:root {
  color-scheme: dark;
  --bg: #070a0f;
  --bg-2: #0a0e14;
  --card: #121a24;
  --card-2: #17222e;
  --card-3: #0f1822;
  --line: rgba(255, 255, 255, .07);
  --line-strong: rgba(255, 255, 255, .13);
  --gold: #d6b36a;
  --gold-2: #e8cb94;
  --gold-soft: rgba(214, 179, 106, .14);
  --white: #f4f5f7;
  --muted: #8a94a6;
  --muted-2: #5f6b7d;
  --red: #ff5a67;
  --red-soft: rgba(255, 90, 103, .12);
  --green: #58d6a5;
  --green-soft: rgba(88, 214, 165, .12);
  --blue: #67b7ff;
  --blue-soft: rgba(103, 183, 255, .12);
  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 18px 50px rgba(0, 0, 0, .35);
  --tab-h: 66px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: #05070a;
  color: var(--white);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100dvh;
  overflow-x: hidden;
}

body.sheet-open { overflow: hidden; }

button, input, textarea, select {
  font: inherit;
  color: inherit;
}

button { cursor: pointer; border: 0; }

a { color: var(--gold-2); }

#app {
  width: 100%;
  max-width: 560px;
  min-height: 100dvh;
  margin: 0 auto;
  background:
    radial-gradient(120% 70% at 50% -10%, rgba(214, 179, 106, .10), transparent 55%),
    radial-gradient(80% 50% at 100% 30%, rgba(103, 183, 255, .06), transparent 60%),
    var(--bg);
  position: relative;
  overflow: hidden;
}

@media (min-width: 700px) {
  #app {
    min-height: calc(100dvh - 32px);
    margin: 16px auto;
    border-radius: 32px;
    box-shadow: 0 30px 90px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .05);
  }
}

.screen {
  padding: calc(18px + var(--safe-top)) 18px calc(104px + var(--safe-bottom));
  min-height: 100dvh;
  animation: fade .28s ease;
}

@keyframes fade {
  from { opacity: .4; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.eyebrow {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .14em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 6px;
}

h1 {
  font-size: 31px;
  line-height: 1.1;
  letter-spacing: -.03em;
  margin: 0;
  font-weight: 760;
}

h2 {
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: -.02em;
  margin: 0;
  font-weight: 720;
}

h3 {
  font-size: 15px;
  line-height: 1.3;
  margin: 0;
  font-weight: 700;
}

p { margin: 0; }

.muted { color: var(--muted); }
.tiny { font-size: 11px; }
.small { font-size: 12px; }
.preline { white-space: pre-line; }
.center { text-align: center; }

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line);
  color: var(--white);
  flex: 0 0 auto;
}
.icon-btn:active { background: rgba(255, 255, 255, .09); transform: scale(.97); }
.icon-btn svg { width: 21px; height: 21px; }

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, .025), transparent 60%), var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

.card + .card { margin-top: 12px; }

.hero {
  position: relative;
  overflow: hidden;
  border-color: rgba(214, 179, 106, .32);
  background:
    radial-gradient(120% 100% at 100% 0%, rgba(214, 179, 106, .15), transparent 55%),
    linear-gradient(160deg, #17222e 0%, #101821 60%, #0d141c 100%);
}

.hero::after {
  content: "";
  position: absolute;
  right: -30px;
  top: -50px;
  width: 190px;
  height: 190px;
  border: 1px solid rgba(214, 179, 106, .18);
  border-radius: 50%;
  box-shadow: 0 0 0 26px rgba(214, 179, 106, .04), 0 0 0 58px rgba(214, 179, 106, .025);
  pointer-events: none;
}

.hero > * { position: relative; z-index: 1; }

.hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--gold-soft);
  border: 1px solid rgba(214, 179, 106, .25);
  color: var(--gold-2);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  white-space: nowrap;
}

.badge.red { background: var(--red-soft); border-color: rgba(255, 90, 103, .3); color: #ff9aa2; }
.badge.blue { background: var(--blue-soft); border-color: rgba(103, 183, 255, .25); color: #a8d4ff; }
.badge.green { background: var(--green-soft); border-color: rgba(88, 214, 165, .25); color: #a5f0d4; }
.badge.grey { background: rgba(255, 255, 255, .05); border-color: var(--line); color: var(--muted); }

.hero h2 {
  font-size: 24px;
  line-height: 1.28;
  margin: 2px 0 14px;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .045);
  border: 1px solid var(--line);
  color: #c9d2df;
  font-size: 10.5px;
  white-space: nowrap;
}
.chip svg { width: 14px; height: 14px; opacity: .8; }

.hero-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 750;
  letter-spacing: -.01em;
  transition: transform .12s ease, opacity .12s ease;
  text-decoration: none;
}
.btn:active { transform: scale(.98); opacity: .9; }
.btn svg { width: 18px; height: 18px; }
.btn.primary { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #17120a; }
.btn.secondary { background: rgba(255, 255, 255, .055); color: var(--white); border: 1px solid var(--line); }
.btn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.btn.danger { background: var(--red-soft); color: #ff9aa2; border: 1px solid rgba(255, 90, 103, .3); }
.btn.small { min-height: 38px; padding: 0 12px; font-size: 12px; border-radius: 11px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .4; pointer-events: none; }

.progress-ring {
  width: 66px;
  height: 66px;
  flex: 0 0 auto;
  position: relative;
}
.progress-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.progress-ring .ring-bg { fill: none; stroke: rgba(255, 255, 255, .08); stroke-width: 5; }
.progress-ring .ring-fg { fill: none; stroke: var(--gold); stroke-width: 5; stroke-linecap: round; }
.progress-ring .ring-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  color: var(--white);
  line-height: 1;
}
.progress-ring .ring-label small { font-size: 8px; color: var(--muted); font-weight: 600; margin-top: 3px; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 22px 2px 10px;
}
.section-head h2 { font-size: 16px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.section-head .link { font-size: 11px; color: var(--gold); font-weight: 700; }

/* readiness */
.readiness-row {
  display: grid;
  grid-template-columns: 92px 1fr 42px;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.readiness-row:last-of-type { border-bottom: 0; }
.readiness-label { font-size: 12px; color: #c9d2df; }
.readiness-value { text-align: right; font-size: 14px; font-weight: 800; color: var(--gold-2); font-variant-numeric: tabular-nums; }
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 28px;
  background: transparent;
  accent-color: var(--gold);
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(214, 179, 106, .55), rgba(255, 255, 255, .1));
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--gold-2);
  border: 4px solid #141b24;
  box-shadow: 0 0 0 1px rgba(214, 179, 106, .5);
  margin-top: -9px;
}
input[type="range"]::-moz-range-track { height: 4px; background: rgba(255, 255, 255, .15); border-radius: 999px; }
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border: 0; border-radius: 50%; background: var(--gold-2); }

.warning {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
  border-radius: 14px;
  background: var(--red-soft);
  border: 1px solid rgba(255, 90, 103, .3);
  color: #ffb3b9;
  font-size: 11.5px;
  line-height: 1.5;
  margin-top: 12px;
}
.warning svg { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 1px; }
.warning.gold { background: var(--gold-soft); border-color: rgba(214, 179, 106, .3); color: var(--gold-2); }

/* week strip */
.week-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.week-strip.three { grid-template-columns: repeat(3, 1fr); }
.week-day {
  border-radius: 14px;
  padding: 10px 4px;
  text-align: center;
  background: rgba(255, 255, 255, .03);
  border: 1px solid var(--line);
  min-height: 62px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: var(--muted);
  font-size: 9px;
}
.week-day strong { font-size: 10px; color: #c9d2df; }
.week-day span:not(.dot) { display: block; width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.week-day .dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, .18); }
.week-day.done { background: var(--green-soft); border-color: rgba(88, 214, 165, .25); }
.week-day.done .dot { background: var(--green); }
.week-day.partial { background: var(--gold-soft); border-color: rgba(214, 179, 106, .25); }
.week-day.partial .dot { background: var(--gold); }
.week-day.skipped { opacity: .55; }
.week-day.current { box-shadow: inset 0 0 0 1px var(--gold); }

/* details */
details {
  border-top: 1px solid var(--line);
  padding: 2px 0;
}
details:first-of-type { border-top: 0; }
summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 2px;
  font-size: 13px;
  font-weight: 700;
  color: var(--white);
}
summary::-webkit-details-marker { display: none; }
summary .chev { transition: transform .2s ease; color: var(--muted); }
summary .chev svg { width: 16px; height: 16px; }
details[open] summary .chev { transform: rotate(90deg); }
.detail-body {
  padding: 0 2px 16px;
  font-size: 12.5px;
  line-height: 1.7;
  color: #c9d2df;
}
.detail-body ul { margin: 8px 0 0; padding-left: 18px; }
.detail-body li { margin: 5px 0; }
.detail-body .warn-text { color: #ffb3b9; }
.detail-body .gold-text { color: var(--gold-2); }
.kv { display: grid; grid-template-columns: 86px 1fr; gap: 8px 12px; }
.kv dt { color: var(--muted); font-size: 11px; }
.kv dd { margin: 0; color: var(--white); }

/* knowledge cards */
.k-card {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .03);
  border: 1px solid var(--line);
  margin-top: 10px;
}
.k-card:first-child { margin-top: 0; }
.k-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.k-id { font-size: 10px; color: var(--gold); font-weight: 800; letter-spacing: .08em; }
.k-name { font-size: 13px; font-weight: 750; }
.k-purpose { font-size: 11px; color: var(--muted); line-height: 1.55; margin-top: 4px; }
.k-cues { margin: 8px 0 0; padding-left: 16px; font-size: 11px; line-height: 1.55; color: #c9d2df; }
.k-cues li { margin: 4px 0; }

/* session header */
.session-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
}
.session-head .back { margin-left: -4px; }
.session-title { flex: 1; min-width: 0; }
.session-title h1 { font-size: 25px; line-height: 1.2; }
.session-sub { color: var(--muted); font-size: 11px; margin-top: 5px; }

.session-hero {
  border-color: rgba(214, 179, 106, .28);
  background:
    radial-gradient(100% 100% at 100% 0%, rgba(214, 179, 106, .13), transparent 55%),
    linear-gradient(160deg, #17222e, #0f1822);
}
.session-hero h2 { margin-bottom: 12px; }

.sticky-action {
  position: sticky;
  bottom: calc(10px + var(--safe-bottom));
  margin-top: 18px;
  padding: 8px 0;
  background: linear-gradient(180deg, transparent, rgba(7, 10, 15, .92) 35%);
  z-index: 5;
}

/* tabbar */
.tabbar {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: 560px;
  height: calc(var(--tab-h) + var(--safe-bottom));
  padding: 8px 12px calc(8px + var(--safe-bottom));
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  background: rgba(10, 14, 20, .92);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  z-index: 20;
}
.tabbar[hidden] { display: none; }
.tab {
  background: transparent;
  color: var(--muted-2);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 9px;
  font-weight: 650;
  padding: 3px 0;
  min-height: 48px;
}
.tab svg { width: 21px; height: 21px; }
.tab.active { color: var(--gold-2); background: rgba(214, 179, 106, .08); }
.tab:active { background: rgba(255, 255, 255, .05); }

/* plan */
.filter-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 8px;
  scrollbar-width: none;
}
.filter-row::-webkit-scrollbar { display: none; }
.filter {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .03);
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 13px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.filter.active { background: var(--gold-soft); border-color: rgba(214, 179, 106, .35); color: var(--gold-2); }

.week-block { margin-top: 14px; }
.week-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  padding: 0 2px;
}
.week-head strong { font-size: 13px; }
.week-head span { font-size: 10px; color: var(--muted); }
.week-progress { height: 4px; border-radius: 999px; background: rgba(255, 255, 255, .07); overflow: hidden; margin: 6px 2px 0; }
.week-progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-2)); border-radius: 999px; }
.day-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
.day-grid.three { grid-template-columns: repeat(3, 1fr); }
.day-cell {
  min-height: 70px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .03);
  padding: 8px 5px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
  text-align: left;
  position: relative;
  overflow: hidden;
}
.day-cell .d { font-size: 9px; font-weight: 800; color: var(--muted); letter-spacing: .06em; }
.day-cell .t { font-size: 9px; line-height: 1.25; color: #c9d2df; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.day-cell .s { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, .16); position: absolute; right: 8px; top: 8px; }
.day-cell.done { background: var(--green-soft); border-color: rgba(88, 214, 165, .22); }
.day-cell.done .s { background: var(--green); }
.day-cell.partial { background: var(--gold-soft); border-color: rgba(214, 179, 106, .24); }
.day-cell.partial .s { background: var(--gold); }
.day-cell.skipped { opacity: .45; }
.day-cell.assessment { border-color: rgba(103, 183, 255, .28); }
.day-cell.current { box-shadow: inset 0 0 0 1px var(--gold); }
.legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; font-size: 10px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }

/* progress */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat {
  padding: 15px;
  border-radius: 18px;
  background: var(--card);
  border: 1px solid var(--line);
}
.stat .num { font-size: 28px; font-weight: 800; letter-spacing: -.04em; line-height: 1; }
.stat .lab { font-size: 10px; color: var(--muted); margin-top: 7px; }
.stat .num small { font-size: 12px; color: var(--muted); font-weight: 600; }

.chart-card { padding: 14px 12px 10px; }
.chart-title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 0 4px 8px; }
.chart-title h3 { font-size: 13px; }
.chart-title span { font-size: 9px; color: var(--muted); }
.chart { width: 100%; height: auto; display: block; }
.chart text { font-family: inherit; }

.stage-row { margin-top: 12px; }
.stage-top { display: flex; justify-content: space-between; gap: 10px; font-size: 11px; margin-bottom: 6px; }
.stage-bar { height: 7px; border-radius: 999px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.stage-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--gold), var(--gold-2)); }

.note-area {
  width: 100%;
  min-height: 84px;
  resize: vertical;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .03);
  color: var(--white);
  padding: 12px;
  font-size: 16px;
  line-height: 1.5;
  outline: none;
}
.note-area:focus { border-color: rgba(214, 179, 106, .45); }

/* knowledge list */
.search {
  width: 100%;
  height: 46px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .04);
  color: var(--white);
  padding: 0 14px;
  font-size: 16px;
  outline: none;
  margin-bottom: 12px;
}
.search:focus { border-color: rgba(214, 179, 106, .4); }
.k-group { margin-top: 18px; }
.k-group h3 { font-size: 11px; letter-spacing: .08em; color: var(--gold); text-transform: uppercase; margin: 0 2px 8px; }
.k-list { display: grid; gap: 9px; }
.k-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border-radius: 15px;
  background: var(--card);
  border: 1px solid var(--line);
  text-align: left;
  width: 100%;
}
.k-item .kid {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--gold-soft);
  border: 1px solid rgba(214, 179, 106, .25);
  color: var(--gold-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  flex: 0 0 auto;
}
.k-item .kt { flex: 1; min-width: 0; }
.k-item .kt strong { display: block; font-size: 13px; }
.k-item .kt span { display: block; font-size: 10px; color: var(--muted); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.k-item .chev { color: var(--muted); }
.k-item .chev svg { width: 16px; height: 16px; }

/* sheet */
#sheet-root { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .2s ease;
  pointer-events: auto;
}
.sheet {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translate(-50%, 100%);
  width: 100%;
  max-width: 560px;
  max-height: 92dvh;
  background: #0e151e;
  border-radius: 26px 26px 0 0;
  border: 1px solid var(--line);
  box-shadow: 0 -20px 60px rgba(0, 0, 0, .55);
  overflow: auto;
  padding: 10px 18px calc(22px + var(--safe-bottom));
  transition: transform .24s cubic-bezier(.22, .9, .3, 1);
  pointer-events: auto;
}
#sheet-root.open .sheet-backdrop { opacity: 1; }
#sheet-root.open .sheet { transform: translate(-50%, 0); }
.sheet-handle { width: 42px; height: 4px; border-radius: 999px; background: rgba(255, 255, 255, .18); margin: 4px auto 14px; }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.sheet-head h2 { font-size: 20px; }
.sheet-body { padding-bottom: 4px; }
.sheet-actions { display: flex; gap: 9px; margin-top: 16px; }
.sheet-actions .btn { flex: 1; }

.field { margin-top: 14px; }
.field label { display: block; font-size: 11px; color: var(--muted); margin-bottom: 7px; font-weight: 650; }
.field input[type="text"], .field input[type="url"], .field input[type="date"], .field input[type="number"], .field select, .field textarea {
  width: 100%;
  min-height: 46px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .04);
  color: var(--white);
  padding: 10px 12px;
  font-size: 16px;
  outline: none;
}
.field textarea { min-height: 86px; resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: rgba(214, 179, 106, .45); }
.field .hint { font-size: 10px; color: var(--muted); line-height: 1.5; margin-top: 6px; }

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line);
  padding: 4px;
  border-radius: 14px;
}
.segmented button {
  min-height: 40px;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.segmented button.active { background: var(--gold); color: #17120a; }
.assess-btns { grid-template-columns: repeat(5, 1fr); }
.assess-btns button { min-height: 36px; font-size: 12px; }

.range-field { margin-top: 14px; }
.range-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 2px; }
.range-top label { font-size: 11px; color: var(--muted); font-weight: 650; }
.range-top output { font-size: 14px; font-weight: 800; color: var(--gold-2); }

/* onboarding */
.onboarding {
  min-height: 100dvh;
  padding: calc(30px + var(--safe-top)) 22px calc(30px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  justify-content: center;
  background:
    radial-gradient(120% 70% at 50% 0%, rgba(214, 179, 106, .18), transparent 55%),
    linear-gradient(180deg, #0b1118, #070a0f 60%);
  position: relative;
  overflow: hidden;
}
.onboarding::before {
  content: "";
  position: absolute;
  width: 360px; height: 360px;
  right: -120px; top: -100px;
  border: 1px solid rgba(214, 179, 106, .16);
  border-radius: 50%;
  box-shadow: 0 0 0 50px rgba(214, 179, 106, .03), 0 0 0 110px rgba(214, 179, 106, .02);
}
.onboarding > * { position: relative; z-index: 1; }
.brand-mark {
  width: 54px; height: 54px; border-radius: 16px;
  border: 1px solid rgba(214, 179, 106, .45);
  background: rgba(214, 179, 106, .08);
  display: flex; align-items: center; justify-content: center;
  color: var(--gold-2); font-weight: 800; font-size: 16px; letter-spacing: .04em;
  margin-bottom: 22px;
}
.onboarding h1 { font-size: 36px; line-height: 1.08; margin-bottom: 10px; }
.onboarding h1 span { color: var(--gold); }
.onboarding .lead { color: #b8c1cf; font-size: 14px; line-height: 1.7; max-width: 360px; }
.onboarding-form { margin-top: 26px; }
.onboarding .btn { margin-top: 16px; }
.onboarding .fine { margin-top: 16px; font-size: 10px; color: var(--muted); line-height: 1.6; }
.demo-link { margin-top: 12px; background: transparent; color: var(--gold); font-size: 11px; font-weight: 700; padding: 6px; }

/* toast */
.toast-root { position: fixed; left: 0; right: 0; bottom: calc(84px + var(--safe-bottom)); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 80; pointer-events: none; padding: 0 18px; }
.toast {
  max-width: 420px;
  background: rgba(24, 34, 45, .98);
  border: 1px solid var(--line-strong);
  color: var(--white);
  border-radius: 14px;
  padding: 11px 14px;
  font-size: 12px;
  line-height: 1.5;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .45);
  animation: toastIn .2s ease;
}
.toast.red { border-color: rgba(255, 90, 103, .4); color: #ffb3b9; }
.toast.gold { border-color: rgba(214, 179, 106, .4); color: var(--gold-2); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* misc */
.divider { height: 1px; background: var(--line); margin: 16px 0; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.row + .row { margin-top: 12px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.hidden { display: none !important; }
.empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  border: 1px dashed var(--line-strong);
  border-radius: 18px;
}
.footer-note { margin: 18px 2px 0; font-size: 10px; color: var(--muted-2); line-height: 1.6; }
.gold { color: var(--gold-2); }
.red { color: #ff9aa2; }
.green { color: var(--green); }

@media (max-width: 380px) {
  h1 { font-size: 28px; }
  .hero h2 { font-size: 21px; }
  .screen { padding-left: 14px; padding-right: 14px; }
  .tabbar { padding-left: 6px; padding-right: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
