/* =====================================================================
   Bloom — Ambassador Portal
   Warm gradient · bold sans · serif accents · clean cards
   ===================================================================== */

:root {
  /* Surfaces */
  --paper: #FFFFFF;
  --paper-soft: #FAF7F2;
  --ink-900: #14110D;
  --ink-800: #1F1B16;
  --ink-700: #3A352D;
  --ink-500: #6B6458;
  --ink-400: #8E8678;
  --ink-300: #B5AE9F;
  --ink-200: #D6D0BF;
  --rule:    #E8E2D2;
  --rule-soft: #F1ECDD;

  /* Brand — Bloom plumeria deep purple */
  --bloom: #3C00A6;
  --bloom-2: #5421C7;
  --bloom-3: #8A6FE0;
  --bloom-soft: #EFE6FF;
  --bloom-deep: #240063;

  /* Sky gradient palette (cloud-pink → sky-blue → lavender) */
  --sky-1: #C9D8F5;   /* sky blue */
  --sky-2: #E6D4F0;   /* lavender mist */
  --sky-3: #F8D2E2;   /* cloud pink */
  --sky-4: #FFC6D9;   /* peach pink */
  --sky-5: #B8A8E8;   /* mauve violet */
  /* legacy warm tokens — mapped to bloom for any leftover refs */
  --warm-1: var(--bloom-3);
  --warm-2: var(--bloom);
  --warm-3: var(--bloom-2);
  --warm-4: var(--sky-5);
  --warm-5: var(--sky-3);

  /* Status accent (warm amber) */
  --amber: #B5751F;
  --amber-soft: #FCEBD2;
  --teal: #1F6E73;
  --teal-soft: #DCEAEA;

  /* Type */
  --serif: 'Instrument Serif', 'EB Garamond', Georgia, serif;
  --sans:  'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --mono:  'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Layout */
  --max: 1240px;
  --radius: 14px;
  --radius-lg: 20px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; scroll-behavior: smooth; }
section[id^="section-"] { scroll-margin-top: 88px; }
body {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  color: var(--ink-800);
  min-height: 100vh;
  background:
    radial-gradient(ellipse 70% 50% at 18% 8%, var(--sky-1) 0%, transparent 55%),
    radial-gradient(ellipse 80% 60% at 90% 20%, var(--sky-3) 0%, transparent 55%),
    radial-gradient(ellipse 90% 60% at 50% 100%, var(--sky-4) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 0% 100%, var(--sky-5) 0%, transparent 50%),
    linear-gradient(180deg, #D5DEF5 0%, #ECD7EF 45%, #FBC7DC 100%);
  background-attachment: fixed;
}

::selection { background: var(--ink-900); color: #fff; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }

/* ---------- Type scale ---------- */
.kicker, .mono-label, .eyebrow, .caption {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-500);
  font-weight: 500;
}
.eyebrow.purple { color: var(--bloom); }

/* App-UI display: bold sans (matches reference "Ambassador Dashboard") */
.h-app {
  font-family: var(--sans);
  font-weight: 800;
  font-size: clamp(38px, 5vw, 56px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  color: var(--ink-900);
}

/* Program landing display: elegant serif */
.h-display {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(72px, 10vw, 144px);
  line-height: 0.95;
  letter-spacing: -0.025em;
  color: var(--ink-900);
}
.h-display .ital { font-style: italic; }

.h-section {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(36px, 4.4vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--ink-900);
  text-wrap: balance;
}
.h-section .ital { font-style: italic; }

.h-card {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--ink-900);
}

/* JSX-existing aliases */
.serif-h1 { font-family: var(--sans); font-weight: 800; font-size: clamp(38px, 5vw, 56px); line-height: 1.02; letter-spacing: -0.035em; color: var(--ink-900); }
.serif-h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(36px, 4.4vw, 52px); line-height: 1.05; letter-spacing: -0.02em; color: var(--ink-900); }
.serif-h3 { font-family: var(--sans); font-weight: 700; font-size: 22px; line-height: 1.2; letter-spacing: -0.02em; color: var(--ink-900); }
.display  { font-family: var(--serif); font-weight: 400; font-size: clamp(72px, 10vw, 144px); line-height: 0.95; letter-spacing: -0.025em; color: var(--ink-900); }
.display em, .display .ital { font-style: italic; }
.display.sm { font-size: clamp(48px, 6.4vw, 88px); }

.lede {
  font-size: 18px;
  line-height: 1.55;
  color: var(--ink-700);
  max-width: 60ch;
}

/* Hairline rule */
.rule, .hairline, .rule-soft { border: 0; border-top: 1px solid var(--rule); }
.rule-soft { border-top-color: var(--rule-soft); }

/* ---------- Layout ---------- */
.container, .page-wrap { max-width: var(--max); margin: 0 auto; padding: 0 40px; }
.page-pad { padding: 56px 40px; }
.section { padding: 96px 0; }

@media (max-width: 760px) {
  .container, .page-wrap { padding: 0 20px; }
  .page-pad { padding: 32px 20px; }
  .section { padding: 56px 0; }
}

/* ---------- App header ---------- */
.app-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid rgba(20, 17, 13, 0.06);
}
.app-header .inner {
  max-width: var(--max); margin: 0 auto;
  padding: 14px 40px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--ink-900);
  letter-spacing: -0.02em;
  font-weight: 700;
}
.nav-link {
  font-size: 14px; color: var(--ink-700); font-weight: 500;
  padding: 8px 14px; border-radius: 999px;
  transition: color 150ms ease, background 150ms ease;
}
.nav-link:hover { color: var(--ink-900); background: rgba(255,255,255,0.4); }
.nav-link.active { color: var(--ink-900); background: rgba(255,255,255,0.6); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 14px; font-weight: 600;
  letter-spacing: -0.005em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease, transform 80ms ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink-900); color: #fff; }
.btn-primary:hover { background: var(--bloom); }
.btn-primary:disabled, .btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn-secondary {
  background: rgba(255,255,255,0.7); color: var(--ink-900);
  border-color: rgba(20,17,13,0.12);
  backdrop-filter: blur(8px);
}
.btn-secondary:hover { background: #fff; border-color: var(--ink-900); }
.btn-ghost {
  background: transparent; color: var(--ink-700);
  padding: 10px 16px;
}
.btn-ghost:hover { color: var(--ink-900); background: rgba(255,255,255,0.4); }
.btn-link { background: transparent; color: var(--ink-900); padding: 12px 0; }
.btn-link:hover { color: var(--bloom); }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn.lg { padding: 16px 28px; font-size: 15px; }

/* Sign-in with X (login + program CTA) */
.btn-x {
  width: 100%;
  background: var(--ink-900); color: #fff;
  padding: 14px 18px; border-radius: 12px;
  font-size: 15px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  transition: background 150ms ease, transform 80ms ease;
  border: none; cursor: pointer;
}
.btn-x:hover { background: var(--bloom); }
.btn-x:active { transform: translateY(1px); }

/* ---------- Cards ---------- */
.card {
  background: var(--paper);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: 0 1px 0 rgba(20,17,13,0.04), 0 24px 60px -32px rgba(20,17,13,0.18);
}
.card-flush { padding: 0; overflow: hidden; }
.card-head { margin-bottom: 24px; }
.card-head.row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.card-sub { font-size: 14px; color: var(--ink-500); margin-top: 4px; }
.mt-32 { margin-top: 24px; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600;
  padding: 8px 14px; border-radius: 999px;
  background: rgba(20,17,13,0.08);
  color: var(--ink-900);
  border: 1px solid rgba(20,17,13,0.12);
  backdrop-filter: blur(8px);
}
.badge.waiting {
  color: var(--ink-900);
  background: rgba(255,255,255,0.55);
  border-color: rgba(20,17,13,0.18);
}
.badge.scout  { color: var(--ink-900); background: rgba(255,255,255,0.6); }
.badge.ranger { color: var(--teal); background: var(--teal-soft); border-color: rgba(31,110,115,0.2); }
.badge.apex   {
  color: #fff; background: var(--ink-900); border-color: var(--ink-900);
  font-style: italic;
}

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 999px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  border: 1px solid var(--rule); background: var(--paper);
}
.pill.warn   { color: var(--amber); border-color: rgba(181,117,31,0.3); background: var(--amber-soft); }
.pill.ok     { color: var(--teal);  border-color: rgba(31,110,115,0.3); background: var(--teal-soft); }
.pill.bad    { color: #a1361c; border-color: rgba(161,54,28,0.3); background: #f6e1d9; }
.pill.purple { color: var(--bloom); border-color: rgba(60,0,166,0.25); background: var(--bloom-soft); }

/* ---------- Tabs (pill segmented, reference style) ---------- */
.tabs {
  display: inline-flex;
  background: rgba(20,17,13,0.06);
  border-radius: 999px;
  padding: 5px;
  gap: 2px;
  margin-bottom: 28px;
}
.tab {
  padding: 9px 22px; border-radius: 999px;
  font-size: 14px; font-weight: 600; color: var(--ink-700);
  cursor: pointer; transition: all 150ms ease;
  white-space: nowrap;
  display: inline-flex; align-items: center; gap: 8px;
  border: none; background: transparent;
}
.tab:hover { color: var(--ink-900); }
.tab.active {
  background: var(--paper); color: var(--ink-900);
  box-shadow: 0 1px 2px rgba(20,17,13,0.06), 0 6px 14px -8px rgba(20,17,13,0.12);
}
.tab .count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 6px;
  background: #E04E2A; color: #fff;
  border-radius: 999px; font-size: 11px; font-weight: 700;
  letter-spacing: 0;
}

/* ---------- Form fields ---------- */
.field { display: flex; flex-direction: column; gap: 8px; }
.field-label {
  font-size: 14px; color: var(--ink-500); font-weight: 500;
  letter-spacing: -0.005em;
}
.field-help { font-size: 13px; color: var(--ink-400); margin-top: 4px; }

.input, .textarea, .select,
.field input, .field textarea, .field select,
.post-form input, .post-form select {
  width: 100%;
  background: var(--paper);
  border: 1px solid rgba(20,17,13,0.10);
  border-radius: 12px;
  padding: 13px 16px;
  font-size: 15px;
  color: var(--ink-900);
  transition: border-color 150ms ease, box-shadow 150ms ease;
  font-family: inherit;
}
.input::placeholder, .textarea::placeholder, .select::placeholder,
.field input::placeholder, .field textarea::placeholder,
.post-form input::placeholder { color: var(--ink-300); }
.input:focus, .textarea:focus, .select:focus,
.field input:focus, .field textarea:focus, .field select:focus,
.post-form input:focus, .post-form select:focus {
  outline: none;
  border-color: var(--bloom);
  box-shadow: 0 0 0 4px rgba(60,0,166,0.14);
}
.textarea, .field textarea { min-height: 110px; resize: vertical; line-height: 1.55; }

/* Custom radio (warm orange ring like reference) */
.radio { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; padding: 8px 0; user-select: none; position: relative; }
.radio input { position: absolute; opacity: 0; pointer-events: none; }
.radio .pip {
  width: 20px; height: 20px; border-radius: 50%;
  border: 1.5px solid var(--bloom);
  background: var(--paper);
  display: inline-flex; align-items: center; justify-content: center;
  transition: all 150ms ease;
  flex-shrink: 0;
}
.radio input:checked + .pip { background: var(--bloom); }
.radio input:checked + .pip::after {
  content: ''; width: 8px; height: 8px; border-radius: 50%;
  background: #fff;
}
.radio:hover .pip { border-color: var(--bloom-2); }
.radio .lbl { font-size: 15px; color: var(--ink-900); }

/* Checkbox chips */
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: 999px;
  border: 1px solid rgba(20,17,13,0.12);
  background: var(--paper); color: var(--ink-700);
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition: all 150ms ease;
  user-select: none;
}
.chip input { display: none; }
.chip:hover { border-color: var(--ink-700); color: var(--ink-900); }
.chip.on { background: var(--ink-900); color: #fff; border-color: var(--ink-900); }

/* Likert (1-5) */
.likert { display: inline-flex; align-items: center; gap: 10px; }
.likert-dot {
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid rgba(20,17,13,0.10);
  background: var(--paper);
  font-family: var(--sans); font-size: 14px; font-weight: 700;
  color: var(--ink-900); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all 150ms ease;
}
.likert-dot:hover { border-color: var(--bloom); }
.likert-dot.on { background: var(--bloom); color: #fff; border-color: var(--bloom); }
.likert-cap { font-size: 13px; color: var(--ink-500); font-weight: 500; }

/* ---------- Tables ---------- */
.tbl, .data-table { width: 100%; border-collapse: collapse; }
.tbl thead th, .data-table thead th {
  text-align: left; padding: 14px 16px;
  font-size: 13px; font-weight: 500; color: var(--ink-500);
  border-bottom: 1px solid var(--rule);
  background: transparent;
}
.tbl thead th.num, .data-table thead th.num { text-align: right; }
.tbl tbody td, .data-table tbody td {
  padding: 18px 16px;
  font-size: 14px; color: var(--ink-700);
  border-bottom: 1px solid var(--rule-soft);
  vertical-align: middle;
}
.tbl tbody tr:last-child td, .data-table tbody tr:last-child td { border-bottom: none; }
.tbl td.num, .data-table td.num { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-900); }
.tbl tbody tr:hover td, .data-table tbody tr:hover td { background: rgba(60,0,166,0.04); }
.data-table .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-900); }
.data-table .dash { color: var(--ink-300); }
.data-table .link { color: var(--ink-900); border-bottom: 1px solid var(--ink-300); }
.data-table .link:hover { border-bottom-color: var(--ink-900); }

/* Ambassador name cell — avatar + name side by side */
.amb-name {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.amb-name img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--paper-soft);
}
.amb-name strong {
  font-weight: 600;
  color: var(--ink-900);
  white-space: nowrap;
}
.data-table .x-mark { font-family: var(--sans); font-weight: 700; color: var(--ink-900); }
.data-table .rating { color: var(--ink-900); font-weight: 600; }
.data-table .comment-cell { max-width: 220px; color: var(--ink-500); }
.data-table .empty { text-align: center; padding: 40px; color: var(--ink-400); font-style: italic; }
.icon-btn {
  width: 32px; height: 32px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink-500); transition: all 120ms ease; border: none; background: transparent; cursor: pointer;
}
.icon-btn:hover { background: rgba(20,17,13,0.06); color: var(--ink-900); }
.table-wrap { overflow-x: auto; margin: 0 -32px; padding: 0 32px; }

/* Sticky table header — keeps the column labels visible while the body scrolls.
   Added on admin tables (.table-wrap.sticky-head). */
.table-wrap.sticky-head {
  max-height: 60vh;
  overflow-y: auto;
}
.table-wrap.sticky-head .data-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--paper);
  /* The td uses 1px border-bottom; on a sticky header that border can disappear
     under the scrolling body, so paint it as a box-shadow instead. */
  border-bottom: none;
  box-shadow: inset 0 -1px 0 var(--rule);
}

/* ---------- Login ---------- */
.login-page { position: relative; min-height: 100vh; }
.login-bg {
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(ellipse 90% 70% at 0% 0%, rgba(255,255,255,0.18) 0%, transparent 55%),
    radial-gradient(ellipse 80% 60% at 100% 100%, rgba(20,17,13,0.18) 0%, transparent 60%),
    var(--bloom);
}
.login-page {
  display: flex; align-items: center; justify-content: center;
  padding: 32px;
  flex-direction: column; gap: 24px;
}
.login-card {
  width: 100%; max-width: 420px;
  background: var(--paper);
  border-radius: 22px;
  padding: 40px 36px 32px;
  text-align: center;
  box-shadow: 0 1px 0 rgba(20,17,13,0.04), 0 30px 80px -32px rgba(20,17,13,0.25);
  display: flex; flex-direction: column; align-items: center; gap: 20px;
}
.login-card .login-label {
  font-size: 16px; color: var(--ink-500); font-weight: 500;
  margin-top: -4px;
}
.login-link {
  font-size: 14px; color: rgba(20,17,13,0.78); font-weight: 500;
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 8px;
}
.login-link:hover { color: var(--ink-900); }
.login-foot {
  font-family: var(--mono);
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: rgba(20,17,13,0.55);
  margin-top: 12px;
}

/* ---------- Dashboard shell ---------- */
.dash { padding: 56px 0 96px; }
.dash-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 36px; gap: 24px; flex-wrap: wrap;
}
.dash-head .kicker { display: block; margin-bottom: 12px; color: rgba(20,17,13,0.6); }
.dash-head h1, .dash-head .serif-h1 {
  font-family: var(--sans); font-weight: 800;
  font-size: clamp(40px, 5vw, 60px);
  line-height: 1.0; letter-spacing: -0.035em;
  color: var(--ink-900);
}
.dash-head-right { display: inline-flex; align-items: center; gap: 12px; padding-top: 8px; }

.tab-panel { animation: fadeUp 280ms ease both; }

/* Posts tab form */
.post-form {
  display: grid; grid-template-columns: 200px 160px 1fr auto; gap: 12px; align-items: stretch;
}
.post-form .select-wrap { position: relative; }
.post-form .select-wrap select {
  width: 100%; appearance: none; padding-right: 36px;
}
.post-form .select-wrap svg { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--ink-500); }
@media (max-width: 760px) { .post-form { grid-template-columns: 1fr; } }
.mono-count { font-family: var(--mono); font-size: 14px; color: var(--ink-400); font-weight: 400; letter-spacing: 0.04em; }

/* ---------- Sprint cards (reference: numbered grid) ---------- */
.sprint-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px;
}
.sprint-card {
  background: var(--paper-soft);
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 18px; text-align: left;
  cursor: pointer;
  transition: all 150ms ease;
  position: relative;
  min-height: 130px;
  display: flex; flex-direction: column;
}
.sprint-card:hover { border-color: var(--ink-900); transform: translateY(-1px); }
.sprint-card .sprint-card-top {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 10px;
}
.sprint-card .sprint-n-big {
  font-family: var(--sans); font-weight: 800;
  font-size: 28px; color: var(--ink-900); line-height: 1;
  letter-spacing: -0.03em;
}
.sprint-card .sprint-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 6px; }
.sprint-card .sprint-dot.active  { background: #2E9961; }
.sprint-card .sprint-dot.pending { background: var(--bloom); }
.sprint-card .sprint-dot.ended   { background: var(--ink-400); }
.sprint-card .sprint-dot.empty   { background: var(--ink-200); }
.sprint-card.ended { opacity: 0.6; }
.sprint-card .sprint-card-title { font-size: 13px; color: var(--ink-900); font-weight: 600; line-height: 1.35; }
.sprint-card .sprint-card-snip  { font-size: 12px; color: var(--ink-500); margin-top: 6px; line-height: 1.4; }
.sprint-card .muted { color: var(--ink-300); font-style: italic; font-weight: 400; }

.legend { display: inline-flex; gap: 16px; font-size: 13px; color: var(--ink-500); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.legend i.dot.active  { background: #2E9961; }
.legend i.dot.pending { background: var(--bloom); }
.legend i.dot.ended   { background: var(--ink-400); }
.legend i.dot.empty   { background: var(--ink-200); }

/* ---------- Application form ---------- */
.app-tab-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 28px; gap: 16px; flex-wrap: wrap;
}
.app-tab-head .serif-h3 { font-size: 28px; font-weight: 800; letter-spacing: -0.03em; }
.app-tab-actions { display: inline-flex; gap: 12px; }
.app-tab-actions.floating { justify-content: flex-end; margin-top: 32px; }

.form-section {
  background: var(--paper);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 20px;
  box-shadow: 0 1px 0 rgba(20,17,13,0.04), 0 24px 60px -32px rgba(20,17,13,0.16);
}
.form-section-head {
  display: flex; align-items: baseline; gap: 16px;
  padding-bottom: 18px; margin-bottom: 28px;
  border-bottom: 1px solid var(--rule);
}
.form-section-head .mono-label { color: var(--bloom); font-weight: 600; }
.form-section-head h3, .form-section-head .serif-h3 {
  font-family: var(--sans); font-weight: 700; font-size: 22px;
  color: var(--ink-900); letter-spacing: -0.02em;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.form-grid .col-span-2, .field.col-span-2 { grid-column: 1 / -1; }
@media (max-width: 760px) { .form-grid { grid-template-columns: 1fr; } }

/* ---------- Hero (program) ---------- */
.hero {
  position: relative;
  padding: 140px 0 80px;
  text-align: center;
}
.hero-bg { display: none; }
.hero-inner { max-width: var(--max); margin: 0 auto; padding: 0 40px; display: flex; flex-direction: column; align-items: center; gap: 28px; }
.hero .kicker { color: rgba(20,17,13,0.65); }
.hero .display { color: var(--ink-900); }
.hero .display em { color: var(--ink-900); }
.hero .display .period { color: var(--ink-900); }
.hero-sub {
  font-size: 22px; line-height: 1.5; color: var(--ink-900);
  max-width: 56ch; font-family: var(--serif); font-weight: 400;
  letter-spacing: -0.005em;
  margin: 24px 0 12px;
  position: relative;
}
.hero-sub::before {
  content: ""; display: block; width: 32px; height: 1px;
  background: var(--ink-900); opacity: 0.4;
  margin: 0 auto 28px;
}
@media (max-width: 720px) {
  .hero-sub { font-size: 19px; }
}
.hero-meta {
  display: inline-flex; gap: 0;
  background: rgba(255,255,255,0.55); backdrop-filter: blur(10px);
  border: 1px solid rgba(20,17,13,0.08);
  border-radius: var(--radius);
  padding: 4px;
}
.hero-meta .meta-cell {
  padding: 12px 22px;
  display: flex; flex-direction: column; gap: 2px; align-items: flex-start;
  border-right: 1px solid rgba(20,17,13,0.08);
}
.hero-meta .meta-cell:last-child { border-right: none; }
.hero-meta .meta-k { font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-500); }
.hero-meta .meta-v { font-size: 14px; font-weight: 600; color: var(--ink-900); }
.hero-cta { display: inline-flex; gap: 16px; align-items: center; flex-wrap: wrap; justify-content: center; }
.hero-rule { border-top: 1px solid rgba(20,17,13,0.08); margin-top: 48px; }
.hero-rule-inner {
  padding: 14px 40px; display: flex; justify-content: space-between; gap: 24px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(20,17,13,0.6);
}

/* Program nav (transparent over hero) */
.prog-header {
  position: absolute; top: 0; left: 0; right: 0; z-index: 30;
}
.prog-header-inner {
  padding: 22px 40px;
  display: flex; align-items: center; justify-content: space-between;
}
.prog-nav { display: inline-flex; align-items: center; gap: 22px; }
.prog-nav a { font-size: 14px; color: var(--ink-700); font-weight: 500; }
.prog-nav a:hover { color: var(--ink-900); }
.prog-nav .btn { color: var(--ink-900); }

/* Section heads */
.section-head { margin-bottom: 56px; max-width: 720px; text-align: left; }
.section-head .serif-h2 { margin: 0; }
.section-sub { font-size: 17px; line-height: 1.55; color: rgba(20,17,13,0.7); margin-top: 16px; max-width: 60ch; }

.section-warm  { background: rgba(255,255,255,0.4); backdrop-filter: blur(2px); border-top: 1px solid rgba(20,17,13,0.06); border-bottom: 1px solid rgba(20,17,13,0.06); }
.section-dark  { background: var(--ink-900); color: rgba(255,255,255,0.78); }
.section-dark .serif-h2,
.section-dark .display,
.section-dark h2 { color: #fff; }
.section-dark .kicker, .section-dark .kicker.dark { color: rgba(255,255,255,0.5); }

/* Goals grid */
.goals-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px;
}
.goal-card {
  background: var(--paper);
  border-radius: var(--radius);
  padding: 24px;
  display: flex; flex-direction: column; gap: 12px;
  box-shadow: 0 1px 0 rgba(20,17,13,0.03);
}
.goal-card svg { width: 40px; height: 40px; padding: 8px; border-radius: 10px; background: var(--bloom-soft); color: var(--bloom); }
.goal-card h3 { font-family: var(--sans); font-weight: 700; font-size: 18px; color: var(--ink-900); letter-spacing: -0.02em; }
.goal-card p { font-size: 14px; color: var(--ink-500); line-height: 1.5; }
@media (max-width: 760px) { .goals-grid { grid-template-columns: 1fr; } }

/* Tier cards */
.tier-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; align-items: stretch; }
.tier-card {
  position: relative;
  background: var(--paper);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  display: flex; flex-direction: column; gap: 22px;
  box-shadow: 0 1px 0 rgba(20,17,13,0.04), 0 24px 60px -32px rgba(20,17,13,0.16);
}
.tier-card.apex {
  background: var(--ink-900);
  color: rgba(255,255,255,0.78);
}
.tier-card.apex .tier-name,
.tier-card.apex h4,
.tier-card.apex strong { color: #fff; }
.tier-head { display: flex; flex-direction: column; gap: 10px; }
.tier-badge {
  display: inline-flex; align-self: flex-start; padding: 4px 12px;
  border-radius: 999px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 500;
  background: rgba(20,17,13,0.06); color: var(--ink-700);
}
.tier-card.apex .tier-badge { background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.78); }
.tier-name { font-family: var(--serif); font-weight: 400; font-size: 44px; line-height: 1; color: var(--ink-900); letter-spacing: -0.02em; }
.tier-name em { font-style: italic; }
.tier-tag { font-size: 14px; color: var(--ink-500); }
.tier-card.apex .tier-tag { color: rgba(255,255,255,0.6); }
.tier-block .tier-label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-400); margin-bottom: 10px; }
.tier-card.apex .tier-block .tier-label { color: rgba(255,255,255,0.5); }
.tier-block ul { list-style: none; display: flex; flex-direction: column; gap: 12px; font-size: 15px; }
.tier-block ul.dashed li {
  padding-left: 22px; position: relative; line-height: 1.45;
  color: var(--ink-900); font-weight: 500;
}
.tier-block ul.dashed li::before {
  content: ''; position: absolute; left: 0; top: 0.62em;
  width: 12px; height: 2px; background: var(--bloom);
  border-radius: 1px;
}
.tier-card.apex .tier-block ul.dashed li { color: rgba(255,255,255,0.92); }
.tier-card.apex .tier-block ul.dashed li::before { background: #fff; }
.tier-block ul:not(.dashed) li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--rule-soft); }
.tier-card.apex .tier-block ul:not(.dashed) li { border-bottom-color: rgba(255,255,255,0.08); }
.tier-block ul:not(.dashed) li:last-child { border-bottom: none; }
.tier-block ul:not(.dashed) li span { color: var(--ink-500); }
.tier-card.apex .tier-block ul:not(.dashed) li span { color: rgba(255,255,255,0.55); }
.tier-foot {
  margin-top: auto; display: flex; justify-content: space-between; align-items: baseline;
  padding-top: 20px; border-top: 1px solid var(--rule);
}
.tier-card.apex .tier-foot { border-top-color: rgba(255,255,255,0.1); }
.mult-label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-400); }
.tier-card.apex .mult-label { color: rgba(255,255,255,0.5); }
.mult-val { font-family: var(--sans); font-weight: 800; font-size: 36px; color: var(--ink-900); letter-spacing: -0.025em; display: inline-flex; align-items: baseline; gap: 8px; }
.mult-token { font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: 0.06em; color: var(--bloom); padding: 3px 8px; border-radius: 6px; background: var(--bloom-soft); }
.tier-card.apex .mult-token { color: #fff; background: rgba(255,255,255,0.12); }
.tier-card.apex .mult-val { color: #fff; }
@media (max-width: 900px) { .tier-grid { grid-template-columns: 1fr; } }

/* Progression */
.progression { display: flex; flex-direction: column; gap: 36px; }
.prog-line { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 28px 0; }
.prog-node { display: flex; flex-direction: column; align-items: center; gap: 8px; flex: 1; }
.prog-node-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--ink-900); }
.prog-node.hl .prog-node-dot { background: var(--bloom); }
.prog-node-label { font-family: var(--serif); font-size: 36px; line-height: 1; color: var(--ink-900); }
.prog-node-label.apex em { font-style: italic; }
.prog-node-sub { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-500); }
.prog-arrow { color: rgba(20,17,13,0.3); }
.prog-steps { list-style: none; display: flex; flex-direction: column; gap: 16px; }
.prog-steps li { display: flex; gap: 20px; align-items: baseline; padding: 18px 0; border-top: 1px solid rgba(20,17,13,0.08); font-size: 16px; line-height: 1.55; }
.prog-steps li:last-child { border-bottom: 1px solid rgba(20,17,13,0.08); }
.prog-steps .step-n { font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; color: var(--bloom); width: 32px; flex-shrink: 0; font-weight: 600; }
.prog-steps strong { color: var(--ink-900); font-weight: 700; }
.prog-note { background: rgba(20,17,13,0.04); border-radius: var(--radius); padding: 22px 24px; display: flex; gap: 18px; align-items: flex-start; }
.prog-note .note-mark { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--bloom); font-weight: 600; }
.prog-note p { font-size: 15px; color: var(--ink-700); }
.prog-note p em { font-style: italic; font-weight: 600; }

/* Matrix table */
.matrix { background: var(--paper); border-radius: var(--radius-lg); overflow: hidden; box-shadow: 0 1px 0 rgba(20,17,13,0.04), 0 24px 60px -32px rgba(20,17,13,0.16); }
.matrix table { width: 100%; border-collapse: collapse; }
.matrix th { text-align: left; padding: 18px 24px; font-size: 13px; font-weight: 600; color: var(--ink-500); border-bottom: 1px solid var(--rule); }
.matrix th:not(:first-child) { text-align: center; width: 18%; }
.matrix td { padding: 18px 24px; border-bottom: 1px solid var(--rule-soft); font-size: 15px; color: var(--ink-700); }
.matrix td.act { color: var(--ink-900); font-weight: 500; }
.matrix td:not(:first-child) { text-align: center; }
.matrix tr:last-child td { border-bottom: none; }
.matrix .apex-cell { background: rgba(20,17,13,0.02); }
.matrix .dash { color: var(--ink-300); }
.matrix .cell-apex { color: var(--ink-900); font-weight: 600; }

/* Points cards */
.points-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 760px) { .points-grid { grid-template-columns: 1fr; } }
.points-card { background: var(--paper); border-radius: var(--radius-lg); padding: 32px; box-shadow: 0 1px 0 rgba(20,17,13,0.04), 0 24px 60px -32px rgba(20,17,13,0.16); }
.points-card .points-label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--bloom); margin-bottom: 18px; font-weight: 600; }
.points-card ul { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.points-card li { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--rule-soft); font-size: 15px; }
.points-card li:last-child { border-bottom: none; }
.points-card strong { color: var(--ink-900); font-weight: 700; }
.points-card span { color: var(--ink-500); }

/* Sprints (program list) */
.sprints-wrap { display: flex; flex-direction: column; gap: 36px; }
.sprint-phase { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--bloom); margin-bottom: 12px; font-weight: 600; }
.sprint-list { list-style: none; }
.sprint-list li { border-top: 1px solid rgba(20,17,13,0.08); }
.sprint-list li:last-child { border-bottom: 1px solid rgba(20,17,13,0.08); }
.sprint-row { width: 100%; display: grid; grid-template-columns: 60px 1fr 2fr 24px; gap: 16px; padding: 22px 0; align-items: baseline; text-align: left; border: none; background: transparent; cursor: pointer; }
.sprint-row .sprint-num { font-family: var(--mono); font-size: 12px; color: var(--ink-400); }
.sprint-row .sprint-title { font-family: var(--sans); font-weight: 700; font-size: 18px; color: var(--ink-900); letter-spacing: -0.02em; }
.sprint-row .sprint-snippet { font-size: 14px; color: var(--ink-500); }
.sprint-row .sprint-chev { color: var(--ink-400); transition: transform 200ms ease; justify-self: end; }
.sprint-row .sprint-chev.open { transform: rotate(180deg); }
.sprint-body { padding: 0 0 24px 76px; max-width: none; color: var(--ink-700); font-size: 15px; line-height: 1.6; }
/* Allow up to two lines on desktop. Short bodies stay on one line; long ones
   wrap to a second and get an ellipsis if they overflow. */
.sprint-body p {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 1080px) {
  /* Phones / small tablets — let the prose flow naturally. */
  .sprint-body p { display: block; -webkit-line-clamp: none; overflow: visible; text-overflow: clip; }
}

/* FAQ */
.faq-list { list-style: none; }
.faq-list li { border-top: 1px solid rgba(20,17,13,0.08); }
.faq-list li:last-child { border-bottom: 1px solid rgba(20,17,13,0.08); }
.faq-q { width: 100%; padding: 24px 0; display: flex; justify-content: space-between; align-items: center; gap: 16px; cursor: pointer; text-align: left; border: none; background: transparent; font-family: var(--sans); font-size: 18px; font-weight: 600; color: var(--ink-900); letter-spacing: -0.02em; }
.faq-q:hover { color: var(--bloom); }
.faq-a { padding: 0 0 24px; max-width: 720px; color: var(--ink-700); font-size: 15px; line-height: 1.6; }

/* Conduct */
.conduct-list { list-style: none; display: flex; flex-direction: column; gap: 0; }
.conduct-list li { display: flex; gap: 24px; padding: 28px 0; border-top: 1px solid rgba(20,17,13,0.08); }
.conduct-list li:last-child { border-bottom: 1px solid rgba(20,17,13,0.08); }
.conduct-n { font-family: var(--mono); font-size: 12px; color: var(--bloom); width: 40px; flex-shrink: 0; padding-top: 4px; font-weight: 600; }
.conduct-list h4 { font-family: var(--sans); font-weight: 700; font-size: 18px; color: var(--ink-900); margin-bottom: 8px; letter-spacing: -0.02em; }
.conduct-list p { font-size: 15px; color: var(--ink-700); line-height: 1.6; }

/* Getting started (dark) */
.start-head { display: flex; flex-direction: column; gap: 12px; max-width: 720px; margin-bottom: 64px; }
.start-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin-bottom: 56px; }
.start-card { padding: 28px 0; border-top: 1px solid rgba(255,255,255,0.2); }
.start-n { font-family: var(--mono); font-size: 12px; color: var(--bloom-3); margin-bottom: 16px; font-weight: 600; }
.start-card h4 { font-family: var(--sans); font-weight: 700; font-size: 22px; color: #fff; margin-bottom: 10px; letter-spacing: -0.02em; }
.start-card p { font-size: 14px; color: rgba(255,255,255,0.65); line-height: 1.55; }
.start-cta { display: flex; justify-content: flex-start; }
@media (max-width: 760px) { .start-grid { grid-template-columns: 1fr 1fr; } }

/* Program footer */
.program-footer { padding: 32px 0 48px; border-top: 1px solid rgba(20,17,13,0.08); }
.pf-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.pf-tag { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-500); margin-left: 12px; }
.pf-right.mono { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-500); }

/* ---------- Modal ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(20,17,13,0.55); z-index: 80; display: flex; align-items: center; justify-content: center; padding: 32px; animation: fadeUp 180ms ease both; backdrop-filter: blur(4px); }
.modal {
  background: var(--paper); border-radius: var(--radius-lg);
  padding: 28px 32px;
  max-width: 720px; width: 100%;
  max-height: calc(100vh - 48px);
  display: flex; flex-direction: column;
  box-shadow: 0 30px 80px -20px rgba(20,17,13,0.4);
  overflow: hidden;
}
/* The header is pinned at the top of the modal, the body scrolls underneath.
   This guarantees the title is always visible no matter how tall the body is. */
.modal > .modal-head {
  flex: 0 0 auto;
  background: var(--paper);
  margin: 0 -32px 16px;
  padding: 0 32px 16px;
  border-bottom: 1px solid var(--rule-soft);
}
.modal > .modal-body {
  flex: 1 1 auto;
  overflow-y: auto;
  min-height: 0;
  margin: 0 -32px -28px;
  padding: 0 32px 28px;
}
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 24px; gap: 16px; }
.modal-head .serif-h2 { font-family: var(--sans); font-weight: 800; font-size: 28px; letter-spacing: -0.03em; }
.sprint-detail { padding: 18px 0; border-top: 1px solid var(--rule-soft); }
.sprint-detail:first-child { border-top: none; padding-top: 0; }
.sprint-detail .mono-label { color: var(--bloom); font-weight: 600; margin-bottom: 8px; display: block; }
.sprint-detail p { font-size: 15px; color: var(--ink-700); line-height: 1.6; }
.sprint-detail .muted { color: var(--ink-300); font-style: italic; }

/* ---------- Admin shell ---------- */
.admin-shell { display: grid; grid-template-columns: 240px 1fr; min-height: calc(100vh - 65px); }
.admin-side { background: rgba(255,255,255,0.5); backdrop-filter: blur(10px); border-right: 1px solid rgba(20,17,13,0.06); padding: 32px 24px; }
.admin-main { padding: 40px; }
.admin-nav { display: flex; flex-direction: column; gap: 4px; }
.admin-nav a {
  padding: 10px 14px; border-radius: 10px;
  font-size: 14px; color: var(--ink-700); font-weight: 500;
  display: flex; align-items: center; justify-content: space-between;
  transition: background 120ms ease, color 120ms ease;
}
.admin-nav a:hover { background: rgba(255,255,255,0.7); color: var(--ink-900); }
.admin-nav a.active { background: var(--ink-900); color: #fff; }
.admin-nav a .ct { font-family: var(--mono); font-size: 11px; opacity: 0.6; }
@media (max-width: 760px) { .admin-shell { grid-template-columns: 1fr; } .admin-side { border-right: none; border-bottom: 1px solid var(--rule); } .admin-main { padding: 24px; } }

/* ---------- Misc ---------- */
.dash .container, .admin-main { position: relative; }

/* Page transitions */
.page-enter, .route-fade { animation: fadeUp 320ms ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Stat row */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; background: var(--paper); border-radius: var(--radius-lg); box-shadow: 0 1px 0 rgba(20,17,13,0.04), 0 24px 60px -32px rgba(20,17,13,0.16); overflow: hidden; }
.stat { padding: 24px 28px; border-right: 1px solid var(--rule); }
.stat:last-child { border-right: none; }
.stat .l { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-400); font-weight: 500; }
.stat .v { font-family: var(--sans); font-weight: 800; font-size: 36px; color: var(--ink-900); margin-top: 10px; line-height: 1; letter-spacing: -0.03em; }
@media (max-width: 760px) {
  .stat-row { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(2) { border-right: none; }
  .stat:nth-child(odd) { border-right: 1px solid var(--rule); }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--rule); }
}


/* ---------- Admin · Sprint Management ---------- */
.sa-head-right { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.sa-filters { display: inline-flex; background: var(--paper-soft); border: 1px solid var(--rule); border-radius: 999px; padding: 4px; }
.sa-filter {
  appearance: none; border: 0; background: transparent;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-500); padding: 8px 14px; border-radius: 999px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px; transition: all 0.15s;
}
.sa-filter:hover { color: var(--ink-900); }
.sa-filter.on { background: var(--ink-900); color: #fff; }
.sa-filter.on .sa-count { background: rgba(255,255,255,0.18); color: #fff; }
.sa-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 18px; padding: 0 6px; border-radius: 9px;
  background: var(--rule); color: var(--ink-700); font-size: 10px;
}

.sa-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px; padding: 24px;
}
.sa-card {
  position: relative; background: var(--paper); border: 1px solid var(--rule);
  border-radius: 14px; padding: 18px 18px 14px; cursor: pointer;
  display: flex; flex-direction: column; gap: 10px; min-height: 168px;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.sa-card:hover { border-color: var(--bloom); transform: translateY(-1px); box-shadow: 0 8px 20px -12px rgba(60,0,166,0.25); }
.sa-card.active { border-left: 3px solid var(--bloom); }
.sa-card-head { display: flex; align-items: center; justify-content: space-between; }
.sa-num-chip {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em;
  color: var(--ink-500); background: var(--paper-soft);
  padding: 4px 8px; border-radius: 6px; border: 1px solid var(--rule);
}
.sa-status {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-500);
}
.sa-status .sa-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-300); }
.sa-status.active { color: var(--bloom); }
.sa-status.active .sa-dot { background: var(--bloom); box-shadow: 0 0 0 3px rgba(60,0,166,0.15); }
.sa-status.ended { color: var(--ink-400); }
.sa-status.ended .sa-dot { background: var(--ink-400); }
.sa-card.ended { opacity: 0.7; }
.sa-title { font-family: var(--serif); font-size: 18px; line-height: 1.2; color: var(--ink-900); margin: 0; }
.sa-snippet { font-size: 13px; line-height: 1.45; color: var(--ink-500); margin: 0; flex: 1; }
.sa-card-foot {
  display: flex; gap: 14px; padding-top: 10px; margin-top: auto;
  border-top: 1px solid var(--rule-soft);
}
.sa-iconlink {
  appearance: none; border: 0; background: transparent; padding: 0;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-500); cursor: pointer; transition: color 0.15s;
}
.sa-iconlink:hover { color: var(--bloom); }
.sa-iconlink.danger:hover { color: #C2384C; }
.sa-empty { grid-column: 1/-1; padding: 48px 24px; text-align: center; color: var(--ink-500); font-family: var(--mono); font-size: 13px; }

/* Modal form helpers shared with sprint editor */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.seg { display: inline-flex; background: var(--paper-soft); border: 1px solid var(--rule); border-radius: 8px; padding: 3px; }
.seg-btn {
  appearance: none; border: 0; background: transparent;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-500); padding: 8px 16px; border-radius: 6px; cursor: pointer;
}
.seg-btn.on { background: var(--ink-900); color: #fff; }


/* ---------- Goals four-up + step label ---------- */
.goals-grid.four { grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 1080px) { .goals-grid.four { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px)  { .goals-grid.four { grid-template-columns: 1fr; } }
.goal-card { display: flex; flex-direction: column; gap: 10px; padding: 22px; }
.goal-card.center { align-items: center; text-align: center; }
.goal-step { color: var(--bloom); letter-spacing: 0.12em; text-transform: uppercase; font-weight: 600; }

/* ---------- Tier rewards card upgrades ---------- */
.tier-card.rewards { padding: 28px; gap: 16px; display: flex; flex-direction: column; }
.tier-card.rewards .req-strip ul { display: flex; flex-direction: column; gap: 0; }
.tier-card.rewards .req-strip { background: var(--paper-soft); border-radius: 10px; padding: 12px 14px; margin-top: 4px; }
.tier-card.rewards.apex .req-strip { background: rgba(255,255,255,0.04); }
.tier-card.rewards .req-strip ul li { padding: 4px 0; border: 0; font-size: 13px; }

/* ---------- Activities ---------- */
.activity-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 32px; }
@media (max-width: 1080px) { .activity-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .activity-grid { grid-template-columns: 1fr; } }
.activity-card {
  background: var(--paper); border-radius: var(--radius); padding: 22px;
  display: flex; flex-direction: column; gap: 10px;
  box-shadow: 0 1px 0 rgba(20,17,13,0.03);
}
.activity-card.primary { background: var(--ink-900); color: rgba(255,255,255,0.78); }
.activity-card.primary h3 { color: #fff; }
.activity-card.primary p { color: rgba(255,255,255,0.7); }
.activity-card.primary .mono-label { color: var(--bloom-3); }
.activity-card .mono-label { color: var(--bloom); font-weight: 600; }
.activity-card h3 { font-family: var(--sans); font-weight: 700; font-size: 17px; color: var(--ink-900); letter-spacing: -0.02em; line-height: 1.25; }
.activity-card p { font-size: 13.5px; color: var(--ink-500); line-height: 1.5; }

.activity-matrix { background: var(--paper); border-radius: var(--radius-lg); overflow: hidden; box-shadow: 0 1px 0 rgba(20,17,13,0.04), 0 24px 60px -32px rgba(20,17,13,0.16); }
.activity-matrix .am-head { padding: 18px 24px 0; }
.activity-matrix table { width: 100%; border-collapse: collapse; }
.activity-matrix th { text-align: left; padding: 14px 24px 18px; font-size: 13px; font-weight: 600; color: var(--ink-500); border-bottom: 1px solid var(--rule); }
.activity-matrix th:not(:first-child) { text-align: center; width: 18%; }
.activity-matrix td { padding: 16px 24px; border-bottom: 1px solid var(--rule-soft); font-size: 14.5px; color: var(--ink-700); }
.activity-matrix td.act { color: var(--ink-900); font-weight: 500; }
.activity-matrix td:not(:first-child) { text-align: center; }
.activity-matrix tr:last-child td { border-bottom: none; }
.activity-matrix .dash { color: var(--ink-300); }
.activity-matrix .cell-apex { color: var(--bloom); font-weight: 600; }

/* ---------- Phase timeline ---------- */
.phase-timeline {
  list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0;
  background: var(--paper); border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: 0 1px 0 rgba(20,17,13,0.04), 0 24px 60px -32px rgba(20,17,13,0.16);
  margin-bottom: 36px;
}
@media (max-width: 900px) { .phase-timeline { grid-template-columns: 1fr; } }
.phase-step { display: flex; gap: 16px; padding: 24px; position: relative; }
.phase-step + .phase-step { border-left: 1px solid var(--rule-soft); }
@media (max-width: 900px) { .phase-step + .phase-step { border-left: 0; border-top: 1px solid var(--rule-soft); } }
.phase-rail { display: flex; flex-direction: column; align-items: center; }
.phase-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--bloom-soft); color: var(--bloom);
  font-family: var(--mono); font-weight: 700; font-size: 13px;
}
.phase-body { flex: 1; }
.phase-body h4 { font-family: var(--serif); font-size: 22px; line-height: 1.2; color: var(--ink-900); margin: 6px 0 8px; }
.phase-body p { font-size: 13.5px; color: var(--ink-500); line-height: 1.5; }
.phase-meta { display: flex; align-items: center; gap: 10px; }
.phase-window { color: var(--ink-500); letter-spacing: 0.08em; }
.phase-tag { font-family: var(--mono); font-size: 10px; padding: 3px 7px; border-radius: 999px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 600; }
.phase-tag.confidential { background: rgba(60,0,166,0.08); color: var(--bloom); }
.phase-tag.public { background: rgba(20,17,13,0.06); color: var(--ink-700); }
.phase-tag.tge { background: var(--ink-900); color: #fff; }

/* ---------- Sprint group head ---------- */
.sprint-group + .sprint-group { margin-top: 48px; }
.sprint-group-head {
  padding: 0 0 16px;
  border-bottom: 1px solid var(--ink-900);
  margin-bottom: 0;
}
.sprint-group-head h4.sprint-phase {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--ink-900); font-weight: 600;
  margin: 0;
}
.sprint-group .sprint-list { background: transparent; border: 0; border-radius: 0; }
.sprint-group .sprint-list li { border-top: 0; border-bottom: 1px solid rgba(20,17,13,0.10); }
.sprint-group .sprint-list li:last-child { border-bottom: 1px solid rgba(20,17,13,0.10); }


/* ---------- Application: section sub + acknowledgments redesign ---------- */
.form-section-head { display: flex; flex-direction: column; gap: 6px; }
.form-section-sub { font-size: 14px; color: var(--ink-500); margin-top: 2px; }

.ack-list { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.ack-item {
  display: grid; grid-template-columns: auto 1fr; gap: 18px;
  align-items: flex-start;
  padding: 18px 20px; border: 1px solid var(--rule); border-radius: var(--radius);
  background: var(--paper); transition: border-color 0.15s, background 0.15s;
}
.ack-item.on { border-color: var(--bloom); background: linear-gradient(180deg, rgba(60,0,166,0.04), rgba(60,0,166,0.02)); }
.ack-toggle {
  appearance: none; border: 1.5px solid var(--ink-300); background: var(--paper);
  width: 28px; height: 28px; border-radius: 8px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all 0.15s; padding: 0; flex-shrink: 0; margin-top: 2px;
}
.ack-toggle:hover { border-color: var(--bloom); }
.ack-item.on .ack-toggle { background: var(--bloom); border-color: var(--bloom); color: #fff; }
.ack-toggle .ack-check { display: inline-flex; opacity: 0; transition: opacity 0.15s; color: #fff; }
.ack-item.on .ack-toggle .ack-check { opacity: 1; }
.ack-copy h4 { font-family: var(--sans); font-weight: 700; font-size: 15px; color: var(--ink-900); letter-spacing: -0.01em; margin-bottom: 4px; }
.ack-copy p { font-size: 13.5px; color: var(--ink-500); line-height: 1.55; }


/* ---------- Tight CTA bar ---------- */
.cta-tight { padding: 28px 0; background: var(--ink-900); color: #fff; }
.cta-tight .cta-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; flex-wrap: wrap;
}
.cta-line {
  font-family: var(--serif); font-weight: 400; font-size: 28px;
  letter-spacing: -0.01em; color: #fff; margin: 0;
}
@media (max-width: 640px) {
  .cta-tight .cta-row { justify-content: center; text-align: center; }
}


/* ---------- CTA tight (override) ---------- */
.cta-tight { padding: 32px 0; background: var(--ink-900); color: #fff; }
.cta-tight .cta-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
}
.cta-tight .kicker.dark {
  font-family: var(--mono); font-size: 16px; letter-spacing: 0.14em;
  text-transform: uppercase; color: rgba(255,255,255,0.7); font-weight: 600;
  margin: 0;
}
.btn-cta-line {
  appearance: none; border: 0; background: transparent; padding: 0;
  font-family: var(--mono); font-size: 16px; letter-spacing: 0.14em;
  text-transform: uppercase; color: #fff; font-weight: 600;
  display: inline-flex; align-items: center; gap: 10px; cursor: pointer;
  transition: color 0.15s;
}
.btn-cta-line:hover { color: var(--bloom-3); }
.btn-cta-line:hover svg { transform: translateX(2px); }
.btn-cta-line svg { transition: transform 0.15s; }
@media (max-width: 640px) {
  .cta-tight .cta-row { justify-content: center; text-align: center; }
}


/* ---------- Pending notice (waiting room) ---------- */
.pending-notice {
  display: flex; align-items: flex-start; gap: 18px;
  padding: 22px 24px; margin: 0 0 28px;
  background: var(--bloom-soft); border: 1px solid rgba(124,58,237,0.18);
  border-radius: 12px;
}
.pending-notice-mark {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%;
  background: var(--bloom); color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.pending-notice-body h3 {
  margin: 0 0 4px; font-family: var(--serif); font-weight: 500;
  font-size: 20px; color: var(--ink-900); letter-spacing: -0.01em;
}
.pending-notice-body p {
  margin: 0; font-size: 14px; line-height: 1.55;
  color: rgba(20,17,13,0.72); max-width: 64ch;
}

/* ---------- Pending dashboard CTA (nudge to post during review) ---------- */
.pending-cta {
  display: flex; align-items: flex-start; gap: 18px;
  padding: 22px 24px; margin: 0 0 24px;
  background: linear-gradient(135deg, rgba(60,0,166,0.06), rgba(60,0,166,0.13));
  border: 1px solid rgba(60,0,166,0.20);
  border-radius: 14px;
  box-shadow: 0 6px 24px -16px rgba(60,0,166,0.45);
}
.pending-cta-mark {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%;
  background: var(--bloom); color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.pending-cta-body h3 {
  margin: 0 0 4px; font-family: var(--serif); font-weight: 500;
  font-size: 20px; color: var(--ink-900); letter-spacing: -0.01em;
}
.pending-cta-body p {
  margin: 0; font-size: 14px; line-height: 1.55;
  color: rgba(20,17,13,0.78); max-width: 70ch;
}
.pending-cta-body p strong { color: var(--ink-900); font-weight: 600; }

/* ---------- Image uploader ---------- */
.img-uploader { width: 100%; }
.img-thumbs {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.img-thumb {
  position: relative; aspect-ratio: 4/3; border-radius: 8px;
  overflow: hidden; border: 1px solid var(--rule); background: var(--ink-50);
}
.img-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-thumb-x {
  position: absolute; top: 6px; right: 6px; width: 22px; height: 22px;
  border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(20,17,13,0.78); color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.img-thumb-x:hover { background: var(--ink-900); }
.img-thumb-name {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 4px 8px; font-family: var(--mono); font-size: 10px;
  color: #fff; background: linear-gradient(180deg, transparent, rgba(0,0,0,0.6));
  white-space: nowrap; text-overflow: ellipsis; overflow: hidden;
}
.img-add {
  appearance: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; aspect-ratio: 4/3;
  background: transparent; color: rgba(20,17,13,0.6);
  border: 1.5px dashed var(--rule); border-radius: 8px;
  font-family: var(--sans); font-size: 13px; font-weight: 500;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.img-add:hover {
  border-color: var(--bloom); color: var(--bloom);
  background: var(--bloom-soft);
}
.img-add-hint {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.06em;
  text-transform: uppercase; color: rgba(20,17,13,0.45);
}

/* Card-head right-side cluster (download button + row count). */
.card-head-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Application detail (admin modal) — readable, grouped sections */
.app-detail { display: flex; flex-direction: column; gap: 22px; }
.app-detail-section { display: block; }
.app-detail-section-title {
  font-family: var(--mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.10em;
  color: var(--ink-500); font-weight: 500;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--rule-soft);
}
.app-detail-grid {
  display: grid;
  grid-template-columns: minmax(160px, max-content) 1fr;
  gap: 8px 20px;
  margin: 0;
}
.app-detail-grid dt {
  font-family: var(--mono); font-size: 11px;
  color: var(--ink-400); letter-spacing: 0.06em;
  text-transform: uppercase; font-weight: 500;
  align-self: center;
}
.app-detail-grid dd {
  margin: 0;
  font-size: 14px; color: var(--ink-900);
  font-weight: 500;
  overflow-wrap: anywhere;
}
.app-detail-long { margin-top: 14px; }
.app-detail-long:first-child { margin-top: 0; }
.app-detail-long-label {
  font-family: var(--mono); font-size: 11px;
  color: var(--bloom, #3C00A6); letter-spacing: 0.06em;
  text-transform: uppercase; font-weight: 500;
  margin-bottom: 6px;
}
.app-detail-long p {
  margin: 0;
  font-size: 14px; line-height: 1.55; color: var(--ink-900);
  white-space: pre-wrap; overflow-wrap: anywhere;
}

/* Modal action row — flex so a left-aligned Delete + right-aligned Reject/Approve all line up */
.modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--rule-soft);
}

/* ---------- Confirm modal (in-app replacement for window.confirm) ---------- */
.confirm-modal {
  text-align: center;
  padding: 4px 4px 0;
  display: flex; flex-direction: column; align-items: center;
}
.confirm-modal-mark {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(60,0,166,0.10), rgba(60,0,166,0.18));
  color: var(--bloom, #3C00A6);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
  box-shadow: 0 0 0 6px rgba(60,0,166,0.06);
}
.confirm-modal-mark.danger {
  background: linear-gradient(135deg, rgba(192,57,43,0.10), rgba(192,57,43,0.22));
  color: #c0392b;
  box-shadow: 0 0 0 6px rgba(192,57,43,0.06);
}
.confirm-modal h3 { margin: 0 0 8px; }
.confirm-modal p {
  max-width: 420px;
  color: var(--ink-500);
  line-height: 1.55;
  margin: 0 0 22px;
  font-size: 14px;
}
.confirm-modal-actions {
  display: flex; gap: 10px; justify-content: center;
  width: 100%;
  padding-top: 12px;
  border-top: 1px solid var(--rule-soft);
  margin-top: 4px;
}
.btn-danger {
  background: #c0392b; color: #fff;
  border: 1px solid #c0392b;
}
.btn-danger:hover { background: #a83020; border-color: #a83020; }
.btn-danger:active { transform: translateY(1px); }

/* ---------- Toast stack (in-app replacement for window.alert) ---------- */
.toast-stack {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex; flex-direction: column-reverse;
  gap: 10px;
  pointer-events: none;
  max-width: calc(100vw - 48px);
}
.toast {
  display: flex; align-items: center; gap: 10px;
  background: var(--ink-900, #14110D);
  color: #fff;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px; line-height: 1.4;
  box-shadow: 0 12px 32px -12px rgba(20,17,13,0.6);
  pointer-events: auto;
  animation: toastIn 220ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  max-width: 420px;
}
.toast-msg { overflow-wrap: anywhere; }
.toast-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ink-400);
  flex: 0 0 auto;
}
.toast-success .toast-dot { background: #16a34a; box-shadow: 0 0 0 4px rgba(22,163,74,0.18); }
.toast-error   .toast-dot { background: #ef4444; box-shadow: 0 0 0 4px rgba(239,68,68,0.18); }
.toast-info    .toast-dot { background: var(--bloom, #3C00A6); box-shadow: 0 0 0 4px rgba(60,0,166,0.18); }
@keyframes toastIn {
  from { transform: translateY(8px); opacity: 0; }
  to   { transform: translateY(0);   opacity: 1; }
}

/* Application-submitted success modal */
.submit-modal {
  text-align: center;
  padding: 12px 8px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.submit-modal-mark {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(60,0,166,0.10), rgba(60,0,166,0.18));
  color: var(--bloom, #3C00A6);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 18px;
  box-shadow: 0 0 0 6px rgba(60,0,166,0.06);
}
.submit-modal h3 { margin: 0 0 10px; }
.submit-modal p {
  max-width: 440px;
  color: var(--ink-500);
  line-height: 1.55;
  margin: 0 0 24px;
}
.submit-modal-actions { display: flex; justify-content: center; }

/* Required-field marker + error state */
.req-mark { color: #c0392b; margin-left: 2px; }
.field.field-error input,
.field.field-error select,
.field.field-error textarea {
  border-color: #c0392b !important;
  box-shadow: 0 0 0 1px rgba(192,57,43,0.20);
}
.ack-item.field-error { border-color: #c0392b; box-shadow: 0 0 0 1px rgba(192,57,43,0.20); }
