/* Unavum Udalum — one stylesheet for the member app (web + PWA), the dietician portal,
   administration, the public site and the installer.
   Identity: calm lavender, clean white, soft leaf green. The signature element is the
   fasting ring — the same arc appears in the logo, the timer and progress meters. */

@font-face { font-family: "Plus Jakarta Sans"; font-weight: 400; font-display: swap; src: url("../fonts/plus-jakarta-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 500; font-display: swap; src: url("../fonts/plus-jakarta-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 600; font-display: swap; src: url("../fonts/plus-jakarta-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 700; font-display: swap; src: url("../fonts/plus-jakarta-sans-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 800; font-display: swap; src: url("../fonts/plus-jakarta-sans-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "Noto Sans Tamil"; font-weight: 400; font-display: swap; src: url("../fonts/noto-sans-tamil-tamil-400-normal.woff2") format("woff2"); unicode-range: U+0B80-0BFF, U+200C-200D, U+25CC; }
@font-face { font-family: "Noto Sans Tamil"; font-weight: 600; font-display: swap; src: url("../fonts/noto-sans-tamil-tamil-600-normal.woff2") format("woff2"); unicode-range: U+0B80-0BFF, U+200C-200D, U+25CC; }
@font-face { font-family: "Noto Sans Tamil"; font-weight: 700; font-display: swap; src: url("../fonts/noto-sans-tamil-tamil-700-normal.woff2") format("woff2"); unicode-range: U+0B80-0BFF, U+200C-200D, U+25CC; }
@font-face { font-family: "Fraunces"; font-weight: 600; font-display: swap; src: url("../fonts/fraunces-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Fraunces"; font-weight: 700; font-display: swap; src: url("../fonts/fraunces-latin-700-normal.woff2") format("woff2"); }

:root {
  --plum: #2e2453;
  --lav-800: #463a7c;
  --lav-700: #5b4b9a;
  --lav-500: #7f6cc7;
  --lav-300: #b8acea;
  --lav-200: #ddd6f5;
  --lav-100: #f1edfb;
  --lav-50: #f8f6fd;
  --leaf-700: #2f7a52;
  --leaf-600: #3f8f62;
  --leaf-500: #5aae80;
  --leaf-100: #e3f3e9;
  --paper: #ffffff;
  --bg: #faf9fd;
  --ink: #2a2440;
  --muted: #6b6680;
  --line: #e6e1f0;
  --line-soft: #f0edf6;
  --warn: #a8670f;
  --warn-soft: #fdf3e1;
  --bad: #c2413b;
  --bad-soft: #fbe9e8;
  --info: #3d6fb6;
  --info-soft: #e8f0fb;
  --radius: 12px;
  --radius-s: 8px;
  --shadow: 0 1px 2px rgba(46, 36, 83, .05), 0 8px 24px -16px rgba(46, 36, 83, .28);
  --font: "Plus Jakarta Sans", "Noto Sans Tamil", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Fraunces", "Noto Sans Tamil", Georgia, serif;
  /* kept for older templates */
  --lane: var(--line); --cond: var(--display); --signal: var(--leaf-600); --brake: var(--bad); --sky: var(--info);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.55 var(--font); color: var(--ink); background: var(--bg); }
a { color: var(--lav-700); text-underline-offset: 2px; }
a:hover { color: var(--plum); }
h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 .5rem; color: var(--plum); }
h1 { font-family: var(--display); font-weight: 700; font-size: 1.95rem; letter-spacing: -.01em; }
h2 { font-weight: 700; font-size: 1.2rem; }
h3 { font-weight: 700; font-size: 1.05rem; }
:lang(ta) h1, [lang=ta] h1 { font-family: var(--font); }
p { margin: 0 0 .75rem; }
small, .small { font-size: .86rem; }
.muted { color: var(--muted); }
.mono, .num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 3px solid var(--lav-300); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
img { max-width: 100%; }
svg { width: 1.1em; height: 1.1em; vertical-align: -.17em; flex: none; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.2rem 0; }
code { background: var(--lav-100); padding: .05rem .35rem; border-radius: 5px; font-size: .9em; }

/* -------------------------------------------------------------- brand mark */
.logo-mark { display: inline-block; width: 40px; height: 40px; background: url("../img/logo.svg") center/contain no-repeat; flex: none; }
.logo-mark.big { width: 56px; height: 56px; }
.plate { display: inline-block; font-weight: 700; font-size: .8rem; letter-spacing: .04em; background: var(--lav-100); color: var(--lav-800); border: 1px solid var(--lav-200); border-radius: 999px; padding: .05rem .6rem; white-space: nowrap; }
.plate.ref { background: var(--paper); }
.plate.big { font-size: 1.1rem; }

/* -------------------------------------------------------------- app shell */
.shell { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
.side { background: var(--paper); border-right: 1px solid var(--line); position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.side .brand { padding: 1.1rem 1.1rem 1rem; display: flex; gap: .7rem; align-items: center; }
.side .brand b { display: block; font-family: var(--display); font-size: 1.12rem; color: var(--plum); line-height: 1.1; }
.side .brand span { font-size: .78rem; color: var(--muted); }
.side nav { padding: .2rem .7rem 1rem; flex: 1; }
.side .group { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 1rem .6rem .3rem; font-weight: 700; }
.side nav a { display: flex; align-items: center; gap: .65rem; color: var(--ink); text-decoration: none; padding: .48rem .7rem; border-radius: 10px; font-weight: 500; font-size: .95rem; }
.side nav a:hover { background: var(--lav-50); color: var(--plum); }
.side nav a[aria-current="page"] { background: var(--lav-100); color: var(--lav-800); font-weight: 700; }
.side nav a svg { width: 19px; height: 19px; flex: none; color: var(--lav-500); }
.side .who { border-top: 1px solid var(--line); padding: .9rem 1.1rem; font-size: .9rem; }
.navtoggle { display: none; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem 1.6rem; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 30; }
.topbar .crumbs { font-size: .9rem; color: var(--muted); display: flex; align-items: center; gap: .6rem; }
.topbar .crumbs .logo-mark { display: none; width: 30px; height: 30px; }
.topbar .actions { display: flex; gap: .5rem; align-items: center; }
.bell { position: relative; display: inline-flex; padding: .35rem; color: var(--ink); border-radius: 10px; }
.bell:hover { background: var(--lav-50); }
.bell svg { width: 22px; height: 22px; }
.bell .dot { position: absolute; top: 0; right: 0; background: var(--bad); color: #fff; font-size: .68rem; border-radius: 9px; padding: 0 .35rem; line-height: 1.35; font-weight: 700; }
.langswitch { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.langswitch button { border: 0; background: var(--paper); font: 600 .8rem var(--font); padding: .3rem .65rem; color: var(--muted); cursor: pointer; }
.langswitch button[aria-pressed="true"] { background: var(--lav-100); color: var(--lav-800); }
.content { padding: 1.5rem 1.6rem 4rem; max-width: 1320px; width: 100%; }
.pagehead { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.2rem; }
.pagehead p { margin: 0; color: var(--muted); }
.pagehead .crumb { margin: 0 0 .2rem; font-size: .88rem; }
.tabbar { display: none; }
.offline-banner { display: none; background: var(--warn-soft); color: var(--warn); text-align: center; font-size: .88rem; font-weight: 600; padding: .4rem 1rem; }
.offline-banner.on { display: block; }
.offline-banner svg { width: 16px; height: 16px; vertical-align: -3px; }

/* ---------------------------------------------------------------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; font: 600 .95rem/1 var(--font); padding: .66rem 1.05rem; border-radius: 999px; border: 1.5px solid var(--lav-700); background: var(--lav-700); color: #fff; text-decoration: none; cursor: pointer; min-height: 42px; transition: background .15s, border-color .15s; }
.btn:hover { background: var(--lav-800); border-color: var(--lav-800); color: #fff; }
.btn svg { width: 18px; height: 18px; }
.btn.go { background: var(--lav-700); border-color: var(--lav-700); color: #fff; }
.btn.ok, .btn.leaf { background: var(--leaf-600); border-color: var(--leaf-600); color: #fff; }
.btn.ok:hover, .btn.leaf:hover { background: var(--leaf-700); border-color: var(--leaf-700); }
.btn.danger { background: var(--paper); color: var(--bad); border-color: #e9b4b1; }
.btn.danger:hover { background: var(--bad-soft); }
.btn.quiet { background: var(--paper); color: var(--ink); border-color: var(--line); }
.btn.quiet:hover { border-color: var(--lav-300); background: var(--lav-50); }
.btn.soft { background: var(--lav-100); color: var(--lav-800); border-color: var(--lav-100); }
.btn.soft:hover { background: var(--lav-200); border-color: var(--lav-200); }
.btn.small { padding: .38rem .7rem; min-height: 32px; font-size: .84rem; }
.btn.big { padding: .9rem 1.5rem; font-size: 1.05rem; min-height: 52px; }
.btn.block { width: 100%; }
.btn[disabled], .btn.disabled { opacity: .45; pointer-events: none; }
.btnrow { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
form.inline { display: inline; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--lav-700); text-decoration: underline; cursor: pointer; }

/* ------------------------------------------------------------------ forms */
label, .label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .3rem; color: var(--plum); }
.req { color: var(--bad); }
.field { margin-bottom: .95rem; }
.field .help { font-size: .82rem; color: var(--muted); margin-top: .25rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=tel], input[type=date], input[type=datetime-local], input[type=time], input[type=url], input[type=search], select, textarea {
  width: 100%; font: inherit; padding: .58rem .75rem; border: 1.5px solid var(--line); border-radius: var(--radius-s); background: var(--paper); color: var(--ink); min-height: 44px;
}
input[type=file] { font: inherit; font-size: .9rem; }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--lav-500); outline: none; box-shadow: 0 0 0 3px var(--lav-100); }
input[type=checkbox], input[type=radio] { width: 1.15rem; height: 1.15rem; accent-color: var(--lav-700); vertical-align: -3px; flex: none; }
input[type=range] { width: 100%; accent-color: var(--lav-700); }
.check { display: flex; gap: .55rem; align-items: flex-start; font-weight: 500; margin-bottom: .55rem; color: var(--ink); }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem .4rem; margin: 0 0 1rem; }
legend { font-weight: 700; padding: 0 .3rem; color: var(--plum); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 1rem; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 1rem; }
.span2 { grid-column: span 2; }
.span3 { grid-column: 1 / -1; }
.filters { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end; margin-bottom: 1rem; }
.filters .field { margin: 0; min-width: 180px; }
.choice { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.choice label { margin: 0; border: 1.5px solid var(--line); border-radius: var(--radius); padding: .7rem .8rem; background: var(--paper); cursor: pointer; font-weight: 600; display: flex; gap: .5rem; align-items: center; }
.choice label:has(input:checked) { border-color: var(--lav-500); background: var(--lav-50); }
.choice label .muted { font-weight: 400; display: block; font-size: .8rem; }
.scale5 { display: flex; gap: .35rem; }
.scale5 label { flex: 1; text-align: center; border: 1.5px solid var(--line); border-radius: 10px; padding: .45rem 0; margin: 0; cursor: pointer; font-weight: 700; }
.scale5 input { position: absolute; opacity: 0; }
.scale5 label:has(input:checked) { background: var(--lav-100); border-color: var(--lav-500); color: var(--lav-800); }
.scale5 label:has(input:focus-visible) { outline: 3px solid var(--lav-300); }

/* ------------------------------------------------------------ containers */
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.3rem; margin-bottom: 1.1rem; box-shadow: var(--shadow); }
.panel > h2:first-child, .panel > h3:first-child { margin-top: 0; }
.panel.tint { background: var(--lav-50); }
.panel.leafy { background: var(--leaf-100); border-color: #cde8d7; }
.panel.stripe { border-left: 5px solid var(--lav-500); }
.panel.stripe.bad { border-left-color: var(--bad); }
.panel.stripe.warn { border-left-color: var(--warn); }
.panel.stripe.ok { border-left-color: var(--leaf-500); }
.panelhead { display: flex; justify-content: space-between; align-items: center; gap: .6rem; margin-bottom: .6rem; flex-wrap: wrap; }
.panelhead h2, .panelhead h3 { margin: 0; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 1.2rem; align-items: start; }
.cols.even { grid-template-columns: 1fr 1fr; }
.cols.wide-left { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; box-shadow: var(--shadow); text-decoration: none; color: var(--ink); display: block; position: relative; }
a.card:hover { border-color: var(--lav-300); color: var(--ink); }
.card h3 { margin: .2rem 0 .3rem; }
.card .thumb { width: calc(100% + 2.2rem); max-width: none; margin: -1rem -1.1rem .8rem; border-radius: var(--radius) var(--radius) 0 0; height: 150px; object-fit: cover; display: block; }
.thumb { max-height: 120px; border-radius: 8px; border: 1px solid var(--line); }
.danger-zone { margin-top: 1rem; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .9rem; margin-bottom: 1.1rem; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; box-shadow: var(--shadow); text-decoration: none; color: var(--ink); display: block; }
.stat .k { font-size: .8rem; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: .35rem; }
.stat .k svg { width: 16px; height: 16px; color: var(--lav-500); }
.stat .v { font-size: 1.65rem; font-weight: 800; color: var(--plum); line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat .v small { font-size: .85rem; font-weight: 600; color: var(--muted); }
.stat .s { font-size: .8rem; color: var(--muted); }
.stat.leafy { background: var(--leaf-100); border-color: #cde8d7; }

.meter { height: 9px; background: var(--lav-100); border-radius: 99px; overflow: hidden; }
.meter > i { display: block; height: 100%; background: linear-gradient(90deg, var(--lav-500), var(--leaf-500)); border-radius: 99px; }
.meter.leaf > i { background: var(--leaf-500); }
.meter.over > i { background: var(--warn); }

/* -------------------------------------------------------- tables & lists */
.tablewrap { overflow-x: auto; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 1rem; }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; padding: .7rem .8rem; border-bottom: 1px solid var(--line); background: var(--lav-50); white-space: nowrap; }
td { padding: .62rem .8rem; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; }
tr.rowlink { cursor: pointer; }
tr.rowlink:hover td { background: var(--lav-50); }
td.empty, .empty { color: var(--muted); text-align: center; padding: 1.6rem 1rem; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1.1rem; margin: 0; }
.kv dt { color: var(--muted); font-size: .88rem; }
.kv dd { margin: 0; font-weight: 600; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: .8rem; align-items: center; padding: .65rem 0; border-bottom: 1px solid var(--line-soft); }
.list li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .ico { width: 36px; height: 36px; border-radius: 10px; background: var(--lav-100); color: var(--lav-700); display: grid; place-items: center; flex: none; }
.list .ico svg { width: 19px; height: 19px; }
.list .ico.leaf { background: var(--leaf-100); color: var(--leaf-700); }

/* pills, flashes, tabs */
.pill { display: inline-block; font-size: .76rem; font-weight: 700; padding: .12rem .55rem; border-radius: 99px; background: var(--line-soft); color: var(--muted); white-space: nowrap; }
.pill.ok { background: var(--leaf-100); color: var(--leaf-700); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.info, .pill.lav { background: var(--lav-100); color: var(--lav-800); }
.flash { padding: .75rem 1rem; border-radius: var(--radius-s); margin-bottom: 1rem; border: 1px solid; font-weight: 500; }
.flash.ok { background: var(--leaf-100); border-color: #c4e3cf; color: #1f5b3b; }
.flash.error { background: var(--bad-soft); border-color: #efc4c1; color: #8d2a25; }
.flash.warn { background: var(--warn-soft); border-color: #f0d9ad; color: #7a4a08; }
.flash.info { background: var(--info-soft); border-color: #c8d9f1; color: #234a80; }
.tabs { display: flex; gap: .3rem; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 1rem; }
.tabs a { padding: .55rem .9rem; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a[aria-current="page"], .tabs a.on { color: var(--lav-800); border-bottom-color: var(--lav-500); }
.pager { display: flex; gap: .6rem; align-items: center; justify-content: flex-end; margin: .6rem 0; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { display: inline-flex; align-items: center; gap: .3rem; border: 1px solid var(--line); background: var(--paper); border-radius: 99px; padding: .3rem .75rem; font-size: .85rem; text-decoration: none; color: var(--ink); font-weight: 600; }
.chip.on, .chip[aria-current="page"] { background: var(--lav-100); border-color: var(--lav-200); color: var(--lav-800); }

/* ------------------------------------------------------------- dialogs */
dialog { border: 0; border-radius: 16px; padding: 0; max-width: min(560px, 94vw); width: 100%; box-shadow: 0 30px 80px -20px rgba(46, 36, 83, .45); }
dialog::backdrop { background: rgba(46, 36, 83, .35); }
.dhead { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.2rem .4rem; }
.dhead h2 { margin: 0; }
.dbody { padding: .4rem 1.2rem 1.2rem; }
.close { background: none; border: 0; font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 88px; transform: translateX(-50%); background: var(--plum); color: #fff; padding: .7rem 1.1rem; border-radius: 99px; font-weight: 600; font-size: .92rem; z-index: 90; box-shadow: var(--shadow); max-width: 92vw; }

/* ------------------------------------------------------- fasting ring */
.ringwrap { display: grid; place-items: center; position: relative; margin: .4rem auto 1rem; width: min(300px, 80vw); aspect-ratio: 1; }
.ringwrap svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ringwrap .track { stroke: var(--lav-100); }
.ringwrap .arc { stroke: url(#ringgrad); stroke-linecap: round; transition: stroke-dashoffset .8s ease; }
.ringwrap.eating .arc { stroke: var(--leaf-500); }
.ringwrap .center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; padding: 1.6rem; }
.ringwrap .center .phase { font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--lav-700); }
.ringwrap.eating .center .phase { color: var(--leaf-700); }
.ringwrap .center .time { font-size: clamp(2rem, 9vw, 2.9rem); font-weight: 800; color: var(--plum); font-variant-numeric: tabular-nums; line-height: 1.1; letter-spacing: -.02em; }
.ringwrap .center .sub { font-size: .86rem; color: var(--muted); }
.ringmini { width: 120px; margin: 0; }
.ringmini .center { padding: .5rem; }
.ringmini .center .time { font-size: 1.15rem; }
.ringmini .center .phase { font-size: .62rem; }
.planpick { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .7rem; }
.planpick label { border: 1.5px solid var(--line); border-radius: var(--radius); padding: .8rem; cursor: pointer; background: var(--paper); margin: 0; position: relative; }
.planpick label:has(input:checked) { border-color: var(--lav-500); background: var(--lav-50); box-shadow: 0 0 0 3px var(--lav-100); }
.planpick input { position: absolute; opacity: 0; }
.planpick b { font-size: 1.35rem; display: block; color: var(--plum); }
.planpick .lvl { font-size: .74rem; font-weight: 700; color: var(--lav-700); text-transform: uppercase; letter-spacing: .05em; }
.planpick label.locked { opacity: .55; cursor: not-allowed; background: var(--line-soft); }
.planpick label.locked::after { content: "🔒"; position: absolute; top: .5rem; right: .6rem; font-size: .9rem; }
.symptoms { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .2rem .8rem; }
.days7 { display: grid; grid-template-columns: repeat(7, 1fr); gap: .35rem; }
.days7 .d { text-align: center; font-size: .75rem; color: var(--muted); }
.days7 .d i { display: block; height: 34px; border-radius: 10px; background: var(--lav-100); margin-bottom: .2rem; font-style: normal; display: grid; place-items: center; font-weight: 700; color: var(--lav-800); }
.days7 .d.done i { background: var(--leaf-500); color: #fff; }
.days7 .d.part i { background: var(--lav-300); color: #fff; }
.days7 .d.today i { outline: 2px solid var(--lav-500); outline-offset: 1px; }

/* --------------------------------------------------- food diary & search */
.meal-group { margin-bottom: 1rem; }
.meal-group h3 { display: flex; justify-content: space-between; align-items: baseline; font-size: 1rem; margin: 0 0 .4rem; }
.meal-group h3 span { font-weight: 600; color: var(--muted); font-size: .85rem; }
.foodline { display: flex; gap: .7rem; align-items: center; padding: .55rem .7rem; border: 1px solid var(--line-soft); border-radius: 10px; margin-bottom: .35rem; background: var(--paper); }
.foodline .grow { flex: 1; min-width: 0; }
.foodline .kcal { font-weight: 700; color: var(--plum); white-space: nowrap; }
.foodline.pending { border-style: dashed; border-color: var(--lav-300); }
.foodline img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; }
.macro { display: flex; gap: .9rem; flex-wrap: wrap; font-size: .82rem; color: var(--muted); }
.macro b { color: var(--ink); }
.search-pop { position: relative; }
.search-pop .results { position: absolute; z-index: 40; left: 0; right: 0; top: 100%; background: var(--paper); border: 1px solid var(--line); border-radius: 0 0 var(--radius-s) var(--radius-s); max-height: 320px; overflow-y: auto; box-shadow: var(--shadow); display: none; }
.search-pop .results.open { display: block; }
.search-pop .results button { display: flex; width: 100%; justify-content: space-between; gap: .6rem; text-align: left; padding: .55rem .75rem; border: 0; border-bottom: 1px solid var(--line-soft); background: none; font: inherit; cursor: pointer; }
.search-pop .results button:hover, .search-pop .results button.on { background: var(--lav-50); }
.search-pop .results small { color: var(--muted); }
.water { display: flex; gap: .3rem; flex-wrap: wrap; }
.water i { width: 22px; height: 30px; border-radius: 4px 4px 9px 9px; border: 2px solid var(--info); opacity: .35; }
.water i.full { background: #9cc2ef; opacity: 1; }

/* ---------------------------------------------------- dietician chart builder */
.builder { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 1rem; align-items: start; }
.builder .dayhead { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .8rem; }
.slot { border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); margin-bottom: .8rem; }
.slot header { display: flex; gap: .6rem; align-items: center; padding: .6rem .8rem; border-bottom: 1px solid var(--line-soft); background: var(--lav-50); border-radius: var(--radius) var(--radius) 0 0; flex-wrap: wrap; }
.slot header h3 { margin: 0; flex: 1; font-size: .98rem; }
.slot header input[type=time] { width: auto; min-height: 34px; padding: .25rem .5rem; }
.slot .items { padding: .5rem .6rem; min-height: 54px; }
.slot .items.drop { background: var(--leaf-100); }
.slot .item { display: grid; grid-template-columns: 22px minmax(0, 1fr) 76px 70px auto; gap: .5rem; align-items: center; padding: .4rem .4rem; border: 1px solid var(--line-soft); border-radius: 8px; margin-bottom: .35rem; background: var(--paper); }
.slot .item.dragging { opacity: .5; }
.slot .item .grip { cursor: grab; color: var(--muted); }
.slot .item .grip svg { width: 18px; height: 18px; }
.slot .item input { min-height: 34px; padding: .25rem .4rem; }
.slot .item .nut { font-size: .76rem; color: var(--muted); }
.slot.outside header { background: var(--warn-soft); }
.slot footer { padding: .4rem .7rem .7rem; }
.totals { position: sticky; top: 76px; }
.totals .row { display: flex; justify-content: space-between; font-size: .92rem; padding: .25rem 0; }
.checks-list li { padding: .3rem 0; font-size: .9rem; }
.checks-list .ok::before { content: "✓ "; color: var(--leaf-600); font-weight: 800; }
.checks-list .warn::before { content: "! "; color: var(--warn); font-weight: 800; }
.chart-print h2 { margin-top: 1rem; }

/* ------------------------------------------------------------ messages */
.thread { display: flex; flex-direction: column; gap: .55rem; max-height: 60vh; overflow-y: auto; padding: .4rem; }
.bubble { max-width: 78%; padding: .6rem .85rem; border-radius: 16px; background: var(--lav-100); align-self: flex-start; white-space: pre-wrap; }
.bubble.me { align-self: flex-end; background: var(--lav-700); color: #fff; }
.bubble .meta { display: block; font-size: .72rem; opacity: .75; margin-top: .2rem; }

/* ------------------------------------------------------------ assistant */
.chat { display: flex; flex-direction: column; height: calc(100vh - 230px); min-height: 420px; }
.chat .log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: .7rem; padding: .3rem; }
.chat .msg { max-width: 86%; padding: .7rem .95rem; border-radius: 16px; background: var(--paper); border: 1px solid var(--line); line-height: 1.5; }
.chat .msg.me { align-self: flex-end; background: var(--lav-700); color: #fff; border-color: var(--lav-700); }
.chat .msg.safety { background: var(--warn-soft); border-color: #f0d9ad; }
.chat .msg table { font-size: .85rem; margin: .4rem 0; }
.chat .msg .src { font-size: .78rem; color: var(--muted); margin-top: .35rem; }
.chat form { display: flex; gap: .5rem; padding-top: .6rem; }
.chat .suggest { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .5rem; }
.engine { font-size: .82rem; color: var(--muted); display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.dotline { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.dotline.on { background: var(--leaf-500); }
.dotline.busy { background: var(--warn); }
.photo-drop { border: 2px dashed var(--lav-300); border-radius: var(--radius); padding: 1.4rem; text-align: center; background: var(--lav-50); }
.photo-drop img { max-height: 280px; border-radius: 10px; }

/* ------------------------------------------------------------ articles */
.prose { max-width: 720px; font-size: 1.04rem; line-height: 1.7; }
.prose h2 { margin-top: 1.6rem; font-size: 1.3rem; }
.prose h3 { margin-top: 1.2rem; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li { margin-bottom: .3rem; }
.refs { font-size: .88rem; color: var(--muted); border-top: 1px solid var(--line); margin-top: 1.5rem; padding-top: .8rem; }
.video { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: var(--plum); }
.video iframe, .video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.notice { display: flex; gap: .7rem; align-items: flex-start; font-size: .88rem; color: var(--muted); background: var(--lav-50); border: 1px solid var(--line); border-radius: var(--radius-s); padding: .65rem .8rem; }
.notice svg { width: 18px; height: 18px; flex: none; color: var(--lav-500); margin-top: .1rem; }

/* ------------------------------------------------------------ public site */
.pub-top { background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.pub-top .in { max-width: 1180px; margin: 0 auto; padding: .7rem 1.2rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.pub-top .co { display: flex; align-items: center; gap: .6rem; font-family: var(--display); font-weight: 700; font-size: 1.2rem; color: var(--plum); text-decoration: none; }
.pub-top .co small { display: block; font-family: var(--font); font-size: .74rem; color: var(--muted); font-weight: 500; }
.pub-top nav { display: flex; gap: 1rem; align-items: center; flex: 1; justify-content: flex-end; }
.pub-top nav .links, .pub-top nav .acts { display: flex; gap: .3rem; align-items: center; }
.pub-top nav .links a { color: var(--ink); text-decoration: none; font-weight: 600; padding: .45rem .65rem; border-radius: 8px; }
.pub-top nav .links a:hover { background: var(--lav-50); }
.pub-top nav .links a[aria-current="page"] { color: var(--lav-800); box-shadow: inset 0 -2px 0 var(--lav-500); border-radius: 0; }
.pubnav-btn { display: none; width: 44px; height: 44px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--paper); color: var(--ink); align-items: center; justify-content: center; cursor: pointer; }
.pubnav-btn .bars { display: grid; gap: 4px; width: 20px; }
.pubnav-btn .bars i { display: block; height: 2px; border-radius: 2px; background: currentColor; transition: transform .2s ease, opacity .2s ease; }
.pubnav-btn[aria-expanded="true"] .bars i:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.pubnav-btn[aria-expanded="true"] .bars i:nth-child(2) { opacity: 0; }
.pubnav-btn[aria-expanded="true"] .bars i:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* member stories: before / after comparison */
.stories { margin: 2.5rem 0; }
.st-head { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 1rem; }
.st-head h2 { margin: 0; }
.st-head p { margin: .2rem 0 0; color: var(--muted); }
.st-nav { display: flex; gap: .4rem; }
.st-btn { width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--paper); color: var(--ink); display: grid; place-items: center; cursor: pointer; }
.st-btn svg { width: 20px; height: 20px; }
.st-track { display: grid; grid-auto-flow: column; grid-auto-columns: min(86vw, 370px); gap: 1.2rem; overflow-x: auto; scroll-snap-type: x mandatory; padding: .3rem .2rem 1rem; scrollbar-width: thin; }
.st-track > .story { scroll-snap-align: start; }
.story-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.4rem; }
.story { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; display: flex; flex-direction: column; }
.ba { position: relative; aspect-ratio: 4 / 5; overflow: hidden; background: var(--lav-50); --pos: 50%; touch-action: pan-y; }
.ba-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; user-select: none; -webkit-user-drag: none; }
.ba-after { clip-path: inset(0 0 0 var(--pos)); }
.ba-one .ba-img { position: static; }
.ba::after { content: ""; position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .12); pointer-events: none; }
.ba-one::after { display: none; }
.ba-handle { position: absolute; top: 50%; left: var(--pos); transform: translate(-50%, -50%); width: 44px; height: 44px; border-radius: 50%; background: #fff; color: var(--ink); display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 14px rgba(0, 0, 0, .22); pointer-events: none; z-index: 2; }
.ba-handle svg { width: 14px; height: 14px; margin: 0 -2px; }
.ba-range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; z-index: 3; }
.ba-range:focus-visible + * , .ba:has(.ba-range:focus-visible) .ba-handle { outline: 3px solid var(--lav-300); outline-offset: 2px; }
.ba-tag { position: absolute; top: .7rem; z-index: 1; font-size: .78rem; font-weight: 700; padding: .2rem .6rem; border-radius: 99px; background: rgba(255, 255, 255, .9); color: var(--ink); }
.ba-tag-b { left: .7rem; }
.ba-tag-a { right: .7rem; }
.story-body { padding: 1.1rem 1.2rem 1.3rem; display: flex; flex-direction: column; gap: .55rem; flex: 1; }
.story-result { font-weight: 700; color: var(--leaf-700); margin: 0; }
.story blockquote { margin: 0; font-size: .98rem; line-height: 1.6; }
.story-who { margin: auto 0 0; font-size: .9rem; display: flex; flex-direction: column; }
.story-who span { color: var(--muted); }
.story-sample { margin: 0; font-size: .78rem; color: var(--muted); border-top: 1px dashed var(--line); padding-top: .5rem; }
.st-note { font-size: .86rem; color: var(--muted); max-width: 70ch; }
.pub-main { max-width: 1180px; margin: 0 auto; padding: 1.6rem 1.2rem 4rem; }
.pub-foot { border-top: 1px solid var(--line); background: var(--paper); color: var(--muted); font-size: .88rem; }
.pub-foot .in { max-width: 1180px; margin: 0 auto; padding: 1.4rem 1.2rem 2rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
.pub-foot a { color: var(--muted); }
.authbox { max-width: 460px; margin: 1rem auto; }
.authbox.wide { max-width: 640px; }
.hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 2.5rem; align-items: center; padding: 1.5rem 0 2.5rem; }
.hero .tag { display: inline-block; background: var(--leaf-100); color: var(--leaf-700); font-weight: 700; padding: .25rem .8rem; border-radius: 99px; font-size: .85rem; margin-bottom: .9rem; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); line-height: 1.05; margin-bottom: .4rem; }
.hero .ta { font-size: clamp(1.15rem, 2.6vw, 1.5rem); color: var(--lav-700); font-weight: 700; margin-bottom: 1rem; }
.hero p.lead { font-size: 1.12rem; color: var(--muted); max-width: 34rem; }
.hero .art { position: relative; }
.hero .phone { background: var(--paper); border: 1px solid var(--line); border-radius: 30px; padding: 1.3rem; box-shadow: 0 40px 80px -40px rgba(46, 36, 83, .5); max-width: 340px; margin: 0 auto; }
.motto { text-align: center; font-weight: 700; color: var(--lav-700); padding: 1.2rem 0; }
.features { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; margin: 1rem 0 2.5rem; }
.feature { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 1.2rem; }
.feature .ico { width: 44px; height: 44px; border-radius: 12px; background: var(--lav-100); color: var(--lav-700); display: grid; place-items: center; margin-bottom: .7rem; }
.feature .ico svg { width: 22px; height: 22px; }
.feature.leaf .ico { background: var(--leaf-100); color: var(--leaf-700); }
.feature ul { margin: .4rem 0 0; padding-left: 1.1rem; color: var(--muted); font-size: .92rem; }
.band { background: var(--lav-50); border: 1px solid var(--line); border-radius: 20px; padding: 1.8rem; margin: 2rem 0; }
.banner { display: flex; gap: 1rem; align-items: center; justify-content: space-between; background: linear-gradient(110deg, var(--lav-100), var(--leaf-100)); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; margin-bottom: 1.1rem; flex-wrap: wrap; }
.banner b { color: var(--plum); }

/* ------------------------------------------------------------ installer */
.install { max-width: 780px; margin: 2rem auto; padding: 0 1rem; }
.install .card { padding: 1.6rem 1.8rem; }
.steps { display: flex; gap: .4rem; padding: 0; margin: 0 0 1rem; list-style: none; flex-wrap: wrap; }
.steps li { padding: .3rem .8rem; border-radius: 99px; background: var(--line-soft); color: var(--muted); font-size: .85rem; font-weight: 600; }
.steps li.done { background: var(--leaf-100); color: var(--leaf-700); }
.steps li.now { background: var(--lav-700); color: #fff; }
.code-block { background: var(--plum); color: #f1edfb; padding: .9rem 1rem; border-radius: var(--radius-s); overflow-x: auto; font-size: .86rem; }
.key { font-family: ui-monospace, monospace; background: var(--warn-soft); border: 1px dashed var(--warn); padding: .7rem; border-radius: var(--radius-s); word-break: break-all; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1100px) {
  .cols, .cols.wide-left, .builder { grid-template-columns: 1fr; }
  .totals { position: static; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 284px; transform: translateX(-100%); transition: transform .2s ease; z-index: 60; box-shadow: 0 0 60px rgba(46, 36, 83, .3); }
  .side.open { transform: none; }
  .navtoggle { display: inline-flex; }
  .topbar { padding: .55rem 1rem; }
  .topbar .crumbs .logo-mark { display: inline-block; }
  .content { padding: 1rem 1rem 6.5rem; }
  .grid3, .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { grid-template-columns: 1fr; gap: 1.5rem; }
  .cols.even { grid-template-columns: 1fr; }
  .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: rgba(255, 255, 255, .97); border-top: 1px solid var(--line); padding: .3rem .3rem calc(.3rem + env(safe-area-inset-bottom)); backdrop-filter: blur(8px); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: .1rem; text-decoration: none; color: var(--muted); font-size: .68rem; font-weight: 600; padding: .3rem 0; border-radius: 10px; text-align: center; line-height: 1.15; }
  .tabbar a svg { width: 22px; height: 22px; }
  .tabbar a[aria-current="page"] { color: var(--lav-800); background: var(--lav-50); }
  h1 { font-size: 1.6rem; }
  .slot .item { grid-template-columns: 18px minmax(0, 1fr) 64px auto; }
  .slot .item .nut { display: none; }
}
@media (max-width: 860px) {
  .pubnav-btn { display: inline-flex; margin-left: auto; }
  .pub-top .in { flex-wrap: wrap; }
  .pub-top nav { display: none; flex-basis: 100%; flex-direction: column; align-items: stretch; gap: .8rem; padding: .4rem 0 .8rem; }
  .pub-top nav.open { display: flex; }
  .pub-top nav .links { flex-direction: column; align-items: stretch; }
  .pub-top nav .links a { padding: .75rem .4rem; border-bottom: 1px solid var(--line); border-radius: 0; }
  .pub-top nav .links a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--lav-500); padding-left: .8rem; }
  .pub-top nav .acts { justify-content: space-between; flex-wrap: wrap; }
}
@media (max-width: 560px) {
  .grid2, .grid3, .grid4 { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .panel { padding: 1rem; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat .v { font-size: 1.35rem; }
  .langswitch button { padding: .3rem .5rem; }
}
@media print {
  .side, .topbar, .tabbar, .no-print, .pub-top, .pub-foot, .btn, .offline-banner { display: none !important; }
  .shell { display: block; }
  .content { padding: 0; max-width: none; }
  .panel, .tablewrap, .card, .stat { box-shadow: none; break-inside: avoid; }
  body { background: #fff; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
.pub-top nav .links a, .pub-top nav .acts .btn { white-space: nowrap; }
.langswitch { flex: none; }
@media (min-width: 861px) and (max-width: 1440px) {
  html[lang="ta"] .pubnav-btn { display: inline-flex; margin-left: auto; }
  html[lang="ta"] .pub-top .in { flex-wrap: wrap; }
  html[lang="ta"] .pub-top nav { display: none; flex-basis: 100%; flex-direction: column; align-items: stretch; gap: .8rem; padding: .4rem 0 .8rem; }
  html[lang="ta"] .pub-top nav.open { display: flex; }
  html[lang="ta"] .pub-top nav .links { flex-direction: column; align-items: stretch; }
  html[lang="ta"] .pub-top nav .links a { padding: .75rem .4rem; border-bottom: 1px solid var(--line); border-radius: 0; }
  html[lang="ta"] .pub-top nav .acts { justify-content: flex-start; flex-wrap: wrap; }
}
.pub-top .co { white-space: nowrap; }

/* rich text editor (Toast UI) and the content it produces */
.rte { margin-bottom: .3rem; }
.rte .toastui-editor-defaultUI { border-color: var(--line); border-radius: 12px; overflow: hidden; font-family: var(--font); }
.rte .toastui-editor-defaultUI-toolbar { background: var(--lav-50); border-bottom-color: var(--line); }
.rte .toastui-editor-contents { font-family: var(--font); font-size: 1rem; }
.rte .toastui-editor-mode-switch { background: var(--lav-50); border-top-color: var(--line); }
.rte .toastui-editor-mode-switch .tab-item.active { color: var(--lav-800); border-color: var(--line); }
.rte-invalid .toastui-editor-defaultUI { border-color: var(--bad); box-shadow: 0 0 0 3px rgba(194, 65, 65, .15); }
textarea.editor-failed { display: block !important; }
.prose img, .refs img { max-width: 100%; height: auto; border-radius: 10px; margin: .4rem 0; }
.prose blockquote { margin: 1rem 0; padding: .4rem 1rem; border-left: 4px solid var(--lav-300); background: var(--lav-50); border-radius: 0 10px 10px 0; }
.prose blockquote p { margin: .3rem 0; }
.prose pre { background: var(--plum); color: #f1edfb; padding: .8rem 1rem; border-radius: 10px; overflow-x: auto; font-size: .9rem; }
.prose pre code { background: none; padding: 0; color: inherit; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 1.6rem 0; }
.prose .table-wrap { overflow-x: auto; margin: 1rem 0; }
.prose table { border-collapse: collapse; width: 100%; font-size: .95rem; }
.prose th, .prose td { border: 1px solid var(--line); padding: .45rem .6rem; text-align: left; }
.prose th { background: var(--lav-50); }
.prose del { color: var(--muted); }

/* AI check and AI files */
.ai-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.ai-checks li { display: flex; gap: .75rem; align-items: flex-start; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.ai-checks .ck { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .85rem; color: #fff; background: var(--line); margin-top: .1rem; }
.ai-checks li.ok .ck { background: var(--leaf-600); } .ai-checks li.ok .ck::before { content: "✓"; }
.ai-checks li.warn .ck { background: var(--warn); } .ai-checks li.warn .ck::before { content: "!"; }
.ai-checks li.fail .ck { background: var(--bad); } .ai-checks li.fail .ck::before { content: "×"; }
.ai-checks li.busy .ck::before { content: "…"; color: var(--muted); }
.ai-checks li.fail { border-color: rgba(194, 65, 59, .35); background: #fff7f6; }
.ai-checks .fix { color: var(--ink); font-weight: 600; }
.ai-packs { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); margin-bottom: 1rem; }
.ai-pack .meter { height: 8px; border-radius: 99px; background: var(--lav-100); overflow: hidden; margin: .6rem 0 .3rem; }
.ai-pack .meter span { display: block; height: 100%; background: var(--leaf-600); transition: width .3s ease; }

/* segmented control, reading levels */
.seg { display: inline-flex; gap: .2rem; padding: .25rem; background: var(--lav-50); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 1rem; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: .5rem .8rem; border-radius: 9px; font: 600 .9rem var(--font); color: var(--muted); cursor: pointer; min-height: 38px; }
.seg button[aria-selected="true"] { background: var(--paper); color: var(--lav-800); box-shadow: 0 1px 3px rgba(46, 36, 83, .12); }
.pill.lvl-ok { background: var(--leaf-100); color: var(--leaf-700); }
.pill.lvl-info { background: #fff3d6; color: #7a5208; }
.pill.lvl-high, .pill.lvl-low { background: #ffe9dc; color: #93400f; }
.pill.lvl-urgent { background: #fde2e1; color: #a12622; }
.stat.reading.lvl-urgent { border-color: rgba(194, 65, 59, .5); background: #fff7f6; }
.stat.reading.lvl-high, .stat.reading.lvl-low { border-color: #f3c7a6; }

/* registration wizard */
.joinwiz { max-width: 860px; margin: 0 auto; }
.jw-head h1 { margin-bottom: .2rem; }
.jw-steps { list-style: none; display: flex; gap: .3rem; padding: 0; margin: 1.1rem 0 1rem; counter-reset: s; overflow-x: auto; }
.jw-steps li { flex: 1; min-width: 92px; display: flex; flex-direction: column; align-items: center; gap: .3rem; font-size: .8rem; font-weight: 600; color: var(--muted); text-align: center; position: relative; cursor: default; }
.jw-steps li span { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line); background: var(--paper); font-weight: 700; z-index: 1; }
.jw-steps li::after { content: ""; position: absolute; top: 15px; left: calc(50% + 18px); right: calc(-50% + 18px); height: 2px; background: var(--line); }
.jw-steps li:last-child::after { display: none; }
.jw-steps li.on { color: var(--lav-800); }
.jw-steps li.on span { border-color: var(--lav-700); background: var(--lav-700); color: #fff; }
.jw-steps li.done { color: var(--leaf-700); cursor: pointer; }
.jw-steps li.done span { border-color: var(--leaf-600); background: var(--leaf-100); color: var(--leaf-700); }
.jw-steps li.done::after { background: var(--leaf-500); }
.jw-form .jw-step { border: 0; padding: 0; margin: 0 0 1.4rem; min-width: 0; }
.jw-form .jw-step > legend { font-family: var(--display); font-size: 1.35rem; font-weight: 700; margin-bottom: .8rem; color: var(--plum); }
.jw-form:not(.js) .jw-step { border-bottom: 1px dashed var(--line); padding-bottom: 1.2rem; }
.jw-form fieldset fieldset { border: 0; padding: 0; margin: 0 0 .9rem; }
.jw-form fieldset fieldset > legend { font-weight: 600; margin-bottom: .35rem; font-size: .95rem; }
.inline-choice { display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; align-items: center; }
.inline-choice > legend { width: 100%; }
.jw-nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-top: 1px solid var(--line); padding-top: 1rem; position: sticky; bottom: 0; background: var(--paper); margin: 0 -1.2rem -1.2rem; padding: 1rem 1.2rem; border-radius: 0 0 16px 16px; }
.jw-nav .jw-count { margin: 0 auto; }
.jw-form:not(.js) [data-next], .jw-form:not(.js) [data-prev] { display: none; }
.has-error > label, .has-error > legend { color: var(--bad); }
input.invalid, select.invalid { border-color: var(--bad) !important; box-shadow: 0 0 0 3px rgba(194, 65, 59, .14) !important; }
.pwrow { display: flex; gap: .4rem; }
.pwrow input { flex: 1; }
.pwmeter { height: 5px; background: var(--lav-100); border-radius: 9px; margin-top: .35rem; overflow: hidden; }
.pwmeter i { display: block; height: 100%; width: 0; background: var(--bad); transition: width .2s ease, background .2s ease; }
.pwmeter i.ok { background: var(--warn); }
.pwmeter i.strong { background: var(--leaf-600); }
.units { margin-bottom: 1rem; }
.units label { padding: .5rem .9rem; border-radius: 9px; font-weight: 600; font-size: .9rem; color: var(--muted); cursor: pointer; display: flex; align-items: center; gap: .4rem; }
.units label.on { background: var(--paper); color: var(--lav-800); box-shadow: 0 1px 3px rgba(46, 36, 83, .12); }
.units input { accent-color: var(--lav-700); }
.grid2.tight { gap: .5rem; }
.bmicard { display: grid; grid-template-columns: auto 1fr; gap: .6rem 1.2rem; align-items: center; padding: 1rem 1.1rem; border-radius: 14px; background: var(--lav-50); border: 1px solid var(--line); margin-top: .4rem; }
.bmicard .bmi-num { grid-row: span 2; text-align: center; min-width: 74px; }
.bmicard .bmi-num span { display: block; font: 700 2rem/1 var(--display); color: var(--plum); }
.bmicard .bmi-num small { color: var(--muted); font-weight: 700; }
.bmi-scale { position: relative; height: 10px; border-radius: 99px; background: linear-gradient(90deg, #f0c36a 0 17.5%, #5aae80 17.5% 39.5%, #f0c36a 39.5% 50%, #e8875f 50% 75%, #c2413b 75%); }
.bmi-scale b { position: absolute; top: -5px; width: 4px; height: 20px; border-radius: 3px; background: var(--ink); transform: translateX(-2px); left: 0; transition: left .25s ease; box-shadow: 0 0 0 2px #fff; }
.bmicard.ok { border-color: #bfe0cb; background: var(--leaf-100); }
.bmicard.warn { border-color: #f1d49b; background: #fff8e8; }
.bmicard.bad { border-color: #f0b9a6; background: #fff3ee; }
.jw-readings { border: 1px solid var(--line); border-radius: 12px; padding: .7rem .9rem; margin: .4rem 0 1rem; }
.jw-readings summary { cursor: pointer; font-weight: 600; }
.jw-readings[open] summary { margin-bottom: .7rem; }

/* plan (registration preview and My daily plate) */
.planpv { display: grid; gap: 1.1rem; }
.pv-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .7rem; }
.pv-fast { display: flex; gap: 1rem; align-items: center; padding: 1rem 1.1rem; border-radius: 14px; background: var(--lav-50); border: 1px solid var(--line); }
.pv-fast.locked { display: block; background: #fff8e8; border-color: #f1d49b; }
.pv-fast h3 { margin: 0 0 .25rem; }
.pv-fast p { margin: .2rem 0; }
.pv-fast-ring { position: relative; width: 92px; height: 92px; flex: none; }
.pv-fast-ring svg { width: 92px; height: 92px; }
.pv-fast-ring b { position: absolute; inset: 0; display: grid; place-items: center; font: 700 1.05rem var(--display); color: var(--plum); }
.pv-plate h3, .pv-meals h3 { margin: 0 0 .2rem; }
.groups { list-style: none; padding: 0; margin: .6rem 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .45rem .9rem; }
.groups li { display: grid; grid-template-columns: 14px 1fr auto; gap: .1rem .55rem; align-items: center; padding: .45rem .6rem; border-radius: 10px; background: var(--paper); border: 1px solid var(--line); }
.groups li small { grid-column: 2 / 4; color: var(--muted); font-size: .8rem; }
.groups li span:not(.sw) { font-weight: 700; color: var(--plum); white-space: nowrap; }
.groups .sw { width: 14px; height: 14px; border-radius: 4px; background: #ccc; }
.g-cereals .sw { background: #e2b04a; } .g-pulses .sw { background: #b5651d; } .g-milk .sw { background: #9fc5e8; } .g-vegetables .sw { background: #3f8f62; }
.g-fruits .sw { background: #e8875f; } .g-nuts .sw { background: #8d6e63; } .g-fats .sw { background: #f3d58c; }
.meals { list-style: none; padding: 0; margin: .5rem 0; display: grid; gap: .5rem; }
.meals li { display: grid; grid-template-columns: 58px 1fr; gap: .6rem; padding: .55rem .7rem; border-radius: 10px; border: 1px solid var(--line); background: var(--paper); }
.meals .t { font-weight: 700; color: var(--lav-700); font-variant-numeric: tabular-nums; }
@media (max-width: 720px) {
  .pv-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .jw-steps li { min-width: 54px; font-size: 0; gap: 0; }
  .jw-steps li span { font-size: .85rem; }
  .jw-nav { margin: 0 -1rem -1rem; padding: .8rem 1rem; }
  .pv-fast { flex-direction: column; align-items: flex-start; }
}
/* heritage theme touches */
.theme-heritage .jw-steps li.on span { background: var(--leaf); border-color: var(--leaf); }
.theme-heritage .jw-form .jw-step > legend { color: var(--leaf-deep); }
.theme-heritage .jw-nav { background: #fff; }
.jw-nav [hidden], .btn[hidden] { display: none !important; }
.planmini { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; }
.planmini > div { display: flex; flex-direction: column; padding: .6rem .7rem; border-radius: 12px; background: var(--lav-50); border: 1px solid var(--line); }
.planmini .k { font-size: .78rem; color: var(--muted); font-weight: 600; }
.planmini b { font: 700 1.2rem var(--display); color: var(--plum); }
.planmini small { color: var(--muted); font-size: .8rem; }
.jw-form [hidden], .planpv [hidden] { display: none !important; }

/* ------------------------------------------------------------- appointments */
.book { max-width: 920px; margin: 0 auto; }
.book.narrow { max-width: 640px; }
.book .panel h2 { display: flex; align-items: center; gap: .55rem; font-size: 1.12rem; }
.bstep { display: inline-grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--leaf-100); color: var(--leaf-700); font-size: .9rem; font-weight: 800; }
.svcpick { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.svcpick label { align-items: flex-start; }
.svcpick label > span { display: grid; gap: .15rem; }
.daypick { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .4rem; scroll-snap-type: x proximity; }
.daypick label, .timepick label, .modepick label { margin: 0; cursor: pointer; position: relative; }
.daypick input, .timepick input, .modepick input { position: absolute; opacity: 0; pointer-events: none; }
.daypick span { display: grid; min-width: 7.2rem; padding: .55rem .7rem; border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--paper); font-weight: 700; font-size: .9rem; scroll-snap-align: start; }
.daypick small { font-weight: 500; color: var(--muted); font-size: .76rem; }
.daypick input:checked + span, .timepick input:checked + span { border-color: var(--leaf-500); background: var(--leaf-100); color: var(--leaf-700); }
.daypick input:focus-visible + span, .timepick input:focus-visible + span { outline: 3px solid var(--lav-200); outline-offset: 1px; }
.timepick { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: .45rem; margin-top: .9rem; min-height: 2.6rem; }
.timepick[aria-busy="true"] { opacity: .5; }
.timepick span { display: block; text-align: center; padding: .5rem .3rem; border: 1.5px solid var(--line); border-radius: 10px; background: var(--paper); font-weight: 700; font-variant-numeric: tabular-nums; }
.modepick label { cursor: pointer; }
.modepick label:has(input:checked) { background: var(--leaf-100); border-color: var(--leaf-500); color: var(--leaf-700); }
.modepick label[hidden] { display: none !important; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.appt-when { font-size: 1.35rem; font-weight: 800; margin: .2rem 0 .8rem; color: var(--leaf-700); }
table.hours input[type=time] { width: auto; min-height: 34px; padding: .2rem .4rem; }
