:root {
  /* Kaengom Production brand: navy #2E3A8F, red #E8202A, near-black text on white */
  --navy: #1f2766;
  --navy-2: #2e3a8f;
  --red: #e8202a;
  --bg: #f4f6fb;
  --panel: #ffffff;
  --panel-2: #f7f8fc;
  --panel-3: #eef1f8;
  --line: #e3e7f0;
  --line-2: #d3d9e6;
  --text: #111827;
  --text-2: #374151;
  --muted: #5b6478;
  --faint: #8a93a6;
  --accent: #3b4bb5;
  --accent-2: #2e3a8f;
  --live: #e8202a;
  --ok: #16a34a;
  --warn: #d97706;
  --pv: #16a34a;
  --well: #e2e6ef;
  --ok-bg: #e8f6ed; --ok-line: #b5e0c3; --ok-text: #166534;
  --warn-bg: #fff6e0; --warn-line: #f1d38c; --warn-text: #8a5300;
  --bad-bg: #fdecec; --bad-line: #f4b9bc; --bad-text: #b4141e;
  --info-bg: #eaedfa; --info-line: #c7cdee; --info-text: #2e3a8f;
  --radius: 12px;
  --font: "Segoe UI", "Leelawadee UI", "Noto Sans Thai", system-ui, -apple-system, sans-serif;
  --mono: "Cascadia Mono", Consolas, "SF Mono", monospace;
  --side-w: 236px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
body { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea { color-scheme: light; }
a { color: var(--accent); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }
p { margin: 0; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-family: var(--mono); }
.num { font-variant-numeric: tabular-nums; }
.sp { flex: 1; }
.hidden { display: none !important; }
.boot { display: grid; place-items: center; height: 100vh; color: var(--muted); }
::selection { background: rgba(46, 58, 143, .22); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #c7cedc; border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

.ic { width: 18px; height: 18px; flex: none; vertical-align: -4px; }
.ic.sm { width: 15px; height: 15px; vertical-align: -3px; }
.ic.lg { width: 22px; height: 22px; }

/* ── Shell ───────────────────────────── */
.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); height: 100vh; height: 100dvh; }
.side { background: var(--navy); border-right: 1px solid var(--navy); color: #fff; display: flex; flex-direction: column; min-height: 0; }
.brand { display: grid; gap: 6px; padding: 14px 14px 10px; }
.brand-plate { background: #fff; border-radius: 12px; padding: 10px 12px; display: grid; place-items: center; box-shadow: 0 4px 14px rgba(0, 0, 0, .18); }
.brand-plate img { width: 100%; max-width: 190px; height: auto; display: block; }
.brand b { display: block; font-size: 13px; color: #fff; padding: 0 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand small { color: rgba(255, 255, 255, .6); font-size: 11.5px; padding: 0 4px; }
.side .brand b { margin-top: 4px; }
.nav { flex: 1; overflow-y: auto; padding: 4px 10px 16px; }
.nav h6 { margin: 16px 8px 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: rgba(255, 255, 255, .5); font-weight: 700; display: flex; align-items: center; }
.nav h6 button { margin-left: auto; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; color: rgba(255, 255, 255, .8); font-weight: 500; position: relative; }
.nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.nav a.on { background: rgba(255, 255, 255, .15); color: #fff; }
.nav a.on::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 4px; border-radius: 3px; background: var(--red); }
.nav a .tag { margin-left: auto; font-size: 11px; color: rgba(255, 255, 255, .55); }
.side .icon-btn { color: rgba(255, 255, 255, .7); }
.side .icon-btn:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.nav a .dot { margin-left: auto; }
.nav a .em { width: 18px; text-align: center; font-size: 15px; }
.side-foot { border-top: 1px solid rgba(255, 255, 255, .12); padding: 10px 14px; font-size: 12px; color: rgba(255, 255, 255, .65); }
.side-foot .muted { color: rgba(255, 255, 255, .5); }
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.top { height: 58px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 18px; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .94); backdrop-filter: blur(8px); }
.top h1 { font-size: 17px; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.status { display: flex; gap: 6px; margin-left: auto; align-items: center; flex-wrap: nowrap; overflow: hidden; }
.top-clock { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 600; min-width: 64px; text-align: right; }
.user-btn { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--navy-2); color: #fff; font-weight: 700; cursor: pointer; font-size: 13px; }
.view { flex: 1; overflow: auto; padding: 20px; min-height: 0; position: relative; }
.view.flush { padding: 0; }
.offline { background: var(--warn-bg); color: var(--warn-text); border-bottom: 1px solid var(--warn-line); text-align: center; padding: 6px; font-size: 13px; font-weight: 600; }
.scrim { display: none; }
.only-m { display: none !important; }

@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; z-index: 50; top: 0; bottom: 0; left: 0; width: 270px; transform: translateX(-100%); transition: transform .2s; }
  .app.nav-open .side { transform: none; box-shadow: 0 0 60px rgba(17, 24, 39, .35); }
  .app.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(17, 24, 39, .4); }
  .only-m { display: inline-flex !important; }
  .top { padding: 0 10px; gap: 8px; }
  .top-clock { display: none; }
  .status .pill.opt { display: none; }
  .view { padding: 14px; }
}
@media (min-width: 901px) { .app.focus { grid-template-columns: minmax(0, 1fr); } .app.focus .side { display: none; } }
.app.kiosk { grid-template-columns: minmax(0, 1fr); }
.app.kiosk .side, .app.kiosk .top { display: none; }
.app.kiosk .view { padding: 10px; }

/* ── Pills & dots ───────────────────────────── */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); font-size: 12px; font-weight: 650; letter-spacing: .02em; white-space: nowrap; color: var(--text-2); font-variant-numeric: tabular-nums; }
.pill.live { background: var(--live); border-color: var(--live); color: #fff; }
.pill.rec { background: var(--bad-bg); border-color: var(--bad-line); color: var(--bad-text); }
.pill.ok { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok-text); }
.pill.warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn-text); }
.pill.bad { background: var(--bad-bg); border-color: var(--bad-line); color: var(--bad-text); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); display: inline-block; flex: none; }
.dot.ok { background: var(--ok); box-shadow: 0 0 8px rgba(34, 197, 94, .6); }
.dot.live { background: var(--live); box-shadow: 0 0 8px rgba(232, 32, 42, .6); animation: blink 1.2s infinite; }
.dot.warn { background: var(--warn); }
.dot.bad { background: var(--live); }
.pill.live .dot { background: #fff; box-shadow: none; }
@keyframes blink { 50% { opacity: .35; } }

/* ── Buttons & inputs ───────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--line-2); background: #fff; color: var(--text); font-weight: 600; cursor: pointer; white-space: nowrap; user-select: none; transition: background .12s, border-color .12s, transform .05s; text-decoration: none; }
.btn:hover { background: #f1f3f9; border-color: #b9c1d4; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }
.btn.primary:hover { background: var(--accent); }
.btn.danger { background: #c4141e; border-color: #c4141e; color: #fff; }
.btn.danger:hover { background: #db1f29; }
.btn.live { background: var(--live); border-color: var(--live); color: #fff; }
.btn.live:hover { background: #f5333c; }
.btn.ok { background: #15803d; border-color: #15803d; color: #fff; }
.btn.ok:hover { background: #17924a; }
.btn.warn { background: #b45309; border-color: #b45309; color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--panel-3); }
.btn.outline { background: transparent; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn.lg { height: 46px; padding: 0 20px; font-size: 15px; border-radius: 11px; }
.btn.xl { height: 64px; padding: 0 28px; font-size: 19px; border-radius: 14px; font-weight: 750; }
.btn.block { width: 100%; }
.btn.on { background: var(--accent-2); border-color: var(--accent); color: #fff; }
.icon-btn { width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 8px; border: 0; background: transparent; color: var(--muted); cursor: pointer; flex: none; }
.icon-btn:hover { background: var(--panel-3); color: var(--text); }
.icon-btn.sm { width: 28px; height: 28px; }
.icon-btn.danger:hover { color: #c4141e; }

input[type=text], input[type=password], input[type=number], input[type=url], input[type=search], input[type=datetime-local], input[type=time], input:not([type]), select, textarea {
  width: 100%; height: 38px; padding: 0 11px; border-radius: 9px; border: 1px solid var(--line-2); background: #fff; color: var(--text); outline: none; transition: border-color .12s, box-shadow .12s;
}
textarea { height: auto; min-height: 90px; padding: 9px 11px; resize: vertical; line-height: 1.45; }
textarea.code { font-family: var(--mono); font-size: 12.5px; min-height: 160px; tab-size: 2; white-space: pre; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(46, 58, 143, .16); }
input::placeholder, textarea::placeholder { color: #9aa3b5; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #8b94a8 50%), linear-gradient(135deg, #8b94a8 50%, transparent 50%); background-position: calc(100% - 16px) 16px, calc(100% - 11px) 16px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 28px; }
input[type=color] { width: 42px; height: 38px; padding: 3px; border-radius: 9px; border: 1px solid var(--line-2); background: #fff; cursor: pointer; }
input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--accent); }
input[type=range] { accent-color: var(--accent); width: 100%; }
label.field { display: grid; gap: 6px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
label.field > span small { font-weight: 400; color: var(--faint); }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 500; color: var(--text); }
.input-row { display: flex; gap: 6px; }
.input-row > input, .input-row > select { flex: 1; min-width: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-stack { display: grid; gap: 12px; }
.hint { font-size: 12px; color: var(--muted); font-weight: 400; }
.err-text { color: var(--bad-text); font-size: 13px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }

.switch { position: relative; width: 40px; height: 23px; flex: none; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: #cbd2e0; transition: .15s; cursor: pointer; }
.switch i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(17, 24, 39, .25); transition: .15s; }
.switch input:checked + i { background: var(--ok); }
.switch input:checked + i::after { transform: translateX(17px); background: #fff; }

/* ── Cards & layout ───────────────────────────── */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; min-width: 0; box-shadow: 0 1px 2px rgba(17, 24, 39, .04); }
.card > h3, .card-head h3 { font-size: 14px; display: flex; align-items: center; gap: 8px; }
.card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; min-height: 30px; }
.card-head .sp + * { margin-left: 0; }
.card.pad-0 { padding: 0; }
.stack { display: grid; gap: 16px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.nowrap { flex-wrap: nowrap; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1100px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); } }
.page-head { display: flex; align-items: flex-end; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h2 { font-size: 22px; color: var(--navy); }
.page-head p { color: var(--muted); margin-top: 3px; }
.page-head .row { margin-left: auto; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-variant-numeric: tabular-nums; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stats { display: flex; gap: 6px; flex-wrap: wrap; }
.stat { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; min-width: 92px; }
.stat b { display: block; font-size: 17px; font-variant-numeric: tabular-nums; }
.stat span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.stat.bad b { color: var(--bad-text); }
.stat.warn b { color: var(--warn-text); }
.empty { text-align: center; padding: 34px 16px; color: var(--muted); border: 1px dashed var(--line-2); border-radius: var(--radius); }
.empty h3 { color: var(--text); margin-bottom: 6px; }
.empty .btn { margin-top: 14px; }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; background: var(--info-bg); border: 1px solid var(--info-line); color: var(--info-text); font-size: 13px; }
.notice.warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn-text); }
.notice.bad { background: var(--bad-bg); border-color: var(--bad-line); color: var(--bad-text); }
.bar { height: 7px; background: var(--well); border-radius: 9px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 9px; transition: width .3s; }
.bar.ok > i { background: var(--ok); }
.copy-row { min-width: 0; display: flex; align-items: center; gap: 6px; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 9px; padding: 0 4px 0 11px; height: 38px; }
.copy-row code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: 12.5px; color: var(--text-2); }
.badge { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 6px; font-size: 11px; font-weight: 700; background: var(--panel-3); color: var(--text-2); letter-spacing: .02em; white-space: nowrap; }
.badge.live { background: var(--live); color: #fff; }
.badge.ok { background: var(--ok-bg); color: var(--ok-text); }
.badge.warn { background: var(--warn-bg); color: var(--warn-text); }
.badge.bad { background: var(--bad-bg); color: var(--bad-text); }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .r { text-align: right; }
.tbl .c { text-align: center; }
.tbl-wrap { overflow-x: auto; }
details > summary { cursor: pointer; color: var(--muted); font-weight: 600; font-size: 13px; }
pre.log { background: #0f172a; border: 1px solid var(--line); border-radius: 9px; padding: 10px; font: 12px/1.5 var(--mono); color: #aeb8cc; max-height: 260px; overflow: auto; white-space: pre-wrap; word-break: break-all; margin: 8px 0 0; }

/* ── Modal, toast, menu ───────────────────────────── */
.modal-wrap { position: fixed; inset: 0; z-index: 100; background: rgba(17, 24, 39, .45); display: grid; place-items: center; padding: 16px; animation: fade .12s; }
.modal { width: min(560px, 100%); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line-2); border-radius: 16px; box-shadow: 0 30px 80px rgba(17, 24, 39, .28); animation: pop .15s; }
.modal.wide { width: min(980px, 100%); }
.modal.mid { width: min(720px, 100%); }
.modal > header { display: flex; align-items: center; gap: 10px; padding: 14px 16px 12px 20px; border-bottom: 1px solid var(--line); }
.modal > header h3 { font-size: 16px; flex: 1; color: var(--navy); }
.modal-body { padding: 18px 20px; overflow: auto; }
.modal > footer { display: flex; gap: 8px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: scale(.97); opacity: 0; } }
#toasts { position: fixed; z-index: 200; bottom: 16px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; justify-items: center; pointer-events: none; width: min(520px, calc(100vw - 32px)); }
.toast { background: var(--navy); color: #fff; border: 1px solid var(--navy); padding: 10px 16px; border-radius: 10px; box-shadow: 0 12px 30px rgba(17, 24, 39, .3); font-weight: 600; animation: pop .15s; max-width: 100%; }
.toast.err { background: #b4141e; border-color: #b4141e; color: #fff; }
.toast.ok { background: #166534; border-color: #166534; color: #fff; }
.menu { position: fixed; z-index: 120; min-width: 190px; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 11px; padding: 6px; box-shadow: 0 18px 50px rgba(17, 24, 39, .22); animation: pop .1s; }
.menu button, .menu a { display: flex; width: 100%; align-items: center; gap: 9px; text-align: left; padding: 8px 10px; border: 0; border-radius: 7px; background: none; color: var(--text); cursor: pointer; font-weight: 500; }
.menu button:hover, .menu a:hover { background: var(--panel-3); }
.menu .danger { color: var(--bad-text); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 5px 2px; }
.menu .menu-head { padding: 6px 10px 8px; font-size: 12px; color: var(--muted); }
.menu .menu-head b { display: block; color: var(--text); font-size: 14px; }

/* ── Login ───────────────────────────── */
.login-wrap { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 20px; background: radial-gradient(1200px 520px at 50% -10%, #dfe4f7 0%, transparent 62%), var(--bg); overflow: auto; }
.login { width: min(400px, 100%); padding: 28px; display: grid; gap: 14px; }
.login .brand { padding: 0 0 6px; }
.login-logo { width: 100%; max-width: 300px; height: auto; display: block; margin: 0 auto 6px; }
.login h2 { color: var(--navy); }
.login h2 { font-size: 20px; }
.login p { color: var(--muted); font-size: 13px; }

/* ── Dashboard ───────────────────────────── */
.dash { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.dash > .card { grid-column: span 4; }
.dash > .card.w6 { grid-column: span 6; }
.dash > .card.w8 { grid-column: span 8; }
.dash > .card.w12 { grid-column: span 12; }
@media (max-width: 1200px) { .dash > .card, .dash > .card.w8 { grid-column: span 6; } }
@media (max-width: 760px) { .dash > .card, .dash > .card.w6, .dash > .card.w8 { grid-column: span 12; } }
.onair { display: grid; gap: 12px; align-content: start; }
.onair-big { font-size: 34px; font-weight: 800; letter-spacing: .04em; color: var(--faint); }
.onair.is-live { background: linear-gradient(160deg, #e8202a, #a50f18 75%); border-color: #c4141e; color: #fff; }
.onair.is-live .muted, .onair.is-live .hint { color: rgba(255, 255, 255, .8); }
.onair.is-live .onair-big { color: #fff; display: flex; align-items: center; gap: 12px; }
.onair .tc { font-size: 44px; font-weight: 300; font-variant-numeric: tabular-nums; letter-spacing: .02em; line-height: 1; }
.onair.is-live .tc { color: #fff; }
.list-mini { display: grid; gap: 8px; }
.list-mini .li { display: flex; align-items: center; gap: 10px; min-width: 0; }
.list-mini .li .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act-log { display: grid; gap: 4px; max-height: 300px; overflow: auto; font-size: 13px; }
.act-log div { display: flex; gap: 10px; }
.act-log time { color: var(--faint); font-variant-numeric: tabular-nums; flex: none; }
.act-log b { color: var(--navy-2); font-weight: 600; }
.mini-score { display: flex; align-items: center; justify-content: center; gap: 16px; font-size: 40px; font-weight: 800; font-variant-numeric: tabular-nums; }
.mini-score small { font-size: 13px; color: var(--muted); font-weight: 700; display: block; text-align: center; letter-spacing: .05em; }

/* ── Destinations ───────────────────────────── */
.dest { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel-2); }
.dest + .dest { margin-top: 8px; }
.dest.off { opacity: .55; }
.plat { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; color: #fff; font-size: 13px; }
.dest .info b { display: block; }
.dest .info small { color: var(--muted); font-family: var(--mono); font-size: 12px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dest .err-text { font-size: 12px; margin-top: 3px; }
@media (max-width: 640px) { .dest { grid-template-columns: auto minmax(0, 1fr); } .dest .acts { grid-column: 1 / -1; } }

/* ── Stream control ───────────────────────────── */
.ctl-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.ctl-bar .tc { font-size: 22px; font-variant-numeric: tabular-nums; font-weight: 600; min-width: 100px; }
.monitors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.monitors.one { grid-template-columns: minmax(0, 1fr); max-width: 980px; }
.mon { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: 10px; overflow: hidden; border: 3px solid #333c50; }
.mon.pgm { border-color: var(--live); }
.mon.pvw { border-color: var(--pv); }
.mon img { width: 100%; height: 100%; object-fit: contain; display: block; }
.mon .lbl { position: absolute; left: 8px; top: 8px; color: #fff; background: rgba(0, 0, 0, .7); padding: 3px 9px; border-radius: 6px; font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.recdir { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: -6px 0 16px; min-width: 0; }
.recdir code { font: 12.5px var(--mono); color: var(--text-2); background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 7px; padding: 4px 9px; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-folder .recdir { margin: 0 0 14px; }
.fp { margin-top: 12px; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; }
.fp-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px; background: var(--panel-2); border-bottom: 1px solid var(--line-2); }
.fp-bar .btn.on { border-color: var(--accent); background: var(--info-bg); color: var(--info-text); }
.fp-list { max-height: 300px; overflow: auto; padding: 4px; display: grid; }
.fp-list .muted { padding: 14px; }
.fp-row { display: flex; align-items: center; gap: 8px; text-align: left; border: 0; background: none; color: var(--text); padding: 8px 10px; border-radius: 7px; cursor: pointer; font: inherit; }
.fp-row:hover { background: var(--panel-3); }
.mon-rate { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin: -6px 0 16px; }
.mon-rate .seg button { height: 28px; font-size: 12px; padding: 0 10px; }
.mon.pgm .lbl { background: var(--live); }
.mon.pvw .lbl { background: #15803d; }
.scenes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.scene { min-height: 64px; padding: 10px; border-radius: 10px; border: 2px solid var(--line-2); background: var(--panel-2); font-weight: 650; cursor: pointer; text-align: left; display: flex; align-items: flex-end; line-height: 1.25; word-break: break-word; }
.scene:hover { border-color: #9aa6c4; }
.scene.pgm { border-color: var(--live); background: var(--bad-bg); }
.scene.pvw { border-color: var(--pv); background: var(--ok-bg); }
.scenes.thumbs { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.scenes.thumbs .scene { padding: 0; display: grid; align-items: stretch; overflow: hidden; min-height: 0; }
.scenes.thumbs .scene img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #05070b; }
.scenes.thumbs .scene span { padding: 6px 9px 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scenes.thumbs .scene.pgm span { background: var(--live); color: #fff; }
.scenes.thumbs .scene.pvw span { background: #15803d; color: #fff; }
.mixer { display: grid; gap: 10px; }
.ch { display: grid; grid-template-columns: minmax(110px, 180px) minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); }
.ch .nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch .nm small { display: block; color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.ch.muted { opacity: .7; }
.ch .vol { display: grid; gap: 5px; }
.meter { height: 9px; border-radius: 4px; background: #1f2937; position: relative; overflow: hidden; container-type: inline-size; }
.meter i { position: absolute; left: 0; top: 0; height: 4px; width: 0; background: linear-gradient(90deg, #22c55e 0 70%, #eab308 70% 88%, #ef4444 88%); background-size: 100cqw 100%; transition: width .07s linear; }
.meter i + i { top: 5px; }
.ch.muted .meter i { filter: grayscale(1) brightness(.6); }
.mute-btn { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel-3); cursor: pointer; display: grid; place-items: center; color: var(--text-2); }
.mute-btn.on { background: #c4141e; border-color: #c4141e; color: #fff; }
.src-list { display: grid; gap: 6px; }
.src { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 12px; border-radius: 9px; background: var(--panel-2); border: 1px solid var(--line); }
.src span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.src.off span { color: var(--faint); text-decoration: line-through; }
@media (max-width: 760px) { .monitors { grid-template-columns: minmax(0, 1fr); } .ch { grid-template-columns: minmax(0, 1fr) auto; } .ch .vol { grid-column: 1 / -1; grid-row: 2; } }

/* ── Scoreboard control ───────────────────────────── */
.sb-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 360px) minmax(0, 1fr); gap: 14px; align-items: start; }
@media (max-width: 1100px) { .sb-wrap { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .sb-wrap > [data-part="center"] { grid-column: 1 / -1; grid-row: 1; } }
@media (max-width: 640px) { .sb-wrap { grid-template-columns: minmax(0, 1fr); } }
.team { border-top: 5px solid var(--tc); display: grid; gap: 12px; }
.team-head { display: grid; grid-template-columns: minmax(0, 1fr) 84px auto auto; gap: 6px; }
.score-big { font-size: 110px; font-weight: 800; text-align: center; line-height: 1; font-variant-numeric: tabular-nums; padding: 8px 0; text-shadow: 0 0 40px color-mix(in srgb, var(--tc) 45%, transparent); }
.score-btns { display: grid; grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); gap: 8px; }
.score-btns .btn { height: 58px; font-size: 22px; font-weight: 800; }
.score-btns .plus { background: color-mix(in srgb, var(--tc) 65%, #111); border-color: transparent; color: #fff; }
.score-btns .plus:hover { background: color-mix(in srgb, var(--tc) 80%, #111); }
.counter { display: flex; align-items: center; gap: 8px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 6px 6px 6px 12px; }
.counter span { flex: 1; color: var(--muted); font-weight: 600; font-size: 13px; }
.counter b { min-width: 34px; text-align: center; font-size: 20px; font-variant-numeric: tabular-nums; }
.counter .btn { width: 38px; padding: 0; }
.sb-center { display: grid; gap: 12px; text-align: center; }
.clock-big { font-size: 72px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; padding: 6px 0; color: var(--faint); }
.clock-big.running { color: var(--text); }
.shot-big { font-size: 46px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--warn); line-height: 1; }
.period-big { font-size: 28px; font-weight: 800; min-width: 120px; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 9px; overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 0 12px; height: 34px; cursor: pointer; font-weight: 600; color: var(--text-2); border-right: 1px solid var(--line-2); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--accent-2); color: #fff; }
.preview-box { position: relative; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; border: 1px solid var(--line-2); background-color: #1a1f2b; background-image: linear-gradient(45deg, #242b3a 25%, transparent 25%), linear-gradient(-45deg, #242b3a 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #242b3a 75%), linear-gradient(-45deg, transparent 75%, #242b3a 75%); background-size: 24px 24px; background-position: 0 0, 0 12px, 12px -12px, -12px 0; }
.preview-box iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; color-scheme: normal; background: transparent; }
.kbd { display: inline-block; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; font: 11px var(--mono); color: var(--text-2); background: var(--panel-2); }

/* ── Match control (scoreboard page) ───────────────────────────── */
.sbx-layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(340px, 1fr); gap: 16px; align-items: start; }
.sbx-main, .sbx-side { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; }
@media (max-width: 1180px) { .sbx-layout { grid-template-columns: minmax(0, 1fr); } }
.sbx-live { background: radial-gradient(900px 300px at 50% 0%, #3b4bb5, var(--navy) 75%); border-color: var(--navy); color: #fff; padding: 14px 18px 20px; }
.sbx-live .sbx-score i { color: rgba(255, 255, 255, .45); }
.sbx-live .muted, .sbx-live .faint, .sbx-live .hint { color: rgba(255, 255, 255, .7); }
.sbx-live .sbx-pill { background: rgba(255, 255, 255, .12); color: #fff; border-color: rgba(255, 255, 255, .25); }
.sbx-live .icon-btn, .sbx-live .btn.ghost { color: rgba(255, 255, 255, .85); }
.sbx-live .icon-btn:hover, .sbx-live .btn.ghost:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.sbx-live.running { border-color: #16a34a; box-shadow: 0 0 0 2px #16a34a inset; }
.sbx-meta { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; font-weight: 600; color: rgba(255, 255, 255, .85); min-height: 30px; }
.sbx-board { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 18px; margin-top: 8px; }
.sbx-team { display: grid; justify-items: center; gap: 8px; text-align: center; min-width: 0; }
.sbx-side-tag { font-size: 11px; font-weight: 800; letter-spacing: .12em; padding: 2px 10px; border-radius: 5px; background: var(--tc); color: #fff; }
.sbx-disc { width: 104px; height: 104px; border-radius: 50%; border: 5px solid var(--tc); background: #0d121c; display: grid; place-items: center; overflow: hidden; box-shadow: 0 0 30px color-mix(in srgb, var(--tc) 30%, transparent); }
.sbx-disc img { width: 82%; height: 82%; object-fit: contain; }
.sbx-disc span { font-size: 30px; font-weight: 800; color: #e7eaf1; }
.sbx-name { font-size: 24px; font-weight: 800; line-height: 1.15; overflow-wrap: anywhere; }
.sbx-center { display: grid; justify-items: center; gap: 6px; }
.sbx-score { display: flex; align-items: center; gap: 14px; font-size: 104px; font-weight: 900; line-height: .95; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.sbx-score i { font-style: normal; color: var(--faint); font-size: 60px; }
.sbx-score .pop { animation: sbpop .55s ease-out; }
@keyframes sbpop { 0% { transform: scale(1); } 35% { transform: scale(1.25); color: #b9f26b; } 100% { transform: scale(1); } }
.sbx-clock { font: 700 58px/1 var(--mono); font-variant-numeric: tabular-nums; background: #070a10; color: #9aa3b5; border-radius: 12px; padding: 8px 18px; border: 1px solid var(--line); }
.sbx-live.running .sbx-clock { color: #b9f26b; }
.sbx-sub { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: center; }
.sbx-period { font-weight: 800; letter-spacing: .06em; opacity: .85; }
.sbx-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: 999px; font-size: 12px; font-weight: 800; letter-spacing: .06em; background: var(--panel-3); color: var(--text-2); border: 1px solid var(--line-2); }
.sbx-pill.big { font-size: 14px; padding: 5px 14px; }
.sbx-pill i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: blink 1.2s infinite; }
.sbx-pill.st-live { background: var(--bad-bg); color: var(--bad-text); border-color: var(--bad-line); }
.sbx-pill.st-break { background: var(--warn-bg); color: var(--warn-text); border-color: var(--warn-line); }
.sbx-pill.st-final { background: var(--ok-bg); color: var(--ok-text); border-color: var(--ok-line); }
.sbx-sc { display: grid; grid-template-columns: minmax(0, 1fr) 190px minmax(0, 1fr); gap: 12px; align-items: start; }
@media (max-width: 760px) { .sbx-sc { grid-template-columns: minmax(0, 1fr); } .sbx-board { grid-template-columns: minmax(0, 1fr); } .sbx-score { font-size: 80px; } }
.sbx-col { display: grid; gap: 8px; padding: 10px; border-radius: 12px; background: color-mix(in srgb, var(--tc) 9%, var(--panel-2)); border: 1px solid color-mix(in srgb, var(--tc) 40%, var(--line)); }
.sbx-col-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.sbx-col-head .badge { background: var(--tc); color: #fff; }
.sbx-col-head .nm { flex: 1; min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sbx-col-head b { font-size: 26px; font-variant-numeric: tabular-nums; }
.sbx-act { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 56px; padding: 0 14px; border-radius: 10px; cursor: pointer; font-weight: 800; font-size: 16px; letter-spacing: .03em; color: #fff; text-align: left;
  border: 1px solid color-mix(in srgb, var(--ac, var(--tc)) 70%, #fff 0%); background: linear-gradient(180deg, color-mix(in srgb, var(--ac, var(--tc)) 55%, #0b1020), color-mix(in srgb, var(--ac, var(--tc)) 38%, #0b1020)); transition: filter .1s, transform .05s; }
.sbx-act:hover { filter: brightness(1.15); }
.sbx-act:active { transform: scale(.98); }
.sbx-act:disabled { opacity: .45; cursor: not-allowed; filter: grayscale(.4); }
.sbx-act .r { display: flex; align-items: center; gap: 8px; }
.sbx-act .r b { font-size: 22px; font-variant-numeric: tabular-nums; }
.sbx-act.custom { background: #fff; color: var(--text); border: 1px dashed var(--line-2); min-height: 46px; font-size: 14px; }
.sbx-mid { display: grid; gap: 10px; align-content: start; }
.sbx-undo { display: grid; justify-items: center; gap: 2px; padding: 16px 10px; border-radius: 12px; border: 1px solid var(--warn-line); background: var(--warn-bg); color: var(--warn-text); cursor: pointer; font-weight: 800; font-size: 20px; }
.sbx-undo:hover { filter: brightness(1.15); }
.sbx-undo:disabled { opacity: .45; cursor: not-allowed; }
.sbx-undo small { font-size: 11px; letter-spacing: .12em; }
.sbx-undo > span:first-child { display: flex; gap: 6px; align-items: center; }
.sbx-last { text-align: center; font-size: 13px; color: var(--muted); }
.sbx-last b { color: var(--text); }
.sbx-tm-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.sbx-tm-clock { font: 700 64px/1 var(--mono); font-variant-numeric: tabular-nums; color: var(--faint); }
.sbx-tm-clock.running { color: #15803d; }
.sbx-tm-btns { display: grid; grid-template-columns: 1.4fr 1fr auto auto; gap: 8px; }
@media (max-width: 760px) { .sbx-tm-btns { grid-template-columns: repeat(2, minmax(0, 1fr)); } .sbx-tm-btns .btn { min-width: 0; padding-left: 8px; padding-right: 8px; } }
.sbx-tm-status { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 14px; align-items: flex-end; }
.sbx-tm-status .lbl, .sbx-shot .lbl { display: block; font-size: 11px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 6px; }
.sbx-tm-status .seg button.on.st-live { background: #c4141e; }
.sbx-tm-status .seg button.on.st-break { background: #b45309; }
.sbx-tm-status .seg button.on.st-final { background: #15803d; }
.sbx-pv-seg { display: flex; margin-bottom: 10px; }
.sbx-pv-seg button { flex: 1; white-space: nowrap; padding: 0 6px; }
.sbx-added { min-width: 34px; text-align: center; font-size: 18px; }
.sbx-shot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.sbx-shot .shot-big { font-size: 36px; min-width: 70px; text-align: center; }
.sbx-result.done { border-color: var(--ok-line); }
.sbx-res-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; font-size: 16px; font-weight: 600; border-bottom: 1px solid var(--line); }
.sbx-res-row b { font-size: 26px; font-variant-numeric: tabular-nums; }
.sbx-log { display: grid; gap: 4px; max-height: 460px; overflow: auto; }
.sbx-ev { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; background: var(--panel-2); font-size: 13px; border-left: 4px solid var(--tc, transparent); }
.sbx-ev.system { background: transparent; border-left-color: var(--line-2); color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.sbx-ev .mn { width: 30px; color: var(--faint); font-variant-numeric: tabular-nums; text-align: right; }
.sbx-ev .pr { width: 44px; color: var(--faint); font-size: 11px; font-weight: 700; }
.sbx-ev .tm { font-weight: 800; color: var(--tc); min-width: 34px; }
.sbx-ev .lb { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sbx-ev .pt { color: #15803d; font-weight: 700; }
.sbx-ev .sc { font-variant-numeric: tabular-nums; color: var(--muted); min-width: 44px; text-align: right; }
.sbx-sched { display: grid; gap: 6px; max-height: 520px; overflow: auto; }
.sbx-m { display: grid; grid-template-columns: 56px minmax(0, 1fr) 64px auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); }
.sbx-m.cur { border-color: var(--live); background: var(--bad-bg); }
.sbx-m.done { opacity: .82; }
.sbx-m .mt { display: grid; font-size: 12px; color: var(--muted); }
.sbx-m .mt b { color: var(--text); font-size: 14px; }
.sbx-m .tms { display: grid; min-width: 0; font-weight: 600; }
.sbx-m .tms span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sbx-m .tms small { color: var(--faint); font-size: 11px; }
.sbx-m .rs { display: grid; justify-items: center; }
.sbx-m .rs b { font-size: 16px; font-variant-numeric: tabular-nums; }
.sbx-m .rs small { color: var(--faint); font-size: 11px; font-weight: 700; }
.sbx-m .ac { display: flex; gap: 2px; align-items: center; }
.sbx-ae { display: grid; grid-template-columns: minmax(0, 1fr) 76px 46px 64px 64px auto; gap: 6px; align-items: center; }
.sbx-ae.head span { font-size: 11px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; }
.sbx-ae input { height: 34px; }
.sbx-ae input[data-ak="keyA"], .sbx-ae input[data-ak="keyB"] { text-align: center; text-transform: uppercase; }

/* ── Graphic previews & multiview ───────────────────────────── */
.gthumb { background-color: #1a1f2b; background-image: linear-gradient(45deg, #242b3a 25%, transparent 25%), linear-gradient(-45deg, #242b3a 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #242b3a 75%), linear-gradient(-45deg, transparent 75%, #242b3a 75%); background-size: 16px 16px; background-position: 0 0, 0 8px, 8px -8px, -8px 0; }
.cue > .gthumb { position: relative; aspect-ratio: 16 / 9; border-radius: 8px; margin-bottom: 10px; border: 1px solid var(--line-2); }
.mv-g-pic > .gthumb { position: absolute; inset: 0; }
.mv-mons { margin-bottom: 16px; }
.mv-card { margin-bottom: 16px; }
.mv-scenes .scenes.thumbs { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.mv-page + .mv-page { margin-top: 16px; }
.mv-page h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 8px; display: flex; gap: 8px; align-items: baseline; }
.mv-page h4 a { color: inherit; }
.mv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.mv-g { position: relative; border: 2px solid var(--line-2); border-radius: 10px; overflow: hidden; background: var(--panel-2); display: grid; align-content: start; min-width: 0; }
.mv-g.on { border-color: var(--live); box-shadow: 0 0 0 1px var(--live); }
.mv-g-pic { position: relative; aspect-ratio: 16 / 9; background-color: #1a1f2b; background-image: linear-gradient(45deg, #242b3a 25%, transparent 25%), linear-gradient(-45deg, #242b3a 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #242b3a 75%), linear-gradient(-45deg, transparent 75%, #242b3a 75%); background-size: 16px 16px; background-position: 0 0, 0 8px, 8px -8px, -8px 0; }
.mv-g-pic.preview-box { border: 0; border-radius: 0; }
.mv-air { position: absolute; top: 8px; left: 8px; z-index: 2; background: var(--live); color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .08em; padding: 4px 7px; border-radius: 5px; }
.mv-g-meta { display: flex; align-items: center; gap: 8px; padding: 8px 10px; min-width: 0; }
.mv-g-meta > div { flex: 1; display: grid; min-width: 0; }
.mv-g-meta b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mv-g-meta small { color: var(--faint); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Replay ───────────────────────────── */
.rp-status { margin-top: 6px; }
.rp-save .kbd, .rp-back .kbd, .rp-ctl .kbd { margin-left: 6px; background: rgba(0, 0, 0, .25); border-color: rgba(255, 255, 255, .25); color: inherit; }
.rp-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 360px); gap: 16px; align-items: start; }
.rp-main, .rp-side { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; }
@media (max-width: 1180px) { .rp-layout { grid-template-columns: minmax(0, 1fr); } }
.rp-warn { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn-text); border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; font-size: 13.5px; }
.rp-warn .hint { flex-basis: 100%; color: #8a6a2a; }
.rp-live.air { border-color: var(--live); box-shadow: 0 0 0 1px var(--live), 0 0 28px rgba(232, 32, 42, .18); }
.rp-stage { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 860px) { .rp-stage { grid-template-columns: minmax(0, 1fr); } }
.rp-mon.rp-air { border-color: var(--live); }
.rp-side-ctl { display: grid; gap: 12px; min-width: 0; }
.rp-back { width: 100%; justify-content: center; }
.rp-now { --tc: var(--accent-2); border: 1px solid var(--line-2); border-left: 5px solid var(--tc); border-radius: 10px; padding: 12px 14px; background: var(--panel-2); display: grid; gap: 10px; min-width: 0; }
.rp-now.idle { border-left-color: var(--line-2); }
.rp-now-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.rp-now-top b { font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.rp-state { flex: none; font-size: 11px; font-weight: 800; letter-spacing: .1em; padding: 3px 8px; border-radius: 5px; background: var(--panel-3); color: var(--muted); }
.rp-now.st-playing .rp-state { background: var(--live); color: #fff; }
.rp-now.st-paused .rp-state, .rp-now.st-cued .rp-state { background: #b45309; color: #fff; }
.rp-now.st-loading .rp-state { animation: blink 1s infinite; }
.rp-time { font: 600 13px var(--mono); color: var(--muted); white-space: nowrap; }
.rp-bar { height: 8px; border-radius: 4px; background: var(--well); overflow: hidden; }
.rp-bar i { display: block; height: 100%; width: 0; background: var(--tc); }
.rp-tl { position: relative; height: 34px; border-radius: 7px; background: #1f2937; border: 1px solid var(--line-2); overflow: hidden; touch-action: none; user-select: none; }
.rp-tl.can { cursor: ew-resize; }
.rp-tl-sel { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--tc) 30%, transparent); }
.rp-tl-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: rgba(255, 255, 255, .07); pointer-events: none; }
.rp-tl-mk { position: absolute; top: 0; bottom: 0; width: 3px; margin-left: -1.5px; background: #22c55e; pointer-events: none; }
.rp-tl-mk.out { background: #ef4444; }
.rp-tl-head { position: absolute; top: 0; bottom: 0; width: 3px; margin-left: -1.5px; background: #fff; box-shadow: 0 0 6px rgba(0, 0, 0, .7); pointer-events: none; }
.rp-tl-head::before { content: ''; position: absolute; top: 0; left: -5px; border: 6.5px solid transparent; border-top-color: #fff; }
.rp-tl-meta { display: flex; justify-content: space-between; align-items: center; gap: 4px 10px; flex-wrap: wrap; margin-top: -4px; }
.rp-jog .btn { padding: 0 9px; }
.rp-jog .rp-mk-in { border-color: #15803d; }
.rp-jog .rp-mk-out { border-color: #b91c1c; }
.rp-cut { color: #fff; position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%); padding: 1px 7px; border-radius: 5px; background: rgba(21, 128, 61, .92); font: 700 11px var(--mono); white-space: nowrap; }
.rp-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.rp-ctl .seg button { height: 34px; }
.rp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.rp-clip { --tc: #475569; background: var(--panel-2); border: 1px solid var(--line-2); border-top: 4px solid var(--tc); border-radius: 10px; overflow: hidden; display: grid; min-width: 0; }
.rp-clip.on { border-color: var(--live); border-top-color: var(--live); box-shadow: 0 0 0 1px var(--live); }
.rp-thumb { position: relative; aspect-ratio: 16 / 9; background: #05070b center / cover no-repeat; }
.rp-dur, .rp-min { position: absolute; bottom: 6px; padding: 1px 7px; border-radius: 5px; color: #fff; background: rgba(0, 0, 0, .75); font: 600 12px var(--mono); }
.rp-dur { right: 6px; }
.rp-min { left: 6px; }
.rp-star { position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .6); color: #8b94a8; font-size: 16px; cursor: pointer; }
.rp-star.on { color: #fbbf24; }
.rp-info { padding: 8px 6px 0 10px; display: flex; align-items: center; gap: 2px; min-width: 0; }
.rp-info > div { flex: 1; display: grid; min-width: 0; }
.rp-info b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-info small { color: var(--faint); font-family: var(--mono); font-size: 11.5px; }
.rp-btns { display: grid; grid-template-columns: 1.35fr repeat(3, minmax(0, 1fr)); gap: 5px; padding: 8px 10px 10px; }
.rp-btns .btn { padding: 0 4px; justify-content: center; min-width: 0; }
.rp-clips-head { flex-wrap: wrap; }
.rp-clips-head .seg button { white-space: nowrap; }
.rp-check { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 9px 12px; border-radius: 9px; margin-bottom: 14px; background: var(--warn-bg); color: var(--warn-text); font-size: 13px; }
.rp-check.ok { background: var(--ok-bg); color: var(--ok-text); }
.rp-check .btn { margin-left: auto; }
.rp-delay-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: -4px 0 0 30px; color: var(--muted); font-size: 13px; }
.rp-delay-row input.rp-delay { width: 66px; height: 32px; }
.rp-angles { display: flex; flex-wrap: wrap; width: 100%; }
.rp-angles button { flex: 1 1 auto; height: 34px; white-space: nowrap; }
.rp-angs { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px 10px 0; }
.rp-angs button { border: 1px solid var(--line-2); background: #fff; color: var(--text-2); border-radius: 6px; padding: 2px 7px; font: 600 11.5px inherit; cursor: pointer; max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-angs button.on { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }
.rp-nang { position: absolute; top: 6px; left: 6px; padding: 1px 7px; border-radius: 5px; color: #fff; background: rgba(0, 0, 0, .75); font: 700 11.5px var(--mono); }
.rp-cams { border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; margin-bottom: 14px; background: var(--panel-2); }
.rp-cams-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.rp-cams-head b { display: flex; align-items: center; gap: 6px; }
.rp-cam { display: grid; grid-template-columns: 22px minmax(0, 1.3fr) minmax(0, 1fr) auto auto; gap: 6px; align-items: center; margin-bottom: 6px; }
.rp-cam select, .rp-cam input { height: 32px; font-size: 13px; padding-left: 8px; }
.rp-cn { width: 22px; height: 22px; border-radius: 6px; background: var(--panel-3); display: grid; place-items: center; font: 700 12px var(--mono); }
.rp-cs { font: 700 10.5px var(--mono); padding: 2px 6px; border-radius: 5px; background: var(--panel-3); color: var(--muted); white-space: nowrap; max-width: 110px; overflow: hidden; text-overflow: ellipsis; }
.rp-cs.ok { background: var(--bad-bg); color: var(--bad-text); }
.rp-cs.warn { background: var(--warn-bg); color: var(--warn-text); }
.rp-keys-wrap { max-height: 60vh; overflow: auto; margin-top: 10px; }
.rp-keytbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding-top: 12px; }
.rp-keytbl td.r { text-align: right; width: 1%; white-space: nowrap; }
.rp-kb { min-width: 92px; height: 30px; border: 1px solid var(--line-2); border-bottom-width: 3px; border-radius: 7px; background: var(--panel-2); color: var(--text); font: 600 13px var(--mono); cursor: pointer; padding: 0 10px; }
.rp-kb:hover:not(:disabled) { border-color: var(--accent); }
.rp-kb.none { color: var(--faint); }
.rp-kb.wait { border-color: var(--accent); background: var(--accent-2); color: #fff; animation: blink 1s infinite; }
.rp-adv summary { cursor: pointer; color: var(--muted); font-size: 13px; }

/* ── Graphics ───────────────────────────── */
.gfx-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 420px); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .gfx-wrap { grid-template-columns: minmax(0, 1fr); } .gfx-side { order: -1; } }
.gfx-side { display: grid; gap: 14px; position: sticky; top: 0; }
.cues { display: grid; grid-template-columns: repeat(var(--cols, auto-fill), minmax(220px, 1fr)); gap: 12px; }
.cue { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; gap: 8px; align-content: start; transition: border-color .15s, box-shadow .15s; min-width: 0; }
.cue.on { border-color: var(--live); box-shadow: 0 0 0 1px var(--live), 0 0 24px rgba(232, 32, 42, .16); background: #fff7f7; }
.cue-top { display: flex; gap: 6px; align-items: center; min-width: 0; }
.cue-top .badge { min-width: 0; overflow: hidden; text-overflow: ellipsis; flex-shrink: 1; }
.cue-top .icon-btn { margin-left: auto; }
.cue-name { font-weight: 700; font-size: 15px; }
.cue-fields { color: var(--muted); font-size: 12.5px; min-height: 36px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cue-acts { display: flex; gap: 6px; }
.cue-acts .btn.take { flex: 1; height: 44px; font-size: 15px; letter-spacing: .04em; }
.onair-list { display: grid; gap: 6px; }
.onair-item { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 12px; border-radius: 9px; background: var(--bad-bg); border: 1px solid var(--bad-line); }
.onair-item .grow { flex: 1; min-width: 0; }
.onair-item small { display: block; color: var(--bad-text); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.tpl-preview { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 10px; border: 1px solid var(--line-2); background: #1a1f2b; }
.tpl-preview > div { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; transform-origin: 0 0; }
.emoji-row { display: flex; flex-wrap: wrap; gap: 4px; }
.emoji-row button { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); cursor: pointer; font-size: 18px; }

/* ── Deck ───────────────────────────── */
.deck-page { display: flex; flex-direction: column; height: 100%; min-height: 420px; gap: 12px; }
.deck-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.deck-head h2 { font-size: 18px; margin-right: 6px; }
.deck-grid-host { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.deck-grid { flex: 1; display: grid; gap: 10px; min-height: 0; }
.dk { position: relative; border-radius: 16px; border: 0; background: var(--bc, #334155); color: var(--fg, #fff); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 8px; overflow: hidden; user-select: none; -webkit-user-select: none; touch-action: manipulation; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .25), 0 3px 10px rgba(0, 0, 0, .3); transition: transform .06s, filter .12s, box-shadow .12s; min-height: 0; }
.dk:hover { filter: brightness(1.12); }
.dk.pressed { transform: scale(.95); filter: brightness(1.3); }
.dk img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .55; pointer-events: none; }
.dk .dk-ic { font-size: clamp(20px, 3.2vw, 42px); line-height: 1; position: relative; }
.dk .dk-lb { font-size: clamp(11px, 1.15vw, 15px); font-weight: 750; text-align: center; letter-spacing: .02em; line-height: 1.15; position: relative; text-shadow: 0 1px 3px rgba(0, 0, 0, .5); word-break: break-word; }
.dk.fb-on { box-shadow: inset 0 0 0 4px #fff, 0 0 22px rgba(255, 255, 255, .25); }
.dk.fb-pv { box-shadow: inset 0 0 0 4px var(--pv); }
.dk.fb-live { box-shadow: inset 0 0 0 4px #fff, 0 0 26px rgba(239, 59, 74, .8); animation: dkpulse 1.4s infinite; }
.dk.fb-off { filter: grayscale(.7) brightness(.6); }
.dk.fb-off::after { content: ""; position: absolute; left: 12%; right: 12%; top: 50%; height: 4px; background: #ff4d5e; transform: rotate(-30deg); border-radius: 4px; }
.dk.flash-ok { box-shadow: inset 0 0 0 4px var(--ok); }
.dk.flash-err { box-shadow: inset 0 0 0 4px var(--live); animation: shake .3s; }
@keyframes dkpulse { 50% { box-shadow: inset 0 0 0 4px #fff, 0 0 8px rgba(239, 59, 74, .3); } }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.dk-empty { border-radius: 16px; border: 1px dashed var(--line-2); }
.dk-add { border-radius: 16px; border: 2px dashed var(--line-2); background: transparent; color: var(--faint); font-size: 28px; cursor: pointer; }
.dk-add:hover { border-color: var(--accent); color: var(--accent); }
.deck-grid.editing .dk { cursor: grab; }
.deck-grid.editing .dk::before { content: "✎"; position: absolute; top: 6px; right: 9px; font-size: 13px; opacity: .7; }
.drop-target { outline: 3px solid var(--accent); outline-offset: 2px; }
.act-row { display: grid; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); }
.act-row .row > select { flex: 1; min-width: 0; }
.act-params { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.act-params label { display: grid; gap: 4px; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.btn-preview { width: 110px; height: 110px; }

/* ── Desktop ───────────────────────────── */
.desk-screen { position: relative; background: #000; border-radius: 10px; overflow: hidden; border: 1px solid var(--line-2); outline: none; user-select: none; touch-action: none; }
.desk-screen:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(46, 58, 143, .25); }
.desk-screen img { width: 100%; display: block; min-height: 120px; -webkit-user-drag: none; }
.desk-screen.ctrl img { cursor: crosshair; }
.desk-cursor { position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; border: 2px solid #fff; background: rgba(239, 59, 74, .8); box-shadow: 0 0 0 2px rgba(0, 0, 0, .5); pointer-events: none; transition: left .08s, top .08s; }
.desk-msg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-weight: 600; text-align: center; padding: 20px; }
.keys { display: flex; flex-wrap: wrap; gap: 6px; }
.keys .btn { min-width: 46px; }
.shortcuts { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.shortcut { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 14px 8px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); cursor: pointer; text-align: center; font-weight: 600; min-height: 92px; }
.shortcut:hover { border-color: var(--accent); }
.shortcut .e { font-size: 28px; line-height: 1; }

/* ── Checklists & items ───────────────────────────── */
.two-pane { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .two-pane { grid-template-columns: minmax(0, 1fr); } }
.pane-list { display: grid; gap: 6px; }
.pane-item { display: block; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--text); }
.pane-item:hover { border-color: var(--line-2); }
.pane-item.on { border-color: var(--accent); background: var(--info-bg); }
.pane-item b { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; }
.pane-item b span { color: var(--muted); font-weight: 500; font-size: 12px; font-variant-numeric: tabular-nums; }
.pane-item .bar { margin-top: 8px; height: 5px; }
.cl-items { display: grid; gap: 4px; }
.cl-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; background: var(--panel-2); border: 1px solid transparent; }
.cl-item.done { background: var(--ok-bg); }
.cl-item.done .txt { color: var(--faint); text-decoration: line-through; text-decoration-color: #9fbfae; }
.cl-item .txt { flex: 1; min-width: 0; }
.cl-item .txt small { display: block; color: var(--muted); font-size: 12px; text-decoration: none; }
.cl-item .who { font-size: 12px; color: #15803d; white-space: nowrap; }
.cl-head { padding: 16px 4px 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); font-weight: 800; display: flex; align-items: center; gap: 8px; }
.cl-head:first-child { padding-top: 4px; }
.tick { width: 30px; height: 30px; border-radius: 8px; border: 2px solid var(--line-2); background: transparent; cursor: pointer; display: grid; place-items: center; color: transparent; flex: none; transition: .12s; }
.tick:hover { border-color: var(--ok); }
.tick.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.tick.sm { width: 26px; height: 26px; border-radius: 7px; }
.item-cat td { background: var(--panel-3); font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--accent); font-weight: 800; }
.items-tbl td.chk { width: 64px; text-align: center; }
.items-tbl .nm { font-weight: 600; }
.items-tbl .nm small { display: block; color: var(--muted); font-weight: 400; }
@media (max-width: 700px) { .items-tbl .opt { display: none; } }

/* ── Settings ───────────────────────────── */
.settings { display: grid; gap: 16px; max-width: 1000px; }
.set-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.set-row:last-child { border-bottom: 0; }
.set-row .grow { flex: 1; }
.set-row .grow small { display: block; color: var(--muted); }

/* ── Title designer ───────────────────────────── */
.seg button:disabled { opacity: .35; cursor: default; }
.dz { display: grid; grid-template-columns: 228px minmax(0, 1fr) 312px; grid-template-rows: auto minmax(0, 1fr); height: 100%; min-height: 520px; }
.dz-top { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; padding: 9px 12px; border-bottom: 1px solid var(--line); background: var(--panel); flex-wrap: wrap; }
.dz-top select, .dz-top .dz-name { height: 32px; font-size: 13px; }
.dz-name { width: 230px !important; font-weight: 650; }
.dz-dirty { font-size: 12px; color: var(--muted); white-space: nowrap; }
.dz-top .seg button { height: 32px; display: inline-flex; align-items: center; gap: 5px; }
.dz-left { border-right: 1px solid var(--line); background: var(--panel); overflow: auto; padding: 12px; display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.dz-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.dz-tool { height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel-2); cursor: pointer; font-size: 12px; font-weight: 650; color: var(--text-2); }
.dz-tool:hover { border-color: var(--accent); color: var(--info-text); background: var(--info-bg); }
.dz-lh { display: flex; align-items: baseline; justify-content: space-between; font-size: 13px; }
.dz-layers { display: grid; gap: 2px; }
.dz-layer { display: flex; align-items: center; gap: 7px; padding: 4px 4px 4px 8px; border-radius: 8px; cursor: pointer; font-size: 13px; border: 1px solid transparent; color: var(--text-2); }
.dz-layer:hover { background: var(--panel-2); }
.dz-layer.on { background: var(--info-bg); border-color: var(--accent); color: var(--info-text); }
.dz-layer.drop { border-top: 2px solid var(--accent); }
.dz-layer .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dz-layer.hid .nm { opacity: .45; text-decoration: line-through; }
.dz-layer .badge { max-width: 70px; overflow: hidden; text-overflow: ellipsis; background: var(--ok-bg); color: var(--ok-text); }
.dz-layer .icon-btn { width: 24px; height: 24px; opacity: .55; }
.dz-layer .icon-btn:hover, .dz-layer .icon-btn.is-on { opacity: 1; }
.dz-layer .icon-btn.is-on { color: var(--warn); }
.dz-canvas { position: relative; overflow: hidden; background: #06080d; touch-action: none; user-select: none; -webkit-user-select: none; }
.dz-board { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; transform-origin: 0 0; box-shadow: 0 0 0 calc(1px / var(--s, 1)) #2c3854, 0 20px 60px rgba(0, 0, 0, .5); }
.dz-board.bg-checker { background-color: #1a1f2b; background-image: linear-gradient(45deg, #232a39 25%, transparent 25%), linear-gradient(-45deg, #232a39 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #232a39 75%), linear-gradient(-45deg, transparent 75%, #232a39 75%); background-size: 48px 48px; background-position: 0 0, 0 24px, 24px -24px, -24px 0; }
.dz-board.bg-black { background: #000; }
.dz-board.bg-white { background: #fff; }
.dz-board.bg-green { background: #00b140; }
.dz-ref { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.dz-host, .dz-guides { position: absolute; inset: 0; pointer-events: none; }
.dz-safe { position: absolute; border: calc(2px / var(--s, 1)) dashed rgba(255, 255, 255, .3); }
.dz-safe.t { border-color: rgba(255, 210, 90, .3); }
.dz-gridbg { position: absolute; inset: 0; background-image: linear-gradient(rgba(255, 255, 255, .08) calc(1px / var(--s, 1)), transparent 0), linear-gradient(90deg, rgba(255, 255, 255, .08) calc(1px / var(--s, 1)), transparent 0); background-size: 40px 40px; }
.dz-gl { position: absolute; background: #ff3df2; }
.dz-gl.v { top: 0; bottom: 0; width: calc(1.5px / var(--s, 1)); }
.dz-gl.h { left: 0; right: 0; height: calc(1.5px / var(--s, 1)); }
.dz-sel { position: absolute; outline: calc(2px / var(--s, 1)) solid var(--accent); pointer-events: none; }
.dz-sel.locked { outline-style: dashed; }
.dz-sel.locked i { display: none; }
.dz-sel i { position: absolute; width: calc(13px / var(--s, 1)); height: calc(13px / var(--s, 1)); box-sizing: border-box; background: #fff; border: calc(2px / var(--s, 1)) solid var(--accent); border-radius: calc(3px / var(--s, 1)); transform: translate(-50%, -50%); pointer-events: auto; }
.dz-sel i[data-h=nw] { left: 0; top: 0; cursor: nwse-resize; }
.dz-sel i[data-h=n] { left: 50%; top: 0; cursor: ns-resize; }
.dz-sel i[data-h=ne] { left: 100%; top: 0; cursor: nesw-resize; }
.dz-sel i[data-h=e] { left: 100%; top: 50%; cursor: ew-resize; }
.dz-sel i[data-h=se] { left: 100%; top: 100%; cursor: nwse-resize; }
.dz-sel i[data-h=s] { left: 50%; top: 100%; cursor: ns-resize; }
.dz-sel i[data-h=sw] { left: 0; top: 100%; cursor: nesw-resize; }
.dz-sel i[data-h=w] { left: 0; top: 50%; cursor: ew-resize; }
.dz-props { border-left: 1px solid var(--line); background: var(--panel); overflow: auto; padding: 4px 14px 20px; min-height: 0; }
.dz-sec { border-bottom: 1px solid var(--line); padding: 12px 0; display: grid; gap: 8px; }
.dz-sec:last-child { border-bottom: 0; }
.dz-sec h5 { margin: 0; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); font-weight: 750; }
.dz-g2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 8px; }
.dz-g3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 8px; }
.dz-g4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.dzf { display: grid; gap: 3px; font-size: 11px; color: var(--muted); font-weight: 600; min-width: 0; }
.dzf input:not([type=range]):not([type=color]), .dzf select { height: 31px; font-size: 13px; padding: 0 8px; border-radius: 7px; }
.dzf select { padding-right: 24px; background-position: calc(100% - 13px) 13px, calc(100% - 8px) 13px; }
.dzf textarea { min-height: 64px; font-size: 13px; padding: 6px 8px; border-radius: 7px; }
.dzc { font-size: 12.5px; }
.dz-checks { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.dz-color { display: flex; gap: 5px; align-items: center; min-width: 0; }
.dz-color input[type=color] { width: 34px; height: 31px; padding: 2px; flex: none; border-radius: 7px; }
.dz-color input:not([type=color]) { flex: 1; min-width: 0; height: 31px; font-size: 12px; padding: 0 7px; border-radius: 7px; }
.dz-sw { display: flex; gap: 3px; flex: none; }
.dz-sw button { width: 18px; height: 22px; border-radius: 5px; border: 1px solid var(--line-2); cursor: pointer; padding: 0; font-size: 9px; color: var(--text-2); background: var(--panel-3); }
.dz-sw button.on { outline: 2px solid var(--navy-2); outline-offset: 1px; }
.dz-props .seg button { height: 30px; padding: 0 8px; display: inline-flex; align-items: center; }
.dz-field { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.dz-field .mono { color: var(--ok-text); font-size: 12px; flex: 1; }
.dz-keys { display: grid; gap: 5px; font-size: 12px; color: var(--muted); }
.dz-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.dz-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; }
.dz-card:hover { border-color: var(--line-2); }
.dz-thumb { display: block; position: relative; aspect-ratio: 16 / 9; overflow: hidden; border: 0 !important; border-radius: 0 !important; }
.dz-thumb > div { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; transform-origin: 0 0; pointer-events: none; }
.dz-card-b { padding: 12px 14px 14px; display: grid; gap: 6px; }
.dz-card-b > b { font-size: 15px; }
.dz-presets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.dz-preset { display: grid; gap: 6px; cursor: pointer; font-size: 13px; text-align: center; position: relative; }
.dz-preset input { position: absolute; opacity: 0; pointer-events: none; }
.dz-preset .dz-thumb { border-radius: 9px !important; outline: 2px solid var(--line-2); }
.dz-preset input:checked + .dz-thumb { outline: 3px solid var(--accent); }
.dz-center { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.dz-center .dz-canvas { flex: 1; min-height: 200px; }
.dz-hov { position: absolute; outline: calc(1.5px / var(--s, 1)) dashed rgba(79, 140, 255, .8); pointer-events: none; }
.dz-ol { position: absolute; outline: calc(1.5px / var(--s, 1)) solid rgba(79, 140, 255, .9); pointer-events: none; }
.dz-sel.multi { outline-style: dashed; }
.dz-sel.multi i, .dz-sel.multi .dz-roth { display: none; }
.dz-roth { position: absolute; left: 50%; top: calc(-34px / var(--s, 1)); width: calc(16px / var(--s, 1)); height: calc(16px / var(--s, 1)); transform: translate(-50%, -50%); border-radius: 50%; background: #fff; border: calc(2px / var(--s, 1)) solid var(--accent); box-sizing: border-box; cursor: grab; pointer-events: auto; }
.dz-roth::after { content: ""; position: absolute; left: 50%; top: 100%; width: calc(2px / var(--s, 1)); height: calc(20px / var(--s, 1)); background: var(--accent); transform: translateX(-50%); }
.dz-sel.locked .dz-roth { display: none; }
.dz-marq { position: absolute; border: calc(1.5px / var(--s, 1)) dashed #8ab4ff; background: rgba(79, 140, 255, .12); pointer-events: none; }
.dz-tl { flex: none; border-top: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; max-height: 230px; }
.dz-tl.closed .dz-tl-body { display: none; }
.dz-tl-head { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-bottom: 1px solid var(--line); font-size: 13px; }
.dz-tl-head .seg button { height: 26px; font-size: 12px; }
.dz-tl-head .hint { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dz-tl-body { overflow: auto; position: relative; padding-bottom: 4px; }
.dz-tl-row { display: grid; grid-template-columns: 150px minmax(0, 1fr); align-items: center; height: 26px; border-bottom: 1px solid var(--line); cursor: pointer; }
.dz-tl-row.on { background: var(--info-bg); }
.dz-tl-row.hid { opacity: .45; }
.dz-tl-row.ruler { height: 22px; cursor: default; position: sticky; top: 0; background: var(--panel); z-index: 2; }
.dz-tl-lab { display: flex; align-items: center; gap: 6px; padding: 0 8px; font-size: 12px; color: var(--text-2); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.dz-tl-lab span { overflow: hidden; text-overflow: ellipsis; }
.dz-tl-track { position: relative; height: 100%; margin-right: 14px; }
.dz-tl-row.ruler .dz-tl-track span { position: absolute; top: 4px; font-size: 10px; color: var(--faint); transform: translateX(-50%); }
.dz-tl-row.ruler .dz-tl-track span:first-child { transform: none; }
.dz-tl-bar { position: absolute; top: 4px; bottom: 4px; min-width: 6px; border-radius: 5px; background: var(--navy-2); color: #fff; font-size: 10.5px; font-weight: 650; display: flex; align-items: center; padding: 0 6px; overflow: hidden; white-space: nowrap; cursor: grab; box-sizing: border-box; }
.dz-tl-bar.out { background: #c4141e; }
.dz-tl-row.on .dz-tl-bar { box-shadow: 0 0 0 2px var(--navy); }
.dz-tl-bar span { pointer-events: none; overflow: hidden; text-overflow: ellipsis; }
.dz-tl-bar i { position: absolute; right: 0; top: 0; bottom: 0; width: 8px; cursor: ew-resize; background: rgba(255, 255, 255, .35); }
.dz-tl-loop { position: absolute; top: 9px; bottom: 9px; right: 0; background: repeating-linear-gradient(90deg, rgba(255, 207, 110, .5) 0 6px, transparent 6px 10px); border-radius: 3px; pointer-events: none; }
.dz-tl-phwrap { position: absolute; top: 0; bottom: 0; left: 150px; right: 14px; pointer-events: none; }
.dz-tl-ph { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--red); box-shadow: 0 0 6px rgba(232, 32, 42, .5); }
.dz-head { display: flex; align-items: center; gap: 6px; padding: 12px 0 8px; position: sticky; top: 0; background: var(--panel); z-index: 2; }
.dz-head b { display: flex; gap: 6px; align-items: center; }
.dz-pad { padding: 0 0 10px; display: grid; gap: 8px; }
details.dz-sec { padding: 0; display: block; }
details.dz-sec > summary { list-style: none; cursor: pointer; padding: 10px 0; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); font-weight: 750; display: flex; align-items: center; gap: 6px; user-select: none; }
details.dz-sec > summary::-webkit-details-marker { display: none; }
details.dz-sec > summary::before { content: "▸"; font-size: 10px; transition: transform .12s; }
details.dz-sec[open] > summary::before { transform: rotate(90deg); }
details.dz-sec > summary:hover { color: var(--muted); }
.dz-sec-b { display: grid; gap: 8px; padding-bottom: 12px; }
.dz-x { width: 26px; height: 31px; flex: none; border-radius: 7px; border: 1px solid var(--line-2); background: var(--panel-3); color: var(--text-2); cursor: pointer; font-size: 11px; }
.dz-sw { display: flex; gap: 3px; flex-wrap: wrap; margin-top: 4px; }
.dz-sw button { width: 22px; height: 18px; }
.dz-sw i { width: 1px; background: var(--line-2); margin: 0 3px; }
.badge.data { background: var(--warn-bg); color: var(--warn-text); }
.dz-layer.grp { box-shadow: inset 3px 0 0 #8b5cf6; }
@media (max-width: 1250px) { .dz { grid-template-columns: 190px minmax(0, 1fr) 280px; } }
@media (max-width: 900px) {
  .dz { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto auto; height: auto; }
  .dz-center { grid-row: 2; }
  .dz-center .dz-canvas { flex: none; height: 50vh; }
  .dz-left { grid-row: 3; border-right: 0; }
  .dz-props { grid-row: 4; border-left: 0; }
  .dz-presets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media print {
  body { overflow: visible; background: #fff; color: #000; }
  .side, .top, .no-print, #toasts { display: none !important; }
  .app { display: block; height: auto; }
  .view { overflow: visible; padding: 0; }
  .card { border: 0; background: #fff; padding: 0; }
  .two-pane { display: block; }
  .tbl th, .tbl td { color: #000; border-color: #ccc; }
  .item-cat td { background: #eee; color: #000; }
  .tick { border-color: #000; }
}

/* ───────── Consoles (multi-show workspace) ───────── */
.con-switch { margin: 2px 12px 4px; display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 10px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16); color: #fff; text-align: left; font: inherit; cursor: pointer; }
.con-switch:hover { background: rgba(255, 255, 255, .16); }
.con-switch .grow { min-width: 0; flex: 1; display: grid; }
.con-switch small { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: rgba(255, 255, 255, .55); font-weight: 700; }
.con-switch b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.con-switch .ic { opacity: .7; }
.nav a .tag.live { color: #fff; background: var(--red); border-radius: 6px; padding: 1px 6px; font-weight: 700; }
.badge.info { background: var(--info-bg); color: var(--info-text); }
.badge.rec { background: var(--bad-bg); color: var(--bad-text); }
.stat.live b { color: var(--live); }
.con-stats { margin-bottom: 16px; }
.con-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.con-card { background: var(--panel); border: 1px solid var(--line); border-top: 4px solid var(--navy-2); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 12px; align-content: start; box-shadow: 0 1px 2px rgba(17, 24, 39, .04); min-width: 0; }
.con-card.is-live { border-top-color: var(--live); }
.con-card.is-here { box-shadow: 0 0 0 2px var(--info-line); }
.con-card-top { display: flex; gap: 10px; align-items: flex-start; }
.con-card-top .grow { min-width: 0; flex: 1; }
.con-card h3 { font-size: 16px; color: var(--navy); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.con-card-top small { color: var(--muted); font-size: 12px; }
.con-card-status { display: flex; flex-wrap: wrap; gap: 6px; min-height: 20px; }
.con-card .kv dd { text-align: right; }
.con-last { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-top: 1px solid var(--line); padding-top: 8px; }
.steps { margin: 12px 0 0 18px; display: grid; gap: 8px; font-size: 13.5px; color: var(--text-2); }
.steps .btn { vertical-align: middle; }
.sub-h { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 16px 0 8px; }
details.adv { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
details.adv summary { cursor: pointer; font-weight: 600; color: var(--accent-2); font-size: 13px; }
details.adv[open] summary { margin-bottom: 10px; }
.danger-zone { border-color: var(--bad-line); }
.danger-zone h3 { color: var(--bad-text); }
@media (max-width: 640px) { .con-grid { grid-template-columns: minmax(0, 1fr); } }
