:root {
    --bg: #f3f5f7;
    --surface: #fff;
    --text: #17202a;
    --muted: #617080;
    --line: #d9e0e7;
    --brand: #1f5eff;
    --brand-dark: #1548c6;
    --success: #19764a;
    --success-bg: #e9f7ef;
    --danger: #b42318;
    --danger-bg: #fff0ee;
    --warning-bg: #fff8df;
    --radius: 14px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.55; }
a { color: var(--brand-dark); }
input, select, textarea, button { font: inherit; }
input[type="text"], input[type="password"], input[type="number"], select, textarea {
    width: 100%; padding: .72rem .8rem; border: 1px solid #b8c3ce; border-radius: 8px; background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 3px solid #cbd8ff; border-color: var(--brand); }
.site-header {
    min-height: 64px; padding: 0 max(1rem, calc((100vw - 1180px) / 2));
    display: flex; align-items: center; gap: 2rem; background: #101828; color: #fff;
}
.site-header a { color: #fff; text-decoration: none; }
.brand { max-width: 360px; font-size: 1rem; font-weight: 800; line-height: 1.2; }
.site-header nav { display: flex; gap: 1.25rem; flex: 1; }
.header-login { margin-left: auto; padding: .45rem .75rem; border: 1px solid #667085; border-radius: 8px; font-weight: 700; }
.user-menu { display: flex; align-items: center; gap: .9rem; }
.user-menu form { margin: 0; }
.page-shell { max-width: 1180px; margin: 0 auto; padding: 2rem 1rem 5rem; }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 2rem; margin-bottom: 2rem; }
.page-heading h1 { margin: .15rem 0 .4rem; font-size: clamp(2rem, 4vw, 3.2rem); line-height: 1.1; }
.portal-hero { margin-bottom: 2.5rem; padding: clamp(1.5rem, 4vw, 3rem); border-radius: 20px; color: #fff; background: linear-gradient(135deg, #101828, #193a77 62%, #1f5eff); box-shadow: 0 18px 45px rgba(16, 24, 40, .18); }
.portal-hero h1 { max-width: 850px; margin: .25rem 0 .8rem; font-size: clamp(2.1rem, 5vw, 4rem); line-height: 1.05; }
.portal-hero p:not(.eyebrow) { max-width: 720px; color: #dbe6ff; font-size: 1.08rem; }
.portal-hero .eyebrow { color: #b9cbff; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.4rem; }
.catalog-heading { margin-bottom: 1rem; }
.catalog-heading > p { max-width: 520px; }
.course-card { display: flex; flex-direction: column; align-items: flex-start; }
.course-card .button { margin-top: auto; }
.public-access-note { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 0 0 1.5rem; padding: 1rem 1.2rem; border: 1px solid #b7c8fa; border-radius: 11px; background: #f4f7ff; }
.public-access-note div { display: flex; flex-direction: column; }
.eyebrow { margin: 0 0 .3rem; color: var(--brand-dark); font-size: .78rem; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.muted, .meta { color: var(--muted); }
.meta { font-size: .86rem; }
.breadcrumbs { margin-bottom: 1.5rem; color: var(--muted); }
.messages { display: grid; gap: .5rem; margin-bottom: 1rem; }
.message { padding: .75rem 1rem; border-radius: 9px; background: #e7efff; }
.message-success { color: var(--success); background: var(--success-bg); }
.message-error { color: var(--danger); background: var(--danger-bg); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; margin-bottom: 2.5rem; }
.card, .content-panel, .narrow-card, .auth-card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.35rem; box-shadow: 0 8px 28px rgba(16, 24, 40, .05);
}
.card h2, .card h3 { margin-top: .2rem; }
.card.compact { padding: 1rem 1.2rem; }
.button {
    display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: .55rem .9rem;
    border: 1px solid #a9b5c2; border-radius: 8px; color: var(--text); background: #fff; font-weight: 700; text-decoration: none; cursor: pointer;
}
.button:hover { background: #f3f6f9; }
.button.primary { color: #fff; background: var(--brand); border-color: var(--brand); }
.button.primary:hover { background: var(--brand-dark); }
.button.secondary { color: var(--brand-dark); border-color: #aec2ff; background: #f4f7ff; }
.link-button { padding: 0; color: var(--brand-dark); background: none; border: 0; text-decoration: underline; cursor: pointer; }
.site-header .link-button { color: #fff; }
.button-group { display: flex; gap: .5rem; }
.empty-state { padding: 1.25rem; border: 1px dashed #adb8c3; border-radius: 10px; color: var(--muted); background: rgba(255,255,255,.6); }
.block-section { margin: 2.5rem 0; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.section-heading h2 { margin: .2rem 0; }
.practice-list { display: grid; gap: .7rem; }
.practice-row {
    display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 1rem;
    padding: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: 11px;
}
.practice-number {
    width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%;
    color: var(--brand-dark); background: #e9efff; font-weight: 800;
}
.practice-copy h3 { margin: 0; }
.practice-copy p { margin: .25rem 0; }
.practice-action { display: grid; justify-items: end; gap: .35rem; }
.status { display: inline-flex; width: fit-content; padding: .2rem .55rem; border-radius: 999px; color: #43505d; background: #edf1f4; font-size: .82rem; font-weight: 700; }
.status-completed, .status-accepted { color: var(--success); background: var(--success-bg); }
.status-revision, .status-void, .danger { color: var(--danger); background: var(--danger-bg); }
.practice-heading { align-items: center; }
.score-panel, .timer-panel {
    min-width: 150px; padding: 1rem; display: grid; justify-items: end; border: 1px solid var(--line); border-radius: 12px; background: #fff;
}
.score-panel strong, .timer-panel strong { font-size: 1.6rem; }
.timer-panel small { color: var(--muted); }
.lab-meta { display: flex; flex-wrap: wrap; gap: .5rem; margin: -1rem 0 1.5rem; }
.lab-meta span { padding: .3rem .65rem; border-radius: 999px; background: #e8edf2; font-size: .85rem; }
.content-panel { margin: 1rem 0; }
.content-panel pre { position: relative; padding: 2.7rem 1rem 1rem; overflow-x: auto; color: #e8edf2; background: #17202a; border-radius: 8px; }
.content-panel code { font-family: "SFMono-Regular", Consolas, monospace; }
.copy-code { position: absolute; top: .55rem; right: .55rem; padding: .3rem .55rem; border: 1px solid #617080; border-radius: 6px; color: #fff; background: #344054; font-size: .78rem; cursor: pointer; }
.copy-code:hover { background: #475467; }
.theory-reminder, .study-note { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 1rem 0; padding: 1rem 1.2rem; border: 1px solid #b7c8fa; border-radius: 11px; background: #f4f7ff; }
.theory-reminder div, .study-note { display: flex; }
.theory-reminder div { flex-direction: column; }
.study-note { align-items: flex-start; justify-content: flex-start; flex-direction: column; }
.theory-content { max-width: 900px; }
.theory-content h2 { margin-top: 2.2rem; padding-top: .5rem; border-top: 1px solid var(--line); }
.theory-content table { width: 100%; border-collapse: collapse; }
.theory-content th, .theory-content td { padding: .6rem; border: 1px solid var(--line); text-align: left; }
.next-actions { display: flex; flex-wrap: wrap; gap: .7rem; }
.step-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.step-heading h2 { margin: .15rem 0 1rem; }
.step-time { white-space: nowrap; padding: .3rem .6rem; border-radius: 999px; color: var(--muted); background: #edf1f4; font-size: .84rem; }
.instruction-box { margin: .8rem 0; padding: .9rem 1rem; border-left: 4px solid #98a2b3; border-radius: 7px; background: #f8fafc; }
.instruction-box h3 { margin: 0 0 .4rem; font-size: 1rem; }
.instruction-box > :last-child { margin-bottom: 0; }
.instruction-objective { border-left-color: var(--brand); background: #f4f7ff; }
.instruction-actions { border-left-color: #617080; }
.instruction-result { border-left-color: var(--success); background: var(--success-bg); }
.troubleshooting { margin: .8rem 0; padding: .8rem 1rem; border: 1px solid #ead58a; border-radius: 8px; background: var(--warning-bg); }
.troubleshooting summary { font-weight: 750; cursor: pointer; }
.config-list { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; }
.config-list dt { font-weight: 700; }
.config-list dd { margin: 0; }
.download-list li { margin: .5rem 0; }
.download-list span { display: block; color: var(--muted); font-size: .85rem; }
.checkpoint { margin-top: 1.25rem; padding: 1rem; border: 1px solid var(--line); border-left: 5px solid #96a3b1; border-radius: 9px; background: #fbfcfd; }
.checkpoint-correct { border-left-color: var(--success); background: var(--success-bg); }
.checkpoint-title { display: flex; justify-content: space-between; gap: 1rem; }
.checkpoint-title h3 { margin-top: 0; }
.answer-form { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: .6rem; }
.answer-form label { grid-column: 1 / -1; font-weight: 700; }
.success-text { color: var(--success); font-weight: 700; }
.error-text { color: var(--danger); }
.hint { margin-top: .75rem; padding: .75rem 1rem; border-radius: 8px; background: var(--warning-bg); }
.facts { display: flex; flex-wrap: wrap; gap: .75rem; }
.facts div { min-width: 130px; padding: .75rem; background: #f3f6f9; border-radius: 8px; }
.facts dt { color: var(--muted); font-size: .8rem; }
.facts dd { margin: 0; font-size: 1.2rem; font-weight: 800; }
.test-question h2 { font-size: 1.15rem; }
.choice { display: flex; align-items: flex-start; gap: .65rem; margin: .5rem 0; padding: .6rem; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.choice input { margin-top: .3rem; }
.sticky-submit { position: sticky; bottom: 1rem; display: flex; justify-content: flex-end; padding: 1rem; border-radius: 11px; background: rgba(16, 24, 40, .92); }
.table-scroll { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 11px; }
.progress-table { width: 100%; border-collapse: collapse; white-space: nowrap; }
.progress-table th, .progress-table td { padding: .65rem; border-bottom: 1px solid var(--line); text-align: center; }
.progress-table thead th { position: sticky; top: 0; background: #eef2f6; }
.progress-table tbody th { position: sticky; left: 0; z-index: 1; min-width: 220px; text-align: left; background: #fff; }
.progress-table small { display: block; color: var(--muted); }
.score-cell.status-completed, .score-cell.status-accepted { color: var(--success); background: var(--success-bg); }
.auth-card, .narrow-card { max-width: 620px; margin: 3rem auto; }
.auth-card { max-width: 420px; }
.auth-card form { display: grid; gap: .6rem; }
@media (max-width: 760px) {
    .site-header { align-items: flex-start; flex-wrap: wrap; gap: .75rem; padding-block: .8rem; }
    .site-header nav { order: 3; flex-basis: 100%; }
    .user-menu { margin-left: auto; }
    .page-heading, .section-heading { align-items: stretch; flex-direction: column; }
    .practice-row { grid-template-columns: 44px 1fr; }
    .practice-action { grid-column: 1 / -1; justify-items: stretch; }
    .answer-form { grid-template-columns: 1fr; }
    .theory-reminder { align-items: stretch; flex-direction: column; }
    .public-access-note { align-items: stretch; flex-direction: column; }
    .step-heading { flex-direction: column; }
}
