/* Self-hosted fonts (F21) — Golos Text + JetBrains Mono, cyrillic+latin subsets.
   Source: Google Fonts css2 API, downloaded locally to drop the CDN dependency. */

/* cyrillic-ext */
@font-face {
  font-family: 'Golos Text';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/golostext-400-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
  font-family: 'Golos Text';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/golostext-400-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* latin-ext */
@font-face {
  font-family: 'Golos Text';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/golostext-400-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Golos Text';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/golostext-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* cyrillic-ext */
@font-face {
  font-family: 'Golos Text';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/golostext-500-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
  font-family: 'Golos Text';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/golostext-500-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* latin-ext */
@font-face {
  font-family: 'Golos Text';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/golostext-500-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Golos Text';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/golostext-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* cyrillic-ext */
@font-face {
  font-family: 'Golos Text';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/golostext-600-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
  font-family: 'Golos Text';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/golostext-600-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* latin-ext */
@font-face {
  font-family: 'Golos Text';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/golostext-600-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Golos Text';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/golostext-600-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* cyrillic-ext */
@font-face {
  font-family: 'Golos Text';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/golostext-700-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
  font-family: 'Golos Text';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/golostext-700-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* latin-ext */
@font-face {
  font-family: 'Golos Text';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/golostext-700-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Golos Text';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/golostext-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* cyrillic-ext */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/jetbrainsmono-400-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/jetbrainsmono-400-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* latin-ext */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/jetbrainsmono-400-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/jetbrainsmono-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* cyrillic-ext */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/jetbrainsmono-500-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/jetbrainsmono-500-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* latin-ext */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/jetbrainsmono-500-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/jetbrainsmono-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* cyrillic-ext */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/jetbrainsmono-700-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/jetbrainsmono-700-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* latin-ext */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/jetbrainsmono-700-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/jetbrainsmono-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* ============================================================
   Эфир — дизайн-система
   Образ: редакционный эфирный пульт. Монохром + один сигнальный
   акцент. Намеренная типографика, волосяные линии, табличные цифры.
   ============================================================ */

:root {
  --sans: "Golos Text", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", monospace;

  --signal: #C4302B;          /* единственный акцент — лампа ON AIR */
  --signal-ink: #fff;

  --r: 4px;                   /* строгий, почти прямой радиус */
  --ease: cubic-bezier(.4, 0, .2, 1);
  --dur: .2s;
  --maxw: 1480px;
}

/* Светлая тема (по умолчанию) — тёплая бумага */
[data-theme="light"] {
  --bg: #F6F4EF;
  --bg-2: #FBFAF6;
  --panel: #FFFFFF;
  --ink: #15140F;
  --ink-2: #4B473E;
  --ink-3: #8A8478;
  --line: #DED9CE;
  --line-2: #ECE8DE;
  --hover: #F1EEE6;
  --shadow: 0 1px 2px rgba(20,18,12,.05), 0 8px 24px -16px rgba(20,18,12,.18);
  --grain: .015;
}

/* Тёмная тема — тёплый near-black */
[data-theme="dark"] {
  --bg: #100F0D;
  --bg-2: #16140F;
  --panel: #1A1814;
  --ink: #ECE8DF;
  --ink-2: #B4AE9F;
  --ink-3: #777164;
  --line: #2A2720;
  --line-2: #221F19;
  --hover: #211E18;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 12px 30px -18px rgba(0,0,0,.8);
  --grain: .03;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* намеренная «бумажная» зернистость */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  background-blend-mode: overlay;
}
[data-theme] body { background-blend-mode: soft-light; }

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.kicker { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }

.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; display: block; }
.ic-lg { width: 26px; height: 26px; }

button { font-family: inherit; cursor: pointer; color: inherit; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }

/* ---------- Masthead ---------- */
.masthead {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px clamp(16px, 3vw, 34px);
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
}
.mast-left { display: flex; align-items: baseline; gap: 14px; min-width: 0; }
.wordmark { font-weight: 700; font-size: 22px; letter-spacing: .02em; text-decoration: none; color: var(--ink); }
.wm-dot { color: var(--signal); }
.mast-sub { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 720px) { .mast-sub { display: none; } }

.mast-right { display: flex; align-items: center; gap: 14px; }
.tally { display: flex; align-items: center; gap: 8px; font-size: 11px; letter-spacing: .14em; font-weight: 600; color: var(--ink-3); border: 1px solid var(--line); padding: 6px 10px; border-radius: var(--r); }
.tally-lamp { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); }
.tally[data-on="true"] { color: var(--signal); border-color: color-mix(in srgb, var(--signal) 40%, var(--line)); }
.tally[data-on="true"] .tally-lamp { background: var(--signal); box-shadow: 0 0 0 0 color-mix(in srgb, var(--signal) 60%, transparent); animation: tally 1.6s infinite; }
@keyframes tally { 0%,100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--signal) 55%, transparent); } 50% { box-shadow: 0 0 0 5px transparent; } }
.clock { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 14px; color: var(--ink-2); }
.mast-city { font-size: 13px; color: var(--ink-2); border-left: 1px solid var(--line); padding-left: 14px; }
@media (max-width: 600px) { .mast-city, .clock { display: none; } }

.icon-btn { background: none; border: 1px solid var(--line); border-radius: var(--r); padding: 7px; color: var(--ink-2); display: grid; place-items: center; transition: background var(--dur) var(--ease), color var(--dur); }
.icon-btn:hover { background: var(--hover); color: var(--ink); }

/* ---------- Ticker ---------- */
.ticker { border-bottom: 1px solid var(--line); background: var(--panel); overflow: hidden; height: 34px; }
.ticker-track { display: flex; gap: 48px; white-space: nowrap; align-items: center; height: 100%; font-family: var(--mono); font-size: 12px; color: var(--ink-2); padding-left: 100%; animation: ticker 60s linear infinite; }
.ticker-track .sep { color: var(--signal); }
@keyframes ticker { to { transform: translateX(-100%); } }
.ticker:hover .ticker-track { animation-play-state: paused; }

/* ---------- Grid ---------- */
.grid {
  max-width: var(--maxw); margin: 0 auto; padding: clamp(16px, 2.4vw, 30px);
  display: grid; gap: clamp(16px, 1.8vw, 26px);
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr) minmax(260px, 340px);
  align-items: start;
}
@media (max-width: 1180px) { .grid { grid-template-columns: minmax(0,1fr) minmax(240px,320px); } .stage { grid-column: 1 / -1; order: -1; } }
@media (max-width: 820px) { .grid { grid-template-columns: 1fr; } }

.rail { display: flex; flex-direction: column; gap: clamp(16px,1.8vw,26px); }
.block { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); }
.block-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.daypart, .count { font-family: var(--mono); font-size: 11px; color: var(--ink-3); }

/* ---------- Программа: циферблат ---------- */
.dial-wrap { position: relative; display: grid; place-items: center; margin: 4px 0 14px; }
#dial { width: 200px; height: 200px; }
.dial-center { position: absolute; font-family: var(--mono); font-size: 12px; color: var(--ink-2); text-align: center; max-width: 120px; line-height: 1.3; }
.schedule { list-style: none; margin: 0; padding: 0; }
.schedule li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line-2); font-size: 13px; color: var(--ink-2); }
.schedule li:first-child { border-top: none; }
.schedule .s-time { font-family: var(--mono); color: var(--ink); }

/* ---------- История ---------- */
.log { list-style: none; margin: 0; padding: 0; max-height: 320px; overflow: auto; }
.log li { padding: 9px 0; border-top: 1px solid var(--line-2); display: flex; gap: 10px; align-items: baseline; }
.log li:first-child { border-top: none; }
.log .l-kind { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); width: 74px; flex: none; padding-top: 2px; }
.log .l-title { font-size: 13px; color: var(--ink); }
.log-empty { color: var(--ink-3); font-size: 13px; }

/* ---------- Сцена ---------- */
.stage { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: clamp(22px, 3vw, 40px); box-shadow: var(--shadow); display: flex; flex-direction: column; min-height: 540px; }
.now { border-bottom: 1px solid var(--line-2); padding-bottom: 20px; }
.now-kicker { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--signal); font-weight: 600; margin-bottom: 12px; }
.now-title { font-size: clamp(26px, 3.6vw, 44px); line-height: 1.08; letter-spacing: -.015em; margin: 0 0 12px; font-weight: 600; }
.now-sub { color: var(--ink-2); margin: 0; max-width: 60ch; font-size: 15px; }

.viz { position: relative; flex: 1; min-height: 150px; margin: 18px 0; }
#viz { width: 100%; height: 100%; display: block; }
.viz-speaking { position: absolute; left: 0; bottom: 8px; font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--signal); }
.viz-speaking::before { content: ""; display: inline-block; width: 7px; height: 7px; background: var(--signal); border-radius: 50%; margin-right: 7px; vertical-align: middle; animation: tally 1.4s infinite; }

.scrub { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.scrub .t { font-size: 12px; color: var(--ink-3); min-width: 40px; }
.scrub .t:last-child { text-align: right; }
.bar { flex: 1; height: 3px; background: var(--line); border-radius: 2px; overflow: hidden; }
.bar-fill { height: 100%; width: 0; background: var(--ink); transition: width .25s linear; }

.transport { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.t-btn { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r); height: 46px; min-width: 46px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; color: var(--ink); font-size: 13px; font-weight: 500; transition: background var(--dur) var(--ease), border-color var(--dur), transform .05s; }
.t-btn:hover:not(:disabled) { background: var(--hover); }
.t-btn:active:not(:disabled) { transform: translateY(1px); }
.t-btn:disabled { opacity: .4; cursor: not-allowed; }
.t-btn.play { background: var(--ink); color: var(--bg); border-color: var(--ink); width: 58px; }
.t-btn.play:hover:not(:disabled) { background: var(--ink-2); }
.t-btn.wide { min-width: auto; }
.t-sep { width: 1px; align-self: stretch; background: var(--line); margin: 4px 4px; }

.breaking { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line-2); }
.breaking .kicker { display: block; margin-bottom: 10px; }
.breaking-row { display: flex; gap: 10px; }
.breaking-row input { flex: 1; }
.btn-solid { background: var(--signal); color: var(--signal-ink); border: 1px solid var(--signal); border-radius: var(--r); padding: 0 16px; height: 42px; display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; transition: filter var(--dur); }
.btn-solid:hover:not(:disabled) { filter: brightness(1.08); }
.btn-solid:disabled { opacity: .4; cursor: not-allowed; }
.audio-hidden { display: none; }

/* ---------- Фонотека ---------- */
.dropzone { border: 1px dashed var(--line); border-radius: var(--r); padding: 22px 16px; text-align: center; color: var(--ink-2); transition: background var(--dur), border-color var(--dur); }
.dropzone.over { background: var(--hover); border-color: var(--signal); }
.dropzone .ic-lg { margin: 0 auto 8px; color: var(--ink-3); }
.dropzone p { margin: 0; font-size: 13px; line-height: 1.5; }
.link { background: none; border: none; padding: 0; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; font-size: 13px; }
.track-list { list-style: none; margin: 12px 0 0; padding: 0; max-height: 320px; overflow: auto; }
.track-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line-2); font-size: 13px; }
.track-list li:first-child { border-top: none; }
.track-list li.playing { color: var(--signal); }
.track-list .t-idx { font-family: var(--mono); font-size: 11px; color: var(--ink-3); width: 22px; flex: none; }
.track-list .t-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.track-list .t-del { background: none; border: none; color: var(--ink-3); padding: 2px; display: grid; }
.track-list .t-del:hover { color: var(--signal); }
.track-empty { color: var(--ink-3); font-size: 13px; padding: 8px 0; }

/* ---------- Пресеты / контент ---------- */
.preset-row { display: flex; gap: 8px; margin-bottom: 10px; }
.preset-row select, .preset-row input { flex: 1; }
.content-actions { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.btn-ghost { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 14px; display: inline-flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 500; color: var(--ink); transition: background var(--dur); }
.btn-ghost:hover:not(:disabled) { background: var(--hover); }
.btn-ghost.small { padding: 8px 12px; font-size: 12px; }
.btn-ghost.block { width: 100%; justify-content: center; }
.btn-ghost.rec-on { color: var(--signal); border-color: color-mix(in srgb, var(--signal) 40%, var(--line)); }
.stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin: 0; }
.stats div { border: 1px solid var(--line-2); border-radius: var(--r); padding: 10px; text-align: center; }
.stats dt { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.stats dd { margin: 4px 0 0; font-size: 17px; color: var(--ink); }

/* ---------- Формы ---------- */
input[type="text"], select { width: 100%; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r); padding: 9px 11px; color: var(--ink); font-family: inherit; font-size: 14px; transition: border-color var(--dur); }
input[type="text"]:focus, select:focus { border-color: var(--ink-3); outline: none; }
input[type="range"] { width: 100%; accent-color: var(--signal); margin-top: 8px; }
.switch { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--ink-2); margin: 10px 0; cursor: pointer; }
.switch input { accent-color: var(--signal); width: 15px; height: 15px; }

/* ---------- Drawer (настройки) ---------- */
.scrim { position: fixed; inset: 0; background: rgba(10,9,7,.42); z-index: 40; }
.drawer { position: fixed; top: 0; right: 0; height: 100%; width: min(440px, 92vw); background: var(--panel); border-left: 1px solid var(--line); z-index: 50; transform: translateX(100%); transition: transform .28s var(--ease); display: flex; flex-direction: column; box-shadow: -20px 0 50px -30px rgba(0,0,0,.5); }
.drawer.open { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.drawer-body { overflow: auto; padding: 8px 20px 28px; }
fieldset { border: none; border-top: 1px solid var(--line-2); margin: 0; padding: 18px 0 6px; }
fieldset:first-child { border-top: none; }
legend { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; padding: 0; margin-bottom: 6px; }
.fld { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 14px; }
.fld .lbl { display: block; margin-bottom: 6px; }
.fld output { font-family: var(--mono); color: var(--ink); }
.checks { display: grid; gap: 4px; margin-top: 8px; }
.chk { display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: 13px; }
.chk input { accent-color: var(--signal); }
.feeds { display: flex; flex-direction: column; gap: 4px; max-height: 220px; overflow: auto; }
.feeds .region { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); margin: 10px 0 2px; }
.add-feed { display: flex; gap: 8px; margin-top: 10px; }
.custom-feeds { list-style: none; padding: 0; margin: 10px 0 0; font-size: 12px; }
.custom-feeds li { display: flex; justify-content: space-between; gap: 8px; padding: 5px 0; color: var(--ink-2); border-top: 1px solid var(--line-2); }
.custom-feeds button { background: none; border: none; color: var(--signal); font-size: 12px; }
[data-trigger] { transition: opacity var(--dur); }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(8px); background: var(--ink); color: var(--bg); padding: 11px 18px; border-radius: var(--r); font-size: 13px; z-index: 60; box-shadow: var(--shadow); opacity: 0; transition: opacity var(--dur), transform var(--dur); max-width: 90vw; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.signal { background: var(--signal); color: #fff; }
.hidden { display: none; }

/* ---------- Подвал ---------- */
.credit {
  text-align: center;
  padding: 16px clamp(16px, 3vw, 34px);
  border-top: 1px solid var(--line);
  background: var(--bg-2);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .01em;
  color: var(--ink-3);
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .ticker-track { animation: none; padding-left: 0; }
  .tally[data-on="true"] .tally-lamp, .viz-speaking::before { animation: none; }
  * { transition-duration: .01ms !important; }
}

/* ---------- Экран входа (gate) ---------- */
.gate-body { display: grid; place-items: center; min-height: 100%; padding: 24px; }
.gate { width: 100%; max-width: 384px; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.gate-card { width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 30px 26px; display: flex; flex-direction: column; gap: 11px; }
.gate-brand { margin-bottom: 4px; }
.gate-title { font-size: 21px; font-weight: 700; margin: 4px 0 0; letter-spacing: .01em; }
.gate-sub { font-size: 13px; color: var(--ink-2); margin: 0 0 8px; }
.gate-input { width: 100%; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r); padding: 11px 13px; color: var(--ink); font-family: inherit; font-size: 15px; letter-spacing: .04em; transition: border-color var(--dur); }
.gate-input:focus { border-color: var(--ink-3); outline: none; }
.gate-btn { width: 100%; justify-content: center; height: 44px; margin-top: 2px; }
.gate-error { color: var(--signal); font-size: 13px; margin: 4px 0 0; }
.gate-credit { font-family: var(--mono); font-size: 12px; letter-spacing: .01em; color: var(--ink-3); text-align: center; }
