:root {
    color-scheme: light;
    --ink: #202925;
    --muted: #65706a;
    --paper: #fffdf8;
    --green: #176c56;
    --green-light: #e8f3ed;
    --terracotta: #bd593e;
    --line: #dce3dd;
    --error: #9d2c2c;
    --error-bg: #fff0ed;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: #f5f1e8;
    color: var(--ink);
    font: 16px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif;
}

.wrap { width: min(920px, calc(100% - 32px)); margin-inline: auto; }

.site-header {
    padding: 56px 0 42px;
    background: var(--green);
    color: white;
    border-bottom: 6px solid #e9b85e;
}

.eyebrow { margin: 0 0 4px; font-size: .78rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
h1 { margin: 0; font: 700 clamp(2.8rem, 8vw, 5rem)/1 Georgia, serif; }
.intro { max-width: 580px; margin: 12px 0 0; font-size: 1.08rem; opacity: .9; }
main { padding-block: 38px 70px; }

.validation, .empty-state {
    margin-bottom: 26px;
    padding: 20px 24px;
    border: 1px solid #e4aaa0;
    border-left: 5px solid var(--error);
    border-radius: 10px;
    background: var(--error-bg);
}

.validation h2, .empty-state h2 { margin: 0 0 5px; font-size: 1.15rem; }
.validation p, .validation ul, .empty-state p { margin-block: 6px; }
.exercise-grid { display: grid; gap: 24px; }

.exercise {
    padding: clamp(22px, 5vw, 36px);
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--paper);
    box-shadow: 0 6px 24px rgb(44 55 48 / 7%);
}

.exercise-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.tags { display: flex; flex-wrap: wrap; gap: 7px; }
.tags span { padding: 3px 9px; border-radius: 99px; background: var(--green-light); color: var(--green); font-size: .78rem; font-weight: 700; }
.exercise-number { margin: 3px 0; color: var(--muted); font-size: .8rem; white-space: nowrap; }
.exercise h2 { margin: 24px 0 8px; font: 700 1.1rem/1.4 system-ui, sans-serif; }
.question { margin: 0 0 22px; font: 700 clamp(1.35rem, 4vw, 1.75rem)/1.35 Georgia, serif; }
fieldset { display: grid; gap: 10px; margin: 0; padding: 0; border: 0; }
.choice { display: flex; gap: 11px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; }
.choice:hover { border-color: var(--green); background: #f6faf7; }
.choice:has(input:checked) { border-color: var(--green); background: var(--green-light); }
.choice input { accent-color: var(--green); }
.gap-label { display: block; margin-bottom: 6px; font-weight: 700; }
.gap-input { width: min(100%, 360px); padding: 11px 13px; border: 1px solid #9ba79f; border-radius: 8px; background: white; color: inherit; font: inherit; }
.gap-input:focus { outline: 3px solid rgb(23 108 86 / 18%); border-color: var(--green); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
button { padding: 10px 16px; border: 1px solid transparent; border-radius: 8px; font: 700 .95rem/1 system-ui, sans-serif; cursor: pointer; }
.check-button { background: var(--green); color: white; }
.check-button:hover { background: #105541; }
.hint-button { border-color: var(--line); background: transparent; color: var(--ink); }
.hint, .feedback, .explanation { margin-top: 18px; padding: 12px 14px; border-radius: 8px; }
.hint { background: #fff4d7; }
.feedback:empty { display: none; }
.feedback.correct { background: var(--green-light); color: #105541; font-weight: 700; }
.feedback.incorrect { background: var(--error-bg); color: var(--error); font-weight: 700; }
.explanation { background: #edf2f7; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 520px) {
    .site-header { padding-block: 38px 30px; }
    .exercise-header { display: block; }
    .exercise-number { margin-top: 10px; }
}
