/* Workflow Hub: "Ocean". Soft Material: blue-tinted dark surfaces, one calm sky-blue accent, big rounded cards,
   a quiet sidebar and one centred column. Light mode keeps the same shapes on pale blue-white. */

:root {
  --frame: #0e1520;          /* page behind everything */
  --side: #111a26;           /* the sidebar */
  --panel: #0e1520;          /* main column background */
  --surface: #16212f;        /* cards */
  --surface-2: #1c2a3b;      /* buttons, inputs, rows */
  --surface-3: #243549;      /* hover */
  --pill: #21415c;           /* selected nav item, selected chip */
  --border: #1f2d3e;
  --border-strong: #2e4258;
  --text: #dde7f2;
  --muted: #8ea3b8;
  --faint: #62788f;
  --accent: #7fcfff;         /* sky blue: done, selected, the main action */
  --accent-hover: #9ddaff;
  --on-accent: #00344d;
  --accent-bg: rgba(127, 207, 255, 0.13);
  --success: #8fd9b4;
  --success-bg: rgba(143, 217, 180, 0.13);
  --warning: #f0c35c;
  --warning-bg: rgba(240, 195, 92, 0.13);
  --pro: #cdbdff;
  --pro-bg: rgba(205, 189, 255, 0.14);
  --info: #7fcfff;
  --info-bg: rgba(127, 207, 255, 0.13);
  --danger: #ffb4ab;
  --shadow-pop: rgba(0, 0, 0, 0.45) 0 12px 32px;
  --shadow-card: none;
  --r-card: 22px;
  --r-input: 14px;
  --font: "Google Sans", "Google Sans Text", "Segoe UI Variable Text", "Segoe UI", Roboto, system-ui, -apple-system, sans-serif;
  --font-display: "Google Sans Display", "Google Sans", "Segoe UI Variable Display", "Segoe UI", Roboto, system-ui, sans-serif;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --frame: #f3f7fb;
    --side: #eaf1f8;
    --panel: #f3f7fb;
    --surface: #ffffff;
    --surface-2: #e8eff6;
    --surface-3: #dce6f0;
    --pill: #cde5ff;
    --border: #dbe4ee;
    --border-strong: #b9c8d8;
    --text: #17222e;
    --muted: #4f6275;
    --faint: #7d8fa1;
    --accent: #00658f;
    --accent-hover: #005478;
    --on-accent: #ffffff;
    --accent-bg: #cde5ff;
    --success: #1f6b4f;
    --success-bg: #d4f1e3;
    --warning: #7a5900;
    --warning-bg: #ffefc6;
    --pro: #5b4a9f;
    --pro-bg: #e9e0ff;
    --info: #00658f;
    --info-bg: #cde5ff;
    --danger: #ba1a1a;
    --shadow-pop: rgba(16, 32, 48, 0.16) 0 16px 40px -8px;
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--panel);
  color: var(--text);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* ---------- shell: Material bottom bar on phones, a quiet sidebar + one column on the laptop ---------- */

.shell { min-height: 100%; }
main { --pad-top: 20px; --pad-x: 16px; max-width: 760px; margin: 0 auto; padding: var(--pad-top) var(--pad-x) calc(96px + env(safe-area-inset-bottom)); }

.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; justify-content: center; gap: 2px;
  background: var(--side);
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
}
.nav .brand, .nav .nav-foot { display: none; }
.nav-links { display: contents; }
.nav a {
  flex: 0 1 110px; display: flex; flex-direction: column; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 500; color: var(--muted); text-decoration: none;
  padding: 2px 4px; border-radius: 16px;
}
/* Material 3: the selected icon sits in a soft pill */
.nav a svg { width: 22px; height: 22px; box-sizing: content-box; padding: 4px 18px; border-radius: 16px; transition: background .2s; }
.nav a.active { color: var(--text); }
.nav a.active svg { color: var(--text); background: var(--pill); }
.nav-more {
  flex: 0 1 110px; display: flex; flex-direction: column; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 500; color: var(--muted); background: transparent; border: 0; padding: 2px 4px; border-radius: 16px;
}
.nav-more svg { width: 22px; height: 22px; box-sizing: content-box; padding: 4px 18px; border-radius: 16px; }
.nav-more.active, .nav-more[aria-expanded="true"] { color: var(--text); }
.nav-more.active svg, .nav-more[aria-expanded="true"] svg { background: var(--pill); }
.nav-break { display: none; }
.nav a { position: relative; }
.nav .badge {
  position: absolute; top: 0; left: calc(50% + 8px); min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px;
  background: var(--danger); color: #410002; font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
}
/* Phones: four sections + More in the bar; More opens a sheet with the rest. */
@media (max-width: 899px) {
  .nav a.more-item { display: none; }
  .nav.more-open { flex-wrap: wrap; gap: 8px 0; box-shadow: var(--shadow-pop); border-radius: 28px 28px 0 0; padding-top: 16px; }
  .nav.more-open a.more-item { display: flex; order: -1; }
  .nav.more-open > .nav-links > a, .nav.more-open .nav-more { flex: 0 0 20%; }
  .nav.more-open > .nav-links > a.more-item { flex-basis: 25%; }
  .nav.more-open > .nav-links > a:not(.more-item), .nav.more-open .nav-more { order: 1; }
  .nav.more-open .nav-break { display: block; flex-basis: 100%; height: 1px; order: 0; background: var(--border); margin: 4px 16px; }
  .nav-kbd { display: none; }
}

@media (min-width: 900px) {
  body { background: var(--frame); overflow: hidden; }
  .shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); height: 100vh; }
  .nav {
    position: static; flex-direction: column; justify-content: flex-start; gap: 2px;
    background: var(--side); border: 0; padding: 18px 12px; overflow-y: auto;
  }
  .nav .brand {
    display: flex; align-items: center; gap: 10px; padding: 4px 12px 18px;
    font-weight: 500; font-size: 16px; font-family: var(--font-display);
  }
  .nav .brand img { width: 28px; height: 28px; border-radius: 9px; }
  .nav-links { display: flex; flex-direction: column; gap: 2px; }
  .nav-more { display: none; }
  .nav .badge { position: static; margin-left: auto; }
  .nav a {
    flex: none; flex-direction: row; gap: 14px; height: 42px; padding: 0 16px;
    font-size: 14px; font-weight: 500; border-radius: 21px;
    transition: background .15s, color .15s;
  }
  .nav a svg { width: 20px; height: 20px; padding: 0; background: none !important; }
  .nav a:hover { background: var(--surface-2); color: var(--text); }
  .nav a.active { background: var(--pill); color: var(--text); }
  .nav a:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--accent); }
  .nav .nav-foot {
    display: flex; flex-direction: column; gap: 4px; margin-top: auto; padding: 12px 16px 4px;
    font-size: 12px; color: var(--faint);
  }
  main {
    --pad-top: 36px; --pad-x: clamp(24px, 4vw, 56px); --col: 820px;
    max-width: none; margin: 0;
    padding: var(--pad-top) max(var(--pad-x), calc((100% - var(--col)) / 2)) 56px;
    background: var(--panel); overflow-y: auto; height: 100vh;
  }
  main .live-pill { display: none; }  /* shown once, in the sidebar */
}

/* Everything placed directly on a page gets space above it, so cards never touch. */
main > * + * { margin-top: 16px; }
main > h2 { margin-top: 32px; }

/* ---------- type ---------- */

h1 { font-family: var(--font-display); font-size: 28px; font-weight: 500; letter-spacing: -0.3px; line-height: 1.2; margin: 0; text-wrap: balance; }
h2 { font-family: var(--font-display); font-size: 18px; font-weight: 500; margin: 28px 0 10px; }
.muted { color: var(--muted); font-size: 13px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
a { color: var(--accent); }

/* ---------- controls ---------- */

button, input, select, textarea { font: inherit; color: inherit; }
button {
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: 9999px;
  padding: 9px 18px;
  font-size: 14px; font-weight: 500;
  cursor: pointer;
  transition: background .15s, transform .1s, border-color .15s;
}
button:hover { background: var(--surface-3); }
button:active { transform: scale(0.97); }
button.primary { background: var(--accent); color: var(--on-accent); font-weight: 500; padding: 10px 22px; }
button.primary:hover { background: var(--accent-hover); }
button.danger { color: var(--danger); }
button.ghost { background: transparent; }
button.ghost:hover { background: var(--surface-2); }
button:disabled { opacity: .4; cursor: default; transform: none; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
input, select, textarea {
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: var(--r-input);
  padding: 10px 14px;
  min-width: 0;
  transition: border-color .15s, background .15s;
}
input:hover, select:hover, textarea:hover { border-color: var(--border-strong); }
input[type="search"] { border-radius: 9999px; padding-left: 18px; }
textarea { resize: vertical; width: 100%; line-height: 1.5; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
label > input, label > select { color: var(--text); font-size: 15px; width: 100%; }

.pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 500;
  padding: 4px 10px; border-radius: 9999px; white-space: nowrap;
}
.pill.streak { background: var(--warning-bg); color: var(--warning); }
.pill.rank { background: var(--pro-bg); color: var(--pro); }
.pill.pts { background: var(--surface-2); color: var(--muted); }
.pill.pts.got { background: var(--accent-bg); color: var(--accent); }

.card {
  background: var(--surface); border: 0; border-radius: var(--r-card); padding: 18px;
}

/* ---------- Today: a header with a ring, then one list of habits ---------- */

.today-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.today-head .sub { color: var(--muted); font-size: 14px; margin-top: 4px; }
.day-arrows { display: flex; gap: 4px; margin-top: 10px; }
.day-arrows button { padding: 4px 12px; font-size: 13px; background: transparent; color: var(--muted); }
.day-arrows button:hover { background: var(--surface-2); color: var(--text); }
.ring { --p: 0; flex: none; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--surface-2) 0); }
.ring > span { width: 52px; height: 52px; border-radius: 50%; background: var(--panel); display: grid; place-items: center;
  font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; }
.habit-list { background: var(--surface); border-radius: var(--r-card); padding: 6px; }
.h-row { display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 8px 12px; border-radius: 16px;
  width: 100%; text-align: left; background: transparent; font-weight: 400; font-size: 15px; transition: background .12s; }
button.h-row:hover { background: var(--surface-2); }
button.h-row:active { transform: none; }
.h-check { flex: none; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--faint); display: grid; place-items: center;
  transition: background .15s, border-color .15s; }
.h-row.done .h-check { background: var(--accent); border-color: var(--accent); }
.h-row.done .h-check::after { content: ""; width: 10px; height: 5px; border: 2px solid var(--on-accent); border-top: 0; border-right: 0; transform: translateY(-1px) rotate(-45deg); }
.h-row.done .h-name { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--faint); }
.h-ico { flex: none; width: 24px; text-align: center; font-size: 18px; }
.h-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.h-pts { flex: none; font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.h-row.done .h-pts, .h-row.set .h-pts { color: var(--accent); }
.h-side { flex: none; display: flex; align-items: center; gap: 6px; }
.h-side .chip { padding: 5px 12px; }
.h-stepper { display: flex; align-items: center; gap: 4px; }
.h-stepper button { width: 32px; height: 32px; padding: 0; border-radius: 50%; font-size: 16px; }
.h-stepper input { width: 64px; text-align: center; padding: 6px 4px; font-weight: 500; }
.h-unit { font-size: 12px; color: var(--muted); min-width: 34px; }
.h-text { width: 100%; margin: 4px 0 6px 38px; width: calc(100% - 38px); }
.h-wrap { display: flex; flex-wrap: wrap; align-items: center; }
@media (max-width: 600px) {
  .h-row.opts { flex-wrap: wrap; }
  .h-row.opts .h-side { width: 100%; padding-left: 38px; flex-wrap: wrap; }
}
.focus-quick { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.focus-quick b { font-family: var(--font-display); font-size: 34px; font-weight: 400; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.today-section { margin-top: 14px; }

/* Board */
.board { display: flex; flex-direction: column; gap: 14px; }
.board-num { font-family: var(--font-display); font-size: 36px; font-weight: 400; letter-spacing: -1px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.board-num small { font-size: 15px; color: var(--muted); letter-spacing: 0; margin-left: 4px; }
.week-bars { display: flex; align-items: flex-end; gap: 8px; height: 96px; margin-top: 12px; }
.week-bars > div { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.week-bars i { display: block; width: 100%; max-width: 34px; border-radius: 8px; background: var(--surface-3); min-height: 4px; }
.week-bars i.hit { background: var(--accent); }
.week-bars span { font-size: 11px; color: var(--muted); }
.week-bars .today span { color: var(--text); font-weight: 500; }
.week-dots { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin-top: 12px; }
.week-dots > div { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.week-dots i { width: 100%; max-width: 40px; aspect-ratio: 1; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center;
  font-style: normal; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.week-dots i.lvl1 { background: rgba(127, 207, 255, .25); color: var(--text); }
.week-dots i.lvl2 { background: rgba(127, 207, 255, .5); color: var(--text); }
.week-dots i.lvl3 { background: var(--accent); color: var(--on-accent); }
.board-split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 600px) { .board-split { grid-template-columns: 1fr; } }

/* A regular grid: every tile has the same width, and every row the same height. */

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); grid-auto-rows: 1fr; gap: 10px; }
@media (min-width: 900px) { .tiles { grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); } }

/* Snippets */
.snip { padding: 12px 14px; }
.snip-main { min-width: 0; color: inherit; }
.snip-title { font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.snip-folder { font-size: 11px; font-weight: 500; color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: 1px 8px; }
.snip-folder.blanks { color: var(--info); background: var(--info-bg); }
.snip-body {
  margin-top: 4px; color: var(--muted); font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.snip .row-actions { align-items: center; gap: 2px; opacity: 1; }
.snip .row-actions .icon-btn { opacity: .7; }
.snip-copy { margin-left: 4px; padding: 6px 14px; }
.snip-fill { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.snip-blank { flex-direction: row; align-items: center; gap: 10px; }
.snip-blank span { flex: none; width: 110px; text-align: left; overflow-wrap: anywhere; }
.snip-blank input { flex: 1; min-width: 0; width: auto; }
@media (max-width: 600px) {
  .snip .row { flex-wrap: wrap; }
  .snip .row-actions { width: 100%; justify-content: flex-end; }
  .nav a { font-size: 10px; padding: 6px 2px; }
}

/* Focus timer */
.focus-card { align-items: center; padding: 24px 16px; gap: 18px; }
.focus-ring-box { position: relative; width: min(260px, 70vw); aspect-ratio: 1; }
.focus-ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.focus-ring circle { fill: none; stroke-width: 10; }
.focus-ring .track { stroke: var(--surface-2); }
.focus-ring .fill { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset .25s linear; }
.focus-ring.break .fill { stroke: var(--info); }
.focus-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-align: center; padding: 0 30px; }
.focus-time { font-size: clamp(44px, 13vw, 60px); font-weight: 600; letter-spacing: -2px; font-variant-numeric: tabular-nums; line-height: 1.05; }
.focus-kind { font-size: 13px; font-weight: 500; color: var(--muted); }
.focus-kind.focus { color: var(--accent); }
.focus-kind.break { color: var(--info); }
.focus-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.focus-controls { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
button.big { padding: 12px 28px; font-size: 15px; }
.focus-next { border-color: var(--accent); flex-wrap: wrap; }
.focus-week { display: flex; align-items: flex-end; gap: 6px; height: 110px; }
.focus-day { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; min-width: 0; }
.focus-day .muted { font-size: 11px; }
.focus-day.today .muted { color: var(--text); font-weight: 700; }
.focus-day-min { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.focus-bar { width: 100%; max-width: 34px; border-radius: 6px 6px 3px 3px; background: var(--surface-3); }
.focus-day.today .focus-bar, .focus-bar.goal { background: var(--accent); }
.focus-recent { font-size: 14px; padding: 4px 0; border-top: 1px solid var(--border); }
.focus-recent > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.focus-recent .muted { flex: none; }
.focus-settings { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.nav a[data-tab="focus"] span { font-variant-numeric: tabular-nums; }

/* Reminders */
.remind-preview { min-height: 18px; }
.remind-ok { color: var(--accent); font-weight: 600; }
.remind-menu { margin-top: 8px; }
.inbox-remind { flex-basis: 100%; padding-left: 34px; }
.remind-menu input[type="datetime-local"] { color-scheme: dark light; }
.remind-row { align-items: center; }
.remind-row.late { background: var(--warning-bg); }
.remind-time { flex: none; width: 64px; display: flex; flex-direction: column; font-variant-numeric: tabular-nums; }
.remind-time .muted { font-size: 11px; }
.remind-row.late .remind-time b { color: var(--warning); }
.remind-actions { align-items: center; gap: 4px; opacity: 1; }
.remind-actions button:not(.icon-btn) { padding: 5px 12px; font-size: 13px; }
.section-title { font-size: 14px; font-weight: 500; color: var(--muted); margin: 20px 0 8px; }
@media (max-width: 600px) {
  .remind-row { flex-wrap: wrap; }
  .remind-row .remind-actions { width: 100%; justify-content: flex-end; }
}

/* Search */
.nav-kbd { margin-left: auto; font: 600 10px/1 var(--font); color: var(--faint); border: 1px solid var(--border-strong); border-radius: 5px; padding: 3px 5px; }
.search-row { width: 100%; text-align: left; border: 0; border-radius: 0; font-weight: 400; align-items: flex-start; }
.search-row.sel { background: var(--surface-3); box-shadow: inset 3px 0 0 var(--accent); }
.search-row:active { transform: none; }
.search-ico { flex: none; width: 22px; text-align: center; }
.search-title { display: block; font-weight: 600; overflow-wrap: anywhere; }
.search-excerpt { display: block; margin-top: 2px; overflow-wrap: anywhere; }
.search-date { flex: none; font-size: 12px; }
.search-results section .section-title { margin-top: 4px; }
mark { background: var(--accent-bg); color: inherit; border-radius: 3px; padding: 0 1px; }

/* Ask AI */
.ai-thread { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.ai-empty { padding: 24px 4px; }
.ai-msg { display: flex; }
.ai-msg.user { justify-content: flex-end; }
.ai-bubble { max-width: min(680px, 88%); padding: 10px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); line-height: 1.5; overflow-wrap: anywhere; }
.ai-msg.user .ai-bubble { background: var(--surface-3); border-color: transparent; white-space: pre-wrap; }
.ai-msg.error .ai-bubble { border-color: var(--danger); color: var(--danger); }
.ai-li { padding-left: 4px; }
.ai-p:empty { height: 6px; }
.ai-proposal { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--accent); background: var(--success-bg); }
.ai-proposal.done, .ai-proposal.skipped { border-color: var(--border); background: transparent; opacity: .75; }
.ai-proposal button { padding: 5px 14px; font-size: 13px; }
.ai-quick { margin-bottom: 10px; }
.ai-compose { display: flex; gap: 8px; align-items: flex-end; padding: 10px; }
.ai-compose textarea { flex: 1; }
.ai-typing { display: flex; gap: 5px; padding: 14px 16px; }
.ai-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: ai-dot 1s infinite ease-in-out; }
.ai-typing span:nth-child(2) { animation-delay: .15s; }
.ai-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes ai-dot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.ai-remembered { margin-top: 8px; font-size: 12px; color: var(--pro); }
.ai-model { margin-top: 6px; font-size: 11px; color: var(--faint); }
.jarvis-out { margin: 6px 0 0; padding: 8px 10px; background: var(--surface-2); border-radius: 8px; font: 12px/1.4 Consolas, 'Cascadia Mono', monospace; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 220px; overflow: auto; }
.ai-profile textarea { width: 100%; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 3px; }
.seg button { border: 0; background: transparent; color: var(--muted); padding: 5px 12px; font-size: 13px; border-radius: 999px; font-weight: 600; }
.seg button.on { background: var(--pill); color: var(--text); }
.icon-btn.on { color: var(--text); background: var(--surface-3); }
.button-link { color: var(--accent); font-weight: 600; text-decoration: none; }

/* Life RPG */
.rpg-pill { text-decoration: none; background: rgba(255, 216, 77, .14); color: #ffd84d; font-weight: 700; }
.rpg-hero { display: flex; gap: 16px; align-items: center; }
.rpg-level { flex: none; width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; align-content: center;
  background: radial-gradient(circle at 30% 30%, #ffe680, #c98a00); color: #2b1d00; box-shadow: 0 0 24px rgba(255, 216, 77, .35); }
.rpg-level span { font-size: 11px; font-weight: 600; letter-spacing: 1px; }
.rpg-level b { font-size: 30px; line-height: 1; }
.rpg-title { font-size: 20px; }
.rpg-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.rpg-stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); padding: 10px 12px; }
.rpg-bar { height: 6px; margin-bottom: 0; }
.rpg-quest { padding: 8px 0; border-top: 1px solid var(--border); }
.rpg-quest.done { opacity: .7; }
.rpg-boss { border-color: rgba(243, 114, 127, .45); }
.boss-hp { margin: 0; }
.boss-hp > div { background: linear-gradient(90deg, #f3727f, #ff3b4e); }
.rpg-badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.rpg-badge { display: flex; flex-direction: column; gap: 2px; padding: 10px; border-radius: 10px; background: var(--surface-2); font-size: 13px; }
.rpg-badge .muted { font-size: 11px; }
.rpg-badge-icon { font-size: 26px; }
.rpg-badge.locked { opacity: .45; filter: grayscale(1); }

/* Wrapped stories */
.story { position: relative; max-width: 420px; width: 100%; aspect-ratio: 9 / 15; margin: 0 auto; border-radius: 18px; overflow: hidden; }
.story-slide { position: absolute; inset: 0; padding: 70px 28px 40px; color: #fff; display: flex; flex-direction: column;
  justify-content: center; animation: story-in .45s ease; text-shadow: 0 1px 12px rgba(0, 0, 0, .25); }
@keyframes story-in { from { opacity: 0; transform: scale(1.04); } to { opacity: 1; transform: none; } }
.story-bars { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; gap: 4px; z-index: 2; }
.story-bar { flex: 1; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .35); overflow: hidden; }
.story-bar.seen { background: #fff; }
.story-bar.now::after { content: ''; display: block; height: 100%; background: #fff; animation: story-fill 6s linear forwards; }
@keyframes story-fill { from { width: 0; } to { width: 100%; } }
.story-tap { position: absolute; top: 0; bottom: 0; width: 40%; background: transparent; border: 0; z-index: 3; border-radius: 0; }
.story-tap:hover { background: transparent; }
.story-tap.left { left: 0; }
.story-tap.right { right: 0; width: 60%; }

/* Time capsules */
.capsule.sealed { border-style: dashed; }
.capsule.ready { border-color: #ffd84d; box-shadow: 0 0 18px rgba(255, 216, 77, .2); }
.capsule-message { white-space: pre-wrap; line-height: 1.6; font-size: 15px; padding: 6px 0; }

/* Modes */
.mode-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.mode-card { display: flex; flex-direction: column; gap: 10px; }
.mode-title { font-size: 17px; }
.mode-step { border: 1px solid var(--border); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 6px; }

/* Desk mode: the whole screen, no app frame */
html.desk-mode .nav, html.desk-mode #toast { display: none; }
html.desk-mode, html.desk-mode body { overflow: hidden; background: #0a1019; }
html.desk-mode main, html.desk-mode .shell { max-width: none; padding: 0; margin: 0; border-radius: 0; background: #000; height: 100vh; overflow: hidden; }
html.desk-mode .shell { display: block; }
.desk { min-height: 100vh; padding: clamp(20px, 5vw, 64px); color: #fff; cursor: pointer;
  background: radial-gradient(ellipse at 20% 0%, rgba(127, 207, 255, .14), transparent 55%), #0a1019; display: flex; flex-direction: column; gap: 28px; }
.desk-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.desk-time { font-size: clamp(64px, 14vw, 160px); font-weight: 600; letter-spacing: -4px; line-height: .9; font-variant-numeric: tabular-nums; }
.desk-date { font-size: clamp(16px, 2.4vw, 24px); color: #b3b3b3; margin-top: 8px; }
.desk-weather { display: flex; align-items: center; gap: 12px; }
.desk-weather b { display: block; font-size: 42px; font-weight: 600; }
.desk-weather-icon { font-size: 48px; }
.desk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.desk-card { background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .08); border-radius: 16px; padding: 16px 18px;
  display: flex; flex-direction: column; gap: 6px; }
.desk-label { font-size: 13px; font-weight: 500; color: var(--accent); }
.desk-line { display: flex; gap: 10px; align-items: baseline; font-size: 16px; }
.desk-line b { flex: none; font-variant-numeric: tabular-nums; }
.desk-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; align-self: center; }
.desk-focus, .desk-music { flex-direction: row; align-items: center; gap: 14px; }
.desk-focus b, .desk-music b { display: block; font-size: 18px; }
.desk-music img { width: 64px; height: 64px; border-radius: 8px; }
.desk-ring { width: 64px; height: 64px; transform: rotate(-90deg); flex: none; }
.desk-ring circle { fill: none; stroke-width: 7; }
.desk-ring .track { stroke: rgba(255, 255, 255, .1); }
.desk-ring .fill { stroke: var(--accent); stroke-linecap: round; }
.desk-hint { margin-top: auto; color: #555; font-size: 12px; text-align: center; }

/* Remote */
.remote-pad {
  height: min(52vh, 420px); border-radius: var(--r-card); background: var(--surface); border: 1px solid var(--border);
  display: grid; place-items: center; touch-action: none; user-select: none; -webkit-user-select: none;
}
.remote-pad:active { background: var(--surface-2); }
.remote-screen { width: 100%; border-radius: var(--r-card); border: 1px solid var(--border); background: #000; touch-action: manipulation; cursor: pointer; }
.remote-media-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.remote-clicks { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.remote-click { padding: 18px 0; border-radius: var(--r-card); touch-action: none; user-select: none; -webkit-user-select: none; }
.remote-click:active { background: var(--surface-3); }
.remote-media { font-size: 20px; padding: 10px 0; }

/* Automations */
.auto-field { flex-direction: column; }
.auto-field input, .auto-field select { width: 100%; }

/* Today: habits + calendar side by side on wide windows, calendar first on phones */
.today-grid { display: grid; gap: 14px; align-items: start; }
@media (min-width: 1200px) {
  .today-grid { grid-template-columns: minmax(0, 1fr) 340px; }
  .today-agenda { grid-column: 2; grid-row: 1; position: sticky; top: 12px; }
}
.agenda .row { justify-content: space-between; }
.agenda-row { display: flex; align-items: flex-start; gap: 10px; padding: 7px 0; border-top: 1px solid var(--border); }
.agenda > .row + .agenda-row { border-top: 0; }
.agenda-row.compact { padding: 3px 0; border-top: 0; font-size: 13px; }
.agenda-row.past { opacity: .45; }
.agenda-row.live .agenda-time { color: var(--accent); font-weight: 600; }
.agenda-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; margin-top: 6px; }
.agenda-time { flex: none; width: 92px; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; padding-top: 1px; }
.agenda-row.compact .agenda-time { width: 56px; }
.agenda-title { font-weight: 500; overflow-wrap: anywhere; }
.agenda-row.compact .agenda-title { font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile {
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: var(--r-card);
  padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
  text-align: left; font-weight: 400;
  min-height: 132px; height: 100%; min-width: 0;
  transition: background .15s, border-color .15s, transform .1s;
}
.tile > .pill.pts, .tile-foot { margin-top: auto; }  /* points always sit at the bottom */
.tile-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 22px; }
.tile.text-tile textarea { flex: 1; min-height: 52px; resize: none; font-size: 14px; padding: 6px 8px; }
button.tile { border-radius: var(--r-card); padding: 14px; }
button.tile:hover { background: var(--surface-2); }
.tile.on { background: var(--success-bg); border-color: transparent; color: var(--success); }
button.tile.on:hover { background: var(--success-bg); filter: brightness(1.15); }
.tile.set { background: var(--info-bg); border-color: transparent; color: var(--info); }
.tile-name { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; }
.tile-name .ico { font-size: 18px; }
.tile .pill.pts { align-self: flex-start; }
.tile.on .pill.pts { background: transparent; color: inherit; padding: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  padding: 6px 14px; font-size: 13px; font-weight: 500; border-radius: 9999px;
  background: var(--surface-2); border: 1px solid transparent;
}
.chip.sel { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper input { flex: 1; width: 0; min-width: 44px; text-align: center; font-weight: 700; padding: 7px 4px; }
.stepper button { flex: none; width: 34px; height: 34px; padding: 0; border-radius: 50%; }

/* ---------- lists (Notion-like rows) ---------- */

.list { display: flex; flex-direction: column; border-radius: var(--r-card); overflow: hidden; background: var(--surface); padding: 0; }
.list-row { display: flex; align-items: center; gap: 14px; padding: 13px 18px; border-radius: 0; background: transparent;
  transition: background .12s; min-height: 52px; }
button.list-row { width: 100%; text-align: left; font-weight: 400; border: 0; }
button.list-row:active { transform: none; }
.list-row:hover { background: var(--surface-2); }
.list-row + .list-row { border-top: 1px solid var(--border); }
.list-row.off { opacity: .5; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn { padding: 4px 8px; background: transparent; color: var(--muted); border-radius: 6px; font-weight: 500; }
.icon-btn:hover { color: var(--text); background: var(--surface-3); }
.row-link { background: transparent; border: 0; padding: 0; text-align: left; border-radius: 6px; font-weight: 400; }
.row-link:hover { background: transparent; }
.row-link:active { transform: none; }

/* ---------- editor ---------- */

.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { padding: 6px 14px; font-size: 13px; }
.seg button.sel { background: var(--accent); color: var(--on-accent); }
.rule { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; background: var(--surface-2); border-radius: 10px; padding: 10px; }
.rule input.num { width: 90px; }
.rule .arrow { color: var(--muted); }
.error { color: var(--danger); font-size: 13px; min-height: 1em; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.switch { display: flex; flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-size: 15px; }
.switch input { width: 18px; height: 18px; accent-color: var(--accent); }

/* ---------- stats ---------- */

.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.metric { background: var(--surface); border-radius: var(--r-card); padding: 16px 18px; }
.metric b { display: block; font-size: 28px; font-weight: 600; letter-spacing: -1px; }
.bars { display: flex; align-items: flex-end; gap: 5px; height: 160px; padding-top: 18px; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; min-width: 0; }
.bar > div { width: 100%; background: var(--accent); border-radius: 4px 4px 2px 2px; min-height: 2px; }
.bar > div.zero { background: var(--surface-2); }
.bar span { font-size: 11px; color: var(--muted); }
@media (min-width: 1200px) {
  .overview { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 0 24px; align-items: start; }
}

/* ---------- inbox ---------- */

.capture textarea { min-height: 64px; font-size: 16px; background: transparent; border: 0; padding: 4px 2px; }
.capture textarea:focus-visible { outline: none; }
.capture:focus-within { border-color: var(--border-strong); }
.inbox-row .kind-ico, .kind-ico { font-size: 18px; width: 22px; text-align: center; line-height: 1.4; }
.task-check { width: 20px; height: 20px; margin: 2px 1px 0; accent-color: var(--accent); flex: none; }
.item-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.inbox-row a { color: var(--info); overflow-wrap: anywhere; }
.inbox-row a.title { display: block; font-weight: 600; text-decoration: none; color: var(--text); }
.inbox-row a.title:hover { text-decoration: underline; }
.inbox-row.done .item-text { text-decoration: line-through; color: var(--muted); }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-actions { display: flex; flex: none; opacity: .7; transition: opacity .15s; }
.list-row:hover .row-actions { opacity: 1; }
.row-actions .icon-btn { padding: 4px 6px; }
.row-actions .pin { filter: grayscale(1); opacity: .35; }
.row-actions .pin.on { filter: none; opacity: 1; }
.row-actions .icon-btn.danger { color: var(--danger); font-size: 12px; }

/* ---------- sync ---------- */

.cols { display: grid; gap: 0 28px; }
@media (min-width: 1200px) {
  .cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .cols .files-title, .overview .overview-first { margin-top: 0; }
}
.clip-text { max-height: 12em; overflow: auto; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13px; }
.clip-latest { border-color: var(--accent); }
.history summary { cursor: pointer; color: var(--muted); font-size: 14px; margin-top: 12px; }
.dropzone {
  width: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 26px 12px; border: 2px dashed var(--border-strong); border-radius: var(--r-card); background: var(--surface);
  font-weight: 400;
}
.dropzone:hover { background: var(--surface-2); }
.dropzone.over { border-color: var(--accent); background: var(--success-bg); }
.upload { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; margin-top: 8px; font-size: 13px; }

.pair-card { margin-bottom: 20px; align-items: flex-start; }
.pair-qr { width: 200px; height: 200px; background: #fff; border-radius: 12px; padding: 8px; }

/* ---------- translate ---------- */

.engine-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.tr-langs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.tr-langs select { min-width: 150px; }
.tr-grid { display: grid; gap: 12px; }
@media (min-width: 1000px) { .tr-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.tr-pane { display: flex; flex-direction: column; gap: 10px; min-height: 190px; }
.tr-pane textarea { flex: 1; min-height: 150px; font-size: 18px; background: transparent; border: 0; padding: 2px; }
.tr-pane textarea:focus-visible { outline: none; }
.tr-pane:focus-within { border-color: var(--border-strong); }
.tr-out { font-size: 22px; font-weight: 700; letter-spacing: -0.3px; overflow-wrap: anywhere; white-space: pre-wrap; }
.tr-out.placeholder { color: var(--faint); font-weight: 400; font-size: 18px; }
.tr-dict { display: grid; gap: 4px; font-size: 14px; }
.tr-dict i { color: var(--muted); margin-right: 8px; }

/* ---------- money ---------- */

.money-month { min-width: 130px; text-align: center; font-weight: 600; align-self: center; }
.money-amount-wrap { display: flex; align-items: center; gap: 6px; }
.money-amount { width: 140px; font-size: 22px; font-weight: 600; letter-spacing: -0.5px; text-align: right; }
.money-in { color: var(--success); }
.money-out { color: var(--text); }
.metric .money-in, .metric .money-out { font-size: 24px; white-space: nowrap; }
@media (max-width: 600px) {
  .metrics { gap: 6px; }
  .metric { padding: 10px; min-width: 0; }
  .metric .money-in, .metric .money-out { font-size: 16px; letter-spacing: -0.3px; }
}
.money-day { margin-bottom: 12px; }
.money-day-head { font-size: 13px; font-weight: 600; color: var(--muted); padding: 0 4px 6px; }
button.money-row { width: 100%; border: 0; border-radius: 0; font-weight: 400; text-align: left; }
button.money-row:active { transform: none; }
.xp.budget.near > div { background: var(--warning); }
.xp.budget.over > div { background: var(--danger); }
.row.off { opacity: .5; }

/* ---------- live status ---------- */

.live-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.live-text::after { content: "Connecting…"; }
:root[data-live="on"] .live-dot { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
:root[data-live="on"] .live-text::after { content: "Live"; }
:root[data-live="off"] .live-text::after { content: "Offline"; }

#toast {
  position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); z-index: 20;
  transform: translateX(-50%) translateY(20px);
  background: var(--text); color: var(--panel);
  padding: 10px 18px; border-radius: 9999px; font-weight: 700; font-size: 14px;
  box-shadow: var(--shadow-pop);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  max-width: calc(100% - 32px);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (min-width: 900px) { #toast { bottom: 32px; left: calc(50% + 128px); } }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------- Gym ---------- */
.gym-warn { background: var(--warning-bg); color: var(--warning); border-radius: var(--r-input); padding: 6px 10px; font-size: 13px; }
.gym-guard { border-color: var(--warning); }
.gym-sets { display: flex; flex-direction: column; gap: 2px; }
.gym-set { padding: 4px 0; border-bottom: 1px solid var(--border); }
.gym-set:last-child { border-bottom: 0; }
.gym-add input { padding: 8px; text-align: center; }
.gym-pick { max-height: 300px; overflow-y: auto; gap: 2px; }
.gym-pick-row { background: transparent; border: 0; padding: 8px; text-align: left; font-weight: 500; border-radius: 6px; }
.gym-pick-row:hover { background: var(--surface-2); }
.gym-pick-row.off { opacity: .55; }
.gym-score { font-size: 22px; }
.gym-score[data-level="mid"] { color: var(--warning); }
.gym-score[data-level="high"] { color: var(--danger); }
.gym-slider { width: 100%; accent-color: var(--accent); padding: 0; border: 0; }
.gym-bar-row { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 8px; font-size: 13px; }
.gym-bar { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.gym-bar > div { height: 100%; background: var(--accent); border-radius: 999px; }
.gym-rest { position: sticky; bottom: 12px; margin-top: 14px; display: none; align-items: center; gap: 8px; justify-content: center;
  background: var(--surface-3); border: 1px solid var(--border-strong); border-radius: 999px; padding: 8px 14px; box-shadow: var(--shadow-pop); }
.gym-rest.on { display: flex; }
.gym-rest b { font-size: 18px; font-variant-numeric: tabular-nums; min-width: 44px; }

/* ---------- Health ---------- */
.hl-nav { margin: -4px 0 12px; }
.hl-nav .icon-btn { font-size: 20px; padding: 2px 12px; }
.hl-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.hl-stat { display: flex; flex-direction: column; gap: 2px; background: var(--surface-2); border-radius: var(--r-input); padding: 8px 10px; }
.hl-stat b { font-size: 17px; font-variant-numeric: tabular-nums; }
.hl-delta { font-size: 12px; font-weight: 700; }
.hl-delta.up { color: var(--success); }
.hl-delta.down { color: var(--warning); }
.hl-bars { position: relative; display: flex; align-items: flex-end; gap: 4px; height: 130px; padding-top: 6px; }
.hl-bars.month { gap: 2px; }
.hl-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; min-width: 0; }
.hl-bar-track { flex: 1; width: 100%; display: flex; align-items: flex-end; }
.hl-bar { width: 100%; background: var(--surface-3); border-radius: 4px 4px 2px 2px; transition: height .3s; }
.hl-bar.hit { background: var(--accent); }
.hl-bar.warn { background: var(--warning); }
.hl-bar.today { outline: 2px solid var(--text); outline-offset: 1px; }
.hl-bar-label { font-size: 10px; color: var(--faint); height: 12px; }
.hl-bars.month .hl-bar-label { font-size: 9px; }
.hl-goal { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--muted); opacity: .6; pointer-events: none;
  transform: translateY(calc(-16px)); }
.hl-spark svg { width: 100%; height: 60px; display: block; }
.hl-spark path { fill: none; stroke: var(--danger); stroke-width: 2; vector-effect: non-scaling-stroke; }
.hl-day { display: flex; align-items: center; gap: 18px; }
.hl-ring { --p: 0; width: 120px; height: 120px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--surface-2) 0); }
.hl-ring > div { width: 96px; height: 96px; border-radius: 50%; background: var(--surface); display: flex; flex-direction: column;
  align-items: center; justify-content: center; }
.hl-ring b { font-size: 20px; }
.hl-stages { display: flex; height: 12px; border-radius: 999px; overflow: hidden; gap: 2px; }
.hl-stage.deep, .hl-dot.deep { background: #5645d4; }
.hl-stage.light, .hl-dot.light { background: #6aa9f7; }
.hl-stage.rem, .hl-dot.rem { background: #b4a7ff; }
.hl-stage.awake, .hl-dot.awake { background: #ffa42b; }
.hl-legend { justify-content: flex-start; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--muted); }
.hl-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }
.hl-link { flex-wrap: wrap; justify-content: flex-start; }
.hl-link select { flex: 1; min-width: 130px; }

/* progress bars (RPG, quests, boss) */
.xp { height: 8px; background: var(--surface-2); border-radius: 9999px; overflow: hidden; margin-bottom: 20px; }
.xp > div { height: 100%; background: var(--accent); border-radius: 9999px; transition: width .35s ease; }

/* Money, minimal */
.money-hero { display: flex; flex-direction: column; gap: 8px; }
.money-big { font-family: var(--font-display); font-size: 40px; font-weight: 400; letter-spacing: -1px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.money-bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.money-bar > div { height: 100%; border-radius: 99px; background: var(--accent); transition: width .3s; }
.money-bar.near > div { background: var(--warning); }
.money-bar.over > div { background: var(--danger); }
.money-bar.thin { height: 5px; margin-top: 4px; }
.money-add { display: flex; gap: 8px; align-items: center; }
.money-add input { flex: 1; font-size: 16px; }
.money-kind { width: 42px; height: 42px; padding: 0; font-size: 20px; flex: none; }
.money-kind.income { background: var(--success-bg); color: var(--success); }
.money-cats .chip { font-size: 12px; padding: 5px 11px; }
.money-row { width: 100%; text-align: left; font-weight: 400; background: transparent; }
.money-row:active { transform: none; }
.money-in { color: var(--success); }
.money-where { display: flex; flex-direction: column; gap: 2px; }
.money-add input { text-align: left; }

/* Gym: programs, next-time hints, food */
.gym-next { background: var(--accent-bg); color: var(--accent); border-radius: 12px; padding: 7px 12px; font-size: 13px; }
.gym-plates { font-size: 13px; }
.gym-program { display: flex; flex-direction: column; gap: 6px; padding: 12px 0; border-top: 1px solid var(--border); }
.gym-program-days { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.gym-program-days > div { display: flex; gap: 8px; flex-wrap: wrap; }
.food-top { display: flex; gap: 18px; align-items: center; }
.ring.big { width: 120px; height: 120px; }
.ring.big > span { width: 100px; height: 100px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring.big b { font-family: var(--font-display); font-size: 26px; font-weight: 500; line-height: 1; }
.ring.big small { font-size: 11px; color: var(--muted); margin-top: 2px; }
.food-macro { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.money-bar.p > div { background: var(--accent); }
.money-bar.c > div { background: var(--warning); }
.money-bar.f > div { background: var(--pro); }
.food-draft { background: var(--surface-2); border-radius: 16px; padding: 12px; }
.food-draft input { padding: 7px 8px; background: var(--surface); }
.food-row { font-size: 14px; padding: 4px 0; }
.food-row .icon-btn { margin-left: 4px; }
.weight-spark { width: 100%; height: 64px; display: block; }
.weight-spark path { fill: none; vector-effect: non-scaling-stroke; }
.weight-spark .raw { stroke: var(--faint); stroke-width: 1; }
.weight-spark .trend { stroke: var(--accent); stroke-width: 2.5; }
.gym-bar.vol { position: relative; }
.gym-bar.vol .band { position: absolute; left: 50%; right: 0; top: 0; bottom: 0; background: var(--accent-bg); border-radius: 0 999px 999px 0; }
.gym-bar.vol > div { position: relative; background: var(--faint); }
.gym-bar.vol > div.ok { background: var(--accent); }
@media (max-width: 600px) { .food-top { flex-direction: column; align-items: stretch; } .food-top .ring { align-self: center; } }
.gym-bar-row.vol-row { grid-template-columns: 90px 1fr 34px; }

/* Remote keyboard */
.remote-live { font-size: 18px; text-align: center; letter-spacing: 2px; color: var(--faint); caret-color: var(--accent); }
.remote-live:focus { border-color: var(--accent); }
.remote-keys { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.remote-key { padding: 12px 0; font-size: 13px; border-radius: 12px; touch-action: manipulation; }
.remote-key.wide { grid-column: span 2; }
.remote-key:active { background: var(--pill); }

/* ---------- the app's bar chart (ui.js barChart) ---------- */
.chart { display: flex; flex-direction: column; gap: 8px; }
.chart-plot { position: relative; padding-top: 22px; }
.chart-cols { position: absolute; inset: 22px 0 0 0; display: flex; gap: 10px; }
.chart.dense .chart-cols { gap: 3px; }
.chart-col { flex: 1; min-width: 0; height: 100%; display: flex; justify-content: center; }
.chart-track { position: relative; flex: 1; max-width: 44px; border-radius: 10px; background: rgba(127, 207, 255, 0.035); display: flex; align-items: flex-end; }
.chart.dense .chart-track { max-width: 18px; }
.chart.dense .chart-track { border-radius: 4px; }
.chart-fill { position: relative; width: 100%; border-radius: 10px; background: var(--pill); transition: height .35s ease; }
.chart.dense .chart-fill { border-radius: 4px; }
.chart-fill.hit { background: var(--accent); }
.chart-col.today .chart-fill { background: var(--accent); }
.chart-col.today .chart-track { background: rgba(127, 207, 255, 0.08); }
.chart-val { position: absolute; left: 50%; bottom: calc(100% + 4px); transform: translateX(-50%); font-size: 11px; color: var(--muted);
  font-variant-numeric: tabular-nums; white-space: nowrap; }
.chart-goal { position: absolute; left: 0; right: 0; margin-bottom: 0; border-top: 1.5px dashed var(--border-strong); z-index: 1;
  pointer-events: none; }
.chart-goal span { position: absolute; right: 0; top: -18px; font-size: 10px; color: var(--faint); background: var(--surface); padding: 0 4px; border-radius: 4px; }
.chart-x { display: flex; gap: 10px; }
.chart.dense .chart-x { gap: 3px; }
.chart-x span { flex: 1; min-width: 0; text-align: center; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: visible; }
.chart-x span.today { color: var(--text); font-weight: 600; }
@media (hover: hover) { .chart-col:hover .chart-fill { filter: brightness(1.15); } }

/* ---------- page header, headline numbers, board ---------- */
.page-head { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.page-head .sub { margin: 0; color: var(--muted); font-size: 15px; }
h3 { font-family: var(--font-display); font-size: 16px; font-weight: 500; margin: 0; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 700px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi { background: var(--surface); border-radius: var(--r-card); padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.kpi-label { font-size: 13px; color: var(--muted); }
.kpi-value { font-family: var(--font-display); font-size: 30px; font-weight: 400; letter-spacing: -.5px; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi-value small { font-size: 14px; color: var(--muted); letter-spacing: 0; margin-left: 5px; }
.kpi-note { font-size: 12px; color: var(--faint); }
.kpi-bar { height: 4px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.kpi-bar > div { height: 100%; background: var(--accent); border-radius: 99px; }
.board-card { display: flex; flex-direction: column; gap: 16px; padding: 20px 22px; }
.board-card > header { gap: 12px; }
.board-empty { margin: 0; }
.board-empty-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.board-empty-row p { margin: 0; }
.board-gym { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.board-gym > div { display: flex; flex-direction: column; gap: 4px; }
a.muted { text-decoration: none; }
a.muted:hover { color: var(--text); }

/* My foods */
.myfoods-head { width: 100%; background: transparent; padding: 0; font-weight: 400; }
.myfoods-head:hover { background: transparent; }
.myfoods-head:active { transform: none; }
.myfoods-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.myfoods-form .myfoods-field:first-child { grid-column: span 2; }
.myfoods-field input { width: 100%; }
@media (max-width: 600px) { .myfoods-form { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.myfoods-list .list-row { padding: 10px 14px; min-height: 0; }
.remote-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.remote-steps > div { display: flex; flex-direction: column; gap: 8px; background: var(--surface-2); border-radius: 18px; padding: 16px; }
.remote-steps b { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--pill); color: var(--accent); font-size: 14px; }
@media (max-width: 600px) { .remote-steps { grid-template-columns: 1fr; } }

/* Today, refined */
.today-head { align-items: center; margin-bottom: 4px; }
.today-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.today-title h1 { font-size: 32px; }
.today-side { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.today-side .ring.big { width: 92px; height: 92px; }
.today-side .ring.big > span { width: 76px; height: 76px; }
.today-side .ring.big b { font-size: 20px; }
.day-arrows { margin-top: 0; }
.day-arrows button.round { width: 34px; height: 34px; padding: 0; border-radius: 50%; font-size: 18px; background: var(--surface); color: var(--text); }
.today-group { display: flex; flex-direction: column; gap: 8px; }
.group-head { display: flex; justify-content: space-between; align-items: baseline; padding: 0 6px; font-size: 14px; font-weight: 500; color: var(--muted); }
.group-head.as-button { background: transparent; border: 0; width: 100%; padding: 6px; border-radius: 12px; }
.group-head.as-button:hover { background: var(--surface); }
.habit-list { padding: 0; overflow: hidden; }
.habit-list .h-row { border-radius: 0; min-height: 56px; padding: 10px 18px; }
.habit-list .h-row + .h-row { border-top: 1px solid var(--border); }
.h-row.done .h-name { text-decoration: none; color: var(--muted); }
.done-list { opacity: .9; }
.all-done { display: flex; flex-direction: column; gap: 4px; align-items: center; text-align: center; padding: 26px; }
.h-pts { min-width: 34px; text-align: right; }
.card .list { background: var(--surface-2); }
.card .list .list-row + .list-row { border-top-color: var(--surface-3); }
.list-row a.item-text { color: var(--text); text-decoration: none; }
.list-row a.item-text:hover { color: var(--accent); }

/* Focus history */
.focus-history { display: flex; flex-direction: column; gap: 14px; }
.history-toggle { display: flex; justify-content: space-between; align-items: center; width: 100%; background: transparent; padding: 0; font-size: 16px; font-weight: 500; }
.history-toggle:hover { background: transparent; }
.history-toggle:active { transform: none; }
.switch-pill { width: 42px; height: 24px; border-radius: 12px; background: var(--surface-3); position: relative; transition: background .2s; flex: none; }
.switch-pill i { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--muted); transition: transform .2s, background .2s; }
.switch-pill.on { background: var(--accent); }
.switch-pill.on i { transform: translateX(18px); background: var(--on-accent); }
.history-day { display: flex; flex-direction: column; gap: 8px; }
.history-day-head { padding: 0 4px; }
.history-dot { width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--faint); flex: none; }
.history-dot.done { background: var(--accent); border-color: var(--accent); }
.focus-history .list-row { min-height: 46px; padding: 10px 16px; }
.week-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 2px; }
.week-nav > div { text-align: center; font-size: 15px; }
.week-nav button.round { width: 38px; height: 38px; padding: 0; border-radius: 50%; font-size: 20px; background: var(--surface); }
.week-nav button.round:disabled { opacity: .3; }

/* Reminders */
.remind-add .chips .chip { font-size: 12px; }
.remind-next { display: flex; flex-direction: column; gap: 10px; padding: 20px 22px; border: 1px solid var(--pill); }
.remind-next-time { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.remind-next-time b { font-family: var(--font-display); font-size: 40px; font-weight: 400; letter-spacing: -1px; font-variant-numeric: tabular-nums; line-height: 1; }
.remind-next-time span { color: var(--accent); font-size: 14px; }
.remind-next-text { font-size: 17px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.remind-empty { align-items: flex-start; }
.remind-row .remind-time b { font-variant-numeric: tabular-nums; }
.list-row.remind-row.late { background: transparent; box-shadow: inset 3px 0 0 var(--warning); }
.remind-row .remind-actions button.primary { padding: 6px 14px; }

/* Alarm sound */
.alarm-row { padding: 6px 10px 6px 6px; gap: 4px; }
.alarm-pick { flex: 1; display: flex; align-items: center; gap: 12px; background: transparent; text-align: left; font-weight: 400; padding: 8px 10px; min-width: 0; }
.alarm-pick:hover { background: transparent; }
.alarm-pick:active { transform: none; }
.alarm-radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--faint); flex: none; position: relative; }
.alarm-row.on .alarm-radio { border-color: var(--accent); }
.alarm-row.on .alarm-radio::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--accent); }
.alarm-settings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; align-items: end; }
@media (max-width: 600px) { .alarm-settings { grid-template-columns: 1fr; } }
