
/* Layout: FileHubb/ProjectHubb desk shell. Top bar, section sidebar, workspace, shared Ollama panel, phone gets a bottom tab bar. Layout reacts to the .app container so the phone preview frame works on desktop. */
:root {
  --bg: #f4f6f9; --surface: #ffffff; --surface2: #eef1f5; --line: #dde3ea; --line2: #cfd7e1;
  --text: #111827; --text2: #374151; --muted: #5b6675;
  --accent: #0b8a60; --accent-ink: #ffffff; --accent-soft: rgba(11,138,96,.10);
  --warn: #a35f00; --danger: #c62828;
  --shadow: 0 10px 30px rgba(17,24,39,.14); --scrim: rgba(15,20,30,.45);
  --c-today: #0b8a60; --c-proj: #7b3fc4; --c-budget: #a35f00; --c-meds: #2f5fd0; --c-server: #0a7a99; --c-notes: #b0307e; --c-home: #5b4fc4; --c-soccer: #b8325a; --c-journal: #4b5768; --c-shop: #2f7d32; --c-habit: #c2410c;
  --g1: #9d4edd; --g2: #2ec4b6;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, Consolas, monospace;
  --frame: #c9d1db;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1117; --surface: #151b24; --surface2: #1b2330; --line: #263040; --line2: #2f3a4c;
    --text: #e6edf3; --text2: #c9d1db; --muted: #8b97a6;
    --accent: #5ee3b0; --accent-ink: #0d1117; --accent-soft: rgba(94,227,176,.09);
    --warn: #f5b866; --danger: #ff8a80;
    --shadow: 0 12px 30px rgba(0,0,0,.5); --scrim: rgba(0,0,0,.6);
    --c-today: #5ee3b0; --c-proj: #c39bff; --c-budget: #f5b866; --c-meds: #7aa2ff; --c-server: #6fd6f2; --c-notes: #ff8fd2; --c-home: #a9a1ff; --c-soccer: #ff9fb6; --c-journal: #a9b4c4; --c-shop: #8fdc8a; --c-habit: #ffa070;
    --frame: #2a3443;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1117; --surface: #151b24; --surface2: #1b2330; --line: #263040; --line2: #2f3a4c;
  --text: #e6edf3; --text2: #c9d1db; --muted: #8b97a6;
  --accent: #5ee3b0; --accent-ink: #0d1117; --accent-soft: rgba(94,227,176,.09);
  --warn: #f5b866; --danger: #ff8a80;
  --shadow: 0 12px 30px rgba(0,0,0,.5); --scrim: rgba(0,0,0,.6);
  --c-today: #5ee3b0; --c-proj: #c39bff; --c-budget: #f5b866; --c-meds: #7aa2ff; --c-server: #6fd6f2; --c-notes: #ff8fd2; --c-home: #a9a1ff; --c-soccer: #ff9fb6; --c-journal: #a9b4c4; --c-shop: #8fdc8a; --c-habit: #ffa070;
  --frame: #2a3443;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 13.5px/1.45 var(--sans); overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
svg.lucide { width: 18px; height: 18px; flex-shrink: 0; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }

.app { container-type: inline-size; container-name: app; height: 100%; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; background: var(--bg); position: relative; }
.top { display: flex; align-items: center; gap: 8px; padding-block: 8px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 9px; border: 0; background: none; padding: 0; color: var(--text); }
.brand svg { width: 28px; height: 28px; }
.wordmark { font-size: 17px; letter-spacing: -.4px; }
.wordmark span { font-weight: 800; background: linear-gradient(90deg, var(--g1), var(--g2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.add { flex: 1; min-width: 0; max-width: 520px; margin-left: 18px; display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 6px 0 11px; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; color: var(--muted); }
.add input { width: 100%; border: 0; background: none; outline: none; flex: 1; min-width: 0; color: var(--text); }
.add button { border: 0; height: 26px; padding: 0 10px; border-radius: 7px; background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: 12px; }
.spacer { flex: 1; }
.tbtn { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; border-radius: 9px; border: 1px solid transparent; background: none; color: var(--text); white-space: nowrap; }
.tbtn:hover { background: var(--surface2); }
.tbtn.on { background: var(--accent-soft); color: var(--accent); }
.tbtn.ghost { border-color: var(--line); background: var(--surface); }
.ibtn { width: 34px; height: 34px; display: grid; place-items: center; border: 0; background: none; border-radius: 9px; color: var(--text); }
.ibtn:hover { background: var(--surface2); }

.body { display: grid; grid-template-columns: 228px minmax(0, 1fr) auto; min-height: 0; }
.side { border-right: 1px solid var(--line); overflow-y: auto; padding: 10px 10px 14px; display: flex; flex-direction: column; gap: 2px; }
.slabel { padding: 14px 8px 6px; font-size: 11.5px; font-weight: 650; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.nav { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; border: 0; background: none; width: 100%; text-align: left; color: var(--text); }
.nav:hover { background: var(--surface2); }
.nav.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav .ct { margin-left: auto; font-size: 11px; font-family: var(--mono); color: var(--muted); }
.nav .warn { margin-left: auto; font-size: 11px; font-weight: 700; padding: 0 7px; border-radius: 10px; color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.chip-ic { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; flex-shrink: 0; color: var(--cc); background: color-mix(in srgb, var(--cc) 15%, transparent); }
.chip-ic svg.lucide { width: 15px; height: 15px; }
.side-foot { margin-top: auto; padding: 16px 8px 0; font-size: 11.5px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }

.main { overflow-y: auto; min-width: 0; padding-block: 22px 40px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.wrap { max-width: 1180px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
.mock-note { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); border: 1px dashed var(--line2); border-radius: 9px; padding: 7px 11px; }
.mock-note svg.lucide { width: 15px; height: 15px; }
h1 { font-size: 24px; font-weight: 700; letter-spacing: -.4px; margin: 0; text-wrap: balance; }
h2 { font-size: 12px; font-weight: 650; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin: 0; display: flex; align-items: center; gap: 8px; }
h2 .link { margin-left: auto; text-transform: none; letter-spacing: 0; font-weight: 500; border: 0; background: none; color: var(--accent); padding: 0; font-size: 12.5px; }
.head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.src { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; color: var(--cc); padding: 1px 8px; border-radius: 10px; background: color-mix(in srgb, var(--cc) 12%, transparent); white-space: nowrap; }
.src svg.lucide { width: 12px; height: 12px; }

/* Today hero */
.hero { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 22px; align-items: center; }
.date { display: flex; align-items: baseline; gap: 10px; line-height: 1; }
.date b { font-size: 64px; font-weight: 800; letter-spacing: -2.5px; font-variant-numeric: tabular-nums; }
.date span { font-size: 22px; font-weight: 700; color: var(--muted); letter-spacing: 1px; }
.brief { font-size: 14.5px; color: var(--text2); max-width: 62ch; }
.brief .ai { display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 650; letter-spacing: .8px; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }
.brief .ai svg.lucide { width: 13px; height: 13px; }
.wx { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.wx .t { display: flex; align-items: center; gap: 8px; font-size: 30px; font-weight: 700; }
.wx .t svg.lucide { width: 30px; height: 30px; color: var(--warn); }
.radio { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px; border-radius: 15px; border: 1px solid var(--line2); background: none; font-size: 12.5px; }
.radio.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.radio svg.lucide { width: 14px; height: 14px; }

.today-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

/* agenda */
.agenda { display: flex; flex-direction: column; }
.ev { display: grid; grid-template-columns: 62px 3px minmax(0, 1fr); gap: 10px; padding: 7px 0; align-items: start; }
.ev .tm { font-family: var(--mono); font-size: 12px; color: var(--muted); padding-top: 1px; }
.ev .bar { align-self: stretch; border-radius: 2px; background: var(--cc); }
.ev b { display: block; font-weight: 600; }
.ev small { color: var(--muted); }
.ev.now .tm { color: var(--accent); font-weight: 700; }
.nowline { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 700; color: var(--accent); margin: 2px 0; }
.nowline::after { content: ""; flex: 1; height: 1px; background: var(--accent); }

/* tasks */
.task { display: flex; align-items: flex-start; gap: 10px; padding: 6px 0; }
.task + .task { border-top: 1px solid var(--line); }
.cb { width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--line2); background: none; display: grid; place-items: center; padding: 0; flex-shrink: 0; margin-top: 1px; color: var(--accent-ink); }
.cb svg.lucide { width: 13px; height: 13px; stroke-width: 3; }
.cb.on { background: var(--accent); border-color: var(--accent); }
.task .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.task.done .tx > span { text-decoration: line-through; color: var(--muted); }
.task .meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 11.5px; color: var(--muted); }

/* meters */
.meter { height: 8px; border-radius: 4px; background: var(--surface2); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 4px; background: var(--cc, var(--accent)); }
.meter.over i { background: var(--danger); }
.bigrow { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.bigrow b { font-size: 26px; font-weight: 750; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.kv { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; }
.kv span:first-child { color: var(--muted); }

/* doses */
.dose { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--surface2); }
.dose .dt { flex: 1; min-width: 0; }
.dose b { display: block; }
.dose small { color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 11px; border-radius: 14px; border: 1px solid var(--line2); background: var(--surface); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.pill.go { background: var(--c-meds); border-color: var(--c-meds); color: var(--accent-ink); }
.pill.ok { color: var(--accent); border-color: transparent; background: var(--accent-soft); }
.pill svg.lucide { width: 14px; height: 14px; }

/* server strip */
.adds { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.adds div { background: var(--surface2); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; }
.adds b { font-size: 18px; font-variant-numeric: tabular-nums; }
.adds span { font-size: 11.5px; color: var(--muted); }

/* projects */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.pcard { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; text-align: left; padding: 0; }
.pcard:hover { border-color: var(--line2); box-shadow: var(--shadow); }
.cover { height: 84px; position: relative; background: linear-gradient(135deg, color-mix(in srgb, var(--cc) 70%, #101622), #101622); }
.cover svg.lucide { position: absolute; right: 14px; bottom: 12px; width: 38px; height: 38px; color: #ffffffcc; }
.pcard .pb { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; }
.pcard .pb b { font-size: 15px; }
.pcard .sum { color: var(--text2); font-size: 12.5px; min-height: 36px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.fchip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 15px; border: 1px solid var(--line); background: var(--surface); color: var(--text2); }
.fchip.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.fchip svg.lucide { width: 14px; height: 14px; }

.board { display: grid; grid-template-columns: repeat(3, minmax(220px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.lane { background: var(--surface2); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 180px; }
.lane h3 { margin: 0 2px 2px; font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); display: flex; justify-content: space-between; }
.kcard { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; text-align: left; display: flex; flex-direction: column; gap: 4px; }
.kcard:hover { border-color: var(--accent); }
.kcard small { color: var(--muted); font-size: 11.5px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab { border: 0; background: none; padding: 8px 12px; border-bottom: 2px solid transparent; color: var(--muted); white-space: nowrap; }
.tab.on { color: var(--text); border-color: var(--accent); font-weight: 600; }

/* budget */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.stat b { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 12.5px; }
.env { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 6px 0; }
.env .nm { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.env .amt { font-variant-numeric: tabular-nums; font-size: 12.5px; text-align: right; }
.env .amt small { display: block; color: var(--muted); }
.tx-row { display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); align-items: center; }
.tx-row:first-of-type { border-top: 0; }
.tx-row .d { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.tx-row .a { font-variant-numeric: tabular-nums; font-weight: 600; }
.split { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 14px; align-items: start; }

/* notes */
.note { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.note p { margin: 0; color: var(--text2); }

/* Ollama panel */
.ai-panel { width: 320px; border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.ai-panel[hidden] { display: none !important; }
.ai-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); font-weight: 650; }
.ai-head svg.lucide { color: var(--accent); }
.ai-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.msg { padding: 9px 12px; border-radius: 12px; max-width: 92%; font-size: 13px; }
.msg.me { align-self: flex-end; background: var(--accent); color: var(--accent-ink); }
.msg.bot { align-self: flex-start; background: var(--surface2); }
.qa { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 10px; }
.qa button { border: 1px solid var(--line); background: var(--surface); border-radius: 14px; padding: 4px 10px; font-size: 12px; color: var(--text2); }
.ai-in { display: flex; gap: 6px; padding: 10px 14px 14px; border-top: 1px solid var(--line); }
.ai-in input { flex: 1; min-width: 0; height: 34px; border: 1px solid var(--line); background: var(--surface); border-radius: 9px; padding: 0 10px; }

.status { display: flex; align-items: center; gap: 14px; padding-block: 5px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); border-top: 1px solid var(--line); font-size: 11.5px; color: var(--muted); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); display: inline-block; margin-right: 5px; }
.bottom { display: none; }

/* sheet + toast */
.scrim { position: absolute; inset: 0; background: var(--scrim); display: grid; place-items: center; z-index: 20; padding: 16px; }
.sheet { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow); }
.sheet h3 { margin: 0; font-size: 17px; }
.field { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); }
.field input, .field select { height: 38px; border: 1px solid var(--line); background: var(--bg); border-radius: 9px; padding: 0 10px; color: var(--text); font-size: 14px; }
.btn { height: 36px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.toast { position: absolute; left: 50%; bottom: 60px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 9px 14px; border-radius: 10px; font-size: 13px; z-index: 30; max-width: calc(100% - 32px); box-shadow: var(--shadow); }

/* new sections */
.mini-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.lights { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.light { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); text-align: left; }
.light .lt { display: flex; align-items: center; gap: 8px; width: 100%; }
.light small { color: var(--muted); }
.light.on { border-color: var(--c-home); background: color-mix(in srgb, var(--c-home) 10%, var(--surface)); }
.light.on .bulb { color: var(--sw, var(--c-home)); }
.bulb { color: var(--muted); }
.sw { margin-left: auto; width: 34px; height: 20px; border-radius: 10px; background: var(--line2); position: relative; flex-shrink: 0; }
.sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); transition: left .15s; }
.on .sw { background: var(--c-home); }
.on .sw::after { left: 16px; }
.qbtns { display: flex; gap: 8px; flex-wrap: wrap; }
.scene { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 16px; border: 1px solid var(--line2); background: var(--surface); font-size: 12.5px; }
.scene svg.lucide { width: 15px; height: 15px; color: var(--c-home); }
.game { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.game:first-of-type { border-top: 0; }
.gday { text-align: center; border-radius: 10px; padding: 6px 0; background: color-mix(in srgb, var(--c-soccer) 12%, transparent); color: var(--c-soccer); line-height: 1.1; }
.gday b { display: block; font-size: 20px; }
.gday small { font-size: 10.5px; font-weight: 700; letter-spacing: .8px; }
.game .g small { color: var(--muted); display: block; }
.tag { font-size: 11px; font-weight: 650; padding: 1px 8px; border-radius: 10px; background: var(--surface2); color: var(--text2); white-space: nowrap; }
.tag.home { background: color-mix(in srgb, var(--c-soccer) 14%, transparent); color: var(--c-soccer); }
.jline { display: flex; gap: 8px; }
.jline input { flex: 1; min-width: 0; height: 38px; border: 1px solid var(--line); background: var(--bg); border-radius: 9px; padding: 0 11px; }
.jentry { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.jentry:first-of-type { border-top: 0; }
.jentry .d { font-family: var(--mono); font-size: 11.5px; color: var(--muted); padding-top: 2px; }
.recap { background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.recap ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; color: var(--text2); }
.aisle { font-size: 11px; font-weight: 650; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin-top: 6px; }
.meals { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.meal { border-radius: 10px; background: var(--surface2); padding: 8px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.meal small { font-size: 10.5px; font-weight: 700; letter-spacing: .8px; color: var(--muted); }
.meal span { font-size: 12.5px; }
.meal.today { outline: 2px solid var(--c-shop); }
.habit { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); }
.habit:first-of-type { border-top: 0; }
.habit .hn small { display: block; color: var(--muted); font-size: 11.5px; }
.dots { display: grid; grid-template-columns: repeat(14, 12px); gap: 4px; }
.dots i { width: 12px; height: 12px; border-radius: 3px; background: var(--surface2); }
.dots i.y { background: var(--c-habit); }
.streak { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--c-habit); white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.streak svg.lucide { width: 15px; height: 15px; }
.hcheck { width: 30px; height: 30px; border-radius: 9px; border: 2px solid var(--line2); background: none; display: grid; place-items: center; color: var(--accent-ink); padding: 0; }
.hcheck.on { background: var(--c-habit); border-color: var(--c-habit); }
.ring-row { display: flex; gap: 6px; }
.ring-row i { flex: 1; height: 6px; border-radius: 3px; background: var(--surface2); }
.ring-row i.y { background: var(--c-habit); }
.more-group { display: flex; flex-direction: column; gap: 8px; }
.more-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.more-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); text-align: left; }

.ntf { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.ntf:first-of-type { border-top: 0; }
.ntf small { display: block; color: var(--muted); font-size: 12px; }
.ntf input[type=time] { height: 32px; border: 1px solid var(--line); background: var(--bg); border-radius: 8px; padding: 0 8px; }
.tog { border: 0; background: none; padding: 0; }
.tog.on .sw { background: var(--accent); }
.tog .sw { display: block; margin: 0; }
.lock { border-radius: 22px; background: linear-gradient(160deg, #1d2440, #0d1117); padding: 18px 14px; display: flex; flex-direction: column; gap: 10px; color: #e6edf3; }
.lock .clock { text-align: center; font-size: 44px; font-weight: 300; letter-spacing: -1px; }
.push { background: rgba(255,255,255,.12); border-radius: 16px; padding: 10px 12px; display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; font-size: 12.5px; }
.push .pi { width: 26px; height: 26px; border-radius: 7px; background: linear-gradient(135deg, #9d4edd, #2ec4b6); }
.push b { display: flex; justify-content: space-between; font-size: 12.5px; }
.push b span { font-weight: 400; opacity: .7; }
.push .acts { display: flex; gap: 6px; margin-top: 6px; }
.push .acts span { background: rgba(255,255,255,.14); border-radius: 10px; padding: 3px 10px; font-size: 11.5px; }

/* ---------- starter screen (always dark, from Eric's reference) ---------- */
.starter { --st-bg: #111214; --st-ink: #16171a; --st-white: #f5f5f2; --st-dim: #8d9099; --st-teal: #2a9d9a;
  --sky: #cfe6ee; --sun: #f9c240; --lav: #e2def0; --mist: #eceef1; --mint: #c9ecd9; --peach: #f8cdb8; --night: #1d2233; --night2: #262c42;
  position: absolute; inset: 0; z-index: 25; background: var(--st-bg); color: var(--st-white); font-family: Poppins, var(--sans);
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto; transition: transform .45s cubic-bezier(.2,.8,.2,1), opacity .45s; color-scheme: dark; }
.starter.gone { transform: translateY(-100%); opacity: 0; pointer-events: none; }
.starter.overnight { --st-bg: #07080c; }
.st-head { display: flex; align-items: flex-start; gap: 14px; padding-block: 34px 6px; padding-left: max(28px, env(safe-area-inset-left, 0px)); padding-right: max(28px, env(safe-area-inset-right, 0px)); }
.st-head h1 { font-size: 46px; font-weight: 700; letter-spacing: -1px; line-height: 1.05; margin: 0; }
.st-head .when { color: var(--st-dim); font-size: 14px; margin-top: 6px; }
.st-chips { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.st-chip { height: 44px; min-width: 44px; padding: 0 14px; border-radius: 22px; display: inline-flex; align-items: center; gap: 7px; background: #24262b; color: var(--st-white); border: 0; font-weight: 600; font-size: 14px; }
.st-chip svg.lucide { width: 18px; height: 18px; }
.st-tabs { display: flex; gap: 26px; overflow-x: auto; padding-block: 14px 6px; padding-left: max(28px, env(safe-area-inset-left, 0px)); padding-right: max(28px, env(safe-area-inset-right, 0px)); scrollbar-width: none; }
.st-tab { border: 0; background: none; color: var(--st-dim); font-weight: 500; font-size: 14px; padding: 4px 0 8px; position: relative; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.st-tab.on { color: var(--st-white); font-weight: 700; }
.st-tab.on::after { content: ""; position: absolute; left: 0; bottom: 0; width: 22px; height: 3px; border-radius: 2px; background: var(--st-white); }
.st-tab .now { font-size: 9.5px; font-weight: 700; letter-spacing: .6px; color: var(--st-ink); background: var(--sun); border-radius: 6px; padding: 0 5px; }
.st-scroll { overflow-x: auto; overflow-y: hidden; display: flex; gap: 18px; padding-block: 18px 10px; padding-left: max(28px, env(safe-area-inset-left, 0px)); padding-right: max(28px, env(safe-area-inset-right, 0px)); scroll-snap-type: x mandatory; scrollbar-width: none; min-height: 0; }
.st-col { flex: 0 0 300px; display: flex; flex-direction: column; gap: 18px; scroll-snap-align: start; min-height: 0; }
.sc { border-radius: 26px; padding: 24px 24px 22px; color: var(--st-ink); display: flex; flex-direction: column; gap: 14px; position: relative; overflow: hidden; min-height: 0; flex: 1 1 auto; text-align: left; border: 0; font-family: inherit; }
.sc.tall { flex: 1 1 100%; }
.sc h3 { margin: 0; font-size: 26px; font-weight: 700; line-height: 1.12; letter-spacing: -.5px; text-wrap: balance; }
.sc p { margin: 0; font-size: 14px; line-height: 1.5; color: #2c2e33; }
.sc .k { font-size: 11.5px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: #4c4f57; display: flex; align-items: center; gap: 6px; }
.sc .k svg.lucide { width: 14px; height: 14px; }
.sc.dark { color: var(--st-white); }
.sc.dark p, .sc.dark .k { color: #b9bdca; }
.sc .big { font-size: 64px; font-weight: 700; letter-spacing: -3px; line-height: 1; }
.play { width: 56px; height: 56px; border-radius: 50%; background: var(--st-teal); color: #fff; display: grid; place-items: center; border: 0; flex-shrink: 0; }
.play svg.lucide { width: 22px; height: 22px; fill: currentColor; }
.dots-list { display: flex; flex-direction: column; gap: 12px; }
.dl { display: flex; align-items: center; gap: 12px; font-size: 14px; font-weight: 500; }
.dl .o { width: 46px; height: 46px; border-radius: 50%; background: #fff; display: grid; place-items: center; flex-shrink: 0; box-shadow: 0 4px 12px rgba(0,0,0,.08); color: var(--ic, #16171a); }
.dl .o svg.lucide { width: 20px; height: 20px; }
.dl small { display: block; color: #55585f; font-weight: 400; font-size: 12px; }
.dark .dl .o { background: var(--night2); color: #cfd6ff; box-shadow: none; }
.dark .dl small { color: #9aa0b4; }
.sbtn { align-self: flex-start; height: 40px; padding: 0 18px; border-radius: 20px; border: 0; background: var(--st-ink); color: #fff; font-family: inherit; font-weight: 600; font-size: 13.5px; display: inline-flex; align-items: center; gap: 7px; }
.sbtn.light { background: rgba(255,255,255,.7); color: var(--st-ink); }
.sbtn { line-height: 1; flex-shrink: 0; }
.sc.dark .sbtn.light { background: rgba(255,255,255,.14); color: var(--st-white); }
.sbtn.done { background: var(--st-teal); }
.sbtn svg.lucide { width: 16px; height: 16px; }
.sc .deco { position: absolute; right: -18px; bottom: -18px; width: 150px; height: 150px; opacity: .18; color: var(--st-ink); }
.sc.dark .deco { color: #fff; opacity: .08; }
.sc .row2 { display: flex; gap: 8px; flex-wrap: wrap; }
.st-foot { display: flex; flex-direction: column; align-items: center; gap: 4px; padding-block: 6px 16px; color: var(--st-dim); font-size: 12.5px; border: 0; background: none; font-family: inherit; }
.st-foot svg.lucide { width: 22px; height: 22px; animation: bob 1.8s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-5px); } }

/* ---------- container breakpoints ---------- */
@container app (max-width: 1240px) {
  .ai-panel { position: absolute; right: 0; top: 51px; bottom: 26px; background: var(--bg); z-index: 15; box-shadow: var(--shadow); }
  .today-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .today-grid .col:nth-child(3) { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mini-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container app (max-width: 860px) {
  .body { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .add { margin-left: 8px; }
  .top .spacer { display: none; }
  .date { flex-direction: column; align-items: flex-start; gap: 4px; }
  .date span { white-space: nowrap; }
  .hide-sm { display: none !important; }
  .status { display: none; }
  .bottom { display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid var(--line); background: var(--surface); padding-bottom: env(safe-area-inset-bottom, 0px); }
  .bottom button { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 7px; font-size: 10.5px; color: var(--muted); }
  .bottom button.on { color: var(--accent); font-weight: 650; }
  .ai-panel { top: 51px; bottom: 0; left: 0; width: auto; }
  .today-grid, .today-grid .col:nth-child(3), .split { grid-template-columns: minmax(0, 1fr); }
  .hero { grid-template-columns: minmax(0, 1fr) auto; gap: 14px; }
  .hero .brief { grid-column: 1 / -1; grid-row: 2; }
  .date b { font-size: 46px; }
  .date span { font-size: 17px; }
  .wx .t { font-size: 22px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mini-grid { grid-template-columns: minmax(0, 1fr); }
  .ntf { grid-template-columns: 30px minmax(0, 1fr) auto; }
  .ntf input[type=time], .ntf .nnote { grid-column: 2; grid-row: 2; justify-self: start; }
  .meals { grid-template-columns: repeat(7, 92px); overflow-x: auto; padding-bottom: 4px; }
  .habit { grid-template-columns: 30px minmax(0, 1fr) auto; }
  .habit .dots { grid-column: 2 / -1; grid-row: 2; }
  .adds { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .main { padding-block: 16px 30px; }
  .board { grid-template-columns: repeat(3, 78%); scroll-snap-type: x mandatory; }
  .lane { scroll-snap-align: start; }
}
@container app (max-width: 860px) {
  .st-head { padding-block: 22px 4px; padding-left: 20px; padding-right: 20px; }
  .st-head h1 { font-size: 34px; }
  .st-tabs, .st-scroll { padding-left: 20px; padding-right: 20px; }
  .st-tabs { gap: 20px; }
  .st-col { flex-basis: 78%; }
  .st-chips .st-chip span { display: none; }
  .st-chip { padding: 0; width: 44px; justify-content: center; }
}
@container app (max-width: 520px) {
  .wordmark { display: none; }
  .tbtn .lbl { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- real app additions ---------- */
#root { height: 100%; }
.body { grid-template-columns: 228px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
a.link, a.tbtn, a.pcard { text-decoration: none; color: inherit; }
a.link { margin-left: auto; text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--accent); font-size: 12.5px; }
a.pcard { display: flex; }
.link-btn { border: 0; background: none; padding: 0; color: var(--accent); font-weight: 600; }
.dot.bad { background: var(--danger); }
.notice p { margin: 0; }
.pill:disabled { opacity: .6; }
.login { height: 100%; display: grid; place-items: center; padding: 16px; background: var(--bg); }
.login-card { width: min(360px, 100%); display: flex; flex-direction: column; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 24px; }
.login-card .brand.big svg { width: 40px; height: 40px; }
.login-card .brand.big .wordmark { font-size: 24px; }
.login-card p { margin: 0; }
.login-card input { height: 42px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; background: var(--bg); font-size: 16px; }
.err { color: var(--danger); }
.sc .dl .o[data-task] { cursor: pointer; }
.sc .dl .o[data-task]:hover { color: var(--st-teal); }
.sc p:empty { display: none; }
.sc { overflow-y: auto; scrollbar-width: none; }
.st-chip { pointer-events: none; }
@container app (max-width: 860px) {
  .body { grid-template-columns: minmax(0, 1fr); }
  .top .ibtn#refreshBtn { display: none; }
}
