/* Pathya brand: leaf green (wholesome, "pathya" = suitable food) + turmeric warmth. Red is reserved for real alerts. */
:root {
  color-scheme: light;
  --cp-bg: #f6f4ee;
  --cp-bg-elevated: #fbfaf6;
  --cp-surface: #ffffff;
  --cp-surface-soft: #f1efe8;
  --cp-border: #e2ded3;
  --cp-border-strong: #a39e90;
  --cp-text: #1d2721;
  --cp-text-muted: #56615a;
  --cp-text-soft: #66706a;
  --cp-accent: #1e7a4c;
  --cp-accent-hover: #17623d;
  --cp-accent-soft: rgba(30, 122, 76, 0.09);
  --cp-accent-fg: #ffffff;
  --cp-turmeric: #e0a126;
  --cp-turmeric-soft: rgba(224, 161, 38, 0.14);
  --cp-success: #2b8a4e;
  --cp-danger: #c2362b;
  --cp-warning: #c77800;
  --cp-link: #2563a8;
  --cp-shadow: 0 18px 48px rgba(29, 39, 33, 0.12);
  --cp-panel-strong: rgba(251, 250, 246, 0.96);
}
html[data-theme="dark"] {
  color-scheme: dark;
  --cp-bg: #141a16;
  --cp-bg-elevated: #1a211c;
  --cp-surface: #1f2722;
  --cp-surface-soft: #26302a;
  --cp-border: #34403a;
  --cp-border-strong: #5a6760;
  --cp-text: #e8ede9;
  --cp-text-muted: #a3b0a8;
  --cp-text-soft: #93a199;
  --cp-accent: #4cc38a;
  --cp-accent-hover: #62d19b;
  --cp-accent-soft: rgba(76, 195, 138, 0.14);
  --cp-accent-fg: #0e1a13;
  --cp-turmeric: #f0b44c;
  --cp-turmeric-soft: rgba(240, 180, 76, 0.16);
  --cp-success: #4cc38a;
  --cp-danger: #f2776b;
  --cp-warning: #f0b44c;
  --cp-link: #7db3f0;
  --cp-shadow: 0 18px 48px rgba(0, 0, 0, 0.4);
  --cp-panel-strong: rgba(26, 33, 28, 0.96);
}* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body { background: var(--cp-bg); color: var(--cp-text); font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Noto Sans", "Noto Sans Devanagari", "Nirmala UI", Aptos, sans-serif; font-size: 14.5px; line-height: 1.45; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--cp-link); }
input, textarea, select { font: inherit; font-size: 16px; color: var(--cp-text); background: var(--cp-surface); border: 1px solid var(--cp-border); border-radius: 10px; padding: 9px 11px; width: 100%; }
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus, button:focus-visible { outline: 2px solid var(--cp-accent); outline-offset: 1px; }
#app { max-width: 520px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; position: relative; background: var(--cp-bg); }

.ahead { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: var(--cp-bg-elevated); border-bottom: 1px solid var(--cp-border); }
.brand { font-weight: 800; font-size: 20px; color: var(--cp-accent); letter-spacing: -.01em; }
.carechip { font-size: 11.5px; font-weight: 700; padding: 5px 10px; border-radius: 999px; background: var(--cp-accent-soft); color: var(--cp-accent); border: 0; }
.carechip.off { background: var(--cp-surface-soft); color: var(--cp-text-muted); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--cp-accent); color: var(--cp-accent-fg); display: grid; place-items: center; font-weight: 700; flex: none; font-size: 14px; border: 0; }
main.abody { padding: 14px 14px calc(96px + env(safe-area-inset-bottom)); }
.dock { position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: 100%; max-width: 520px; display: grid; grid-template-columns: repeat(4, 1fr); padding: 8px 6px calc(10px + env(safe-area-inset-bottom)); background: var(--cp-panel-strong); border-top: 1px solid var(--cp-border); z-index: 15; backdrop-filter: blur(8px); }
.dock button { border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--cp-text-muted); position: relative; padding: 4px 0; }
.dock button.on { color: var(--cp-accent); font-weight: 700; }
.dock svg { width: 23px; height: 23px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dock .dot { position: absolute; top: 1px; right: 30%; width: 9px; height: 9px; border-radius: 50%; background: var(--cp-danger); border: 2px solid var(--cp-surface); }
.card { background: var(--cp-surface); border: 1px solid var(--cp-border); border-radius: 16px; padding: 13px 14px; margin-bottom: 12px; box-shadow: 0 0 2px rgba(0,0,0,.12), 0 1px 2px rgba(0,0,0,.14); }
.card h4 { margin: 0 0 8px; font-size: 15px; }
.card h5 { margin: 12px 0 6px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--cp-text-muted); }
.muted { color: var(--cp-text-muted); } .soft { color: var(--cp-text-soft); } .small { font-size: 13px; } .tiny { font-size: 11.5px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.row.start { justify-content: flex-start; } .row.top { align-items: flex-start; } .grow { flex: 1; min-width: 0; }
.big { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.h1 { font-size: 21px; font-weight: 800; letter-spacing: -.01em; }
.lvl-ok { --c: var(--cp-success); } .lvl-warn { --c: var(--cp-warning); } .lvl-danger, .lvl-block, .lvl-emergency, .lvl-urgent { --c: var(--cp-danger); } .lvl-info, .lvl-doctor, .lvl-routine { --c: var(--cp-link); } .lvl-accent { --c: var(--cp-accent); } .lvl-muted { --c: var(--cp-text-soft); }
.pill { display: inline-flex; gap: 4px; align-items: center; font-size: 11px; padding: 2px 8px; border-radius: 999px; background: color-mix(in srgb, var(--c, var(--cp-accent)) 13%, transparent); color: color-mix(in srgb, var(--c, var(--cp-accent)) 72%, var(--cp-text)); font-weight: 700; white-space: nowrap; }
.src { font-family: Consolas, "Courier New", Courier, monospace; font-size: 10px; padding: 1px 5px; border-radius: 5px; background: var(--cp-surface-soft); color: var(--cp-text-muted); white-space: nowrap; border: 1px solid var(--cp-border); }
.bar { height: 7px; border-radius: 6px; background: var(--cp-surface-soft); overflow: hidden; margin-top: 5px; position: relative; border: 1px solid var(--cp-border); }
.bar i { display: block; height: 100%; border-radius: 6px; background: var(--c, var(--cp-accent)); }
.bar b { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--cp-text); }
.metric { padding: 8px 0; border-bottom: 1px solid var(--cp-border); } .metric:last-child { border-bottom: 0; }
.btn { border: 1px solid var(--cp-border); background: var(--cp-surface); border-radius: 10px; padding: 9px 13px; font-weight: 600; font-size: 13.5px; }
.btn:hover { border-color: var(--cp-border-strong); }
.btn.primary { background: var(--cp-accent); color: var(--cp-accent-fg); border-color: var(--cp-accent); }
.btn.primary:hover { background: var(--cp-accent-hover); }
.btn.danger { background: var(--cp-danger); border-color: var(--cp-danger); color: var(--cp-accent-fg); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
.btn.block { width: 100%; } .btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--cp-accent); padding-left: 4px; padding-right: 4px; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.note { border-left: 3px solid var(--c, var(--cp-accent)); background: color-mix(in srgb, var(--c, var(--cp-accent)) 8%, var(--cp-surface)); padding: 9px 11px; border-radius: 10px; font-size: 13px; margin-top: 8px; }
.note b.t { display: block; margin-bottom: 2px; }
.flag { font-size: 12.5px; padding: 6px 9px; border-radius: 9px; background: color-mix(in srgb, var(--c) 10%, var(--cp-surface)); border: 1px solid color-mix(in srgb, var(--c) 30%, transparent); margin-top: 6px; }
.seg { display: flex; gap: 3px; background: var(--cp-surface-soft); padding: 4px; border-radius: 12px; margin-bottom: 12px; overflow-x: auto; border: 1px solid var(--cp-border); scrollbar-width: none; position: sticky; top: 58px; z-index: 8; }
.seg::-webkit-scrollbar { display: none; }
.seg button { flex: 1 0 auto; border: 0; background: transparent; border-radius: 9px; padding: 7px 10px; font-size: 12.5px; white-space: nowrap; color: var(--cp-text-muted); position: relative; }
.seg button.on { background: var(--cp-surface); color: var(--cp-text); font-weight: 700; box-shadow: 0 0 2px rgba(0,0,0,.12), 0 1px 2px rgba(0,0,0,.14); }
.seg .dot { position: absolute; top: 4px; right: 4px; width: 7px; height: 7px; border-radius: 50%; background: var(--cp-danger); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--cp-border); background: var(--cp-surface); border-radius: 999px; padding: 6px 11px; font-size: 13px; text-align: left; }
.chip.on { background: var(--cp-accent); border-color: var(--cp-accent); color: var(--cp-accent-fg); }
.list { margin: 0; padding-left: 18px; } .list li { margin: 4px 0; font-size: 13.5px; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 5px 10px; font-size: 13.5px; } .kv > :nth-child(even) { text-align: right; font-weight: 600; }
.item { border: 1px solid var(--cp-border); border-radius: 12px; padding: 10px; margin-top: 8px; background: var(--cp-surface); }
.nutr { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.nc { font-size: 11.5px; padding: 2px 7px; border-radius: 6px; background: var(--cp-surface-soft); border: 1px solid var(--cp-border); }
.nc.focus { border-color: var(--cp-accent); color: var(--cp-accent); font-weight: 700; }
.tl { display: grid; grid-template-columns: 14px 1fr auto; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--cp-border); font-size: 13.5px; }
.tl:last-child { border-bottom: 0; } .tl .d { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.rings { display: flex; justify-content: space-around; gap: 6px; margin-top: 6px; }
.ring { display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; font-size: 11.5px; min-width: 84px; } .ring b { font-size: 13.5px; }
.glasses { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.glass { width: 15px; height: 22px; border: 2px solid var(--cp-link); border-top: 0; border-radius: 0 0 5px 5px; } .glass.f { background: color-mix(in srgb, var(--cp-link) 45%, transparent); }
.dots { display: flex; gap: 5px; } .dots span { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--cp-accent); } .dots span.f { background: var(--cp-accent); }
.mealbars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; align-items: end; height: 96px; margin-top: 8px; }
.mb { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; font-size: 10.5px; gap: 3px; position: relative; }
.mb i { width: 100%; max-width: 38px; border-radius: 6px 6px 2px 2px; background: var(--c); min-height: 3px; }
.mb .cap { position: absolute; left: 0; right: 0; border-top: 2px dashed var(--cp-text-soft); }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tile { border: 1px solid var(--cp-border); background: var(--cp-surface); border-radius: 12px; padding: 10px; text-align: left; }
.tile:hover { border-color: var(--cp-accent); } .tile b { display: block; font-size: 13.5px; } .tile span { font-size: 12px; color: var(--cp-text-muted); }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .dow { font-size: 11px; text-align: center; color: var(--cp-text-muted); padding-bottom: 2px; }
.cal .day { border: 1px solid var(--cp-border); background: var(--cp-surface); border-radius: 9px; min-height: 58px; padding: 3px; display: flex; flex-direction: column; gap: 2px; text-align: left; overflow: hidden; }
.cal .day.today { border-color: var(--cp-accent); box-shadow: inset 0 0 0 1px var(--cp-accent); } .cal .day.sel { background: var(--cp-accent-soft); } .cal .day.future { background: var(--cp-surface-soft); }
.cal .num { font-size: 11px; font-weight: 700; }
.marks { display: flex; flex-wrap: wrap; gap: 2px; }
.mk { font-size: 8.5px; line-height: 1; padding: 2px 3px; border-radius: 4px; background: color-mix(in srgb, var(--c, var(--cp-accent)) 16%, transparent); color: color-mix(in srgb, var(--c, var(--cp-accent)) 78%, var(--cp-text)); font-weight: 700; white-space: nowrap; }
.dotm { width: 6px; height: 6px; border-radius: 50%; background: var(--cp-text-soft); display: inline-block; }
.sheet-bg { position: fixed; inset: 0; background: color-mix(in srgb, #000 42%, transparent); display: flex; align-items: flex-end; justify-content: center; z-index: 40; }
.sheet { background: var(--cp-bg-elevated); width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; border-radius: 20px 20px 0 0; padding: 12px 16px calc(24px + env(safe-area-inset-bottom)); }
.sheet .grab { width: 40px; height: 4px; border-radius: 4px; background: var(--cp-border-strong); margin: 0 auto 12px; }
.sheet h4 { margin: 0 0 10px; font-size: 17px; }
.field { margin-bottom: 10px; } .field label, .lbl { display: block; font-size: 12px; color: var(--cp-text-muted); margin-bottom: 4px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; } .grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; margin: 7px 0; } .check input { width: auto; margin-top: 3px; }
.alertbar { border-radius: 14px; padding: 11px 12px; margin-bottom: 12px; background: color-mix(in srgb, var(--c) 13%, var(--cp-surface)); border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); }
.alertbar b.t { display: block; font-size: 14.5px; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); width: calc(100% - 28px); max-width: 490px; bottom: calc(84px + env(safe-area-inset-bottom)); background: var(--cp-text); color: var(--cp-bg); border-radius: 12px; padding: 11px 13px; font-size: 13.5px; z-index: 60; box-shadow: var(--cp-shadow); }
.chatlog { display: flex; flex-direction: column; gap: 8px; }
.bubble { max-width: 86%; padding: 9px 12px; border-radius: 14px; font-size: 13.5px; white-space: pre-wrap; }
.bubble.me { align-self: flex-end; background: var(--cp-accent); color: var(--cp-accent-fg); border-bottom-right-radius: 4px; }
.bubble.bot { align-self: flex-start; background: var(--cp-surface); border: 1px solid var(--cp-border); border-bottom-left-radius: 4px; }
.bubble.urgent, .bubble.emergency { border-color: var(--cp-danger); background: color-mix(in srgb, var(--cp-danger) 9%, var(--cp-surface)); }
.bubble img { max-width: 100%; border-radius: 10px; display: block; margin-bottom: 6px; }
.chatbar { position: sticky; bottom: calc(70px + env(safe-area-inset-bottom)); display: flex; gap: 6px; align-items: flex-end; background: var(--cp-bg); padding: 8px 0; }
.chatbar textarea { min-height: 42px; max-height: 120px; }
.iconbtn { width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--cp-border); background: var(--cp-surface); display: grid; place-items: center; flex: none; font-size: 18px; }
.iconbtn.primary { background: var(--cp-accent); border-color: var(--cp-accent); color: var(--cp-accent-fg); }
.suggest { border: 1px solid var(--cp-border); border-radius: 12px; background: var(--cp-surface); margin-top: 6px; overflow: hidden; }
.suggest button { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--cp-border); background: transparent; padding: 8px 10px; font-size: 13px; }
.suggest button:last-child { border-bottom: 0; } .suggest button:hover { background: var(--cp-accent-soft); }
.doc { display: grid; grid-template-columns: 56px 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--cp-border); }
.doc:last-child { border-bottom: 0; }
.thumb { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; background: var(--cp-surface-soft); display: grid; place-items: center; font-size: 22px; border: 1px solid var(--cp-border); }
.welcome { padding: 28px 18px 40px; }
.welcome .logo { font-size: 34px; font-weight: 800; color: var(--cp-accent); letter-spacing: -.02em; }
.spark { display: block; width: 100%; }
.hr { height: 1px; background: var(--cp-border); margin: 10px 0; }
.empty { text-align: center; color: var(--cp-text-muted); padding: 18px 8px; font-size: 13.5px; }
body.hl .care { outline: 2px dashed var(--cp-accent); outline-offset: 2px; position: relative; }
body.hl .care[data-src]::after { content: attr(data-src); position: absolute; top: -9px; right: 8px; font-size: 9px; font-weight: 700; background: var(--cp-accent); color: var(--cp-accent-fg); padding: 1px 6px; border-radius: 6px; z-index: 2; pointer-events: none; font-family: Consolas, monospace; max-width: 85%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#print-area { display: none; }
@media print {
  body { background: #fff; color: #000; }
  #app { display: none !important; }
  #print-area { display: block !important; padding: 16px; font-size: 12px; }
  #print-area h1 { font-size: 18px; margin: 0 0 4px; } #print-area h2 { font-size: 13px; border-bottom: 1px solid #999; margin: 14px 0 6px; padding-bottom: 2px; }
  #print-area table { border-collapse: collapse; width: 100%; } #print-area td { padding: 2px 6px; border-bottom: 1px solid #ddd; vertical-align: top; }
  #print-area img { max-width: 48%; margin: 4px; border: 1px solid #ccc; }
}

/* ---------- v2 layout & components ---------- */
.btn { min-height: 40px; } .btn.sm { min-height: 34px; } .chip { min-height: 34px; }
.logo { width: 28px; height: 28px; flex: none; display: block; }
.brand { color: var(--cp-accent); }
.side { display: none; }
.wide2 > .col { min-width: 0; }
.carenav { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 12px; }
.carenav button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 58px; padding: 6px 4px; border: 1px solid var(--cp-border); background: var(--cp-surface); border-radius: 12px; font-size: 11.5px; line-height: 1.2; text-align: center; color: var(--cp-text-muted); }
.carenav button .ci { font-size: 18px; }
.carenav button.on { border-color: var(--cp-accent); background: var(--cp-accent-soft); color: var(--cp-accent); font-weight: 700; }
.carenav .dot, .snav .dot { position: absolute; top: 6px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--cp-danger); }
.upnext { border-left: 4px solid var(--cp-turmeric); }
.unrow { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--cp-border); }
.unrow:last-child { border-bottom: 0; }
.unrow.lvl-danger .grow { color: var(--cp-danger); font-weight: 600; }
.unic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--cp-turmeric-soft); flex: none; }
.askcard { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; cursor: pointer; }
.askcard b { display: block; }
.askicon { width: 40px; height: 40px; border-radius: 12px; background: var(--cp-accent-soft); display: grid; place-items: center; font-size: 20px; flex: none; }
.setup { border: 1px dashed var(--cp-accent); }
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.quick:has(> :only-child) { grid-template-columns: 1fr; }
.qbtn { text-align: left; border: 1px solid var(--cp-border); background: var(--cp-turmeric-soft); border-radius: 12px; padding: 8px 10px; min-height: 52px; }
.qbtn b { display: block; font-size: 13px; } .qbtn span { display: block; font-size: 11.5px; color: var(--cp-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.src { font-family: inherit; font-size: 10.5px; font-weight: 600; background: var(--cp-accent-soft); color: var(--cp-accent); border-color: transparent; border-radius: 999px; padding: 1px 7px; }
/* welcome */
.welcome { padding: 22px 16px 40px; }
.hero { margin-bottom: 14px; }
.htitle { font-size: 30px; line-height: 1.12; letter-spacing: -.02em; margin: 16px 0 8px; }
.hsub { color: var(--cp-text-muted); font-size: 15px; margin: 0 0 12px; }
.vps { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.vp { background: var(--cp-surface); border: 1px solid var(--cp-border); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.vp > span { font-size: 22px; width: 40px; height: 40px; border-radius: 12px; background: var(--cp-turmeric-soft); display: grid; place-items: center; margin-bottom: 4px; }
.vp small { color: var(--cp-text-muted); font-size: 12px; }
.persona { width: 100%; text-align: left; display: flex; gap: 10px; align-items: center; cursor: pointer; }
.trust { display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; font-size: 12px; color: var(--cp-text-muted); margin: 6px 0 10px; }
a.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; color: inherit; }
a.btn.primary { color: var(--cp-accent-fg); }
/* desktop */
@media (min-width: 960px) {
  #app { max-width: 1240px; border: 0; box-shadow: none; }
  .shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; }
  .side { display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100vh; padding: 20px 14px; border-right: 1px solid var(--cp-border); background: var(--cp-bg-elevated); overflow-y: auto; }
  .sbrand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; } .sbrand .brand { font-size: 22px; font-weight: 800; }
  .snav { position: relative; display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent; border-radius: 10px; padding: 10px 12px; font-size: 14.5px; color: var(--cp-text-muted); text-align: left; }
  .snav svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .snav:hover { background: var(--cp-surface-soft); } .snav.on { background: var(--cp-accent-soft); color: var(--cp-accent); font-weight: 700; }
  .ssub { display: flex; flex-direction: column; margin: 2px 0 6px 22px; border-left: 2px solid var(--cp-border); }
  .ssub button { border: 0; background: transparent; text-align: left; padding: 6px 12px; font-size: 13px; color: var(--cp-text-muted); border-radius: 0 8px 8px 0; }
  .ssub button:hover { background: var(--cp-surface-soft); } .ssub button.on { color: var(--cp-accent); font-weight: 700; background: var(--cp-accent-soft); }
  .sfoot { margin-top: auto; padding: 10px 8px; }
  .ahead { padding: 14px 28px; } .ahead .hbrand { visibility: hidden; }
  main.abody { padding: 20px 28px 40px; }
  .dock { display: none; }
  .carenav { display: none; }
  .wide2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
  .carebody { max-width: 820px; }
  .chatbar { bottom: 0; }
  .toast { bottom: 24px; }
  .cal .day { min-height: 76px; }
  .welcome { max-width: 1000px; margin: 0 auto; padding: 48px 32px; }
  .hero { display: grid; grid-template-columns: 1.15fr 1fr; gap: 32px; align-items: center; }
  .htitle { font-size: 44px; } .vps { margin-top: 0; }
  #try, #setup { display: inline-block; vertical-align: top; width: calc(50% - 8px); }
  #try { margin-right: 12px; }
  .sheet-bg { align-items: center; } .sheet { border-radius: 20px; max-height: 84vh; }
}
@media (min-width: 560px) and (max-width: 959px) { #app { border-left: 1px solid var(--cp-border); border-right: 1px solid var(--cp-border); } }
@media (min-width: 960px) { #app { border-left: 0; border-right: 0; } }

/* ---------- audit fixes ---------- */
.quick { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .quick > * { min-width: 0; }
.carechip { min-height: 34px; padding: 6px 12px; }
[data-act="delLog"] { min-width: 34px; min-height: 34px; }
[data-act="calNav"] { min-width: 40px; }
.carenav button { font-size: 12px; } .carenav button.on { color: var(--cp-accent-hover); }
html[data-theme="dark"] .carenav button.on { color: var(--cp-accent); }
label.field { display: block; } label.field > .lbl { display: block; font-size: 12px; color: var(--cp-text-muted); margin-bottom: 4px; }
.src { color: var(--cp-accent-hover); background: var(--cp-surface); border: 1px solid var(--cp-border); } html[data-theme="dark"] .src { color: var(--cp-accent); }
.mk { color: color-mix(in srgb, var(--c, var(--cp-accent)) 52%, var(--cp-text)); } .pill { color: color-mix(in srgb, var(--c, var(--cp-accent)) 62%, var(--cp-text)); }

/* ---------- accounts & sync ---------- */
.syncb { display: inline-flex; align-items: center; gap: 5px; min-height: 34px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--cp-border); background: var(--cp-surface); color: var(--cp-text-muted); font-size: 11.5px; font-weight: 600; cursor: pointer; }
.syncb svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.syncb.ok { color: var(--cp-success); } .syncb.busy { color: var(--cp-link); } .syncb.warn { color: var(--cp-warning); border-color: color-mix(in srgb, var(--cp-warning) 45%, var(--cp-border)); }
.syncb.busy svg { animation: syncpulse 1.2s ease-in-out infinite; }
@keyframes syncpulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .syncb.busy svg { animation: none; } }
@media (max-width: 520px) { .ahead .syncb span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } .ahead .syncb { padding: 5px 9px; } }
.authtabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin-bottom: 8px; border-radius: 12px; background: var(--cp-surface-soft); }
.authtabs button { min-height: 40px; border: 0; border-radius: 9px; background: transparent; color: var(--cp-text-muted); font-weight: 700; font-size: 14px; cursor: pointer; }
.authtabs button.on { background: var(--cp-surface); color: var(--cp-accent); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.autherr { color: var(--cp-danger); font-size: 13px; font-weight: 600; margin: 6px 0 0; min-height: 0; }
.autherr:empty { display: none; }
.linkbtn { display: block; margin: 10px auto 0; min-height: 40px; padding: 6px 10px; border: 0; background: none; color: var(--cp-link); font-size: 13.5px; font-weight: 600; cursor: pointer; text-decoration: underline; }
.keybox { font: 700 22px/1.3 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: 1px; text-align: center; padding: 14px 10px; margin: 10px 0; border: 2px dashed var(--cp-accent); border-radius: 14px; background: var(--cp-accent-soft); color: var(--cp-text); user-select: all; word-break: break-all; }
.demobar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; justify-content: space-between; padding: 10px 12px; margin-bottom: 12px; border-radius: 14px; background: var(--cp-turmeric-soft); border: 1px solid color-mix(in srgb, var(--cp-turmeric) 40%, var(--cp-border)); font-size: 13px; }
.check a { color: var(--cp-link); }

[id^="sec-"], #auth, #try { scroll-margin-top: 84px; }
@media (min-width: 960px) { .ahead .syncb { display: none; } }

/* welcome: show where a top button took you */
.flash { animation: flashcard 1.4s ease-out; }
@keyframes flashcard { 0%, 35% { box-shadow: 0 0 0 3px var(--cp-turmeric), var(--cp-shadow); } 100% { box-shadow: 0 0 0 0 transparent; } }
.check.flash { border-radius: 10px; animation-duration: 1.8s; }
@media (prefers-reduced-motion: reduce) { .flash { animation: none; outline: 3px solid var(--cp-turmeric); outline-offset: 2px; } }
.welcome .btns button.btn { font: inherit; font-weight: 700; cursor: pointer; }
