:root {
    --bg: #f4f7f8;
    --panel: #ffffff;
    --ink: #172026;
    --muted: #62717d;
    --line: #dbe3e7;
    --primary: #0b6b77;
    --primary-dark: #084f58;
    --accent: #d8952a;
    --danger: #b42318;
    --success: #0f7a3d;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: Arial, Helvetica, sans-serif;
}

a {
    color: var(--primary);
    text-decoration: none;
}

.shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 280px 1fr;
}

.sidebar {
    background: #13252d;
    color: #fff;
    padding: 24px 18px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    font-weight: 700;
    font-size: 18px;
}

.brand-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    background: var(--accent);
    color: #172026;
    border-radius: 6px;
    font-weight: 800;
}

.menu {
    display: grid;
    gap: 8px;
}

.menu a {
    color: #dce7ea;
    padding: 12px 12px;
    border-radius: 6px;
    line-height: 1.25;
}

.menu-heading {
    margin: 10px 8px 2px;
    color: #9fb4bc;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.menu a:hover,
.menu a.active {
    background: #203942;
    color: #fff;
}

.sidebar-footer {
    margin-top: auto;
    border-top: 1px solid rgba(255,255,255,.16);
    padding-top: 16px;
    display: grid;
    gap: 8px;
    color: #dce7ea;
}

.study-block { min-width: 0; margin-top: 14px; padding: 0 0 4px 12px; border-left: 3px solid #718b95; }
.study-block-title { margin: 0; padding: 8px 0; font-size: 17px; line-height: 1.4; font-weight: 800; color: #fff; overflow-wrap: anywhere; }
.study-block-current { border-left-color: #f1c35d; }
.study-block-current .study-block-title { color: #f1c35d; }
.study-block-status { display: block; margin-bottom: 8px; color: #f1c35d; font-size: 12px; font-weight: 700; }
.study-topics { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.menu .study-topics a { display: block; padding: 11px 10px; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; border: 1px solid transparent; }
.menu .study-topics a.active { background: #e6f4f1; color: #153d35; border-color: #a3cbbf; font-weight: 800; }
.menu a:focus-visible { outline: 2px solid #f1c35d; outline-offset: 2px; }

.sidebar-footer a {
    color: #fff;
    font-weight: 700;
}

.content {
    min-width: 0;
    padding: 34px;
    display: flex;
    flex-direction: column;
}

.site-credit {
    margin-top: auto;
    padding-top: 32px;
    text-align: center;
    font-size: 13px;
    line-height: 1.5;
}

.site-credit a {
    color: var(--muted);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.site-credit a:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 4px;
}

.page-head {
    margin-bottom: 24px;
}

.page-head h1 {
    margin: 0 0 8px;
    font-size: 32px;
}

.page-head p {
    margin: 0;
    color: var(--muted);
    max-width: 780px;
    line-height: 1.55;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px;
}

.card,
.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 20px;
}

.card h2,
.panel h2 {
    margin: 0 0 10px;
    font-size: 20px;
}

.card p,
.panel p {
    color: var(--muted);
    line-height: 1.5;
}

.auth-page {
    min-height: 100vh;
    display: grid;
    grid-template-rows: 1fr auto;
    place-items: center;
    padding: 24px;
    background: linear-gradient(135deg, #e8f0f2, #f8f6ef);
}

.auth-card {
    width: min(440px, 100%);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 28px;
    box-shadow: 0 18px 50px rgba(23,32,38,.12);
}

.auth-card h1 {
    margin: 0 0 8px;
}

.auth-card p {
    margin-top: 0;
    color: var(--muted);
}

.form {
    display: grid;
    gap: 14px;
}

.field {
    display: grid;
    gap: 7px;
}

label {
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid #c9d5db;
    border-radius: 6px;
    padding: 11px 12px;
    font: inherit;
    background: #fff;
}

.btn,
button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    border: 0;
    border-radius: 6px;
    padding: 11px 15px;
    background: var(--primary);
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.btn:hover,
button:hover {
    background: var(--primary-dark);
}

.btn.secondary {
    background: #e8eef1;
    color: var(--ink);
}

.btn.danger {
    background: var(--danger);
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.compact-form {
    display: grid;
    gap: 8px;
    min-width: 260px;
}

.compact-form input,
.compact-form textarea {
    padding: 8px 9px;
    font-size: 14px;
}

.alert {
    margin-bottom: 18px;
    padding: 12px 14px;
    border-radius: 6px;
    background: #e7f6ec;
    border: 1px solid #bde5cb;
    color: #14532d;
}

.alert.error {
    background: #fff0ed;
    border-color: #f3b8ae;
    color: #7a271a;
}

.table-wrap {
    overflow-x: auto;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    text-align: left;
    padding: 13px 14px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

th {
    background: #eef4f5;
}

tr:last-child td {
    border-bottom: 0;
}

.question {
    display: grid;
    gap: 12px;
    margin-bottom: 18px;
}

.option {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.option input {
    width: auto;
    margin-top: 3px;
}

.score {
    font-size: 42px;
    font-weight: 800;
    color: var(--success);
}

.muted {
    color: var(--muted);
}

.stat {
    margin: 0;
    color: var(--primary);
    font-size: 30px;
    font-weight: 800;
}

@media (max-width: 820px) {
    .shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
    }

    .content {
        padding: 22px;
    }
}


.check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 8px;
}


.support-link {
    display: grid;
    gap: 4px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-left: 4px solid var(--accent);
    border-radius: 8px;
    background: #f7fbfb;
    color: var(--primary);
    text-decoration: none;
}

.support-link span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

.support-link strong {
    font-size: 16px;
}

.support-link small {
    color: var(--muted);
    overflow-wrap: anywhere;
}

.support-link:hover {
    border-color: var(--accent);
    background: #eef8f6;
}

.question-image {
    display: block;
    width: min(100%, 680px);
    max-height: 420px;
    object-fit: contain;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.compact-form select {
    padding: 8px 9px;
    font-size: 14px;
}

[hidden] { display: none !important; }
.uppercase-name { text-transform: uppercase; }
.question-video {
    display: block;
    width: 100%;
    max-width: 760px;
    aspect-ratio: 16 / 9;
    border: 0;
    background: #111;
}
.question-kind { font-size: 14px; font-weight: 400; color: var(--muted); }
.answer-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.review-form { display: grid; gap: 10px; min-width: 220px; }
.question { min-width: 0; }
.question input[type="file"] { min-width: 0; max-width: 100%; }
.result-list { display: grid; gap: 16px; }
.block-picker { display: grid; gap: 8px; margin: 0; padding: 12px; min-width: 0; border: 1px solid var(--line); border-radius: 6px; }
.block-picker legend { font-weight: 700; padding: 0 4px; overflow-wrap: anywhere; }
.block-picker .option { font-size: 14px; font-weight: 400; overflow-wrap: anywhere; }
.block-picker-form { display: grid; gap: 12px; min-width: 240px; max-width: 340px; margin-top: 20px; }

.student-shell { grid-template-columns: 340px minmax(0, 1fr); }
.student-shell .sidebar { background: #fff; color: #182b32; border-right: 1px solid #dbe4e7; }
.student-shell .brand, .student-shell .sidebar-footer, .student-shell .sidebar-footer a { color: #182b32; }
.student-shell .sidebar-footer { border-top-color: #dbe4e7; }
.student-shell .menu > a { color: #354d59; }
.student-shell .menu > a.active, .student-shell .menu > a:hover { background: #edf4f3; color: #183b33; }
.student-shell .study-block { padding: 16px 0; margin: 0; border: 0; border-top: 1px solid #dbe4e7; }
.study-block summary { position: relative; cursor: pointer; list-style: none; padding-right: 24px; }
.study-block summary::-webkit-details-marker { display: none; }
.study-block summary::after { content: ''; position: absolute; top: 7px; right: 4px; width: 8px; height: 8px; border-right: 2px solid #536879; border-bottom: 2px solid #536879; transform: rotate(45deg); }
.study-block[open] summary::after { transform: rotate(225deg); top: 11px; }
.study-block summary:focus-visible { outline: 2px solid #126e65; outline-offset: 4px; }
.module-number { display: block; color: #586b88; font-size: 14px; font-weight: 700; }
.student-shell .study-block-title { color: #19262d; font-size: 18px; line-height: 1.4; padding: 6px 0; }
.student-shell .study-block-status { color: #09675b; margin: 0; }
.module-progress { display: grid; gap: 6px; margin: 14px 0 12px; font-size: 13px; color: #49606d; }
.module-progress progress { display: block; width: 100%; height: 8px; border: 0; border-radius: 4px; overflow: hidden; appearance: none; background: #e3ebe8; }
.module-progress progress::-webkit-progress-bar { background: #e3ebe8; }
.module-progress progress::-webkit-progress-value { background: #258335; }
.module-progress progress::-moz-progress-bar { background: #258335; }
.student-shell .menu .study-topics a, .home-topic { display: grid; grid-template-columns: 24px minmax(0, 1fr); align-items: start; gap: 10px; color: #233239; }
.student-shell .menu .study-topics a { padding: 12px 8px; font-size: 15px; }
.student-shell .menu .study-topics a:hover { background: #f0f5f3; }
.student-shell .menu .study-topics a.active { background: #e9f4ef; border-color: #8dbfa7; color: #164933; }
.completion-mark { display: inline-grid; place-items: center; width: 24px; height: 24px; border: 2px solid #b5c2ca; border-radius: 50%; color: #fff; font-size: 16px; font-weight: 700; line-height: 1; }
.completion-mark.is-complete { background: #188022; border-color: #188022; }
.topic-caption { min-width: 0; }
.topic-caption small, .home-topic small { display: block; font-size: 12px; font-weight: 400; color: #566d80; margin-top: 4px; }
.home-topic { overflow-wrap: anywhere; }
.learning-status { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.study-confirmation { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
@media (max-width: 820px) { .student-shell { grid-template-columns: minmax(0, 1fr); } }
