:root {
    --sb-ink: #111827;
    --sb-muted: #667085;
    --sb-line: #d8dee8;
    --sb-panel: #ffffff;
    --sb-soft: #f3f6fb;
    --sb-blue: #1769ff;
    --sb-blue-dark: #0b4fd8;
    --sb-green: #12805c;
    --sb-amber: #b7791f;
}

body {
    color: var(--sb-ink);
    background: #f6f8fb !important;
}

main {
    min-height: calc(100vh - 150px);
}

.sb-page-shell {
    max-width: 1180px;
}

.sb-hero {
    background:
        linear-gradient(135deg, rgba(13, 42, 86, .94), rgba(22, 79, 150, .9)),
        url("https://images.unsplash.com/photo-1519389950473-47ba0277781c?auto=format&fit=crop&w=1600&q=80");
    background-position: center;
    background-size: cover;
    border-radius: 8px;
    color: #fff;
    overflow: hidden;
}

.sb-hero-inner {
    padding: clamp(24px, 5vw, 46px);
}

.sb-kicker {
    color: rgba(255, 255, 255, .74);
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.sb-stat-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    background: rgba(255, 255, 255, .2);
    border-top: 1px solid rgba(255, 255, 255, .22);
}

.sb-stat-strip > div {
    background: rgba(7, 20, 40, .22);
    padding: 14px 18px;
}

.sb-hero-focus {
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 8px;
    padding: 14px;
}

.sb-stat-value {
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.1;
}

.sb-stat-label {
    color: rgba(255, 255, 255, .72);
    font-size: .78rem;
}

.sb-action-card,
.sb-admin-card,
.sb-panel-card,
.sb-lesson-card,
.sb-question-panel {
    background: var(--sb-panel);
    border: 1px solid #e4e9f1;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .06);
}

.sb-action-card,
.sb-admin-card {
    display: flex;
    gap: 14px;
    padding: 16px;
    text-decoration: none;
    color: inherit;
    min-height: 100%;
}

.sb-action-card:hover,
.sb-admin-card:hover {
    border-color: #b8c7dd;
    color: inherit;
    transform: translateY(-1px);
}

.sb-icon-tile {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e8f0ff;
    color: var(--sb-blue);
    font-weight: 800;
    flex: 0 0 auto;
}

.sb-icon-tile i {
    font-size: 1.05rem;
    line-height: 1;
}

.sb-lesson-card {
    padding: 18px;
    min-height: 100%;
}

.sb-lesson-title {
    font-size: 1.05rem;
    font-weight: 750;
    line-height: 1.25;
}

.sb-progress {
    height: 8px;
    background: #e8edf5;
    border-radius: 999px;
    overflow: hidden;
}

.sb-progress > span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--sb-blue), #12a594);
    border-radius: inherit;
}

.sb-status-pill {
    border: 1px solid #d7deea;
    border-radius: 999px;
    color: #475467;
    display: inline-flex;
    font-size: .76rem;
    font-weight: 700;
    line-height: 1;
    padding: 6px 9px;
}

.sb-status-pill.done {
    border-color: #b7e3d5;
    color: var(--sb-green);
    background: #ecfdf6;
}

.sb-status-pill.active {
    border-color: #bfd3ff;
    color: var(--sb-blue-dark);
    background: #eef4ff;
}

.sb-login-wrap {
    min-height: calc(100vh - 150px);
    display: flex;
    align-items: center;
}

.sb-login-panel {
    overflow: hidden;
    border: 1px solid #dfe6ef;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 16px 45px rgba(15, 23, 42, .1);
}

.sb-login-intro {
    background:
        linear-gradient(150deg, rgba(15, 23, 42, .94), rgba(22, 101, 216, .86)),
        url("https://images.unsplash.com/photo-1497366754035-f200968a6e72?auto=format&fit=crop&w=1200&q=80");
    background-position: center;
    background-size: cover;
    color: #fff;
    min-height: 100%;
    padding: clamp(26px, 5vw, 44px);
}

.sb-login-proof {
    border-top: 1px solid rgba(255, 255, 255, .18);
    color: rgba(255, 255, 255, .78);
    display: grid;
    gap: 10px;
    margin-top: 32px;
    padding-top: 18px;
}

.sb-admin-toolbar {
    background: #0f172a;
    border-radius: 8px;
    color: #dbeafe;
    padding: 12px;
}

.sb-admin-toolbar .btn {
    border-color: rgba(255, 255, 255, .24);
    color: #fff;
}

.sb-question-text {
    font-size: 1rem;
    line-height: 1.55;
}

.sb-question-meta {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.sb-filter-bar {
    background: #fff;
    border: 1px solid #e4e9f1;
    border-radius: 8px;
    padding: 14px;
}

.sb-option-row {
    border: 1px solid #d8dee8;
    border-radius: 8px;
    padding: 12px;
}

.sb-option-row.correct {
    border-color: #9fd6c4;
    background: #f0fdf8;
}

.sb-editor-actions {
    position: sticky;
    bottom: 0;
    z-index: 5;
    background: rgba(255, 255, 255, .92);
    border-top: 1px solid #e4e9f1;
    margin: 18px -16px -16px;
    padding: 14px 16px;
    backdrop-filter: blur(10px);
}

.sb-global-flashes {
    left: 50%;
    max-width: min(720px, calc(100vw - 24px));
    position: fixed;
    top: 68px;
    transform: translateX(-50%);
    width: 100%;
    z-index: 2000;
}

.sb-metric-box {
    background: #f8fafc;
    border: 1px solid #e4e9f1;
    border-radius: 8px;
    padding: 14px;
}

.sb-metric-value {
    color: var(--sb-ink);
    font-size: 1.55rem;
    font-weight: 800;
    line-height: 1;
}

.sb-stats-card {
    min-height: 100%;
}

.sb-stats-explainer {
    border-color: #dbe7ff;
}

.sb-onboarding-panel {
    border-color: #cfe0ff;
}

.sb-explainer-steps {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.sb-explainer-steps > div {
    background: #f8fafc;
    border: 1px solid #e4e9f1;
    border-radius: 8px;
    min-height: 100%;
    padding: 12px;
}

.sb-explainer-steps-stacked {
    grid-template-columns: 1fr;
}

.sb-step-number {
    align-items: center;
    background: #e8f0ff;
    border-radius: 999px;
    color: var(--sb-blue);
    display: inline-flex;
    font-size: .78rem;
    font-weight: 800;
    height: 24px;
    justify-content: center;
    margin-bottom: 8px;
    width: 24px;
}

.sb-stats-advice {
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e4e9f1;
    border-radius: 8px;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    padding: 12px;
}

.sb-stats-mini {
    background: #f8fafc;
    border: 1px solid #e4e9f1;
    border-radius: 8px;
    padding: 10px;
}

.sb-toggle-box {
    background: #f8fafc;
    border: 1px solid #e4e9f1;
    border-radius: 8px;
    padding: 12px;
}

.sb-stage-grid {
    display: grid;
    gap: 9px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.sb-stage-track {
    background: #e8edf5;
    border-radius: 999px;
    height: 7px;
    overflow: hidden;
}

.sb-stage-track > span {
    background: linear-gradient(90deg, #1769ff, #12a594);
    border-radius: inherit;
    display: block;
    height: 100%;
}

.sb-admin-card {
    background: #fff;
}

.sb-read-side-nav {
    z-index: 1040;
    padding: 12px;
}

.sb-read-side-nav-prev {
    left: max(8px, env(safe-area-inset-left));
}

.sb-read-side-nav-next {
    right: max(8px, env(safe-area-inset-right));
}

.sb-read-mobile-nav {
    display: none;
}

@media (max-width: 767px) {
    .sb-read-side-nav {
        display: none;
    }

    .sb-read-mobile-nav {
        position: sticky;
        bottom: 0;
        z-index: 1030;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        margin: 18px -12px -16px;
        padding: 12px max(12px, env(safe-area-inset-left)) calc(12px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-right));
        background: rgba(248, 250, 252, .96);
        border-top: 1px solid #e2e8f0;
        backdrop-filter: blur(10px);
    }
}

.sb-admin-card .sb-icon-tile {
    background: #edf4ff;
}

.sb-select-card {
    align-items: flex-start;
    background: #fff;
    border: 1px solid #d8dee8;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    gap: 10px;
    height: 100%;
    padding: 12px;
    transition: border-color .12s ease, box-shadow .12s ease, background-color .12s ease;
}

.sb-select-card:hover {
    border-color: #b8c7dd;
    box-shadow: 0 6px 18px rgba(15, 23, 42, .06);
}

.sb-select-card:has(input:checked) {
    background: #f0f7ff;
    border-color: #9dbdff;
}

@media (max-width: 767px) {
    .sb-stat-strip {
        grid-template-columns: 1fr;
    }

    .sb-stage-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sb-explainer-steps {
        grid-template-columns: 1fr;
    }

    .sb-stats-advice {
        align-items: stretch;
        flex-direction: column;
    }

    .sb-hero-inner,
    .sb-login-intro {
        padding: 24px;
    }

    .sb-admin-toolbar {
        align-items: stretch !important;
    }

    .sb-global-flashes {
        top: 62px;
    }
}
