  /* ============ Cadence design tokens: edit here only (UX round 1, U1) ============
     New names (--page, --card, --sunken, --text-1..3, --accent, --danger, --type-*, --space-*, --radius-*)
     plus the legacy names (--accent-fill, --accent-text, --raised, --chip-*, --pill-*) kept as aliases.
     Dark values apply via body.dark-mode, which updateDarkMode() sets for appearance=Dark or System+OS dark
     (so "Light" now really is light even when the OS is dark). Dusk re-points the same names. */
  :root {
    --page: #F6F7F5; --card: #FFFFFF; --surface: var(--card); --raised: #FFFFFF; --sunken: #EEF2F0;
    --hairline: #E3E8E6; --border-strong: #CFD8D4;
    --text-1: #12201C; --text-2: #4A5B55; --text-3: #5C6B66;
    --accent: #0F766E; --accent-press: #0D5F59; --accent-soft: #E6F4F1; --on-accent: #FFFFFF;
    --accent-text: var(--accent); --accent-fill: var(--accent); --accent-on-fill: var(--on-accent);
    --good-bg: #CCFBF1; --good-text: #115E59; --steady-bg: #FEF3C7; --steady-text: #92400E; --recover-bg: #FFE4E6; --recover-text: #9F1239;
    --pill-push-bg: var(--good-bg); --pill-push-text: var(--good-text); --pill-steady-bg: var(--steady-bg); --pill-steady-text: var(--steady-text); --pill-recover-bg: var(--recover-bg); --pill-recover-text: var(--recover-text);
    --danger: #B42335; --danger-soft: #FDECEE; --danger-border: #F1C4CA;
    --chip-border: var(--border-strong); --chip-text: #334155; --chip-sel-bg: var(--accent); --chip-sel-text: var(--on-accent);
    --ribbon-night: #1E2A3A; --ribbon-dawn: #F2B880; --ribbon-daylight: #5EC2B7; --ribbon-dusk: #A79BEA;
    --signal-amber: #B7791F; --signal-rose: #BE4B5E;
    --info-bg: #eff6ff; --info-border: #bfdbfe; --info-text: #1e40af;
    --tl-track: #e2e8f0; --tl-sleep: #475569; --tl-deepwork: #0d9488; --tl-walk: #16a34a; --tl-now: #f43f5e; --tl-energy: rgba(30,41,59,0.25);
    --type-display: 32px; --type-num-xl: 40px; --type-title-1: 24px; --type-title-2: 20px; --type-title-3: 17px; --type-body: 16px; --type-callout: 14px; --type-caption: 13px; --type-overline: 12px;
    --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 20px; --space-6: 24px; --space-8: 32px; --space-10: 40px;
    --radius-sm: 8px; --radius-md: 12px; --radius-lg: 14px; --radius-xl: 20px; --radius-full: 9999px;
    --shadow-1: 0 1px 2px rgba(18,32,28,.06), 0 1px 3px rgba(18,32,28,.04); --shadow-sheet: 0 -8px 32px rgba(18,32,28,.14); --shadow: var(--shadow-1);
    --scrim: rgba(18,32,28,.45);
    --dur-press: 120ms; --dur-fade: 200ms; --dur-sheet-in: 280ms; --dur-sheet-out: 200ms; --ease-out: cubic-bezier(.2,.8,.2,1); --ease-in: cubic-bezier(.4,0,1,1);
    --focus: #0F766E;
  }
  body.dark-mode {
    --page: #1A2422; --card: #222E2B; --raised: #2A3734; --sunken: #2A3734; --hairline: #344340; --border-strong: #4A5A55;
    --text-1: #E8F0EC; --text-2: #A7B8B1; --text-3: #93A69F;
    --accent: #2DD4BF; --accent-press: #14B8A6; --accent-soft: rgba(45,212,191,.12); --on-accent: #04201B;
    --accent-text: #2DD4BF; --accent-fill: #2DD4BF; --accent-on-fill: #04201B;
    --good-bg: rgba(45,212,191,.14); --good-text: #5EEAD4; --steady-bg: rgba(251,191,36,.14); --steady-text: #FCD34D; --recover-bg: rgba(251,113,133,.14); --recover-text: #FDA4AF;
    --danger: #FCA5A5; --danger-soft: rgba(252,165,165,.12); --danger-border: rgba(252,165,165,.35);
    --info-bg: rgba(45,212,191,0.08); --info-border: rgba(45,212,191,0.25); --info-text: #99F6E4;
    --chip-border: #4A5A55; --chip-text: #C9D6D1; --chip-sel-bg: #2DD4BF; --chip-sel-text: #04201B;
    --tl-track: #172A26; --tl-sleep: rgba(124,156,245,0.85); --tl-deepwork: #2DD4BF; --tl-walk: #86EFAC; --tl-now: #F87171; --tl-energy: rgba(232,240,236,0.25);
    --shadow-1: none; --shadow-sheet: none; --shadow: none; --scrim: rgba(0,0,0,.6); --focus: #2DD4BF;
  }
  /* Dusk theme: softer dim for light-mode users (not full dark) */
  body.dusk-mode {
    --page: #2B333A; --card: #343D45; --raised: #3D4750; --sunken: #3D4750; --hairline: #4A555E; --border-strong: #5A666F;
    --text-1: #EEF1F3; --text-2: #BCC6CC; --text-3: #B3BEC4;
    --accent: #7DD3C0; --accent-press: #5EC2B7; --accent-soft: rgba(125,211,192,0.14); --on-accent: #10231F;
    --accent-text: #7DD3C0; --accent-fill: #7DD3C0; --accent-on-fill: #10231F;
    --good-bg: rgba(125,211,192,0.18); --good-text: #8FE3CF; --steady-bg: rgba(251,191,36,0.18); --steady-text: #FCD34D; --recover-bg: rgba(251,113,133,0.18); --recover-text: #FDA4AF;
    --danger: #FCA5A5; --danger-soft: rgba(252,165,165,.12); --danger-border: rgba(252,165,165,.35);
    --info-bg: rgba(125,211,192,0.12); --info-border: rgba(125,211,192,0.25); --info-text: #A7E8D8;
    --chip-border: #5A666F; --chip-text: #D6DEE2; --chip-sel-bg: #7DD3C0; --chip-sel-text: #10231F; --chip-active-bg: #5EC2B7; --chip-active-text: #10231F;
    --tl-track: #2B333A; --tl-sleep: rgba(124,156,245,0.85); --tl-deepwork: #5EC2B7; --tl-walk: #86EFAC; --tl-now: #F87171; --tl-energy: rgba(238,241,243,0.25);
    --shadow-1: none; --shadow-sheet: none; --shadow: none; --scrim: rgba(0,0,0,.55); --focus: #7DD3C0;
  }


/* ================= UX round 1: component layer (tokens only) ================= */
body.dark-mode .btn-secondary { color: var(--accent); border-color: var(--accent); }
.btn-primary { background: var(--accent); color: var(--on-accent); min-height: 48px; }
.btn-primary:active { background: var(--accent-press); transform: scale(.98); }
.btn-secondary { color: var(--accent); border-color: var(--accent); min-height: 48px; }
.conn-row { background: var(--sunken) !important; color: var(--text-1); }
.conn-status { color: var(--text-3) !important; }
.bg-teal-600 { background-color: var(--accent) !important; }
.bg-teal-600.text-white, .bg-teal-600 .text-white { color: var(--on-accent) !important; }
button.bg-teal-600, a.bg-teal-600 { border-radius: var(--radius-full) !important; }
button.bg-teal-600:active, a.bg-teal-600:active { background-color: var(--accent-press) !important; }
button.bg-slate-800, a.bg-slate-800, body.dark-mode button.bg-slate-800 { background: var(--card) !important; color: var(--text-1) !important; border: 1px solid var(--border-strong) !important; border-radius: var(--radius-full) !important; min-height: 48px; }
.text-slate-500 { color: var(--text-3) !important; }
.text-rose-600 { color: var(--danger) !important; }
.border-rose-200 { border-color: var(--danger-border) !important; }
.text-teal-700 { color: var(--accent) !important; }
body.dark-mode .bg-teal-50, body.dusk-mode .bg-teal-50 { background-color: var(--accent-soft) !important; }
.text-\[11px\], .text-\[12px\], .text-\[12\.5px\], .text-xs { font-size: var(--type-caption) !important; line-height: 18px; }
.text-\[13\.5px\], .text-\[14\.5px\] { font-size: var(--type-callout) !important; }
.type-title-1 { font-size: var(--type-title-1); line-height: 30px; font-weight: 700; letter-spacing: -.01em; }
.type-title-2 { font-size: var(--type-title-2); line-height: 26px; font-weight: 700; }
.type-title-3 { font-size: var(--type-title-3); line-height: 24px; font-weight: 600; }
.type-body { font-size: var(--type-body); line-height: 24px; }
.type-callout { font-size: var(--type-callout); line-height: 20px; font-weight: 500; }
.type-caption { font-size: var(--type-caption); line-height: 18px; font-weight: 500; }
.type-overline { font-size: var(--type-overline); line-height: 16px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.t1 { color: var(--text-1); } .t2 { color: var(--text-2); } .t3 { color: var(--text-3); } .tacc { color: var(--accent); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: var(--radius-full); font-size: 16px; font-weight: 600; border: 1px solid transparent; cursor: pointer; transition: transform var(--dur-press); text-align: center; position: relative; }
.btn:active { transform: scale(.98); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .4; pointer-events: none; }
.btn-p { background: var(--accent); color: var(--on-accent); }
.btn-p:active { background: var(--accent-press); }
.btn-s { background: var(--card); color: var(--text-1); border-color: var(--border-strong); }
.btn-g { background: transparent; color: var(--accent); min-height: 44px; padding: 0 12px; }
.btn-d { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-border); }
.btn-dfill { background: var(--danger); color: #fff; }
body.dark-mode .btn-dfill, body.dusk-mode .btn-dfill { color: #2A0B0F; }
.btn-sm { min-height: 44px; font-size: 14px; padding: 0 14px; }
.btn-sm::before { content: ""; position: absolute; inset: -4px 0; }
.btn-block { display: flex; width: 100%; }
.c-iconbtn { width: 44px; height: 44px; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-full); color: var(--text-2); background: transparent; border: 1px solid var(--hairline); }
.c-card { background: var(--card); border: 1px solid var(--hairline); border-radius: var(--radius-lg); padding: var(--space-4); box-shadow: var(--shadow-1); }
.c-label { font-size: var(--type-overline); line-height: 16px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); margin: 0 4px 8px; }
.c-list { background: var(--card); border: 1px solid var(--hairline); border-radius: var(--radius-lg); overflow: hidden; }
.c-row { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 16px; width: 100%; text-align: left; color: var(--text-1); background: transparent; }
.c-row + .c-row { border-top: 1px solid var(--hairline); }
.c-row-t { font-size: 16px; font-weight: 500; color: var(--text-1); }
.c-row-c { font-size: 13px; color: var(--text-3); }
.c-seg { display: flex; background: var(--sunken); border-radius: var(--radius-full); padding: 3px; gap: 2px; }
.c-seg > button { flex: 1; min-width: 0; min-height: 40px; border-radius: var(--radius-full); font-size: 14px; font-weight: 600; color: var(--text-2); background: transparent; position: relative; padding: 0 4px; }
.c-seg > button::before { content: ""; position: absolute; inset: -2px 0; }
.c-seg > button[aria-checked="true"] { background: var(--accent); color: var(--on-accent); }
.c-ends { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-3); margin-top: 6px; padding: 0 6px; }
.c-chip { min-height: 44px; padding: 0 14px; border-radius: var(--radius-full); border: 1px solid var(--border-strong); font-size: 15px; font-weight: 500; color: var(--text-1); background: var(--card); display: inline-flex; align-items: center; gap: 6px; position: relative; }
.c-chip::before { content: ""; position: absolute; inset: -2px 0; }
.c-chip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.blkDur.is-on, .blkRep.is-on, .blkDayPick.is-on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.blk-row { touch-action: pan-y; }
.weekEditor { min-width: 0; }
.c-switch { appearance: none; -webkit-appearance: none; width: 44px; height: 26px; border-radius: 9999px; background: var(--border-strong); position: relative; flex: none; cursor: pointer; transition: background var(--dur-fade); margin: 9px 0; }
.c-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 9999px; background: #fff; transition: transform var(--dur-fade) var(--ease-out); box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.c-switch:checked { background: var(--accent); }
.c-switch:checked::after { transform: translateX(18px); }
.c-sheet { position: fixed; inset: 0; z-index: 55; display: flex; align-items: flex-end; justify-content: center; }
.c-scrim { position: absolute; inset: 0; background: var(--scrim); animation: cFade var(--dur-sheet-in) var(--ease-out); }
.c-panel { position: relative; width: 100%; max-width: 480px; max-height: 90dvh; display: flex; flex-direction: column; background: var(--card); color: var(--text-1); border-radius: var(--radius-xl) var(--radius-xl) 0 0; box-shadow: var(--shadow-sheet); animation: cUp var(--dur-sheet-in) var(--ease-out); outline: none; }
body.dark-mode .c-panel, body.dusk-mode .c-panel { border: 1px solid var(--hairline); border-bottom: 0; }
.c-panel::before { content: ""; display: block; width: 36px; height: 4px; border-radius: 9999px; background: var(--border-strong); margin: 8px auto 0; flex: none; }
.c-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px 8px 20px; flex: none; }
.c-title { font-size: var(--type-title-2); line-height: 26px; font-weight: 700; color: var(--text-1); margin: 0; }
.c-sub { padding: 0 20px 8px; margin: -4px 0 0; font-size: 14px; color: var(--text-2); flex: none; }
.c-body { padding: 4px 20px 20px; overflow-y: auto; overscroll-behavior: contain; flex: 1 1 auto; min-height: 0; }
.c-foot { flex: none; padding: 12px 20px calc(env(safe-area-inset-bottom) + 16px); border-top: 1px solid var(--hairline); background: var(--card); display: flex; flex-direction: column; gap: 8px; border-radius: 0; }
.c-sheet.c-full .c-panel { height: 90dvh; }
.c-sheet.c-dialog { align-items: center; padding: 20px; }
.c-sheet.c-dialog .c-panel { max-width: 360px; border-radius: var(--radius-xl); animation: cPop var(--dur-sheet-in) var(--ease-out); border-bottom: 1px solid var(--hairline); }
.c-sheet.c-dialog .c-panel::before { display: none; }
.c-sheet.c-dialog .c-head { padding-top: 16px; }
.c-sheet.c-dialog .c-foot { border-top: 0; padding-bottom: 20px; border-radius: 0 0 var(--radius-xl) var(--radius-xl); }
.c-sheet.c-closing { pointer-events: none; }
.c-sheet.c-closing .c-panel { animation: cDown var(--dur-sheet-out) var(--ease-in) forwards; }
.c-sheet.c-dialog.c-closing .c-panel, .c-sheet.c-closing .c-scrim { animation: cFadeOut var(--dur-sheet-out) var(--ease-in) forwards; }
@keyframes cUp { from { transform: translateY(100%); } to { transform: none; } }
@keyframes cDown { to { transform: translateY(100%); } }
@keyframes cPop { from { transform: translateY(12px) scale(.98); } to { transform: none; } }
@keyframes cFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes cFadeOut { to { opacity: 0; } }
html.c-lock, html.c-lock body { overflow: hidden; }
#askSheet .rounded-t-3xl { max-height: 90dvh; background: var(--card); }
.c-field { width: 100%; min-height: 52px; border-radius: var(--radius-md); border: 1px solid var(--border-strong); background: var(--card); color: var(--text-1); padding: 0 14px; font-size: 16px; }
.c-flabel { display: block; font-size: 14px; font-weight: 600; color: var(--text-1); margin-bottom: 8px; }
.c-help { font-size: 13px; color: var(--text-3); margin-top: 6px; }
.c-err { font-size: 13px; color: var(--danger); margin-top: 6px; }
#toastWrap { position: fixed; left: 0; right: 0; bottom: calc(56px + env(safe-area-inset-bottom) + 16px); z-index: 70; display: flex; justify-content: center; pointer-events: none; padding: 0 16px; }
#toast { pointer-events: auto; max-width: 448px; width: 100%; background: var(--text-1); color: var(--page); border-radius: var(--radius-md); padding: 12px 16px; font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.18); animation: cPop var(--dur-fade) var(--ease-out); }
#toast .t-msg { flex: 1; }
#toast .t-act { color: var(--page); font-weight: 700; text-decoration: underline; min-height: 44px; padding: 0 8px; margin: -12px -8px -12px 0; }
.c-offline { font-size: 13px; color: var(--text-2); background: var(--accent-soft); border-radius: var(--radius-sm); padding: 8px 10px; margin-top: 10px; }
#obChips button, #askChips button { min-height: 40px; position: relative; }
#obChips button::before, #askChips button::before { content: ""; position: absolute; inset: -2px 0; }
.c-status { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; border-radius: var(--radius-full); font-size: 13px; font-weight: 600; position: relative; white-space: nowrap; }
.c-status::before { content: ""; position: absolute; inset: -6px 0; }
.c-status svg { flex: none; }
.c-status.good { background: var(--good-bg); color: var(--good-text); }
.c-status.steady { background: var(--steady-bg); color: var(--steady-text); }
.c-status.recover { background: var(--recover-bg); color: var(--recover-text); }
.c-hero { border-radius: var(--radius-lg); padding: 20px; background: linear-gradient(135deg, #0F766E, #115E59); color: #fff; }
body.dark-mode .c-hero { background: linear-gradient(135deg, #115E59, #134E4A); border: 1px solid #1F6F68; }
body.dusk-mode .c-hero { background: linear-gradient(135deg, #2F6E66, #285B55); }
.c-hero .h-over { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: #CCFBF1; }
.c-hero .h-time { font-size: 40px; line-height: 44px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 6px; }
.c-hero .h-name { font-size: 20px; line-height: 26px; font-weight: 700; margin-top: 2px; }
.c-hero .h-why { font-size: 14px; line-height: 20px; color: #E6FFFA; margin-top: 6px; }
.c-hero .btn-hw { background: #fff; color: #0F766E; }
.c-plan-why { font-size: 15px; line-height: 21px; color: var(--text-3); margin-top: 2px; overflow-wrap: break-word; }
.c-debt-num { font-size: 28px; line-height: 32px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text-1); }
.c-meter { height: 8px; border-radius: 9999px; background: var(--sunken); overflow: hidden; }
.c-meter > i { display: block; height: 100%; border-radius: 9999px; background: var(--accent); }
.c-energy svg { display: block; width: 100%; height: auto; overflow: visible; }
.c-energy .e-line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.c-energy .e-fill { fill: var(--accent); opacity: .12; }
.c-energy .e-axis { stroke: var(--hairline); stroke-width: 1; }
.c-energy .e-now { stroke: var(--tl-now); stroke-width: 1.5; stroke-dasharray: 3 3; }
.c-energy .e-dot { fill: var(--tl-now); stroke: var(--card); stroke-width: 2; }
.c-energy .e-mark { fill: var(--card); stroke: var(--accent); stroke-width: 2; }
.c-elabels, .c-rlabels { position: relative; height: 18px; margin-top: 4px; font-size: 13px; color: var(--text-3); }
.c-elabels span, .c-rlabels span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.c-elabels span:first-child, .c-rlabels span:first-child { transform: none; }
.c-elabels span:last-child, .c-rlabels span:last-child { transform: translateX(-100%); }
.c-epeaks { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 13px; color: var(--text-2); }
.c-epeaks b { color: var(--text-1); font-weight: 600; }
.c-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--text-3); margin-top: 6px; }
.c-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 9999px; margin-right: 5px; }
@media (min-width: 768px) {
  #app { max-width: 480px !important; }
  nav.fixed > div { max-width: 480px !important; }
}
@media (max-width: 359px) {
  #view { padding-left: 16px !important; padding-right: 16px !important; }
  .c-hero .h-time { font-size: 34px; }
}
@media (prefers-reduced-motion: reduce) {
  .c-panel, .c-scrim, .c-sheet.c-closing .c-panel, .c-sheet.c-closing .c-scrim, #toast { animation: none !important; }
}
/* Plan row check button: 44px hit area, 28px visual circle */
.c-check { flex: none; width: 44px; height: 44px; margin: -6px -8px 0 0; display: grid; place-items: center; background: none; border: 0; cursor: pointer; color: #fff; }
.c-check > span { width: 28px; height: 28px; border-radius: 9999px; border: 2px solid var(--text-3); display: grid; place-items: center; transition: background-color 160ms var(--ease-out, ease), border-color 160ms; }
.c-check[aria-pressed="true"] > span { background: var(--accent); border-color: var(--accent); }
.c-check:hover > span { border-color: var(--accent); }
body.dark-mode .c-check[aria-pressed="true"] { color: #0B1220; }
/* U1/U16: legacy Tailwind colour utilities resolve to tokens, so every old template follows light/dark/dusk */
.text-slate-900, .text-slate-800, .text-\[\#0F1E1B\], .text-\[\#0f1e1b\], .text-gray-900 { color: var(--text-1) !important; }
.text-slate-700, .text-slate-600 { color: var(--text-2) !important; }
.text-slate-400, .text-slate-300 { color: var(--text-3) !important; }
.text-teal-600, .text-teal-700, .text-teal-800 { color: var(--accent) !important; }
.bg-white { background-color: var(--card) !important; }
.bg-slate-50, .bg-slate-100, .bg-gray-50 { background-color: var(--sunken) !important; }
.border-slate-100, .border-slate-200, .border-slate-300, .border-gray-200 { border-color: var(--hairline) !important; }
.bg-teal-500, .bg-teal-600 { background-color: var(--accent) !important; }
.bg-slate-300 { background-color: var(--border-strong) !important; }
.border-slate-400, .border-slate-500 { border-color: var(--text-3) !important; }
/* U25 / Oki #5: desktop app = left sidebar nav + centered max-width content (no stretched phone column) */
@media (min-width: 1024px) {
  body.in-app #app { max-width: none !important; margin: 0 0 0 248px !important; border: 0 !important; box-shadow: none !important; background: var(--page) !important; }
  body.in-app #view { max-width: 680px; width: 100%; margin: 0 auto; padding: 8px 32px 64px !important; }
  body.in-app nav.fixed { left: 0 !important; right: auto !important; top: 0; bottom: 0 !important; width: 248px; background: var(--card); border-right: 1px solid var(--hairline); padding: 0 !important; }
  body.in-app nav.fixed::before { content: "Cadence"; display: block; padding: 28px 24px 16px; font-size: 20px; font-weight: 700; letter-spacing: -.01em; color: var(--text-1); }
  body.in-app nav.fixed > div { display: flex !important; flex-direction: column; height: auto !important; max-width: none !important; border-top: 0 !important; padding: 0 12px; gap: 4px; background: transparent !important; }
  body.in-app .tab-btn { flex-direction: row !important; justify-content: flex-start !important; gap: 10px !important; padding: 0 12px; border-radius: 12px; min-height: 48px; }
  body.in-app .tab-btn > span:last-child { font-size: 16px !important; font-weight: 600 !important; }
  body.in-app .tab-btn.active { background: var(--accent-soft); }
  body.in-app .tab-btn.active .tab-icon-pill { background: transparent !important; }
  body.in-app .tab-btn:hover { background: var(--sunken); }
  body.in-app #toastWrap { left: 248px; }
}
/* Round 2: Schedule rows + From/To at narrow widths (Oki #12) */
.c-sched-row { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 2px 12px; align-items: baseline; }
.c-ftime { display: flex; gap: 12px; }
.c-ftime input { width: 100%; min-width: 0; }
@media (max-width: 359px) { .c-ftime { flex-direction: column; gap: 8px; } }
/* Round 2 (Oki #8): Today column ordering + 2 columns on desktop (plan left; energy, sleep debt, trend right) */
.c-cols { display: flex; flex-direction: column; gap: 12px; }
.c-col-a, .c-col-b { display: contents; }
.c-col-a > *, .c-col-b > * { min-width: 0; }
.c-o0 { order: 0 } .c-o1 { order: 1 } .c-o2 { order: 2 } .c-o3 { order: 3 } .c-o4 { order: 6 } .c-o5 { order: 3 } .c-o6 { order: 8 } .c-o7 { order: 9 } .c-o8 { order: 10 } .c-o9 { order: 11 } .c-desk { order: 8 }
.c-desk { display: none; }
.c-o1:empty, .c-o7:empty, .c-o8:empty, .c-o9:empty, .c-o2:empty { display: none; }
.c-status.neutral { background: var(--sunken); color: var(--text-2); }
@media (min-width: 1024px) {
  body.in-app[data-tab="today"] #view { max-width: 1080px; }
  .c-cols { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 24px; align-items: start; }
  .c-col-a, .c-col-b { display: flex; flex-direction: column; gap: 12px; }
  .c-desk { display: block; }
}
/* Round 2 (U23): chat bubbles on tokens; offline note sits on its own line inside the reply */
.c-bub { max-width: 88%; padding: 10px 14px; font-size: 15px; line-height: 22px; border-radius: 18px; overflow-wrap: anywhere; }
.c-bub-ai { background: var(--card); color: var(--text-1); border: 1px solid var(--hairline); border-top-left-radius: 6px; }
.c-bub-me { background: var(--accent); color: var(--on-accent); border-top-right-radius: 6px; }
.c-bub-ai b { color: var(--text-1); }
.c-bub .c-offline { display: block; margin-top: 10px; }
.c-typing { display: inline-flex; gap: 4px; align-items: center; height: 42px; }
.c-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); animation: cTyping 1s infinite ease-in-out; }
.c-typing i:nth-child(2) { animation-delay: .15s } .c-typing i:nth-child(3) { animation-delay: .3s }
@keyframes cTyping { 0%, 80%, 100% { opacity: .3; transform: translateY(0) } 40% { opacity: 1; transform: translateY(-3px) } }
#askChips, #obChips { display: flex; flex-wrap: wrap; gap: 8px; }


/* Round 2 (U10): motion rules. Press = 120ms scale, sheets/toasts = transform+opacity only; done/skip feedback */
.c-check[aria-pressed="true"] { animation: cPop 220ms cubic-bezier(.2,.8,.2,1); }
@keyframes cPop { 0% { transform: scale(.85) } 60% { transform: scale(1.08) } 100% { transform: scale(1) } }
.c-plan-row.is-done .c-plan-t { text-decoration: line-through; text-decoration-color: var(--text-3); color: var(--text-2); }
.c-plan-row.is-skipped { opacity: .72; }
.btn:active, .c-chip:active, .c-iconbtn:active { transform: scale(.97); transition: transform var(--dur-press, 120ms) ease-out; }
@media (prefers-reduced-motion: reduce) { .c-typing i, .c-check[aria-pressed="true"] { animation: none !important; } .btn:active, .c-chip:active { transform: none; } }
.c-send { width: 48px; height: 48px; flex: none; border-radius: 9999px; background: var(--accent); color: var(--on-accent); display: inline-flex; align-items: center; justify-content: center; border: 0; }
.c-send:active { transform: scale(.95); }
/* Round 2 (U7): one chevron for every disclosure instead of the native triangle */
details > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; cursor: pointer; color: var(--text-1); }
details > summary::-webkit-details-marker { display: none; }
details > summary::after { content: ""; width: 10px; height: 10px; flex: none; border-right: 2px solid var(--text-3); border-bottom: 2px solid var(--text-3); transform: rotate(45deg) translateY(-3px); transition: transform 200ms ease; }
details[open] > summary::after { transform: rotate(-135deg) translateY(-3px); }
details > summary a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; margin-left: auto; font-size: 13px; }
button.c-status::before { content: ""; position: absolute; inset: -6px 0; }
/* Round 3: hero actions never wrap mid-label (Oki C) */
.c-hero-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.btn-sm, .c-hero-acts .btn { white-space: nowrap; }
.c-hero .btn-hghost { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.75); }
.c-inline-ic { display: inline-flex; align-items: center; gap: 6px; } .c-inline-ic svg { color: var(--accent); flex: none; }
/* Round 3: Week strip */
.c-wk { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.c-wk-day { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.c-wk-bar { width: 100%; max-width: 32px; height: 64px; background: var(--sunken); border-radius: 8px; position: relative; overflow: hidden; }
.c-wk-bar i { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 8px; background: var(--accent); }
.c-wk-bar i.short { background: var(--warn, #b45309); }
.c-wk-ic { height: 14px; display: flex; gap: 3px; align-items: center; color: var(--accent); }
.c-wk-w { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--text-2); }
.c-wk-lbl { font-size: 12px; line-height: 16px; color: var(--text-2); font-weight: 600; }
.c-wk-day.is-today .c-wk-lbl { color: var(--accent-text, var(--accent)); text-decoration: underline; text-underline-offset: 3px; }
/* Round 3 (Oki C/E): no layout shift when a sheet locks scroll; visible sleep band; dark toast; styled checkbox */
html { scrollbar-gutter: stable; }
:root { --ribbon-sleep: #3F4C8A; }
body.dark-mode, body.dusk-mode { --ribbon-sleep: #8B97E8; }
body.dark-mode #toast, body.dusk-mode #toast { background: #2F3F3B; color: var(--text-1); border: 1px solid var(--border-strong); box-shadow: 0 8px 24px rgba(0,0,0,.45); }
body.dark-mode #toast .t-act, body.dusk-mode #toast .t-act { color: var(--accent); }
#askInput, #obInput, .c-chatrow input { min-width: 0; }
#askSheet .c-send, .c-send { flex: none; }
#askSheet label[for], #askSheet label:has(#askProfileTgl) { min-height: 44px; }
#askProfileTgl, .c-check { appearance: none; -webkit-appearance: none; width: 20px; height: 20px; flex: none; border: 2px solid var(--border-strong); border-radius: 6px; background: var(--card); display: inline-grid; place-content: center; cursor: pointer; margin: 0; }
#askProfileTgl::after, .c-check::after { content: ""; width: 10px; height: 6px; border: solid var(--on-accent, #fff); border-width: 0 0 2px 2px; transform: rotate(-45deg) translate(1px, -1px); opacity: 0; }
#askProfileTgl:checked, .c-check:checked { background: var(--accent); border-color: var(--accent); }
#askProfileTgl:checked::after, .c-check:checked::after { opacity: 1; }
#askProfileTgl:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
#askSheet label { color: var(--text-2) !important; font-size: 13px !important; }
/* Web package: from 768px up, sheets are centered dialogs (Settings
   included), and the static sign-in / consent sheets center the same way
   via .dlg-anchor. On desktop the You view puts Connections and Account
   side by side, and You / Week / Schedule get the wide measure. */
@media (min-width: 768px) {
  .c-sheet { align-items: center; padding: 24px; }
  .c-panel { max-width: 560px; max-height: min(86vh, 880px); border-radius: var(--radius-xl); border-bottom: 1px solid var(--hairline) !important; animation: cPop var(--dur-sheet-in) var(--ease-out); }
  .c-panel::before { display: none; }
  .c-head { padding-top: 16px; }
  .c-foot { border-radius: 0 0 var(--radius-xl) var(--radius-xl); padding-bottom: 20px; }
  .c-sheet.c-full .c-panel { height: min(86vh, 880px); }
  .dlg-anchor { top: 0 !important; align-items: center; padding: 24px; }
}
@media (min-width: 1024px) {
  body.in-app[data-tab="you"] #view, body.in-app[data-tab="week"] #view, body.in-app[data-tab="schedule"] #view { max-width: 1080px; }
  .you-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: start; }
  .you-grid > div { margin-bottom: 0 !important; }
}
/* Round 3 (Oki C): buttons that wrapped at 320/390 */
.btn { white-space: nowrap; }
.btn.btn-block, .c-panel .btn-block { white-space: normal; }
@media (max-width: 360px) { .btn-sm { padding-left: 12px; padding-right: 12px; font-size: 14px; } }
/* Round 3 (Oki E): desktop sheets are centred dialogs; Ask Cadence is a right-side panel */
@media (min-width: 1024px) {
  .c-sheet { align-items: center; padding: 24px; }
  .c-panel { max-width: 560px; max-height: min(86vh, 880px); border-radius: var(--radius-xl); border-bottom: 1px solid var(--hairline) !important; animation: cPop var(--dur-sheet-in) var(--ease-out); }
  .c-panel::before { display: none; }
  .c-head { padding-top: 16px; }
  .c-foot { border-radius: 0 0 var(--radius-xl) var(--radius-xl); padding-bottom: 20px; }
  .c-sheet.c-full .c-panel { height: min(86vh, 880px); }
  .c-sheet.c-closing .c-panel { animation: cFadeOut var(--dur-sheet-out) var(--ease-in) forwards; }
  #askSheet > div:last-child { top: 0; justify-content: flex-end; align-items: stretch; }
  #askSheet > div:last-child > div { max-width: 440px; max-height: none; height: 100%; border-radius: 0; border-left: 1px solid var(--hairline); }
  #toastWrap { bottom: 24px; }
}
#askChips button:disabled, #obChips button:disabled { opacity: .55; cursor: progress; }
/* Round 3 (Oki F): every selected chip is filled (duration, effort, workout type, symptoms) */
.c-chip[aria-pressed="true"], .c-chip[aria-checked="true"] { background: var(--accent) !important; border-color: var(--accent) !important; color: var(--on-accent, #fff) !important; }
.c-chip[aria-pressed="true"] svg, .c-chip[aria-checked="true"] svg { color: inherit; }
html:has(body.dark-mode) { background: #1A2422; }
html:has(body.dusk-mode) { background: #1A2422; }
.c-row-t.c-inline-ic { display: flex; }
/* Round 4 (#9): normal-night reference curve on short-sleep days */
.c-energy .e-base { fill: none; stroke: var(--text-3); stroke-width: 1.5; stroke-dasharray: 4 4; opacity: .8; }
.c-legend i.e-base-key { width: 14px; height: 0; border-radius: 0; border-top: 2px dashed var(--text-3); vertical-align: middle; }
.c-ask { background: var(--accent-soft); border: 1px solid var(--accent); border-radius: 12px; padding: 10px 12px; margin-top: 4px; }
/* Round 4 part 2: evening ritual, tomorrow preview, examples, small link */
.c-ritual { border-color: var(--accent); }
.c-tmrw { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; margin-top: 8px; }
.c-tmrw > div { background: var(--sunken); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; }
.c-tmrw b { font-size: 16px; line-height: 22px; }
.c-example { margin-top: 10px; padding: 10px; border: 1px dashed var(--border-strong); border-radius: 12px; }
.c-link { background: none; border: 0; padding: 0; min-height: 44px; color: var(--accent-text, var(--accent)); font-weight: 600; font-size: 15px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.c-input { border: 1px solid var(--border-strong); background: var(--card); color: var(--text-1); border-radius: 10px; padding: 8px 10px; min-height: 44px; font-size: 16px; }
@keyframes cFlash { 0% { box-shadow: 0 0 0 3px var(--accent); } 100% { box-shadow: 0 0 0 0 transparent; } } .c-flash { animation: cFlash 1.2s ease-out; }
/* Round 4 part 2 (#10): landing uses the same site nav as the static pages */
.l-nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.l-nav a { color: var(--text-2); font-weight: 500; font-size: 15px; padding: 10px 10px; min-height: 44px; display: inline-flex; align-items: center; white-space: nowrap; border-radius: 10px; text-decoration: none; }
.l-nav a:hover { color: var(--text-1); background: var(--sunken); }
.l-menu-btn { display: none; }
@media (max-width: 899px) {
  .l-nav { display: none; }
  .l-menu-btn { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 1px solid var(--border-strong); border-radius: 999px; background: transparent; color: var(--text-1); font-weight: 600; font-size: 15px; cursor: pointer; }
}
/* Round 4 part 2 (#10): tab switches never look blank; content is visible from the first frame. */
.fade-in { animation: cFadeIn .18s ease-out !important; }
@keyframes cFadeIn { from { opacity: .85; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .fade-in { animation: none !important; } }
.c-err { color: var(--danger-text, #B42318); font-size: 14px; line-height: 20px; margin: 4px 0 0; font-weight: 500; } html.dark .c-err, body.dark-mode .c-err { color: #FDA29B; }
.c-late-list { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 15px; line-height: 22px; color: var(--text-2); }
/* Round 5 (#8): the landing scroller never scrolls sideways (the email row was the culprit; this is a guard). */
#onboarding { overflow-x: hidden; }
/* Round 5 (#10): bottom-nav labels always render (fixed line box, never squeezed out of the 56px bar). */
nav[aria-label=Main] .tab-btn > span:last-child { display: block; line-height: 16px; font-size: 12px; white-space: nowrap; }
nav[aria-label=Main] .tab-btn { overflow: visible; }
/* Round 5 (#10): Chronotype + Goal sit side by side only when both fit; below 400px they stack, so selects never clip. */
.c-pe-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.c-pe-pair select { min-width: 0; width: 100%; text-overflow: ellipsis; }
@media (max-width: 399px) { .c-pe-pair { grid-template-columns: 1fr; gap: 16px; } }
/* Round 5 (#10): no nested scrollbar inside sheets on phones (touch scrolls fine; the page gutter already shows one).
   On desktop it's thin and themed. */
body.dark-mode, body.dusk-mode { color-scheme: dark; }
.c-body { scrollbar-width: thin; scrollbar-color: var(--hairline) transparent; }
@media (max-width: 899px) {
  .c-body { scrollbar-width: none; }
  .c-body::-webkit-scrollbar { display: none; width: 0; height: 0; }
}
/* Round 5: while a sheet/dialog is open, toasts appear at the top so they never cover its buttons. */
html.c-lock #toastWrap { top: calc(env(safe-area-inset-top) + 12px); bottom: auto; }
/* Round 6 (#1/#2): shift status lives on the Today card all day */
.c-hero .h-late { display: flex; align-items: center; gap: 14px; margin-top: 12px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.22); font-size: 14px; color: #fff; }
.c-hero .h-late span { flex: 1; }
.c-hero .h-late .c-link { color: #fff; font-size: 14px; min-height: 44px; }
.c-hero-acts { flex-wrap: wrap; }
/* Round 6 (#3): visible character limit */
.c-count { display: block; text-align: right; font-size: 13px; line-height: 18px; color: var(--text-3); margin-top: 4px; }
.c-count.is-max { color: var(--warn-text, #9A3412); font-weight: 600; }
body.dark-mode .c-count.is-max { color: #FDBA74; }
/* Round 6 (#10): one visible focus ring everywhere (keyboard only), including segmented controls and the theme control. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible { outline: 3px solid var(--focus) !important; outline-offset: 2px !important; box-shadow: none; }
.c-seg > button:focus-visible { outline-offset: -3px !important; z-index: 1; }
.c-hero :focus-visible { outline-color: #fff !important; }
.c-panel:focus-visible, .c-panel:focus { outline: none !important; }
/* Round 6 (#6): unselected segmented options read clearly in dark */
body.dark-mode .c-seg > button:not([aria-checked="true"]), body.dusk-mode .c-seg > button:not([aria-checked="true"]) { color: var(--text-1); }
/* Round 6 (#9): Sleep and Wind-down differ in hue AND pattern (wind-down is hatched); legend dots are 10px+. */
:root { --ribbon-dusk: #C98BD9; --ribbon-hatch: rgba(255,255,255,.35); }
body.dark-mode, body.dusk-mode { --ribbon-dusk: #E8A87C; --ribbon-hatch: rgba(0,0,0,.28); --ribbon-sleep: #7C8CF0; }
.c-legend i { width: 11px; height: 11px; vertical-align: -1px; }
.c-legend i.c-hatch { border-radius: 3px; background: repeating-linear-gradient(45deg, var(--ribbon-dusk) 0 3px, var(--ribbon-hatch) 3px 5px), var(--ribbon-dusk); }
/* Round 6 (#10): Tonight & tomorrow / Close the day tiles: a clean 2x2 grid (no orphan tile at 390). */
.c-tmrw { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.c-tmrw > div:last-child:nth-child(odd) { grid-column: span 2; }
.c-err-list { margin: 0 0 10px; padding-left: 18px; list-style: disc; font-size: 14px; line-height: 20px; color: var(--text-2); }
.c-err-list li { margin: 2px 0; overflow-wrap: anywhere; }
/* Round 6 (#6): "Tomorrow's alarm" stays on one line at 320 */
.c-ritual label.c-field > span { white-space: nowrap; }
.c-ritual label.c-field > input[type=time] { min-width: 0; width: auto; max-width: 9.5em; flex: 0 1 auto; }
/* Round 7 (#1): evening check-in marker (Week strip + History) */
.c-wk-ev { font-size: 12px; line-height: 14px; color: var(--text-2); }
.c-eve-mark { color: var(--text-2); }
/* Round 7 (#2): the minute tick re-renders quietly (no fade-in flash) */
body.c-tick .fade-in, body.c-tick .fade-in * { animation: none !important; }
/* Round 7 (#4): overlap warning */
.c-warn { background: var(--warn-soft, #FFF7ED); color: var(--text-1); border: 1px solid var(--warn-border, #FDBA74); border-radius: 12px; padding: 10px 12px; font-size: 14px; line-height: 20px; }
body.dark-mode .c-warn, body.dusk-mode .c-warn { background: rgba(253,186,116,.12); border-color: rgba(253,186,116,.45); }
/* Round 7 (#5): the alarm time never clips; below 380px the label and the time field stack */
.c-ritual label.c-field > input[type=time] { min-width: 8.5em; }
@media (max-width: 379px) {
  .c-ritual label.c-field { flex-wrap: wrap; }
  .c-ritual label.c-field > input[type=time] { flex: 1 1 100%; width: 100%; max-width: none; }
}
/* Round 8 (#2): theme helper line (visible in light and dark) */
.c-theme-help { margin: 6px 0 0; font-size: 13px; line-height: 18px; color: var(--text-2) !important; display: block !important; }
/* Round 8 (#5): reserved, scrollable preview area in the Running late sheet (no layout shift while tapping) */
.c-late-prev { height: 248px; overflow-y: auto; overscroll-behavior: contain; }
.c-late-prev > .c-card { margin-top: 12px; }
@media (max-height: 700px) { .c-late-prev { height: 200px; } }

/* Prompt 05/09: tab header + tomorrow-night line (classes used in JS) */
.c-tabhead { position: sticky; top: 0; z-index: 10; background: var(--page); }
.c-tmrw-night { margin: 8px 0 0; }

/* Package 9 (7): check-in time inputs get the field style + iOS fixes */
input[type="time"].c-time { display: block; min-width: 0; -webkit-appearance: none; appearance: none; width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 14px; background: var(--card); color: var(--text-1); font: inherit; font-size: 15px; }
input[type="time"].c-time::-webkit-date-and-time-value { text-align: left; }

/* Package 9 (7): the setup form submit fade uses the page color (dark-safe). */
.ob-submit-bar { background: linear-gradient(to top, var(--page) 55%, transparent); }

/* Package 9 retest (3): chat suggestion chips are full-height targets. */
.ob-chip { min-height: 44px; display: inline-flex; align-items: center; }
