html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* ---- ElevenReady bespoke auth pages ---- */
.er-auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background: linear-gradient(135deg, #1E3A8A 0%, #0EA5E9 100%);
}

.er-auth-card {
    width: 100%;
    max-width: 26rem;
    background: #fff;
    border-radius: 16px;
    padding: 2.25rem 2rem;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.28);
}

.er-auth-brand {
    text-align: center;
    margin-bottom: 1.75rem;
}

.er-auth-logo {
    display: block;
    font-family: 'Poppins', 'Inter', sans-serif;
    font-weight: 700;
    font-size: 1.6rem;
    color: #1E3A8A;
    letter-spacing: -0.01em;
}

.er-auth-tagline {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.85rem;
    color: #64748B;
}

.er-field {
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
}

.er-field > label {
    font-size: 1rem; /* 16px — WCAG-readable on mobile */
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.35rem;
}

/* Helper / hint text under a field or checkbox. */
.er-helper-text {
    margin: 0.3rem 0 0;
    font-size: 0.8rem;
    line-height: 1.4;
    color: #64748B;
}

/* Caps Lock warning under a password field. */
.er-caps-warning {
    margin: 0.3rem 0 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: #B45309;
}

.er-caps-warning[hidden] {
    display: none;
}

/* WCAG 2.5.5: comfortable touch targets for auth actions. */
.er-auth-card .mud-button-root {
    min-height: 44px;
}

/* P10: differentiate the two footer links. */
.er-auth-card .er-link-primary {
    color: #1E3A8A;
    font-weight: 600;
}

.er-auth-card .er-link-secondary {
    color: #64748B;
    font-size: 0.875rem;
}

.er-field > input {
    width: 100%;
    padding: 0.65rem 0.75rem;
    border: 1px solid #CBD5E1;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.er-field > input:focus {
    outline: none;
    border-color: #0EA5E9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.18);
}

.er-field-check {
    flex-direction: row;
    align-items: flex-start;
}

.er-field-check > label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-weight: 400;
    color: #475569;
    line-height: 1.4;
}

.er-field-check input[type=checkbox] {
    margin-top: 0.2rem;
    flex: 0 0 auto;
}

/* ---- Password field with show/hide toggle ---- */
.er-password {
    position: relative;
    display: flex;
    align-items: stretch;
}

.er-password__input {
    width: 100%;
    padding: 0.65rem 2.85rem 0.65rem 0.75rem;
    border: 1px solid #CBD5E1;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.er-password__input:focus {
    outline: none;
    border-color: #0EA5E9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.18);
}

.er-password__toggle {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: 2.6rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    color: #94A3B8;
    border-radius: 0 8px 8px 0;
    transition: color 0.15s ease;
}

.er-password__toggle:hover,
.er-password__toggle:focus-visible {
    color: #0EA5E9;
}

.er-password__toggle:focus-visible {
    outline: 2px solid #0EA5E9;
    outline-offset: -2px;
}

.er-password__icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.er-password__icon--hide {
    display: none;
}

.er-password__toggle.is-revealed .er-password__icon--show {
    display: none;
}

.er-password__toggle.is-revealed .er-password__icon--hide {
    display: block;
}

/* ---- Password strength meter ---- */
.er-strength {
    margin: -0.4rem 0 1rem;
    --er-strength-color: #CBD5E1;
}

.er-strength.is-weak { --er-strength-color: #EF4444; }
.er-strength.is-fair { --er-strength-color: #F59E0B; }
.er-strength.is-good { --er-strength-color: #0EA5E9; }
.er-strength.is-strong { --er-strength-color: #10B981; }

.er-strength__bars {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.35rem;
    margin-bottom: 0.4rem;
}

.er-strength__bars > span {
    height: 5px;
    border-radius: 999px;
    background: #E2E8F0;
    transition: background-color 0.25s ease, transform 0.25s ease;
    transform-origin: left center;
}

.er-strength__bars > span.is-on {
    background: var(--er-strength-color);
}

.er-strength__label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #64748B;
    transition: color 0.2s ease;
}

.er-strength.is-weak .er-strength__label,
.er-strength.is-fair .er-strength__label,
.er-strength.is-good .er-strength__label,
.er-strength.is-strong .er-strength__label {
    color: var(--er-strength-color);
}

.er-strength__reqs {
    list-style: none;
    margin: 0.5rem 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem 0.85rem;
}

.er-strength__reqs > li {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.72rem;
    color: #94A3B8;
    transition: color 0.2s ease;
}

.er-strength__tick {
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
    border-radius: 50%;
    border: 1.5px solid #CBD5E1;
    position: relative;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.er-strength__reqs > li.is-met {
    color: #10B981;
}

.er-strength__reqs > li.is-met .er-strength__tick {
    background: #10B981;
    border-color: #10B981;
}

.er-strength__reqs > li.is-met .er-strength__tick::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 1px;
    width: 3px;
    height: 7px;
    border: solid #fff;
    border-width: 0 1.5px 1.5px 0;
    transform: rotate(45deg);
}

@media (prefers-reduced-motion: reduce) {
    .er-strength__bars > span,
    .er-strength__label,
    .er-strength__tick,
    .er-strength__reqs > li {
        transition: none;
    }
}

/* ---- Blazor unhandled-error banner ---- */
/* The interactive ErrorBoundary in MainLayout is the normal error handler now, so the global banner stays
   hidden (it would only ever appear for a circuit-level failure before the boundary can render). */
#blazor-error-ui {
    display: none !important;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 0.7rem 1.25rem;
    background: #FEF3C7;
    color: #0F172A;
    box-shadow: 0 -1px 2px rgba(15, 23, 42, 0.2);
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* ---- Kid home (Child Mode) ---- */
.er-kid-hero {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.5rem 1.75rem;
    margin-bottom: 1.5rem;
    border-radius: 24px;
    background: linear-gradient(135deg, #0EA5E9 0%, #1E3A8A 100%);
    color: #fff;
    box-shadow: 0 12px 32px rgba(14, 165, 233, 0.28);
}

.er-kid-back.mud-icon-button {
    color: #fff;
    background: rgba(255, 255, 255, 0.18);
}

.er-kid-hero__mascot {
    flex: 0 0 auto;
    filter: drop-shadow(0 4px 8px rgba(11, 37, 102, 0.25));
}

.er-kid-hero__text {
    flex: 1 1 auto;
    min-width: 0;
}

.er-kid-hello {
    font-family: 'Poppins', 'Inter', sans-serif;
    font-weight: 700;
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    margin: 0;
    line-height: 1.1;
}

.er-kid-bubble {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.4rem 0.85rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 500;
}

.er-kid-rewards {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 1.5rem;
}

.er-kid-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1rem;
    border-radius: 999px;
    font-family: 'Poppins', 'Inter', sans-serif;
    font-weight: 700;
    font-size: 1.15rem;
    color: #0F172A;
}

.er-kid-pill small {
    font-weight: 600;
    font-size: 0.8rem;
    color: #475569;
}

.er-kid-pill__emoji {
    font-size: 1.4rem;
    line-height: 1;
}

.er-kid-pill--coins { background: #FEF3C7; }
.er-kid-pill--points { background: #FDE68A; }
.er-kid-pill--streak { background: #FFE4E6; }
.er-kid-pill--badges { background: #DBEAFE; }

/* A reward pill that's also a tappable shortcut (coins → spend, badges → view).
   Looks like the other pills but gains a chevron + hover/focus affordance. */
.er-kid-pill--link {
    text-decoration: none;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.er-kid-pill--link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.14);
}

.er-kid-pill--link:focus-visible {
    outline: none;
    border-color: var(--mud-palette-primary, #1E3A8A);
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.25);
}

.er-kid-pill__go {
    font-weight: 800;
    font-size: 1.25rem;
    line-height: 1;
    color: #475569;
    margin-left: 0.15rem;
}

@media (prefers-reduced-motion: reduce) {
    .er-kid-pill--link {
        transition: none;
    }

    .er-kid-pill--link:hover {
        transform: none;
    }
}

.er-kid-section {
    font-family: 'Poppins', 'Inter', sans-serif;
    font-weight: 700;
    font-size: 1.3rem;
    color: #1E3A8A;
    margin: 0 0 1rem;
}

.er-kid-card {
    height: 100%;
    border-radius: 20px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.08);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.er-kid-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
}

/* Round illustrated icon tile at the top of each action card. */
.er-kid-card--tile { padding-top: 1.5rem; }

.er-kid-tile {
    width: 96px;
    height: 96px;
    margin: 0 auto 0.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
}

.er-kid-tile svg {
    width: 58px;
    height: 58px;
}

.er-kid-tile--practice { background: radial-gradient(circle at 50% 38%, #E0F2FE, #BAE6FD); }
.er-kid-tile--mock { background: radial-gradient(circle at 50% 38%, #FEF3C7, #FDE68A); }
.er-kid-tile--diag { background: radial-gradient(circle at 50% 38%, #E0E7FF, #C7D2FE); }

.er-kid-card__title {
    font-family: 'Poppins', 'Inter', sans-serif;
    font-weight: 700;
    font-size: 1.3rem;
    color: #1E3A8A;
    text-align: center;
}

.er-kid-card__desc {
    margin: 0.25rem 0 1rem;
    text-align: center;
    color: #64748B;
    font-size: 0.85rem;
    line-height: 1.4;
}

.er-kid-card__body {
    padding: 0.5rem 1.25rem 1.25rem;
}

/* Tappable subject tiles + skill chips (kid-friendly — no dropdowns). */
.er-pick-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    color: #64748B;
    text-align: center;
    margin-bottom: 0.5rem;
}

.er-subject-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
}

.er-subject-tile {
    all: unset;
    box-sizing: border-box;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    min-height: 88px;
    justify-content: center;
    padding: 0.6rem 0.4rem;
    border-radius: 16px;
    background: #F1F5F9;
    border: 2px solid transparent;
    font-weight: 600;
    font-size: 0.8rem;
    line-height: 1.15;
    color: #334155;
    text-align: center;
    transition: transform 0.1s ease, border-color 0.1s ease, background 0.1s ease;
}

.er-subject-tile:hover { transform: translateY(-2px); background: #E2E8F0; }
.er-subject-tile:focus-visible { outline: 2px solid #0EA5E9; outline-offset: 2px; }
.er-subject-tile__emoji { font-size: 1.9rem; line-height: 1; }

.er-subject-tile.is-selected {
    border-color: #0EA5E9;
    background: #E0F2FE;
    color: #0B2566;
}

/* "Tap to go" variant (timed mock) gets a warm tint on hover. */
.er-subject-tile--go:hover { background: #FEF3C7; }

.er-skill-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.er-skill-chip {
    all: unset;
    cursor: pointer;
    padding: 0.5rem 0.9rem;
    border-radius: 999px;
    background: #1E3A8A;
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.1s ease;
}

.er-skill-chip:hover { transform: translateY(-2px); background: #0EA5E9; box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3); }
.er-skill-chip:focus-visible { outline: 2px solid #0EA5E9; outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
    .er-subject-tile, .er-skill-chip { transition: none; }
    .er-subject-tile:hover, .er-skill-chip:hover { transform: none; }
}

/* ---- Learning plan bars (Child Mode home) ---- */
/* ===== Kid "Today" panel: daily goal ring + to-do missions (Atom-style daily loop, our palette) ===== */
.er-today {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1.25rem;
    align-items: center;
    margin: 1.25rem 0 0.5rem;
    padding: 1.1rem 1.25rem;
    border-radius: 22px;
    background: linear-gradient(135deg, #EFF6FF 0%, #FDF6E3 100%);
    border: 2px solid rgba(14, 165, 233, 0.18);
    box-shadow: 0 8px 22px rgba(30, 58, 138, 0.06);
}
.er-today__goal { position: relative; width: 96px; height: 96px; flex: 0 0 auto; }
.er-ring { width: 96px; height: 96px; transform: rotate(-90deg); }
.er-ring__track { fill: none; stroke: rgba(30, 58, 138, 0.12); stroke-width: 8; }
.er-ring__fill {
    fill: none;
    stroke: #0EA5E9;
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.6s ease;
}
.er-today__goal.is-done .er-ring__fill { stroke: #16A34A; }
.er-today__goal-text {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.er-today__goal-num { font-weight: 800; font-size: 1.5rem; color: #1E293B; }
.er-today__goal-num small { font-size: 0.8rem; color: var(--mud-palette-text-secondary); font-weight: 700; }
.er-today__goal-cap { margin-top: 0.2rem; font-size: 0.7rem; font-weight: 700; color: #0EA5E9; }
.er-today__goal.is-done .er-today__goal-cap { color: #16A34A; }
.er-today__list { display: flex; flex-direction: column; gap: 0.5rem; min-width: 0; }
.er-today-mission {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem 0.85rem;
    border-radius: 14px;
    background: #fff;
    border: 2px solid rgba(30, 58, 138, 0.08);
    text-decoration: none;
    transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}
.er-today-mission:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(30, 58, 138, 0.1); border-color: rgba(14, 165, 233, 0.4); }
.er-today-mission:focus-visible { outline: 3px solid var(--mud-palette-primary); outline-offset: 2px; }
.er-today-mission.is-done { background: rgba(22, 163, 74, 0.06); border-color: rgba(22, 163, 74, 0.3); }
.er-today-mission__emoji { flex: 0 0 auto; font-size: 1.5rem; line-height: 1; }
.er-today-mission__text { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; }
.er-today-mission__title { font-weight: 800; color: #1E293B; }
.er-today-mission.is-done .er-today-mission__title { text-decoration: line-through; color: #15803D; }
.er-today-mission__sub { font-size: 0.8rem; color: var(--mud-palette-text-secondary); }
.er-today-mission__go { flex: 0 0 auto; font-weight: 800; font-size: 1.2rem; color: #0EA5E9; }
.er-today-mission.is-done .er-today-mission__go { color: #16A34A; }
@media (max-width: 599px) {
    .er-today { grid-template-columns: 1fr; justify-items: center; text-align: left; }
    .er-today__list { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
    .er-ring__fill, .er-today-mission { transition: none; }
}

/* ===== Daily delight: Robbie's joke / fun fact (tap-to-reveal <details>) ===== */
.er-joke {
    margin: 0.75rem 0 0.25rem;
    max-width: 760px;
    border-radius: 16px;
    background: linear-gradient(135deg, #FEF9C3 0%, #FEF3C7 100%);
    border: 2px solid rgba(234, 179, 8, 0.3);
    overflow: hidden;
}
.er-joke__head {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-weight: 700;
    color: #854D0E;
    list-style: none;
}
.er-joke__head::-webkit-details-marker { display: none; }
.er-joke__head:focus-visible { outline: 3px solid var(--mud-palette-primary); outline-offset: -3px; }
.er-joke__bot { flex: 0 0 auto; font-size: 1.4rem; line-height: 1; }
.er-joke__label { flex: 1 1 auto; }
.er-joke__hint {
    flex: 0 0 auto;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #B45309;
    background: rgba(234, 179, 8, 0.25);
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
}
.er-joke[open] .er-joke__hint { display: none; }
.er-joke__answer { margin: 0; padding: 0 1rem 0.95rem 3rem; font-weight: 700; color: #1E293B; }

/* ===== Daily-goal celebration overlay ===== */
.er-celebrate {
    position: fixed;
    inset: 0;
    z-index: 1400;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(3px);
}
.er-celebrate__card {
    position: relative;
    z-index: 2;
    max-width: 420px;
    width: 100%;
    text-align: center;
    background: #fff;
    border-radius: 24px;
    padding: 1.75rem 1.5rem 1.5rem;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.3);
    animation: er-pop-in 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.4) both;
}
.er-celebrate__buddy { display: inline-block; animation: er-bob 1.6s ease-in-out infinite; }
.er-celebrate__title { margin: 0.5rem 0 0.3rem; font-size: 1.5rem; font-weight: 800; color: #0F172A; }
.er-celebrate__sub { margin: 0 0 1.1rem; color: var(--mud-palette-text-secondary); }
.er-celebrate__badges { display: flex; flex-direction: column; gap: 0.5rem; margin: 0 0 1.1rem; }
.er-celebrate__badge {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-align: left;
    padding: 0.6rem 0.85rem;
    border-radius: 14px;
    background: rgba(234, 179, 8, 0.1);
    border: 1px solid rgba(234, 179, 8, 0.3);
}
.er-celebrate__badge-icon { flex: 0 0 auto; font-size: 1.7rem; line-height: 1; }
.er-celebrate__badge-text { font-size: 0.9rem; color: #1E293B; }
.er-celebrate__confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.er-confetti {
    position: absolute;
    top: -12px;
    width: 10px;
    height: 14px;
    border-radius: 2px;
    opacity: 0.9;
    animation: er-fall 2.6s linear infinite;
}
.er-confetti--0 { left: 8%; background: #0EA5E9; animation-delay: 0s; }
.er-confetti--1 { left: 22%; background: #EAB308; animation-delay: 0.3s; }
.er-confetti--2 { left: 38%; background: #EC4899; animation-delay: 0.6s; }
.er-confetti--3 { left: 55%; background: #10B981; animation-delay: 0.15s; }
.er-confetti--4 { left: 72%; background: #F59E0B; animation-delay: 0.45s; }
.er-confetti--5 { left: 88%; background: #6366F1; animation-delay: 0.75s; }

@keyframes er-pop-in {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
@keyframes er-bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
@keyframes er-fall {
    0% { transform: translateY(0) rotate(0); opacity: 0.95; }
    100% { transform: translateY(105vh) rotate(540deg); opacity: 0.4; }
}
@media (prefers-reduced-motion: reduce) {
    .er-celebrate__card { animation: none; }
    .er-celebrate__buddy { animation: none; }
    .er-confetti { display: none; }
}

.er-plan {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 760px;
}

.er-plan-row {
    all: unset;
    box-sizing: border-box;
    cursor: pointer;
    display: flex;
    align-items: stretch;
    min-height: 60px;
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.er-plan-row:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(15, 23, 42, 0.13); }
.er-plan-row:focus-visible { outline: 2px solid #0EA5E9; outline-offset: 2px; }

.er-plan-row__label {
    flex: 0 0 42%;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 1rem;
    color: #fff;
    font-family: 'Poppins', 'Inter', sans-serif;
    font-weight: 700;
    font-size: 1.05rem;
}

.er-plan-row__emoji { font-size: 1.3rem; }

.er-plan-row__progress {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 0.75rem 0 1rem;
}

.er-plan-row__bar {
    flex: 1 1 auto;
    height: 10px;
    border-radius: 999px;
    background: #E2E8F0;
    overflow: hidden;
}

.er-plan-row__bar-fill {
    display: block;
    height: 100%;
    border-radius: 999px;
    transition: width 0.4s ease;
}

.er-plan-row__count {
    font-weight: 700;
    font-size: 0.85rem;
    color: #334155;
    white-space: nowrap;
}

.er-plan-row__arrow {
    display: flex;
    align-items: center;
    padding-right: 1rem;
    color: #94A3B8;
    font-size: 1.3rem;
}

.er-plan-row--english .er-plan-row__label { background: #EC4899; }
.er-plan-row--english .er-plan-row__bar-fill { background: #EC4899; }
.er-plan-row--maths .er-plan-row__label { background: #3B82F6; }
.er-plan-row--maths .er-plan-row__bar-fill { background: #3B82F6; }
.er-plan-row--vr .er-plan-row__label { background: #10B981; }
.er-plan-row--vr .er-plan-row__bar-fill { background: #10B981; }
.er-plan-row--nvr .er-plan-row__label { background: #F59E0B; }
.er-plan-row--nvr .er-plan-row__bar-fill { background: #F59E0B; }
.er-plan-row--default .er-plan-row__label { background: #0EA5E9; }
.er-plan-row--default .er-plan-row__bar-fill { background: #0EA5E9; }

@media (prefers-reduced-motion: reduce) {
    .er-plan-row { transition: none; }
    .er-plan-row:hover { transform: none; }
    .er-plan-row__bar-fill { transition: none; }
}

/* ---- Subject journey map (Child Mode) ---- */
.er-journey-head {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.er-journey-head__emoji {
    width: 64px;
    height: 64px;
    flex: 0 0 auto;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    background: radial-gradient(circle at 50% 38%, #E0F2FE, #BAE6FD);
}

.er-journey-head__title {
    font-family: 'Poppins', 'Inter', sans-serif;
    font-weight: 700;
    font-size: 1.6rem;
    color: #1E3A8A;
    margin: 0;
    line-height: 1.1;
}

.er-journey-head__sub {
    color: #64748B;
    font-weight: 600;
}

/* Subject-themed "island" background wrapping the journey head + path (matches the home plan colours). */
.er-journey-theme {
    max-width: 640px;
    border-radius: 24px;
    padding: 0.5rem 0.6rem 1.1rem;
    background: linear-gradient(180deg, rgba(14, 165, 233, 0.10), transparent 230px);
}
.er-journey-theme--maths { background: linear-gradient(180deg, rgba(59, 130, 246, 0.14), transparent 240px); }
.er-journey-theme--english { background: linear-gradient(180deg, rgba(236, 72, 153, 0.13), transparent 240px); }
.er-journey-theme--vr { background: linear-gradient(180deg, rgba(16, 185, 129, 0.13), transparent 240px); }
.er-journey-theme--nvr { background: linear-gradient(180deg, rgba(245, 158, 11, 0.14), transparent 240px); }
.er-journey-theme--maths .er-journey-head { background: radial-gradient(circle at 50% 38%, #DBEAFE, #BFDBFE); }
.er-journey-theme--english .er-journey-head { background: radial-gradient(circle at 50% 38%, #FCE7F3, #FBCFE8); }
.er-journey-theme--vr .er-journey-head { background: radial-gradient(circle at 50% 38%, #D1FAE5, #A7F3D0); }
.er-journey-theme--nvr .er-journey-head { background: radial-gradient(circle at 50% 38%, #FEF3C7, #FDE68A); }
.er-journey-theme--maths .er-journey__topic { color: #2563EB; }
.er-journey-theme--english .er-journey__topic { color: #DB2777; }
.er-journey-theme--vr .er-journey__topic { color: #059669; }
.er-journey-theme--nvr .er-journey__topic { color: #B45309; }

.er-journey {
    max-width: 600px;
}

.er-journey__topic {
    font-family: 'Poppins', 'Inter', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: #0EA5E9;
    margin: 1.25rem 0 0.6rem;
}

.er-journey-node {
    all: unset;
    box-sizing: border-box;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    padding: 0.7rem 0.9rem;
    border-radius: 16px;
    margin-bottom: 0.6rem;
    background: #fff;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.07);
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.er-journey-node:hover { transform: translateX(4px); box-shadow: 0 8px 22px rgba(15, 23, 42, 0.13); }
.er-journey-node:focus-visible { outline: 2px solid #0EA5E9; outline-offset: 2px; }

.er-journey-node__dot {
    flex: 0 0 auto;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.15rem;
    color: #fff;
    background: #94A3B8;
}

.er-journey-node__title { display: block; font-weight: 700; color: #0F172A; }
.er-journey-node__sub { display: block; font-size: 0.8rem; color: #64748B; }

.er-journey-node--done .er-journey-node__dot { background: #10B981; }
.er-journey-node--current { outline: 2px solid #0EA5E9; }
.er-journey-node--current .er-journey-node__dot { background: #0EA5E9; box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.25); }
/* "Coming soon" — no questions to practise yet: muted so it doesn't read as the next step. */
.er-journey-node--soon { opacity: 0.72; }
.er-journey-node--soon .er-journey-node__dot { background: #94A3B8; font-size: 1rem; }

/* "Islands" path polish: link the nodes with a connector + make the current step pulse + reward done nodes. */
.er-journey-node { position: relative; }
.er-journey-node:not(:last-child)::after {
    content: "";
    position: absolute;
    left: 38px;
    top: calc(100% - 0.2rem);
    transform: translateX(-50%);
    width: 4px;
    height: 0.8rem;
    border-radius: 2px;
    background: rgba(148, 163, 184, 0.4);
    z-index: 0;
}
.er-journey-node--done:not(:last-child)::after { background: rgba(16, 185, 129, 0.5); }
.er-journey-node__dot { position: relative; z-index: 1; }
.er-journey-node--done .er-journey-node__dot {
    background: linear-gradient(135deg, #34D399, #10B981);
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.35);
}
.er-journey-node--current .er-journey-node__dot { animation: er-dot-pulse 1.8s ease-in-out infinite; }
@keyframes er-dot-pulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.25); }
    50% { box-shadow: 0 0 0 9px rgba(14, 165, 233, 0.12); }
}

@media (prefers-reduced-motion: reduce) {
    .er-journey-node--current .er-journey-node__dot { animation: none; }
    .er-journey-node { transition: none; }
    .er-journey-node:hover { transform: none; }
}

.er-kid-start.mud-button-root {
    min-height: 52px;
    font-size: 1.05rem;
    font-weight: 700;
    border-radius: 14px;
}

@media (max-width: 600px) {
    .er-kid-hero { flex-direction: column; text-align: center; }
}

/* ---- Kid "learn before you practise" lesson card ---- */
.er-lesson {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 20px;
    padding: 1.5rem 1.5rem 1.75rem;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.er-lesson__head {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin-bottom: 1rem;
}

.er-lesson__mascot {
    font-size: 2.6rem;
    line-height: 1;
    flex-shrink: 0;
}

.er-lesson__eyebrow {
    font-weight: 700;
    color: #0EA5E9;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.78rem;
}

.er-lesson__title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 800;
    color: #1E293B;
    line-height: 1.2;
}

.er-lesson__intro {
    font-size: 1.05rem;
    color: #334155;
    margin: 0 0 1rem;
}

.er-lesson__key {
    background: #EFF6FF;
    border-left: 4px solid #0EA5E9;
    border-radius: 10px;
    padding: 0.85rem 1rem;
    font-size: 1.02rem;
    color: #1E293B;
    margin-bottom: 1rem;
}

.er-lesson__label {
    font-weight: 700;
    color: #475569;
    margin-bottom: 0.35rem;
}

.er-lesson__examples ul {
    margin: 0;
    padding-left: 1.2rem;
}

.er-lesson__examples li {
    margin-bottom: 0.4rem;
    color: #334155;
}

.er-lesson__tip {
    margin-top: 1rem;
    background: #FEF3C7;
    border-radius: 10px;
    padding: 0.8rem 1rem;
    font-weight: 600;
    color: #92400E;
}

/* ---- Guided lesson stepper (kid "learn before you practise" flow) ---- */
.er-step-counter {
    font-weight: 700;
    font-size: 0.85rem;
    color: #64748B;
}

.er-step-dots {
    display: flex;
    gap: 0.4rem;
    justify-content: center;
    margin-bottom: 1rem;
}

.er-step-dot {
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 999px;
    background: #CBD5E1;
    transition: background 0.2s ease, transform 0.2s ease, width 0.2s ease;
}

.er-step-dot.is-done { background: #34D399; }

.er-step-dot.is-active {
    background: #0EA5E9;
    width: 1.6rem;
}

.er-lesson-step {
    text-align: center;
    min-height: 260px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    animation: er-step-enter 0.28s ease;
}

.er-lesson-step .er-lesson__title { font-size: 1.6rem; }

.er-lesson-step__graphic {
    width: 110px;
    height: 110px;
    border-radius: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.4rem;
    margin-bottom: 0.4rem;
    background: #EFF6FF;
}

/* Big, uncropped lesson picture — fills the card so kids can see the detail. */
.er-lesson-step__image {
    display: block;
    width: 100%;
    max-width: 440px;
    height: auto;
    object-fit: contain;
    border-radius: 24px;
    margin-bottom: 0.6rem;
    background: #EFF6FF;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
    transition: transform 0.15s ease;
}

/* Tap / double-click the picture to zoom it big. */
.er-lesson-step__imgbtn {
    position: relative;
    display: inline-block;
    max-width: 100%;
    padding: 0;
    border: 0;
    background: none;
    border-radius: 24px;
    cursor: zoom-in;
}
.er-lesson-step__imgbtn:hover .er-lesson-step__image {
    transform: scale(1.015);
}
.er-lesson-step__imgbtn:focus-visible {
    outline: 3px solid var(--mud-palette-primary);
    outline-offset: 3px;
}
.er-lesson-step__zoomhint {
    position: absolute;
    bottom: 1rem;
    right: 0.6rem;
    display: inline-flex;
    align-items: center;
    background: rgba(13, 27, 62, 0.74);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.22rem 0.6rem;
    border-radius: 999px;
    pointer-events: none;
}

/* Full-screen zoom overlay for the picture. */
.er-zoom {
    position: fixed;
    inset: 0;
    z-index: 1500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(13, 27, 62, 0.82);
    cursor: zoom-out;
    animation: er-relearn-fade 0.18s ease-out;
}
.er-zoom__img {
    max-width: 92vw;
    max-height: 88vh;
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}
.er-zoom__close {
    position: fixed;
    top: 1rem;
    right: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: #0D1B3E;
    font-size: 1.25rem;
    font-weight: 700;
    cursor: pointer;
}
.er-zoom__close:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
    .er-zoom { animation: none; }
    .er-lesson-step__image { transition: none; }
}

.er-lesson-step__video {
    width: 100%;
    max-width: 30rem;
    border-radius: 18px;
    margin-bottom: 0.6rem;
    background: #000;
}

.er-lesson-step__graphic--keyidea { background: #FEF9C3; }
.er-lesson-step__graphic--video { background: #E0E7FF; }

.er-narration {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 1rem;
}

.er-narration__label {
    font-weight: 700;
    color: #0EA5E9;
    font-size: 0.9rem;
}

.er-narration__player {
    height: 40px;
    max-width: 100%;
}

.er-narration__transcript {
    max-width: 30rem;
    font-size: 0.95rem;
    color: #334155;
}

.er-narration__transcript summary {
    cursor: pointer;
    font-weight: 700;
    color: #0EA5E9;
}

.er-narration__transcript p {
    margin: 0.4rem 0 0;
    line-height: 1.5;
}
.er-lesson-step__graphic--example { background: #DCFCE7; }
.er-lesson-step__graphic--tip { background: #FEF3C7; }
.er-lesson-step__graphic--ready { background: #E0E7FF; }

.er-lesson-step__body {
    font-size: 1.12rem;
    color: #334155;
    max-width: 30rem;
    margin: 0.2rem 0 0;
    line-height: 1.5;
}

.er-lesson-step__body--key {
    font-weight: 700;
    color: #1E293B;
}

.er-step-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.er-step-nav__next { min-width: 9.5rem; }

/* Buddy companion in the practice runner header + celebrating on results. */
.er-run__buddy { display: flex; align-items: center; gap: 0.6rem; }
.er-buddy-cheer { display: inline-flex; animation: er-buddy-cheer 0.9s ease-in-out 2; }
@keyframes er-buddy-cheer { 0%,100% { transform: translateY(0) rotate(0); } 30% { transform: translateY(-8px) rotate(-6deg); } 60% { transform: translateY(-4px) rotate(6deg); } }
@media (prefers-reduced-motion: reduce) { .er-buddy-cheer { animation: none; } }

/* Composed dressed-buddy badge (dashboard etc.). */
.er-buddyav { position: relative; display: inline-block; }
.er-buddyav__base { position: relative; z-index: 2; display: block; }
.er-buddyav__layer { position: absolute; z-index: 3; line-height: 1; pointer-events: none; filter: drop-shadow(0 2px 3px rgba(13,27,62,.25)); }

/* Admin build-a-buddy item art manager. */
.er-aiitems { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: 0.75rem; }
.er-aiitem__art { width: 5rem; height: 5rem; display: flex; align-items: center; justify-content: center; margin-bottom: 0.35rem; }
.er-aiitem__art img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 10px; }
.er-aiitem__emoji { font-size: 3rem; line-height: 1; }

/* ===== Build-a-Buddy dress-up shop ===== */
.er-buddy-stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 230px;
    border-radius: 24px;
    background: linear-gradient(160deg, #E0F2FE 0%, #EDE9FE 100%);
    overflow: hidden;
    box-shadow: inset 0 -8px 22px rgba(13, 27, 62, 0.06);
}
.er-buddy-bg {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12rem;
    opacity: 0.28;
    filter: saturate(1.1);
    pointer-events: none;
}
.er-buddy-figure { position: relative; width: 132px; height: 132px; animation: er-buddy-float 3.2s ease-in-out infinite; }
@keyframes er-buddy-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.er-buddy-base { position: relative; z-index: 2; }
.er-buddy-layer { position: absolute; line-height: 1; z-index: 3; filter: drop-shadow(0 3px 4px rgba(13,27,62,.25)); }
.er-buddy-layer--hat { top: -34px; left: 50%; transform: translateX(-50%); font-size: 3rem; }
.er-buddy-layer--face { top: 38px; left: 50%; transform: translateX(-50%); font-size: 2.2rem; }
.er-buddy-layer--outfit { bottom: -6px; left: 50%; transform: translateX(-50%); font-size: 2.6rem; }
.er-buddy-layer--held { bottom: -4px; right: -30px; font-size: 2.6rem; z-index: 4; }

.er-buddy-coins { display: flex; align-items: center; justify-content: center; gap: 0.5rem; flex-wrap: wrap; margin: 0.9rem 0 0.4rem; }

.er-buddy-tabs {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.25rem 0.1rem 0.6rem;
    -webkit-overflow-scrolling: touch;
}
.er-buddy-tab {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    min-width: 4.2rem;
    padding: 0.5rem 0.6rem;
    border: 2px solid var(--mud-palette-lines-default);
    border-radius: 16px;
    background: var(--mud-palette-surface);
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.1s ease;
}
.er-buddy-tab__emoji { font-size: 1.4rem; line-height: 1; }
.er-buddy-tab__label { font-size: 0.72rem; font-weight: 700; color: #334155; }
.er-buddy-tab:hover { border-color: var(--mud-palette-primary); }
.er-buddy-tab:focus-visible { outline: 3px solid var(--mud-palette-primary); outline-offset: 2px; }
.er-buddy-tab.is-active { border-color: var(--mud-palette-primary); background: rgba(37, 99, 235, 0.1); }

.er-buddy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr));
    gap: 0.7rem;
    margin-top: 0.5rem;
}
.er-buddy-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 0.85rem 0.5rem 0.7rem;
    border: 2px solid var(--mud-palette-lines-default);
    border-radius: 18px;
    background: var(--mud-palette-surface);
    text-align: center;
    transition: transform 0.12s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.er-buddy-item:hover { transform: translateY(-3px); box-shadow: 0 8px 18px rgba(13, 27, 62, 0.1); }
.er-buddy-item.is-equipped { border-color: #16A34A; background: #ECFDF5; }
.er-buddy-item__badge {
    position: absolute;
    top: -0.55rem;
    background: #16A34A;
    color: #fff;
    font-size: 0.66rem;
    font-weight: 800;
    padding: 0.12rem 0.5rem;
    border-radius: 999px;
}
.er-buddy-item__art { font-size: 2.6rem; line-height: 1; height: 3rem; display: flex; align-items: center; }
.er-buddy-item__art img { width: 3rem; height: 3rem; object-fit: contain; border-radius: 8px; }
.er-buddy-item__name { font-size: 0.8rem; font-weight: 600; color: #1E293B; line-height: 1.2; }
.er-buddy-item__btn {
    margin-top: 0.1rem;
    padding: 0.32rem 0.9rem;
    border: 0;
    border-radius: 999px;
    background: var(--mud-palette-primary);
    color: #fff;
    font-weight: 800;
    font-size: 0.85rem;
    cursor: pointer;
    transition: transform 0.1s ease, opacity 0.15s ease;
}
.er-buddy-item__btn:active:not(:disabled) { transform: scale(0.96); }
.er-buddy-item__btn:focus-visible { outline: 3px solid var(--mud-palette-primary); outline-offset: 2px; }
.er-buddy-item__btn.is-on { background: #16A34A; }
.er-buddy-item__btn:disabled { opacity: 0.55; cursor: default; }
.er-buddy-item__btn--buy { background: #F4B740; color: #4A2E00; }
.er-buddy-item__btn--buy.is-locked { background: #E2E8F0; color: #94A3B8; }
.er-buddy-item--off { border-style: dashed; cursor: pointer; justify-content: center; }
.er-buddy-item--off:focus-visible { outline: 3px solid var(--mud-palette-primary); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
    .er-buddy-tab, .er-buddy-item__btn, .er-buddy-item { transition: none; }
    .er-buddy-figure { animation: none; }
    .er-buddy-item:hover { transform: none; }
}

/* ===== Rich-text editor (admin) + rendered rich content ===== */
.er-rte { margin-bottom: 0.5rem; }
.er-rte__label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--mud-palette-text-secondary);
    margin-bottom: 0.35rem;
}
.er-rte__editor {
    background: var(--mud-palette-surface);
    border-radius: 0 0 8px 8px;
}
.er-rte__editor .ql-editor {
    min-height: 8rem;
    font-size: 1rem;
}
/* Quill's snow toolbar — round the top corners to match. */
.er-rte .ql-toolbar.ql-snow { border-radius: 8px 8px 0 0; }
.er-rte__hint {
    font-size: 0.75rem;
    color: var(--mud-palette-text-secondary);
    margin-top: 0.3rem;
}
.er-rte__view {
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    background: var(--mud-palette-background-grey);
}

/* Rendered rich content (question stem / explanation, admin + kid). Keeps authored images tidy and tags safe-looking. */
.er-richtext :is(p, ul, ol) { margin: 0 0 0.5rem; }
.er-richtext :is(p, ul, ol):last-child { margin-bottom: 0; }
.er-richtext img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 0.4rem 0;
}
.er-richtext a { color: var(--mud-palette-primary); }

/* ===== Kid practice runner: question card, answer choices, confidence, reveal ===== */
.er-run {
    max-width: 640px;
    margin-inline: auto;
}
.er-run__progress {
    height: 8px;
    border-radius: 999px;
}
.er-q-card {
    background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 6px 22px rgba(13, 27, 62, 0.06);
}
.er-q-card__skill {
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--mud-palette-primary);
    margin-bottom: 0.35rem;
}
.er-q-card__stem {
    font-size: 1.4rem;
    line-height: 1.35;
    font-weight: 700;
    color: #1E293B;
    margin: 0 0 1.25rem;
}

/* Answer choices = full-width tappable cards with a letter badge + inline state icon. */
.er-answers {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
/* NVR (image) options: a responsive grid of figure tiles rather than a stacked list. */
.er-answers--grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
}
.er-answers--grid .er-answer { flex-direction: column; align-items: center; text-align: center; }
.er-answer__img { display: block; width: 104px; height: 104px; }
/* A question's own figure (NVR stem strip / illustration). */
.er-q-card__image { display: block; max-width: 100%; height: auto; margin: 0.25rem 0 1rem; }
.er-review__image { display: block; max-width: 100%; height: auto; }
.er-review-opts { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.er-review-opt { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px; border: 2px solid transparent; border-radius: 10px; }
.er-review-opt img { width: 76px; height: 76px; }
.er-review-opt.is-correct { border-color: var(--mud-palette-success); background: rgba(76,175,80,.08); }
.er-review-opt.is-wrong { border-color: var(--mud-palette-error); background: rgba(244,67,54,.06); }
.er-answer {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    width: 100%;
    text-align: left;
    padding: 0.85rem 1rem;
    border: 2px solid var(--mud-palette-lines-default);
    border-radius: 14px;
    background: var(--mud-palette-surface);
    color: #1E293B;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}
.er-answer[disabled] {
    cursor: default;
    opacity: 1;
}
.er-answer:not([disabled]):hover {
    border-color: var(--mud-palette-primary);
    background: rgba(37, 99, 235, 0.04);
}
.er-answer:not([disabled]):active {
    transform: scale(0.99);
}
.er-answer:focus-visible {
    outline: 3px solid var(--mud-palette-primary);
    outline-offset: 2px;
}
.er-answer__letter {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: #EEF2F7;
    color: #475569;
    font-weight: 800;
    font-size: 0.95rem;
}
.er-answer__text { flex: 1 1 auto; }
.er-answer__icon {
    flex: 0 0 auto;
    width: 1.6rem;
    height: 1.6rem;
}
.er-answer__icon--ok { color: #16A34A; }
.er-answer__icon--no { color: #DC2626; }

.er-answer.is-selected {
    border-color: var(--mud-palette-primary);
    background: rgba(37, 99, 235, 0.08);
}
.er-answer.is-selected .er-answer__letter {
    background: var(--mud-palette-primary);
    color: #fff;
}
.er-answer.is-correct {
    border-color: #16A34A;
    background: #ECFDF5;
}
.er-answer.is-correct .er-answer__letter {
    background: #16A34A;
    color: #fff;
}
.er-answer.is-wrong {
    border-color: #DC2626;
    background: #FEF2F2;
}
.er-answer.is-wrong .er-answer__letter {
    background: #DC2626;
    color: #fff;
}
.er-answer.is-dimmed { opacity: 0.5; }

/* "How sure are you?" — friendly pill segmented control instead of stacked radios. */
.er-confidence { margin-top: 1.4rem; }
.er-confidence__label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--mud-palette-text-secondary);
    margin-bottom: 0.5rem;
}
.er-confidence__opts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.er-conf {
    padding: 0.5rem 0.95rem;
    border: 2px solid var(--mud-palette-lines-default);
    border-radius: 999px;
    background: var(--mud-palette-surface);
    color: #334155;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}
.er-conf:hover { border-color: var(--mud-palette-primary); }
.er-conf:focus-visible {
    outline: 3px solid var(--mud-palette-primary);
    outline-offset: 2px;
}
.er-conf.is-active {
    border-color: var(--mud-palette-primary);
    background: rgba(37, 99, 235, 0.1);
    color: var(--mud-palette-primary);
}

/* Reveal: result banner + explanation + re-learn invite. */
.er-result {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-top: 1.4rem;
    padding: 0.85rem 1.1rem;
    border-radius: 14px;
    font-size: 1.12rem;
    font-weight: 700;
}
.er-result__emoji { font-size: 1.5rem; line-height: 1; }
.er-result.is-correct { background: #ECFDF5; color: #166534; }
.er-result.is-wrong { background: #FFF1F2; color: #9F1239; }

.er-explain {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin-top: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: 14px;
    background: #F1F5F9;
    color: #334155;
    font-size: 1.02rem;
    line-height: 1.5;
}
.er-explain__icon {
    flex: 0 0 auto;
    width: 1.4rem;
    height: 1.4rem;
    color: #F59E0B;
    margin-top: 0.1rem;
}

/* "Learn this again" — a warm, secondary (not loud) full-width invite to re-teach on a miss. */
.er-relearn-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    margin-top: 1rem;
    padding: 0.85rem 1rem;
    border: 2px solid #F4B740;
    border-radius: 14px;
    background: #FFF7E6;
    color: #92400E;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.1s ease;
}
.er-relearn-btn:hover:not([disabled]) { background: #FDEFC8; }
.er-relearn-btn:active:not([disabled]) { transform: scale(0.99); }
.er-relearn-btn:focus-visible {
    outline: 3px solid #F4B740;
    outline-offset: 2px;
}
.er-relearn-btn[disabled] { opacity: 0.6; cursor: default; }
.er-relearn-btn__icon { width: 1.4rem; height: 1.4rem; }

/* Action row under the card. */
.er-q-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.25rem;
}
.er-q-next { min-width: 11rem; border-radius: 12px; }

@media (prefers-reduced-motion: reduce) {
    .er-answer, .er-relearn-btn { transition: none; }
}

/* ===== Kid "My results" history list ===== */
.er-history {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.er-history__row {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    width: 100%;
    text-align: left;
    padding: 0.85rem 1rem;
    border: 2px solid var(--mud-palette-lines-default);
    border-radius: 16px;
    background: var(--mud-palette-surface);
    cursor: pointer;
    transition: border-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}
.er-history__row:not([disabled]):hover {
    border-color: var(--mud-palette-primary);
    box-shadow: 0 6px 18px rgba(13, 27, 62, 0.08);
}
.er-history__row:not([disabled]):active { transform: scale(0.99); }
.er-history__row:focus-visible { outline: 3px solid var(--mud-palette-primary); outline-offset: 2px; }
.er-history__row[disabled] { cursor: default; opacity: 0.7; }
.er-history__icon { flex: 0 0 auto; font-size: 1.6rem; line-height: 1; }
.er-history__main { flex: 1 1 auto; display: flex; flex-direction: column; }
.er-history__title { font-weight: 700; color: #1E293B; }
.er-history__date { font-size: 0.82rem; color: var(--mud-palette-text-secondary); }
.er-history__score {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.1;
}
.er-history__fraction { font-weight: 800; font-size: 1.05rem; }
.er-history__pct { font-size: 0.78rem; color: var(--mud-palette-text-secondary); }
.er-history__score.is-great .er-history__fraction { color: #16A34A; }
.er-history__score.is-ok .er-history__fraction { color: #B45309; }
/* Low scores stay calm and neutral for a child — never alarming red — with an encouraging nudge instead. */
.er-history__score.is-low .er-history__fraction { color: #475569; }
.er-history__cheer { font-size: 0.78rem; font-weight: 700; color: #0EA5E9; }
.er-history__chev { flex: 0 0 auto; color: var(--mud-palette-text-secondary); }
.er-history__inprogress { flex: 0 0 auto; font-size: 0.82rem; color: var(--mud-palette-text-secondary); font-style: italic; }
.er-history-empty { text-align: center; display: flex; flex-direction: column; align-items: center; padding: 1.5rem 0; }
@media (prefers-reduced-motion: reduce) { .er-history__row { transition: none; } }

/* Time-bucketed history groups (Today / Yesterday / …) — collapsible, kid-friendly. */
.er-histgrp { display: flex; flex-direction: column; gap: 0.6rem; }
.er-histgrp__group {
    border: 2px solid var(--mud-palette-lines-default);
    border-radius: 16px;
    overflow: hidden;
    background: var(--mud-palette-surface);
}
.er-histgrp__head {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    width: 100%;
    text-align: left;
    padding: 0.85rem 1rem;
    background: var(--mud-palette-surface);
    border: 0;
    cursor: pointer;
    transition: background-color 0.15s ease;
}
.er-histgrp__head:hover { background: rgba(37, 99, 235, 0.04); }
.er-histgrp__head.is-open { background: rgba(37, 99, 235, 0.06); }
.er-histgrp__head:focus-visible { outline: 3px solid var(--mud-palette-primary); outline-offset: -3px; }
.er-histgrp__emoji { flex: 0 0 auto; font-size: 1.5rem; line-height: 1; }
.er-histgrp__text { flex: 1 1 auto; display: flex; flex-direction: column; }
.er-histgrp__label { font-weight: 800; color: #1E293B; }
.er-histgrp__summary { font-size: 0.82rem; color: var(--mud-palette-text-secondary); }
.er-histgrp__chev {
    flex: 0 0 auto;
    color: var(--mud-palette-text-secondary);
    font-size: 1.1rem;
    transition: transform 0.18s ease;
}
.er-histgrp__chev.is-open { transform: rotate(90deg); }
.er-histgrp__body {
    padding: 0 0.6rem 0.6rem;
    gap: 0.45rem;
}
/* Inside a group, soften the individual play rows so the group is the primary frame. */
.er-histgrp__body .er-history__row { border-color: var(--mud-palette-lines-default); border-radius: 12px; }
@media (prefers-reduced-motion: reduce) { .er-histgrp__head, .er-histgrp__chev { transition: none; } }

/* Practice completion / results: friendly, never-punitive summary + the coins/points just earned. */
.er-kid-result { text-align: center; border-radius: 20px; }
.er-kid-result__score {
    font-size: 2.6rem;
    font-weight: 800;
    line-height: 1.1;
    color: #1E293B; /* calm ink — never red, even for a low score */
    margin: 0.1rem 0;
}
.er-kid-result__cheer { margin-top: 0.4rem; font-weight: 700; color: #0EA5E9; }

.er-reward {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
    margin-top: 1rem;
    animation: er-reward-pop 0.45s ease both;
}
.er-reward__item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    font-weight: 800;
    color: #1E293B;
    background: linear-gradient(135deg, #FEF3C7, #FDE68A);
    box-shadow: 0 2px 6px rgba(234, 179, 8, 0.25);
}
.er-reward__icon { font-size: 1.15rem; line-height: 1; }

.er-reward-badges { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.9rem; }
.er-reward-badge {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-align: left;
    padding: 0.6rem 0.85rem;
    border-radius: 14px;
    background: rgba(14, 165, 233, 0.08);
    border: 1px solid rgba(14, 165, 233, 0.2);
}
.er-reward-badge__icon { flex: 0 0 auto; font-size: 1.6rem; line-height: 1; }
.er-reward-badge__text { font-size: 0.9rem; color: #1E293B; }

.er-result-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}

@keyframes er-reward-pop {
    from { transform: scale(0.85); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
    .er-reward { animation: none; }
}

/* Re-learn mini-lesson overlay: a focused, kid-friendly sheet over the question. */
.er-relearn {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: flex;
    justify-content: center;
    padding: 1rem;
    overflow-y: auto;
    background: rgba(13, 27, 62, 0.55);
    backdrop-filter: blur(2px);
    animation: er-relearn-fade 0.18s ease-out;
}
.er-relearn__sheet {
    width: 100%;
    max-width: 30rem;
    margin: auto;
    padding: 1.1rem 1.1rem 1.4rem;
    background: var(--mud-palette-surface);
    border-radius: 22px;
    box-shadow: 0 20px 52px rgba(13, 27, 62, 0.35);
}
@keyframes er-relearn-fade {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
    .er-relearn { animation: none; }
    @keyframes er-relearn-fade { from { opacity: 1; } to { opacity: 1; } }
}

@keyframes er-step-enter {
    from { opacity: 0; transform: translateY(10px) scale(0.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .er-lesson-step { animation: none; }
    .er-step-dot { transition: none; }
}

/* ---- Lesson library (browse all approved lessons) ---- */
.er-kid-hero--compact { padding-top: 0.5rem; padding-bottom: 0.5rem; }

.er-lesson-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 1rem;
}

.er-lesson-tile {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    text-align: left;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 16px;
    padding: 1rem 1.1rem 1.15rem;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.er-lesson-tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 26px rgba(14, 165, 233, 0.16);
    border-color: #7DD3FC;
}

.er-lesson-tile:focus-visible { outline: 2px solid #0EA5E9; outline-offset: 2px; }

.er-lesson-tile__topic {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #0EA5E9;
}

.er-lesson-tile__title {
    font-weight: 800;
    font-size: 1.05rem;
    color: #1E293B;
    line-height: 1.25;
}

.er-lesson-tile__key {
    font-size: 0.9rem;
    color: #475569;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.er-lesson-tile__cta {
    margin-top: 0.35rem;
    font-weight: 700;
    color: #0EA5E9;
}

@media (prefers-reduced-motion: reduce) {
    .er-lesson-tile { transition: none; }
    .er-lesson-tile:hover { transform: none; }
}

/* ---- Child Mode bottom tab bar ---- */
.er-tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1300;
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    gap: 0.25rem;
    padding: 0.35rem 0.5rem calc(0.35rem + env(safe-area-inset-bottom, 0px));
    background: #FFFFFF;
    border-top: 1px solid #E2E8F0;
    box-shadow: 0 -6px 24px rgba(15, 23, 42, 0.08);
}

.er-tabbar__item {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.1rem;
    min-height: 58px;
    padding: 0.3rem 0.25rem;
    border-radius: 14px;
    text-decoration: none;
    color: #64748B;
    font-weight: 700;
    font-size: 0.78rem;
    transition: background 0.12s ease, color 0.12s ease, transform 0.12s ease;
}

.er-tabbar__item:hover { background: #F1F5F9; }

.er-tabbar__item.active {
    color: #0B2566;
    background: #E0F2FE;
}

.er-tabbar__item.active .er-tabbar__icon { transform: translateY(-2px) scale(1.12); }

.er-tabbar__icon {
    font-size: 1.5rem;
    line-height: 1;
    transition: transform 0.12s ease;
}

.er-tabbar__item:focus-visible { outline: 2px solid #0EA5E9; outline-offset: 2px; }

/* Keep page content clear of the fixed bar. */
.er-has-tabbar { padding-bottom: 96px; }

@media (prefers-reduced-motion: reduce) {
    .er-tabbar__item, .er-tabbar__icon { transition: none; }
    .er-tabbar__item.active .er-tabbar__icon { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .er-kid-card { transition: none; }
    .er-kid-card:hover { transform: none; }
}

/* ---- Cookie consent banner ---- */
.er-cookie-banner {
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    z-index: 1400;
    max-width: 64rem;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: #0F172A;
    color: #F8FAFC;
    border-radius: 12px;
    box-shadow: 0 12px 36px rgba(15, 23, 42, 0.4);
    font-size: 0.9rem;
    line-height: 1.5;
}

.er-cookie-banner[hidden] {
    display: none;
}

.er-cookie-banner__text {
    flex: 1 1 20rem;
}

.er-cookie-banner__text a {
    color: #7DD3FC;
    text-decoration: underline;
}

.er-cookie-banner__actions {
    display: flex;
    gap: 0.5rem;
    flex: 0 0 auto;
}

.er-cookie-btn {
    padding: 0.55rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
}

.er-cookie-btn--primary {
    background: #0EA5E9;
    color: #0F172A;
}

.er-cookie-btn--ghost {
    background: transparent;
    color: #F8FAFC;
    border-color: #475569;
}

.er-cookie-btn:focus-visible {
    outline: 3px solid #7DD3FC;
    outline-offset: 2px;
}
/* ---- Kid avatar (tappable mascot → avatar shop) ---- */
.er-kid-avatar-link {
    position: relative;
    display: inline-flex;
    text-decoration: none;
    border-radius: 50%;
}

.er-kid-avatar-edit {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 1.7rem;
    height: 1.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .9rem;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(11, 37, 102, 0.3);
}

/* ---- "Learning Land" mission welcome ---- */
.er-mission {
    text-align: center;
    color: #fff;
    background: linear-gradient(135deg, #2563EB 0%, #7C3AED 100%);
    border-radius: 28px;
    padding: 2.5rem 1.75rem;
    box-shadow: 0 18px 40px rgba(37, 99, 235, 0.35);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .35rem;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity .45s ease, transform .45s ease;
}

.er-mission--in {
    opacity: 1;
    transform: translateY(0);
}

.er-mission__badge {
    font-size: 3.25rem;
    line-height: 1;
    /* A few welcoming bounces, then settle — an endless animation kept the page from ever reaching a stable
       paint (janky transitions / screenshot stalls, J7). The keyframe rests at translateY(0), so it ends in place. */
    animation: er-mission-bounce 1.8s ease-in-out 4;
}

@keyframes er-mission-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.er-mission__eyebrow {
    margin: .5rem 0 0;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    font-size: .8rem;
    opacity: .9;
}

.er-mission__title {
    margin: .15rem 0;
    font-family: 'Poppins', system-ui, sans-serif;
    font-size: clamp(1.6rem, 5vw, 2.3rem);
    line-height: 1.1;
}

.er-mission__body {
    margin: 0 0 .75rem;
    max-width: 32ch;
    font-size: 1.05rem;
    opacity: .95;
}

.er-mission__go {
    font-size: 1.15rem;
    padding: .6rem 1.6rem;
}

@media (prefers-reduced-motion: reduce) {
    .er-mission { transition: none; opacity: 1; transform: none; }
    .er-mission__badge { animation: none; }
}

/* ---- Admin Skill Lessons: native-button accordion + readable popover + dark-mode contrast ---- */

/* (#1) Subject dropdown: force an opaque surface + elevation + stacking so options aren't see-through. */
.er-select-popover.mud-popover,
.er-select-popover .mud-list {
    background-color: var(--mud-palette-surface) !important;
}
.er-select-popover.mud-popover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 8px;
    z-index: 1400;
}

/* Answer-option editor row: radio · text · remove, each in its own column with a clear gap so the
   left option's remove button never crowds the next option's radio. One option per row. */
.er-option-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    column-gap: 1rem;
    margin-bottom: .75rem;
}
.er-option-row__radio {
    margin: 0;
}
.er-option-row__text {
    min-width: 0;
}

/* Custom disclosure accordion (real <button> toggles for accessibility + state we control). */
.er-acc__item {
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 10px;
    margin-bottom: .5rem;
    background-color: var(--mud-palette-surface);
    overflow: hidden;
}
.er-acc__header {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding-right: .75rem;
}
.er-acc__toggle {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .85rem 1rem;
    background: none;
    border: 0;
    font: inherit;
    color: var(--mud-palette-text-primary);
    text-align: left;
    cursor: pointer;
    border-radius: 10px;
}
.er-acc__toggle:hover {
    background-color: var(--mud-palette-action-default-hover);
}
.er-acc__toggle:focus-visible {
    outline: 3px solid #7DD3FC;
    outline-offset: -3px;
}
/* (#7) Chevron uses the primary text colour so it meets AA contrast in light AND dark themes. */
.er-acc__chevron {
    display: inline-block;
    color: var(--mud-palette-text-primary);
    font-size: 1.05rem;
    line-height: 1;
    transition: transform .15s ease;
}
.er-acc__chevron.is-open {
    transform: rotate(90deg);
}
.er-acc__title {
    flex: 1 1 auto;
    min-width: 0;
    text-align: left;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.er-acc__chips {
    display: flex;
    align-items: center;
    gap: .35rem;
    flex: 0 0 auto;
}
.er-acc__panel {
    padding: .25rem 1rem 1rem;
    border-top: 1px solid var(--mud-palette-lines-default);
}
.er-acc--steps .er-acc__item {
    border-radius: 8px;
}
.er-acc--steps .er-acc__item:hover {
    border-color: var(--mud-palette-primary);
}

/* Step row: a numbered badge + left-aligned summary, so collapsed rows read like a clean list. */
.er-step__num {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    background-color: var(--mud-palette-primary);
    color: var(--mud-palette-primary-text);
    font-size: .8rem;
    font-weight: 700;
    line-height: 1;
}
.er-step__text {
    flex: 1 1 auto;
    text-align: left;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Drag handle + drag-and-drop reorder feedback (arrows remain as the non-drag/keyboard fallback). */
.er-step__grip {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 .15rem;
    color: var(--mud-palette-text-secondary);
    cursor: grab;
    touch-action: none;
}
.er-step__grip:active {
    cursor: grabbing;
}
.er-acc--steps .er-acc__item.is-dragging {
    opacity: .45;
}
.er-acc--steps .er-acc__item.is-drag-over {
    border-color: var(--mud-palette-primary);
    box-shadow: inset 0 3px 0 -1px var(--mud-palette-primary);
}
@media (prefers-reduced-motion: reduce) {
    .er-acc--steps .er-acc__item {
        transition: none;
    }
}

/* "Generate with AI" panel inside an expanded step — a tinted, labelled box so the AI actions are
   obvious and clearly distinct from the text fields above them. */
.er-aitools {
    border: 1px dashed var(--mud-palette-lines-default);
    border-radius: 10px;
    padding: .75rem .85rem;
    background-color: var(--mud-palette-action-default-hover);
}
.er-aitools__label {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    margin-bottom: .5rem;
    font-size: .8rem;
    font-weight: 600;
    color: var(--mud-palette-text-secondary);
    text-transform: uppercase;
    letter-spacing: .03em;
}

@media (prefers-reduced-motion: reduce) {
    .er-acc__chevron { transition: none; }
}

/* (#7) Floating field labels can fall below 4.5:1 in dark mode — use the primary text colour for the
   shrunk/floating label so the "Lesson title" etc. labels stay legible. */
.er-lessons-admin .mud-input-label.mud-input-label-inputcontrol {
    color: var(--mud-palette-text-primary);
}
