/* Nourish Track — steel thali, curry leaf, turmeric */

:root {
  --bg: #EEF1EF;          /* stainless steel white */
  --surface: #FFFFFF;
  --ink: #24302C;         /* slate */
  --muted: #5B6863;
  --leaf: #1F5A3A;        /* curry leaf */
  --leaf-soft: #DCE8E0;
  --turmeric: #D99A06;
  --turmeric-soft: #F7E8BC;
  --chili: #B23A2A;
  --chili-soft: #F5DED9;
  --steel: #C9D0CD;
  --steel-dark: #8C969B;
  --plate: #E3E8E5;
  --radius-s: 8px;
  --radius-l: 18px;
  --font: ui-rounded, "SF Pro Rounded", "Nunito", "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}

/* Steel thali (default) follows the phone's light/dark setting */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]), :root[data-theme="thali"] {
    --bg: #101A15;
    --surface: #17231D;
    --ink: #E3EAE6;
    --muted: #9BA9A2;
    --leaf: #86CDA0;
    --leaf-soft: #213529;
    --turmeric: #F0B429;
    --turmeric-soft: #3B3015;
    --chili: #F0907F;
    --chili-soft: #3B201C;
    --steel: #2F3C36;
    --steel-dark: #6E7B75;
    --plate: #1E2B25;
    color-scheme: dark;
  }
}
/* Fresh mint: teal with a coral accent */
:root[data-theme="mint"] {
  --bg: #F4FAF9; --surface: #FFFFFF; --ink: #16302C; --muted: #52706A;
  --leaf: #0F766E; --leaf-soft: #CCEFEA;
  --turmeric: #F97362; --turmeric-soft: #FDE1DB;
  --chili: #B42318; --chili-soft: #F8DAD5;
  --steel: #D3E3E0; --steel-dark: #7F9A95; --plate: #E6F2F0;
  color-scheme: light;
}
/* Warm sunrise: burnt orange with amber */
:root[data-theme="sunrise"] {
  --bg: #FFF8F2; --surface: #FFFFFF; --ink: #3A2418; --muted: #7A5E4F;
  --leaf: #C2410C; --leaf-soft: #FDE5D3;
  --turmeric: #E8A33D; --turmeric-soft: #FCEBC9;
  --chili: #B42318; --chili-soft: #F9DCD8;
  --steel: #EADBCD; --steel-dark: #A88B78; --plate: #F7EADF;
  color-scheme: light;
}
/* Night mode: charcoal with lime */
:root[data-theme="night"] {
  --bg: #16191D; --surface: #1F2328; --ink: #E8ECEF; --muted: #9AA3AB;
  --leaf: #A3E635; --leaf-soft: #2C3A1C;
  --turmeric: #A3E635; --turmeric-soft: #33401F;
  --chili: #F87171; --chili-soft: #3B1F1F;
  --steel: #2E343B; --steel-dark: #6B7580; --plate: #262B31;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.45;
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
}
h1, h2, h3, h4 { line-height: 1.15; margin: 0; font-weight: 700; }
h2 { font-size: 21px; margin-bottom: 10px; }
h4 { font-size: 15px; margin: 12px 0 4px; }
p { margin: 0 0 10px; }
a { color: var(--leaf); }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--turmeric); outline-offset: 2px; border-radius: 4px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 20; }
.skip:focus { left: 8px; }

main { max-width: 34rem; margin: 0 auto; padding: 8px 16px 24px; outline: none; }

/* top bar */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 34rem; margin: 0 auto;
  padding: calc(10px + env(safe-area-inset-top)) 16px 6px;
}
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; color: var(--leaf); text-decoration: none; }
.brand svg { width: 26px; height: 26px; }
.brand-rim { fill: var(--plate); stroke: var(--steel-dark); stroke-width: 2; }
.brand-katori { fill: var(--turmeric); }
.settings-link { display: grid; place-items: center; width: 44px; height: 44px; color: var(--muted); }
.settings-link svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }

/* bottom tabs */
.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 10;
  display: grid; grid-template-columns: repeat(6, 1fr);
  background: var(--surface);
  border-top: 1px solid var(--steel);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 0 7px; min-height: 56px;
  font-size: 11px; color: var(--muted); text-decoration: none;
}
.tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a[aria-current="page"] { color: var(--leaf); font-weight: 700; }
.tabbar a[aria-current="page"] svg { stroke-width: 2.3; }

/* type */
.display { font-size: 34px; letter-spacing: -0.01em; margin: 18px 0 10px; color: var(--leaf); }
.page-title { font-size: 28px; margin: 14px 0 12px; }
.lede { font-size: 17px; color: var(--muted); max-width: 32em; }
.fine { font-size: 14px; color: var(--muted); }
.center { text-align: center; }
.empty { color: var(--muted); padding: 16px 0; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 46px; padding: 10px 18px;
  border: 1.5px solid var(--leaf); border-radius: 999px;
  background: transparent; color: var(--leaf); font-weight: 700; text-decoration: none; cursor: pointer;
}
.btn-primary { background: var(--leaf); color: var(--bg); }
.btn-danger { border-color: var(--chili); color: var(--chili); }
.btn-small { min-height: 38px; padding: 6px 14px; font-size: 15px; }
.btn:active { transform: translateY(1px); }
.link { background: none; border: 0; padding: 8px 0; color: var(--leaf); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link-danger { color: var(--chili); }
.round {
  display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none;
  border-radius: 50%; border: 1.5px solid var(--steel); background: var(--surface);
  font-size: 22px; line-height: 1; cursor: pointer;
}
.round:disabled { opacity: 0.35; cursor: default; }
.round-small { width: 34px; height: 34px; font-size: 18px; }
.stack { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; }
.share-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }

/* forms */
input[type="date"], input[type="number"], input[type="search"], input:not([type]), textarea {
  width: 100%; min-height: 46px; padding: 10px 12px;
  border: 1.5px solid var(--steel); border-radius: var(--radius-s);
  background: var(--surface);
}
textarea { resize: vertical; }
label { font-weight: 600; font-size: 15px; }
.field { display: grid; gap: 6px; margin-top: 14px; }
.grid-form { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; align-items: center; margin-top: 8px; }
.grid-form .span-2 { grid-column: 1 / -1; margin-top: 6px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 46px; }
.check input { width: 22px; height: 22px; accent-color: var(--leaf); }

/* start + welcome */
.start-form { display: grid; gap: 8px; margin: 18px 0; }
.readiness { display: grid; gap: 6px; color: var(--ink); text-decoration: none; font-weight: 600; margin: 8px 0 14px; }
.readiness-bar, .meter { display: block; height: 10px; border-radius: 999px; background: var(--plate); overflow: hidden; }
.readiness-fill, .meter-fill { display: block; height: 100%; width: 0; background: var(--turmeric); border-radius: inherit; transition: width 0.3s ease; }

/* today */
.day-head { margin-top: 6px; }
.day-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.day-title { text-align: center; }
.day-number { font-size: 52px; letter-spacing: -0.02em; color: var(--leaf); font-variant-numeric: tabular-nums; }
.day-meta { color: var(--muted); margin: 2px 0 0; }
.day-head .link { display: block; margin: 0 auto; }

.hero { display: grid; justify-items: center; margin: 10px 0 6px; }
.thali { width: min(68vw, 240px); height: auto; }
.thali-rim { fill: var(--steel); }
.thali-plate { fill: var(--plate); }
.thali-katori { fill: var(--surface); stroke: var(--steel); stroke-width: 2; }
.seg { fill: var(--surface); stroke: var(--steel); stroke-width: 1; transition: fill 0.35s ease; }
.seg-done { fill: var(--turmeric); stroke: var(--turmeric); }
.seg-skipped { fill: var(--chili-soft); stroke: var(--chili); stroke-dasharray: 3 3; }
.seg-now { fill: var(--leaf-soft); stroke: var(--leaf); stroke-width: 2.5; }
.seg-missed { fill: var(--surface); stroke: var(--chili); stroke-width: 2; stroke-dasharray: 4 3; }
.thali-count { font: 700 30px var(--font); fill: var(--ink); font-variant-numeric: tabular-nums; }
.thali-sub { font: 500 13px var(--font); fill: var(--muted); }
.now-line { text-align: center; max-width: 26em; margin: 10px auto 0; }
.now-line strong { color: var(--leaf); }

.notice { background: var(--turmeric-soft); border-left: 4px solid var(--turmeric); padding: 12px 14px; border-radius: var(--radius-s); margin: 14px 0; }
.notice p { margin-bottom: 8px; }
.notice-chili { background: var(--chili-soft); border-left-color: var(--chili); }
.notice-chili p { margin: 0; }

/* timeline */
.timeline { list-style: none; margin: 18px 0 8px; padding: 0; }
.meal { display: grid; grid-template-columns: 76px 1fr; gap: 0 12px; position: relative; }
.rail { position: relative; display: flex; flex-direction: column; align-items: flex-end; padding-top: 3px; }
.rail-time { font-size: 13px; color: var(--muted); text-align: right; line-height: 1.25; padding-right: 26px; }
.rail-icon {
  position: absolute; right: -18px; top: -2px; z-index: 1;
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--steel); color: var(--leaf);
  transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon-sm { width: 18px; height: 18px; }
.rail::after { content: ""; position: absolute; right: -1px; top: 36px; bottom: -4px; width: 2px; background: var(--steel); }
.meal:last-child .rail::after { display: none; }
.meal-body { padding: 0 0 24px 26px; min-width: 0; }
.meal-slot { font-size: 14px; font-weight: 700; color: var(--muted); margin: 0 0 2px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.meal-title { font-size: 19px; margin-bottom: 4px; }
.meal-detail { font-size: 15px; color: var(--muted); }
.meal[data-state="done"] .rail-icon { background: var(--turmeric); border-color: var(--turmeric); color: var(--surface); }
.meal[data-state="done"] .rail-icon .icon { stroke-width: 2.6; }
.meal.just-done .rail-icon .icon { animation: check-in 0.35s ease-out; }
.meal.just-done .pill-done { animation: press 0.3s ease-out; }
.meal[data-state="done"] .meal-title { color: var(--muted); }
.meal[data-state="skipped"] .rail-icon { background: var(--chili-soft); border-color: var(--chili); color: var(--chili); }
.meal[data-state="missed"] .rail-icon { border-color: var(--chili); color: var(--chili); border-style: dashed; }
.meal.is-now .rail-icon { border-color: var(--leaf); background: var(--leaf-soft); box-shadow: 0 0 0 4px var(--leaf-soft); }

/* meal photos */
.pill-photo { display: inline-flex; align-items: center; gap: 6px; color: var(--leaf); }
.photo { display: inline-flex; align-items: flex-start; gap: 6px; }
.photo-thumb { padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: 10px; }
.photo img { display: block; width: 56px; height: 56px; object-fit: cover; border-radius: 10px; border: 1.5px solid var(--steel); transition: width 0.25s ease, height 0.25s ease; }
.photo-big { flex-basis: 100%; }
.photo-big .photo-thumb { cursor: zoom-out; }
.photo-big img { width: min(100%, 320px); height: auto; aspect-ratio: auto; }
.share-photos { justify-content: center; margin: 4px 0 18px; }
.greet { margin: 0; color: var(--muted); font-weight: 600; font-size: 15px; }
.rem-list { display: grid; margin: 6px 0 10px; }
.meal.is-now .meal-title { color: var(--leaf); }

.tag { font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--plate); color: var(--muted); }
.tag-now { background: var(--leaf); color: var(--bg); }
.tag-low { background: var(--turmeric-soft); color: var(--ink); }
.tag-out { background: var(--chili-soft); color: var(--chili); }

.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 6px 0 10px; }
.chip { font-size: 13px; padding: 3px 10px; border-radius: 999px; background: var(--plate); color: var(--ink); }
.chip-out { background: var(--chili-soft); color: var(--chili); font-weight: 700; }
.chip-low { background: var(--turmeric-soft); }
.chip-need { background: transparent; border: 1px dashed var(--steel-dark); color: var(--muted); }

.meal-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
  min-height: 40px; padding: 6px 16px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--steel); background: var(--surface); font-weight: 600; font-size: 15px;
}
.pill-done[aria-pressed="true"] { background: var(--turmeric); border-color: var(--turmeric); color: #241A00; }
.pill-skip[aria-pressed="true"] { background: var(--chili-soft); border-color: var(--chili); color: var(--chili); }

.prep { background: var(--leaf-soft); border-radius: var(--radius-l); padding: 14px 16px; margin: 6px 0 18px; }
.prep ul { margin: 0; padding-left: 20px; }

/* trackers */
.trackers { border-top: 1px solid var(--steel); padding-top: 18px; margin-top: 8px; }
.counter { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; }
.counter-text { display: grid; }
.counter-label { font-weight: 600; }
.counter-note { display: block; font-size: 13px; font-weight: 400; color: var(--muted); }
.counter-ctrl { display: flex; align-items: center; gap: 10px; }
.counter-value { min-width: 2ch; text-align: center; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.meter { margin: 0 0 8px; }
.field-row { display: grid; grid-template-columns: 1fr 9rem; align-items: center; gap: 12px; padding: 10px 0; }

/* week */
.days { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 8px; }
.day { background: var(--surface); border-radius: var(--radius-s); border: 1px solid var(--steel); }
.day summary { display: flex; align-items: center; gap: 10px; padding: 14px 16px; cursor: pointer; list-style: none; min-height: 52px; }
.day summary::-webkit-details-marker { display: none; }
.day-name { font-weight: 700; font-size: 18px; }
.day-date { color: var(--muted); }
.day-score { margin-left: auto; font-weight: 700; color: var(--leaf); font-variant-numeric: tabular-nums; }
.day[open] summary { border-bottom: 1px solid var(--steel); }
.day-meals { margin: 0; padding: 12px 16px 4px; display: grid; grid-template-columns: 7rem 1fr; gap: 10px 12px; }
.day-meals dt { font-size: 14px; color: var(--muted); font-weight: 600; }
.day-meals dd { margin: 0; display: grid; gap: 2px; }
.day-meals dd span { font-size: 14px; color: var(--muted); }
.day .link { margin: 0 16px 8px; }

/* kitchen */
.segmented { display: grid; grid-template-columns: 1fr 1fr; background: var(--plate); border-radius: 999px; padding: 4px; margin-bottom: 14px; }
.segmented button { border: 0; background: transparent; min-height: 40px; border-radius: 999px; font-weight: 600; cursor: pointer; color: var(--muted); }
.segmented button[aria-selected="true"] { background: var(--surface); color: var(--leaf); font-weight: 700; }
.group { margin: 18px 0 6px; }
.group-head { display: flex; justify-content: space-between; align-items: baseline; }
.group h2 { font-size: 17px; color: var(--muted); }
.items { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--steel); }
.item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--steel); min-height: 56px; }
.item-text { display: grid; min-width: 0; }
.item-name { font-weight: 600; }
.item-qty { font-size: 14px; color: var(--muted); }
.item-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.tri { display: inline-flex; border: 1.5px solid var(--steel); border-radius: 999px; overflow: hidden; }
.opt { border: 0; background: var(--surface); min-height: 36px; padding: 4px 10px; font-size: 14px; font-weight: 600; cursor: pointer; color: var(--muted); }
.opt + .opt { border-left: 1px solid var(--steel); }
.opt-have[aria-pressed="true"] { background: var(--leaf); color: var(--bg); }
.opt-low[aria-pressed="true"] { background: var(--turmeric); color: #241A00; }
.opt-out[aria-pressed="true"] { background: var(--chili); color: var(--surface); }
.add-item { margin-top: 26px; }
.add-row { display: grid; grid-template-columns: 1fr 6.5rem auto; gap: 8px; }

/* progress */
.big-stat { margin: 0 0 6px; }
.big-num { font-size: 56px; font-weight: 700; color: var(--leaf); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.big-unit { font-size: 22px; color: var(--muted); }
.delta { display: block; font-weight: 600; }
.delta.down { color: var(--leaf); }
.delta.up { color: var(--chili); }
.chart { width: 100%; height: auto; margin: 6px 0 12px; }
.chart .grid { stroke: var(--steel); stroke-dasharray: 4 4; }
.chart .axis { font: 11px var(--font); fill: var(--muted); }
.chart .line { fill: none; stroke: var(--leaf); stroke-width: 2.5; stroke-linejoin: round; }
.chart .pt { fill: var(--turmeric); stroke: var(--surface); stroke-width: 1.5; }
.card-plain { padding: 18px 0; border-top: 1px solid var(--steel); }
.health { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 14px; }
.log-list { list-style: none; padding: 0; margin: 14px 0 0; }
.log-list li { display: grid; grid-template-columns: 5rem 1fr auto; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--steel); font-size: 15px; }
.bars { list-style: none; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; padding: 0; margin: 0; }
.bar { display: grid; justify-items: center; gap: 4px; }
.bar-track { position: relative; display: block; width: 100%; max-width: 34px; height: 90px; background: var(--plate); border-radius: 6px; overflow: hidden; }
.bar-fill { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: var(--turmeric); }
.bar-label { font-size: 13px; color: var(--muted); }
.summary { white-space: pre-wrap; font-family: var(--font); font-size: 15px; background: var(--surface); border: 1px solid var(--steel); border-radius: var(--radius-s); padding: 12px 14px; margin: 0; }

/* guide */
.guide-sec { border-bottom: 1px solid var(--steel); }
.guide-sec > summary { padding: 16px 0; font-weight: 700; font-size: 18px; cursor: pointer; min-height: 52px; }
.guide-body { padding-bottom: 16px; }
.guide-body ul, .guide-body ol { padding-left: 20px; margin: 0 0 10px; }
.guide-body li { margin-bottom: 6px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; margin-bottom: 8px; }
th { text-align: left; font-size: 13px; color: var(--muted); font-weight: 600; padding: 6px 8px 6px 0; border-bottom: 1px solid var(--steel); }
td { padding: 8px 8px 8px 0; border-bottom: 1px solid var(--plate); vertical-align: top; }
.cards-list { list-style: none; padding: 0 !important; }
.cards-list li { display: grid; gap: 2px; padding: 8px 0; border-bottom: 1px solid var(--plate); }
.portion { color: var(--leaf); font-weight: 600; }
.recipe { border-top: 1px solid var(--plate); }
.recipe > summary { padding: 10px 0; cursor: pointer; font-weight: 600; }
.faq dt { font-weight: 700; margin-top: 10px; }
.faq dd { margin: 2px 0 0; color: var(--muted); }
.steps li { margin-bottom: 8px; }

/* countdown and week preview */
.countdown { display: flex; align-items: baseline; gap: 12px; margin: 22px 0 8px; }
.countdown-num { font-size: 72px; font-weight: 700; line-height: 1; color: var(--leaf); font-variant-numeric: tabular-nums; }
.countdown-label { font-size: 20px; font-weight: 600; line-height: 1.2; max-width: 12em; }
.preview { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 8px; }
.preview-day { display: grid; gap: 2px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--steel); border-radius: 12px; color: var(--ink); text-decoration: none; }
.preview-title { font-weight: 700; color: var(--leaf); }
.preview-meal { font-size: 14px; color: var(--muted); }
.preview-meal b { font-weight: 600; color: var(--ink); }
.start h2 { margin-top: 18px; }

/* veg / non-veg marks (fixed colors: they're a standard, not a theme) */
.diet-mark { display: inline-grid; place-items: center; width: 14px; height: 14px; border: 1.5px solid; border-radius: 2px; margin-right: 7px; vertical-align: -1px; flex: none; background: #fff; }
.diet-mark::after { content: ""; display: block; }
.diet-veg { border-color: #1E8E3E; }
.diet-veg::after { width: 6px; height: 6px; border-radius: 50%; background: #1E8E3E; }
.diet-nonveg { border-color: #8B4513; }
.diet-nonveg::after { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-bottom: 7px solid #8B4513; }
.rcard-name { display: inline-flex; align-items: baseline; }
.veg-toggle { min-height: 36px; font-weight: 600; margin-top: 4px; }

/* calories and history */
.calories { border-top: 1px solid var(--steel); padding-top: 18px; margin-top: 8px; }
.cal-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 6px 0 12px; }
.cal-grid-6 { grid-template-columns: repeat(3, 1fr); }
.cal-stat { display: grid; gap: 1px; padding: 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--steel); min-width: 0; }
.cal-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.cal-num { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); line-height: 1.2; }
.cal-note { font-size: 11px; color: var(--muted); line-height: 1.25; }
.cal-good .cal-num { color: var(--leaf); }
.meal-kcal { font-size: 13px; color: var(--muted); margin: -4px 0 8px; display: flex; gap: 8px; align-items: center; }
.disclaimer { font-size: 14px; }
.segmented-3 { grid-template-columns: repeat(3, 1fr); }
.chart-box { margin: 16px 0 6px; }
.chart-box h3 { font-size: 15px; margin: 0 0 4px; }
.bars-chart .bar-eaten { fill: var(--turmeric); }
.bars-chart .bar-burned { fill: var(--leaf); }
.bars-chart .bar-steps { fill: var(--leaf); }
.bars-chart .bar-water { fill: #3A8DDE; }
.bars-chart .bar-meals { fill: var(--turmeric); }
.target-line { stroke: var(--chili); stroke-width: 1.5; stroke-dasharray: 4 3; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 13px; color: var(--muted); margin: 2px 0; }
.legend-item { display: inline-flex; align-items: center; gap: 5px; }
.swatch { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.swatch.bar-eaten, .swatch.bar-meals { background: var(--turmeric); }
.swatch.bar-burned, .swatch.bar-steps { background: var(--leaf); }
.swatch.bar-water { background: #3A8DDE; }
.swatch-line { height: 0; border-top: 2px dashed var(--chili); }
@media (max-width: 360px) { .cal-num { font-size: 18px; } }

/* diets catalog */
.program-list { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 12px; }
.program { background: var(--surface); border: 1px solid var(--steel); border-radius: var(--radius-l); padding: 16px; }
.program.is-current { border: 2px solid var(--leaf); }
.program-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.program-head h2 { margin: 0; color: var(--leaf); }
.program-meta { font-size: 14px; color: var(--muted); margin: 4px 0 8px; }
.program-preview { border-top: 1px solid var(--steel); margin-top: 12px; padding-top: 10px; }
.program-preview h3 { font-size: 15px; margin: 10px 0 6px; }
.program-preview ul:not(.preview) { padding-left: 20px; margin: 0 0 8px; }

/* own recipes */
.title-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.recipe-form { display: grid; gap: 6px; border-top: 0; }
.recipe-form label { margin-top: 8px; }
select { width: 100%; min-height: 46px; padding: 10px 12px; border: 1.5px solid var(--steel); border-radius: var(--radius-s); background: var(--surface); font: inherit; color: inherit; }
input[type="url"], input[type="email"] { width: 100%; min-height: 46px; padding: 10px 12px; border: 1.5px solid var(--steel); border-radius: var(--radius-s); background: var(--surface); }
.rcard-body .btn-small { margin-top: 10px; }

/* shared kitchen */
.sync-line { font-size: 14px; color: var(--muted); background: var(--leaf-soft); border-radius: var(--radius-s); padding: 8px 12px; margin: 0 0 12px; }
.sync-line strong { color: var(--leaf); }
.sync-line .link { padding: 0; font-size: 14px; }
.sync-offline, .sync-signin, .sync-paused { background: var(--turmeric-soft); }
.item-by { font-size: 12px; color: var(--leaf); }
.inline-form { display: grid; gap: 6px; margin-top: 14px; }
.inline-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.kitchens h3, .card-plain h3 { font-size: 16px; margin: 16px 0 6px; }
.kitchen-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--steel); }
.kitchen-current { font-size: 18px; margin: 4px 0 8px; }
.members li { grid-template-columns: 1fr auto auto; }
.members .fine { font-size: 13px; text-align: right; word-break: break-all; }

/* recipes */
.filters {
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  margin: 12px -16px 4px; padding: 2px 16px 6px;
}
.filters::-webkit-scrollbar { display: none; }
.filter {
  flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 14px;
  border-radius: 999px; border: 1.5px solid var(--steel); background: var(--surface);
  font-weight: 600; font-size: 15px; color: var(--ink); cursor: pointer;
}
.filter[aria-pressed="true"] { background: var(--leaf); border-color: var(--leaf); color: var(--bg); }
.filter-sub { min-height: 34px; font-size: 14px; padding: 4px 12px; }
.filter-sub[aria-pressed="true"] { background: var(--leaf-soft); color: var(--leaf); border-color: var(--leaf); }
.count { font-size: 12px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--plate); color: var(--muted); }
.filter[aria-pressed="true"] .count { background: var(--surface); color: var(--leaf); }
.recipe-group h2 { display: flex; align-items: center; gap: 8px; font-size: 17px; color: var(--muted); margin: 20px 0 8px; }
.recipe-cards { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.rcard { background: var(--surface); border: 1px solid var(--steel); border-radius: 14px; overflow: hidden; }
.rcard summary { display: flex; align-items: center; gap: 12px; padding: 10px 14px; min-height: 62px; cursor: pointer; list-style: none; }
.rcard summary::-webkit-details-marker { display: none; }
.rcard[open] summary { border-bottom: 1px solid var(--steel); }
.rcard-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; flex: none; background: var(--leaf-soft); color: var(--leaf); }
.rc-shots { background: var(--turmeric-soft); color: var(--ink); }
.rc-desserts { background: var(--chili-soft); color: var(--chili); }
.rc-drinks, .rc-snacks { background: var(--plate); color: var(--leaf); }
.rcard-text { display: grid; min-width: 0; }
.rcard-name { font-weight: 700; line-height: 1.25; }
.rcard-meta { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rcard-body { padding: 10px 16px 16px; }
.rcard-body h4 { margin-top: 14px; }
.rcard-body ul:not(.chips), .rcard-body ol { padding-left: 20px; margin: 4px 0; }
.rcard-body li { margin-bottom: 4px; }
.rcard-body .notice { margin-bottom: 0; }
.guide-link { padding: 16px 0; border-bottom: 1px solid var(--steel); margin: 0; font-weight: 600; }

/* appearance picker (preview colors are fixed per theme, not tokens) */
.themes { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-top: 10px; }
.theme-opt {
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-s); border: 1.5px solid var(--steel);
  background: var(--surface); text-align: left; cursor: pointer; min-height: 56px;
}
.theme-opt[aria-checked="true"] { border-color: var(--leaf); box-shadow: 0 0 0 2px var(--leaf); }
.theme-name { display: grid; font-weight: 600; font-size: 15px; }
.theme-name small { font-weight: 400; font-size: 12px; color: var(--muted); }
.dots { display: grid; grid-template-columns: repeat(3, 14px); gap: 3px; padding: 6px; border-radius: 8px; }
.dots span { width: 14px; height: 14px; border-radius: 50%; }
.dots-thali { background: #EEF1EF; } .dots-thali span:nth-child(1) { background: #1F5A3A; } .dots-thali span:nth-child(2) { background: #D99A06; } .dots-thali span:nth-child(3) { background: #B23A2A; }
.dots-mint { background: #F4FAF9; } .dots-mint span:nth-child(1) { background: #0F766E; } .dots-mint span:nth-child(2) { background: #F97362; } .dots-mint span:nth-child(3) { background: #CCEFEA; }
.dots-sunrise { background: #FFF8F2; } .dots-sunrise span:nth-child(1) { background: #C2410C; } .dots-sunrise span:nth-child(2) { background: #E8A33D; } .dots-sunrise span:nth-child(3) { background: #FDE5D3; }
.dots-night { background: #16191D; } .dots-night span:nth-child(1) { background: #A3E635; } .dots-night span:nth-child(2) { background: #E8ECEF; } .dots-night span:nth-child(3) { background: #F87171; }

/* chrome */
.update {
  position: sticky; top: 0; z-index: 15; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  max-width: 34rem; margin: 0 auto; padding: 10px 16px; background: var(--leaf); color: var(--bg);
}
.update[hidden] { display: none; }
.update .btn { border-color: var(--bg); color: var(--bg); }
.toast {
  position: fixed; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom)); z-index: 30;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  width: max-content; max-width: calc(100vw - 32px);
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: var(--radius-s); font-size: 15px;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 360px) {
  .day-number { font-size: 44px; }
  .meal { grid-template-columns: 62px 1fr; }
  .add-row { grid-template-columns: 1fr auto; }
  .add-row input:nth-of-type(2) { grid-column: 1; }
}

/* motion: one opening moment, feedback on actions, one celebration */
.thali-glow { fill: none; stroke: var(--turmeric); stroke-width: 6; opacity: 0; transform-origin: 100px 100px; }
.thali.intro .seg { animation: seg-in 0.5s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i, 0) * 70ms + 120ms); transform-origin: 100px 100px; }
.seg-pop { animation: seg-pop 0.45s cubic-bezier(.3,1.6,.5,1); transform-origin: 100px 100px; }
.thali.complete .thali-katori { fill: var(--turmeric-soft); stroke: var(--turmeric); }
.thali.celebrate .thali-glow { animation: glow 1.1s ease-out 2; }
.thali.celebrate .thali-katori { animation: katori 0.6s cubic-bezier(.3,1.6,.5,1); transform-origin: 100px 100px; }
.notice-missed.nudge { animation: nudge 0.5s ease-out 0.4s; }
@keyframes seg-in { from { opacity: 0; transform: scale(0.85) rotate(-8deg); } to { opacity: 1; transform: none; } }
@keyframes seg-pop { 0% { transform: scale(1); } 45% { transform: scale(1.07); } 100% { transform: scale(1); } }
@keyframes glow { from { opacity: 0.7; transform: scale(1); } to { opacity: 0; transform: scale(1.12); } }
@keyframes katori { 0% { transform: scale(1); } 50% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes press { 0% { transform: scale(1); } 40% { transform: scale(0.94); } 100% { transform: scale(1); } }
@keyframes check-in { from { transform: scale(0.4); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes nudge { 0%, 100% { transform: none; } 25% { transform: translateX(-4px); } 60% { transform: translateX(3px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
