/* Gut Feeling: warm paper, confident type and useful food decisions. */
:root {
  color-scheme: light;
  --paper: #f5f3ed;
  --surface: #fffdf8;
  --ink: #252522;
  --muted: #65635c;
  --line: #dcd8cd;
  --red: #ef5b41;
  --accent: #bd3d28;
  --accent-hover: #a33221;
  --butter: #f0e3a1;
  --green: #49694e;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: 'Avenir Next', Avenir, 'Segoe UI', Helvetica, Arial, sans-serif;
  --radius: 20px;
  --page-width: 1280px;
  --shadow: 0 12px 35px #332b1910;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; overflow-x: clip; }
button, input, select, textarea { font: inherit; color: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button, a, select { touch-action: manipulation; }
button { cursor: pointer; border: 0; }
button:disabled { opacity: .45; cursor: not-allowed; }
button, a { transition: background-color .16s, color .16s, border-color .16s, transform .16s; }
a { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.12; text-wrap: balance; }
h1 { font-size: clamp(36px, 4.8vw, 66px); letter-spacing: -.055em; font-weight: 750; }
h2 { font-size: clamp(24px, 2.8vw, 36px); letter-spacing: -.04em; }
h3 { font-size: 20px; letter-spacing: -.025em; }
em { font-family: var(--serif); font-weight: 400; }
img, svg { max-width: 100%; }
[hidden] { display: none !important; }
fieldset { min-width: 0; padding: 0; border: 0; margin: 0; }
legend { font-weight: 650; margin-bottom: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: 10px; left: 16px; z-index: 50; padding: 12px 18px; background: var(--ink); color: white; border-radius: 8px; transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }

/* Shared shell and page rhythm. */
.header { max-width: var(--page-width); margin: 0 auto; padding: 22px 28px; min-height: 96px; display: flex; align-items: center; justify-content: space-between; gap: 22px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-size: 24px; font-weight: 800; letter-spacing: -1.2px; flex-shrink: 0; }
.brand-light { font-weight: 450; }
.brand-mark { width: 38px; height: 39px; border-radius: 12px; background: var(--red); color: var(--ink); font-family: var(--serif); font-size: 38px; font-weight: 700; line-height: 35px; text-align: center; padding-right: 3px; letter-spacing: -3px; }
.header nav { display: flex; align-items: center; gap: 3px; min-width: 0; padding: 4px; background: #eae7df; border-radius: 99px; }
.nav { padding: 10px 13px; background: transparent; border-radius: 99px; font-size: 13px; font-weight: 650; min-height: 44px; white-space: nowrap; }
.nav:hover { background: #ffffff6b; }
.nav[aria-current="page"], .nav.active { background: var(--surface); box-shadow: 0 2px 5px #2525220a; }
.settings-trigger { display: flex; align-items: center; gap: 8px; padding: 10px 0 10px 8px; min-height: 44px; background: transparent; font-size: 13px; font-weight: 650; }
.settings-trigger svg { width: 21px; height: 21px; }
.settings-trigger svg circle { fill: var(--paper); }
#app { max-width: var(--page-width); min-height: calc(100svh - 187px); margin: auto; padding: 42px 28px 64px; }
#app > section + section { margin-top: 48px; }
.page-head { display: block; max-width: 850px; margin-bottom: 32px; }
.page-head h1 { margin-top: 13px; }
.page-head p { max-width: 670px; margin-top: 16px; }
.eyebrow { font-size: 11px; line-height: 1.5; font-weight: 750; letter-spacing: .13em; text-transform: uppercase; }
.muted { color: var(--muted); }
.lead { font-size: clamp(16px, 1.6vw, 19px); color: var(--muted); line-height: 1.65; max-width: 610px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.section-head h2 { font-size: 26px; }
.section-head > p, .section-head > span { color: var(--muted); font-size: 13px; }
.footer { max-width: var(--page-width); margin: auto; border-top: 1px solid var(--line); padding: 23px 28px 28px; display: flex; justify-content: space-between; gap: 16px; color: var(--muted); font-size: 11px; }

/* Visible labels and generous targets, including the quiet buttons. */
.btn { display: inline-flex; justify-content: center; align-items: center; gap: 9px; padding: 13px 23px; min-height: 48px; border: 1px solid transparent; border-radius: 99px; font-size: 14px; font-weight: 650; line-height: 1.3; text-decoration: none; text-align: center; }
.btn.primary, .primary { background: var(--accent); color: #fffdf8; }
.btn.primary:hover, .primary:hover { background: var(--accent-hover); }
.btn.secondary { background: var(--surface); border-color: var(--line); }
.btn.secondary:hover { background: #eee8d9; border-color: #c7beab; }
.btn.ghost { background: transparent; border-color: var(--line); }
.btn.ghost:hover { background: #eae6dc; }
.btn.danger { color: #962e20; background: #f9e7e0; border-color: #e0bcb0; }
.btn.small { padding: 10px 16px; min-height: 44px; font-size: 12px; }
.btn svg { width: 18px; height: 18px; }
.button-row { display: flex; align-items: center; gap: 11px; flex-wrap: wrap; margin-top: 24px; }
.text-button, .inline-link, .export-link { display: inline-flex; align-items: center; min-height: 44px; padding: 6px 0; background: transparent; color: var(--ink); font-size: 13px; text-decoration: underline; text-underline-offset: 4px; }
.text-button:hover, .inline-link:hover, .export-link:hover { color: var(--accent); }

/* Home: an editorial cover with a useful action. */
.hero { display: grid; grid-template-columns: 1.1fr 1fr; align-items: center; gap: 70px; padding: 12px 0 44px; }
.hero-copy { max-width: 600px; }
.hero-copy h1 { font-size: clamp(48px, 6.2vw, 86px); line-height: .99; letter-spacing: -.065em; margin: 24px 0; }
.hero-copy h1 em { color: var(--accent); }
.hero-copy .lead { max-width: 460px; }
.hero-copy .button-row { margin-top: 28px; }
.hero-copy .method-note { max-width: 430px; }
.hero-visual { position: relative; padding: 13px 16px 18px 0; width: 100%; min-width: 0; isolation: isolate; }
.hero-visual::before { content: ''; position: absolute; inset: 15px 0 10px 10px; border-radius: 28px; background: #e6dfc9; border: 1px solid #d5ccb5; transform: rotate(4deg); z-index: -1; }
.hero-dish { position: relative; border-radius: 26px; overflow: hidden; aspect-ratio: .97; background: #eae4d2; box-shadow: var(--shadow); }
.hero-dish > .food-image { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-caption { position: absolute; left: 25px; right: 25px; bottom: 25px; background: var(--surface); border-radius: 15px; padding: 16px 19px; box-shadow: 0 4px 20px #0000000d; }
.hero-caption h2, .hero-caption h3 { font-size: 25px; margin-top: 5px; }
.hero-caption p { color: var(--muted); font-size: 12px; margin-top: 5px; }
.hero-number { position: absolute; top: 29px; left: 17px; z-index: 2; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; max-width: calc(100% - 58px); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 15px; font-size: 28px; line-height: 1; font-weight: 750; letter-spacing: -.04em; }
.hero-number span { font-size: 8px; line-height: 1.4; font-weight: 750; letter-spacing: .1em; }
.mode-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.mode-card { position: relative; display: flex; flex-direction: column; align-items: flex-start; border: 1px solid var(--line); border-radius: var(--radius); padding: 27px; background: transparent; text-align: left; }
.mode-card:nth-child(2) { background: var(--butter); border-color: #ddd090; }
.mode-card h2, .mode-card h3 { margin: 17px 0 12px; font-size: 27px; }
.mode-card p { color: var(--muted); font-size: 14px; }
.mode-card .btn, .mode-card .text-button { margin-top: 24px; }
.mode-number { display: inline-block; color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: .11em; }
.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 23px 0; gap: 24px; }
.stat { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.stat strong { font-size: 34px; font-weight: 700; line-height: 1.1; letter-spacing: -.06em; }
.stat span, .stat p { font-size: 12px; color: var(--muted); }
.panel { padding: 27px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; }
.panel > h2 { font-size: 25px; }
.panel > h3 { margin-bottom: 14px; }
.panel > p { margin-top: 13px; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.three-col { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }

/* The swipe surface stays separate from normal page scroll. */
.flow-layout { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(300px, 430px) minmax(180px, 1fr); gap: 48px; align-items: start; }
.flow-intro { padding-top: 25px; }
.flow-intro h1 { font-size: clamp(39px, 4.3vw, 60px); margin: 20px 0; }
.flow-intro h1 em { color: var(--accent); }
.flow-intro p { font-size: 14px; color: var(--muted); margin-top: 15px; }
.flow-intro .eyebrow { font-size: 11px; color: var(--ink); }
.flow-aside { padding-top: 25px; }
.flow-aside h2 { margin-top: 16px; font-size: 28px; }
.flow-aside p { font-size: 13px; margin-top: 12px; color: var(--muted); }
.flow-aside .stat-grid { margin-top: 26px; gap: 12px; }
.flow-aside .stat strong { font-size: 27px; }
.swipe-area { min-width: 0; width: 100%; max-width: 460px; margin: auto; }
.round-meta { display: flex; justify-content: space-between; gap: 12px; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; font-weight: 650; margin-bottom: 12px; }
.progress-track { height: 4px; background: #dfd9ca; border-radius: 4px; overflow: hidden; margin-bottom: 20px; }
.progress-track > span, .progress-track > div { display: block; height: 100%; background: var(--accent); transition: width .2s; }
.food-card { position: relative; border-radius: 24px; background: var(--surface); border: 1px solid #d9d2c1; box-shadow: var(--shadow); overflow: hidden; }
#swipe-card { cursor: grab; touch-action: none; user-select: none; transform-origin: 50% 80%; }
.food-card.dragging { cursor: grabbing; transition: none !important; }
.food-visual { height: 285px; position: relative; overflow: hidden; background: #e9e4d6; }
.food-visual > .food-image { position: absolute; inset: 0; width: 100%; height: 100%; }
.food-copy { padding: 24px 25px 25px; }
.food-origin { font-size: 10px; letter-spacing: .13em; font-weight: 750; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.food-name, .food-copy h2 { font-size: 29px; letter-spacing: -.045em; line-height: 1.06; }
.food-description, .food-copy > p { font-size: 14px; line-height: 1.6; color: var(--muted); margin-top: 11px; }
.food-meta { display: flex; flex-wrap: wrap; gap: 8px 15px; font-size: 12px; color: var(--muted); margin-top: 15px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.tags > span, .pill { display: inline-flex; align-items: center; border: 1px solid #d9d1bd; padding: 4px 9px; border-radius: 99px; font-size: 11px; line-height: 1.4; background: #f5f0e4; color: #5c5444; }
.food-info { position: absolute; top: 14px; right: 14px; z-index: 2; min-width: 44px; min-height: 44px; padding: 9px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 50%; font-family: var(--serif); font-size: 20px; font-style: italic; }
.swipe-stamp { position: absolute; z-index: 3; top: 80px; left: 25px; right: 25px; padding: 15px; border: 3px solid currentColor; border-radius: 8px; background: var(--surface); color: var(--accent); text-align: center; font-weight: 800; font-size: 24px; opacity: 0; pointer-events: none; transform: rotate(-8deg); }
.actions { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.action { display: inline-flex; justify-content: center; align-items: center; flex-direction: column; gap: 3px; min-height: 64px; min-width: 82px; padding: 12px 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); font-size: 12px; font-weight: 650; line-height: 1.3; }
.action span:first-child:not(:only-child), .action b { font-size: 24px; font-weight: 500; }
.action:hover:not(:disabled) { transform: translateY(-3px); }
.action.reject { background: var(--surface); }
.action.love { background: var(--butter); border-color: #d9ca85; color: #514416; }
.action.accept { background: var(--accent); border-color: var(--accent); color: white; }
.shortcut { margin-top: 16px; color: var(--muted); text-align: center; font-size: 11px; }
.shortcut kbd { font: inherit; border: 1px solid var(--line); padding: 1px 5px; border-radius: 4px; }
.card-empty { min-height: 370px; border: 1px dashed #c2b9a4; border-radius: 24px; padding: 36px 27px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; background: #eee8d8; }
.card-empty h2 { font-size: 38px; }
.card-empty p { margin-top: 16px; color: var(--muted); }

/* Atlas crops keep each dish in proportion at every card size. */
.food-media { position: relative; overflow: hidden; background: #e9e4d6; }
.dish-photo { position: absolute; inset: 0; display: block; width: 100%; height: 100%; overflow: hidden; opacity: 0; }
.food-media[data-photo-state="ready"] .dish-photo { opacity: 1; }
.photo-status { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 20px; color: var(--muted); font-size: 12px; text-align: center; }
.food-media[data-photo-state="ready"] .photo-status { display: none; }
.food-media[data-photo-state="failed"] .photo-status { padding-bottom: 62px; }
.photo-retry { position: absolute; top: calc(50% + 5px); left: 50%; transform: translateX(-50%); min-height: 44px; padding: 10px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font-size: 12px; white-space: nowrap; }
.photo-retry:hover { background: var(--paper); }
.photo-retry[hidden] { display: none; }

/* Profile and explanations. */
.trait-list { display: flex; flex-direction: column; gap: 20px; margin-top: 24px; }
.trait-label { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; font-size: 13px; margin-bottom: 8px; }
.trait-label span:last-child { color: var(--muted); font-size: 12px; }
.trait-track { height: 6px; border-radius: 99px; background: #e4decf; overflow: hidden; }
.trait-track > span { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width .25s; }
.trait.unknown .trait-track { background: repeating-linear-gradient(90deg, #d9d2c1 0 5px, transparent 5px 9px); }
.evidence { font-size: 11px; line-height: 1.55; color: var(--muted); margin-top: 7px; }
.privacy-note, .method-note { color: var(--muted); font-size: 12px; line-height: 1.65; margin-top: 22px; }
.list-row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.list-row:last-child { border-bottom: 0; }
.list-row span:last-child { color: var(--muted); font-size: 12px; }
.list-row small { display: block; font-size: 11px; line-height: 1.5; color: var(--muted); margin-top: 3px; }
.history-list { display: flex; flex-direction: column; }
.history-item { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 17px 0; border-bottom: 1px solid var(--line); }
.history-item p { font-size: 12px; color: var(--muted); }
.history-item h3 { font-size: 16px; line-height: 1.3; }

/* Catalogue and result tiles. */
.food-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.dish-tile { display: flex; flex-direction: column; min-width: 0; position: relative; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); overflow: hidden; }
.dish-tile > button:not(.btn) { border: 0; text-align: left; background: transparent; padding: 0; }
.tile-visual { position: relative; aspect-ratio: 1.3; overflow: hidden; background-color: #e9e4d6; }
.tile-copy { padding: 18px; display: flex; flex-direction: column; flex: 1; }
.tile-copy h3 { font-size: 18px; line-height: 1.2; }
.tile-copy p { font-size: 12px; color: var(--muted); margin-top: 8px; }
.tile-copy .tags { margin-top: 12px; }
.tile-copy .tags span { font-size: 10px; }
.tile-meta { color: var(--muted); font-size: 11px; margin-top: 9px; display: flex; flex-wrap: wrap; gap: 7px; }
.tile-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 17px; }
.tile-actions .btn { flex: 1; min-width: 90px; padding: 10px 12px; }
.rank { position: absolute; top: 12px; left: 12px; min-width: 32px; height: 32px; padding: 0 9px; border-radius: 99px; background: var(--surface); color: var(--ink); font-size: 12px; font-weight: 700; display: inline-grid; place-items: center; z-index: 1; }
.match-reasons { padding-left: 16px; color: var(--green); font-size: 12px; line-height: 1.6; margin: 12px 0 0; }
.match-reasons li + li { margin-top: 4px; }
.tile-copy p.match-reasons { padding-left: 0; color: var(--green); }
.selection-panel { background: #ebe9d6; border: 1px solid #d8d6ba; border-radius: 20px; padding: 26px; margin-bottom: 28px; }
.selection-panel h2 { margin: 8px 0 11px; }
.selection-panel .button-row { margin-top: 19px; }
.selection-summary { font-size: 13px; line-height: 1.65; color: var(--muted); margin-top: 18px; }
.session-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.session-head h1 { font-size: 30px; }
.session-head p { color: var(--muted); font-size: 13px; margin-top: 6px; }
.pass-screen { max-width: 680px; margin: 28px auto; border-radius: 28px; border: 1px solid #d9cc8c; background: var(--butter); padding: 56px; text-align: center; }
.pass-screen h1, .pass-screen h2 { margin: 21px 0; font-size: 47px; }
.pass-screen p { color: #635936; }
.pass-screen .button-row { justify-content: center; margin-top: 30px; }
.results-head { margin-bottom: 30px; }
.results-head h1 { margin-top: 15px; }
.results-head p { margin-top: 15px; max-width: 670px; color: var(--muted); }
.results-head + .food-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* Forms retain native controls and visible labels. */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 22px; }
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field-label, .field > label, label.field { font-size: 13px; font-weight: 650; }
.field small { font-weight: 400; color: var(--muted); font-size: 12px; }
input:not([type="radio"]):not([type="checkbox"]), select, textarea { width: 100%; min-width: 0; min-height: 48px; padding: 12px 14px; border: 1px solid #cfc8b8; border-radius: 10px; background: var(--surface); font-size: 16px; line-height: 1.4; }
input::placeholder, textarea::placeholder { color: #747064; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); width: 18px; height: 18px; flex-shrink: 0; }
.choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 11px; }
.choice { display: flex; align-items: center; justify-content: flex-start; gap: 9px; min-height: 52px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-size: 13px; line-height: 1.4; text-align: left; cursor: pointer; }
.choice:hover { background: #f0eadb; }
.choice:has(input:checked), .choice[aria-pressed="true"], .choice.active { border-color: var(--accent); background: #f9e6df; box-shadow: inset 0 0 0 1px var(--accent); }
.choice input { margin: 0; }
.choice strong { display: block; }
.choice span { min-width: 0; }
.choice small { display: block; font-size: 11px; color: var(--muted); margin-top: 3px; }
.check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 18px; margin-top: 12px; }
.check-option { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 13px; cursor: pointer; }
.check-option input { margin: 0; }
.filters { display: flex; align-items: flex-end; gap: 15px; flex-wrap: wrap; }
.filters .field { flex: 1 1 150px; }
.library-toolbar { display: grid; grid-template-columns: minmax(200px, 1fr) minmax(170px, 220px) auto; gap: 18px; align-items: flex-end; margin-bottom: 25px; }
.library-toolbar .filters { flex-wrap: nowrap; }
.search-input { background: var(--surface); }
.rating-buttons { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.rating-buttons button { min-height: 44px; min-width: 70px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 12px; }
.rating-buttons button[aria-pressed="true"], .rating-buttons .selected { border-color: var(--accent); background: #f9e6df; color: var(--ink); box-shadow: inset 0 0 0 1px var(--accent); }

/* Feedback and recovery states. */
.notice { padding: 15px 18px; background: #eeeadc; border: 1px solid #d8d0bc; border-radius: 12px; font-size: 13px; line-height: 1.6; margin: 20px 0; }
.notice.error, .error { background: #f8e7e1; color: #823426; border-color: #dbb0a2; }
.notice.success, .success { background: #e7eee1; color: #35533b; border-color: #bccdb2; }
.empty-state { grid-column: 1 / -1; padding: 44px 30px; text-align: center; border: 1px dashed #bfb59f; border-radius: 18px; background: #efeadd; }
.empty-state h2 { font-size: 30px; }
.empty-state p { margin: 14px auto 0; max-width: 530px; color: var(--muted); }
.empty-state .button-row { justify-content: center; }
.toast { position: fixed; bottom: 25px; left: 50%; transform: translate(-50%, 16px); width: max-content; max-width: calc(100vw - 32px); z-index: 40; border-radius: 15px; padding: 14px 21px; background: var(--ink); color: var(--surface); font-size: 13px; line-height: 1.5; box-shadow: 0 5px 20px #0002; text-align: center; pointer-events: none; opacity: 0; transition: opacity .18s, transform .18s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
dialog { max-width: 620px; width: calc(100% - 32px); max-height: calc(100svh - 40px); padding: 33px; border: 1px solid var(--line); border-radius: 23px; background: var(--paper); color: var(--ink); box-shadow: 0 20px 100px #0003; }
dialog::backdrop { background: #24231d80; backdrop-filter: blur(4px); }
.dialog-close { position: absolute; top: 12px; right: 12px; min-width: 44px; min-height: 44px; border-radius: 50%; background: var(--paper); border: 1px solid var(--line); font-size: 28px; line-height: 1; z-index: 3; }
.dialog-close:hover { background: #e8e1d1; }
#dialog-body > .eyebrow:first-child { padding-right: 35px; }
dialog h2 { font-size: 32px; margin: 15px 28px 16px 0; }
dialog h3 { margin: 25px 0 12px; }
dialog p { font-size: 14px; color: var(--muted); line-height: 1.7; margin-top: 13px; }
dialog ul, dialog ol { padding-left: 22px; font-size: 14px; color: var(--muted); line-height: 1.7; }
dialog li + li { margin-top: 10px; }
dialog .food-visual, dialog .tile-visual { height: 260px; aspect-ratio: auto; border-radius: 14px; margin: 12px 0 20px; }
dialog .button-row { margin-top: 24px; }
dialog .field { margin-top: 15px; }
dialog .form-grid .field { margin-top: 0; }

/* Complete flows and the spacing between their different content types. */
.swipe-tools { justify-content: space-between; gap: 20px; margin-top: 9px; }
.swipe-tools .text-button { font-size: 12px; }
.swipe-area > .btn { display: flex; width: max-content; max-width: 100%; margin: 20px auto 0; }
.feedback-panel { margin-top: 32px; background: #eeeadc; }
.feedback-panel h2 { margin-top: 11px; font-size: 27px; }
.feedback-panel .method-note { max-width: 720px; }
.steps { list-style: none; counter-reset: dinner-steps; padding: 0; margin: 29px 0 0; }
.steps li { counter-increment: dinner-steps; position: relative; padding: 0 0 25px 46px; }
.steps li::before { content: counter(dinner-steps, decimal-leading-zero); position: absolute; left: 0; top: 0; width: 29px; height: 29px; display: grid; place-items: center; background: #eee7d5; border: 1px solid var(--line); border-radius: 50%; font-size: 10px; font-weight: 700; }
.steps strong { font-size: 15px; }
.steps p { font-size: 13px; color: var(--muted); margin-top: 6px; }
.pass-screen > .btn { margin-top: 25px; }
.pass-screen > .text-button { display: flex; width: max-content; max-width: 100%; margin: 13px auto 0; }
.stat-grid + .two-col { margin-top: 28px; }
.associations { margin-top: 24px; }
.associations + .section-head { margin-top: 40px; }
.associations .panel h2 { font-size: 23px; }
.selection-panel > .text-button { display: flex; width: max-content; max-width: 100%; }
.selection-panel > .text-button + .text-button { margin-top: 0; }
#library-results > .method-note { margin: 0 0 20px; }
#library-results > .btn { margin-top: 24px; }
.dialog-visual { margin-top: 11px; }
.dialog-visual > .tile-visual { margin-top: 0; }
#preferences-form > .btn { margin-top: 22px; }
#setup-error { padding: 13px 16px; border: 1px solid #dbb0a2; border-radius: 10px; margin-top: 20px; font-size: 13px; }
dialog hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }

@media (max-width: 1120px) {
  .header { gap: 15px; }
  .settings-trigger span { display: none; }
  .settings-trigger { width: 44px; padding: 10px; justify-content: center; }
  .nav { padding: 10px 11px; font-size: 12px; }
  .flow-layout { gap: 30px; grid-template-columns: minmax(160px, 1fr) minmax(300px, 390px) minmax(160px, 1fr); }
  .flow-intro h1 { font-size: 47px; }
  .hero { gap: 40px; }
  .food-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
}
@media (max-width: 900px) {
  .header { flex-wrap: wrap; padding-top: 18px; padding-bottom: 13px; gap: 14px; }
  .header nav { order: 3; width: 100%; justify-content: center; background: transparent; border-top: 1px solid var(--line); border-radius: 0; padding: 11px 0 0; gap: 7px; }
  .nav { font-size: 13px; }
  .nav[aria-current="page"], .nav.active { background: #e5e0d3; box-shadow: none; }
  .settings-trigger span { display: inline; }
  .settings-trigger { width: auto; padding: 10px 0; }
  #app { padding-top: 30px; }
  .hero { gap: 28px; }
  .hero-copy h1 { font-size: 59px; }
  .hero-copy .btn { font-size: 12px; padding: 13px 18px; }
  .hero-caption { left: 17px; right: 17px; bottom: 17px; padding: 14px; }
  .hero-caption h2, .hero-caption h3 { font-size: 21px; }
  .hero-number { left: 17px; top: 29px; }
  .flow-layout { grid-template-columns: minmax(180px, 1fr) minmax(300px, 430px); gap: 34px; }
  .flow-aside { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 0 35px; padding-top: 25px; border-top: 1px solid var(--line); }
  .flow-aside .trait-list { grid-column: 2; grid-row: 1 / span 5; margin-top: 0; }
  .mode-card { padding: 22px; }
  .mode-card h2, .mode-card h3 { font-size: 24px; }
  .mode-card p { font-size: 13px; }
  .two-col { gap: 20px; }
  .three-col { grid-template-columns: 1fr; }
  .library-toolbar { grid-template-columns: 1fr; }
  .library-toolbar .filters { flex-wrap: wrap; }
  .choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer { font-size: 10px; }
}
@media (max-width: 640px) {
  .header { padding: 16px 20px 8px; gap: 11px; }
  .brand { font-size: 22px; }
  .brand-mark { width: 34px; height: 35px; font-size: 34px; line-height: 31px; border-radius: 10px; }
  .settings-trigger { font-size: 12px; gap: 6px; }
  .header nav { justify-content: flex-start; overflow-x: auto; scrollbar-width: thin; padding: 9px 2px 7px; gap: 3px; }
  .nav { flex-shrink: 0; padding: 10px 12px; font-size: 12px; }
  #app { padding: 27px 20px 44px; }
  #app > section + section { margin-top: 34px; }
  .page-head { display: block; margin-bottom: 25px; }
  .page-head > .btn, .page-head > .button-row { margin-top: 20px; }
  .page-head h1 { font-size: 42px; margin-top: 12px; }
  .page-head p { margin-top: 14px; }
  .lead { font-size: 16px; }
  .eyebrow { font-size: 10px; }
  .hero { grid-template-columns: 1fr; gap: 24px; padding: 0 0 15px; }
  .hero-copy h1 { font-size: clamp(50px, 12vw, 69px); margin: 20px 0; }
  .hero-copy .lead { max-width: 440px; }
  .hero-copy .button-row { margin-top: 22px; }
  .hero-copy .btn { font-size: 14px; }
  .hero-copy .method-note { margin-top: 15px; }
  .hero-visual { max-width: 420px; margin: auto; padding-right: 12px; }
  .hero-dish { aspect-ratio: 1.24; border-radius: 21px; }
  .hero-caption { max-width: 265px; }
  .hero-number { font-size: 24px; border-radius: 11px; padding: 10px 12px; }
  .hero-number span { font-size: 7px; }
  .mode-grid { grid-template-columns: 1fr; gap: 14px; }
  .mode-card { padding: 23px; }
  .mode-card h2, .mode-card h3 { font-size: 27px; margin-top: 13px; }
  .mode-card p { font-size: 14px; }
  .mode-card .btn, .mode-card .text-button { margin-top: 17px; }
  .section-head { align-items: flex-start; flex-wrap: wrap; gap: 10px; margin-bottom: 17px; }
  .section-head h2 { font-size: 24px; }
  .stat-grid { gap: 15px; padding: 20px 0; }
  .stat strong { font-size: 29px; }
  .stat span, .stat p { font-size: 11px; }
  .panel { padding: 23px; }
  .two-col, .three-col { grid-template-columns: 1fr; gap: 18px; }
  .flow-layout { display: flex; flex-direction: column; gap: 14px; }
  .flow-intro { position: relative; width: 100%; padding-top: 0; }
  .flow-intro h1 { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
  .flow-intro p { font-size: 12px; margin-top: 6px; max-width: 440px; }
  .flow-intro > .eyebrow { font-size: 10px; margin-top: 0; }
  .flow-intro > .lead { font-size: 15px; line-height: 1.4; color: var(--ink); }
  .flow-intro > p:not(.eyebrow):not(.lead):not(.mode-explanation) { display: none; }
  .flow-intro .selection-summary { margin-top: 7px; font-size: 11px; line-height: 1.4; }
  .flow-intro > .text-button { min-height: 44px; padding: 5px 0; font-size: 11px; }
  .flow-intro .button-row { margin-top: 7px; }
  .flow-aside { display: block; width: 100%; padding-top: 26px; }
  .flow-aside .trait-list { margin-top: 24px; }
  .food-card { border-radius: 20px; }
  .food-visual { height: 200px; }
  .food-copy { padding: 17px 20px; }
  .food-name, .food-copy h2 { font-size: 27px; }
  .food-origin { margin-bottom: 6px; }
  .food-description, .food-copy > p { font-size: 13px; line-height: 1.5; margin-top: 8px; }
  .food-copy .tags { margin-top: 10px; }
  .food-copy .tags > span { font-size: 10px; padding: 3px 8px; }
  .food-copy .food-meta { margin-top: 9px; font-size: 10px; }
  .actions { gap: 9px; margin-top: 15px; }
  .action { min-width: 76px; min-height: 63px; padding: 10px 12px; font-size: 11px; }
  .shortcut { font-size: 11px; }
  .card-empty { min-height: 300px; }
  .food-grid, .results-head + .food-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
  .tile-visual { aspect-ratio: 1.1; }
  .tile-copy { padding: 13px; }
  .tile-copy h3 { font-size: 16px; }
  .tile-copy p { font-size: 11px; }
  .tile-actions { gap: 7px; }
  .tile-actions .btn { min-width: 0; width: 100%; flex-basis: 100%; font-size: 11px; }
  .tile-copy .tags { gap: 4px; }
  .tile-copy .tags span { font-size: 9px; padding: 3px 6px; }
  .match-reasons { font-size: 11px; padding-left: 14px; }
  .rank { top: 9px; left: 9px; min-width: 29px; height: 29px; font-size: 10px; }
  .form-grid { grid-template-columns: 1fr; gap: 17px; }
  .choice-grid { gap: 8px; }
  .choice { font-size: 12px; padding: 12px; }
  .selection-panel { padding: 23px; }
  .session-head { align-items: flex-start; flex-wrap: wrap; gap: 13px; }
  .session-head h1 { font-size: 27px; }
  .pass-screen { padding: 35px 23px; margin: 15px auto; border-radius: 20px; }
  .pass-screen h1, .pass-screen h2 { font-size: 38px; }
  .history-item { gap: 14px; align-items: flex-start; flex-wrap: wrap; }
  .history-item .rating-buttons { margin-top: 0; }
  .empty-state { padding: 32px 23px; }
  .footer { padding: 20px; flex-direction: column; gap: 8px; font-size: 10px; }
  dialog { padding: 25px; width: calc(100% - 24px); max-height: calc(100svh - 24px); border-radius: 18px; }
  dialog h2 { font-size: 29px; }
  dialog .food-visual, dialog .tile-visual { height: 220px; }
  dialog .button-row .btn { flex: 1 1 130px; }
  .toast { bottom: 16px; font-size: 12px; padding: 12px 18px; }
}
@media (max-width: 360px) {
  .header { padding-left: 16px; padding-right: 16px; }
  #app { padding-left: 16px; padding-right: 16px; }
  .settings-trigger span { display: none; }
  .settings-trigger { min-width: 44px; justify-content: center; }
  .hero-copy h1 { font-size: 49px; }
  .food-visual { height: 185px; }
  .food-copy { padding: 16px 18px; }
  .food-name, .food-copy h2 { font-size: 26px; }
  .actions { gap: 7px; }
  .action { min-width: 70px; padding: 10px; }
  .food-grid { gap: 12px 9px; }
  .tile-copy { padding: 11px; }
  .tile-copy h3 { font-size: 15px; }
  .check-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
@media (forced-colors: active) {
  .btn, .action, .choice, .nav, .settings-trigger, .food-info, .dialog-close { border: 1px solid ButtonText; }
  .nav[aria-current="page"], .choice[aria-pressed="true"], .rating-buttons button[aria-pressed="true"] { outline: 2px solid Highlight; outline-offset: -3px; }
  .trait-track { border: 1px solid CanvasText; }
  .trait-track > span, .progress-track > span { background: Highlight; }
  .food-media { border: 1px solid CanvasText; }
}
