/* ==========================================================================
   WANDERLIGHT — css/wanderlight.css
   The original's cozy palette (plum, honey, mint, coral) on the same
   phone-first frame as Zyentora's other apps (copied from Prompt Studio):
   every control at least 44 px, text at least 11 px, nothing scrolls
   sideways at 320 px. Light by default, as the original; a dark theme in
   Settings. Below 1024 px the pages sit behind a bottom tab bar (Today,
   Quests, Journey, Camp, More). Colours live in the variables below only.
   ========================================================================== */
:root {
  --r-sm: 10px; --r: 14px; --r-lg: 18px; --r-full: 999px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Consolas, "Roboto Mono", monospace;
  --plum: #2D1B4E; --plum2: #4A3370; --honey: #FFB347; --honey-d: #C97A1F; --mint: #5EEAD4; --mint-d: #0E9488; --coral: #FF6B81;
  --serif: "Bookman Old Style", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --good: #12A08F; --warn: #E2A336; --bad: #E04A66; --info: #8B6FD0;
  --tap: 44px;
  --bar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
html { --a1: var(--honey); --a2: #FF8E7A; }
html[data-theme="light"] {
  --bg: #F5F2FB; --bg2: #FBFAFE; --side: #FBFAFE; --surface: #FFFFFF; --surface2: #F1EDF8; --hover: rgba(45, 27, 78, .05);
  --border: rgba(45, 27, 78, .1); --border2: rgba(45, 27, 78, .2);
  --t1: #201433; --t2: #54476E; --t3: #6B5E85; --overlay: rgba(30, 20, 48, .45); --on-accent: #2D1B4E; --a-text: #9A5A0F;
  --good-t: #0B7A6E; --bad-t: #A83249; --field: #8C7FA3; --spark: #C2453A;
  --glow: radial-gradient(1100px 620px at 8% -8%, rgba(94, 234, 212, .12), transparent 60%), radial-gradient(900px 560px at 108% 8%, rgba(255, 179, 71, .12), transparent 55%);
  color-scheme: light;
}
html[data-theme="dark"] {
  --bg: #1E1430; --bg2: #241838; --side: #20152F; --surface: #2B1E42; --surface2: #35274F; --hover: rgba(255, 255, 255, .06);
  --border: rgba(255, 255, 255, .1); --border2: rgba(255, 255, 255, .18);
  --t1: #EFEAF9; --t2: #C3B6DD; --t3: #A898C6; --overlay: rgba(10, 6, 18, .72); --on-accent: #2D1B4E; --a-text: #FFC56B;
  --good-t: #5EEAD4; --bad-t: #FF8597; --field: #8A7BA8; --spark: #FF8E7A;
  --glow: radial-gradient(1100px 620px at 8% -8%, rgba(94, 234, 212, .10), transparent 60%), radial-gradient(900px 560px at 108% 8%, rgba(255, 179, 71, .10), transparent 55%);
  color-scheme: dark;
}
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), 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); } .bad-text { color: var(--bad-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(--plum); color: var(--honey); 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: 700 14px var(--serif); letter-spacing: .3em; text-transform: uppercase; color: #E9E2F7; }

/* ---------- 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: 0 0 60px rgba(0, 0, 0, .5); }
.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); }
.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 { display: flex; align-items: center; gap: 8px; flex: 2 1 200px; min-height: var(--tap); padding: 0 12px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--border2); color: var(--t3); min-width: 0; }
.search-box input { flex: 1; min-width: 0; border: 0; background: none; outline: none; color: var(--t1); min-height: var(--tap); font-size: 15px; }
.search-box:focus-within { border-color: var(--a1); }
.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-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); }
.meta { display: inline-flex; align-items: center; gap: 4px; }
.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; }
.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; }
.search-row svg { color: var(--a-text); margin-left: 8px; }
.search-results { max-height: 60vh; overflow-y: auto; }

/* ---------- dashboard ---------- */
.hero { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.greet { font-size: 24px; }
.spotlight .insight { margin: 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); }
.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); }

/* ---------- 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; }

/* ---------- charts ---------- */
.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:focus { border-color: var(--a1); 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-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(--border2); 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; }
.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: 0 30px 80px -20px rgba(0, 0, 0, .6); }
  .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: 0 12px 30px -10px rgba(0, 0, 0, .5); 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), 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 ---------- */
@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; }
}


/* ==========================================================================
   Wanderlight's own pieces
   ========================================================================== */
h1, h2, .hero-name, .ob-card h1, .brand b, .lock-title { font-family: var(--serif); letter-spacing: 0; }
.art { display: block; max-width: 100%; height: auto; }
.brand-mark { background: none; border-radius: 50%; padding: 0; width: 36px; height: 36px; }
.loader img { width: 64px; height: 64px; }
.side-streak { display: flex; align-items: center; gap: 8px; margin: 0 16px 6px; padding: 8px 12px; border-radius: var(--r); background: color-mix(in srgb, var(--honey) 14%, transparent); font-size: 13.5px; color: var(--t2); }
.side-streak:empty { display: none; }
.side-streak svg { color: var(--a-text); }
.side-streak span:first-of-type { flex: 1; }
.side-streak b { color: var(--t1); font-family: var(--mono); }
/* The gem and its number on one centre line (an inline span put the icon on the text baseline). */
.side-streak span:last-child { display: inline-flex; align-items: center; gap: 4px; }
html[data-theme="dark"] .side-streak svg { color: var(--honey); }

/* ---------- Today ---------- */
.home-grid { display: grid; gap: 0 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1024px) { .home-grid { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); } }
.home-main, .home-side { min-width: 0; }
.hero { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px 16px; align-items: center; padding: 18px; color: #F5F1FD; border: 0;
  background: radial-gradient(420px 260px at 0% 0%, rgba(94, 234, 212, .22), transparent 60%), radial-gradient(420px 260px at 100% 100%, rgba(255, 179, 71, .2), transparent 60%), linear-gradient(150deg, var(--plum), var(--plum2)); }
.hero .muted, .hero .bond-cap { color: #D8CDEE; }
.hero-art { position: relative; width: 112px; }
.hero-companion { display: block; border: 0; background: none; padding: 0; width: 112px; min-height: var(--tap); cursor: pointer; border-radius: 50%; }
.companion-img { width: 100%; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .25)); }
.companion-img.big { width: min(220px, 60vw); margin: 0 auto; }
.companion-img.bounce { animation: bounce .6s ease; }
@keyframes bounce { 0%, 100% { transform: none; } 30% { transform: translateY(-12px) scale(1.04); } 60% { transform: translateY(0) scale(.98); } }
.hero-explorer { position: absolute; left: -6px; bottom: -4px; width: 44px; height: 44px; border-radius: 50%; overflow: hidden; background: #F1EDF8; border: 2px solid var(--honey); }
.hero-explorer .avatar { width: 100%; height: auto; transform: translateY(2px) scale(1.15); }
.hero-tx { min-width: 0; }
.hero-hi { margin: 0; font-size: 13.5px; color: #D8CDEE; }
.hero-name { font-size: 22px; color: #fff; overflow-wrap: anywhere; }
.stage-pill { display: inline-block; vertical-align: middle; padding: 2px 9px; border-radius: var(--r-full); background: var(--honey); color: var(--plum); font: 800 11px var(--font); letter-spacing: .08em; text-transform: uppercase; }
.bond-cap { margin: 0; font-size: 13px; color: var(--t2); }
.bond-cap b { color: inherit; }
.meter.bond i { background: linear-gradient(90deg, var(--mint-d), var(--mint)); }
.meter.honey i { background: linear-gradient(90deg, var(--honey-d), var(--honey)); }
.meter.plum i { background: linear-gradient(90deg, var(--plum2), #8B6FD0); }
.hero .meter { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .12); }
.stats { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stats.stats-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 14px; }
@media (min-width: 760px) { .stats.stats-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat { display: flex; align-items: flex-start; gap: 8px; }
.stat-ic { width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center; flex: none; background: color-mix(in srgb, var(--c, var(--honey)) 20%, transparent); color: var(--c-t, var(--honey-d)); }
.stat > div { min-width: 0; }
.stat.c-honey { --c: var(--honey); --c-t: var(--a-text); } .stat.c-mint { --c: var(--mint); --c-t: var(--mint-d); } .stat.c-plum { --c: #8B6FD0; --c-t: #6A4FB0; } .stat.c-coral { --c: var(--coral); --c-t: #C13F56; }
html[data-theme="dark"] .stat { --c-t: var(--c); }
.hero .stat { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .1); padding: 10px 8px; }
.hero .stat-val { color: #fff; }
.hero .stat-lbl, .hero .stat-sub { color: #D8CDEE; }
.hero .stat-ic { background: rgba(255, 255, 255, .14); color: var(--honey); }
@media (max-width: 400px) { .hero .stat { flex-direction: column; gap: 4px; } .hero .stat-ic { width: 26px; height: 26px; } .hero-art, .hero-companion { width: 92px; } .hero-name { font-size: 19px; } }
.banner { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.banner > svg { flex: none; }
.banner > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.banner-chest > svg { color: var(--a-text); } .banner-rest > svg { color: #6A4FB0; } .banner-risk { border-color: color-mix(in srgb, var(--coral) 45%, transparent); } .banner-risk > svg { color: var(--bad-t); }
html[data-theme="dark"] .banner-chest > svg { color: var(--honey); } html[data-theme="dark"] .banner-rest > svg { color: #B9A3F0; } html[data-theme="dark"] .banner-risk > svg { color: var(--coral); }
.today-progress { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; font-size: 14px; }
.today-progress .meter { flex: 1; }
.q-group { margin-top: 10px; }
.q-group-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 2px 6px; font-size: 12.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--t2); }
.q-group-head > span:first-child { display: inline-flex; align-items: center; gap: 6px; }
.q-group-head svg { color: var(--a-text); }
.q-group-head .muted { text-transform: none; letter-spacing: 0; font-weight: 600; }
.quest { display: flex; align-items: center; gap: 10px; padding: 6px 10px 6px 6px; margin-bottom: 6px; border-radius: var(--r); background: var(--surface2); border: 1px solid transparent; min-height: 58px; }
.quest-check { flex: none; width: 48px; height: 48px; padding: 0; border: 0; background: none; border-radius: 14px; display: flex; align-items: center; justify-content: center; }
.qc-box { width: 44px; height: 44px; border-radius: 13px; display: flex; align-items: center; justify-content: center; background: var(--surface); border: 2px solid var(--border2); color: var(--t2); transition: background .15s, border-color .15s, transform .15s; }
.quest-check:hover .qc-box { border-color: var(--mint-d); }
.quest-check:active .qc-box { transform: scale(.94); }
.quest.done { background: color-mix(in srgb, var(--mint) 14%, var(--surface)); border-color: color-mix(in srgb, var(--mint) 35%, transparent); }
.quest.done .qc-box { background: var(--mint-d); border-color: var(--mint-d); color: #fff; }
.quest-tx { flex: 1; min-width: 0; }
.quest-title { font-weight: 600; font-size: 15px; overflow-wrap: anywhere; }
.quest.done .quest-title { color: var(--t2); }
.quest-meta { font-size: 12.5px; color: var(--t3); }
.quest-done { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 700; color: var(--good-t); flex: none; }
.all-done { display: flex; align-items: center; gap: 8px; margin: 8px 0 0; padding: 10px 12px; border-radius: var(--r); background: color-mix(in srgb, var(--mint) 16%, transparent); color: var(--t1); font-weight: 600; }
.all-done svg { color: var(--good-t); flex: none; }
.map-teaser { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.map-teaser:hover { border-color: var(--a1); }
.map-thumb { width: 96px; border-radius: 12px; flex: none; }
.map-teaser > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ---------- Quests ---------- */
.qcard { display: flex; align-items: center; gap: 12px; padding: 8px 4px 8px 8px; border-top: 1px solid var(--border); min-height: 60px; }
.card-head + .qcard { border-top: 0; }
.qcard-ic { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex: none; background: color-mix(in srgb, var(--honey) 18%, transparent); color: var(--a-text); }
.qcard-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.qcard-tx b { overflow-wrap: anywhere; }
.qcard.archived, .qcard.resting { opacity: .75; }
.qcard-act { flex: none; }
.starter-title { margin: 0; font-weight: 700; font-size: 16px; }
.pick-list.days { flex-direction: row; flex-wrap: wrap; gap: 6px; border: 0; padding: 0; }
.day-pick { position: relative; flex: 1 0 44px; }
.day-pick input { position: absolute; opacity: 0; pointer-events: none; }
.day-pick span { display: flex; align-items: center; justify-content: center; min-height: var(--tap); border-radius: var(--r-sm); border: 1px solid var(--border2); background: var(--bg2); color: var(--t2); font-weight: 700; font-size: 13.5px; cursor: pointer; }
.day-pick input:checked + span { background: color-mix(in srgb, var(--a1) 22%, transparent); border-color: var(--a1); color: var(--t1); }
.day-pick input:focus-visible + span { outline: 2px solid var(--a1); outline-offset: 2px; }
.seg-icons .seg-opt { flex: 0 0 auto; }
.seg-icons .seg-opt > span { width: var(--tap); padding: 0; }
.seg-opt small { font-weight: 600; color: var(--t3); font-size: 12px; }

/* ---------- Journey ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: -6px 0 8px; }
.cal-head h3 { font-size: 17px; }
.cal-head .icon-btn[disabled] { opacity: .35; }
.cal-dow, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-dow span { text-align: center; font-size: 11.5px; font-weight: 700; color: var(--t3); padding-bottom: 4px; }
.cal-cell { position: relative; aspect-ratio: 1; min-height: 34px; border-radius: 10px; border: 1px solid transparent; background: var(--surface2); color: var(--t1); padding: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; font: 600 13px var(--font); }
.cal-cell.empty, .cal-cell.before { background: none; }
.cal-cell.before { color: var(--t3); opacity: .5; }
.cal-cell.future { background: none; border-color: var(--border); color: var(--t3); }
.cal-cell.active { background: color-mix(in srgb, var(--mint) 34%, var(--surface)); }
.cal-cell.perfect { background: #0B7A6E; color: #fff; } /* a perfect day: deep mint with white, 5.4:1 in both themes */
.cal-cell.rested { background: color-mix(in srgb, #8B6FD0 30%, var(--surface)); }
.cal-cell.rested.future { border-style: dashed; border-color: #8B6FD0; }
.cal-cell.missed { background: color-mix(in srgb, var(--coral) 14%, var(--surface)); color: var(--t2); }
.cal-cell.open { background: var(--surface); border: 1px dashed var(--border2); }
.cal-cell.locked { background: repeating-linear-gradient(135deg, var(--surface2), var(--surface2) 4px, transparent 4px, transparent 8px); color: var(--t3); }
.cal-cell.today { outline: 2px solid var(--honey); outline-offset: 1px; }
.cal-cell svg { width: 12px; height: 12px; }
button.cal-cell:not([disabled]):hover { filter: brightness(1.05); border-color: var(--a1); }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 12.5px; color: var(--t2); }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal-legend i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.cal-legend i.perfect { background: var(--mint-d); } .cal-legend i.active { background: color-mix(in srgb, var(--mint) 34%, var(--surface)); }
.cal-legend i.rested { background: color-mix(in srgb, #8B6FD0 30%, var(--surface)); } .cal-legend i.missed { background: color-mix(in srgb, var(--coral) 22%, var(--surface)); }
.year { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 560px) { .year { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .year { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.year-month b { display: block; font-size: 12.5px; color: var(--t2); margin-bottom: 4px; }
.cal-small .cal-grid { gap: 2px; }
.cal-small .cal-cell { min-height: 0; border-radius: 3px; }
.rest-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); }
.rest-row > svg { color: #8B6FD0; flex: none; }
.rest-row.warn > svg { color: var(--coral); }
.rest-row > span { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.day-list { list-style: none; padding: 0; margin: 8px 0; display: flex; flex-direction: column; gap: 6px; }
.day-list li { display: flex; align-items: center; gap: 8px; }
.day-list li svg { color: var(--good-t); flex: none; }
.day-list li span:first-of-type { flex: 1; }

/* ---------- Camp ---------- */
.camp-hero { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.camp-hero .hero-companion { width: auto; }
.camp-hero h2 { font-size: 24px; }
.camp-hero .meter { width: min(320px, 100%); }
.evo-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 560px) { .evo-gallery { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.evo-thumb { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; padding: 10px 8px; border-radius: var(--r); background: var(--surface2); border: 1px solid transparent; min-width: 0; }
.evo-thumb .art { width: 84px; margin-bottom: 4px; }
.evo-thumb.current { border-color: var(--honey); background: color-mix(in srgb, var(--honey) 12%, var(--surface2)); }
.evo-thumb b { overflow-wrap: anywhere; }
.compendium .evo-thumb .small { color: var(--t2); }
.silhouette { filter: grayscale(1) brightness(.2); opacity: .45; }
html[data-theme="dark"] .silhouette { filter: grayscale(1) brightness(0) invert(1); opacity: .22; }
.second-row { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; }
.second-row .companion-img { width: 96px; flex: none; }
.second-row > div { min-width: 0; flex: 1; }

/* ---------- Map ---------- */
.map-card { padding: 10px; }
.map { position: relative; border-radius: var(--r); overflow: hidden; }
.map-img { width: 100%; }
.region { position: absolute; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 6px; min-width: var(--tap); min-height: var(--tap); padding: 0 10px; border-radius: var(--r-full); border: 2px solid rgba(255, 255, 255, .6);
  background: rgba(30, 20, 48, .88); color: #fff; font: 700 12.5px var(--font); justify-content: center; } /* near-solid: readable over any part of the map */
.region.open { border-color: var(--honey); color: var(--honey); }
.region.sel { background: var(--honey); color: var(--plum); border-color: #fff; }
.region-name { display: none; color: inherit; white-space: nowrap; }
@media (min-width: 640px) { .region-name { display: inline; } }
.map-explorer { position: absolute; width: 34px; height: 34px; transform: translate(-50%, -135%); border-radius: 50%; overflow: hidden; background: #F1EDF8; border: 2px solid var(--honey); pointer-events: none; }
.map-explorer .art { transform: translateY(2px) scale(1.15); }
.map-dock { padding: 12px 6px 4px; display: flex; flex-direction: column; gap: 2px; }
.region-list { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 6px; }
.region-list li { display: flex; align-items: center; gap: 8px; color: var(--t2); }
.region-list li.open { color: var(--t1); }
.region-list li.open svg { color: var(--good-t); }
.region-list li span:first-of-type { flex: 1; }

/* ---------- Items ---------- */
.items-grid { display: grid; gap: 0 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .items-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.gem-big { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.gem-big svg { color: var(--mint-d); }
.gem-big b { font: 800 34px var(--mono); }
html[data-theme="dark"] .gem-big svg { color: var(--mint); }
.gem-log { list-style: none; padding: 0; margin: 8px 0; display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; }
.gem-log li { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 8px; align-items: baseline; }
.gem-log li span:first-child { font: 700 13px var(--mono); }
.chest-card { text-align: center; display: flex; flex-direction: column; align-items: center; }
.chest-card .card-head { align-self: stretch; }
.chest-card .meter { width: min(260px, 100%); }
.chest-art { color: var(--honey-d); margin: 4px 0 8px; }
html[data-theme="dark"] .chest-art { color: var(--honey); }
.chest-art.open { animation: bounce .7s ease; }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.badge { display: flex; flex-direction: column; gap: 3px; padding: 12px; border-radius: var(--r); background: var(--surface2); border: 1px solid color-mix(in srgb, var(--honey) 40%, transparent); min-width: 0; }
.badge-ic { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--honey) 22%, transparent); color: var(--a-text); margin-bottom: 4px; }
.badge.locked { border-color: transparent; }
.badge.locked .badge-ic { background: var(--surface); color: var(--t3); }
.badge.locked b { color: var(--t2); }

/* ---------- celebrations ---------- */
.celebrate { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 6px 0; }
.celebrate h2 { font-size: 26px; }
.eyebrow { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--a-text); }
.evo { position: relative; width: 160px; height: 160px; }
.evo .art { position: absolute; inset: 0; width: 100%; }
.evo-from { animation: evo-out 1.6s ease forwards; }
.evo-to { opacity: 0; animation: evo-in 1.6s ease forwards; }
@keyframes evo-out { 0% { opacity: 1; filter: none; } 45% { opacity: 1; filter: brightness(2.4); } 60%, 100% { opacity: 0; } }
@keyframes evo-in { 0%, 50% { opacity: 0; transform: scale(.8); } 75% { opacity: 1; transform: scale(1.06); } 100% { opacity: 1; transform: none; } }
.level-badge { width: 84px; height: 84px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font: 800 36px var(--serif); color: var(--plum); background: radial-gradient(circle at 35% 30%, #FFE2A8, var(--honey)); box-shadow: 0 0 0 6px color-mix(in srgb, var(--honey) 25%, transparent); }
.region-note { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--r-full); background: color-mix(in srgb, var(--mint) 18%, transparent); font-weight: 700; }

/* ---------- first run and pickers ---------- */
.onboarding { background: radial-gradient(600px 400px at 10% 0%, rgba(94, 234, 212, .18), transparent 60%), radial-gradient(600px 400px at 100% 100%, rgba(255, 179, 71, .16), transparent 60%), var(--bg); }
.ob-logo { align-self: center; width: 64px; height: 64px; }
.ob-card h1 { font-size: 32px; letter-spacing: .06em; }
.pick-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pick-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; padding: 12px 10px; border-radius: var(--r); border: 2px solid var(--border); background: var(--surface); color: var(--t1); cursor: pointer; min-width: 0; font: inherit; }
.pick-card input { position: absolute; opacity: 0; pointer-events: none; }
.pick-card .art { width: 88px; margin-bottom: 4px; }
.pick-card.selected { border-color: var(--honey); background: color-mix(in srgb, var(--honey) 10%, var(--surface)); }
.pick-card:focus-within { outline: 2px solid var(--a1); outline-offset: 2px; }
.pick-type { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--a-text); }
