/* Jarvis: a calm instrument panel. Graphite surfaces, one ice-blue accent, warm amber only for "now / running".
   Every colour lives in this one block as light-dark(LIGHT, DARK), so a palette swap is one edit; the theme is picked by color-scheme.
   Floating chrome (header, tab bar, composer, sheets, toasts) uses an iOS 26 style "Liquid Glass" material over the scrolling page. */
:root {
  color-scheme: light dark;
  --bg: light-dark(#efe9df, #121110); --bg-raise: light-dark(#f6f1e8, #181614);
  --surface: light-dark(#fffdf8, #1d1a17); --surface-2: light-dark(#f7f2ea, #23201c); --sunken: light-dark(#e7e0d4, #0f0e0c);
  --hair: light-dark(rgba(60, 40, 20, .1), rgba(255, 240, 220, .09)); --hair-2: light-dark(rgba(60, 40, 20, .24), rgba(255, 240, 220, .2));
  --text: light-dark(#1d1a17, #efe7da); --text-2: light-dark(#554d44, #c9beaf); --text-3: light-dark(#6e6459, #a69a8b);
  --accent: light-dark(#b53624, #e2654f); --accent-strong: light-dark(#8f2a1c, #f6a594);
  --accent-wash: light-dark(rgba(181, 54, 36, .08), rgba(226, 101, 79, .14)); --accent-line: light-dark(rgba(181, 54, 36, .36), rgba(226, 101, 79, .42));
  --on-accent: light-dark(#fff8ef, #161210);
  --warm: light-dark(#b53624, #e2654f); --warm-wash: light-dark(rgba(181, 54, 36, .1), rgba(226, 101, 79, .16));
  --ink: light-dark(rgba(29, 26, 23, .82), rgba(239, 231, 218, .82));
  --idle: light-dark(#94897d, #7d7366); --good: light-dark(#5e554b, #c2b7a8); --bad: light-dark(#8e1f2a, #f08a8a);
  --track: light-dark(rgba(60, 40, 20, .13), rgba(255, 240, 220, .11));
  --plan: light-dark(rgba(60, 40, 20, .34), rgba(255, 240, 220, .4));
  --edge-hi: light-dark(rgba(255, 255, 255, 0), rgba(255, 255, 255, .035));
  --shadow-1: light-dark(rgba(60, 40, 20, .06), rgba(0, 0, 0, .2)); --shadow-2: light-dark(rgba(60, 40, 20, .08), rgba(0, 0, 0, .26));
  --shadow: 0 1px 0 var(--edge-hi) inset, 0 1px 2px var(--shadow-1), 0 10px 26px var(--shadow-2);
  /* glass material */
  --glass: light-dark(rgba(255, 252, 247, .38), rgba(44, 40, 36, .34));
  --glass-strong: light-dark(rgba(255, 252, 247, .62), rgba(38, 34, 30, .6));
  --glass-solid: light-dark(#f8f3ea, #211e1a);
  --glass-edge: light-dark(rgba(60, 40, 20, .1), rgba(255, 240, 220, .1));
  --glass-hi: light-dark(rgba(255, 255, 255, .9), rgba(255, 255, 255, .32));
  --glass-pill: light-dark(rgba(60, 40, 20, .07), rgba(255, 240, 220, .11));
  --glass-drop: light-dark(rgba(60, 40, 20, .16), rgba(0, 0, 0, .5));
  --hud-hi: light-dark(rgba(255, 255, 255, .9), rgba(255, 255, 255, .06));
  --scrim: light-dark(rgba(40, 28, 16, .22), rgba(0, 0, 0, .45));
  --glass-fx: blur(16px) saturate(2) brightness(1.04);
  --glass-shadow: inset 0 1.5px 1px -.5px var(--glass-hi), inset 0 -1px 1px rgba(0, 0, 0, .05), inset 0 0 0 .5px var(--glass-edge), 0 0 0 .5px var(--glass-edge), 0 10px 30px var(--glass-drop);
  /* metrics */
  --radius: 16px; --radius-sm: 10px;
  --gutter: 22px; --maxw: 720px;
  --tabh: 62px; --tabs-b: max(16px, calc(env(safe-area-inset-bottom, 0px) - 6px)); --dockh: 52px; --barw: min(560px, calc(100% - 2 * var(--gutter)));
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Helvetica Neue", sans-serif;
}
:root[data-theme="dark"] { color-scheme: dark; }
:root[data-theme="light"] { color-scheme: light; }

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
html { height: 100%; overflow: hidden; }
body { height: 100%; overflow-x: hidden; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-y: none; -webkit-tap-highlight-color: transparent; font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
.mono { font-family: var(--sans); font-variant-numeric: tabular-nums; }
.muted { color: var(--text-2); }
.small { font-size: 13px; }
.pk { letter-spacing: -.5em; }
code { font-family: var(--mono); font-size: .86em; background: var(--sunken); padding: 1px 6px; border-radius: 6px; }
h1, h2, h3 { margin: 0; }
h2 { font-size: 15px; font-weight: 600; color: var(--text); letter-spacing: .01em; }

/* mark */
.reactor { position: relative; width: 20px; height: 20px; flex: none; }
.reactor i { position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid var(--accent); }
.reactor i:nth-child(2) { inset: 4px; border-color: var(--accent-line); border-style: dashed; animation: spin 14s linear infinite; }
.reactor i:nth-child(3) { inset: 7.5px; background: var(--accent); border: 0; }
.reactor.big { width: 96px; height: 96px; margin: 0 auto 28px; }
.reactor.big i:nth-child(2) { inset: 14px; }
.reactor.big i:nth-child(3) { inset: 34px; box-shadow: 0 0 28px var(--accent-line); }
@keyframes spin { to { transform: rotate(360deg); } }

/* controls */
.btn { appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px;
  border: 1px solid var(--hair-2); background: var(--surface-2); color: var(--text); border-radius: var(--radius-sm);
  padding: 0 16px; font: inherit; font-size: 14px; font-weight: 550; line-height: 1; cursor: pointer; white-space: nowrap;
  transition: transform .08s, background .15s, border-color .15s; }
.btn:hover { border-color: var(--accent-line); }
.btn:active { transform: scale(.97); }
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn.primary { background: color-mix(in srgb, var(--accent) 34%, transparent); border-color: transparent; color: var(--accent-strong); }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 28%, transparent); }
.btn.ghost { background: var(--track); border-color: transparent; color: var(--text); }
.btn.amber { color: var(--warm); border-color: transparent; background: color-mix(in srgb, var(--warm) 16%, transparent); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 42%, transparent); background: transparent; }
.btn.ghost.danger { border-color: transparent; background: var(--track); }
.btn.ghost.danger:hover { border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.btn.small { height: 32px; padding: 0 14px; font-size: 13px; border-radius: 16px; }
.btn.icon { width: 32px; padding: 0; }
.btn.wide { width: 100%; height: 46px; font-size: 15px; border-radius: 14px; }
input, textarea, select { width: 100%; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--hair-2);
  border-radius: var(--radius-sm); padding: 11px 13px; outline: none; transition: border-color .15s, box-shadow .15s; }
input:focus, textarea:focus, select:focus { border-color: var(--accent-line); box-shadow: 0 0 0 4px var(--accent-wash); }
input::placeholder, textarea::placeholder { color: var(--text-3); }
input[type="checkbox"] { accent-color: var(--accent); }
.row-gap { display: flex; gap: 8px; flex-wrap: wrap; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: calc(32px + env(safe-area-inset-top, 0px)) var(--gutter) calc(32px + env(safe-area-inset-bottom, 0px)); }
.login-core { width: min(360px, 100%); text-align: center; }
.login-core h1 { font: 600 17px var(--sans); letter-spacing: .4em; color: var(--text); margin-bottom: 6px; }
.enroll { margin-top: 30px; text-align: left; }
.enroll summary { color: var(--text-2); cursor: pointer; text-align: center; }
.enroll input, .enroll .btn { margin-top: 10px; }

/* shell */
.app { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter) calc(var(--tabs-b) + var(--tabh) + 12px + var(--dockh) + 22px); }
.app:has(#dock[hidden]) { padding-bottom: calc(var(--tabs-b) + var(--tabh) + 22px); }
.top { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center;
  margin: 0 calc(50% - 50vw) 6px; padding: calc(14px + env(safe-area-inset-top, 0px)) calc(50vw - 50%) 14px;
  background: var(--glass); box-shadow: inset 0 -.5px 0 var(--glass-edge); -webkit-backdrop-filter: var(--glass-fx); backdrop-filter: var(--glass-fx); }
.brand { display: flex; align-items: center; gap: 11px; font: 650 13px var(--sans); letter-spacing: .2em; color: var(--text); }
.seal { display: inline-grid; place-items: center; flex: none; background: var(--accent); color: var(--on-accent); border-radius: 3px;
  font: 800 13px/1 "Futura", "Futura-CondensedExtraBold", var(--sans); font-stretch: condensed; letter-spacing: .04em;
  padding: 5px 6px 4px; transform: rotate(-3.5deg); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06); }
.seal.big { font-size: 34px; line-height: .95; padding: 14px 16px 12px; border-radius: 6px; margin: 0 auto 26px; text-align: center; }
.top-right { display: flex; align-items: center; gap: 9px; color: var(--text-2); font-size: 13px; font-weight: 500; }
.top-right .mono { font-size: 13px; }
.live { width: 6px; height: 6px; border-radius: 50%; background: var(--idle); }
.live.on { background: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 14%, transparent); }
.page { animation: fade .22s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.card { background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }

/* today */
.nb { white-space: nowrap; }
.broadcast { margin: 16px 0 20px; font-size: 16px; line-height: 1.65; color: var(--text-2); }
.broadcast b { color: var(--text); font-weight: 600; }
.hud { background: var(--surface); border: 1px solid var(--hair); border-radius: 20px; padding: 20px 18px 18px;
  box-shadow: inset 0 1px 0 var(--hud-hi), var(--shadow); }
.dial-wrap { position: relative; width: min(312px, 100%); margin: 0 auto; aspect-ratio: 1; }
#dial { width: 100%; height: 100%; display: block; overflow: visible; }
.dial-center { position: absolute; inset: 29% 25%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; pointer-events: none; }
.clock { font: 300 32px/1.1 var(--sans); font-variant-numeric: tabular-nums; color: var(--text); letter-spacing: .01em; }
.clock .sec { font-size: .5em; font-weight: 400; color: var(--text-3); margin-left: 2px; letter-spacing: 0; }
.center-task { margin-top: 8px; font-size: 13px; line-height: 1.4; color: var(--text-2); max-height: 2.8em; overflow: hidden; }
.center-sub { font-size: 12px; color: var(--warm); margin-top: 3px; }
.center-sub.idle { color: var(--text-3); }
.dial-legend { display: flex; justify-content: center; gap: 18px; margin-top: -22px; font-size: 12px; color: var(--text-2); }
.dial-legend span { display: inline-flex; align-items: center; gap: 7px; }
.dial-legend i { display: inline-block; width: 14px; border-radius: 3px; }
.dial-legend .lg-plan { height: 4px; background: var(--plan); }
.dial-legend .lg-act { height: 8px; background: var(--ink); }
.dial-legend .lg-now { width: 9px; height: 9px; border-radius: 50%; background: var(--warm); box-shadow: 0 0 0 3px var(--warm-wash); }
.arc-run { animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .6; } }
.counters { display: grid; grid-template-columns: repeat(5, 1fr); margin: 16px 0 0; border-top: 1px solid var(--hair); padding-top: 14px; }
.chip { text-align: center; font-size: 12px; color: var(--text-2); letter-spacing: .04em; }
.chip b { display: block; font: 600 20px/1.2 var(--sans); font-variant-numeric: tabular-nums; color: var(--text); letter-spacing: 0; margin-bottom: 2px; }
.chip.run b { color: var(--warm); }
.agenda { margin-top: 28px; }
#btn-add { color: var(--text); background: transparent; box-shadow: inset 0 0 0 1px var(--hair-2); }
.list-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 10px; flex-wrap: wrap; min-height: 32px; }

/* timeline: rail, dots, time labels and the first title line all share one centre line (row pad 7 + card border 1 + card pad 14 + half of 22) */
.rows { --tcol: 84px; --rail: 104px; --cy: 33px; list-style: none; margin: 0; padding: 0; position: relative; }
.rows > li { --rl: linear-gradient(var(--hair-2), var(--hair-2)); background: var(--rl) no-repeat var(--rail) 0 / 1px 100%; }
.rows > li:first-child { background-position: var(--rail) var(--cy); background-size: 1px calc(100% - var(--cy)); }
.rows > li:last-child { background-size: 1px var(--cy); }
.rows > li:only-child { background: none; }
.rows > .now-line { --cy: 13px; position: relative; height: 26px; }
.row { position: relative; display: grid; grid-template-columns: var(--tcol) 1fr; gap: calc(2 * (var(--rail) - var(--tcol))); padding: 7px 0; }
.row .t { font: 500 12px/18px var(--sans); font-variant-numeric: tabular-nums; color: var(--text-3); text-align: right; padding-top: 17px; white-space: nowrap; }
.row.running .t, .row .t .now-t { color: var(--warm); }
.row .dot { position: absolute; left: calc(var(--rail) - 4px); top: calc(var(--cy) - 4.5px); width: 9px; height: 9px; border-radius: 50%;
  border: 1.5px solid var(--text-3); background: var(--bg); }
.row.done .dot { background: var(--ink); border-color: var(--ink); }
.row.running .dot { background: var(--warm); border-color: var(--warm); box-shadow: 0 0 0 4px var(--warm-wash); }
.row.paused .dot { border-color: var(--idle); background: var(--sunken); }
.row.overdue .dot { border-color: var(--warm); }
.row .card { padding: 14px 16px; }
.row .name { font-size: 15px; line-height: 22px; font-weight: 550; overflow-wrap: anywhere; }
.row.done .name { color: var(--text-2); font-weight: 500; }
.row .notes { font-size: 13px; line-height: 1.5; color: var(--text-2); margin-top: 3px; overflow-wrap: anywhere; }
.row.running .card { border-color: color-mix(in srgb, var(--warm) 40%, transparent); background: linear-gradient(var(--warm-wash), var(--warm-wash)), var(--surface); }
.card .meta { font: 12.5px/20px var(--sans); font-variant-numeric: tabular-nums; color: var(--text-3); margin-top: 8px; display: flex; gap: 6px 12px; flex-wrap: wrap; align-items: center; }
.flag { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 11px; font: 600 11.5px/1 var(--sans); letter-spacing: .02em;
  color: var(--text-2); background: var(--sunken); }
.flag.ok { color: var(--good); background: color-mix(in srgb, var(--good) 15%, transparent); }
.flag.grace, .flag.due { color: var(--warm); background: color-mix(in srgb, var(--warm) 15%, transparent); }
.flag.late { color: var(--bad); background: color-mix(in srgb, var(--bad) 15%, transparent); }
.card .acts { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

.now-line::after { content: ""; position: absolute; left: var(--rail); right: 0; top: 12.25px; height: 1.5px;
  background: linear-gradient(90deg, var(--warm) 55%, color-mix(in srgb, var(--warm) 0%, transparent)); }
.now-line::before { content: ""; position: absolute; z-index: 1; left: calc(var(--rail) - 4px); top: 8.5px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--warm); box-shadow: 0 0 0 4px var(--warm-wash); }
.now-line span { position: absolute; left: 0; width: var(--tcol); text-align: right; top: 4px;
  font: 600 12px/18px var(--sans); font-variant-numeric: tabular-nums; color: var(--warm); white-space: nowrap; }
.day-notes { margin-top: 18px; display: grid; gap: 10px; }
.day-notes .card { font-size: 14px; color: var(--text-2); }
.day-notes b { color: var(--text); font-weight: 600; }
.empty { text-align: center; color: var(--text-3); padding: 28px 0; }

/* week */
.week-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 18px 0 16px; }
.week-head .btn { width: 34px; height: 34px; border-radius: 50%; background: var(--surface); border: 1px solid var(--hair-2); box-shadow: var(--shadow); color: var(--text); }
.week-head h2 { font-size: 14px; color: var(--text); font-weight: 600; letter-spacing: .02em; }
.week { display: grid; gap: 12px; }
.wday { cursor: pointer; transition: border-color .15s; }
.wday:hover { border-color: var(--accent-line); }
.wday.today { border-color: var(--accent-line); }
.wday .wh { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.wday .wh > b { font-size: 15px; font-weight: 600; }
.wday .wh > b em { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; margin-left: 8px; border-radius: 10px; vertical-align: 1px;
  font: normal 600 12px/1 var(--sans); color: var(--accent-strong); background: var(--accent-wash); }
.wday .cnt { font-size: 12.5px; color: var(--text-3); white-space: nowrap; }
.wday .cnt b { color: var(--text-2); font-weight: 600; }
.bar { position: relative; height: 6px; margin: 12px 0 0; border-radius: 3px; overflow: hidden; background: var(--track); }
.bar-ax { position: relative; height: 11px; margin: 5px 0 10px; font-size: 10.5px; line-height: 1; color: var(--text-3); }
.bar-ax span { position: absolute; top: 0; transform: translateX(-50%); }
.bar-ax span:first-child { transform: none; } .bar-ax span:last-child { transform: translateX(-100%); }
.bar i { position: absolute; top: 0; bottom: 0; border-radius: 3px; }
.wrows { font-size: 13.5px; line-height: 1.5; color: var(--text); display: grid; gap: 5px; }
.wrows > div { display: grid; grid-template-columns: 14px 38px 1fr; column-gap: 8px; align-items: baseline; }
.wrows > div > .tm { color: var(--text-3); min-width: 0; }
.wrows .g { width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid var(--text-2); align-self: start; justify-self: center; margin-top: 6.6px; }
.wrows .r-done { color: var(--text-2); } .wrows .r-done .g { background: color-mix(in srgb, var(--accent) 60%, transparent); border-color: transparent; }
.wrows .r-run { color: var(--warm); } .wrows .r-run .g { background: var(--warm); border-color: var(--warm); }
.wrows .r-paused .g { border-color: var(--idle); }
.wrows .more { color: var(--text-3); padding-left: 68px; }
.wday .sum { margin-top: 8px; font-size: 13px; color: var(--text-2); }

/* cycle */
.cyc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin: 12px 0 16px; }
.cyc-no { font: 650 28px/1.2 var(--sans); color: var(--text); letter-spacing: -.01em; }
.daydots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 14px; }
.daydots span { text-align: center; font: 500 13px var(--sans); font-variant-numeric: tabular-nums; padding: 9px 0; border: 1px solid var(--hair-2);
  border-radius: var(--radius-sm); color: var(--text-2); background: var(--surface); }
.daydots span.past { color: var(--text-3); background: transparent; }
.daydots span.today { border-color: var(--accent-line); color: var(--accent-strong); background: color-mix(in srgb, var(--accent) 16%, transparent); font-weight: 650; }
.cyc-note { margin: 0 0 16px; }
.goal { margin-bottom: 12px; }
.goal + .section-title { margin-top: 16px; }
.cyc-head .badge { margin-top: 3px; }
.goal h3 { font-size: 16px; font-weight: 600; }
.meter { height: 6px; background: var(--track); border-radius: 3px; overflow: hidden; margin: 12px 0 6px; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.mrow { display: grid; grid-template-columns: 84px 1fr 36px; align-items: center; gap: 12px; margin-top: 12px; font-size: 12.5px; color: var(--text-2); }
.mrow .meter { margin: 0; height: 8px; border-radius: 4px; background: color-mix(in srgb, var(--text-3) 32%, transparent); }
.mrow b { text-align: right; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.goal .gsum { margin-top: 10px; font-size: 13px; color: var(--text-2); }
.goal .gset { margin-top: 6px; font-size: 13px; }
.badge { display: inline-flex; align-items: center; height: 26px; font: 600 12.5px/1 var(--sans); padding: 0 11px; border-radius: 13px;
  background: color-mix(in srgb, currentColor 12%, transparent); border: 1px solid color-mix(in srgb, currentColor 28%, transparent); }
.badge.ok { color: var(--good); } .badge.used { color: var(--bad); }
.mk { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; vertical-align: .12em; background: var(--idle); }
.mk.pass { background: var(--good); } .mk.fail { background: var(--bad); }
.hist { display: grid; gap: 12px; }
.hist .card .wh { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.hist .card .wh b { font-size: 15px; font-weight: 600; white-space: nowrap; }
.hist .concl { margin-top: 6px; font-size: 13.5px; color: var(--text-2); }
.hist .goals { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--text-2); }
.fail-text { color: var(--bad) !important; }
.evlist { background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius); padding: 0 16px; box-shadow: var(--shadow); }
details.ev { border-bottom: 1px solid var(--hair); }
details.ev:last-child { border-bottom: 0; }
details.ev summary { list-style: none; position: relative; cursor: pointer; color: var(--text); font-size: 13.5px; line-height: 1.5; padding: 12px 22px 12px 0; }
details.ev summary::-webkit-details-marker { display: none; }
details.ev summary::after { content: ""; position: absolute; right: 4px; top: 50%; width: 7px; height: 7px; margin-top: -5px;
  border-right: 1.5px solid var(--text-2); border-bottom: 1.5px solid var(--text-2); transform: rotate(45deg); transition: transform .15s; }
details.ev[open] summary::after { transform: rotate(-135deg); margin-top: -1px; }
details.ev summary .sub { color: var(--text-3); }
details.ev div { font-size: 13px; line-height: 1.6; color: var(--text-2); padding: 0 0 12px; }
.section-title { margin: 28px 0 10px; font-size: 16px; font-weight: 650; }

/* memory */
.panel { background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius); padding: 0 16px; margin-bottom: 8px; box-shadow: var(--shadow); }
.add-pref summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: 14px; list-style: none; display: flex; align-items: center; gap: 8px; height: 48px; }
.add-pref summary::-webkit-details-marker { display: none; }
.add-pref summary::after { content: ""; margin-left: auto; width: 7px; height: 7px; border-right: 1.5px solid var(--text-2); border-bottom: 1.5px solid var(--text-2);
  transform: rotate(45deg) translateY(-2px); transition: transform .15s; }
.add-pref[open] summary::after { transform: rotate(-135deg) translateY(-2px); }
.add-pref[open] { padding-bottom: 16px; }
.add-pref > * + * { margin-top: 10px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips label { font-size: 12.5px; border: 1px solid var(--hair-2); border-radius: 999px; padding: 4px 12px; cursor: pointer; color: var(--text-2); }
.chips input { display: none; }
.chips label:has(input:checked) { background: var(--accent-wash); border-color: var(--accent-line); color: var(--accent-strong); }
.toggle { display: flex; gap: 7px; align-items: center; color: var(--text-2); cursor: pointer; min-height: 32px; }
.toggle input { width: 16px; height: 16px; margin: 0; }
.mem-cat { margin: 18px 0 10px; font-size: 12.5px; font-weight: 600; color: var(--text-3); letter-spacing: .06em; }
.pref .pid { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; margin-right: 4px; border-radius: 10px; vertical-align: 1px;
  background: var(--accent-wash); color: var(--accent-strong); font: 650 11.5px/1 var(--sans); font-variant-numeric: tabular-nums; }
.pref .rule { font-size: 15px; line-height: 1.6; overflow-wrap: anywhere; }
.pref.off { opacity: .55; }
.pref .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font: 12.5px/22px var(--sans); font-variant-numeric: tabular-nums; color: var(--text-2); margin-top: 8px; }
.pref .meta .pid { margin-right: 0; }
.pref .meta .tag { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 10px; background: var(--track); color: var(--text-2); font-size: 12px; }
.pref .acts { display: flex; gap: 8px; margin-top: 10px; }

/* chat */
.chat { display: flex; flex-direction: column; gap: 12px; padding-top: 10px; }
.msg { max-width: 86%; padding: 10px 14px; border-radius: 16px; font-size: 15px; line-height: 1.6; overflow-wrap: anywhere; }
.msg.user { align-self: flex-end; background: color-mix(in srgb, var(--accent) 28%, var(--surface)); border: 1px solid var(--accent-line); color: var(--text); border-bottom-right-radius: 8px; }
.msg.jarvis { align-self: flex-start; max-width: 94%; background: var(--surface); border: 1px solid var(--hair); border-bottom-left-radius: 8px; box-shadow: var(--shadow); }
.msg .ts { display: block; font: 500 11.5px var(--sans); font-variant-numeric: tabular-nums; color: var(--text-3); margin-top: 6px; }
.msg.user .ts { text-align: right; color: var(--text-2); }
.msg p { margin: 0 0 8px; } .msg p:last-child { margin: 0; }
.msg code { background: color-mix(in srgb, var(--text) 9%, transparent); color: var(--text); overflow-wrap: anywhere; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.msg pre { overflow-x: auto; background: var(--sunken); padding: 10px 12px; border-radius: 10px; font-size: 12.5px; margin: 8px 0; }
.msg pre code { background: none; padding: 0; }
.msg table { border-collapse: collapse; font-size: 13px; display: block; overflow-x: auto; margin: 8px 0; }
.msg td, .msg th { border: 1px solid var(--hair-2); padding: 4px 8px; }
.msg ul, .msg ol { margin: 6px 0 8px; padding-left: 20px; }
.msg li + li { margin-top: 2px; }
.msg a { color: var(--accent); }
.typing { display: inline-flex; gap: 5px; margin-top: 12px; padding: 14px 16px; border-radius: 16px; border-bottom-left-radius: 8px;
  background: var(--surface); border: 1px solid var(--hair-2); }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); animation: breathe 1s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }

/* floating glass chrome: composer capsule above a capsule tab bar, sheets and toasts */
.dock { position: fixed; z-index: 6; left: 50%; transform: translateX(-50%); width: var(--barw);
  bottom: calc(var(--tabs-b) + var(--tabh) + 12px); margin: 0; }
.composer { display: flex; align-items: center; height: var(--dockh); border-radius: calc(var(--dockh) / 2);
  background: var(--glass); box-shadow: var(--glass-shadow); -webkit-backdrop-filter: var(--glass-fx); backdrop-filter: var(--glass-fx); }
.composer:focus-within { box-shadow: var(--glass-shadow), 0 0 0 3px var(--accent-wash); }
.composer input { border: 0; background: transparent; box-shadow: none !important; padding: 0 12px 0 18px; height: 100%; min-width: 0; text-overflow: ellipsis; }
.composer .send { flex: none; width: 40px; height: 40px; margin-right: 6px; padding: 0; border: 0; border-radius: 50%; background: var(--accent); display: grid; place-items: center; cursor: pointer; }
.composer .send svg { width: 18px; height: 18px; fill: none; stroke: var(--on-accent); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.tabs { position: fixed; z-index: 7; left: 50%; transform: translateX(-50%); bottom: var(--tabs-b); width: var(--barw); height: var(--tabh);
  display: grid; grid-template-columns: repeat(5, 1fr); padding: 0 5px; border-radius: calc(var(--tabh) / 2);
  background: var(--glass); box-shadow: var(--glass-shadow); -webkit-backdrop-filter: var(--glass-fx); backdrop-filter: var(--glass-fx); }
.tabs button { position: relative; appearance: none; border: 0; background: none; color: var(--text-2); font: 500 10.5px/1 var(--sans);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; height: 100%; padding: 0; cursor: pointer; }
.tabs button svg { position: relative; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tabs button span { position: relative; }
.tabs button::before { content: ""; position: absolute; inset: 7px 4px; border-radius: calc(var(--tabh) / 2 - 7px); }
.tabs button.on { color: var(--text); font-weight: 600; }
.tabs button.on::before { background: var(--glass-pill); box-shadow: inset 0 1px 0 var(--glass-hi), inset 0 0 0 .5px var(--glass-edge); }
.tabs button.on svg { stroke-width: 1.9; }
.tabs em { position: absolute; top: 9px; left: calc(50% + 10px); width: 7px; height: 7px; border-radius: 50%; background: var(--warm); }
.sheet { position: fixed; inset: 0; z-index: 20; background: var(--scrim); display: flex; align-items: flex-end; justify-content: center;
  padding: 0 8px max(8px, env(safe-area-inset-bottom, 0px)); }
.sheet-body { width: min(560px, 100%); max-height: calc(100% - 24px - env(safe-area-inset-top, 0px)); overflow: auto; border-radius: 28px; padding: 24px 20px 20px;
  background: var(--glass-strong); box-shadow: var(--glass-shadow); -webkit-backdrop-filter: var(--glass-fx); backdrop-filter: var(--glass-fx); animation: up .2s ease; }
.sheet-body h3 { font-size: 17px; font-weight: 600; line-height: 1.4; }
.sheet-body > * + * { margin-top: 12px; }
.sheet-body .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sheet-body .two .btn { height: auto; min-height: 44px; }
.sheet-body .btn.wide { border-radius: 14px; }
@keyframes up { from { transform: translateY(24px); opacity: 0; } }
.toast { position: fixed; left: 50%; top: calc(12px + env(safe-area-inset-top, 0px)); transform: translateX(-50%); z-index: 30;
  width: max-content; max-width: min(520px, calc(100% - 24px)); border-radius: 20px; padding: 11px 18px; font-size: 14px; color: var(--text);
  background: var(--glass-strong); box-shadow: var(--glass-shadow); -webkit-backdrop-filter: var(--glass-fx); backdrop-filter: var(--glass-fx); animation: fade .2s ease; }
.toast.err { color: var(--bad); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .top, .composer, .tabs, .sheet-body, .toast { background: var(--glass-solid); }
}

@media (max-width: 420px) {
  :root { --gutter: 18px; }
  .rows { --tcol: 74px; --rail: 88px; }
  .row .t { font-size: 11.5px; }
  .now-line span { font-size: 11.5px; }
}
@media (min-width: 960px) {
  :root { --maxw: 1120px; --gutter: 40px; }
  #page-today:not([hidden]) { display: grid; grid-template-columns: 360px 1fr; gap: 0 44px; align-items: start; }
  #page-today .broadcast { grid-column: 1 / -1; }
  #page-today .hud { position: sticky; top: 80px; margin-top: 49px; }
  #page-today .agenda { margin-top: 0; }
  .week { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); align-items: start; }
  .chat { max-width: 760px; margin: 0 auto; }
}

/* Liquid Glass sheen: a light-catching gradient over the glass surfaces (on top of the blur, below the content) */
.tabs, .composer { isolation: isolate; }
.composer { position: relative; }
.tabs::after, .composer::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: -1;
  background: linear-gradient(180deg, rgba(255, 255, 255, .28), rgba(255, 255, 255, .04) 42%, rgba(255, 255, 255, 0) 60%, rgba(255, 255, 255, .08));
  mix-blend-mode: soft-light; }
