/* ---------- Switchback "Trail" look ---------- */
:root {
    --sb-bg: #F5F6FB;
    --sb-ink: #14172B;
    --sb-muted: #5B5F7A;
    --sb-accent: #3B3FE4;
    --sb-accent-dark: #2A2DB8;
    --sb-sun: #FFC233;
    --sb-english: #FF6A3D;
    --sb-math: #3B3FE4;
    --sb-reading: #0FA3B1;
    --sb-science: #2FB344;
    --sb-radius: 18px;
    --bs-body-bg: var(--sb-bg);
    --bs-body-color: var(--sb-ink);
    --bs-primary: #3B3FE4;
    --bs-primary-rgb: 59, 63, 228;
}

html, body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    background: var(--sb-bg);
    color: var(--sb-ink);
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6, .sb-display {
    font-family: 'Space Grotesk', 'Inter', system-ui, sans-serif;
    font-weight: 700;
    letter-spacing: -0.01em;
}

a, .btn-link {
    color: var(--sb-accent);
}

.btn-primary {
    color: #fff;
    background-color: var(--sb-accent);
    border-color: var(--sb-accent);
}

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--sb-accent-dark);
    border-color: var(--sb-accent-dark);
}

.card, .list-group {
    border-radius: var(--sb-radius);
}

.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 rgba(59, 63, 228, .5);
}

.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;
}
/* ACT-style boxed numbers in English passages (e.g. [40]) */
.qbox {
    display: inline-block;
    border: 1.5px solid currentColor;
    padding: 0 .3em;
    font-weight: 700;
    font-size: .85em;
    line-height: 1.3;
}


/* ---------- Logo ---------- */
.sb-logo {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
    color: inherit;
    text-decoration: none;
}

.sb-logo img {
    width: 2rem;
    height: 2rem;
    border-radius: 9px;
}

.sb-logo-lg img {
    width: 4rem;
    height: 4rem;
    border-radius: 16px;
}

.sb-logo-lg {
    font-size: 2rem;
}

/* ---------- Dashboard ---------- */
.sb-hello {
    font-size: clamp(1.6rem, 4vw, 2.3rem);
    margin-bottom: .25rem;
}

.sb-hello .wave {
    color: var(--sb-accent);
}

.sb-chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .35rem .8rem;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(20, 23, 43, .08);
    font-weight: 600;
    font-size: .9rem;
}

.sb-card {
    background: #fff;
    border-radius: var(--sb-radius);
    box-shadow: 0 1px 3px rgba(20, 23, 43, .08), 0 6px 20px rgba(20, 23, 43, .04);
    padding: 1.1rem 1.2rem;
}

.sb-trail-card {
    background: linear-gradient(160deg, #23268F 0%, #3B3FE4 60%, #5B5FF0 100%);
    color: #fff;
    border-radius: var(--sb-radius);
    padding: 1.2rem 1.3rem;
    overflow: hidden;
}

.sb-trail-card .label {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    opacity: .8;
}

.sb-trail-card .score {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 2rem;
    line-height: 1;
}

.sb-section-card {
    display: block;
    color: var(--sb-ink);
    text-decoration: none;
    border-top: 6px solid var(--sec, var(--sb-accent));
    transition: transform .12s ease, box-shadow .12s ease;
}

.sb-section-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(20, 23, 43, .12);
    color: var(--sb-ink);
}

.sb-ring {
    --pct: 0;
    width: 4.2rem;
    height: 4.2rem;
    border-radius: 50%;
    background: conic-gradient(var(--sec, var(--sb-accent)) calc(var(--pct) * 1%), #E7E8F3 0);
    display: grid;
    place-items: center;
    flex: none;
}

.sb-ring span {
    width: 3.2rem;
    height: 3.2rem;
    border-radius: 50%;
    background: #fff;
    display: grid;
    place-items: center;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: .95rem;
}

.sb-next {
    display: flex;
    gap: .9rem;
    align-items: center;
    padding: .9rem 1rem;
    border-radius: 16px;
    text-decoration: none;
    color: var(--sb-ink);
    background: var(--tint, #EEF0FF);
    transition: transform .12s ease;
}

.sb-next:hover {
    transform: translateX(3px);
    color: var(--sb-ink);
}

.sb-next .bubble {
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: var(--hue, var(--sb-accent));
    color: #fff;
    font-size: 1.2rem;
    flex: none;
}

.sb-next.teach { --hue: #E6A700; --tint: #FFF4D6; }
.sb-next.review { --hue: var(--sb-english); --tint: #FFE8E0; }
.sb-next.practice { --hue: var(--sb-accent); --tint: #E9EAFF; }
.sb-next.lesson { --hue: var(--sb-reading); --tint: #DDF5F7; }
.sb-next.test { --hue: var(--sb-science); --tint: #E2F6E6; }

.sb-sec-english { --sec: var(--sb-english); }
.sb-sec-mathematics { --sec: var(--sb-math); }
.sb-sec-reading { --sec: var(--sb-reading); }
.sb-sec-science { --sec: var(--sb-science); }

/* Lesson videos */
.sb-video {
    position: relative;
    width: 100%;
    max-width: 48rem;
    aspect-ratio: 16 / 9;
    margin: .75rem 0;
    border-radius: 14px;
    overflow: hidden;
    background: #000;
}

.sb-video iframe, .sb-video video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ---------- Diagnostic prompt ---------- */
.sb-diagnostic-cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    padding: 1.1rem 1.25rem;
    border-radius: 1rem;
    color: #fff;
    background: linear-gradient(120deg, var(--sb-accent, #3B3FE4), #6A3DE8 60%, var(--sb-english, #FF6A3D));
    box-shadow: 0 10px 24px rgba(59, 63, 228, .25);
}
.sb-diagnostic-cta .bubble {
    display: grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, .18);
    font-size: 1.5rem;
}
.sb-mini {
    padding: .75rem 1rem;
    border-radius: .75rem;
    border-left: 5px solid var(--hue, var(--sb-accent, #3B3FE4));
    background: #fff;
    box-shadow: 0 2px 8px rgba(20, 23, 43, .06);
}
.sb-mini.english { --hue: var(--sb-english, #FF6A3D); }
.sb-mini.math { --hue: var(--sb-accent, #3B3FE4); }
.sb-mini.reading { --hue: var(--sb-reading, #0FA3B1); }
.sb-mini.science { --hue: var(--sb-science, #2FB344); }

/* ---------- Current question in a passage ---------- */
mark.sb-current {
    background: #FFE58A;
    padding: .05em .15em;
    border-radius: .2em;
    box-shadow: 0 0 0 2px #FFC233;
}
.qbox.sb-current {
    background: #FFE58A;
    box-shadow: 0 0 0 2px #FFC233;
}
.sb-passage-ref {
    display: inline-flex;
    align-items: center;
    gap: .15rem;
    font-size: .8rem;
    font-weight: 600;
    padding: .1rem .55rem;
    border-radius: 999px;
    background: #FFF4D6;
    color: #8A5A00;
}

/* ---------- Invite friends ---------- */
.sb-invite-progress {
    border-radius: 1rem;
    color: #fff;
    background: linear-gradient(135deg, #3B3FE4, #6A3DE8 65%, #FF6A3D);
    box-shadow: 0 10px 24px rgba(59, 63, 228, .25);
}
.sb-invite-progress .progress {
    background: rgba(255, 255, 255, .25);
}

/* ---------- Base Camp and My Path ---------- */
.sb-basecamp {
    border-radius: 1rem;
    padding: 1.25rem;
    color: #fff;
    background: linear-gradient(135deg, #14172B, #3B3FE4 70%);
    box-shadow: 0 10px 24px rgba(20, 23, 43, .25);
}
.sb-basecamp .bubble {
    display: grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: #FFC233;
    color: #14172B;
    font-size: 1.4rem;
}
.sb-basecamp .list-group-item.sb-basecamp-next {
    border-left: 4px solid #FFC233;
}
.sb-basecamp-skip {
    color: rgba(255, 255, 255, .75);
}
.sb-basecamp-skip:hover {
    color: #fff;
}
.sb-camp-preview {
    border-style: dashed;
    background: #FAFAFF;
}

/* ---------- Writing ---------- */
.sb-essay-text {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.05rem;
    line-height: 1.6;
}
.sb-essay-final {
    white-space: pre-wrap;
    font-family: Georgia, "Times New Roman", serif;
    line-height: 1.6;
}
.sb-essay-timer {
    font-family: "Space Grotesk", sans-serif;
    font-weight: 700;
    font-size: 1.3rem;
    padding: .2rem .8rem;
    border-radius: 999px;
    background: #EEF0FF;
    color: #3B3FE4;
}
.sb-essay-timer.low {
    background: #FFE9E2;
    color: #C23A12;
}
@media (min-width: 992px) {
    .sb-essay-prompt {
        position: sticky;
        top: 1rem;
        max-height: calc(100vh - 2rem);
        overflow-y: auto;
    }
}

/* ---------- Practice page: subject / mode / length picker ---------- */
.sb-step-label { font-weight: 700; font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; color: #6b6f86; margin: 1rem 0 .5rem; }
.sb-step-label:first-child { margin-top: 0; }
.sb-choice-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.sb-choice-grid.two { grid-template-columns: repeat(2, 1fr); }
.sb-choice-grid.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 576px) {
    .sb-choice-grid { grid-template-columns: repeat(2, 1fr); }
    .sb-choice-grid.three { grid-template-columns: 1fr; }
}
.sb-choice { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .2rem; text-align: center;
    min-height: 4.5rem; padding: .75rem .5rem; border: 2px solid #E3E5F0; border-radius: 14px; background: #fff; color: #14172B; font-weight: 600; }
.sb-choice i { font-size: 1.4rem; color: #3B3FE4; }
.sb-choice small { font-weight: 400; color: #6b6f86; font-size: .8rem; line-height: 1.3; }
.sb-choice.active { border-color: #3B3FE4; background: #EEF0FF; }
.sb-choice:disabled { opacity: .5; }

/* ---------- Diagnostic summary on the review page ---------- */
.sb-diag-sections { display: grid; grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr)); gap: .5rem; }
.sb-diag-sections > div { padding: .75rem; border-radius: 12px; background: #F5F6FB; text-align: center; }
.sb-diag-sections .num { font-family: "Space Grotesk", sans-serif; font-size: 1.5rem; font-weight: 700; }

/* ---------- Question player on phones ---------- */
.sb-qnav-toggle {
    display: flex; align-items: center; gap: .6rem; width: 100%;
    padding: .55rem .85rem; border: 1px solid #E3E5F0; border-radius: 12px; background: #fff; color: #14172B; text-align: left;
}
.sb-passage-box { max-height: 75vh; overflow-y: auto; }
@media (max-width: 991.98px) {
    .sb-qnav { display: none !important; }
    .sb-qnav.open { display: flex !important; }
    /* Leave room on screen for the question and answers below the passage. */
    .sb-passage-box { max-height: 32vh; font-size: .95rem; }
    .sb-passage-box.tall { max-height: 70vh; }
    /* Keep Previous / Flag / Next within thumb reach. */
    .sb-player-actions {
        position: sticky; bottom: 0; z-index: 5;
        padding: .6rem 0 calc(.6rem + env(safe-area-inset-bottom));
        background: #F5F6FB; border-top: 1px solid #E3E5F0;
    }
    .sb-player-actions .btn { min-height: 44px; }
    .list-group-item { padding-top: .8rem; padding-bottom: .8rem; }
}

/* ---------- Essay page on phones ---------- */
@media (max-width: 991.98px) {
    .sb-essay-prompt.sb-collapsed-sm { display: none; }
    /* Keep the title and timer in view while the student scrolls through a long essay. */
    .sb-essay-head { position: sticky; top: 0; z-index: 5; background: rgba(245, 246, 251, .96); padding: .4rem 0; }
    .sb-essay-text { min-height: 55vh; }
}

/* ---------- On-screen calculator (Math) ---------- */
/* Phones: a sheet over the bottom of the screen. Larger screens: a floating panel at the bottom right. */
.sb-calc-sheet {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1040;
    height: min(526px, 72vh); box-sizing: border-box;
    display: flex; flex-direction: column; gap: 8px;
    padding: 6px 16px calc(14px + env(safe-area-inset-bottom));
    background: #FFFFFF; color: #14172B;
    border-radius: 24px 24px 0 0; box-shadow: 0 -8px 32px rgba(20, 23, 43, .18);
    font-family: Inter, system-ui, sans-serif;
}
.sb-calc-sheet[hidden] { display: none; }
.sb-calc-drag { touch-action: none; }
.sb-calc-grip { width: 40px; height: 5px; border-radius: 3px; background: #CDD0E0; margin: 4px auto 6px; }
.sb-calc-head { display: flex; align-items: center; gap: 8px; }
.sb-calc-head h2 { flex: 1; margin: 0; font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 16px; }
.sb-calc-mode { display: flex; background: #EEF0F8; border-radius: 10px; padding: 3px; }
.sb-calc-mode button { height: 32px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; font-size: 12px; font-weight: 600; color: #4A4F6A; }
.sb-calc-mode button.on { background: #FFFFFF; color: #14172B; font-weight: 700; }
.sb-calc-close { width: 44px; height: 44px; border: 0; border-radius: 12px; background: #F5F6FB; color: #14172B; font-size: 18px; }

.sb-calc-history { list-style: none; margin: 0; padding: 6px 8px; background: #F5F6FB; border-radius: 14px; max-height: 88px; min-height: 40px; overflow-y: auto; font-size: 13px; }
.sb-calc-history button { display: flex; gap: 8px; width: 100%; border: 0; background: transparent; padding: 3px 4px; text-align: left; color: #6A6F8A; border-radius: 6px; }
.sb-calc-history button.current { color: #2C3048; }
.sb-calc-history button:active { background: #E4E6F2; }
.sb-calc-history .q { font-weight: 700; min-width: 32px; }
.sb-calc-history button.current .q { color: #3B3FE4; }
.sb-calc-history .e { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-calc-history .r { white-space: nowrap; }
.sb-calc-empty { color: #6A6F8A; padding: 4px; }

.sb-calc-display { display: flex; flex-direction: column; align-items: flex-end; padding: 0 4px 4px; border-bottom: 2px solid #E4E6F2; min-width: 0; }
.sb-calc-expr { font-size: 14px; color: #6A6F8A; min-height: 18px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-calc-value { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 32px; line-height: 1.15; max-width: 100%; overflow-x: auto; white-space: nowrap; }

.sb-calc-keys { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin-top: auto; }
.sb-calc-keys button { height: 44px; border: 0; border-radius: 12px; font-family: 'Space Grotesk', Inter, sans-serif; touch-action: manipulation; user-select: none; }
.sb-calc-keys button:active { filter: brightness(.92); }
.sb-calc-keys .fn { background: #EEF0F8; color: #14172B; font-size: 15px; font-weight: 600; }
.sb-calc-keys .num { background: #FFFFFF; color: #14172B; font-size: 19px; font-weight: 600; border: 1px solid #E4E6F2; }
.sb-calc-keys .op { background: #DFE0FF; color: #23259A; font-size: 19px; font-weight: 700; }
.sb-calc-keys .clear { background: #FFE4E1; color: #A3261C; font-size: 15px; font-weight: 700; }
.sb-calc-keys .eq { background: #3B3FE4; color: #FFFFFF; font-size: 20px; font-weight: 700; }

/* The "last result" chip: shows what the calculator said on this question while it's tucked away. */
.sb-calc-chip {
    position: fixed; right: 16px; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 1030;
    display: flex; align-items: center; gap: 8px; min-height: 44px;
    padding: 8px 14px 8px 10px; border: 0; border-radius: 999px;
    background: #14172B; color: #FFFFFF; box-shadow: 0 6px 18px rgba(20, 23, 43, .25); text-align: left;
}
.sb-calc-chip[hidden] { display: none; }
.sb-calc-chip-icon { width: 28px; height: 28px; border-radius: 8px; background: #FFC233; color: #14172B; display: flex; align-items: center; justify-content: center; }
.sb-calc-chip-text { display: flex; flex-direction: column; line-height: 1.1; }
.sb-calc-chip-label { font-size: 11px; color: #C9CCE0; }
.sb-calc-chip-value { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 17px; }

/* The calculator button in the player's action bar. */
.sb-calc-btn { border: 2px solid #FFC233; background: #FFF6DB; color: #14172B; }
.sb-calc-btn[aria-expanded="true"] { background: #FFC233; }

@media (min-width: 992px) {
    .sb-calc-sheet { left: auto; right: 24px; bottom: 24px; width: 380px; height: 540px; border-radius: 24px; box-shadow: 0 12px 40px rgba(20, 23, 43, .22); }
    .sb-calc-grip { display: none; }
    .sb-calc-chip { right: 24px; bottom: 24px; }
}

/* ---------- Answer eliminator ---------- */
.sb-answer > .rich-content { flex: 1; min-width: 0; }
.sb-elim {
    flex: none; align-self: center; margin-left: auto;
    width: 40px; height: 40px; border: 0; border-radius: 10px;
    background: transparent; color: #6A6F8A; font-size: 15px;
}
.sb-elim:hover { background: #EEF0F8; color: #14172B; }
.sb-elim[aria-pressed="true"] { color: #3B3FE4; }
.sb-eliminated { background: #F5F6FB; }
.sb-eliminated > strong, .sb-eliminated > .rich-content { opacity: .5; text-decoration: line-through; text-decoration-thickness: 2px; }

/* ---------- Passage highlighter ---------- */
mark.sb-hl { background: #BDE3FF; color: inherit; padding: 0; border-radius: .15em; cursor: pointer; }
mark.sb-current mark.sb-hl { background: #A6D8FF; }
.sb-hl-button {
    position: fixed; z-index: 1050; min-height: 44px; padding: 0 16px;
    border: 0; border-radius: 999px; background: #14172B; color: #FFFFFF;
    font: 600 15px Inter, system-ui, sans-serif; box-shadow: 0 6px 18px rgba(20, 23, 43, .25);
}
.sb-hl-button[hidden] { display: none; }
.sb-hl-tip { margin-left: auto; }

/* ---------- Flashcard decks (lesson steps) ---------- */
.sb-deck { margin: 1rem 0; max-width: 560px; }
.sb-deck-head { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; margin-bottom: .5rem; }
.sb-deck-title { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 1.1rem; }
.sb-deck-counts { color: var(--sb-muted); font-size: .9rem; white-space: nowrap; }
.sb-deck-filters { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .75rem; }
.sb-deck-filter, .sb-deck-shuffle {
    border: 1px solid #D5D8EA; background: #fff; color: var(--sb-ink); border-radius: 999px;
    padding: .3rem .8rem; font-size: .9rem; min-height: 36px;
}
.sb-deck-filter.on { background: var(--sb-ink); border-color: var(--sb-ink); color: #fff; }
.sb-deck-shuffle { margin-left: auto; }
.sb-card { display: block; width: 100%; border: 0; padding: 0; background: none; perspective: 1200px; text-align: center; cursor: pointer; color: inherit; }
.sb-card[hidden] { display: none; }
.sb-card-inner { display: grid; transition: transform .45s ease; transform-style: preserve-3d; }
.sb-card.flipped .sb-card-inner { transform: rotateY(180deg); }
.sb-card-face {
    grid-area: 1 / 1; min-height: 210px; padding: 1.5rem 1.25rem; border-radius: var(--sb-radius);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem;
    backface-visibility: hidden; -webkit-backface-visibility: hidden;
    box-shadow: 0 6px 20px rgba(20, 23, 43, .10);
}
.sb-card-front { background: #fff; border: 2px solid #E3E5F2; }
.sb-card-back { background: #F0F1FF; border: 2px solid var(--sb-accent); transform: rotateY(180deg); }
.sb-card-label { position: absolute; top: .7rem; left: 1rem; font-size: .8rem; color: var(--sb-muted); }
.sb-card-front { position: relative; }
.sb-card-text { font-size: 1.25rem; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.sb-card-back .sb-card-text { font-weight: 500; }
.sb-card-text .katex { font-size: 1.1em; }
.sb-card-note { font-size: .95rem; color: var(--sb-muted); max-width: 32rem; }
.sb-deck-hint { text-align: center; color: var(--sb-muted); font-size: .85rem; margin: .5rem 0; }
.sb-deck-hint[hidden], .sb-deck-controls[hidden], .sb-deck-done[hidden] { display: none; }
.sb-deck-controls { display: flex; gap: .5rem; align-items: stretch; }
.sb-deck-nav { flex: 0 0 48px; border: 1px solid #D5D8EA; background: #fff; border-radius: 14px; min-height: 48px; font-size: 1.1rem; }
.sb-deck-again, .sb-deck-got { flex: 1; border: 0; border-radius: 14px; min-height: 48px; font-weight: 600; }
.sb-deck-again { background: #FFE9D6; color: #8A3A12; }
.sb-deck-got { background: var(--sb-science); color: #fff; }
.sb-deck-again:disabled, .sb-deck-got:disabled { opacity: .45; }
.sb-deck-done { text-align: center; padding: 1.5rem; background: #fff; border-radius: var(--sb-radius); display: flex; flex-direction: column; gap: .6rem; align-items: center; }
.sb-deck-done .sb-deck-got { flex: none; padding: 0 1.25rem; }
.sb-deck-done-title { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 1.15rem; }
@media (prefers-reduced-motion: reduce) { .sb-card-inner { transition: none; } }
