/* Концепция: эмалированный знак по охране труда — единственный громкий предмет страницы.
   Ниже спокойный офисный стенд: открытая словарная статья, журнал учёта, а рамки-панели
   только у того, с чем работают руками (ставки, игры). Всё по левому краю, по центру — только знак.
   Шрифты по ролям: Unbounded — надписи знака и заголовки, Plex Sans — всё остальное,
   Plex Mono — только «машинное»: цифры табло, номера портов, почтовые адреса.
   Шкала кегля: 14 / 16 / 18 / 21 / 24 / 36 / 48. */
:root {
  --bg: #ECEEE7;
  --paper: #F7F8F3;
  --field: #FFFFFF;
  --ink: #161A15;
  --muted: #555E52;
  --line: #D3D8CC;
  --line-strong: #A3AC9C;
  --safety: #0B6E3F;
  --on-safety: #F4F7F1;
  --alarm: #C42A1F;
  --alarm-deep: #8F1C14;
  --hazard: #F2B705;
  --hazard-ink: #16140C;
  --ok: #1D7A45;
  --bad: #B3261E;
  --flap: #191C1A;
  --flap-ink: #F5F3EA;
  --link: #0B6E3F;
  --focus: #E0A800;
  --shadow: 0 1px 0 rgba(0, 0, 0, .04), 0 18px 40px -24px rgba(20, 40, 25, .45);

  --font-display: "Unbounded", "Arial Black", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-machine: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --fs-s: 14px;
  --fs-m: 16px;
  --fs-l: 18px;
  --fs-xl: 21px;
  --fs-2xl: 24px;
  --fs-3xl: 36px;
  --fs-4xl: 48px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131A15;
    --paper: #19221C;
    --field: #0F1511;
    --ink: #E3E8DE;
    --muted: #9CA698;
    --line: #2A342D;
    --line-strong: #4A5650;
    --alarm: #D9372B;
    --alarm-deep: #8A1D15;
    --ok: #4CC07D;
    --bad: #F2685C;
    --flap: #0C110E;
    --link: #5FC48B;
    --shadow: 0 18px 40px -24px rgba(0, 0, 0, .8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #131A15;
  --paper: #19221C;
  --field: #0F1511;
  --ink: #E3E8DE;
  --muted: #9CA698;
  --line: #2A342D;
  --line-strong: #4A5650;
  --alarm: #D9372B;
  --alarm-deep: #8A1D15;
  --ok: #4CC07D;
  --bad: #F2685C;
  --flap: #0C110E;
  --link: #5FC48B;
  --shadow: 0 18px 40px -24px rgba(0, 0, 0, .8);
  color-scheme: dark;
}

/* ---------- основа ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: var(--fs-m)/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); }
img { max-width: 100%; }
[hidden] { display: none !important; }

.tnum { font-variant-numeric: tabular-nums; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.wrap {
  max-width: 1120px;
  margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* ---------- шапка ---------- */

.topbar {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.topbar__row {
  display: flex;
  align-items: center;
  gap: 10px 28px;
  padding-block: 14px;
  flex-wrap: wrap;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font: 700 var(--fs-s)/1 var(--font-display);
}
.brand__mark {
  position: relative;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  background: var(--safety);
}
.brand__mark::before, .brand__mark::after {
  content: "";
  position: absolute;
  background: var(--on-safety);
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
}
.brand__mark::before { width: 4px; height: 14px; }
.brand__mark::after { width: 14px; height: 4px; }

.nav { display: flex; gap: 22px; margin-left: auto; }
.nav a { color: var(--muted); text-decoration: none; font-weight: 500; }
.nav a:hover { color: var(--ink); }
.clock { color: var(--muted); font-variant-numeric: tabular-nums; }

@media (max-width: 700px) {
  .nav { order: 3; width: 100%; margin-left: 0; overflow-x: auto; gap: 20px; }
  .clock { margin-left: auto; }
}

/* ---------- знак ---------- */

.board-zone { padding-block: 40px 36px; }

.sign {
  position: relative;
  padding: clamp(26px, 5vw, 52px) clamp(18px, 5vw, 56px) clamp(24px, 4vw, 36px);
  border-radius: 16px;
  border: 6px solid var(--on-safety);
  outline: 1px solid rgba(0, 0, 0, .28);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .09), rgba(0, 0, 0, .1)),
    var(--safety);
  color: var(--on-safety);
  text-align: center;
  box-shadow: var(--shadow);
}
.rivet {
  position: absolute;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #FFFFFF, #B9C0B4 45%, #6C7468);
  box-shadow: 0 1px 1px rgba(0, 0, 0, .4);
}
.rivet--tl { top: 12px; left: 12px; }
.rivet--tr { top: 12px; right: 12px; }
.rivet--bl { bottom: 12px; left: 12px; }
.rivet--br { bottom: 12px; right: 12px; }

.sign__org { margin: 0; font-size: var(--fs-l); opacity: .86; }
.sign__headline {
  margin: 6px 0 30px;
  font: 800 clamp(var(--fs-2xl), 4.4vw, var(--fs-4xl))/1.08 var(--font-display);
  text-transform: uppercase;
  text-wrap: balance;
}

.sign__counter {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 14px 20px;
  flex-wrap: wrap;
}
.flaps { display: flex; gap: clamp(5px, 1vw, 10px); }
.flap {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(58px, 12vw, 118px);
  aspect-ratio: 3 / 4;
  max-width: 100%;
  border-radius: 8px;
  background: var(--flap);
  color: var(--flap-ink);
  font: 600 clamp(52px, 11vw, 108px)/1 var(--font-machine);
  box-shadow: 0 6px 0 rgba(0, 0, 0, .3), inset 0 0 0 1px rgba(255, 255, 255, .05);
  overflow: hidden;
  perspective: 400px;
}
.flap::before {
  content: "";
  position: absolute;
  inset: 0 0 50% 0;
  background: rgba(255, 255, 255, .045);
}
.flap::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: calc(50% - 1px);
  height: 2px;
  background: rgba(0, 0, 0, .7);
}
.flap span { position: relative; display: block; }
.flap.is-flipping span { animation: flap .55s cubic-bezier(.25, .8, .35, 1) both; }
@keyframes flap {
  0% { transform: rotateX(88deg); opacity: .15; }
  60% { transform: rotateX(-12deg); opacity: 1; }
  100% { transform: rotateX(0); }
}

.sign__unit {
  padding-bottom: 6px;
  font: 700 clamp(var(--fs-2xl), 4vw, 40px)/1 var(--font-display);
  text-transform: uppercase;
}
.sign__elapsed { margin: 22px 0 0; font-size: var(--fs-m); opacity: .86; }

/* Нижняя кромка знака: строки с вставными табличками, как на стенде по охране труда */
.sign__plates {
  display: flex;
  justify-content: space-between;
  gap: 12px 32px;
  flex-wrap: wrap;
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, .28);
}
.plate-line {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0;
  font-size: var(--fs-m);
  text-align: left;
}
.plate {
  padding: 3px 9px;
  border-radius: 4px;
  background: var(--flap);
  color: var(--flap-ink);
  font: 600 var(--fs-xl)/1.2 var(--font-machine);
  letter-spacing: .08em;
  box-shadow: inset 0 -2px 0 rgba(255, 255, 255, .06);
}
.plate-line__note { margin-left: -4px; opacity: .86; }
@media (max-width: 560px) {
  .sign__plates { flex-direction: column; align-items: flex-start; }
}

.board-actions {
  display: flex;
  align-items: center;
  gap: 18px 28px;
  margin-top: 28px;
  flex-wrap: wrap;
}
.btn-alarm {
  display: grid;
  gap: 4px;
  padding: 14px 26px 15px;
  border: 5px solid transparent;
  border-radius: 12px;
  background:
    linear-gradient(var(--alarm), var(--alarm)) padding-box,
    repeating-linear-gradient(-45deg, var(--hazard) 0 8px, var(--hazard-ink) 8px 16px) border-box;
  color: #FFFFFF;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 5px 0 var(--alarm-deep);
  transition: transform .08s ease, box-shadow .08s ease;
}
.btn-alarm:hover { filter: brightness(1.06); }
.btn-alarm:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--alarm-deep); }
.btn-alarm__label { font: 700 var(--fs-l)/1.2 var(--font-display); }
.btn-alarm__hint { font-size: var(--fs-s); opacity: .9; }

.last-incident { margin: 0; max-width: 62ch; min-width: 0; flex: 1 1 280px; color: var(--muted); }
.last-incident p { margin: 0; }
.last-incident__what { color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }

.undo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  flex-wrap: wrap;
  margin-top: 22px;
  padding: 12px 16px;
  border: 1px dashed var(--alarm);
  border-radius: 10px;
  background: var(--paper);
}
.undo p { margin: 0; }
.undo .undo__msg { width: 100%; min-height: 0; }
.undo .undo__msg:empty { display: none; }

/* ---------- секции ---------- */

.section { padding-block: 56px; border-top: 1px solid var(--line); }
.section--games { background: var(--paper); }

.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 24px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.section__head h2 {
  margin: 0;
  font: 700 clamp(var(--fs-2xl), 3.2vw, var(--fs-3xl))/1.15 var(--font-display);
  text-wrap: balance;
}
.section__meta { margin: 0; color: var(--muted); }

/* Панель — только для того, с чем работают руками */
.panel {
  min-width: 0;
  padding: clamp(20px, 3vw, 28px);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--paper);
}
.panel__title { margin: 0 0 8px; font: 700 var(--fs-xl)/1.3 var(--font-display); text-wrap: balance; }
.panel__lede { margin: 0 0 18px; color: var(--muted); max-width: 60ch; }

.today-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 32px 56px;
  align-items: start;
}
@media (max-width: 880px) { .today-grid { grid-template-columns: minmax(0, 1fr); } }

/* словарная статья — открытым текстом, без рамки */
.dict { min-width: 0; padding-top: 4px; }
.dict__word {
  margin: 0;
  font: 800 clamp(var(--fs-3xl), 5vw, var(--fs-4xl))/1.08 var(--font-display);
  letter-spacing: -.015em;
  text-wrap: balance;
  overflow-wrap: anywhere;
  hyphens: auto;
}
.dict__pos { margin: 10px 0 18px; color: var(--muted); font-style: italic; }
.dict__text { margin: 0 0 18px; font-size: var(--fs-xl); line-height: 1.55; max-width: 34em; }
.dict__example { margin: 0; max-width: 40em; font-style: italic; color: var(--muted); }
.dict__cite {
  margin: 26px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--fs-s);
}

/* формы */
.field { display: grid; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }
.field__label { color: var(--muted); font-size: var(--fs-s); font-weight: 500; padding: 0; }
.input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
  font: inherit;
  font-size: var(--fs-m);
}
textarea.input { resize: vertical; min-height: 84px; }
.input:focus-visible { outline: 3px solid var(--focus); outline-offset: 0; border-color: var(--ink); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  font: 600 var(--fs-m)/1.2 var(--font-body);
  cursor: pointer;
  white-space: nowrap;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn--ink { background: var(--ink); color: var(--bg); }
.btn--ink:hover:not(:disabled) { filter: brightness(1.15); }
.btn--ghost { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn--ghost:hover:not(:disabled) { border-color: var(--ink); }
.btn--danger { background: var(--alarm); color: #FFFFFF; }
.btn--danger:hover:not(:disabled) { filter: brightness(1.08); }
.btn--small { padding: 6px 12px; font-size: var(--fs-s); }

.form-msg { min-height: 1.4em; margin: 10px 0 0; font-size: var(--fs-s); color: var(--muted); }
.form-msg--error, .form-msg.is-error { color: var(--bad); }

/* тотализатор */
.tote__form { display: grid; grid-template-columns: minmax(0, 1fr) 104px auto; gap: 10px; align-items: end; }
@media (max-width: 460px) {
  .tote__form { grid-template-columns: minmax(0, 1fr) 96px; }
  .tote__form .btn { grid-column: 1 / -1; }
}
.bets { list-style: none; margin: 14px 0 0; padding: 0; }
.bets li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.bets li:last-child { border-bottom: 0; }
.bets__name { overflow-wrap: anywhere; }
.bets__days { font-variant-numeric: tabular-nums; }
.bets li.is-mine .bets__name { font-weight: 600; }
.bets li.is-past { color: var(--muted); }
.bets li.is-now {
  grid-template-columns: 1fr;
  padding: 6px 0;
  border-bottom: 2px solid var(--link);
  color: var(--link);
  font-size: var(--fs-s);
  font-weight: 600;
}
.tag {
  display: inline-block;
  margin-left: 8px;
  padding: 0 7px;
  border-radius: 999px;
  border: 1px solid currentColor;
  font-size: var(--fs-s);
  font-weight: 500;
  line-height: 1.5;
}
.tote__last { margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: var(--fs-s); }

/* ---------- игры ---------- */

.games-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
@media (max-width: 760px) { .games-grid { grid-template-columns: minmax(0, 1fr); } }

.game-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  padding: clamp(20px, 3vw, 28px);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
}
.game-tile__art {
  width: 100%;
  height: 92px;
  margin-bottom: 20px;
  border-radius: 8px;
}
.game-tile__art--mail {
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: var(--field);
  overflow-wrap: anywhere;
}
.game-tile__art--port {
  display: grid;
  place-items: center;
  padding: 16px;
  background: var(--flap);
  color: var(--flap-ink);
  font: 600 clamp(28px, 5vw, var(--fs-3xl))/1 var(--font-machine);
  letter-spacing: .04em;
}
.addr { font: 500 var(--fs-s)/1.4 var(--font-machine); }
.addr--suspect { text-decoration: underline wavy var(--alarm); text-underline-offset: 4px; }

.mini-title { margin: 26px 0 4px; font-size: var(--fs-s); font-weight: 600; }
.leaders { width: 100%; margin: 0; padding: 0; list-style: none; counter-reset: rank; }
.leaders li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: baseline;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  counter-increment: rank;
  font-variant-numeric: tabular-nums;
}
.leaders li::before { content: counter(rank); color: var(--muted); }
.leaders li:last-child { border-bottom: 0; }
.leaders__name { overflow-wrap: anywhere; }
.leaders__time { color: var(--muted); font-size: var(--fs-s); }
.leaders .empty-row { display: block; color: var(--muted); }
.leaders .empty-row::before { content: none; }

.arena {
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--bg);
}
.arena__bar {
  display: flex;
  align-items: center;
  gap: 10px 18px;
  flex-wrap: wrap;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.arena__title { font: 700 var(--fs-l)/1.2 var(--font-display); margin-right: auto; }
.arena__progress { color: var(--muted); font-size: var(--fs-s); }

/* прогресс партии: клетка на вопрос, цветом — верно или нет */
.pips { display: flex; gap: 4px; margin: 0; padding: 0; list-style: none; }
.pips li { width: 14px; height: 14px; border-radius: 3px; border: 1px solid var(--line-strong); }
.pips li.is-current { border: 2px solid var(--ink); }
.pips li.is-ok { background: var(--ok); border-color: var(--ok); }
.pips li.is-bad { background: var(--bad); border-color: var(--bad); }

.mail {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--field);
}
.mail__head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px 14px;
  margin: 0;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.mail__head dt { color: var(--muted); }
.mail__head dd { margin: 0; overflow-wrap: anywhere; }
.mail__head .addr { color: var(--muted); }
.mail__body { margin: 0; padding: 18px; font-size: var(--fs-l); line-height: 1.6; }
.mail__note { margin: 0 0 12px; color: var(--muted); font-size: var(--fs-s); }

.answers { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.answers .btn { min-width: 160px; padding: 13px 20px; }
.answers--grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.answers--grid .btn { min-width: 0; white-space: normal; text-align: center; }
@media (max-width: 460px) { .answers--grid { grid-template-columns: minmax(0, 1fr); } }
.answers .btn.is-right { border-color: var(--ok); color: var(--ok); opacity: 1; }
.answers .btn.is-wrong { border-color: var(--bad); color: var(--bad); text-decoration: line-through; opacity: 1; }

.port-big {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  padding: 22px 16px;
  border-radius: 10px;
  background: var(--flap);
  color: var(--flap-ink);
  font-family: var(--font-machine);
}
.port-big b { font-size: clamp(var(--fs-4xl), 10vw, 84px); font-weight: 600; line-height: 1; }
.port-big span { font-size: var(--fs-xl); opacity: .7; }
.port-q { margin: 0 0 14px; font-size: var(--fs-l); }

.verdict {
  margin-top: 18px;
  padding: 14px 18px;
  border-radius: 10px;
  border: 1px solid var(--line);
}
.verdict p { margin: 0; }
.verdict__head { font-weight: 600; margin-bottom: 4px !important; }
.verdict--ok { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 10%, transparent); }
.verdict--ok .verdict__head { color: var(--ok); }
.verdict--bad { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 9%, transparent); }
.verdict--bad .verdict__head { color: var(--bad); }
.verdict .btn { margin-top: 14px; }

.result { text-align: center; padding-block: 10px; }
.result__score { margin: 0; font: 800 clamp(56px, 12vw, 96px)/1 var(--font-display); }
.result__score small { font-size: .4em; color: var(--muted); font-weight: 600; }
.result__rank { margin: 12px 0 20px; font-size: var(--fs-l); }
.result__form { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; max-width: 440px; margin-inline: auto; }
.result__form .input { flex: 1 1 200px; }

/* ---------- новости ---------- */

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.chip {
  padding: 6px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: 500 var(--fs-s)/1.3 var(--font-body);
  cursor: pointer;
}
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chips--pick { margin: 0; }

.news {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 40px;
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (max-width: 760px) { .news { grid-template-columns: minmax(0, 1fr); } }
.news li { min-width: 0; padding: 18px 0; border-bottom: 1px solid var(--line); }
.news__meta { margin: 0 0 4px; color: var(--muted); font-size: var(--fs-s); }
.news__source { color: var(--ink); font-weight: 600; }
.news__title {
  display: block;
  color: var(--ink);
  font-size: var(--fs-l);
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.news__title:hover { text-decoration: underline; text-underline-offset: 3px; }
.news__summary {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: var(--fs-s);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news .empty-row { grid-column: 1 / -1; color: var(--muted); border-bottom: 0; }

/* ---------- журнал ---------- */

.ledger-scroll {
  overflow-x: auto;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--paper);
}
.ledger { width: 100%; min-width: 780px; border-collapse: collapse; font-size: var(--fs-s); }
.ledger th, .ledger td { padding: 10px 12px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.ledger tr > :first-child { border-left: 0; }
.ledger tr > :last-child { border-right: 0; }
.ledger thead th {
  border-top: 0;
  border-bottom: 2px solid var(--line-strong);
  background: var(--bg);
  font-weight: 600;
  vertical-align: bottom;
}
.ledger tbody tr:last-child td { border-bottom: 0; }
.ledger td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ledger td.what { min-width: 220px; overflow-wrap: anywhere; }
.ledger .empty-row td { padding: 28px 12px; color: var(--muted); text-align: center; }
.ledger .src { color: var(--muted); }

/* ---------- подвал ---------- */

.footer { border-top: 1px solid var(--line); color: var(--muted); font-size: var(--fs-s); }
.footer__row { display: flex; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap; padding-block: 28px; }
.footer p { margin: 0; }

/* ---------- окно обнуления ---------- */

.modal {
  width: min(560px, calc(100% - 32px));
  max-height: calc(100% - 32px);
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .55);
}
.modal::backdrop { background: rgba(8, 10, 8, .62); }
.modal__inner { display: grid; gap: 16px; padding-bottom: 24px; }
.modal__inner > *:not(.modal__tape) { margin-inline: clamp(18px, 4vw, 26px); }
.modal__tape {
  height: 12px;
  background: repeating-linear-gradient(-45deg, var(--hazard) 0 12px, var(--hazard-ink) 12px 24px);
}
.modal__title { margin-top: 8px; margin-bottom: 0; font: 700 var(--fs-2xl)/1.2 var(--font-display); }
.modal__lede { margin-top: -6px; margin-bottom: 0; color: var(--muted); }
.modal .form-msg { margin-top: -6px; margin-bottom: -6px; }
.modal__actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .flap.is-flipping span { animation: none; }
  .btn-alarm { transition: none; }
}
