:root {
  color-scheme: light;
  --bg: #f4f5f7;
  --panel: #ffffff;
  --panel-2: #f0f2f5;
  --border: #e4e7ec;
  --border-strong: #d0d5dd;
  --text: #101828;
  --muted: #667085;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: rgba(37, 99, 235, 0.08);
  --ok: #12b76a;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-md: 0 4px 16px rgba(16, 24, 40, 0.06);
  --shadow-lg: 0 12px 40px rgba(16, 24, 40, 0.1);
  --radius: 12px;
  --font: "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  --max: 920px;
  --demo-break: 780px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ——— Header ——— */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.1rem 1.25rem;
}

.brand {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.logo {
  display: block;
  height: 40px;
  width: auto;
  max-width: min(200px, 52vw);
  object-fit: contain;
}

.logo-sm {
  height: 32px;
  max-width: 140px;
  margin: 0 auto 0.75rem;
}

.header-link {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
}

.header-link:hover {
  color: var(--text);
  background: var(--panel);
  text-decoration: none;
}

/* ——— Hero ——— */
.hero {
  position: relative;
  max-width: var(--max);
  margin: 0 auto;
  padding: 3.25rem 1.25rem 2.25rem;
  text-align: center;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 1.15rem;
  padding: 0.35rem 0.75rem 0.35rem 0.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(37, 99, 235, 0.18);
  box-shadow: var(--shadow-sm);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
}

.hero-eyebrow-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--ok, #12b76a);
  box-shadow: 0 0 0 3px rgba(18, 183, 106, 0.18);
  animation: hero-pulse 2.2s ease-in-out infinite;
}

@keyframes hero-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 3px rgba(18, 183, 106, 0.18);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(18, 183, 106, 0.08);
  }
}

.hero h1 {
  margin: 0 0 1.15rem;
  font-size: clamp(2.15rem, 6.2vw, 3.45rem);
  font-weight: 750;
  letter-spacing: -0.04em;
  line-height: 1.05;
  color: var(--text);
}

@media (max-width: 780px) {
  .hero {
    padding: 2.5rem 1.1rem 1.75rem;
  }

  .hero h1 {
    font-size: clamp(2.55rem, 11.5vw, 3.35rem);
    letter-spacing: -0.045em;
    line-height: 1.02;
    margin-bottom: 1rem;
  }

  /* Install is Mac-only — hide secondary CTA on phones */
  .hero-actions .btn-ghost[href="#install"] {
    display: none;
  }

  .hero-actions {
    gap: 0;
  }

  .hero-actions .btn-primary {
    width: 100%;
    max-width: 20rem;
  }
}

.hero-line {
  display: block;
}

.hero-line-accent {
  background: linear-gradient(105deg, #1d4ed8 0%, #2563eb 45%, #0f766e 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  margin: 0 auto 1.9rem;
  max-width: 36rem;
  font-size: clamp(1.02rem, 2.2vw, 1.15rem);
  color: var(--muted);
  line-height: 1.6;
}

.hero-sub-em {
  color: var(--text);
  font-weight: 650;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  justify-content: center;
}

.btn-primary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.65rem 1.4rem;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 650;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.12s ease;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow:
    0 1px 2px rgba(16, 24, 40, 0.06),
    0 8px 20px rgba(37, 99, 235, 0.28);
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  text-decoration: none;
  box-shadow:
    0 1px 2px rgba(16, 24, 40, 0.06),
    0 10px 24px rgba(37, 99, 235, 0.34);
  transform: translateY(-1px);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.85);
  color: var(--text);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(6px);
}

.btn-ghost:hover {
  background: var(--panel);
  border-color: var(--border-strong);
  text-decoration: none;
  transform: translateY(-1px);
}

@media (prefers-reduced-motion: reduce) {
  .hero-eyebrow-dot {
    animation: none;
  }
  .btn-primary:hover,
  .btn-ghost:hover {
    transform: none;
  }
}

/* ——— Demo section ——— */
.demo-section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
  text-align: center;
}

.section-label {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.demo-caption {
  margin: 1.1rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

/* Device-specific visibility */
.demo-desktop {
  display: block;
}

.demo-mobile {
  display: none;
}

@media (max-width: 780px) {
  .demo-desktop {
    display: none;
  }

  .demo-mobile {
    display: block;
  }
}

/* ——— Laptop frame ——— */
.laptop {
  /* Screen area targets 16:9 (1920×1080); width caps overall size */
  width: min(920px, 100%);
  margin: 0 auto;
  filter: drop-shadow(var(--shadow-lg));
}

.laptop-bezel {
  position: relative;
  background: #1a1d23;
  border-radius: 14px 14px 0 0;
  padding: 1.1rem 0.85rem 0.65rem;
  border: 1px solid #0f1115;
}

.laptop-camera {
  position: absolute;
  top: 0.4rem;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2a2e36;
  box-shadow: inset 0 0 0 1px #111;
}

.laptop-base {
  height: 14px;
  background: linear-gradient(180deg, #c8ccd3 0%, #aeb4be 100%);
  border-radius: 0 0 8px 8px;
  position: relative;
  margin: 0 -1.5%;
  box-shadow: 0 2px 0 #9aa1ad;
}

.laptop-base::before,
.laptop-base::after {
  content: "";
  position: absolute;
  bottom: -6px;
  width: 12%;
  height: 6px;
  background: #9aa1ad;
  border-radius: 0 0 4px 4px;
}

.laptop-base::before {
  left: 8%;
}

.laptop-base::after {
  right: 8%;
}

.laptop-notch {
  width: 18%;
  height: 5px;
  margin: 0 auto;
  background: #8b929e;
  border-radius: 0 0 6px 6px;
}

/* ——— iPhone-style frame (≈ 9:19.5, modern iOS) ——— */
.phone {
  --phone-w: min(320px, 86vw);
  width: var(--phone-w);
  /* iPhone 14/15 Pro-ish aspect */
  aspect-ratio: 9 / 19.5;
  max-height: min(720px, 88dvh);
  margin: 0 auto;
  position: relative;
  background: linear-gradient(160deg, #2c2c2e 0%, #1c1c1e 40%, #0a0a0b 100%);
  border-radius: 48px;
  padding: 11px;
  box-shadow:
    0 0 0 1px #3a3a3c,
    0 0 0 3px #0a0a0b,
    0 24px 60px rgba(16, 24, 40, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.phone-side {
  position: absolute;
  background: #2a2a2c;
  border-radius: 2px;
  z-index: 2;
}

.phone-side-left {
  left: -2px;
  top: 18%;
  width: 3px;
  height: 28%;
  box-shadow:
    0 0 0 0 #2a2a2c,
    0 42px 0 0 #2a2a2c,
    0 78px 0 0 #2a2a2c;
  /* mute + vol up/down as stacked segments via height + shadows approx */
  height: 14px;
  box-shadow:
    0 28px 0 0 #2a2a2c,
    0 52px 0 0 #2a2a2c;
}

.phone-side-right {
  right: -2px;
  top: 24%;
  width: 3px;
  height: 52px;
}

.phone-screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 38px;
  overflow: hidden;
  background: #000;
  display: flex;
  flex-direction: column;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

/* iOS status bar + Dynamic Island */
.phone-status {
  position: relative;
  flex-shrink: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0.55rem 1rem 0.35rem;
  min-height: 2.65rem;
  background: #fff;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}

.phone-time {
  font-size: 0.82rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  justify-self: start;
  padding-left: 0.15rem;
}

.phone-island {
  width: 5.5rem;
  height: 1.55rem;
  border-radius: 999px;
  background: #0a0a0b;
  box-shadow: inset 0 0 0 1px #1a1a1c;
  justify-self: center;
}

.phone-status-icons {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.28rem;
  justify-self: end;
}

.phone-signal {
  width: 0.95rem;
  height: 0.7rem;
  background:
    linear-gradient(to top, currentColor 0 100%) 0 100% / 15% 40% no-repeat,
    linear-gradient(to top, currentColor 0 100%) 30% 100% / 15% 55% no-repeat,
    linear-gradient(to top, currentColor 0 100%) 60% 100% / 15% 75% no-repeat,
    linear-gradient(to top, currentColor 0 100%) 90% 100% / 15% 100% no-repeat;
  color: var(--text);
  opacity: 0.9;
}

.phone-battery {
  width: 1.35rem;
  height: 0.65rem;
  border: 1.5px solid var(--text);
  border-radius: 3px;
  position: relative;
  opacity: 0.9;
  box-sizing: border-box;
}

.phone-battery::before {
  content: "";
  position: absolute;
  left: 1.5px;
  top: 1.5px;
  bottom: 1.5px;
  width: 72%;
  background: var(--text);
  border-radius: 1px;
}

.phone-battery::after {
  content: "";
  position: absolute;
  right: -3px;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 45%;
  background: var(--text);
  border-radius: 0 1px 1px 0;
  opacity: 0.7;
}

/* iOS home indicator */
.phone-home-indicator {
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding: 0.35rem 0 0.45rem;
  background: #fff;
  z-index: 5;
}

.phone-home-indicator::after {
  content: "";
  width: 36%;
  max-width: 8.5rem;
  height: 0.28rem;
  border-radius: 999px;
  background: var(--text);
  opacity: 0.85;
}

/* ——— App shell (shared with product look) ——— */
.app-shell {
  background: var(--bg);
  overflow: hidden;
  text-align: left;
}

.app-shell-desktop {
  border-radius: 6px;
  /* Usual desktop display ratio: 1920×1080 → 16:9 */
  aspect-ratio: 1920 / 1080;
  width: 100%;
  height: auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
}

.app-shell-mobile {
  flex: 1 1 auto;
  min-height: 0;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  border: none;
  overflow: hidden;
  background: var(--bg);
}

.app-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.app-bar-brand {
  display: flex;
  align-items: center;
  min-width: 0;
}

.app-bar-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.app-logo {
  height: 28px;
  width: auto;
  object-fit: contain;
  display: block;
}

.live-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(18, 183, 106, 0.15);
  flex-shrink: 0;
  margin-left: 0.15rem;
}

/* Matches app .btn-share */
.btn-share {
  appearance: none;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  padding: 0.35rem 0.7rem;
  font-size: 0.72rem;
  font-weight: 600;
  font-family: inherit;
  cursor: default;
  pointer-events: none;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 2px 8px rgba(37, 99, 235, 0.25);
  white-space: nowrap;
}

/* Desktop workspace: answer | media */
.app-workspace-desktop {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(200px, 0.95fr);
  background: var(--bg);
}

.media-column {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-left: 1px solid var(--border);
  background: #eef0f3;
}

.pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  background: var(--panel);
}

.answer-pane {
  padding: 0;
}

.live-pane {
  flex: 1 1 58%;
  min-height: 0;
  border-bottom: 1px solid var(--border);
  background: #e8eaee;
}

.question-pane {
  flex: 0 1 42%;
  min-height: 0;
  background: #eef0f3;
}

.pane-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.45rem 0.75rem 0.25rem;
  flex-shrink: 0;
}

.answer-box {
  flex: 1 1 auto;
  min-height: 120px;
  margin: 0 0.65rem;
  padding: 0.75rem 0.85rem;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.88rem;
  line-height: 1.5;
  overflow: auto;
}

.answer-box .placeholder {
  margin: 0;
  color: var(--muted);
}

.answer-box .answer-text {
  margin: 0;
  color: var(--text);
}

.answer-box .answer-text strong {
  color: var(--accent);
}

.answer-box.loading {
  color: var(--muted);
}

/* Matches app .ask-row / .btn-ask / .auto-ask-toggle */
.ask-row {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.75rem 0.55rem;
}

.btn-ask {
  appearance: none;
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  min-height: 2.75rem;
  border: none;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 4px 12px rgba(37, 99, 235, 0.22);
  transition: background 0.12s ease;
}

.btn-ask:hover {
  background: var(--accent-hover);
}

.btn-ask:disabled {
  background: #98a2b3;
  box-shadow: none;
  color: #fff;
  cursor: wait;
  opacity: 1;
}

.auto-ask-toggle {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0.35rem 0.15rem 0.35rem 0.2rem;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.auto-ask-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.auto-ask-switch {
  position: relative;
  width: 2.35rem;
  height: 1.35rem;
  border-radius: 999px;
  background: #d0d5dd;
  box-shadow: inset 0 0 0 1px rgba(16, 24, 40, 0.06);
  transition: background 0.15s ease;
  flex-shrink: 0;
}

.auto-ask-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: calc(1.35rem - 4px);
  height: calc(1.35rem - 4px);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.18);
  transition: transform 0.15s ease;
}

.auto-ask-toggle input:checked + .auto-ask-switch {
  background: var(--accent);
}

.auto-ask-toggle input:checked + .auto-ask-switch::after {
  transform: translateX(1rem);
}

.auto-ask-toggle:has(input:checked) {
  color: var(--accent);
}

.auto-ask-text {
  line-height: 1;
}

/* Media stages */
.media-stage {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0 0.5rem 0.5rem;
  border-radius: 8px;
  overflow: hidden;
  background: #dfe3e9;
  border: 1px solid var(--border);
  display: flex;
  align-items: stretch;
}

.fake-browser {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #f7f8fa;
  min-height: 0;
}

.fake-browser-bar {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.5rem;
  background: #f0f2f5;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.fake-browser-bar > span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #d0d5dd;
}

.fake-browser-bar > span:nth-child(1) {
  background: #f97066;
}
.fake-browser-bar > span:nth-child(2) {
  background: #fdb022;
}
.fake-browser-bar > span:nth-child(3) {
  background: #32d583;
}

.fake-url {
  flex: 1;
  margin-left: 0.35rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.15rem 0.45rem;
  font-size: 0.65rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fake-quiz {
  padding: 0;
  font-size: 0.78rem;
  overflow: auto;
  flex: 1 1 auto;
  min-height: 0;
  background: #f7f8fa;
}

/* ——— Quiz environment chrome (LMS-like clutter) ——— */
.quiz-chrome {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  text-align: left;
}

.quiz-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  background: #1b3a5f;
  color: #e8eef6;
  flex-shrink: 0;
}

.quiz-course {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.quiz-course-name {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quiz-topic {
  font-size: 0.6rem;
  opacity: 0.75;
}

.quiz-meta-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
  flex-shrink: 0;
}

.quiz-student {
  font-size: 0.6rem;
  opacity: 0.9;
}

.quiz-timer {
  font-size: 0.68rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: rgba(255, 255, 255, 0.12);
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
}

.quiz-timer-warn {
  background: #fee4e2;
  color: #b42318;
  font-size: 0.62rem;
  font-weight: 650;
  padding: 0.28rem 0.65rem;
  border-bottom: 1px solid #fecdca;
}

.quiz-progress-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.75rem;
  padding: 0.4rem 0.65rem 0.25rem;
  font-size: 0.62rem;
  color: #475467;
  background: #fff;
}

.quiz-qnum {
  font-weight: 700;
  color: var(--text);
}

.quiz-points,
.quiz-attempt {
  color: var(--muted);
}

.quiz-progress-bar {
  height: 4px;
  margin: 0 0.65rem 0.45rem;
  background: #e4e7ec;
  border-radius: 999px;
  overflow: hidden;
}

.quiz-progress-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #2e90fa, #2563eb);
  border-radius: 999px;
}

.quiz-body {
  display: flex;
  gap: 0;
  flex: 1 1 auto;
  min-height: 0;
  padding: 0 0.5rem 0.5rem;
}

.quiz-body.has-sidebar {
  gap: 0.45rem;
}

.quiz-sidebar {
  width: 88px;
  flex-shrink: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.4rem;
  align-self: flex-start;
}

.sidebar-title {
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.q-palette {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.2rem;
}

.q-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 1.25rem;
  font-size: 0.58rem;
  font-weight: 650;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: #f9fafb;
  color: #475467;
}

.q-cell.done {
  background: #d1fadf;
  border-color: #6ce9a6;
  color: #027a48;
}

.q-cell.current {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.q-cell.flagged {
  background: #fef0c7;
  border-color: #fdb022;
  color: #b54708;
}

.sidebar-legend {
  margin-top: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.52rem;
  color: var(--muted);
}

.sidebar-legend span {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.lg {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 2px;
  display: inline-block;
  border: 1px solid var(--border);
  background: #f9fafb;
}

.lg.done {
  background: #d1fadf;
  border-color: #6ce9a6;
}
.lg.current {
  background: var(--accent);
  border-color: var(--accent);
}
.lg.flagged {
  background: #fef0c7;
  border-color: #fdb022;
}

.quiz-main {
  flex: 1 1 auto;
  min-width: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.55rem 0.65rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.fake-quiz-q {
  margin: 0;
  font-weight: 650;
  color: var(--text);
  line-height: 1.35;
  font-size: 0.84rem;
}

.fake-choices,
.fake-quiz ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.fake-quiz li,
.fake-choices li {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  padding: 0.38rem 0.5rem;
  border-radius: 8px;
  color: #344054;
  border: 1px solid var(--border);
  background: #fff;
  line-height: 1.35;
  font-size: 0.76rem;
}

.choice-letter {
  flex-shrink: 0;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--muted);
  background: #f9fafb;
}

.choice-text {
  flex: 1;
  min-width: 0;
  padding-top: 0.05rem;
}

.fake-quiz li.highlight,
.fake-choices li.highlight {
  background: var(--accent-soft);
  border-color: rgba(37, 99, 235, 0.35);
  color: var(--accent);
  font-weight: 600;
}

.fake-quiz li.highlight .choice-letter,
.fake-choices li.highlight .choice-letter {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.quiz-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.25rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--border);
}

.quiz-nav-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: #fff;
  color: #344054;
  border-radius: 6px;
  padding: 0.28rem 0.5rem;
  font-size: 0.62rem;
  font-weight: 600;
  font-family: inherit;
  cursor: default;
  pointer-events: none;
}

.quiz-nav-btn.primary {
  background: #1b3a5f;
  border-color: #1b3a5f;
  color: #fff;
}

.quiz-nav-btn.ghost {
  margin-left: auto;
  color: var(--muted);
}

.quiz-nav-btn:disabled {
  opacity: 0.45;
}

.question-snap {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0.35rem;
  padding: 0.55rem 0.65rem;
  background: #f8f9fb;
  overflow: auto;
  min-height: 0;
}

.question-snap .snap-q {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
}

.snap-choices {
  margin: 0;
  padding: 0 0 0 1.1rem;
  list-style: disc;
  color: #344054;
}

.snap-choices li {
  font-size: 0.74rem;
  line-height: 1.4;
  padding: 0.05rem 0;
}

.snap-choices li.highlight {
  color: var(--accent);
  font-weight: 600;
}

/* Mobile workspace */
.app-workspace-mobile {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.media-toggle {
  display: flex;
  gap: 0.25rem;
  padding: 0.4rem 0.5rem 0.25rem;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.media-toggle-btn {
  flex: 1 1 0;
  min-height: 2rem;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
  font-family: inherit;
  cursor: pointer;
  padding: 0.3rem 0.4rem;
}

.media-toggle-btn.active {
  background: var(--accent-soft);
  border-color: rgba(37, 99, 235, 0.28);
  color: var(--accent);
}

.mobile-media {
  position: relative;
  flex: 0 0 42%;
  min-height: 160px;
  background: #e8eaee;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.mobile-media .media-stage {
  margin: 0.45rem 0.5rem 0.5rem;
  flex: 1 1 auto;
  min-height: 0;
}

.mobile-media .media-stage.hide-pane {
  display: none;
}

.app-shell-mobile .answer-pane {
  flex: 1 1 auto;
  min-height: 0;
}

.app-shell-mobile .answer-box {
  min-height: 80px;
}

.app-shell-mobile .ask-row {
  gap: 0.55rem;
  padding: 0.55rem 0.6rem 0.65rem;
}

.app-shell-mobile .btn-ask {
  flex: 1;
  min-height: 2.85rem;
  font-size: 1rem;
  border-radius: 12px;
}

.app-shell-mobile .auto-ask-toggle {
  flex-shrink: 0;
}

.fake-browser.compact .quiz-topbar {
  padding: 0.35rem 0.45rem;
}

.fake-browser.compact .quiz-course-name {
  font-size: 0.6rem;
}

.fake-browser.compact .quiz-body {
  padding: 0 0.35rem 0.35rem;
}

.fake-browser.compact .quiz-main {
  padding: 0.4rem 0.45rem;
}

.fake-browser.compact .fake-quiz-q {
  font-size: 0.76rem;
}

.fake-browser.compact .fake-choices li,
.fake-browser.compact .fake-quiz li {
  padding: 0.3rem 0.4rem;
  font-size: 0.7rem;
}

.fake-browser.compact .quiz-nav-btn.ghost {
  margin-left: 0;
}

.fake-browser.compact .quiz-progress-row {
  gap: 0.25rem 0.5rem;
  padding: 0.3rem 0.45rem 0.2rem;
}

/* ——— Install guide ——— */
.install-section {
  max-width: 720px;
  margin: 0 auto;
  padding: 0.5rem 0 2.75rem;
  text-align: left;
}

.install-section .section-label,
.install-section h2,
.install-intro,
.install-note {
  padding-left: 1.25rem;
  padding-right: 1.25rem;
  text-align: center;
}

.install-section h2 {
  margin: 0 0 0.45rem;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.install-intro {
  margin: 0 0 1.5rem;
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.45;
}

/* Full-width mobile copy (titlebar Copy stays for desktop) */
.btn-copy-mobile {
  display: none;
  width: 100%;
  margin-top: 0.75rem;
  appearance: none;
  border: none;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  padding: 0.9rem 1rem;
  min-height: 3.1rem;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.28);
}

.btn-copy-mobile:hover {
  background: var(--accent-hover);
}

.btn-copy-mobile:disabled {
  opacity: 0.55;
  cursor: wait;
}

.btn-copy-mobile.copied {
  background: #027a48;
  box-shadow: none;
}

/* Install step card + nested terminal for the command */
.cmd-card {
  margin: 0 1.25rem 1.5rem;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.15rem 1.15rem 1rem;
  box-shadow: var(--shadow-md);
}

.cmd-card-top {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.cmd-step-badge {
  flex-shrink: 0;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font);
}

.cmd-card-titles {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  font-family: var(--font);
}

.cmd-card-titles strong {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.cmd-card-sub {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
}

.cmd-card-sub em {
  font-style: normal;
  color: var(--text);
  font-weight: 600;
}

.term-window {
  background: #1c1c1e;
  color: #f5f5f7;
  border-radius: 10px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.2),
    0 8px 24px rgba(16, 24, 40, 0.12);
  font-family: var(--mono);
}

.term-titlebar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 0.65rem;
  background: linear-gradient(180deg, #3a3a3c 0%, #2c2c2e 100%);
  border-bottom: 1px solid #1a1a1c;
  user-select: none;
}

.term-dots {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.term-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.25);
}

.term-dot-red {
  background: #ff5f57;
}
.term-dot-yellow {
  background: #febc2e;
}
.term-dot-green {
  background: #28c840;
}

.term-title {
  text-align: center;
  font-size: 0.68rem;
  font-weight: 500;
  color: #a1a1a6;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.term-body {
  padding: 0.75rem 0.85rem 0.9rem;
  background: #0b0b0c;
  min-height: 3.75rem;
}

.term-line {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.term-prompt {
  flex-shrink: 0;
  color: #32d74b;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.5;
  user-select: none;
}

/* Command + cursor share one inline flow so the caret sits after the text */
.term-cmd-wrap {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.78rem;
  line-height: 1.5;
  word-break: break-all;
}

.cmd-text {
  display: inline;
  margin: 0;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  color: #f5f5f7;
  word-break: break-all;
  white-space: pre-wrap;
  cursor: text;
  user-select: all;
  background: transparent;
}

.cmd-text.is-error {
  color: #ff6b6b;
}

.cmd-text.is-loading {
  color: #8e8e93;
}

.term-cursor {
  display: inline-block;
  width: 0.48em;
  height: 1.05em;
  margin-left: 1px;
  vertical-align: -0.12em;
  background: #32d74b;
  border-radius: 1px;
  animation: term-blink 1.05s steps(1) infinite;
}

@keyframes term-blink {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0;
  }
}

.btn-copy {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #f5f5f7;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.25rem 0.55rem;
  cursor: pointer;
  min-height: 0;
  line-height: 1.2;
  box-shadow: none;
}

.btn-copy:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-copy:disabled {
  opacity: 0.45;
  cursor: wait;
}

.btn-copy.copied {
  background: rgba(50, 215, 75, 0.2);
  border-color: rgba(50, 215, 75, 0.45);
  color: #32d74b;
}

.cmd-status {
  margin: 0.55rem 0 0;
  min-height: 0;
  font-size: 0.8rem;
  font-family: var(--font);
  color: #027a48;
}

.cmd-status:empty {
  display: none;
}

.cmd-status.is-err {
  color: var(--danger, #b42318);
}

.cmd-status a {
  color: var(--accent);
}

.linkish {
  appearance: none;
  border: none;
  background: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.linkish:hover {
  color: var(--accent-hover);
}

/* Horizontal step cards */
.step-scroller {
  display: flex;
  gap: 0.85rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 0.15rem 1.25rem 0.85rem;
  scrollbar-width: thin;
}

.step-scroller::-webkit-scrollbar {
  height: 6px;
}

.step-scroller::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 99px;
}

.step-card {
  flex: 0 0 min(280px, 82vw);
  scroll-snap-align: start;
  border-radius: 16px;
  padding: 1.15rem 1.1rem 1.2rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  min-height: 11.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.step-card-a,
.step-card-b,
.step-card-c,
.step-card-d {
  background: var(--panel);
  border-color: var(--border);
}

.step-num {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.15rem;
}

.step-card h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.25;
  white-space: nowrap;
}

.step-card p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.45;
}

.step-path {
  margin-top: auto !important;
  font-size: 0.75rem !important;
  font-weight: 600;
  color: #1d4ed8 !important;
  background: rgba(255, 255, 255, 0.75);
  border-radius: 8px;
  padding: 0.4rem 0.5rem;
  line-height: 1.35 !important;
}

.install-note {
  margin: 1.1rem 0 0;
  font-size: 0.88rem;
  color: var(--muted);
}

/* Setup is Mac Terminal — hide on phones */
@media (max-width: 780px) {
  .install-section {
    display: none !important;
  }
}

@media (min-width: 781px) {
  .btn-copy-mobile {
    display: none;
  }
}

@media (min-width: 900px) {
  .step-scroller {
    justify-content: center;
    overflow: visible;
  }

  .step-card {
    flex: 1 1 0;
    min-width: 0;
    max-width: none;
  }

  .step-card h3 {
    font-size: clamp(0.82rem, 1.05vw, 0.95rem);
  }
}

/* ——— FAQ ——— */
.faq-section {
  max-width: 560px;
  margin: 0 auto;
  padding: 1rem 1.25rem 3.5rem;
}

.faq-section .section-label {
  text-align: center;
}

.faq-section h2 {
  margin: 0 0 1.25rem;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-align: center;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.faq-item {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.faq-item summary {
  padding: 0.9rem 1rem;
  font-weight: 650;
  font-size: 0.95rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  user-select: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--muted);
  flex-shrink: 0;
  line-height: 1;
}

.faq-item[open] summary::after {
  content: "−";
}

.faq-item summary:hover {
  background: var(--panel-2);
}

.faq-item p {
  margin: 0;
  padding: 0 1rem 1rem;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.55;
}

/* ——— Footer ——— */
.site-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem 1.25rem 2.5rem;
  text-align: center;
  border-top: 1px solid var(--border);
}

.site-footer p {
  margin: 0 0 0.35rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.footer-meta {
  font-size: 0.8rem !important;
  opacity: 0.85;
}

/* Slightly tighter hero on small phones */
@media (max-width: 420px) {
  .hero {
    padding-top: 1.5rem;
  }

  .hero h1 {
    font-size: 1.7rem;
  }

  .site-header {
    padding: 0.9rem 1rem;
  }
}
