:root {
  --bg: #f5f8fc;
  --card: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --brand: #1d4ed8;
  --brand-2: #2563eb;
  --brand-deep: #1e3a8a;
  --accent: #0d9488;
  --warn: #b45309;
  --warn-bg: #fff7ed;
  --radius: 16px;
  --shadow: 0 12px 36px rgba(15, 23, 42, 0.07);
  --shadow-sm: 0 4px 14px rgba(15, 23, 42, 0.05);
  --font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --gradient-hero: linear-gradient(135deg, #eff6ff 0%, #f0fdfa 48%, #f8fafc 100%);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1100px 480px at 8% -12%, #dbeafe 0%, transparent 58%),
    radial-gradient(900px 420px at 92% -8%, #ccfbf1 0%, transparent 52%),
    radial-gradient(700px 320px at 50% 100%, #e0e7ff 0%, transparent 55%),
    var(--bg);
  min-height: 100vh;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { width: min(1040px, calc(100% - 2rem)); margin-inline: auto; }

.site-header {
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: blur(12px) saturate(1.2);
  background: rgba(245, 248, 252, 0.82);
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 0.85rem 0;
}
.brand {
  display: inline-flex; align-items: center; gap: 0.55rem;
  color: var(--ink); font-weight: 700; text-decoration: none;
}
.brand-mark {
  display: grid; place-items: center;
  width: 2.1rem; height: 2.1rem; border-radius: 11px;
  background: linear-gradient(145deg, var(--brand) 0%, #0d9488 100%);
  color: #fff; font-size: 0.95rem;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.28);
}
.header-actions { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }

.badge {
  display: inline-flex; align-items: center;
  font-size: 0.75rem; font-weight: 600;
  color: #0f766e; background: #ccfbf1;
  border: 1px solid #99f6e4; border-radius: 999px;
  padding: 0.35rem 0.75rem; white-space: nowrap;
}

.main { padding: 1.75rem 0 3rem; }
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 0.85rem; }
.footer-inner { padding: 1.25rem 0 2rem; }

.hero h1 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin: 0 0 0.5rem; letter-spacing: -0.02em; }
.lede { color: var(--muted); margin: 0 0 1.5rem; max-width: 42rem; }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.25rem 1.35rem; margin-bottom: 1.1rem;
}
.card h2 { margin: 0 0 0.85rem; font-size: 1.1rem; }

.usage-card.compact { padding: 0.9rem 1.1rem; }
.usage-top { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.usage-top h2 { margin: 0; }
.usage-taste { font-size: 0.82rem; color: var(--brand-2, #2563eb); font-weight: 600; }
.usage-nums { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 0.9rem; font-weight: 600; }
.usage-meters { display: grid; grid-template-columns: 1fr 1fr; gap: 0.85rem 1.25rem; margin-top: 0.55rem; }
@media (max-width: 640px) { .usage-meters { grid-template-columns: 1fr; } }
.usage-meter-block { min-width: 0; }
.usage-meter-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; }
.usage-meter-label { font-size: 0.8rem; font-weight: 700; color: #334155; text-transform: uppercase; letter-spacing: 0.03em; }
.meter {
  height: 10px; background: #e2e8f0; border-radius: 999px; overflow: hidden; margin: 0.45rem 0 0.35rem;
}
.meter-fill {
  height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--brand-2));
  border-radius: inherit; transition: width 0.35s ease;
}
.meter-fill.over { background: linear-gradient(90deg, #f59e0b, #ef4444); }
.usage-hint { margin: 0; color: var(--muted); font-size: 0.85rem; }
.usage-hint.soft-warn { margin-bottom: 0.85rem; }
.usage-jobs { margin-top: 0.65rem; }
.flash-warn { margin: 0 0 1rem; padding: 0.65rem 0.85rem; border-radius: 10px; background: var(--warn-bg, #fff7ed); }
.warn { color: var(--warn); background: var(--warn-bg); padding: 0.15rem 0.4rem; border-radius: 6px; }

.field { display: grid; gap: 0.35rem; margin-bottom: 1rem; }
.label { font-size: 0.85rem; font-weight: 600; color: #334155; }
input[type="text"], select {
  font: inherit; padding: 0.65rem 0.8rem; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
}
input[type="text"]:focus, select:focus {
  outline: 2px solid #93c5fd; border-color: #60a5fa;
}

.dropzone {
  display: block; cursor: pointer; margin-bottom: 1.1rem;
  border: 2px dashed #94a3b8; border-radius: 14px; background: #f8fafc;
  transition: border-color 0.15s, background 0.15s;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--brand-2); background: #eff6ff; }
.dropzone input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.dropzone-inner {
  display: grid; gap: 0.25rem; place-items: center; text-align: center;
  padding: 1.6rem 1rem; color: var(--muted);
}
.dropzone-inner strong { color: var(--ink); font-size: 1.05rem; }
.file-label { margin-top: 0.4rem; font-weight: 600; color: var(--brand); }
.duration-preview { font-size: 0.85rem; color: var(--accent); font-weight: 600; }

.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.85rem; }
.fineprint { margin: 0; color: var(--muted); font-size: 0.8rem; }
.fineprint code { background: #e2e8f0; padding: 0.1rem 0.35rem; border-radius: 4px; }

.btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font: inherit; font-weight: 650; border-radius: 999px;
  padding: 0.6rem 1.1rem; border: 1px solid transparent; cursor: pointer;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn-primary {
  background: linear-gradient(135deg, var(--brand) 0%, #1e40af 100%);
  color: #fff;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.28);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
  box-shadow: 0 8px 22px rgba(30, 64, 175, 0.32);
}
.btn-primary:disabled { opacity: 0.65; cursor: wait; }
.btn-ghost {
  background: #fff; color: #475569; border-color: var(--line);
}
.btn-ghost:hover { background: #f8fafc; }
.btn-ghost:disabled, .btn-ghost[disabled] {
  color: var(--muted); cursor: not-allowed; opacity: 0.85;
}
.soon-tag {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  background: #f1f5f9; color: #64748b; border-radius: 999px; padding: 0.15rem 0.45rem;
}

.busy {
  display: flex; align-items: center; gap: 0.85rem;
  margin-top: 1rem; padding: 0.9rem 1rem;
  background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 12px; color: #1e3a8a;
}
.busy[hidden] { display: none !important; }
.spinner {
  width: 1.25rem; height: 1.25rem; border-radius: 50%;
  border: 3px solid #bfdbfe; border-top-color: var(--brand-2);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.results-header {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  margin-bottom: 1.1rem; align-items: flex-start;
}
.results-header h1 { margin: 0.15rem 0 0.35rem; font-size: clamp(1.4rem, 2.5vw, 1.9rem); }
.eyebrow { margin: 0; font-size: 0.9rem; }
.meta { margin: 0; color: var(--muted); font-size: 0.92rem; }
.results-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.grid-2 {
  display: grid; gap: 1.1rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  margin-bottom: 0;
}
.prose p { margin: 0 0 0.85rem; }
.keypoints { margin: 0; padding-left: 1.15rem; }
.keypoints li { margin-bottom: 0.45rem; }
.muted { color: var(--muted); }

.mindmap-section-head {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 0.5rem; margin-bottom: 0.65rem;
}
.mindmap-section-head h2 { margin: 0; }
.mindmap-sub {
  margin: 0; font-size: 0.85rem; color: var(--muted);
}
.mindmap-wrap {
  overflow-x: auto;
  border: 1px solid #c7d2fe;
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(241, 245, 249, 0.9), rgba(255, 255, 255, 0.95));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 8px 24px rgba(30, 58, 138, 0.06);
  padding: 0.35rem;
}
.mindmap-wrap .mindmap-svg { display: block; border-radius: 14px; }
.mindmap-alt { margin-top: 0.85rem; color: var(--muted); }
.mindmap-html {
  margin-top: 0.5rem;
  padding: 0.75rem 0.85rem;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid var(--line);
}
.mindmap-html ul { list-style: none; padding-left: 1.15rem; margin: 0.35rem 0; }
.mindmap-html .mm-root { padding-left: 0; }
.mm-label {
  display: inline-block; padding: 0.28rem 0.7rem; border-radius: 999px;
  background: #fff; border: 1px solid var(--line); margin: 0.18rem 0;
  font-size: 0.9rem; box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.mm-root-label {
  background: linear-gradient(135deg, #1e3a8a, #3b82f6);
  color: #fff; border-color: #1e40af; font-weight: 700;
  border-radius: 999px; padding: 0.35rem 0.9rem;
}
.mm-branch-label { font-weight: 650; }
.mm-leaf-label {
  border-radius: 10px; border-left-width: 4px;
  background: #fff; color: #334155;
}
.mm-branch-sky .mm-branch-label { background: #e0f2fe; border-color: #38bdf8; color: #0c4a6e; }
.mm-branch-sky .mm-leaf-label { border-left-color: #0ea5e9; border-color: #e2e8f0; }
.mm-branch-violet .mm-branch-label { background: #ede9fe; border-color: #a78bfa; color: #4c1d95; }
.mm-branch-violet .mm-leaf-label { border-left-color: #8b5cf6; border-color: #e2e8f0; }
.mm-branch-emerald .mm-branch-label { background: #d1fae5; border-color: #34d399; color: #064e3b; }
.mm-branch-emerald .mm-leaf-label { border-left-color: #10b981; border-color: #e2e8f0; }
.mm-branch-amber .mm-branch-label { background: #fef3c7; border-color: #fbbf24; color: #78350f; }
.mm-branch-amber .mm-leaf-label { border-left-color: #f59e0b; border-color: #e2e8f0; }
.mm-branch-rose .mm-branch-label { background: #ffe4e6; border-color: #fb7185; color: #881337; }
.mm-branch-rose .mm-leaf-label { border-left-color: #f43f5e; border-color: #e2e8f0; }

.btn-secondary {
  background: #fff; color: var(--brand); border-color: #93c5fd;
}
.btn-secondary:hover { background: #eff6ff; }
.btn-accent {
  background: #0d9488; color: #fff; border-color: #0f766e;
}
.btn-accent:hover { background: #0f766e; }
.btn-soft {
  background: #f8fafc; color: #334155; border-color: var(--line);
}
.btn-soft:hover { background: #f1f5f9; }

.edit-card textarea, .edit-card input[type="text"] {
  width: 100%; font: inherit; padding: 0.65rem 0.8rem; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  resize: vertical; min-height: 2.5rem;
}
.edit-card textarea:focus, .edit-card input[type="text"]:focus {
  outline: 2px solid #93c5fd; border-color: #60a5fa;
}
.edit-card .field-hint { margin: 0; font-size: 0.8rem; color: var(--muted); }
.edit-actions {
  display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.85rem;
  padding-top: 0.85rem; border-top: 1px solid var(--line);
}
.edit-grid {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.flash-ok {
  margin: 0 0 1rem; padding: 0.65rem 0.9rem; border-radius: 10px;
  background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; font-size: 0.92rem;
}

.transcript { max-height: 240px; overflow: auto; margin-top: 0.75rem; color: #334155; }
details summary { cursor: pointer; font-weight: 600; }

@media (max-width: 640px) {
  .badge { white-space: normal; }
  .header-inner { align-items: flex-start; flex-direction: column; }
}


/* Lesson context + transcript review */
.context-chip {
  margin: 0.35rem 0 0.4rem;
  font-size: 0.92rem;
  color: var(--brand);
}
.context-chip .chip-label {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #0f766e;
  background: #ccfbf1;
  border: 1px solid #99f6e4;
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  margin-right: 0.4rem;
  vertical-align: middle;
}

.review-card {
  border-color: #fdba74;
  background: linear-gradient(180deg, #fff7ed 0%, #ffffff 48%);
}
.review-card h2 { color: #9a3412; }
.review-note { margin: 0 0 0.85rem; color: #9a3412; font-size: 0.92rem; }
.review-ok { margin: 0; }
.flag-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.65rem; }
.flag-item {
  background: #fff; border: 1px solid #fed7aa; border-radius: 10px;
  padding: 0.7rem 0.85rem;
}
.flag-swap { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; font-weight: 650; }
.flag-original {
  color: #9f1239; background: #ffe4e6; border-radius: 6px; padding: 0.1rem 0.45rem;
  text-decoration: line-through;
}
.flag-arrow { color: var(--muted); }
.flag-suggestion {
  color: #166534; background: #dcfce7; border-radius: 6px; padding: 0.1rem 0.45rem;
}
.flag-reason { margin: 0.35rem 0 0; font-size: 0.88rem; color: #7c2d12; }
.flag-context { margin: 0.25rem 0 0; font-size: 0.85rem; color: var(--muted); font-style: italic; }

.structured-notes .notes-section { margin: 0.65rem 0 0.35rem; }
.structured-notes .notes-bullets { margin: 0.2rem 0 0.75rem; padding-left: 1.2rem; }
.structured-notes .notes-bullets li { margin-bottom: 0.3rem; }

/* Dual entry: paste notes vs upload audio */
.entry-tabs {
  display: flex; gap: 0.4rem; flex-wrap: wrap;
  margin: 0 0 0.75rem; padding: 0.3rem;
  background: #e8eef7; border-radius: 999px; width: fit-content;
  border: 1px solid #c7d2fe;
}
.entry-tab {
  font: inherit; font-weight: 650; cursor: pointer;
  border: none; background: transparent; color: #475569;
  border-radius: 999px; padding: 0.5rem 1rem;
}
.entry-tab:hover { color: #1e3a8a; background: rgba(255,255,255,0.55); }
.entry-tab.is-active {
  background: #fff; color: #1e3a8a;
  box-shadow: 0 2px 8px rgba(30, 58, 138, 0.12);
}
.entry-panel[hidden] { display: none !important; }
.entry-panel-head { margin-bottom: 1rem; }
.entry-panel-head h2 { margin: 0 0 0.35rem; }
.entry-panel-sub { margin: 0; color: var(--muted); font-size: 0.92rem; max-width: 40rem; }
#notes-text {
  width: 100%; font: inherit; padding: 0.75rem 0.9rem; border-radius: 12px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  resize: vertical; min-height: 12rem; line-height: 1.45;
}
#notes-text:focus { outline: 2px solid #93c5fd; border-color: #60a5fa; }

/* Lesson context (pre-notes) */
.lesson-context {
  margin-bottom: 1.1rem;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  border: 1px solid #bfdbfe;
  background: linear-gradient(180deg, #eff6ff 0%, #ffffff 70%);
}
.lesson-context-title {
  margin: 0 0 0.15rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: #1e3a8a;
}
.lesson-context-lede {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  color: #64748b;
}
.lesson-context .field { margin-bottom: 0.75rem; }
.lesson-context .field:last-child { margin-bottom: 0; }
.field-hint { font-weight: 500; color: var(--muted); font-size: 0.8rem; }
.user-context-line {
  margin: 0.2rem 0 0.35rem;
  font-size: 0.92rem;
  color: #334155;
}
.user-context-line strong { color: var(--brand); font-weight: 700; }
.lesson-context { min-inline-size: 0; }
.lesson-context legend.lesson-context-title {
  padding: 0 0.25rem;
  float: none;
}
textarea {
  font: inherit; padding: 0.65rem 0.8rem; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  width: 100%; resize: vertical;
}
textarea:focus {
  outline: 2px solid #93c5fd; border-color: #60a5fa;
}

/* ===== Public cloud extras ===== */
.header-nav { display: flex; gap: 1rem; align-items: center; margin-left: auto; margin-right: 1rem; }
.header-nav a { color: var(--text-muted, #64748b); text-decoration: none; font-weight: 600; font-size: 0.95rem; }
.header-nav a:hover { color: var(--primary, #1e4d8c); }
.badge-warn { background: #fef3c7; color: #92400e; border: 1px solid #fbbf24; }
.badge-ok { background: #d1fae5; color: #065f46; border: 1px solid #34d399; }
.badge-plan { background: #e0e7ff; color: #3730a3; }
.banner-ai-off {
  background: #fef3c7; color: #92400e; border: 1px solid #f59e0b;
  padding: 0.65rem 1rem; border-radius: 10px; font-weight: 600; margin: 0.75rem 0 0;
}
.landing-hero {
  text-align: center;
  padding: 3.25rem 1.5rem 2.25rem;
  max-width: 780px;
  margin: 0.75rem auto 0;
  border-radius: 24px;
  background: var(--gradient-hero);
  border: 1px solid rgba(191, 219, 254, 0.65);
  box-shadow: var(--shadow-sm);
}
.landing-hero h1 {
  font-size: clamp(1.85rem, 4.2vw, 2.55rem);
  line-height: 1.18;
  letter-spacing: -0.03em;
  margin: 0.35rem 0 0.85rem;
  color: var(--brand-deep);
}
.landing-hero .eyebrow {
  display: inline-block;
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #0f766e;
  background: #ccfbf1;
  border: 1px solid #99f6e4;
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
}
.landing-lede {
  font-size: 1.12rem;
  line-height: 1.55;
  margin: 0 auto 1.35rem;
  max-width: 38rem;
  color: #475569;
}
.landing-lede strong { color: var(--brand-deep); font-weight: 700; }
.hero-bullets {
  list-style: none;
  margin: 0 auto 0.35rem;
  padding: 0;
  max-width: 32rem;
  text-align: left;
  display: grid;
  gap: 0.55rem;
}
.hero-bullets li {
  position: relative;
  padding: 0.55rem 0.85rem 0.55rem 2.35rem;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: #334155;
  font-size: 0.98rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}
.hero-bullets li::before {
  content: "";
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--brand-2));
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}
.hero-bullets strong { color: var(--ink); }
.hero-cta {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  margin: 1.65rem 0 0.85rem;
}
.hero-fine { color: #64748b; }
.btn-lg { padding: 0.9rem 1.55rem; font-size: 1.05rem; }
.landing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.15rem;
  margin: 2.25rem 0 1.5rem;
}
.feature-card {
  margin-bottom: 0;
  padding: 1.35rem 1.35rem 1.4rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  border-color: #e2e8f0;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}
.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(30, 58, 138, 0.1);
  border-color: #bfdbfe;
}
.feature-icon {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 12px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  font-size: 1.15rem;
  margin-bottom: 0.75rem;
}
.feature-card h2 {
  font-size: 1.08rem;
  margin: 0 0 0.45rem;
  color: var(--brand-deep);
  letter-spacing: -0.01em;
}
.feature-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.5;
}
.social-proof {
  margin: 1.75rem 0;
  padding: 1.5rem 1.6rem;
  background: linear-gradient(180deg, #eff6ff 0%, #ffffff 55%);
  border-color: #bfdbfe;
}
.social-proof h2 {
  margin: 0 0 0.85rem;
  font-size: 1.25rem;
  color: var(--brand-deep);
}
.social-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.1rem;
}
.bullet-list { padding-left: 1.2rem; line-height: 1.6; color: #334155; }
.bullet-list li { margin-bottom: 0.45rem; }
.pricing-teaser { margin: 2.25rem 0 1rem; text-align: center; }
.pricing-teaser h2 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.35rem, 2.5vw, 1.65rem);
  color: var(--brand-deep);
  letter-spacing: -0.02em;
}
.pricing-teaser-lede {
  margin: 0 auto 0.5rem;
  max-width: 36rem;
  text-align: center;
}
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1.15rem 0;
  text-align: left;
}
.pricing-grid-full { margin-bottom: 2rem; }
.pricing-hero { text-align: center; margin-bottom: 1.5rem; }
.pricing-hero .eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #0f766e;
  background: #ccfbf1;
  border: 1px solid #99f6e4;
  border-radius: 999px;
  padding: 0.28rem 0.8rem;
  margin-bottom: 0.65rem;
}
.pricing-hero h1 { color: var(--brand-deep); }
.price-card {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.price-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(30, 58, 138, 0.1);
}
.price-card .price {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--brand-deep);
  margin: 0.25rem 0;
  letter-spacing: -0.02em;
}
.price-card-pro {
  border: 2px solid #818cf8;
  box-shadow: 0 10px 28px rgba(99, 102, 241, 0.14);
  background: linear-gradient(180deg, #eef2ff 0%, #ffffff 42%);
}
.price-card.is-current { outline: 2px solid #34d399; }
.price-blurb { color: #64748b; min-height: 2.6em; }
.center { text-align: center; }
.text-link {
  font-weight: 650;
  color: var(--brand-2);
}
.text-link:hover { text-decoration: underline; }
.upgrade-card { max-width: 640px; margin: 2rem auto; }
.signup-card .inline-form { display: flex; gap: 0.75rem; align-items: flex-end; flex-wrap: wrap; }
.signup-card .grow { flex: 1; min-width: 220px; }
.footer-links { margin-top: 0.35rem; }
.polish-meta { margin: 0.5rem 0 1rem; }
.flash-ok, .flash { background: #ecfdf5; color: #065f46; padding: 0.65rem 1rem; border-radius: 8px; }
.flash.warn, .flash-warn { background: #fef3c7; color: #92400e; }
@media (max-width: 720px) {
  .header-nav { margin-right: 0.5rem; gap: 0.65rem; font-size: 0.9rem; }
  .landing-hero { padding: 2.25rem 1rem 1.75rem; border-radius: 18px; }
  .hero-bullets li { font-size: 0.94rem; }
}


/* ===== Live lesson record ===== */
.live-record {
  margin: 0.25rem 0 1.15rem;
  padding: 1rem 1.1rem;
  border-radius: 14px;
  border: 1px solid #99f6e4;
  background: linear-gradient(180deg, #f0fdfa 0%, #ffffff 65%);
}
.live-record-title {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
  color: #0f766e;
}
.live-record-sub {
  margin: 0 0 0.9rem;
  font-size: 0.88rem;
  color: var(--muted);
}
.live-record-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}
.btn-record {
  background: #dc2626;
  color: #fff;
  border-color: #b91c1c;
  font-size: 1.05rem;
  padding: 0.75rem 1.35rem;
  box-shadow: 0 6px 16px rgba(220, 38, 38, 0.25);
}
.btn-record:hover { background: #b91c1c; }
.btn-record:disabled { opacity: 0.55; cursor: not-allowed; box-shadow: none; }
.btn-record .rec-dot {
  width: 0.65rem; height: 0.65rem; border-radius: 50%;
  background: #fff; box-shadow: 0 0 0 2px rgba(255,255,255,0.35);
  animation: none;
}
.btn-record[aria-pressed="true"] .rec-dot,
.live-record.is-recording .rec-dot {
  animation: rec-pulse 1s ease-in-out infinite;
}
.btn-stop {
  background: #0f172a;
  color: #fff;
  border-color: #020617;
  font-size: 1.05rem;
  padding: 0.75rem 1.35rem;
}
.btn-stop:hover { background: #1e293b; }
.btn-stop:disabled { opacity: 0.55; cursor: not-allowed; }
.rec-timer {
  font-variant-numeric: tabular-nums;
  font-weight: 750;
  font-size: 1.25rem;
  color: #0f766e;
  min-width: 3.5rem;
}
.rec-status {
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
  color: #0f766e;
}
.rec-status.is-error {
  color: #9a3412;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 10px;
  padding: 0.55rem 0.75rem;
}
.rec-preview {
  margin-top: 0.9rem;
  display: grid;
  gap: 0.75rem;
  justify-items: start;
}
.rec-preview audio {
  width: min(100%, 420px);
  max-width: 100%;
}
.audio-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.25rem 0 1rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.audio-divider::before,
.audio-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.upload-secondary-title {
  margin: 0 0 0.65rem;
  font-size: 0.98rem;
  color: #334155;
}
@keyframes rec-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.85); }
}


/* Interactive mind map drag */
.mindmap-toolbar {
  display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center;
}
.btn-sm {
  padding: 0.35rem 0.75rem; font-size: 0.82rem; border-radius: 8px;
}
#mm-save-layout.is-saved {
  background: #d1fae5; color: #064e3b; border-color: #34d399;
}
.mindmap-wrap .mindmap-svg .mm-draggable {
  cursor: grab;
}
.mindmap-wrap .mindmap-svg .mm-draggable.is-dragging {
  cursor: grabbing;
}
.mindmap-wrap .mindmap-svg .mm-draggable text {
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}
.mindmap-card .mindmap-section-head {
  align-items: flex-start;
}

/* Editable mind map */
.mindmap-hint {
  font-size: 0.78rem;
  color: var(--muted);
  align-self: center;
  margin-left: 0.15rem;
}
.mindmap-toolbar .btn-sm {
  min-height: 36px;
  min-width: 36px;
}
.mindmap-toolbar .btn-sm:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.mindmap-wrap .mindmap-svg .mm-node.is-selected .mm-hit {
  stroke: #2563eb !important;
  stroke-width: 2.6 !important;
  filter: drop-shadow(0 0 0.5px #2563eb);
}
.mindmap-wrap .mindmap-svg .mm-node.is-selected {
  outline: none;
}
.mindmap-wrap .mindmap-svg .mm-node-actions {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
}
.mindmap-wrap .mindmap-svg .mm-node:hover .mm-node-actions,
.mindmap-wrap .mindmap-svg .mm-node.is-selected .mm-node-actions {
  opacity: 1;
  pointer-events: auto;
}
.mindmap-wrap .mindmap-svg .mm-btn-add,
.mindmap-wrap .mindmap-svg .mm-btn-add-label {
  cursor: pointer;
  pointer-events: all;
}
.mindmap-wrap .mindmap-svg .mm-inline-input {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  border: 2px solid #3b82f6;
  border-radius: 10px;
  padding: 0.35rem 0.5rem;
  font: 600 13px/1.3 system-ui, -apple-system, Segoe UI, sans-serif;
  text-align: center;
  background: #fff;
  color: #0f172a;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
}
.mindmap-wrap .mindmap-svg .mm-edit-fo {
  overflow: visible;
}
@media (hover: none) {
  .mindmap-wrap .mindmap-svg .mm-node-actions {
    opacity: 1;
    pointer-events: auto;
  }
}



/* ===== Live captions (SpeechRecognition alongside MediaRecorder) ===== */
.live-captions {
  margin-top: 0.85rem;
  border: 1px solid #99f6e4;
  border-radius: 12px;
  background: #f0fdfa;
  overflow: hidden;
}
.live-captions[hidden],
.live-captions-unavail[hidden] {
  display: none !important;
}
.live-captions-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.75rem;
  border-bottom: 1px solid #ccfbf1;
  background: rgba(255, 255, 255, 0.65);
}
.live-captions-label {
  font-size: 0.78rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #0f766e;
}
.live-captions-badge {
  font-size: 0.75rem;
  font-weight: 650;
  color: #0f766e;
  background: #ccfbf1;
  border: 1px solid #99f6e4;
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
  animation: caption-pulse 1.4s ease-in-out infinite;
}
.live-captions-badge[hidden] { display: none !important; }
.live-captions-scroll {
  max-height: 160px;
  overflow-y: auto;
  padding: 0.7rem 0.85rem;
  font-size: 0.95rem;
  line-height: 1.45;
  color: #134e4a;
  min-height: 2.5rem;
}
.live-captions-final {
  display: inline;
  white-space: pre-wrap;
  word-break: break-word;
}
.live-captions-interim {
  display: inline;
  color: #64748b;
  font-style: italic;
  opacity: 0.85;
  white-space: pre-wrap;
  word-break: break-word;
}
.live-captions-unavail {
  margin: 0.75rem 0 0;
  font-size: 0.88rem;
  color: #9a3412;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 10px;
  padding: 0.55rem 0.75rem;
}
.prefer-live-check {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: #334155;
  cursor: pointer;
  max-width: 36rem;
}
.prefer-live-check[hidden] { display: none !important; }
.prefer-live-check input {
  margin-top: 0.2rem;
  accent-color: #0d9488;
}
.rec-preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}
@keyframes caption-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}
.live-record.is-recording .live-captions {
  border-color: #2dd4bf;
  box-shadow: 0 0 0 1px rgba(45, 212, 191, 0.25);
}

/* —— Auth / library / quiz / admin —— */
.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.82rem; }
.btn-google {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  width: 100%; max-width: 22rem;
  background: #fff; color: #1f2937; border: 1px solid #cbd5e1;
  font-weight: 600; border-radius: 10px; padding: 0.7rem 1rem;
  text-decoration: none; cursor: pointer;
}
.btn-google:hover:not(:disabled) { background: #f8fafc; text-decoration: none; }
.btn-google:disabled { opacity: 0.55; cursor: not-allowed; }
.badge-user {
  color: #1e3a8a; background: #dbeafe; border-color: #93c5fd;
  max-width: 12rem; overflow: hidden; text-overflow: ellipsis;
}
.auth-card { max-width: 28rem; margin-inline: auto; }
.auth-lede { margin-bottom: 1rem; }
.oauth-block { margin: 0.75rem 0 1rem; }
.auth-divider {
  display: flex; align-items: center; gap: 0.75rem;
  color: var(--muted); font-size: 0.85rem; margin: 1rem 0;
}
.auth-divider::before, .auth-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--line);
}
.auth-form .field { margin-bottom: 0.75rem; }
.flash.warn, .flash-warn {
  background: var(--warn-bg); color: var(--warn);
  border: 1px solid #fdba74; border-radius: 10px; padding: 0.65rem 0.85rem;
}
.library-day { margin-bottom: 1.5rem; }
.library-day-heading {
  font-size: 0.95rem; color: #334155; margin: 0 0 0.65rem;
  letter-spacing: 0.01em;
}
.library-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.65rem; }
.library-item {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  margin-bottom: 0; padding: 0.85rem 1rem;
}
.library-link {
  display: flex; flex-direction: column; gap: 0.35rem;
  color: inherit; text-decoration: none; flex: 1; min-width: 0;
}
.library-link:hover { text-decoration: none; }
.library-link:hover .library-title { color: var(--brand-2); text-decoration: underline; }
.library-title { font-weight: 700; font-size: 1.02rem; }
.library-meta { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.library-chip {
  font-size: 0.75rem; font-weight: 600; color: #0f766e;
  background: #ccfbf1; border: 1px solid #99f6e4;
  border-radius: 999px; padding: 0.15rem 0.55rem;
}
.library-chip-topic { color: #1d4ed8; background: #dbeafe; border-color: #93c5fd; }
.library-chip.muted { color: var(--muted); background: #f1f5f9; border-color: #e2e8f0; }
.library-time { font-size: 0.8rem; color: var(--muted); }
.library-actions { display: flex; gap: 0.75rem; flex-shrink: 0; }
.inline-quiz-form { display: inline; margin: 0; }
.quiz-list { margin: 0.75rem 0 0; padding-left: 0; list-style: none; }
.quiz-item {
  border: 1px solid var(--line); border-radius: 12px;
  padding: 0.85rem 1rem; margin-bottom: 0.65rem; background: #fafbfc;
}
.quiz-q { margin: 0 0 0.5rem; font-weight: 600; }
.quiz-num { color: var(--brand-2); margin-right: 0.25rem; }
.quiz-answer summary {
  cursor: pointer; color: var(--brand-2); font-weight: 600; font-size: 0.9rem;
}
.quiz-answer[open] summary { margin-bottom: 0.35rem; }
.quiz-answer p { margin: 0; color: #334155; }
.admin-table-wrap { overflow-x: auto; }
.admin-table {
  width: 100%; border-collapse: collapse; font-size: 0.9rem;
}
.admin-table th, .admin-table td {
  text-align: left; padding: 0.55rem 0.65rem;
  border-bottom: 1px solid var(--line); vertical-align: top;
}
.admin-table th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; color: #64748b; }
.admin-table .mono { font-variant-numeric: tabular-nums; font-size: 0.82rem; color: #475569; }
.header-nav { display: flex; gap: 0.9rem; flex-wrap: wrap; align-items: center; }
.header-nav a { color: #334155; font-weight: 600; font-size: 0.92rem; }
@media (max-width: 720px) {
  .library-item { flex-direction: column; align-items: flex-start; }
  .header-inner { flex-wrap: wrap; }
}


.legal-card h2 { margin-top: 1.5rem; font-size: 1.1rem; }
.legal-card .bullet-list { margin: 0.5rem 0 1rem; }
.flash.ok { background: #e8f7ee; color: #0f5132; border: 1px solid #a3d9b1; padding: 0.75rem 1rem; border-radius: 8px; }

/* ===== Landing demo / how-it-works ===== */
.demo-section {
  margin: 0.5rem 0 2.25rem;
}
.demo-heading {
  text-align: center;
  color: var(--brand-deep);
  margin: 0 0 0.35rem;
}
.demo-lede {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}
.how-steps {
  list-style: none;
  margin: 0 auto 1.5rem;
  padding: 0;
  display: grid;
  gap: 0.85rem;
  max-width: 44rem;
}
.how-steps li {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.85rem 1rem;
  box-shadow: var(--shadow-sm);
}
.how-steps p { margin: 0.2rem 0 0; color: var(--muted); font-size: 0.92rem; }
.how-num {
  flex: 0 0 auto;
  width: 1.85rem; height: 1.85rem;
  border-radius: 999px;
  display: grid; place-items: center;
  font-weight: 800; font-size: 0.9rem;
  color: #fff;
  background: linear-gradient(145deg, var(--brand), #0d9488);
}
.demo-stage { margin-top: 0.5rem; }
.demo-window {
  background: #0f172a;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.22);
  border: 1px solid #1e293b;
}
.demo-chrome {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.65rem 0.85rem;
  background: #1e293b;
}
.demo-dot {
  width: 0.55rem; height: 0.55rem; border-radius: 50%;
  background: #64748b;
}
.demo-dot:nth-child(1) { background: #f87171; }
.demo-dot:nth-child(2) { background: #fbbf24; }
.demo-dot:nth-child(3) { background: #34d399; }
.demo-url {
  margin-left: 0.65rem;
  font-size: 0.75rem;
  color: #94a3b8;
  background: #0f172a;
  border-radius: 6px;
  padding: 0.2rem 0.55rem;
}
.demo-body {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.75rem;
  padding: 1rem;
  align-items: stretch;
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
}
.demo-pane {
  background: #fff;
  border-radius: 12px;
  padding: 0.85rem;
  min-height: 11rem;
}
.demo-label {
  margin: 0 0 0.55rem;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}
.demo-notes {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82rem;
  line-height: 1.55;
  color: #334155;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  padding: 0.65rem;
}
.demo-takes {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.88rem;
  color: #0f172a;
}
.demo-takes li { margin-bottom: 0.35rem; }
.demo-arrow {
  align-self: center;
  color: #5eead4;
  font-size: 1.6rem;
  font-weight: 700;
}
.demo-mm {
  display: flex; flex-wrap: wrap; gap: 0.35rem;
  margin-top: 0.75rem;
}
.mm-node {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  background: #ecfeff;
  border: 1px solid #99f6e4;
  color: #0f766e;
}
.mm-root {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1e40af;
}
.demo-caption { text-align: center; margin-top: 0.75rem; color: #64748b; }

/* Mobile polish */
@media (max-width: 720px) {
  .wrap { width: min(1040px, calc(100% - 1.25rem)); }
  .demo-body { grid-template-columns: 1fr; }
  .demo-arrow { transform: rotate(90deg); justify-self: center; }
  .hero-cta .btn, .social-cta .btn, .price-card .btn, .auth-form .btn {
    width: 100%;
    justify-content: center;
  }
  .hero-cta, .social-cta { flex-direction: column; align-items: stretch; }
  input[type="text"], input[type="email"], input[type="password"], select, textarea {
    font-size: 16px; /* prevent iOS zoom */
    width: 100%;
  }
  .btn { min-height: 44px; }
  .header-actions .badge-ok, .header-actions .badge-warn { display: none; }
  .pricing-grid { grid-template-columns: 1fr; }
  .landing-grid { grid-template-columns: 1fr; }
}

.demo-shots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin: 1.25rem 0 0.5rem;
}
.demo-shot {
  margin: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.demo-shot img {
  display: block;
  width: 100%;
  height: auto;
  border-bottom: 1px solid var(--line);
}
.demo-shot figcaption {
  padding: 0.65rem 0.85rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.demo-shots-flow {
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 900px) {
  .demo-shots-flow { grid-template-columns: 1fr; }
}
.demo-shot figcaption strong { color: var(--brand-deep); }

.demo-video-wrap { grid-column: 1 / -1; margin-bottom: 0.5rem; }
.demo-video, .demo-video-wrap img#demo-gif, .demo-video-wrap > img {
  display: block; width: 100%; height: auto;
  border-radius: 14px; border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: #0f172a;
}
.demo-shots-flow { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) {
  .demo-shots-flow { grid-template-columns: 1fr; }
}


/* Landing: GIF row — conversion full-width, then edit + rearrange */
.demo-shots-main {
  grid-template-columns: 1fr 1fr;
}
.demo-shots-main .demo-video-wrap {
  grid-column: 1 / -1;
}
@media (max-width: 800px) {
  .demo-shots-main { grid-template-columns: 1fr; }
}
