/* vonmath — design system v0.
 * Mobile-first: base rules target phones (320px+).
 * @media (min-width: 640px)  -> large phones / portrait tablets
 * @media (min-width: 960px)  -> landscape tablets / small laptops
 * @media (min-width: 1200px) -> desktop
 * Touch targets ≥ 44x44 px (WCAG 2.5.5 / Apple HIG).
 */

:root {
    --vm-bg: #e8edf6;
    --vm-surface: #ffffff;
    --vm-surface-2: #f1f4fa;
    --vm-text: #1a1f2c;
    --vm-muted: #5b6577;
    --vm-border: #e3e7ef;
    --vm-primary: #2962ff;
    --vm-primary-hover: #1e4fd1;
    --vm-danger: #d93636;
    --vm-success: #1f9c5b;

    /* Spacing scale (multiples of 4px). Use these, not magic numbers. */
    --vm-s-1: 4px;
    --vm-s-2: 8px;
    --vm-s-3: 12px;
    --vm-s-4: 16px;
    --vm-s-5: 24px;
    --vm-s-6: 32px;
    --vm-s-7: 48px;
    --vm-s-8: 64px;

    --vm-radius: 12px;
    --vm-radius-sm: 8px;
    --vm-shadow: 0 1px 2px rgba(20, 30, 50, 0.04), 0 8px 24px rgba(20, 30, 50, 0.06);

    /* Min size for any tappable control. */
    --vm-tap: 44px;

    /* ── Unified mastery palette ────────────────────────────────────────────
     * Use these everywhere a topic / metric encodes proficiency. Do not
     * introduce new shades. Surfaces: Topics grid, Topic timeline circles,
     * Dashboard stat bars, Progress page, Missed Questions severity.
     */
    --vm-mastery-mastered:    #1f9c5b;   /* solid — met grade-level goal */
    --vm-mastery-mastered-bg: #dcfce7;
    --vm-mastery-learning:    #b45309;   /* amber — making progress */
    --vm-mastery-learning-bg: #fef3c7;
    --vm-mastery-struggling:  #d93636;   /* red — needs work */
    --vm-mastery-struggling-bg:#fee2e2;
    --vm-mastery-empty:       #94a3b8;   /* slate — not started */
    --vm-mastery-empty-bg:    #f1f5f9;
}

@media (prefers-color-scheme: dark) {
    /* Reserved for v1. For now we ship light-mode only so we don't ship a half-finished palette. */
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--vm-bg);
    color: var(--vm-text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

body {
    /* iOS safe-area for notched devices. */
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

a { color: var(--vm-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

img, svg { max-width: 100%; height: auto; display: block; }

/* ---------------- Shell + nav ---------------- */

.vm-shell {
    min-height: 100vh;
    min-height: 100dvh; /* avoids mobile-browser URL-bar resize jank */
    display: flex;
    flex-direction: column;
}

.vm-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--vm-s-3);
    padding: var(--vm-s-3) var(--vm-s-4);
    background: var(--vm-surface);
    border-bottom: 1px solid var(--vm-border);
    padding-top: max(var(--vm-s-3), env(safe-area-inset-top));
    position: relative; /* anchor for mobile panel */
    z-index: 50;
}
.vm-brand {
    display: flex;
    align-items: center;
    color: var(--vm-text);
}
.vm-brand img { height: 28px; display: block; width: auto; }
@media (min-width: 640px) { .vm-brand img { height: 32px; } }
.vm-nav-actions {
    display: flex;
    gap: var(--vm-s-2);
    align-items: center;
    min-width: 0;
}
.vm-nav-actions > span {
    /* email truncates on small screens instead of pushing the button off */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 18ch;
}

@media (min-width: 640px) {
    .vm-nav { padding: var(--vm-s-4) var(--vm-s-5); }
    .vm-brand { font-size: 1.25rem; }
    .vm-nav-actions > span { max-width: none; }
}

/* ── Dashboard sub-toolbar ───────────────────────────────────────────────── */
.vm-dash-toolbar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: var(--vm-s-2);
    padding: var(--vm-s-2) var(--vm-s-4);
    background: var(--vm-surface);
    border-bottom: 1px solid var(--vm-border);
}
@media (min-width: 640px) {
    .vm-dash-toolbar { padding: var(--vm-s-2) var(--vm-s-5); }
}

/* ---------------- Main + cards ---------------- */

.vm-main {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: var(--vm-s-5) var(--vm-s-4);
    padding-bottom: max(var(--vm-s-5), env(safe-area-inset-bottom));
}

/* Auth pages: card is short, so center it vertically to kill dead space */
.vm-main--center {
    align-items: center;
    padding-top: var(--vm-s-4);
    padding-bottom: max(var(--vm-s-4), env(safe-area-inset-bottom));
}

@media (min-width: 640px) {
    .vm-main { padding: var(--vm-s-6) var(--vm-s-5); }
    .vm-main--center { padding-top: var(--vm-s-5); padding-bottom: var(--vm-s-5); }
}

.vm-card {
    background: var(--vm-surface);
    border: 1px solid var(--vm-border);
    border-radius: var(--vm-radius);
    box-shadow: var(--vm-shadow);
    padding: var(--vm-s-5);
    width: 100%;
    max-width: 420px;
}
.vm-card h1 {
    font-size: clamp(1.375rem, 1.2rem + 1vw, 1.5rem);
    margin: 0 0 var(--vm-s-1);
    line-height: 1.2;
}
.vm-card .vm-sub {
    color: var(--vm-muted);
    margin: 0 0 var(--vm-s-5);
    font-size: 0.875rem;
}

@media (min-width: 640px) {
    .vm-card { padding: var(--vm-s-6); }
}

/* ---------------- Forms ---------------- */

.vm-field { margin-bottom: var(--vm-s-3); display: flex; flex-direction: column; gap: var(--vm-s-1); }
.vm-field label { font-size: 0.8125rem; color: var(--vm-muted); font-weight: 500; }
.vm-field input,
.vm-field select,
.vm-field textarea {
    padding: 12px 14px;
    min-height: var(--vm-tap);
    border: 1px solid var(--vm-border);
    border-radius: var(--vm-radius-sm);
    font-size: 16px; /* 16px+ prevents iOS Safari zoom-on-focus */
    background: var(--vm-surface);
    color: var(--vm-text);
    transition: border-color 0.15s, box-shadow 0.15s;
    width: 100%;
    font-family: inherit;
}
.vm-field input:focus,
.vm-field select:focus,
.vm-field textarea:focus {
    outline: none;
    border-color: var(--vm-primary);
    box-shadow: 0 0 0 3px rgba(41, 98, 255, 0.18);
}
.vm-input-wrap {
    position: relative;
    display: flex;
}
.vm-input-wrap input {
    flex: 1;
    padding-right: 40px;
}
.vm-pw-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--vm-muted);
    display: flex;
    align-items: center;
    line-height: 1;
    transition: color .15s;
}
.vm-pw-toggle:hover { color: var(--vm-text); }

/* ---------------- Buttons ---------------- */

.vm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--vm-s-2);
    padding: 10px 16px;
    min-height: var(--vm-tap);
    border: 1px solid transparent;
    border-radius: var(--vm-radius-sm);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s, color 0.12s, transform 0.05s;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    font-family: inherit;
}
.vm-btn:active { transform: scale(0.98); }
.vm-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(41, 98, 255, 0.35);
}
.vm-btn-primary { background: var(--vm-primary); color: #fff; }
.vm-btn-primary:hover { background: var(--vm-primary-hover); text-decoration: none; }
.vm-btn-ghost { background: transparent; color: var(--vm-text); border-color: var(--vm-border); }
.vm-btn-ghost:hover { background: var(--vm-surface-2); text-decoration: none; }
.vm-btn-block { display: flex; width: 100%; }

/* ---------------- Misc primitives ---------------- */

.vm-divider {
    display: flex; align-items: center;
    gap: var(--vm-s-3);
    color: var(--vm-muted);
    font-size: 0.75rem;
    margin: var(--vm-s-5) 0;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.vm-divider::before, .vm-divider::after {
    content: ''; flex: 1; height: 1px; background: var(--vm-border);
}

.vm-error {
    color: var(--vm-danger);
    font-size: 0.8125rem;
    min-height: 18px;
    margin: var(--vm-s-1) 0 0;
}
.vm-success { color: var(--vm-success); font-size: 0.8125rem; min-height: 18px; margin: var(--vm-s-1) 0 0; }

.vm-footnote {
    margin-top: var(--vm-s-5);
    text-align: center;
    color: var(--vm-muted);
    font-size: 0.8125rem;
}

/* ---------------- Hero (landing) ---------------- */

.vm-hero {
    max-width: 720px;
    text-align: center;
    padding: var(--vm-s-6) var(--vm-s-4);
}
.vm-hero h1 {
    /* Fluid: 30px on phone, up to 56px on desktop. */
    font-size: clamp(1.875rem, 1.25rem + 3.2vw, 3.5rem);
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin: 0 0 var(--vm-s-4);
}
.vm-hero p {
    font-size: clamp(1rem, 0.92rem + 0.4vw, 1.125rem);
    color: var(--vm-muted);
    margin: 0 0 var(--vm-s-6);
}
.vm-hero-actions {
    display: flex;
    gap: var(--vm-s-3);
    justify-content: center;
    flex-wrap: wrap;
}
.vm-hero-actions .vm-btn { min-width: 160px; }

@media (min-width: 640px) {
    .vm-hero { padding: var(--vm-s-7) var(--vm-s-5); }
}

/* ---------------- Dashboard ---------------- */

.vm-main--dash {
    justify-content: flex-start;
    align-items: stretch;
    padding: 0;
}

.vm-dash {
    width: 100%;
    padding: var(--vm-s-4) var(--vm-s-4);
    display: flex;
    flex-direction: column;
    gap: var(--vm-s-4);
}

@media (min-width: 640px) {
    .vm-dash { padding: var(--vm-s-5) var(--vm-s-5); }
}
.vm-dash-header { margin-bottom: var(--vm-s-5); }
.vm-dash-header h1 {
    font-size: clamp(1.5rem, 1.3rem + 1vw, 1.875rem);
    margin: 0 0 var(--vm-s-1);
    line-height: 1.2;
}
.vm-dash-header p { color: var(--vm-muted); margin: 0; font-size: 0.9375rem; }

/* ── Child selection strip ─────────────────────────────────────────────────── */
.vm-child-strip-scroll {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* left indent matches vm-cp card padding (20px) so Nicholas aligns with Day Streak */
    padding: 8px 0 12px 20px;
}
.vm-child-strip-scroll::-webkit-scrollbar { display: none; }

.vm-child-strip {
    display: inline-flex;
    /* center so the visual centers of all circles align regardless of whether
       a sibling is scaled (dimmed) or the Add/Limit tile is at 0.76. */
    align-items: center;
    gap: var(--vm-s-4);
    min-width: max-content;
}

.vm-child-strip-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: transform 0.22s ease, opacity 0.22s ease;
    -webkit-tap-highlight-color: transparent;
    outline: none;
    background: none;
    border: none;
    padding: 0;
    user-select: none;
}
.vm-child-strip-item:focus-visible .vm-profile-avatar {
    box-shadow: 0 0 0 3px rgba(41,98,255,0.35);
}
.vm-child-strip-item--dimmed {
    opacity: 0.38;
    transform: scale(0.76);
}
.vm-child-strip-item--selected .vm-profile-avatar {
    border-color: var(--vm-primary);
    box-shadow: 0 0 0 3px rgba(41,98,255,0.18), 0 4px 16px rgba(20,30,50,0.12);
}
.vm-child-strip-name {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--vm-text);
    white-space: nowrap;
    transition: color 0.2s;
}
.vm-child-strip-item--dimmed .vm-child-strip-name { color: var(--vm-muted); }

/* Add Child + Limit-reached cards always render at the deselected size
   so they never appear larger than the dimmed sibling profile circles.
   Use the default center origin so they shrink the same way dimmed
   siblings do — keeps every circle's visual center on the same horizontal
   axis (issue #84). */
.vm-child-strip-add,
.vm-child-strip-limit {
    transform: scale(0.76);
    opacity: 1;
}

/* Add Child circle */
.vm-profile-avatar--add {
    border-style: dashed;
    border-width: 2px;
    border-color: var(--vm-primary);
    background: #fff;
    color: var(--vm-primary);
    box-shadow: none;
}
.vm-child-strip-add .vm-child-strip-name { color: var(--vm-primary); }
.vm-child-strip-add:hover .vm-profile-avatar--add { background: #f5f7ff; }

/* Limit-reached state */
.vm-profile-avatar--add-disabled {
    border-style: dashed;
    border-width: 2px;
    border-color: var(--vm-border);
    background: #fff;
    color: var(--vm-muted);
    box-shadow: none;
    cursor: default;
}
.vm-child-strip-limit .vm-child-strip-name { color: var(--vm-muted); font-size: 0.65rem; text-align: center; }

/* ── Child panel ──────────────────────────────────────────────────────────── */
.vm-cp {
    background: var(--vm-surface);
    border: 1px solid var(--vm-border);
    border-radius: var(--vm-radius);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Header */
.vm-cp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.vm-cp-identity {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.vm-cp-name  { font-size: 1.25rem; font-weight: 700; color: var(--vm-text); }
.vm-cp-grade { font-size: 0.875rem; color: var(--vm-muted); }

/* Today badge */
.vm-today-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 99px;
    white-space: nowrap;
}
.vm-today-badge--done    { background: #dcfce7; color: #166534; }
.vm-today-badge--pending { background: #fef9c3; color: #854d0e; }

/* Header action cluster: FAB + icon buttons */
.vm-cp-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.vm-cp-ctas    { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Combined name + CTA pill button */
.vm-cp-name-cta {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 20px;
    height: 44px;
    background: var(--vm-primary);
    color: #fff;
    border: none;
    border-radius: 99px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(41,98,255,0.35);
    transition: transform 0.1s, box-shadow 0.1s;
}
.vm-cp-name-cta:hover:not(:disabled) { transform: scale(1.03); box-shadow: 0 6px 18px rgba(41,98,255,0.45); }
.vm-cp-name-cta:disabled { background: var(--vm-surface-2); color: var(--vm-muted); box-shadow: none; cursor: not-allowed; }
.vm-cp-name-cta--car { background: #1f9c5b; box-shadow: 0 4px 12px rgba(31,156,91,0.35); }
.vm-cp-name-cta--car:hover:not(:disabled) { box-shadow: 0 6px 18px rgba(31,156,91,0.45); }
.vm-mc-today-time {
    font-size: 0.8125rem;
    color: var(--vm-primary);
    font-weight: 600;
    margin-top: 2px;
}

/* Icon buttons — larger */
.vm-cp-icon-btn {
    width: 48px; height: 48px;
    border-radius: 50%;
    border: 1.5px solid var(--vm-border);
    background: var(--vm-surface);
    color: var(--vm-muted);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: border-color 0.1s, color 0.1s, background 0.1s;
    flex-shrink: 0;
}
.vm-cp-icon-btn:hover { border-color: var(--vm-primary); color: var(--vm-primary); background: #eef2ff; }

/* ── Metrics layout ───────────────────────────────────────────────────────── */
.vm-metrics { display: flex; flex-direction: column; gap: 10px; }

/* Stat + chart grid — 1 col mobile, 2×2 tablet, 4-wide desktop */
.vm-stat-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}
@media (min-width: 540px) {
    .vm-stat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
    .vm-stat-grid { grid-template-columns: repeat(4, 1fr); }
}

/* Clickable card */
.vm-mc--clickable {
    cursor: pointer;
    transition: box-shadow 0.15s, transform 0.1s;
}
.vm-mc--clickable:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.10);
    transform: translateY(-1px);
}
.vm-mc--clickable:active { transform: translateY(0); box-shadow: none; }

/* Card header row: number/label + info icon */
.vm-mc-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 6px;
    width: 100%;
}

/* Info tooltip */
.vm-infotip {
    position: relative;
    flex-shrink: 0;
    color: var(--vm-border);
    cursor: pointer;
    transition: color 0.1s;
    padding: 2px;
    margin-top: 2px;
}
.vm-infotip:hover { color: var(--vm-muted); }
.vm-infotip-popup {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 220px;
    background: #1e293b;
    color: #f1f5f9;
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 1.5;
    padding: 10px 12px;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    z-index: 50;
    pointer-events: auto;
    text-align: left;
}
/* Arrow on tooltip */
.vm-infotip-popup::before {
    content: '';
    position: absolute;
    top: -5px;
    right: 10px;
    width: 10px;
    height: 10px;
    background: #1e293b;
    transform: rotate(45deg);
    border-radius: 2px;
}

/* Flat stat card */
.vm-mc--stat {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 20px 16px 16px;
}

/* Streak dots — 7 small circles */
.vm-streak-dots { display: flex; gap: 5px; }
.vm-streak-dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: #f1f5f9;
}
.vm-streak-dot--on { background: #f97316; }

/* Topic progress bar */
.vm-stat-bar-wrap {
    width: 100%; height: 8px;
    background: #f1f5f9; border-radius: 99px; overflow: hidden;
}
.vm-stat-bar-fill {
    height: 100%; border-radius: 99px;
    transition: width 0.5s ease;
}

/* Accuracy chart card */
.vm-mc--accuracy-chart {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 20px 16px 12px;
}
.vm-acc-current {
    font-size: 2.5rem;
    font-weight: 300;
    line-height: 1;
    letter-spacing: -0.02em;
}
.vm-acc-svg { display: block; overflow: visible; }
.vm-acc-weeks {
    font-size: 0.6875rem;
    color: var(--vm-muted);
    text-align: right;
}
.vm-acc-empty {
    font-size: 0.8125rem;
    color: var(--vm-muted);
    padding: 24px 0;
    text-align: center;
}

.vm-mc--donut {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    padding: 20px 12px 16px;
    text-align: center;
    min-height: 0;
}

.vm-mc--donut .vm-mc-ring-wrap { margin: 0 auto; }

/* Push label+sub to the same vertical zone across all donut cards */
.vm-mc--donut .vm-mc-donut-label { margin-top: auto; }

/* Bottom row: sessions + topics */
.vm-mc-bottom {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* ── Mobile ─────────────────────────────────────── */
@media (max-width: 600px) {
    .vm-mc-bottom  { grid-template-columns: 1fr; }
    .vm-cp-header  { flex-wrap: wrap; gap: 12px; }
}

/* Tablet: donuts side by side, bottom row side by side */
@media (min-width: 541px) and (max-width: 900px) {
    .vm-mc-ring-wrap { width: 120px; height: 120px; }
}

.vm-mc {
    background: var(--vm-surface);
    border: 1px solid var(--vm-border);
    border-radius: 18px;
    padding: 16px 14px 14px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    min-height: 0;
}

/* Ring wrap — number lives inside SVG, always proportional */
.vm-mc-ring-wrap {
    width: 58%;
    aspect-ratio: 1;
    margin: 0 auto;
}

/* Donut label — single line with inline sub */
.vm-mc-donut-label {
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--vm-muted);
    text-align: center;
}
.vm-mc-donut-sub {
    font-size: 0.75rem;
    opacity: 0.7;
}

/* Big number (sessions / topics) */
.vm-mc-big {
    font-size: 3rem;
    font-weight: 300;
    line-height: 1;
    letter-spacing: -0.03em;
}

/* Shared label + sub */
.vm-mc-label {
    font-size: 0.9375rem;
    color: var(--vm-muted);
    font-weight: 400;
}
.vm-mc-sub {
    font-size: 0.8125rem;
    color: var(--vm-muted);
    font-weight: 400;
}

/* Sessions: 5-dot weekday chart */
.vm-mc-dots {
    display: flex;
    gap: 6px;
    margin-top: 4px;
}
.vm-mc-day {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.vm-mc-dot {
    width: 14px; height: 14px; border-radius: 50%;
    background: var(--vm-border);
    transition: background 0.2s;
}
.vm-mc-dot--on { background: var(--vm-primary); }
.vm-mc-dot--weekend { background: #e2e8f0; }
.vm-mc-dot--weekend.vm-mc-dot--on { background: #7c3aed; }
.vm-mc-day-lbl { font-size: 0.6875rem; color: var(--vm-muted); font-weight: 600; }

/* Topics: mini horizontal bars */
.vm-mc-bars {
    display: flex; flex-direction: column; gap: 4px;
    width: 100%;
    margin-top: 4px;
}
.vm-mc-bar-row {
    height: 6px;
    background: #f1f5f9;
    border-radius: 3px;
    overflow: hidden;
    width: 100%;
}
.vm-mc-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s ease;
}

/* legacy class kept for any stray references */
.vm-child-panel-action-link {
    font-size: 0.9375rem; color: var(--vm-muted); background: none;
    border: none; cursor: pointer; font-family: inherit; padding: 0;
}
.vm-child-panel-action-link:hover { color: var(--vm-text); }

/* keep grid class for any other pages that might reference it */
.vm-profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: var(--vm-s-4) var(--vm-s-3);
}

.vm-profile-card {
    background: transparent;
    border: none;
    padding: 0;
    min-height: unset;
    text-align: center;
    cursor: pointer;
    transition: transform 0.12s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) {
    .vm-profile-card:hover { transform: translateY(-3px); }
}
.vm-profile-card:active { transform: scale(0.95); }

/* Circle wrapper — positions the edit pencil relative to the avatar circle */
.vm-profile-card-circle {
    position: relative;
    flex-shrink: 0;
}

.vm-profile-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: #fff;
    border: 1.5px solid var(--vm-border);
    box-shadow: 0 2px 8px rgba(20, 30, 50, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    line-height: 1;
    overflow: hidden;
    transition: box-shadow 0.15s, border-color 0.15s;
    margin-bottom: 0;
}
.vm-profile-avatar img {
    width: 76%;
    height: 76%;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
}
@media (hover: hover) {
    .vm-profile-card:hover .vm-profile-avatar {
        box-shadow: 0 6px 20px rgba(20, 30, 50, 0.14);
        border-color: var(--vm-primary);
    }
}

.vm-profile-name {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--vm-text);
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    text-align: center;
}

.vm-profile-edit-btn {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 26px;
    height: 26px;
    background: #fff;
    border: 1px solid var(--vm-border);
    padding: 0;
    cursor: pointer;
    color: var(--vm-muted);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s, color 0.15s, box-shadow 0.15s;
    -webkit-tap-highlight-color: transparent;
    min-height: unset;
    box-shadow: 0 1px 4px rgba(20, 30, 50, 0.12);
}
/* Desktop: pencil fades in on hover */
@media (hover: hover) {
    .vm-profile-edit-btn { opacity: 0; }
    .vm-profile-card:hover .vm-profile-edit-btn { opacity: 1; color: var(--vm-primary); }
}
/* Touch: pencil hidden — edit via child detail page */
@media (hover: none) {
    .vm-profile-edit-btn { display: none; }
}
.vm-profile-card--readonly .vm-profile-edit-btn { display: none; }

@media (min-width: 640px) {
    .vm-profile-avatar { width: 112px; height: 112px; font-size: 3rem; }
    .vm-profile-name { font-size: 0.9375rem; }
    .vm-profile-grid { gap: var(--vm-s-5) var(--vm-s-4); }
}

.vm-profile-card--readonly {
    opacity: 0.5;
    cursor: default;
    pointer-events: none;
}

.vm-add--locked {
    opacity: 1;
    pointer-events: auto;
    cursor: pointer;
    color: var(--vm-muted);
}
.vm-add--locked:hover { color: var(--vm-danger); border-color: var(--vm-danger); }

.vm-add--standalone {
    width: 200px;
    min-height: 180px;
    margin-top: var(--vm-s-4);
    font-size: 1.125rem;
    font-weight: 500;
}
.vm-add--standalone .vm-profile-avatar {
    font-size: 2.5rem;
    margin-bottom: var(--vm-s-3);
}

/* ---------------- Footer ---------------- */

.vm-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--vm-s-4) var(--vm-s-5);
    border-top: 1px solid var(--vm-border);
    font-size: 0.8125rem;
    color: var(--vm-muted);
    flex-wrap: nowrap;
    gap: var(--vm-s-3);
    white-space: nowrap;
}
.vm-footer-links {
    display: flex;
    gap: var(--vm-s-4);
}
.vm-footer-links a {
    color: var(--vm-muted);
    text-decoration: none;
}
.vm-footer-links a:hover { color: var(--vm-text); }
@media (max-width: 479px) {
    .vm-footer { font-size: 0.75rem; padding: var(--vm-s-3) var(--vm-s-4); }
    .vm-footer-links { gap: var(--vm-s-3); }
    .vm-footer-rights { display: none; }
}

/* ---------------- Child detail page ---------------- */

.vm-child-detail {
    width: 100%;
    max-width: 640px;
    display: flex;
    flex-direction: column;
    gap: var(--vm-s-5);
}

.vm-child-detail-back { display: none; } /* replaced by vm-back-nav */

/* ── Back navigation — used on all inner pages ── */
/* ── Unified back button (nav bar placement) ───────────────────────────── */
.vm-nav-back {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 36px;
    padding: 0 14px 0 10px;
    border-radius: 99px;
    border: 1.5px solid var(--vm-border);
    background: var(--vm-surface);
    color: var(--vm-muted);
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: color 0.12s, border-color 0.12s, background 0.12s;
    -webkit-tap-highlight-color: transparent;
}
.vm-nav-back:hover {
    color: var(--vm-text);
    border-color: var(--vm-border);
    background: var(--vm-surface-2);
    text-decoration: none;
}

/* Legacy aliases — kept for auth-split content areas */
.vm-back-nav {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--vm-muted);
    text-decoration: none;
    padding: 4px 0;
    border: none;
    background: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.12s;
}
.vm-back-nav:hover { color: var(--vm-text); }
.vm-back-nav svg { flex-shrink: 0; }

.vm-child-detail-hero {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--vm-s-2);
}

.vm-child-detail-avatar-wrap {
    font-size: 4rem;
    line-height: 1;
    width: 96px;
    height: 96px;
    background: var(--vm-surface-2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--vm-s-1);
}

.vm-child-detail-name {
    font-size: clamp(1.75rem, 1.5rem + 1vw, 2.25rem);
    font-weight: 600;
    margin: 0;
    line-height: 1.1;
}

.vm-child-detail-meta {
    display: flex;
    align-items: center;
    gap: var(--vm-s-2);
    font-size: 0.9375rem;
    color: var(--vm-muted);
}

.vm-child-detail-dot { color: var(--vm-border); }

.vm-child-detail-edit-link {
    background: none;
    border: none;
    color: var(--vm-primary);
    font-size: 0.9375rem;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
}
.vm-child-detail-edit-link:hover { text-decoration: underline; }

/* Resume session banner */
.vm-resume-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #eef2ff;
    border: 1.5px solid var(--vm-primary);
    border-radius: var(--vm-radius);
    padding: 14px 16px;
}
.vm-resume-banner-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.vm-resume-banner-title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--vm-primary);
}
.vm-resume-banner-sub {
    font-size: 0.8125rem;
    color: var(--vm-muted);
}
.vm-resume-banner-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.vm-child-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--vm-s-4);
}

@media (max-width: 480px) {
    .vm-child-actions { grid-template-columns: 1fr; }
}

/* ── Recommended focus card ──────────────────────────────────────────── */
.vm-reco-card {
    background: var(--vm-surface);
    border: 1px solid var(--vm-border);
    border-left: 4px solid var(--vm-primary);
    border-radius: var(--vm-radius);
    padding: var(--vm-s-5);
    margin-bottom: var(--vm-s-4);
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.vm-reco-head { display: flex; align-items: flex-start; gap: 12px; }
.vm-reco-emoji { font-size: 1.5rem; line-height: 1; }
.vm-reco-title { font-size: 1.0625rem; font-weight: 600; margin: 0; }
.vm-reco-sub { font-size: 0.875rem; color: var(--vm-muted); margin: 2px 0 0; }
.vm-reco-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.vm-reco-chip {
    font-size: 0.8125rem;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--vm-border);
    background: #fff;
    color: var(--vm-text, #1f2937);
}

/* ── Skill map ───────────────────────────────────────────────────────── */
.vm-skillmap-hint {
    font-size: 0.875rem;
    color: var(--vm-muted);
    margin: 0 0 12px;
}
.vm-skillmap {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: var(--vm-s-2);
}
.vm-skill-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
    padding: 12px 6px;
    background: none;
    border: none;
    border-radius: var(--vm-radius);
    cursor: pointer;
    transition: background 0.12s ease;
}
.vm-skill-tile:hover { background: var(--vm-surface-2); }
.vm-skill-tile-name {
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.25;
    color: var(--vm-text);
}
.vm-skill-tile-level {
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    color: var(--vm-muted);
}

/* ── Skill-map donut (reuses the practice topic-path ring) ────────────── */
.vm-skill-donut {
    --vm-donut-ring: #2f9e44;       /* progress arc: always green */
    --vm-donut-track: #cfe6fb;      /* perimeter: one calm light blue */
    position: relative;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}
.vm-skill-donut-ring {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    overflow: visible;
}
.vm-skill-donut-hub { fill: var(--vm-surface); }
.vm-skill-donut-track { stroke: var(--vm-donut-track); }
.vm-skill-donut-fill {
    stroke: var(--vm-donut-ring);
    transition: stroke-dashoffset 0.5s ease;
}
.vm-skill-donut-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    color: var(--vm-text);
    pointer-events: none;
}

.vm-child-action-card {
    background: var(--vm-surface);
    border: 1px solid var(--vm-border);
    border-radius: var(--vm-radius);
    padding: var(--vm-s-5);
    display: flex;
    flex-direction: column;
    gap: var(--vm-s-2);
    min-height: 0;
}

.vm-child-action-card--primary {
    border-color: var(--vm-primary);
    background: #f0f4ff;
}

.vm-child-action-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--vm-radius-sm);
    background: var(--vm-surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--vm-muted);
    margin-bottom: var(--vm-s-1);
}

.vm-child-action-icon--primary {
    background: #dce8ff;
    color: var(--vm-primary);
}

.vm-child-action-card--car {
    background: #0f1923;
    border-color: #1e3a4a;
    color: #fff;
}
.vm-child-action-card--car .vm-child-action-title { color: #fff; }
.vm-child-action-card--car .vm-child-action-desc  { color: rgba(255,255,255,0.55); }

.vm-child-action-icon--car {
    background: rgba(255,255,255,0.08);
    color: #4ade80;
}

.vm-btn-car {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #1f9c5b;
    color: #fff;
    border: none;
    border-radius: var(--vm-radius-sm);
    padding: 10px 18px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    min-height: var(--vm-tap);
    transition: opacity 0.15s;
}
.vm-btn-car:hover { opacity: 0.88; }

.vm-child-action-title {
    font-size: 1.0625rem;
    font-weight: 600;
    margin: 0;
}

.vm-child-action-desc {
    font-size: 0.875rem;
    color: var(--vm-muted);
    margin: 0;
    line-height: 1.5;
    flex: 1;
}

/* ---------------- Add child — grade pills & avatar grid ---------------- */

.vm-grade-pills {
    display: flex;
    gap: var(--vm-s-1);
    flex-wrap: wrap;
}
.vm-grade-pill {
    flex: 1 1 calc(25% - var(--vm-s-1));
    min-width: 64px;
    padding: 8px 4px;
    border: 1.5px solid var(--vm-border);
    border-radius: 99px;
    background: var(--vm-surface);
    color: var(--vm-text);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    min-height: var(--vm-tap);
    transition: border-color 0.12s, background 0.12s, color 0.12s;
    -webkit-tap-highlight-color: transparent;
}
.vm-grade-pill:hover { border-color: var(--vm-primary); color: var(--vm-primary); }
.vm-grade-pill--active {
    background: var(--vm-primary);
    border-color: var(--vm-primary);
    color: #fff;
}

.vm-avatar-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: var(--vm-s-2);
}
.vm-avatar-option {
    aspect-ratio: 1;
    border: 2.5px solid transparent;
    border-radius: 50%;
    background: none; /* overridden inline per avatar */
    padding: 0;
    cursor: pointer;
    transition: border-color 0.12s, transform 0.12s, box-shadow 0.12s;
    -webkit-tap-highlight-color: transparent;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.vm-avatar-option img {
    width: 76%;
    height: 76%;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
}
.vm-avatar-option:hover { transform: scale(1.08); box-shadow: 0 0 0 2px rgba(41,98,255,0.25); }
.vm-avatar-option--active {
    border-color: var(--vm-primary);
    transform: scale(1.08);
    box-shadow: 0 0 0 3px rgba(41,98,255,0.18);
}

/* Learner avatar picker (ChildDetail) */
.vm-learner-avatar-picker {
    background: var(--vm-surface);
    border: 1px solid var(--vm-border);
    border-radius: 16px;
    padding: var(--vm-s-4);
    margin-bottom: var(--vm-s-4);
}
.vm-learner-avatar-picker-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--vm-muted);
    margin: 0 0 12px;
    text-align: center;
}

/* ---------------- Add child — right panel preview ---------------- */

.vm-child-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--vm-s-4);
    text-align: center;
}
.vm-child-preview-eyebrow {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--vm-muted);
    margin: 0;
}
.vm-child-preview-card {
    background: var(--vm-surface);
    border: 1px solid var(--vm-border);
    border-radius: var(--vm-radius);
    padding: var(--vm-s-6);
    box-shadow: var(--vm-shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--vm-s-2);
    min-width: 180px;
    position: relative;
}
.vm-child-preview-grade-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--vm-surface-2);
    border: 1px solid var(--vm-border);
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--vm-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: -0.01em;
}
.vm-child-preview-avatar {
    width: 96px;
    height: 96px;
    font-size: 4rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.vm-child-preview-avatar img {
    width: 76%;
    height: 76%;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
}
.vm-child-preview-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--vm-text);
    min-height: 1.5em;
}
.vm-child-preview-hint {
    font-size: 0.8125rem;
    color: var(--vm-muted);
    margin: 0;
    max-width: 220px;
    line-height: 1.5;
}

/* ---------------- Trial banner ---------------- */

.vm-trial-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--vm-s-4);
    padding: var(--vm-s-3) var(--vm-s-4);
    border-radius: var(--vm-radius-sm);
    margin-bottom: var(--vm-s-5);
    flex-wrap: wrap;
}
.vm-trial-banner--expired {
    background: #fff2f2;
    border: 1px solid #f5c6c6;
}
.vm-trial-banner--warning {
    background: #fffbea;
    border: 1px solid #ffe066;
}
.vm-trial-banner-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.875rem;
    line-height: 1.4;
}
.vm-trial-banner-text strong {
    font-size: 0.9375rem;
    color: var(--vm-text);
}
.vm-trial-banner-text span {
    color: var(--vm-muted);
}
.vm-trial-banner-actions {
    display: flex;
    align-items: center;
    gap: var(--vm-s-2);
    flex-shrink: 0;
    flex-wrap: wrap;
}
.vm-btn-sm {
    font-size: 0.8125rem;
    padding: 6px 14px;
    min-height: 34px;
}
.vm-trial-save {
    display: inline-block;
    background: #dcfce7;
    color: #15803d;
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 99px;
    margin-left: 4px;
    vertical-align: middle;
    letter-spacing: 0.02em;
}

/* ---------------- Auth split layout (login / signup) ---------------- */

.vm-auth-split {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
}

/* Left panel — form */
.vm-auth-left {
    display: flex;
    flex-direction: column;
    width: 100%;
    background: var(--vm-surface);
    padding: var(--vm-s-5) var(--vm-s-5) max(var(--vm-s-5), env(safe-area-inset-bottom));
}
.vm-auth-left-logo { flex-shrink: 0; margin-bottom: var(--vm-s-2); }
.vm-auth-left-logo img { height: 28px; }
.vm-auth-left-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
    max-width: 360px;
    margin: 0 auto;
    padding: var(--vm-s-5) 0;
}
.vm-auth-left-body h1 { font-size: 1.625rem; margin: 0 0 var(--vm-s-1); line-height: 1.2; }

/* Family hero — floating pastel circles, no box */
.vm-family-hero {
    position: relative;
    overflow: visible;
    padding: 100px 0 4px;
    margin-bottom: var(--vm-s-5);
}
.vm-family-hero-circles {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.vm-fhc {
    position: absolute;
    border-radius: 50%;
    opacity: 0.3;
}
.vm-fhc--1 { width: 200px; height: 200px; background: #9dd4f5; top: -30px; left: -60px; }
.vm-fhc--2 { width: 180px; height: 180px; background: #fac9a4; top: -15px; left: 50px; }
.vm-fhc--3 { width: 190px; height: 190px; background: #a8e6bb; top: -40px; left: 130px; }
.vm-fhc--4 { width: 175px; height: 175px; background: #b8c2f0; top: -20px; right: -20px; }
.vm-fhc--5 { width: 160px; height: 160px; background: #f2b8d0; top:  20px; left: 90px; }

/* Mobile: shrink hero + circles so the full form fits without scrolling */
@media (max-width: 767px) {
    .vm-auth-left {
        padding: var(--vm-s-4) var(--vm-s-5) max(var(--vm-s-4), env(safe-area-inset-bottom));
    }
    .vm-auth-left-body { padding: var(--vm-s-3) 0; }
    .vm-family-hero { padding-top: 68px; margin-bottom: var(--vm-s-4); }
    .vm-fhc--1 { width: 155px; height: 155px; }
    .vm-fhc--2 { width: 140px; height: 140px; }
    .vm-fhc--3 { width: 148px; height: 148px; top: -30px; left: 100px; }
    .vm-fhc--4 { width: 140px; height: 140px; right: -15px; }
    .vm-fhc--5 { width: 125px; height: 125px; top: 14px; left: 65px; }
    .vm-field { margin-bottom: var(--vm-s-2); }
}

.vm-family-hero-content {
    position: relative;
    z-index: 1;
}
.vm-family-hero h1 {
    margin: 0 0 var(--vm-s-1);
    font-size: clamp(1.1rem, 5.2vw, 1.5rem);
    line-height: 1.2;
    color: var(--vm-text);
    white-space: nowrap;
}
.vm-family-hero p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--vm-muted);
}
.vm-family-hero p span {
    color: var(--vm-primary);
    font-weight: 600;
}
.vm-auth-left-body .vm-sub { color: var(--vm-muted); font-size: 0.875rem; margin: 0 0 var(--vm-s-5); }

/* Parent | Student segmented toggle (login / child-login) */
.vm-auth-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    padding: 4px;
    background: var(--vm-surface-2);
    border: 1px solid var(--vm-border);
    border-radius: 99px;
    margin: 0 0 var(--vm-s-5);
}
.vm-auth-toggle-opt {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    border-radius: 99px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--vm-muted);
    text-decoration: none;
    transition: color 0.12s, background 0.12s, box-shadow 0.12s;
    -webkit-tap-highlight-color: transparent;
}
.vm-auth-toggle-opt:hover { color: var(--vm-text); text-decoration: none; }
.vm-auth-toggle-opt--active {
    background: var(--vm-surface);
    color: var(--vm-primary);
    box-shadow: 0 1px 4px rgba(20, 30, 50, 0.10);
}
.vm-auth-toggle-opt--active:hover { color: var(--vm-primary); }

.vm-auth-left-footer {
    flex-shrink: 0;
    font-size: 0.75rem;
    color: var(--vm-muted);
    line-height: 1.5;
    max-width: 360px;
    margin: 0 auto;
    width: 100%;
}
.vm-auth-left-footer a { color: var(--vm-muted); text-decoration: underline; }
.vm-auth-left-footer a:hover { color: var(--vm-text); }

/* Right panel — quote, hidden on mobile */
.vm-auth-right {
    display: none;
}

@media (min-width: 768px) {
    .vm-auth-left {
        width: 460px;
        flex-shrink: 0;
        padding: var(--vm-s-6) var(--vm-s-7);
    }
    .vm-auth-left-logo img { height: 32px; }
    .vm-auth-right {
        display: flex;
        flex: 1;
        background: var(--vm-surface-2);
        align-items: center;
        justify-content: center;
        padding: var(--vm-s-8);
        border-left: 1px solid var(--vm-border);
    }
}

/* Signup right panel — feature list + quote */
.vm-signup-panel {
    display: flex;
    flex-direction: column;
    gap: var(--vm-s-6);
    max-width: 400px;
    width: 100%;
}
.vm-signup-features-eyebrow {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--vm-primary);
    margin: 0 0 var(--vm-s-3);
}
.vm-signup-features-heading {
    font-size: clamp(1.5rem, 2.2vw, 2rem);
    font-weight: 700;
    line-height: 1.2;
    color: var(--vm-text);
    margin: 0 0 var(--vm-s-5);
}
.vm-signup-feature-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--vm-s-4);
}
.vm-signup-feature-item {
    display: flex;
    align-items: center;
    gap: var(--vm-s-3);
    font-size: 0.9375rem;
    color: var(--vm-text);
    line-height: 1.4;
}
.vm-feature-check { flex-shrink: 0; }
.vm-signup-panel-rule {
    height: 1px;
    background: var(--vm-border);
}

.vm-auth-quote { max-width: 480px; }
.vm-auth-quote-mark {
    font-size: 5rem;
    line-height: 0.8;
    color: var(--vm-border);
    font-family: Georgia, serif;
    margin-bottom: var(--vm-s-4);
    display: block;
    user-select: none;
}
.vm-auth-quote-text {
    font-size: clamp(1.375rem, 1.1rem + 1.2vw, 1.875rem);
    line-height: 1.5;
    color: var(--vm-text);
    margin: 0 0 var(--vm-s-5);
    font-weight: 400;
}
.vm-auth-quote-author {
    display: flex;
    align-items: center;
    gap: var(--vm-s-3);
    font-size: 0.875rem;
    color: var(--vm-muted);
}
.vm-auth-quote-avatar {
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--vm-primary);
    color: #fff; font-weight: 700; font-size: 1rem;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

/* ---------------- Persona chips (signup) ---------------- */

.vm-persona-chips {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--vm-s-2);
    margin-bottom: var(--vm-s-5);
}
.vm-persona-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px 8px;
    min-height: 80px;
    background: var(--vm-surface-2);
    border: 2px solid var(--vm-border);
    border-radius: var(--vm-radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    color: var(--vm-muted);
    font-family: inherit;
    transition: background 0.12s, border-color 0.12s, color 0.12s;
    -webkit-tap-highlight-color: transparent;
    text-align: center;
}
.vm-persona-chip:hover { border-color: var(--vm-primary); color: var(--vm-text); }
.vm-persona-chip--active {
    background: #eef2ff;
    border-color: var(--vm-primary);
    color: var(--vm-primary);
}
.vm-persona-chip-icon { font-size: 1.625rem; line-height: 1; }

/* ---------------- Persona image cards (signup) — reserved for future use ---------------- */
.vm-persona-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--vm-s-3);
    margin-bottom: var(--vm-s-5);
}
.vm-persona-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 4px;
    border: 2px solid var(--vm-border);
    border-radius: var(--vm-radius);
    background: var(--vm-surface);
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--vm-text-muted);
    transition: border-color .15s, color .15s, background .15s;
    position: relative;
    width: 100%;
}
.vm-persona-card img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 6px;
}
.vm-persona-card:hover:not(:disabled) {
    border-color: var(--vm-primary);
    color: var(--vm-text);
}
.vm-persona-card--active {
    border-color: var(--vm-primary);
    background: #eef2ff;
    color: var(--vm-primary);
}
.vm-persona-card--disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.vm-persona-card-soon {
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 0.5625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    background: var(--vm-border);
    color: var(--vm-text-muted);
    border-radius: 4px;
    padding: 1px 3px;
    line-height: 1.4;
}

/* Larger images on wider screens */
@media (min-width: 400px) {
    .vm-persona-card img { width: 64px; height: 64px; border-radius: 8px; }
    .vm-persona-card { font-size: 0.8125rem; padding: 10px 6px; }
}

.vm-persona-card-wrap {
    position: relative;
}

/* Info button — visually 18px, tap target 44px via ::before */
.vm-persona-info-btn {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1.5px solid var(--vm-border);
    background: var(--vm-surface);
    color: var(--vm-text-muted);
    font-size: 0.625rem;
    font-style: italic;
    font-family: Georgia, serif;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color .15s, color .15s;
    z-index: 1;
}
.vm-persona-info-btn::before {
    content: '';
    position: absolute;
    inset: -13px; /* expands hit area to 44px without changing visuals */
}
.vm-persona-info-btn:hover {
    border-color: var(--vm-primary);
    color: var(--vm-primary);
}

/* Tooltip — appears below the card, anchored to avoid screen edge overflow */
.vm-persona-tip {
    position: absolute;
    top: calc(100% + 8px);
    width: 160px;
    background: var(--vm-text);
    color: var(--vm-surface);
    font-size: 0.75rem;
    line-height: 1.45;
    padding: 8px 10px;
    border-radius: 8px;
    z-index: 10;
    pointer-events: none;
    text-align: left;
}
/* Middle card: centered */
.vm-persona-card-wrap:nth-child(2) .vm-persona-tip {
    left: 50%;
    transform: translateX(-50%);
}
/* First card: anchor to left edge so it doesn't bleed off screen */
.vm-persona-card-wrap:first-child .vm-persona-tip {
    left: 0;
}
/* Last card: anchor to right edge */
.vm-persona-card-wrap:last-child .vm-persona-tip {
    right: 0;
}

/* Arrow pointing up from the tooltip */
.vm-persona-tip::after {
    content: '';
    position: absolute;
    bottom: 100%;
    border: 5px solid transparent;
    border-bottom-color: var(--vm-text);
}
.vm-persona-card-wrap:nth-child(2) .vm-persona-tip::after {
    left: 50%;
    transform: translateX(-50%);
}
.vm-persona-card-wrap:first-child .vm-persona-tip::after {
    left: 20px;
}
.vm-persona-card-wrap:last-child .vm-persona-tip::after {
    right: 20px;
}

/* ---------------- Dialog (modal) ---------------- */

dialog {
    border: 1px solid var(--vm-border);
    border-radius: var(--vm-radius);
    padding: 0;
    max-width: 420px;
    width: calc(100% - 32px);
    box-shadow: var(--vm-shadow);
    background: var(--vm-surface);
    color: inherit;
}
dialog::backdrop {
    background: rgba(20, 30, 50, 0.4);
    backdrop-filter: blur(2px);
}

/* ---------------- NavHamburger ---------------- */

.vm-nav-hamburger {
    /* No position: relative — mobile panel anchors to vm-nav instead */
    display: contents; /* wrapper has no visual box */
}

/* Desktop actions: hidden on mobile, flex on desktop */
.vm-nav-desktop {
    display: none;
    align-items: center;
    gap: var(--vm-s-2);
}
@media (min-width: 768px) {
    .vm-nav-desktop { display: flex; }
}

/* Avatar button (desktop dropdown trigger) */
.vm-avatar-btn {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--vm-primary); color: #fff;
    border: none; cursor: pointer; font-weight: 700; font-size: 15px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}
.vm-avatar-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(41,98,255,0.35); }
.vm-avatar-btn--illustrated { background: #fff; overflow: hidden; padding: 0; }
.vm-avatar-btn--illustrated:focus-visible { box-shadow: 0 0 0 3px rgba(41,98,255,0.35); }

/* Desktop dropdown */
.vm-avatar-dropdown {
    position: absolute; right: 0; top: calc(100% + 8px);
    background: var(--vm-surface); border: 1px solid var(--vm-border);
    border-radius: var(--vm-radius-sm); box-shadow: var(--vm-shadow);
    min-width: 220px; z-index: 100; overflow: hidden;
}
.vm-avatar-dropdown-header {
    padding: 12px 16px; border-bottom: 1px solid var(--vm-border);
}
.vm-avatar-dropdown-item {
    display: block; width: 100%; padding: 10px 16px;
    text-align: left; font-size: 14px; color: var(--vm-text);
    background: none; border: none; cursor: pointer;
    font-family: inherit; text-decoration: none;
    transition: background 0.1s;
}
.vm-avatar-dropdown-item:hover { background: var(--vm-surface-2); }
.vm-avatar-dropdown-item--danger {
    color: var(--vm-danger);
    border-top: 1px solid var(--vm-border);
}

/* Desktop Help dropdown (left of avatar) */
.vm-nav-help { position: relative; }
.vm-nav-help-trigger {
    display: inline-flex; align-items: center; gap: 6px;
}
.vm-nav-help-caret {
    width: 0; height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
    transition: transform 0.15s ease;
}
.vm-nav-help-caret--open { transform: rotate(180deg); }
.vm-nav-help-dropdown {
    position: absolute; left: 0; top: calc(100% + 8px);
    background: var(--vm-surface); border: 1px solid var(--vm-border);
    border-radius: var(--vm-radius-sm); box-shadow: var(--vm-shadow);
    min-width: 200px; z-index: 100; overflow: hidden;
}
.vm-nav-help-item {
    display: block; width: 100%; padding: 10px 16px;
    text-align: left; font-size: 14px; color: var(--vm-text);
    background: none; border: none; cursor: pointer;
    font-family: inherit; text-decoration: none;
    transition: background 0.1s;
}
.vm-nav-help-item:hover { background: var(--vm-surface-2); }

/* Section label inside mobile panel (e.g. "Help") */
.vm-mobile-panel-label {
    padding: 12px var(--vm-s-4) 4px;
    font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em;
    text-transform: uppercase; color: var(--vm-muted);
    border-top: 1px solid var(--vm-border);
}
.vm-mobile-panel-item--sub { padding-left: calc(var(--vm-s-4) + 12px); }

/* Pricing page — Khanmigo-style hero + plan cards */
.vm-pricing-page {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: var(--vm-s-6) var(--vm-s-4);
}
.vm-pricing-h1 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 var(--vm-s-2);
    color: var(--vm-text);
}
.vm-pricing-lead {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--vm-muted);
    margin: 0 0 var(--vm-s-5);
    max-width: 52ch;
}

/* Green free-trial hero */
.vm-pricing-hero {
    background: #c8f2d4;
    border-radius: 20px;
    padding: clamp(24px, 4vw, 48px);
    display: grid;
    grid-template-columns: 1fr;
    gap: 28px;
    margin-bottom: var(--vm-s-5);
}
@media (min-width: 760px) {
    .vm-pricing-hero { grid-template-columns: 1fr 1fr; gap: 48px; }
}
.vm-pricing-hero-left { display: flex; flex-direction: column; }
.vm-pricing-hero-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: #14532d;
    margin-bottom: 10px;
}
.vm-pricing-hero-title {
    font-size: clamp(1.8rem, 3.6vw, 2.6rem);
    font-weight: 500;
    line-height: 1.12;
    margin: 0;
    color: #0b2e16;
}
.vm-pricing-hero-note {
    margin: 24px 0 0;
    font-size: 1rem;
    line-height: 1.55;
    color: #14532d;
    max-width: 34ch;
}
@media (min-width: 760px) {
    .vm-pricing-hero-note { margin-top: auto; padding-top: 32px; }
}
.vm-pricing-hero-right {
    display: flex;
    flex-direction: column;
    gap: 24px;
    justify-content: center;
}
.vm-pricing-checklist {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 14px;
}
.vm-pricing-checklist li {
    position: relative;
    padding-left: 30px;
    font-size: 0.98rem;
    line-height: 1.45;
    color: #0b2e16;
}
.vm-pricing-checklist li::before {
    content: "\2713";
    position: absolute;
    left: 0;
    top: 0;
    font-weight: 700;
    color: #15803d;
}
.vm-pricing-hero-cta {
    align-self: stretch;
    background: var(--vm-primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 16px 24px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: filter 0.15s;
}
.vm-pricing-hero-cta:hover { filter: brightness(0.94); }
.vm-pricing-hero-cta:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(41,98,255,0.35); }

/* Blue plan cards */
.vm-pricing-plans {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--vm-s-4);
    margin-bottom: var(--vm-s-5);
}
@media (min-width: 640px) {
    .vm-pricing-plans { grid-template-columns: 1fr 1fr; }
}
.vm-pricing-plan {
    position: relative;
    background: #d4eafd;
    border-radius: 20px;
    padding: clamp(28px, 4vw, 44px) 24px;
    text-align: center;
}
.vm-pricing-plan-name {
    font-size: 1.05rem;
    font-weight: 600;
    color: #102a43;
}
.vm-pricing-plan-price {
    font-size: clamp(2.2rem, 6vw, 3rem);
    font-weight: 500;
    line-height: 1;
    color: #0a2540;
    margin: 12px 0 8px;
}
.vm-pricing-plan-price span {
    font-size: 1rem;
    font-weight: 500;
    color: #243b53;
}
.vm-pricing-plan-sub {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    font-size: 1rem;
    color: #243b53;
}
.vm-pricing-plan-badge {
    background: var(--vm-primary);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 4px 10px;
    border-radius: 999px;
    white-space: nowrap;
}

.vm-pricing-cta-row { text-align: center; margin: 0 0 var(--vm-s-5); }
.vm-pricing-foot {
    text-align: center;
    font-size: 0.9rem;
    color: var(--vm-muted);
    margin: 0;
}
.vm-pricing-foot a { color: var(--vm-primary); text-decoration: underline; }
.vm-pricing-foot a:hover { opacity: 0.8; }

/* ─── Help / info pages (FAQ, About, Disclaimer, Getting Started, Blog,
   Contact) — pricing-style layout: wide page, green hero, content card ─── */
.vm-help-page {
    width: 100%;
    max-width: 880px;
    margin: 0 auto;
    padding: var(--vm-s-6) var(--vm-s-4);
}
.vm-help-hero {
    background: #c8f2d4;
    border-radius: 20px;
    padding: clamp(28px, 4vw, 44px);
    margin-bottom: var(--vm-s-5);
}
.vm-help-hero-title {
    font-size: clamp(1.7rem, 3.4vw, 2.4rem);
    font-weight: 500;
    line-height: 1.12;
    margin: 0;
    color: #0b2e16;
}
.vm-help-hero-meta {
    margin: 12px 0 0;
    font-size: 1rem;
    line-height: 1.5;
    color: #14532d;
    max-width: 52ch;
}

.vm-help-body {
    background: var(--vm-surface);
    border: 1px solid var(--vm-border);
    border-radius: 20px;
    padding: clamp(24px, 4vw, 40px);
}
.vm-help-body > h2 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--vm-text);
    margin: var(--vm-s-5) 0 var(--vm-s-2);
}
.vm-help-body > h2:first-child,
.vm-help-body > p:first-child {
    margin-top: 0;
}
.vm-help-body > h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--vm-text);
    margin: var(--vm-s-4) 0 var(--vm-s-1);
}
.vm-help-body > p,
.vm-help-body li {
    font-size: 0.98rem;
    line-height: 1.7;
    color: var(--vm-text);
    margin: 0 0 var(--vm-s-3);
}
.vm-help-body ul {
    padding-left: var(--vm-s-5);
    margin: 0 0 var(--vm-s-3);
    display: grid;
    gap: 6px;
}
.vm-help-body a {
    color: var(--vm-primary);
    text-decoration: underline;
}
.vm-help-body a:hover { opacity: 0.8; }

.vm-help-note {
    margin: var(--vm-s-4) 0 0;
    padding-top: var(--vm-s-4);
    border-top: 1px solid var(--vm-border);
    font-size: 0.95rem;
    color: var(--vm-muted);
}
.vm-help-note a { color: var(--vm-primary); text-decoration: underline; }
.vm-help-note a:hover { opacity: 0.8; }

/* FAQ accordion — native <details>/<summary> */
.vm-faq-list {
    display: grid;
    gap: 12px;
}
.vm-faq-item {
    border: 1px solid var(--vm-border);
    border-radius: 14px;
    background: var(--vm-surface);
    overflow: hidden;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.vm-faq-item[open] {
    border-color: var(--vm-primary);
    box-shadow: 0 1px 4px rgba(20,30,50,0.06);
}
.vm-faq-q {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    font-size: 1.02rem;
    font-weight: 500;
    color: var(--vm-text);
    cursor: pointer;
    list-style: none;
    -webkit-tap-highlight-color: transparent;
}
.vm-faq-q::-webkit-details-marker { display: none; }
.vm-faq-q:focus-visible { outline: none; box-shadow: inset 0 0 0 2px rgba(41,98,255,0.4); border-radius: 14px; }
.vm-faq-chevron {
    flex-shrink: 0;
    color: var(--vm-muted);
    transition: transform 0.2s ease;
}
.vm-faq-item[open] .vm-faq-chevron {
    transform: rotate(180deg);
    color: var(--vm-primary);
}
.vm-faq-a {
    margin: 0;
    padding: 0 20px 20px;
    font-size: 0.96rem;
    line-height: 1.65;
    color: var(--vm-muted);
}

/* Hamburger button: visible on mobile, hidden on desktop */
.vm-hamburger-btn {
    display: flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; padding: 0;
    background: none; border: none; cursor: pointer;
    border-radius: var(--vm-radius-sm);
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
}
.vm-hamburger-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(41,98,255,0.35); }
.vm-hamburger-btn:hover { background: var(--vm-surface-2); }
@media (min-width: 768px) {
    .vm-hamburger-btn { display: none; }
}

/* Three-line icon → X when open */
.vm-hamburger-icon {
    display: flex; flex-direction: column; gap: 5px;
    width: 22px;
}
.vm-hamburger-icon span {
    display: block; height: 2px; border-radius: 2px;
    background: var(--vm-text); transition: transform 0.2s, opacity 0.2s;
    transform-origin: center;
}
.vm-hamburger-icon--open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.vm-hamburger-icon--open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.vm-hamburger-icon--open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile slide-down panel: positions below vm-nav */
.vm-mobile-panel {
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--vm-surface); border-bottom: 1px solid var(--vm-border);
    box-shadow: 0 8px 24px rgba(20,30,50,0.1);
    z-index: 200;
    animation: vm-panel-in 0.15s ease-out;
    /* panel only exists on mobile */
}
@keyframes vm-panel-in {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}
@media (min-width: 768px) {
    .vm-mobile-panel { display: none; }
}

/* User header inside mobile panel */
.vm-mobile-panel-user {
    display: flex; align-items: center; gap: 12px;
    padding: 16px var(--vm-s-4);
    border-bottom: 1px solid var(--vm-border);
}

/* Individual item inside mobile panel */
.vm-mobile-panel-item {
    display: block; width: 100%; padding: 14px var(--vm-s-4);
    text-align: left; font-size: 1rem; font-weight: 500;
    color: var(--vm-text); background: none; border: none;
    border-top: 1px solid var(--vm-border); cursor: pointer;
    font-family: inherit; text-decoration: none;
    min-height: var(--vm-tap); /* WCAG touch target */
    transition: background 0.1s;
    -webkit-tap-highlight-color: transparent;
}
.vm-mobile-panel-item:first-child { border-top: none; }
.vm-mobile-panel-item:hover, .vm-mobile-panel-item:active { background: var(--vm-surface-2); }
.vm-mobile-panel-item--danger { color: var(--vm-danger); }


/* ─── Legal pages (Terms / Privacy) ─────────────────────────────────────── */
.vm-legal-doc {
    max-width: 720px;
    margin: 0 auto;
    padding: var(--vm-s-6) var(--vm-s-4);
}
.vm-legal-doc h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: var(--vm-s-2);
    color: var(--vm-text);
}
.vm-legal-meta {
    font-size: 0.85rem;
    color: var(--vm-text-muted, #888);
    margin-bottom: var(--vm-s-5);
    border-bottom: 1px solid var(--vm-border);
    padding-bottom: var(--vm-s-3);
}
.vm-legal-doc h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: var(--vm-s-5);
    margin-bottom: var(--vm-s-2);
    color: var(--vm-text);
}
.vm-legal-doc h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-top: var(--vm-s-4);
    margin-bottom: var(--vm-s-1);
    color: var(--vm-text);
}
.vm-legal-doc p,
.vm-legal-doc li {
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--vm-text);
    margin-bottom: var(--vm-s-2);
}
.vm-legal-doc ul {
    padding-left: var(--vm-s-5);
    margin-bottom: var(--vm-s-3);
}
.vm-legal-doc a {
    color: var(--vm-primary);
    text-decoration: underline;
}
.vm-legal-doc a:hover { opacity: 0.8; }
@media (min-width: 640px) {
    .vm-legal-doc { padding: var(--vm-s-7) var(--vm-s-5); }
    .vm-legal-doc h1 { font-size: 2rem; }
}

/* ─── COPPA consent checkbox (AddChild) ─────────────────────────────────── */
.vm-consent-field {
    margin-top: var(--vm-s-4);
    margin-bottom: var(--vm-s-2);
}
.vm-consent-label {
    display: flex;
    align-items: flex-start;
    gap: var(--vm-s-3);
    cursor: pointer;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--vm-text);
    padding: 10px 12px;
    background: var(--vm-surface-2);
    border: 1px solid var(--vm-border);
    border-radius: var(--vm-radius-sm);
}
.vm-consent-label input[type="checkbox"] {
    margin-top: 2px;
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    accent-color: var(--vm-primary);
    cursor: pointer;
}
.vm-consent-label a { color: var(--vm-primary); text-decoration: underline; }

/* ─── Child login setup (EditChild) ─────────────────────────────────────── */
.vm-child-login-setup {
    margin-top: var(--vm-s-6);
    padding-top: var(--vm-s-5);
    border-top: 1px solid var(--vm-border);
}
.vm-child-login-setup h2 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 var(--vm-s-2);
}
.vm-child-login-setup .vm-sub {
    margin-bottom: var(--vm-s-4);
}
.vm-field-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--vm-muted);
    margin-top: var(--vm-s-1);
}

/* ── PIN keypad ──────────────────────────────────────────────────────────── */

.vm-pin-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.vm-pin-keypad-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px 4px 8px;
    border-radius: 20px;
    border: 1.5px solid var(--vm-border);
    background: transparent;
    color: var(--vm-muted);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
    white-space: nowrap;
    line-height: 1;
}

.vm-pin-keypad-toggle:hover {
    border-color: var(--vm-primary);
    color: var(--vm-primary);
}

.vm-pin-keypad-toggle--active {
    background: var(--vm-primary);
    border-color: var(--vm-primary);
    color: #fff;
}

.vm-pin-keypad-container {
    background: var(--vm-surface-2);
    border: 1.5px solid var(--vm-border);
    border-radius: var(--vm-radius);
    padding: 20px 16px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.vm-pin-dots {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.vm-pin-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid var(--vm-border);
    background: transparent;
    transition: background 0.15s, border-color 0.15s, transform 0.15s;
}

.vm-pin-dot--filled {
    background: var(--vm-primary);
    border-color: var(--vm-primary);
    transform: scale(1.25);
}

.vm-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    width: 100%;
    max-width: 252px;
}

.vm-keypad-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    min-height: 56px;
    border-radius: 50%;
    border: 2px solid var(--vm-border);
    background: var(--vm-surface);
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--vm-text);
    cursor: pointer;
    transition: background 0.1s, border-color 0.1s, color 0.1s, transform 0.1s, box-shadow 0.1s;
    box-shadow: 0 2px 6px rgba(20, 30, 50, 0.08);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.vm-keypad-btn:hover {
    border-color: var(--vm-primary);
    color: var(--vm-primary);
    box-shadow: 0 2px 12px rgba(41, 98, 255, 0.18);
}

.vm-keypad-btn:active {
    transform: scale(0.88);
    background: var(--vm-primary);
    border-color: var(--vm-primary);
    color: #fff;
    box-shadow: none;
}

.vm-keypad-empty {
    /* empty bottom-left slot */
}

.vm-keypad-btn--del {
    border-color: var(--vm-danger);
    color: var(--vm-danger);
    box-shadow: 0 2px 6px rgba(217, 54, 54, 0.1);
}

.vm-keypad-btn--del:hover {
    background: #fff0f0;
    border-color: var(--vm-danger);
    color: var(--vm-danger);
    box-shadow: 0 2px 12px rgba(217, 54, 54, 0.2);
}

.vm-keypad-btn--del:active {
    background: var(--vm-danger);
    border-color: var(--vm-danger);
    color: #fff;
}

/* ─── Danger zone / delete profile (EditChild) ──────────────────────────── */
.vm-danger-zone {
    margin-top: var(--vm-s-6);
    padding-top: var(--vm-s-4);
    border-top: 1px solid var(--vm-border);
}
.vm-btn-danger-ghost {
    background: transparent;
    color: var(--vm-danger);
    border-color: var(--vm-danger);
}
.vm-btn-danger-ghost:hover { background: #fff0f0; text-decoration: none; }
.vm-btn-danger {
    background: var(--vm-danger);
    color: #fff;
    border-color: var(--vm-danger);
}
.vm-btn-danger:hover { background: #b82e2e; text-decoration: none; }
.vm-delete-confirm {
    background: #fff5f5;
    border: 1px solid #fcc;
    border-radius: 8px;
    padding: var(--vm-s-4);
}
.vm-delete-confirm p {
    font-size: 0.875rem;
    margin: 0 0 var(--vm-s-3);
    color: var(--vm-text);
    line-height: 1.5;
}
.vm-delete-confirm-actions {
    display: flex;
    gap: var(--vm-s-3);
}
.vm-delete-confirm-actions .vm-btn { flex: 1; }

/* ─── Co-parent member list (Account page) ──────────────────────────────── */
.vm-member-list {
    display: flex;
    flex-direction: column;
    gap: var(--vm-s-2);
}
.vm-member-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--vm-surface-2);
    border-radius: var(--vm-radius-sm);
    font-size: 0.875rem;
}
.vm-member-email {
    color: var(--vm-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
.vm-member-badge {
    flex-shrink: 0;
    margin-left: var(--vm-s-3);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--vm-success);
    background: #e8f8f0;
    padding: 2px 8px;
    border-radius: 99px;
}
.vm-member-badge--pending {
    color: #92400e;
    background: #fef3c7;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Home / Landing page
   ═══════════════════════════════════════════════════════════════════════════ */

.vm-home {
    flex: 1;
    width: 100%;
    overflow-x: hidden;
    background: var(--vm-surface);
}

/* ── Shared section primitives ────────────────────────────────────────────── */

.vm-home-label {
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--vm-primary);
    margin: 0 0 var(--vm-s-3);
}

.vm-home-heading {
    font-size: clamp(1.5rem, 1.1rem + 2vw, 2.25rem);
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin: 0 0 var(--vm-s-6);
}

.vm-home-section {
    padding: var(--vm-s-8) var(--vm-s-4);
}

.vm-home-section--alt {
    background: var(--vm-surface-2);
}

.vm-home-section-inner {
    max-width: 1060px;
    margin: 0 auto;
}

.vm-home-section-inner--narrow {
    max-width: 640px;
}

/* ── Hero ─────────────────────────────────────────────────────────────────── */

.vm-home-hero {
    background: linear-gradient(150deg, #f0fdf7 0%, #ffffff 50%, #f5f8ff 100%);
    padding: var(--vm-s-7) var(--vm-s-4) var(--vm-s-8);
    text-align: center;
}

.vm-home-hero-inner {
    max-width: 780px;
    margin: 0 auto;
}

.vm-home-kicker {
    display: inline-block;
    background: rgba(31, 156, 91, 0.1);
    color: var(--vm-success);
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 4px 14px;
    border-radius: 20px;
    margin-bottom: var(--vm-s-4);
    border: 1px solid rgba(31, 156, 91, 0.2);
}

.vm-home-hero h1 {
    font-size: clamp(2.25rem, 1.4rem + 4.5vw, 4rem);
    line-height: 1.05;
    letter-spacing: -0.03em;
    margin: 0 0 var(--vm-s-4);
}

.vm-br-desktop { display: none; }
@media (min-width: 640px) { .vm-br-desktop { display: block; } }

.vm-home-hero-sub {
    font-size: clamp(1rem, 0.9rem + 0.5vw, 1.2rem);
    color: var(--vm-muted);
    max-width: 580px;
    margin: 0 auto var(--vm-s-6);
    line-height: 1.6;
}

.vm-btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 600;
}

.vm-home-hero-proof {
    margin-top: var(--vm-s-4);
    font-size: 0.8125rem;
    color: var(--vm-muted);
}

/* ── Quote band ───────────────────────────────────────────────────────────── */

.vm-home-quote-band {
    background: linear-gradient(135deg, #1a7a49 0%, #1f9c5b 100%);
    padding: var(--vm-s-6) var(--vm-s-4);
}

.vm-home-quote {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
    color: #fff;
    padding: 0;
    border: none;
}

.vm-home-quote-mark {
    font-size: 3rem;
    line-height: 1;
    opacity: 0.4;
    font-family: Georgia, serif;
    display: block;
    margin-bottom: var(--vm-s-2);
}

.vm-home-quote p {
    font-size: clamp(1rem, 0.9rem + 0.4vw, 1.175rem);
    line-height: 1.65;
    margin: 0 0 var(--vm-s-4);
    opacity: 0.95;
}

.vm-home-quote footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--vm-s-3);
}

.vm-home-quote-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    color: #fff;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.vm-home-quote footer strong {
    display: block;
    font-size: 0.9375rem;
    text-align: left;
}

.vm-home-quote footer span {
    display: block;
    font-size: 0.8125rem;
    opacity: 0.75;
    text-align: left;
}

/* ── Problems ─────────────────────────────────────────────────────────────── */

.vm-home-problems {
    display: grid;
    gap: var(--vm-s-4);
    grid-template-columns: 1fr;
}

@media (min-width: 640px) {
    .vm-home-problems { grid-template-columns: repeat(3, 1fr); }
}

.vm-home-problem-card {
    background: var(--vm-surface);
    border: 1px solid var(--vm-border);
    border-radius: var(--vm-radius);
    padding: var(--vm-s-5);
}

.vm-home-problem-icon {
    font-size: 1.75rem;
    margin-bottom: var(--vm-s-3);
    line-height: 1;
}

.vm-home-problem-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 var(--vm-s-2);
    line-height: 1.3;
}

.vm-home-problem-card p {
    font-size: 0.875rem;
    color: var(--vm-muted);
    margin: 0;
    line-height: 1.6;
}

/* ── Pillars ──────────────────────────────────────────────────────────────── */

.vm-home-pillars {
    display: grid;
    gap: var(--vm-s-5);
    grid-template-columns: 1fr;
}

@media (min-width: 640px) {
    .vm-home-pillars { grid-template-columns: repeat(2, 1fr); }
}

.vm-home-pillar {
    display: flex;
    flex-direction: column;
    gap: var(--vm-s-2);
}

.vm-home-pillar-icon {
    font-size: 2rem;
    line-height: 1;
    margin-bottom: var(--vm-s-1);
}

.vm-home-pillar h3 {
    font-size: 1.0625rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
}

.vm-home-pillar p {
    font-size: 0.9375rem;
    color: var(--vm-muted);
    margin: 0;
    line-height: 1.65;
}

/* ── Pricing ──────────────────────────────────────────────────────────────── */

.vm-home-pricing-card {
    background: var(--vm-surface);
    border: 2px solid var(--vm-success);
    border-radius: var(--vm-radius);
    padding: var(--vm-s-6);
    box-shadow: 0 4px 6px rgba(31, 156, 91, 0.08), 0 12px 32px rgba(31, 156, 91, 0.1);
}

.vm-home-pricing-options {
    display: flex;
    align-items: center;
    gap: var(--vm-s-4);
    margin-bottom: var(--vm-s-5);
    flex-wrap: wrap;
}

.vm-home-pricing-option {
    display: flex;
    align-items: baseline;
    gap: var(--vm-s-1);
    flex-wrap: wrap;
}

.vm-home-pricing-amount {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--vm-text);
}

.vm-home-pricing-period {
    font-size: 1rem;
    color: var(--vm-muted);
}

.vm-home-pricing-save {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--vm-success);
    background: rgba(31, 156, 91, 0.1);
    padding: 2px 8px;
    border-radius: 20px;
}

.vm-home-pricing-divider {
    font-size: 0.875rem;
    color: var(--vm-muted);
    font-style: italic;
}

.vm-home-pricing-features {
    list-style: none;
    padding: 0;
    margin: 0 0 var(--vm-s-5);
    display: flex;
    flex-direction: column;
    gap: var(--vm-s-2);
}

.vm-home-pricing-features li {
    font-size: 0.9375rem;
    color: var(--vm-text);
    padding-left: var(--vm-s-5);
    position: relative;
    line-height: 1.5;
}

.vm-home-pricing-features li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--vm-success);
    font-weight: 700;
}

.vm-home-pricing-fine {
    text-align: center;
    font-size: 0.8125rem;
    color: var(--vm-muted);
    margin: var(--vm-s-3) 0 0;
}

/* ── Final CTA ────────────────────────────────────────────────────────────── */

.vm-home-cta {
    background: var(--vm-surface-2);
    border-top: 1px solid var(--vm-border);
    text-align: center;
    padding: var(--vm-s-8) var(--vm-s-4);
}

.vm-home-cta h2 {
    font-size: clamp(1.5rem, 1.1rem + 2vw, 2.25rem);
    letter-spacing: -0.02em;
    margin: 0 0 var(--vm-s-3);
}

.vm-home-cta p {
    color: var(--vm-muted);
    font-size: 1.0625rem;
    margin: 0 0 var(--vm-s-5);
}

/* ---------------- Child detail — weekly stats & topic progress ---------------- */

.vm-week-stats {
    display: flex;
    gap: var(--vm-s-3);
    flex: 1;
    align-items: flex-end;
    padding-bottom: var(--vm-s-2);
}
.vm-week-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}
.vm-week-stat-num {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--vm-text);
    line-height: 1;
}
.vm-week-stat-label {
    font-size: 0.75rem;
    color: var(--vm-muted);
    font-weight: 500;
}

/* ── Progress page ────────────────────────────────────────────────────────── */
.vm-prog-wrap {
    max-width: 860px;
    margin: 0 auto;
    padding: 24px var(--vm-s-5) 48px;
}
.vm-back-btn { display: none; } /* replaced by vm-nav-back in the nav bar */

.vm-prog-header {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 20px;
}
.vm-prog-name  { font-size: 1.5rem; font-weight: 700; margin: 0; }
.vm-prog-grade { font-size: 1rem; color: var(--vm-muted); }
.vm-prog-placement-btn { margin-left: auto; flex: 0 0 auto; }

/* Quiet "redo placement" affordance on the kid home (post-completion) */
.vm-placement-redo {
    display: flex;
    justify-content: center;
    margin: 2px 0 10px;
}
.vm-placement-redo .vm-btn {
    gap: 6px;
    padding: 6px 14px;
    border-radius: 99px;
    border: 1px solid var(--vm-border);
    background: var(--vm-surface);
    color: var(--vm-muted);
    font-size: 0.8125rem;
    font-weight: 600;
    box-shadow: none;
    transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.vm-placement-redo .vm-btn:hover {
    color: var(--vm-primary);
    border-color: var(--vm-primary);
    background: var(--vm-surface);
}

/* ── Filter tabs ─────────────────────────────────────────────── */
.vm-prog-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}
.vm-prog-filter {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 99px;
    border: 1.5px solid var(--vm-border);
    background: var(--vm-surface);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--vm-muted);
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.1s, color 0.1s, background 0.1s;
    white-space: nowrap;
}
.vm-prog-filter:hover { border-color: var(--vm-primary); color: var(--vm-primary); }
.vm-prog-filter--active {
    border-color: var(--vm-primary);
    background: #eef2ff;
    color: var(--vm-primary);
    font-weight: 600;
}
.vm-prog-filter-count {
    background: var(--vm-surface-2);
    border-radius: 99px;
    padding: 1px 7px;
    font-size: 0.75rem;
    font-weight: 600;
}
.vm-prog-filter--active .vm-prog-filter-count {
    background: var(--vm-primary);
    color: white;
}

.vm-prog-empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--vm-muted);
    font-size: 1rem;
}

/* ── Topic cards grid ────────────────────────────────────────── */
.vm-tc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
}
@media (max-width: 540px) {
    .vm-tc-grid { grid-template-columns: 1fr 1fr; }
}

.vm-tc {
    background: var(--tc-bg, var(--vm-surface));
    border: 1.5px solid var(--tc-border, var(--vm-border));
    border-radius: 16px;
    padding: 16px 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    transition: box-shadow 0.15s, transform 0.1s;
}
.vm-tc:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.09); transform: translateY(-1px); }

.vm-tc-cc     { font-size: 0.6875rem; font-weight: 700; color: var(--tc-color, var(--vm-muted)); letter-spacing: 0.05em; text-transform: uppercase; }
.vm-tc-name   { font-size: 1rem; font-weight: 600; color: var(--vm-text); line-height: 1.3; }
.vm-tc-pct    { font-size: 1.5rem; font-weight: 300; line-height: 1; margin-top: 4px; }
.vm-tc-sub    { font-size: 0.75rem; color: var(--vm-muted); }
.vm-tc-badge  { font-size: 0.75rem; font-style: italic; margin-top: 4px; }
.vm-tc-bar {
    height: 5px;
    background: rgba(0,0,0,0.08);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 6px;
}
.vm-tc-bar-fill { height: 100%; border-radius: 3px; transition: width 0.4s ease; }
.vm-tc-practice {
    margin-top: 10px;
    padding: 6px 0;
    border: none;
    background: none;
    color: var(--tc-color, var(--vm-primary));
    font-size: 0.8125rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
    opacity: 0.8;
    transition: opacity 0.1s;
}
.vm-tc-practice:hover { opacity: 1; }

/* Recent-miss collapsible inside topic card (issue #76) */
.vm-tc-misses {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed rgba(0, 0, 0, 0.08);
}
.vm-tc-misses-toggle {
    border: none;
    background: none;
    padding: 2px 0;
    color: #495057;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
}
.vm-tc-misses-toggle:hover { color: var(--tc-color, var(--vm-primary)); }
.vm-tc-misses-list {
    list-style: none;
    margin: 6px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.vm-tc-miss {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 6px;
    padding: 8px;
    font-size: 0.75rem;
    line-height: 1.4;
}
.vm-tc-miss-prompt   { font-weight: 600; color: #212529; margin-bottom: 4px; }
.vm-tc-miss-answer   { color: #495057; margin-bottom: 4px; }
.vm-tc-miss-hint     { color: #6c757d; font-style: italic; }

/* ── (end progress page) ──────────────────────────────────────────────────── */

.vm-progress-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: var(--vm-s-3);
}
.vm-progress-title {
    font-size: 1.0625rem;
    font-weight: 600;
    margin: 0;
}
.vm-progress-empty {
    font-size: 0.9375rem;
    color: var(--vm-muted);
    background: var(--vm-surface);
    border: 1px solid var(--vm-border);
    border-radius: var(--vm-radius);
    padding: var(--vm-s-5);
    text-align: center;
    line-height: 1.5;
}

.vm-topic-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: var(--vm-surface);
    border: 1px solid var(--vm-border);
    border-radius: var(--vm-radius);
    overflow: hidden;
}
.vm-topic-row {
    padding: var(--vm-s-3) var(--vm-s-4);
    border-bottom: 1px solid var(--vm-border);
    display: flex;
    flex-direction: column;
    gap: var(--vm-s-1);
}
.vm-topic-row:last-child { border-bottom: none; }

.vm-topic-row-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--vm-s-2);
}
.vm-topic-row-name {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--vm-text);
}
.vm-topic-row-pct {
    font-size: 0.875rem;
    font-weight: 700;
    flex-shrink: 0;
}
.vm-topic-bar-track {
    height: 6px;
    background: var(--vm-surface-2);
    border-radius: 99px;
    overflow: hidden;
}
.vm-topic-bar-fill {
    height: 100%;
    border-radius: 99px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.vm-topic-row-sub {
    font-size: 0.75rem;
    color: var(--vm-muted);
}

/* ---------------- Practice session ---------------- */

.vm-session {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--vm-surface);
}

.vm-session-loading {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--vm-s-4);
    color: var(--vm-muted);
    font-size: 1rem;
    padding: var(--vm-s-6);
    text-align: center;
}

/* Top bar */
.vm-session-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--vm-s-3) var(--vm-s-3);
    padding-top: max(var(--vm-s-3), env(safe-area-inset-top));
    flex-shrink: 0;
}

.vm-session-back-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--vm-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--vm-radius-sm);
    padding: 0;
    transition: color 0.12s, background 0.12s;
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
}
.vm-session-back-btn:hover { color: var(--vm-text); background: var(--vm-surface-2); }

.vm-session-counter {
    font-size: 0.9375rem;
    color: var(--vm-muted);
    text-align: center;
}
.vm-session-counter strong {
    font-size: 1.125rem;
    color: var(--vm-text);
}

/* Progress track */
.vm-session-track {
    height: 5px;
    background: var(--vm-border);
    margin: 0 var(--vm-s-4);
    border-radius: 99px;
    overflow: hidden;
    flex-shrink: 0;
}
.vm-session-fill {
    height: 100%;
    background: var(--vm-primary);
    border-radius: 99px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Context pills */
.vm-session-context {
    display: flex;
    align-items: center;
    gap: var(--vm-s-2);
    padding: var(--vm-s-3) var(--vm-s-4);
    flex-shrink: 0;
    flex-wrap: wrap;
}
.vm-session-topic-pill {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--vm-primary);
    background: #eef2ff;
    padding: 4px 12px;
    border-radius: 99px;
    letter-spacing: 0.01em;
}
.vm-session-diff-pill {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 99px;
    border: 1.5px solid;
    letter-spacing: 0.01em;
    background: transparent;
}

/* Problem area — centers question + visual in available space */
.vm-session-problem-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    padding: var(--vm-s-5) var(--vm-s-4);
    gap: var(--vm-s-4);
    overflow: hidden;
    min-height: 0;
}

/* Report issue trigger — subtle link below the visual */
.vm-report-row {
    display: flex;
    justify-content: center;
}
.vm-report-trigger {
    background: none;
    border: none;
    font-size: 0.75rem;
    color: var(--vm-muted);
    cursor: pointer;
    padding: 4px 8px;
    font-family: inherit;
    opacity: 0.6;
    transition: opacity 0.15s;
}
.vm-report-trigger:hover { opacity: 1; }

/* ── Immersive practice (focus mode) ─────────────────────────────────────────
   When the kid is mid-question the top nav is gone; the only chrome is the
   in-question mini-menu (sound / read-along / lesson / exit) sitting on top of
   the question, plus the larger progress dots. */
.vm-session-header--immersive {
    background: transparent;
    border-bottom: none;
}
.vm-session-header--immersive .vm-session-topic-row {
    justify-content: space-between;
    align-items: center;
    padding-top: var(--vm-s-3);
}
.vm-session-brand {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}
.vm-session-brand img {
    height: 26px;
    width: auto;
}
.vm-session-header--immersive .vm-answer-dots {
    padding-top: var(--vm-s-2);
}

/* Report issue pinned to the very bottom, quiet. */
.vm-report-row--bottom {
    margin-top: auto;
    padding: var(--vm-s-3) 0 var(--vm-s-2);
}
.vm-report-row--bottom .vm-report-trigger {
    font-size: 0.7rem;
    opacity: 0.45;
}

/* "Try once more" nudge after a first wrong attempt. */
.vm-retry-nudge {
    align-self: center;
    background: #fff7ed;
    color: #b45309;
    border: 1.5px solid #fdba74;
    border-radius: 999px;
    padding: 6px 16px;
    font-size: 0.95rem;
    font-weight: 700;
    animation: vm-retry-pop 0.25s ease;
}
@keyframes vm-retry-pop {
    0%   { transform: scale(0.85); opacity: 0; }
    100% { transform: scale(1);    opacity: 1; }
}
/* On-demand hints (kid taps "Get a hint" in the gear menu). */
.vm-ondemand-hints {
    list-style: none;
    margin: var(--vm-s-3, 12px) 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    max-width: 560px;
    align-self: center;
}
.vm-ondemand-hint {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    background: #fffbeb;
    border: 1.5px solid #fde68a;
    border-radius: var(--vm-radius-sm, 10px);
    padding: 10px 14px;
    animation: vm-retry-pop 0.2s ease;
}
.vm-ondemand-hint-num {
    flex-shrink: 0;
    line-height: 1.5;
}
.vm-ondemand-hint-text {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #92400e;
}
/* Gentle shake on the answer area when a retry begins. */
.vm-session-numeric--retry .vm-session-answer-display {
    animation: vm-shake 0.4s ease;
    border-color: #fdba74;
}
@keyframes vm-shake {
    0%, 100% { transform: translateX(0); }
    20%      { transform: translateX(-7px); }
    40%      { transform: translateX(6px); }
    60%      { transform: translateX(-4px); }
    80%      { transform: translateX(3px); }
}
/* Multiple-choice option that was the first (wrong) pick — locked out. */
.vm-choice-btn--wrong {
    background: #fff0f0;
    border-color: var(--vm-danger);
    color: var(--vm-danger);
    opacity: 0.6;
    cursor: not-allowed;
    text-decoration: line-through;
}

/* Report problem bottom sheet */
.vm-report-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 200;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
.vm-report-sheet {
    background: var(--vm-surface);
    border-radius: 24px 24px 0 0;
    padding: 24px 20px max(28px, env(safe-area-inset-bottom));
    width: 100%;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    animation: vm-slide-up 0.2s ease;
}
.vm-report-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--vm-text);
    text-align: center;
}
.vm-report-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.vm-report-option {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--vm-border);
    border-radius: 12px;
    background: var(--vm-surface);
    font-size: 0.9375rem;
    font-family: inherit;
    color: var(--vm-text);
    text-align: left;
    cursor: pointer;
    transition: border-color 0.1s, background 0.1s;
}
.vm-report-option:hover { border-color: var(--vm-primary); background: #f5f7ff; }
.vm-report-option--selected { border-color: var(--vm-primary); background: #eef2ff; font-weight: 600; }
.vm-report-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 4px;
}
.vm-report-thanks {
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    color: #2f9e44;
    padding: 16px 0;
}

/* Visual collapses when empty; capped so it doesn't crowd the question */
.vm-visual-container {
    flex: 0 1 auto;
    max-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 0;
    overflow: hidden;
}

/* AI-generated SVG — responsive, full width */
.vm-ai-visual {
    width: 100%;
    max-width: 540px;
    margin: 0 auto;
}
.vm-ai-visual svg {
    width: 100%;
    height: auto;
    display: block;
}

/* ── Dot visualizer ─────────────────────────────── */
.vm-problem-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    animation: vm-fade-in 0.25s ease;
}
@keyframes vm-fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.vm-dot-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.vm-dot-row {
    display: flex;
    gap: 6px;
}
.vm-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    flex-shrink: 0;
}
.vm-dot--dim {
    background: #d1d5db !important;
    opacity: 0.5;
}
.vm-dot-label {
    font-size: 0.875rem;
    font-weight: 700;
    margin-top: 2px;
}
.vm-visual-op {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--vm-muted);
    line-height: 1;
    align-self: center;
    padding-bottom: 18px;
}

/* shared label below any visual */
.vm-visual-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--vm-muted);
    text-align: center;
    margin-top: 4px;
}

/* ── Place value blocks ───────── */
.vm-pv { flex-direction: column; }
.vm-pv-blocks { display: flex; align-items: flex-end; gap: 4px; }
.vm-pv-gap    { width: 12px; }
.vm-pv-ones   { display: flex; flex-wrap: wrap; gap: 3px; align-content: flex-end; max-width: 80px; }

/* ── Counting / sequence ─────── */
.vm-sequence-wrap {
    flex-wrap: wrap;
    gap: 6px;
}
.vm-seq-bubble {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--vm-primary);
    color: white;
    font-size: 0.9375rem;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}
.vm-seq-bubble--blank {
    background: none;
    border: 2px dashed var(--vm-border);
    color: var(--vm-muted);
}
.vm-seq-arrow {
    font-size: 1.125rem;
    color: var(--vm-muted);
    align-self: center;
}

/* ── Comparison ──────────────── */
.vm-comparison { gap: 20px; align-items: center; }
.vm-cmp-sym {
    font-size: 2rem;
    font-weight: 800;
    color: var(--vm-primary);
    line-height: 1;
}
.vm-cmp-sym--blank { color: var(--vm-text-muted, #94a3b8); }

/* ── Clock ───────────────────── */
.vm-clock-wrap { flex-direction: column; align-items: center; }

/* ── Money coins ─────────────── */
.vm-coins { flex-wrap: wrap; gap: 16px; justify-content: center; align-items: center; }

/* ── Pattern shapes ──────────── */
.vm-shape-item {
    font-size: 1.5rem;
    align-self: center;
    line-height: 1;
}

/* ── Bar chart ───────────────── */
.vm-bar-chart {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    max-width: 260px;
}
.vm-bar-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.vm-bar-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--vm-text);
    width: 52px;
    text-align: right;
    flex-shrink: 0;
}
.vm-bar-track {
    flex: 1;
    height: 26px;
    background: var(--vm-surface-2);
    border-radius: 6px;
    overflow: hidden;
}
.vm-bar-fill {
    height: 100%;
    background: var(--vm-primary);
    border-radius: 4px;
    transition: width 0.3s ease;
}
.vm-bar-val {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--vm-primary);
    width: 22px;
    flex-shrink: 0;
}
/* Prompt row: text + speaker button side by side */
.vm-prompt-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    flex-shrink: 0;
}

.vm-session-prompt {
    font-size: clamp(1.625rem, 5vw, 2.5rem);
    font-weight: 500;
    text-align: center;
    color: var(--vm-text);
    margin: 0;
    line-height: 1.3;
    letter-spacing: -0.01em;
    max-width: 480px;
    flex: 1;
}
/* When TTS is on the whole prompt is tappable to re-read it aloud — a quiet
   affordance instead of a separate floating speaker button. */
.vm-session-prompt--tappable {
    cursor: pointer;
    border-radius: var(--vm-radius, 12px);
    transition: background 0.12s;
    -webkit-tap-highlight-color: transparent;
}
.vm-session-prompt--tappable:hover { background: var(--vm-surface-2); }
.vm-session-prompt--tappable:focus-visible {
    outline: 2px solid var(--vm-primary);
    outline-offset: 3px;
}

/* Speaker button */
.vm-speaker-btn {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: none;
    background: var(--vm-surface-2);
    color: var(--vm-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.1s, color 0.1s, transform 0.1s;
}
.vm-speaker-btn:hover { background: #e0e7ff; color: var(--vm-primary); }
.vm-speaker-btn--active {
    background: #e0e7ff;
    color: var(--vm-primary);
    animation: vm-pulse 1.2s ease-in-out infinite;
}
.vm-speaker-btn--loading {
    opacity: 0.6;
    cursor: default;
    animation: vm-spin 1s linear infinite;
}
/* Auto-read off — speaker shows the struck-through (muted) glyph */
.vm-speaker-btn--muted {
    color: var(--vm-muted);
    background: var(--vm-surface-2);
}
.vm-speaker-btn--muted:hover { color: var(--vm-primary); background: #e0e7ff; }

/* Speaker + "auto-read going forward?" popover anchor */
.vm-speaker-wrap {
    position: relative;
    flex-shrink: 0;
}
.vm-autoread-pop {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 20;
    width: max-content;
    max-width: 220px;
    background: var(--vm-surface);
    border: 1px solid var(--vm-border);
    border-radius: var(--vm-radius);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.16);
    padding: 12px;
    text-align: left;
    animation: vm-slide-up 0.16s ease;
}
.vm-autoread-pop::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 18px;
    width: 12px;
    height: 12px;
    background: var(--vm-surface);
    border-left: 1px solid var(--vm-border);
    border-top: 1px solid var(--vm-border);
    transform: rotate(45deg);
}
.vm-autoread-pop-q {
    margin: 0 0 10px;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--vm-text);
}
.vm-autoread-pop-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.vm-autoread-pop-btn {
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: var(--vm-radius-sm);
    border: 1.5px solid var(--vm-border);
    background: var(--vm-surface);
    color: var(--vm-text);
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s, color 0.12s;
    -webkit-tap-highlight-color: transparent;
}
.vm-autoread-pop-btn:hover { background: var(--vm-surface-2); }
.vm-autoread-pop-btn--yes {
    border-color: var(--vm-primary);
    background: var(--vm-primary);
    color: #fff;
}
.vm-autoread-pop-btn--yes:hover { background: var(--vm-primary-hover); }
@keyframes vm-spin { to { transform: rotate(360deg); } }

@keyframes vm-pulse {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.12); }
}

/* Numeric input area */
.vm-session-numeric {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--vm-s-3);
    padding: 0 var(--vm-s-4) max(var(--vm-s-4), env(safe-area-inset-bottom));
    flex-shrink: 0;
    width: 100%;
}

.vm-session-answer-display {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--vm-text);
    min-width: 100px;
    text-align: center;
    border-bottom: 3px solid var(--vm-primary);
    padding: 2px 16px 8px;
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.04em;
}
.vm-session-answer-placeholder {
    color: var(--vm-border);
    font-weight: 400;
}

/* Numpad — single row, wraps on very narrow screens */
.vm-numpad {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.vm-numpad-key {
    flex: 1 1 0;
    min-width: 36px;
    height: 48px;
    border: 1.5px solid var(--vm-border);
    border-radius: 12px;
    background: var(--vm-surface);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--vm-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.08s, transform 0.05s, border-color 0.08s, box-shadow 0.08s;
    -webkit-tap-highlight-color: transparent;
    font-family: inherit;
    padding: 0;
    box-shadow: 0 2px 6px rgba(20, 30, 50, 0.08);
}
.vm-numpad-key:hover:not(:disabled):not(.vm-numpad-key--submit) { box-shadow: 0 4px 12px rgba(20, 30, 50, 0.14); }
.vm-numpad-key:active:not(:disabled) { transform: scale(0.91); background: var(--vm-surface-2); box-shadow: 0 1px 3px rgba(20, 30, 50, 0.08); }
.vm-numpad-key--del {
    background: var(--vm-surface-2);
    color: var(--vm-muted);
    border-color: var(--vm-surface-2);
}
.vm-numpad-key--submit {
    background: var(--vm-primary);
    border-color: var(--vm-primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(41, 98, 255, 0.35);
}
.vm-numpad-key--submit:hover:not(:disabled) { background: var(--vm-primary-hover); box-shadow: 0 4px 16px rgba(41, 98, 255, 0.45); }
.vm-numpad-key--submit:disabled {
    background: var(--vm-surface-2);
    border-color: var(--vm-surface-2);
    color: var(--vm-border);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
.vm-numpad-key--colon {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--vm-text);
}
.vm-numpad-key--slash {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--vm-text);
}

/* Multiple choice */
.vm-session-mc {
    padding: var(--vm-s-2) var(--vm-s-4) max(var(--vm-s-5), env(safe-area-inset-bottom));
    flex-shrink: 0;
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
}
.vm-choices {
    display: grid;
    grid-template-columns: 1fr;
    grid-auto-rows: 1fr;
    gap: var(--vm-s-2);
}
.vm-choice-btn {
    min-height: 68px;
    border: 2px solid var(--vm-border);
    border-radius: 999px;
    background: var(--vm-surface);
    font-size: 1.125rem;
    font-weight: 400;
    color: var(--vm-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.1s, border-color 0.1s, color 0.1s, transform 0.05s;
    -webkit-tap-highlight-color: transparent;
    font-family: inherit;
    padding: var(--vm-s-3);
    text-align: center;
    line-height: 1.3;
}
.vm-choice-btn:hover { border-color: var(--vm-primary); color: var(--vm-primary); background: #f0f4ff; }
.vm-choice-btn:active { transform: scale(0.97); }

/* Feedback panel — slides up from bottom */
.vm-feedback {
    padding: var(--vm-s-4) var(--vm-s-4) max(var(--vm-s-5), env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: var(--vm-s-4);
    border-top: 1px solid var(--vm-border);
    background: var(--vm-surface);
    flex-shrink: 0;
    animation: vm-slide-up 0.22s ease;
    width: 100%;
}
@keyframes vm-slide-up {
    from { transform: translateY(24px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}
.vm-feedback--correct { border-top-color: var(--vm-mastery-mastered); }
.vm-feedback--wrong   { border-top-color: var(--vm-border); }

.vm-feedback-row {
    display: flex;
    align-items: center;
    gap: var(--vm-s-3);
    width: 100%;
}
.vm-feedback-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    font-weight: 700;
    flex-shrink: 0;
}
.vm-feedback--correct .vm-feedback-icon { background: var(--vm-mastery-mastered-bg);   color: var(--vm-mastery-mastered); }
.vm-feedback--wrong   .vm-feedback-icon { background: var(--vm-mastery-struggling-bg); color: var(--vm-mastery-struggling); }

.vm-feedback-head {
    display: flex;
    align-items: baseline;
    gap: var(--vm-s-3);
    flex-wrap: wrap;
    min-width: 0;
}
.vm-feedback-label {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.2;
}
.vm-feedback--correct .vm-feedback-label { color: var(--vm-success); }
.vm-feedback--wrong   .vm-feedback-label { color: var(--vm-danger); }

.vm-feedback-answer {
    font-size: 0.9375rem;
    color: var(--vm-muted);
}
.vm-feedback-answer strong {
    color: var(--vm-text);
    font-weight: 700;
}

/* Hints — a single quiet card; each hint is a numbered row with a divider. */
.vm-feedback-hints {
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
    border: 1px solid var(--vm-border);
    border-radius: var(--vm-radius);
    background: var(--vm-surface-2);
    overflow: hidden;
}
.vm-feedback-hint {
    display: flex;
    align-items: flex-start;
    gap: var(--vm-s-3);
    padding: var(--vm-s-3) var(--vm-s-4);
    font-size: 0.9375rem;
    color: var(--vm-text);
    line-height: 1.5;
    text-align: left;
}
.vm-feedback-hint + .vm-feedback-hint {
    border-top: 1px solid var(--vm-border);
}
.vm-feedback-hint-num {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--vm-surface);
    border: 1px solid var(--vm-border);
    color: var(--vm-muted);
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
}
.vm-feedback-hint-text { min-width: 0; }

.vm-feedback-actions {
    display: flex;
    gap: var(--vm-s-2);
    width: 100%;
    align-items: center;
}
.vm-feedback-continue {
    flex: 1;
    font-size: 1rem;
    padding: 13px 0;
}
.vm-feedback-secondary {
    flex: 1;
    font-size: 0.9375rem;
    padding: 13px 18px;
}

/* While hint narration is playing, lock everything except "Next Question".
 * The header, answer dots and the missed-so-far panel become non-interactive
 * and slightly dimmed; the feedback actions stay fully active. */
.vm-hints-locked .vm-session-header,
.vm-hints-locked .vm-missed-so-far {
    pointer-events: none;
    opacity: 0.5;
}

/* Session complete */
.vm-session--complete {
    align-items: center;
    justify-content: center;
    padding: var(--vm-s-5);
}
.vm-complete-card {
    background: var(--vm-surface);
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.10);
    padding: 36px 28px 28px;
    width: 100%;
    max-width: 340px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
}
.vm-complete-emoji { font-size: 3rem; line-height: 1; }
.vm-complete-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0;
    color: var(--vm-text);
    letter-spacing: -0.02em;
}
.vm-complete-tally {
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1;
    color: var(--vm-text);
}
.vm-complete-num   { font-size: 2rem; color: var(--vm-primary); }
.vm-complete-slash { font-size: 1.5rem; color: var(--vm-border); }
.vm-complete-denom { font-size: 1.5rem; color: var(--vm-muted); }
.vm-complete-tally-label { font-size: 0.9rem; color: var(--vm-muted); font-weight: 500; }
.vm-complete-streak {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--vm-text);
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 99px;
    padding: 6px 18px;
}

/* Counter moved inline with context pills */
.vm-session-counter-inline {
    margin-left: auto;
    font-size: 0.8125rem;
    color: var(--vm-muted);
    font-weight: 500;
}

/* Complete screen actions */
.vm-complete-actions { width: 100%; margin-top: 4px; display: flex; flex-direction: column; gap: 8px; }
.vm-complete-cta { padding: 14px 0; font-size: 1rem; }

/* Question review modal */
.vm-review-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.vm-review-modal {
    background: var(--vm-surface);
    border-radius: 20px;
    padding: 28px 24px 24px;
    width: 100%;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.20);
}
.vm-review-badge {
    align-self: flex-start;
    font-size: 0.8125rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 99px;
}
.vm-review-badge--correct { background: #dcfce7; color: #166534; }
.vm-review-badge--wrong   { background: #fee2e2; color: #991b1b; }
.vm-review-prompt {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--vm-text);
    margin: 0;
    line-height: 1.4;
}
.vm-review-answers {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--vm-surface-2, #f8fafc);
    border-radius: 12px;
    padding: 14px 16px;
}
.vm-review-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
.vm-review-label { font-size: 0.8125rem; color: var(--vm-muted); }
.vm-review-value { font-size: 1rem; font-weight: 700; }
.vm-review-value--correct { color: #2f9e44; }
.vm-review-value--wrong   { color: #e03131; }
.vm-review-hint {
    font-size: 0.875rem;
    color: var(--vm-muted);
    background: #f8fafc;
    border-left: 3px solid var(--vm-border);
    padding: 10px 14px;
    border-radius: 0 8px 8px 0;
    margin: 0;
    line-height: 1.5;
}

/* ── Topic path ──────────────────────────────────────────────────────────── */

.vm-topic-path-wrap {
    flex-shrink: 0;
    position: relative;
    background: var(--vm-surface);
    padding: 12px 0;
}
.vm-topic-path-wrap--compact {
    padding: 10px 0;
}

/* Edge hover-scroll zones — invisible strips at each side; resting the mouse
   over one glides the topic row in that direction (no clickable arrows). A soft
   gradient fade + a faint chevron hint where to hover. Hidden on touch/compact. */
.vm-topic-path-edge {
    position: absolute;
    top: 0;
    bottom: 0;
    z-index: 5;
    width: 56px;
    display: flex;
    align-items: center;
    cursor: default;
    pointer-events: auto;
    opacity: 0;
    transition: opacity .15s ease;
}
.vm-topic-path-wrap:hover .vm-topic-path-edge { opacity: 1; }
.vm-topic-path-edge--left {
    left: 0;
    justify-content: flex-start;
    padding-left: 6px;
    background: linear-gradient(to right, var(--vm-surface) 30%, transparent);
}
.vm-topic-path-edge--right {
    right: 0;
    justify-content: flex-end;
    padding-right: 6px;
    background: linear-gradient(to left, var(--vm-surface) 30%, transparent);
}
.vm-topic-path-edge-hint {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--vm-surface);
    color: var(--vm-muted);
    font-size: 1.25rem;
    line-height: 1;
    box-shadow: 0 2px 8px rgba(20, 30, 55, 0.12);
    transition: background .15s ease, color .15s ease, transform .1s ease;
}
.vm-topic-path-edge:hover .vm-topic-path-edge-hint {
    background: var(--vm-surface-2);
    color: var(--vm-text);
    transform: scale(1.08);
}
@media (hover: none) {
    .vm-topic-path-edge { display: none; }
}

/* Outer scroll container — hides scrollbar.
   Note: overflow-x:auto forces overflow-y to clip too (CSS spec), so we use
   padding-top to ensure the selected circle's scale+ring shadow isn't cut off. */
.vm-topic-path-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 12px var(--vm-s-5) 8px;
}
.vm-topic-path-scroll::-webkit-scrollbar { display: none; }

/* Inner flex row — items align at flex-start so labels fall below the line */
.vm-topic-path {
    display: inline-flex;
    align-items: flex-start;
    min-width: max-content;
}

/* ── Connecting line ── */
.vm-topic-path-line {
    width: 34px;
    height: 3px;
    background: var(--vm-border);
    border-radius: 99px;
    margin-top: 32px;   /* centers line with 66px donuts: (66/2) - (3/2) = 31.5 */
    flex-shrink: 0;
}
.vm-topic-path-wrap--compact .vm-topic-path-line {
    margin-top: 16px;   /* centers with 34px compact donuts: 17 - 1.5 */
    width: 14px;
}

/* ── Start / end markers ── */
.vm-topic-path-marker {
    font-size: 1.5rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 66px;
    height: 66px;
    flex-shrink: 0;
}
.vm-topic-path-wrap--compact .vm-topic-path-marker {
    width: 34px;
    height: 34px;
    font-size: 1rem;
}

/* ── Topic node (button) ── */
.vm-topic-path-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.12s;
}
.vm-topic-path-node:hover:not(:disabled) { transform: translateY(-2px); }
.vm-topic-path-node:disabled { cursor: default; opacity: 0.6; }

/* ── Donut (progress ring) ── */
/* A real SVG ring (rounded line-cap) fills by mastery %, conveying progress
   visually — smoother than a conic-gradient, no aliased edge. The icon sits in
   the surface-filled hub. */
.vm-topic-path-donut {
    --vm-donut-ring: #2f9e44;       /* progress arc: always a friendly green */
    --vm-donut-track: #cfe6fb;      /* perimeter: one calm light blue */
    width: 66px;
    height: 66px;
    min-width: 66px;
    min-height: 66px;
    flex: 0 0 auto;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
}
.vm-topic-path-wrap--compact .vm-topic-path-donut {
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;
}
.vm-topic-path-ring {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    /* Override the global `img, svg { height: auto }` reset so the ring can
       never collapse or scale differently across viewports — it is always a
       perfect square locked to the donut box. */
    max-width: none;
    overflow: visible;
}
.vm-topic-path-ring-track {
    stroke: var(--vm-donut-track);
}
.vm-topic-path-ring-fill {
    stroke: var(--vm-donut-ring);
    transition: stroke-dashoffset 0.5s ease, stroke 0.2s;
}
.vm-topic-path-ring-hub {
    fill: var(--vm-surface);
    transition: fill 0.2s;
}

/* ── Icon overlay ──
   The donut (hub + track + arc) is fully drawn in the SVG above so it scales as
   one unit and is pixel-consistent at every screen size. This layer only holds
   the centered icon/text — it has no background of its own. */
.vm-topic-path-circle {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    color: var(--vm-text);
    pointer-events: none;
    transition: color 0.2s;
}
.vm-topic-path-wrap--compact .vm-topic-path-circle {
    font-size: 0.5625rem;
}

/* The ring is intentionally uniform — one light-blue perimeter and a green
   progress arc for every topic. Mastery is conveyed by how far the green
   travels, not by changing colors, so it never reads as red/yellow/green
   "good vs bad" to a kid. */

/* Selected state */
.vm-topic-path-node--selected .vm-topic-path-donut {
    box-shadow: 0 0 0 3px rgba(41,98,255,0.35);
    transform: scale(1.1);
}
.vm-topic-path-node--selected .vm-topic-path-circle {
    color: var(--vm-primary);
}

/* Loading spin on selected node */
.vm-topic-path-node--loading.vm-topic-path-node--selected .vm-topic-path-donut {
    animation: vm-pulse 1s ease-in-out infinite;
}
@keyframes vm-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.5; }
}

/* Dimmed state — non-selected nodes when a topic is highlighted */
.vm-topic-path-node--dimmed {
    opacity: 0.35;
    transform: scale(0.76);
}
.vm-topic-path-node--dimmed .vm-topic-path-circle {
    background: var(--vm-surface-2);
    color: var(--vm-muted);
}

/* Mastered checkmark overlay (small badge on the corner of the circle) */
.vm-topic-path-circle { position: relative; }
.vm-topic-path-mastered-mark {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--vm-mastery-mastered);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    border: 2px solid var(--vm-surface);
}

/* ── Label (hidden in compact mode) ── */
.vm-topic-path-label {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--vm-text);
    text-align: center;
    width: 80px;
    line-height: 1.3;
    margin-top: 2px;
    overflow-wrap: break-word;
    word-break: break-word;
}
.vm-topic-path-node--selected .vm-topic-path-label { color: var(--vm-primary); font-weight: 700; }

/* ── Topic confirmation panel ── */
.vm-topic-confirm-wrap {
    flex-shrink: 0;
    padding: 0 var(--vm-s-4) var(--vm-s-4);
    background: var(--vm-surface);
}
.vm-topic-confirm {
    background: var(--vm-surface-2);
    border-radius: var(--vm-radius);
    padding: var(--vm-s-3) var(--vm-s-4);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--vm-s-3);
    min-height: 68px;
}
.vm-topic-confirm--empty {
    justify-content: flex-start;
}
.vm-topic-confirm-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.vm-topic-confirm-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--vm-text);
}
.vm-topic-confirm-mastery {
    font-size: 0.8125rem;
    color: var(--vm-muted);
}
.vm-topic-confirm-hint {
    font-size: 0.9375rem;
    color: var(--vm-muted);
}
@media (min-width: 640px) {
    .vm-topic-confirm-wrap { padding: 0 var(--vm-s-5) var(--vm-s-4); }
}

/* Confirm-panel actions: one row, wraps on very narrow screens */
.vm-confirm-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
}
.vm-start-missed { white-space: nowrap; }

/* "Missed Questions Only" toggle pill — on/off switch, not an action button.
   When on, the Start button practices a fresh missed-style set. */
.vm-missed-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    height: 36px;
    padding: 0 14px 0 6px;
    border-radius: 999px;
    border: 1.5px solid var(--vm-border);
    background: var(--vm-surface);
    color: var(--vm-muted);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s, color 0.12s;
    -webkit-tap-highlight-color: transparent;
}
.vm-missed-pill:hover { background: var(--vm-surface-2); }
.vm-missed-pill:disabled { opacity: 0.6; cursor: default; }
.vm-missed-pill-knob {
    width: 34px;
    height: 20px;
    border-radius: 999px;
    background: var(--vm-border);
    position: relative;
    flex-shrink: 0;
    transition: background 0.15s;
}
.vm-missed-pill-knob::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
    transition: transform 0.15s;
}
.vm-missed-pill--on {
    color: #1a7f37;
    border-color: #1a7f37;
    background: #eafbef;
}
.vm-missed-pill--on:hover { background: #d8f5e1; }
.vm-missed-pill--on .vm-missed-pill-knob { background: #1a7f37; }
.vm-missed-pill--on .vm-missed-pill-knob::after { transform: translateX(14px); }
.vm-missed-empty {
    flex-basis: 100%;
    text-align: left;
    font-size: 0.875rem;
    color: #1a7f37;
    font-weight: 600;
}

/* ── Start control: split button + count dropdown ────────────────────────── */
.vm-startctl {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
}
.vm-startctl-main {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    white-space: nowrap;
}
.vm-startctl-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding-left: 11px;
    padding-right: 12px;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.28);
}
.vm-btn-ghost.vm-startctl-chip {
    box-shadow: inset 1px 0 0 var(--vm-border);
}
.vm-startctl-count { font-size: 1rem; font-weight: 800; }
.vm-startctl-arrow {
    font-size: 0.7em;
    opacity: 0.85;
    transition: transform .15s ease;
}
.vm-startctl-arrow--open { transform: rotate(180deg); }
.vm-startctl-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 30;
    min-width: 200px;
    margin: 0;
    padding: 6px;
    list-style: none;
    background: var(--vm-surface);
    border: 1px solid var(--vm-border);
    border-radius: var(--vm-radius-sm);
    box-shadow: 0 12px 32px rgba(20, 30, 55, 0.16);
    animation: vm-slide-up .14s ease;
}
.vm-startctl-list { list-style: none; margin: 0; padding: 0; }
.vm-startctl-menu li { margin: 0; }
.vm-startctl-section-label {
    padding: 4px 12px 2px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--vm-muted);
}
.vm-startctl-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-radius: 8px;
    background: none;
    color: var(--vm-text);
    font: inherit;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
}
.vm-startctl-item:hover { background: var(--vm-surface-2); }
.vm-startctl-item--active { color: var(--vm-primary); }
.vm-startctl-check { color: var(--vm-primary); font-weight: 700; }
.vm-startctl-divider {
    height: 1px;
    margin: 6px 4px;
    background: var(--vm-border);
}
.vm-startctl-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-radius: 8px;
    background: none;
    color: var(--vm-text);
    font: inherit;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
}
.vm-startctl-toggle:hover { background: var(--vm-surface-2); }
.vm-startctl-toggle:disabled { opacity: 0.45; cursor: default; }
.vm-startctl-toggle:disabled:hover { background: none; }
.vm-startctl-switch {
    flex-shrink: 0;
    width: 34px;
    height: 20px;
    border-radius: 999px;
    background: var(--vm-border);
    position: relative;
    transition: background 0.15s;
}
.vm-startctl-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
    transition: transform 0.15s;
}
.vm-startctl-switch--on { background: #1a7f37; }
.vm-startctl-switch--on::after { transform: translateX(14px); }

@media (min-width: 640px) {
    .vm-numpad { max-width: 600px; margin: 0 auto; }
    .vm-session-prompt { font-size: 2.25rem; }
    .vm-topic-path-wrap { padding: 16px 0; }
    .vm-topic-path-circle { width: 64px; height: 64px; font-size: 0.875rem; }
    .vm-topic-path-line { margin-top: 31px; width: 24px; }
    .vm-topic-path-marker { width: 64px; height: 64px; font-size: 1.6rem; }
    .vm-topic-path-marker--grade { width: 72px; height: 72px; }
    .vm-topic-path-marker--grade .vm-topic-path-grade-num { font-size: 0.875rem; }
}

/* Topic path marker icon colors */
.vm-topic-path-marker--start { color: var(--vm-primary); }
/* Grade start node — leads the path. A touch larger than the topic circles so
   the "Grade 2" label reads clearly; aligns at the top of the path row. */
.vm-topic-path-marker--grade {
    width: 66px;
    height: 66px;
    border-radius: 50%;
    border: 2.5px solid var(--vm-primary);
    background: var(--vm-primary);
    color: #fff;
    text-align: center;
    padding: 0 4px;
}
.vm-topic-path-grade-num {
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.1;
    letter-spacing: -0.01em;
}
.vm-topic-path-marker--end {
    color: #d97706;
    border-radius: 50%;
    border: 2.5px solid #d97706;
    background: #fef3c7;
}

/* ── Session header: active topic + answer dots ──────────────────────────── */

.vm-session-header {
    flex-shrink: 0;
    background: var(--vm-surface);
    border-bottom: 1px solid var(--vm-border);
}

.vm-session-topic-row {
    display: flex;
    align-items: center;
    gap: var(--vm-s-3);
    padding: var(--vm-s-2) var(--vm-s-4);
    justify-content: space-between;
}

.vm-session-active-topic {
    display: flex;
    align-items: center;
    gap: var(--vm-s-2);
    padding: 6px 8px;
    flex-shrink: 0;
    pointer-events: none;
    cursor: default;
    user-select: none;
}

.vm-session-active-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2.5px solid var(--vm-primary);
    background: #eef2ff;
    color: var(--vm-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6875rem;
    font-weight: 800;
    flex-shrink: 0;
    box-shadow: 0 0 0 3px rgba(41, 98, 255, 0.18);
}

.vm-session-active-label {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--vm-primary);
    text-align: left;
    line-height: 1.25;
    max-width: 76px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* "Missed Questions Only" indicator — amber so it clearly reads as review. */
.vm-session-active-topic--missed .vm-session-active-circle {
    border-color: #d97706;
    background: #fff7ed;
    color: #b45309;
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.18);
    font-size: 1.25rem;
}
.vm-session-active-topic--missed .vm-session-active-label {
    color: #b45309;
    max-width: 120px;
}

/* Answer dots — 10 numbered circles in their own row beneath the title.
   Fill green/red as questions are answered. Stay on a single row even on
   the narrowest phones (issue #85). */
.vm-answer-dots {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    justify-content: center;
    padding: 0 var(--vm-s-4) var(--vm-s-2);
}

.vm-answer-dot {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2.5px solid var(--vm-border);
    background: var(--vm-surface-2);
    color: var(--vm-muted);
    font-size: 1rem;
    font-weight: 800;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    transition: background 0.25s, border-color 0.25s, color 0.25s, box-shadow 0.2s;
}
@media (max-width: 480px) {
    .vm-answer-dots { gap: 6px; }
    .vm-answer-dot { width: 32px; height: 32px; font-size: 0.9rem; border-width: 2px; }
}
.vm-answer-dot--correct {
    background: var(--vm-success);
    border-color: var(--vm-success);
    color: #ffffff;
}
.vm-answer-dot--wrong {
    background: var(--vm-danger);
    border-color: var(--vm-danger);
    color: #ffffff;
}
/* One wrong attempt so far (current question) — half-filled red, Beast-Academy
   style. The kid still has a second chance. */
.vm-answer-dot--half {
    background: linear-gradient(90deg, var(--vm-danger) 0 50%, var(--vm-surface-2) 50% 100%);
    border-color: var(--vm-danger);
    color: var(--vm-text);
}
/* The question the kid is on right now — gentle blue ring. */
.vm-answer-dot--current {
    border-color: var(--vm-primary);
    color: var(--vm-primary);
    box-shadow: 0 0 0 3px rgba(41, 98, 255, 0.15);
}
.vm-answer-dot--prior {
    background: var(--vm-muted);
    border-color: var(--vm-muted);
    color: #ffffff;
    opacity: 0.45;
}
.vm-answer-dot--clickable {
    cursor: pointer;
    padding: 0;
    transition: transform 0.1s, box-shadow 0.1s, background 0.25s, border-color 0.25s, color 0.25s;
}
.vm-answer-dot--clickable:hover {
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}

.vm-session-header-actions {
    display: flex;
    align-items: center;
    gap: var(--vm-s-2);
    flex-shrink: 0;
}

/* ── Gear options menu — folds sound / read-along / lesson / report into one
   icon so only the essentials (the menu + Exit) show during a question. ── */
.vm-gear-menu {
    position: relative;
    display: flex;
}
.vm-gear-btn {
    width: 36px;
    height: 36px;
    border: 1.5px solid var(--vm-border);
    background: var(--vm-surface);
    cursor: pointer;
    color: var(--vm-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--vm-radius-sm);
    transition: background 0.12s, border-color 0.12s, color 0.12s, transform 0.2s;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}
.vm-gear-btn:hover { background: var(--vm-surface-2); color: var(--vm-text); }
.vm-gear-btn--open {
    border-color: var(--vm-primary);
    color: var(--vm-primary);
    background: #eef2ff;
    transform: rotate(30deg);
}

/* Click-away layer */
.vm-gear-backdrop {
    position: fixed;
    inset: 0;
    z-index: 60;
}

.vm-gear-popover {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 61;
    min-width: 200px;
    background: var(--vm-surface);
    border: 1px solid var(--vm-border);
    border-radius: var(--vm-radius);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16);
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    animation: vm-gear-pop 0.12s ease-out;
}
@keyframes vm-gear-pop {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.vm-gear-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border: none;
    background: none;
    border-radius: var(--vm-radius-sm);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--vm-text);
    text-align: left;
    transition: background 0.12s;
    -webkit-tap-highlight-color: transparent;
}
.vm-gear-item:hover { background: var(--vm-surface-2); }
.vm-gear-item:disabled {
    opacity: 0.45;
    cursor: default;
}
.vm-gear-item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--vm-muted);
    flex-shrink: 0;
}
.vm-gear-item-label { flex: 1; }
.vm-gear-item-state {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--vm-muted);
    background: var(--vm-surface-2);
    border-radius: 99px;
    padding: 2px 9px;
    flex-shrink: 0;
}
.vm-gear-item-state--on {
    color: #1a7f37;
    background: #eafbef;
}


/* Lesson button — mirrors Exit but primary blue */
.vm-lesson-btn {
    height: 36px;
    padding: 0 12px;
    border: 1.5px solid var(--vm-primary);
    background: var(--vm-surface);
    cursor: pointer;
    color: var(--vm-primary);
    display: flex;
    align-items: center;
    gap: 5px;
    border-radius: var(--vm-radius-sm);
    font-size: 0.8125rem;
    font-weight: 700;
    font-family: inherit;
    letter-spacing: 0.01em;
    transition: background 0.12s;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}
.vm-lesson-btn:hover { background: #eef2ff; }

/* Auto-read toggle — muted when off, primary when on */
.vm-autoplay-btn {
    height: 36px;
    padding: 0 12px;
    border: 1.5px solid var(--vm-border);
    background: var(--vm-surface);
    cursor: pointer;
    color: var(--vm-muted);
    display: flex;
    align-items: center;
    gap: 5px;
    border-radius: var(--vm-radius-sm);
    font-size: 0.8125rem;
    font-weight: 700;
    font-family: inherit;
    letter-spacing: 0.01em;
    transition: background 0.12s, border-color 0.12s, color 0.12s;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}
.vm-autoplay-btn:hover { background: var(--vm-surface-2); }
.vm-autoplay-btn--on {
    border-color: var(--vm-primary);
    color: var(--vm-primary);
    background: #eef2ff;
}

/* Master sound (mute) toggle — icon-only, square tap target */
.vm-sound-btn {
    width: 36px;
    height: 36px;
    border: 1.5px solid var(--vm-border);
    background: var(--vm-surface);
    cursor: pointer;
    color: var(--vm-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--vm-radius-sm);
    transition: background 0.12s, border-color 0.12s, color 0.12s;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}
.vm-sound-btn:hover { background: var(--vm-surface-2); }
.vm-sound-btn--on {
    color: #1a7f37;
    border-color: #1a7f37;
    background: #eafbef;
}
.vm-sound-btn--on:hover { background: #d8f5e1; }
.vm-sound-btn:not(.vm-sound-btn--on) {
    color: var(--vm-muted);
    background: var(--vm-surface-2);
}

.vm-session-stop-btn {
    height: 36px;
    padding: 0 12px;
    border: 1.5px solid var(--vm-danger);
    background: var(--vm-surface);
    cursor: pointer;
    color: var(--vm-danger);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--vm-radius-sm);
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    transition: background 0.12s;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}
.vm-session-stop-btn:hover { background: #fee2e2; }

/* Child avatar chip shown in nav for parent sessions */
.vm-nav-child-chip {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--vm-border);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--vm-surface-2);
    flex-shrink: 0;
}

/* ── Missed Questions page ───────────────────────────────────────────────── */
.vm-missed-wrap {
    width: 100%;
    max-width: 680px;
}
.vm-missed-header { margin: 0 0 var(--vm-s-5); }
.vm-missed-header h1 { margin: 0 0 4px; font-size: clamp(1.375rem, 1.2rem + 1vw, 1.75rem); }
.vm-missed-header p  { margin: 0; color: var(--vm-muted); font-size: 0.9375rem; }

.vm-missed-filters {
    display: flex;
    gap: var(--vm-s-2);
    flex-wrap: wrap;
    margin-bottom: var(--vm-s-5);
}
.vm-missed-filter-pill {
    padding: 6px 14px;
    border-radius: 99px;
    border: 1.5px solid var(--vm-border);
    background: var(--vm-surface);
    color: var(--vm-muted);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.12s, border-color 0.12s, background 0.12s;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}
.vm-missed-filter-pill:hover { border-color: var(--vm-primary); color: var(--vm-primary); }
.vm-missed-filter-pill--active {
    background: var(--vm-primary);
    border-color: var(--vm-primary);
    color: #fff;
}

.vm-missed-list { display: flex; flex-direction: column; gap: var(--vm-s-3); }

.vm-missed-card {
    background: var(--vm-surface);
    border: 1px solid var(--vm-border);
    border-radius: var(--vm-radius);
    overflow: hidden;
}
.vm-missed-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--vm-s-3);
    padding: var(--vm-s-4);
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.vm-missed-card-top:hover { background: var(--vm-surface-2); }
.vm-missed-prompt {
    font-size: 1rem;
    font-weight: 600;
    color: var(--vm-text);
    flex: 1;
    min-width: 0;
}
.vm-missed-card-right {
    display: flex;
    align-items: center;
    gap: var(--vm-s-2);
    flex-shrink: 0;
    color: var(--vm-muted);
}
.vm-missed-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 99px;
    background: var(--vm-surface-2);
    color: var(--vm-muted);
    white-space: nowrap;
}
.vm-missed-answer-row {
    padding: 0 var(--vm-s-4) var(--vm-s-3);
    font-size: 0.9375rem;
    color: var(--vm-muted);
    border-top: 1px solid var(--vm-border);
    padding-top: var(--vm-s-3);
}
.vm-missed-answer-row strong { color: var(--vm-text); }
.vm-missed-answer-row .vm-missed-wrong {
    color: var(--vm-mastery-struggling);
    background: var(--vm-mastery-struggling-bg);
    padding: 1px 6px;
    border-radius: 4px;
}
.vm-missed-answer-row .vm-missed-right {
    color: var(--vm-mastery-mastered);
    background: var(--vm-mastery-mastered-bg);
    padding: 1px 6px;
    border-radius: 4px;
}

.vm-missed-groups { display: flex; flex-direction: column; gap: var(--vm-s-3); }
.vm-missed-group { background: var(--vm-surface); border-radius: var(--vm-radius); border: 1px solid var(--vm-border); overflow: hidden; }
.vm-missed-group-header {
    width: 100%;
    display: flex;
    align-items: center;
    gap: var(--vm-s-2);
    padding: var(--vm-s-3) var(--vm-s-4);
    background: transparent;
    border: 0;
    cursor: pointer;
    text-align: left;
    color: var(--vm-text);
    min-height: var(--vm-tap);
}
.vm-missed-group-header:hover { background: var(--vm-surface-2); }
.vm-missed-group-title { font-weight: 700; font-size: 1rem; flex: 1; }
.vm-missed-group-count {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--vm-muted);
    background: var(--vm-surface-2);
    border-radius: 99px;
    padding: 2px 10px;
}
.vm-missed-group .vm-missed-list { padding: 0 var(--vm-s-3) var(--vm-s-3); }

.vm-missed-explanation {
    padding: var(--vm-s-3) var(--vm-s-4) var(--vm-s-4);
    border-top: 1px solid var(--vm-border);
    display: flex;
    flex-direction: column;
    gap: var(--vm-s-2);
}
.vm-missed-explanation-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--vm-muted);
    margin-bottom: 4px;
}
.vm-missed-hint-step {
    font-size: 0.9375rem;
    color: var(--vm-text);
    padding: var(--vm-s-2) var(--vm-s-3);
    background: var(--vm-surface-2);
    border-radius: var(--vm-radius-sm);
    line-height: 1.5;
}
.vm-missed-empty {
    text-align: center;
    padding: var(--vm-s-8) var(--vm-s-4);
    color: var(--vm-muted);
}
.vm-missed-empty-icon { font-size: 2.5rem; margin-bottom: var(--vm-s-3); }

/* -- Micro-intro lesson card (shown once per subtopic before practice) ----- */
.vm-microintro {
    display: flex;
    justify-content: center;
    padding: var(--vm-s-4);
}
.vm-microintro-card {
    width: 100%;
    max-width: 640px;
    background: var(--vm-surface);
    border: 1px solid var(--vm-border);
    border-radius: var(--vm-radius);
    padding: var(--vm-s-5);
    display: flex;
    flex-direction: column;
    gap: var(--vm-s-4);
}
.vm-microintro-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--vm-text);
    margin: 0;
    line-height: 1.2;
}
.vm-microintro-kid {
    font-size: 1.125rem;
    line-height: 1.5;
    color: var(--vm-text);
    margin: 0;
    padding: var(--vm-s-3) var(--vm-s-4);
    background: var(--vm-surface-2);
    border-left: 4px solid var(--vm-primary);
    border-radius: var(--vm-radius-sm);
}
.vm-microintro-sections {
    display: flex;
    flex-direction: column;
    gap: var(--vm-s-3);
}
.vm-microintro-section {
    display: flex;
    flex-direction: column;
    gap: var(--vm-s-2);
}
.vm-microintro-section-title {
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--vm-muted);
}
.vm-microintro-section-body {
    font-size: 1rem;
    line-height: 1.5;
    color: var(--vm-text);
}
.vm-microintro-example {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 1rem;
    background: var(--vm-surface-2);
    padding: var(--vm-s-3);
    border-radius: var(--vm-radius-sm);
    margin: 0;
    white-space: pre;
    overflow-x: auto;
}
.vm-microintro-go {
    align-self: stretch;
    min-height: 56px;
    font-size: 1.125rem;
    font-weight: 700;
    margin-top: var(--vm-s-2);
}
.vm-microintro-parent {
    border-top: 1px solid var(--vm-border);
    padding-top: var(--vm-s-3);
    display: flex;
    flex-direction: column;
    gap: var(--vm-s-2);
}
.vm-microintro-parent-toggle {
    background: none;
    border: none;
    padding: 0;
    color: var(--vm-primary);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    align-self: flex-start;
}
.vm-microintro-parent-toggle:hover { text-decoration: underline; }
.vm-microintro-parent-body {
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--vm-muted);
    margin: 0;
}

/* Modal variant — used by 'Show lesson again' affordances. */
.vm-microintro--modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.55);
    padding: var(--vm-s-4);
    align-items: flex-start;
    overflow-y: auto;
}
.vm-microintro--modal .vm-microintro-card {
    position: relative;
    margin-top: var(--vm-s-6);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}
.vm-microintro-close {
    position: absolute;
    top: var(--vm-s-2);
    right: var(--vm-s-3);
    background: none;
    border: none;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    color: var(--vm-muted);
    padding: var(--vm-s-1) var(--vm-s-2);
}
.vm-microintro-close:hover { color: var(--vm-text); }
.vm-microintro-close--inline {
    position: static;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
}

/* Inline "Show lesson" link inside the topic-confirm bar. */
.vm-topic-confirm-lesson {
    align-self: flex-start;
    background: none;
    border: none;
    padding: 0;
    color: var(--vm-primary, #4f46e5);
    font-size: 0.875rem;
    cursor: pointer;
    margin-top: var(--vm-s-1);
}
.vm-topic-confirm-lesson:hover { text-decoration: underline; }

/* Small book icon next to each topic name on the parent Progress page. */
.vm-tc-preview {
    background: none;
    border: none;
    padding: 0 var(--vm-s-1);
    font-size: 1rem;
    cursor: pointer;
    margin-left: var(--vm-s-2);
    opacity: 0.6;
    transition: opacity 0.15s;
}
.vm-tc-preview:hover { opacity: 1; }

/* -- Lesson player (video-style narrated walkthrough) --------------------- */
.vm-microintro-watch {
    align-self: center;
}
.vm-lesson-player .vm-lp-stage {
    min-height: 200px;
    padding: var(--vm-s-4);
    border-radius: var(--vm-radius);
    background: var(--vm-bg, #f8fafc);
    display: flex;
    flex-direction: column;
    gap: var(--vm-s-3);
}
.vm-lp-intro {
    font-size: 1.125rem;
    line-height: 1.5;
    margin: 0;
    color: var(--vm-text);
}
.vm-lp-section-titlebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}
.vm-lp-section-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--vm-primary, #4f46e5);
}
.vm-lp-speaker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--vm-border, #e5e7eb);
    border-radius: 999px;
    width: 38px;
    height: 38px;
    padding: 0;
    cursor: pointer;
    color: var(--vm-primary, #4f46e5);
    transition: background 0.15s, transform 0.1s;
}
.vm-lp-speaker:hover  { background: var(--vm-surface-2, #f3f4f6); }
.vm-lp-speaker:active { transform: scale(0.94); }
.vm-lp-titlebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.vm-lp-titlebar .vm-microintro-title { margin: 0; }

/* Personalized greeting above the title */
.vm-lp-greeting {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--vm-primary, #4f46e5);
    letter-spacing: 0.01em;
    margin-bottom: 0.25rem;
}

/* Mascot — talking penguin in the lesson stage */
.vm-lp-mascot {
    display: flex;
    justify-content: center;
    margin-bottom: 0.5rem;
    transition: transform 0.2s ease;
}
.vm-lp-mascot img {
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.12));
}
.vm-lp-mascot--talking {
    animation: vm-lp-mascot-bob 1.4s ease-in-out infinite;
}
@keyframes vm-lp-mascot-bob {
    0%, 100% { transform: translateY(0)    rotate(-2deg); }
    50%      { transform: translateY(-6px) rotate(2deg); }
}
@media (prefers-reduced-motion: reduce) {
    .vm-lp-mascot--talking { animation: none; }
}
.vm-lp-section-body {
    font-size: 1rem;
    line-height: 1.5;
    margin: 0;
    color: var(--vm-text);
}
.vm-lp-worked {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 1.25rem;
    line-height: 1.4;
    background: #fff;
    border: 1px solid var(--vm-border);
    border-radius: var(--vm-radius);
    padding: var(--vm-s-3);
    margin: 0;
    white-space: pre;
    color: var(--vm-text);
    min-height: 5rem;
}
.vm-lp-caret {
    display: inline-block;
    opacity: 0.6;
    animation: vm-lp-blink 1s steps(2) infinite;
}
@keyframes vm-lp-blink {
    50% { opacity: 0; }
}
.vm-lp-done {
    font-size: 1.125rem;
    text-align: center;
    margin: 0;
    color: var(--vm-text);
}
.vm-lp-dots {
    display: flex;
    justify-content: center;
    gap: var(--vm-s-2);
    margin-top: var(--vm-s-2);
}
.vm-lp-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--vm-border);
    transition: background 0.2s;
}
.vm-lp-dot--done { background: var(--vm-primary, #4f46e5); }
.vm-lp-dot--active {
    background: var(--vm-primary, #4f46e5);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}
.vm-lp-controls {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--vm-s-2);
    margin-top: var(--vm-s-2);
}
.vm-lp-tts-warning {
    font-size: 0.8125rem;
    color: var(--vm-muted);
    text-align: center;
    margin: 0;
}

/* -- Danger zone (Account) ---------------------------------------------- */
.vm-danger-zone {
    margin-top: var(--vm-s-5);
    border: 1px solid var(--vm-mastery-struggling);
    background: var(--vm-mastery-struggling-bg);
    border-radius: var(--vm-radius);
    padding: 18px 20px;
}
.vm-danger-zone-header h2 {
    margin: 0 0 4px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--vm-mastery-struggling);
}
.vm-danger-zone-header p {
    margin: 0 0 12px;
    font-size: 0.8125rem;
    color: var(--vm-muted);
}
.vm-danger-zone-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--vm-s-3);
    padding: 12px 0 4px;
    border-top: 1px solid rgba(217,54,54,0.18);
    flex-wrap: wrap;
}
.vm-danger-zone-row-text { display: flex; flex-direction: column; min-width: 0; }
.vm-danger-zone-row-text strong { font-size: 0.9375rem; color: var(--vm-text); }
.vm-danger-zone-row-text span { font-size: 0.8125rem; color: var(--vm-muted); margin-top: 2px; }
.vm-danger-zone-toggle { flex-shrink: 0; }
.vm-danger-zone-confirm {
    margin-top: 12px;
    padding: 14px;
    background: var(--vm-surface);
    border: 1px solid var(--vm-mastery-struggling);
    border-radius: var(--vm-radius-sm);
}
.vm-danger-zone-actions {
    display: flex;
    gap: var(--vm-s-2);
    margin-top: 12px;
    flex-wrap: wrap;
}

/* ── Form field invalid state (auth-fail red border) ───────────────── */
.vm-field--invalid input,
.vm-field--invalid .vm-input-wrap > input {
    border-color: var(--vm-mastery-struggling);
    background: var(--vm-mastery-struggling-bg);
}
.vm-field--invalid input:focus,
.vm-field--invalid .vm-input-wrap > input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(217,54,54,0.18);
}

/* ── Practice focused shell (kid mid-question) ─────────────────────── */
.vm-shell--focused .vm-nav-actions { gap: var(--vm-s-2); }

/* ── Empty hero (first-time dashboard, illustrated) ────────────────── */
.vm-empty-hero {
    background: var(--vm-surface);
    border: 1px solid var(--vm-border);
    border-radius: var(--vm-radius-lg, 16px);
    padding: 40px 28px 32px;
    text-align: center;
    max-width: 520px;
    margin: 24px auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}
.vm-empty-hero-illustration { line-height: 0; margin-bottom: 4px; }
.vm-empty-hero-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--vm-text);
}
.vm-empty-hero-sub {
    margin: 0;
    color: var(--vm-muted);
    font-size: 0.9375rem;
    line-height: 1.5;
    max-width: 38ch;
}
.vm-empty-hero-bullets {
    list-style: none;
    padding: 0;
    margin: 16px 0 0;
    text-align: left;
    width: 100%;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 0.875rem;
    color: var(--vm-text);
}
.vm-empty-hero-bullets li {
    position: relative;
    padding-left: 26px;
    line-height: 1.45;
}
.vm-empty-hero-bullets li::before {
    content: '✓';
    position: absolute;
    left: 0;
    top: 0;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--vm-mastery-mastered-bg);
    color: var(--vm-mastery-mastered);
    font-size: 0.75rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Parent focus panel (C12) ─────────────────────────────────────── */
.vm-focus-panel {
    margin-top: var(--vm-s-4);
    background: var(--vm-surface);
    border: 1px solid var(--vm-border);
    border-radius: var(--vm-radius);
    padding: 18px 20px;
}
.vm-focus-panel--celebrate { background: var(--vm-mastery-mastered-bg); border-color: var(--vm-mastery-mastered); }
.vm-focus-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--vm-s-2);
    margin-bottom: 10px;
}
.vm-focus-panel-header h3 { margin: 0; font-size: 1rem; font-weight: 700; color: var(--vm-text); }
.vm-focus-panel-pill {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--vm-mastery-mastered);
    background: var(--vm-surface);
    border-radius: 99px;
    padding: 3px 10px;
}
.vm-focus-panel-body { margin: 0; font-size: 0.9375rem; color: var(--vm-text); line-height: 1.5; }
.vm-focus-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.vm-focus-item-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--vm-s-2);
    margin-bottom: 6px;
}
.vm-focus-item-name { font-size: 0.9375rem; font-weight: 600; color: var(--vm-text); }
.vm-focus-item-pct { font-size: 0.875rem; font-weight: 700; }
.vm-focus-item-bar {
    height: 6px;
    background: var(--vm-mastery-empty-bg);
    border-radius: 99px;
    overflow: hidden;
}
.vm-focus-item-bar-fill { height: 100%; border-radius: 99px; transition: width 0.25s; }
.vm-focus-panel-tip {
    margin: 14px 0 0;
    padding: 10px 12px;
    background: var(--vm-surface-2);
    border-radius: var(--vm-radius-sm);
    font-size: 0.8125rem;
    color: var(--vm-muted);
    line-height: 1.5;
}

/* ── PlaceValueLesson (vm-pvl-*) ──────────────────────────────────────────────
 * Grade 1 animated lesson: Tens and Ones.
 */

.vm-pvl-wrap {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: stretch;
    justify-content: center;
    background: var(--vm-surface, #fff);
    padding: 0;
}

/* Inline variant — embedded under the topic picker, not a full-screen overlay. */
.vm-pvl-wrap--inline {
    position: static;
    inset: auto;
    z-index: auto;
    background: var(--vm-surface);
    border: 1px solid var(--vm-border);
    border-radius: var(--vm-radius);
    overflow: hidden;
    margin-top: var(--vm-s-4);
}
.vm-pvl-wrap--inline .vm-pvl-card {
    max-height: none;
    border-radius: 0;
}

.vm-pvl-card {
    background: var(--vm-surface);
    border-radius: 0;
    box-shadow: none;
    width: 100%;
    max-width: 100%;
    padding: var(--vm-s-5) var(--vm-s-6);
    display: flex;
    flex-direction: column;
    gap: var(--vm-s-3);
    max-height: 100dvh;
    overflow-y: auto;
}

.vm-pvl-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--vm-s-3);
}

.vm-pvl-brand-title {
    display: flex;
    align-items: center;
    gap: var(--vm-s-3);
    min-width: 0;
    flex: 1;
}

.vm-pvl-brand {
    height: 22px;
    width: auto;
    flex-shrink: 0;
    opacity: 0.85;
    user-select: none;
    -webkit-user-drag: none;
}

.vm-pvl-greeting {
    font-size: 0.85rem;
    color: var(--vm-muted);
    font-weight: 500;
    margin-bottom: 2px;
}

.vm-pvl-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
    color: var(--vm-text);
}

.vm-pvl-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 2.1rem;
    color: var(--vm-muted);
    line-height: 1;
    padding: 0;
    flex-shrink: 0;
    width: calc(var(--vm-tap) + 6px);
    height: calc(var(--vm-tap) + 6px);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--vm-radius-sm);
    transition: background 0.12s ease, color 0.12s ease;
}
.vm-pvl-close:hover { background: var(--vm-surface-2); color: #1a1f2c; }

/* ── Stage ── */

.vm-pvl-stage {
    background: linear-gradient(150deg, #eef2ff 0%, #f0fdf4 100%);
    border-radius: 16px;
    min-height: 270px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--vm-s-5);
    overflow: hidden;
    position: relative;
}


/* ── Scene containers ── */

.vm-pvl-scene-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--vm-s-3);
    animation: vm-pvl-fadein 0.35s ease both;
    width: 100%;
}

.vm-pvl-scene-inner--row {
    flex-direction: row;
    justify-content: center;
    gap: var(--vm-s-5);
}

@keyframes vm-pvl-fadein {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Scene text ── */

.vm-pvl-scene-label {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
    text-align: center;
}

.vm-pvl-scene-sub {
    font-size: 0.85rem;
    color: var(--vm-muted);
    margin: 0;
    text-align: center;
}

.vm-pvl-tens-word { color: #2962ff; }
.vm-pvl-ones-word { color: #ea580c; }

/* ── Hook scene ── */

.vm-pvl-big-number {
    font-size: 5.5rem;
    font-weight: 900;
    line-height: 1;
    background: linear-gradient(135deg, #2962ff 0%, #7c3aed 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: vm-pvl-pop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.vm-pvl-hook-sub {
    font-size: 1rem;
    font-weight: 500;
    color: var(--vm-muted);
    margin: 0;
    text-align: center;
    animation: vm-pvl-fadein 0.4s 0.35s ease both;
}

@keyframes vm-pvl-pop {
    from { opacity: 0; transform: scale(0.35); }
    60%  { transform: scale(1.13); }
    to   { opacity: 1; transform: scale(1); }
}

/* Centered variants — preserve translateX(-50%) so anchored elements
   (number-line marks/labels) stay aligned to their tick during animation. */
@keyframes vm-pvl-pop-centered {
    from { opacity: 0; transform: translateX(-50%) scale(0.35); }
    60%  { transform: translateX(-50%) scale(1.13); }
    to   { opacity: 1; transform: translateX(-50%) scale(1); }
}
@keyframes vm-pvl-fadein-centered {
    from { opacity: 0; transform: translateX(-50%) translateY(12px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── Hero cube (scene 1) ── */

.vm-pvl-hero-cube {
    width: 76px;
    height: 76px;
    border-radius: 14px;
    background: linear-gradient(135deg, #fb923c, #ea580c);
    box-shadow: 0 6px 24px rgba(234, 88, 12, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 900;
    color: white;
    animation: vm-pvl-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* ── One cube (small, reused) ── */

.vm-pvl-one-cube {
    width: 28px;
    height: 28px;
    border-radius: 5px;
    background: linear-gradient(135deg, #fb923c, #ea580c);
    box-shadow: 0 2px 6px rgba(234, 88, 12, 0.35);
    flex-shrink: 0;
    animation: vm-pvl-cube-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes vm-pvl-cube-pop {
    from { opacity: 0; transform: scale(0.2) rotate(-12deg); }
    60%  { transform: scale(1.18) rotate(3deg); }
    to   { opacity: 1; transform: scale(1) rotate(0); }
}

/* ── Build-ten grid ── */

.vm-pvl-loose-cubes {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    justify-content: center;
    max-width: 185px;
}

/* ── Ten rod ── */

.vm-pvl-ten-rod {
    display: flex;
    flex-direction: column;
    gap: 1px;
    border-radius: 5px;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 3px 12px rgba(41, 98, 255, 0.38);
    animation: vm-pvl-rod-in 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.vm-pvl-rod-cell {
    width: 22px;
    height: 14px;
    background: linear-gradient(90deg, #4d7fff, #2962ff);
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    flex-shrink: 0;
}
.vm-pvl-rod-cell:last-child { border-bottom: none; }

@keyframes vm-pvl-rod-in {
    from { opacity: 0; transform: translateX(-28px) scaleY(0.45); }
    to   { opacity: 1; transform: translateX(0) scaleY(1); }
}

/* ── Build-number layout (24 / 37 scenes) ── */

.vm-pvl-number-build {
    display: flex;
    align-items: center;
    gap: var(--vm-s-4);
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
}

.vm-pvl-block-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--vm-s-2);
}

.vm-pvl-rods-row {
    display: flex;
    gap: 6px;
    align-items: flex-end;
}

.vm-pvl-ones-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    justify-content: center;
    max-width: 127px; /* 4 cubes × 28px + 3 gaps × 5px */
}

.vm-pvl-group-label {
    font-size: 0.82rem;
    font-weight: 700;
    text-align: center;
    animation: vm-pvl-fadein 0.35s 0.85s ease both;
}

.vm-pvl-plus-sign {
    font-size: 2rem;
    font-weight: 700;
    color: #94a3b8;
    flex-shrink: 0;
}

.vm-pvl-equation {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--vm-muted);
    text-align: center;
    animation: vm-pvl-fadein 0.35s ease both;
    margin: 0;
}
.vm-pvl-equation strong {
    color: var(--vm-text);
    font-size: 1.5rem;
    font-weight: 900;
}

/* ── Place value chart ── */

.vm-pvl-chart {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    border: 2.5px solid var(--vm-border);
    border-radius: 12px;
    overflow: hidden;
    animation: vm-pvl-fadein 0.35s ease both;
}

.vm-pvl-chart-head {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.vm-pvl-chart-col {
    padding: 7px 12px;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    border-bottom: 2px solid var(--vm-border);
}

.vm-pvl-chart-col--tens {
    background: #dbeafe;
    color: #2962ff;
    border-right: 2px solid var(--vm-border);
}

.vm-pvl-chart-col--ones {
    background: #ffedd5;
    color: #ea580c;
}

.vm-pvl-chart-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.vm-pvl-chart-digit {
    height: 88px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    font-weight: 900;
    animation: vm-pvl-digit-drop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.vm-pvl-chart-digit--tens {
    color: #2962ff;
    background: #f0f6ff;
    border-right: 2px solid var(--vm-border);
}

.vm-pvl-chart-digit--ones {
    color: #ea580c;
    background: #fff8f5;
}

@keyframes vm-pvl-digit-drop {
    from { opacity: 0; transform: translateY(-40px) scale(1.35); }
    60%  { transform: translateY(5px) scale(0.94); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Done state ── */

.vm-pvl-done-star {
    font-size: 4rem;
    animation: vm-pvl-pop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* ── Narration ── */

.vm-pvl-narration {
    font-size: 0.9rem;
    color: var(--vm-muted);
    text-align: center;
    line-height: 1.55;
    min-height: 2.8em;
    margin: 0;
    animation: vm-pvl-fadein 0.3s ease both;
}

/* ── Progress dots ── */

.vm-pvl-dots {
    display: flex;
    gap: 6px;
    justify-content: center;
}

.vm-pvl-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--vm-border);
    transition: background 0.25s, width 0.25s, border-radius 0.25s;
    flex-shrink: 0;
}

.vm-pvl-dot--active {
    background: var(--vm-primary);
    width: 22px;
    border-radius: 4px;
}

.vm-pvl-dot--done { background: var(--vm-success); }

/* ── Controls ── */

.vm-pvl-controls {
    display: flex;
    gap: 18px;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    background: var(--vm-surface);
    padding: var(--vm-s-3) 0 max(var(--vm-s-3), env(safe-area-inset-bottom));
    z-index: 2;
}

/* Modern round transport controls — Spotify-style, black & white, identical
 * across iOS / Android / desktop (no native button chrome, no emoji glyphs). */
.vm-pvl-ctrl {
    -webkit-appearance: none;
    appearance: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #1a1f2c;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.12s ease, transform 0.06s ease, color 0.12s ease;
}
.vm-pvl-ctrl:hover { background: rgba(0, 0, 0, 0.06); }
.vm-pvl-ctrl:active { transform: scale(0.92); }
.vm-pvl-ctrl:disabled { opacity: 0.3; cursor: default; }
.vm-pvl-ctrl:disabled:hover { background: transparent; }

/* Primary play/pause — solid black filled circle with white glyph */
.vm-pvl-ctrl--main {
    width: 64px;
    height: 64px;
    background: #1a1f2c;
    color: #fff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
}
.vm-pvl-ctrl--main:hover { background: #000; transform: scale(1.04); }
.vm-pvl-ctrl--main:active { transform: scale(0.96); }

/* Skip lesson — muted so it reads as secondary to the transport row */
.vm-pvl-ctrl--skip { color: var(--vm-muted); }
.vm-pvl-ctrl--skip:hover { color: #1a1f2c; }

.vm-pvl-tts-note {
    font-size: 0.75rem;
    color: var(--vm-muted);
    text-align: center;
    margin: 0;
}

/* Header action buttons (fullscreen + close) */
.vm-pvl-header-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

/* Word-by-word highlight during narration */
.vm-pvl-word {
    display: inline;
}
.vm-pvl-word--active {
    background: #fef08a;          /* warm yellow */
    color: #1a1f2c;
    border-radius: 3px;
    padding: 0 2px;
    margin: 0 -2px;
    transition: background 0.08s;
}

/* ── Fullscreen ── */
/* The lesson modal already fills the viewport (white background, no card),
 * so the browser's native fullscreen mode is no longer used. The toggle
 * button has been removed from the player. */

/* Stage scaler — a wrapper with no animation of its own.
 * Scaling this instead of the visual children avoids the animation-override
 * bug: child animations set transform:translateY() which would overwrite
 * transform:scale() if both were on the same element. */
.vm-pvl-stage-scaler {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    transition: transform 0.3s ease;
}

/* ── Interactive prompt ── */

.vm-pvl-interactive {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--vm-s-3);
    animation: vm-pvl-fadein 0.3s ease both;
}

.vm-pvl-interactive-q {
    font-size: 1rem;
    font-weight: 700;
    color: var(--vm-text);
    text-align: center;
    margin: 0;
}

.vm-pvl-interactive-options {
    display: flex;
    gap: var(--vm-s-3);
    justify-content: center;
    flex-wrap: wrap;
}

.vm-pvl-interactive-opt {
    min-width: 64px;
    min-height: 64px;
    border-radius: 14px;
    border: 2.5px solid var(--vm-border);
    background: var(--vm-surface);
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--vm-text);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vm-pvl-interactive-opt:hover:not(:disabled) {
    border-color: var(--vm-primary);
    background: #eff6ff;
    transform: translateY(-2px);
}

.vm-pvl-interactive-opt:active:not(:disabled) {
    transform: scale(0.94);
}

.vm-pvl-interactive-opt--correct {
    border-color: var(--vm-success);
    background: #dcfce7;
    color: var(--vm-success);
    animation: vm-pvl-correct-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.vm-pvl-interactive-opt--wrong {
    border-color: var(--vm-danger);
    background: #fee2e2;
    color: var(--vm-danger);
    animation: vm-pvl-wrong-shake 0.4s ease both;
}

@keyframes vm-pvl-correct-pop {
    from { transform: scale(0.9); }
    60%  { transform: scale(1.15); }
    to   { transform: scale(1); }
}

@keyframes vm-pvl-wrong-shake {
    0%, 100% { transform: translateX(0); }
    20%      { transform: translateX(-6px); }
    40%      { transform: translateX(6px); }
    60%      { transform: translateX(-4px); }
    80%      { transform: translateX(4px); }
}

.vm-pvl-interactive-feedback {
    font-size: 1rem;
    font-weight: 700;
    text-align: center;
    margin: 0;
    animation: vm-pvl-fadein 0.25s ease both;
}

.vm-pvl-interactive-feedback--correct { color: var(--vm-success); }
.vm-pvl-interactive-feedback--wrong   { color: var(--vm-danger); }

/* ── Visual component library (vm-vis-*) ──────────────────────────────────────
 * Shared by all lesson visual components in src/components/visuals/.
 * All animations restart on scene change because components receive a new key.
 */

/* Scene inner wrapper — all visuals use this as root */
.vm-vis-scene-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--vm-s-3);
    animation: vm-pvl-fadein 0.35s ease both;
    width: 100%;
}
.vm-vis-scene-inner--row {
    flex-direction: row;
    justify-content: center;
    gap: var(--vm-s-5);
}

/* Text helpers */
.vm-vis-label { font-size: 1.05rem; font-weight: 700; margin: 0; text-align: center; }
.vm-vis-sub   { font-size: 0.85rem; color: var(--vm-muted); margin: 0; text-align: center; animation: vm-pvl-fadein 0.35s ease both; }
.vm-vis-tens-word { color: #2962ff; }
.vm-vis-ones-word { color: #ea580c; }

/* ── PlaceValueBlocks ── */

.vm-vis-big-number {
    font-size: 5.5rem;
    font-weight: 900;
    line-height: 1;
    background: linear-gradient(135deg, #2962ff 0%, #7c3aed 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: vm-pvl-pop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.vm-vis-hook-sub {
    font-size: 1rem; font-weight: 500; color: var(--vm-muted); margin: 0; text-align: center;
    animation: vm-pvl-fadein 0.4s 0.35s ease both;
}

.vm-vis-hero-cube {
    width: 76px; height: 76px; border-radius: 14px;
    background: linear-gradient(135deg, #fb923c, #ea580c);
    box-shadow: 0 6px 24px rgba(234,88,12,0.45);
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem; font-weight: 900; color: white;
    animation: vm-pvl-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.vm-vis-one-cube {
    width: 28px; height: 28px; border-radius: 5px;
    background: linear-gradient(135deg, #fb923c, #ea580c);
    box-shadow: 0 2px 6px rgba(234,88,12,0.35);
    flex-shrink: 0;
    animation: vm-pvl-cube-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.vm-vis-loose-cubes {
    display: flex; flex-wrap: wrap; gap: 7px;
    justify-content: center; max-width: 185px;
}

.vm-vis-ten-rod {
    display: flex; flex-direction: column; gap: 1px;
    border-radius: 5px; overflow: hidden; flex-shrink: 0;
    box-shadow: 0 3px 12px rgba(41,98,255,0.38);
    animation: vm-pvl-rod-in 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.vm-vis-rod-cell {
    width: 22px; height: 14px;
    background: linear-gradient(90deg, #4d7fff, #2962ff);
    border-bottom: 1px solid rgba(255,255,255,0.18);
    flex-shrink: 0;
}
.vm-vis-rod-cell:last-child { border-bottom: none; }

.vm-vis-number-build {
    display: flex; align-items: center; gap: var(--vm-s-4);
    flex-wrap: wrap; justify-content: center; width: 100%;
}
.vm-vis-block-group { display: flex; flex-direction: column; align-items: center; gap: var(--vm-s-2); }
.vm-vis-rods-row    { display: flex; gap: 6px; align-items: flex-end; }
.vm-vis-ones-wrap   { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; max-width: 127px; }

.vm-vis-group-label {
    font-size: 0.82rem; font-weight: 700; text-align: center;
    animation: vm-pvl-fadein 0.35s 0.85s ease both;
}
.vm-vis-plus-sign { font-size: 2rem; font-weight: 700; color: #94a3b8; flex-shrink: 0; }

/* ── Build-and-snap transformation ── */

/* Phase 1: cubes spin inward and vanish */
.vm-vis-cubes--converge .vm-vis-one-cube {
    animation: vm-vis-cube-converge 0.38s cubic-bezier(0.55, 0, 1, 0.45) both !important;
}

@keyframes vm-vis-cube-converge {
    0%   { opacity: 1; transform: scale(1)    rotate(0deg); }
    100% { opacity: 0; transform: scale(0.05) rotate(60deg); }
}

/* Phase 2: rod snaps in with spring + glow flash */
.vm-vis-rod--snap-in {
    animation: vm-vis-rod-snap-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes vm-vis-rod-snap-in {
    0%   { opacity: 0; transform: scaleY(0.04) scaleX(2.2); box-shadow: 0 0 0 0 rgba(41,98,255,0); }
    45%  { opacity: 1; transform: scaleY(1.1)  scaleX(0.88); box-shadow: 0 0 36px 16px rgba(41,98,255,0.45); }
    72%  { transform: scaleY(0.97) scaleX(1.01); box-shadow: 0 0 12px 4px rgba(41,98,255,0.2); }
    100% { transform: scaleY(1)    scaleX(1);    box-shadow: 0 3px 12px rgba(41,98,255,0.38); }
}

/* Phase 2: label + sub fade up after rod */
.vm-vis-emerge {
    animation: vm-pvl-fadein 0.35s ease both;
    animation-delay: 0.18s;
}

/* ── PlaceValueChart ── */

.vm-vis-chart {
    display: flex; flex-direction: column; align-items: stretch;
    border: 2.5px solid var(--vm-border); border-radius: 12px; overflow: hidden;
    animation: vm-pvl-fadein 0.35s ease both;
}
.vm-vis-chart-head { display: grid; grid-template-columns: 1fr 1fr; }
.vm-vis-chart-col {
    padding: 7px 12px; text-align: center;
    font-size: 0.8rem; font-weight: 800; letter-spacing: 0.07em;
    border-bottom: 2px solid var(--vm-border);
}
.vm-vis-chart-col--tens { background: #dbeafe; color: #2962ff; border-right: 2px solid var(--vm-border); }
.vm-vis-chart-col--ones { background: #ffedd5; color: #ea580c; }
.vm-vis-chart-row { display: grid; grid-template-columns: 1fr 1fr; }
.vm-vis-chart-digit {
    height: 88px; display: flex; align-items: center; justify-content: center;
    font-size: 4rem; font-weight: 900;
    animation: vm-pvl-digit-drop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.vm-vis-chart-digit--tens { color: #2962ff; background: #f0f6ff; border-right: 2px solid var(--vm-border); }
.vm-vis-chart-digit--ones { color: #ea580c; background: #fff8f5; }

/* Shared equation */
.vm-vis-equation {
    font-size: 1.25rem; font-weight: 600; color: var(--vm-muted);
    text-align: center; margin: 0;
    animation: vm-pvl-fadein 0.35s ease both;
}
.vm-vis-equation strong { color: var(--vm-text); font-size: 1.5rem; font-weight: 900; }

/* ── AnimatedDots ── */

.vm-vis-dots-row {
    display: flex; align-items: center; gap: var(--vm-s-4); flex-wrap: wrap; justify-content: center;
}
.vm-vis-dot-grid {
    display: flex; flex-wrap: wrap; gap: 6px;
    justify-content: center; max-width: 140px;
}
.vm-vis-dot {
    width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
    animation: vm-pvl-cube-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.vm-vis-dot-count {
    width: 100%; text-align: center; font-size: 1.1rem; font-weight: 800;
    animation: vm-pvl-fadein 0.3s ease both;
}
.vm-vis-op-sign { font-size: 2.5rem; font-weight: 700; color: #64748b; flex-shrink: 0; }

/* ── NumberSequence ── */

.vm-vis-sequence {
    display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: center;
}
.vm-vis-seq-bubble {
    min-width: 44px; height: 44px; border-radius: 10px;
    background: #eff6ff; border: 2px solid var(--vm-primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem; font-weight: 800; color: var(--vm-primary);
    animation: vm-pvl-cube-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.vm-vis-seq-bubble--blank { background: #f8fafc; border-style: dashed; color: #94a3b8; }
.vm-vis-seq-bubble--hi    { background: #fff7ed; border-color: #ea580c; color: #ea580c; }
.vm-vis-seq-arrow { font-size: 1.2rem; color: #94a3b8; flex-shrink: 0; }

/* ── NumberLine ── */

.vm-vis-numline {
    width: 100%;
    max-width: 520px;
    padding: 28px 18px 12px;
    position: relative;
    animation: vm-pvl-fadein 0.4s ease both;
}

.vm-vis-numline-axis {
    position: relative;
    height: 4px;
    background: linear-gradient(90deg, #cbd5e1, #64748b, #cbd5e1);
    border-radius: 2px;
    /* No horizontal margin: ticks/marks must share the same width as the
       jumps container above so percentages line up. */
    margin: 24px 0 12px;
}

.vm-vis-numline-tick {
    position: absolute;
    top: -7px;
    width: 2px;
    height: 14px;
    background: #64748b;
    transform: translateX(-50%);
    border-radius: 1px;
}
.vm-vis-numline-tick--labeled { height: 18px; top: -9px; background: #334155; width: 2.5px; }
.vm-vis-numline-tick--zero    { background: #1e293b; width: 3px; }

.vm-vis-numline-tick-label {
    position: absolute;
    top: 22px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.78rem;
    font-weight: 700;
    color: #475569;
    white-space: nowrap;
}

.vm-vis-numline-mark {
    position: absolute;
    top: -10px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 3px solid #ffffff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.25);
    transform: translateX(-50%);
    animation: vm-pvl-pop-centered 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.vm-vis-numline-mark-label {
    position: absolute;
    top: 44px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.85rem;
    font-weight: 800;
    white-space: nowrap;
    animation: vm-pvl-fadein-centered 0.35s ease both;
}

.vm-vis-numline-jumps {
    position: relative;
    height: 56px;
    margin-bottom: -10px;
}

.vm-vis-numline-jump {
    position: absolute;
    bottom: 6px;
    height: 32px;
    border-top: 2.5px solid #ea580c;
    border-left: 2.5px solid #ea580c;
    border-right: 2.5px solid #ea580c;
    border-radius: 16px 16px 0 0;
    animation: vm-vis-numline-jump-in 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.vm-vis-numline-jump--back {
    border-top-color: #2962ff;
    border-left-color: #2962ff;
    border-right-color: #2962ff;
}

.vm-vis-numline-jump::after {
    content: "";
    position: absolute;
    right: -7px;
    bottom: -8px;
    width: 0; height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 9px solid #ea580c;
}
.vm-vis-numline-jump--back::after {
    right: auto;
    left: -7px;
    border-top-color: #2962ff;
}

.vm-vis-numline-jump-label {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.85rem;
    font-weight: 800;
    color: #ea580c;
    white-space: nowrap;
}
.vm-vis-numline-jump--back .vm-vis-numline-jump-label { color: #2962ff; }

/* ── Admin operations dashboard (issue #98) ──────────────────────────────── */
.vm-admin {
    max-width: 1180px;
    margin: 0 auto;
    padding: var(--vm-s-5) var(--vm-s-4) var(--vm-s-8);
}
.vm-admin-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--vm-s-2);
    margin-bottom: var(--vm-s-5);
}
.vm-admin-title { font-size: 1.6rem; font-weight: 800; margin: 0; }
.vm-admin-sub {
    display: flex;
    align-items: center;
    gap: var(--vm-s-4);
    color: var(--vm-muted);
    font-size: 0.85rem;
}
.vm-admin-back { color: var(--vm-primary); text-decoration: none; font-weight: 600; }
.vm-admin-back:hover { text-decoration: underline; }
.vm-admin-muted { color: var(--vm-muted); }
.vm-admin-error { color: var(--vm-danger); font-weight: 600; }

.vm-admin-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: var(--vm-s-3);
    margin-bottom: var(--vm-s-5);
}
.vm-admin-kpi {
    background: var(--vm-surface);
    border: 1px solid var(--vm-border);
    border-radius: var(--vm-radius);
    padding: var(--vm-s-4);
    box-shadow: var(--vm-shadow);
}
.vm-admin-kpi--accent { background: linear-gradient(135deg, #1a7f37, #15803d); border-color: transparent; color: #fff; }
.vm-admin-kpi--accent .vm-admin-kpi-label,
.vm-admin-kpi--accent .vm-admin-kpi-sub { color: rgba(255,255,255,0.85); }
.vm-admin-kpi--warn { border-color: #f0a500; }
.vm-admin-kpi-label { font-size: 0.78rem; color: var(--vm-muted); text-transform: uppercase; letter-spacing: 0.03em; }
.vm-admin-kpi-value { font-size: 1.5rem; font-weight: 800; margin-top: var(--vm-s-1); line-height: 1.1; }
.vm-admin-kpi-sub { font-size: 0.8rem; color: var(--vm-muted); margin-top: var(--vm-s-1); }

.vm-admin-panel {
    background: var(--vm-surface);
    border: 1px solid var(--vm-border);
    border-radius: var(--vm-radius);
    padding: var(--vm-s-5);
    margin-bottom: var(--vm-s-5);
    box-shadow: var(--vm-shadow);
}
.vm-admin-panel-title { font-size: 1.1rem; font-weight: 700; margin: 0 0 var(--vm-s-4); }
.vm-admin-h4 { font-size: 0.85rem; font-weight: 700; margin: var(--vm-s-4) 0 var(--vm-s-2); color: var(--vm-text); }

.vm-admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: var(--vm-s-3);
}
.vm-admin-stat {
    background: var(--vm-surface-2);
    border: 1px solid var(--vm-border);
    border-radius: var(--vm-radius-sm);
    padding: var(--vm-s-3);
    text-align: center;
}
.vm-admin-stat--warn { border-color: #f0a500; background: #fff8e6; }
.vm-admin-stat-value { font-size: 1.25rem; font-weight: 800; }
.vm-admin-stat-label { font-size: 0.72rem; color: var(--vm-muted); margin-top: 2px; }

.vm-admin-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--vm-s-5);
    margin-top: var(--vm-s-3);
}
.vm-admin-list { list-style: none; margin: 0; padding: 0; }
.vm-admin-list li {
    display: flex;
    justify-content: space-between;
    gap: var(--vm-s-3);
    padding: 4px 0;
    border-bottom: 1px solid var(--vm-border);
    font-size: 0.85rem;
}
.vm-admin-list li span { color: var(--vm-muted); }
.vm-admin-ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

.vm-admin-bars { margin-top: var(--vm-s-4); }
.vm-admin-bars-track {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 90px;
    padding-top: var(--vm-s-2);
}
.vm-admin-bar { flex: 1; display: flex; align-items: flex-end; height: 100%; }
.vm-admin-bar-fill { width: 100%; min-height: 2px; background: var(--vm-primary); border-radius: 2px 2px 0 0; }

.vm-admin-funnel { display: flex; flex-direction: column; gap: var(--vm-s-2); margin-bottom: var(--vm-s-4); }
.vm-admin-funnel-row { display: grid; grid-template-columns: 130px 1fr 110px; align-items: center; gap: var(--vm-s-3); }
.vm-admin-funnel-label { font-size: 0.85rem; font-weight: 600; }
.vm-admin-funnel-bar { background: var(--vm-surface-2); border-radius: 6px; height: 22px; overflow: hidden; }
.vm-admin-funnel-fill { height: 100%; background: linear-gradient(90deg, #2962ff, #1a7f37); border-radius: 6px; }
.vm-admin-funnel-val { font-size: 0.8rem; color: var(--vm-muted); text-align: right; }

.vm-admin-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.vm-admin-table th { text-align: left; color: var(--vm-muted); font-weight: 600; padding: 4px 6px; border-bottom: 1px solid var(--vm-border); }
.vm-admin-table td { padding: 4px 6px; border-bottom: 1px solid var(--vm-border); max-width: 240px; }
.vm-admin-num { text-align: right; white-space: nowrap; }
.vm-admin-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.75rem; }
.vm-admin-cohort-cell { display: inline-block; min-width: 38px; text-align: center; border-radius: 4px; padding: 1px 4px; color: #fff; font-weight: 600; }
.vm-admin-cohort td:first-child { white-space: nowrap; }

@media (max-width: 640px) {
    .vm-admin-funnel-row { grid-template-columns: 96px 1fr 84px; }
}


@keyframes vm-vis-numline-jump-in {
    0%   { opacity: 0; transform: translateY(8px) scaleX(0.4); transform-origin: left center; }
    60%  { opacity: 1; }
    100% { opacity: 1; transform: translateY(0) scaleX(1); }
}

/* ── FractionBar ── */

.vm-vis-fbar-row {
    display: flex;
    align-items: center;
    gap: var(--vm-s-3);
    flex-wrap: wrap;
    justify-content: center;
}

.vm-vis-fbar {
    display: flex;
    border: 2.5px solid #334155;
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
    height: 56px;
    width: clamp(220px, 60vw, 360px);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.vm-vis-fbar-cell {
    flex: 1 1 0;
    border-right: 1.5px solid #334155;
    background: #ffffff;
    animation: vm-pvl-fadein 0.3s ease both;
}
.vm-vis-fbar-cell:last-child { border-right: none; }

.vm-vis-fbar-cell--filled {
    animation: vm-vis-fbar-fill 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes vm-vis-fbar-fill {
    0%   { transform: scaleY(0); transform-origin: bottom; opacity: 0; }
    60%  { opacity: 1; }
    100% { transform: scaleY(1); opacity: 1; }
}

/* ═══ Levels + Placement (#68) ═══════════════════════════════════════════════ */

/* Overall Level + XP strip (kid home + progress) */
.vm-level-strip {
    display: flex;
    align-items: center;
    gap: var(--vm-s-3);
    background: var(--vm-surface);
    border: 1px solid var(--vm-border);
    border-radius: 14px;
    padding: 12px 16px;
    margin: 4px 0 8px;
}
.vm-level-strip--prog { margin: 8px 0 16px; }
.vm-level-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 56px;
    height: 56px;
    border-radius: 12px;
    background: #f3f0ff;
    border: 1px solid #e5dbff;
    color: #6741d9;
}
.vm-level-badge-num { font-size: 1.5rem; font-weight: 700; line-height: 1; }
.vm-level-badge-word { font-size: 0.55rem; font-weight: 600; letter-spacing: 0.1em; opacity: 0.8; }
.vm-level-xp { flex: 1; min-width: 0; }
.vm-level-xp-bar {
    height: 10px;
    background: var(--vm-surface-2);
    border: 1px solid var(--vm-border);
    border-radius: 999px;
    overflow: hidden;
}
.vm-level-xp-bar > span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #7048e8, #9775fa);
    border-radius: 999px;
    transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.vm-level-xp-text { display: block; margin-top: 5px; font-size: 0.78rem; color: var(--vm-muted); font-weight: 500; }

/* Topic level chip on the progress cards */
.vm-tc-level {
    align-self: flex-start;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 2px 9px;
    margin-bottom: 4px;
}

/* Level-up celebration on the session-complete screen */
.vm-levelup-list { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 6px; }
.vm-levelup {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f3f0ff;
    border: 1px solid #d6c8fb;
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 0.9rem;
    color: #5f3dc4;
    animation: vm-levelup-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.vm-levelup--overall { margin-top: 10px; background: linear-gradient(135deg, #fff3bf, #ffec99); border-color: #ffd43b; color: #845ef7; font-weight: 700; }
.vm-levelup-spark { font-size: 1.1rem; }
@keyframes vm-levelup-pop {
    0%   { opacity: 0; transform: scale(0.8) translateY(6px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* Assessment / placement page */
.vm-assess { width: 100%; max-width: 520px; margin: 0 auto; }
.vm-assess-intro, .vm-assess-done {
    text-align: center;
    padding: 32px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}
.vm-assess-emoji { font-size: 3rem; }
.vm-assess-title { font-size: 1.6rem; font-weight: 800; margin: 0; }
.vm-assess-sub { color: var(--vm-muted); margin: 0; line-height: 1.5; max-width: 420px; }
.vm-assess-skip {
    background: none;
    border: none;
    color: var(--vm-muted);
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 6px;
}
.vm-btn-lg { font-size: 1.05rem; padding: 14px 28px; }

.vm-assess-q { padding: 16px 4px; }
.vm-assess-progress { margin-bottom: 18px; }
.vm-assess-progress-bar {
    height: 8px;
    background: var(--vm-surface-2, #f1f3f5);
    border-radius: 999px;
    overflow: hidden;
}
.vm-assess-progress-bar > span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #7048e8, #9775fa);
    transition: width 0.4s ease;
}
.vm-assess-progress-text { display: block; margin-top: 6px; font-size: 0.78rem; color: var(--vm-muted); text-align: center; }
.vm-assess-prompt { font-size: 1.5rem; font-weight: 700; text-align: center; margin: 8px 0 22px; line-height: 1.3; }

.vm-assess-numpad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    max-width: 300px;
    margin: 0 auto;
}
.vm-assess-key {
    font-size: 1.4rem;
    font-weight: 700;
    padding: 16px 0;
    border: 1px solid var(--vm-border);
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
}
.vm-assess-key:active { transform: scale(0.96); }
.vm-assess-key--go { background: var(--vm-primary, #2962ff); color: #fff; border-color: transparent; }
.vm-assess-key--go:disabled { opacity: 0.5; cursor: not-allowed; }

.vm-assess-choices { display: grid; gap: 10px; max-width: 340px; margin: 0 auto; }
.vm-assess-choice {
    font-size: 1.2rem;
    font-weight: 600;
    padding: 16px;
    border: 1.5px solid var(--vm-border);
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
}
.vm-assess-choice:active { transform: scale(0.98); }

.vm-assess-results { list-style: none; padding: 0; margin: 8px 0 16px; width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 8px; }
.vm-assess-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: #fff;
    border: 1px solid var(--vm-border);
    border-radius: 10px;
    padding: 10px 14px;
}
.vm-assess-result-topic { font-weight: 600; }
.vm-assess-result-level { font-size: 0.75rem; font-weight: 700; border-radius: 999px; padding: 3px 10px; }


.vm-vis-fbar-label {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-weight: 900;
    font-size: 1.4rem;
    line-height: 1;
    animation: vm-pvl-fadein 0.35s ease both;
}
.vm-vis-fbar-num,
.vm-vis-fbar-den { font-variant-numeric: tabular-nums; }
.vm-vis-fbar-bar {
    display: block;
    width: 22px;
    height: 2.5px;
    background: currentColor;
    border-radius: 2px;
    margin: 2px 0;
}

.vm-vis-fbar-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--vm-s-3);
    width: 100%;
}

.vm-vis-fbar-op {
    font-size: 1.8rem;
    font-weight: 900;
    color: #475569;
    line-height: 1;
    animation: vm-pvl-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* ── ArrayGrid ── */

.vm-vis-array-grid {
    display: grid;
    gap: 8px;
    padding: 6px;
    max-width: 320px;
    animation: vm-pvl-fadein 0.3s ease both;
}

.vm-vis-array-dot {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.18);
    animation: vm-pvl-cube-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.vm-vis-area-wrap {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: stretch;
    gap: 6px;
    animation: vm-pvl-fadein 0.35s ease both;
}

.vm-vis-area-stack {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.vm-vis-area-side {
    font-size: 1.05rem;
    font-weight: 800;
    color: #1e293b;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
}
.vm-vis-area-side--top  { padding-bottom: 2px; }
.vm-vis-area-side--left { padding-right: 4px; align-self: center; }

.vm-vis-area-rect {
    border-radius: 10px;
    min-height: 90px;
    width: clamp(180px, 50vw, 280px);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(41, 98, 255, 0.32);
    animation: vm-pvl-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.vm-vis-area-product {
    color: #ffffff;
    font-size: 2rem;
    font-weight: 900;
    line-height: 1;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    animation: vm-pvl-fadein 0.3s 0.35s ease both;
}

.vm-vis-area-grid {
    display: grid;
    gap: 3px;
    width: clamp(220px, 55vw, 320px);
    min-height: 130px;
    background: #334155;
    padding: 3px;
    border-radius: 10px;
}

.vm-vis-area-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 800;
    text-align: center;
    padding: 4px;
    line-height: 1.15;
    box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.18);
    animation: vm-pvl-pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.vm-vis-area-cell-label {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
    word-break: keep-all;
}

/* ── EquationSteps ── */

.vm-vis-eqsteps {
    width: 100%;
    max-width: 420px;
    gap: var(--vm-s-2);
}
.vm-vis-eqsteps--center { align-items: center; }
.vm-vis-eqsteps--left   { align-items: flex-start; padding-left: 8px; }

.vm-vis-eqsteps-row {
    display: flex;
    flex-direction: column;
    align-items: inherit;
    animation: vm-pvl-fadein 0.45s ease both;
}

.vm-vis-eqsteps-op {
    font-size: 0.78rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 2px;
    animation: vm-pvl-fadein 0.4s ease both;
}

.vm-vis-eqsteps-eq {
    font-family: ui-monospace, "Cascadia Mono", "JetBrains Mono", Consolas, monospace;
    font-size: 1.45rem;
    font-weight: 800;
    color: #1e293b;
    line-height: 1.2;
    letter-spacing: 0.2px;
}

.vm-vis-eqsteps-row--final .vm-vis-eqsteps-eq {
    font-size: 1.7rem;
    font-weight: 900;
}

/* ── CoordinatePlane ── */

.vm-vis-plane {
    width: clamp(240px, 70vw, 360px);
    height: auto;
    aspect-ratio: 1;
    animation: vm-pvl-fadein 0.4s ease both;
}

.vm-vis-plane-grid line { animation: vm-pvl-fadein 0.4s ease both; }

.vm-vis-plane-line {
    stroke-dasharray: 800;
    stroke-dashoffset: 800;
    animation: vm-vis-plane-draw 0.9s ease 0.4s forwards;
}

@keyframes vm-vis-plane-draw {
    to { stroke-dashoffset: 0; }
}

.vm-vis-plane-point {
    animation: vm-pvl-pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    transform-box: fill-box;
    transform-origin: center;
}

.vm-vis-plane-shape {
    animation: vm-pvl-fadein 0.5s 0.2s ease both;
}

/* ── BarDiagram ── */

.vm-vis-bardiag-stack {
    display: flex;
    flex-direction: column;
    gap: var(--vm-s-3);
    width: 100%;
    max-width: 460px;
}

.vm-vis-bardiag-row {
    display: grid;
    grid-template-columns: minmax(0, auto) 1fr;
    gap: 10px;
    align-items: center;
}

.vm-vis-bardiag-side {
    font-size: 0.92rem;
    font-weight: 800;
    color: #334155;
    min-width: 56px;
    text-align: right;
    white-space: nowrap;
}

.vm-vis-bardiag-bar {
    display: flex;
    height: 44px;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid #334155;
    background: #ffffff;
    position: relative;
}

.vm-vis-bardiag-bar--ratio,
.vm-vis-bardiag-bar--fraction {
    gap: 0;
    border-radius: 8px;
}

.vm-vis-bardiag-bar--percent {
    background: #f1f5f9;
}

.vm-vis-bardiag-seg {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 800;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    border-right: 1.5px solid rgba(255, 255, 255, 0.45);
    animation: vm-vis-bardiag-grow 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    transform-origin: left center;
    overflow: hidden;
    white-space: nowrap;
}
.vm-vis-bardiag-seg:last-child { border-right: none; }

.vm-vis-bardiag-fill {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 800;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
    height: 100%;
    animation: vm-vis-bardiag-grow 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    transform-origin: left center;
    border-radius: 8px 0 0 8px;
}

.vm-vis-bardiag-tick {
    position: absolute;
    top: 0; bottom: 0;
    width: 1px;
    background: rgba(15, 23, 42, 0.18);
    pointer-events: none;
}

.vm-vis-bardiag-unit {
    flex: 1 1 0;
    border-right: 1.5px solid #334155;
    animation: vm-pvl-fadein 0.3s ease both;
}
.vm-vis-bardiag-unit:last-child { border-right: none; }

.vm-vis-bardiag-seg-label { padding: 0 6px; }

@keyframes vm-vis-bardiag-grow {
    0%   { transform: scaleX(0); opacity: 0; }
    60%  { opacity: 1; }
    100% { transform: scaleX(1); opacity: 1; }
}

/* ── GeometryShape ── */

.vm-vis-shape {
    width: clamp(240px, 75vw, 380px);
    height: auto;
    aspect-ratio: 320 / 220;
    animation: vm-pvl-fadein 0.45s ease both;
}

.vm-vis-shape polygon,
.vm-vis-shape circle,
.vm-vis-shape line {
    stroke-linejoin: round;
    stroke-linecap: round;
}

/* ═══════════════════════════════════════════════════════════════════════════
   QUIZ-LOOK PROTOTYPE  (revertable)
   Scoped under .vm-quiz-look (added to the answering view) plus the standalone
   .vm-missed-so-far panel. To remove the prototype entirely: delete this whole
   block and set QUIZ_LOOK = false in src/pages/PracticeSession.jsx.
   ═══════════════════════════════════════════════════════════════════════════ */

/* Immersive layout — the question sits right under the progress dots and the
   answer choices sit directly beneath it. No vertical centering / dead space,
   no card chrome. Just the question and the choices. */
.vm-quiz-look .vm-session-problem-area {
    flex: 0 0 auto;
    justify-content: flex-start;
    background: none;
    border: none;
    box-shadow: none;
    padding: var(--vm-s-4, 16px) var(--vm-s-4) var(--vm-s-2);
    gap: var(--vm-s-2, 8px);
    overflow: visible;
}
.vm-quiz-look .vm-session-prompt {
    font-weight: 500;
    color: var(--vm-text);
    line-height: 1.3;
}

/* Topic breadcrumb Common-Core code */
.vm-quiz-look .vm-session-active-cc {
    color: var(--vm-muted);
    font-weight: 600;
}

/* Report issue — tucked into the top-right, unobtrusive, never centered */
.vm-quiz-look .vm-report-row {
    order: -1;
    justify-content: flex-end;
    margin-bottom: calc(-1 * var(--vm-s-2, 8px));
}
.vm-quiz-look .vm-report-trigger {
    font-size: 0.7rem;
    opacity: 0.4;
}
.vm-quiz-look .vm-report-trigger:hover { opacity: 0.9; }

/* Choices sit right under the question */
.vm-quiz-look .vm-session-mc { padding-top: var(--vm-s-2); }
.vm-quiz-look .vm-session-numeric { padding-top: var(--vm-s-2); }

/* Multiple-choice answers — clean, full-width, rounded */
.vm-quiz-look .vm-choice-btn {
    border-radius: 14px;
    border: 1.5px solid var(--vm-border);
    background: var(--vm-surface-2);
    font-weight: 500;
    transition: border-color .12s ease, background .12s ease, transform .06s ease;
}
.vm-quiz-look .vm-choice-btn:hover {
    border-color: var(--vm-primary);
    background: var(--vm-surface);
}
.vm-quiz-look .vm-choice-btn:active { transform: scale(0.99); }

/* ── "Questions missed so far" panel ── */
.vm-missed-so-far {
    margin-top: auto;
    border-top: 1px solid var(--vm-border);
    padding-top: var(--vm-s-3, 12px);
}
.vm-msf-header {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    padding: 8px 0;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    color: #b42318;
}
.vm-msf-caret {
    display: inline-block;
    transition: transform .15s ease;
    transform: rotate(-90deg);
    font-size: 0.8em;
}
.vm-msf-caret--open { transform: rotate(0deg); }

.vm-msf-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 6px;
}
.vm-msf-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 12px 14px;
    border: 1px solid var(--vm-border);
    border-radius: var(--vm-radius-sm);
    background: var(--vm-surface);
}
.vm-msf-q {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
}
.vm-msf-prompt {
    font-weight: 700;
    color: var(--vm-text);
}
.vm-msf-time {
    font-size: 0.75rem;
    color: var(--vm-muted);
    background: var(--vm-surface-2);
    border-radius: 999px;
    padding: 1px 9px;
    white-space: nowrap;
}
.vm-msf-watch {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--vm-primary);
    background: rgba(41, 98, 255, 0.08);
    border: none;
    border-radius: 999px;
    padding: 3px 11px;
    cursor: pointer;
    white-space: nowrap;
}
.vm-msf-watch:hover { background: rgba(41, 98, 255, 0.15); }
.vm-msf-yours { font-size: 0.9rem; color: #b42318; }
.vm-msf-yours--correct { color: #1a7f37; }
.vm-msf-correct { font-size: 0.9rem; color: #1a7f37; }
.vm-msf-yours strong, .vm-msf-correct strong { font-weight: 800; }
.vm-msf-item--correct { border-left: 3px solid #1a7f37; }
.vm-msf-explain {
    margin-top: 4px;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #1d4ed8;
}
@media (min-width: 640px) {
    .vm-msf-prompt { font-size: 1rem; }
}
/* ════════════════════════ END QUIZ-LOOK PROTOTYPE ════════════════════════ */

/* ════════════════════════ Admin content review ════════════════════════════ */
.vm-cr { max-width: 1280px; }

.vm-cr-grades {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: var(--vm-s-4);
}
.vm-cr-grade {
    padding: 7px 14px;
    border-radius: 99px;
    border: 1.5px solid var(--vm-border);
    background: var(--vm-surface);
    color: var(--vm-text);
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .12s, border-color .12s, color .12s;
}
.vm-cr-grade:hover { background: var(--vm-surface-2); }
.vm-cr-grade--active {
    background: var(--vm-primary);
    border-color: var(--vm-primary);
    color: #fff;
}

.vm-cr-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--vm-s-3);
    margin-bottom: var(--vm-s-4);
}
.vm-cr-counts { color: var(--vm-muted); font-size: 0.9rem; }
.vm-cr-flagchip {
    color: var(--vm-danger);
    font-weight: 700;
}
.vm-cr-issuechip {
    color: #b45309;
    font-weight: 700;
}
.vm-cr-scan-btn {
    border: 1.5px solid #f59e0b;
    background: #fffbeb;
    color: #b45309;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
}
.vm-cr-scan-btn:hover:not(:disabled) { background: #fef3c7; }
.vm-cr-scan-btn:disabled { opacity: 0.55; cursor: default; }
.vm-cr-filters { display: flex; align-items: center; gap: 8px; }
.vm-cr-select {
    padding: 6px 10px;
    border-radius: 8px;
    border: 1.5px solid var(--vm-border);
    background: var(--vm-surface);
    font-size: 0.85rem;
}
.vm-cr-seg {
    display: inline-flex;
    border: 1.5px solid var(--vm-border);
    border-radius: 8px;
    overflow: hidden;
}
.vm-cr-seg-btn {
    padding: 6px 12px;
    background: var(--vm-surface);
    border: none;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--vm-muted);
    cursor: pointer;
}
.vm-cr-seg-btn + .vm-cr-seg-btn { border-left: 1.5px solid var(--vm-border); }
.vm-cr-seg-btn--active { background: var(--vm-primary); color: #fff; }

/* Card grid */
.vm-cr-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--vm-s-3);
    align-items: start;
}
.vm-cr-card {
    background: var(--vm-surface);
    border: 1px solid var(--vm-border);
    border-radius: var(--vm-radius, 12px);
    padding: var(--vm-s-3);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.vm-cr-card--flag { border-color: var(--vm-danger); box-shadow: 0 0 0 1px var(--vm-danger) inset; }
.vm-cr-card--fixed { border-color: #1f9c5b; box-shadow: 0 0 0 1px #1f9c5b inset; }
.vm-cr-card--wontfix { border-color: var(--vm-border); box-shadow: none; opacity: 0.7; }

.vm-cr-card-meta { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.vm-cr-tag {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 99px;
    background: var(--vm-surface-2);
    color: var(--vm-muted);
    white-space: nowrap;
}
.vm-cr-tag--sub { background: #eef2ff; color: #4338ca; }
.vm-cr-tag--diff { background: #fef3c7; color: #b45309; }
.vm-cr-tag--type { background: #e0f2fe; color: #0369a1; }
.vm-cr-tag--diag { background: #fae8ff; color: #a21caf; }
.vm-cr-status {
    margin-left: auto;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 99px;
}
.vm-cr-status--open { background: #fee2e2; color: #b42318; }
.vm-cr-status--fixed { background: #dcfce7; color: #1f7a45; }
.vm-cr-status--wontfix { background: var(--vm-surface-2); color: var(--vm-muted); }

.vm-cr-prompt {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--vm-text);
    margin: 2px 0;
    line-height: 1.35;
}
.vm-cr-visual { display: flex; justify-content: center; min-height: 0; }
.vm-cr-visual:empty { display: none; }

.vm-cr-choices { display: flex; flex-wrap: wrap; gap: 6px; }
.vm-cr-choice {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 8px;
    border: 1px solid var(--vm-border);
    background: var(--vm-surface-2);
    color: var(--vm-text);
}
.vm-cr-choice--correct {
    background: #dcfce7;
    border-color: #1f9c5b;
    color: #1f7a45;
}
.vm-cr-answer { font-size: 0.9rem; color: var(--vm-text); }

.vm-cr-hints { font-size: 0.85rem; color: var(--vm-muted); }
.vm-cr-hints summary { cursor: pointer; font-weight: 600; }
.vm-cr-hints ol { margin: 6px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 3px; }

.vm-cr-auto {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 0.82rem;
    color: #92400e;
}
.vm-cr-auto-label { font-weight: 800; display: block; margin-bottom: 3px; }
.vm-cr-auto ul { margin: 0; padding-left: 16px; display: flex; flex-direction: column; gap: 2px; }

.vm-cr-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
    padding-top: 6px;
    border-top: 1px solid var(--vm-border);
}
.vm-cr-id { font-size: 0.72rem; color: var(--vm-muted); }
.vm-cr-foot-actions { display: flex; align-items: center; gap: 6px; }
.vm-cr-ok-btn {
    border: 1px solid #1f9c5b;
    background: var(--vm-surface);
    color: #1f7a45;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 99px;
    cursor: pointer;
}
.vm-cr-ok-btn:hover:not(:disabled) { background: #dcfce7; }
.vm-cr-ok-btn:disabled { opacity: 0.55; cursor: default; }
.vm-cr-clear-btn {
    border: 1px solid var(--vm-border);
    background: var(--vm-surface);
    color: var(--vm-muted);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 99px;
    cursor: pointer;
}
.vm-cr-clear-btn:hover:not(:disabled) { background: var(--vm-surface-2); }
.vm-cr-clear-btn:disabled { opacity: 0.55; cursor: default; }
.vm-cr-flag-btn {
    border: 1px solid var(--vm-border);
    background: var(--vm-surface);
    color: var(--vm-danger);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 99px;
    cursor: pointer;
}
.vm-cr-flag-btn:hover { background: #fff0f0; }
.vm-cr-flag-btn--edit { color: var(--vm-primary); }
.vm-cr-flag-btn--edit:hover { background: #eef2ff; }

.vm-cr-note-read {
    font-size: 0.85rem;
    font-style: italic;
    color: var(--vm-text);
    margin: 0;
}
.vm-cr-note-by { font-style: normal; color: var(--vm-muted); }

.vm-cr-flagbox { display: flex; flex-direction: column; gap: 8px; }
.vm-cr-note {
    width: 100%;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1.5px solid var(--vm-border);
    font-size: 0.875rem;
    font-family: inherit;
    resize: vertical;
}
.vm-cr-flag-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.vm-cr-flag-spacer { flex: 1; }
.vm-cr-clear, .vm-cr-cancel {
    background: none;
    border: none;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    padding: 5px 8px;
}
.vm-cr-clear { color: var(--vm-danger); }
.vm-cr-cancel { color: var(--vm-muted); }


/* ── Car Mode ──────────────────────────────────────────────────────────────── */

.vm-car-shell {
    min-height: 100dvh;
    background: #0f1923;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 0 0 env(safe-area-inset-bottom);
    position: relative;
    overflow: hidden;
}

.vm-car-shell--correct { background: #0d2e1a; }
.vm-car-shell--wrong   { background: #2a0f0f; }

/* Progress bar */
.vm-car-progress {
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.1);
    flex-shrink: 0;
}
.vm-car-progress-fill {
    height: 100%;
    background: var(--vm-success);
    transition: width 0.4s ease;
}

.vm-car-counter {
    font-size: 0.9rem;
    opacity: 0.5;
    margin: 12px 0 0;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Prompt area */
.vm-car-prompt-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 28px;
    text-align: center;
    gap: 20px;
    width: 100%;
}

.vm-car-prompt {
    font-size: clamp(2rem, 6vw + 1rem, 3.5rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin: 0;
}

.vm-car-heard {
    font-size: 1.1rem;
    opacity: 0.7;
    margin: 0;
}

.vm-car-feedback {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    font-weight: 600;
    margin: 0;
    opacity: 0.95;
}

/* Mic indicator */
.vm-car-mic {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    opacity: 0.4;
    transition: opacity 0.3s;
    font-size: 0.875rem;
    letter-spacing: 0.04em;
}
.vm-car-mic--active {
    opacity: 1;
    color: #4ade80;
}
.vm-car-mic--active svg {
    animation: vm-car-pulse 1.2s ease-in-out infinite;
}

@keyframes vm-car-pulse {
    0%, 100% { transform: scale(1);   opacity: 1; }
    50%       { transform: scale(1.15); opacity: 0.7; }
}

/* Tap-to-answer button (iOS, where the mic needs a fresh user gesture) */
.vm-car-mic-tap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: var(--vm-success);
    border: none;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    box-shadow: 0 0 0 0 rgba(74,222,128,0.5);
    animation: vm-car-tap-pulse 1.6s ease-out infinite;
}
.vm-car-mic-tap:active { transform: scale(0.96); }

@keyframes vm-car-tap-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(74,222,128,0.5); }
    70%  { box-shadow: 0 0 0 24px rgba(74,222,128,0); }
    100% { box-shadow: 0 0 0 0 rgba(74,222,128,0); }
}

/* Buttons */
.vm-car-end-btn {
    width: calc(100% - 48px);
    max-width: 480px;
    min-height: 72px;
    background: rgba(255,255,255,0.08);
    border: 1.5px solid rgba(255,255,255,0.15);
    border-radius: 16px;
    color: #fff;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: max(24px, env(safe-area-inset-bottom));
    transition: background 0.15s;
    flex-shrink: 0;
}
.vm-car-end-btn:active { background: rgba(255,255,255,0.14); }

.vm-car-commands-hint {
    margin: 0 0 14px;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.45);
    text-align: center;
    flex-shrink: 0;
}

.vm-car-start-btn {
    width: 100%;
    max-width: 320px;
    min-height: 80px;
    background: var(--vm-success);
    border: none;
    border-radius: 20px;
    color: #fff;
    font-size: 1.5rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 32px;
    transition: opacity 0.15s;
}
.vm-car-start-btn:active { opacity: 0.85; }
.vm-car-start-btn:disabled { opacity: 0.5; cursor: default; }

/* Topic selector chips (ready screen) */
.vm-car-topics {
    width: 100%;
    max-width: 480px;
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.vm-car-topics-label {
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    opacity: 0.5;
    margin: 0;
}
.vm-car-chips {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    width: 100%;
}
.vm-car-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 48px;
    padding: 0 16px;
    background: rgba(255,255,255,0.07);
    border: 1.5px solid rgba(255,255,255,0.15);
    border-radius: 12px;
    color: #fff;
    font-size: 0.98rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.vm-car-chip:active { background: rgba(255,255,255,0.14); }
.vm-car-chip--on {
    background: var(--vm-success);
    border-color: var(--vm-success);
}
.vm-car-chip-check {
    flex: 0 0 18px;
    width: 18px;
    text-align: center;
    font-size: 0.95rem;
    line-height: 1;
}
.vm-car-chip-label { flex: 1; }
.vm-car-chip-clear {
    background: none;
    border: none;
    color: rgba(255,255,255,0.5);
    font-size: 0.9rem;
    cursor: pointer;
    padding: 6px;
    text-decoration: underline;
}

.vm-car-back-link {
    background: none;
    border: none;
    color: rgba(255,255,255,0.4);
    font-size: 1rem;
    cursor: pointer;
    margin-top: 20px;
    padding: 8px;
}

/* Ready / complete / error screens */
.vm-car-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 28px;
    text-align: center;
    gap: 12px;
    width: 100%;
}

.vm-car-logo { font-size: 4rem; line-height: 1; }

.vm-car-suv {
    width: clamp(120px, 40vw, 168px);
    height: auto;
    color: #fff;
}

.vm-car-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0;
}

.vm-car-subtitle {
    font-size: 1.05rem;
    opacity: 0.6;
    margin: 0;
    line-height: 1.6;
}

.vm-car-score {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 8px 0 0;
}

.vm-car-loading {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.5;
    font-size: 1.1rem;
}

.vm-car-error-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.vm-car-error-sub {
    font-size: 1rem;
    opacity: 0.6;
    margin: 0;
    max-width: 320px;
    line-height: 1.6;
}

.vm-car-steps {
    list-style: none;
    padding: 0;
    margin: 4px 0 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 360px;
    text-align: left;
}

.vm-car-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: rgba(255,255,255,0.85);
}

.vm-car-step-num {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #1f9c5b;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
}
