/* ============================================================
   Maverix Academy Portal
   Extends the Maverix Visuals brand system (cream / ink / lime).
   ============================================================ */

:root {
  --cream: oklch(0.972 0.014 92);
  --ink: #041715;
  --charcoal: oklch(0.24 0.008 260);
  --lime: oklch(0.92 0.22 128);
  --lime-deep: oklch(0.82 0.24 128);

  --background: var(--cream);
  --foreground: var(--ink);
  --card: oklch(1 0 0);
  --border: oklch(0.16 0.012 260 / 0.1);
  --border-strong: oklch(0.16 0.012 260 / 0.18);
  --muted: oklch(0.16 0.012 260 / 0.55);

  --font-display: "Instrument Serif", ui-serif, Georgia, serif;
  --font-sans: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --radius-sm: 0.75rem;
  --radius-md: 1.25rem;
  --radius-lg: 1.75rem;
  --radius-2xl: 2.25rem;

  --sidebar-w: 248px;
  --topbar-h: 68px;

  --ok: oklch(0.75 0.16 145);
  --warn: oklch(0.8 0.16 75);
  --bad: oklch(0.63 0.22 25);
}

* { box-sizing: border-box; }
html, body, div, span, a, p, h1, h2, h3, h4, h5, ul, ol, li, img, button, input, textarea, select, label, table, th, td {
  margin: 0; padding: 0; border: 0; font: inherit; vertical-align: baseline;
}
ul, ol { list-style: none; }
a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }
button, input, textarea, select { background: none; color: inherit; }
button { cursor: pointer; }
table { border-collapse: collapse; width: 100%; }

html, body {
  height: 100%;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--lime); color: var(--ink); }

.italic { font-family: var(--font-display); font-style: italic; }
.mono { font-family: var(--font-mono); }

/* ---------- App shell (no page-length scrolling) ---------- */
.app-shell {
  height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  overflow: hidden;
}

.sidebar {
  background: var(--ink);
  color: var(--cream);
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem;
  overflow-y: auto;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.5rem 1.5rem;
}
.sidebar-brand .mark {
  width: 34px; height: 34px;
  background: var(--lime);
  border-radius: 0.6rem;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.25rem;
}
.sidebar-brand .mark.mark-img,
.auth-brand .mark.mark-img {
  background: var(--cream);
  padding: 4px;
}
.mark-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.brand-hero-mark {
  position: absolute; right: -18px; bottom: -18px; width: 190px; height: 190px;
  object-fit: contain; opacity: 0.08; pointer-events: none; filter: grayscale(1) brightness(4);
}
.badges-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.85rem; }
.badge-tile {
  border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 1rem; text-align: center; background: var(--card);
  transition: transform .15s ease, box-shadow .15s ease;
}
.badge-tile.earned { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.badge-tile .badge-icon-wrap {
  width: 44px; height: 44px; margin: 0 auto 0.6rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--lime); color: var(--ink);
}
.badge-tile:not(.earned) .badge-icon-wrap { background: var(--border); color: var(--muted); opacity: .6; }
.badge-tile .badge-name { font-weight: 600; font-size: 0.85rem; margin-bottom: 0.15rem; }
.badge-tile .badge-desc { font-size: 0.72rem; opacity: 0.7; }
.gift-cover { height: 110px; border-radius: var(--radius-sm) var(--radius-sm) 0 0; background: var(--ink) center/cover no-repeat; margin: -1.5rem -1.5rem 1rem; position: relative; overflow: hidden; }
.gift-cover.no-image { display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--ink), #0a2e24); }
.gift-cover.no-image svg { width: 34px; height: 34px; color: var(--lime); opacity: .85; }
.color-field { display: flex; align-items: center; gap: 0.6rem; }
.color-field input[type="color"] { width: 44px; height: 36px; padding: 2px; border-radius: 0.5rem; border: 1px solid var(--border-strong); background: none; cursor: pointer; }
.admin-list-row { display: flex; align-items: center; gap: .75rem; padding: .75rem 0; border-bottom: 1px solid var(--border); }
.admin-list-row:last-child { border-bottom: 0; }
.settings-tabs { display: flex; gap: .4rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.settings-tabs a { padding: .5rem 1rem; border-radius: 999px; font-size: .85rem; font-weight: 500; text-decoration: none; color: var(--foreground); border: 1px solid var(--border); }
.settings-tabs a.active { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.sidebar-brand .name {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.sidebar-brand .sub {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgb(252 248 233 / 0.5);
}

.sidebar-nav { display: flex; flex-direction: column; gap: 0.15rem; flex: 1; }
.sidebar-section-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgb(252 248 233 / 0.4);
  padding: 1rem 0.75rem 0.4rem;
}
.sidebar-link {
  display: flex; align-items: center; gap: 0.65rem;
  padding: 0.6rem 0.75rem;
  border-radius: 0.7rem;
  font-size: 0.9rem;
  color: rgb(252 248 233 / 0.75);
  transition: background 0.15s ease, color 0.15s ease;
}
.sidebar-link svg { width: 17px; height: 17px; flex-shrink: 0; }
.sidebar-link:hover { background: rgb(252 248 233 / 0.06); color: var(--cream); }
.sidebar-link.active { background: var(--lime); color: var(--ink); font-weight: 500; }
.sidebar-link .badge-count {
  margin-left: auto;
  background: rgb(252 248 233 / 0.15);
  color: var(--cream);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
}
.sidebar-link.active .badge-count { background: rgb(4 23 21 / 0.15); color: var(--ink); }

.sidebar-footer {
  border-top: 1px solid rgb(252 248 233 / 0.1);
  padding-top: 1rem;
  margin-top: 0.5rem;
  display: flex; align-items: center; gap: 0.6rem;
}
.avatar {
  width: 36px; height: 36px; border-radius: 999px;
  background: var(--lime); color: var(--ink);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 600; flex-shrink: 0;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-footer .who { flex: 1; min-width: 0; }
.sidebar-footer .who .n { font-size: 0.82rem; color: var(--cream); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-footer .who .r { font-family: var(--font-mono); font-size: 0.65rem; color: rgb(252 248 233 / 0.45); text-transform: uppercase; }
.sidebar-footer .logout { color: rgb(252 248 233 / 0.5); }
.sidebar-footer .logout:hover { color: var(--cream); }

/* Always out-of-flow so it never occupies a grid cell in .app-shell,
   regardless of viewport — only its visibility toggles per breakpoint. */
.sidebar-scrim {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgb(0 0 0 / 0.4);
}

/* ---------- Main column ---------- */
.main-col {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.topbar {
  height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 2rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--background);
}
.topbar h1 {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.4rem;
  letter-spacing: -0.01em;
}
.topbar .topbar-right { display: flex; align-items: center; gap: 1rem; }
.mobile-toggle { display: none; }

.main-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 1.75rem 2rem 2.5rem;
}

/* ---------- Cards & grid ---------- */
.grid { display: grid; gap: 1rem; }
.g-12 { grid-template-columns: repeat(12, 1fr); }
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
}
.card-tight { padding: 1.1rem 1.25rem; }
.card-flush { padding: 0; overflow: hidden; }
.card-title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}
.card-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.card-sub { font-size: 0.85rem; color: var(--muted); }
.card-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  font-family: var(--font-sans);
  font-size: 0.85rem; font-weight: 500;
  padding: 0.72rem 1.2rem;
  border-radius: 999px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease, background 0.15s ease;
  white-space: nowrap;
  box-shadow: 0 8px 20px rgb(4 23 21 / 0.06);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn svg { width: 15px; height: 15px; }
.btn-ink { background: var(--ink); color: var(--cream); }
.btn-ink:hover { background: var(--charcoal); box-shadow: 0 12px 24px rgb(4 23 21 / 0.14); }
.btn-lime { background: var(--lime); color: var(--ink); }
.btn-lime:hover { filter: brightness(0.95); box-shadow: 0 12px 24px rgb(178 220 95 / 0.28); }
.btn-outline { border: 1px solid var(--border-strong); }
.btn-outline:hover { background: rgb(4 23 21 / 0.05); }
.btn-ghost { color: var(--muted); }
.btn-ghost:hover { color: var(--ink); }
.btn-sm { padding: 0.45rem 0.8rem; font-size: 0.78rem; }
.btn-danger { background: rgb(220 38 38 / 0.1); color: rgb(185 28 28); }
.btn-danger:hover { background: rgb(220 38 38 / 0.18); }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- Progress ---------- */
.progress-bar { height: 8px; background: rgb(4 23 21 / 0.08); border-radius: 999px; overflow: hidden; }
.progress-bar > span { display: block; height: 100%; background: var(--lime-deep); border-radius: 999px; transition: width 0.4s ease; }
.progress-ring { position: relative; width: 76px; height: 76px; }
.progress-ring svg { transform: rotate(-90deg); }
.progress-ring circle { fill: none; stroke-width: 7; }
.progress-ring .track { stroke: rgb(4 23 21 / 0.08); }
.progress-ring .fill { stroke: var(--lime-deep); stroke-linecap: round; transition: stroke-dashoffset 0.5s ease; }
.progress-ring .pct {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 0.85rem; font-weight: 600;
}

/* ---------- Pills / badges / status ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 0.3rem;
  border-radius: 999px; font-size: 0.7rem; font-family: var(--font-mono);
  padding: 0.25rem 0.65rem; text-transform: uppercase; letter-spacing: 0.03em;
}
.pill-lime { background: var(--lime); color: var(--ink); }
.pill-ink { background: var(--ink); color: var(--cream); }
.pill-muted { background: rgb(4 23 21 / 0.06); color: var(--muted); }
.pill-ok { background: oklch(0.75 0.16 145 / 0.15); color: oklch(0.45 0.14 145); }
.pill-warn { background: oklch(0.8 0.16 75 / 0.18); color: oklch(0.5 0.14 60); }
.pill-bad { background: oklch(0.63 0.22 25 / 0.13); color: oklch(0.5 0.2 25); }
.dot { width: 7px; height: 7px; border-radius: 999px; display: inline-block; }
.dot-ok { background: var(--ok); }
.dot-warn { background: var(--warn); }
.dot-bad { background: var(--bad); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1rem; }
.field label { font-size: 0.8rem; font-weight: 500; }
.field .hint { font-size: 0.72rem; color: var(--muted); }
input[type="text"], input[type="password"], input[type="email"], input[type="tel"],
input[type="date"], input[type="time"], input[type="url"], input[type="number"],
input[type="file"], textarea, select {
  border: 1px solid var(--border-strong);
  border-radius: 0.85rem;
  padding: 0.8rem 0.9rem;
  font-size: 0.88rem;
  background: linear-gradient(180deg, rgb(255 255 255 / 0.9), rgb(252 248 233 / 0.7));
  width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
textarea { resize: vertical; min-height: 90px; }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: rgb(178 220 95 / 0.8);
  box-shadow: 0 0 0 4px rgb(178 220 95 / 0.14);
}
.form-actions { display: flex; gap: 0.6rem; margin-top: 1.25rem; }
.checkbox-row { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; }
.checkbox-row input { width: auto; }

.alert {
  border-radius: 0.9rem; padding: 0.8rem 1rem; font-size: 0.85rem; margin-bottom: 1.1rem;
  display: flex; align-items: center; gap: 0.6rem;
}
.alert-ok { background: oklch(0.75 0.16 145 / 0.12); color: oklch(0.4 0.14 145); }
.alert-bad { background: oklch(0.63 0.22 25 / 0.1); color: oklch(0.48 0.2 25); }
.alert-info { background: var(--lime); color: var(--ink); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.table th {
  text-align: left; font-family: var(--font-mono); font-size: 0.68rem;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted);
  padding: 0.7rem 1rem; border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td { padding: 0.85rem 1rem; border-bottom: 1px solid var(--border); font-size: 0.86rem; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: rgb(4 23 21 / 0.02); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 0.3rem; border-bottom: 1px solid var(--border); margin-bottom: 1.25rem; }
.tab {
  padding: 0.7rem 0.2rem; margin-right: 1.3rem; font-size: 0.86rem; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab.active { color: var(--ink); border-color: var(--lime-deep); font-weight: 500; }

/* ---------- Lists ---------- */
.list-row {
  display: flex; align-items: center; gap: 0.9rem;
  padding: 0.85rem 0; border-bottom: 1px solid var(--border);
}
.list-row:last-child { border-bottom: 0; }
.list-icon {
  width: 38px; height: 38px; border-radius: 0.7rem; background: rgb(4 23 21 / 0.05);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.list-icon svg { width: 17px; height: 17px; }
/* Defensive default: any icon svg rendered directly inside a row/card
   without a sizing wrapper (like .list-icon) must never fall back to the
   browser's native ~300x150 replaced-element size. */
.list-row > svg, .card-row > svg, .btn > svg { width: 16px; height: 16px; flex-shrink: 0; }
.list-chevron { display: flex; align-items: center; flex-shrink: 0; color: var(--muted); }
.list-chevron svg { width: 16px; height: 16px; }

/* ---------- Empty states ---------- */
.empty {
  text-align: center; padding: 2.5rem 1rem; color: var(--muted);
}
.empty svg { width: 32px; height: 32px; margin: 0 auto 0.75rem; opacity: 0.4; }

/* ---------- Utility ---------- */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; } .gap-2 { gap: 0.75rem; } .gap-3 { gap: 1rem; }
.muted { color: var(--muted); }
.small { font-size: 0.8rem; }
.tiny { font-size: 0.72rem; }
.mt-1 { margin-top: 0.5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; } .mb-2 { margin-bottom: 1rem; }
.w-full { width: 100%; }
.rounded-img { border-radius: var(--radius-sm); overflow: hidden; }
.clickable { cursor: pointer; }
.divider { height: 1px; background: var(--border); margin: 1.25rem 0; }

/* span helpers */
.col-3 { grid-column: span 3; } .col-4 { grid-column: span 4; } .col-5 { grid-column: span 5; }
.col-6 { grid-column: span 6; } .col-7 { grid-column: span 7; } .col-8 { grid-column: span 8; }
.col-12 { grid-column: span 12; }

/* ---------- Auth pages (outside app shell) ---------- */
.auth-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(circle at top left, rgb(178 220 95 / 0.18), transparent 26%),
    radial-gradient(circle at bottom right, rgb(255 255 255 / 0.08), transparent 30%),
    linear-gradient(135deg, #041715 0%, #082a27 38%, #0b1f1d 100%);
  padding: 2rem;
}
.auth-card {
  position: relative;
  width: 100%; max-width: 420px;
  background: rgba(252, 248, 233, 0.98);
  border: 1px solid rgb(255 255 255 / 0.4);
  border-radius: var(--radius-2xl);
  padding: 2.5rem;
  box-shadow: 0 28px 55px rgb(0 0 0 / 0.28);
  backdrop-filter: blur(10px);
  overflow: hidden;
}
.auth-card::before {
  content: "";
  position: absolute;
  inset: -30% auto auto -20%;
  width: 180px; height: 180px;
  background: radial-gradient(circle, rgb(178 220 95 / 0.28), transparent 70%);
  pointer-events: none;
}
.auth-card::after {
  content: "";
  position: absolute;
  right: -30px; bottom: -30px;
  width: 170px; height: 170px;
  background: radial-gradient(circle, rgb(4 23 21 / 0.08), transparent 66%);
  pointer-events: none;
}
.auth-brand { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 2rem; }
.auth-brand .mark {
  width: 38px; height: 38px; background: var(--ink); color: var(--lime);
  border-radius: 0.7rem; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-style: italic; font-size: 1.3rem;
}
.auth-brand .name { font-family: var(--font-display); font-style: italic; font-size: 1.3rem; }
.auth-title { font-family: var(--font-display); font-style: italic; font-size: 2rem; letter-spacing: -0.02em; margin-bottom: 0.35rem; }
.auth-sub { color: var(--muted); font-size: 0.88rem; margin-bottom: 1.75rem; }
.auth-foot { text-align: center; margin-top: 1.5rem; font-size: 0.85rem; color: var(--muted); }
.auth-foot a { color: var(--ink); font-weight: 500; border-bottom: 1px solid var(--border-strong); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; top: 0; left: 0; z-index: 50; width: 260px;
    transform: translateX(-100%); transition: transform 0.25s ease;
    box-shadow: 0 0 40px rgb(0 0 0 / 0.3);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-scrim.show { display: block; }
  .mobile-toggle { display: flex; }
  .topbar { padding: 0 1rem; }
  .main-scroll { padding: 1.25rem 1rem 2rem; }
  .col-3, .col-4, .col-5, .col-6, .col-7, .col-8 { grid-column: span 12; }
}

@media (max-width: 640px) {
  .topbar { padding: 0 0.8rem; }
  .topbar h1 { font-size: 1.1rem; }
  .main-scroll { padding: 0.9rem 0.75rem 1.5rem; }
  .card { padding: 1rem; }
  .grid { gap: 0.75rem; }
  .btn { padding: 0.55rem 0.9rem; font-size: 0.76rem; }
  .btn-sm { padding: 0.4rem 0.7rem; font-size: 0.72rem; }
  .sidebar-link {
    padding: 0.52rem 0.6rem; font-size: 0.78rem; gap: 0.45rem;
  }
  .sidebar-link svg,
  .list-icon svg,
  .btn svg,
  .card-eyebrow svg,
  .badge-icon-wrap svg,
  .list-chevron svg {
    width: 13px; height: 13px;
  }
  .sidebar-brand { padding-bottom: 1rem; }
  .sidebar-brand .name { font-size: 1rem; }
  .sidebar-brand .mark { width: 30px; height: 30px; }
  .sidebar-footer .who .n { font-size: 0.75rem; }
  .sidebar-footer .who .r { font-size: 0.58rem; }
  .list-row { gap: 0.65rem; padding: 0.7rem 0; }
  .list-icon { width: 32px; height: 32px; }
  .avatar { width: 30px; height: 30px; font-size: 0.7rem; }
  .auth-wrap { padding: 1rem; }
  .auth-card { padding: 1.2rem 1rem 1.15rem; }
  .auth-brand { margin-bottom: 1.3rem; }
  .onboard-card { max-width: 100%; }
  .onboard-masthead {
    grid-template-columns: 1fr; gap: 0.75rem; padding: 0.7rem; text-align: center;
  }
  .onboard-visual { height: 150px; max-width: 220px; width: 100%; margin: 0 auto; }
  .onboard-hero-copy .eyebrow { margin: 0 auto; }
  .onboard-hero-copy h1 { font-size: 1.7rem; }
  .onboard-rules { display: grid; grid-template-columns: 1fr; }
  .onboard-rules span { justify-content: center; }
  .onboard-step-title { font-size: 1.4rem; }
  .avatar-picker { flex-direction: column; align-items: flex-start; }
  .onboard-nav { flex-direction: column-reverse; }
  .onboard-nav .btn { width: 100%; }
  .interest-grid { grid-template-columns: 1fr; max-height: none; }
  .interest-card .thumb { height: 120px; }
  .interest-card .body { padding: 0.7rem 0.7rem 0.8rem; }
}

/* ---------- Milestone toast ---------- */
.toast-pop {
  background: var(--ink);
  color: var(--lime);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-md);
  box-shadow: 0 12px 32px rgb(0 0 0 / 0.22);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.toast-pop.show { opacity: 1; transform: translateY(0); }

/* ============================================================
   Locked / explore courses
   ============================================================ */
.course-locked { position: relative; opacity: 0.55; filter: grayscale(0.25); }
.course-locked .lock-overlay {
  position: absolute; inset: 0; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, rgb(4 23 21 / 0.05), rgb(4 23 21 / 0.35));
}
.course-locked .lock-badge {
  background: var(--ink); color: var(--cream);
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.5rem 0.9rem; border-radius: 999px;
  font-size: 0.78rem; font-weight: 500;
}
.course-locked .lock-badge svg { width: 14px; height: 14px; }
.section-heading {
  display: flex; align-items: center; justify-content: space-between;
  margin: 1.75rem 0 0.75rem;
}
.section-heading .card-title { font-size: 1.05rem; }

/* ============================================================
   Registration onboarding wizard
   ============================================================ */
.onboard-card { width: 100%; max-width: 640px; }
.onboard-masthead {
  display: grid; grid-template-columns: 110px 1fr; gap: 0.9rem; align-items: center;
  padding: 0.9rem 0.9rem 0.7rem; margin-bottom: 0.8rem; border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgb(178 220 95 / 0.12), rgb(255 255 255 / 0.04));
  border: 1px solid var(--border-strong);
  min-height: 0;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.4);
}
.onboard-visual {
  width: 100%; height: 110px; border-radius: 1rem; overflow: hidden; border: 1px solid var(--border-strong); background: var(--ink);
  box-shadow: 0 12px 26px rgb(4 23 21 / 0.12);
}
.onboard-visual img { width: 100%; height: 100%; object-fit: cover; display: block; }
.onboard-hero-copy .eyebrow {
  display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.28rem 0.5rem; border-radius: 999px;
  background: rgb(3 111 84 / 0.08); color: var(--ink); font-size: 0.65rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
}
.onboard-hero-copy h1 {
  margin: 0.5rem 0 0.35rem; font-family: var(--font-display); font-style: italic; font-size: clamp(1.5rem, 2.2vw, 2.05rem); line-height: 1.04; letter-spacing: -0.04em;
}
.onboard-hero-copy p { margin: 0; color: var(--muted); font-size: 0.82rem; line-height: 1.4; }
.onboard-rules {
  display: flex; flex-wrap: wrap; gap: 0.45rem; margin-bottom: 1.1rem;
}
.onboard-rules span {
  display: inline-flex; align-items: center; gap: 0.38rem; padding: 0.45rem 0.62rem; border-radius: 999px; border: 1px solid var(--border-strong);
  background: rgb(255 255 255 / 0.25); color: var(--ink); font-size: 0.7rem; font-weight: 500;
  box-shadow: 0 6px 14px rgb(4 23 21 / 0.04);
}
.onboard-rules svg { width: 12px; height: 12px; }
.onboard-steps-track {
  display: flex; align-items: center; gap: 0.4rem; margin-bottom: 1.75rem;
}
.onboard-steps-track .seg {
  flex: 1; height: 5px; border-radius: 999px; background: rgb(4 23 21 / 0.08); position: relative; overflow: hidden;
}
.onboard-steps-track .seg.done {
  background: linear-gradient(90deg, var(--lime-deep), var(--lime));
  box-shadow: 0 0 0 1px rgb(178 220 95 / 0.18);
}
.onboard-step { display: none; }
.onboard-step.active { display: block; }
.onboard-step-title {
  font-family: var(--font-display); font-style: italic; font-size: 1.5rem; margin-bottom: 0.3rem;
  letter-spacing: -0.02em;
}
.onboard-step-sub { color: var(--muted); font-size: 0.85rem; margin-bottom: 1.5rem; }
.onboard-nav { display: flex; justify-content: space-between; gap: 0.75rem; margin-top: 1.5rem; }
.avatar-picker { display: flex; align-items: center; gap: 1.1rem; margin-bottom: 1.25rem; }
.avatar-picker .preview {
  width: 76px; height: 76px; border-radius: 999px; background: rgb(4 23 21 / 0.06);
  display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0;
  border: 1px solid var(--border-strong);
}
.avatar-picker .preview img { width: 100%; height: 100%; object-fit: cover; }
.avatar-picker .preview svg { width: 26px; height: 26px; color: var(--muted); }

.interest-mini-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.8rem;
}
.interest-mini-card {
  border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden;
  background: var(--card); box-shadow: 0 8px 18px rgb(4 23 21 / 0.04);
}
.interest-mini-thumb { height: 90px; overflow: hidden; background: var(--ink); }
.interest-mini-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.interest-mini-body { padding: 0.8rem; }

.interest-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.8rem; max-height: 420px; overflow-y: auto; padding: 0.1rem; }
.interest-card {
  position: relative; display: block; border: 1.5px solid var(--border-strong); border-radius: var(--radius-md);
  overflow: hidden; cursor: pointer; background: var(--card); transition: border-color 0.15s ease, transform 0.1s ease, box-shadow 0.2s ease;
  box-shadow: 0 10px 18px rgb(4 23 21 / 0.04);
}
.interest-card:hover { transform: translateY(-2px); box-shadow: 0 12px 22px rgb(4 23 21 / 0.09); }
.interest-card input { position: absolute; opacity: 0; pointer-events: none; }
.interest-card .thumb {
  height: 110px; background: var(--ink) center/cover no-repeat;
  border-bottom: 1px solid rgb(255 255 255 / 0.12);
  pointer-events: none;
}
.interest-card .body {
  padding: 0.8rem 0.8rem 0.9rem; background: linear-gradient(180deg, rgb(255 255 255 / 0.02), rgb(4 23 21 / 0.02));
  pointer-events: none;
}
.interest-card .t { font-size: 0.82rem; font-weight: 600; line-height: 1.25; color: var(--ink); }
.interest-card .p { font-family: var(--font-mono); font-size: 0.65rem; color: var(--muted); margin-top: 0.28rem; }
.interest-card .check {
  position: absolute; top: 0.6rem; right: 0.6rem; width: 24px; height: 24px; border-radius: 999px;
  background: rgb(252 248 233 / 0.82); border: 1.5px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center; color: transparent;
  backdrop-filter: blur(2px);
  pointer-events: none;
}
.interest-card .check svg { width: 13px; height: 13px; }
.interest-card input:checked ~ .check { background: var(--lime); border-color: var(--lime-deep); color: var(--ink); animation: mvxPopIn .3s cubic-bezier(.3,1.4,.4,1) both; }
.interest-card .check { transition: background-color .2s ease, border-color .2s ease; }
.interest-card input:checked ~ .thumb { outline: 3px solid var(--lime-deep); outline-offset: -3px; transition: outline-color .2s ease; }
.interest-card input:checked ~ .body .t { color: var(--ink); }
.interest-empty { grid-column: 1 / -1; text-align: center; padding: 2rem 1rem; color: var(--muted); font-size: 0.85rem; }

/* ============================================================
   Messaging / chat thread
   ============================================================ */
.thread-list { display: flex; flex-direction: column; }
.thread-item {
  display: flex; align-items: center; gap: 0.8rem; padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border); text-decoration: none; color: inherit;
}
.thread-item:hover { background: rgb(4 23 21 / 0.02); }
.thread-item.active { background: var(--lime); }
.thread-item .meta { flex: 1; min-width: 0; }
.thread-item .name { font-size: 0.88rem; font-weight: 500; }
.thread-item .preview { font-size: 0.76rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.thread-item .time { font-size: 0.68rem; color: var(--muted); flex-shrink: 0; }
.thread-item .unread-dot { width: 8px; height: 8px; border-radius: 999px; background: var(--lime-deep); flex-shrink: 0; }

.chat-shell { display: flex; flex-direction: column; height: 100%; }
.chat-header { display: flex; align-items: center; gap: 0.75rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.chat-header .name { font-weight: 500; font-size: 0.95rem; }
.chat-header .role { font-family: var(--font-mono); font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.chat-body { flex: 1; overflow-y: auto; padding: 1.25rem; display: flex; flex-direction: column; gap: 0.9rem; }
.chat-msg { display: flex; align-items: flex-end; gap: 0.6rem; max-width: 78%; }
.chat-msg .avatar { width: 30px; height: 30px; font-size: 0.68rem; }
.chat-msg .bubble { background: rgb(4 23 21 / 0.06); border-radius: 1.1rem 1.1rem 1.1rem 0.3rem; padding: 0.65rem 0.95rem; font-size: 0.86rem; line-height: 1.4; }
.chat-msg .stamp { font-size: 0.65rem; color: var(--muted); margin-top: 0.3rem; }
.chat-msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.chat-msg.mine .bubble { background: var(--lime); color: var(--ink); border-radius: 1.1rem 1.1rem 0.3rem 1.1rem; }
.chat-msg.mine .stamp { text-align: right; }
.chat-empty { flex: 1; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 0.85rem; text-align: center; padding: 2rem; }
.chat-compose { display: flex; gap: 0.6rem; padding: 1rem 1.25rem; border-top: 1px solid var(--border); flex-shrink: 0; }
.chat-compose textarea { min-height: 44px; max-height: 120px; }
.chat-compose .btn { flex-shrink: 0; align-self: flex-end; }
.messages-layout { display: grid; grid-template-columns: 300px 1fr; height: calc(100vh - var(--topbar-h) - 3.5rem); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; background: var(--card); }
.messages-layout .thread-list { overflow-y: auto; border-right: 1px solid var(--border); }
@media (max-width: 960px) {
  .messages-layout { grid-template-columns: 1fr; height: auto; }
  .messages-layout .thread-list { border-right: 0; border-bottom: 1px solid var(--border); max-height: 260px; }
  .interest-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   Settings toggles
   ============================================================ */
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.9rem 0; border-bottom: 1px solid var(--border); }
.switch-row:last-child { border-bottom: 0; }
.switch-row .t { font-size: 0.88rem; font-weight: 500; }
.switch-row .d { font-size: 0.76rem; color: var(--muted); margin-top: 0.15rem; }
.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch .track { position: absolute; inset: 0; background: rgb(4 23 21 / 0.15); border-radius: 999px; transition: background 0.15s ease; }
.switch .knob { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 999px; background: #fff; transition: transform 0.15s ease; }
.switch input:checked ~ .track { background: var(--lime-deep); }
.switch input:checked ~ .knob { transform: translateX(18px); }
