/* ==========================================================================
   APEX PROTOCOL — css/apex.css
   The original's look (deep navy, cyan glow, Orbitron headings, the hero
   class colour as the accent), on the Zyentora frame: a sidebar on wide
   screens, a bottom bar and slide-in menu on phones, Pro markers and
   locked cards, VEGA's insights, Refer & Earn and the first-run screen.
   Readability fixes: the original's 6–9px labels are 11px and up here, and
   every tap target is at least 36px.
   ========================================================================== */
/* Release B (2026-10-21): light by default with a Dark mode switch (shared/zy-theme.js),
   on the calm --c-* tokens (shared/zy-theme.css). Apex keeps its neon accents (cyan,
   gold, green, purple, red) and the hero class colour (--hero, set by main.js) as
   fills, bars and borders; as text each has a "-t" colour that passes WCAG AA on the
   theme's surfaces (--hero-t, and --cc-t / --rc-t / --lv-t from AX.Util.ink).
   No neon glows on light. */
:root {
  --hero: #00A8FF;
  --font-display: 'Orbitron', system-ui, sans-serif;
  --font-alt: 'Rajdhani', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --r: 12px;
  --sidebar-w: 236px; --topbar-h: 60px; --bottom-h: 64px;
}
html[data-theme="light"] {
  --bg0: var(--c-bg); --bg1: var(--c-surface); --bg2: var(--c-surface); --bg3: var(--c-surface2); --side: var(--c-side); --hover: var(--c-hover);
  --t1: var(--c-t1); --t2: var(--c-t2); --t3: var(--c-t3);
  --border: var(--c-border); --border-c: rgba(0, 110, 140, 0.18); --field: var(--c-field);
  --cyan: #00B8E6; --cyan-soft: rgba(0, 170, 220, 0.10); --cyan-t: #00687E;
  --gold: #FFB800; --gold-soft: rgba(255, 184, 0, 0.16); --gold-t: #7A5700;
  --green: #00C46E; --green-soft: rgba(0, 196, 110, 0.12); --green-t: #006B3C;
  --purple: #9C6BFF; --purple-soft: rgba(156, 107, 255, 0.12); --purple-t: #6A47B5;
  --red: #E8304F; --red-soft: rgba(232, 48, 79, 0.10); --red-t: #B4233C;
  --hero-t: #00689E;
  --overlay: var(--c-overlay); --scrim: rgba(24, 18, 40, 0.35); --shadow-pop: var(--c-shadow-2); --shadow-card: var(--c-shadow-1);
  --topbar-bg: rgba(246, 245, 249, 0.9); --bar-bg: rgba(251, 250, 253, 0.97);
  --avatar-base: var(--c-surface2);
  --page-wash: radial-gradient(900px 500px at 80% -10%, rgba(0, 170, 220, 0.06), transparent 60%);
  --logo-grad: linear-gradient(135deg, #00687E, #6A47B5, #00687E);
  color-scheme: light;
}
html[data-theme="dark"] {
  --bg0: var(--c-bg); --bg1: var(--c-surface); --bg2: var(--c-surface); --bg3: var(--c-surface2); --side: var(--c-side); --hover: var(--c-hover);
  --t1: var(--c-t1); --t2: var(--c-t2); --t3: var(--c-t3);
  --border: var(--c-border); --border-c: rgba(0, 212, 255, 0.18); --field: var(--c-field);
  --cyan: #00D4FF; --cyan-soft: rgba(0, 212, 255, 0.1); --cyan-t: #00D4FF;
  --gold: #FFB800; --gold-soft: rgba(255, 184, 0, 0.12); --gold-t: #FFB800;
  --green: #00E883; --green-soft: rgba(0, 232, 131, 0.12); --green-t: #00E883;
  --purple: #9C6BFF; --purple-soft: rgba(156, 107, 255, 0.14); --purple-t: #B595FF;
  --red: #FF3860; --red-soft: rgba(255, 56, 96, 0.12); --red-t: #FF8A9C;
  --hero-t: #00A8FF;
  --overlay: var(--c-overlay); --scrim: rgba(6, 4, 12, 0.6); --shadow-pop: var(--c-shadow-2); --shadow-card: var(--c-shadow-1);
  --topbar-bg: rgba(21, 19, 28, 0.9); --bar-bg: rgba(24, 22, 31, 0.97);
  --avatar-base: rgba(0, 0, 0, 0.45);
  --page-wash: radial-gradient(900px 500px at 80% -10%, rgba(0, 212, 255, 0.07), transparent 60%);
  --logo-grad: linear-gradient(135deg, #00D4FF, #9C6BFF, #00D4FF);
  color-scheme: dark;
}
/* the shared frame (zy-panel, zy-ask, the Dark mode switch) in Apex's colours, following the theme */
html {
  --zy-bg: var(--bg1); --zy-surface: var(--bg3); --zy-border: var(--border-c);
  --zy-text: var(--t1); --zy-muted: var(--t2); --zy-accent: var(--cyan); --zy-accent-ink: var(--cyan-t); --zy-accent-text: #001018;
  --zy-ok: var(--green); --zy-warn: var(--gold); --zy-danger: var(--red); --zy-font: var(--font-body);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; }
body { margin: 0; color: var(--t1); font-family: var(--font-body); min-height: 100vh; overflow-x: hidden; background: var(--page-wash), var(--bg0); }
body.modal-open { overflow: hidden; }
h1, h2, h3, h4, p { margin: 0; }
button { font: inherit; color: inherit; }
a { color: inherit; }
input { font: inherit; }
.muted { color: var(--t2); }
.small { font-size: 12px; }
.link { background: none; border: 0; padding: 0; color: var(--cyan-t); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; font-size: inherit; }
:focus-visible { outline: 2px solid var(--cyan-t); outline-offset: 2px; }
#stars { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
body.no-fx #stars { display: none; }
html[data-theme="light"] #stars { display: none; } /* the star field is for the night sky */
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes shine { to { background-position: 200% center; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes floatUp { 0% { opacity: 1; transform: translateX(-50%) translateY(0); } 100% { opacity: 0; transform: translateX(-50%) translateY(-55px); } }
@keyframes bootbar { from { width: 0; } to { width: 100%; } }
/* Light: the calm system, so no neon glows on the page. */
html[data-theme="light"] .loader-logo, html[data-theme="light"] .xp-float { text-shadow: none; }
html[data-theme="light"] .xp-fill, html[data-theme="light"] .tc-check.done, html[data-theme="light"] .habit-check.done, html[data-theme="light"] .ob-step span.active { box-shadow: none; }
html[data-theme="light"] .id-avatar { box-shadow: 0 0 0 6px color-mix(in srgb, var(--cc) 12%, transparent); }
html[data-theme="light"] .ach-popup { box-shadow: var(--shadow-pop); }
html[data-theme="light"] .ob-hex { filter: none; }

/* ---------- loader ---------- */
.loader { position: fixed; inset: 0; background: var(--bg0); z-index: 500; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; transition: opacity 0.4s, visibility 0.4s; }
.loader.hide { opacity: 0; visibility: hidden; }
.loader-logo { font-family: var(--font-display); font-weight: 900; font-size: 14px; letter-spacing: 7px; color: var(--cyan-t); text-shadow: 0 0 30px rgba(0, 212, 255, 0.4); }
.loader-sub { font-family: var(--font-display); font-size: 11px; letter-spacing: 3px; color: var(--t3); margin-bottom: 18px; }
.loader-track { width: 240px; height: 2px; background: var(--bg2); border-radius: 1px; overflow: hidden; }
.loader-bar { height: 100%; background: linear-gradient(90deg, var(--cyan), var(--purple)); animation: bootbar 1.4s cubic-bezier(.4, 0, .2, 1) forwards; }

/* ---------- layout ---------- */
.app { display: flex; min-height: 100vh; position: relative; z-index: 1; }
.sidebar { width: var(--sidebar-w); flex: none; background: var(--side); border-right: 1px solid var(--border-c); display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; z-index: 60; transition: transform 0.25s ease; }
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 16px; border-bottom: 1px solid var(--border-c); }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 20px; color: var(--cyan-t); background: var(--cyan-soft); border: 1px solid var(--border-c); }
.brand-name { font-family: var(--font-display); font-weight: 900; font-size: 15px; letter-spacing: 5px; color: var(--cyan-t); }
.brand-sub { font-size: 11px; color: var(--t3); margin-top: 2px; }
.sidebar-close { display: none; margin-left: auto; background: none; border: 0; color: var(--t2); width: 36px; height: 36px; border-radius: 8px; cursor: pointer; align-items: center; justify-content: center; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 10px; }
.nav-item { display: flex; width: 100%; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 9px; color: var(--t2); font-size: 13.5px; font-weight: 500; cursor: pointer; margin-bottom: 2px; border: 1px solid transparent; background: none; text-align: left; transition: background 0.15s, color 0.15s; }
.nav-item:hover { background: var(--hover); color: var(--t1); }
.nav-item.active { background: var(--cyan-soft); color: var(--t1); border-color: var(--border-c); }
.nav-item.active svg { color: var(--hero-t); }
.nav-spark svg, .bn-spark svg { color: var(--cyan-t); }
.nav-pro, .pro-badge { margin-left: auto; padding: 2px 6px; border-radius: 100px; background: var(--gold-soft); color: var(--gold-t); font-size: 11px; font-weight: 700; letter-spacing: 0.06em; font-family: var(--font-body); white-space: nowrap; }
.pro-badge { margin-left: 6px; display: inline-block; vertical-align: middle; }
.nav-divider { height: 1px; background: var(--border); margin: 10px 8px; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--t3); padding: 8px 12px 6px; }
.sidebar-footer { padding: 14px 18px 18px; border-top: 1px solid var(--border-c); font-size: 12px; color: var(--t3); display: grid; gap: 6px; }
.sidebar-footer a { text-decoration: underline; text-underline-offset: 2px; }
.scrim { display: none; }
.main { margin-left: var(--sidebar-w); flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: var(--topbar-h); flex: none; display: flex; align-items: center; gap: 12px; padding: 0 24px; border-bottom: 1px solid var(--border-c); position: sticky; top: 0; background: var(--topbar-bg); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); z-index: 30; }
.topbar h1 { font-family: var(--font-display); font-size: 14px; letter-spacing: 3px; text-transform: uppercase; color: var(--t1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.menu-btn { display: none; width: 38px; height: 38px; border-radius: 9px; border: 1px solid var(--border-c); background: var(--bg2); color: var(--t1); align-items: center; justify-content: center; cursor: pointer; flex: none; }
.vega-line { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; justify-content: center; font-size: 12px; color: var(--t2); font-style: italic; overflow: hidden; }
.vega-line #vegaLine { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vega-dot { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-style: normal; font-size: 11px; color: var(--cyan-t); border: 1px solid var(--cyan); background: var(--cyan-soft); animation: pulse 3s ease-in-out infinite; flex: none; }
.topbar-actions { display: flex; align-items: center; gap: 10px; flex: none; margin-left: auto; }
.topbar-actions .zy-chip { min-height: 36px; }
.hero-badge { display: flex; align-items: center; gap: 8px; background: none; border: 0; cursor: pointer; padding: 0; min-height: 36px; }
.hb-text { display: flex; flex-direction: column; align-items: flex-end; min-width: 0; }
.hb-name { font-family: var(--font-display); font-size: 11px; letter-spacing: 2px; color: var(--hero-t); max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-class { font-size: 11px; color: var(--t3); }
.hb-level { font-family: var(--font-display); font-size: 11px; font-weight: 700; color: #000; background: var(--hero); padding: 5px 8px; border-radius: 6px; white-space: nowrap; }
.page { padding: 24px 24px 80px; max-width: 980px; width: 100%; margin: 0 auto; display: none; }
.page.active { display: block; animation: fadeUp 0.3s ease; }
.bottom-nav { display: none; }

/* ---------- type, cards, buttons ---------- */
.eyebrow { font-family: var(--font-display); font-size: 11px; letter-spacing: 3px; text-transform: uppercase; color: var(--t3); margin-bottom: 4px; }
.section-title { font-family: var(--font-alt); font-size: 24px; font-weight: 700; color: var(--t1); margin-bottom: 2px; overflow-wrap: anywhere; }
.section-sub { font-size: 13px; color: var(--t2); margin-bottom: 16px; }
.page-lede { color: var(--t2); font-size: 13px; line-height: 1.6; margin: -6px 0 16px; max-width: 70ch; }
.mini-label { display: flex; align-items: center; gap: 6px; font-family: var(--font-display); font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--t3); margin-bottom: 10px; }
.mini-label svg { color: var(--cyan-t); }
.card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--c-r-lg); box-shadow: var(--shadow-card); padding: 16px 18px; position: relative; margin-bottom: 14px; }
.card-c { border-color: var(--border-c); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 10px; border: 1px solid var(--border-c); background: var(--bg3); color: var(--t1); font-family: var(--font-alt); font-size: 14px; font-weight: 700; letter-spacing: 0.5px; cursor: pointer; min-height: 40px; text-decoration: none; transition: transform 0.12s, filter 0.15s, border-color 0.15s; }
.btn:hover { border-color: var(--hero); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(135deg, var(--cyan), #1A8CFF); border-color: transparent; color: #001018; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--t2); }
.btn-danger { background: var(--red-soft); border-color: color-mix(in srgb, var(--red) 40%, transparent); color: var(--red-t); }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 8px; min-height: 36px; }
.btn-block { width: 100%; margin-top: 10px; }
.empty-state { text-align: center; padding: 30px 16px; color: var(--t2); font-size: 13.5px; line-height: 1.7; }
.empty-icon { font-size: 30px; display: block; margin-bottom: 8px; opacity: 0.5; }
.empty-small { font-size: 13px; color: var(--t3); text-align: center; padding: 10px 0; }

/* ---------- stats, XP ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.stats-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--r); padding: 12px 10px; text-align: center; min-width: 0; }
.stat-val { font-family: var(--font-display); font-size: 20px; font-weight: 700; overflow-wrap: anywhere; }
.stat-val .flame { font-size: 14px; margin-left: 2px; }
.stat-lbl { font-size: 11px; color: var(--t3); margin-top: 4px; letter-spacing: 0.5px; text-transform: uppercase; }
.stat-sub { font-size: 11px; color: var(--cyan-t); margin-top: 3px; }
.c-hero { color: var(--hero-t); } .c-gold { color: var(--gold-t); } .c-green { color: var(--green-t); } .c-purple { color: var(--purple-t); }
.xp-bar-wrap { background: var(--bg2); border: 1px solid var(--border-c); border-radius: var(--r); padding: 12px 16px; margin-bottom: 14px; }
.xp-labels { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 7px; }
.xp-rank, .xp-count { font-family: var(--font-display); font-size: 11px; letter-spacing: 1.5px; color: var(--t2); }
.xp-count { color: var(--hero-t); }
.xp-track { height: 7px; background: var(--bg3); border-radius: 4px; overflow: hidden; }
.xp-track.big { height: 10px; margin-top: 10px; }
.xp-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--hero), var(--purple)); box-shadow: 0 0 10px var(--hero); transition: width 0.8s ease; }
.xp-fill.gold { background: linear-gradient(90deg, var(--gold), var(--purple)); }
.xp-next { font-size: 12px; color: var(--t3); margin-top: 6px; text-align: right; }
.daily-xp { background: linear-gradient(135deg, rgba(0, 212, 255, 0.05), rgba(156, 107, 255, 0.04)), var(--bg2); }
.dx-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 8px; }
.dx-row .mini-label { margin-bottom: 2px; }
.dx-note { font-size: 12px; color: var(--t3); }
.dx-val { font-family: var(--font-display); font-size: 18px; font-weight: 700; color: var(--hero-t); white-space: nowrap; }
.dx-val span { font-size: 11px; color: var(--t3); font-weight: 400; }
.dx-val.full { color: var(--gold-t); }
.dx-track { height: 8px; background: var(--bg3); border-radius: 4px; overflow: hidden; margin-bottom: 7px; }
.dx-fill { height: 100%; background: linear-gradient(90deg, var(--hero), var(--green)); border-radius: 4px; transition: width 0.8s ease; }
.dx-fill.full { background: linear-gradient(90deg, var(--gold), var(--red)); }
.dx-foot { font-size: 12px; color: var(--t3); }
.dx-foot.full { color: var(--gold-t); }

/* ---------- VEGA (insights) ---------- */
.vega-card { border-color: color-mix(in srgb, var(--cyan) 35%, transparent); background: linear-gradient(135deg, rgba(0, 212, 255, 0.08), rgba(0, 212, 255, 0.02)), var(--bg2); }
.vega-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.vega-head .mini-label { margin-bottom: 2px; color: var(--cyan-t); }
.vega-sub { font-size: 12px; color: var(--t3); }
.vega-orb { width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--cyan-t); border: 1px solid var(--cyan); background: var(--cyan-soft); position: relative; flex: none; }
.vega-orb::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 1px solid rgba(0, 212, 255, 0.2); border-top-color: transparent; animation: spin 8s linear infinite; }
.vega-msg { font-size: 14px; color: var(--t1); line-height: 1.5; padding: 8px 0; font-style: italic; }
.vega-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.insight-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.insight-item:last-child { border-bottom: none; }
.insight-item .ic { width: 32px; height: 32px; border-radius: 9px; flex: none; display: flex; align-items: center; justify-content: center; background: var(--cyan-soft); color: var(--cyan-t); }
.insight-good .ic { background: var(--green-soft); color: var(--green-t); }
.insight-warn .ic { background: var(--gold-soft); color: var(--gold-t); }
.insight-item .tx { min-width: 0; }
.insight-item .h { font-size: 14px; font-weight: 600; margin-bottom: 3px; line-height: 1.4; overflow-wrap: anywhere; }
.insight-item .d { font-size: 13px; color: var(--t2); line-height: 1.55; overflow-wrap: anywhere; }
.insight-item .tip { font-size: 12.5px; color: var(--cyan-t); line-height: 1.5; margin-top: 5px; }
.more-locked { margin-top: 10px; }
.ask-teaser { display: grid; gap: 10px; }
.ask-samples { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ask-samples .zy-ask-q { background: var(--bg3); }
.ask-card { padding: 14px; display: flex; flex-direction: column; height: calc(100vh - var(--topbar-h) - 150px); height: calc(100dvh - var(--topbar-h) - 150px); min-height: 440px; }

/* ---------- missions and training ---------- */
.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.dash-grid .card { margin-bottom: 0; }
.dash-grid + .card { margin-top: 14px; }
.recent-ach { display: flex; gap: 10px; flex-wrap: wrap; font-size: 24px; }
.quota-note { margin-bottom: 14px; padding: 9px 12px; border-radius: 9px; background: var(--gold-soft); color: var(--t2); font-size: 13px; line-height: 1.5; }
.quota-note b { color: var(--t1); }
.add-form { background: var(--bg2); border: 1px solid var(--border-c); border-radius: var(--r); padding: 14px; margin-bottom: 14px; }
.add-form .mini-label { color: var(--hero-t); }
.form-row { display: flex; gap: 8px; flex-wrap: wrap; }
.form-input { flex: 1 1 200px; min-width: 0; background: var(--bg3); border: 1.5px solid var(--field); border-radius: 9px; padding: 10px 13px; font-size: 15px; color: var(--t1); outline: none; min-height: 42px; }
.form-input:focus { border-color: var(--hero); }
.form-input::placeholder { color: var(--t3); opacity: 1; }
.form-input.small { flex: 1 1 140px; max-width: 220px; }
.prio-wrap { display: flex; flex-wrap: wrap; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; }
.prio-btn { font-family: var(--font-alt); font-size: 13.5px; font-weight: 700; padding: 8px 11px; border: none; background: transparent; color: var(--t3); cursor: pointer; min-height: 40px; }
.prio-btn.active { background: var(--cyan-soft); color: var(--hero-t); }
.prio-btn .pro-badge { margin-left: 4px; }
.tip-box { background: rgba(0, 212, 255, 0.04); border: 1px solid var(--border-c); border-radius: var(--r); padding: 10px 14px; margin-bottom: 14px; font-size: 13px; color: var(--t2); }
.tip-box summary { cursor: pointer; color: var(--cyan-t); font-weight: 600; min-height: 24px; }
.tip-box ul { margin: 10px 0 2px; padding-left: 18px; display: grid; gap: 6px; line-height: 1.5; }
.list-label { font-family: var(--font-display); font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--t3); margin: 16px 0 8px; }
.todo-list { display: flex; flex-direction: column; gap: 8px; }
.todo-card, .habit-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--r); padding: 10px 12px; display: flex; align-items: center; gap: 10px; position: relative; overflow: hidden; }
.card .todo-card, .card .habit-card { background: transparent; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; padding: 8px 0; }
.todo-card.prio::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--gold); }
.card .todo-card.prio::before { display: none; }
.todo-card.done-card .tc-title, .habit-title.done-t { text-decoration: line-through; color: var(--t3); }
.locked-card .tc-title, .locked-card .habit-title { color: var(--t2); } /* resting (a Pro mission on Free): muted, its tags still readable */
.locked-card .tc-check, .locked-card .habit-check { opacity: 0.8; }
.tc-check, .habit-check { width: 36px; height: 36px; flex: none; border-radius: 50%; border: 2px solid var(--field); background: transparent; cursor: pointer; display: flex; align-items: center; justify-content: center; color: transparent; transition: background 0.15s, border-color 0.15s; }
.habit-check { border-radius: 9px; }
.tc-check:hover, .habit-check:hover { border-color: var(--green); background: var(--green-soft); }
.tc-check.done, .habit-check.done { background: var(--green); border-color: var(--green); color: #001a0e; box-shadow: 0 0 12px rgba(0, 232, 131, 0.25); }
.tc-check.locked, .habit-check.locked { color: var(--gold-t); border-color: color-mix(in srgb, var(--gold) 50%, transparent); }
.tc-check.locked svg, .habit-check.locked svg { width: 15px; height: 15px; }
.tc-body, .habit-body { flex: 1; min-width: 0; }
.tc-meta, .habit-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 3px; font-size: 11.5px; }
.tc-title, .habit-title { font-size: 14.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.habit-meta { margin: 3px 0 0; }
.prio-tag, .daily-tag, .xp-tag, .done-tag, .rest-tag { padding: 2px 7px; border-radius: 5px; font-weight: 700; letter-spacing: 0.3px; white-space: nowrap; }
.prio-tag { background: var(--gold-soft); color: var(--gold-t); }
.daily-tag { background: var(--cyan-soft); color: var(--cyan-t); }
.xp-tag { background: var(--cyan-soft); color: var(--hero-t); }
.done-tag { color: var(--green-t); padding-left: 0; }
.rest-tag { background: var(--gold-soft); color: var(--gold-t); }
.habit-streak { color: var(--t3); } .habit-streak b { color: var(--gold-t); }
.habit-xp { color: var(--hero-t); font-weight: 600; }
.habit-rate { color: var(--purple-t); font-weight: 600; }
.del-btn { width: 36px; height: 36px; flex: none; display: flex; align-items: center; justify-content: center; background: var(--red-soft); border: 1px solid color-mix(in srgb, var(--red) 30%, transparent); color: var(--red-t); border-radius: 8px; cursor: pointer; }
.del-btn:hover { background: var(--red); color: #fff; }
.done-earlier { margin-top: 16px; }
.done-earlier summary { cursor: pointer; font-family: var(--font-display); font-size: 11px; letter-spacing: 1.5px; color: var(--t3); padding: 8px 0; min-height: 36px; }
.progress-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.progress-row .mini-label { margin: 0; }
.progress-count { font-family: var(--font-display); font-size: 12px; color: var(--green-t); }
.progress-track { height: 7px; background: var(--bg3); border-radius: 4px; overflow: hidden; margin-bottom: 14px; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--green), var(--cyan)); border-radius: 4px; transition: width 0.5s; }
#habitList { display: flex; flex-direction: column; gap: 8px; }
.teaser-wrap { margin-top: 14px; }

/* ---------- Pro locks ---------- */
.lock-card { max-width: 560px; margin: 8px auto 0; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 26px 20px; }
.lock-icon { width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--gold-soft); color: var(--gold-t); }
.lock-card .pro-badge { margin: 0; }
.lock-title { font-family: var(--font-alt); font-size: 22px; }
.lock-text { font-size: 14px; color: var(--t2); line-height: 1.6; max-width: 46ch; }
.lock-list { text-align: left; display: grid; gap: 8px; margin: 4px 0; padding: 0; list-style: none; font-size: 13px; color: var(--t2); }
.lock-list li { position: relative; padding-left: 22px; line-height: 1.45; }
.lock-list li::before { content: '✓'; position: absolute; left: 0; color: var(--green-t); font-weight: 700; }
.lock-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.lock-teaser { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; cursor: pointer; color: var(--t1); margin-bottom: 0; }
.lock-teaser:hover { border-color: color-mix(in srgb, var(--gold) 50%, transparent); }
.lock-teaser-icon { width: 38px; height: 38px; flex: none; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--gold-soft); color: var(--gold-t); }
.lock-teaser-icon svg { width: 17px; height: 17px; }
.lock-teaser-text { min-width: 0; font-size: 14px; line-height: 1.45; }
.lock-teaser-sub { display: block; font-size: 12.5px; color: var(--t2); margin-top: 3px; }

/* ---------- profile ---------- */
.id-card { text-align: center; padding: 26px 16px 20px; background: radial-gradient(ellipse at top, color-mix(in srgb, var(--cc) 14%, transparent), transparent 65%), var(--bg2); border-color: color-mix(in srgb, var(--cc) 25%, transparent); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.id-avatar { width: 110px; height: 110px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 48px; border: 2px solid var(--cc); box-shadow: 0 0 35px color-mix(in srgb, var(--cc) 35%, transparent); margin-bottom: 8px; background: radial-gradient(circle at 40% 35%, color-mix(in srgb, var(--cc) 18%, transparent), var(--avatar-base)); }
.id-name { font-family: var(--font-display); font-size: 20px; font-weight: 900; letter-spacing: 3px; color: var(--cc-t, var(--cc)); overflow-wrap: anywhere; }
.id-title { font-size: 13px; color: var(--t2); font-style: italic; }
.id-pills { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 10px; background: var(--hover); border: 1px solid var(--border-c); border-radius: 22px; padding: 6px 16px; font-size: 12.5px; font-weight: 700; margin: 6px 0 8px; }
.rank-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.rank-row .mini-label { margin-bottom: 2px; }
.rank-xp { font-family: var(--font-display); font-size: 17px; font-weight: 700; color: var(--gold-t); text-align: right; }
.rank-xp span { font-size: 11px; color: var(--t3); font-weight: 400; }
.power-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.power-lbl { font-size: 13px; color: var(--t2); width: 110px; flex: none; }
.power-track { flex: 1; height: 7px; background: var(--bg3); border-radius: 4px; overflow: hidden; }
.power-fill { height: 100%; border-radius: 4px; transition: width 0.9s ease; }
.power-pct { font-family: var(--font-display); font-size: 11px; color: var(--t2); width: 40px; text-align: right; }
.ability { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-left: 3px solid var(--hero); background: linear-gradient(90deg, var(--cyan-soft), transparent); border-radius: 8px; margin-bottom: 8px; }
.ab-num { font-family: var(--font-display); font-weight: 900; color: var(--hero-t); min-width: 22px; }
.ab-name { font-size: 14px; font-weight: 600; }
.title-list { display: flex; flex-wrap: wrap; gap: 8px; }
.title-chip { border: 1px solid color-mix(in srgb, var(--hero) 45%, transparent); background: var(--cyan-soft); color: var(--hero-t); border-radius: 20px; padding: 6px 12px; font-size: 12.5px; font-weight: 700; }
.title-chip.off { border-color: var(--border-c); background: transparent; color: var(--t3); }
.locked-label { margin-top: 14px; }
.class-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 14px 0; }
.class-card { background: var(--bg2); border: 1.5px solid var(--border); border-radius: var(--r); padding: 14px 8px; cursor: pointer; text-align: center; position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; color: var(--t1); }
.class-card:hover, .class-card.selected { border-color: var(--cc); background: var(--hover); }
.class-card.selected { box-shadow: 0 0 0 1px var(--cc) inset; }
.class-card.locked { border-style: dashed; } /* a Pro class on Free: the PRO badge and a dashed edge, its name still readable */
.class-card.locked .cc-icon { filter: grayscale(0.7); }
.cc-icon { font-size: 26px; }
.cc-name { font-family: var(--font-display); font-size: 11px; letter-spacing: 1px; color: var(--cc-t, var(--cc)); }
.cc-title { font-family: var(--font-alt); font-size: 13.5px; font-weight: 600; }
.cc-powers { font-size: 11px; color: var(--t3); line-height: 1.4; }
.class-pro { position: absolute; top: 6px; right: 6px; margin: 0; }

/* ---------- achievements ---------- */
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.ach-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--r); padding: 14px 10px; text-align: center; position: relative; overflow: hidden; }
.ach-card.earned { border-color: var(--rc); }
.ach-card.earned::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--rc); }
.ach-card.locked .ach-icon { filter: grayscale(1); opacity: 0.7; }
.ach-icon { font-size: 28px; display: block; margin-bottom: 6px; }
.ach-name { font-family: var(--font-display); font-size: 11px; letter-spacing: 1px; color: var(--rc-t, var(--rc)); margin-bottom: 4px; }
.ach-card.locked .ach-name { color: var(--t2); }
.ach-desc { font-size: 12px; color: var(--t3); line-height: 1.4; }
.ach-xp { font-family: var(--font-display); font-size: 11px; color: var(--gold-t); margin-top: 5px; }
.ach-mark { position: absolute; top: 6px; right: 8px; font-size: 12px; color: var(--green-t); }
.ach-on { font-size: 11px; color: var(--t3); margin-top: 4px; }
.ach-progress { height: 4px; background: var(--bg3); border-radius: 2px; overflow: hidden; margin-top: 8px; }
.ach-progress div { height: 100%; background: var(--t3); }
.tag { display: inline-block; font-family: var(--font-display); font-size: 11px; letter-spacing: 1px; padding: 2px 7px; border-radius: 4px; margin-top: 6px; }
.tag-common { background: var(--cyan-soft); color: var(--cyan-t); }
.tag-rare { background: var(--purple-soft); color: var(--purple-t); }
.tag-epic { background: var(--gold-soft); color: var(--gold-t); }
.tag-legendary { background: var(--red-soft); color: var(--red-t); }

/* ---------- activity log ---------- */
.cal-legend { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.cal-legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--t2); text-transform: capitalize; }
.cal-dot { width: 12px; height: 12px; border-radius: 3px; }
.cal-head, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.cal-head { margin-bottom: 6px; font-size: 11px; color: var(--t3); text-align: center; }
.cal-day { height: 30px; border-radius: 5px; cursor: pointer; position: relative; overflow: hidden; background: var(--bg3); border: 1px solid var(--border); padding: 0; }
.cal-day::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: var(--h); background: var(--lv); opacity: 0.9; }
.cal-day.today { outline: 1px solid var(--cyan); }
.cal-grid.year .cal-day { height: 16px; border-radius: 3px; }
.cal-foot { display: flex; justify-content: space-between; margin-top: 10px; font-size: 11px; color: var(--t3); }
.sum-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.sum-cell { text-align: center; padding: 10px 4px; background: var(--bg3); border-radius: 8px; border: 1px solid color-mix(in srgb, var(--lv) 25%, transparent); min-width: 0; }
.sum-cell b { display: block; font-size: 18px; color: var(--lv-t, var(--lv)); }
.sum-cell span { font-size: 11px; color: var(--t3); text-transform: capitalize; }
.day-card { border-color: color-mix(in srgb, var(--lv) 45%, transparent); }
.day-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.day-level { font-size: 12px; color: var(--lv-t, var(--lv)); text-transform: capitalize; }
.day-xp { margin-left: auto; font-family: var(--font-display); font-size: 12px; color: var(--gold-t); }
.day-stats { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--t2); }

/* ---------- settings, data, about ---------- */
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.setting-row:last-child { border-bottom: none; }
.setting-row .meta { min-width: 0; }
.setting-row .t { font-size: 14px; font-weight: 600; }
.setting-row .d { font-size: 12.5px; color: var(--t3); margin-top: 3px; max-width: 460px; line-height: 1.45; }
.setting-row > .btn { flex: none; }
.inline-form { display: flex; gap: 8px; flex: 0 1 auto; min-width: 0; }
.danger-card { border-color: color-mix(in srgb, var(--red) 30%, transparent); }
.toggle { position: relative; width: 46px; height: 28px; flex: none; display: inline-block; }
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle .track { position: absolute; inset: 0; background: var(--bg3); border: 1px solid var(--field); border-radius: 100px; transition: 0.2s; cursor: pointer; }
.toggle .track::before { content: ''; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: var(--t3); border-radius: 50%; transition: 0.2s; }
.toggle input:checked + .track { background: var(--cyan); border-color: var(--cyan); }
.toggle input:checked + .track::before { transform: translateX(18px); background: #001018; }
.toggle input:focus-visible + .track { outline: 2px solid var(--cyan-t); outline-offset: 2px; }
.about h3 { font-family: var(--font-alt); font-size: 17px; margin: 14px 0 6px; color: var(--hero-t); }
.about h3:first-child { margin-top: 0; }
.about p, .about li { font-size: 13.5px; color: var(--t2); line-height: 1.65; }
.about ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.about-links a { text-decoration: underline; text-underline-offset: 2px; color: var(--cyan-t); }

/* ---------- Refer & Earn ---------- */
.refer-banner { display: flex; align-items: stretch; margin-bottom: 14px; border: 1px solid var(--border-c); border-radius: var(--c-r-lg); background: var(--bg2); overflow: hidden; }
.refer-banner-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 0; background: none; color: var(--t1); font-size: 13.5px; text-align: left; cursor: pointer; }
.refer-icon { width: 30px; height: 30px; flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--green-soft); color: var(--green-t); }
.refer-banner-text { flex: 1; min-width: 0; line-height: 1.4; }
.refer-banner-x { width: 46px; flex: none; border: 0; border-left: 1px solid var(--border-c); background: none; color: var(--t3); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.refer-banner-main:hover, .refer-banner-x:hover { background: var(--hover); }

/* ---------- modal, confirm, toasts, banners ---------- */
.modal-overlay { position: fixed; inset: 0; background: var(--overlay); backdrop-filter: blur(4px); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 32px 16px; overflow-y: auto; opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal { background: var(--bg1); border: 1px solid var(--border-c); border-radius: 16px; width: 100%; max-width: 680px; box-shadow: var(--shadow-pop); }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border-c); }
.modal-head h3 { font-family: var(--font-alt); font-size: 19px; min-width: 0; }
.modal-head .close { margin-left: auto; background: none; border: none; color: var(--t3); cursor: pointer; width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex: none; }
.modal-body { padding: 18px 20px; }
.modal-body .class-grid { margin-bottom: 0; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border-c); flex-wrap: wrap; }
.confirm-overlay { position: fixed; inset: 0; background: var(--overlay); z-index: 150; display: flex; align-items: center; justify-content: center; padding: 16px; opacity: 0; pointer-events: none; transition: 0.2s; }
.confirm-overlay.open { opacity: 1; pointer-events: auto; }
.confirm-box { background: var(--bg2); border: 1px solid var(--border-c); border-radius: var(--c-r-lg); box-shadow: var(--shadow-pop); padding: 22px; max-width: 380px; width: 100%; text-align: center; }
.confirm-box h4 { margin-bottom: 8px; font-size: 16px; }
.confirm-box p { font-size: 13.5px; color: var(--t2); margin-bottom: 18px; line-height: 1.5; }
.confirm-box .row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.toast-stack { position: fixed; bottom: 24px; right: 20px; z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; max-width: calc(100vw - 32px); pointer-events: none; }
.toast { background: var(--bg1); border: 1px solid var(--border-c); color: var(--t1); padding: 10px 15px; border-radius: 10px; font-size: 13px; max-width: 320px; box-shadow: var(--shadow-pop); animation: fadeUp 0.25s ease; transition: opacity 0.25s, transform 0.25s; }
.toast.leaving { opacity: 0; transform: translateY(8px); }
.toast-gold { border-color: var(--gold); color: var(--gold-t); }
.toast-green { border-color: var(--green); color: var(--green-t); }
.toast-err { border-color: var(--red); color: var(--red-t); }
.ach-popup { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(160px); z-index: 310; background: var(--bg1); border: 1px solid var(--gold); border-radius: 14px; padding: 14px 18px; display: flex; align-items: center; gap: 12px; width: min(330px, calc(100vw - 32px)); box-shadow: 0 0 30px rgba(255, 184, 0, 0.18); visibility: hidden; transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), visibility 0.5s; }
.ach-popup.show { transform: translateX(-50%) translateY(0); visibility: visible; }
.ap-icon { font-size: 30px; }
.ap-body { min-width: 0; }
.ap-pre { font-family: var(--font-display); font-size: 11px; letter-spacing: 2px; color: var(--gold-t); text-transform: uppercase; }
.ap-name { font-family: var(--font-alt); font-size: 17px; font-weight: 700; }
.ap-desc { font-size: 12px; color: var(--t2); }
.ap-xp { font-family: var(--font-display); font-size: 11px; color: var(--gold-t); margin-top: 2px; }
.xp-float { position: fixed; left: 50%; top: 130px; z-index: 320; pointer-events: none; font-family: var(--font-display); font-size: 16px; font-weight: 700; color: var(--hero-t); text-shadow: 0 0 10px var(--hero); animation: floatUp 1.2s ease forwards; }

/* ---------- first run ---------- */
.onboarding { position: fixed; inset: 0; z-index: 400; background: var(--bg0); overflow-y: auto; transition: opacity 0.3s; }
.onboarding.leaving { opacity: 0; }
.ob-screen { display: none; flex-direction: column; align-items: center; justify-content: center; text-align: center; width: 100%; max-width: 760px; min-height: 100vh; padding: 28px 18px; margin: 0 auto; animation: fadeUp 0.4s ease; }
.ob-screen.active { display: flex; }
.ob-hex { font-size: 56px; color: var(--cyan-t); filter: drop-shadow(0 0 18px var(--cyan)); margin-bottom: 8px; }
.ob-logo { font-family: var(--font-display); font-size: clamp(22px, 5vw, 40px); font-weight: 900; letter-spacing: 6px; background: var(--logo-grad); background-size: 200%; -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; animation: shine 4s linear infinite; }
.ob-logo.small { font-size: clamp(16px, 3.5vw, 24px); }
.ob-sub { font-family: var(--font-alt); font-size: 14px; letter-spacing: 2px; color: var(--t2); margin-top: 6px; text-transform: uppercase; }
.ob-desc { font-size: 14px; color: var(--t2); margin: 18px 0 20px; line-height: 1.7; max-width: 480px; }
.ob-form { width: 100%; max-width: 360px; display: grid; gap: 12px; }
.ob-input { width: 100%; background: var(--bg2); border: 1px solid var(--field); border-radius: 10px; padding: 13px 18px; font-size: 16px; color: var(--t1); outline: none; text-align: center; letter-spacing: 2px; }
.ob-input:focus { border-color: var(--cyan); }
.ob-input::placeholder { color: var(--t3); opacity: 1; }
.ob-next { width: 100%; max-width: 360px; min-height: 46px; }
.ob-next:disabled { opacity: 0.35; cursor: not-allowed; }
.ob-step { display: flex; gap: 8px; margin-top: 22px; }
.ob-step span { width: 8px; height: 8px; border-radius: 50%; background: var(--t3); }
.ob-step span.active { background: var(--cyan-t); box-shadow: 0 0 8px var(--cyan); }
#obClasses { width: 100%; }
.ob-demo { display: flex; gap: 10px; align-items: flex-start; text-align: left; margin: 4px 0 16px; font-size: 13.5px; color: var(--t2); line-height: 1.5; cursor: pointer; max-width: 460px; }
.ob-demo input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--cyan-t); flex: none; }
.ob-signin { margin-top: 16px; font-size: 13.5px; color: var(--t2); }
.ob-brand { margin-top: 12px; font-size: 12.5px; color: var(--t3); }
.ob-brand a { text-decoration: underline; text-underline-offset: 2px; }

/* ---------- phones and small tablets ---------- */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); width: min(300px, 86vw); box-shadow: var(--shadow-pop); }
  .sidebar.open { transform: none; }
  .sidebar-close { display: inline-flex; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 55; background: var(--scrim); opacity: 0; pointer-events: none; transition: opacity 0.2s; }
  .scrim.open { opacity: 1; pointer-events: auto; }
  .main { margin-left: 0; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 0 12px; gap: 10px; padding-top: env(safe-area-inset-top); height: calc(var(--topbar-h) + env(safe-area-inset-top)); }
  .page { padding: 18px 14px calc(var(--bottom-h) + 40px + env(safe-area-inset-bottom)); }
  .bottom-nav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; height: calc(var(--bottom-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--bar-bg); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid var(--border-c); }
  .bn-item { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; background: none; border: 0; color: var(--t3); font-size: 11px; font-weight: 500; cursor: pointer; padding: 6px 2px; }
  .bn-item span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .bn-item.active { color: var(--t1); }
  .bn-item.active svg { color: var(--hero-t); }
  .toast-stack { bottom: calc(var(--bottom-h) + 14px + env(safe-area-inset-bottom)); right: 16px; }
  .ach-popup { bottom: calc(var(--bottom-h) + 14px + env(safe-area-inset-bottom)); }
  .ask-card { height: calc(100dvh - var(--topbar-h) - var(--bottom-h) - 128px - env(safe-area-inset-bottom)); min-height: 380px; }
  .vega-line { display: none; }
}
@media (max-width: 680px) {
  .class-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
  .sum-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .hb-text { display: none; }
  .topbar-actions .zy-chip { padding: 0 10px; }
  .card { padding: 14px; }
  .section-title { font-size: 21px; }
  .lock-actions .btn { width: 100%; }
  .form-row > .btn-primary { width: 100%; }
  .prio-wrap { width: 100%; }
  .prio-btn { flex: 1 1 auto; }
  .modal-overlay { padding: 0; display: block; }
  .modal { border-radius: 0; min-height: 100%; border: 0; }
  .setting-row { flex-wrap: wrap; }
  .inline-form { width: 100%; }
  .form-input.small { max-width: none; }
  .cal-grid.year { gap: 3px; }
  .cal-grid.year .cal-day { height: 12px; }
  .power-lbl { width: 90px; font-size: 12px; }
}
@media (max-width: 360px) {
  .topbar h1 { font-size: 12px; letter-spacing: 2px; }
  .stat-val { font-size: 17px; }
}
