/* ==========================================================================
   ONYX — css/onyx.css
   The original's "Aurora Glass" look (dark violet-to-cyan, and a light
   counterpart), rebuilt phone first: every control is at least 44 px, text
   at least 11 px, nothing scrolls sideways at 320 px (the original's
   Dashboard ran 42 px and Performance 411 px past a 375 px screen), and
   calendar columns can't be pushed wider by long titles (on desktop the
   original's month view lost Friday and Saturday off the right edge).
   Below 1024 px the pages sit behind a bottom tab bar (Dashboard, Planner,
   Calendar, Ideas, More): the original's phone menu button had no icon.
   ========================================================================== */
:root {
  --r-sm: var(--c-r-sm); --r: var(--c-r); --r-lg: var(--c-r-lg); --r-full: var(--c-r-full);
  --font: var(--c-font);
  --mono: var(--c-mono);
  --p-urgent: #F5566B; --p-high: #F5A623; --p-medium: #4D9EFF; --p-low: #8E8CA3;
  --tap: var(--c-tap);
  --bar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
/* Each accent: its two fills (--a1/--a2, the aurora gradient) and its colour as text, per theme (--at-d dark, --at-l light; AA on every surface). */
html[data-accent="violet"] { --a1: #8B6CFF; --a2: #2DD4C6; --at-d: #A68FFF; --at-l: #5B3FD9; }
html[data-accent="blue"] { --a1: #5B8CFF; --a2: #8B6CFF; --at-d: #8DB0FF; --at-l: #2F5FD0; }
html[data-accent="emerald"] { --a1: #22C47E; --a2: #2DD4C6; --at-d: #4ED99A; --at-l: #116E44; }
html[data-accent="amber"] { --a1: #F5A623; --a2: #F87171; --at-d: #F7B955; --at-l: #8A5100; }
html[data-accent="rose"] { --a1: #FF6B81; --a2: #A78BFA; --at-d: #FF8FA0; --at-l: #B22B44; }
html[data-accent="cyan"] { --a1: #22C3DE; --a2: #8B6CFF; --at-d: #5AD3E8; --at-l: #0A6F80; }
/* Release B (2026-10-21): the calm shared system (/shared/zy-theme.css) under
   Onyx's aurora accents. Light by default, dark from the "Dark mode" switch.
   Surfaces, borders and text come from the --c-* tokens; status text uses
   the -t tokens. The aurora glow stays, quieter, at night only. */
html[data-theme="dark"], html[data-theme="light"] {
  --bg: var(--c-bg); --bg2: var(--c-bg2); --side: var(--c-side); --surface: var(--c-surface); --surface2: var(--c-surface2); --surface3: var(--c-surface3); --hover: var(--c-hover);
  --border: var(--c-border); --border2: var(--c-border2); --field: var(--c-field);
  --t1: var(--c-t1); --t2: var(--c-t2); --t3: var(--c-t3); --overlay: var(--c-overlay); --on-accent: #0A0A10;
  --good: var(--c-good); --warn: var(--c-warn); --bad: var(--c-bad); --info: var(--c-info);
  --good-t: var(--c-good-t); --warn-t: var(--c-warn-t); --bad-t: var(--c-bad-t); --info-t: var(--c-info-t);
  --shadow-1: var(--c-shadow-1); --shadow-2: var(--c-shadow-2);
}
html[data-theme="dark"] {
  --a-text: var(--at-d); --spark: var(--a2);
  --glow: radial-gradient(1100px 620px at 8% -8%, color-mix(in srgb, var(--a1) 10%, transparent), transparent 60%), radial-gradient(900px 560px at 108% 8%, color-mix(in srgb, var(--a2) 7%, transparent), transparent 55%);
  color-scheme: dark;
}
html[data-theme="light"] {
  --a-text: var(--at-l); --spark: var(--at-l);
  --glow: none;
  color-scheme: light;
}
html { --zy-bg: var(--bg2); --zy-surface: var(--surface); --zy-border: var(--border2); --zy-text: var(--t1); --zy-muted: var(--t2); --zy-accent: var(--a1); --zy-accent-ink: var(--a-text); --zy-accent-text: var(--on-accent);
  --zy-ok: var(--good); --zy-warn: var(--warn); --zy-danger: var(--bad); --zy-font: var(--font); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--glow, none), var(--bg); background-attachment: fixed; color: var(--t1); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; overflow-x: hidden; min-height: 100vh; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.015em; line-height: 1.25; }
p { margin: 0 0 8px; }
a { color: var(--a-text); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { flex-shrink: 0; }
:focus-visible { outline: 2px solid var(--a1); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--a1) 35%, transparent); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--t2); }
.small { font-size: 12.5px; }
.center { text-align: center; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.clamp-2, .clamp-3, .clamp-4 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-2 { -webkit-line-clamp: 2; } .clamp-3 { -webkit-line-clamp: 3; } .clamp-4 { -webkit-line-clamp: 4; }
.good-text { color: var(--good-t); } .accent-text { color: var(--a-text); font-weight: 600; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; } }

/* ---------- loader (shown only until the device's data is read) ---------- */
.loader { position: fixed; inset: 0; z-index: 400; background: var(--bg); color: var(--a-text); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; transition: opacity .25s, visibility .25s; }
.loader.hide { opacity: 0; visibility: hidden; }
.loader-word { font-weight: 700; letter-spacing: .3em; text-transform: uppercase; font-size: 13px; color: var(--t2); }

/* ---------- shell ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 272px; max-width: 86vw; z-index: 120; background: var(--side); border-right: 1px solid var(--border); display: flex; flex-direction: column;
  transform: translateX(-102%); transition: transform .22s ease; padding-bottom: var(--safe-b); }
.sidebar.open { transform: none; box-shadow: var(--shadow-2); }
.brand { display: flex; align-items: center; gap: 10px; padding: 14px 12px 10px 16px; }
.brand-mark { width: 36px; height: 36px; border-radius: 11px; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--a1), var(--a2)); color: var(--on-accent); flex: none; }
.brand div { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.brand b { color: var(--t1); font-size: 17px; }
.brand span { color: var(--t3); font-size: 12px; }
.side-nav { flex: 1; overflow-y: auto; padding: 4px 10px 12px; overscroll-behavior: contain; }
.nav-group { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--t3); padding: 14px 10px 4px; }
.nav-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: var(--tap); padding: 0 10px; border: 1px solid transparent; border-radius: var(--r-sm); background: none; color: var(--t2); font-weight: 600; font-size: 14.5px; text-align: left; }
.nav-item:hover { background: var(--hover); color: var(--t1); }
.nav-item.active { background: linear-gradient(90deg, color-mix(in srgb, var(--a1) 18%, transparent), color-mix(in srgb, var(--a1) 4%, transparent)); border-color: color-mix(in srgb, var(--a1) 28%, transparent); color: var(--t1); }
.nav-item.active svg { color: var(--a-text); }
.nav-item span:first-of-type { flex: 1; }
.nav-spark svg { color: var(--spark); }
.nav-count { font: 600 12px var(--mono); color: var(--t3); }
.side-foot { padding: 12px 18px 16px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--t3); display: flex; flex-direction: column; gap: 4px; }
.side-foot a { color: var(--t2); text-decoration: none; min-height: 32px; display: inline-flex; align-items: center; }
.scrim { position: fixed; inset: 0; background: var(--overlay); z-index: 110; opacity: 0; visibility: hidden; transition: opacity .2s; }
.scrim.open { opacity: 1; visibility: visible; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 60; display: flex; align-items: center; gap: 6px; min-height: 60px; padding: 8px 10px; padding-top: max(8px, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.topbar h1 { flex: 1; min-width: 0; font-size: 19px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-left: 4px; }
.topbar-actions { display: flex; align-items: center; gap: 4px; }
@media (max-width: 400px) { .topbar h1 { font-size: 17px; } .topbar { gap: 2px; padding-left: 6px; padding-right: 6px; } }
/* The narrowest phones: the chip says just "Free" so the page title fits. */
@media (max-width: 360px) { .topbar .zy-chip-cta { display: none; } .topbar h1 { font-size: 16px; } }
.topbar .zy-chip { min-height: var(--tap); }
.add-btn { background: linear-gradient(135deg, var(--a1), var(--a2)); color: var(--on-accent); border-radius: 50%; }
.add-btn:hover { filter: brightness(1.06); background: linear-gradient(135deg, var(--a1), var(--a2)); color: var(--on-accent); }
main { flex: 1; padding: 14px 14px calc(var(--bar-h) + 24px + var(--safe-b)); width: 100%; max-width: 1240px; margin: 0 auto; min-width: 0; }
.page { display: none; }
.page.active { display: block; animation: page-in .18s ease; }
@keyframes page-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; display: grid; grid-template-columns: repeat(5, 1fr); height: calc(var(--bar-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: color-mix(in srgb, var(--bg2) 94%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--border); }
.bn-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; background: none; color: var(--t3); font-size: 11.5px; font-weight: 600; min-width: 0; }
.bn-item.active { color: var(--a-text); }
.bn-item span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (min-width: 1024px) {
  .sidebar { transform: none; position: sticky; top: 0; height: 100vh; flex: none; z-index: 1; box-shadow: none !important; }
  .sidebar-close, .menu-btn, .scrim, .bottom-nav { display: none !important; }
  main { padding: 22px 28px 40px; }
  .topbar { padding-left: 24px; padding-right: 20px; }
  .topbar h1 { font-size: 21px; }
}

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap); padding: 0 16px; border-radius: var(--r-sm); border: 1px solid var(--border2); background: var(--surface2);
  color: var(--t1); font-weight: 600; font-size: 14.5px; text-decoration: none; white-space: nowrap; transition: filter .15s, background .15s; }
.btn:hover { background: var(--hover); }
.btn-primary { background: linear-gradient(135deg, var(--a1), var(--a2)); border-color: transparent; color: var(--on-accent); }
.btn-primary:hover { filter: brightness(1.06); background: linear-gradient(135deg, var(--a1), var(--a2)); }
.btn-danger { background: color-mix(in srgb, var(--bad) 16%, transparent); border-color: color-mix(in srgb, var(--bad) 45%, transparent); color: var(--bad-t); }
.btn-ghost { background: none; border-color: transparent; }
.btn-sm { padding: 0 12px; font-size: 13.5px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: default; }
.danger-text { color: var(--bad-t); }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: var(--tap); height: var(--tap); flex: none; border: 0; border-radius: 50%; background: none; color: var(--t2); }
.icon-btn:hover { background: var(--hover); color: var(--t1); }
.icon-btn.star.on { color: var(--warn-t); }
.icon-btn.star.on svg { fill: currentColor; }
.link { border: 0; background: none; padding: 0; color: var(--a-text); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; min-height: 0; text-align: left; }
.card-link { display: inline-flex; align-items: center; gap: 2px; min-height: var(--tap); padding: 0 4px; text-decoration: none; font-size: 13.5px; white-space: nowrap; }
.pro-badge { display: inline-block; padding: 2px 7px; border-radius: var(--r-full); background: linear-gradient(135deg, var(--a1), var(--a2)); color: var(--on-accent); font-size: 11px; font-weight: 800; letter-spacing: .05em; line-height: 1.4; vertical-align: middle; }

/* ---------- cards and layout ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px; margin-bottom: 14px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; min-height: var(--tap); margin-top: -8px; flex-wrap: wrap; }
.card-head h3 { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--t2); min-width: 0; }
.card-head h3 svg { color: var(--a-text); }
.grid-2 { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); margin-bottom: 14px; }
.grid-2 > .card { margin-bottom: 0; }
@media (min-width: 760px) { .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.page-sub { margin: 0; color: var(--t2); font-size: 14px; flex: 1 1 180px; min-width: 0; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.page-lede { color: var(--t2); max-width: 680px; }
.quota-note { margin: 0 0 14px; padding: 10px 14px; border-radius: var(--r); background: color-mix(in srgb, var(--a1) 9%, transparent); border: 1px solid color-mix(in srgb, var(--a1) 28%, transparent); font-size: 14px; color: var(--t2); }
.quota-note b { color: var(--t1); }
.quota-note .link { min-height: var(--tap); display: inline-flex; align-items: center; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.toolbar .input { flex: 1 1 130px; width: auto; min-width: 0; }
.search-box { position: relative; display: flex; align-items: center; flex: 2 1 200px; min-height: var(--tap); color: var(--t3); min-width: 0; }
/* The field itself carries the edge (3:1 against the page); the magnifier sits inside it. */
.search-box > svg { position: absolute; left: 12px; pointer-events: none; }
.search-box input { flex: 1; width: 100%; min-width: 0; border: 1px solid var(--field); border-radius: var(--r-sm); background: var(--surface); outline: none; color: var(--t1); min-height: var(--tap); padding: 0 12px 0 40px; font-size: 15px; }
.search-box input:focus { border-color: var(--a-text); box-shadow: 0 0 0 3px color-mix(in srgb, var(--a1) 22%, transparent); }
.search-box.big { margin-bottom: 12px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.chip { min-height: var(--tap); padding: 0 14px; border-radius: var(--r-full); border: 1px solid var(--border2); background: var(--surface); color: var(--t2); font-weight: 600; font-size: 14px; }
.chips.static { margin: 0; }
.chip.static { display: inline-flex; align-items: center; min-height: 32px; font-weight: 500; color: var(--t1); background: var(--surface2); }
.stats-4 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
@media (min-width: 760px) { .stats-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 12px; min-width: 0; }
.card .stat { background: var(--surface2); }
.stat-lbl { font-size: 12px; color: var(--t3); font-weight: 600; }
.stat-val { font: 700 19px/1.3 var(--mono); overflow-wrap: anywhere; letter-spacing: -.02em; }
.stat-sub { font-size: 12px; color: var(--t3); }
.empty { text-align: center; padding: 26px 16px; color: var(--t2); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty svg { color: var(--a-text); opacity: .85; }
.empty h4 { color: var(--t1); font-size: 16px; }
.empty p { max-width: 380px; margin: 0; }
details summary { cursor: pointer; min-height: var(--tap); display: flex; align-items: center; font-weight: 600; color: var(--t2); }
.done-block { padding-top: 6px; padding-bottom: 6px; }
.done-block[open] { padding-bottom: 16px; }

/* ---------- tags ---------- */
.ptag { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--t2); white-space: nowrap; }
.ptag i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.stag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; color: var(--t1); padding: 1px 8px; border-radius: var(--r-full); background: color-mix(in srgb, var(--c) 18%, transparent); border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); white-space: nowrap; }
.prio { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--t2); }
.prio i, .pdot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; }
.prio-urgent i, .pdot.prio-urgent { background: var(--p-urgent); } .prio-high i, .pdot.prio-high { background: var(--p-high); }
.prio-medium i, .pdot.prio-medium { background: var(--p-medium); } .prio-low i, .pdot.prio-low { background: var(--p-low); }
.prio-urgent { color: var(--bad-t); font-weight: 600; }
.meta { display: inline-flex; align-items: center; gap: 4px; }
.meta.overdue { color: var(--bad-t); font-weight: 600; }
.meta.rest { color: var(--t3); }
.meta.rest svg { width: 14px; height: 14px; }

/* ---------- rows ---------- */
.rows { display: flex; flex-direction: column; gap: 6px; }
.row { display: flex; align-items: center; gap: 6px; min-height: 52px; padding: 4px; border-radius: var(--r); background: var(--surface2); border: 1px solid transparent; width: 100%; text-align: left; color: var(--t1); min-width: 0; }
button.row:hover, .row-main:hover { background: var(--hover); }
.row-main, .row-main-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 4px; min-height: var(--tap); padding: 4px 6px; border: 0; background: none; text-align: left; color: inherit; border-radius: var(--r-sm); }
.row-title { font-weight: 600; font-size: 14.5px; overflow-wrap: anywhere; }
.row-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 12.5px; color: var(--t2); }
.row-meta:empty { display: none; }
.content-row { border-left: 3px solid var(--c); }
.content-row.overdue { border-color: color-mix(in srgb, var(--bad) 40%, transparent); border-left-color: var(--bad); }
.content-row.published .row-title { color: var(--t2); }
.advance, .lead-done { width: var(--tap); height: var(--tap); flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; border: 2px solid color-mix(in srgb, var(--c) 60%, transparent); background: none; color: var(--t1); }
.advance:hover { background: color-mix(in srgb, var(--c) 20%, transparent); }
.lead-done { border: 0; background: color-mix(in srgb, var(--good) 22%, transparent); color: var(--good-t); }
.group { margin-bottom: 16px; }
.group-title { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--t2); margin: 6px 2px 8px; }
.count { font: 600 12px var(--mono); color: var(--t3); letter-spacing: 0; }
.g-overdue .group-title { color: var(--bad-t); }
.search-row svg { color: var(--a-text); margin-left: 8px; }
.search-results { max-height: 60vh; overflow-y: auto; }

/* ---------- board ---------- */
.board { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .board { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .board { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.board-col { background: var(--bg2); border: 1px solid var(--border); border-top: 3px solid var(--c); border-radius: var(--r-lg); padding: 10px; min-width: 0; }
.bdot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); display: inline-block; }
.board-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 4px; margin-bottom: 8px; }
.board-move { display: flex; justify-content: space-between; gap: 6px; padding: 4px; flex-wrap: wrap; }
.board-move .btn { padding: 0 10px; }
.board-empty { padding: 8px; }

/* ---------- dashboard ---------- */
.hero { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.greet { font-size: 24px; }
.momentum { display: flex; align-items: center; gap: 14px; margin: 0; padding: 12px 16px; flex: 1 1 260px; max-width: 440px; }
.momentum-tx { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.streak { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; padding: 3px 10px; border-radius: var(--r-full); color: var(--warn-t); background: color-mix(in srgb, var(--warn) 13%, transparent); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); font: 600 13px var(--mono); align-self: flex-start; }
.spotlight .insight { margin: 0; }
.goal-card { padding-top: 10px; padding-bottom: 12px; }
.goal-card .progress-line { margin-top: 0; }
.refer-banner { display: flex; align-items: center; gap: 4px; margin-bottom: 14px; border-radius: var(--r); border: 1px solid color-mix(in srgb, var(--a1) 35%, transparent); background: color-mix(in srgb, var(--a1) 8%, transparent); }
.refer-main { flex: 1; display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 6px 12px; border: 0; background: none; text-align: left; color: var(--t1); min-width: 0; }
.refer-main svg { color: var(--a-text); }
.pipe { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 480px) { .pipe { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.pipe-stage { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 64px; padding: 8px 10px; border-radius: var(--r); border: 1px solid var(--border); border-left: 3px solid var(--c); background: var(--surface2); color: var(--t1); text-align: left; min-width: 0; }
.pipe-stage:hover { border-color: var(--c); }
.pipe-n { font: 700 20px/1.2 var(--mono); }
.pipe-l { font-size: 12px; color: var(--t2); overflow-wrap: anywhere; }
.activity { display: flex; flex-direction: column; }
.act-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.act-row:last-child { border-bottom: 0; }
.act-row svg { color: var(--a-text); margin-top: 2px; }
.act-row span { min-width: 0; overflow-wrap: anywhere; }
.quick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.quick-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 74px; padding: 8px; border-radius: var(--r); border: 1px solid var(--border); background: var(--surface2); color: var(--t1); font-weight: 600; font-size: 13px; }
.quick-btn svg { color: var(--a-text); }
.quick-btn:hover { border-color: var(--a1); }

/* ---------- calendar ---------- */
.cal-card { padding: 12px; }
.cal-head { display: flex; align-items: center; gap: 4px; margin-bottom: 8px; }
.cal-head h3 { flex: 1; text-align: center; font-size: 17px; min-width: 0; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-dow { text-align: center; font-size: 11.5px; font-weight: 700; color: var(--t3); padding: 4px 0; text-transform: uppercase; letter-spacing: .04em; min-width: 0; overflow: hidden; }
.cal-cell { position: relative; min-height: 52px; min-width: 0; border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--surface2); display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px 2px; overflow: hidden; }
/* Days of the next or last month: no fill and quieter text instead of fading (faded text fell below AA). */
.cal-cell.other { background: none; }
.cal-cell.other .dnum { color: var(--t3); font-weight: 500; }
.cal-cell.other .cal-pill-t { color: var(--t2); }
.cal-cell.today { border-color: var(--a1); }
.cal-cell.sel { background: color-mix(in srgb, var(--a1) 20%, var(--surface2)); border-color: var(--a1); }
.cal-cell.drop-over, .week-day.drop-over, .card.drop-over { outline: 2px dashed var(--a2); outline-offset: -2px; }
.cal-btn { position: absolute; inset: 0; border: 0; background: none; border-radius: inherit; display: flex; justify-content: center; padding-top: 4px; color: var(--t1); }
.cal-cell.today .dnum { color: var(--a-text); }
html[data-theme="dark"] .cal-cell.today .dnum { color: var(--t1); } /* the today cell is accent-tinted: plain text reads on it */
.dnum { font: 600 14px var(--mono); }
.cal-items { position: relative; margin-top: 22px; display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; width: 100%; min-width: 0; pointer-events: none; }
.cal-pill { width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.cal-pill-t { display: none; }
.cal-more { display: none; }
@media (max-width: 559px) { .cal-card { margin-left: -14px; margin-right: -14px; border-radius: 0; border-left: 0; border-right: 0; padding: 10px 4px; } .cal-grid { gap: 2px; } .cal-head { padding: 0 6px; } }
@media (min-width: 760px) {
  .cal-cell { min-height: 96px; align-items: stretch; }
  .cal-btn { justify-content: flex-start; padding: 4px 8px; }
  .cal-items { flex-direction: column; flex-wrap: nowrap; align-items: stretch; justify-content: flex-start; padding: 0 4px; pointer-events: auto; margin-top: 24px; }
  .cal-pill { width: auto; height: auto; border-radius: 6px; background: color-mix(in srgb, var(--c) 18%, var(--surface)); border-left: 3px solid var(--c); padding: 2px 6px; cursor: grab; min-width: 0; }
  .cal-pill-t { display: block; font-size: 12px; font-weight: 600; color: var(--t1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .cal-more { display: block; font-size: 12px; color: var(--t2); padding-left: 4px; }
}
.week { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .week { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); } }
.week-day { border: 1px solid var(--border); border-radius: var(--r); padding: 6px 8px 10px; background: var(--bg2); min-width: 0; }
.week-day.today { border-color: var(--a1); }
.week-head { display: flex; align-items: center; justify-content: space-between; }
.drag-wrap { min-width: 0; }
@media (min-width: 1024px) { .drag-wrap { cursor: grab; } }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 4px 2px 14px; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--t2); }
.legend-item i { width: 9px; height: 9px; border-radius: 50%; }

/* ---------- vaults ---------- */
.vault-grid { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .vault-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .vault-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.v-card { display: flex; flex-direction: column; padding: 4px; margin: 0; }
.v-card.archived, .v-card.resting { opacity: .78; }
.v-main { flex: 1; display: flex; flex-direction: column; gap: 6px; padding: 10px 10px 4px; border: 0; background: none; text-align: left; color: var(--t1); border-radius: var(--r); min-width: 0; min-height: var(--tap); }
.v-main:hover { background: var(--hover); }
.v-title { font-size: 15px; overflow-wrap: anywhere; }
.v-text { margin: 0; color: var(--t2); font-size: 14px; overflow-wrap: anywhere; }
.v-quote { margin: 0; font-size: 14.5px; font-weight: 500; overflow-wrap: anywhere; }
.v-mono { margin: 0; font: 13px/1.5 var(--mono); color: var(--a-text); overflow-wrap: anywhere; }
.v-actions { display: flex; justify-content: flex-end; gap: 2px; border-top: 1px solid var(--border); padding-top: 2px; }
.group-card .g-bar { display: block; height: 5px; border-radius: var(--r-full); background: var(--c); margin-bottom: 4px; }

/* ---------- checklists ---------- */
.cl-grid { margin-bottom: 14px; }
.cl-card.resting { opacity: .8; }
.cl-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.cl-name { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; padding-top: 10px; }
.cl-name b { overflow-wrap: anywhere; }
.cl-name .link { min-height: var(--tap); display: inline-flex; align-items: center; font-weight: 500; }
.steps { display: flex; flex-direction: column; margin: 6px 0; }
.step { display: flex; align-items: center; gap: 4px; min-height: var(--tap); border-bottom: 1px solid var(--border); }
.step-text { flex: 1; min-width: 0; font-size: 14.5px; overflow-wrap: anywhere; }
.step.done .step-text { color: var(--t3); text-decoration: line-through; }
.check { width: var(--tap); height: var(--tap); flex: none; border-radius: 50%; border: 0; background: none; display: inline-flex; align-items: center; justify-content: center; position: relative; color: transparent; }
.check::before { content: ''; position: absolute; width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--field); transition: background .15s, border-color .15s; }
.check svg { position: relative; }
.check:not(.on) svg { visibility: hidden; } /* nothing to show until it's ticked */
/* Ticked: the mark sits on its own aurora tile (the same size as the box). */
.check.on svg { box-sizing: content-box; padding: 4px; border-radius: 8px; background: linear-gradient(135deg, var(--a1), var(--a2)); }
.check:hover::before { border-color: var(--a1); }
.check.on::before { background: linear-gradient(135deg, var(--a1), var(--a2)); border-color: transparent; }
.check.on { color: var(--on-accent); }
.add-step { display: flex; gap: 6px; align-items: center; margin-top: 8px; }
.add-step .input { flex: 1; }
.tpl-row { padding-left: 10px; gap: 8px; }

/* ---------- brand kit ---------- */
.logo-box { display: flex; align-items: center; justify-content: center; min-height: 140px; border-radius: var(--r); border: 1px dashed var(--border2); background: var(--surface2); padding: 14px; }
.logo-box img { max-width: 100%; max-height: 160px; object-fit: contain; }
.logo-box.small { min-height: 88px; width: 120px; padding: 8px; }
.logo-box.small img { max-height: 72px; }
.logo-edit { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch-btn { display: inline-flex; align-items: center; gap: 8px; min-height: var(--tap); padding: 4px 12px 4px 4px; border-radius: var(--r-full); border: 1px solid var(--border2); background: var(--surface2); font: 600 13px var(--mono); color: var(--t1); }
.swatch-btn i { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border2); }
.pillars { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.color-pick { width: var(--tap); height: var(--tap); padding: 2px; border: 1px solid var(--border2); border-radius: var(--r-sm); background: var(--bg2); flex: none; cursor: pointer; }

/* ---------- results ---------- */
.result-row { gap: 8px; padding: 6px 12px 6px 8px; }
.m-date { font: 600 12.5px var(--mono); color: var(--t3); width: 52px; flex: none; text-align: center; }
.r-views { display: flex; flex-direction: column; align-items: flex-end; flex: none; }
.r-views b { font: 700 15px var(--mono); }
.rank-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); min-height: var(--tap); }
.rank-row:last-child { border-bottom: 0; }
.rank { width: 28px; height: 28px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font: 700 13px var(--mono); background: color-mix(in srgb, var(--a1) 18%, transparent); color: var(--t1); flex: none; }
.rank.low { background: var(--surface2); color: var(--t2); }
.rank-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rank-t b { overflow-wrap: anywhere; font-size: 14px; }
.rank-v { font-family: var(--mono); }
.table-wrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th, .tbl td { text-align: left; padding: 8px 10px 8px 0; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl thead th { font-size: 12px; color: var(--t3); text-transform: uppercase; letter-spacing: .04em; }
.tbl td { font-family: var(--mono); }
.ring-row { display: flex; align-items: center; gap: 16px; }
.ring-row p { margin: 2px 0; }

/* ---------- charts ---------- */
.ring-wrap { position: relative; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.ring-wrap .ring { position: absolute; inset: 0; }
.ring-bg { fill: none; stroke: var(--surface2); }
.ring-fg { fill: none; stroke: var(--a1); stroke-linecap: round; transition: stroke-dashoffset .5s ease; }
.ring-label { position: relative; font: 700 18px var(--mono); }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 140px; margin: 4px 0 8px; }
.bars.dense { gap: 2px; }
.bar-col { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; align-items: stretch; gap: 4px; }
.bar-val { font: 600 11px var(--mono); color: var(--t2); text-align: center; overflow: hidden; white-space: nowrap; text-overflow: clip; }
.bar-track { flex: 1; display: flex; align-items: flex-end; }
.bar { width: 100%; border-radius: 5px 5px 2px 2px; background: linear-gradient(180deg, var(--a2), var(--a1)); min-height: 2px; }
.bar.empty { background: var(--surface2); }
.bar-lbl { font-size: 11px; color: var(--t3); text-align: center; overflow: hidden; white-space: nowrap; }
@media (max-width: 559px) { .bars .bar-col:nth-child(odd):not(:last-child) .bar-lbl, .bars .bar-col:nth-child(odd):not(:last-child) .bar-val { visibility: hidden; } }
.shares { display: flex; flex-direction: column; gap: 10px; }
.share-head { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.share-name { display: inline-flex; align-items: center; gap: 8px; min-width: 0; overflow-wrap: anywhere; }
.share-name .dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.share-val { font-family: var(--mono); color: var(--t2); white-space: nowrap; }
.meter { height: 8px; border-radius: var(--r-full); background: var(--surface2); border: 1px solid var(--border); overflow: hidden; margin: 6px 0; }
.meter i { display: block; height: 100%; border-radius: var(--r-full); background: linear-gradient(90deg, var(--a1), var(--a2)); }
.meter.good i { background: var(--good); }
.shares .meter { margin: 4px 0 0; }
.progress-line { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 8px 0 6px; font-size: 13.5px; flex-wrap: wrap; }
.progress-line b { font-family: var(--mono); }

/* ---------- insights and ask ---------- */
.insight { display: flex; gap: 12px; padding: 12px; border-radius: var(--r); background: var(--surface2); margin-bottom: 8px; border-left: 3px solid var(--info); }
.insight-good { border-left-color: var(--good); } .insight-warn { border-left-color: var(--warn); }
.insight-ic { width: 32px; height: 32px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex: none; background: color-mix(in srgb, var(--a1) 16%, transparent); color: var(--a-text); }
.insight-tx { min-width: 0; }
.insight-h { font-weight: 700; overflow-wrap: anywhere; }
.insight-d { color: var(--t2); font-size: 14px; overflow-wrap: anywhere; }
.insight-tip { margin-top: 4px; font-size: 13px; color: var(--t3); }
.ask-samples { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ask-samples .zy-ask-q { min-height: var(--tap); }
.ask-card { display: flex; flex-direction: column; padding: 14px; margin-bottom: 0; height: calc(100vh - 60px - var(--bar-h) - 44px - var(--safe-b)); height: calc(100dvh - 60px - var(--bar-h) - 44px - var(--safe-b)); min-height: 380px; }
@media (min-width: 1024px) { .ask-card { height: calc(100vh - 60px - 64px); height: calc(100dvh - 60px - 64px); min-height: 440px; } }

/* ---------- Pro locks ---------- */
.lock-card { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 26px 18px; }
.lock-icon { width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--a1) 16%, transparent); color: var(--a-text); }
.lock-title { font-size: 21px; }
.lock-text { color: var(--t2); max-width: 520px; }
.lock-list { text-align: left; color: var(--t2); max-width: 520px; padding-left: 20px; margin: 0; font-size: 14px; }
.lock-list li { margin: 4px 0; }
.lock-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.lock-teaser { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border-style: dashed; color: var(--t1); }
.lock-teaser:hover { border-color: var(--a1); }
.lock-teaser-icon { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex: none; background: color-mix(in srgb, var(--a1) 14%, transparent); color: var(--a-text); }
.lock-teaser-text { min-width: 0; }
.lock-teaser-sub { display: block; color: var(--t2); font-size: 13.5px; margin-top: 2px; }
.more-locked { margin-top: 10px; }
.more-locked .lock-teaser { margin: 0; }
.older-note { display: flex; align-items: center; gap: 10px; width: 100%; min-height: var(--tap); margin: 8px 0; padding: 10px 12px; border-radius: var(--r); border: 1px dashed var(--border2); background: none; color: var(--t2); text-align: left; font-size: 13.5px; }
.older-note svg { color: var(--a-text); }
.older-note b { color: var(--t1); }

/* ---------- settings, data, about ---------- */
.set-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border); }
.card-head + .set-row { border-top: 0; }
.set-row > div:first-child { display: flex; flex-direction: column; flex: 1 1 200px; min-width: 0; }
.set-row .input { width: auto; flex: 1 1 180px; max-width: 280px; }
.set-row .seg { flex: 0 1 auto; }
.form-actions { display: flex; justify-content: flex-end; padding-top: 10px; }
.danger-card { border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
.about h3 { font-size: 16px; margin: 14px 0 6px; } .about h3:first-child { margin-top: 0; }
.about p, .howto { color: var(--t2); }
.howto { padding-left: 20px; margin: 0 0 8px; display: flex; flex-direction: column; gap: 4px; }
.about-links a { display: inline-flex; align-items: center; min-height: var(--tap); min-width: var(--tap); justify-content: center; padding: 0 2px; }

/* ---------- forms ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; border: 0; margin: 0; padding: 0; }
.field-lbl { font-size: 13px; font-weight: 700; color: var(--t2); }
.field-hint { font-size: 12.5px; color: var(--t3); }
.input { width: 100%; min-height: var(--tap); padding: 8px 12px; border-radius: var(--r-sm); border: 1px solid var(--field); background: var(--bg2); color: var(--t1); font-size: 15.5px; outline: none; min-width: 0; }
.input::placeholder, .search-box input::placeholder { color: var(--t3); opacity: 1; }
.input:focus { border-color: var(--a-text); box-shadow: 0 0 0 3px color-mix(in srgb, var(--a1) 22%, transparent); }
.textarea { resize: vertical; min-height: 72px; line-height: 1.5; }
select.input { appearance: none; -webkit-appearance: none; padding-right: 34px; background-image: linear-gradient(45deg, transparent 50%, var(--t2) 50%), linear-gradient(135deg, var(--t2) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
input[type="date"].input { min-width: 0; }
.form-2, .form-3 { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 520px) { .form-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .form-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 360px) and (max-width: 519px) { .form-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg-opt { position: relative; flex: 1 1 auto; min-width: var(--tap); }
.seg-opt input { position: absolute; opacity: 0; pointer-events: none; }
.seg-opt > span { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: var(--tap); padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--border2); background: var(--bg2); color: var(--t2); font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; }
.seg-opt input:checked + span { background: color-mix(in srgb, var(--a1) 20%, transparent); border-color: var(--a1); color: var(--t1); }
.seg-opt input:focus-visible + span { outline: 2px solid var(--a1); outline-offset: 2px; }
.seg-4 .seg-opt { flex: 1 1 calc(50% - 6px); } @media (min-width: 480px) { .seg-4 .seg-opt { flex-basis: 0; } }
.seg-3 .seg-opt { flex: 1 1 0; } .seg-3 .seg-opt > span { padding: 0 8px; }
.seg-stages .seg-opt { flex: 1 1 calc(50% - 6px); } .seg-stages .seg-opt > span { justify-content: flex-start; }
.seg-list { flex-direction: column; } .seg-list .seg-opt > span { justify-content: flex-start; white-space: normal; text-align: left; padding: 8px 12px; }
.seg-inline { flex-wrap: nowrap; } .seg-inline .seg-opt > span { padding: 0 10px; font-size: 13.5px; }
.seg-swatches .seg-opt { flex: 0 0 auto; }
.seg-swatches .seg-opt > span { width: var(--tap); padding: 0; }
.seg-view { flex-wrap: nowrap; }
.swatch { width: 22px; height: 22px; border-radius: 50%; display: inline-block; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: var(--tap); font-weight: 600; font-size: 14.5px; cursor: pointer; }
.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: var(--r-full); background: var(--surface2); border: 1px solid var(--border2); transition: background .15s; }
.switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--t2); transition: transform .15s, background .15s; }
.switch input:checked + i { background: var(--a1); border-color: var(--a1); }
.switch input:checked + i::after { transform: translateX(20px); background: var(--on-accent); }
.switch input:focus-visible + i { outline: 2px solid var(--a1); outline-offset: 2px; }
.dyn { display: flex; flex-direction: column; gap: 6px; }
.dyn:empty { display: none; }
.dyn-row { display: flex; align-items: center; gap: 6px; }
.dyn-row .input { flex: 1; }
.dyn-2 { flex-wrap: wrap; } .dyn-2 .input { flex: 1 1 130px; }
.pick { position: relative; display: inline-flex; align-items: center; gap: 10px; min-height: var(--tap); cursor: pointer; }
.pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pick > i { width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--field); display: inline-flex; align-items: center; justify-content: center; color: transparent; flex: none; }
.pick input:checked + i { background: var(--a1); border-color: var(--a1); color: var(--on-accent); }
.pick input:focus-visible + i { outline: 2px solid var(--a1); outline-offset: 2px; }
/* Unticked boxes show no mark (it was drawn in transparent). */
.pick input:not(:checked) + i svg { visibility: hidden; }
.pick-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--r-sm); padding: 2px 10px; }
.pick .ptag { font-size: 14.5px; color: var(--t1); }
.live-count { margin: -6px 0 0; font-family: var(--mono); }
.link-list { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.link-list a { display: inline-flex; align-items: center; gap: 8px; min-height: var(--tap); overflow-wrap: anywhere; }

/* ---------- sheets, confirm, toasts ---------- */
body.modal-open { overflow: hidden; }
.modal-overlay, .confirm-overlay { position: fixed; inset: 0; z-index: 200; background: var(--overlay); display: none; align-items: flex-end; justify-content: center; }
.modal-overlay.open, .confirm-overlay.open { display: flex; }
.confirm-overlay { z-index: 260; align-items: center; padding: 16px; }
.sheet { width: 100%; max-height: 100%; height: 100%; background: var(--bg2); display: flex; flex-direction: column; animation: sheet-in .2s ease; }
.sheet-small { height: auto; max-height: 85vh; border-radius: 20px 20px 0 0; }
@keyframes sheet-in { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-head { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 18px; padding-top: max(8px, env(safe-area-inset-top)); border-bottom: 1px solid var(--border); }
.sheet-small .sheet-head { padding-top: 8px; }
.sheet-head h3 { flex: 1; min-width: 0; font-size: 18px; overflow-wrap: anywhere; }
.sheet-body { flex: 1; overflow-y: auto; padding: 16px 18px 24px; overscroll-behavior: contain; }
.sheet-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 10px 14px; padding-bottom: max(10px, var(--safe-b)); border-top: 1px solid var(--border); background: var(--bg2); }
.foot-right { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
@media (min-width: 700px) {
  .modal-overlay { align-items: center; padding: 24px; }
  .sheet { height: auto; max-height: min(88vh, 900px); max-width: 620px; border-radius: 20px; border: 1px solid var(--border2); box-shadow: var(--shadow-2); }
  .sheet-wide { max-width: 780px; }
  .sheet-small { max-width: 460px; border-radius: 20px; }
}
.action-list { display: flex; flex-direction: column; gap: 4px; }
.action-item { display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 0 12px; border-radius: var(--r-sm); border: 0; background: none; text-align: left; color: var(--t1); font-weight: 600; font-size: 15px; }
.action-item:hover { background: var(--hover); }
.action-item svg { color: var(--a-text); }
.action-item.danger, .action-item.danger svg { color: var(--bad-t); }
.confirm-box { width: 100%; max-width: 420px; background: var(--bg2); border: 1px solid var(--border2); border-radius: 20px; padding: 20px; }
.confirm-box h3 { font-size: 18px; margin-bottom: 6px; }
.confirm-box p { color: var(--t2); overflow-wrap: anywhere; }
.confirm-box .row { background: none; border: 0; justify-content: flex-end; gap: 8px; padding: 8px 0 0; min-height: 0; flex-wrap: wrap; }
.toast-stack { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--bar-h) + 14px + var(--safe-b)); z-index: 300; display: flex; flex-direction: column; gap: 8px; width: min(440px, calc(100vw - 24px)); pointer-events: none; }
@media (min-width: 1024px) { .toast-stack { bottom: 24px; } }
.toast { padding: 12px 16px; border-radius: var(--r); background: var(--surface2); border: 1px solid var(--border2); color: var(--t1); font-size: 14.5px; box-shadow: var(--shadow-2); animation: toast-in .2s ease; overflow-wrap: anywhere; }
.toast-good { border-color: color-mix(in srgb, var(--good) 55%, transparent); }
.toast-err { border-color: color-mix(in srgb, var(--bad) 60%, transparent); }
.toast.leaving { opacity: 0; transform: translateY(6px); transition: opacity .25s, transform .25s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- first run ---------- */
.onboarding { position: fixed; inset: 0; z-index: 350; background: var(--glow, none), var(--bg); overflow-y: auto; display: flex; justify-content: center; padding: 24px 16px; }
.ob-card { width: 100%; max-width: 460px; margin: auto; display: flex; flex-direction: column; gap: 14px; }
.ob-mark { color: var(--a-text); align-self: center; }
.ob-card h1 { text-align: center; font-size: 30px; letter-spacing: .02em; }
.ob-sub { text-align: center; margin: -10px 0 0; color: var(--a-text); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: 12.5px; }
.ob-desc { text-align: center; color: var(--t2); }
.ob-demo { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: var(--r); border: 1px solid var(--border2); background: var(--surface); cursor: pointer; }
.ob-demo input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--a1); flex: none; }
.ob-signin, .ob-brand { text-align: center; font-size: 13.5px; color: var(--t2); margin: 0; }
.ob-signin .link { min-height: var(--tap); }

/* ---------- printing the analytics report ---------- */
@media print {
  body { background: #fff; color: #000; }
  .sidebar, .topbar, .bottom-nav, .toast-stack, .page-actions, .modal-overlay, .confirm-overlay, .loader { display: none !important; }
  main { padding: 0; }
  .card, .stat { border-color: #ccc; background: #fff; break-inside: avoid; }
}
