:root {
    color-scheme: light;
    font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #382924;
    background: #faf3e0;
    --ink: #382924;
    --red: #c62828;
    --muted: #71635b;
    --line: #dfd4c0;
    --paper: #fffdf8;
}
* { box-sizing: border-box }
body { margin: 0; min-height: 100vh }
a { color: inherit }
img { display: block; max-width: 100% }
button, textarea { font: inherit }
[hidden] { display: none !important }
:focus-visible { outline: 3px solid #a93c20; outline-offset: 4px }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%) }
.wrap, .mast { width: min(1200px, calc(100% - clamp(40px, 9vw, 144px))); margin-inline: auto }
.mast { display: flex; justify-content: space-between; align-items: center; min-height: 90px; border-bottom: 1px solid var(--line) }
.brand { display: inline-flex; gap: 10px; align-items: center; font-size: 1.4rem; font-weight: 800; letter-spacing: -.05em; text-decoration: none; color: #7b1f1f }
.brand img { width: 46px; height: 46px }
.intro { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: center; gap: clamp(36px, 5vw, 88px); padding: clamp(46px, 8vh, 105px) 0 }
h1, h2, h3, p, figure { margin: 0 }
h1, h2, h3 { line-height: 1.12; text-wrap: balance }
h1 { font-size: clamp(3rem, 5.5vw, 5.3rem); font-weight: 750; letter-spacing: -.047em }
h1 span { display: block; color: var(--red) }
.search-panel form { display: flex; align-items: stretch; margin-top: 40px; gap: 8px; flex-wrap: wrap }
.query-box { min-width: 0; display: flex; align-items: center; gap: 11px; flex: 1 1 240px; padding: 0 16px; border: 2px solid #bbab95; border-radius: 12px; background: var(--paper) }
.query-box:focus-within { border-color: var(--red) }
#query:focus { outline: none }
@media (forced-colors: active) { .query-box:focus-within { border-color: Highlight } }
.search-icon { flex: 0 0 20px; width: 20px; height: 20px; stroke: var(--muted); fill: none; stroke-width: 1.8; stroke-linecap: round }
textarea { border: 0; background: transparent; padding: 14px 0; width: 100%; min-width: 0; color: var(--ink); outline: none; line-height: 1.45; field-sizing: content; min-height: 52px; max-height: 9em; resize: none }
textarea::placeholder { color: #70645b; opacity: 1 }
.button { background: var(--red); border: 1px solid var(--red); color: white; font-weight: 700; padding: 14px 26px; border-radius: 12px; cursor: pointer }
.button:hover { background: #a51e20 }
.button:disabled { opacity: .65; cursor: wait }
.cover { position: relative; aspect-ratio: 1.2; overflow: hidden; border-radius: 22px 22px 90px 22px; background: #eadfc7 }
.cover img { width: 100%; height: 100%; object-fit: cover }
.cover a { display: block; height: 100% }
.cover:focus-within { outline: 3px solid var(--red); outline-offset: 4px }
.cover-caption { position: absolute; bottom: 18px; left: 18px; right: 18px; width: fit-content; background: var(--paper); color: var(--ink); padding: 7px 13px; border-radius: 30px; font-size: .87rem; font-weight: 650 }
.searching .intro { display: block; padding: 37px 0 25px }
.searching h1 { font-size: clamp(2.2rem,4vw,3.8rem) }
.searching h1 span { display: inline }
.searching form { max-width: 820px; margin-top: 24px }
.searching .cover { display: none }
.feedback { display: flex; align-items: baseline; flex-wrap: wrap; gap: 12px; color: var(--muted); line-height: 1.5 }
.feedback:has(p:empty):has(button[hidden]) { display: none }
#results { border-top: 1px solid var(--line); margin-top: 12px; padding: 30px 0 60px }
h2 { font-size: clamp(1.55rem,2.4vw,2.05rem); letter-spacing: -.038em }
.cards { margin-top: 22px; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 24px }
.card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; text-decoration: none; background: var(--paper) }
.card:hover { border-color: #b08768 }
.card-img { width: 100%; aspect-ratio: 1.8; background: #ede3cf; object-fit: cover }
.card-copy { display: flex; flex: 1; flex-direction: column; align-items: flex-start; padding: 20px; gap: 10px }
.card h3 { font-size: 1.28rem; letter-spacing: -.025em }
.card p { font-size: 1rem; color: var(--muted); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden }
.meta { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--muted); font-size: .94rem }
.card .meta { margin-top: auto; padding-top: 7px }
.text-btn, .back { border: none; background: transparent; color: #8c2824; font-weight: 650; text-underline-offset: .2em; text-decoration: underline; cursor: pointer; padding: 0 }
.detail { padding-block: 36px 64px }
.detail-hero { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,.82fr); align-items: center; gap: clamp(24px,6vw,80px) }
.detail-hero:not(:has(.photo)) { display: block }
.detail h1 { font-size: clamp(2.4rem,4.2vw,4.2rem) }
.detail .meta { margin-top: 18px }
.detail p, .detail li { line-height: 1.62; white-space: pre-line; overflow-wrap: anywhere }
.detail .description { margin-top: 20px; max-width: 62ch }
.photo { width: 100%; height: auto; border-radius: 14px }
.detail-hero > .photo { max-height: 420px; object-fit: cover }
.columns { margin-top: 42px; display: grid; align-items: start; grid-template-columns: minmax(0,.68fr) minmax(0,1.32fr); gap: clamp(26px,5vw,72px) }
.columns:not(:has(.ingredients)) { grid-template-columns: 1fr }
.ingredients { padding: clamp(18px,3vw,34px); border: 1px solid var(--line); border-radius: 16px; background: var(--paper) }
.ingredients h3 { font-size: 1.12rem; margin-top: 20px }
.ingredients ul { padding: 0; list-style: none }
.ingredients li { padding: 9px 0; border-bottom: 1px dotted var(--line) }
.ingredient-note { color: var(--muted) }
.ingredient-scale { display: flex; flex-wrap: wrap; margin-top: 16px; gap: 4px }
.ingredient-scale button {
    flex: 1 0 auto;
    min-width: 44px;
    min-height: 44px;
    padding: 6px 9px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--paper);
    color: #8c2824;
    font-weight: 650;
    cursor: pointer;
}
.ingredient-scale button:hover { border-color: var(--red) }
.ingredient-scale button[aria-pressed="true"] { background: var(--red); border-color: var(--red); color: white }
.scale-dialog {
    width: min(390px, calc(100% - 32px));
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--paper);
    color: var(--ink);
}
.scale-dialog::backdrop { background: rgb(56 41 36 / .45) }
.scale-dialog h2 { font-size: 1.5rem }
.scale-value { display: block; margin-top: 20px; text-align: center }
.scale-dialog input { display: block; width: 100%; min-height: 44px; margin: 4px 0 12px; accent-color: var(--red) }
.scale-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px }
.scale-actions button { min-height: 44px; padding: 8px 18px }
.instructions section + section { margin-top: 32px }
.instructions h2 { margin-bottom: 16px }
.steps { list-style: decimal; padding-inline-start: 2.2em; margin: 0 }
.steps li { padding-left: 4px; padding-bottom: 20px }
.steps li::marker { font-weight: 750; color: var(--red) }
.detail section .photo, .description-photo { width: auto; max-width: 100%; max-height: 520px; margin-top: 12px }
.nutrition { display: grid; gap: 12px }
.nutrition dt { font-weight: 650 }
.nutrition dd { margin: 3px 0 0; color: var(--muted) }
@media (max-width: 940px) { .cards { grid-template-columns: repeat(2,minmax(0,1fr)) } }
@media (max-width: 730px) {
    .mast { min-height: 70px }
    .brand { font-size: 1.18rem }
    .brand img { width: 39px; height: 39px }
    .intro, .detail-hero, .columns { grid-template-columns: 1fr }
    .intro { padding: 35px 0; gap: 28px }
    h1 { font-size: clamp(2.8rem,10vw,3.8rem) }
    .search-panel form { margin-top: 23px }
    .query-box { flex-basis: 185px; padding-inline: 12px }
    .button { padding-inline: 18px }
    .cover { aspect-ratio: 1.8; border-radius: 16px 16px 58px 16px }
    .cover img { object-position: center 54% }
    .detail { padding-top: 26px }
    .columns { margin-top: 28px }
    .cards { grid-template-columns: 1fr }
}
