/* NutriHug Studio. Two looks share one set of components, and components read only tokens:
   «Studio» (default): Apple-style, system font, grouped surfaces on a grey ground, translucent bars, capsule controls.
   «Κλασικό» (<html data-style="classic">): the original olive look, Commissioner, surfaces separated by tone.
   Each has light and dark (<html data-theme="dark">). The choice is per device: see _boot.html and Ρυθμίσεις → Εμφάνιση. */

/* Commissioner (SIL OFL 1.1), self-hosted: Latin + Greek subsets. Only the classic look asks for it. */
@font-face { font-family: "Commissioner"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("fonts/commissioner-greek.3cd506322c76.woff2") format("woff2"); unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF; }
@font-face { font-family: "Commissioner"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("fonts/commissioner-latin-ext.f33cd9c8e306.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Commissioner"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("fonts/commissioner-latin.8c4ddafbebbf.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ---------- tokens: Studio, light. Text colours are Apple's accessible system colours (4.5:1 on their own tints). */
:root {
  --bg: #f2f2f7; --surface: #ffffff; --surface-2: #f5f5f7; --surface-3: #e8e8ed;
  --ink: #1d1d1f; --ink-2: #3c3c43; --muted: #636366; --line: #e3e3e8; --line-2: #d1d1d6;
  --brand: #1f7a3a; --brand-2: #196630; --brand-ink: #ffffff; --brand-soft: #e2f3e6; --brand-tint: #f2faf4;
  --ok: #1f7a3a; --ok-soft: #e2f3e6; --warn: #a64b00; --warn-soft: #fff1df; --err: #d70015; --err-soft: #ffe9ea;
  --info: #0040dd; --info-soft: #e8efff;
  --g-A: #5c3d28; --g-A-soft: #e6d2bd; --g-F: #6b5300; --g-F-soft: #ffe866; --g-G: #0040dd; --g-G-soft: #c9d9ff;
  --g-V: #17662f; --g-V-soft: #c5ecd0; --g-P: #086a8e; --g-P-soft: #b8ecf7; --g-E: #086a8e; --g-E-soft: #b8ecf7;
  --g-L: #a80f15; --g-L-soft: #ffc9c4;  /* Α καφέ · Φ κίτρινο · Γ μπλε · Λαχ πράσινο · Π και Αυγ γαλάζιο · Λ κόκκινο (η διαιτολόγος, 19/11) */
  /* fills and materials */
  --fill: rgb(118 118 128 / .12); --fill-2: rgb(118 118 128 / .2); --hover: rgb(118 118 128 / .07); --field: #ffffff;
  --btn: var(--fill); --btn-in: var(--fill); --btn-hover: var(--fill-2); --pill: var(--fill); --th-bg: transparent; --th-ink: var(--muted);
  --bar: rgb(242 242 247 / .8); --side-bg: rgb(255 255 255 / .74); --sheet-bg: rgb(242 242 247 / .86); --blur: saturate(180%) blur(20px);
  --seg-track: var(--fill); --seg-on: #ffffff; --seg-on-ink: var(--ink); --seg-shadow: 0 3px 8px rgb(0 0 0 / .1), 0 2px 1px rgb(0 0 0 / .04);
  --nav-on: rgb(31 122 58 / .13); --nav-on-ink: var(--ink); --switch-on: #34c759;
  --avatar: linear-gradient(180deg, #a6abb7, #858a96); --avatar-ink: #ffffff;
  --mark: linear-gradient(160deg, #45c766, #1a8a43); --today: #d70015;
  --toast: rgb(36 36 38 / .9); --toast-ink: #ffffff;
  --hero: linear-gradient(180deg, #d9f0e0 0%, var(--bg) 100%); --hero-ink: var(--ink); --hero-sub: var(--ink-2);
  --art: linear-gradient(155deg, #1d8445 0%, #106049 58%, #0b4239 100%);
  /* shape, type, motion */
  --radius: 18px; --radius-sm: 12px; --radius-xs: 8px; --radius-btn: 999px; --radius-field: 10px; --radius-nav: 10px;
  --card-pad: 18px 20px; --shadow: 0 0 0 .5px rgb(0 0 0 / .05), 0 1px 2px rgb(0 0 0 / .04), 0 8px 24px -14px rgb(0 0 0 / .14);
  --shadow-lg: 0 0 0 .5px rgb(0 0 0 / .08), 0 30px 70px -20px rgb(0 0 0 / .32), 0 6px 18px -6px rgb(0 0 0 / .12);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", system-ui, Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif;
  --font-head: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI Variable Display", "Segoe UI", system-ui, Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif;
  --font-num: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display", "Segoe UI", system-ui, Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, monospace;
  --h1: 2.125rem; --h1-weight: 700; --h2: 1.0625rem; --head-weight: 600; --track: -.012em; --press: scale(.97);
  --side-w: 264px; --side-gap: 10px; --side-radius: 22px; --sheet-gap: 10px; --sheet-radius: 22px; --sheet-edge: 0;
  --top-h: 56px; --control-h: 36px;
  /* a critically damped spring (Apple's default: damping 1, response .4 s), sampled for CSS */
  --spring: linear(0, .044 5%, .143 10%, .263 15%, .383 20%, .494 25%, .592 30%, .743 40%, .844 50%, .907 60%, .946 70%, .969 80%, .982 90%, 1);
  --dur: .42s;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #000000; --surface: #1c1c1e; --surface-2: #2c2c2e; --surface-3: #3a3a3c;
  --ink: #f5f5f7; --ink-2: #d1d1d6; --muted: #aeaeb2; --line: #38383a; --line-2: #48484a;
  --brand: #30d158; --brand-2: #5ce07a; --brand-ink: #032b10; --brand-soft: #193a24; --brand-tint: #14231a;
  --ok: #30d158; --ok-soft: #193a24; --warn: #ffb340; --warn-soft: #3d2b10; --err: #ff6961; --err-soft: #401a19;
  --info: #409cff; --info-soft: #132a4a;
  --g-A: #d9b48f; --g-A-soft: #4a3626; --g-F: #ffd60a; --g-F-soft: #5c4d00; --g-G: #7fb0ff; --g-G-soft: #1b3a70;
  --g-V: #4ee07a; --g-V-soft: #1f4d2d; --g-P: #7fdcff; --g-P-soft: #0f4a5e; --g-E: #7fdcff; --g-E-soft: #0f4a5e;
  --g-L: #ff8a82; --g-L-soft: #5e2020;
  --fill: rgb(118 118 128 / .24); --fill-2: rgb(118 118 128 / .36); --hover: rgb(255 255 255 / .05); --field: rgb(118 118 128 / .14);
  --bar: rgb(0 0 0 / .74); --side-bg: rgb(28 28 30 / .78); --sheet-bg: rgb(18 18 20 / .86);
  --seg-on: #636366; --seg-on-ink: #ffffff; --seg-shadow: 0 3px 8px rgb(0 0 0 / .3);
  --nav-on: rgb(48 209 88 / .16); --switch-on: #30d158;
  --avatar: linear-gradient(180deg, #6e6e74, #4a4a4f);
  --toast: rgb(58 58 60 / .92);
  --hero: linear-gradient(180deg, #0d2a18 0%, var(--bg) 100%);
  --art: linear-gradient(155deg, #11502c 0%, #0b3b31 58%, #072623 100%);
  --shadow: 0 0 0 .5px rgb(255 255 255 / .07);
  --shadow-lg: 0 0 0 .5px rgb(255 255 255 / .1), 0 30px 70px -20px rgb(0 0 0 / .85);
  color-scheme: dark;
}

/* ---------- tokens: Κλασικό (the original look, values unchanged) */
:root[data-style="classic"] {
  --bg: #eceee6; --surface: #ffffff; --surface-2: #f4f5ef; --surface-3: #e4e8db;
  --ink: #1b2416; --ink-2: #435039; --muted: #5d6655; --line: #dfe3d6; --line-2: #c9d0bd;
  --brand: #3f5a2a; --brand-2: #4d6c34; --brand-ink: #ffffff; --brand-soft: #e1ebd6; --brand-tint: #f2f6ec;
  --ok: #2b784a; --ok-soft: #e1f2e7; --warn: #8f5c0f; --warn-soft: #fbf0d9; --err: #b4291f; --err-soft: #fbe5e2;
  --info: #2f5f8a; --info-soft: #e3edf7;
  --g-A: #6b4c2e; --g-A-soft: #e3d3bf; --g-F: #6a5810; --g-F-soft: #f1e39b; --g-G: #2a528a; --g-G-soft: #c8d8f0;
  --g-V: #36662a; --g-V-soft: #cfe6c4; --g-P: #17636e; --g-P-soft: #bfe6e9; --g-E: #17636e; --g-E-soft: #bfe6e9;
  --g-L: #96291f; --g-L-soft: #f3c7c2;
  --fill: var(--surface-2); --fill-2: var(--surface-3); --hover: var(--surface-2); --field: var(--surface);
  --btn: var(--surface); --btn-in: var(--surface-2); --btn-hover: var(--surface-3); --pill: var(--surface-3); --th-bg: var(--surface-2); --th-ink: var(--ink-2);
  --bar: var(--bg); --side-bg: var(--surface); --sheet-bg: var(--bg); --blur: none;
  --seg-track: var(--surface-3); --seg-on: var(--surface); --seg-on-ink: var(--brand); --seg-shadow: none;
  --nav-on: var(--brand-soft); --nav-on-ink: var(--brand); --switch-on: var(--brand);
  --avatar: var(--brand-soft); --avatar-ink: var(--brand);
  --mark: var(--brand); --today: var(--brand);
  --toast: var(--ink); --toast-ink: var(--bg);
  --hero: #3f5a2a; --hero-ink: #ffffff; --hero-sub: #dfe9d3; --art: #3f5a2a;
  --radius: 10px; --radius-sm: 6px; --radius-xs: 5px; --radius-btn: 6px; --radius-field: 6px; --radius-nav: 6px;
  --card-pad: 20px 22px; --shadow: none;
  --shadow-lg: 0 18px 40px -12px rgb(20 28 14 / .28), 0 2px 6px rgb(20 28 14 / .08);
  --font: "Commissioner", "Segoe UI", system-ui, -apple-system, "Noto Sans", Arial, sans-serif;
  --font-head: var(--font); --font-num: var(--font);
  --h1: 2rem; --h1-weight: 650; --h2: 1.02rem; --head-weight: 650; --track: -.015em; --press: translateY(1px);
  --side-w: 240px; --side-gap: 0px; --side-radius: 0px; --sheet-gap: 0px; --sheet-radius: 0px; --sheet-edge: 1px;
  --top-h: 60px; --control-h: 38px;
}
:root[data-style="classic"][data-theme="dark"] {
  --bg: #0f130d; --surface: #191f15; --surface-2: #20271b; --surface-3: #2a3323;
  --ink: #e8eee0; --ink-2: #c3ccb8; --muted: #9aa58e; --line: #2d3727; --line-2: #3d4934;
  --brand: #9cc472; --brand-2: #b2d48c; --brand-ink: #11170c; --brand-soft: #263522; --brand-tint: #1c2518;
  --ok: #79c79a; --ok-soft: #173325; --warn: #e2b45c; --warn-soft: #362a12; --err: #f08b80; --err-soft: #3b1a17;
  --info: #8db9e2; --info-soft: #172a3b;
  --g-A: #d6b796; --g-A-soft: #45372a; --g-F: #e6cf6a; --g-F-soft: #4a431a; --g-G: #9cc0ee; --g-G-soft: #1f3757;
  --g-V: #9ad485; --g-V-soft: #27441f; --g-P: #8fdbe6; --g-P-soft: #1c444d; --g-E: #8fdbe6; --g-E-soft: #1c444d;
  --g-L: #f29d92; --g-L-soft: #57261f;
  --shadow-lg: 0 18px 40px -12px rgb(0 0 0 / .7);
  color-scheme: dark;
}

/* ---------- base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--top-h) + 64px); }
a, button, input, select, textarea, label, summary { touch-action: manipulation; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.47 var(--font); font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
/* links inside running text are underlined, not colour-only (WCAG 1.4.1) */
p a, li a:not(.title):not(.btn), .notice a, dd a, .help-grid a { text-decoration: underline; text-underline-offset: 3px; }
.list li > a.title, .list .grow > a.title, .r-card, .nav a, .side-foot a { text-decoration: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; font-family: var(--font-head); font-weight: var(--head-weight); letter-spacing: var(--track); text-wrap: balance; }
h1 { font-size: var(--h1); font-weight: var(--h1-weight); letter-spacing: -.025em; line-height: 1.12; }
h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
p { margin: 0 0 .6em; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.sr { position: absolute; 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: 100; border-radius: 8px; }
.skip:focus { left: 8px; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
code { font-family: var(--mono); font-size: .9em; }

/* ---------- shell: sidebar (a floating glass panel in Studio), top bar, page */
.side { position: fixed; z-index: 40; top: var(--side-gap); bottom: var(--side-gap); left: var(--side-gap); width: calc(var(--side-w) - 2 * var(--side-gap));
  display: flex; flex-direction: column; padding: 14px 10px 10px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none;
  background: var(--side-bg); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border-radius: var(--side-radius); box-shadow: var(--shadow); }
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 14px; color: var(--ink); font-size: 1.02rem; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--mark); color: #fff; flex: none;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .25); }
.brand-mark svg { width: 19px; height: 19px; }
.nav, .side-foot, .nav-group { display: flex; flex-direction: column; gap: 1px; }
.nav-h { margin: 16px 10px 4px; font-size: .75rem; font-weight: 600; color: var(--muted); letter-spacing: .01em; }
.nav a, .side-foot > a { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 5px 8px; border-radius: var(--radius-nav);
  color: var(--ink-2); font-weight: 500; font-size: .94rem; transition: background .15s; }
.nav a:hover, .side-foot > a:hover { background: var(--hover); text-decoration: none; color: var(--ink); }
.nav a[aria-current="page"], .side-foot > a[aria-current="page"] { background: var(--nav-on); color: var(--nav-on-ink); font-weight: 600; }
.nav .pill { margin-left: auto; color: var(--ink-2); }
/* Studio: each place has its own coloured tile, like System Settings; the classic look keeps the bare icon */
.nav-ico { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: var(--tile, var(--muted)); color: #fff; flex: none;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .22); }
.nav-ico svg { width: 16px; height: 16px; stroke-width: 2; }
.side-foot { margin-top: auto; padding-top: 12px; }
.me { display: flex; align-items: center; gap: 2px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.me-link { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; padding: 4px 6px; border-radius: var(--radius-nav); color: var(--ink); }
.me-link:hover { background: var(--hover); text-decoration: none; }
.me-link .lbl { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.me-link b { font-weight: 600; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-link .muted { font-size: .76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me .icon-btn { width: 32px; height: 32px; background: none; color: var(--muted); }
.me .icon-btn:hover { background: var(--hover); color: var(--ink); }
.me form { display: contents; }
.linklike { background: none; border: 0; font: inherit; cursor: pointer; width: 100%; text-align: left; }
.shell { margin-left: var(--side-w); min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 30; height: var(--top-h); display: flex; align-items: center; gap: 12px; padding: 0 28px;
  background: var(--bar); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); transition: box-shadow .2s; }
:root[data-scrolled]:not([data-style="classic"]) .top { box-shadow: 0 .5px 0 var(--line-2); }  /* the edge shows only once content runs under it */
.crumbs { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .9rem; min-width: 0; }
.crumbs a { color: var(--muted); } .crumbs b { color: var(--ink); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-search { margin-left: auto; position: relative; width: min(340px, 40vw); }
.top-search svg { position: absolute; left: 12px; top: 50%; translate: 0 -50%; color: var(--muted); width: 16px; height: 16px; }
.top-search input { padding-left: 36px; height: 36px; min-height: 36px; background: var(--btn); border-color: transparent; border-radius: var(--radius-btn); }
.top-search input:focus { background: var(--field); }
.icon-btn.menu-btn { display: none; }
.page { padding: 24px 32px 64px; max-width: 1360px; width: 100%; margin: 0 auto; }
.page-wide { padding: 18px 20px 60px; width: 100%; }
.scrim { position: fixed; inset: 0; background: rgb(0 0 0 / .32); z-index: 35; }

/* ---------- page headings */
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px 20px; flex-wrap: wrap; margin-bottom: 22px; }
.head h1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.head .sub { color: var(--muted); margin-top: 6px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.section-title { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; margin: 0 0 12px; }
.section-title h2, .section-title h3 { font-size: var(--h2); white-space: nowrap; }
summary.section-title { cursor: pointer; list-style: none; flex-wrap: nowrap; margin: 0; }
summary.section-title h2 { white-space: normal; } summary.section-title::-webkit-details-marker { display: none; }
summary.section-title::after { content: ""; flex: none; width: 7px; height: 7px; margin: 0 4px 3px 0; border: solid var(--muted); border-width: 0 2px 2px 0;
  rotate: -45deg; transition: rotate .2s; }
details[open] > summary.section-title::after { rotate: 45deg; }
details[open] > summary.section-title { margin-bottom: 12px; }

/* ---------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: var(--control-h); padding: 0 15px; border-radius: var(--radius-btn);
  border: 1px solid transparent; background: var(--btn); color: var(--ink); font: 500 .92rem/1 var(--font); cursor: pointer; white-space: nowrap;
  -webkit-user-select: none; user-select: none; transition: background .15s, border-color .15s, transform .12s, opacity .15s; }
.btn:hover { background: var(--btn-hover); text-decoration: none; }
.btn:active { transform: var(--press); }
.btn svg { width: 16px; height: 16px; }
.card .btn:not(.btn-primary):not(.btn-ghost), .panel .btn:not(.btn-primary):not(.btn-ghost) { background: var(--btn-in); }
.card .btn:not(.btn-primary):not(.btn-ghost):hover, .panel .btn:not(.btn-primary):not(.btn-ghost):hover { background: var(--btn-hover); }
.btn.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.btn-primary:hover { background: var(--brand-2); border-color: var(--brand-2); }
.btn.btn-ghost { border-color: transparent; background: transparent; }
.btn.btn-ghost:hover { background: var(--hover); }
.btn-danger { color: var(--err); }
.btn.btn-danger:hover { background: var(--err-soft); }
.btn-sm { height: calc(var(--control-h) - 6px); padding: 0 11px; font-size: .84rem; }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.btn-block { width: 100%; height: 46px; margin-top: 6px; font-size: 1rem; }
.icon-btn { display: inline-grid; place-items: center; width: var(--control-h); height: var(--control-h); border-radius: var(--radius-btn); border: 0;
  background: var(--btn); color: var(--ink); cursor: pointer; transition: background .15s, transform .12s; }
.icon-btn:hover { background: var(--btn-hover); text-decoration: none; }
.icon-btn:active { transform: var(--press); }
.icon-btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
/* related actions sit together: one joined capsule in Studio, a plain row in the classic look */
.btn-group { display: inline-flex; align-items: center; gap: 2px; padding: 2px; border-radius: var(--radius-btn); background: var(--btn); }
.btn-group > .btn, .btn-group > .icon-btn { background: transparent; height: calc(var(--control-h) - 4px); }
.btn-group > .icon-btn { width: calc(var(--control-h) - 4px); }
.btn-group > .btn:hover, .btn-group > .icon-btn:hover { background: var(--surface); box-shadow: var(--seg-shadow); }
.btn-group > .btn-ghost { color: var(--ink); }

/* ---------- form controls */
input, select, textarea { width: 100%; font: inherit; color: var(--ink); background-color: var(--field); border: 1px solid var(--line-2);
  border-radius: var(--radius-field); padding: 8px 12px; min-height: var(--control-h); transition: border-color .15s, box-shadow .15s; }
textarea { resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }
/* one chevron on every platform, drawn in the theme's colour */
select { appearance: none; -webkit-appearance: none; padding-right: 34px; max-width: 100%;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; min-height: 0; padding: 0; accent-color: var(--brand); flex: none; }
input[type="file"] { padding: 5px; cursor: pointer; }
input[type="file"]::file-selector-button { font: inherit; font-size: .86rem; font-weight: 600; color: var(--ink); background: var(--fill);
  border: 0; border-radius: var(--radius-btn); padding: 6px 13px; margin-right: 10px; cursor: pointer; transition: background .15s; }
input[type="file"]::file-selector-button:hover { background: var(--fill-2); }
label { display: block; font-size: .85rem; font-weight: 550; color: var(--ink-2); margin-bottom: 6px; }
.field { margin-bottom: 14px; }
.field .help { color: var(--muted); font-size: .8rem; margin-top: 5px; }
.field .err { color: var(--err); font-size: .82rem; margin-top: 5px; }
.field-check { display: flex; align-items: center; gap: 9px; }
.field-check label { margin: 0; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0 18px; }
.form-grid .wide { grid-column: 1 / -1; }
fieldset.card { margin: 0; border: 0; min-width: 0; }
fieldset.card > legend { float: left; width: 100%; padding: 0; margin-bottom: 14px; font: var(--head-weight) var(--h2)/1.3 var(--font-head); letter-spacing: var(--track); color: var(--ink); }
fieldset.card > legend + * { clear: both; }
.field-check-wrap .help, .field-check-wrap .err { margin-left: 27px; }
.form-page { display: flex; flex-direction: column; gap: 16px; }
.form-page > .card + .card { margin-top: 0; }
/* long forms keep Save in reach: the action bar floats at the bottom of the window */
.form-actions { position: sticky; bottom: 12px; z-index: 10; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 12px;
  background: var(--sheet-bg); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.form-actions .field-check { flex: 1 1 100%; padding: 2px 4px 6px; }
.form-actions .btn-danger { margin-left: auto; }
:root[data-style="classic"] .form-actions { background: var(--surface); box-shadow: 0 6px 20px -8px rgb(20 28 14 / .25); }
.switch { width: 44px; height: 26px; border-radius: 99px; border: 0; background: var(--fill-2); position: relative; cursor: pointer; flex: none; padding: 0; transition: background .2s; }
.switch span { position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform var(--dur) var(--spring);
  box-shadow: 0 2px 6px rgb(0 0 0 / .18), 0 1px 1px rgb(0 0 0 / .12); }
.switch[aria-checked="true"] { background: var(--switch-on); } .switch[aria-checked="true"] span { transform: translateX(18px); }

/* ---------- surfaces: cards, stat tiles, lists */
.card { background: var(--surface); border-radius: var(--radius); padding: var(--card-pad); min-width: 0; box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.grid > .card, .grid > * > .card:first-child { margin-top: 0; }
.card-flush { padding: 0; overflow: hidden; }
.grid { display: grid; gap: 16px; align-items: start; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-side { grid-template-columns: minmax(0, 1fr) 360px; }
.columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.col > .card + .card { margin-top: 0; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { background: var(--surface); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); min-width: 0; }
.stat .label { display: flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: .86rem; font-weight: 600; }
.stat .label svg { width: 15px; height: 15px; stroke-width: 2.2; color: var(--tile, var(--brand)); }
.stat .value { font-family: var(--font-num); font-size: 2rem; font-weight: 650; letter-spacing: -.025em; line-height: 1.1; margin-top: 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .value small { font-size: .5em; font-weight: 600; letter-spacing: 0; color: var(--muted); margin-left: 3px; }
.stat .foot { color: var(--muted); font-size: .8rem; margin-top: 2px; }
.list { list-style: none; margin: 0; padding: 0; }
.list > li { position: relative; display: flex; align-items: center; gap: 12px; padding: 11px 0; min-width: 0; }
.list > li + li::before { content: ""; position: absolute; top: 0; right: 0; left: var(--sep-inset, 0); border-top: 1px solid var(--line); }
.list .grow { flex: 1; min-width: 0; }
.list > li.li-wrap { flex-wrap: wrap; } .list > li.li-wrap > .grow { flex: 1 1 180px; min-width: min(180px, 100%); }
.list > li.li-wrap > :last-child:not(.grow) { margin-left: auto; }
.list > li.li-wrap > details.edit > summary { list-style: none; display: inline-flex; } .list > li.li-wrap > details.edit > summary::-webkit-details-marker { display: none; }
.list > li.li-wrap > details.edit[open] { flex-basis: 100%; }  /* closed: one row with the button; open: the form on its own line */
.list .title { font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
/* the whole row opens the record (a bigger target than the name); the row's own buttons and links stay on top */
.list > li > .grow > a.title::after, .list > li > a.title::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius-xs); }
.list > li :is(form, button, .btn, a:not(.title), details, input, select, textarea, .chat-btns) { position: relative; z-index: 1; }
.list > li:has(> .grow > a.title, > a.title):hover { background: linear-gradient(var(--hover), var(--hover)) no-repeat; background-size: calc(100% + 16px) 100%; background-position: center; }
.chat-btns { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.empty { color: var(--muted); padding: 22px 0; text-align: center; font-size: .92rem; }
.empty svg { width: 28px; height: 28px; display: block; margin: 0 auto 8px; opacity: .55; }
.avatar { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--avatar); color: var(--avatar-ink);
  font-weight: 600; font-size: .82rem; letter-spacing: .02em; flex: none; }
.avatar-sm { width: 30px; height: 30px; font-size: .72rem; }
.avatar-lg { width: 60px; height: 60px; font-size: 1.25rem; }
.time { font-variant-numeric: tabular-nums; font-weight: 650; color: var(--brand); min-width: 48px; }
/* Studio: row separators start where the text starts, after the avatar or the time */
:root:not([data-style="classic"]) .list > li:has(> .avatar) { --sep-inset: 48px; }
:root:not([data-style="classic"]) .list > li:has(> .time) { --sep-inset: 60px; }

/* ---------- tables */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-size: .8rem; color: var(--th-ink); font-weight: 600; padding: 10px 16px; border-bottom: 1px solid var(--line);
  background: var(--th-bg); white-space: nowrap; }
.table td { padding: 11px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--hover); }
.table .r { text-align: right; }
.row-link { color: var(--ink); font-weight: 600; }
/* clickable rows: the name's link covers the row, other controls stay above it */
.table-link tbody tr { position: relative; }
.table-link .row-link::after { content: ""; position: absolute; inset: 0; }
.table-link td :is(a:not(.row-link), button, form) { position: relative; z-index: 1; }

/* ---------- pills and exchange chips */
.pill { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 99px; font-size: .74rem; font-weight: 600;
  background: var(--pill); color: var(--ink-2); white-space: nowrap; }
a.pill:hover { text-decoration: none; filter: brightness(.97); }
.pill-muted { background: var(--fill); color: var(--muted); }
.pill-ok { background: var(--ok-soft); color: var(--ok); } .pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-err { background: var(--err-soft); color: var(--err); } .pill-info { background: var(--info-soft); color: var(--info); }
.pill-brand { background: var(--brand-soft); color: var(--brand); }
.tags { display: flex; gap: 5px; flex-wrap: wrap; }
.chips { display: flex; gap: 4px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: baseline; gap: 2px; padding: 1px 7px; border-radius: 99px; font-size: .76rem; font-weight: 650;
  font-variant-numeric: tabular-nums; background: var(--surface-3); color: var(--ink-2); line-height: 1.5; }
.chip[data-g="Α"] { background: var(--g-A-soft); color: var(--g-A); } .chip[data-g="Φ"] { background: var(--g-F-soft); color: var(--g-F); }
.chip[data-g="Γ"] { background: var(--g-G-soft); color: var(--g-G); } .chip[data-g="Λαχ"] { background: var(--g-V-soft); color: var(--g-V); }
.chip[data-g="Π"], .chip[data-g="Π2"], .chip[data-g="Π3"] { background: var(--g-P-soft); color: var(--g-P); } .chip[data-g="Αυγ"] { background: var(--g-E-soft); color: var(--g-E); }
.chip[data-g="Λ"] { background: var(--g-L-soft); color: var(--g-L); }

/* ---------- segmented controls, filters, in-page navigation */
.seg { display: inline-flex; background: var(--seg-track); border-radius: calc(var(--radius-sm) - 2px); padding: 2px; gap: 2px; flex-wrap: wrap; }
:root:not([data-style="classic"]) .seg { border-radius: 10px; }
.seg a, .seg button { padding: 5px 12px; border: 0; border-radius: 8px; background: none; color: var(--ink-2); font: 550 .87rem var(--font); cursor: pointer;
  transition: background .15s, box-shadow .15s; }
.seg a:hover, .seg button:hover { text-decoration: none; background: var(--hover); }
.seg a[aria-current="page"], .seg button[aria-pressed="true"] { background: var(--seg-on); color: var(--seg-on-ink); box-shadow: var(--seg-shadow); font-weight: 600; }
.seg label { position: relative; margin: 0; padding: 5px 14px; border-radius: 8px; color: var(--ink-2); font: 550 .87rem var(--font); cursor: pointer; }
.seg label input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:hover { background: var(--hover); }
.seg label:has(input:checked) { background: var(--seg-on); color: var(--seg-on-ink); box-shadow: var(--seg-shadow); font-weight: 600; }
.seg label:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 1px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filters input[type="search"] { max-width: 320px; }
.filters select { width: auto; }
.jump { position: sticky; top: var(--top-h); z-index: 20; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
  background: var(--bar); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); padding: 8px 2px 10px; margin: -8px -2px 12px; }
.jump a { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px; border-radius: 99px; background: var(--surface); color: var(--ink-2);
  font-size: .85rem; font-weight: 550; box-shadow: var(--shadow); }
.jump a:hover { background: var(--brand-soft); color: var(--brand); text-decoration: none; }
.jump a[aria-current="true"] { background: var(--brand); color: var(--brand-ink); }
.jump .nav-ico { width: 20px; height: 20px; border-radius: 6px; } .jump .nav-ico svg { width: 13px; height: 13px; }

/* ---------- ⓘ hints: a quiet button by a heading or control, its text in one floating bubble (app.js) */
.info { display: inline-grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--muted);
  cursor: help; vertical-align: middle; flex: none; transition: color .15s, background .15s; }
.info:hover, .info:focus-visible, .info[aria-expanded="true"] { color: var(--brand); background: var(--hover); }
.info svg { width: 16px; height: 16px; stroke-width: 2; }
.section-title > .info { margin-right: auto; margin-left: -4px; }  /* sits by its heading; the section's actions stay on the right */
.issues-strip > .info { margin-top: 3px; }
.tip { position: fixed; z-index: 90; max-width: min(330px, calc(100vw - 16px)); padding: 9px 12px; border-radius: 12px; background: var(--toast); color: var(--toast-ink);
  font: 450 .84rem/1.45 var(--font); letter-spacing: 0; text-wrap: pretty; box-shadow: var(--shadow-lg); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  pointer-events: none; animation: tip-in .16s ease-out; }
.tip[data-side="below"] { --tip-from: -4px; }
@keyframes tip-in { from { opacity: 0; transform: translateY(var(--tip-from, 4px)); } }
:root[data-style="classic"] .tip { border-radius: var(--radius-sm); }

/* ---------- feedback: toasts, notices, office flags */
.toasts { position: fixed; left: 50%; bottom: 24px; translate: -50% 0; display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 60;
  width: max-content; max-width: min(520px, calc(100vw - 32px)); pointer-events: none; }
.toast { background: var(--toast); color: var(--toast-ink); padding: 11px 18px; border-radius: 99px; box-shadow: var(--shadow-lg); font-size: .92rem; font-weight: 500;
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); pointer-events: auto;
  animation: toast-in var(--dur) var(--spring), toast-out .3s ease-in 5s forwards; }
.toast-error { background: var(--err); color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); visibility: hidden; } }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--info-soft); color: var(--info); font-size: .9rem; }
.notice svg { margin-top: 1px; }
.notice-warn { background: var(--warn-soft); color: var(--warn); }
.notice-bar { align-items: center; flex-wrap: wrap; margin: 0 0 12px; padding: 8px 10px 8px 14px; }
.notice-bar > span { flex: 1 1 260px; }
.flags { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.flag { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: var(--radius-sm); font-size: .92rem; }
.flag svg { margin-top: 2px; } .flag-stop { background: var(--err-soft); color: var(--err); font-weight: 600; }
.flag-warn { background: var(--warn-soft); color: var(--warn); } .flag-info { background: var(--info-soft); color: var(--info); }

/* ---------- client file */
.profile-head { display: flex; gap: 16px; align-items: center; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 7px 16px; font-size: .92rem; margin: 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
/* in the narrow profile column each value sits under its label, as on a contact card */
.aside-stick .kv { grid-template-columns: minmax(0, 1fr); row-gap: 1px; }
.aside-stick .kv dt { font-size: .78rem; margin-top: 9px; } .aside-stick .kv dt:first-child { margin-top: 0; }
.calc-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 12px 0; }
.calc-steps div { background: var(--surface-2); border-radius: var(--radius-sm); padding: 11px 13px; }
.calc-steps b { display: block; font-family: var(--font-num); font-size: 1.3rem; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.calc-steps span { font-size: .78rem; color: var(--muted); }
.calc-steps .hero { background: var(--brand); color: var(--brand-ink); } .calc-steps .hero span { color: inherit; }
.chart-box { position: relative; height: 240px; }
.metric-tabs { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 2px; border-radius: 10px; background: var(--seg-track); }
.metric-tabs button { border: 0; background: none; border-radius: 8px; padding: 5px 12px; font: 550 .84rem var(--font); color: var(--ink-2); cursor: pointer; }
.metric-tabs button[aria-pressed="true"] { background: var(--seg-on); color: var(--seg-on-ink); box-shadow: var(--seg-shadow); font-weight: 600; }
details.q > summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
details.q dl { margin-top: 8px; }
details.add { margin-top: 12px; }
details.add > summary { list-style: none; display: inline-flex; } details.add > summary::-webkit-details-marker { display: none; }
.kv.anthro { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.new-plan { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-end; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.new-plan .field { margin: 0; } .new-plan .field.grow { flex: 1 1 240px; min-width: 0; }
.group-label { margin: 26px 4px 10px; font: 600 .8rem/1.2 var(--font); letter-spacing: .02em; color: var(--muted); }
.group-label:first-child { margin-top: 0; }
/* the profile stays in view while the work scrolls; a tall profile scrolls on its own */
.aside-stick { position: sticky; top: calc(var(--top-h) + 60px); max-height: calc(100dvh - var(--top-h) - 72px); overflow-y: auto; scrollbar-width: thin;
  margin: -6px; padding: 6px; }

/* ---------- plan builder */
.plan-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }
.plan-bar h1 { font-size: 1.5rem; letter-spacing: -.02em; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.allergy-line { display: inline-flex; gap: 6px; align-items: flex-start; margin-top: 6px; padding: 4px 10px; border-radius: var(--radius-xs); background: var(--warn-soft); color: var(--warn); font-size: .85rem; }
.allergy-line svg { width: 15px; height: 15px; margin-top: 2px; }
.targets { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 12px 16px; background: var(--surface); border-radius: var(--radius); margin-bottom: 14px; box-shadow: var(--shadow); }
.targets .t-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.targets .t-label { font-size: .78rem; font-weight: 600; color: var(--muted); }
.targets .kcal { font-family: var(--font-num); font-weight: 700; font-size: 1.15rem; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.targets .t-edit { margin-left: auto; }
.macro { display: flex; flex-direction: column; gap: 4px; min-width: 200px; }
.macro-bar { display: flex; height: 7px; border-radius: 99px; overflow: hidden; background: var(--surface-3); }
.macro-bar span { flex: 0 1 0; transition: flex-grow .3s; } .macro-bar span:nth-child(1) { background: var(--g-A); } .macro-bar span:nth-child(2) { background: var(--g-P); } .macro-bar span:nth-child(3) { background: var(--g-L); }
.save-state { font-size: .82rem; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; padding: 0 6px; }
.save-state[data-state="dirty"] { color: var(--warn); } .save-state[data-state="saved"] { color: var(--ok); }
.builder { display: block; }
.week { overflow-x: auto; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.week table { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 1080px; table-layout: fixed; }
.week th { position: sticky; top: 0; background: var(--surface-2); font-size: .8rem; font-weight: 650; color: var(--ink-2); padding: 9px 8px; text-align: left;
  border-bottom: 1px solid var(--line); z-index: 2; }
.week th:first-child, .week td.meal { position: sticky; left: 0; z-index: 3; background: var(--surface-2); width: 104px; }
.week td { vertical-align: top; padding: 6px; border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); }
.week td.meal { font-weight: 650; font-size: .82rem; color: var(--brand); padding: 10px 8px; border-left: 0; }
.cell { position: relative; display: flex; flex-direction: column; gap: 4px; border-radius: var(--radius-xs); padding: 4px; transition: background .15s, box-shadow .15s; }
.cell:focus-within { background: var(--brand-tint); box-shadow: inset 0 0 0 1.5px var(--brand); }
.cell input, .cell textarea { border-color: transparent; background: transparent; padding: 3px 5px; min-height: 0; font-size: .82rem; border-radius: 6px; resize: none; overflow: hidden; }
.cell .c-title::placeholder, .cell .c-eq::placeholder { color: transparent; }
.cell:focus-within .c-title::placeholder, .cell:focus-within .c-eq::placeholder { color: var(--muted); }
.cell input:hover, .cell textarea:hover { border-color: var(--line); }
.cell input:focus, .cell textarea:focus { background: var(--surface); box-shadow: none; }
/* foods coloured by exchange group: .c-hl lies under the (transparent) textarea and repeats its text, each product in a <mark> */
.c-hl-wrap { display: grid; border-radius: 6px; } .c-hl-wrap > * { grid-area: 1 / 1; }
.c-hl-wrap:focus-within { background: var(--surface); } .cell .c-lines:focus { background: transparent; }
.c-hl { padding: 3px 5px; border: 1px solid transparent; font-size: .82rem; line-height: 1.45; white-space: pre-wrap; overflow-wrap: break-word; color: transparent; pointer-events: none; }
.c-hl mark { color: transparent; border-radius: 3px; background: var(--s); -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.cell .c-title { font-weight: 650; line-height: 1.3; }
.cell:not(:focus-within) .c-title:placeholder-shown { display: none; }
.cell .c-lines { min-height: 40px; }
.cell .c-eq { font-size: .8rem; font-weight: 600; color: var(--ink-2); background: var(--surface-2); letter-spacing: .01em; }
.c-tools { position: absolute; bottom: 3px; right: 3px; display: flex; gap: 2px; opacity: 0; transition: opacity .15s; }  /* over the empty end of the exchanges box, not over the text */
.cell:hover .c-tools, .cell:focus-within .c-tools, [data-week].swapping .c-tools { opacity: 1; }
.c-tools button { display: grid; place-items: center; width: 22px; height: 24px; border: 0; border-radius: 6px; background: var(--surface-3); color: var(--ink-2); cursor: pointer; }
.c-tools button:hover { background: var(--brand-soft); color: var(--brand); }
.c-tools svg { width: 13px; height: 13px; }
@media (pointer: coarse) { .c-tools { opacity: 1; } .c-tools button { width: 32px; height: 32px; } }
.cell.swap-from { outline: 2px dashed var(--brand); outline-offset: 2px; }
.swap-hint { margin: 6px 0 0; color: var(--brand); }
.cell[data-issue]::before { content: ""; position: absolute; left: 0; top: 5px; bottom: 5px; width: 3px; border-radius: 3px; background: var(--warn); }
.cell[data-issue="error"]::before { background: var(--err); }
.cell .c-asked { align-self: flex-start; font-size: .68rem; text-decoration: none; }
.cell.asked { outline: 2px solid var(--warn); outline-offset: -2px; }
.th-day { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.day-act { width: 30px; min-height: 0; height: 26px; padding: 0 4px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer;
  font-size: .8rem; text-align: center; }
select.day-act { background-image: none; padding: 0 4px; }
.day-act:hover, .day-act:focus { background: var(--surface-3); color: var(--ink); box-shadow: none; }
.week tfoot td { background: var(--surface-2); font-size: .78rem; padding: 8px 6px; border-bottom: 0; }
.tot { display: flex; flex-direction: column; gap: 3px; }
.tot .kc { font-weight: 700; font-size: .85rem; font-variant-numeric: tabular-nums; }
.tot .kc .low { color: var(--warn); }
.tot[data-issue] { border-radius: var(--radius-xs); padding: 4px 6px; margin: -4px -6px; }
.tot[data-issue="error"] { background: var(--err-soft); } .tot[data-issue="warn"] { background: var(--warn-soft); }
.meal-target { margin-top: 6px; font-weight: 500; } .meal-target .chips { gap: 2px; } .meal-target .chip { font-size: .7rem; padding: 0 5px; }
.tot .chip[data-s="over"] { outline: 1.5px solid var(--err); } .tot .chip[data-s="under"] { outline: 1.5px dashed var(--warn); }
.issues-strip { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 14px; }
.issues-strip .pill { margin-top: 4px; flex: none; }
.issues-strip .issues { flex-direction: row; flex-wrap: wrap; max-height: 70px; -webkit-mask-image: linear-gradient(#000 calc(100% - 12px), transparent); mask-image: linear-gradient(#000 calc(100% - 12px), transparent); }
.issues-strip .issues li { padding: 4px 10px; }
.issues { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow: auto; }
.issues li { display: flex; gap: 8px; align-items: flex-start; font-size: .84rem; padding: 7px 9px; border-radius: var(--radius-xs); background: var(--surface-2); cursor: pointer; }
.issues li[data-level="error"] { background: var(--err-soft); color: var(--err); } .issues li[data-level="warn"] { background: var(--warn-soft); color: var(--warn); }
.issues li[data-level="ok"] { background: var(--ok-soft); color: var(--ok); cursor: default; }
.issues li svg { width: 15px; height: 15px; margin-top: 2px; }
.issues li[data-level="ignored"] { color: var(--muted); cursor: default; }
.issue-x { flex: none; display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 2px; border: 0; border-radius: 6px; background: none; color: inherit; font: inherit; font-size: .78rem; text-decoration: underline; opacity: .65; cursor: pointer; }
.issue-x:hover, .issue-x:focus-visible { opacity: 1; background: color-mix(in srgb, currentColor 14%, transparent); } .issue-x svg { margin: 0; width: 13px; height: 13px; }
.changes .change-form { display: grid; gap: 6px; min-width: 260px; flex: 1 1 260px; } .changes textarea { font-size: .85rem; min-height: 40px; }
/* the drawer: an inspector sheet floating over the week in Studio, a full-height side panel in the classic look */
.panel { position: fixed; top: var(--sheet-gap); right: var(--sheet-gap); bottom: var(--sheet-gap); width: min(400px, calc(100vw - 2 * var(--sheet-gap)));
  background: var(--sheet-bg); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border-left: var(--sheet-edge) solid var(--line);
  border-radius: var(--sheet-radius); box-shadow: var(--shadow-lg); padding: 14px; overflow: auto; overscroll-behavior: contain;
  transform: translateX(calc(100% + 2 * var(--sheet-gap) + 24px)); visibility: hidden; transition: transform var(--dur) var(--spring), visibility 0s var(--dur);
  z-index: 45; display: flex; flex-direction: column; gap: 12px; }
.panel[data-open] { transform: none; visibility: visible; transition: transform var(--dur) var(--spring); }
.panel > * { flex: none; }  /* the panel scrolls; cards never shrink under each other on short screens */
.panel-head { display: flex; justify-content: space-between; align-items: center; padding: 2px 2px 0 6px; }
.panel .card { padding: 14px 16px; }
.panel .card + .card { margin-top: 0; }
.picker { display: flex; flex-direction: column; min-height: 0; }
.picker-tabs { display: flex; margin-bottom: 8px; }
.picker-tabs a { flex: 1; text-align: center; }
.picker-list { list-style: none; margin: 8px 0 0; padding: 0; overflow: auto; max-height: 46vh; display: flex; flex-direction: column; gap: 4px; }
.picker-list button { width: 100%; text-align: left; border: 0; background: var(--surface-2); border-radius: var(--radius-xs); padding: 8px 10px;
  font: inherit; font-size: .84rem; cursor: pointer; display: flex; flex-direction: column; gap: 3px; color: var(--ink); transition: background .15s; }
.picker-list button:hover { background: var(--brand-soft); }
.picker-list .meta { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: .76rem; }
.build-pick { background: var(--brand-soft); border-radius: var(--radius-xs); padding: 10px 12px; display: grid; gap: 8px; margin-top: 6px; }
[data-swap-list] .chips { display: inline-flex; flex-wrap: wrap; gap: 3px; vertical-align: middle; }
.day-tabs { display: none; }
.plan-sources { display: flex; flex-direction: column; gap: 8px; }
.plan-sources .field-check { font-weight: 500; color: var(--ink); }
.src-list { display: flex; flex-direction: column; gap: 6px; padding-left: 26px; }
.src-list[data-off] { opacity: .5; }
.block-picks { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center; }
.block-picks button { border: 0; cursor: pointer; font-family: inherit; height: 28px; }
.block-picks button[disabled] { cursor: default; }
dialog { color: var(--ink); }
.eqswap { width: min(560px, 94vw); max-height: 86dvh; border: 0; border-radius: var(--radius); background: var(--surface); padding: 18px 20px; box-shadow: var(--shadow-lg); }
.eqswap[open] { animation: sheet-in var(--dur) var(--spring); }
.eqswap::backdrop { background: rgb(0 0 0 / .32); }
@keyframes sheet-in { from { opacity: 0; transform: translateY(14px) scale(.97); } }
.eqswap-row { display: grid; gap: 6px; padding: 10px 0; border-top: 1px solid var(--line); }
.eqswap-row label { display: flex; gap: 8px; align-items: center; font-size: .9rem; }

/* ---------- calendar */
.week-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.day-col { background: var(--surface); border-radius: var(--radius); min-height: 220px; padding: 12px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow); }
.day-col h3 { font-size: .82rem; color: var(--muted); font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
.day-col h3 a { color: var(--ink); text-decoration: none; }
.day-col h3 b { display: inline-grid; place-items: center; min-width: 30px; height: 30px; border-radius: 99px; color: var(--ink); font-size: 1.1rem; font-family: var(--font-num); }
.day-col h3 a:hover b { background: var(--hover); }
.appt { display: block; border-radius: var(--radius-xs); padding: 7px 9px; background: var(--brand-soft); color: var(--ink); font-size: .84rem; border-left: 3px solid var(--brand); }
.appt:hover { text-decoration: none; filter: brightness(.97); }
.appt[data-status="done"] { background: var(--ok-soft); border-left-color: var(--ok); }
.appt[data-status="cancelled"], .appt[data-status="noshow"] { background: var(--surface-2); border-left-color: var(--muted); color: var(--muted); text-decoration: line-through; }
.appt b { display: block; } .appt .small { display: block; }
.month { display: flex; flex-direction: column; gap: 6px; }
.month-head, .month-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.month-head span { font-size: .8rem; color: var(--muted); font-weight: 600; padding: 0 6px; }
.mday { min-height: 104px; background: var(--surface); border-radius: var(--radius-sm); padding: 6px 8px; display: flex; flex-direction: column; gap: 3px; color: var(--ink); box-shadow: var(--shadow); }
.mday:hover { text-decoration: none; background: var(--brand-tint); } .mday.other { background: var(--surface-2); color: var(--muted); box-shadow: none; }
.mday b { font-size: .9rem; align-self: flex-start; display: inline-grid; place-items: center; min-width: 24px; height: 24px; border-radius: 99px; padding: 0 4px; }
.mappt { font-size: .75rem; background: var(--brand-soft); border-radius: 4px; padding: 1px 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mappt[data-status="done"] { background: var(--ok-soft); } .mappt[data-status="noshow"], .mappt[data-status="cancelled"] { background: var(--surface-3); color: var(--muted); }
/* today: the date in a red disc in Studio (as in Apple Calendar), a brand line on top in the classic look */
.day-col.today h3 b, .mday.today b { background: var(--today); color: #fff; }

/* ---------- recipes, foods, sources */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.r-card { display: flex; flex-direction: column; gap: 10px; background: var(--surface); border-radius: var(--radius); padding: 18px; color: var(--ink); box-shadow: var(--shadow);
  transition: background .15s, transform .25s var(--spring), box-shadow .25s; }
.r-card:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.r-card h2 { font-size: .98rem; }
.r-card .meta { color: var(--muted); font-size: .8rem; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: auto; }
.group-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; margin-bottom: 16px; }
.group-card { border-radius: var(--radius-sm); padding: 12px 14px; background: var(--surface); color: var(--ink); display: flex; flex-direction: column; gap: 3px; box-shadow: var(--shadow);
  transition: background .15s, box-shadow .15s; }
.group-card:hover { text-decoration: none; background: var(--brand-tint); }
.group-card[aria-current="page"] { background: var(--brand-soft); box-shadow: inset 0 0 0 1.5px var(--brand); }
.group-card b { font-size: .92rem; } .group-card span { font-size: .76rem; color: var(--muted); }
.group-card .chip { align-self: flex-start; }
.sources { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; margin-bottom: 16px; }
.source { display: flex; gap: 12px; align-items: flex-start; background: var(--surface-2); border-radius: var(--radius); padding: 14px 16px; }
.source:not(.on) b { color: var(--ink-2); }
.source.on { background: var(--surface); box-shadow: var(--shadow); }
.source-main { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; color: var(--ink); }
.source-main:hover { text-decoration: none; } .source-main:hover b { color: var(--brand); }
.sources-hint { grid-column: 1 / -1; margin: 0; }
.recipe-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 16px; }
.recipe-body ol, .recipe-body ul { margin: 0; padding-left: 1.2em; } .recipe-body li { margin-bottom: 5px; }
.plan-lines { background: var(--surface-2); padding: 10px 12px; border-radius: var(--radius-xs); }
.calc-panel { display: flex; flex-direction: column; gap: 10px; position: sticky; top: calc(var(--top-h) + 14px); }
.calc-rows td { padding: 6px 4px; font-size: .85rem; } .calc-rows input { min-height: 32px; padding: 4px 6px; }
.calc-total { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 8px 0; }
.help-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.help-grid .card + .card { margin-top: 0; } .help-grid h2 { margin-bottom: 8px; }
.help-grid ol { margin: 0; padding-left: 1.2em; } .help-grid li { margin-bottom: 6px; }

/* ---------- assistant */
.chat { display: flex; flex-direction: column; height: min(640px, calc(100dvh - 220px)); }
.chat-log { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 8px; padding: 4px 2px 12px; }
.msg { max-width: 82%; padding: 9px 14px; border-radius: 18px; font-size: .92rem; white-space: pre-wrap; animation: toast-in .3s var(--spring); }
.msg-me { align-self: flex-end; background: var(--brand); color: var(--brand-ink); border-bottom-right-radius: 5px; }
.msg-bot { align-self: flex-start; background: var(--surface-3); border-bottom-left-radius: 5px; }
.chat-form { display: flex; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; align-items: flex-end; }
.chat-form textarea { min-height: 40px; max-height: 160px; field-sizing: content; border-radius: 20px; padding: 9px 14px; }
.chat-form .btn { border-radius: 99px; width: 40px; height: 40px; padding: 0; flex: none; }
.suggest { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.suggest button { border: 1px solid var(--line-2); background: var(--surface); border-radius: 99px; padding: 5px 12px; font: 500 .82rem var(--font); cursor: pointer; color: var(--ink-2); }
.suggest button:hover { border-color: var(--brand); color: var(--brand); }
pre.packet { background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px; font: .76rem/1.5 var(--mono); max-height: 420px; overflow: auto; margin: 0; white-space: pre-wrap; }

/* ---------- settings: section list and the appearance picker */
.settings-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: start; }
.settings-layout > .jump { flex-direction: column; gap: 1px; top: calc(var(--top-h) + 8px); margin: 0; padding: 8px; border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow); }
.settings-layout > .jump a { box-shadow: none; background: none; border-radius: var(--radius-nav); padding: 6px 8px; gap: 10px; font-size: .92rem; color: var(--ink-2); }
.settings-layout > .jump a:hover { background: var(--hover); color: var(--ink); }
.settings-layout > div > .card { scroll-margin-top: calc(var(--top-h) + 16px); }
.looks { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin: 4px 0 16px; }
.look { display: flex; flex-direction: column; gap: 8px; margin: 0; cursor: pointer; font-size: .92rem; font-weight: 600; color: var(--ink); }
.look small { font-weight: 400; color: var(--muted); font-size: .8rem; }
.look input { position: absolute; opacity: 0; pointer-events: none; }
.look-thumb { position: relative; display: block; height: 112px; border-radius: 14px; overflow: hidden; box-shadow: 0 0 0 1px var(--line-2); transition: box-shadow .15s; }
.look:has(input:checked) .look-thumb { box-shadow: 0 0 0 3px var(--brand); }
.look:has(input:focus-visible) .look-thumb { outline: 2px solid var(--brand); outline-offset: 4px; }
/* each thumbnail paints its own look, whatever the current one */
.look-thumb::before, .look-thumb::after, .look-thumb i { content: ""; position: absolute; display: block; }
.look-studio { background: #f2f2f7; }
.look-studio::before { left: 7px; top: 7px; bottom: 7px; width: 46px; border-radius: 10px; background: #fff; box-shadow: 0 1px 4px rgb(0 0 0 / .1); }
.look-studio::after { left: 62px; right: 10px; top: 30px; height: 48px; border-radius: 10px; background: #fff; box-shadow: 0 1px 4px rgb(0 0 0 / .08); }
.look-studio i { left: 70px; top: 12px; width: 60px; height: 10px; border-radius: 4px; background: #1d1d1f; }
.look-studio i + i { left: 15px; top: 18px; width: 12px; height: 12px; border-radius: 4px; background: #34c759; }
.look-classic { background: #eceee6; }
.look-classic::before { left: 0; top: 0; bottom: 0; width: 52px; background: #fff; }
.look-classic::after { left: 62px; right: 10px; top: 30px; height: 48px; border-radius: 6px; background: #fff; }
.look-classic i { left: 62px; top: 12px; width: 60px; height: 10px; border-radius: 3px; background: #1b2416; }
.look-classic i + i { left: 8px; top: 16px; width: 36px; height: 12px; border-radius: 4px; background: #e1ebd6; }
.mode-seg { margin-top: 2px; }

/* ---------- client-facing pages: intake form, client link, login */
.intake { display: flex; flex-direction: column; gap: 14px; }
.intake fieldset { border: 0; margin: 0; }
.intake legend { font-weight: 650; font-size: 1.05rem; padding: 0; margin-bottom: 12px; float: left; width: 100%; }
.intake legend + * { clear: both; }
.intake .two, .intake .three { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; } .intake .three { grid-template-columns: repeat(3, 1fr); }
.intake .checks { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.intake .checks .field-check, .intake .consent { font-weight: 500; color: var(--ink); align-items: flex-start; }
.intake .label { display: block; font-size: .85rem; font-weight: 550; color: var(--ink-2); margin-bottom: 6px; }
.freq { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; } .freq-row label { min-height: 2.6em; display: flex; align-items: flex-end; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.share-head { background: var(--hero); color: var(--hero-ink); padding: calc(22px + env(safe-area-inset-top)) 20px 28px; }
.share-head > * { max-width: 688px; margin-left: auto; margin-right: auto; }
.share-head .brand { color: var(--hero-ink); padding: 0; }
.share-head h1 { font-size: clamp(1.9rem, 7vw, 2.6rem); margin: 22px auto 6px; color: var(--hero-ink); letter-spacing: -.03em; }
.share-head p { margin: 0 auto; color: var(--hero-sub); }
.share { max-width: 720px; margin: 0 auto; padding: 8px 16px calc(48px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; }
.share-days { position: sticky; top: max(6px, env(safe-area-inset-top)); z-index: 5; display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; background: var(--surface-3); }
.share-days a { white-space: nowrap; }
.share-tabs { display: flex; } .share-tabs a { flex: 1; text-align: center; }
.share-days a[aria-current], .share-tabs a[aria-current] { background: var(--seg-on); color: var(--seg-on-ink); box-shadow: var(--seg-shadow); }
.share-day { display: flex; flex-direction: column; gap: 10px; } .share-day[data-hidden] { display: none; }
.share-day > h2 { font-size: 1.4rem; margin-top: 4px; letter-spacing: -.02em; }
.meal-card { background: var(--surface); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.meal-card h3 { font-size: .8rem; color: var(--brand); font-weight: 650; margin-bottom: 4px; letter-spacing: .01em; }
.meal-title { font-weight: 650; margin: 0 0 4px; font-size: 1.04rem; }
.meal-card ul, .share-note ul { margin: 0; padding-left: 1.1em; } .meal-card li, .share-note li { margin-bottom: 3px; }
.share-note h2 { margin-bottom: 8px; } .share-foot { text-align: center; margin-top: 8px; }
.change-ask summary { cursor: pointer; color: var(--brand); margin-top: 8px; list-style: none; } .change-ask summary::before { content: "+ "; }
.change-ask[open] summary::before { content: "− "; }
.change-ask form { display: grid; gap: 6px; margin-top: 6px; } .change-ask textarea { font-size: .9rem; }
.change-declined { background: var(--warn-soft); } .change-open { background: var(--surface-2); }
.share-chart .svg-chart, .svg-chart { width: 100%; height: auto; font-family: inherit; stroke-width: 1; }
.svg-chart text { stroke: none; }  /* the global icon rule strokes every svg; chart text must not be outlined */
.svg-chart .grid { stroke: var(--line); } .svg-chart .axis { font-size: 13px; fill: var(--muted); } .svg-chart .val { font-size: 14px; fill: var(--ink); font-weight: 650; }
.svg-chart .line { fill: none; stroke: var(--brand); stroke-width: 2.5; stroke-linejoin: round; } .svg-chart .dot { fill: var(--brand); stroke: var(--surface); stroke-width: 2; }
.svg-chart .target { stroke: var(--ink-2); stroke-dasharray: 5 4; } .svg-chart .target-label { font-size: 13px; fill: var(--ink-2); }
.growth { max-width: 620px; display: block; margin: 4px 0 6px; }
.growth text, .growth .axis { font-size: 11px; font-weight: 500; }
.growth .who { fill: none; stroke: var(--muted); stroke-width: 1.2; opacity: .55; }
.growth .who-2 { stroke: var(--brand); stroke-width: 1.6; opacity: .9; }
.growth .who-0, .growth .who-4 { stroke-dasharray: 4 4; stroke: var(--ink-2); opacity: .7; }  /* neutral: never red against the green data (CVD) */
.bars .bar { fill: var(--brand); stroke: none; } .bars .bar:hover { fill: var(--brand-2); }
.bars .val { font-size: 12px; fill: var(--ink); font-weight: 600; } .bars .axis { font-size: 11px; fill: var(--muted); }
.bars .base { stroke: var(--line-2); }
.habits { display: flex; flex-direction: column; gap: 8px; } .habits h2 { margin: 0 0 2px; }
.habit { width: 100%; display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 8px 12px; border: 0; border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--ink); font: 500 1rem var(--font); text-align: left; cursor: pointer; transition: background .2s, transform .12s; }
.habit:active { transform: var(--press); }
.habit .tick { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line-2);
  color: var(--brand-ink); flex: none; font-weight: 700; }
.habit.done { background: var(--brand-soft); } .habit.done .tick { background: var(--brand); box-shadow: none; }
.habit-bar { width: 90px; height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; flex: none; }
.habit-bar span { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.water { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.water h2 { margin: 0; } .water p { margin: 2px 0 0; }
.water-ctl { display: flex; align-items: center; gap: 12px; } .water-n { font-family: var(--font-num); font-size: 1.9rem; min-width: 2ch; text-align: center; }
.water-ctl .icon-btn { font-size: 1.4rem; width: 44px; height: 44px; background: var(--fill); }
.diary-form { display: flex; flex-direction: column; gap: 10px; } .diary-form h2 { margin: 0; }
.diary-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.photo-btn { justify-content: flex-start; }
.diary-day { display: flex; flex-direction: column; gap: 8px; } .diary-day > h2 { font-size: 1rem; margin-top: 6px; }
.diary-photo { width: 100%; max-height: 340px; object-fit: cover; border-radius: var(--radius-sm); margin-top: 6px; display: block; }
.reply { background: var(--brand-soft); border-radius: var(--radius-sm); padding: 8px 10px; margin-top: 8px; font-size: .92rem; }
.diary-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.diary-item { background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; font-size: .9rem; }
.diary-item.new { box-shadow: inset 3px 0 0 var(--brand); }
.diary-item img { width: 100%; height: 150px; object-fit: cover; border-radius: var(--radius-xs); }
.diary-item form { display: flex; gap: 6px; } .diary-item textarea { min-height: 36px; font-size: .85rem; }
/* login: the day's exchange line set large on a brand field */
.login { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(360px, 1fr); }
.login-art { background: var(--art); color: #f1f6ea; padding: 40px clamp(24px, 5vw, 72px); display: flex; flex-direction: column; justify-content: space-between; gap: 32px; }
.brand-inv { color: #f1f6ea; padding: 0; } .brand-inv .brand-mark { background: #f1f6ea; color: #2a5a35; }
:root[data-style="classic"] .brand-inv .brand-mark { color: #3f5a2a; }
.share-head .brand-mark { background: var(--mark); color: #fff; }
.login-day { margin: 0; font-family: var(--font-head); font-size: clamp(2.6rem, 6.4vw, 6.2rem); font-weight: 650; line-height: .98; letter-spacing: -.04em; max-width: 9ch; }
.login-day span { white-space: nowrap; }
.login-day [data-g="Α"] { color: #d9b48f; } .login-day [data-g="Φ"] { color: #f2e08e; } .login-day [data-g="Γ"] { color: #9dbdf5; }
.login-day [data-g="Λαχ"] { color: #b9e3a3; } .login-day [data-g="Π"], .login-day [data-g="Αυγ"] { color: #a6e3f2; } .login-day [data-g="Λ"] { color: #f6a39a; }
.login-line { max-width: 46ch; font-size: 1.05rem; line-height: 1.55; margin: 0; color: #dfe9d3; }
.login-form { display: grid; place-items: center; padding: 40px 24px; background: var(--bg); }
.login-form form { width: min(380px, 100%); }
.login-form h1 { margin-bottom: 6px; }
.login-form .muted { margin-bottom: 22px; }
.login-form .notice { margin-bottom: 14px; }

/* ---------- the classic look: the few things that are not a token */
:root[data-style="classic"] .side { padding: 16px 12px; }
:root[data-style="classic"] .nav-ico { width: auto; height: auto; background: none; color: inherit; box-shadow: none; }
:root[data-style="classic"] .nav-ico svg { width: 18px; height: 18px; stroke-width: 1.8; }
:root[data-style="classic"] .nav a, :root[data-style="classic"] .side-foot > a { gap: 11px; padding: 9px 10px; font-size: inherit; }
:root[data-style="classic"] .jump .nav-ico, :root[data-style="classic"] .stat .label svg { display: none; }
:root[data-style="classic"] .settings-layout > .jump .nav-ico { display: grid; color: var(--muted); }
:root[data-style="classic"] .btn-group { padding: 0; gap: 8px; background: none; }
:root[data-style="classic"] .btn-group > .btn, :root[data-style="classic"] .btn-group > .icon-btn { background: var(--btn); height: var(--control-h); }
:root[data-style="classic"] .btn-group > .icon-btn { width: var(--control-h); }
:root[data-style="classic"] .btn-group > .btn-ghost { background: transparent; }
:root[data-style="classic"] .btn-group > .btn:hover, :root[data-style="classic"] .btn-group > .icon-btn:hover { background: var(--btn-hover); box-shadow: none; }
:root[data-style="classic"] .toasts { left: auto; right: 20px; bottom: 20px; translate: none; align-items: stretch; width: auto; max-width: min(420px, calc(100vw - 40px)); }
:root[data-style="classic"] .toast { border-radius: var(--radius-sm); padding: 11px 16px; animation-timing-function: ease-out, ease-in; }
:root[data-style="classic"] .day-col.today { box-shadow: inset 0 3px 0 var(--brand); }
:root[data-style="classic"] .mday.today { box-shadow: inset 0 3px 0 var(--brand); }
:root[data-style="classic"] .day-col.today h3 b, :root[data-style="classic"] .mday.today b { background: none; color: inherit; }
:root[data-style="classic"] .source.on { box-shadow: inset 3px 0 0 var(--brand); }
:root[data-style="classic"] .r-card:hover { background: var(--brand-tint); transform: translateY(-1px); box-shadow: none; }
:root[data-style="classic"] .jump { padding: 6px 0 10px; margin: -6px 0 10px; }
:root[data-style="classic"] .share-head .brand-mark { background: #f1f6ea; color: #3f5a2a; }
:root[data-style="classic"] .msg { border-radius: 14px; }
:root[data-style="classic"] .meal-card h3 { font-size: .85rem; }

/* ---------- responsive */
@media (max-width: 1180px) {
  .grid-side, .settings-layout { grid-template-columns: minmax(0, 1fr); }
  .grid-side > aside:has(> .aside-stick) { order: -1; }  /* on one column the client's profile (allergies, exclusions) comes before the work */
  .aside-stick { position: static; max-height: none; overflow: visible; margin: 0; padding: 0; }
  .settings-layout > .jump { flex-direction: row; top: var(--top-h); padding: 8px 2px 10px; margin: -8px -2px 4px; border-radius: 0; background: var(--bar); box-shadow: none; }
  .settings-layout > .jump a { background: var(--surface); box-shadow: var(--shadow); border-radius: 99px; padding: 6px 13px; font-size: .85rem; }
  .settings-layout > .jump .nav-ico { display: none; }
  .calc-panel { position: static; }
}
@media (max-width: 960px) {
  .side { transform: translateX(calc(-100% - 2 * var(--side-gap) - 20px)); transition: transform var(--dur) var(--spring); box-shadow: var(--shadow-lg); z-index: 50; }
  .side[data-open] { transform: none; }
  .shell { margin-left: 0; }
  .icon-btn.menu-btn { display: inline-grid; background: none; }
  .top { padding: 0 16px; }
  .page { padding: 18px 16px 48px; }
  .page-wide { padding: 14px 12px 48px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2, .columns { grid-template-columns: minmax(0, 1fr); }
  .week-cal { grid-template-columns: 1fr; }
  .day-col { min-height: 0; }
  .calc-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .recipe-body { grid-template-columns: 1fr; }
  :root[data-style="classic"] .side { transform: translateX(-100%); }
}
@media (max-width: 860px) {
  .issues-strip .issues { max-height: none; -webkit-mask-image: none; mask-image: none; }
  .login { grid-template-columns: 1fr; }
  .login-art { padding: 28px 20px 32px; gap: 20px; }
  .login-day { font-size: clamp(2.2rem, 12vw, 3.4rem); max-width: none; }
  .login-form { place-items: start center; padding: 28px 20px 48px; }
}
@media (max-width: 720px) {
  .top-search { width: auto; flex: 1; }
  .crumbs { display: none; }
  .head h1 { font-size: 1.6rem; }
  .targets .t-edit { margin-left: 0; }
  .toolbar .btn-group { display: flex; width: 100%; } .toolbar .btn-group > .btn { flex: 1 1 0; min-width: 0; padding: 0 8px; }
  :root[data-style="classic"] .toolbar .btn-group { flex-wrap: wrap; }
  /* plan grid: one day at a time */
  .day-tabs { display: flex; position: sticky; top: var(--top-h); z-index: 5; margin-bottom: 8px; overflow-x: auto; flex-wrap: nowrap; }
  .week table { min-width: 0; }
  .week thead, .week tfoot tr td:not(.meal):not([data-show]) { display: none; }
  .week td[data-day]:not([data-show]) { display: none; }
  .week td.meal, .week th:first-child { width: 96px; font-size: .74rem; overflow-wrap: anywhere; }
  .table-cards thead { display: none; }
  .table-cards tr { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .table-cards td { border: 0; padding: 0; }
  .table-cards td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-size: .8rem; }
  .table-cards td.primary { grid-column: 1 / -1; }
  .msg { max-width: 92%; }
  .mday { min-height: 64px; padding: 4px; } .mappt { font-size: .65rem; padding: 0 3px; } .month-head span { padding: 0; text-align: center; }
}
@media (max-width: 520px) {
  .intake .two, .freq { grid-template-columns: 1fr; } .intake .three { grid-template-columns: 1fr 1fr; }
  .freq-row { display: grid; grid-template-columns: minmax(0, 1fr) 44%; gap: 10px; align-items: center; margin-bottom: 8px; }
  .freq-row label { min-height: 0; margin: 0; font-weight: 500; overflow-wrap: anywhere; }
  .stats { gap: 10px; } .stat { padding: 14px; } .stat .value { font-size: 1.6rem; }
}
@media (min-width: 1700px) {
  .builder { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
  .panel { position: sticky; top: calc(var(--top-h) + 14px); transform: none; visibility: visible; box-shadow: none; border: 0; border-radius: 0; padding: 0;
    background: none; -webkit-backdrop-filter: none; backdrop-filter: none; max-height: calc(100dvh - var(--top-h) - 28px); z-index: auto; width: auto; }
  .panel-head, [data-panel-toggle] { display: none !important; }
}
/* compact rail on the plan page so all 7 days fit on a laptop */
@media (min-width: 961px) and (max-width: 1599px) {
  body.compact { --side-w: calc(56px + 2 * var(--side-gap)); }
  body.compact .side { padding: 14px 8px 10px; }
  :root[data-style="classic"] body.compact { --side-w: 68px; }
  :root[data-style="classic"] body.compact .side { padding: 16px 10px; }
  /* labels stay for screen readers (visually hidden, not display:none) */
  body.compact .side .lbl, body.compact .side .nav-h { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  body.compact .side .pill { display: none; }
  body.compact .nav-group { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
  body.compact .nav a, body.compact .side-foot > a, body.compact .me-link { justify-content: center; padding: 6px 0; }
  body.compact .me { flex-direction: column; }
  body.compact .brand { justify-content: center; padding: 2px 0 14px; }
}
@media (pointer: coarse) {
  .btn, .icon-btn, input:not([type="checkbox"]):not([type="radio"]), select { min-height: 44px; }
  .icon-btn { width: 44px; height: 44px; }
  .btn-sm { height: 40px; }
  .info { width: 32px; height: 32px; }
  input, select, textarea, .c-hl { font-size: 16px; }  /* below 16px iOS zooms the page on focus */
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
@media (prefers-reduced-transparency: reduce) {
  :root { --bar: var(--bg); --side-bg: var(--surface); --sheet-bg: var(--bg); --toast: #1d1d1f; --blur: none; }
  :root[data-theme="dark"] { --toast: #3a3a3c; }
}
@media (prefers-contrast: more) { .card, .stat, .day-col, .week, .side { box-shadow: 0 0 0 1px var(--line-2); } }
@media print {
  .side, .top, .toasts, .jump { display: none; } .shell { margin: 0; }
  .card, .stat { box-shadow: none; border: 1px solid #ddd; }
  .share-days { display: none; } .share-day[data-hidden] { display: flex; } .share-head { color: #000; background: none; }
}

/* authenticator setup (login step and Ασφάλεια): the QR stays black on white in every look, with its quiet zone */
.totp-qr { display: block; width: 210px; max-width: 100%; height: auto; margin: 12px auto; border-radius: 10px;
  stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; }  /* undo the icon rule: square, exact modules */
.totp-setup details { margin: 4px 0 16px; }
.totp-setup code { font-size: .95rem; letter-spacing: .06em; word-break: break-all; }
