/* Code Golf v2 — one stylesheet, no framework.
   The palette keeps the original black/yellow pairing and fills in the
   parts the old site never had: state colours, a real type scale, and a
   dark theme that follows the system. */

:root {
  /* Brand */
  --ink: #21201f;
  --ink-strong: #0f0f0e;
  --bar: #222222;
  --bar-2: #2e2d2b;
  --accent: #ffde40;
  --accent-strong: #f5cf14;
  --accent-ink: #21201f;

  /* Surfaces */
  --bg: #ffffff;
  --surface: #f6f5f4;
  --surface-2: #ffffff;
  --border: #e5e3e0;
  --border-strong: #d4d1cd;
  --muted: #6e6a65;

  /* State */
  --ok: #1a7f37;
  --ok-bg: #e8f5ec;
  --bad: #c33131;
  --bad-bg: #fdecec;
  --warn: #9a6700;
  --warn-bg: #fff6da;
  --info-bg: #eef4ff;
  --info-border: #c6d8ff;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(20, 18, 15, .06), 0 6px 20px rgba(20, 18, 15, .05);
  --shadow-lift: 0 2px 6px rgba(20, 18, 15, .08), 0 14px 34px rgba(20, 18, 15, .10);

  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --wrap: 1180px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e8e6e3;
    --ink-strong: #f7f6f4;
    --bg: #161614;
    --surface: #1e1d1b;
    --surface-2: #242320;
    --border: #33312d;
    --border-strong: #454239;
    --muted: #9c968d;
    --bar: #0f0f0e;
    --bar-2: #1b1a18;
    --ok: #57d27f;
    --ok-bg: #16291d;
    --bad: #ff8093;
    --bad-bg: #2c1919;
    --warn: #f0c453;
    --warn-bg: #2b2416;
    --info-bg: #1a2030;
    --info-border: #2e3c58;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 20px rgba(0, 0, 0, .3);
    --shadow-lift: 0 2px 6px rgba(0, 0, 0, .45), 0 14px 34px rgba(0, 0, 0, .4);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
}

a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 2px; }
a:hover { text-decoration-color: currentColor; }

h1, h2, h3 { line-height: 1.25; margin: 0 0 .4em; color: var(--ink-strong); }

code, pre, .mono { font-family: var(--mono); }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.main { padding: 28px 20px 64px; }
.muted { color: var(--muted); }

.skip {
  position: absolute; left: -9999px; top: 0; background: var(--accent);
  color: var(--accent-ink); padding: 10px 16px; z-index: 100; border-radius: 0 0 var(--radius-sm) 0;
}
.skip:focus { left: 0; }

/* ---------- top bar ---------- */

.topbar { background: var(--bar); color: #fff; }
.topbar__inner { display: flex; align-items: center; gap: 20px; min-height: 62px; }

.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 19px; }
.brand__mark {
  font-family: var(--mono); color: var(--accent-ink); background: var(--accent);
  border-radius: 8px; padding: 1px 8px; font-size: 17px; letter-spacing: -1px;
}
.brand__text { color: #fff; }

.nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.nav__link {
  color: #d8d5d0; text-decoration: none; padding: 8px 12px; border-radius: 999px;
  font-size: 15px; transition: background .15s, color .15s;
}
.nav__link:hover { background: rgba(255, 255, 255, .09); color: #fff; }
.nav__link.is-active { background: var(--accent); color: var(--accent-ink); font-weight: 600; }

.burger { display: none; background: none; border: 1px solid rgba(255,255,255,.3); border-radius: 8px; padding: 9px 8px; cursor: pointer; margin-left: auto; }
.burger span { display: block; width: 20px; height: 2px; background: var(--accent); margin: 4px 0; border-radius: 2px; }

/* The author's personal channel, not part of the site's job. It lives at the
   far edge of the bar behind a divider so it never reads as one of the
   functional controls, and it stays quiet until hovered.

   Declared here, above the mobile rules, on purpose: a media query adds no
   specificity, so this block sitting later in the file would quietly beat
   the override below and margin-left:auto would do nothing. */
.tg-icon { flex: none; }

.topbar__tg {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  margin-left: 18px; padding: 6px 2px 6px 18px;
  border-left: 1px solid rgba(255, 255, 255, .14);
  color: #8f8a83; text-decoration: none; font-size: 13.5px;
  transition: color .15s;
}
.topbar__tg .tg-icon { color: #6f8ea3; transition: color .15s; }
.topbar__tg:hover { color: #e8e6e3; }
.topbar__tg:hover .tg-icon { color: #4bb6e8; }

@media (max-width: 760px) {
  .topbar__inner { flex-wrap: wrap; gap: 12px; }

  /* Three items share one row, so their order is set explicitly instead of
     being left to whichever margin happens to win: brand on the left, then
     the channel link and the burger together at the right edge. The nav
     drops onto its own line below when opened. */
  .brand { order: 0; }
  .topbar__tg { order: 1; margin-left: auto; padding-left: 0; border-left: 0; font-size: 13px; }
  .burger { display: block; order: 2; margin-left: 0; }
  .nav { display: none; order: 3; width: 100%; margin: 0 0 12px; flex-direction: column; }
  .nav.is-open { display: flex; }
}

/* On the narrowest phones the brand, a handle and the burger stop fitting on
   one line. The icon alone still says what the link is; the name stays in
   the accessibility tree through aria-label on the anchor. */
@media (max-width: 380px) {
  .topbar__tg span { display: none; }
  .topbar__tg { gap: 0; }
}

/* ---------- status strip ---------- */

.statusbar { background: var(--bar-2); color: #efeded; font-size: 14px; border-bottom: 1px solid rgba(255,255,255,.07); }
.statusbar__inner { display: flex; align-items: center; gap: 14px; min-height: 44px; flex-wrap: wrap; }
.statusbar__title { font-weight: 600; }
.statusbar__title a { text-decoration: none; }
.statusbar__state { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.statusbar .muted { color: #a9a49c; }
.statusbar--running { background: linear-gradient(90deg, var(--bar-2), #3a3524); }

/* ---------- chips, badges ---------- */

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; background: var(--surface); border: 1px solid var(--border);
  color: var(--ink); white-space: nowrap;
}
.chip--live { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip--live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #c9361f; animation: pulse 1.8s infinite; }
.chip--soon { background: var(--info-bg); border-color: var(--info-border); color: var(--ink); }
.chip--done { background: transparent; border-color: var(--border-strong); color: var(--muted); }
.chip--ok { background: var(--ok-bg); border-color: transparent; color: var(--ok); }
.chip--muted { background: transparent; color: var(--muted); }
.chip--lang { font-weight: 500; }
.chip--tiny { font-size: 11px; padding: 1px 7px; font-weight: 500; color: var(--muted); }
.chip--filter { text-decoration: none; cursor: pointer; }
.chip--filter:hover { border-color: var(--border-strong); }
.chip--filter.is-active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

/* ---------- cards ---------- */

.card {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; margin-bottom: 20px; box-shadow: var(--shadow);
}
.card--compact { padding: 18px; margin-bottom: 0; }
.card--featured { border-color: var(--accent); box-shadow: var(--shadow-lift); }
.card--featured::before {
  content: ""; display: block; height: 4px; border-radius: 4px; margin: -8px 0 16px;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
}
.card--sealed { text-align: center; background: var(--surface); }
.card--error { border-left: 4px solid var(--bad); }
.card--problem,
.card--link { position: relative; transition: transform .12s ease, box-shadow .12s ease; }
.card--problem:hover,
.card--link:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.card--problem.is-solved { border-color: color-mix(in srgb, var(--ok) 45%, var(--border)); }

/* The whole card is the click target, but only the title is a real link, so
   keyboard and screen-reader users still get one sensible control. */
.card--problem .card__title a::after,
.card--link .card__title a::after { content: ""; position: absolute; inset: 0; }
.card--problem:focus-within,
.card--link:focus-within { outline: 2px solid var(--accent-strong); outline-offset: 2px; }

.card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.card__aside { text-align: right; }
.card__title { font-size: 24px; margin: 0 0 4px; }
.card__title--sm { font-size: 18px; }
.card__title a { text-decoration: none; }
.card__actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; }

.section-title { font-size: 20px; margin: 32px 0 12px; display: flex; align-items: baseline; gap: 12px; }
.section-title--flush { margin-top: 24px; }
.section-title .muted { font-size: 14px; font-weight: 400; }

/* ---------- hero ---------- */

.hero { padding: 18px 0 26px; }
.hero__title { font-size: clamp(34px, 6vw, 54px); letter-spacing: -.02em; margin-bottom: 10px; }
.hero__title::after { content: ""; display: block; width: 72px; height: 5px; background: var(--accent); border-radius: 3px; margin-top: 14px; }
/* No max-width here on purpose: a 62ch measure is for paragraphs, and it
   would break this one sentence across two lines on a screen wide enough to
   hold it. The container is the only limit; narrow screens still wrap. */
.hero__lead { font-size: 18px; color: var(--muted); }
.hero__lead strong { color: var(--ink); }

/* ---------- grids ---------- */

.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid--problems { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

/* Rules, prize details and anything else that is read once and then in the
   way: collapsed by default so the problems stay above the fold. */
.spoiler { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 14px; }
.spoiler > summary {
  cursor: pointer; font-weight: 600; font-size: 15px; list-style: none;
  display: flex; align-items: center; gap: 8px; color: var(--ink);
}
.spoiler > summary::-webkit-details-marker { display: none; }
.spoiler > summary::before { content: "▸"; color: var(--muted); transition: transform .15s; }
.spoiler[open] > summary::before { transform: rotate(90deg); }
.spoiler > summary:hover { color: var(--ink-strong); }
.spoiler .prose { margin-top: 12px; }

.facts { display: flex; flex-wrap: wrap; gap: 10px 32px; margin: 18px 0 0; padding: 16px 0 0; border-top: 1px solid var(--border); }
.facts div { min-width: 0; }
.facts dt { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.facts dd { margin: 2px 0 0; font-size: 15px; font-weight: 600; }

.stats { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13.5px; color: var(--muted); margin-top: 10px; }
.stats span { white-space: nowrap; }
.winner { margin: 10px 0 0; font-weight: 600; font-size: 14px; }

.langs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.langs--tight { margin-top: 10px; gap: 6px; font-size: 13px; }
.limits { display: flex; gap: 16px; flex-wrap: wrap; font-size: 14px; color: var(--muted); margin-bottom: 18px; }
.limits code { background: var(--surface); padding: 1px 6px; border-radius: 5px; font-size: 13px; color: var(--ink); }
/* A problem that only accepts some of the contest's languages says so right
   next to the time limit, where players already look for the rules. */
.limits__only { font-weight: 600; color: var(--ink); }
.limits__only code { background: var(--accent); color: var(--accent-ink); }

.pnum {
  display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 26px;
  border-radius: 8px; background: var(--accent); color: var(--accent-ink); font-size: 14px;
  font-weight: 700; margin-right: 6px; font-family: var(--mono);
}

/* ---------- buttons & inputs ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--surface-2); color: var(--ink); font: inherit; font-weight: 600; font-size: 15px;
  cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, transform .08s;
}
.btn:hover { background: var(--surface); border-color: var(--muted); }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn--sm { padding: 6px 12px; font-size: 13.5px; }
.btn[disabled] { opacity: .55; cursor: progress; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field__label { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }

.input {
  width: 100%; padding: 10px 12px; font: inherit; font-size: 15px; color: var(--ink);
  background: var(--bg); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
}
.input:focus-visible, .code-input:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 1px; }
.input--search { max-width: 260px; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: right 16px center, right 11px center; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 34px; }

/* ---------- editor ---------- */

.editor__row { display: grid; grid-template-columns: 1fr 240px; gap: 14px; margin-bottom: 14px; }
@media (max-width: 620px) { .editor__row { grid-template-columns: 1fr; } }

.editor__bar { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 6px; }
.counter { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.counter b { color: var(--ink); font-size: 15px; }

.code-input {
  width: 100%; min-height: 320px; padding: 14px 16px; font-family: var(--mono); font-size: 13.5px;
  line-height: 1.5; tab-size: 4; color: var(--ink); background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); resize: vertical; white-space: pre; overflow-wrap: normal; overflow-x: auto;
}
.editor__actions { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.hint { font-size: 13px; }
.editor__code .hint { margin: 8px 0 0; }

.linkbtn {
  background: none; border: 0; padding: 0; font: inherit; color: var(--ink);
  text-decoration: underline; cursor: pointer;
}

/* ---------- result panel ---------- */

.result { margin-top: 16px; border-radius: var(--radius-sm); padding: 16px 18px; border: 1px solid var(--border); background: var(--surface); }
.result--ok { background: var(--ok-bg); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.result--bad { background: var(--bad-bg); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.result--warn { background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.result--busy { background: var(--surface); }
.result__head { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; flex-wrap: wrap; }
.result__msg { margin: 8px 0 0; white-space: pre-wrap; font-family: var(--mono); font-size: 13px; }
.result__links { margin-top: 12px; display: flex; gap: 12px; font-size: 14px; flex-wrap: wrap; }

.spinner {
  width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border-strong);
  border-top-color: var(--ink); display: inline-block; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.verdict {
  display: inline-block; font-family: var(--mono); font-weight: 700; font-size: 12px; letter-spacing: .04em;
  padding: 2px 7px; border-radius: 6px; background: var(--surface); border: 1px solid var(--border);
}
.verdict--ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.verdict--bad { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.verdict--warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }

.verdict-card--ok { border-left: 4px solid var(--ok); }
.verdict-card--bad { border-left: 4px solid var(--bad); }
.verdict-card--warn { border-left: 4px solid var(--warn); }
.bigsize { font-family: var(--mono); font-size: 30px; font-weight: 700; line-height: 1; }
.bigsize span { font-size: 15px; color: var(--muted); }

/* ---------- banners ---------- */

.banner { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 14.5px; margin: 0 0 16px; border: 1px solid var(--border); }
.banner--info { background: var(--info-bg); border-color: var(--info-border); }
.banner--warn { background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }

/* ---------- prose (statements) ---------- */

.prose { font-size: 16px; }
.prose > :first-child { margin-top: 0; }
.prose h2 { font-size: 19px; margin-top: 26px; }
.prose h3 { font-size: 16.5px; margin-top: 22px; }
.prose p, .prose ul, .prose ol { margin: 0 0 14px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin-bottom: 6px; }
.prose code { background: var(--surface); border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px; font-size: .9em; }
.prose pre { background: var(--bar); color: #f2f0ec; padding: 14px 16px; border-radius: var(--radius-sm); overflow-x: auto; }
.prose pre code { background: none; border: 0; padding: 0; color: inherit; }
.prose table { border-collapse: collapse; margin-bottom: 14px; }
.prose th, .prose td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; }
.prose blockquote { margin: 0 0 14px; padding: 2px 16px; border-left: 3px solid var(--accent); color: var(--muted); }

/* ---------- samples & code blocks ---------- */

.sample { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 16px; }
@media (max-width: 620px) { .sample { grid-template-columns: 1fr; } }
.sample__label { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; margin-bottom: 6px; }
.sample__dl { font-size: 12px; text-transform: none; letter-spacing: 0; font-weight: 500; }

.code {
  background: var(--bar); color: #f2f0ec; padding: 14px 16px; border-radius: var(--radius-sm);
  overflow-x: auto; font-size: 13px; line-height: 1.5; margin: 0; white-space: pre;
}
.code--message { background: var(--surface); color: var(--ink); border: 1px solid var(--border); white-space: pre-wrap; }

/* ---------- tables ---------- */

.table-wrap { overflow-x: auto; margin: 0 -4px; }
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th {
  text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--border-strong);
  white-space: nowrap;
}
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.table tr.is-highlight td { background: color-mix(in srgb, var(--accent) 45%, transparent); font-weight: 700; }

.col-rank { width: 56px; }
.col-num { font-family: var(--mono); white-space: nowrap; }

/* Alignment has to name both th and td: ".table th" above is one element
   selector more specific than a bare ".col-num", so a header would keep the
   left alignment while its numbers sat right — the column heading looked
   shifted away from the data underneath it. */
.table th.col-num, .table td.col-num { text-align: right; }
.table th.col-rank, .table td.col-rank { text-align: center; }
.col-score { font-weight: 700; }
.col-time { color: var(--muted); font-size: 13px; white-space: nowrap; }
.col-nick { font-weight: 600; }
.col-src { width: 90px; }
.table--board tr.is-top .col-score { color: var(--ink-strong); }

.medal {
  display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px;
  border-radius: 50%; font-weight: 700; font-size: 13px; color: var(--accent-ink);
}
.medal--1 { background: #ffd23f; }
.medal--2 { background: #d8d5cf; }
.medal--3 { background: #e3b08a; }

@media (max-width: 720px) {
  .col-problem, .col-time { display: none; }
}

/* ---------- tabs ---------- */

.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.tab {
  padding: 8px 15px; border-radius: 999px; border: 1px solid var(--border-strong);
  background: var(--surface-2); color: var(--ink); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.tab:hover { border-color: var(--muted); }
.tab.is-active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.tabpane { display: none; }
.tabpane.is-active { display: block; }

.switch { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 999px; padding: 3px; gap: 3px; margin: 14px 0; }
.switch__opt { padding: 6px 16px; border-radius: 999px; text-decoration: none; font-size: 14px; font-weight: 600; color: var(--muted); }
.switch__opt.is-active { background: var(--accent); color: var(--accent-ink); }

.filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

/* ---------- misc ---------- */

.crumbs { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--muted); margin-bottom: 14px; flex-wrap: wrap; }
.crumbs a { text-decoration: none; }

.countdown { font-family: var(--mono); font-weight: 700; font-size: 15px; }
.countdown--big { font-size: 26px; margin-top: 6px; }
.countdown span { font-weight: 400; font-size: .62em; color: var(--muted); margin-left: 6px; }

.crumbs__nav { margin-left: auto; display: flex; gap: 6px; }

.footer { border-top: 1px solid var(--border); padding: 22px 0; margin-top: 40px; font-size: 14px; color: var(--muted); }
.footer__inner { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }


/* ---------- phones ---------- */

@media (max-width: 760px) {
  /* iOS zooms the whole page when a focused field is under 16px, which on
     an editor-first site means every tap into the code box jumps the
     layout. The editor stays visually compact through line-height. */
  .input, .select, .code-input, .btn { font-size: 16px; }
  .code-input { min-height: 260px; line-height: 1.45; }
}

@media (max-width: 560px) {
  .wrap { padding: 0 14px; }
  .main { padding: 20px 14px 48px; }
  .card { padding: 16px; margin-bottom: 14px; }
  .card--compact { padding: 14px; }
  .card__title { font-size: 21px; }
  .card__title--sm { font-size: 17px; }
  .card__aside { text-align: left; }
  .card__head { gap: 10px; }
  .facts { gap: 8px 20px; }
  .hero { padding: 8px 0 18px; }
  .hero__lead { font-size: 16px; }
  .section-title { font-size: 18px; margin: 24px 0 10px; }
  .countdown--big { font-size: 22px; }
  .grid, .grid--problems { grid-template-columns: 1fr; }

  /* Submitting is the one thing a phone user came here to do. */
  .editor__actions { flex-wrap: wrap; }
  .editor__actions .btn { flex: 1 1 100%; justify-content: center; }
  .input--search { max-width: none; }
  .tab { padding: 7px 12px; font-size: 13.5px; }
  .table th, .table td { padding: 9px 8px; }

  /* The follow button is a link, not a call to action competing with
     "Отправить": on a narrow screen it sits on its own line at natural
     width instead of stretching across the page. */
  .footer__inner { gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
