/* Protein Kitchen: mobile-first, one decision per screen, big targets (48px+), 17px body text. */
:root {
  color-scheme: light;
  --bg: #FBF6EE;
  --card: #FFFFFF;
  --ink: #2B2118;
  --body: #3B3631;
  --muted: #74685E;
  --line: #EADFCF;
  --sand: #F1E8DA;
  --saffron: #D9731A;
  --saffron-dk: #B85A10;
  --saffron-t: #FDE6CF;
  --green: #2E7A4C;
  --green-t: #E6F4EC;
  --red: #B23B3B;
  --red-t: #FCEBEA;
  --amber: #8A5A00;
  --amber-t: #FFF1D6;
  --night: #3F327A;
  --night-t: #E8E3F7;
  --accent: var(--saffron);
  --tint: var(--saffron-t);
  --shadow: 0 1px 2px rgba(43, 33, 24, .05), 0 6px 20px rgba(43, 33, 24, .07);
  /* Lexend: built for readability, wide and open (not condensed). Devanagari falls back to Noto Sans. */
  --serif: Lexend, "Noto Sans Devanagari", system-ui, -apple-system, sans-serif;
  --sans: Lexend, "Noto Sans Devanagari", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  letter-spacing: .005em;
  background: var(--bg);
  color: var(--body);
  font: 17px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--saffron); outline-offset: 2px; border-radius: 10px; }

.screen {
  max-width: 560px;
  margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) 16px calc(120px + env(safe-area-inset-bottom));
}
.loading { padding-top: 40vh; text-align: center; }

/* ---------- type */
.eyebrow { font: 800 12.5px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--saffron); margin: 18px 0 10px; }
.display { font: 700 30px/1.2 var(--serif); color: var(--ink); margin: 6px 0 12px; letter-spacing: -.015em; }
.display.sm { font-size: 26px; }
.lede { font-size: 17px; color: var(--muted); margin: 0 0 18px; }
.group { font: 800 13px/1 var(--sans); letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin: 26px 0 10px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.small { font-size: 15px; }

/* ---------- top bar */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 52px; margin-bottom: 8px; }
.back {
  display: inline-flex; align-items: center; gap: 6px; min-height: 48px; padding: 0 16px 0 12px;
  border-radius: 14px; background: var(--card); border: 1.5px solid var(--line);
  color: var(--ink); font-weight: 600; font-size: 16px; text-decoration: none; cursor: pointer;
}
.stepinfo { font: 700 14px/1 var(--sans); color: var(--muted); }
.home-link { font-size: 15px; font-weight: 600; color: var(--muted); text-decoration: none; padding: 12px 4px; }

/* ---------- home */
.home .display { font-size: 31px; }
.big-card {
  display: flex; flex-direction: column; gap: 6px; width: 100%; min-height: 172px;
  margin: 14px 0; padding: 22px 22px 20px; border: 0; border-radius: 28px;
  text-align: left; text-decoration: none; cursor: pointer; position: relative; overflow: hidden;
  box-shadow: var(--shadow); transition: transform .12s ease;
}
.big-card:active { transform: scale(.985); }
.big-card.quick { background: linear-gradient(140deg, #E98A2E 0%, #D9731A 45%, #B9501A 100%); color: #fff; }
.big-card.explore { background: var(--card); color: var(--ink); border: 1.5px solid var(--line); }
.big-card::after {
  content: attr(data-art); position: absolute; right: -8px; bottom: -22px;
  font-size: 120px; line-height: 1; opacity: .16; pointer-events: none;
}
.bc-emoji { font-size: 32px; line-height: 1; }
.bc-title { font: 700 27px/1.15 var(--serif); margin-top: 6px; }
.bc-sub { font-size: 16.5px; line-height: 1.4; opacity: .93; max-width: 28ch; }
.bc-go {
  margin-top: auto; align-self: flex-start; font-weight: 700; font-size: 16px;
  padding: 10px 16px; border-radius: 999px; background: rgba(255, 255, 255, .22);
}
.big-card.explore .bc-go { background: var(--sand); }
.mini-links { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.mini {
  display: flex; align-items: center; gap: 10px; min-height: 60px; padding: 10px 14px;
  border-radius: 18px; background: var(--card); border: 1.5px solid var(--line);
  text-decoration: none; color: var(--ink); font-weight: 600; font-size: 15.5px; line-height: 1.25;
}
.mini span { font-size: 22px; }

/* ---------- bottom sheet */
.backdrop { position: fixed; inset: 0; background: rgba(43, 33, 24, .45); opacity: 0; transition: opacity .2s; z-index: 40; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-width: 560px; margin: 0 auto;
  background: var(--card); border-radius: 28px 28px 0 0;
  padding: 10px 18px calc(18px + env(safe-area-inset-bottom));
  transform: translateY(100%); transition: transform .28s cubic-bezier(.2, .8, .2, 1);
}
.sheet-open .backdrop { opacity: 1; }
.sheet-open .sheet { transform: none; }
.grab { width: 44px; height: 5px; border-radius: 9px; background: var(--line); margin: 4px auto 14px; }
.sheet h2 { font: 700 25px/1.2 var(--serif); color: var(--ink); margin: 0 0 4px; text-align: center; }
.sheet p { text-align: center; color: var(--muted); margin: 0 0 18px; font-size: 16px; }
.time-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.time-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 112px; border-radius: 22px; background: var(--saffron-t); color: var(--ink);
  text-decoration: none; border: 2px solid transparent; transition: transform .1s;
}
.time-btn:active { transform: scale(.97); border-color: var(--saffron); }
.tb-n { font: 700 42px/1 var(--serif); color: var(--saffron-dk); }
.tb-u { font-weight: 700; font-size: 16px; color: var(--muted); }
.link-btn {
  display: block; width: 100%; min-height: 52px; margin-top: 12px; border: 0; background: none;
  font-weight: 600; color: var(--muted); cursor: pointer; font-size: 16px;
}

/* ---------- pills and chips */
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 14px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 14px;
  border-radius: 999px; background: var(--card); border: 1.5px solid var(--line);
  font-size: 15px; font-weight: 600; color: var(--ink); text-decoration: none;
}
.chips { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.chip-btn {
  display: flex; align-items: center; gap: 10px; min-height: 62px; padding: 10px 34px 10px 12px;
  border-radius: 18px; background: var(--card); border: 2px solid var(--line);
  font: 600 16px/1.22 var(--sans); color: var(--ink); text-align: left; cursor: pointer;
  position: relative; transition: background .12s, border-color .12s;
}
.chip-btn .e { font-size: 25px; line-height: 1; flex: none; }
.chip-btn[aria-pressed="true"] { border-color: var(--saffron); background: var(--saffron-t); }
.chip-btn[aria-pressed="true"]::after {
  content: "✓"; position: absolute; top: 50%; right: 10px; transform: translateY(-50%);
  width: 22px; height: 22px; border-radius: 50%; background: var(--saffron); color: #fff;
  font-size: 13px; font-weight: 800; display: grid; place-items: center;
}
.soft-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 54px;
  margin: 4px 0 6px; border-radius: 16px; border: 2px dashed var(--saffron); background: transparent;
  color: var(--saffron-dk); font-weight: 700; font-size: 16px; cursor: pointer; text-decoration: none;
}
.note {
  margin: 22px 0 0; padding: 14px 16px; border-radius: 16px; background: var(--sand);
  font-size: 15px; color: var(--muted); line-height: 1.45;
}

/* ---------- bottom action bar */
.bottombar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 68%, rgba(251, 246, 238, 0));
}
.primary {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  max-width: 528px; min-height: 62px; margin: 0 auto; padding: 0 20px;
  border-radius: 20px; border: 0; background: var(--saffron); color: #fff;
  font: 700 18.5px/1.1 var(--sans); text-decoration: none; cursor: pointer;
  box-shadow: 0 8px 22px rgba(217, 115, 26, .35);
}
.primary:active { background: var(--saffron-dk); }
.primary.dark { background: var(--ink); box-shadow: 0 8px 22px rgba(43, 33, 24, .3); }

/* ---------- recipe cards */
.rcard {
  display: block; position: relative; overflow: hidden; margin: 12px 0; padding: 15px 16px 14px 20px;
  background: var(--card); border-radius: 20px; box-shadow: var(--shadow);
  color: inherit; text-decoration: none; transition: transform .1s;
}
.rcard:active { transform: scale(.99); }
.rcard::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--accent); }
.rc-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 14px; font-weight: 600; color: var(--muted); }
.rc-code { background: var(--tint); color: var(--accent); padding: 3px 9px; border-radius: 8px; font-weight: 800; }
.rc-title { font: 600 19px/1.3 var(--serif); color: var(--ink); margin: 7px 0 11px; }
.rc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rc-stats div { background: var(--tint); border-radius: 13px; padding: 8px 10px; }
.rc-stats b { display: block; font-size: 19px; line-height: 1.15; color: var(--ink); }
.rc-stats div:first-child b { color: var(--accent); }
.rc-stats span { font-size: 13px; color: var(--muted); font-weight: 600; }
.rc-facts { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 14.5px; color: var(--muted); font-weight: 600; }
.badge {
  display: inline-flex; align-items: flex-start; gap: 6px; margin-top: 10px; padding: 7px 11px;
  border-radius: 11px; font-size: 14.5px; font-weight: 600; line-height: 1.3;
}
.badge.ok { background: var(--green-t); color: var(--green); }
.badge.need { background: var(--amber-t); color: var(--amber); }
.badge.ahead { background: var(--sand); color: var(--muted); }
.badge.info { background: var(--night-t); color: var(--night); }
.rcard .badge { margin-right: 6px; }
.tiffin-yes { color: var(--green); }
.tiffin-careful { color: var(--amber); }
.tiffin-no { color: var(--red); }

/* ---------- tags (the book's tag line) */
.tag { display: inline-block; padding: 5px 11px; border-radius: 999px; font: 800 12.5px/1.2 var(--sans); letter-spacing: .04em; }
.t-quick { background: #FDE6CF; color: #9A4A0B; }
.t-no-cook { background: #D5F0EC; color: #1D6B62; }
.t-rice-cooker { background: #DCE7F5; color: #23507F; }
.t-soak-tonight { background: #E5E0F5; color: #3F327A; }
.t-start-2-nights-before { background: #F3DCEB; color: #6E2A5B; }
.t-needs-a-base { background: #E6EED6; color: #41591E; }
.t-weekend-batch { background: #D9EFE1; color: #1F5C38; }

/* ---------- recipe page */
.r-hero {
  position: relative; overflow: hidden; margin: 4px 0 14px; padding: 22px 20px 20px;
  border-radius: 28px; background: var(--tint);
}
.r-art { position: absolute; right: -10px; top: -14px; font-size: 104px; line-height: 1; opacity: .2; pointer-events: none; }
.r-sec { font: 800 12.5px/1.3 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin: 0 0 8px; padding-right: 70px; }
.r-hero h1 { font: 700 25px/1.25 var(--serif); color: var(--ink); margin: 0 0 12px; }
.r-code { color: var(--accent); margin-right: 6px; }
.r-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; color: var(--muted); }
.r-note { margin: 12px 0 0; font-size: 15.5px; font-style: italic; color: var(--accent); }
.stats4 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { background: var(--card); border-radius: 18px; padding: 13px 14px; box-shadow: var(--shadow); }
.stat .l { display: block; font: 700 12.5px/1.2 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.stat .v { display: block; font: 700 25px/1.15 var(--sans); color: var(--ink); margin-top: 4px; }
.stat:first-child .v { color: var(--accent); }
.stat .s { display: block; font-size: 13.5px; color: var(--muted); font-weight: 500; margin-top: 2px; }
.facts { margin: 12px 0 4px; padding: 4px 16px; background: var(--card); border-radius: 18px; box-shadow: var(--shadow); }
.fact { display: grid; grid-template-columns: 30px 1fr; gap: 6px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 16px; }
.fact:last-child { border-bottom: 0; }
.fact b { color: var(--ink); }
.card { margin: 14px 0; padding: 18px 18px 8px; background: var(--card); border-radius: 22px; box-shadow: var(--shadow); }
.card h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font: 700 18.5px/1.2 var(--sans); color: var(--accent); }
.need { list-style: none; margin: 0; padding: 0; }
.need li { position: relative; padding: 10px 0 10px 26px; border-bottom: 1px solid var(--line); font-size: 17px; }
.need li:last-child { border-bottom: 0; }
.need li::before { content: ""; position: absolute; left: 4px; top: 19px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.steps { list-style: none; counter-reset: s; margin: 0; padding: 4px 0 0; }
.steps li { counter-increment: s; position: relative; padding: 0 0 18px 48px; font-size: 17.5px; line-height: 1.5; }
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: -2px; width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent); color: #fff; font: 700 16px/34px var(--sans); text-align: center;
}
.tip { margin: 14px 0; padding: 15px 16px; border-radius: 18px; background: var(--tint); border-left: 5px solid var(--accent); font-size: 16.5px; }
.tip > b, .tip summary { color: var(--accent); font-weight: 700; }
.tip summary { cursor: pointer; min-height: 32px; list-style-position: outside; }
.tip ol { margin: 10px 0 0; padding-left: 22px; }
.tip ol li { margin: 6px 0; }
.dd { display: grid; gap: 10px; margin: 14px 0; }
.dd > div { padding: 15px 16px; border-radius: 18px; font-size: 16.5px; }
.dd .do { background: var(--green-t); }
.dd .dont { background: var(--red-t); }
.dd .do > b:first-child { color: var(--green); }
.dd .dont > b:first-child { color: var(--red); }
.chip.night, .chip.day { display: inline-block; padding: 1px 8px; border-radius: 7px; font-weight: 800; font-size: .84em; }
.chip.night { background: var(--night-t); color: var(--night); }
.chip.day { background: var(--saffron-t); color: #9A4A0B; }
a.code { font-weight: 700; text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1.5px; }
.sA { color: #C2620F; } .sB { color: #1D7A6F; } .sC { color: #2F64A0; }
.sD { color: #5A4A9C; } .sE { color: #2E7A4C; } .sF { color: #B0472A; }

/* ---------- cook mode */
body[data-route="cook"] { background: var(--tint); }
.cook { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; max-width: 560px; margin: 0 auto; }
.cook-top { display: flex; align-items: center; gap: 12px; padding: max(14px, env(safe-area-inset-top)) 16px 8px; }
.x {
  display: grid; place-items: center; width: 48px; height: 48px; flex: none; border-radius: 14px;
  background: var(--card); border: 1.5px solid var(--line); font-size: 20px; text-decoration: none; color: var(--ink);
}
.progress { flex: 1; height: 9px; border-radius: 99px; background: rgba(43, 33, 24, .1); overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: 99px; background: var(--accent); transition: width .25s; }
.cook-body { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 10px 22px 20px; }
.cook-n { font: 800 14px/1 var(--sans); letter-spacing: .09em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }
.cook-title { font: 700 22px/1.2 var(--serif); color: var(--ink); margin: 0 0 16px; }
.cook-text { font: 400 23px/1.55 var(--sans); color: var(--ink); }
.cook-list { list-style: none; margin: 0; padding: 0; }
.cook-list label {
  display: flex; gap: 12px; align-items: flex-start; padding: 13px 0; border-bottom: 1px solid rgba(43, 33, 24, .1);
  font-size: 18px; cursor: pointer;
}
.cook-list input { width: 24px; height: 24px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.cook-list input:checked + span { text-decoration: line-through; opacity: .5; }
.cook-foot { display: grid; grid-template-columns: 1fr 2fr; gap: 12px; padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); }
.btn-ghost {
  display: flex; align-items: center; justify-content: center; min-height: 64px; border-radius: 20px;
  background: var(--card); border: 1.5px solid var(--line); font-weight: 700; font-size: 18px; color: var(--ink);
  text-decoration: none; cursor: pointer;
}
.cook-foot .primary { min-height: 64px; margin: 0; max-width: none; }

/* ---------- explore */
.search {
  display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 0 16px; margin: 6px 0 4px;
  background: var(--card); border: 1.5px solid var(--line); border-radius: 18px;
}
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font: 500 17px var(--sans); color: var(--ink); min-height: 52px; }
.sec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sec-card {
  position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 4px; min-height: 140px;
  padding: 15px 15px 14px; border-radius: 22px; background: var(--tint); color: var(--ink); text-decoration: none;
}
.sec-card .lt { font: 800 13px/1 var(--sans); letter-spacing: .08em; color: var(--accent); }
.sec-card .nm { font: 600 16.5px/1.3 var(--serif); padding-right: 6px; }
.sec-card .ct { margin-top: auto; font-size: 14px; font-weight: 600; color: var(--muted); }
.sec-card .em { position: absolute; right: 10px; top: 10px; font-size: 30px; }
.wide {
  display: flex; align-items: center; gap: 14px; min-height: 78px; margin: 12px 0; padding: 14px 16px;
  border-radius: 20px; background: var(--card); box-shadow: var(--shadow); text-decoration: none; color: var(--ink);
}
.wide .em { font-size: 30px; }
.wide b { display: block; font-size: 17.5px; }
.wide small { display: block; font-size: 14.5px; color: var(--muted); margin-top: 2px; }
.wide .go { margin-left: auto; font-size: 22px; color: var(--muted); }
.pref {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 22px; padding: 14px 16px;
  border-radius: 18px; background: var(--sand); font-size: 15.5px;
}
.toggle[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.toggle {
  min-width: 84px; min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card);
  font-weight: 700; cursor: pointer;
}
.s-hero {
  position: relative; overflow: hidden; margin: 4px 0 16px; padding: 24px 20px 22px; border-radius: 28px;
  background: var(--accent); color: #fff;
}
.s-hero .em { position: absolute; right: -6px; bottom: -18px; font-size: 110px; opacity: .25; }
.s-hero .lt { font: 800 13px/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; opacity: .9; }
.s-hero h1 { font: 700 26px/1.2 var(--serif); margin: 8px 0 8px; max-width: 18ch; }
.s-hero p { margin: 0; font-weight: 600; opacity: .95; }
.intro-p { font-size: 17.5px; color: var(--ink); }

/* ---------- kitchen list */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin: 4px 0 8px; border-radius: 16px; background: var(--sand); }
.seg a { display: grid; place-items: center; min-height: 48px; border-radius: 12px; text-decoration: none; font-weight: 700; font-size: 15.5px; color: var(--muted); }
.seg a.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.shelf h2 { color: var(--ink); font-size: 19px; }
.kitem {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 64px;
  padding: 10px 0; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; cursor: pointer;
}
.shelf .kitem:last-child { border-bottom: 0; }
.ki-main { display: flex; flex-direction: column; gap: 2px; }
.ki-name { font-weight: 600; font-size: 16.5px; color: var(--ink); }
.ki-note, .ki-used { font-size: 14px; color: var(--muted); }
.ki-used { color: var(--green); font-weight: 600; }
.ki-status { flex: none; min-width: 84px; padding: 8px 10px; border-radius: 12px; text-align: center; font: 700 13.5px/1 var(--sans); background: var(--green-t); color: var(--green); }
.ki-status::before { content: "In stock"; }
.kitem[aria-pressed="true"] .ki-status { background: var(--saffron); color: #fff; }
.kitem[aria-pressed="true"] .ki-status::before { content: "Buy ✓"; }
.empty { padding: 30px 18px; text-align: center; color: var(--muted); background: var(--card); border-radius: 20px; box-shadow: var(--shadow); }
.actions { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; margin-top: 16px; }

/* ---------- plan */
.day { margin: 12px 0; padding: 14px 16px 8px; background: var(--card); border-radius: 20px; box-shadow: var(--shadow); }
.day.today { outline: 3px solid var(--saffron); }
.day h3 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 0 0 6px; font: 700 20px/1.2 var(--serif); color: var(--ink); }
.day h3 small { font: 700 13px/1 var(--sans); color: var(--saffron); letter-spacing: .06em; text-transform: uppercase; }
.meal { display: grid; grid-template-columns: 104px 1fr; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 16px; }
.meal .k { color: var(--muted); font-weight: 600; font-size: 14.5px; }
.flag { display: block; width: fit-content; margin-top: 6px; padding: 4px 9px; border-radius: 9px; background: var(--amber-t); color: var(--amber); font-size: 13.5px; font-weight: 600; }
.meal.tonight { margin: 4px -8px 6px; padding: 10px 8px; border: 0; border-radius: 12px; background: var(--night-t); color: var(--night); }
.meal.tonight .k { color: var(--night); }

/* ---------- guide */
.g-h { font: 700 22px/1.2 var(--serif); color: var(--ink); margin: 26px 0 8px; }
.g-list { padding-left: 22px; }
.g-list li { margin: 8px 0; }
.table-wrap { overflow-x: auto; margin: 10px -16px; padding: 0 16px; -webkit-overflow-scrolling: touch; }
.table-wrap table { border-collapse: collapse; min-width: 100%; font-size: 15px; background: var(--card); border-radius: 14px; overflow: hidden; }
.table-wrap th, .table-wrap td { padding: 9px 11px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.table-wrap th { background: var(--ink); color: #fff; font-weight: 700; font-size: 14px; white-space: nowrap; }

@media (min-width: 520px) {
  .stats4 { grid-template-columns: repeat(4, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- second build: today, history, plan, batch, timer, settings */
.today-card { display: flex; align-items: center; gap: 16px; margin: 6px 0 4px; padding: 14px 16px; background: var(--card); border-radius: 24px; box-shadow: var(--shadow); }
.tc-ring, .tb-ring { position: relative; display: grid; place-items: center; flex: none; text-decoration: none; color: var(--ink); }
.tc-num, .tb-num { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.tc-num b { font-size: 26px; } .tc-num small, .tb-num small { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.tb-num b { font-size: 40px; }
.tc-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tc-title { font: 700 20px/1.2 var(--sans); color: var(--ink); text-decoration: none; }
.tc-sub { font-size: 15px; color: var(--muted); }
.link, .tc-sub.link { color: var(--saffron-dk); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.tc-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.chip-link { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--bg); font: 600 14.5px var(--sans); color: var(--ink); text-decoration: none; cursor: pointer; }
.mini-links { grid-template-columns: 1fr 1fr; }
.settings-link { display: block; margin: 18px 0 0; text-align: center; color: var(--muted); font-weight: 600; text-decoration: none; padding: 12px; }
.wide.hl { background: var(--saffron-t); }
.bb-in { display: flex; gap: 10px; max-width: 528px; margin: 0 auto; }
.bb-in .primary { flex: 1; margin: 0; max-width: none; padding: 0 12px; font-size: 17px; }
button.primary { width: 100%; }
.fav { min-width: 48px; min-height: 48px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--card); font-size: 22px; color: var(--red); cursor: pointer; }
.fav.on { background: var(--red-t); border-color: var(--red); }
.fav-dot { color: var(--red); font-size: 15px; }
.fatfib { margin: 8px 2px 0; font-size: 14px; color: var(--muted); }
.sheet h2 { font-size: 22px; }
.meal-seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 0 0 12px; }
.meal-seg label { position: relative; }
.meal-seg input { position: absolute; opacity: 0; inset: 0; }
.meal-seg span { display: grid; place-items: center; min-height: 46px; border-radius: 12px; background: var(--sand); font-weight: 600; font-size: 14px; }
.meal-seg input:checked + span { background: var(--ink); color: #fff; }
.meal-seg input:focus-visible + span { outline: 3px solid var(--saffron); }
.ate-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 2px; border-bottom: 1px solid var(--line); cursor: pointer; }
.ate-row input { width: 24px; height: 24px; margin-top: 2px; accent-color: var(--saffron); flex: none; }
.ate-row b { display: block; font-size: 16px; color: var(--ink); }
.ate-row small { display: block; font-size: 14px; color: var(--muted); margin-top: 2px; }
.sheet .primary { margin-top: 14px; }
.cook-tools { display: flex; gap: 8px; padding: 0 16px; }
.tool { min-height: 44px; padding: 0 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); font: 600 15px var(--sans); cursor: pointer; }
.tool.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.listening { margin: 8px 16px 0; font-size: 14.5px; color: var(--accent); font-weight: 600; }
.tbtns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.tbtn { min-height: 46px; padding: 0 14px; border-radius: 14px; border: 2px solid var(--accent); background: var(--card); color: var(--ink); font: 600 15px var(--sans); cursor: pointer; }
#timer-root { position: fixed; top: max(10px, env(safe-area-inset-top)); left: 0; right: 0; display: flex; justify-content: center; z-index: 60; pointer-events: none; }
.timer { pointer-events: auto; min-height: 48px; padding: 0 18px; border-radius: 999px; border: 0; background: var(--ink); color: #fff; font: 700 16px var(--sans); box-shadow: 0 8px 24px rgba(0,0,0,.25); cursor: pointer; }
.timer.done { background: var(--red); animation: pulse 1s infinite; }
@keyframes pulse { 50% { transform: scale(1.05); } }
.today-big { display: flex; align-items: center; gap: 18px; padding: 16px; background: var(--card); border-radius: 24px; box-shadow: var(--shadow); }
.tb-side p { margin: 0 0 6px; }
.list { padding: 4px 16px; }
.lrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 58px; padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.lrow:last-child { border-bottom: 0; }
.lname { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-weight: 500; }
.lname a { color: var(--saffron-dk); font-weight: 700; }
.lname small { font-size: 13.5px; color: var(--muted); font-weight: 400; }
.lx { flex: none; width: 40px; height: 40px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); color: var(--muted); cursor: pointer; }
.mini-btn { flex: none; min-height: 40px; padding: 0 12px; border-radius: 12px; border: 0; background: var(--saffron); color: #fff; font: 600 14px var(--sans); cursor: pointer; }
.done-tick { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: var(--green-t); color: var(--green); font-weight: 800; }
.presets { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.preset { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-height: 64px; padding: 10px 12px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--card); text-align: left; cursor: pointer; }
.preset b { font-size: 15px; color: var(--ink); font-weight: 600; } .preset small { font-size: 13px; color: var(--muted); }
.custom summary { min-height: 40px; font-weight: 700; color: var(--saffron-dk); cursor: pointer; }
.field { width: 100%; min-height: 52px; padding: 0 14px; margin: 8px 0; border: 1.5px solid var(--line); border-radius: 14px; background: var(--bg); font: 500 16px var(--sans); color: var(--ink); }
.field-row { display: flex; gap: 8px; align-items: center; }
.field-row .field { flex: 1; min-width: 0; }
.field-row .primary { flex: none; width: auto; min-height: 52px; padding: 0 18px; }
.day-row .bar { display: block; height: 6px; margin-top: 6px; border-radius: 99px; background: var(--sand); overflow: hidden; width: 100%; }
.day-row .bar i { display: block; height: 100%; background: var(--saffron); border-radius: 99px; }
.day-row .lname { flex: 1; }
.go { color: var(--muted); font-size: 22px; flex: none; }
label.btn-ghost { cursor: pointer; }
.dtot { margin-left: auto; font: 500 13px var(--sans); color: var(--muted); }
.meal.ml { text-decoration: none; color: var(--ink); }
.mc { font-weight: 700; } .mp { color: var(--muted); font-weight: 500; }
.linkish { border: 0; background: none; color: var(--saffron-dk); font: 600 15px var(--sans); text-decoration: underline; cursor: pointer; padding: 6px 2px; }
.seg + .seg { margin-top: 0; }
.qty { flex: none; font-size: 15.5px; color: var(--ink); }
.tip.big { font-size: 18px; line-height: 1.5; }
.bstep { padding: 12px 0; border-bottom: 1px solid var(--line); }
.bstep:last-child { border-bottom: 0; }
.bstep label { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; font-size: 16.5px; }
.bstep input { width: 24px; height: 24px; margin-top: 2px; accent-color: var(--green); flex: none; }
.bstep.on label > span { opacity: .55; text-decoration: line-through; }
.bstep .tbtns { margin: 10px 0 0 36px; }
.toast { position: fixed; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 70; padding: 12px 18px; border-radius: 14px; background: var(--ink); color: #fff; font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.25); max-width: 90vw; }
