/* MiniDMR - общие стили (согласованный дизайн, design/base.css). */

@font-face { font-family: "Plex Sans"; font-weight: 400; font-display: swap;
  src: url(../fonts/ibm-plex-sans-cyrillic-400.woff2) format("woff2"); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Plex Sans"; font-weight: 400; font-display: swap;
  src: url(../fonts/ibm-plex-sans-latin-400.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family: "Plex Sans"; font-weight: 500; font-display: swap;
  src: url(../fonts/ibm-plex-sans-cyrillic-500.woff2) format("woff2"); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Plex Sans"; font-weight: 500; font-display: swap;
  src: url(../fonts/ibm-plex-sans-latin-500.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family: "Plex Sans"; font-weight: 600; font-display: swap;
  src: url(../fonts/ibm-plex-sans-cyrillic-600.woff2) format("woff2"); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Plex Sans"; font-weight: 600; font-display: swap;
  src: url(../fonts/ibm-plex-sans-latin-600.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family: "Plex Mono"; font-weight: 400; font-display: swap;
  src: url(../fonts/ibm-plex-mono-latin-400.woff2) format("woff2"); }
@font-face { font-family: "Plex Mono"; font-weight: 500; font-display: swap;
  src: url(../fonts/ibm-plex-mono-latin-500.woff2) format("woff2"); }
@font-face { font-family: "Plex Mono"; font-weight: 400; font-display: swap;
  src: url(../fonts/ibm-plex-mono-cyrillic-400.woff2) format("woff2"); unicode-range: U+0400-045F; }

/* Тона с баннера, приглушённые. Ночное небо - ink, бирюза - единственный акцент,
   оранжевый от лампы - только «в эфире». */
/* Тона баннера заказчика «Радиосвязь без границ»: ночное небо, бирюза волн,
   оранжевый закат и лампа. Основная тема ночная, светлая по выбору. */
:root {
  --bg: #00122b;
  --surface: #032645;
  --line: #0b4560;
  --line-soft: #08344c;
  --ink: #ffffff;
  --text: #dcecf5;
  --muted: #86aec4;
  --accent: #00d4ef;
  --accent-ink: #4fe6fb;
  --accent-soft: #063f57;
  --on-accent: #00122b;
  --air: #f5870f;
  --air-soft: #4a2604;
  --second: #f5870f;
  --ok: #3fdc95;
  --bad: #ff6f4f;
  --head: #000b1e;
  --head-text: #ffffff;
  --head-muted: #86aec4;
  --radius: 6px;
  --mono: "Plex Mono", ui-monospace, "Cascadia Mono", monospace;
  --sans: "Plex Sans", system-ui, sans-serif;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #eaf6fa; --surface: #ffffff; --line: #bfe0ea; --line-soft: #dcf0f6;
    --ink: #00111f; --text: #0d2a3c; --muted: #4b6b7e;
    --accent: #0099b8; --accent-ink: #007894; --accent-soft: #d2f1f8; --on-accent: #ffffff;
    --air: #e07000; --air-soft: #fde8d2; --second: #d96a00; --ok: #138a52; --bad: #c63a1c;
    --head: #00111f; --head-text: #ffffff; --head-muted: #86aec4;
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #eaf6fa; --surface: #ffffff; --line: #bfe0ea; --line-soft: #dcf0f6;
    --ink: #00111f; --text: #0d2a3c; --muted: #4b6b7e;
    --accent: #0099b8; --accent-ink: #007894; --accent-soft: #d2f1f8; --on-accent: #ffffff;
    --air: #e07000; --air-soft: #fde8d2; --second: #d96a00; --ok: #138a52; --bad: #c63a1c;
    --head: #00111f; --head-text: #ffffff; --head-muted: #86aec4;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 15px/1.5 var(--sans); }
a { color: var(--accent-ink); text-underline-offset: 2px; }
h1, h2, h3 { color: var(--ink); margin: 0; line-height: 1.2; }
h1 { font-size: 26px; font-weight: 600; }
h2 { font-size: 17px; font-weight: 600; }
h3 { font-size: 15px; font-weight: 600; }
.mono, .call, .id, .tg { font-family: var(--mono); }
.muted { color: var(--muted); }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 16px; }

/* Шапка */
.top { background: var(--head); color: var(--head-text); }
.top .wrap { display: flex; align-items: center; gap: 28px; min-height: 56px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--head-text); text-decoration: none; font-weight: 600; font-size: 17px; }
.brand svg { flex: none; }
.brand small { font: 400 12px var(--mono); color: var(--head-muted); }
.nav { display: flex; gap: 20px; flex: 1; }
.nav a { color: var(--head-muted); text-decoration: none; padding: 17px 0 15px; border-bottom: 2px solid transparent; }
.nav a[aria-current] { color: var(--head-text); border-bottom-color: var(--accent); }
.nav a:hover { color: var(--head-text); }
.top .who { display: flex; align-items: center; gap: 12px; color: var(--head-muted); font-size: 14px; }
.top .who .call { color: var(--head-text); }

/* Кнопки и поля */
.btn { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--surface); color: var(--text); font: 500 14px var(--sans); text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn.small { height: 30px; padding: 0 10px; font-size: 13px; }
.top .btn { background: transparent; color: var(--head-text); border-color: var(--line); }

/* Блоки страницы: плоские разделы с линией, без карточек-плиток */
.section { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.section > header { display: flex; align-items: baseline; gap: 12px; padding: 14px 16px 10px; border-bottom: 1px solid var(--line-soft); }
.section > header .muted { font-size: 13px; }
.section > header .act { margin-left: auto; font-size: 13px; }

/* Строка «в эфире» */
.onair { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 14px; align-items: center;
  padding: 12px 16px; background: var(--air-soft); border-bottom: 1px solid var(--line-soft); }
.onair:last-child { border-bottom: 0; border-radius: 0 0 var(--radius) var(--radius); }
.tx { font: 500 11px var(--mono); color: var(--surface); background: var(--air); border-radius: 3px; padding: 2px 6px; letter-spacing: .04em; }
.onair .who b { color: var(--ink); font-family: var(--mono); font-weight: 500; font-size: 17px; }
.onair .who span { margin-left: 8px; }
.onair .meta { grid-column: 2; font-size: 13px; color: var(--muted); }
.onair .time { grid-row: 1 / span 2; grid-column: 3; font: 500 22px var(--mono); color: var(--air); font-variant-numeric: tabular-nums; }
.quiet { padding: 18px 16px; color: var(--muted); }

/* Таблица вызовов */
table.log { width: 100%; border-collapse: collapse; font-size: 14px; }
table.log th { text-align: left; font-weight: 500; color: var(--muted); font-size: 13px; padding: 8px 12px; border-bottom: 1px solid var(--line-soft); }
table.log td { padding: 9px 12px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
table.log tr:last-child td { border-bottom: 0; }
table.log td.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
table.log .call { color: var(--ink); font-weight: 500; }
table.log .name { color: var(--muted); }
/* Длинные имена и «откуда» не распирают журнал: обрезаем многоточием, а сама таблица
   не вылезает из своей колонки (раньше уезжала под блок «Группы») */
.log-wrap { overflow-x: auto; }
.log-wrap table.log { table-layout: fixed; }
.log-wrap table.log td, .log-wrap table.log th { padding-left: 9px; padding-right: 9px; overflow: hidden; text-overflow: ellipsis; }
/* узкие колонки постоянной ширины (время, слот, длительность, BER, потери), «кто», «группа» и
   «откуда» делят остаток поровну */
.log-wrap table.log th:nth-child(1) { width: 92px; } .log-wrap table.log th:nth-child(4) { width: 56px; }
.log-wrap table.log th:nth-child(6) { width: 66px; } .log-wrap table.log th:nth-child(7) { width: 64px; }
.log-wrap table.log th:nth-child(8) { width: 74px; }
.via { font-size: 13px; color: var(--muted); }
.via.bridge { color: var(--accent-ink); }
.bad { color: var(--bad); }
.ok { color: var(--ok); }

.notice { margin: 16px 0; padding: 12px 16px; border-radius: 8px; font-size: 14px; }
.notice.bad { background: color-mix(in srgb, var(--bad) 12%, var(--paper)); border: 1px solid color-mix(in srgb, var(--bad) 35%, transparent); color: var(--ink); }
.notice.bad a { color: var(--bad); }

/* Подвал */
.foot { margin-top: 48px; border-top: 1px solid var(--line); }
.foot .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 18px; padding-bottom: 28px; color: var(--muted); font-size: 13px; flex-wrap: wrap; }

@media (max-width: 760px) {
  body { font-size: 15px; }
  .top .wrap { gap: 14px; flex-wrap: wrap; min-height: 0; padding-top: 10px; }
  .nav { order: 3; flex-basis: 100%; gap: 18px; overflow-x: auto; }
  .nav a { padding: 8px 0 10px; white-space: nowrap; }
  .top .who { margin-left: auto; }
  h1 { font-size: 22px; }
}

/* Заглушки вместо аватарок и логотипов: placeholders/*.svg, встраиваются в разметку
   (inline), поэтому берут цвета темы. Инициалы не используем. */
:root { --ph-bg: #063f57; --ph-mid: #0b6a86; --ph-fg: #00d4ef; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) { --ph-bg: #d2f1f8; --ph-mid: #7fcfe0; --ph-fg: #0099b8; } }
:root[data-theme="light"] { --ph-bg: #d2f1f8; --ph-mid: #7fcfe0; --ph-fg: #0099b8; }
.ph { display: inline-block; width: 40px; height: 40px; flex: none; }
.ph svg, .ph img { width: 100%; height: 100%; display: block; border-radius: 8px; }

/* Подписи разделов и активная вкладка - вторым цветом баннера */
.section > header h2 { color: var(--ink); }
.section > header .muted { color: var(--second); opacity: .85; }
