: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"], input[type="email"], 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; }
.button.danger-button { color: var(--danger); border-color: #e7aaa4; background: var(--danger-bg); }
.button.danger-button:hover { background: #ffe1dd; }
.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-needs_review { color: #854d0e; background: var(--warning-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-theory { border-left-color: #7a5af8; background: #f7f5ff; }
.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; }
.answer-form textarea, .answer-form > div, .answer-form ul, .answer-form .meta { grid-column: 1 / -1; }
.answer-form ul { display: grid; gap: .45rem; margin: 0; padding: 0; list-style: none; }
.answer-form ul label { display: flex; align-items: flex-start; gap: .65rem; padding: .65rem .75rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; }
.answer-form ul input { width: auto; margin-top: .3rem; }
.success-text { color: var(--success); font-weight: 700; }
.saved-text { color: #694100; font-weight: 700; }
.error-text { color: var(--danger); }
.rubric-note { margin: .75rem 0; padding: .7rem .9rem; border: 1px solid #c8bdf7; border-radius: 8px; background: #f7f5ff; }
.rubric-note summary { font-weight: 750; cursor: pointer; }
.case-briefing { position: relative; overflow: hidden; border-top: 5px solid #7a5af8; }
.case-briefing::after { content: "УЧЕБНЫЙ КЕЙС"; position: absolute; top: 1rem; right: -2.5rem; padding: .25rem 3rem; color: #5d3fd3; background: #eee9ff; font-size: .68rem; font-weight: 900; letter-spacing: .12em; transform: rotate(35deg); }
.case-briefing .section-heading { padding-right: 5rem; }
.case-code { display: inline-flex; padding: .3rem .65rem; border-radius: 999px; color: #4d349f; background: #eee9ff; font-family: "SFMono-Regular", Consolas, monospace; }
.event-inject { margin: 1rem 0; padding: 1.1rem 1.2rem; border: 2px solid #d3aa55; border-radius: 10px; background: linear-gradient(135deg, #fff8df, #fffdf4); box-shadow: 0 8px 22px rgba(105, 65, 0, .08); }
.review-answer-list { display: grid; min-width: 0; gap: 1rem; margin: 1.5rem 0; }
.review-answer { min-width: 0; overflow: hidden; padding: 1rem; border: 1px solid var(--line); border-radius: 10px; background: #f8fafc; }
.review-answer h2 { margin-top: 0; font-size: 1.15rem; }
.review-answer blockquote { max-width: 100%; margin: .75rem 0; padding: .9rem 1rem; border-left: 4px solid #7a5af8; background: #fff; white-space: normal; overflow-wrap: anywhere; word-break: break-all; }
.review-feedback { border-color: #9cc9ae; background: #f5fbf7; }
.review-feedback-revision { border-color: #e7aaa4; background: #fff8f7; }
.review-feedback blockquote { margin: .8rem 0; padding: .8rem 1rem; border-left: 4px solid currentColor; background: rgba(255,255,255,.75); overflow-wrap: anywhere; word-break: break-word; }
.review-feedback-list { display: grid; gap: .65rem; }
.review-feedback-list article { padding: .8rem 1rem; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.review-feedback-list h3 { margin: 0 0 .25rem; font-size: 1rem; }
.review-feedback-list p { margin: 0; }
.review-form { display: grid; gap: 1rem; margin-top: 1.2rem; }
.review-score-box { display: grid; gap: .45rem; padding: 1rem; border: 1px solid var(--line); border-radius: 10px; }
.review-score-box legend { padding: 0 .35rem; font-weight: 800; }
.review-score-box input { max-width: 180px; }
.errorlist { margin: .25rem 0; color: var(--danger); }
.osint-hero { margin-bottom: 1rem; padding: clamp(1.4rem, 4vw, 2.5rem); border-radius: 18px; color: #eefcf7; background: linear-gradient(135deg, #102a27, #155e55 65%, #14866f); box-shadow: 0 16px 38px rgba(15, 61, 54, .18); }
.osint-hero.compact { padding-block: 1.7rem; }
.osint-hero h1 { margin: .15rem 0 .5rem; font-size: clamp(2rem, 5vw, 3.6rem); line-height: 1.05; }
.osint-hero .eyebrow { color: #9be1d2; }
.synthetic-warning { margin: 1rem 0; padding: .9rem 1.1rem; border: 1px solid #e1bd63; border-radius: 10px; background: #fff8df; }
.searchlab-form { display: grid; gap: .4rem; margin-top: 1.2rem; }
.searchlab-form label { font-weight: 800; }
.searchlab-form > div { display: grid; grid-template-columns: 1fr auto; gap: .55rem; }
.searchlab-form input[type="search"] { min-width: 0; padding: .75rem .85rem; border: 1px solid #9fb5b0; border-radius: 8px; }
.source-catalog { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: .6rem; margin-top: .8rem; }
.source-catalog a { display: grid; padding: .75rem; border: 1px solid var(--line); border-radius: 8px; color: var(--text); background: #fff; text-decoration: none; }
.source-catalog a:hover { border-color: #57a895; background: #f1fbf8; }
.source-catalog small { color: var(--muted); }
.search-results { display: grid; gap: .8rem; }
.search-result { padding: 1.1rem 1.25rem; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.search-result h2 { margin: .15rem 0 .35rem; font-size: 1.22rem; }
.synthetic-source { max-width: 900px; margin: 1rem auto; overflow: hidden; border: 1px solid #cfd7de; border-radius: 12px; background: #fff; box-shadow: 0 12px 32px rgba(16, 24, 40, .09); }
.synthetic-source header { padding: 1.4rem clamp(1.2rem, 4vw, 2.5rem); border-bottom: 1px solid var(--line); background: #f7faf9; }
.synthetic-source h1 { margin: .25rem 0 .5rem; line-height: 1.15; }
.source-brand { margin: 0; color: #155e55; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; }
.source-body { padding: clamp(1.2rem, 4vw, 2.5rem); font-size: 1.05rem; }
.source-body span[id] { display: block; margin: .8rem 0; padding: .8rem 1rem; border-left: 4px solid #57a895; background: #f1fbf8; }
.archived-source { border-color: #d3aa55; }
.archived-source header { background: #fff8df; }
.archive-badge { display: inline-flex; margin-top: .45rem; padding: .2rem .55rem; border-radius: 999px; color: #694100; background: #f8df9a; font-weight: 800; }
.evidence-footer { max-width: 900px; margin-inline: auto; }
.hint { margin-top: .75rem; padding: .75rem 1rem; border-radius: 8px; background: var(--warning-bg); }
.activation-panel { border-top: 5px solid var(--brand); }
.activation-ready { border-top-color: var(--success); }
.activation-action, .activation-waiting, .activation-success { margin-top: 1.2rem; padding: 1.1rem; border-radius: 10px; }
.activation-action { border: 1px solid #b7c8fa; background: #f4f7ff; }
.activation-action h3, .activation-waiting p, .activation-success p { margin-top: 0; }
.activation-form { display: grid; grid-template-columns: minmax(240px, 1fr) auto; align-items: end; gap: .7rem; max-width: 680px; }
.activation-form label { grid-column: 1 / -1; font-weight: 800; }
.activation-code-input { font-family: "SFMono-Regular", Consolas, monospace; font-size: 1.15rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.activation-waiting { border: 1px solid #ead58a; background: var(--warning-bg); }
.activation-success { border: 1px solid #9ad0b4; background: var(--success-bg); }
.waiting-dots { display: flex; gap: .35rem; }
.waiting-dots span { width: 9px; height: 9px; border-radius: 50%; background: var(--brand); animation: waiting-pulse 1.2s infinite ease-in-out; }
.waiting-dots span:nth-child(2) { animation-delay: .15s; }
.waiting-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes waiting-pulse { 0%, 80%, 100% { opacity: .25; transform: scale(.8); } 40% { opacity: 1; transform: scale(1); } }
.locked-panel { display: flex; align-items: center; gap: 1rem; border-style: dashed; color: var(--muted); background: #f7f8fa; box-shadow: none; }
.locked-panel h2, .locked-panel p { margin: 0; }
.lock-icon { font-size: 1.7rem; }
.locked-step { color: var(--muted); background: #f7f8fa; box-shadow: none; }
.checkpoint-locked { background: #f3f5f7; }
.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); }
.score-cell.status-needs_review { color: #854d0e; background: var(--warning-bg); }
.management-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; }
.management-card h2 { margin-top: .2rem; }
.form-stack { display: grid; gap: 1rem; }
.form-field { display: grid; gap: .35rem; }
.form-field label { font-weight: 750; }
.form-field small { color: var(--muted); }
.field-errors, .field-errors ul { margin: 0; color: var(--danger); }
.student-table { width: 100%; border-collapse: collapse; }
.student-table th, .student-table td { padding: .7rem; border-bottom: 1px solid var(--line); text-align: left; }
.student-table thead th { background: #eef2f6; }
.inline-form { margin: 0; }
.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; }
    .searchlab-form > div { grid-template-columns: 1fr; }
    .activation-form { grid-template-columns: 1fr; }
    .activation-form label { grid-column: auto; }
    .theory-reminder { align-items: stretch; flex-direction: column; }
    .public-access-note { align-items: stretch; flex-direction: column; }
    .step-heading { flex-direction: column; }
}
