
:root {
  --bg: #0b1020; --card: #121a30; --card-2: #18223d; --line: #26314f; --text: #e8ecf6; --muted: #93a0bd;
  --mint: #43e0b2; --mint-ink: #062a20; --bad: #ff6b6b; --warn: #facc15; --live: #43e0b2;
  --r: 12px;
  color-scheme: dark;
}
* { box-sizing: border-box; }

[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.4 "Onest", "Inter", "Segoe UI", Arial, sans-serif; }
button, input, select { font: inherit; color: inherit; }
h1, h2 { margin: 0; font-weight: 700; }
h2 { font-size: 16px; }

.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 16px; padding: 10px 16px; background: rgba(11, 16, 32, .94); border-bottom: 1px solid var(--line); backdrop-filter: blur(6px); }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; flex: none; }
.show-title { flex: 1; min-width: 0; font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status { display: flex; align-items: center; gap: 14px; flex: none; color: var(--muted); font-size: 14px; }
.link-state { display: inline-flex; align-items: center; gap: 6px; }
.link-state i { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.link-state[data-state="online"] i { background: var(--mint); box-shadow: 0 0 0 3px rgba(67, 224, 178, .18); }
.link-state[data-state="offline"] i { background: var(--bad); animation: pulse 1s infinite; }
.link-state[data-state="offline"] { color: var(--bad); font-weight: 600; }
@keyframes pulse { 50% { opacity: .3; } }
.now { font-variant-numeric: tabular-nums; color: var(--text); font-weight: 600; }
.viewers { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border: 1px solid var(--line); border-radius: 99px; background: transparent; color: var(--muted); cursor: pointer; font-size: 13px; }
.viewers b { color: var(--text); }
.viewers.is-alert { border-color: var(--bad); color: #ffd7d7; }
.screens-warn { font-style: normal; font-weight: 700; color: var(--bad); }
.screens-pop { position: fixed; z-index: 9; top: 54px; right: 16px; width: min(380px, calc(100vw - 32px)); padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); box-shadow: 0 10px 30px rgba(0, 0, 0, .45); }
.screens-list { display: grid; gap: 6px; margin-bottom: 8px; }
.scr { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: center; font-size: 14px; }
.scr i { width: 9px; height: 9px; border-radius: 50%; background: var(--mint); }
.scr.is-off i { background: var(--bad); }
.scr b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.scr span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.scr.is-off span { color: #ffb4b4; }

.offline { margin: 0; padding: 10px 16px; background: #4a1414; color: #ffd7d7; font-weight: 600; text-align: center; }

.layout { display: grid; gap: 14px; padding: 14px 16px 40px; grid-template-columns: minmax(0, 1fr) minmax(320px, 440px); grid-template-areas: "program master" "custom master" "settings settings" "links links"; align-items: start; max-width: 1600px; margin: 0 auto; }

.master { grid-area: master; }
.program { grid-area: program; }
.custom { grid-area: custom; }
.settings { grid-area: settings; }
.links { grid-area: links; }

.kind-timer .program { display: none; }
.kind-timer .layout { grid-template-areas: "custom master" "settings settings" "links links"; }
@media (max-width: 980px) {
  .layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "master" "program" "custom" "settings" "links"; }
  .kind-timer .layout { grid-template-areas: "master" "custom" "settings" "links"; }
}
@media (max-width: 560px) {
  .top { flex-wrap: wrap; gap: 6px 12px; }
  .show-title { order: 3; flex-basis: 100%; }
  .status { margin-left: auto; }
}

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.hint-text { color: var(--muted); font-size: 13px; }
.master-src { font-size: 13px; color: var(--muted); padding: 2px 8px; border-radius: 99px; border: 1px solid var(--line); }
.master.is-live .master-src, .custom.is-master .master-src { color: var(--mint-ink); background: var(--mint); border-color: var(--mint); font-weight: 600; }
.custom.is-master { border-color: var(--mint); box-shadow: 0 0 0 1px var(--mint) inset; }

.preview-wrap { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; border: 1px solid var(--line);
  background: repeating-conic-gradient(#1a2238 0 25%, #141b2e 0 50%) 0 0 / 16px 16px; }
.preview { position: absolute; inset: 0; }
.master-label { min-height: 1.4em; margin: 8px 0 4px; color: var(--muted); font-size: 14px; }

.btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--card-2); color: var(--text); cursor: pointer; text-decoration: none; white-space: nowrap; font-weight: 600; font-size: 14px; }
.btn:hover:not(:disabled) { border-color: #3b4a72; background: #1e2a4a; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .4; cursor: default; }
.btn:focus-visible, .chip:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }
.btn-main { background: var(--mint); color: var(--mint-ink); border-color: var(--mint); }
.btn-main:hover:not(:disabled) { background: #5ff0c4; border-color: #5ff0c4; }
.btn-ghost { background: transparent; }
.btn-go { min-width: 58px; background: #12361f; border-color: #1f6b3d; color: #b6f5cd; letter-spacing: .04em; }
.btn-go:hover:not(:disabled) { background: #185a30; border-color: #2a8a50; }
.master-btns .btn { flex: 1 1 auto; }

.message { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.message-row { display: flex; gap: 6px; }
.message-row input { flex: 1; min-width: 0; }
input[type="text"], input[type="number"], select { min-height: 36px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: #0d1427; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 4px 10px; border-radius: 99px; border: 1px solid var(--line); background: transparent; color: var(--text); cursor: pointer; font-size: 13px; }
.chip:hover { border-color: var(--mint); }
.check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.message-state { color: var(--mint); font-size: 13px; font-weight: 600; }

.table-wrap { overflow-x: auto; margin: 0 -14px; padding: 0 14px; }
.rows { width: 100%; border-collapse: collapse; }
.rows th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.rows td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.rows .c-n { width: 34px; color: var(--muted); }
.rows .c-t { width: 64px; font-variant-numeric: tabular-nums; }
.rows .c-speaker { font-weight: 600; min-width: 140px; }
.rows .c-title { color: #c9d1e4; min-width: 160px; }
.rows .c-timer { width: 1%; }
.row-note { color: var(--muted); font-size: 13px; margin-top: 2px; }
.rows tr.section td { padding-top: 16px; font-weight: 700; color: var(--mint); border-bottom-color: transparent; }
.rows tr.is-now td:first-child { box-shadow: inset 3px 0 0 var(--muted); }
.rows tr.is-past { opacity: .62; }
.rows tr.is-master { background: rgba(67, 224, 178, .1); opacity: 1; }
.rows tr.is-master td:first-child { box-shadow: inset 4px 0 0 var(--mint); }
.rows tr.is-master .btn-go { background: var(--mint); color: var(--mint-ink); border-color: var(--mint); }
.rt { display: flex; align-items: center; gap: 10px; justify-content: flex-end; }
.rt-text { display: grid; justify-items: end; }
.rt-value { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 18px; color: #22c55e; white-space: nowrap; }
.rt-value[data-phase="warn"] { color: var(--warn); }
.rt-value[data-phase="danger"] { color: #f97316; }
.rt-value[data-phase="end"] { color: var(--bad); }
.rt-note { font-size: 12px; color: var(--muted); white-space: nowrap; }
.rows tr.is-future .rt-value { color: #8fd8a8; }
.rows tr.is-past .rt-value { color: var(--muted); }

.custom-grid { display: grid; grid-template-columns: auto minmax(110px, 160px) 1fr; gap: 10px; align-items: center; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg label { padding: 7px 10px; cursor: pointer; font-size: 14px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { background: var(--card-2); color: var(--mint); font-weight: 600; }
.seg label:has(input:focus-visible) { outline: 2px solid var(--mint); outline-offset: -2px; }
.time-input { font-size: 18px; font-variant-numeric: tabular-nums; width: 100%; }
.custom-value { justify-self: end; font-size: 34px; font-weight: 700; font-variant-numeric: tabular-nums; color: #22c55e; }
.custom-value[data-phase="idle"] { color: var(--text); }
.custom-value[data-phase="warn"] { color: var(--warn); }
.custom-value[data-phase="danger"] { color: #f97316; }
.custom-value[data-phase="end"] { color: var(--bad); }
.custom .chips { margin-top: 10px; }
@media (max-width: 560px) { .custom-grid { grid-template-columns: 1fr 1fr; } .seg { grid-column: 1 / -1; justify-self: start; } }

details.card > summary { list-style: none; cursor: pointer; display: flex; align-items: baseline; gap: 12px; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::before { content: "▸"; color: var(--muted); transition: transform .15s; display: inline-block; }
details.card[open] > summary::before { transform: rotate(90deg); }
.settings-body { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin-top: 12px; }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px 12px; margin: 0; display: grid; gap: 8px; align-content: start; }
legend { padding: 0 6px; color: var(--mint); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
.set { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 8px; font-size: 14px; }
.set[hidden] { display: none; }
.set-check { grid-template-columns: auto 1fr; cursor: pointer; }
.set-name { color: #c9d1e4; }
.set input[type="color"] { width: 44px; height: 30px; padding: 0 2px; border: 1px solid var(--line); border-radius: 6px; background: #0d1427; cursor: pointer; }
.set input[type="number"] { width: 84px; }
.set input[type="range"] { width: 130px; accent-color: var(--mint); }
.set input[type="checkbox"], .check input { width: 18px; height: 18px; accent-color: var(--mint); }
.set select, .set input[type="text"] { max-width: 200px; }
.set-out { min-width: 26px; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; }

.links-body { display: grid; gap: 14px; margin-top: 12px; }
.link-title { font-weight: 600; margin-bottom: 4px; }
.link-box { display: flex; gap: 6px; }
.link-box input { flex: 1; min-width: 0; font-family: Consolas, "Courier New", monospace; font-size: 13px; }
.link-note { color: var(--muted); font-size: 13px; margin-top: 4px; }

.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 20; padding: 10px 16px; border-radius: 10px; background: #1f2a47; border: 1px solid #34426a; box-shadow: 0 8px 30px rgba(0, 0, 0, .4); font-weight: 600; max-width: calc(100vw - 32px); }
.toast.is-bad { background: #4a1414; border-color: #7a2323; color: #ffe1e1; }


.index-main { max-width: 760px; margin: 0 auto; padding: 32px 16px; }
.index-list { display: grid; gap: 12px; padding: 0; list-style: none; }
.index-list li { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.index-list a { color: var(--mint); }
code { background: #0d1427; padding: 2px 6px; border-radius: 4px; }


.adj { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 10px; }
.btn-sm { min-height: 30px; min-width: 34px; padding: 3px 7px; font-size: 13px; border-radius: 7px; font-variant-numeric: tabular-nums; }
.adj-unit { color: var(--muted); font-size: 13px; padding: 0 2px; }
.adj-n { display: inline-flex; align-items: center; gap: 0; margin-left: 6px; }
.adj-n .btn-sm:first-child { border-radius: 7px 0 0 7px; }
.adj-n .btn-sm:last-child { border-radius: 0 7px 7px 0; }
.step-input { width: 54px; min-height: 30px; padding: 3px 4px; border: 1px solid var(--line); border-left: 0; border-right: 0; border-radius: 0; background: #0d1427; text-align: center; font-size: 13px; -moz-appearance: textfield; }
.step-input::-webkit-inner-spin-button, .step-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

.presets { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; }
.presets .chips { margin: 0; }
.chip-edit { color: var(--muted); border-style: dashed; }
.presets-editor { display: grid; gap: 6px; margin-top: 8px; padding: 10px; border: 1px dashed var(--line); border-radius: 10px; font-size: 13px; color: var(--muted); }


@media (max-width: 640px) {
  .table-wrap { overflow: visible; margin: 0; padding: 0; }
  .rows, .rows tbody { display: block; }
  .rows thead { display: none; }
  .rows tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "n timer" "speaker timer" "title timer"; column-gap: 10px; row-gap: 2px; padding: 10px 8px; border-bottom: 1px solid var(--line); }
  .rows tr.section { display: block; padding: 14px 8px 4px; border-bottom: 0; }
  .rows tr.section td { padding: 0; }
  .rows td { padding: 0; border: 0; min-width: 0; }
  .rows td.c-t { display: none; }
  .rows td.c-n { grid-area: n; width: auto; font-size: 13px; }
  .rows td.c-n::after { content: " · " attr(data-time); font-variant-numeric: tabular-nums; }
  .rows td.c-speaker { grid-area: speaker; min-width: 0; }
  .rows td.c-title { grid-area: title; min-width: 0; font-size: 14px; }
  .rows td.c-timer { grid-area: timer; align-self: center; width: auto; }
  .rows tr.is-now td:first-child, .rows tr.is-master td:first-child { box-shadow: none; }
  .rows tr.is-now { box-shadow: inset 3px 0 0 var(--muted); }
  .rows tr.is-master { box-shadow: inset 4px 0 0 var(--mint); }
  .rt { flex-direction: column; align-items: flex-end; gap: 4px; }
}


.index .top .show-title { color: var(--muted); }
.login { max-width: 480px; margin: 8vh auto 0; display: grid; gap: 12px; }
.login-form { display: grid; gap: 10px; }
.login-form input[type="password"] { font-size: 16px; min-height: 42px; }
.login-error { color: var(--bad); font-weight: 600; min-height: 1.4em; }
.show-list { display: grid; gap: 12px; }
.show-card { display: grid; gap: 8px; }
.show-head { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.show-name { font-size: 18px; min-width: 0; overflow-wrap: anywhere; }
.rename-form { display: flex; gap: 6px; flex-wrap: wrap; }
.rename-form input { flex: 1 1 240px; min-width: 0; font-size: 16px; }
.show-meta { color: var(--muted); font-size: 14px; }
.show-links { margin-top: 2px; }
.index-main a:not(.btn) { color: var(--mint); }


.program .card-head .hint-text { margin-left: auto; }
.edit-hint { margin: -4px 0 10px; padding: 8px 10px; border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); font-size: 13px; }
.ed { width: 100%; min-height: 32px; padding: 4px 8px; border-radius: 6px; border: 1px solid var(--line); background: #0d1427; }
.ed:focus { border-color: var(--mint); outline: none; }
.ed-time { width: 72px; font-variant-numeric: tabular-nums; text-align: center; }
.mv { display: flex; gap: 4px; justify-content: flex-end; }
.program.is-editing .rows tr.section td { padding-top: 10px; }
@media (max-width: 640px) {
  .program.is-editing .rows tr { grid-template-columns: auto auto 1fr auto; grid-template-areas: "n n n timer" "start end . timer" "speaker speaker speaker speaker" "title title title title"; row-gap: 6px; }
  .program.is-editing .rows td.c-t { display: block; }
  .program.is-editing .rows td.c-start { grid-area: start; }
  .program.is-editing .rows td.c-end { grid-area: end; }
  .program.is-editing .rows td.c-n::after { content: none; }
  .program.is-editing .rows tr.section { display: flex; gap: 8px; align-items: center; }
  .program.is-editing .rows tr.section td.c-section { flex: 1; }
  .program.is-editing .mv { display: grid; grid-template-columns: repeat(2, auto); }
}


.qr-dialog { width: min(360px, calc(100vw - 32px)); padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); color: var(--text); }
.qr-dialog::backdrop { background: rgba(5, 8, 18, .7); }
.qr-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.qr-seg { margin-bottom: 12px; }
.qr-box { display: grid; place-items: center; padding: 10px; border-radius: 10px; background: #fff; }
.qr-box svg { display: block; width: 100%; max-width: 280px; height: auto; }
.qr-host { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.qr-url { margin-top: 10px; font: 12px/1.35 Consolas, "Courier New", monospace; color: var(--muted); overflow-wrap: anywhere; }
.qr-warn { margin: 10px 0 0; font-size: 13px; color: var(--warn); }


.paste-dialog { width: min(820px, calc(100vw - 32px)); max-height: calc(100vh - 40px); padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); color: var(--text); }
.paste-dialog::backdrop { background: rgba(5, 8, 18, .7); }
.paste-dialog textarea { width: 100%; margin: 8px 0; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: #0d1427; color: var(--text); font: 13px/1.4 Consolas, "Courier New", monospace; resize: vertical; }
.paste-issues { display: grid; gap: 2px; font-size: 13px; max-height: 120px; overflow: auto; }
.paste-issue.is-error { color: var(--bad); }
.paste-issue.is-warning { color: var(--warn); }
.paste-issue.is-info { color: var(--muted); }
.paste-preview { margin-top: 8px; max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.paste-preview:empty { display: none; }
.pp-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) minmax(0, 1.4fr); gap: 10px; padding: 5px 10px; border-bottom: 1px solid var(--line); font-size: 14px; }
.pp-row > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-section { display: block; color: var(--mint); font-weight: 700; }
.pp-time { font-variant-numeric: tabular-nums; color: var(--muted); }
.paste-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
@media (max-width: 560px) { .pp-row { grid-template-columns: 90px minmax(0, 1fr); } .pp-row > :last-child { grid-column: 2; } }


.grip { cursor: grab; padding: 0 6px; color: var(--muted); font-weight: 700; user-select: none; align-self: center; letter-spacing: -2px; }
.grip:active { cursor: grabbing; }
.rows tr.is-dragging { opacity: .45; }
.rows tr.is-drop-before > td { box-shadow: inset 0 3px 0 var(--mint); }
.rows tr.is-drop-after > td { box-shadow: inset 0 -3px 0 var(--mint); }
@media (hover: none) { .grip { display: none; } }


body.is-gone .layout { opacity: .35; pointer-events: none; }


.list-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 12px; }
.list-head .hint-text { margin: 0; }
.create-form { display: grid; gap: 10px; }
.field { display: grid; gap: 4px; font-size: 14px; color: #c9d1e4; }
.field input[type="text"], .field select { font-size: 15px; }
.field input[type="date"] { min-height: 36px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: #0d1427; color: var(--text); color-scheme: dark; font-size: 15px; }
.field-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 10px; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }
.create-form textarea { width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: #0d1427; color: var(--text); font: 13px/1.4 Consolas, "Courier New", monospace; resize: vertical; }
.show-card.is-new { border-color: var(--mint); box-shadow: 0 0 0 1px var(--mint) inset; }
.admin-h { margin: 28px 0 12px; font-size: 18px; display: flex; gap: 10px; align-items: baseline; }
.demo-note { margin: 0; padding: 8px 16px; background: #123a35; color: #d6fbef; font-size: 14px; text-align: center; line-height: 1.4; }
.demo-note a { color: var(--mint); font-weight: 700; margin-left: 4px; }

header.okv-topbar,header.top{flex-wrap:wrap}[data-languages]{display:flex;flex-wrap:wrap;gap:12px;font-size:13px}[data-languages] a[aria-current]{color:var(--mint,#22c55e);font-weight:700}#pilot{overflow-x:auto}#pilot table{border-collapse:collapse}#pilot th,#pilot td{padding:6px 10px;text-align:left}
