@font-face {
  font-family: Literata;
  src: url(assets/literata-normal-cyrillic.woff2) format("woff2");
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+0400-052F;
}
@font-face {
  font-family: Literata;
  src: url(assets/literata-normal-latin.woff2) format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
:root {
  --paper: #f4ede4;
  --card: #faf6f1;
  --ink: #231d18;
  --muted: #61554c;
  --line: #d8cbbf;
  --red: #a53838;
  --green: #364b49;
  --sans: system-ui, sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(ellipse 660px 450px at 0 96px, #dd565626, transparent),
    radial-gradient(ellipse 620px 460px at 100% 150px, #364b4920, transparent),
    var(--paper);
  font: 16px/1.55 Literata, Georgia, serif;
}
a { color: inherit; }
button, input { font: inherit; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
.wrap { width: min(calc(100% - 36px), 1120px); margin-inline: auto; }
.masthead { border-bottom: 1px solid var(--line); }
.masthead-inner { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 16px; font: 14px var(--sans); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; }
.brand img { border-radius: 7px; }
main { padding-bottom: 56px; }
.intro { padding: clamp(36px, 7vw, 78px) 0 30px; }
h1, h2, h3, p, dl, dd { margin: 0; }
h1 { max-width: 18ch; font-size: clamp(38px, 7vw, 72px); font-weight: 480; line-height: 1.08; letter-spacing: -.045em; }
h1 em { color: var(--red); font-style: normal; display: inline-block; }
.intro p { max-width: 58ch; margin-top: 16px; color: var(--muted); }
h2 { font-size: 25px; font-weight: 530; letter-spacing: -.025em; margin-bottom: 14px; }
.scenario { margin-bottom: 22px; }
.scenario-controls, fieldset { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.scenario-controls { justify-content: space-between; }
fieldset { border: 0; margin: 0; padding: 0; }
fieldset label { position: relative; cursor: pointer; }
fieldset input, .sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); }
fieldset span, button { display: block; border: 1px solid var(--line); border-radius: 24px; background: var(--card); padding: 8px 13px; font: 13px/1.4 var(--sans); color: var(--ink); }
fieldset input:checked + span { background: var(--green); color: white; border-color: var(--green); }
fieldset input:focus-visible + span { outline: 2px solid var(--red); outline-offset: 3px; }
button, summary { cursor: pointer; }
button:hover { border-color: var(--green); }
.workspace { display: grid; grid-template-columns: minmax(260px, .85fr) minmax(0, 1.65fr); align-items: start; gap: 20px; }
.panel, .option { border: 1px solid var(--line); background: var(--card); border-radius: 15px; padding: clamp(14px, 2.4vw, 24px); }
.field { display: grid; grid-template-columns: minmax(0, 1fr) 7.3rem; align-items: start; gap: 5px 9px; margin-bottom: 12px; font: 13px/1.35 var(--sans); }
.field label { align-self: center; }
.field small { display: block; color: var(--muted); margin-top: 3px; }
.field input { width: 100%; min-width: 0; border: 1px solid var(--line); background: white; color: var(--ink); border-radius: 7px; padding: 7px; text-align: right; }
.field input:invalid { border-color: var(--red); }
.parameters details { border-top: 1px solid var(--line); padding-top: 11px; margin-top: 12px; }
.parameters details summary { margin-bottom: 8px; font-size: 14px; }
.note, .error { font: 13px/1.5 var(--sans); color: var(--muted); margin-top: 12px; }
.error, .negative { color: var(--red); }
.summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.summary > div { background: #364b490d; border-radius: 10px; padding: 10px; }
.summary dt, .option dt { color: var(--muted); font: 12px/1.35 var(--sans); }
.summary dd { font-size: clamp(14px, 2vw, 21px); overflow-wrap: anywhere; }
.options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.option { min-width: 0; }
.option h3 { font-size: 18px; margin-bottom: 10px; line-height: 1.25; }
.option dl > div { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; padding-block: 5px; border-top: 1px solid var(--line); }
.option dd { font: 600 13px/1.4 var(--sans); font-variant-numeric: tabular-nums; }
.disclosure { margin-top: 15px; }
.disclosure summary { font-size: 19px; }
.table-wrap { overflow: auto; margin-top: 12px; }
table { border-collapse: collapse; width: 100%; font: 14px/1.4 var(--sans); }
caption { text-align: left; margin-bottom: 8px; font-weight: 650; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; }
td { white-space: nowrap; }
th[scope=row] { font-weight: 500; }
#sources dt { margin-top: 12px; font-weight: 600; }
#sources dd { overflow-wrap: anywhere; color: var(--muted); }
@media (max-width: 800px) {
  .workspace { grid-template-columns: 1fr; }
}
@media (max-width: 455px) {
  .options { grid-template-columns: 1fr; }
  .summary > div { padding: 7px; }
}
