:root {
  --bg: #f4f8fb; --text: #2d3f54; --muted: #52647a;
  --border: rgba(82, 100, 122, .24); --blue: #004c94; --sky: #3c93fa;
  --green: #73cc80; --red: #d64545;
  --shadow: 0 14px 35px rgba(45, 63, 84, .10);
}
* { box-sizing: border-box; }
body {
  margin: 0; min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text); line-height: 1.55;
  background:
    radial-gradient(circle at top left, rgba(0, 76, 148, .12), transparent 36%),
    radial-gradient(circle at bottom right, rgba(29, 189, 142, .10), transparent 30%), var(--bg);
}
.exercise-nav { max-width: 1180px; margin: 0 auto; padding: 18px 20px 0; display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.exercise-nav a { border-radius: 13px; padding: 10px 14px; background: var(--blue); color: white; font-size: .95rem; font-weight: 900; text-decoration: none; transition: .15s; }
.exercise-nav a:hover { transform: translateY(-1px); }
.site-header { max-width: 1180px; margin: auto; padding: 32px 20px 24px; text-align: center; }
.chapter-label { margin: 0 0 10px; color: var(--blue); font-size: .9rem; font-weight: 850; }
h1 { margin: 0 0 8px; font-size: clamp(1.8rem, 4vw, 3rem); line-height: 1.2; letter-spacing: -.04em; }
.subtitle { max-width: 880px; margin: auto; color: var(--muted); }
main { max-width: 1180px; margin: auto; padding: 0 20px 32px; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 18px; align-items: start; }
.chapter-block { min-width: 0; padding: 18px; background: rgba(255, 255, 255, .94); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow); }
.exercise-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.exercise-heading h2 { margin: 0; font-size: 1.05rem; font-weight: 900; }
#progress { border-radius: 999px; padding: 5px 10px; background: rgba(60, 147, 250, .14); color: var(--blue); font-size: .84rem; font-weight: 850; white-space: nowrap; }
.statement { border: 2px solid var(--sky); border-radius: 20px; background: linear-gradient(135deg, rgba(60, 147, 250, .10), #fff); padding: 20px; margin-bottom: 16px; box-shadow: 0 12px 26px rgba(0, 76, 148, .08); }
.statement p { margin: 0 0 10px; }
.eyebrow { font-weight: 900; color: var(--blue); }
#context { color: var(--muted); font-size: .94rem; }
.statement .statement-text { margin: 0; min-height: 70px; padding: 12px; border-radius: 16px; background: rgba(255, 255, 255, .65); font-size: 1.25rem; text-align: center; }
h3 { margin: 24px 0 10px; font-size: 1rem; }
fieldset { min-width: 0; margin: 16px 0; padding: 14px; border: 1px solid var(--border); border-radius: 16px; }
legend { max-width: 100%; padding: 0 6px; font-weight: 650; }
.choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.choice { min-width: 0; display: flex; align-items: center; justify-content: center; gap: 7px; padding: 13px 10px; min-height: 58px; border: 2px solid transparent; border-radius: 14px; background: #f8fafc; text-align: center; cursor: pointer; transition: .15s; }
.choices .choice { min-height: 86px; flex-direction: column; border-radius: 16px; font-weight: 850; }
.choice:hover:not(:has(input:disabled)) { transform: translateY(-2px); background: white; box-shadow: 0 10px 20px rgba(15, 23, 42, .08); }
.choice:has(input:checked) { border-color: var(--blue); background: white; box-shadow: 0 0 0 4px rgba(0, 76, 148, .15); }
.choice:has(input:disabled) { cursor: default; }
input { accent-color: var(--blue); flex-shrink: 0; margin: 0; }
#negation-options { display: grid; gap: 10px; }
#negation-options .choice { justify-content: flex-start; text-align: left; font-size: 1.05rem; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
button { font: inherit; font-weight: 900; padding: 11px 15px; border: 0; border-radius: 13px; cursor: pointer; transition: .15s; }
button:hover { transform: translateY(-1px); }
.primary { background: var(--blue); color: white; }
.secondary { background: rgba(60, 147, 250, .14); color: var(--blue); }
button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 4px; }
.correct { border-color: var(--green); background: rgba(115, 204, 128, .18); }
.incorrect { border-color: var(--red); background: rgba(214, 69, 69, .12); }
.explanation { margin: 12px 0 0; }
#feedback { margin: 16px 0 0; padding: 15px; border-radius: 18px; border: 1px solid var(--border); background: #f8fafc; font-weight: 700; }
#feedback:empty { display: none; }
summary { cursor: pointer; font-weight: 900; font-size: 1.05rem; }
details > p { color: var(--muted); }
dl { display: grid; gap: 10px; }
.memo { border: 1px solid var(--border); border-radius: 16px; padding: 13px; background: white; }
dt { font-weight: 850; }
dd { margin: 4px 0 0; color: var(--muted); }
.formula { display: block; margin-bottom: 6px; font-size: 1.2rem; color: var(--blue); }
[hidden] { display: none !important; }
@media (max-width: 980px) { .layout { grid-template-columns: 1fr; } }
@media (max-width: 620px) {
  .choices { grid-template-columns: 1fr; }
  .choices .choice { min-height: 58px; flex-direction: row; }
  .statement { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .choice, button, .exercise-nav a { transition: none; }
  .choice:hover:not(:has(input:disabled)), button:hover, .exercise-nav a:hover { transform: none; }
}
