/* ==========================================================================
   Geeg design system — plain CSS, no build step.
   Near-black/near-white surfaces and type, with the logo's orange as a single
   accent color used sparingly (primary buttons, focus rings, the active nav
   indicator) — plus color reserved for semantic status (success/warning/
   danger/info) and the star rating convention.
   ========================================================================== */

:root {
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono", Menlo, Consolas, monospace;

  --neutral-0: #ffffff; --neutral-50: #fafafa; --neutral-100: #f4f4f5; --neutral-150: #ececef;
  --neutral-200: #e4e4e7; --neutral-300: #d4d4d8; --neutral-400: #a1a1aa; --neutral-500: #71717a;
  --neutral-600: #52525b; --neutral-700: #3f3f46; --neutral-800: #27272a; --neutral-850: #1c1c1f;
  --neutral-900: #18181b; --neutral-950: #09090b;

  /* The logo's orange, straight from logo-mark.svg (#DB6E01 / #DA6F02). */
  --accent-500: #db6e01; --accent-600: #b85901; --accent-50: #fdf1e2;

  --success-50: #ecfdf5; --success-100: #d1fae5; --success-500: #10b981; --success-600: #059669; --success-700: #047857;
  --warning-50: #fffbeb; --warning-100: #fef3c7; --warning-500: #f59e0b; --warning-600: #d97706;
  --danger-50: #fef2f2; --danger-100: #fee2e2; --danger-500: #ef4444; --danger-600: #dc2626; --danger-700: #b91c1c;
  --info-50: #eff6ff; --info-100: #dbeafe; --info-500: #3b82f6; --info-600: #2563eb;
  --star-500: #f59e0b;

  --radius-xs: 5px; --radius-sm: 7px; --radius-md: 9px; --radius-lg: 12px; --radius-xl: 16px; --radius-2xl: 20px; --radius-full: 999px;
  --shadow-xs: 0 1px 2px rgb(0 0 0 / 4%);
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 5%), 0 1px 1px -1px rgb(0 0 0 / 4%);
  --shadow-md: 0 6px 16px -4px rgb(0 0 0 / 8%), 0 2px 6px -2px rgb(0 0 0 / 5%);
  --shadow-lg: 0 16px 32px -8px rgb(0 0 0 / 12%), 0 4px 10px -4px rgb(0 0 0 / 6%);
  --shadow-xl: 0 24px 48px -12px rgb(0 0 0 / 18%);

  --ease: cubic-bezier(.4, 0, .2, 1);
  --dur-fast: .12s;
  --dur: .18s;

  --background: var(--neutral-0);
  --surface: var(--neutral-0);
  --surface-raised: var(--neutral-0);
  --surface-muted: var(--neutral-50);
  --surface-sunken: var(--neutral-100);
  --border: var(--neutral-200);
  --border-subtle: var(--neutral-150);
  --border-strong: var(--neutral-300);
  --text-primary: var(--neutral-900);
  --text-secondary: var(--neutral-600);
  --text-tertiary: var(--neutral-400);
  --text-inverse: var(--neutral-0);

  /* Monochrome surface accent, used for general highlight backgrounds/badges. */
  --brand: var(--neutral-900);
  --brand-hover: var(--neutral-800);
  --brand-fg: var(--neutral-0);
  --brand-subtle: var(--neutral-100);
  --brand-subtle-fg: var(--neutral-900);

  /* The logo's orange — reserved for primary buttons, focus rings, and the active
     nav indicator, so it reads as a deliberate accent rather than a repaint. */
  --accent: var(--accent-500);
  --accent-hover: var(--accent-600);
  --accent-fg: var(--neutral-0);
  --ring: var(--accent-500);
  --ring-subtle: var(--accent-50);

  --success: var(--success-600); --success-subtle: var(--success-50); --success-subtle-fg: var(--success-700);
  --warning: var(--warning-600); --warning-subtle: var(--warning-50); --warning-subtle-fg: var(--warning-600);
  --danger: var(--danger-600); --danger-subtle: var(--danger-50); --danger-subtle-fg: var(--danger-700);
  --info: var(--info-600); --info-subtle: var(--info-50); --info-subtle-fg: var(--info-600);
  --overlay: rgb(9 9 11 / 45%);
}

:root[data-theme="dark"] {
  --background: var(--neutral-950);
  --surface: var(--neutral-900);
  --surface-raised: var(--neutral-850);
  --surface-muted: var(--neutral-900);
  --surface-sunken: var(--neutral-950);
  --border: var(--neutral-800);
  --border-subtle: var(--neutral-850);
  --border-strong: var(--neutral-700);
  --text-primary: var(--neutral-50);
  --text-secondary: var(--neutral-400);
  --text-tertiary: var(--neutral-600);

  --brand: var(--neutral-50);
  --brand-hover: var(--neutral-200);
  --brand-fg: var(--neutral-950);
  --brand-subtle: var(--neutral-850);
  --brand-subtle-fg: var(--neutral-50);

  /* Brighter orange than the light-theme accent so it still pops against a dark surface. */
  --accent: #e8791c;
  --accent-hover: #f3924a;
  --accent-fg: var(--neutral-950);
  --ring: #e8791c;
  --ring-subtle: rgb(232 121 28 / 20%);

  --success-subtle: rgb(16 185 129 / 12%); --success-subtle-fg: #6ee7b7;
  --warning-subtle: rgb(245 158 11 / 12%); --warning-subtle-fg: #fcd34d;
  --danger-subtle: rgb(239 68 68 / 14%); --danger-subtle-fg: #fca5a5;
  --info-subtle: rgb(59 130 246 / 14%); --info-subtle-fg: #93c5fd;
  --overlay: rgb(0 0 0 / 65%);
}

*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: light; -webkit-text-size-adjust: 100%; }
html[data-theme="dark"] { color-scheme: dark; }
body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--background);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }
ul { list-style: none; margin: 0; padding: 0; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }
::selection { background: var(--text-primary); color: var(--background); }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 4px; }

/* Restrained scrollbars — a small but noticeable craft detail. */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; border: 2px solid var(--background); background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); background-clip: padding-box; }

.container { max-width: 1440px; margin: 0 auto; padding: 0 24px; }
.container-wide { max-width: 1600px; margin: 0 auto; padding: 0 24px; }
.page { padding: 32px 0 64px; display: flex; flex-direction: column; gap: 24px; animation: page-in .32s var(--ease); }
@media (max-width: 640px) { .container, .container-wide { padding: 0 16px; } }
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .page { animation: none; } }

/* ---- Typography ---- */
.h1 { font-size: 26px; font-weight: 650; letter-spacing: -.02em; line-height: 1.25; color: var(--text-primary); }
.h2 { font-size: 18px; font-weight: 600; letter-spacing: -.01em; line-height: 1.3; color: var(--text-primary); }
.h3 { font-size: 15px; font-weight: 600; letter-spacing: -.005em; line-height: 1.4; color: var(--text-primary); }

.prose { color: var(--text-primary); font-size: 15px; }
.prose h1, .prose h2, .prose h3 { font-weight: 600; letter-spacing: -.01em; margin: 24px 0 10px; }
.prose h1 { font-size: 22px; }
.prose h2 { font-size: 18px; }
.prose h3 { font-size: 16px; }
.prose p { margin: 0 0 14px; color: var(--text-secondary); line-height: 1.65; }
.prose ul, .prose ol { margin: 0 0 14px; padding-left: 22px; color: var(--text-secondary); }
.prose li { margin-bottom: 6px; }
.prose strong { color: var(--text-primary); font-weight: 600; }
.prose code { background: var(--surface-sunken); border-radius: 4px; padding: 2px 6px; font-size: 13px; font-family: var(--font-mono); }
.prose pre { background: var(--surface-sunken); border-radius: var(--radius-sm); padding: 14px; overflow-x: auto; margin: 0 0 14px; }
.prose pre code { background: none; padding: 0; }
.prose blockquote { border-left: 3px solid var(--border-strong); padding-left: 14px; color: var(--text-secondary); margin: 0 0 14px; }

.video-embed { position: relative; width: 100%; padding-top: 56.25%; border-radius: var(--radius-md); overflow: hidden; background: var(--surface-sunken); }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.workspace-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 900px) { .workspace-grid { grid-template-columns: 1fr; } }
.file-tabs { display: flex; gap: 2px; overflow-x: auto; border-bottom: 1px solid var(--border); background: var(--surface-sunken); border-radius: var(--radius-md) var(--radius-md) 0 0; }
.file-tab { padding: 10px 14px; font-size: 13px; font-weight: 500; color: var(--text-secondary); white-space: nowrap; cursor: pointer; border-bottom: 2px solid transparent; display: flex; align-items: center; gap: 8px; transition: color var(--dur-fast) var(--ease); }
.file-tab:hover { color: var(--text-primary); }
.file-tab.active { color: var(--text-primary); background: var(--surface); border-color: var(--brand); }
.file-tab .file-tab-close { opacity: .5; transition: opacity var(--dur-fast) var(--ease); }
.file-tab .file-tab-close:hover { opacity: 1; }
.editor-wrap { border: 1px solid var(--border); border-top: none; border-radius: 0 0 var(--radius-md) var(--radius-md); overflow: hidden; }
.editor-wrap .CodeMirror { height: 420px; font-size: 13px; font-family: var(--font-mono); }
.milestone-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.milestone-item input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--brand); }
.milestone-item.done span { text-decoration: line-through; color: var(--text-tertiary); }
.workspace-chat-messages { height: 260px; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--surface-sunken); border-radius: var(--radius-md); }
.notebook-cell { border: 1px solid var(--border); border-radius: var(--radius-md); margin-bottom: 12px; overflow: hidden; }
.notebook-cell-toolbar { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; background: var(--surface-sunken); font-size: 12px; color: var(--text-tertiary); }
.notebook-cell textarea { width: 100%; border: 0; padding: 12px; font-family: var(--font-mono); font-size: 13px; resize: vertical; min-height: 80px; background: transparent; color: var(--text-primary); }
.notebook-cell textarea:focus { outline: none; }
.design-asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.design-asset-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.hidden { display: none !important; }
.text-secondary { color: var(--text-secondary); font-size: 14px; }
.text-tertiary { color: var(--text-tertiary); font-size: 13px; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-5 { margin-top: 20px; } .mt-6 { margin-top: 24px; }

/* ---- Layout helpers ---- */
.flex { display: flex; } .items-center { align-items: center; } .justify-between { justify-content: space-between; } .justify-center { justify-content: center; }
.flex-col { display: flex; flex-direction: column; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; } .gap-6 { gap: 24px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }
.flex-1 { flex: 1; } .flex-wrap { flex-wrap: wrap; }
.w-full { width: 100%; }
.min-w-0 { min-width: 0; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: var(--radius-md); font-size: 14px; font-weight: 500; padding: 9px 16px;
  border: 1px solid transparent; cursor: pointer; transition: background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
  white-space: nowrap; font-family: inherit; line-height: 1.2;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); color: var(--accent-fg); box-shadow: var(--shadow-xs); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--surface-raised); color: var(--text-primary); border-color: var(--border); box-shadow: var(--shadow-xs); }
.btn-secondary:hover { background: var(--surface-muted); border-color: var(--border-strong); }
.btn-outline { background: transparent; color: var(--text-primary); border-color: var(--border); }
.btn-outline:hover { background: var(--surface-muted); border-color: var(--border-strong); }
.btn-ghost { background: transparent; color: var(--text-primary); }
.btn-ghost:hover { background: var(--surface-muted); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(0.92); }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: var(--radius-sm); }
.btn-lg { padding: 12px 22px; font-size: 15px; border-radius: var(--radius-md); }
.btn-icon { padding: 8px; width: 36px; height: 36px; border-radius: var(--radius-md); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:disabled:hover { background: inherit; }

/* ---- Inputs ---- */
.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.input, .select, .textarea {
  height: 38px; width: 100%; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--text-primary); padding: 0 12px; font-size: 14px;
  font-family: inherit; box-shadow: var(--shadow-xs); transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.textarea { height: auto; padding: 10px 12px; min-height: 100px; resize: vertical; line-height: 1.5; }
.input::placeholder, .textarea::placeholder { color: var(--text-tertiary); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--border-strong); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--ring); box-shadow: 0 0 0 3px var(--ring-subtle); }
.input-icon-wrap { position: relative; }
.input-icon-wrap .input { padding-left: 36px; }
.input-icon-wrap .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-tertiary); pointer-events: none; }
.error-text { color: var(--danger); font-size: 12px; }
.help-text { color: var(--text-tertiary); font-size: 12px; }
.radio-row { display: flex; gap: 12px; }
.radio-card { flex: 1; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px 16px; cursor: pointer; font-size: 14px; font-weight: 500; text-align: center; transition: all var(--dur-fast) var(--ease); }
.radio-card input { display: none; }
.radio-card:hover { border-color: var(--border-strong); }
.radio-card:has(input:checked) { border-color: var(--text-primary); background: var(--brand-subtle); color: var(--brand-subtle-fg); }

.skill-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
@media (min-width: 640px) { .skill-grid { grid-template-columns: repeat(3, 1fr); } }
.skill-chip { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 9px 12px; cursor: pointer; font-size: 13px; font-weight: 500; transition: all var(--dur-fast) var(--ease); }
.skill-chip:hover { border-color: var(--border-strong); }
.skill-chip:has(input:checked) { border-color: var(--text-primary); background: var(--brand-subtle); color: var(--brand-subtle-fg); }
.skill-chip input { accent-color: var(--brand); }

/* ---- Cards ---- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); transition: box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease), transform var(--dur) var(--ease); }
.card-body { padding: 18px 20px; }
.card-header { padding: 20px 20px 0; }
.card-hover { cursor: pointer; }
.card-hover:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); transform: translateY(-1px); }

/* ---- Course content (sections) ---- */
.course-section summary { list-style: none; }
.course-section summary::-webkit-details-marker { display: none; }
.course-section summary .chev { transition: transform var(--dur) var(--ease); flex-shrink: 0; }
.course-section[open] summary .chev { transform: rotate(180deg); }
.course-lecture:hover { background: var(--surface-sunken); }

/* ---- Badges ---- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; border-radius: var(--radius-full);
  padding: 3px 9px; font-size: 12px; font-weight: 500; line-height: 1.6; white-space: nowrap;
}
.badge-neutral { background: var(--surface-sunken); color: var(--text-secondary); }
.badge-brand { background: var(--brand-subtle); color: var(--brand-subtle-fg); }
.badge-info { background: var(--info-subtle); color: var(--info-subtle-fg); }
.badge-success { background: var(--success-subtle); color: var(--success-subtle-fg); }
.badge-warning { background: var(--warning-subtle); color: var(--warning-subtle-fg); }
.badge-danger { background: var(--danger-subtle); color: var(--danger-subtle-fg); }
.badge-outline { border: 1px solid var(--border); color: var(--text-secondary); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }

/* ---- Avatar ---- */
.avatar {
  display: inline-flex; align-items: center; justify-content: center; border-radius: 50%;
  background: var(--surface-sunken); color: var(--text-secondary); font-weight: 600; flex-shrink: 0;
  overflow: hidden; box-shadow: inset 0 0 0 1px var(--border-subtle); letter-spacing: -.02em;
}
.avatar-xs { width: 24px; height: 24px; font-size: 10px; }
.avatar-sm { width: 32px; height: 32px; font-size: 12px; }
.avatar-md { width: 40px; height: 40px; font-size: 14px; }
.avatar-lg { width: 56px; height: 56px; font-size: 18px; }
.avatar-xl { width: 80px; height: 80px; font-size: 24px; }

/* ---- Nav ---- */
.nav-header { position: sticky; top: 0; z-index: 40; border-bottom: 1px solid var(--border); background: var(--surface); }
.nav-header.dark-nav { background: var(--neutral-950); border-color: rgb(255 255 255 / 10%); color: #fff; }
.nav-inner { display: flex; align-items: center; gap: 28px; height: 60px; }
.logo { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 15px; letter-spacing: -.01em; }
.logo-mark { width: 26px; height: 26px; border-radius: 7px; background: #fff; border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; padding: 3px; flex-shrink: 0; overflow: hidden; }
.logo-mark img { width: 100%; height: 100%; object-fit: contain; display: block; }
.nav-links { display: flex; align-items: center; gap: 2px; flex: 1; min-width: 0; overflow-x: auto; }
.nav-link { padding: 7px 12px; border-radius: var(--radius-md); font-size: 14px; font-weight: 500; color: var(--text-secondary); white-space: nowrap; transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); }
.dark-nav .nav-link { color: rgb(255 255 255 / 60%); }
.nav-link:hover { background: var(--surface-muted); color: var(--text-primary); }
.dark-nav .nav-link:hover { background: rgb(255 255 255 / 8%); color: #fff; }
.nav-link.active { font-weight: 600; color: var(--text-primary); background: var(--surface-sunken); box-shadow: inset 0 -2px 0 0 var(--accent); }
.dark-nav .nav-link.active { background: rgb(255 255 255 / 10%); color: #fff; }
.nav-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.pill-tag { border-radius: var(--radius-full); background: var(--surface-sunken); padding: 2px 8px; font-size: 11px; font-weight: 500; color: var(--text-tertiary); }
.post-job-btn { display: none; }
@media (min-width: 640px) { .post-job-btn { display: inline-flex; } }
.dark-nav .pill-tag { background: rgb(255 255 255 / 10%); color: rgb(255 255 255 / 70%); }

/* icon buttons in nav */
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: var(--radius-md); color: var(--text-secondary); background: transparent; border: none; cursor: pointer; position: relative; transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); }
.icon-btn:hover { background: var(--surface-muted); color: var(--text-primary); }
.dark-nav .icon-btn { color: rgb(255 255 255 / 80%); }
.dark-nav .icon-btn:hover { background: rgb(255 255 255 / 10%); }
.icon-btn .dot-flag { position: absolute; top: 7px; right: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); border: 2px solid var(--surface); }

/* user menu */
.user-menu { position: relative; }
.user-trigger { display: flex; align-items: center; gap: 9px; padding: 4px 8px 4px 4px; border-radius: var(--radius-md); background: none; border: none; cursor: pointer; transition: background-color var(--dur-fast) var(--ease); }
.user-trigger:hover { background: var(--surface-muted); }
.dark-nav .user-trigger:hover { background: rgb(255 255 255 / 10%); }
.user-info { display: none; flex-direction: column; align-items: flex-start; line-height: 1.3; }
@media (min-width: 640px) { .user-info { display: flex; } }
.user-trigger .name { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.dark-nav .user-trigger .name { color: #fff; }
.user-trigger .role { font-size: 12px; color: var(--text-tertiary); display: block; text-align: left; }
.dark-nav .user-trigger .role { color: rgb(255 255 255 / 55%); }
.dropdown-panel {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; background: var(--surface-raised);
  border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 6px;
  display: none; z-index: 60; color: var(--text-primary); animation: dropdown-in .12s var(--ease);
}
@keyframes dropdown-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.dropdown-panel.wide { min-width: 360px; padding: 0; }
.user-menu.open .dropdown-panel, .notif-menu.open .dropdown-panel { display: block; }
.dropdown-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); font-size: 14px; color: var(--text-primary); cursor: pointer; background: none; border: none; width: 100%; text-align: left; font-family: inherit; transition: background-color var(--dur-fast) var(--ease); }
.dropdown-item:hover { background: var(--surface-muted); }
.dropdown-item.destructive { color: var(--danger); }
.dropdown-sep { height: 1px; background: var(--border); margin: 6px 0; }
.dropdown-label { padding: 6px 10px; font-size: 12px; color: var(--text-tertiary); font-weight: 500; }
.dropdown-panel.wide li a { transition: background-color var(--dur-fast) var(--ease); }
.dropdown-panel.wide li a:hover { background: var(--surface-muted); }
.notif-menu { position: relative; }

/* mobile nav */
.nav-mobile { display: none; overflow-x: auto; padding: 8px 16px; border-top: 1px solid var(--border-subtle); gap: 4px; }
.dark-nav .nav-mobile { border-color: rgb(255 255 255 / 10%); }
@media (max-width: 1024px) {
  .nav-links { display: none; }
  .nav-mobile { display: flex; }
}

/* ---- Tabs ---- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tab-link { padding: 10px 14px; font-size: 14px; font-weight: 500; color: var(--text-secondary); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease); }
.tab-link:hover { color: var(--text-primary); }
.tab-link.active { color: var(--text-primary); border-color: var(--text-primary); font-weight: 600; }
.tab-count { color: var(--text-tertiary); margin-left: 4px; }

/* ---- Segmented control ---- */
.segmented { display: inline-flex; gap: 2px; background: var(--surface-muted); border: 1px solid var(--border); border-radius: var(--radius-full); padding: 3px; }
.segmented a, .segmented button { padding: 6px 14px; border-radius: var(--radius-full); font-size: 13px; font-weight: 500; color: var(--text-secondary); background: none; border: none; cursor: pointer; font-family: inherit; transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease); }
.segmented a.active, .segmented button.active { background: var(--surface); color: var(--text-primary); box-shadow: var(--shadow-sm); }

/* ---- Progress ---- */
.progress { height: 6px; border-radius: var(--radius-full); background: var(--surface-sunken); overflow: hidden; }
.progress-bar { height: 100%; border-radius: var(--radius-full); background: var(--brand); transition: width .5s var(--ease); }
.progress-bar.success { background: var(--success); }

/* ---- Table ---- */
.table-wrap { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead { background: var(--surface-muted); }
th { text-align: left; padding: 11px 16px; font-size: 11px; font-weight: 600; text-transform: uppercase; color: var(--text-tertiary); letter-spacing: .04em; }
td { padding: 13px 16px; border-top: 1px solid var(--border-subtle); color: var(--text-primary); }
tbody tr { transition: background-color var(--dur-fast) var(--ease); }
tbody tr:hover { background: var(--surface-muted); }

/* ---- Empty state ---- */
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 56px 24px; border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); }
.empty-icon { width: 44px; height: 44px; border-radius: 50%; background: var(--surface-muted); display: flex; align-items: center; justify-content: center; color: var(--text-tertiary); }

/* ---- Stat card ---- */
.stat-card { padding: 18px 20px; }
.stat-icon { width: 34px; height: 34px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; }
.stat-value { font-size: 24px; font-weight: 650; letter-spacing: -.02em; color: var(--text-primary); margin-top: 14px; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.trend-up { color: var(--success); font-size: 12px; font-weight: 500; }

/* ---- Rating ---- */
.stars { display: inline-flex; gap: 2px; color: var(--star-500); font-size: 13px; }

/* ---- Hero banner (dark, full-bleed intro card) ---- */
.hero-banner {
  padding: 32px 36px; position: relative; overflow: hidden; color: #fff;
  background: var(--neutral-950);
  background-image:
    linear-gradient(rgb(255 255 255 / 5%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / 5%) 1px, transparent 1px);
  background-size: 32px 32px;
  border-color: var(--neutral-950);
}
.hero-banner-eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: rgb(255 255 255 / 65%); }
@media (max-width: 640px) { .hero-banner { padding: 24px; } }

/* ---- Landing page ---- */
.landing-nav-links { display: none; align-items: center; gap: 4px; }
@media (min-width: 860px) { .landing-nav-links { display: flex; } }
.landing-nav-links a { padding: 8px 14px; border-radius: var(--radius-md); font-size: 14px; font-weight: 500; color: rgb(255 255 255 / 75%); transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); }
.landing-nav-links a:hover { background: rgb(255 255 255 / 8%); color: #fff; }

.path-card { display: flex; align-items: center; gap: 14px; padding: 18px 20px; border-radius: var(--radius-xl); border: 1px solid rgb(255 255 255 / 14%); background: rgb(255 255 255 / 5%); color: #fff; text-align: left; transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), transform var(--dur) var(--ease); }
.path-card:hover { background: rgb(255 255 255 / 10%); border-color: rgb(255 255 255 / 25%); transform: translateY(-2px); }
.path-card-icon { flex-shrink: 0; width: 44px; height: 44px; border-radius: var(--radius-lg); display: flex; align-items: center; justify-content: center; background: var(--accent); color: #fff; }
.path-card-title { font-weight: 600; font-size: 15px; }
.path-card-sub { color: rgb(255 255 255 / 62%); font-size: 13px; margin-top: 2px; }

.trust-pills { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; }
.trust-pill { display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: var(--radius-full); background: rgb(255 255 255 / 6%); border: 1px solid rgb(255 255 255 / 12%); font-size: 13px; color: rgb(255 255 255 / 80%); }

.step-track { position: relative; display: grid; gap: 20px; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 760px) { .step-track { grid-template-columns: 1fr; } }
.step-card { position: relative; padding: 22px 20px; }
.step-number { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 600; font-size: 14px; flex-shrink: 0; }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

.landing-footer { border-top: 1px solid var(--border); padding: 40px 0 28px; }
.landing-footer-links { display: flex; flex-wrap: wrap; gap: 20px; }
.landing-footer-links a { font-size: 14px; color: var(--text-secondary); }
.landing-footer-links a:hover { color: var(--text-primary); }

/* Bold, oversized display type + a monospace label pairing — used only on the
   landing page, layered on top of .h1/.h2 rather than changing them globally.
   Sizes and section padding live here (not inline in the template) specifically
   so the mobile media query below can actually override them. */
.eyebrow-mono { display: inline-block; font-family: var(--font-mono); font-size: 12px; letter-spacing: .02em; padding: 5px 12px; border-radius: var(--radius-full); background: rgb(255 255 255 / 8%); border: 1px solid rgb(255 255 255 / 14%); color: rgb(255 255 255 / 80%); }
.landing-h1 { font-weight: 800; letter-spacing: -.03em; line-height: 1.04; font-size: 52px; }
.landing-h2 { font-weight: 800; letter-spacing: -.02em; line-height: 1.1; font-size: 32px; }
.accent-word { color: var(--accent); }

.btn-pill { border-radius: var(--radius-full); padding: 12px 22px; }

.landing-hero { padding: 80px 24px 64px; }
.landing-cta-banner { padding: 56px 24px; }

.dark-section {
  background: var(--neutral-950); color: #fff; position: relative; overflow: hidden;
  background-image:
    linear-gradient(rgb(255 255 255 / 5%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / 5%) 1px, transparent 1px);
  background-size: 32px 32px;
  padding: 72px 24px;
}

.faq-item { border-bottom: 1px solid var(--border); padding: 18px 0; }
.faq-item summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; list-style: none; font-weight: 600; font-size: 15px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary > span:first-child { min-width: 0; }
.faq-item summary .chev { transition: transform var(--dur) var(--ease); flex-shrink: 0; color: var(--text-tertiary); }
.faq-item[open] summary .chev { transform: rotate(180deg); }
.faq-item p { color: var(--text-secondary); margin-top: 10px; line-height: 1.6; font-size: 14px; max-width: 640px; }

.footer-cta-heading { font-weight: 800; letter-spacing: -.02em; line-height: 1.15; font-size: 30px; }

@media (max-width: 640px) {
  .landing-h1 { font-size: 30px; letter-spacing: -.02em; }
  .landing-h2 { font-size: 22px; }
  .landing-hero { padding: 40px 20px 32px; }
  .landing-cta-banner { padding: 32px 20px; }
  .dark-section { padding: 40px 20px; }
  .footer-cta-heading { font-size: 22px; }
  .eyebrow-mono { font-size: 11px; padding: 4px 10px; text-align: center; }
  .path-card { padding: 14px 16px; }
  .trust-pills { gap: 8px; }
  .trust-pill { font-size: 12px; padding: 6px 12px; }
}

/* Course cover tile — replaces per-course accent colors with a consistent, monochrome treatment. */
.cover-tile {
  background: var(--neutral-950);
  background-image:
    linear-gradient(rgb(255 255 255 / 6%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / 6%) 1px, transparent 1px);
  background-size: 22px 22px;
}

/* ---- Auth ---- */
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: 1fr; }
@media (min-width: 1024px) { .auth-shell { grid-template-columns: 1fr 1fr; } }
.auth-hero {
  display: none; position: relative; padding: 40px; flex-direction: column; justify-content: space-between; color: #fff; overflow: hidden;
  background: var(--neutral-950);
  background-image:
    linear-gradient(rgb(255 255 255 / 5%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / 5%) 1px, transparent 1px);
  background-size: 32px 32px;
}
@media (min-width: 1024px) { .auth-hero { display: flex; } }
.auth-hero-content { position: relative; z-index: 1; }
.auth-hero-card { border-radius: var(--radius-lg); border: 1px solid rgb(255 255 255 / 12%); background: rgb(255 255 255 / 4%); padding: 22px; }
.auth-highlight { display: flex; align-items: center; gap: 12px; border-radius: var(--radius-md); border: 1px solid rgb(255 255 255 / 10%); background: rgb(255 255 255 / 3%); padding: 12px 16px; }
.auth-highlight-icon { width: 30px; height: 30px; border-radius: var(--radius-sm); background: rgb(255 255 255 / 8%); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.auth-form-side { display: flex; flex-direction: column; justify-content: center; padding: 48px 24px; }
@media (min-width: 640px) { .auth-form-side { padding: 48px; } }
.auth-form-wrap { max-width: 380px; margin: 0 auto; width: 100%; }
.text-link {
  color: var(--text-primary); font-weight: 500; text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat; background-position: 0 100%; background-size: 0% 1px;
  transition: background-size var(--dur) var(--ease);
}
.text-link:hover { background-size: 100% 1px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--text-tertiary); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.oauth-btn { display: flex; align-items: center; justify-content: center; gap: 10px; }

/* ---- Flash / toast ---- */
.flash-stack { position: fixed; top: 16px; right: 16px; z-index: 100; display: flex; flex-direction: column; gap: 8px; max-width: 360px; }
.flash { padding: 12px 16px; border-radius: var(--radius-md); background: var(--surface-raised); border: 1px solid var(--border); box-shadow: var(--shadow-lg); font-size: 14px; color: var(--text-primary); animation: slide-in .2s var(--ease); }
.flash-success { border-color: var(--success-100); background: var(--success-subtle); color: var(--success-subtle-fg); }
.flash-error { border-color: var(--danger-100); background: var(--danger-subtle); color: var(--danger-subtle-fg); }
.flash-info { border-color: var(--border); }
@keyframes slide-in { from { transform: translateX(16px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ---- Kanban ---- */
.kanban { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 16px; }
.kanban-col { width: 300px; flex-shrink: 0; display: flex; flex-direction: column; gap: 12px; }
.kanban-col-header { display: flex; align-items: center; justify-content: space-between; padding: 0 4px; }
.kanban-empty { border: 1px dashed var(--border); border-radius: var(--radius-lg); padding: 32px 12px; text-align: center; font-size: 12px; color: var(--text-tertiary); }

/* ---- Stepper ---- */
.stepper { display: flex; align-items: center; gap: 8px; }
.step { display: flex; align-items: center; gap: 10px; flex: 1; }
.step-circle { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; background: var(--surface-sunken); color: var(--text-tertiary); flex-shrink: 0; transition: all var(--dur) var(--ease); }
.step.active .step-circle { background: var(--brand-subtle); color: var(--brand-subtle-fg); box-shadow: 0 0 0 2px var(--brand); }
.step.complete .step-circle { background: var(--brand); color: var(--brand-fg); }
.step-label { font-size: 13px; font-weight: 500; color: var(--text-tertiary); white-space: nowrap; }
.step.active .step-label, .step.complete .step-label { color: var(--text-primary); }
.step-line { height: 1px; flex: 1; background: var(--border); }
.step.complete .step-line { background: var(--brand); }
@media (max-width: 640px) { .step-label { display: none; } }

/* ---- Chat (professional thread: muted sidebar list, name+timestamp message rows) ---- */
.chat-shell { display: grid; grid-template-columns: 1fr; height: calc(100vh - 260px); min-height: 480px; overflow: hidden; }
@media (min-width: 1024px) { .chat-shell { grid-template-columns: 280px 1fr; } }

.thread-list { background: var(--surface-muted); border-right: 1px solid var(--border); display: flex; flex-direction: column; overflow: hidden; }
.thread-list .input-icon-wrap { padding: 10px; border-bottom: none !important; }
.thread-list .input-icon-wrap .input { border-radius: var(--radius-full); background: var(--surface); }
.thread-items { flex: 1; overflow-y: auto; padding: 2px 8px 8px; display: flex; flex-direction: column; gap: 2px; }
.thread-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius-md); cursor: pointer; transition: background-color var(--dur-fast) var(--ease); }
.thread-item:hover { background: var(--surface-sunken); }
.thread-item.active { background: var(--brand-subtle); }

.chat-panel { display: flex; flex-direction: column; overflow: hidden; background: var(--surface); }
.chat-messages { flex: 1; overflow-y: auto; }
.chat-messages-col { max-width: 800px; margin: 0 auto; padding: 20px 24px 8px; display: flex; flex-direction: column; }

.thread-day-divider { text-align: center; margin: 22px 0 6px; }
.thread-day-divider span { font-size: 12px; font-weight: 500; color: var(--text-tertiary); }

.thread-msg { display: flex; gap: 12px; margin-top: 18px; align-items: flex-start; }
.thread-msg.grouped { margin-top: 4px; }
.thread-msg-avatar { flex-shrink: 0; margin-top: 1px; }
.thread-msg.grouped .thread-msg-avatar { visibility: hidden; }
.thread-msg-body { min-width: 0; flex: 1; }
.thread-msg-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 3px; }
.thread-msg-name { font-size: 14px; font-weight: 600; }
.thread-msg-time { font-size: 12px; color: var(--text-tertiary); }
.thread-msg-text { font-size: 14px; line-height: 1.65; white-space: pre-wrap; word-break: break-word; color: var(--text-primary); }

.chat-back-btn { display: none; }

.composer-wrap { flex-shrink: 0; padding: 14px 24px 20px; }
.composer { max-width: 800px; margin: 0 auto; display: flex; align-items: flex-end; gap: 8px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-lg); padding: 10px 10px 10px 18px; box-shadow: var(--shadow-sm); transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.composer:focus-within { border-color: var(--ring); box-shadow: var(--shadow-md); }
.composer textarea { flex: 1; border: none; background: none; resize: none; font-family: inherit; font-size: 15px; line-height: 1.5; color: var(--text-primary); max-height: 160px; padding: 7px 0; }
.composer textarea:focus { outline: none; }
.composer textarea::placeholder { color: var(--text-tertiary); }
.composer-send { flex-shrink: 0; width: 34px; height: 34px; border-radius: var(--radius-full); border: none; background: var(--brand); color: var(--brand-fg); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: background-color var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease); }
.composer-send:disabled { opacity: .35; cursor: default; }
.composer-send:not(:disabled):hover { background: var(--brand-hover); }

/* Mobile chat: a full-screen list<->conversation switch, not a squeezed split view. */
@media (max-width: 900px) {
  .chat-page-heading { display: none; }
  body:has(.chat-shell) .page { padding-bottom: 0; gap: 0; }
  .chat-shell {
    height: calc(100dvh - 132px - env(safe-area-inset-bottom));
    min-height: 0; border-radius: 0; border-left: none; border-right: none; border-bottom: none;
    margin: 0 -16px; width: calc(100% + 32px);
  }
  .chat-shell.has-active .thread-list { display: none; }
  .chat-shell:not(.has-active) .chat-panel { display: none; }
  .chat-back-btn { display: inline-flex; }
  .chat-messages-col { padding: 16px 16px 8px; }
  .composer-wrap { padding: 10px 16px 16px; }
}

/* ---- Dialog (native <dialog>) ---- */
dialog.modal { border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 22px; box-shadow: var(--shadow-xl); width: 100%; max-width: 480px; color: var(--text-primary); background: var(--surface-raised); animation: modal-in .16s var(--ease); }
dialog.modal::backdrop { background: var(--overlay); }
@keyframes modal-in { from { opacity: 0; transform: translateY(6px) scale(.99); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal-close { position: absolute; top: 16px; right: 16px; }

/* ---- Bars / charts ---- */
.bar-chart { display: flex; align-items: flex-end; gap: 16px; height: 200px; padding: 0 8px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.bar { width: 100%; border-radius: 5px 5px 0 0; background: var(--success); transition: height .5s var(--ease); }
.bar.brand { background: var(--brand); }
.hbar-row { display: flex; align-items: center; gap: 12px; }
.hbar-label { width: 220px; flex-shrink: 0; font-size: 12px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { height: 22px; flex: 1; background: var(--surface-sunken); border-radius: 5px; overflow: hidden; }
.hbar-fill { height: 100%; background: var(--brand); display: flex; align-items: center; justify-content: flex-end; padding-right: 8px; color: var(--brand-fg); font-size: 11px; font-weight: 600; border-radius: 5px; transition: width .5s var(--ease); }

/* ---- Switch ---- */
.switch { position: relative; display: inline-block; width: 38px; height: 22px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-track { position: absolute; inset: 0; background: var(--surface-sunken); border: 1px solid var(--border); border-radius: var(--radius-full); cursor: pointer; transition: background-color var(--dur) var(--ease); }
.switch-track::before { content: ""; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: transform var(--dur) var(--ease); box-shadow: var(--shadow-sm); }
.switch input:checked + .switch-track { background: var(--brand); border-color: var(--brand); }
.switch input:checked + .switch-track::before { transform: translateX(16px); background: var(--brand-fg); }

/* ---- Footer meta row ---- */
.meta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; font-size: 12px; color: var(--text-tertiary); }
.hr { height: 1px; background: var(--border-subtle); border: none; margin: 0; }
.border-top { border-top: 1px solid var(--border-subtle); padding-top: 16px; }

/* ---- Lesson video stage (Geeg Learn) ---- */
.lesson-video-stage { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .lesson-video-stage { grid-template-columns: 1fr; } }
.lesson-video-list { display: flex; flex-direction: column; gap: 8px; max-height: 480px; overflow-y: auto; }
.lesson-video-item { display: flex; gap: 10px; padding: 8px; border-radius: var(--radius-md); cursor: pointer; border: 1px solid transparent; transition: background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease); }
.lesson-video-item:hover { background: var(--surface-muted); }
.lesson-video-item.active { border-color: var(--text-primary); background: var(--surface-muted); }
.lesson-video-item.locked { cursor: not-allowed; }
.lesson-video-thumb { position: relative; width: 100px; height: 60px; flex-shrink: 0; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-sunken); }
.lesson-video-thumb img { width: 100%; height: 100%; object-fit: cover; }
.lesson-video-state { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; background: rgb(0 0 0 / 45%); color: #fff; }
.lesson-video-item.locked .lesson-video-state, .lesson-video-item.watched .lesson-video-state { display: flex; }
.lesson-video-title { font-size: 13px; font-weight: 500; line-height: 1.4; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.lesson-video-number { position: absolute; top: 4px; left: 4px; width: 18px; height: 18px; border-radius: 50%; background: rgb(0 0 0 / 55%); color: #fff; font-size: 10px; font-weight: 600; display: flex; align-items: center; justify-content: center; }

/* course outline sidebar */
.course-outline-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius-md); font-size: 13px; transition: background-color var(--dur-fast) var(--ease); }
.course-outline-item.current { background: var(--brand-subtle); font-weight: 600; color: var(--brand-subtle-fg); }
.course-outline-item:hover:not(.current) { background: var(--surface-muted); }
.course-outline-check { width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--surface-sunken); color: var(--text-tertiary); }
.course-outline-check.done { background: var(--success-subtle); color: var(--success-subtle-fg); }

/* ---- Chat contract pin ---- */
.chat-pin { border-bottom: 1px solid var(--border); padding: 14px 20px; background: var(--surface-muted); }
.chat-pin-label { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-tertiary); }

/* quiz */
.quiz-option { display: flex; align-items: flex-start; gap: 10px; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px 14px; cursor: pointer; transition: border-color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease); }
.quiz-option:hover { border-color: var(--border-strong); }
.quiz-option:has(input:checked) { border-color: var(--text-primary); background: var(--brand-subtle); }
.quiz-option input { margin-top: 3px; accent-color: var(--brand); }
.quiz-option.correct { border-color: var(--success); background: var(--success-subtle); }
.quiz-option.incorrect { border-color: var(--danger); background: var(--danger-subtle); }

/* ---- Skeleton ---- */
.skeleton { background: var(--surface-sunken); border-radius: var(--radius-sm); animation: pulse 1.5s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }

/* ==========================================================================
   Mobile system — touch targets, bottom navigation, sheets.
   Designed for phones from the ground up, not a shrunk desktop layout.
   ========================================================================== */

/* ---- Touch targets ---- */
@media (max-width: 900px) {
  .btn { min-height: 44px; }
  .btn-sm { min-height: 38px; }
  .btn-lg { min-height: 50px; }
  .btn-icon, .icon-btn { width: 44px; height: 44px; }
  /* 16px prevents iOS Safari's auto-zoom-on-focus, which otherwise jars the whole layout. */
  .input, .select, .textarea { min-height: 46px; font-size: 16px; }
  .skill-chip, .radio-card { min-height: 46px; }
  .dropdown-item { min-height: 46px; font-size: 15px; }
  .quiz-option { min-height: 46px; }
  .switch { width: 44px; height: 26px; }
  .switch-track::before { width: 20px; height: 20px; }
  .switch input:checked + .switch-track::before { transform: translateX(18px); }
  a.text-link, .nav-link, .tab-link { min-height: 44px; display: inline-flex; align-items: center; }
}

/* ---- Page bottom clearance for the fixed bottom nav ---- */
@media (max-width: 1024px) {
  .page { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
}

/* ---- Bottom navigation ---- */
.bottom-nav {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: var(--surface); border-top: 1px solid var(--border);
  padding: 4px max(4px, env(safe-area-inset-right)) max(4px, env(safe-area-inset-bottom)) max(4px, env(safe-area-inset-left));
}
.bottom-nav.dark-bottom-nav { background: var(--neutral-950); border-color: rgb(255 255 255 / 10%); }
@media (max-width: 1024px) { .bottom-nav { display: flex; } }
.bottom-nav-items { display: flex; width: 100%; max-width: 560px; margin: 0 auto; }
.bottom-nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  padding: 8px 2px 6px; border-radius: var(--radius-md); color: var(--text-tertiary); min-height: 52px;
  transition: color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease); background: none; border: none;
  font-family: inherit; cursor: pointer;
}
.dark-bottom-nav .bottom-nav-item { color: rgb(255 255 255 / 50%); }
.bottom-nav-item .bn-label { font-size: 10.5px; font-weight: 500; letter-spacing: -.01em; line-height: 1; }
.bottom-nav-item.active { color: var(--text-primary); }
.dark-bottom-nav .bottom-nav-item.active { color: #fff; }
.bottom-nav-item:active { transform: scale(.92); }

/* ---- Bottom sheet (modals become sheets on phones) ---- */
@media (max-width: 640px) {
  dialog.modal {
    position: fixed; margin: 0; left: 0; right: 0; bottom: 0; top: auto;
    max-width: 100%; width: 100%; max-height: 86vh; overflow-y: auto;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0; border-bottom: none;
    padding: 12px 18px calc(20px + env(safe-area-inset-bottom));
    animation: sheet-in .22s var(--ease);
  }
  dialog.modal::before {
    content: ""; display: block; width: 36px; height: 4px; border-radius: var(--radius-full);
    background: var(--border-strong); margin: 4px auto 14px;
  }
  dialog.modal::backdrop { background: var(--overlay); }
}
@keyframes sheet-in { from { transform: translateY(100%); } to { transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { @media (max-width: 640px) { dialog.modal { animation: none; } } }

/* ---- Sheet menu (the bottom nav's "More" panel reuses the sheet mechanics) ---- */
.sheet-menu-item {
  display: flex; align-items: center; gap: 12px; padding: 13px 6px; min-height: 48px;
  font-size: 15px; font-weight: 500; color: var(--text-primary); border-bottom: 1px solid var(--border-subtle);
}
.sheet-menu-item:last-child { border-bottom: none; }
.sheet-menu-item.destructive { color: var(--danger); }
