h1 { font-size: clamp(2.8rem, 6.5vw, 5rem); }
h2 { font-size: clamp(1.7rem, 3vw, 2.5rem); margin-bottom: 1rem; }
h3 { font-size: 1.05rem; font-weight: 600; }
.demo-intro { padding-block: 4rem 2rem; max-width: 48rem; }
.demo-label, .hint { color: var(--muted); font-size: 0.875rem; }
.controls { border: 1px solid var(--rule); border-radius: 8px; padding: 1.5rem; margin: 0; min-width: 0; }
legend { padding-inline: 0.5rem; font-weight: 600; }
.control-row { display: flex; flex-wrap: wrap; align-items: end; gap: 1rem 2rem; }
label { display: grid; gap: 0.3rem; font-weight: 600; }
select, button { min-height: 44px; font: inherit; padding: 0.5rem 0.8rem; border: 1px solid var(--accent); border-radius: 4px; background: white; color: var(--ink); }
button, summary { cursor: pointer; }
button:hover { background: #d5edf6; }
:is(select, button, summary, pre, .table-scroll):focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.controls .hint { margin: 1rem 0 0; }
.source-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-block: 2rem; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; font-size: 0.9rem; }
caption { text-align: left; font-weight: 600; margin-bottom: 0.75rem; overflow-wrap: anywhere; }
th, td { text-align: left; padding: 0.65rem 0.5rem; border-bottom: 1px solid var(--rule); }
th { font-weight: 600; }
.repeated { background: #fff1cd; }
.table-scroll { overflow-x: auto; }
.table-scroll table { min-width: 420px; }
.lesson-section { border-top: 1px solid var(--rule); padding-block: 2.5rem; }
.lesson-section > p { max-width: 52rem; }
.results { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1rem; margin-block: 1.5rem; }
.results article { background: white; border: 1px solid var(--rule); padding: 1.5rem; border-radius: 8px; }
.results .correct { border: 2px solid var(--accent); }
.results article p:last-child { margin: 0; font-size: 0.9rem; }
.amount { font-family: Georgia, serif; font-size: 2.5rem; margin-block: 0.7rem; }
summary { padding-block: 0.8rem; font-weight: 600; color: var(--accent); }
details table { max-width: 35rem; }
pre { overflow-x: auto; padding: 1rem; background: #16313d; color: #eefaff; border-radius: 4px; font-size: 0.85rem; }
.hint { margin-top: 1rem; }
@media (max-width: 800px) { .results { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .source-grid { grid-template-columns: 1fr; gap: 1.5rem; } .demo-intro { padding-top: 2.5rem; } .demo-label { max-width: 8rem; text-align: right; } }
