@font-face { font-family: 'Manrope'; font-weight: 400; font-display: swap; src: url('assets/fonts/manrope-400.woff2') format('woff2'); }
@font-face { font-family: 'Manrope'; font-weight: 500; font-display: swap; src: url('assets/fonts/manrope-500.woff2') format('woff2'); }
@font-face { font-family: 'Manrope'; font-weight: 600; font-display: swap; src: url('assets/fonts/manrope-600.woff2') format('woff2'); }
@font-face { font-family: 'Manrope'; font-weight: 700; font-display: swap; src: url('assets/fonts/manrope-700.woff2') format('woff2'); }
@font-face { font-family: 'Unbounded'; font-weight: 500; font-display: swap; src: url('assets/fonts/unbounded-500.woff2') format('woff2'); }
@font-face { font-family: 'Unbounded'; font-weight: 600; font-display: swap; src: url('assets/fonts/unbounded-600.woff2') format('woff2'); }

:root {
  --deep-ink: #111522; --night-slate: #181E2D; --memory-surface: #222A3C;
  --violet: #8877E8; --violet-pressed: #7563D0; --violet-20: rgba(136, 119, 232, .2); --violet-12: rgba(136, 119, 232, .12);
  --blue: #69A8D8; --lavender: #B6AEE8; --amber: #E4AD68;
  --white: #F3F4F7; --mist: #A8B0C0; --faded: #70798C;
  --line: #30384A; --outline: #4E5870; --disabled-bg: #35394A; --disabled-text: #777F91;
  --display: 'Unbounded', 'Manrope', system-ui, sans-serif;
  --body: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--deep-ink); color: var(--white); }
body { font-family: var(--body); font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overflow: hidden; }
button, input, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, p { margin: 0; font-weight: inherit; }
img { display: block; }
.noscript { padding: 24px; }
:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }

#app { position: relative; height: 100vh; height: 100dvh; max-width: 640px; margin: 0 auto; overflow: hidden; background: var(--deep-ink); }
@media (min-width: 660px) { #app { border-left: 1px solid var(--line); border-right: 1px solid var(--line); } }
.screen { display: flex; flex-direction: column; height: 100%; padding-top: var(--safe-t); animation: screenIn .22s ease-out; }
@keyframes screenIn { from { opacity: .4; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding-bottom: var(--safe-b); }
.root .scroll { padding-bottom: 0; }
.tab-body { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }

/* Typography */
.t-display { font: 600 30px/1.15 var(--display); letter-spacing: -.5px; }
.t-hl { font: 600 28px/1.15 var(--display); letter-spacing: -.4px; }
.t-hm { font: 500 24px/1.25 var(--display); letter-spacing: -.3px; }
.t-hs { font: 500 20px/1.25 var(--display); letter-spacing: -.2px; }
.t-tl { font: 500 18px/1.25 var(--display); letter-spacing: -.1px; }
.t-brand { font: 600 22px/1.25 var(--display); }
.t-tm { font: 700 16px/1.4 var(--body); color: var(--white); }
.t-ts { font: 700 14px/1.4 var(--body); color: var(--white); }
.t-bl { font: 400 16px/1.5 var(--body); color: var(--white); }
.t-bm { font: 400 14px/1.45 var(--body); color: var(--mist); }
.t-bs { font: 500 13px/1.4 var(--body); color: var(--mist); }
.t-lm { font: 600 13px/1.4 var(--body); color: var(--mist); letter-spacing: .2px; }
.t-ls { font: 600 12px/1.4 var(--body); color: var(--mist); letter-spacing: .4px; }
.white { color: var(--white) !important; }
.blue { color: var(--blue); }
.blue-strong { color: var(--blue); font-weight: 700; }
.strong13 { color: var(--white); font-weight: 600; font-size: 13.5px; }
.center-text { text-align: center; }
.prewrap { white-space: pre-wrap; }
.clamp2, .clamp3 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.clamp2 { -webkit-line-clamp: 2; } .clamp3 { -webkit-line-clamp: 3; }
.ell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

/* Layout utils */
.row { display: flex; align-items: center; } .row.top { align-items: flex-start; } .row.center { align-items: center; }
.col { display: flex; flex-direction: column; } .center-items { align-items: center; }
.grow { flex: 1; min-width: 0; }
.wrap { display: flex; flex-wrap: wrap; align-items: center; }
.g4 { gap: 4px; } .g6 { gap: 6px; } .g8 { gap: 8px; } .g10 { gap: 10px; } .g12 { gap: 12px; } .g14 { gap: 14px; } .g16 { gap: 16px; } .g20 { gap: 20px; }
.wrap.g8 { gap: 8px; } .wrap.g10 { gap: 8px 10px; } .wrap.g12 { gap: 8px 12px; } .wrap.g14 { gap: 6px 14px; } .wrap.g16 { gap: 8px 16px; } .wrap.g6 { gap: 6px; }
.pad { padding-left: 16px; padding-right: 16px; padding-top: 8px; } .pad-x { padding-left: 16px; padding-right: 16px; }
.pt4 { padding-top: 4px; } .pb4 { padding-bottom: 4px; } .pb8 { padding-bottom: 8px; } .pb32 { padding-bottom: 32px; } .pb40 { padding-bottom: 40px; } .pb96 { padding-bottom: 96px; }
.mt2 { margin-top: 2px; } .mt4 { margin-top: 4px; } .mt6 { margin-top: 6px; } .mt8 { margin-top: 8px; } .mt10 { margin-top: 10px; } .mt12 { margin-top: 12px; } .mt14 { margin-top: 14px; } .mt16 { margin-top: 16px; } .mt20 { margin-top: 20px; } .mt24 { margin-top: 24px; }
.mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; } .mb16 { margin-bottom: 16px; } .mb20 { margin-bottom: 20px; }
.my16 { margin: 16px 0; }
.h8 { height: 8px; } .h10 { height: 10px; } .h12 { height: 12px; } .h16 { height: 16px; } .h20 { height: 20px; } .h24 { height: 24px; } .h28 { height: 28px; } .h32 { height: 32px; }
.center-row { display: flex; justify-content: center; }
.center-col { display: flex; align-items: center; justify-content: center; }
.divider { height: 1px; background: var(--line); }
.divider.inset { margin: 0 16px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ic { fill: currentColor; flex: none; display: block; }

/* App bar */
.appbar { display: flex; align-items: center; min-height: 64px; padding: 4px 4px 4px 4px; gap: 4px; background: var(--deep-ink); flex: none; }
.appbar-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 12px; color: var(--white); }
.icon-btn + .appbar-title { padding-left: 4px; }
.appbar-actions { display: flex; align-items: center; padding-right: 4px; }
.icon-btn { position: relative; width: 48px; height: 48px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: var(--white); transition: background .15s; }
.icon-btn:hover { background: var(--violet-12); }
.icon-btn:active { background: var(--violet-20); }
.badge-dot { position: absolute; top: 10px; right: 10px; width: 8px; height: 8px; border-radius: 4px; background: var(--amber); }

/* Cards */
.card { position: relative; background: var(--night-slate); border: 1px solid var(--line); border-radius: 16px; padding: 16px; overflow: hidden; }
.card.accent { padding-left: 20px; }
.card.accent::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--accent); }
.card.tap { cursor: pointer; transition: transform .15s ease, background-color .15s; }
.card.tap:hover { background-image: linear-gradient(var(--violet-12), var(--violet-12)); }
.card.tap:active { transform: scale(.98); }
@media (prefers-reduced-motion: reduce) { .card.tap:active { transform: none; } .screen { animation: none; } }

.section-title { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; min-height: 24px; }
.st-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--amber); flex: none; }
.st-text { flex: 1; font: 500 12px/1.3 var(--display); letter-spacing: 1.4px; color: var(--mist); text-transform: uppercase; }

.dot { display: inline-block; border-radius: 50%; flex: none; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border: 1px solid; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--white); max-width: 100%; flex: none; line-height: 1.4; }
.pill > span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kchip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border: 1px solid; border-radius: 999px; font-size: 14px; line-height: 1.3; color: var(--white); max-width: 100%; }
.mini { max-width: 220px; padding: 4px 10px; border-radius: 999px; background: var(--memory-surface); font-size: 12.5px; font-weight: 500; color: var(--white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.summary { display: flex; flex-wrap: wrap; gap: 6px 12px; }
.sum-item { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--white); }
.nrt { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; }
.emblem { flex: none; object-fit: contain; }
.metric .t-bm { margin-top: 4px; }
.count-row { display: flex; align-items: center; gap: 12px; padding: 6px 0; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 12px; font-weight: 700; transition: background .15s, transform .1s, color .15s, border-color .15s; white-space: nowrap; }
.btn.primary { min-height: 52px; padding: 12px 24px; background: var(--violet); color: #fff; font-size: 18px; }
.btn.primary:hover { background: #9586ec; }
.btn.primary:active { background: var(--violet-pressed); }
.btn.primary:disabled { background: var(--disabled-bg); color: var(--disabled-text); cursor: default; }
.btn.outline { min-height: 48px; padding: 10px 20px; border: 1px solid var(--outline); color: var(--white); font-size: 15px; }
.btn.outline:hover { background: var(--violet-12); }
.btn.outline:disabled { border-color: var(--disabled-bg); color: var(--disabled-text); }
.btn.outline.left { justify-content: flex-start; width: auto; }
.btn.text { min-height: 48px; padding: 8px 12px; color: var(--lavender); font-size: 15px; }
.btn.text:hover { background: var(--violet-12); }
.btn.text.sm { min-height: 40px; padding: 6px 10px; }
.btn.text.danger { color: var(--amber); }
.btn.block { width: 100%; }
.btn span { overflow: hidden; text-overflow: ellipsis; }
.add-btn { min-height: 52px !important; flex: none; }
.start-btn { min-height: 48px !important; padding: 0 14px !important; flex: none; font-size: 18px; }

/* Chips */
.chip-row { display: flex; gap: 8px; overflow-x: auto; padding: 4px 16px 8px; flex: none; scrollbar-width: none; }
.chip-row::-webkit-scrollbar { display: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 14px; border-radius: 999px; background: var(--night-slate); border: 1px solid var(--line); color: var(--white); font-size: 14px; font-weight: 600; flex: none; max-width: 100%; transition: background .15s, border-color .15s; }
.chip:hover { background-color: #1e2537; }
.chip.sel { background: var(--violet-20); border-color: var(--violet); }
.chip img { width: 22px; height: 22px; object-fit: contain; }
.chip-l { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip.action { padding-left: 10px; }
.chip-input .chips-list { margin-top: 10px; }
.ichip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 4px 4px 4px 12px; border-radius: 999px; background: var(--night-slate); border: 1px solid var(--line); font-size: 14px; font-weight: 600; max-width: 100%; }
.ichip.amber { border-color: var(--amber); padding-left: 10px; }
.ichip > span:not(.dot) { overflow-wrap: anywhere; }
.ichip-x { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--mist); flex: none; }
.ichip-x:hover { background: var(--violet-12); color: var(--white); }

/* Segmented */
.seg { display: inline-flex; border: 1px solid var(--outline); border-radius: 999px; overflow: hidden; }
.seg.full { display: flex; width: 100%; }
.seg-b { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; padding: 0 12px; font-size: 14px; font-weight: 700; color: var(--mist); border-left: 1px solid var(--outline); transition: background .15s, color .15s; }
.seg-b:first-child { border-left: 0; }
.seg-b.sel { background: var(--violet-20); color: var(--white); box-shadow: inset 0 0 0 1px var(--violet); }
.seg-b:first-child { border-radius: 999px 0 0 999px; } .seg-b:last-child { border-radius: 0 999px 999px 0; } .seg-b:only-child { border-radius: 999px; }
.seg-b:disabled { color: var(--disabled-text); cursor: default; }
.seg.small .seg-b { font-size: 13px; padding: 0 4px; }

/* Text fields */
.form { display: block; }
.tf { position: relative; }
.tf input, .tf textarea, .tf select { width: 100%; background: var(--memory-surface); border: 1px solid var(--line); border-radius: 12px; padding: 24px 16px 8px; font-size: 16px; line-height: 22px; color: var(--white); outline: none; transition: border-color .15s, box-shadow .15s; -webkit-appearance: none; appearance: none; }
.tf textarea { resize: none; display: block; overflow-y: auto; }
.tf.nolabel input, .tf.nolabel textarea, .tf.nolabel select { padding: 15px 16px; }
.tf input:focus, .tf textarea:focus, .tf select:focus { border-color: var(--violet); box-shadow: inset 0 0 0 1px var(--violet); }
.tf.err input, .tf.err textarea { border-color: var(--amber); }
.tf.err input:focus, .tf.err textarea:focus { box-shadow: inset 0 0 0 1px var(--amber); }
.tf label { position: absolute; left: 17px; top: 16px; font-size: 16px; color: var(--mist); font-weight: 500; pointer-events: none; transition: top .15s, font-size .15s, color .15s; max-width: calc(100% - 34px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tf input:focus + label, .tf textarea:focus + label, .tf input:not(:placeholder-shown) + label, .tf textarea:not(:placeholder-shown) + label, .tf.always label, .tf label.fixed { top: 6px; font-size: 12px; }
.tf input:focus + label, .tf textarea:focus + label { color: var(--lavender); font-weight: 600; }
.tf.err label { color: var(--amber); }
.tf ::placeholder { color: var(--mist); opacity: 1; }
.tf:not(.always):not(.nolabel) :not(:focus)::placeholder { color: transparent; }
.tf.lead input { padding: 15px 16px 15px 48px; }
.tf-lead { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--mist); pointer-events: none; }
.tf-msg { margin-top: 6px; padding: 0 4px; font-size: 13px; line-height: 1.35; color: var(--mist); font-weight: 500; }
.tf-msg.err { color: var(--amber); }
.tf input[type=date] { min-height: 52px; color-scheme: dark; }
.sel-wrap select { padding-right: 44px; cursor: pointer; text-overflow: ellipsis; }
.sel-wrap select option { background: var(--memory-surface); color: var(--white); }
.sel-arrow { position: absolute; right: 18px; top: 50%; width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 5px solid var(--mist); pointer-events: none; }
.inline-err { display: flex; gap: 6px; align-items: flex-start; margin-top: 6px; color: var(--amber); font-size: 13px; }
.inline-err .ic { margin-top: 1px; }
.field-label { font: 700 14px/1.4 var(--body); margin-bottom: 8px; }
.field-label .opt { color: var(--mist); font-weight: 500; white-space: pre; }
.date-field { width: 100%; display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--memory-surface); border: 1px solid var(--line); border-radius: 12px; color: var(--blue); font-weight: 700; font-size: 16px; text-align: left; }
.date-field:hover { border-color: var(--outline); }

/* Empty states */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 40px 32px; }
.empty-ic { width: 88px; height: 88px; border-radius: 50%; background: var(--night-slate); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; }
.empty-msg { margin-top: 24px; line-height: 1.45; }
.empty-sec { margin-top: 8px; }
.empty-act { margin-top: 24px; }
.missing { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 32px; text-align: center; }

/* FAB & bottom nav */
.fab { position: absolute; right: 16px; bottom: 16px; min-width: 56px; height: 56px; padding: 0 16px; border-radius: 16px; background: var(--violet); color: #fff; display: inline-flex; align-items: center; justify-content: center; gap: 10px; font-size: 18px; font-weight: 700; box-shadow: 0 6px 18px rgba(0, 0, 0, .35); transition: background .15s, transform .1s; z-index: 2; }
.fab:hover { background: #9586ec; }
.fab:active { background: var(--violet-pressed); transform: scale(.97); }
.fab.ext { padding: 0 20px 0 16px; }
.bottom-nav { flex: none; display: flex; background: var(--night-slate); border-top: 1px solid var(--line); padding-bottom: var(--safe-b); }
.nav-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 60px; padding: 8px 0 6px; color: var(--mist); font-size: 12px; font-weight: 600; }
.nav-item.on { color: var(--violet); font-weight: 700; }
.nav-ic { position: relative; display: flex; }
.badge { position: absolute; top: -5px; left: 15px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--amber); color: var(--deep-ink); font-size: 11px; font-weight: 700; line-height: 16px; text-align: center; }

/* Overlays */
.scrim { position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; background: rgba(17, 21, 34, 0); transition: background .18s; padding: 24px; }
.scrim.in { background: rgba(8, 10, 18, .6); }
.scrim.out { background: rgba(8, 10, 18, 0); }
.dialog { width: 100%; max-width: 400px; max-height: calc(100dvh - 48px); overflow: auto; background: var(--memory-surface); border-radius: 20px; padding: 24px 24px 12px; opacity: 0; transform: scale(.96); transition: opacity .18s, transform .18s; }
.scrim.in .dialog { opacity: 1; transform: none; }
.scrim.out .dialog { opacity: 0; }
.dlg-title { font: 500 20px/1.25 var(--display); margin-bottom: 16px; }
.dlg-body { font-size: 16px; line-height: 1.5; color: var(--mist); }
.dlg-actions { display: flex; justify-content: flex-end; gap: 4px; margin: 16px -12px 0 0; flex-wrap: wrap; }
.dlg-help { font-size: 14px; font-weight: 600; color: var(--mist); }
.dlg-date { margin: 8px 0 16px; color: var(--white); }
.about-ic { border-radius: 18px; margin-bottom: 16px; }
.sheet-scrim { align-items: flex-end; padding: 0; }
.sheet { width: 100%; max-width: 640px; max-height: 85dvh; display: flex; flex-direction: column; background: var(--memory-surface); border-radius: 20px 20px 0 0; transform: translateY(100%); transition: transform .22s ease-out; padding-bottom: var(--safe-b); }
.scrim.in .sheet { transform: none; }
.scrim.out .sheet { transform: translateY(100%); }
.handle { width: 32px; height: 4px; border-radius: 2px; background: var(--outline); margin: 16px auto 18px; flex: none; }
.ov-scroll { overflow-y: auto; min-height: 0; overscroll-behavior: contain; }
.sheet-pad { padding: 0 24px 24px; }
.sheet-h { padding: 0 24px 8px; }
.list-pad { padding: 0 8px 16px; }
.list-tile { width: 100%; display: flex; align-items: center; gap: 16px; min-height: 56px; padding: 8px 16px; border-radius: 12px; text-align: left; color: var(--white); }
.list-tile:hover { background: var(--violet-12); }
.lt-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lt-title { font-size: 16px; line-height: 1.4; color: var(--white); display: block; }
.lt-sub { font-size: 14px; color: var(--mist); display: block; }
.lt-lead { display: flex; }
.settings-tile { border-radius: 0; padding: 12px 16px; }
.menu-scrim { position: fixed; inset: 0; z-index: 30; }
.menu { position: absolute; min-width: 200px; max-width: 280px; background: var(--memory-surface); border: 1px solid var(--line); border-radius: 12px; padding: 6px 0; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); animation: fadeIn .15s ease-out; }
.menu-item { width: 100%; display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 16px; text-align: left; font-size: 16px; color: var(--white); }
.menu-item:hover, .menu-item:focus-visible { background: var(--violet-12); outline: none; }
.menu-item.checked { background: var(--violet-12); }
.menu-item.danger { color: var(--amber); }
#snack { position: fixed; left: 50%; bottom: calc(84px + var(--safe-b)); transform: translate(-50%, 20px); width: calc(100% - 32px); max-width: 560px; padding: 14px 16px; background: var(--memory-surface); border: 1px solid var(--line); border-radius: 12px; font-size: 16px; line-height: 1.3; color: var(--white); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 40; box-shadow: 0 8px 24px rgba(0, 0, 0, .35); }
#snack.show { opacity: 1; transform: translate(-50%, 0); }

.fade-in { animation: fadeIn .3s ease-out; }
.slide-in { animation: slideIn .2s ease-out; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* Onboarding */
.onb { padding-bottom: var(--safe-b); }
.onb-top { height: 64px; display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 0 24px; flex: none; }
.brand { font: 500 13px/1 var(--display); letter-spacing: 3px; color: var(--lavender); }
.onb-pager { flex: 1; min-height: 0; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; }
.onb-pager::-webkit-scrollbar { display: none; }
.onb-page { flex: 0 0 100%; scroll-snap-align: start; overflow-y: auto; }
.onb-inner { padding: 24px 28px; }
.halo-wrap { position: relative; width: 280px; height: 280px; margin: 0 auto 40px; display: flex; align-items: center; justify-content: center; }
.halo { position: absolute; inset: 0; }
.onb-img { position: relative; object-fit: contain; }
.onb-step { letter-spacing: 2px; margin-bottom: 12px; }
.onb-body { color: var(--mist); font-size: 17px; margin-top: 16px; }
.onb-bottom { padding: 8px 24px 24px; flex: none; }
.dots { display: flex; justify-content: center; gap: 8px; margin-bottom: 24px; }
.pdot { width: 8px; height: 8px; border-radius: 4px; background: var(--line); transition: width .2s, background .2s; }
.pdot.on { width: 28px; background: var(--violet); }
@media (max-height: 700px) { .halo-wrap { transform: scale(.8); margin: -28px auto 12px; } }

/* Lists & detail screens */
.month-h { margin-bottom: 10px; }
.mtl { display: flex; flex-direction: column; }
.mtl-node { display: flex; min-height: 56px; border-radius: 12px; }
.mtl-node.tap { cursor: pointer; }
.mtl-node.tap:hover { background: var(--violet-12); }
.mtl-rail { width: 32px; flex: none; display: flex; flex-direction: column; align-items: center; }
.mtl-line { width: 2px; height: 12px; background: var(--line); flex: none; }
.mtl-line.grow { flex: 1; }
.mtl-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid; flex: none; }
.mtl-body { flex: 1; min-width: 0; padding: 8px 4px 16px 8px; }
.mtl-sub { font-size: 13.5px; font-weight: 600; margin-top: 2px; }
.tl-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 4px; border-radius: 12px; cursor: pointer; }
.tl-row.center { align-items: center; }
.tl-row:hover { background: var(--violet-12); }

.comp-sec { background: var(--night-slate); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.comp-ic { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: none; }
.comp-count { padding: 1px 10px; border: 1px solid; border-radius: 999px; font-weight: 700; color: var(--white); }
.comp-item { display: flex; gap: 10px; margin-bottom: 8px; }
.comp-dot { width: 7px; height: 7px; border-radius: 50%; margin-top: 9px; flex: none; }
.expand { background: var(--night-slate); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.expand summary { display: flex; align-items: center; gap: 8px; min-height: 56px; padding: 8px 16px; cursor: pointer; list-style: none; }
.expand summary::-webkit-details-marker { display: none; }
.exp-ic { color: var(--mist); transform: rotate(90deg); transition: transform .2s; display: flex; }
.expand[open] .exp-ic { transform: rotate(-90deg); color: var(--lavender); }
.exp-body { padding: 0 16px 16px; }
.check-tile { display: flex; align-items: center; gap: 16px; padding: 10px 12px; border-radius: 12px; cursor: pointer; }
.check-tile:hover { background: var(--violet-12); }
.check-tile input { position: absolute; opacity: 0; pointer-events: none; }
.cbox { width: 20px; height: 20px; border: 2px solid var(--outline); border-radius: 3px; display: flex; align-items: center; justify-content: center; color: transparent; flex: none; }
.cbox .ic { width: 16px; height: 16px; }
.check-tile input:checked + .cbox { background: var(--violet); border-color: var(--violet); color: #fff; }
.check-tile input:focus-visible + .cbox { outline: 2px solid var(--violet); outline-offset: 2px; }

.cover { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; }
.cover.rounded { border-radius: 16px; }
.thumb { width: 84px; height: 84px; border-radius: 12px; object-fit: cover; flex: none; }
.thumb.sm { width: 64px; height: 64px; border-radius: 10px; }
.article-p { margin: 10px 0 24px; font-size: 16.5px; line-height: 1.6; }
.article-p + .card, h3.t-tl { margin-top: 0; }

/* Stats */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat-grid .span2 { grid-column: span 2; }
.stat-grid .card { height: 100%; }
.cat-row { padding: 6px 0; }
.cat-bar { display: block; height: 14px; border-radius: 7px; background: var(--lavender); }
.bars { position: relative; height: 170px; display: flex; }
.bars-grid { position: absolute; left: 0; right: 0; top: 20px; bottom: 22px; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.bars-grid span { height: 1px; background: var(--line); }
.bar-col { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; }
.bar-area { position: relative; flex: 1; width: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; padding-top: 20px; }
.bar { width: min(28px, 50%); background: var(--blue); border-radius: 6px 6px 0 0; min-height: 2px; }
.bar.zero { background: var(--line); height: 2px !important; }
.bar-val { font-size: 13px; font-weight: 600; color: var(--white); margin-bottom: 2px; min-height: 18px; }
.bar-l { height: 22px; padding-top: 6px; font-size: 12px; font-weight: 600; color: var(--mist); letter-spacing: .4px; }
.ring { position: relative; width: 120px; height: 120px; flex: none; }
.ring-n { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.stack { height: 18px; border-radius: 9px; background: var(--line); display: flex; overflow: hidden; gap: 2px; }
.stack span { display: block; height: 100%; }

/* Lab */
.lab-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.lab-card { display: flex; flex-direction: column; aspect-ratio: .68; }
.lab-img { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.lab-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lab-img.sym { padding: 18px; }
.wheel-wrap { position: relative; width: 300px; height: 320px; margin: 0 auto; }
.wheel { position: absolute; top: 20px; left: 0; width: 300px; height: 300px; will-change: transform; }
.pointer { position: absolute; top: 0; left: 136px; z-index: 1; }
.spin { position: absolute; top: 136px; left: 116px; width: 68px; height: 68px; border-radius: 50%; background: var(--violet); border: 4px solid var(--deep-ink); color: #fff; font: 600 13px/1 var(--display); z-index: 1; transition: background .15s, transform .1s; }
.spin:hover { background: #9586ec; }
.spin:active { transform: scale(.96); }
.reels { padding: 14px; background: var(--night-slate); border: 1px solid var(--line); border-radius: 20px; }
.reel { position: relative; width: 100%; height: 121.6px; margin-top: 8px; background: var(--deep-ink); border: 1px solid var(--outline); border-radius: 14px; overflow: hidden; }
.reel img { position: absolute; left: 50%; top: 0; width: 52px; height: 52px; margin-left: -26px; margin-top: 12px; object-fit: contain; will-change: transform; }
.reel-word { flex: 1; text-align: center; font-size: 13px; font-weight: 700; color: var(--white); }
.pairs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.pcard { position: relative; aspect-ratio: 1; border-radius: 14px; background: var(--night-slate); border: 1px solid var(--outline); overflow: hidden; transition: background .25s, border-color .25s; }
.pcard .face { position: absolute; inset: 10px; width: calc(100% - 20px); height: calc(100% - 20px); object-fit: contain; opacity: 0; transition: opacity .25s; }
.pcard .back { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; transition: opacity .25s; }
.pcard.up { background: var(--memory-surface); border-color: var(--violet); }
.pcard.up .face { opacity: 1; }
.pcard.up .back { opacity: 0; }
.pcard.found { border-color: var(--line); }
.pcard.found .face { opacity: .28; transition: opacity .9s; }
.flash-board { aspect-ratio: 1; padding: 10px; background: var(--night-slate); border: 1px solid var(--line); border-radius: 20px; display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(4, 1fr); gap: 8px; }
.fcell { position: relative; border-radius: 12px; background: var(--deep-ink); border: 1px solid var(--line); overflow: hidden; min-width: 0; min-height: 0; }
.fcell img { position: absolute; inset: 8px; width: calc(100% - 16px); height: calc(100% - 16px); object-fit: contain; opacity: 0; transition: opacity .3s; }
.fcell.vis img { opacity: 1; }
.fcell.vis.rev img { opacity: .55; }
.fcell.picked { border: 2px solid var(--violet); background: var(--violet-20); }
.fcell.still { border: 2px solid #63B9AD; color: #63B9AD; }
.fcell.faded { border: 2px solid #69758D; color: #69758D; }
.fcell.shifted { border: 2px solid #9B82DD; color: #9B82DD; }
.fmark { position: absolute; right: 4px; top: 4px; display: flex; }
@media (prefers-reduced-motion: reduce) { .pcard, .pcard .face, .pcard .back, .fcell img, .sheet, .dialog, .scrim { transition: none !important; } }
@media (max-width: 360px) { .start-btn { font-size: 16px; padding: 0 10px !important; } .wheel-wrap { transform: scale(.9); transform-origin: top center; margin-bottom: -32px; } }
