/* Админка ведущего – рабочий инструмент: спокойная, плотная, крупные понятные кнопки.
   Палитра – светлая тема презентации 19.10 (фон #e9eef1, белые карточки, бирюза, жёлтый акцент). */

/* ---------- шрифты (OFL, файлы OFL-*.txt рядом) ---------- */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/inter-cyrillic-400-normal.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/inter-latin-400-normal.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; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/inter-cyrillic-600-normal.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/inter-latin-600-normal.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; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/inter-cyrillic-700-normal.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/inter-latin-700-normal.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; }
@font-face { font-family: "Inter Tight"; font-style: normal; font-weight: 800; font-display: swap; src: url("/fonts/inter-tight-cyrillic-800-normal.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Inter Tight"; font-style: normal; font-weight: 800; font-display: swap; src: url("/fonts/inter-tight-latin-800-normal.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 {
  --bg: #e9eef1;
  --card: #ffffff;
  --plate: #f1f4f5;
  --plate-2: #e3eaec;
  --line: #d3dcdf;
  --text: #15191a;
  --muted: #5f6d71;
  --teal: #2f6f80;
  --teal-soft: #d6e6ea;
  --accent: #e9e407;
  --coral: #e5483b;
  --coral-soft: #fbe3e0;
  --ok: #2f8f5b;
  --ok-soft: #dff1e6;
  --warn-soft: #fbf8c4;
  --c-yes: #2f6f80;
  --c-part: #6fa3b0;
  --c-no: #e5483b;
  --c-unk: #8a9699;
  --r: 14px;
  --r-s: 9px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.4 "Inter", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: "Inter Tight", "Inter", sans-serif; font-weight: 800; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: 24px; margin: 4px 0 12px; }
h3 { font-size: 16px; margin: 0 0 10px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- кнопки и поля ---------- */
.btn {
  font: inherit; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 6px 14px;
  border: 1px solid var(--line); border-radius: var(--r-s);
  background: var(--card); color: var(--text);
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--teal); }
.btn:focus-visible, .inp:focus-visible, .nav-item:focus-visible, .mx-cell:focus-visible, .check:focus-visible { outline: 3px solid var(--teal-soft); outline-offset: 1px; border-color: var(--teal); }
.btn:disabled, .btn[disabled] { opacity: 0.45; cursor: not-allowed; border-color: var(--line); }
.btn-primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn-primary:hover { background: #255b69; }
.btn-big { min-height: 44px; padding: 8px 18px; font-size: 16px; }
.btn-small { min-height: 30px; padding: 3px 10px; font-size: 13px; }
.btn-quiet { background: transparent; }
.btn-danger { background: var(--coral); border-color: var(--coral); color: #fff; }
.btn.is-on { background: var(--text); border-color: var(--text); color: #fff; }
.btn-focus.is-on, .btn-focus:hover { background: var(--accent); border-color: #c9c400; color: var(--text); }
.btn-cross { border-color: var(--coral); color: var(--coral); }
.btn-cross:not(:disabled):hover { background: var(--coral); color: #fff; }
.inp {
  font: inherit; min-height: 36px; padding: 6px 10px;
  border: 1px solid var(--line); border-radius: var(--r-s);
  background: var(--card); color: var(--text); min-width: 0;
}
textarea.inp { resize: vertical; width: 100%; line-height: 1.4; }
.grow { flex: 1 1 auto; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0; }
.field { display: block; margin: 8px 0; }
.field .label, .label { display: block; font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.row .label { display: inline; margin: 0 4px 0 0; }
.file { position: relative; }
.radio { display: flex; gap: 8px; align-items: baseline; padding: 4px 0; cursor: pointer; }

/* ---------- вход ---------- */
.login {
  width: min(420px, calc(100% - 32px)); margin: 14vh auto 0; padding: 32px;
  background: var(--card); border-radius: 24px; display: grid; gap: 12px;
}
.login-title { font-size: 28px; }
.login-input { font: inherit; font-size: 18px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-s); }
.login-error { color: var(--coral); font-weight: 600; min-height: 1.4em; }

/* ---------- каркас ---------- */
.app { height: 100vh; display: grid; grid-template-rows: auto auto 1fr; }
.topbar {
  display: flex; align-items: center; gap: 16px; padding: 10px 16px;
  background: var(--card); border-bottom: 1px solid var(--line);
}
.brand { font-family: "Inter Tight", sans-serif; font-weight: 800; font-size: 20px; white-space: nowrap; }
.brand span { color: var(--muted); font-weight: 700; }
.status { display: flex; flex-wrap: wrap; gap: 8px; flex: 1; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; background: var(--plate); font-size: 13px; font-weight: 600; }
.pill i { width: 9px; height: 9px; border-radius: 50%; background: var(--c-unk); }
.pill.ok i { background: var(--ok); }
.pill.warn i { background: #c9a400; }
.pill.bad { background: var(--coral-soft); color: var(--coral); }
.pill.bad i { background: var(--coral); }
.pill.pause { background: var(--accent); }
.top-actions { display: flex; gap: 8px; }
#pause.is-on { background: var(--accent); border-color: #c9c400; color: var(--text); }

.banners:empty { display: none; }
.banners { padding: 8px 16px 0; display: grid; gap: 6px; }
.banner { padding: 10px 14px; border-radius: var(--r-s); background: var(--plate); display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 6px 0; }
.banner.bad { background: var(--coral); color: #fff; font-weight: 700; font-size: 17px; }
.banner.warn { background: var(--warn-soft); }
.banner.ok { background: var(--ok-soft); }
.banner.pause { background: var(--accent); font-size: 17px; }
.toast { position: fixed; top: 64px; left: 50%; transform: translateX(-50%); z-index: 20; padding: 10px 18px; border-radius: var(--r-s); font-weight: 600; box-shadow: 0 6px 24px rgba(0,0,0,0.15); max-width: min(640px, 90vw); }
.toast.bad { background: var(--coral); color: #fff; }
.toast.ok { background: var(--text); color: #fff; }

.controls {
  border: 0; margin: 0; padding: 12px 16px 16px; min-width: 0; min-height: 0;
  display: grid; grid-template-columns: 210px minmax(0, 1fr) minmax(360px, 30vw); gap: 16px;
}
.controls:disabled .work, .controls:disabled .nav, .controls:disabled .side-panels { opacity: 0.55; }
.nav, .work, .side { min-height: 0; overflow: auto; }

/* ---------- навигация ---------- */
.nav { display: flex; flex-direction: column; gap: 10px; }
.nav-group { display: grid; gap: 4px; }
.nav-head { font-size: 12px; font-weight: 700; color: var(--teal); text-transform: uppercase; letter-spacing: 0.04em; padding: 4px 8px 0; }
.nav-item {
  font: inherit; font-weight: 600; text-align: left; position: relative;
  padding: 10px 12px; min-height: 42px; border-radius: var(--r-s);
  border: 1px solid transparent; background: var(--card); color: var(--text); cursor: pointer;
}
.nav-item.sub { padding-left: 22px; }
.nav-item:hover { border-color: var(--teal); }
.nav-item.is-current { border-color: var(--text); background: var(--text); color: #fff; }
.nav-item.is-live:not(.is-current) { border-color: var(--teal); }
.live-dot { position: absolute; right: 10px; top: 50%; width: 9px; height: 9px; margin-top: -4px; border-radius: 50%; background: var(--accent); }
.nav-keys { font-size: 12px; color: var(--muted); padding: 4px 8px; line-height: 1.6; }
.nav-prep { margin-top: auto; }

/* ---------- центр ---------- */
.work { padding-right: 4px; }
.panel { background: var(--card); border-radius: var(--r); padding: 14px 16px; margin-bottom: 12px; }
.panel.layer.is-hl { box-shadow: inset 0 0 0 3px var(--accent); }
.hint-box { padding: 14px 16px; color: var(--muted); }
.empty { padding: 8px 0; }

.mx { display: grid; grid-template-columns: 150px repeat(3, minmax(0, 1fr)); gap: 6px; margin-bottom: 12px; }
.mx-head { font-weight: 700; color: var(--teal); padding: 2px 6px; }
.mx-layer { font-weight: 700; align-self: center; font-size: 14px; }
.mx-cell {
  font: inherit; text-align: left; cursor: pointer; position: relative;
  min-height: 64px; padding: 8px 10px; border-radius: var(--r-s);
  border: 2px solid transparent; background: var(--card);
  display: flex; flex-direction: column; gap: 2px;
}
.mx-cell:hover { border-color: var(--teal); }
.mx-cell.is-sel { border-color: var(--text); }
.mx-cell.m-focus { background: var(--accent); }
.mx-cell.m-cross { background: var(--coral-soft); }
.mx-count { font-family: "Inter Tight", sans-serif; font-weight: 800; font-size: 22px; line-height: 1; }
.mx-meta { font-size: 12px; color: var(--muted); }
.mk { font-size: 12px; font-weight: 700; }
.mk.cross { color: var(--coral); }
.mk.focus { background: var(--accent); padding: 0 4px; border-radius: 4px; }

.entries { display: grid; gap: 2px; margin: 4px 0 8px; }
.entry { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 6px 8px; border-radius: var(--r-s); }
.entry:nth-child(odd) { background: var(--plate); }
.entry.is-hidden .entry-text { color: var(--muted); font-style: italic; }
.entry.is-struck .etext { color: var(--muted); text-decoration: line-through; }
.entry.is-picked { background: var(--teal-soft); }
.entry.editing { background: var(--teal-soft); flex-wrap: wrap; }
.entry-text { flex: 1 1 240px; min-width: 0; }
.entry-acts { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.check {
  flex: none; width: 26px; height: 26px; border-radius: 6px; border: 2px solid var(--line);
  background: var(--card); cursor: pointer; font-weight: 800; color: var(--teal); padding: 0;
}
.check[aria-pressed="true"] { border-color: var(--teal); background: var(--teal); color: #fff; }
.dots { flex: none; display: inline-flex; align-items: center; gap: 1px; font-size: 16px; min-width: 48px; }
.dots.none { font-size: 12px; color: var(--muted); }
.dot.d-yes { color: var(--c-yes); }
.dot.d-part { color: var(--c-part); }
.dot.d-no { color: var(--c-no); }
.dot.d-unk { color: var(--c-unk); font-weight: 700; }
.people { margin-left: 4px; font-size: 13px; font-weight: 700; color: var(--muted); }
.tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 4px; background: var(--plate-2); color: var(--muted); vertical-align: 1px; }
.tag.live { background: var(--accent); color: var(--text); }
.add-entry { display: flex; gap: 8px; flex-wrap: wrap; }
.merge-bar, .merge-box { background: var(--teal-soft); border-radius: var(--r-s); padding: 8px 12px; margin: 6px 0; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.merge-box { display: grid; gap: 4px; }
.merge-title { font-weight: 700; }
.focus-box { border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: 10px; }
.focus-now { margin-bottom: 6px; }
.cross-box { margin-top: 8px; display: grid; gap: 6px; justify-items: start; }
.hl-row { margin-bottom: 12px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.chip { min-height: 34px; }
.chip.area.is-on { background: var(--accent); border-color: #c9c400; color: var(--text); }
.pair-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pair-head b { font-size: 17px; margin-right: 4px; }
.count { font-size: 13px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--plate-2); }
.count.ok { background: var(--ok-soft); color: var(--ok); }
.count.over { background: var(--coral); color: #fff; }
.warn-line { margin-top: 6px; color: var(--coral); font-weight: 700; }
.msg { margin-top: 8px; padding: 8px 12px; border-radius: var(--r-s); font-weight: 600; }
.msg.ok { background: var(--ok-soft); }
.msg.bad { background: var(--coral-soft); color: var(--coral); }
.code { font-family: "Inter Tight", sans-serif; font-weight: 800; font-size: 30px; letter-spacing: 0.12em; }

/* ---------- правая колонка ---------- */
.side { display: flex; flex-direction: column; gap: 12px; }
.mirror-box { position: relative; flex: none; }
.mirror-frame {
  position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden;
  border-radius: var(--r-s); background: var(--plate-2); box-shadow: 0 0 0 1px var(--line);
}
.mirror-frame iframe { position: absolute; top: 0; left: 0; width: 1920px; height: 1080px; border: 0; transform-origin: 0 0; pointer-events: none; }
.mirror-paused {
  position: absolute; left: 8px; top: 8px; padding: 6px 12px; border-radius: var(--r-s);
  background: var(--accent); font-weight: 800; font-size: 16px; box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}
body.is-paused .mirror-frame { box-shadow: 0 0 0 4px var(--accent); }
.side-panels .panel { margin-bottom: 0; }
.side-panels { display: grid; gap: 12px; }
.side-row { display: flex; align-items: center; gap: 6px; margin: 6px 0; flex-wrap: wrap; }
.side-row .label { width: 70px; margin: 0; }

@media (max-width: 1100px) {
  .controls { grid-template-columns: 170px minmax(0, 1fr); }
  .side { grid-column: 1 / -1; }
}
.row > textarea.inp { width: auto; flex: 1 1 auto; }

/* ---------- итерация 2: пульт зала, «в зале», замечание внизу, «Кто куда идёт» ---------- */
.remote { display: flex; flex-direction: column; gap: 6px; padding: 10px; border: 2px solid var(--teal); border-radius: 10px; background: #fff; }
.remote-now { font-size: 13px; }
.remote-row { display: flex; gap: 6px; }
.remote-arrow { flex: 1; font-size: 20px; }
.remote-show { width: 100%; }
.live-tag { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 6px; background: var(--teal); color: #fff; }
.nav-item { position: relative; }
.remark-contour { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 6px; }
.entry.remark.is-shown { box-shadow: inset 4px 0 0 var(--teal); }
.mx-names { font-size: 12px; line-height: 1.3; color: var(--text); text-align: left; }
.as-cell { align-items: flex-start; }
.person-row { padding: 10px 0; border-top: 1px solid var(--line, #e3e8ea); display: flex; flex-direction: column; gap: 6px; }

/* рекомендации */
.rec-row { display: flex; align-items: baseline; gap: 8px; padding: 6px 0; border-top: 1px solid var(--plate-2); flex-wrap: wrap; }
.rec-row:first-of-type { border-top: 0; }
.rec-row.is-edit { display: block; }
.rec-text { flex: 1 1 260px; min-width: 0; }
.rec-when { color: var(--teal, #2f6f80); font-weight: 600; white-space: nowrap; }
.rec-btns { display: inline-flex; gap: 4px; }
.rec-form { display: flex; flex-direction: column; gap: 6px; margin: 6px 0; }
.rec-form .row { flex-wrap: wrap; }
.rec-kind { width: 120px; } .rec-dir { width: 80px; } .rec-day { width: 110px; } .rec-time { width: 190px; } .rec-place { width: 140px; }
.rec-add { margin-top: 8px; } .rec-add summary { cursor: pointer; color: var(--muted); }

/* замечания в правой колонке: кнопки под текстом */
.side-remarks .entry { flex-direction: column; align-items: stretch; gap: 6px; }
.side-remarks .entry-acts { flex-wrap: wrap; justify-content: flex-start; }
.side-remarks .remark-contour { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: 4px; }
.side-sub { margin-top: 14px; }
.side-remarks .entry-text, .side-remarks .entry-acts { flex: none; }

/* шаги меню – одним блоком, без отступов между группами */
.nav-steps { display: grid; gap: 4px; }
.btn-cross.is-on { background: var(--coral); color: #fff; }

/* программа и QR */
.qr-row { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--plate-2); }
.qr-mini { width: 84px; height: 84px; flex: none; border-radius: 6px; }
.qr-mini-empty { display: flex; align-items: center; justify-content: center; border: 2px dashed var(--muted); color: var(--muted); font-weight: 700; }

/* статистика DAF */
.st-table { border-collapse: collapse; width: 100%; }
.st-table th, .st-table td { text-align: left; padding: 4px 8px 4px 0; font-weight: 600; }
.st-table thead th { font-weight: 500; color: var(--muted); font-size: 0.9em; }
.inp.st-num { width: 7em; }
.inp.st-name-inp { width: 10em; }
.st-note-field { display: flex; flex-direction: column; margin-top: 10px; }
.st-note-field .inp { width: 100%; }
