/* App-specific styles: nav, dashboard, login, account.
   Builds on brand.css. */

/* === Top Nav === */
.app-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 11, 0.85);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border-faint);
}
.app-nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0.875rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}
.app-nav .brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text-primary);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.app-nav .brand-mark {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.app-nav .brand-mark img,
.app-nav .brand-mark svg { width: 100%; height: 100%; object-fit: contain; display: block; }
.app-nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.app-nav-link {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 0.9375rem;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.5rem 0.875rem;
  border-radius: 999px;
  transition: color 0.15s ease, background 0.15s ease;
}
.app-nav-link:hover { color: var(--text-primary); background: rgba(255, 255, 255, 0.04); }
.app-nav-link.active { color: var(--text-primary); background: rgba(255, 255, 255, 0.06); }
.app-nav-cta {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border-soft);
  padding: 0.5rem 0.875rem;
  border-radius: 999px;
  cursor: pointer;
}
.app-nav-cta:hover { color: var(--text-primary); border-color: var(--border-mid); }

/* Hamburger button (mobile only) */
.app-nav-burger {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
}
.app-nav-burger:hover { border-color: var(--border-mid); }
.app-nav-burger svg { width: 18px; height: 18px; }

/* Mobile menu sheet (hidden by default) */
.app-nav-sheet {
  display: none;
  position: fixed;
  top: 56px;
  left: 0; right: 0;
  background: rgba(10, 10, 11, 0.96);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border-faint);
  padding: 1rem;
  z-index: 99;
  flex-direction: column;
  gap: 0.25rem;
}
.app-nav-sheet.open { display: flex; }
.app-nav-sheet .app-nav-link {
  display: block;
  padding: 0.875rem 1rem;
  border-radius: 12px;
  font-size: 1rem;
}
.app-nav-sheet .app-nav-cta {
  display: block;
  text-align: left;
  padding: 0.875rem 1rem;
  border-radius: 12px;
  font-size: 1rem;
  margin-top: 0.5rem;
  border-color: var(--border-soft);
}

@media (max-width: 720px) {
  .app-nav-inner { gap: 0.75rem; padding: 0.75rem 1rem; }
  .app-nav-links { display: none; }
  .app-nav-burger { display: inline-flex; }
}

/* === Page layout helpers === */
.page { padding: 3rem 0 5rem; }
.page-hero { margin-bottom: 3rem; }
.page-hero h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin: 0 0 0.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.page-hero p { font-size: 1.0625rem; color: var(--text-secondary); margin: 0; max-width: 60ch; }

.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }

/* === Login page === */
.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  position: relative;
}
.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  position: relative;
  z-index: 3;
}
.auth-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-secondary);
  margin-bottom: 1.75rem;
}
.auth-mark-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
}
.auth-mark-tile img { width: 100%; height: 100%; object-fit: contain; display: block; }
.auth-card h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}
.auth-card .sub {
  color: var(--text-secondary);
  margin: 0 0 1.75rem;
  font-size: 0.9375rem;
}
.auth-form { display: grid; gap: 0.75rem; }
.input {
  width: 100%;
  background: var(--bg-overlay);
  border: 1px solid var(--border-soft);
  color: var(--text-primary);
  padding: 0.875rem 1rem;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  outline: none;
  transition: border-color 0.15s ease;
}
.input::placeholder { color: var(--text-faint); }
.input:focus { border-color: var(--brand-orange); }
.input.code {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  letter-spacing: 0.4em;
  text-align: center;
  padding: 1rem;
}
.btn-full { width: 100%; }
.auth-msg {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
}
.auth-msg.error { background: rgba(217, 28, 92, 0.12); border: 1px solid rgba(217, 28, 92, 0.3); color: #ffb0c4; }
.auth-msg.info { background: rgba(247, 152, 29, 0.1); border: 1px solid rgba(247, 152, 29, 0.25); color: var(--text-primary); }
.auth-msg.dev { background: rgba(247, 152, 29, 0.18); border: 1px dashed rgba(247, 152, 29, 0.5); color: var(--brand-orange); font-family: var(--font-mono); font-size: 0.8125rem; }
.auth-back {
  display: inline-block;
  margin-top: 1rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
}
.auth-back:hover { color: var(--text-primary); }
.auth-footer {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-faint);
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.auth-footer a { color: var(--text-secondary); }

/* === Dashboard === */
.dash-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.5rem;
  margin-top: 2.5rem;
}
@media (max-width: 920px) { .dash-grid { grid-template-columns: 1fr; } }

.next-up-card {
  background: var(--bg-card);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-lg);
  padding: 2rem;
  position: relative;
  overflow: hidden;
}
.next-up-card .eyebrow {
  display: inline-block;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand-orange);
  margin-bottom: 0.75rem;
}
.next-up-card h2 {
  font-size: 1.625rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  letter-spacing: -0.01em;
}
.next-up-card .meta {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}
.next-up-card .actions { display: flex; gap: 0.625rem; flex-wrap: wrap; }
.next-up-card.done { background: linear-gradient(135deg, rgba(247,152,29,0.08), rgba(217,28,92,0.08)), var(--bg-card); }

.progress-card {
  background: var(--bg-card);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-lg);
  padding: 2rem;
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 1.5rem;
  align-items: center;
}
.progress-ring { position: relative; width: 110px; height: 110px; }
.progress-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.progress-ring circle { fill: none; stroke-width: 8; }
.progress-ring .bg { stroke: rgba(255,255,255,0.06); }
.progress-ring .fg { stroke: url(#progress-grad); stroke-linecap: round; transition: stroke-dashoffset 0.5s ease; }
.progress-ring .label {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-heading); font-weight: 800; font-size: 1.5rem; letter-spacing: -0.03em;
}
.progress-ring .label small { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); margin-left: 2px; letter-spacing: 0; }
.progress-card .text h3 { margin: 0 0 0.25rem; font-size: 1rem; font-weight: 600; color: var(--text-primary); font-family: var(--font-heading); }
.progress-card .text p { margin: 0; color: var(--text-secondary); font-size: 0.875rem; line-height: 1.5; }

.weeks-card {
  background: var(--bg-card);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-top: 1.5rem;
}
.weeks-card h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1rem;
  margin: 0 0 1.25rem;
}
.weeks-list { display: grid; gap: 0.875rem; }
.week-row {
  display: grid;
  grid-template-columns: 64px 1fr 56px;
  gap: 1rem;
  align-items: center;
}
.week-row .num {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.week-row .title { font-size: 0.9375rem; color: var(--text-primary); font-weight: 500; }
.week-row .stat { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--text-muted); text-align: right; }
.week-bar { grid-column: 1 / -1; height: 4px; background: rgba(255,255,255,0.05); border-radius: 999px; overflow: hidden; }
.week-bar .fill { height: 100%; background: var(--brand-gradient); border-radius: 999px; transition: width 0.4s ease; }

.declaration-card {
  background: var(--bg-card);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-lg);
  padding: 2rem;
}
.declaration-card h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1rem;
  margin: 0 0 0.5rem;
}
.declaration-card .countdown {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 2.25rem;
  letter-spacing: -0.02em;
  margin: 0.5rem 0;
}
.declaration-card .countdown.urgent { background: var(--brand-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.declaration-card .what {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin: 0 0 1rem;
  min-height: 1.3em;
}
.declaration-card .form { display: grid; gap: 0.625rem; margin-top: 1rem; }
.declaration-card .form input { padding: 0.625rem 0.875rem; font-size: 0.875rem; }
.declaration-card .form .btn { padding: 0.625rem 1rem; font-size: 0.8125rem; }

/* === Account page === */
.account-grid { display: grid; gap: 1.25rem; max-width: 600px; }
.kv-card {
  background: var(--bg-card);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
}
.kv-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-faint);
}
.kv-row:last-child { border-bottom: none; }
.kv-row .k {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
}
.kv-row .v { color: var(--text-primary); font-size: 0.9375rem; min-width: 0; word-break: break-word; overflow-wrap: anywhere; }
@media (max-width: 540px) {
  .kv-row { grid-template-columns: 1fr; gap: 0.25rem; }
  .kv-row .k { padding-top: 0.25rem; }
}
.tier-pill {
  display: inline-block;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  background: var(--brand-gradient);
  color: #fff;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* === Sticky day-nav for the program page === */
.program-layout { display: grid; grid-template-columns: 240px 1fr; gap: 2.5rem; align-items: start; max-width: var(--container); margin: 2rem auto 0; padding: 0 1.5rem; }
@media (max-width: 960px) { .program-layout { grid-template-columns: 1fr; } }
.day-nav {
  position: sticky;
  top: 4.5rem;
  max-height: calc(100vh - 6rem);
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-lg);
  padding: 1rem;
  font-size: 0.875rem;
}
@media (max-width: 960px) { .day-nav { position: static; max-height: none; } }
.day-nav-week { margin-bottom: 0.75rem; }
.day-nav-week-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.5rem 0.75rem;
}
.day-nav-day {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--font-body);
  color: var(--text-secondary);
  text-decoration: none;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-size: 0.875rem;
  transition: background 0.1s ease;
}
.day-nav-day:hover { background: rgba(255, 255, 255, 0.04); color: var(--text-primary); }
.day-nav-day.active { background: rgba(255, 255, 255, 0.06); color: var(--text-primary); }
.day-nav-day .dot {
  width: 14px; height: 14px; border-radius: 50%;
  border: 1.5px solid var(--border-mid);
  flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 9px; line-height: 1;
}
.day-nav-day.done .dot { background: var(--brand-gradient); border-color: transparent; color: #fff; }
.day-nav-day .label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.8125rem; }

/* === Toast === */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  padding: 0.875rem 1.25rem;
  background: var(--bg-overlay);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-pill);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-primary);
  z-index: 200;
  box-shadow: 0 10px 40px -10px rgba(0,0,0,0.6);
  transition: transform 0.25s ease;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.success { border-color: rgba(247,152,29,0.4); }

/* === Content card grid (hub pages) === */
.hub-section { margin: 2.5rem 0 3.5rem; }
.hub-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  gap: 1rem;
}
.hub-section-head h2 {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.25rem;
  margin: 0;
  letter-spacing: -0.01em;
}
.hub-section-head .sub { color: var(--text-muted); font-size: 0.875rem; margin: 0; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.content-card {
  background: var(--bg-card);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
  position: relative;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.content-card:hover { border-color: var(--border-mid); transform: translateY(-2px); }
.content-card.locked { opacity: 0.7; }
.content-card.locked:hover { transform: none; }

.content-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.content-card-type {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}
.content-card-type .icon {
  font-size: 1rem;
  line-height: 1;
  letter-spacing: 0;
  filter: saturate(1.2);
}
.content-card h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.125rem;
  margin: 0;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.content-card h3 .h-icon { font-size: 1.25rem; line-height: 1; }
.relative-time {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-left: auto;
  white-space: nowrap;
}
.content-card h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.125rem;
  margin: 0;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}
.content-card p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.5;
  flex: 1;
}
.content-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-family: var(--font-heading);
}
.content-card-foot .arrow { color: var(--brand-orange); font-weight: 600; }

/* Tier pills (kept for internal/admin use only - not used on member-facing cards anymore) */
.tier-badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.625rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
}
.tier-badge.free         { background: rgba(255,255,255,0.06); color: var(--text-secondary); border: 1px solid var(--border-soft); }
.tier-badge.orchestrator { background: rgba(247,152,29,0.15); color: #ffba66; border: 1px solid rgba(247,152,29,0.3); }
.tier-badge.architect    { background: var(--brand-gradient); color: #fff; }
.tier-badge.insider      { background: rgba(217,28,92,0.2); color: #ff7ea3; border: 1px solid rgba(217,28,92,0.4); }
.tier-badge.coming       { background: rgba(255,255,255,0.04); color: var(--text-faint); border: 1px dashed var(--border-soft); }

/* Skill-level badges - the member-facing way we tag content */
.level-badges {
  display: inline-flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}
.level-badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  border: 1px solid transparent;
}
.level-badge.level-beginner     { background: rgba(126, 211, 137, 0.12); color: #8fdca0; border-color: rgba(126, 211, 137, 0.3); }
.level-badge.level-intermediate { background: rgba(247, 152, 29, 0.14);  color: #ffba66; border-color: rgba(247, 152, 29, 0.3); }
.level-badge.level-advanced     { background: rgba(217, 28, 92, 0.16);   color: #ff7ea3; border-color: rgba(217, 28, 92, 0.35); }

/* Filter pills - "All | Beginner | Intermediate | Advanced" */
.level-filter {
  display: flex;
  gap: 0.375rem;
  margin: 0 0 1.5rem;
  flex-wrap: wrap;
}
.level-filter-pill {
  background: transparent;
  border: 1px solid var(--border-soft);
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.8125rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.level-filter-pill:hover { color: var(--text-primary); border-color: var(--border-mid); }
.level-filter-pill.active {
  background: var(--brand-gradient);
  color: #fff;
  border-color: transparent;
}

/* Long-form prose pages (resources/two-lanes, etc.) */
.prose {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 0.5rem;
}
.prose h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 0 0 0.5rem;
  line-height: 1.1;
}
.prose .deck {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin: 0 0 2.5rem;
  line-height: 1.5;
}
.prose h2 {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.5rem;
  margin: 2.5rem 0 1rem;
  letter-spacing: -0.01em;
}
.prose h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.125rem;
  margin: 2rem 0 0.5rem;
  letter-spacing: -0.01em;
}
.prose p { margin: 0 0 1.125rem; color: var(--text-secondary); font-size: 1rem; line-height: 1.7; }
.prose p strong { color: var(--text-primary); }
.prose .pull {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.5rem;
  line-height: 1.3;
  color: var(--text-primary);
  border-left: 2px solid;
  border-image: var(--brand-gradient) 1;
  padding: 0.25rem 0 0.25rem 1.5rem;
  margin: 2rem 0;
}
.prose .value-card {
  background: var(--bg-card);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-md);
  padding: 1.5rem 1.75rem;
  margin: 1rem 0;
}
.prose .value-card h3 {
  margin: 0 0 0.5rem;
  display: flex;
  align-items: baseline;
  gap: 0.625rem;
}
.prose .value-card h3 .num {
  font-family: var(--font-heading);
  font-weight: 800;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: 1rem;
}
.prose .value-card p { margin: 0 0 0.5rem; font-size: 0.9375rem; line-height: 1.6; }

/* Library item rows */
.library-list { display: grid; gap: 0.625rem; }
.library-item {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease;
}
.library-item:hover { border-color: var(--border-mid); }
.library-item .icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: rgba(255,255,255,0.04);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-heading); font-weight: 800; font-size: 0.6875rem; color: var(--text-secondary);
  letter-spacing: 0.06em;
}
.library-item .icon.pdf { color: #ff7e7e; }
.library-item .icon.doc { color: #7eafff; }
.library-item .icon.ppt { color: #ffb547; }
.library-item .meta { font-size: 0.875rem; color: var(--text-secondary); }
.library-item .title { font-weight: 500; color: var(--text-primary); font-family: var(--font-heading); font-size: 1rem; line-height: 1.3; }
.library-item .arrow { color: var(--brand-orange); font-weight: 600; font-family: var(--font-heading); }

/* === Dashboard v2: stats row + badge wall + next-up hero === */

/* Big next-up hero */
.next-hero {
  background: linear-gradient(135deg, rgba(247,152,29,0.10), rgba(217,28,92,0.10)), var(--bg-card);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  margin: 2.5rem 0 2rem;
  flex-wrap: wrap;
}
.next-hero .text { flex: 1; min-width: 260px; }
.next-hero .eyebrow {
  display: inline-block;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand-orange);
  margin-bottom: 0.625rem;
  background: none;
  border: none;
  padding: 0;
}
.next-hero h2 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.next-hero .meta { color: var(--text-secondary); font-size: 0.9375rem; margin: 0 0 1.5rem; }
.next-hero .actions { display: flex; gap: 0.625rem; flex-wrap: wrap; }
.next-hero .visual {
  flex-shrink: 0;
  width: 140px; height: 140px;
  position: relative;
}
.next-hero .visual svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.next-hero .visual circle { fill: none; stroke-width: 10; }
.next-hero .visual .bg { stroke: rgba(255,255,255,0.06); }
.next-hero .visual .fg { stroke: url(#progress-grad); stroke-linecap: round; transition: stroke-dashoffset 0.5s ease; }
.next-hero .visual .label {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-heading); font-weight: 800; font-size: 1.875rem; letter-spacing: -0.03em;
}
.next-hero .visual .label small { font-size: 0.875rem; color: var(--text-muted); margin-left: 2px; font-weight: 600; }
@media (max-width: 640px) {
  .next-hero { padding: 1.75rem 1.5rem; }
  .next-hero .visual { width: 100px; height: 100px; }
  .next-hero .visual .label { font-size: 1.5rem; }
}

/* Stats row: level + streak + lifetime */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}
@media (max-width: 640px) { .stats-row { grid-template-columns: 1fr; } }
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.stat-card .icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
}
.stat-card .icon.level { background: linear-gradient(135deg, rgba(247,152,29,0.18), rgba(217,28,92,0.18)); }
.stat-card .icon.streak { background: rgba(255, 95, 31, 0.15); }
.stat-card .icon.lifetime { background: rgba(126, 175, 255, 0.15); }
.stat-card .val {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  line-height: 1;
}
.stat-card .label {
  font-family: var(--font-heading);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 0.25rem;
}
.stat-card .progress-mini {
  margin-top: 0.5rem;
  height: 3px;
  background: rgba(255,255,255,0.05);
  border-radius: 999px;
  overflow: hidden;
}
.stat-card .progress-mini .fill { height: 100%; background: var(--brand-gradient); transition: width 0.4s ease; }

/* All-programs progress grid */
.programs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}
.program-card {
  background: var(--bg-card);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.program-card:hover { border-color: var(--border-mid); transform: translateY(-2px); }
.program-card.complete { background: linear-gradient(135deg, rgba(247,152,29,0.06), rgba(217,28,92,0.06)), var(--bg-card); border-color: rgba(247,152,29,0.25); }
.program-card-top {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
}
.program-card h3 {
  font-family: var(--font-heading); font-weight: 600; font-size: 1.0625rem; margin: 0; letter-spacing: -0.01em;
  display: flex; align-items: center; gap: 0.5rem;
}
.program-card h3 .h-icon { font-size: 1.25rem; line-height: 1; }
.program-card .sub { color: var(--text-muted); font-size: 0.8125rem; margin: 0; }
.program-card-bar {
  height: 6px; background: rgba(255,255,255,0.06); border-radius: 999px; overflow: hidden; margin-top: 0.5rem;
}
.program-card-bar .fill { height: 100%; background: var(--brand-gradient); transition: width 0.4s ease; }
.program-card-foot {
  display: flex; justify-content: space-between; align-items: center; font-size: 0.8125rem; font-family: var(--font-heading);
}
.program-card-foot .arrow { color: var(--brand-orange); font-weight: 600; }

/* Badge wall - locked to 3 columns so 9 badges always form a clean 3×3.
   Above 1080 we cap the wall width so badges don't stretch comically wide. */
.badge-wall {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.875rem;
  max-width: 720px;
}
@media (max-width: 480px) {
  .badge-wall { gap: 0.625rem; }
}
.badge {
  background: var(--bg-card);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-md);
  padding: 1.125rem 0.875rem;
  text-align: center;
  position: relative;
}
.badge.earned { border-color: rgba(247,152,29,0.4); background: linear-gradient(135deg, rgba(247,152,29,0.08), rgba(217,28,92,0.08)), var(--bg-card); }
.badge .emoji {
  font-size: 1.75rem;
  line-height: 1;
  display: block;
  margin-bottom: 0.375rem;
  filter: grayscale(1) opacity(0.4);
}
.badge.earned .emoji { filter: none; }
.badge .name {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  color: var(--text-secondary);
  line-height: 1.25;
}
.badge.earned .name { color: var(--text-primary); }
.badge:hover::after {
  content: attr(data-desc);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-overlay);
  border: 1px solid var(--border-soft);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 0.75rem;
  color: var(--text-primary);
  white-space: nowrap;
  z-index: 10;
  pointer-events: none;
}

/* === Chat widget === */
.chat-fab {
  position: fixed;
  bottom: 1.5rem; right: 1.5rem;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--brand-gradient);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 12px 32px -6px rgba(217, 28, 92, 0.5);
  z-index: 250;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.chat-fab:hover { transform: translateY(-2px); box-shadow: 0 18px 40px -8px rgba(217, 28, 92, 0.6); }
.chat-fab svg { width: 24px; height: 24px; }

.chat-panel {
  position: fixed;
  bottom: 5.5rem; right: 1.5rem;
  width: 380px;
  max-width: calc(100vw - 2rem);
  height: 560px;
  max-height: calc(100vh - 7rem);
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 64px -12px rgba(0, 0, 0, 0.7);
  z-index: 249;
  display: flex; flex-direction: column;
  opacity: 0; pointer-events: none;
  transform: translateY(8px) scale(0.98);
  transition: opacity 0.15s ease, transform 0.15s ease;
  overflow: hidden;
}
.chat-panel.open { opacity: 1; pointer-events: auto; transform: translateY(0) scale(1); }

@media (max-width: 540px) {
  .chat-panel { width: calc(100vw - 1.5rem); right: 0.75rem; bottom: 5rem; height: calc(100vh - 6rem); }
  .chat-fab { bottom: 1rem; right: 1rem; }
}

.chat-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.875rem 1rem 0.875rem 1.125rem;
  border-bottom: 1px solid var(--border-faint);
  flex-shrink: 0;
}
.chat-header-title {
  display: flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-heading); font-weight: 600; font-size: 0.9375rem;
}
.chat-status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--brand-gradient);
  box-shadow: 0 0 8px rgba(247, 152, 29, 0.6);
}
.chat-close {
  width: 28px; height: 28px;
  background: transparent; border: none;
  color: var(--text-muted); cursor: pointer;
  font-size: 1.5rem; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
}
.chat-close:hover { background: rgba(255,255,255,0.05); color: var(--text-primary); }

.chat-scroller {
  flex: 1; overflow-y: auto;
  padding: 1rem;
  display: flex; flex-direction: column; gap: 0.625rem;
}
.chat-msg { display: flex; }
.chat-msg-user { justify-content: flex-end; }
.chat-msg-assistant { justify-content: flex-start; }
.chat-bubble {
  max-width: 85%;
  padding: 0.625rem 0.875rem;
  border-radius: 14px;
  font-size: 0.875rem;
  line-height: 1.5;
  word-wrap: break-word;
}
.chat-msg-user .chat-bubble {
  background: var(--brand-gradient);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-msg-assistant .chat-bubble {
  background: var(--bg-overlay);
  color: var(--text-primary);
  border: 1px solid var(--border-faint);
  border-bottom-left-radius: 4px;
}
.chat-bubble a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.chat-msg-assistant .chat-bubble a { color: var(--brand-orange); }

.chat-typing .chat-bubble { display: inline-flex; gap: 4px; padding: 0.75rem 0.875rem; }
.chat-typing .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted); animation: chatBounce 1.2s infinite ease-in-out; }
.chat-typing .dot:nth-child(2) { animation-delay: 0.15s; }
.chat-typing .dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes chatBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.chat-reset {
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: var(--text-muted);
  background: transparent; border: none;
  padding: 0.375rem 1rem;
  cursor: pointer;
  text-align: left;
  border-top: 1px solid var(--border-faint);
}
.chat-reset:hover { color: var(--text-secondary); }

.chat-form {
  display: flex; gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid var(--border-faint);
  background: var(--bg-card);
  flex-shrink: 0;
}
.chat-input {
  flex: 1;
  background: var(--bg-overlay);
  border: 1px solid var(--border-soft);
  color: var(--text-primary);
  padding: 0.625rem 0.875rem;
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  resize: none;
  outline: none;
  max-height: 120px;
  min-height: 40px;
}
.chat-input:focus { border-color: var(--brand-orange); }
.chat-send {
  background: var(--brand-gradient);
  color: #fff;
  border: none;
  padding: 0 1rem;
  border-radius: 12px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  flex-shrink: 0;
}
.chat-send:disabled { opacity: 0.5; cursor: wait; }

/* === Admin === */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin: 2rem 0 2.5rem;
}
.admin-stat {
  background: var(--bg-card);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
}
.admin-stat .val {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 2rem;
  letter-spacing: -0.02em;
  line-height: 1;
}
.admin-stat .label {
  font-family: var(--font-heading);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.admin-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 1.5rem; }
@media (max-width: 920px) { .admin-grid { grid-template-columns: 1fr; } }

.admin-card {
  background: var(--bg-card);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}
.admin-card h2 {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.0625rem;
  margin: 0 0 1rem;
}
.admin-search {
  width: 100%;
  background: var(--bg-overlay);
  border: 1px solid var(--border-soft);
  color: var(--text-primary);
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.875rem;
  outline: none;
  margin-bottom: 1rem;
}
.admin-search:focus { border-color: var(--brand-orange); }

.admin-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.admin-table th, .admin-table td { text-align: left; padding: 0.625rem 0.5rem; border-bottom: 1px solid var(--border-faint); }
.admin-table th { color: var(--text-muted); font-family: var(--font-heading); font-weight: 600; font-size: 0.6875rem; letter-spacing: 0.1em; text-transform: uppercase; }
.admin-table tbody tr { cursor: pointer; transition: background 0.1s ease; }
.admin-table tbody tr:hover { background: rgba(255,255,255,0.03); }
.admin-table td.email { color: var(--text-primary); font-weight: 500; word-break: break-word; }
.admin-table td.tier { font-size: 0.75rem; color: var(--text-secondary); }
.admin-table td.num { font-family: var(--font-mono); color: var(--text-secondary); text-align: right; }
.admin-table td.date { font-family: var(--font-mono); color: var(--text-muted); font-size: 0.75rem; }

.admin-pager {
  display: flex; justify-content: space-between; align-items: center; margin-top: 1rem; font-size: 0.8125rem;
  color: var(--text-muted);
}
.admin-pager button {
  background: transparent; border: 1px solid var(--border-soft); color: var(--text-primary);
  padding: 0.375rem 0.75rem; border-radius: 8px; cursor: pointer; font-size: 0.8125rem;
}
.admin-pager button:hover:not(:disabled) { border-color: var(--brand-orange); }
.admin-pager button:disabled { opacity: 0.4; cursor: not-allowed; }

.admin-events {
  max-height: 700px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 0.5rem;
}
.admin-event {
  padding: 0.625rem 0.75rem;
  border-radius: 8px;
  font-size: 0.8125rem;
  border-left: 3px solid var(--border-soft);
  background: rgba(255,255,255,0.02);
  line-height: 1.4;
}
.admin-event.auth   { border-left-color: rgba(126,175,255,0.6); }
.admin-event.completion { border-left-color: rgba(247,152,29,0.6); }
.admin-event .when { font-family: var(--font-mono); font-size: 0.6875rem; color: var(--text-muted); display: block; }
.admin-event .who  { color: var(--text-primary); font-weight: 500; }
.admin-event .what { color: var(--text-secondary); margin-left: 0.25rem; }

/* Admin tabs */
.admin-tabs {
  display: flex;
  gap: 0.25rem;
  margin: 0 0 1.5rem;
  border-bottom: 1px solid var(--border-faint);
  overflow-x: auto;
}
.admin-tab {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}
.admin-tab:hover { color: var(--text-primary); }
.admin-tab.active { color: var(--text-primary); border-bottom-color: var(--brand-orange); }
.admin-pane { display: none; }
.admin-pane.active { display: block; }

/* Funnel bars */
.funnel-program { margin-bottom: 1.5rem; }
.funnel-program h3 {
  font-family: var(--font-heading); font-weight: 600; font-size: 0.9375rem;
  margin: 0 0 0.625rem;
  display: flex; justify-content: space-between; align-items: baseline;
}
.funnel-program h3 .stat { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-muted); font-weight: 400; }
.funnel-stage {
  display: grid;
  grid-template-columns: 110px 1fr 80px;
  align-items: center;
  gap: 0.875rem;
  margin: 0.375rem 0;
  font-size: 0.8125rem;
}
.funnel-stage .name { color: var(--text-secondary); }
.funnel-stage .bar { height: 8px; background: rgba(255,255,255,0.06); border-radius: 999px; overflow: hidden; }
.funnel-stage .fill { height: 100%; background: var(--brand-gradient); border-radius: 999px; transition: width 0.5s ease; }
.funnel-stage .val { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--text-primary); text-align: right; }

/* Declaration cards */
.dec-card {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 0.875rem 1rem;
  background: var(--bg-overlay);
  border-radius: var(--radius-md);
  margin-bottom: 0.625rem;
  border-left: 3px solid var(--border-soft);
}
.dec-card.past     { opacity: 0.5; border-left-color: var(--text-muted); }
.dec-card.today    { border-left-color: var(--brand-orange); background: linear-gradient(135deg, rgba(247,152,29,0.10), transparent), var(--bg-overlay); }
.dec-card.week     { border-left-color: var(--brand-magenta); }
.dec-card .when { font-family: var(--font-heading); font-weight: 700; font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.dec-card.today .when { color: var(--brand-orange); }
.dec-card .who { font-family: var(--font-heading); font-weight: 500; color: var(--text-primary); font-size: 0.9375rem; }
.dec-card .where { color: var(--text-secondary); font-size: 0.8125rem; margin-top: 0.125rem; }
.dec-card .date { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--text-muted); }

/* Inputs search list */
.input-row {
  display: grid;
  grid-template-columns: 130px 1fr 200px;
  gap: 1rem;
  padding: 0.625rem 0.875rem;
  border-bottom: 1px solid var(--border-faint);
  font-size: 0.8125rem;
}
.input-row .key { color: var(--text-muted); font-family: var(--font-mono); font-size: 0.75rem; }
.input-row .val { color: var(--text-primary); word-break: break-word; }
.input-row .who { color: var(--text-secondary); font-size: 0.75rem; text-align: right; word-break: break-word; }
.input-keys {
  display: flex; flex-wrap: wrap; gap: 0.375rem; margin-bottom: 0.875rem;
}
.input-key-chip {
  background: transparent;
  border: 1px solid var(--border-soft);
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  cursor: pointer;
}
.input-key-chip:hover { color: var(--text-primary); border-color: var(--border-mid); }
.input-key-chip.active { background: var(--brand-gradient); color: #fff; border-color: transparent; }

/* Drawer */
.admin-drawer-bg {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 300;
  display: none; backdrop-filter: blur(4px);
}
.admin-drawer-bg.open { display: block; }
.admin-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 540px; max-width: 100vw;
  background: var(--bg-card);
  border-left: 1px solid var(--border-soft);
  padding: 1.75rem;
  overflow-y: auto;
  z-index: 301;
  transform: translateX(100%);
  transition: transform 0.2s ease;
}
.admin-drawer.open { transform: translateX(0); }
.admin-drawer-head {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  margin-bottom: 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border-faint);
}
.admin-drawer-close {
  width: 32px; height: 32px; border-radius: 8px; background: transparent;
  border: 1px solid var(--border-soft); color: var(--text-secondary); cursor: pointer;
  font-size: 1.25rem; line-height: 1;
}
.admin-drawer-close:hover { color: var(--text-primary); border-color: var(--border-mid); }
.admin-drawer h3 {
  font-family: var(--font-heading); font-weight: 600; font-size: 0.875rem;
  margin: 1.25rem 0 0.5rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.08em;
}
.admin-drawer .summary { font-family: var(--font-heading); font-size: 1.125rem; margin: 0 0 0.25rem; }
.admin-drawer .meta { color: var(--text-muted); font-size: 0.8125rem; }
.admin-drawer .prog-row {
  display: flex; justify-content: space-between;
  padding: 0.375rem 0; font-size: 0.8125rem;
  border-bottom: 1px dashed var(--border-faint);
}
.admin-drawer .badge-chips { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.admin-drawer .badge-chip {
  font-size: 0.75rem; padding: 0.25rem 0.5rem; border-radius: 999px;
  background: var(--brand-gradient); color: #fff;
}

/* === Mark-as-read button === */
.mark-read-host {
  display: flex;
  justify-content: flex-start;
  margin: 2rem 0 0;
}
.mark-read-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  border: 1px solid var(--border-mid);
  color: var(--text-primary);
  padding: 0.625rem 1.125rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.15s ease;
}
.mark-read-btn:hover { border-color: var(--brand-orange); }
.mark-read-btn:disabled { opacity: 0.6; cursor: wait; }
.mark-read-btn.read {
  background: var(--brand-gradient);
  border-color: transparent;
  color: #fff;
}

/* Read-state checkmark on content cards */
.content-card.read::before {
  content: '✓';
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--brand-gradient);
  color: #fff;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px -2px rgba(217, 28, 92, 0.4);
}

/* === Celebration overlay === */
.celebrate-bg {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(10, 10, 11, 0.72);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  animation: celebrate-fade-in 220ms ease-out;
}
.celebrate-bg.closing {
  animation: celebrate-fade-out 220ms ease-in forwards;
}

.celebrate-card {
  position: relative;
  width: 100%;
  max-width: 500px;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 2.5rem 2rem 2rem;
  text-align: center;
  box-shadow:
    0 30px 80px -20px rgba(0, 0, 0, 0.6),
    0 0 60px -10px rgba(217, 28, 92, 0.35);
  animation: celebrate-slide-up 360ms cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}
.celebrate-card::before {
  /* Gradient top accent line */
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--brand-gradient);
}
.celebrate-bg.closing .celebrate-card {
  animation: celebrate-slide-down 220ms ease-in forwards;
}

.celebrate-emoji {
  font-size: 3.5rem;
  line-height: 1;
  margin-bottom: 1rem;
  display: inline-block;
  animation: celebrate-bounce 900ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.celebrate-headline {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 2rem;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin-bottom: 0.625rem;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.celebrate-sub {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.celebrate-stats {
  display: flex;
  gap: 0.625rem;
  justify-content: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.celebrate-stat {
  flex: 1 1 auto;
  min-width: 80px;
  max-width: 130px;
  padding: 0.75rem 0.5rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
}
.celebrate-stat-value {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-primary);
  line-height: 1.1;
}
.celebrate-stat-label {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.celebrate-actions {
  display: flex;
  gap: 0.625rem;
  justify-content: center;
  flex-wrap: wrap;
}
.celebrate-btn {
  display: inline-block;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9375rem;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, filter 0.15s ease, background 0.15s ease;
  line-height: 1.2;
}
.celebrate-btn-primary {
  background: var(--brand-gradient);
  color: #fff;
}
.celebrate-btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.celebrate-btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.10);
}
.celebrate-btn-secondary:hover { background: rgba(255, 255, 255, 0.10); transform: translateY(-1px); }

@keyframes celebrate-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes celebrate-fade-out {
  from { opacity: 1; }
  to { opacity: 0; }
}
@keyframes celebrate-slide-up {
  from { opacity: 0; transform: translateY(24px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0)    scale(1);    }
}
@keyframes celebrate-slide-down {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(12px) scale(0.98); }
}
@keyframes celebrate-bounce {
  0%   { transform: scale(0.4) rotate(-12deg); opacity: 0; }
  60%  { transform: scale(1.15) rotate(6deg);  opacity: 1; }
  100% { transform: scale(1)    rotate(0);     opacity: 1; }
}

/* Confetti */
.confetti-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1001;
}
.confetti-piece {
  position: absolute;
  top: -10vh;
  border-radius: 2px;
  opacity: 0.92;
  will-change: transform;
  animation-name: confetti-fall;
  animation-timing-function: cubic-bezier(0.22, 0.61, 0.36, 1);
  animation-fill-mode: forwards;
}
@keyframes confetti-fall {
  0%   { transform: translate3d(0, 0, 0) rotate(0deg); opacity: 1; }
  100% { transform: translate3d(var(--drift, 0), 120vh, 0) rotate(var(--rot, 540deg)); opacity: 0.85; }
}

@media (prefers-reduced-motion: reduce) {
  .celebrate-bg,
  .celebrate-card,
  .celebrate-emoji,
  .confetti-piece { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; }
}

@media (max-width: 480px) {
  .celebrate-card { padding: 2rem 1.25rem 1.5rem; }
  .celebrate-emoji { font-size: 3rem; }
  .celebrate-headline { font-size: 1.625rem; }
  .celebrate-btn { width: 100%; }
}

/* === What's New (changelog) === */
.whats-new-section { margin: 2.25rem 0 2.5rem; }
.whats-new-section .hub-section-head h2 {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.whats-new-list {
  display: grid;
  gap: 0.625rem;
}

.whats-new-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 1.125rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.whats-new-item:hover {
  border-color: var(--border-soft);
  transform: translateY(-1px);
}
.whats-new-item .body { min-width: 0; }
.whats-new-item .title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.625rem;
  margin-bottom: 0.375rem;
}
.whats-new-item .title-text {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-primary);
  letter-spacing: -0.005em;
}
.whats-new-item .summary {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-secondary);
}
.whats-new-item .arrow {
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.8125rem;
  white-space: nowrap;
}
.whats-new-item:hover .arrow { color: #ffba66; }

.whats-new-kind {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.625rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: rgba(255,255,255,0.04);
  color: var(--text-secondary);
  white-space: nowrap;
}
.whats-new-kind.kind-program  { color: #ffba66; border-color: rgba(247,152,29,0.3); background: rgba(247,152,29,0.10); }
.whats-new-kind.kind-essay    { color: #cbd5ff; border-color: rgba(126,175,255,0.28); background: rgba(126,175,255,0.08); }
.whats-new-kind.kind-resource { color: #8fdca0; border-color: rgba(126,211,137,0.28); background: rgba(126,211,137,0.10); }
.whats-new-kind.kind-feature  { color: #ff7ea3; border-color: rgba(217,28,92,0.32); background: rgba(217,28,92,0.10); }
.whats-new-kind.kind-event    { color: #ffd17e; border-color: rgba(255,209,126,0.28); background: rgba(255,209,126,0.10); }

/* Nav unread dot - subtle gradient pip next to a nav link */
.nav-unread-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-gradient);
  margin-left: 0.4rem;
  vertical-align: middle;
  box-shadow: 0 0 0 2px var(--bg-base);
  flex-shrink: 0;
}
.app-nav-link { position: relative; }

/* === Cmd+K search palette === */
/* Lock body scroll while the palette is open */
body.k-locked { overflow: hidden; }

/* Floating trigger - tucked above the chat FAB on the right edge */
.k-fab {
  position: fixed;
  bottom: 6.25rem;
  right: 1.5rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border-soft);
  cursor: pointer;
  box-shadow: 0 8px 20px -6px rgba(0, 0, 0, 0.6);
  z-index: 250;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.k-fab:hover {
  transform: translateY(-2px);
  border-color: var(--border-mid);
  color: var(--text-primary);
}
.k-fab svg { width: 18px; height: 18px; }
@media (max-width: 540px) {
  .k-fab { bottom: 5rem; right: 1rem; width: 40px; height: 40px; }
}

/* Full-screen overlay */
.k-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 10vh 1rem 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
}
.k-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
@media (max-width: 540px) {
  .k-overlay { padding: 4vh 0.75rem 0.75rem; }
}

/* The palette card */
.k-modal {
  width: 100%;
  max-width: 640px;
  max-height: 70vh;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  box-shadow: 0 28px 80px -16px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(-6px) scale(0.98);
  transition: transform 0.14s ease;
}
.k-overlay.open .k-modal { transform: translateY(0) scale(1); }
@media (max-width: 540px) {
  .k-modal { max-height: 80vh; border-radius: 12px; }
}

/* Header row with the input */
.k-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border-faint);
  flex-shrink: 0;
}
.k-header-icon {
  color: var(--text-muted);
  display: inline-flex;
  flex-shrink: 0;
}
.k-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
  padding: 0.25rem 0;
}
.k-input::placeholder { color: var(--text-muted); font-weight: 400; }
.k-kbd {
  display: inline-flex;
  gap: 0.25rem;
  flex-shrink: 0;
}
.k-kbd kbd,
.k-hint kbd {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  background: var(--bg-overlay);
  border: 1px solid var(--border-soft);
  color: var(--text-secondary);
  padding: 0.1875rem 0.4375rem;
  border-radius: 5px;
  line-height: 1;
  min-width: 1.2em;
  text-align: center;
}
@media (max-width: 540px) { .k-kbd { display: none; } }

/* Results scroller */
.k-results {
  flex: 1;
  overflow-y: auto;
  padding: 0.375rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border-mid) transparent;
}
.k-results::-webkit-scrollbar { width: 8px; }
.k-results::-webkit-scrollbar-thumb { background: var(--border-soft); border-radius: 4px; }
.k-results::-webkit-scrollbar-thumb:hover { background: var(--border-mid); }

.k-section-head {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.625rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.75rem 0.875rem 0.375rem;
}

/* Single result row */
.k-result {
  width: 100%;
  display: grid;
  grid-template-columns: 92px 1fr auto;
  align-items: center;
  gap: 0.875rem;
  padding: 0.625rem 0.875rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  text-align: left;
  cursor: pointer;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  line-height: 1.3;
  transition: background 0.08s ease, color 0.08s ease;
}
.k-result + .k-result { margin-top: 1px; }
.k-result:hover,
.k-result.active {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}
.k-result.active {
  background: linear-gradient(90deg, rgba(247, 152, 29, 0.10), rgba(217, 28, 92, 0.08));
  outline: 1px solid rgba(247, 152, 29, 0.35);
  outline-offset: -1px;
}

.k-result-kind {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.625rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg-overlay);
  border: 1px solid var(--border-faint);
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  text-align: center;
  justify-self: start;
  white-space: nowrap;
}
.k-result.active .k-result-kind {
  color: var(--brand-orange);
  border-color: rgba(247, 152, 29, 0.35);
}

.k-result-title {
  font-family: var(--font-heading);
  font-weight: 500;
  color: inherit;
  font-size: 0.9375rem;
  letter-spacing: -0.005em;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.k-result-title .k-mark {
  background: transparent;
  color: var(--brand-orange);
  font-weight: 700;
  padding: 0;
}
.k-result.active .k-result-title .k-mark { color: #ffba66; }

.k-result-arrow {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--text-muted);
  opacity: 0;
  transition: opacity 0.1s ease;
}
.k-result.active .k-result-arrow { opacity: 1; color: var(--brand-orange); }

@media (max-width: 540px) {
  .k-result { grid-template-columns: 68px 1fr; padding: 0.625rem 0.75rem; }
  .k-result-arrow { display: none; }
  .k-result-kind { font-size: 0.5625rem; padding: 0.1875rem 0.375rem; }
}

/* Empty / no-match state */
.k-empty {
  padding: 2.5rem 1rem;
  text-align: center;
}
.k-empty-title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: 0.375rem;
}
.k-empty-hint {
  color: var(--text-muted);
  font-size: 0.875rem;
}
.k-empty-hint strong { color: var(--text-secondary); }

/* Footer */
.k-footer {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.625rem 1rem;
  border-top: 1px solid var(--border-faint);
  background: rgba(255, 255, 255, 0.015);
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-shrink: 0;
}
.k-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}
@media (max-width: 540px) {
  .k-footer { gap: 0.625rem; padding: 0.5rem 0.75rem; font-size: 0.6875rem; }
}

/* === Member directory === */
.directory-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-faint);
  border-left: 3px solid var(--brand-orange);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  font-size: 0.9375rem;
}
.directory-banner .muted { color: var(--text-muted); margin-left: 0.5rem; }
@media (max-width: 640px) {
  .directory-banner { flex-direction: column; align-items: flex-start; }
}
.directory-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}
@media (max-width: 1024px) { .directory-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px)  { .directory-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px)  { .directory-grid { grid-template-columns: 1fr; } }
.directory-card {
  display: flex;
  gap: 0.875rem;
  align-items: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-lg);
  padding: 1.125rem;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.directory-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-mid);
}
.directory-avatar {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 50%;
  background: var(--brand-gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.25rem;
  line-height: 1;
  text-transform: uppercase;
}
.directory-body { min-width: 0; flex: 1; }
.directory-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: 0.375rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.directory-tier { margin-bottom: 0.5rem; }
.tier-pill.tier-pill-sm { font-size: 0.625rem; padding: 0.1875rem 0.5rem; }
.directory-meta { color: var(--text-muted); font-size: 0.8125rem; line-height: 1.4; }
.directory-empty {
  padding: 2rem;
  text-align: center;
  background: var(--bg-card);
  border: 1px dashed var(--border-faint);
  border-radius: var(--radius-lg);
  color: var(--text-secondary);
}

/* Account-page directory controls */
.dir-toggle { display: inline-flex; align-items: center; gap: 0.5rem; cursor: pointer; }
.dir-toggle input { width: 1rem; height: 1rem; cursor: pointer; }
.dir-name-input {
  width: 100%;
  max-width: 320px;
  padding: 0.5rem 0.75rem;
  background: var(--bg-deep, #0d0d12);
  border: 1px solid var(--border-mid);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9375rem;
}
.dir-name-input:focus { outline: none; border-color: var(--brand-orange); }

/* === Momentum widget === */
.momentum-widget {
  background: var(--bg-card);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem;
  margin: 2rem 0;
  display: grid;
  gap: 1.25rem;
}
.momentum-head h2 {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0 0 0.25rem;
  color: var(--text-primary);
}
.momentum-head .sub { color: var(--text-muted); font-size: 0.875rem; margin: 0; }
.momentum-stats {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  padding: 0.75rem 0;
  border-top: 1px solid var(--border-faint);
  border-bottom: 1px solid var(--border-faint);
}
.momentum-stats .stat { display: flex; flex-direction: column; gap: 0.125rem; min-width: 80px; }
.momentum-stats .stat .val {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.5rem;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1.1;
}
.momentum-stats .stat .label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.momentum-unlocks { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; }
.momentum-unlock {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 0.75rem;
  align-items: baseline;
  font-size: 0.9375rem;
  color: var(--text-secondary);
}
.momentum-unlock .unlock-emoji { font-size: 1rem; line-height: 1; }
.momentum-unlock .unlock-text { color: var(--text-secondary); }
.momentum-unlock .unlock-text strong { color: var(--text-primary); font-weight: 600; }
.momentum-unlock .unlock-time { color: var(--text-muted); font-size: 0.8125rem; white-space: nowrap; }
.momentum-foot { display: flex; justify-content: flex-end; }
.momentum-link {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--brand-orange);
  text-decoration: none;
}
.momentum-link:hover { color: var(--brand-magenta, var(--brand-orange)); }
@media (max-width: 540px) {
  .momentum-widget { padding: 1.25rem; }
  .momentum-stats { gap: 1.25rem; }
  .momentum-unlock { grid-template-columns: 20px 1fr; }
  .momentum-unlock .unlock-time { grid-column: 2; }
}

/* === Onboarding modal === */
.onb-bg {
  position: fixed; inset: 0; z-index: 600;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
  animation: onb-fade 0.25s ease;
}
@keyframes onb-fade { from { opacity: 0; } to { opacity: 1; } }
.onb-card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 560px; width: 100%;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.8);
}
.onb-eyebrow {
  font-family: var(--font-heading); font-weight: 700; font-size: 0.6875rem;
  letter-spacing: 0.14em; text-transform: uppercase;
  background: var(--brand-gradient); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.onb-title { font-family: var(--font-heading); font-weight: 700; font-size: 1.625rem; letter-spacing: -0.02em; margin: 0.5rem 0 0.375rem; }
.onb-sub { color: var(--text-secondary); margin: 0 0 1.5rem; font-size: 0.9375rem; }
.onb-form { display: grid; gap: 1.25rem; }
.onb-field { display: block; }
.onb-label { display: block; font-family: var(--font-heading); font-weight: 600; font-size: 0.875rem; color: var(--text-primary); margin-bottom: 0.5rem; }
.onb-input {
  width: 100%; background: var(--bg-overlay); border: 1px solid var(--border-soft); color: var(--text-primary);
  padding: 0.75rem 0.875rem; border-radius: var(--radius-md); font-family: var(--font-body); font-size: 0.9375rem; outline: none;
  transition: border-color 0.15s ease;
}
.onb-input:focus { border-color: var(--brand-orange); }
.onb-textarea { resize: vertical; min-height: 60px; }
.onb-hint { display: block; margin-top: 0.375rem; color: var(--text-muted); font-size: 0.75rem; }
.onb-levels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.625rem; }
@media (max-width: 540px) { .onb-levels { grid-template-columns: 1fr; } }
.onb-level-btn {
  background: var(--bg-overlay); border: 1px solid var(--border-soft); color: var(--text-primary);
  padding: 0.875rem 0.75rem; border-radius: var(--radius-md); cursor: pointer; text-align: left;
  display: flex; flex-direction: column; gap: 0.125rem;
  transition: all 0.15s ease;
}
.onb-level-btn:hover { border-color: var(--border-mid); }
.onb-level-btn.active { border-color: var(--brand-orange); box-shadow: 0 0 0 2px rgba(247,152,29,0.2); }
.onb-level-emoji { font-size: 1.25rem; }
.onb-level-label { font-family: var(--font-heading); font-weight: 700; font-size: 0.8125rem; }
.onb-level-desc { color: var(--text-muted); font-size: 0.75rem; }
.onb-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 1.5rem; gap: 1rem; }
.onb-skip { background: transparent; border: none; color: var(--text-muted); font-family: var(--font-body); font-size: 0.875rem; cursor: pointer; }
.onb-skip:hover { color: var(--text-secondary); }
.onb-submit {
  background: var(--brand-gradient); color: #fff; border: none;
  padding: 0.75rem 1.5rem; border-radius: var(--radius-pill);
  font-family: var(--font-heading); font-weight: 600; font-size: 0.9375rem; cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.onb-submit:hover:not(:disabled) { transform: translateY(-1px); }
.onb-submit:disabled { opacity: 0.4; cursor: not-allowed; }
.onb-error { background: rgba(217,28,92,0.12); border: 1px solid rgba(217,28,92,0.3); color: #ffb0c4; padding: 0.625rem 0.875rem; border-radius: var(--radius-md); margin-top: 1rem; font-size: 0.875rem; }

/* === Streak flame === */
.flame {
  position: relative;
  display: flex; align-items: center; gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-md);
}
.flame-inner {
  position: relative;
  width: 48px; height: 48px;
  flex-shrink: 0;
}
.flame-layer {
  position: absolute;
  border-radius: 50%;
  mix-blend-mode: screen;
  animation: flame-pulse 1.6s ease-in-out infinite;
}
.flame-layer-0 { inset: 0; background: radial-gradient(circle at 50% 70%, #ffb547 10%, transparent 60%); }
.flame-layer-1 { inset: 4px; background: radial-gradient(circle at 50% 65%, #ff7e2e 5%, transparent 65%); animation-delay: 0.2s; }
.flame-layer-2 { inset: 9px; background: radial-gradient(circle at 50% 60%, #ff3d6e 0%, transparent 70%); animation-delay: 0.4s; }
@keyframes flame-pulse {
  0%, 100% { transform: scale(1) translateY(0); opacity: 0.85; }
  50%      { transform: scale(1.15) translateY(-2px); opacity: 1; }
}
.flame-tier-0 .flame-inner { width: 32px; height: 32px; opacity: 0.6; }
.flame-tier-1 .flame-inner { width: 44px; height: 44px; }
.flame-tier-2 .flame-inner { width: 52px; height: 52px; }
.flame-tier-3 .flame-inner { width: 60px; height: 60px; }
.flame-tier-4 .flame-inner { width: 68px; height: 68px; }
.flame-tier-4 .flame-layer-0 { background: radial-gradient(circle at 50% 70%, #fbbf24 10%, transparent 60%); }
.flame-label { flex: 1; min-width: 0; }
.flame-num { font-family: var(--font-heading); font-weight: 800; font-size: 1.625rem; line-height: 1; letter-spacing: -0.03em; }
.flame-txt { font-family: var(--font-heading); font-size: 0.6875rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); margin-top: 0.375rem; }
.flame.flame-at-risk {
  border-color: rgba(251, 191, 36, 0.5);
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.08), rgba(247, 152, 29, 0.05)), var(--bg-card);
  animation: flame-warn 2s ease-in-out infinite;
}
@keyframes flame-warn {
  0%, 100% { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.4); }
  50%      { box-shadow: 0 0 0 6px rgba(251, 191, 36, 0); }
}
.flame.flame-at-risk .flame-txt { color: #fbbf24; }

/* === Reading progress bar === */
.reading-bar {
  position: fixed; top: 0; left: 0; right: 0;
  height: 3px; z-index: 80;
  background: rgba(255,255,255,0.04);
}
.reading-bar-fill {
  height: 100%; width: 0;
  background: var(--brand-gradient);
  transition: width 0.1s linear;
}
.reading-meta {
  position: fixed; top: 0.5rem; right: 0.875rem;
  z-index: 81;
  font-family: var(--font-mono); font-size: 0.6875rem; color: var(--text-muted);
  background: rgba(10,10,11,0.7); backdrop-filter: blur(6px);
  padding: 0.25rem 0.5rem; border-radius: 999px;
  pointer-events: none;
}
.reading-bar.reading-done .reading-meta { color: var(--brand-orange); }

/* === Full-page loader === */
.page-loader {
  position: fixed;
  inset: 0;
  background: var(--bg-base);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  transition: opacity 0.2s ease;
}
.page-loader.hidden { opacity: 0; pointer-events: none; }
.page-loader .pulse {
  width: 48px; height: 48px;
  border-radius: 14px;
  background: var(--brand-gradient);
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(0.85); opacity: 0.7; }
  50% { transform: scale(1); opacity: 1; }
}
