:root {
  --ink-900: #060a14;
  --ink-850: #080e1c;
  --ink-800: #0b1224;
  --ink-700: #111a30;
  --ink-600: #18233c;
  --line: rgba(148, 170, 220, 0.14);
  --line-strong: rgba(148, 170, 220, 0.28);
  --text: #e9edf8;
  --muted: #94a1c0;
  --faint: #6b7896;
  --amber: #f6b73c;
  --amber-bright: #ffd479;
  --mint: #46dfa0;
  --coral: #ff7a72;
  --violet: #8b7cf6;
  --sky: #56b8ff;
  --glass: rgba(255, 255, 255, 0.035);
  --glass-strong: rgba(255, 255, 255, 0.06);
  --shadow: 0 24px 60px -28px rgba(0, 0, 0, 0.9);
  --radius: 18px;
  --radius-sm: 12px;
  --sidebar: 264px;
  --font-ui: 'Manrope', system-ui, -apple-system, sans-serif;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-mono: 'DM Mono', ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ink-900);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 { margin: 0; line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
ul, ol { margin: 0; padding: 0; list-style: none; }

.skip-link {
  position: fixed; top: 8px; left: 8px; z-index: 200;
  padding: 10px 16px; border-radius: 10px;
  background: var(--amber); color: #1a1204; font-weight: 700;
  transform: translateY(-200%); transition: transform 0.2s;
}
.skip-link:focus { transform: none; }

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- backdrop ---------- */
.backdrop { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.glow {
  position: absolute; border-radius: 50%;
  filter: blur(90px); opacity: 0.5;
  animation: drift 26s ease-in-out infinite alternate;
}
.glow-one {
  width: 620px; height: 620px; top: -220px; left: -120px;
  background: radial-gradient(circle, rgba(246, 183, 60, 0.34), transparent 68%);
}
.glow-two {
  width: 720px; height: 720px; bottom: -300px; right: -180px;
  background: radial-gradient(circle, rgba(139, 124, 246, 0.3), transparent 68%);
  animation-delay: -13s;
}
@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(60px, 50px, 0) scale(1.12); }
}
.grid-lines {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(148, 170, 220, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 170, 220, 0.05) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 20%, transparent 78%);
}

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }

/* Full paywall: when the visitor is not an entitled member, the app chrome is
   hidden and the landing/login page takes the whole width. */
body.gated .shell { grid-template-columns: minmax(0, 1fr); }
body.gated .sidebar,
body.gated .tabbar { display: none; }
body.gated .content { padding-inline: clamp(20px, 6vw, 84px); }

.landing-feature-icon {
  display: grid; place-items: center;
  width: 44px; height: 44px;
  border-radius: 13px;
  font-size: 20px; color: var(--amber);
  background: rgba(246, 183, 60, 0.12);
  border: 1px solid rgba(246, 183, 60, 0.28);
}
.landing-price-row { display: flex; align-items: baseline; gap: 14px; margin-top: 14px; flex-wrap: wrap; }
.landing-price-value { font-family: var(--font-display); font-size: 44px; font-weight: 700; letter-spacing: -0.02em; }

.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 28px;
  padding: 26px 18px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(11, 18, 36, 0.86), rgba(6, 10, 20, 0.94));
  backdrop-filter: blur(14px);
}

.brand { display: flex; align-items: center; gap: 12px; padding: 0 6px; }
.brand-mark {
  display: grid; place-items: center;
  width: 42px; height: 42px; flex: none;
  border-radius: 13px;
  background: linear-gradient(145deg, var(--amber), #e08c1c);
  color: #1a1204; font-family: var(--font-display); font-size: 24px; font-weight: 700;
  box-shadow: 0 8px 22px -8px rgba(246, 183, 60, 0.7);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 15px; letter-spacing: -0.01em; }
.brand-text small { color: var(--faint); font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; }

.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav a {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: 12px;
  color: var(--muted); font-weight: 600; font-size: 14.5px;
  transition: color 0.18s, background 0.18s, transform 0.18s;
}
.nav a .nav-icon { font-size: 15px; opacity: 0.75; transition: opacity 0.18s, transform 0.25s; }
.nav a:hover { color: var(--text); background: var(--glass); transform: translateX(3px); }
.nav a:hover .nav-icon { opacity: 1; }
.nav a[aria-current='page'] {
  color: #1a1204;
  background: linear-gradient(120deg, var(--amber-bright), var(--amber));
  box-shadow: 0 10px 26px -14px rgba(246, 183, 60, 0.9);
}
.nav a[aria-current='page'] .nav-icon { opacity: 1; }

.sidebar-foot { display: flex; flex-direction: column; gap: 12px; }

.countdown-mini {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--glass);
}
.countdown-mini svg { width: 44px; height: 44px; flex: none; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: rgba(148, 170, 220, 0.18); stroke-width: 4; }
.ring-value {
  fill: none; stroke: var(--amber); stroke-width: 4; stroke-linecap: round;
  stroke-dasharray: 113.1; stroke-dashoffset: 113.1;
  transition: stroke-dashoffset 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}
.countdown-mini-label { display: flex; flex-direction: column; line-height: 1.25; }
.countdown-mini-label strong { font-family: var(--font-mono); font-size: 20px; color: var(--amber-bright); }
.countdown-mini-label small { color: var(--faint); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; }

.ghost-button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 12px; border-radius: 12px;
  border: 1px solid var(--line); background: transparent;
  cursor: pointer; text-align: left;
  transition: background 0.18s, border-color 0.18s;
}
.ghost-button:hover { background: var(--glass); border-color: var(--line-strong); }
.avatar {
  display: grid; place-items: center;
  width: 32px; height: 32px; flex: none; border-radius: 50%;
  background: linear-gradient(145deg, var(--violet), #5a4bc4);
  color: #fff; font-size: 13px; font-weight: 800;
}
.identity-text {
  flex: 1; min-width: 0;
  font-size: 13.5px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.content { min-width: 0; padding: 34px clamp(20px, 4vw, 52px) 96px; }

/* ---------- typography ---------- */
.eyebrow {
  font-family: var(--font-mono); font-size: 11.5px;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--amber); margin-bottom: 12px;
}
.display {
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.04; letter-spacing: -0.03em;
}
.display i { font-family: var(--font-display); font-style: italic; color: var(--amber-bright); font-weight: 600; }
.lede { color: var(--muted); font-size: 17px; max-width: 62ch; margin-top: 14px; }
.section-title { font-size: clamp(22px, 2.6vw, 30px); }
.section-title i { font-family: var(--font-display); font-style: italic; color: var(--amber-bright); font-weight: 600; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-family: var(--font-mono); }
.small { font-size: 13px; }

.view-head { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-end; justify-content: space-between; margin-bottom: 28px; }
.view-head > div:first-child { min-width: 0; }

.block { margin-top: 44px; }
.block-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: baseline; justify-content: space-between; margin-bottom: 16px; }

/* ---------- surfaces ---------- */
.card {
  position: relative;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(160deg, var(--glass-strong), rgba(255, 255, 255, 0.015));
  box-shadow: var(--shadow);
}
.card-kicker {
  font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--faint); margin-bottom: 10px;
}
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); }

.reveal { opacity: 0; transform: translateY(18px); }
.reveal.in { opacity: 1; transform: none; transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1); }

/* ---------- buttons ---------- */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 12px; border: 1px solid transparent;
  font-size: 14.5px; font-weight: 700; cursor: pointer;
  transition: transform 0.16s, box-shadow 0.2s, background 0.2s, border-color 0.2s, opacity 0.2s;
}
.button:hover:not(:disabled) { transform: translateY(-2px); }
.button:active:not(:disabled) { transform: translateY(0); }
.button:disabled { opacity: 0.45; cursor: not-allowed; }
.button-primary {
  background: linear-gradient(120deg, var(--amber-bright), var(--amber));
  color: #1a1204; box-shadow: 0 14px 30px -16px rgba(246, 183, 60, 0.95);
}
.button-primary:hover:not(:disabled) { box-shadow: 0 18px 38px -16px rgba(246, 183, 60, 1); }
.button-outline { border-color: var(--line-strong); background: var(--glass); color: var(--text); }
.button-outline:hover:not(:disabled) { border-color: var(--amber); background: rgba(246, 183, 60, 0.08); }
.button-quiet { background: transparent; color: var(--muted); padding: 8px 12px; }
.button-quiet:hover:not(:disabled) { color: var(--text); background: var(--glass); }
.button-small { padding: 7px 13px; font-size: 13px; border-radius: 10px; }
.button-danger { border-color: rgba(255, 122, 114, 0.4); color: var(--coral); background: rgba(255, 122, 114, 0.08); }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ---------- chips ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--muted); background: var(--glass); white-space: nowrap;
}
.chip-varc { color: var(--sky); border-color: rgba(86, 184, 255, 0.34); background: rgba(86, 184, 255, 0.1); }
.chip-dilr { color: var(--violet); border-color: rgba(139, 124, 246, 0.34); background: rgba(139, 124, 246, 0.1); }
.chip-qa { color: var(--mint); border-color: rgba(70, 223, 160, 0.34); background: rgba(70, 223, 160, 0.1); }
.chip-amber { color: var(--amber-bright); border-color: rgba(246, 183, 60, 0.36); background: rgba(246, 183, 60, 0.1); }
.chip-solid { border-color: transparent; }

.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tab {
  padding: 8px 16px; border-radius: 999px;
  border: 1px solid var(--line); background: transparent;
  color: var(--muted); font-size: 13.5px; font-weight: 700; cursor: pointer;
  transition: color 0.18s, background 0.18s, border-color 0.18s;
}
.tab:hover { color: var(--text); border-color: var(--line-strong); }
.tab[aria-selected='true'] { color: #1a1204; background: var(--amber); border-color: transparent; }

/* ---------- stats ---------- */
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat-value { font-family: var(--font-mono); font-size: 30px; line-height: 1; color: var(--text); }
.stat-value.accent { color: var(--amber-bright); }
.stat-label { font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); }

/* ---------- meters ---------- */
.meter { height: 6px; border-radius: 999px; background: rgba(148, 170, 220, 0.16); overflow: hidden; }
.meter > span {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--amber), var(--amber-bright));
  transform-origin: left; animation: grow 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}
.meter.mint > span { background: linear-gradient(90deg, #2bb87f, var(--mint)); }
.meter.violet > span { background: linear-gradient(90deg, #6a5ae0, var(--violet)); }
.meter.sky > span { background: linear-gradient(90deg, #2f8fd6, var(--sky)); }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---------- topics ---------- */
.topic {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--glass); overflow: hidden;
  transition: border-color 0.2s, background 0.2s;
}
.topic:hover { border-color: var(--line-strong); }
.topic[open] { background: rgba(255, 255, 255, 0.05); border-color: rgba(246, 183, 60, 0.3); }
.topic-head {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 14px; align-items: center;
  padding: 15px 18px; cursor: pointer; list-style: none;
}
.topic-head::-webkit-details-marker { display: none; }
.topic-rank { font-family: var(--font-mono); font-size: 13px; color: var(--faint); }
.topic-name { font-weight: 700; font-size: 15px; }
.topic-sub { display: block; font-size: 12.5px; color: var(--faint); font-weight: 500; }
.topic-weight { font-family: var(--font-mono); font-size: 15px; color: var(--amber-bright); min-width: 34px; text-align: right; }
.topic-caret { color: var(--faint); transition: transform 0.25s; }
.topic[open] .topic-caret { transform: rotate(90deg); color: var(--amber); }
.topic-body { padding: 0 18px 20px; display: flex; flex-direction: column; gap: 18px; border-top: 1px solid var(--line); }
.topic-body > * { padding-top: 18px; }
.topic-list { display: flex; flex-direction: column; gap: 10px; }

.bullet-list { display: flex; flex-direction: column; gap: 9px; }
.bullet-list li { position: relative; padding-left: 22px; color: var(--muted); font-size: 14.5px; }
.bullet-list li::before {
  content: ''; position: absolute; left: 4px; top: 9px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--amber);
}
.numbered { counter-reset: step; display: flex; flex-direction: column; gap: 10px; }
.numbered li {
  counter-increment: step; position: relative; padding-left: 34px;
  color: var(--muted); font-size: 14.5px;
}
.numbered li::before {
  content: counter(step); position: absolute; left: 0; top: 1px;
  display: grid; place-items: center; width: 22px; height: 22px;
  border-radius: 7px; background: rgba(246, 183, 60, 0.14);
  color: var(--amber-bright); font-family: var(--font-mono); font-size: 11.5px;
}
.trap-list li::before { background: var(--coral); }

.subhead {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--faint); margin-bottom: 10px;
}

/* ---------- tables ---------- */
.tool { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.tool-title {
  padding: 11px 15px; font-size: 13px; font-weight: 700;
  background: rgba(246, 183, 60, 0.07); border-bottom: 1px solid var(--line);
}
.tool table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tool th, .tool td { padding: 8px 14px; text-align: left; border-bottom: 1px solid rgba(148, 170, 220, 0.08); }
.tool th { color: var(--faint); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 600; }
.tool td:first-child { font-family: var(--font-mono); color: var(--amber-bright); white-space: nowrap; }
.tool tr:last-child td { border-bottom: none; }
.tool td.note { color: var(--faint); font-size: 12.5px; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 7px; }
.field > label, .field-label {
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--faint);
}
.input, .textarea, .select {
  width: 100%; padding: 11px 14px;
  border: 1px solid var(--line); border-radius: 11px;
  background: rgba(6, 10, 20, 0.6); color: var(--text);
  transition: border-color 0.18s, background 0.18s;
}
.input:focus, .textarea:focus, .select:focus {
  outline: none; border-color: var(--amber); background: rgba(6, 10, 20, 0.85);
}
.textarea { resize: vertical; min-height: 96px; line-height: 1.55; }
.select { appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 38px; }
.select option { background: var(--ink-800); }
.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.hint { font-size: 12.5px; color: var(--faint); }
.counter { font-family: var(--font-mono); font-size: 11.5px; color: var(--faint); text-align: right; }

.level-picker { display: flex; gap: 6px; }
.level-picker button {
  flex: 1; padding: 9px 0; border-radius: 10px;
  border: 1px solid var(--line); background: transparent;
  font-family: var(--font-mono); font-size: 13px; color: var(--muted); cursor: pointer;
  transition: all 0.18s;
}
.level-picker button:hover { border-color: var(--line-strong); color: var(--text); }
.level-picker button[aria-pressed='true'] {
  background: linear-gradient(120deg, var(--amber-bright), var(--amber));
  color: #1a1204; border-color: transparent; font-weight: 700;
}

/* ---------- planner ---------- */
.phases { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); }
.phase {
  position: relative; padding: 18px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--glass); overflow: hidden;
}
.phase::after {
  content: ''; position: absolute; inset: auto 0 0 0; height: 3px;
  background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
}
.phase.active { border-color: rgba(246, 183, 60, 0.45); background: rgba(246, 183, 60, 0.07); }
.phase.active::after { background: linear-gradient(90deg, var(--amber), var(--amber-bright)); }
.phase.done { opacity: 0.55; }
.phase-number { font-family: var(--font-mono); font-size: 12px; color: var(--faint); }
.phase h3 { font-size: 16px; margin: 6px 0 6px; }
.phase p { font-size: 13px; color: var(--muted); }
.phase-tag {
  display: inline-block; margin-top: 12px; padding: 3px 9px; border-radius: 999px;
  background: rgba(148, 170, 220, 0.12); font-size: 11px; font-weight: 700; color: var(--muted);
}
.phase.active .phase-tag { background: rgba(246, 183, 60, 0.18); color: var(--amber-bright); }

.checklist { display: flex; flex-direction: column; gap: 8px; }
.task {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px; align-items: center;
  padding: 13px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--glass);
  cursor: pointer; transition: border-color 0.2s, background 0.2s, opacity 0.2s;
  text-align: left; width: 100%;
}
.task:hover { border-color: var(--line-strong); background: rgba(255, 255, 255, 0.055); }
.task-box {
  display: grid; place-items: center;
  width: 22px; height: 22px; border-radius: 7px;
  border: 2px solid var(--line-strong); color: transparent;
  font-size: 13px; transition: all 0.2s;
}
.task[aria-pressed='true'] .task-box {
  background: var(--mint); border-color: var(--mint); color: #06281c;
}
.task[aria-pressed='true'] .task-name { text-decoration: line-through; color: var(--faint); }
.task-name { font-weight: 700; font-size: 14.5px; }
.task-note { display: block; font-size: 12.5px; color: var(--faint); font-weight: 500; }
.task-time { font-family: var(--font-mono); font-size: 12.5px; color: var(--amber-bright); white-space: nowrap; }
.task[aria-pressed='true'] .task-time { color: var(--mint); }

.week-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 128px), 1fr)); }
.day-cell {
  padding: 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--glass);
  cursor: pointer; text-align: left; transition: all 0.18s;
}
.day-cell:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.day-cell.today { border-color: rgba(246, 183, 60, 0.5); background: rgba(246, 183, 60, 0.08); }
.day-cell.selected { border-color: var(--amber); box-shadow: 0 0 0 1px var(--amber) inset; }
.day-name { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); }
.day-num { font-family: var(--font-mono); font-size: 19px; color: var(--text); }
.day-dots { display: flex; gap: 3px; margin-top: 8px; }
.day-dot { width: 100%; height: 3px; border-radius: 2px; background: rgba(148, 170, 220, 0.2); }
.day-dot.on { background: var(--mint); }

/* ---------- community ---------- */
.composer { display: flex; flex-direction: column; gap: 12px; }
.post {
  padding: 18px 20px; border-radius: var(--radius);
  border: 1px solid var(--line); background: linear-gradient(160deg, var(--glass-strong), rgba(255, 255, 255, 0.012));
  transition: border-color 0.2s, transform 0.2s;
}
.post:hover { border-color: var(--line-strong); }
.post-top { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 10px; }
.post-author { display: flex; align-items: center; gap: 9px; min-width: 0; }
.post-author .avatar { width: 28px; height: 28px; font-size: 11.5px; }
.post-meta { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.post-meta strong { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.post-meta span { font-size: 11.5px; color: var(--faint); }
.post-title { font-size: 18px; margin-bottom: 7px; letter-spacing: -0.015em; }
.post-title.link { cursor: pointer; transition: color 0.18s; }
.post-title.link:hover { color: var(--amber-bright); }
.post-body {
  color: var(--muted); font-size: 14.5px;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.post-body.clamped { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.post-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; }
.action-button {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 13px; border-radius: 999px;
  border: 1px solid var(--line); background: transparent;
  color: var(--muted); font-size: 13px; font-weight: 700; cursor: pointer;
  transition: all 0.18s;
}
.action-button:hover:not(:disabled) { color: var(--text); border-color: var(--line-strong); background: var(--glass); }
.action-button:disabled { opacity: 0.5; cursor: not-allowed; }
.action-button.on { color: var(--coral); border-color: rgba(255, 122, 114, 0.42); background: rgba(255, 122, 114, 0.1); }
.action-button .count { font-family: var(--font-mono); }

.replies { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.reply {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px;
  padding: 14px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--glass);
  animation: slide-in 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes slide-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.reply .avatar { width: 30px; height: 30px; font-size: 12px; }

/* ---------- library ---------- */
.paper-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.paper {
  display: flex; flex-direction: column; gap: 9px;
  padding: 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--glass);
  transition: all 0.2s;
}
.paper:hover { border-color: rgba(246, 183, 60, 0.4); background: rgba(246, 183, 60, 0.05); transform: translateY(-2px); }
.paper-title { font-weight: 700; font-size: 14.5px; }
.paper-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.paper-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 6px; }

/* ---------- timed attempts ---------- */
.runner { border-color: rgba(246, 183, 60, 0.3); background: linear-gradient(160deg, rgba(246, 183, 60, 0.07), var(--glass)); }
.run-clock {
  display: block; margin-top: 18px;
  font-size: clamp(52px, 13vw, 92px); line-height: 1; font-weight: 500;
  letter-spacing: -0.03em; color: var(--amber-bright);
  font-variant-numeric: tabular-nums;
}
.run-clock.over { color: var(--coral); }
.trend { display: flex; align-items: flex-end; gap: 8px; min-height: 150px; }
.trend-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; min-width: 0; height: 150px; }
.trend-value { font-size: 11.5px; color: var(--muted); }
.trend-bar {
  width: 100%; max-width: 42px; border-radius: 7px 7px 3px 3px;
  background: linear-gradient(180deg, var(--amber-bright), rgba(246, 183, 60, 0.35));
}
.trend-bar.low { background: linear-gradient(180deg, var(--coral), rgba(255, 122, 114, 0.3)); }
.trend-index { font-size: 10.5px; color: var(--faint); }
.archive-card {
  display: block; border-color: rgba(86, 184, 255, 0.32);
  background: linear-gradient(150deg, rgba(86, 184, 255, 0.09), var(--glass));
  transition: all 0.2s;
}
.archive-card:hover { transform: translateY(-2px); border-color: var(--sky); }
.card.cleared { opacity: 0.55; }
.card.cleared:hover { opacity: 1; }

.drill-options { display: flex; flex-direction: column; gap: 8px; }
.option {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: center;
  padding: 12px 15px; border-radius: 11px;
  border: 1px solid var(--line); background: rgba(6, 10, 20, 0.4);
  cursor: pointer; text-align: left; font-size: 14.5px;
  transition: all 0.18s;
}
.option:hover:not(:disabled) { border-color: var(--line-strong); background: rgba(255, 255, 255, 0.05); }
.option:disabled { cursor: default; }
.option-letter {
  display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px;
  background: rgba(148, 170, 220, 0.14); font-family: var(--font-mono); font-size: 12px; color: var(--muted);
}
.option.selected { border-color: var(--amber); background: rgba(246, 183, 60, 0.1); }
.option.selected .option-letter { background: var(--amber); color: #1a1204; }
.option.correct { border-color: var(--mint); background: rgba(70, 223, 160, 0.12); }
.option.correct .option-letter { background: var(--mint); color: #06281c; }
.option.wrong { border-color: var(--coral); background: rgba(255, 122, 114, 0.12); }
.option.wrong .option-letter { background: var(--coral); color: #2b0a08; }

/* ---------- practice player ---------- */
.player-grid { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1100px) {
  .player-grid:has(.stimulus) { grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); align-items: start; }
}
.q-clock {
  font-size: clamp(26px, 5vw, 38px); line-height: 1; font-weight: 500;
  letter-spacing: -0.02em; color: var(--amber-bright); font-variant-numeric: tabular-nums;
}
.q-clock.over { color: var(--coral); }
.q-prompt { font-size: 16.5px; line-height: 1.6; margin: 4px 0 16px; }
.stimulus {
  padding: 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: rgba(6, 10, 20, 0.42);
}
@media (min-width: 1100px) {
  .stimulus { position: sticky; top: 18px; max-height: calc(100vh - 120px); overflow: auto; }
}
.stimulus-body { font-size: 14.5px; line-height: 1.72; color: var(--muted); white-space: pre-wrap; margin-top: 8px; }
.tita-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tita-input { max-width: 320px; font-family: var(--font-mono); }
.feedback {
  margin-top: 16px; padding: 14px 16px; border-radius: var(--radius-sm);
  border-left: 3px solid var(--mint); background: rgba(70, 223, 160, 0.07);
  font-size: 14px; color: var(--muted);
}
.feedback.bad { border-left-color: var(--coral); background: rgba(255, 122, 114, 0.07); }
.feedback-head { display: flex; align-items: baseline; gap: 6px; }
.feedback-head strong { color: var(--text); font-size: 15px; }
.takeaway {
  margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line);
  font-size: 13.5px; line-height: 1.6; color: var(--text);
}
.review-row {
  padding: 14px 16px; margin-bottom: 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); border-left: 3px solid var(--mint);
  background: rgba(6, 10, 20, 0.34);
}
.review-row.bad { border-left-color: var(--coral); }
.review-row.skip { border-left-color: var(--line-strong); opacity: 0.72; }
.topic-card { display: flex; flex-direction: column; }
.topic-card strong { line-height: 1.35; }

.callout {
  padding: 14px 16px; border-radius: var(--radius-sm);
  border-left: 3px solid var(--amber); background: rgba(246, 183, 60, 0.07);
  font-size: 14px; color: var(--muted);
}
.callout.mint { border-left-color: var(--mint); background: rgba(70, 223, 160, 0.07); }
.callout.coral { border-left-color: var(--coral); background: rgba(255, 122, 114, 0.07); }
.callout strong { color: var(--text); }

/* ---------- states ---------- */
.empty {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 46px 24px; text-align: center;
  border: 1px dashed var(--line-strong); border-radius: var(--radius);
  color: var(--muted);
}
.empty-icon { font-size: 30px; opacity: 0.5; }
.empty strong { color: var(--text); font-size: 16px; }

.skeleton {
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, rgba(148, 170, 220, 0.07), rgba(148, 170, 220, 0.15), rgba(148, 170, 220, 0.07));
  background-size: 200% 100%; animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.skeleton-line { height: 13px; margin-bottom: 9px; }
.skeleton-card { height: 108px; }

.notice {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 122, 114, 0.32); background: rgba(255, 122, 114, 0.08);
  font-size: 14px; color: var(--muted);
}
.notice.warn { border-color: rgba(246, 183, 60, 0.32); background: rgba(246, 183, 60, 0.08); }
.notice strong { color: var(--text); }

.plan-points { margin-top: 14px; display: flex; flex-direction: column; gap: 9px; }
.plan-points li { position: relative; padding-left: 24px; font-size: 14px; color: var(--muted); }
.plan-points li::before {
  content: '✓'; position: absolute; left: 0; top: 0;
  color: var(--mint); font-weight: 700;
}

.boot { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 120px 0; color: var(--faint); }
.boot-spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid rgba(148, 170, 220, 0.2); border-top-color: var(--amber);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.spinner-inline {
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid rgba(26, 18, 4, 0.3); border-top-color: #1a1204;
  animation: spin 0.7s linear infinite;
}

/* ---------- toast ---------- */
.toast-region {
  position: fixed; z-index: 120; bottom: 24px; left: 50%;
  transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none; width: min(92vw, 460px);
}
.toast {
  padding: 12px 18px; border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: rgba(17, 26, 48, 0.96); backdrop-filter: blur(10px);
  box-shadow: var(--shadow); font-size: 14px; font-weight: 600;
  animation: toast-in 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  max-width: 100%;
}
.toast.good { border-color: rgba(70, 223, 160, 0.45); color: var(--mint); }
.toast.bad { border-color: rgba(255, 122, 114, 0.45); color: var(--coral); }
.toast.out { animation: toast-out 0.28s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(10px) scale(0.97); } }

/* ---------- modal ---------- */
.modal {
  width: min(94vw, 560px); padding: 0;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--ink-800); color: var(--text);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.95);
}
.modal::backdrop { background: rgba(3, 6, 14, 0.78); backdrop-filter: blur(6px); }
.modal-inner { padding: 26px; display: flex; flex-direction: column; gap: 16px; }
.modal[open] { animation: pop 0.28s cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(0.97); } to { opacity: 1; transform: none; } }

/* ---------- hero ---------- */
.hero { display: grid; gap: 26px; grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.85fr); align-items: center; }
.hero-countdown {
  position: relative; overflow: hidden;
  padding: 26px; border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(246, 183, 60, 0.12), rgba(139, 124, 246, 0.08));
  text-align: center;
}
.hero-days { font-family: var(--font-mono); font-size: clamp(52px, 9vw, 78px); line-height: 1; color: var(--amber-bright); }
.hero-days-label { font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }
.hero-split { display: flex; justify-content: center; gap: 22px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.hero-split div { display: flex; flex-direction: column; }
.hero-split strong { font-family: var(--font-mono); font-size: 19px; }
.hero-split span { font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); }

/* ---------- tabbar (mobile) ---------- */
.tabbar { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  /* The tabbar replaces the sidebar entirely; leaving it rendered hid it behind
     the tabbar while still inflating the content padding. */
  .sidebar { display: none; }
  .tabbar {
    display: grid; grid-template-columns: repeat(7, 1fr);
    position: fixed; inset: auto 0 0 0; z-index: 100;
    padding: 7px 4px calc(7px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: rgba(8, 14, 28, 0.97); backdrop-filter: blur(14px);
  }
  .tabbar a {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 6px 1px; border-radius: 10px;
    font-size: 9px; font-weight: 700; color: var(--faint);
    transition: color 0.18s, background 0.18s;
  }
  .tabbar a span { font-size: 16px; }
  .tabbar a[aria-current='page'] { color: var(--amber-bright); background: rgba(246, 183, 60, 0.12); }
  .content { padding: 24px 18px calc(84px + env(safe-area-inset-bottom)); }
  .hero { grid-template-columns: minmax(0, 1fr); }
  .topic-head { grid-template-columns: minmax(0, 1fr) auto auto; }
  .topic-rank { display: none; }
  .toast-region { bottom: calc(72px + env(safe-area-inset-bottom)); }
}

@media (max-width: 520px) {
  .view-head { align-items: flex-start; }
  .card { padding: 18px; }
  .stat-value { font-size: 25px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}

@media print {
  .sidebar, .tabbar, .backdrop, .toast-region, .button, .action-button { display: none !important; }
  body { background: #fff; color: #000; }
  .content { padding: 0; }
}
