/* The Grill System. One committed look: black steel, Chargers powder blue, off-white paper. */
:root {
  color-scheme: light;
  --ink: #15181d;          /* nav, hero band, thermometer card */
  --iron: #242a33;         /* secondary dark surface */
  --iron-line: #3a424e;    /* rules on dark */
  --paper: #f1f2ee;        /* page ground, cool off-white */
  --card: #fbfbf9;         /* raised sheet on paper */
  --line: #d3d6d0;         /* rules on paper */
  --line-strong: #9aa1a9;
  --text: #1a1d22;
  --muted: #5d6570;
  --blue: #0080c6;         /* Chargers powder blue: buttons, fills, active states */
  --blue-deep: #00629a;    /* the same blue cut deeper for text on paper, and hover */
  --blue-wash: #dcf0fb;    /* selected chip on paper */
  --blue-lite: #62c3f3;    /* powder blue for text/values on black */
  --gold: #ffc20e;         /* the jersey-number outline: hot values on black only */
  --amber: #b25b09;
  --amber-wash: #fbeedd;
  --green: #2e7a4b;
  --on-ink: #f4f5f2;
  --on-ink-muted: #aab2bd;
  --display: "Barlow Condensed", "Arial Narrow", "Helvetica Neue", Impact, sans-serif;
  --body: "Barlow", "Helvetica Neue", Arial, sans-serif;
  --r: 3px;
  --pad: clamp(16px, 3vw, 28px);
  --max: 1100px;
  --tab-h: 62px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--text);
  font-family: var(--body); font-size: 16px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.02; margin: 0; text-wrap: balance; letter-spacing: .005em; }
h1 { font-size: clamp(2.4rem, 7vw, 4.2rem); font-weight: 800; text-transform: uppercase; }
h2 { font-size: clamp(1.6rem, 3.6vw, 2.2rem); font-weight: 700; text-transform: uppercase; }
h3 { font-size: 1.35rem; font-weight: 700; }
p { margin: 0; }
a { color: var(--blue-deep); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--blue); color: #fff; padding: 8px 12px; z-index: 50; }
.skip:focus { left: 8px; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }

/* eyebrow labels: the stencil voice */
.lbl { font-family: var(--display); font-weight: 700; font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.lbl.on-ink { color: var(--on-ink-muted); }
.lbl.blue { color: var(--blue-deep); }

/* ---------- top bar ---------- */
.topbar {
  background: var(--ink); color: var(--on-ink);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 var(--pad); height: 64px; position: sticky; top: 0; z-index: 20;
  border-bottom: 3px solid var(--blue);
}
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; min-width: 0; }
.brand-mark { font-family: var(--display); font-weight: 800; font-size: 1.1rem; letter-spacing: .05em; background: var(--blue); color: #fff; width: 40px; height: 40px; display: grid; place-items: center; border-radius: var(--r); flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.brand-text strong { font-family: var(--display); font-weight: 700; font-size: 1.25rem; text-transform: uppercase; letter-spacing: .03em; }
.brand-text small { font-size: .78rem; color: var(--on-ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topnav { display: flex; gap: 4px; }
.topnav a { color: var(--on-ink-muted); text-decoration: none; font-family: var(--display); font-weight: 700; font-size: 1.05rem; letter-spacing: .06em; text-transform: uppercase; padding: 8px 12px; border-bottom: 3px solid transparent; }
.topnav a:hover { color: var(--on-ink); }
.topnav a.active { color: var(--on-ink); border-bottom-color: var(--blue); }
.nav-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 4px; border-radius: 10px; background: var(--blue); color: #fff; font-family: var(--body); font-size: .75rem; font-weight: 700; vertical-align: 2px; }

/* ---------- mobile tab bar ---------- */
.tabbar { display: none; }
@media (max-width: 760px) {
  .topnav { display: none; }
  .tabbar {
    display: grid; grid-template-columns: repeat(4, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; height: calc(var(--tab-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--ink); border-top: 1px solid var(--iron-line);
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--on-ink-muted); text-decoration: none; font-family: var(--display); font-weight: 700; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; }
  .tabbar a svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar a.active { color: #fff; }
  .tabbar a.active svg { stroke: var(--blue-lite); }
  body { padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom)); }
}

/* ---------- page frame ---------- */
.app { max-width: var(--max); margin: 0 auto; padding: var(--pad); display: grid; gap: clamp(24px, 4vw, 40px); }
.section { display: grid; gap: 14px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.section-head p { color: var(--muted); max-width: 60ch; }

/* ---------- black band (start panel) ---------- */
.band { background: var(--ink); color: var(--on-ink); border-radius: var(--r); padding: clamp(20px, 4vw, 40px); display: grid; gap: 24px; grid-template-columns: 1.1fr 1fr; align-items: start; position: relative; overflow: hidden; }
.band::after { content: ""; position: absolute; inset: auto -40px -60px auto; width: 260px; height: 260px; border: 26px solid var(--iron); border-radius: 50%; opacity: .7; pointer-events: none; }
.band-copy { display: grid; gap: 14px; align-content: start; position: relative; z-index: 1; }
.band-copy p { color: var(--on-ink-muted); max-width: 42ch; font-size: 1.05rem; }
.band-stats { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 6px; }
.band-stats div { display: grid; }
.band-stats b { font-family: var(--display); font-size: 2rem; font-weight: 800; color: var(--blue-lite); line-height: 1; }
.band-stats span { font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--on-ink-muted); }
@media (max-width: 860px) { .band { grid-template-columns: 1fr; } .band::after { display: none; } }

/* ---------- forms / controls ---------- */
.form { background: var(--card); color: var(--text); border-radius: var(--r); padding: clamp(16px, 3vw, 22px); display: grid; gap: 14px; position: relative; z-index: 1; border: 1px solid var(--line); }
.field { display: grid; gap: 6px; }
.field select, .field input[type="number"], .field input[type="text"], .field input[type="email"], .field input[type="search"] {
  width: 100%; height: 46px; padding: 0 12px; border: 2px solid var(--line-strong); border-radius: var(--r); background: #fff; font-weight: 500;
}
.field select:focus, .field input:focus { border-color: var(--blue); outline: none; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 420px) { .row2 { grid-template-columns: 1fr; } }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border: 2px solid var(--line-strong); border-radius: var(--r); overflow: hidden; background: #fff; }
.seg button { border: 0; background: transparent; padding: 10px 6px; font-family: var(--display); font-weight: 700; font-size: 1rem; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.seg button + button { border-left: 2px solid var(--line-strong); }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.seg.small button { padding: 6px 8px; font-size: .9rem; }
.stepper { display: grid; grid-template-columns: 46px 1fr 46px; border: 2px solid var(--line-strong); border-radius: var(--r); overflow: hidden; background: #fff; }
.stepper button { border: 0; background: var(--paper); font-size: 1.4rem; font-weight: 700; }
.stepper input { border: 0; text-align: center; font-family: var(--display); font-weight: 800; font-size: 1.5rem; min-width: 0; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1.5px solid var(--line-strong); background: #fff; border-radius: var(--r); padding: 5px 10px; font-size: .85rem; font-weight: 600; color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--blue-wash); border-color: var(--blue); color: var(--blue-deep); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 2px solid var(--ink); background: var(--ink); color: #fff; border-radius: var(--r); padding: 12px 18px; font-family: var(--display); font-weight: 700; font-size: 1.1rem; letter-spacing: .06em; text-transform: uppercase; text-decoration: none; min-height: 46px; }
.btn.primary { background: var(--blue); border-color: var(--blue); }
.btn.primary:hover { background: var(--blue-deep); border-color: var(--blue-deep); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--blue-wash); }
.btn.on-ink { background: transparent; color: var(--on-ink); border-color: var(--iron-line); }
.btn.on-ink:hover { border-color: var(--blue-lite); }
.btn.wide { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.fav[aria-pressed="true"] { color: var(--blue-deep); border-color: var(--blue); background: var(--blue-wash); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.hint { font-size: .85rem; color: var(--muted); }
.linkbtn { background: none; border: 0; padding: 0; color: var(--blue-deep); font-weight: 600; text-decoration: underline; }

/* ---------- result rows ---------- */
.rows { display: grid; gap: 8px; }
.rrow { display: grid; grid-template-columns: 6px 1fr auto; gap: 14px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 0 16px 0 0; text-decoration: none; color: inherit; }
.rrow:hover { border-color: var(--line-strong); }
.rrow .bar { align-self: stretch; background: var(--line); border-radius: var(--r) 0 0 var(--r); }
.rrow.top .bar { background: var(--blue); }
.rrow .rt { display: grid; gap: 4px; min-width: 0; padding: 14px 0; }
.rrow .rt strong { font-family: var(--display); font-size: 1.35rem; font-weight: 700; line-height: 1.05; }
.rrow .rt span { color: var(--muted); font-size: .92rem; }
.rrow .kind { font-family: var(--display); font-weight: 700; font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--blue-deep); }
.rrow .kind.rub { color: var(--amber); }
.rrow .go { font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--blue-deep); white-space: nowrap; }
.callout { border-left: 4px solid var(--amber); background: var(--amber-wash); padding: 10px 14px; border-radius: 0 var(--r) var(--r) 0; font-size: .95rem; }
.callout.blue { border-color: var(--blue); background: var(--blue-wash); }

/* ---------- browse grid ---------- */
.filters { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: end; }
@media (max-width: 700px) { .filters { grid-template-columns: 1fr; } }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.tile { background: var(--card); border: 1px solid var(--line); border-top: 4px solid var(--ink); border-radius: var(--r); padding: 14px; display: grid; gap: 10px; text-decoration: none; color: inherit; }
.tile:hover { border-color: var(--line-strong); border-top-color: var(--blue); }
.tile.rub { border-top-color: var(--amber); }
.tile strong { font-family: var(--display); font-size: 1.3rem; font-weight: 700; line-height: 1.05; }
.tile .meta { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: .85rem; }
.tile .fv { color: var(--blue-deep); font-size: .85rem; font-weight: 600; }

/* ---------- recipe page ---------- */
.rhead { display: grid; gap: 10px; }
.rhead .tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-family: var(--display); font-weight: 700; font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; padding: 4px 8px; border-radius: var(--r); background: var(--ink); color: #fff; }
.tag.rub { background: var(--amber); }
.tag.blue { background: var(--blue); }
.rhead p { color: var(--muted); max-width: 60ch; font-size: 1.05rem; }
.back { font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; text-decoration: none; }
.cols { display: grid; grid-template-columns: 1.3fr .9fr; gap: 18px; align-items: start; }
@media (max-width: 900px) { .cols { grid-template-columns: 1fr; } }
.sheet { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: clamp(14px, 3vw, 22px); display: grid; gap: 14px; }
.sheet-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.bigval { font-family: var(--display); font-weight: 800; font-size: 2rem; color: var(--blue-deep); line-height: 1; }
.ing { display: grid; gap: 0; border-top: 2px solid var(--ink); }
.ing li { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--line); }
.ing ul, .ing ol { list-style: none; margin: 0; padding: 0; }
.ing .amt { text-align: right; display: grid; }
.ing .amt b { font-family: var(--display); font-size: 1.2rem; font-weight: 700; white-space: nowrap; }
.ing .amt small { color: var(--muted); font-size: .8rem; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; counter-reset: step; }
.steps li { display: grid; grid-template-columns: 34px 1fr; gap: 12px; }
.steps li::before { counter-increment: step; content: counter(step); font-family: var(--display); font-weight: 800; font-size: 1.2rem; color: #fff; background: var(--ink); width: 30px; height: 30px; display: grid; place-items: center; border-radius: var(--r); }
.steps strong { display: block; font-family: var(--display); font-size: 1.15rem; }
.steps p { color: var(--muted); font-size: .95rem; }

/* thermometer card on black */
.therm { background: var(--ink); color: var(--on-ink); border-radius: var(--r); padding: clamp(14px, 3vw, 22px); display: grid; gap: 14px; }
.tstrip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; background: var(--iron-line); border: 1px solid var(--iron-line); border-radius: var(--r); overflow: hidden; }
.tstrip div { background: var(--iron); padding: 12px 10px; display: grid; gap: 2px; }
.tstrip b { font-family: var(--display); font-weight: 800; font-size: clamp(1.35rem, 4.5vw, 1.8rem); line-height: 1; color: var(--blue-lite); white-space: nowrap; }
.tstrip b.hot { color: var(--gold); }
.tstrip small { color: var(--on-ink-muted); font-size: .8rem; }
.usda { border-left: 4px solid var(--green); padding: 8px 12px; background: var(--iron); border-radius: 0 var(--r) var(--r) 0; font-size: .92rem; }
.usda b { color: #8fd7a8; }
.kv { display: grid; gap: 0; }
.kv div { display: grid; grid-template-columns: 110px 1fr; gap: 10px; padding: 8px 0; border-top: 1px solid var(--iron-line); font-size: .95rem; }
.kv dt { color: var(--on-ink-muted); font-family: var(--display); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: .8rem; margin: 0; }
.kv dd { margin: 0; }
.nut { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.nut div { border: 1px solid var(--line); border-radius: var(--r); padding: 10px; display: grid; }
.nut b { font-family: var(--display); font-size: 1.3rem; font-weight: 700; }
.nut small { color: var(--muted); font-size: .78rem; }

/* ---------- plan ---------- */
.pcard { background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--ink); border-radius: var(--r); padding: 14px; display: grid; gap: 12px; }
.pcard.lean { border-left-color: var(--blue); }
.pcard .ptitle { display: flex; justify-content: space-between; gap: 10px; align-items: start; flex-wrap: wrap; }
.pcard .ptitle strong { font-family: var(--display); font-size: 1.4rem; font-weight: 700; line-height: 1.05; }
.pcard .ptitle span { color: var(--muted); font-size: .92rem; }
.pctl { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; align-items: end; }
@media (max-width: 560px) { .pctl { grid-template-columns: 1fr 1fr; } }
.plinks { display: flex; gap: 14px; }
.empty { border: 2px dashed var(--line-strong); border-radius: var(--r); padding: 22px; text-align: center; color: var(--muted); display: grid; gap: 10px; justify-items: center; }
.shop { background: var(--ink); color: var(--on-ink); border-radius: var(--r); padding: clamp(14px, 3vw, 22px); display: grid; gap: 12px; }
.shop ul { list-style: none; margin: 0; padding: 0; display: grid; }
.shop li { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--iron-line); }
.shop li.done label { text-decoration: line-through; color: var(--on-ink-muted); }
.shop input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--blue); }
.shop .amt { display: grid; text-align: right; }
.shop .amt b { font-family: var(--display); font-size: 1.15rem; color: var(--blue-lite); white-space: nowrap; }
.shop .amt small { color: var(--on-ink-muted); font-size: .78rem; }
.shop .seg { border-color: var(--iron-line); background: var(--iron); }
.shop .seg button { color: var(--on-ink-muted); }
.shop .seg button + button { border-left-color: var(--iron-line); }
.shop .seg button[aria-pressed="true"] { background: var(--blue); color: #fff; }

/* ---------- temps ---------- */
.tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.tcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; display: grid; gap: 10px; }
.tcard h3 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.tcard h3 small { font-family: var(--body); font-weight: 600; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.tnums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.tnums div { background: #fff; padding: 8px; display: grid; }
.tnums b { font-family: var(--display); font-size: 1.4rem; font-weight: 800; color: var(--blue-deep); line-height: 1; white-space: nowrap; }
.tnums b.hot { color: var(--amber); }
.tnums small { color: var(--muted); font-size: .75rem; }
.tcard .fine { font-size: .88rem; color: var(--muted); display: grid; gap: 2px; }
.tcard .fine b { color: var(--text); font-weight: 600; }

/* ---------- signup ---------- */
.signup { background: var(--card); border: 1px solid var(--line); border-top: 4px solid var(--blue); border-radius: var(--r); padding: clamp(14px, 3vw, 22px); display: grid; gap: 10px; }
.signup form { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
@media (max-width: 480px) { .signup form { grid-template-columns: 1fr; } }
.signup input[type="email"] { height: 46px; padding: 0 12px; border: 2px solid var(--line-strong); border-radius: var(--r); background: #fff; width: 100%; }
.signup .ok { color: var(--green); font-weight: 600; }

/* ---------- footer, toast ---------- */
.foot { color: var(--muted); font-size: .85rem; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 14px; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tab-h) + 16px + env(safe-area-inset-bottom)); background: var(--blue); color: #fff; padding: 10px 16px; border-radius: var(--r); font-weight: 600; z-index: 30; box-shadow: 0 6px 20px rgba(0,0,0,.25); max-width: min(90vw, 420px); text-align: center; }
@media (min-width: 761px) { .toast { bottom: 24px; } }
@media (prefers-reduced-motion: no-preference) {
  .toast { animation: rise .2s ease-out; }
  @keyframes rise { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
}
