:root {
    color-scheme: light;
    --ink: #142a32;
    --muted: #536768;
    --green: #086f65;
    --green-dark: #055850;
    --mint: #deeee6;
    --paper: #f4f8f5;
    --line: #cddbd4;
    --white: #fff;
    --wrong: #9f3040;
    --wrong-bg: #fcebed;
    --shadow: 0 8px 28px #14372a0a;
    --radius: 17px;
    font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
    font-synthesis: none;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); line-height: 1.55; }
h1, h2, h3, p, figure { margin: 0; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -.035em; overflow-wrap: anywhere; }
h1 { font-size: clamp(2.2rem, 5vw, 3.65rem); font-weight: 800; }
h2 { font-size: clamp(1.45rem, 2.5vw, 2rem); font-weight: 780; }
h3 { font-size: 1.15rem; font-weight: 750; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
img { max-width: 100%; }
svg { width: 1em; height: 1em; vertical-align: middle; flex-shrink: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #117f74; outline-offset: 4px; }
.wrap { width: min(100% - 48px, 1210px); margin-inline: auto; }
.skip { position: fixed; left: 10px; top: -70px; z-index: 50; padding: 8px 14px; border-radius: 6px; background: white; }
.skip:focus { top: 10px; }
.meta, small { color: var(--muted); font-size: .9rem; }
.text-link { color: var(--green-dark); font-weight: 700; text-decoration: underline; text-underline-offset: .25em; }
.text-link:hover { color: var(--ink); }
.button { min-height: 43px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; border-radius: 9px; padding: 8px 15px; font-weight: 730; line-height: 1.2; font-size: .93rem; text-align: center; background: transparent; color: var(--green-dark); }
.button-primary { background: var(--green); border-color: var(--green); color: var(--white); }
.button-primary:hover:not(:disabled) { background: var(--green-dark); border-color: var(--green-dark); }
.button-outline { background: var(--white); border-color: #a9c8be; }
.button-outline:hover:not(:disabled), .button-quiet:hover:not(:disabled) { background: #e7f2ec; }
.button:disabled { opacity: .53; }
.button-small { min-height: 37px; padding: 7px 11px; }
.danger { color: var(--wrong); }
.icon-button { display: inline-grid; place-items: center; min-width: 41px; min-height: 41px; border: 0; border-radius: 8px; background: transparent; color: var(--green-dark); }
.icon-button:hover { background: var(--mint); }
.actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.actions form { margin: 0; }

.site-header, .exam-header { background: var(--white); border-bottom: 1px solid #dce6e0; }
.header-inner { min-height: 76px; display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-size: 1.3rem; letter-spacing: -.04em; font-weight: 820; white-space: nowrap; width: fit-content; }
.brand-icon { width: 41px; height: 41px; border-radius: 50%; display: grid; place-items: center; color: white; background: var(--green); }
.brand-icon svg { width: 26px; height: 26px; }
.header-menu, .header-menu nav { display: flex; gap: clamp(15px, 2.6vw, 37px); align-items: center; }
.header-menu nav a { font-size: .93rem; font-weight: 660; white-space: nowrap; }
.header-menu nav a:hover, .header-menu nav a[aria-current] { color: var(--green-dark); text-decoration: underline; text-underline-offset: .3em; }
.search { display: flex; align-items: center; background: #f3f8f5; border: 1px solid var(--line); border-radius: 9px; max-width: 185px; }
.search input { border: 0; background: transparent; min-width: 0; width: 100%; padding: 8px 0 8px 11px; color: var(--ink); font-size: .9rem; }
.search input:focus { outline: 0; }
.search:focus-within { outline: 2px solid var(--green); outline-offset: 2px; }
.menu-toggle { display: none; }

.home { padding-block: 28px 52px; }
.hero { background: #e0efe6; display: grid; grid-template-columns: 1.03fr 1fr; border: 1px solid #d4e3da; border-radius: 22px; min-height: 350px; overflow: hidden; }
.hero-content { padding: clamp(30px, 5vw, 64px); align-self: center; position: relative; }
.hero h1 { color: #073b3b; max-width: 13ch; font-size: clamp(2.3rem, 4.65vw, 4.05rem); }
.hero p { font-size: clamp(1rem, 1.55vw, 1.2rem); max-width: 34ch; margin-top: 17px; color: #345758; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 25px; }
.hero-actions .button { min-height: 48px; padding-inline: 16px; }
.hero-photo { display: block; width: 100%; height: 100%; min-height: 100%; object-fit: cover; object-position: 52% 58%; }
.home-section { margin-top: 32px; }
.heading-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 15px; }
.heading-row .text-link { font-size: .9rem; white-space: nowrap; }
.two-grid, .three-grid { display: grid; gap: 14px; }
.two-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.three-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.test-card, .feature-card, .panel { border: 1px solid var(--line); background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); }
.test-card, .feature-card { display: flex; align-items: center; gap: 15px; padding: 16px; }
.test-card { justify-content: space-between; }
.test-card .card-content { flex: 1; min-width: 0; }
.test-card .card-content p { margin-top: 4px; overflow-wrap: anywhere; }
.test-card .card-content p:not(.meta) { font-size: .94rem; }
.test-card h3 a:hover { text-decoration: underline; text-underline-offset: 3px; }


.feature-card span:nth-child(2) { display: grid; min-width: 0; }
.feature-card strong { font-size: 1.05rem; }
.feature-card:hover { border-color: #8cb7a6; background: #fcfefc; }
.site-footer { border-top: 1px solid var(--line); background: #e6efe9; padding-block: 32px 23px; }

.inner-page { padding-block: 36px 58px; min-height: min(66vh, 640px); }
.page-heading { margin-bottom: 23px; }
.page-heading .text-link { display: inline-block; margin-bottom: 9px; font-size: .92rem; }
.page-heading h1 { font-size: clamp(2rem, 4.1vw, 3.2rem); }
.page-heading p { margin-top: 10px; color: var(--muted); font-size: 1.05rem; max-width: 64ch; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 17px; }
.chip { display: inline-flex; gap: 7px; align-items: center; justify-content: center; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 100px; padding: 7px 13px; font-size: .9rem; font-weight: 640; }
.chip.active, .chip:hover { background: #e0eee6; border-color: #91bcab; color: var(--green-dark); }
.chips.secondary { margin-top: -2px; }
.fact-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; }
.fact-row span { background: var(--mint); color: var(--green-dark); border-radius: 8px; padding: 7px 10px; font-size: .9rem; font-weight: 680; }
.mode-card, .prose, .admin-form, .breakdown { padding: clamp(16px, 3vw, 31px); }
.mode-card p { margin-block: 13px 18px; color: var(--muted); }
.prose { max-width: 820px; }
.prose p + p { margin-top: 14px; }
.prose .button, .section-link { margin-top: 18px; }
.prose form .button { margin-top: 0; }
.empty-state { padding: 16px; border: 1px dashed #a6bdb0; border-radius: 12px; color: var(--muted); background: #fafcfb; }
.form-grid { display: grid; gap: 15px; }
.form-grid label, .admin-search { display: grid; gap: 5px; font-weight: 690; }
.form-grid input:not([type="checkbox"]), .form-grid select, .form-grid textarea, .admin-search input { border: 1px solid #aabeb4; background: #fcfefd; color: var(--ink); width: 100%; border-radius: 8px; padding: 9px 11px; font-weight: 450; min-height: 43px; }
.form-grid input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--green); flex-shrink: 0; }
.form-grid textarea { resize: vertical; }
.form-grid .check { display: flex; align-items: flex-start; gap: 7px; font-weight: 530; }
.form-grid .button { justify-self: start; }
.notice { padding: 12px 14px; border-radius: 8px; margin: 15px 0; overflow-wrap: anywhere; }
.notice.error { color: #8e2434; background: var(--wrong-bg); border: 1px solid #efbac2; }
.notice.ok { color: var(--green-dark); background: #e3f2e9; border: 1px solid #b5d9c6; }

.exam-header { position: sticky; top: 0; z-index: 2; }
.exam-header-inner { min-height: 71px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.exam-main { padding-block: 24px 41px; }
.exam-heading { display: flex; justify-content: space-between; align-items: end; gap: 10px; margin-bottom: 12px; }
.exam-heading h1 { font-size: clamp(1.42rem, 3.7vw, 2.55rem); }
.exam-heading .meta { margin-top: 4px; }
.exam-heading .text-link { font-size: .88rem; white-space: nowrap; }
.timer { display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px; border-radius: 9px; background: #fff0d7; color: #73440c; font-weight: 780; font-variant-numeric: tabular-nums; }
.timer.urgent { background: var(--wrong-bg); color: var(--wrong); }
.timer.untimed { background: var(--mint); color: var(--green-dark); }
progress { appearance: none; display: block; width: 100%; height: 8px; border: 0; border-radius: 100px; overflow: hidden; color: var(--green); background: #dbe6df; margin-bottom: 16px; }
progress::-webkit-progress-bar { background: #dbe6df; }
progress::-webkit-progress-value { background: var(--green); border-radius: 100px; }
progress::-moz-progress-bar { background: var(--green); border-radius: 100px; }
.exam-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, .40fr); gap: 15px; align-items: start; }
.question-panel, .sheet-panel { padding: clamp(16px, 2.5vw, 26px); min-width: 0; }
.question-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 7px 12px; align-items: center; }
.question-index { background: #dfeee7; color: var(--green-dark); border-radius: 100px; font-weight: 750; padding: 4px 11px; font-size: .9rem; }
#question-text { margin: 13px 0 14px; font-size: clamp(1.2rem, 2.2vw, 1.65rem); line-height: 1.32; white-space: pre-line; }
#question-text:focus { outline: 0; }
.question-media { background: #edf2ef; border-radius: 12px; margin-bottom: 14px; text-align: center; overflow: hidden; }
.question-media img { display: block; margin: auto; max-height: 230px; object-fit: contain; }
#options, .option-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.option { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%; min-width: 0; min-height: 46px; text-align: left; border: 1px solid #b9cbc1; border-radius: 9px; padding: 8px 12px; background: white; color: var(--ink); overflow-wrap: anywhere; }
.option:not(:disabled):hover { border-color: #6d9f8e; background: #f0f7f4; }
.option.selected { color: var(--green-dark); background: #e3f1eb; border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green); }
.option.correct { background: #e2f4e9; border-color: #8bc7a6; color: #175c3b; }
.option.wrong { background: var(--wrong-bg); border-color: #dfa6b1; color: var(--wrong); }
.letter { display: inline-grid; place-items: center; width: 28px; height: 28px; background: #edf2ef; border-radius: 50%; font-weight: 750; font-size: .9rem; }
.option.selected .letter, .option.correct .letter { background: #cbe9d8; }
.option.wrong .letter { background: #f7d5db; }
.option small { font-size: .82rem; font-weight: 760; color: inherit; }
.feedback { margin-top: 12px; padding: 12px 13px; background: #f0f6f2; border: 1px solid #d5e5db; border-radius: 10px; }
.feedback p { margin-top: 3px; white-space: pre-line; overflow-wrap: anywhere; }
.question-tools { display: flex; justify-content: space-between; gap: 7px; margin-top: 9px; flex-wrap: wrap; }
.exam-nav { display: flex; justify-content: space-between; gap: 9px; margin-top: 10px; }
.sheet-panel details > summary { list-style: none; font-size: 1.23rem; font-weight: 780; letter-spacing: -.03em; cursor: default; pointer-events: none; }
.sheet-panel summary::-webkit-details-marker { display: none; }
.sheet-body { margin-top: 8px; }
.answer-sheet { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin-block: 10px 13px; }
.answer-cell { border: 1px solid #bbcec5; border-radius: 8px; background: white; color: var(--ink); min-height: 39px; font-weight: 720; }
.answer-cell:hover { border-color: var(--green); }
.answer-cell.answered, .answer-cell.correct { background: #def0e5; border-color: #a2cbb5; color: #175b3c; }
.answer-cell.wrong { background: var(--wrong-bg); border-color: #e5aab4; color: var(--wrong); }
.answer-cell.current { background: var(--green); border-color: var(--green); color: white; }
.sheet-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; border-top: 1px solid var(--line); padding-top: 11px; font-size: .84rem; color: var(--muted); }
.sheet-legend span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { display: inline-block; width: 14px; height: 14px; border: 1px solid #a9beb2; border-radius: 4px; }
.swatch.answered { background: #cdebd8; }
dialog { border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; width: min(450px, 100% - 30px); background: white; color: var(--ink); box-shadow: 0 20px 70px #112c2940; }
dialog::backdrop { background: #172b2ab0; }
dialog p { margin-block: 12px 18px; color: var(--muted); }

.result-summary { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 15px; }
.score-card { padding: 19px; display: flex; align-items: center; gap: 17px; }
.score-number { font-size: 3.4rem; line-height: 1; font-weight: 820; letter-spacing: -.06em; color: var(--green-dark); }
.score-number small { font-size: .95rem; letter-spacing: 0; }
.score-card p { margin-top: 6px; }
.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.stat { display: grid; align-content: center; padding: 14px; gap: 4px; }
.stat span { color: var(--muted); font-weight: 650; }
.stat strong { font-size: 1.65rem; }
.stat.correct strong { color: var(--green); }
.stat.wrong strong { color: var(--wrong); }
.result-pill { display: inline-block; padding: 5px 9px; font-size: .85rem; border-radius: 100px; font-weight: 760; white-space: nowrap; }
.result-pill.correct { background: #dff0e5; color: #185c3c; }
.result-pill.wrong { background: var(--wrong-bg); color: var(--wrong); }
.result-pill.empty { background: #ebf0ed; color: #485e56; }
.breakdown { margin-top: 15px; }
.breakdown h2 { margin-bottom: 10px; }
.breakdown table { border-collapse: collapse; width: 100%; }
.breakdown td, .breakdown th { text-align: left; padding: 7px clamp(3px, 1.5vw, 12px); border-bottom: 1px solid var(--line); }
.breakdown thead { background: #eef5f0; }
.reviews { margin-top: 23px; }
.review { margin-top: 7px; overflow: hidden; }
.review summary { cursor: pointer; list-style: none; display: grid; grid-template-columns: 30px minmax(0, 1fr) auto 10px; align-items: center; gap: 9px; padding: 13px 16px; }
.review summary::-webkit-details-marker { display: none; }
.review summary::after, .sheet-panel summary::after { content: ''; width: 8px; height: 8px; border: solid var(--green-dark); border-width: 0 2px 2px 0; transform: rotate(45deg); justify-self: end; }
.review[open] summary::after, .sheet-panel details[open] summary::after { transform: rotate(225deg); }
.review summary strong { font-weight: 650; overflow-wrap: anywhere; }
.review-number { font-weight: 760; color: var(--green-dark); }
.review-body { padding: 0 15px 15px; }

.admin-heading { align-items: start; }
.admin-heading .page-heading { margin-bottom: 0; }
.account-card { max-width: 470px; }
.account-card h2 { margin-bottom: 12px; }
.account-card p { margin-bottom: 14px; }
.admin-list { padding: 16px; }
.admin-row { border-top: 1px solid var(--line); padding-block: 10px; display: flex; gap: 13px; justify-content: space-between; align-items: center; }
.admin-row > div:first-child { min-width: 0; overflow-wrap: anywhere; }
.admin-search { margin-bottom: 12px; max-width: 450px; }
.admin-form { max-width: 850px; }
.admin-form > h2 { margin-bottom: 15px; }
.admin-preview { max-width: min(100%, 220px); border-radius: 8px; }
.question-picker { border: 1px solid var(--line); border-radius: 8px; padding: 9px; min-width: 0; }
.question-picker legend { font-weight: 720; }
.question-picker details { padding: 8px; }
.question-picker summary { cursor: pointer; font-weight: 670; }
.question-picker .check { margin-top: 7px; }

@media (max-width: 900px) {
    .header-inner { gap: 14px; }
    .header-menu, .header-menu nav { gap: 15px; }
    .search { max-width: 145px; }
    .hero-content { padding-inline: 28px; }
    .hero { min-height: 300px; }
    .test-card { gap: 10px; padding: 13px; }
}
@media (max-width: 760px) {
    .wrap { width: calc(100% - 30px); }
    .header-inner { flex-wrap: wrap; min-height: 61px; gap: 3px 12px; padding-block: 8px; }
    .brand { font-size: 1.15rem; gap: 8px; }
    .brand-icon { width: 35px; height: 35px; }
    .brand-icon svg { width: 22px; height: 22px; }
    .menu-toggle { display: inline-grid; }
    .header-menu { display: none; width: 100%; padding-block: 7px; align-items: stretch; }
    .header-menu.is-open { display: grid; }
    .header-menu nav { flex-wrap: wrap; }
    .search { max-width: none; }
    .home { padding-top: 16px; }
    .hero { grid-template-columns: 1fr; grid-template-rows: auto auto; }
    .hero-content { display: contents; }
    .hero h1 { grid-row: 1; padding-inline: 19px; padding-top: 20px; font-size: clamp(2rem, 7vw, 3rem); }
    .hero p { grid-row: 2; padding-inline: 19px; margin-block: 10px 15px; }
    .hero-photo { grid-row: 3; width: 100%; height: clamp(170px, 45vw, 300px); }
    .hero-actions { grid-row: 4; margin: 0; padding: 13px; }
    .hero-actions .button { flex: 1 1 155px; }
    .desktop-break { display: none; }
    .home-section { margin-top: 24px; }
    .three-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .home .two-grid, .inner-page > .two-grid, .modes, .result-summary { grid-template-columns: 1fr; }
    .inner-page { padding-top: 25px; }
    .exam-header-inner { min-height: 61px; }
    .exam-main { padding-top: 18px; }
    .exam-grid { grid-template-columns: 1fr; }
    .sheet-panel details > summary { display: grid; grid-template-columns: 1fr auto; align-items: center; cursor: pointer; pointer-events: auto; }
    .answer-sheet { grid-template-columns: repeat(10, minmax(0, 1fr)); }
    .score-card { justify-content: space-between; }
}
@media (max-width: 425px) {
    .wrap { width: calc(100% - 24px); }
    .three-grid { grid-template-columns: 1fr; }


    .feature-card { padding: 12px; }
    .heading-row { align-items: start; }
    .heading-row .text-link { white-space: normal; text-align: right; }
    .exam-header-inner .actions { gap: 4px; }
    .exam-header-inner .button { font-size: .82rem; padding-inline: 7px; }
    .timer { padding-inline: 7px; font-size: .88rem; gap: 3px; }
    .exam-header .brand-icon { width: 29px; height: 29px; }
    .exam-header .brand { font-size: 1rem; }
    .exam-heading { display: grid; }
    .exam-heading .text-link { white-space: normal; }
    .answer-sheet { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .question-panel, .sheet-panel { padding: 12px; }
    .option { grid-template-columns: 29px minmax(0, 1fr); }
    .option small { grid-column: 2; }
    .exam-nav .button { padding-inline: 9px; }
    .review summary { grid-template-columns: 20px minmax(0, 1fr) 8px; }
    .review summary .result-pill { grid-column: 2; justify-self: start; }
    .review summary::after { grid-column: 3; grid-row: 1; }
    .admin-row { align-items: start; flex-direction: column; }
    .admin-form .two-grid { grid-template-columns: 1fr; }
}

.question-picker > label { margin-bottom: .75rem; }
.question-picker > .meta { margin-bottom: .5rem; }
