: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; }
.offline.updated { background: var(--info-bg); color: var(--info-text); border-bottom-color: var(--info-line); }
.offline.updated .btn { margin: 0 4px; }
.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); }
.notice.ok { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok-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; max-height: calc(100vh - 16px); overflow-y: auto; 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; }
/* drone & phone cameras */
.feed { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel-2); }
.feed + .feed { margin-top: 8px; }
.feed.on { border-color: color-mix(in srgb, var(--live) 55%, var(--line)); }
.feed.off { opacity: .6; }
.feed .info { min-width: 0; display: grid; gap: 6px; }
.feed .info .row { gap: 8px; }
.feed .info small { display: block; overflow: hidden; text-overflow: ellipsis; }
.feed .ok-text { color: var(--ok-text); font-weight: 600; }
.feed-qr { width: 96px; height: 96px; padding: 4px; border-radius: 9px; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; cursor: zoom-in; color: #333; }
.feed-qr svg { width: 100%; height: 100%; }
.feed-qr.feed-phone { background: var(--panel); color: var(--text-2); cursor: default; }
.feed-qr.feed-phone svg { width: 40px; height: 40px; }
.phone-steps .input-row { display: flex; gap: 8px; }
.phone-steps .input-row input { flex: 1; min-width: 0; }
.feed-help-list { margin: 0 0 4px 18px; display: grid; gap: 6px; font-size: 13.5px; }
/* AI Director */
.dir-head { gap: 10px; margin-bottom: 12px; }
.dir-why { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46ch; }
.dir-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; align-items: start; }
@media (max-width: 1100px) { .dir-wrap { grid-template-columns: 1fr; } }
.dir-main { display: grid; gap: 12px; min-width: 0; }
.dir-stage { position: relative; aspect-ratio: 16 / 9; background: #0b0d12; border-radius: 10px; overflow: hidden; user-select: none; touch-action: none; }
.dir-stage.drawing { cursor: crosshair; }
.dir-pic { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; }
.dir-over { position: absolute; inset: 0; pointer-events: none; }
.dir-over > div { position: absolute; border-radius: 3px; }
.dir-over span { position: absolute; left: 0; top: 0; font-size: 11px; font-weight: 700; color: #fff; padding: 1px 6px; border-bottom-right-radius: 5px; white-space: nowrap; }
.dir-zone { border: 2px solid var(--c); background: color-mix(in srgb, var(--c) 10%, transparent); }
.dir-zone span { background: var(--c); }
.dir-zone.drawing { border-style: dashed; }
.dir-zone.next { box-shadow: 0 0 0 3px #fff; }
.dir-motion { border: 2px dashed #facc15; }
.dir-motion span { background: #facc15; color: #111 !important; top: auto !important; bottom: 0; }
.dir-subject { border: 2px solid #22d3ee; }
.dir-subject span { background: #22d3ee; color: #111 !important; }
.dir-note { position: absolute; left: 0; right: 0; bottom: 10px; text-align: center; color: #e5e7eb; font-size: 13px; text-shadow: 0 1px 2px #000; pointer-events: none; }
.dir-now { display: grid; gap: 10px; }
.dir-meter { display: grid; grid-template-columns: 110px 1fr 60px; gap: 10px; align-items: center; font-size: 13px; }
.dir-meter em { font-style: normal; text-align: right; font-variant-numeric: tabular-nums; }
.dir-bar { position: relative; height: 10px; background: var(--panel-3); border-radius: 5px; }
.dir-bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); border-radius: 5px; transition: width .3s; }
.dir-bar b { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text); }
.dir-tights { gap: 6px; }
.dir-next { margin: 0; font-size: 14px; }
.dir-log { display: grid; gap: 4px; font-size: 13px; max-height: 260px; overflow: auto; border-top: 1px solid var(--line); padding-top: 8px; }
.dir-side { display: grid; gap: 12px; }
.dir-card { display: grid; gap: 9px; }
.dir-tight { display: flex; gap: 6px; align-items: center; border-left: 4px solid var(--c); padding-left: 8px; }
.dir-tight select { flex: 1; min-width: 0; }
.dir-rng { display: grid; grid-template-columns: 110px 1fr 58px; gap: 8px; align-items: center; font-size: 12.5px; color: var(--text-2); }
.dir-rng b { text-align: right; font-size: 12px; color: var(--text); }
.dir-mics { display: flex; flex-wrap: wrap; gap: 4px; }
.dz-vtime { display: grid; grid-template-columns: 1fr auto; gap: 6px; align-items: center; margin-top: 6px; }
.dz-vtime > span { grid-column: 1 / -1; font-size: 12px; }
.dz-vtime video { grid-column: 1 / -1; width: 100%; max-height: 130px; background: #0b0d12; border-radius: 6px; object-fit: contain; }
.dz-vtime input[type=range] { width: 100%; }
.dz-vtime .btn { grid-column: 1 / -1; justify-self: start; }
.dir-follows { border-left: 4px solid var(--c); padding-left: 8px; margin-top: -4px; font-size: 12.5px; }
.dir-game { margin: 0; font-size: 14px; }
/* operated tight cameras: the operator link, and what the AI thinks of each shot */
.dir-op { border-left: 4px solid var(--c); padding-left: 8px; display: grid; gap: 4px; }
.dir-op .copy-row code { font-size: 11.5px; }
.dir-shots { display: flex; flex-wrap: wrap; gap: 8px; align-items: stretch; margin-bottom: 8px; }
.dir-sw { display: inline-block; width: 11px; height: 11px; border-radius: 3px; vertical-align: -1px; border: 1px solid rgba(0,0,0,.2); }
.dir-shot { border-left: 4px solid var(--c); background: var(--panel-2, rgba(127,127,127,.08)); border-radius: 6px; padding: 6px 10px; display: grid; gap: 1px; min-width: 180px; font-size: 13px; }
.dir-shot.good { box-shadow: inset 0 0 0 1px #16a34a55; }
.dir-shot.good span { color: #16a34a; font-weight: 600; }
.dir-shot.bad span { color: #ea580c; }
.dir-shot.cue { box-shadow: inset 0 0 0 2px #16a34a; }
.dir-shot.cue span { color: #16a34a; font-weight: 800; }
.dir-mic { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 3px 8px; border-radius: 99px; border: 1px solid var(--line-2); cursor: pointer; color: var(--text-2); }
.dir-mic input { display: none; }
.dir-mic.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.dir-tight-mics { border-left: 4px solid var(--c); padding: 0 0 2px 8px; margin-top: -4px; }
.dir-ear span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dir-ear .dir-bar i { background: #64748b; transition: width .15s; }
.dir-ear.talk .dir-bar i { background: var(--ok, #16a34a); }
.dir-ear.talk em { color: var(--ok-text, #166534); font-weight: 700; }
.dir-bar b.v { background: var(--warn, #d97706); }

/* SuperSource (like an ATEM's) */
.ss-head { gap: 10px; margin-bottom: 12px; }
.ss-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 14px; align-items: start; }
@media (max-width: 1100px) { .ss-wrap { grid-template-columns: 1fr; } }
.ss-main { display: grid; gap: 10px; min-width: 0; }
.ss-stage { position: relative; aspect-ratio: 16 / 9; background: #0b0d12; border-radius: 10px; overflow: hidden; user-select: none; touch-action: none; }
.ss-pic { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; }
.ss-stage.dim .ss-pic { opacity: 0; }
.ss-pic { transition: opacity .2s; }
.ss-stage.moving .ss-pic { opacity: .3; }
.ss-note { position: absolute; left: 0; right: 0; bottom: 10px; text-align: center; color: #aab2c0; font-size: 13px; pointer-events: none; }
.ss-boxes { position: absolute; inset: 0; }
.ss-box { position: absolute; border: 2px solid var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); cursor: move; border-radius: 2px; transition: left var(--ssd, 0s) cubic-bezier(.65, 0, .35, 1), top var(--ssd, 0s) cubic-bezier(.65, 0, .35, 1), width var(--ssd, 0s) cubic-bezier(.65, 0, .35, 1), height var(--ssd, 0s) cubic-bezier(.65, 0, .35, 1); }
.ss-stage:not(.dim) .ss-box { background: transparent; }
.ss-box.off { border-style: dashed; opacity: .45; }
.ss-box.sel { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--c); z-index: 2; }
.ss-n { position: absolute; left: 0; top: 0; background: var(--c); color: #fff; font-weight: 800; font-size: 12px; padding: 1px 6px; border-bottom-right-radius: 5px; }
.ss-src { position: absolute; left: 6px; bottom: 4px; right: 18px; color: #fff; font-size: 11px; text-shadow: 0 1px 2px #000; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss-h { position: absolute; right: -7px; bottom: -7px; width: 14px; height: 14px; background: #fff; border: 2px solid var(--c); border-radius: 3px; cursor: nwse-resize; }
.ss-layouts { display: flex; flex-wrap: wrap; gap: 8px; }
.ss-lay { position: relative; display: flex; }
.ss-lay > button:first-child, .ss-add { display: grid; justify-items: center; gap: 4px; width: 112px; padding: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 9px; cursor: pointer; font: inherit; font-size: 11.5px; color: var(--text-2); }
.ss-lay.on > button:first-child { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent); color: var(--text); }
.ss-lay-more { position: absolute; top: 2px; right: 2px; }
.ss-add { align-content: center; min-height: 86px; border-style: dashed; }
.ss-thumb { width: 100px; height: 56px; background: #0b0d12; border-radius: 4px; }
.ss-picprev { margin-top: 6px; height: 64px; border-radius: 6px; border: 1px solid var(--line); background: #0b0d12 center / cover no-repeat; }
.ss-picprev.vid { display: flex; align-items: center; justify-content: center; gap: 6px; color: #e5e7eb; font-size: 12px; }
.ss-side { display: grid; gap: 12px; }
.ss-card { display: grid; gap: 9px; }
.ss-tabs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.ss-tabs button { font: inherit; font-size: 12.5px; font-weight: 650; padding: 6px 0; border-radius: 7px; border: 1px solid var(--line); border-top: 3px solid var(--c); background: var(--panel-2); color: var(--text-2); cursor: pointer; opacity: .65; }
.ss-tabs button.on { opacity: 1; }
.ss-tabs button.sel { background: var(--panel); color: var(--text); box-shadow: inset 0 0 0 1px var(--c); opacity: 1; }
.ss-rng { display: grid; grid-template-columns: 78px 1fr 46px; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); flex: 1; }
.ss-rng b { text-align: right; font-size: 12px; color: var(--text); }
.ss-sub { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3, var(--text-2)); margin-top: 4px; }
.ss-quick { gap: 6px; }

/* Remote cameras dashboard (the director's room) */
.rc-head { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; margin-bottom: 14px; }
.rc-card { display: grid; gap: 10px; align-content: start; }
.rc-card .row { gap: 8px; }
.rc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.rc-tile { background: var(--panel); border: 2px solid var(--line); border-radius: var(--radius); padding: 10px; display: grid; gap: 8px; min-width: 0; align-content: start; }
.rc-tile.program { border-color: var(--live); box-shadow: 0 0 0 2px color-mix(in srgb, var(--live) 25%, transparent); }
.rc-tile.preview { border-color: var(--ok); }
.rc-top { display: flex; align-items: center; gap: 6px; min-width: 0; }
.rc-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.rc-stage { position: relative; background: #0b0d12; border-radius: 8px; overflow: hidden; aspect-ratio: 16 / 9; }
.rc-vid, .rc-av { position: absolute; inset: 0; }
.rc-av video { width: 100%; height: 100%; object-fit: contain; display: block; }
.rc-meter { position: absolute; right: 6px; top: 8px; bottom: 8px; width: 6px; border-radius: 3px; background: rgba(255,255,255,.12); overflow: hidden; display: flex; align-items: flex-end; }
.rc-meter i { display: block; width: 100%; height: 0; background: #22c55e; transition: height .06s linear; }
.rc-meter i.hot { background: #ef4444; }
.rc-over { position: absolute; inset: 0; display: grid; place-items: center; color: #aab2c0; font-size: 13px; text-align: center; padding: 12px; pointer-events: none; }
.rc-flag { position: absolute; left: 8px; top: 8px; padding: 3px 8px; border-radius: 6px; background: rgba(0,0,0,.7); color: #fff; font-size: 12px; font-weight: 650; display: inline-flex; align-items: center; gap: 4px; }
.rc-flag.mic { left: auto; right: 20px; background: var(--live); }
.rc-flag.hear { top: auto; bottom: 8px; background: var(--accent); }
.rc-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.rc-bars i { width: 3px; background: var(--line-2); border-radius: 1px; }
.rc-bars i:nth-child(1) { height: 25%; } .rc-bars i:nth-child(2) { height: 50%; } .rc-bars i:nth-child(3) { height: 75%; } .rc-bars i:nth-child(4) { height: 100%; }
.rc-bars.b1 i:nth-child(-n+1) { background: #ef4444; }
.rc-bars.b2 i:nth-child(-n+2) { background: #f59e0b; }
.rc-bars.b3 i:nth-child(-n+3), .rc-bars.b4 i { background: #22c55e; }
.rc-line { line-height: 1.5; min-height: 18px; }
.rc-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.rc-btns .btn { justify-content: center; padding-left: 6px; padding-right: 6px; }
.rc-btns .btn.on { background: var(--live); border-color: var(--live); color: #fff; }
.rc-btns .danger-text { color: var(--bad-text); }
.rc-wait { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; }
.rc-qr { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 4px; cursor: pointer; line-height: 0; }
.rc-qr svg { width: 72px; height: 72px; }
.rc-obs { display: flex; align-items: center; gap: 6px; border-top: 1px solid var(--line); padding-top: 8px; min-width: 0; }
.rc-obs .icon-btn.on { color: var(--live); }
.rc-vol { flex: 1; min-width: 60px; max-width: 140px; }
.btn.on-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.feed-preview { position: relative; background: #000; border-radius: 10px; overflow: hidden; aspect-ratio: 16 / 9; }
.feed-preview video { width: 100%; height: 100%; object-fit: contain; display: block; }
.feed-preview .badge { position: absolute; top: 8px; left: 8px; }
.feed-obs { font-size: 12.5px; flex-wrap: wrap; }
.feed-help ol { margin: 10px 0 8px 18px; display: grid; gap: 6px; font-size: 13px; color: var(--text-2); }
#cameras .card-head { flex-wrap: wrap; row-gap: 8px; }
#cameras .card-head h3 { white-space: nowrap; }
@media (max-width: 640px) {
  .feed { grid-template-columns: minmax(0, 1fr) auto; }
  .feed-qr { display: none; }
}
@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); }
/* penalty shootout */
/* Race clocks */
.ck-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .ck-grid { grid-template-columns: 1fr; } }
.ck-card { border-left: 6px solid var(--c); }
.ck-edit { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ck-edit input[type=color] { width: 38px; height: 34px; padding: 2px; flex: none; }
.ck-edit .ck-in-name { flex: 2 1 160px; font-weight: 700; }
.ck-edit .ck-in-short { flex: 0 1 90px; }
.ck-edit .ck-in-dist { flex: 1 1 100px; }
.ck-main { display: flex; align-items: baseline; gap: 14px; margin: 10px 0 2px; flex-wrap: wrap; }
.ck-time { font-size: clamp(40px, 6vw, 72px); font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: .01em; line-height: 1; }
.ck-st { font-size: 12px; font-weight: 800; letter-spacing: .1em; padding: 3px 9px; border-radius: 6px; background: var(--line); color: var(--muted); }
.st-running .ck-st { background: var(--ok-bg, #dcfce7); color: var(--ok-text, #166534); }
.st-countdown .ck-time, .st-countdown .ck-st { color: var(--warn-text); }
.st-countdown .ck-st { background: var(--warn-bg); }
.st-stopped .ck-st { background: var(--bad-bg, #fee2e2); color: var(--bad-text, #991b1b); }
.ck-sub { margin: 4px 0 10px; }
.ck-btns .ck-go { min-width: 150px; }
.ck-corners { display: grid; grid-template-columns: 1fr 1fr; }
.ck-corners button { white-space: nowrap; }
.sbx-pens.flash { box-shadow: 0 0 0 3px var(--accent); transition: box-shadow .3s; }
.sbx-pens-more { margin: -4px 0 12px; }
.sbx-pens-setup { gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.sbx-pens-setup .lbl { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 4px; }
.sbx-pen-row { display: grid; grid-template-columns: 150px 1fr 56px; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; border-left: 6px solid var(--tc); background: var(--panel-2); margin-bottom: 8px; }
.sbx-pen-row.turn { box-shadow: 0 0 0 2px var(--accent) inset; }
.sbx-pen-row.win { background: color-mix(in srgb, var(--ok) 14%, var(--panel-2)); }
.sbx-pen-row .nm { font-weight: 800; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sbx-pen-row > b { font-size: 34px; font-weight: 900; text-align: right; font-variant-numeric: tabular-nums; }
.pks { display: flex; gap: 6px; flex-wrap: wrap; }
.pk { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line-2); display: grid; place-items: center; font-style: normal; font-weight: 900; font-size: 16px; }
.pk.g { background: #16a34a; border-color: #16a34a; color: #fff; }
.pk.m { background: #dc2626; border-color: #dc2626; color: #fff; }
.pk.next { border-color: var(--accent); animation: pkpulse 1s infinite; }
@keyframes pkpulse { 50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 30%, transparent); } }
.sbx-pen-next { text-align: center; font-size: 18px; margin: 6px 0 10px; }
.sbx-pen-btns .btn { font-size: 22px; font-weight: 900; padding: 18px 10px; }
.sbx-pen-win { text-align: center; font-size: 22px; font-weight: 900; color: var(--ok); padding: 10px; }
.sbx-pens-sc { font-size: 22px; font-weight: 800; color: var(--accent); letter-spacing: .04em; margin-top: -4px; }
.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-mlogo { width: 18px; height: 18px; object-fit: contain; vertical-align: -4px; margin-right: 6px; }
.sbx-teams { display: grid; gap: 8px; max-height: 60vh; overflow: auto; }
.sbx-teams .sbx-team { grid-template-columns: auto minmax(0, 1fr); justify-items: stretch; text-align: left; gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); }
.sbx-team-f { display: grid; gap: 6px; min-width: 0; }
.sbx-disc.sm { width: 56px; height: 56px; border-width: 3px; box-shadow: none; }
.sbx-disc.sm span { font-size: 16px; }
.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, .desk-screen canvas { width: 100%; height: auto; display: block; min-height: 120px; -webkit-user-drag: none; }
.desk-screen.ctrl img, .desk-screen.ctrl canvas { 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); } }

/* Title designer: storyboard tabs and data-change triggers */
.dz-sb { display: flex; width: 100%; margin-bottom: 4px; }
.dz-sb button { flex: 1; padding-left: 4px; padding-right: 4px; white-space: nowrap; }
.dz-chg-on { display: grid; gap: 2px; max-height: 190px; overflow-y: auto; padding: 6px 8px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--panel-2); }
.dz-chg-on .check { font-size: 12.5px; }
.dz-tl-head .seg button { white-space: nowrap; padding: 0 10px; }

/* ───────── Wire map ───────── */
.wm-page { display: grid; gap: 12px; }
.wm-head { gap: 8px; flex-wrap: wrap; }
.wm-head .tag { font-size: 11px; opacity: .8; margin-left: 4px; }
.wm-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 12px; height: calc(100vh - 190px); min-height: 440px; }
.wm-wrap > [data-part="svg"] { min-width: 0; border: 1px solid var(--line-2); border-radius: 12px; overflow: hidden; background: #fbfcfe; }
.wm-wrap > [data-part="side"] { min-width: 0; min-height: 0; }
.wm-svg { width: 100%; height: 100%; display: block; touch-action: none; user-select: none; cursor: grab; }
.wm-svg:active { cursor: grabbing; }
.wm-gl { stroke: #e7ebf3; stroke-width: 1; }
.wm-hint { font: 600 15px var(--font); fill: var(--muted); }
.wm-dev { cursor: move; }
.wm-box { fill: #fff; stroke: #cfd6e4; stroke-width: 1.5; filter: drop-shadow(0 2px 5px rgba(17, 24, 39, .1)); }
.wm-dev.sel .wm-box { stroke: var(--red); stroke-width: 3; }
.wm-name { font: 700 13px var(--font); fill: #fff; }
.wm-sub { font: 500 10.5px var(--font); fill: rgba(255, 255, 255, .78); }
.wm-prop { font: 600 10.5px var(--font); fill: #1f2937; }
.wm-prop .k { fill: #6b7280; font-weight: 500; }
.wm-load { font: 700 11px var(--font); fill: #c2410c; }
.wm-load.over { fill: #b91c1c; }
.wm-layers button:not(.on) { color: var(--muted); }
.wm-pload { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.wm-pload span { font-variant-numeric: tabular-nums; color: var(--muted); }
.wm-pload.over span { color: var(--bad-text); font-weight: 700; }
.wm-port { cursor: crosshair; }
.wm-port circle { stroke-width: 2.5; transition: r .1s; }
.wm-port:hover circle { r: 8.5; }
.wm-port text { font: 500 11px var(--font); fill: #374151; pointer-events: none; }
.wm-wire { fill: none; stroke-width: 3; stroke-linecap: round; }
.wm-hit { fill: none; stroke: transparent; stroke-width: 14; cursor: pointer; }
.wm-link.planned .wm-wire { stroke-dasharray: 8 6; opacity: .75; }
.wm-link.sel .wm-wire { stroke-width: 5.5; }
.wm-lab { cursor: pointer; }
.wm-lab rect { fill: #fff; stroke-width: 1.5; }
.wm-lab text { font: 700 11px var(--mono); fill: #111827; }
.wm-link.sel .wm-lab rect { stroke-width: 3; }
.wm-st { cursor: pointer; }
.wm-st circle { stroke-width: 2; }
.wm-st path { fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.wm-st .wm-dot { fill: #fff; stroke: none; }
.wm-link.planned .wm-st circle { fill: #fff; stroke: #94a3b8; }
.wm-link.connected .wm-st circle:first-of-type { fill: #f59e0b; stroke: #f59e0b; }
.wm-link.tested .wm-st circle { fill: #16a34a; stroke: #16a34a; }
.wm-temp { fill: none; stroke: var(--accent-2); stroke-width: 2.5; stroke-dasharray: 6 4; pointer-events: none; }
.wm-side { height: 100%; overflow-y: auto; border: 1px solid var(--line-2); border-radius: 12px; background: var(--panel); padding: 14px; box-sizing: border-box; }
.wm-h { font-size: 15px; color: var(--navy); display: flex; align-items: center; gap: 6px; }
.wm-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--text-2); }
.wm-legend i, .wm-pl i { display: inline-block; width: 18px; height: 4px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }
.wm-pl { font-size: 13px; padding: 3px 0; }
.wm-ports { display: grid; gap: 5px; }
.wm-prow { display: grid; grid-template-columns: minmax(0, 1fr) 104px 28px; gap: 4px; align-items: center; }
.wm-prow input, .wm-prow select { height: 32px; font-size: 12.5px; padding: 0 8px; }
.wm-ports > .btn { justify-self: start; }
.wm-prow { grid-template-columns: minmax(0, 1fr) 96px 28px 28px; }
.wm-prow .icon-btn.on { color: var(--ok-text); background: var(--ok-bg); }
.wm-peer { font-size: 11.5px; color: var(--muted); margin: -2px 0 2px 4px; cursor: pointer; }
.wm-peer:hover { color: var(--text); }
.wm-props { display: grid; gap: 5px; }
.wm-proprow { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.2fr) 30px 28px; gap: 4px; align-items: center; }
.wm-proprow input:not([type=checkbox]) { height: 32px; font-size: 12.5px; padding: 0 8px; }
.wm-onmap { display: grid; place-items: center; height: 32px; border-radius: 7px; cursor: pointer; color: var(--faint, #9ca3af); }
.wm-onmap input { position: absolute; opacity: 0; pointer-events: none; }
.wm-onmap:has(input:checked) { color: var(--ok-text); background: var(--ok-bg); }
.wm-quick { display: flex; flex-wrap: wrap; gap: 4px; }
.wm-quick .btn { padding: 0 8px; }
.wm-drow { cursor: pointer; }
.wm-dupip { color: var(--bad-text); font-weight: 700; }
.wm-drow:hover td { background: var(--panel-3); }
.wm-librow { display: flex; align-items: center; gap: 8px; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--line); }
.wm-route { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; margin: 10px 0 12px; padding: 10px; background: var(--panel-2); border-radius: 10px; font-size: 13px; }
.wm-route div { display: grid; min-width: 0; }
.wm-route span { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wm-route b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wm-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.wm-chip::before { content: ""; width: 14px; height: 4px; border-radius: 2px; background: var(--c); }
.wm-stseg button.on.planned { background: #64748b; }
.wm-stseg button.on.connected { background: #d97706; }
.wm-stseg button.on.tested { background: #16a34a; }
.wm-stseg.sm button { height: 28px; padding: 0 8px; font-size: 12px; }
.wm-filters { gap: 8px; flex-wrap: wrap; }
.wm-sum { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.wm-sum .stat b { font-size: 13px; }
.wm-tbl td { vertical-align: middle; }
.wm-tbl tr.tested td { background: var(--ok-bg); }
.wm-notes { max-width: 260px; font-size: 12.5px; color: var(--text-2); }
@media (max-width: 900px) {
  .wm-wrap { grid-template-columns: minmax(0, 1fr); height: auto; }
  .wm-wrap > [data-part="svg"] { height: 62vh; }
  .wm-side { height: auto; }
}
/* ── Sign-in & security ──────────────────── */
.login-or { display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: 12px; }
.login-or::before, .login-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.login-google, .login-line { display: flex; gap: 10px; justify-content: center; border: 1px solid var(--line-2); background: #fff; color: var(--text); }
.login-google .g { font: 800 18px/1 Arial, sans-serif; background: conic-gradient(#ea4335 0 25%, #fbbc05 0 50%, #34a853 0 75%, #4285f4 0); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-line { background: #06c755; border-color: #06c755; color: #fff; }
.login-line .l { font: 800 12px/1 Arial, sans-serif; background: #fff; color: #06c755; padding: 3px 5px; border-radius: 5px; }
.login .notice { font-size: 13px; }
.acct { display: grid; gap: 18px; }
.acct section { display: grid; gap: 8px; }
.acct h4 { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--navy); }
.acct-prov { padding: 6px 0; border-bottom: 1px solid var(--line); }
.tf-steps { margin: 0; padding-left: 20px; display: grid; gap: 14px; }
.tf-qr { margin: 10px 0 6px; }
.tf-qr svg { width: 200px; height: 200px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.tf-key { font-family: var(--mono); font-size: 13px; background: var(--panel-3); padding: 2px 6px; border-radius: 5px; user-select: all; }
.tf-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-top: 10px; }
.tf-codes code { font-family: var(--mono); font-size: 15px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 7px; padding: 6px 10px; text-align: center; letter-spacing: .05em; }
.sec-h { font-size: 14px; color: var(--navy); margin: 14px 0 4px; }
.sec-prov { border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: grid; gap: 10px; margin-top: 10px; }
.inv-form { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.sec-log { max-height: 360px; overflow: auto; }
.st-prog { height: 8px; border-radius: 99px; background: var(--panel-3); overflow: hidden; margin-top: 10px; }
.st-prog i { display: block; height: 100%; background: var(--accent-2); transition: width .3s; }
.sec-log tr.bad td { background: var(--bad-bg); }
@media (max-width: 900px) { .inv-form { grid-template-columns: 1fr 1fr; } }

/* ── Line-ups ─────────────────────────────── */
.lu-grid { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 16px; align-items: start; }
.lu-tlist { display: grid; gap: 6px; }
.lu-trow { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; text-align: left; font: inherit; color: inherit; }
.lu-trow:hover { border-color: var(--line-2); }
.lu-trow.sel { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(46, 58, 143, .14); }
.lu-trow i { width: 12px; height: 32px; border-radius: 4px; flex: none; }
.lu-trow .grow { display: grid; min-width: 0; }
.lu-trow b, .lu-trow small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lu-trow small { color: var(--muted); font-size: 12px; }
.lu-srcs { display: grid; gap: 8px; }
.lu-src { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; }
.lu-src .grow { grid-column: 1 / -1; display: grid; min-width: 0; }
.lu-src .grow b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.lu-src .grow small { font-size: 12px; color: var(--muted); }
.lu-src select { height: 30px; font-size: 12.5px; }
.lu-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.lu-head-form { display: grid; grid-template-columns: 2fr 1fr 70px 2fr 1.4fr 1fr; gap: 10px; align-items: end; }
.lu-tbl input { height: 32px; padding: 0 8px; font-size: 13px; }
.lu-tbl .lu-no { width: 56px; text-align: center; font-weight: 700; }
.lu-tbl .lu-pos { width: 72px; }
.lu-tbl td.c, .lu-tbl th.c { text-align: center; }
.lu-tbl td.mv { width: 30px; }
.lu-tbl tr.start td { background: #f3f8f4; }
.lu-ph { width: 34px; height: 34px; border-radius: 50%; border: 1px dashed var(--line-2); background: var(--panel-2) center / cover no-repeat; display: grid; place-items: center; color: var(--muted); cursor: pointer; }
.lu-pitch-wrap { max-width: 860px; }
.lu-pitch { position: relative; aspect-ratio: 100 / 64; border-radius: 12px; background: repeating-linear-gradient(90deg, #2f8a4b 0 10%, #2a7d44 10% 20%); overflow: hidden; touch-action: none; user-select: none; }
.lu-pitch svg { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; stroke: rgba(255,255,255,.7); stroke-width: .4; }
.lu-tok { position: absolute; transform: translate(-50%, -50%); display: grid; justify-items: center; gap: 2px; cursor: grab; width: 110px; }
.lu-tok.drag { cursor: grabbing; z-index: 2; }
.lu-tok .c { width: 38px; height: 38px; border-radius: 50%; background: var(--tc) center / cover no-repeat; color: #fff; display: grid; place-items: center; font-weight: 800; box-shadow: 0 0 0 2px #fff, 0 3px 8px rgba(0,0,0,.35); }
.lu-tok b { font-size: 11.5px; color: #fff; background: rgba(5,8,20,.7); padding: 0 6px; border-radius: 5px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lu-pv { max-height: 300px; overflow: auto; }
.lu-pv th { vertical-align: top; min-width: 120px; }
.lu-pv th select { height: 30px; font-size: 12.5px; margin-top: 4px; }
.lu-pv td { font-size: 12.5px; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.lu-scorer { border-left: 5px solid var(--tc); }
.lu-scbs { display: flex; flex-wrap: wrap; gap: 6px; }
.lu-scb { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line-2); background: #fff; border-radius: 9px; padding: 0 10px 0 4px; height: 34px; font-weight: 600; cursor: pointer; font-size: 13px; }
.lu-scb b { min-width: 26px; height: 26px; border-radius: 6px; display: grid; place-items: center; background: var(--tc); color: #fff; font-size: 12px; }
.lu-scb.sub { opacity: .75; }
.lu-scb.on { border-color: var(--ok); background: var(--ok-bg); box-shadow: 0 0 0 2px rgba(22,163,74,.2); opacity: 1; }
@media (max-width: 1100px) { .lu-grid { grid-template-columns: minmax(0, 1fr); } .lu-head-form { grid-template-columns: 1fr 1fr 1fr; } }

/* ── Big screen ───────────────────────────── */
.scr-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.scr-takes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.scr-take { display: grid; justify-items: start; gap: 2px; padding: 12px; border: 1.5px solid var(--line-2); border-radius: 12px; background: #fff; cursor: pointer; text-align: left; color: var(--text); font: inherit; }
.scr-take:hover { border-color: var(--accent); }
.scr-take b { font-size: 14px; }
.scr-take small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.scr-take.on { background: var(--live); border-color: var(--live); color: #fff; }
.scr-take.on small { color: rgba(255,255,255,.85); }
.scr-more .btn.on { background: var(--live); border-color: var(--live); color: #fff; }
.scr-more { display: grid; gap: 8px; margin-top: 12px; }
.scr-pv { position: relative; width: 100%; background: #000; border-radius: 10px; overflow: hidden; }
.scr-pv iframe { position: absolute; left: 0; top: 0; border: 0; transform-origin: 0 0; }
.scr-pics { display: grid; gap: 6px; }
.scr-pic { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px; }
.scr-pic.off { opacity: .5; }
.scr-pic .grow { flex: 1; display: grid; min-width: 0; }
.scr-pic .grow b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.scr-pic .grow small { font-size: 12px; color: var(--muted); }
.scr-pic input[type=number] { width: 84px; height: 32px; }
.scr-th { width: 64px; aspect-ratio: 16 / 9; border-radius: 6px; background: #0b1020 center / contain no-repeat; color: #fff; display: grid; place-items: center; flex: none; }
.scr-h4 { margin: 16px 0 8px; font-size: 13px; color: var(--navy); }
.gs-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.gs-tile { display: grid; gap: 2px; justify-items: start; padding: 6px 6px 8px; border: 1.5px solid var(--line-2); border-radius: 10px; background: #fff; cursor: pointer; text-align: left; font: inherit; color: var(--text); }
.gs-tile:hover { border-color: var(--accent); }
.gs-tile.on { border-color: var(--live); box-shadow: 0 0 0 3px rgba(232, 32, 42, .18); }
.gs-tile > b { font-size: 13px; padding-left: 2px; }
.gs-tile > small { font-size: 11px; color: var(--muted); padding-left: 2px; line-height: 1.25; }
.gs-pic { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; background: #0b1020; display: grid; place-items: center; color: #fff; margin-bottom: 4px; }
.gs-pic b { position: relative; font: 900 15px/1 Kanit, var(--font); letter-spacing: .02em; }
.gs-pic i { position: absolute; inset: 0; }
.gs-burst .gs-pic i { background: linear-gradient(110deg, #e11d48 0 48%, #be123c 48% 100%); }
.gs-slide .gs-pic i { top: 26%; bottom: 30%; background: #e11d48; transform: skewY(-6deg); box-shadow: 0 9px 0 #0b1020; }
.gs-zoom .gs-pic i { background: radial-gradient(circle at 50% 50%, #e11d48, #0b1020 72%); }
.gs-zoom .gs-pic b { text-shadow: 0 0 8px #fff; }
.gs-band .gs-pic { background: linear-gradient(#334155, #1e293b); }
.gs-band .gs-pic i { top: 60%; background: #e11d48; border-top: 2px solid #facc15; }
.gs-band .gs-pic b { align-self: end; margin-bottom: 4%; font-size: 11px; }
.gs-design .gs-pic { background: var(--panel-3); color: var(--accent-2); }
.gs-words { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 12px; align-items: center; }
.gs-words input:not([type]) { height: 32px; }
.gs-mine { background: var(--panel-2); border-radius: 10px; padding: 10px 12px; display: grid; gap: 8px; }
.gs-mine code { font-size: 11.5px; background: #fff; padding: 0 4px; border-radius: 4px; }
@media (max-width: 1100px) { .scr-grid { grid-template-columns: minmax(0, 1fr); } }

/* ── Website home page editor ─────────────── */
.hp-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.hp-preview { position: sticky; top: 0; }
.hp-frame { aspect-ratio: 16 / 11; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; background: #fff; position: relative; }
.hp-frame iframe { position: absolute; left: 0; top: 0; width: 200%; height: 200%; border: 0; transform: scale(.5); transform-origin: 0 0; }
.hp-cons { display: grid; gap: 6px; margin: 4px 0 10px; }
.hp-con { display: flex; align-items: center; gap: 8px; padding: 7px 10px; background: var(--panel-2); border-radius: 9px; font-size: 13px; flex-wrap: wrap; }
.hp-con .dot:not(.live) { background: #cbd2e0; }
.hp-pins { display: grid; gap: 6px; }
.hp-pin { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.hp-pin.off { opacity: .55; }
.hp-pin .grow { display: grid; min-width: 0; flex: 1; }
.hp-pin .grow b, .hp-pin .grow small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hp-pin .grow small { color: var(--muted); font-size: 12px; }
.hp-thumb { width: 72px; aspect-ratio: 16 / 9; border-radius: 7px; background: var(--panel-3) center / cover no-repeat; display: grid; place-items: center; color: var(--muted); flex: none; }
@media (max-width: 1100px) { .hp-grid { grid-template-columns: minmax(0, 1fr); } .hp-preview { position: static; } }

/* ── Virtual 3D ─────────────────────────── */
.vr-page { display: grid; gap: 12px; }
.vr-head { gap: 10px; }
.vr-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 12px; height: calc(100vh - 190px); min-height: 460px; }
.vr-stage-wrap { min-width: 0; min-height: 0; background: #0b1020; border-radius: 12px; display: grid; place-items: center; overflow: hidden; }
.vr-stage { position: relative; background: repeating-conic-gradient(#1b2436 0 25%, #151d2d 0 50%) 0 0 / 24px 24px; touch-action: none; user-select: none; cursor: crosshair; overflow: hidden; }
.vr-stage > img, .vr-stage > .vr-3d, .vr-stage > svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.vr-stage > img:not([src]) { display: none; }
.vr-3d, .vr-poly, .vr-nopic, .vr-hint, .vr-loupe { pointer-events: none; }
.vr-poly polygon { fill: rgba(240, 171, 252, .12); stroke: #f0abfc; stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.vr-nopic { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: #a5b0c6; font-size: 13px; padding: 24px; line-height: 1.6; }
.vr-nopic b { color: #fff; font-size: 15px; }
.vr-dot { position: absolute; width: 16px; height: 16px; margin: -8px 0 0 -8px; padding: 0; border-radius: 50%; border: 2px solid #fff; background: rgba(232, 32, 42, .55); cursor: grab; box-shadow: 0 0 0 1px rgba(0, 0, 0, .5); }
.vr-dot::after { content: ""; position: absolute; left: 50%; top: 50%; width: 2px; height: 2px; margin: -1px; background: #fff; border-radius: 50%; }
.vr-dot b { position: absolute; left: 14px; top: -20px; background: #e8202a; color: #fff; font-size: 11px; line-height: 18px; min-width: 18px; padding: 0 4px; border-radius: 9px; }
.vr-dot.on { background: rgba(37, 99, 235, .6); }
.vr-dot.on b { background: #2563eb; }
.vr-loupe { position: absolute; width: 150px; height: 150px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 6px 18px rgba(0, 0, 0, .55); display: none; }
.vr-hint { position: absolute; left: 10px; top: 10px; right: 10px; }
.vr-hint span { display: inline-block; background: rgba(15, 23, 42, .86); color: #fff; padding: 6px 11px; border-radius: 8px; font-size: 12.5px; font-weight: 600; }
.vr-hint span.bad { background: rgba(180, 20, 30, .92); }
.vr-wrap > [data-part="side"] { min-width: 0; min-height: 0; }
.vr-side { height: 100%; overflow-y: auto; display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 12px; padding-right: 2px; }
.vr-side .field { min-width: 0; }
.vr-side div.field { display: grid; gap: 6px; font-size: 12.5px; color: var(--muted); font-weight: 600; justify-items: start; }
.vr-side div.field > span small { font-weight: 400; color: var(--faint); }
.vr-side div.field > .copy-row { justify-self: stretch; }
.vr-side div.field .hint { font-weight: 400; }
.vr-side details > summary { cursor: pointer; }
.vr-list { display: grid; gap: 5px; }
.vr-row { display: grid; grid-template-columns: 8px 18px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 9px; border: 1px solid var(--line); background: #fff; cursor: pointer; }
.vr-row:hover { border-color: var(--line-2); }
.vr-row.sel { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(46, 58, 143, .14); }
.vr-row.on { background: #fff5f5; }
.vr-row .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.vr-row .dot:not(.live):not(.ok):not(.warn) { background: #cbd2e0; }
.vr-row .warn-text { color: var(--warn-text); }
.vr-diag { width: 100%; max-width: 280px; height: auto; background: var(--panel-2); border-radius: 10px; border: 1px solid var(--line); }
.vr-diag rect { fill: #dff3e4; stroke: #16a34a; stroke-width: 1.5; }
.vr-diag text { font: 700 11px var(--font); fill: #b4141e; }
.vr-diag .cam { cursor: pointer; }
.vr-diag .cam circle { fill: #fff; stroke: var(--line-2); stroke-width: 1.5; }
.vr-diag .cam path { fill: #8a93a6; }
.vr-diag .cam.on circle { fill: var(--accent-2); stroke: var(--accent-2); }
.vr-diag .cam.on path { fill: #fff; }
.vr-corners { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; font-size: 12.5px; }
.vr-corners .tag.ok { background: var(--ok-bg); color: var(--ok-text); border-color: var(--ok-line); }
.vr-fit dd.good { color: var(--ok-text); font-weight: 700; }
.vr-fit dd.meh { color: var(--warn-text); font-weight: 700; }
.vr-why { background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn-text); border-radius: 9px; padding: 8px 10px; font-size: 13px; font-weight: 600; }
@media (max-width: 900px) {
  .vr-wrap { grid-template-columns: minmax(0, 1fr); height: auto; }
  .vr-stage-wrap { height: 58vw; min-height: 220px; }
  .vr-side { height: auto; }
}
@media print {
  .wm-wrap { display: block; height: auto; }
  .wm-wrap > [data-part="side"] { display: none; }
  .wm-wrap > [data-part="svg"] { height: 17cm; border: 1px solid #ccc; break-inside: avoid; }
  .wm-gl { stroke: none; }
  .wm-tbl tr.tested td { background: #fff; }
  .wm-stseg button:not(.on) { display: none; }
}

/* ───────── Bookings ───────── */
.bk-tabs .badge { margin-left: 6px; }
.bk-list { display: grid; gap: 12px; }
.bk-req { display: grid; gap: 6px; border-left: 5px solid var(--line-2); }
.bk-req.new { border-left-color: var(--red); }
.bk-req.contacted { border-left-color: #d97706; }
.bk-req.confirmed { border-left-color: #16a34a; }
.bk-req.declined { opacity: .7; }
.bk-when { font-size: 18px; color: var(--navy); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bk-what { margin: 0; color: var(--text-2); }
.bk-details { margin: 4px 0; white-space: pre-wrap; background: var(--panel-2); border-radius: 8px; padding: 10px 12px; font-size: 14px; }
.bk-who { font-size: 14.5px; }
.bk-notes { margin: 6px 0 0; font-size: 13.5px; color: var(--info-text); background: var(--info-bg); border-radius: 8px; padding: 8px 10px; display: flex; gap: 6px; align-items: flex-start; }
.bk-acts { gap: 6px; flex-wrap: wrap; margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.bk-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.bk-dow { text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); padding: 2px 0; }
.bk-dow.we { color: var(--red); }
.bk-day { min-height: 96px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 4px; display: flex; flex-direction: column; gap: 3px; cursor: pointer; min-width: 0; }
.bk-day:hover { border-color: var(--accent-2); }
.bk-day.blank { visibility: hidden; }
.bk-day.past { opacity: .55; }
.bk-day.today { box-shadow: inset 0 0 0 2px var(--accent-2); }
.bk-day.part { background: #fffaf0; }
.bk-day.full { background: #fdf2f2; }
.bk-day .n { font-weight: 700; font-size: 13px; display: flex; justify-content: space-between; color: var(--text-2); }
.bk-day .n small { font-size: 11px; color: var(--muted); font-weight: 600; }
.bk-ev { display: block; width: 100%; text-align: left; border: 0; border-radius: 5px; padding: 2px 6px; font-size: 12px; font-weight: 600; color: #fff; background: var(--navy-2); cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk-ev.tentative { background: #d97706; }
.bk-brand { border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: grid; gap: 10px; }
@media (max-width: 760px) { .bk-day { min-height: 64px; } .bk-ev { font-size: 10.5px; padding: 1px 4px; } }

/* ───────── Kaengom Photo ───────── */
.con-types { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 560px) { .con-types { grid-template-columns: 1fr; } }
.con-type { display: block; cursor: pointer; position: relative; }
.con-type input { position: absolute; opacity: 0; }
.con-type > span { display: grid; gap: 6px; height: 100%; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 11px; background: var(--panel-2); }
.con-type b { display: flex; align-items: center; gap: 8px; color: var(--navy); font-size: 15px; }
.con-type small { color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.con-type input:checked + span { border-color: var(--accent); box-shadow: 0 0 0 2px var(--info-line); background: var(--info-bg); }
.con-type input:focus-visible + span { outline: 2px solid var(--accent); }
.con-type-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 26px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.page-head + .con-type-head { margin-top: 4px; }
.con-type-head h3 { display: flex; align-items: center; gap: 8px; font-size: 16px; color: var(--navy); }
.con-type-empty { padding: 4px 0 8px; }
.con-card.is-photo { border-top-color: #0f766e; }
.con-stats { margin-bottom: 14px; }

.ph-page { display: flex; flex-direction: column; height: 100%; min-height: 0; }
#ph-top { flex: none; padding: 14px 18px 0; border-bottom: 1px solid var(--line); background: var(--panel); }
.ph-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ph-head .stat { min-width: 80px; padding: 6px 10px; }
.ph-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.ph-tools select { width: auto; height: 34px; padding: 0 28px 0 10px; background-position: calc(100% - 16px) 14px, calc(100% - 11px) 14px; }
.ph-tools .seg small { color: inherit; opacity: .7; font-weight: 500; margin-left: 2px; }
.ph-size { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.ph-size input { width: 110px; }
.ph-person { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 4px; border-radius: 999px; background: var(--info-bg); color: var(--info-text); border: 1px solid var(--info-line); font-weight: 600; font-size: 13px; }
.ph-person img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
.ph-bulk { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 44px; padding: 8px 0; font-size: 12.5px; }
.ph-bulk.on { font-size: 13px; }
.ph-bulk.on b { margin-right: 6px; }
.ph-scroll { flex: 1; min-height: 0; overflow: auto; padding: 12px 18px 30px; }
.ph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--sz, 170px), 1fr)); gap: 8px; outline: none; }
.ph-cell { position: relative; aspect-ratio: 3 / 2; background: #1c2130; border-radius: 8px; overflow: hidden; cursor: pointer; user-select: none; transition: box-shadow .08s; }
.ph-cell img { width: 100%; height: 100%; object-fit: contain; display: block; }
.ph-cell.sel { box-shadow: 0 0 0 3px var(--accent); }
.ph-cell.focus { box-shadow: 0 0 0 3px var(--accent), 0 0 0 6px var(--info-line); }
.ph-cell.rej img { opacity: .35; }
.ph-cell.new::after { content: "NEW"; position: absolute; left: 6px; bottom: 6px; background: var(--red); color: #fff; font-size: 10px; font-weight: 800; padding: 1px 6px; border-radius: 4px; letter-spacing: .05em; }
.ph-b i { position: absolute; font-style: normal; display: inline-flex; align-items: center; gap: 2px; font-size: 11px; font-weight: 700; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .7); }
.ph-b .ic { width: 13px; height: 13px; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .6)); }
.ph-flag { top: 6px; left: 6px; width: 20px; height: 20px; border-radius: 50%; justify-content: center; text-shadow: none !important; }
.ph-flag.pick { background: var(--ok); }
.ph-flag.reject { background: #c4141e; }
.ph-pub { top: 6px; right: 6px; }
.ph-pub:not(.on) { width: 9px; height: 9px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .7); top: 9px; right: 9px; }
.ph-pub.on { color: #4ade80 !important; }
.ph-stars { bottom: 5px; right: 6px; color: #fcd34d !important; letter-spacing: -1px; }
.ph-meta { bottom: 5px; left: 6px; gap: 4px !important; }
.ph-cell.new .ph-meta { left: 44px; }
.ph-more { display: flex; justify-content: center; padding: 18px 0; }
#ph-empty { margin: 30px auto; max-width: 560px; }

.ph-loupe { position: fixed; inset: 0; z-index: 90; background: #0c0f16; display: grid; grid-template-columns: minmax(0, 1fr) 300px; color: #e6e9f0; }
@media (max-width: 800px) { .ph-loupe { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; } .ph-l-side { max-height: 42vh; } }
.ph-l-stage { position: relative; display: flex; align-items: center; justify-content: center; min-height: 0; min-width: 0; overflow: hidden; padding: 18px 56px; }
.ph-l-pic { position: relative; display: inline-block; line-height: 0; }
.ph-l-pic img { display: block; width: auto; height: auto; max-width: calc(100vw - 412px); max-height: calc(100vh - 36px); user-select: none; -webkit-user-drag: none; }
@media (max-width: 800px) { .ph-l-pic img { max-width: calc(100vw - 112px); max-height: calc(58vh - 36px); } }
.ph-fbox { position: absolute; border: 2px solid rgba(255, 255, 255, .85); border-radius: 6px; background: transparent; cursor: pointer; box-shadow: 0 0 0 1px rgba(0, 0, 0, .4); padding: 0; }
.ph-fbox:hover { border-color: #fcd34d; background: rgba(252, 211, 77, .12); }
.ph-l-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 42px; height: 64px; border: 0; border-radius: 10px; background: rgba(255, 255, 255, .08); color: #fff; font-size: 30px; cursor: pointer; }
.ph-l-nav:hover:not(:disabled) { background: rgba(255, 255, 255, .18); }
.ph-l-nav:disabled { opacity: .2; cursor: default; }
.ph-l-nav.prev { left: 8px; }
.ph-l-nav.next { right: 8px; }
.ph-l-close { position: absolute; top: 10px; right: 10px; color: #fff; background: rgba(255, 255, 255, .1); }
.ph-l-side { background: #151a24; border-left: 1px solid #252c3a; overflow: auto; }
.ph-l-info { display: flex; flex-direction: column; gap: 10px; padding: 18px; min-height: 100%; }
.ph-l-info h3 { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-l-info .hint { color: #9aa3b5; }
.ph-l-info .sub-h { color: #9aa3b5; margin: 8px 0 0; }
.ph-l-info .check { color: #d7dbe4; font-size: 13px; }
.ph-l-info .set-row { border-color: #252c3a; }
.ph-l-info .kbd { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .2); color: #cdd3df; }
.ph-l-info .btn.ghost { color: #d7dbe4; }
.ph-l-info .btn.ghost:hover { background: rgba(255, 255, 255, .08); }
.ph-l-stars { display: flex; gap: 2px; }
.ph-l-stars button { border: 0; background: none; font-size: 24px; line-height: 1; color: #4b5468; cursor: pointer; padding: 2px; }
.ph-l-stars button.on { color: #fcd34d; }
.ph-l-flag button { height: 32px; font-size: 12.5px; }
.ph-l-flag .kbd { margin-left: 4px; }

.ph-editor { position: fixed; inset: 0; z-index: 95; background: #0c0f16; display: grid; grid-template-columns: minmax(0, 1fr) 320px; color: #e6e9f0; }
@media (max-width: 800px) { .ph-editor { grid-template-columns: 1fr; grid-template-rows: 55vh auto; overflow: auto; } }
.ph-e-stage { display: grid; place-items: center; min-height: 0; overflow: hidden; padding: 12px; }
.ph-e-wrap { position: relative; line-height: 0; }
.ph-e-canvas { display: block; box-shadow: 0 8px 30px rgba(0, 0, 0, .5); }
.ph-e-crop { position: absolute; border: 2px solid #fff; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .55); cursor: move; touch-action: none; background-image: linear-gradient(rgba(255, 255, 255, .35) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .35) 1px, transparent 1px); background-size: 33.333% 33.333%; background-position: -1px -1px; }
.ph-e-crop i { position: absolute; width: 18px; height: 18px; border: 3px solid #fff; }
.ph-e-crop [data-h="nw"] { left: -4px; top: -4px; border-right: 0; border-bottom: 0; cursor: nwse-resize; }
.ph-e-crop [data-h="ne"] { right: -4px; top: -4px; border-left: 0; border-bottom: 0; cursor: nesw-resize; }
.ph-e-crop [data-h="sw"] { left: -4px; bottom: -4px; border-right: 0; border-top: 0; cursor: nesw-resize; }
.ph-e-crop [data-h="se"] { right: -4px; bottom: -4px; border-left: 0; border-top: 0; cursor: nwse-resize; }
.ph-e-side { background: #151a24; border-left: 1px solid #252c3a; padding: 16px 18px; overflow: auto; display: flex; flex-direction: column; gap: 6px; }
.ph-e-side h3 { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-e-side .sub-h { color: #9aa3b5; margin: 12px 0 4px; }
.ph-e-side .hint { color: #9aa3b5; }
.ph-e-side select { height: 30px; border-radius: 8px; border: 1px solid #39425a; background: #1d2330; color: #e6e9f0; padding: 0 6px; }
.ph-e-side .icon-btn { color: #cdd3df; }
.ph-e-side .icon-btn:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.ph-e-side .btn.ghost { color: #d7dbe4; }
.ph-e-side .btn.ghost:hover { background: rgba(255, 255, 255, .08); }
.ph-sl { display: grid; gap: 2px; font-size: 12.5px; color: #cdd3df; }
.ph-sl span { display: flex; justify-content: space-between; }
.ph-sl b { font-variant-numeric: tabular-nums; color: #fcd34d; font-weight: 600; }
.ph-sl input { width: 100%; accent-color: #8ea2ff; }
.ph-looks { display: flex; flex-wrap: wrap; gap: 6px; }
.ph-e-foot { display: flex; gap: 8px; align-items: center; margin-top: auto; padding: 14px 0 4px; position: sticky; bottom: -16px; background: #151a24; }

.pe-qr { display: grid; place-items: center; }
.pe-qr svg { width: min(260px, 70vw); height: auto; border-radius: 8px; border: 1px solid var(--line); }
.pe-wmprev { display: block; width: 100%; max-width: 480px; border-radius: 8px; margin: 12px 0 6px; background: var(--panel-3); }
.cam-recent { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.cam-recent li.bad { color: var(--bad-text); }
.pe-field { display: grid; gap: 6px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.pe-field .seg { width: max-content; max-width: 100%; }
.login-new { margin: 0; text-align: center; font-size: 13.5px; color: var(--muted); }
.login-new a { font-weight: 700; }
/* a field only bots fill in */
.hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; opacity: 0; }

/* ───────── Kaengom Storage ───────── */
.st-tabs { margin-bottom: 16px; flex-wrap: wrap; }
.st-tabs button small, .st-modes button small { opacity: .7; font-weight: 600; margin-left: 4px; }
.st-tabs .ic { margin-right: 4px; vertical-align: -2px; }
.st-modes { margin-bottom: 10px; flex-wrap: wrap; }
.st-opts { margin-bottom: 10px; }
.st-sel { width: auto; min-width: 240px; max-width: 100%; }
.st-scanbar { display: flex; gap: 8px; margin-bottom: 16px; }
.st-scanbar input { flex: 1; height: 52px; font-size: 20px; font-family: var(--mono); letter-spacing: .04em; border-width: 2px; }
.st-scanbar input:focus { border-color: var(--ok); box-shadow: 0 0 0 4px rgba(22, 163, 74, .15); }
.st-scanbar .btn { height: 52px; }
.st-scan-grid { align-items: start; }
.st-panel h3 { margin-bottom: 8px; }
.st-panel.open { border: 2px solid var(--ok); }
.st-count { margin: 6px 0 10px; color: var(--text-2); }
.st-count b { font-size: 22px; color: var(--text); }
.st-list { display: grid; gap: 2px; }
.st-li { display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-bottom: 1px solid var(--line); min-width: 0; text-align: left; background: none; border-left: 0; border-right: 0; border-top: 0; font: inherit; color: inherit; }
.st-li .grow { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.st-li .check { min-width: 0; }
button.st-li { cursor: pointer; width: 100%; }
button.st-li:hover { background: var(--panel-3); }
.st-recent h3 { margin-bottom: 8px; }
.st-rc { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.st-rc i { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--faint); }
.st-rc.ok i { background: var(--ok); } .st-rc.warn i { background: var(--warn); } .st-rc.err i { background: var(--live); } .st-rc.info i { background: var(--accent); }
.st-rc.err .grow { color: var(--bad-text); }
.st-bars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 4px 0 12px; }
.st-bar { position: relative; display: grid; gap: 2px; text-align: left; padding: 8px 10px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--panel-2); cursor: pointer; overflow: hidden; font: inherit; color: inherit; }
.st-bar span { font-size: 12px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.st-bar b { font-size: 18px; font-variant-numeric: tabular-nums; }
.st-bar i { position: absolute; left: 0; bottom: 0; height: 5px; width: var(--p); background: var(--ok); }
.st-bar.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--info-line); background: var(--info-bg); }
.st-done { margin-top: 10px; }
.st-done summary { cursor: pointer; color: var(--muted); font-weight: 600; }
.st-filters { margin-bottom: 12px; }
.st-filters input { flex: 1; min-width: 200px; }
.st-filters select { width: auto; }
.st-selbar { margin-bottom: 8px; min-height: 34px; }
.st-tbl tr.sel td { background: var(--info-bg); }
.st-nm { display: inline-flex; align-items: center; gap: 4px; }
.st-sp { display: inline-block; width: 28px; }
.st-card { display: flex; gap: 14px; align-items: flex-start; }
.st-card img, .st-ph { width: 84px; height: 84px; border-radius: 10px; object-fit: cover; flex: none; background: var(--panel-3); display: grid; place-items: center; color: var(--faint); }
.st-card h3 { font-size: 17px; }
.st-card p { margin: 3px 0 0; }
.st-hist { display: grid; gap: 6px; font-size: 13px; max-height: 420px; overflow: auto; }
.st-evs { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
a.st-ev { color: inherit; display: grid; gap: 6px; }
a.st-ev:hover { border-color: var(--accent); }
.st-mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; font-size: 11px; color: var(--muted); font-weight: 700; }
.st-mini span { position: relative; padding-bottom: 6px; }
.st-mini i { position: absolute; left: 0; bottom: 0; height: 4px; width: 100%; background: var(--panel-3); border-radius: 2px; overflow: hidden; }
.st-mini i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--p); background: var(--ok); }
.st-adds { margin: 6px 0 10px; border: 1px solid var(--line-2); border-radius: 9px; padding: 4px; }
#st-add-q { margin-bottom: 4px; }
.stack { display: grid; gap: 16px; align-content: start; }
/* the result of a scan, big enough to see from across the room */
.st-flash { position: fixed; left: 50%; top: 18%; transform: translate(-50%, -10px) scale(.96); z-index: 300; display: flex; align-items: center; gap: 14px; padding: 16px 22px; border-radius: 16px; color: #fff; font-size: 20px; font-weight: 700; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; max-width: min(720px, calc(100vw - 32px)); }
.st-flash.on { opacity: 1; transform: translate(-50%, 0) scale(1); }
.st-flash b { font-size: 34px; line-height: 1; }
.st-flash.ok { background: #15803d; } .st-flash.warn { background: #b45309; } .st-flash.err { background: #b91c1c; } .st-flash.info { background: var(--accent-2); }
/* the camera */
.st-cam { position: fixed; inset: 0; z-index: 250; background: #000; display: flex; flex-direction: column; }
.st-cam video { flex: 1; min-height: 0; width: 100%; object-fit: cover; }
.st-cam-frame { position: absolute; left: 50%; top: 42%; width: min(64vw, 320px); aspect-ratio: 1; transform: translate(-50%, -50%); border: 3px solid rgba(255, 255, 255, .9); border-radius: 18px; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .35); pointer-events: none; }
.st-cam-msg { position: absolute; top: calc(14px + env(safe-area-inset-top)); left: 12px; right: 12px; text-align: center; color: #fff; font-weight: 700; font-size: 17px; padding: 10px 14px; border-radius: 12px; background: rgba(0, 0, 0, .55); }
.st-cam-msg.ok { background: rgba(21, 128, 61, .92); } .st-cam-msg.warn { background: rgba(180, 83, 9, .92); } .st-cam-msg.err { background: rgba(185, 28, 28, .92); }
.st-cam-bar { display: flex; gap: 10px; padding: 14px 16px calc(16px + env(safe-area-inset-bottom)); background: #000; }
.st-cam-bar .btn { height: 48px; font-size: 16px; }
@media (max-width: 640px) { .st-scanbar input { font-size: 17px; } .st-bars { grid-template-columns: 1fr 1fr 1fr; } .st-sel { min-width: 0; flex: 1; } }

.st-stats .stat { text-decoration: none; color: inherit; }
.st-stats .stat:hover { border-color: var(--accent); }
.st-stats .stat.info b { color: var(--info-text); } .st-stats .stat.warn b { color: var(--warn-text); } .st-stats .stat.bad b { color: var(--bad-text); }
.st-evs.one { grid-template-columns: 1fr; gap: 10px; }
.st-ev.done { opacity: .6; }
.st-warn { border-color: var(--bad-line); background: var(--bad-bg); }
.st-warn .st-li { border-color: var(--bad-line); }
.st-imp th select { width: 100%; min-width: 120px; height: 30px; font-size: 12px; }
.st-imp th small { display: block; font-weight: 500; margin-top: 2px; }
.st-imp td { font-size: 12.5px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ph-why { top: 30px; left: 6px; background: rgba(185, 28, 28, .85); padding: 1px 6px; border-radius: 4px; font-size: 10px !important; text-shadow: none !important; max-width: calc(100% - 12px); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; display: block !important; }
.ph-cell:not(.rej) .ph-why { background: rgba(180, 83, 9, .85); }
.ph-l-auto { display: flex; gap: 6px; align-items: flex-start; }
.ac-opts .set-row { padding: 8px 0; }
.ac-prev { margin-top: 12px; min-height: 60px; }

.st-th { width: 28px; height: 28px; border-radius: 6px; object-fit: cover; flex: none; background: var(--panel-3); vertical-align: middle; }
.st-tbl .st-th { width: 34px; height: 34px; }
.st-pic { width: 120px; height: 120px; border-radius: 12px; overflow: hidden; flex: none; display: grid; place-items: center; background: var(--panel-3); border: 2px solid transparent; }
.st-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.st-pic.add { cursor: pointer; border: 2px dashed var(--line-2); color: var(--muted); gap: 4px; align-content: center; font: inherit; }
.st-pic.add:hover, .st-pic.over { border-color: var(--accent); color: var(--accent); background: var(--info-bg); }
.st-pic.add .ic { width: 28px; height: 28px; }
.st-photo-row { margin-top: 12px; }
.st-photo-panel .st-pic { width: 180px; height: 180px; }
.st-flash img { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; border: 2px solid rgba(255, 255, 255, .7); }
@media (max-width: 640px) { .st-pic { width: 88px; height: 88px; } .st-photo-panel .st-pic { width: 120px; height: 120px; } }

/* ───────── Notes ───────── */
.nt-wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; max-width: 1000px; }
.nt-brief .card-head { flex-wrap: wrap; }
.nt-brief textarea, .nt-new textarea { width: 100%; resize: vertical; }
.nt-bar { gap: 8px; }
.nt-tags, .nt-filter { max-width: 100%; overflow-x: auto; }
.nt-tags button, .nt-filter button { flex: none; }
.nt-count { margin: -4px 0 8px; }
.nt-list { display: grid; gap: 10px; }
.nt-day { margin: 6px 0 -2px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.nt-card { background: var(--panel); border: 1px solid var(--line); border-left: 5px solid var(--line-2); border-radius: 10px; padding: 10px 12px; display: grid; gap: 6px; min-width: 0; }
.nt-card.t-todo { border-left-color: var(--accent); }
.nt-card.t-issue { border-left-color: var(--red); }
.nt-card.t-client { border-left-color: var(--warn); }
.nt-card.t-info { border-left-color: var(--ok); }
.nt-card.pin { background: #fffcf0; }
.nt-card.done .nt-text { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--faint); }
.nt-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.nt-tag { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.t-todo .nt-tag { color: var(--info-text); }
.t-issue .nt-tag { color: var(--bad-text); }
.t-client .nt-tag { color: var(--warn-text); }
.t-info .nt-tag { color: var(--ok-text); }
.nt-pin { display: inline-flex; color: var(--warn); }
.nt-who { font-size: 12.5px; color: var(--muted); }
.nt-acts { display: inline-flex; gap: 2px; opacity: .55; transition: opacity .12s; }
.nt-card:hover .nt-acts, .nt-acts:focus-within { opacity: 1; }
.nt-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14.5px; }
.nt-foot { font-size: 12px; color: var(--muted); }
.nt-dash { display: grid; gap: 8px; margin-top: 12px; }
.nt-dash .nt-card { padding: 7px 10px; gap: 4px; }
.nt-dash .nt-text { font-size: 13px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.icon-btn.on { color: var(--warn); }

/* ───────── Storyboard ───────── */
.print-only { display: none; }
.sbd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--w, 250px)), 1fr)); gap: 20px 16px; align-items: start; }
.sbd-fr { position: relative; display: grid; gap: 6px; min-width: 0; cursor: pointer; border-radius: 10px; padding: 6px; margin: -6px; transition: background .12s; }
.sbd-fr:hover { background: var(--panel-2); }
.sbd-fr.dragging, .sbd-tbl tr.dragging { opacity: .35; }
.sbd-fr.drop-before::before, .sbd-fr.drop-after::after { content: ''; position: absolute; top: 4px; bottom: 4px; width: 4px; border-radius: 2px; background: var(--accent); }
.sbd-fr.drop-before::before { left: -6px; }
.sbd-fr.drop-after::after { right: -6px; }
.sbd-fr.drop-on .sbd-pic { outline: 3px dashed var(--accent); outline-offset: 2px; }
.sbd-pic { position: relative; background: var(--well); border-radius: 8px; overflow: hidden; border: 1px solid var(--line-2); }
.sbd-pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.sbd-fr.done .sbd-pic { border-color: var(--ok); box-shadow: inset 0 0 0 2px var(--ok); }
.sbd-none { position: absolute; inset: 0; display: flex; flex-wrap: wrap; align-content: center; justify-content: center; gap: 6px; padding: 8px; }
.sbd-num, .sbd-dur { position: absolute; left: 6px; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 6px; background: rgba(17, 24, 39, .78); color: #fff; font-weight: 700; font-size: 12.5px; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.sbd-num { top: 6px; }
.sbd-dur { bottom: 6px; height: 21px; font-size: 11.5px; font-weight: 600; }
.sbd-tick { position: absolute; right: 6px; bottom: 6px; background: rgba(255, 255, 255, .92); }
.sbd-tick.on { background: var(--ok); }
.sbd-tools { position: absolute; right: 6px; top: 6px; display: flex; gap: 2px; background: rgba(255, 255, 255, .94); border-radius: 8px; padding: 2px; opacity: 0; transition: opacity .12s; }
.sbd-fr:hover .sbd-tools, .sbd-tools:focus-within { opacity: 1; }
@media (hover: none) { .sbd-tools { opacity: 1; } }
.sbd-meta { display: flex; flex-wrap: wrap; gap: 4px; }
.sbd-chip { display: inline-flex; align-items: center; gap: 4px; height: 21px; padding: 0 7px; border-radius: 6px; background: var(--panel-3); color: var(--text-2); font-size: 11.5px; font-weight: 600; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.sbd-chip.sbd-sc { background: var(--navy-2); color: #fff; }
.sbd-chip.sbd-cm { background: var(--info-bg); color: var(--info-text); }
.sbd-chip .ic { width: 12px; height: 12px; flex: none; }
.sbd-action { font-size: 13.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.sbd-audio { display: flex; gap: 5px; font-size: 12.5px; color: var(--text-2); font-style: italic; white-space: pre-wrap; overflow-wrap: anywhere; }
.sbd-audio .ic { flex: none; width: 13px; height: 13px; margin-top: 2px; }
.sbd-notes { font-size: 12px; color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.sbd-trans { justify-self: end; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); }
.sbd-add { display: grid; place-content: center; justify-items: center; gap: 2px; border: 2px dashed var(--line-2); border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; font: inherit; padding: 8px; }
.sbd-add:hover { border-color: var(--accent); color: var(--accent); }
.sbd-add small { font-size: 11.5px; }
.sbd-grid.drop-here, .sbd-tbl.drop-here, .sbd .empty.drop-here { outline: 3px dashed var(--accent); outline-offset: 6px; border-radius: 8px; }
.sbd-tbl tr[data-fr] { cursor: pointer; }
.sbd-tbl tr[data-fr]:hover td { background: var(--panel-2); }
.sbd-tbl tr.done td { background: var(--ok-bg); }
.sbd-tbl tr.drop-before td { box-shadow: inset 0 3px 0 var(--accent); }
.sbd-tbl tr.drop-after td { box-shadow: inset 0 -3px 0 var(--accent); }
.sbd-tbl td { vertical-align: top; }
.sbd-thumb { position: relative; height: 84px; max-width: 150px; background: var(--well); border-radius: 6px; overflow: hidden; }
.sbd-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sbd-txt { min-width: 220px; max-width: 460px; }
.sbd-txt > div + div { margin-top: 4px; }
.sbd-edit { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 18px; align-items: start; }
.sbd-edit .sbd-pic { margin: 0 auto; }
.sbd-look { display: grid; gap: 10px; align-content: start; }
@media (max-width: 760px) { .sbd-edit { grid-template-columns: minmax(0, 1fr); } }

/* sketch */
.sk-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.sk-tools .seg button { display: inline-grid; place-items: center; min-width: 38px; padding: 0 9px; }
.sk-colors { display: flex; gap: 6px; }
.sk-colors button { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line-2); cursor: pointer; padding: 0; }
.sk-colors button.on { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--accent); }
.sk-dot { display: inline-block; border-radius: 50%; background: currentColor; }
.sk-stage { position: relative; margin: 0 auto; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; background: #fff; }
.sk-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.sk-ink { touch-action: none; cursor: crosshair; }

/* Play: the animatic */
.sbp { position: fixed; inset: 0; z-index: 150; background: #05070d; color: #fff; display: grid; grid-template-rows: minmax(0, 1fr) auto auto auto; animation: fade .15s; }
.sbp-stage { position: relative; align-self: center; justify-self: center; overflow: hidden; background: #111827; }
.sbp-a, .sbp-b, .sbp-black { position: absolute; inset: 0; }
.sbp-a img, .sbp-b img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sbp-none { display: grid; place-items: center; width: 100%; height: 100%; font-size: clamp(48px, 12vw, 140px); font-weight: 800; color: rgba(255, 255, 255, .14); }
.sbp-black { background: #000; opacity: 0; pointer-events: none; }
.sbp-cap { padding: 12px 20px 2px; width: min(1100px, 100%); margin: 0 auto; }
.sbp-top { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.sbp-meta, .sbp-t, .sbp-name { color: rgba(255, 255, 255, .65); }
.sbp-t { font-variant-numeric: tabular-nums; }
.sbp-action { font-size: 18px; margin-top: 4px; min-height: 1.45em; white-space: pre-wrap; }
.sbp-audio { color: #fde68a; font-style: italic; min-height: 1.4em; white-space: pre-wrap; }
.sbp-bar { height: 4px; background: rgba(255, 255, 255, .15); margin: 8px 20px 0; border-radius: 2px; overflow: hidden; }
.sbp-bar i { display: block; height: 100%; width: 0; background: var(--red); }
.sbp-ctl { display: flex; align-items: center; gap: 8px; padding: 10px 16px 14px; }
.sbp .icon-btn { color: #fff; }
.sbp .icon-btn:hover { background: rgba(255, 255, 255, .12); }

@media print {
  .print-only { display: block; }
  .sbd-print-head { font-size: 15px; margin-bottom: 14px; }
  .sbd-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 16px 12px; }
  .sbd-grid.square { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
  .sbd-grid.tall { grid-template-columns: repeat(5, minmax(0, 1fr)) !important; }
  .sbd-fr { break-inside: avoid; margin: 0; padding: 0; }
  .sbd-none, .sbd-tools, .sbd-add, .sbd-tick:not(.on) { display: none !important; }
  .sbd-pic { border-color: #999; }
  .nt-card { break-inside: avoid; }
}

/* ───────── Screen mapping ───────── */
.mp { display: grid; grid-template-columns: 250px minmax(0, 1fr) 300px; gap: 14px; height: calc(100vh - 106px); min-height: 520px; }
.mp-col { display: grid; gap: 12px; align-content: start; overflow-y: auto; min-height: 0; padding-bottom: 8px; }
.mp-list { display: grid; gap: 4px; padding: 12px; }
.mp-list .card-head { margin-bottom: 4px; }
.mp-list .card-head h3 { font-size: 14px; }
.mp-row { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px; border-radius: 8px; border: 1px solid transparent; background: none; text-align: left; font: inherit; color: var(--text); cursor: pointer; min-width: 0; }
.mp-row:hover { background: var(--panel-2); }
.mp-row.on { background: var(--info-bg); border-color: var(--info-line); }
.mp-row.off { opacity: .5; }
.mp-row .grow { min-width: 0; flex: 1; display: grid; }
.mp-row b { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-row small { color: var(--muted); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-row .icon-btn.on { color: var(--warn); }
.mp-dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.mp-out { display: inline-flex; align-items: center; gap: 2px; color: var(--faint); font-size: 12px; font-weight: 700; }
.mp-out.on { color: var(--ok); }
.bad-t { color: var(--bad-text); }
.mp-main { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; padding: 10px; min-width: 0; min-height: 0; }
.mp-bar { flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.mp-stage { position: relative; min-height: 0; border-radius: 10px; overflow: hidden; background: #0b0e16 repeating-conic-gradient(#10141f 0 25%, #0b0e16 0 50%) 0 0 / 24px 24px; }
.mp-stage canvas, .mp-stage img { position: absolute; display: block; }
.mp-stage img[hidden] { display: none; }
.mp-stage svg { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.mp-msg { position: absolute; inset: auto 12px 12px; padding: 10px 12px; border-radius: 8px; background: var(--bad-bg); color: var(--bad-text); }
.mp-foot { padding: 8px 4px 0; font-size: 12.5px; color: var(--muted); min-height: 24px; }
.mp-frame { fill: none; stroke: rgba(255, 255, 255, .35); stroke-dasharray: 6 5; pointer-events: none; }
.mp-ol { fill: transparent; stroke-width: 1.5; cursor: pointer; }
.mp-ol.sel { stroke-width: 2.5; cursor: move; fill: rgba(255, 255, 255, .04); }
.mp-lbl { font: 700 12px "Segoe UI", sans-serif; text-anchor: middle; dominant-baseline: middle; paint-order: stroke; fill: #fff !important; stroke: rgba(0, 0, 0, .8); stroke-width: 3.5px; pointer-events: none; }
.mp-lbl.l { text-anchor: start; fill: #fff; }
.mp-hd { fill: #fff; stroke: var(--accent); stroke-width: 2.5; cursor: grab; }
.mp-hd.on { fill: #facc15; stroke: #111827; }
.mp-hd.k { fill: #facc15; stroke: #111827; stroke-width: 2; }
.mp-gp { fill: #22d3ee; stroke: #0b0e16; stroke-width: 1.5; cursor: grab; }
.mp-grid { fill: none; stroke: rgba(34, 211, 238, .6); stroke-width: 1; pointer-events: none; }
.mp-rot { fill: #f59e0b; stroke: #111827; stroke-width: 2; cursor: alias; }
.mp-in { fill: rgba(59, 75, 181, .12); stroke: rgba(255, 255, 255, .7); stroke-width: 1.5; cursor: pointer; }
.mp-in.sel { fill: rgba(250, 204, 21, .12); stroke: #facc15; stroke-width: 2.5; cursor: move; }
.mp-mask { fill: rgba(250, 204, 21, .1); stroke: #facc15; stroke-dasharray: 5 4; pointer-events: none; }
.mp-props { display: grid; gap: 10px; padding: 14px; }
.mp-props h6 { margin: 6px 0 -2px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.mp-props h6 small { text-transform: none; letter-spacing: 0; font-weight: 400; }
.mp-g4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.mp-g4 label, .mp-corners label { display: grid; gap: 2px; font-size: 11.5px; color: var(--muted); min-width: 0; }
.mp-g4 input, .mp-corners input { width: 100%; min-width: 0; height: 30px; padding: 0 6px; }
.mp-g4 input[type=color] { padding: 2px; }
.mp-corners { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px 10px; }
.mp-corners label { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.mp-corners label span { grid-column: 1 / -1; }
.mp-corners label.on span { color: var(--accent); font-weight: 700; }
.mp-rng { display: grid; grid-template-columns: 86px minmax(0, 1fr) 46px; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); }
.mp-rng b { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.mp-outrow { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; }
.mp-outrow .dot { margin-top: 6px; }
.mp-disps { display: flex; flex-wrap: wrap; gap: 8px; }
.mp-disp { display: grid; gap: 2px; padding: 10px 14px; border: 2px solid var(--line-2); border-radius: 10px; cursor: pointer; min-width: 130px; }
.mp-disp input { display: none; }
.mp-disp:has(input:checked) { border-color: var(--accent); background: var(--info-bg); }
.mp-disp small { color: var(--muted); }
@media (max-width: 1280px) { .mp { grid-template-columns: 220px minmax(0, 1fr) 270px; } }
@media (max-width: 1050px) {
  .mp { grid-template-columns: minmax(0, 1fr); height: auto; }
  .mp-main { height: 70vh; order: -1; }
  .mp-col { overflow: visible; }
}

/* ───────── Composition & Screen mapping: a dark desk, like Resolume Arena ───────── */
.arena {
  --bg: #141518; --panel: #1f2126; --panel-2: #262930; --panel-3: #30343c; --line: #33373f; --line-2: #41464f;
  --text: #e4e6eb; --text-2: #c3c7d0; --muted: #8d939f; --faint: #6c727e;
  --accent: #3fb8e8; --accent-2: #2a95c2; --info-bg: rgba(63, 184, 232, .14); --info-line: rgba(63, 184, 232, .45); --info-text: #7fd3f5;
  --ok-bg: rgba(34, 197, 94, .14); --ok-text: #6ee7a0; --bad-bg: rgba(239, 68, 68, .15); --bad-text: #fca5a5; --warn-bg: rgba(245, 158, 11, .15); --warn-text: #fcd34d;
  color: var(--text); background: var(--bg);
}
.arena input[type=text], .arena input[type=number], .arena input[type=search], .arena input:not([type]), .arena select, .arena textarea { background-color: #15171b; color: var(--text); border-color: var(--line-2); color-scheme: dark; }
.arena input:focus, .arena select:focus, .arena textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(63, 184, 232, .18); }
.arena input[type=color] { background: var(--panel-3); border-color: var(--line-2); }
.arena input[type=range], .arena input[type=checkbox] { accent-color: var(--accent); }
.arena .btn { background: var(--panel-3); border-color: var(--line-2); color: var(--text); }
.arena .btn:hover { background: #3a3f48; border-color: #4b515c; }
.arena .btn.on, .arena .btn.primary { background: var(--accent-2); border-color: var(--accent); color: #fff; }
.arena .btn.danger { background: #b91c1c; border-color: #dc2626; color: #fff; }
.arena .btn.ghost { background: transparent; border-color: transparent; }
.arena .card { background: var(--panel); border-color: var(--line); box-shadow: none; }
.arena .card-head h3 { color: var(--text); }
.arena .seg { border-color: var(--line-2); }
.arena .seg button { background: var(--panel-3); color: var(--text-2); border-color: var(--line-2); }
.arena .seg button.on { background: var(--accent-2); color: #fff; }
.arena .check, .arena .field > span { color: var(--text-2); }
.arena a { color: var(--accent); }
.arena .icon-btn { color: var(--muted); }
.arena .icon-btn:hover { background: var(--panel-3); color: var(--text); }
.arena .copy-row { background: var(--panel-2); border-color: var(--line-2); }

/* the Composition page */
.ar { height: 100%; min-height: 560px; display: grid; grid-template-rows: auto minmax(170px, 1fr) minmax(270px, 42%); gap: 6px; padding: 8px; box-sizing: border-box; font-size: 13px; }
.ar-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 6px 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.ar-title { display: inline-flex; gap: 8px; align-items: center; font-size: 14px; letter-spacing: .02em; }
.ar-fader { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); }
.ar-fader input { width: 140px; }
.ar-fader b { min-width: 38px; font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 600; }
.ar-bpm { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }
.ar-bpm input { width: 76px; height: 28px; padding: 0 8px; border-radius: 5px; }
.ar-beat { width: 12px; height: 12px; border-radius: 50%; background: #3a3f48; transition: background .05s; }
.ar-beat.on { background: #f59e0b; box-shadow: 0 0 8px #f59e0b; }
.ar-btn { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--panel-3); color: var(--text); font: 600 12.5px/1 var(--font); cursor: pointer; white-space: nowrap; text-decoration: none; }
.ar-btn:hover { background: #3a3f48; color: #fff; }
.ar-btn.danger, .ar-clear { color: #fca5a5; }
.ar-shows { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.ar-shows.ok { color: #6ee7a0; }
.ar-gridwrap { overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; min-height: 0; }
.ar-grid { border-collapse: separate; border-spacing: 3px; }
.ar-grid th { font-weight: 600; }
.ar-corner { position: sticky; left: 0; top: 0; z-index: 3; background: var(--panel); padding: 2px; text-align: left; }
.ar-col { position: sticky; top: 0; z-index: 2; background: #2a2e36; color: var(--text-2); height: 26px; min-width: 112px; padding: 0 8px; border-radius: 4px; cursor: pointer; font-size: 12px; text-align: left; white-space: nowrap; }
.ar-col:hover { background: #343944; color: #fff; }
.ar-col.live { background: #1d4f63; color: #bfeaff; }
.ar-col.add { background: none; min-width: 0; padding: 0; }
.ar-lh { position: sticky; left: 0; z-index: 1; width: 170px; min-width: 170px; background: #23262d; border-radius: 4px; padding: 6px 8px; text-align: left; vertical-align: top; }
.ar-lh.sel { box-shadow: inset 0 0 0 1px var(--accent); }
tr.byp .ar-cell:not(.empty) { opacity: .4; }
.ar-lrow { display: flex; align-items: center; gap: 4px; }
.ar-lname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; font-size: 12.5px; }
.ar-mini { width: 20px; height: 20px; border-radius: 4px; border: 1px solid var(--line-2); background: var(--panel-3); color: var(--text-2); font: 700 10.5px/1 var(--font); cursor: pointer; padding: 0; }
.ar-mini:hover { color: #fff; border-color: #5b616c; }
.ar-mini.dim { opacity: .45; }
.ar-mini.on-b { background: #b45309; border-color: #f59e0b; color: #fff; }
.ar-mini.on-s { background: #1d4ed8; border-color: #60a5fa; color: #fff; }
.ar-lop { display: block; margin: 7px 0 3px; height: 14px; }
.ar-lmeta { font-size: 11px; color: var(--muted); font-weight: 500; white-space: nowrap; }
.ar-cell { width: 112px; min-width: 112px; height: 88px; padding: 0; vertical-align: top; background: #1a1c21; border-radius: 4px; cursor: pointer; position: relative; border: 2px solid transparent; box-sizing: border-box; }
.ar-cell:hover { border-color: #4b515c; }
.ar-cell.empty { border: 1px dashed #343944; }
.ar-cell.empty span { display: grid; place-items: center; height: 100%; color: #4b515c; font-size: 18px; }
.ar-cell.empty:hover span { color: var(--accent); }
.ar-cell.empty.sel { border: 1px solid var(--accent); }
.ar-cell.pad { width: auto; min-width: 0; background: none; border: 0; cursor: default; }
.ar-thumb { height: 62px; background: #0d0f12 center / cover no-repeat; border-radius: 2px 2px 0 0; display: grid; place-items: center; color: #6c727e; position: relative; overflow: hidden; }
.ar-cname { padding: 3px 6px; font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.ar-cell.sel { border-color: var(--accent); }
.ar-cell.live { border-color: #22c55e; box-shadow: 0 0 12px rgba(34, 197, 94, .35); }
.ar-cell.live .ar-cname { background: #166534; color: #dcfce7; }
.ar-cell.drop { border-color: #f59e0b; }
.ar-prog { position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: #22c55e; }
.ar-empty { padding: 30px; text-align: center; color: var(--muted); }
.ar-bottom { display: grid; grid-template-columns: 340px minmax(0, 1fr) 300px; gap: 6px; min-height: 0; }
.ar-panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; display: flex; flex-direction: column; min-height: 0; min-width: 0; overflow: hidden; }
.ar-panel > [data-part] { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.ar-ph { display: flex; align-items: center; gap: 8px; padding: 5px 8px; background: #23262d; border-bottom: 1px solid var(--line); font-size: 12px; min-height: 36px; box-sizing: border-box; }
.ar-tabs { display: flex; gap: 2px; }
.ar-tabs button { height: 24px; padding: 0 10px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); font: 600 12px/1 var(--font); cursor: pointer; }
.ar-tabs button.on { background: var(--panel-3); color: #fff; }
.ar-tabs button:hover { color: #fff; }
.ar-form { padding: 8px 10px 12px; overflow-y: auto; display: grid; gap: 7px; align-content: start; }
.ar-form h6 { margin: 6px 0 0; font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.ar-f { display: grid; gap: 3px; min-width: 0; }
.ar-f > span { font-size: 11.5px; color: var(--muted); }
.ar-f input, .ar-f select { height: 28px; font-size: 12.5px; padding: 0 8px; border-radius: 5px; }
.ar-f select { padding-right: 26px; background-position: calc(100% - 14px) 12px, calc(100% - 9px) 12px; }
.ar-rng { display: grid; grid-template-columns: 78px minmax(0, 1fr) 48px; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); }
.ar-rng b { text-align: right; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.ar-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: end; }
.ar-checks { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12.5px; }
.ar-checks label { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.ar-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.ar-src { display: flex; align-items: center; gap: 6px; font-size: 12.5px; min-width: 0; overflow: hidden; white-space: nowrap; }
.ar-src input[type=color] { width: 34px; height: 24px; padding: 1px; }
.ar-hint { padding: 10px; color: var(--muted); font-size: 12.5px; margin: 0; }
.ar-monbox { flex: 1; min-height: 0; display: grid; place-items: center; background: #0b0c0f; padding: 6px; }
.ar-monbox canvas { display: block; background: #000; box-shadow: 0 0 0 1px #33373f; }
.ar-dim { color: var(--muted); font-variant-numeric: tabular-nums; }
.ar-items { overflow-y: auto; padding: 6px; display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px 6px; align-content: start; }
.ar-items .ar-hint { grid-column: 1 / -1; }
.ar-item { display: grid; gap: 3px; cursor: grab; font-size: 11px; color: var(--text-2); min-width: 0; }
.ar-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ar-ithumb { height: 50px; border-radius: 4px; background: #0d0f12 center / cover no-repeat; display: grid; place-items: center; color: #6c727e; border: 1px solid var(--line); }
.ar-item:hover .ar-ithumb { border-color: var(--accent); }
@media (max-width: 1250px) {
  .ar { grid-template-rows: auto minmax(200px, 1fr) auto; height: auto; }
  .ar-bottom { grid-template-columns: 320px minmax(0, 1fr); }
  .ar-props, .ar-mon { min-height: 300px; }
  .ar-browse { grid-column: 1 / -1; max-height: 240px; }
}
@media (max-width: 760px) { .ar-bottom { grid-template-columns: minmax(0, 1fr); } }

/* Screen mapping in the same desk */
.mp.arena { padding: 8px; height: 100%; min-height: 560px; box-sizing: border-box; gap: 8px; }
.mp.arena .mp-col { padding-bottom: 0; }
.mp.arena .card { border-radius: 8px; }
.mp.arena .mp-list, .mp.arena .mp-props { padding: 10px; }
.mp.arena .mp-row:hover { background: var(--panel-2); }
.mp.arena .mp-row.on { background: var(--info-bg); border-color: var(--info-line); }
.mp.arena .mp-row.sub { padding-left: 22px; }
.mp.arena .mp-props h6 { color: var(--accent); }
.mp.arena .mp-stage { background: #0b0c0f repeating-conic-gradient(#121418 0 25%, #0b0c0f 0 50%) 0 0 / 24px 24px; }
.mp-caret { width: 16px; color: var(--muted); font-size: 13px; flex: none; text-align: center; }

/* ───────── Chat (the console's people and the streaming PC) ───────── */
.chat-btn { position: relative; }
.chat-btn.on { background: var(--info-bg); color: var(--accent-2); }
.chat-n { position: absolute; top: 1px; right: 0; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--red); color: #fff; font: 700 10.5px/17px var(--font); text-align: center; box-shadow: 0 0 0 2px #fff; }
.chat { position: fixed; top: 58px; right: 0; bottom: 0; width: min(380px, 100vw); z-index: 60; display: flex; flex-direction: column; background: var(--panel); border-left: 1px solid var(--line); box-shadow: -12px 0 40px rgba(17, 24, 39, .14); animation: chat-in .16s ease; }
.chat[hidden] { display: none; }
@keyframes chat-in { from { transform: translateX(24px); opacity: 0; } }
.chat header { display: flex; align-items: center; gap: 4px; padding: 10px 10px 10px 16px; border-bottom: 1px solid var(--line); }
.chat header .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat header b { font-size: 15px; color: var(--navy); }
.chat header small { color: var(--muted); font-size: 12.5px; }
.chat-list { flex: 1; min-height: 0; overflow-y: auto; padding: 10px 14px; display: flex; flex-direction: column; gap: 2px; background: var(--panel-2); }
.chat-empty { margin: auto; text-align: center; color: var(--muted); line-height: 1.7; }
.chat-empty .ic { width: 28px; height: 28px; opacity: .5; }
.chat-day { align-self: center; margin: 10px 0 6px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.chat-msg { display: grid; gap: 2px; max-width: 86%; align-self: flex-start; margin-top: 8px; }
.chat-msg.cont { margin-top: 1px; }
.chat-msg.me { align-self: flex-end; justify-items: end; }
.chat-who { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); min-width: 0; }
.chat-who b { color: var(--text); font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-who time { font-variant-numeric: tabular-nums; }
.chat-av { width: 22px; height: 22px; border-radius: 50%; flex: none; display: grid; place-items: center; color: #fff; font: 700 9.5px/1 var(--font); font-style: normal; }
.chat-av .ic { width: 13px; height: 13px; }
.chat-tag { font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 5px; background: #e2e8f0; color: #334155; white-space: nowrap; }
.chat-bub { padding: 7px 11px; border-radius: 4px 14px 14px 14px; background: #fff; border: 1px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.4; }
.chat-msg.me .chat-bub { background: var(--accent-2); border-color: var(--accent-2); color: #fff; border-radius: 14px 4px 14px 14px; }
.chat-msg.me .chat-bub a { color: #dbe4ff; }
.chat-msg.pc .chat-bub { background: #f1f5f9; border-color: #cbd5e1; }
.chat-typing { min-height: 22px; padding: 2px 16px; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; background: var(--panel-2); }
.chat-dots { display: inline-flex; gap: 3px; }
.chat-dots b { width: 5px; height: 5px; border-radius: 50%; background: var(--faint); animation: chat-dot 1s infinite; }
.chat-dots b:nth-child(2) { animation-delay: .15s; }
.chat-dots b:nth-child(3) { animation-delay: .3s; }
@keyframes chat-dot { 30% { transform: translateY(-3px); opacity: 1; } 0%, 60%, 100% { opacity: .45; } }
.chat-form { display: flex; gap: 8px; align-items: flex-end; padding: 10px; border-top: 1px solid var(--line); }
.chat-form textarea { min-height: 38px; max-height: 120px; resize: none; padding: 8px 11px; line-height: 1.4; }
.chat-form .btn { height: 38px; width: 42px; padding: 0; flex: none; }
@media (max-width: 640px) { .chat { top: 0; z-index: 140; } }

/* NDI (Composition) */
.ar-ndi { font: 800 15px/1 var(--font); letter-spacing: .06em; color: #fff; background: #0e7490; padding: 5px 8px; border-radius: 5px; }
.ar-ithumb.ndi { font: 800 14px/1 var(--font); letter-spacing: .06em; color: #fff; background: #0e7490; }
.ndi-how { background: var(--info-bg); color: var(--info-text); border-radius: 9px; padding: 10px 12px; font-size: 13.5px; }
.ndi-how ol { margin: 6px 0 0 18px; padding: 0; }
.ndi-how li { margin: 3px 0; }
.ndi-list { display: grid; gap: 6px; max-height: 220px; overflow-y: auto; }
.ndi-src { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--panel); cursor: pointer; font: inherit; color: var(--text); }
.ndi-src:hover { border-color: var(--accent); }
.ndi-src.on { border-color: var(--accent); background: var(--info-bg); }
.ndi-src small { margin-left: auto; color: var(--muted); font-size: 12px; }

/* Effects (Composition) */
.ar-scroll { flex: 1; min-height: 0; overflow-y: auto; }
.ar-scroll .ar-form { overflow: visible; }
.ar-fxs { border-top: 1px solid var(--line); }
.fx-list { display: grid; gap: 6px; }
.fx-card { background: #23262d; border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px 8px; display: grid; gap: 5px; }
.fx-card.off { opacity: .55; }
.fx-head { display: flex; align-items: center; gap: 6px; }
.fx-head b { font-size: 12.5px; }
.fx-p { display: grid; grid-template-columns: minmax(0, 1fr) 22px; gap: 4px; align-items: center; }
.fx-p.anim .ar-rng b { color: #f59e0b; }
.fx-anim { width: 22px; height: 22px; border-radius: 4px; border: 1px solid var(--line-2); background: var(--panel-3); color: var(--muted); cursor: pointer; padding: 0; font-size: 13px; line-height: 1; }
.fx-anim.on { background: #b45309; border-color: #f59e0b; color: #fff; }
.fx-lfo { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; padding: 4px 0 4px 10px; border-left: 2px solid #b45309; font-size: 11.5px; color: var(--muted); }
.fx-lfo select { height: 24px; font-size: 11.5px; padding: 0 22px 0 6px; width: auto; background-position: calc(100% - 12px) 10px, calc(100% - 7px) 10px; }
.fx-lfo input[type=range] { width: 70px; }
.fx-code { font: 11.5px/1.45 var(--mono); min-height: 150px; white-space: pre; tab-size: 2; }
.fx-err { color: #fca5a5; font: 11.5px/1.4 var(--mono); white-space: pre-wrap; }
.fx-err:empty { display: none; }
.ar-fxb { position: absolute; right: 3px; top: 3px; padding: 1px 4px; border-radius: 3px; background: #7c3aed; color: #fff; font: 700 9.5px/1.3 var(--font); font-style: normal; }
.ar-fxt { color: #c4b5fd; font-weight: 700; }
.ar-grp { grid-column: 1 / -1; margin: 6px 0 0; font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; }
.ar-item.fx { position: relative; }
.ar-item.fx .ar-ithumb { height: 34px; color: #c4b5fd; }
.ar-x { position: absolute; right: -2px; top: -4px; width: 18px; height: 18px; border-radius: 50%; border: 0; background: #3f444e; color: #fff; font-size: 10px; cursor: pointer; padding: 0; }
.ar-lh.drop, #ar-monbox.drop { box-shadow: inset 0 0 0 2px #f59e0b; }

/* Storage: printing labels (the sheet preview) */
.lbl-dlg { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 20px; align-items: start; }
.lbl-dlg [hidden] { display: none !important; }
.lbl-g4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.lbl-g4 .field > span { font-size: 12px; }
.lbl-prev { position: sticky; top: 0; display: grid; gap: 8px; justify-items: center; }
.lbl-prev-head { font-weight: 650; font-size: 13px; text-align: center; }
.lbl-page { display: grid; background: #fff; box-shadow: 0 2px 10px rgba(17, 24, 39, .18); border: 1px solid var(--line-2); align-content: start; justify-content: start; box-sizing: border-box; }
.lbl-page i { display: grid; place-items: center; border: 1px dashed #b8c0d2; font: 600 9px/1 var(--font); font-style: normal; color: var(--muted); cursor: pointer; overflow: hidden; }
.lbl-page i:hover { border-color: var(--accent); }
.lbl-page i.on { background: var(--info-bg); border: 1px solid var(--accent); color: var(--info-text); }
.lbl-page i.used { background: repeating-linear-gradient(45deg, #eef1f8 0 4px, #dfe4ee 4px 8px); border-style: solid; border-color: #d3d9e6; }
.lbl-prev .hint { text-align: center; }
@media (max-width: 760px) { .lbl-dlg { grid-template-columns: minmax(0, 1fr); } .lbl-g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.badge.kcrew { background: #ede9fe; color: #5b21b6; }

/* Storage: a kit's parts */
.st-parts-line { font-size: 13px; color: var(--text-2); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.st-qty { min-width: 34px; font-variant-numeric: tabular-nums; color: var(--muted); }
.st-li.missing { background: var(--bad-bg); border-radius: 8px; }
.st-partscheck { border: 2px solid var(--accent); margin-bottom: 12px; }
.st-partscheck .st-li { gap: 8px; }
.st-pcn { min-width: 60px; text-align: center; font-size: 16px; font-variant-numeric: tabular-nums; }
.st-partscheck .icon-btn { border: 1px solid var(--line-2); font-size: 18px; font-weight: 700; width: 36px; height: 36px; }
.st-pform { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
/* Storage: parts with labels of their own (a code a piece) */
.st-units { display: flex; flex-wrap: wrap; gap: 6px; }
.st-unit { border: 1px solid var(--line-2); background: var(--panel); color: var(--text); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; min-height: 34px; }
.st-unit.on { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok-text); font-weight: 600; }
.st-ucodes { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 0 8px 42px; }
.st-ucode { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; border: 1px solid var(--line); border-radius: 8px; padding: 2px 4px 2px 8px; }
.st-ucode.bad { border-color: var(--bad-line); background: var(--bad-bg); color: var(--bad-text); }
.st-ucode .icon-btn { width: 24px; height: 24px; }
.st-pfu { grid-column: 1 / -1; }
.st-unit-ck { border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; }
/* Composition: a clip that can't play, smaller rows on a laptop */
.ar-cell.bad { border-color: #dc2626; }
.ar-cbad { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; background: #dc2626; color: #fff; }
.ar-cerr { display: flex; gap: 6px; margin: 0; padding: 7px 9px; border-radius: 6px; background: rgba(220, 38, 38, .15); border: 1px solid rgba(220, 38, 38, .45); color: #fecaca; font-size: 12px; line-height: 1.35; }
@media (max-height: 820px) {
  .ar { grid-template-rows: auto minmax(150px, 1fr) minmax(230px, 38%); }
  .ar-cell { height: 68px; }
  .ar-thumb { height: 44px; }
  .ar-lh { padding: 3px 8px; }
  .ar-lop { margin: 3px 0 0; }
  .ar-lmeta { display: none; }
}
@media (max-width: 1400px) { .ar-top { gap: 10px; } .ar-fader input { width: 90px; } }

/* Notes placed on a page (sticky.js) */
.stk-btn { position: relative; }
.stk-btn.off { opacity: .5; }
.stk-n { position: absolute; top: 1px; right: 0; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: #f0c419; color: #3b2f00; font: 700 10px/16px var(--font); text-align: center; box-shadow: 0 0 0 2px #fff; }
#stk-layer { position: fixed; z-index: 50; overflow: hidden; pointer-events: none; }
#stk-in { position: absolute; left: 0; top: 0; width: 100%; height: 0; }
#stk-fix { position: absolute; left: 0; top: 0; width: 100%; height: 0; z-index: 1; }
.stk.c-yellow, .nt-placed.c-yellow, .stk-col.c-yellow { --stk: #fff3a8; --stk-h: #fbe77c; }
.stk.c-pink, .nt-placed.c-pink, .stk-col.c-pink { --stk: #ffd9e6; --stk-h: #ffbdd2; }
.stk.c-green, .nt-placed.c-green, .stk-col.c-green { --stk: #d3f4ce; --stk-h: #aee8a6; }
.stk.c-blue, .nt-placed.c-blue, .stk-col.c-blue { --stk: #d3e8ff; --stk-h: #aed3fb; }
.stk.c-purple, .nt-placed.c-purple, .stk-col.c-purple { --stk: #e8dcff; --stk-h: #d2bdfd; }
.stk.c-orange, .nt-placed.c-orange, .stk-col.c-orange { --stk: #ffe3c4; --stk-h: #ffcc94; }
.stk { position: absolute; display: flex; flex-direction: column; box-sizing: border-box; pointer-events: auto; background: var(--stk); color: #2b2618; border-radius: 4px 4px 12px 4px; box-shadow: 0 8px 22px rgba(17, 24, 39, .24), 0 0 0 1px rgba(17, 24, 39, .08); font: 14px/1.4 var(--font); }
.stk-h { flex: none; display: flex; align-items: center; gap: 1px; min-height: 24px; padding: 1px 2px 1px 8px; background: var(--stk-h); border-radius: 4px 4px 0 0; cursor: grab; touch-action: none; user-select: none; }
.stk-h:active { cursor: grabbing; }
.stk.ro .stk-h { cursor: default; }
.stk-who { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 11px; font-weight: 600; opacity: .72; }
.stk-b { flex: none; display: grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 5px; background: transparent; color: inherit; cursor: pointer; }
.stk-b:hover { background: rgba(0, 0, 0, .1); }
.stk-b .ic { width: 13px; height: 13px; }
.stk-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--stk); box-shadow: 0 0 0 1.5px rgba(0, 0, 0, .45); }
.stk-cols { display: none; flex: none; gap: 4px; padding: 5px 8px 1px; }
.stk.cols .stk-cols { display: flex; }
.stk-col { width: 18px; height: 18px; border-radius: 50%; background: var(--stk-h); box-shadow: 0 0 0 1px rgba(0, 0, 0, .3); }
.stk-col:hover { background: var(--stk-h); box-shadow: 0 0 0 2px rgba(0, 0, 0, .6); }
.stk .stk-v { flex: 1; min-height: 34px; padding: 7px 10px 12px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; cursor: text; }
.stk.ro .stk-v { cursor: default; }
.stk .stk-v a { color: #1d4ed8; }
.stk textarea.stk-t { flex: 1; display: block; width: 100%; min-height: 72px; box-sizing: border-box; padding: 7px 10px 12px; border: 0; border-radius: 0 0 12px 4px; background: transparent; color: inherit; font: inherit; resize: none; outline: none; box-shadow: none; }
.stk .stk-v[hidden], .stk textarea.stk-t[hidden] { display: none; }
.stk-r { position: absolute; right: 0; bottom: 0; width: 15px; height: 15px; cursor: nwse-resize; touch-action: none; background: linear-gradient(135deg, transparent 55%, rgba(0, 0, 0, .28) 55%, rgba(0, 0, 0, .28) 65%, transparent 65%, transparent 75%, rgba(0, 0, 0, .28) 75%, rgba(0, 0, 0, .28) 85%, transparent 85%); border-radius: 0 0 12px 0; }
.stk.ro .stk-ed, .stk[data-stk="new"] .stk-foldb, .stk[data-stk="new"] .stk-followb, .stk.noplace .stk-r, .stk.noplace [data-act="stk-color"] { display: none; }
.stk-followb[aria-pressed="true"] { background: rgba(0, 0, 0, .78); color: #fff; }
.stk-followb[aria-pressed="true"]:hover { background: rgba(0, 0, 0, .62); }
.stk.ro.follow .stk-h { cursor: grab; }
.nt-follow.on { background: var(--accent-2); color: #fff; }
.stk-chip { display: none; width: 30px; height: 30px; padding: 0; place-items: center; border: 0; border-radius: 4px 4px 9px 4px; background: var(--stk-h); color: #2b2618; cursor: pointer; }
.stk.fold { width: auto; }
.stk.fold .stk-chip { display: grid; }
.stk.fold > :not(.stk-chip) { display: none; }
.stk.flash { animation: stk-flash .6s ease 3; }
@keyframes stk-flash { 50% { box-shadow: 0 0 0 5px rgba(37, 99, 235, .75), 0 8px 22px rgba(17, 24, 39, .24); } }
#stk-catch { position: absolute; inset: 0; z-index: 1000000; pointer-events: auto; cursor: crosshair; background: rgba(37, 99, 235, .06); box-shadow: inset 0 0 0 2px rgba(37, 99, 235, .55); }
.stk-tip { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); padding: 6px 12px; border-radius: 999px; background: #1e293b; color: #fff; font: 600 13px/1.3 var(--font); white-space: nowrap; }
.nt-placed { display: inline-flex; align-items: center; gap: 4px; height: 21px; padding: 0 8px; border: 0; border-radius: 6px; background: var(--stk-h); color: #2b2618; font: 600 11.5px/1 var(--font); cursor: pointer; }
.nt-placed .ic { width: 12px; height: 12px; }
@media print { #stk-layer { display: none; } }

/* ───── the console's log ───── */
.lg-wrap { display: flex; flex-direction: column; gap: 14px; max-width: 1100px; margin: 0 auto; }
.lg-chips { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.lg-chip { display: flex; align-items: center; gap: 9px; min-width: 130px; }
.lg-chip b { display: block; font-size: 13px; }
.lg-chip small { display: block; color: var(--muted); font-size: 12px; }
.lg-chip .dot { flex: none; }
.lg-open { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.lg-since { font-size: 12px; white-space: nowrap; }
.lg-bar { flex-wrap: wrap; gap: 8px; }
.lg-bar input[type=search] { width: 220px; height: 34px; }
.lg-list { padding: 6px 0; }
.lg-empty { padding: 26px; text-align: center; }
.lg-day { margin: 0; padding: 12px 16px 6px; color: var(--muted); font-size: 12px; font-weight: 700; }
.lg-row { display: flex; align-items: baseline; gap: 10px; padding: 6px 16px; font-size: 13.5px; border-top: 1px solid var(--line); }
.lg-row time { flex: none; width: 62px; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12.5px; }
.lg-row .dot { flex: none; align-self: center; }
.lg-kind { flex: none; width: 74px; color: var(--muted); font-size: 11.5px; }
.lg-text { min-width: 0; overflow-wrap: anywhere; }
.lg-x { color: var(--muted); font-size: 12px; font-weight: 600; }
.lg-row.lv-warn { background: var(--warn-bg); }
.lg-row.lv-warn .lg-text { color: var(--warn-text); }
.lg-row.lv-bad { background: var(--bad-bg); }
.lg-row.lv-bad .lg-text { color: var(--bad-text); }
.lg-more { justify-content: center; padding: 12px; }
@media (max-width: 640px) {
  .lg-row { flex-wrap: wrap; gap: 2px 8px; padding: 8px 12px; }
  .lg-kind { width: auto; }
  .lg-text { flex-basis: 100%; }
  .lg-bar input[type=search] { width: 100%; }
}
@media (max-width: 640px) {
  .lg-filter { width: 100%; }
  .lg-filter button { flex: 1; height: auto; min-height: 34px; padding: 4px 6px; line-height: 1.15; white-space: normal; }
}
.lg-tabs { align-self: flex-start; }

/* The Log's connection history (views-nethistory.js). Colours: one for each connection, the same on every graph. */
.nh-host { --nh-s0: #8a8f9c; --nh-s1: #2a78d6; --nh-s2: #eb6834; --nh-s3: #1baf7a; --nh-s4: #eda100; --nh-s5: #e87ba4; --nh-s6: #008300; --nh-s7: #6250d6; min-width: 0; }
.nh-host > [data-part] { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
#nh-tip { --nh-s0: #8a8f9c; --nh-s1: #2a78d6; --nh-s2: #eb6834; --nh-s3: #1baf7a; --nh-s4: #eda100; --nh-s5: #e87ba4; --nh-s6: #008300; --nh-s7: #6250d6; }
.nh-day { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
.nh-day input { width: 150px; height: 34px; }
.nh-zoomed { display: flex; align-items: center; gap: 10px; }
.nh-zoomed .grow { flex: 1; min-width: 0; }
.nh-tiles { display: flex; flex-wrap: wrap; gap: 10px; }
.nh-tile { flex: 1 1 130px; background: var(--panel); }
.nh-tile span { display: block; }
.nh-tile small { display: block; margin-top: 2px; color: var(--muted); font-size: 11.5px; }
.nh-card { display: flex; flex-direction: column; gap: 8px; }
.nh-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.nh-head h3 { display: flex; align-items: center; gap: 7px; }
.nh-head small { color: var(--muted); font-size: 12px; }
.nh-note { margin: 0; }
.nh-keys, .nh-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--text-2); }
.nh-keys span, .nh-legend span { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.nh-key { width: 16px; height: 10px; border-radius: 2px; }
.nh-key.up { background: var(--ok-line); }
.nh-key.down { background: var(--bad-text); }
.nh-key.slow { background: var(--warn); }
.nh-key.off { background: var(--panel-3); }
.nh-lkey { flex: none; display: inline-block; width: 14px; height: 2px; border-radius: 1px; }
.nh-lanes { display: flex; flex-direction: column; gap: 3px; margin-top: 4px; }
.nh-lane { display: grid; grid-template-columns: 160px minmax(0, 1fr); align-items: center; gap: 10px; min-height: 24px; }
.nh-lane.person .nh-lname { color: var(--muted); }
.nh-lname { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.nh-lname .dot { flex: none; }
.nh-track { position: relative; height: 16px; border-radius: 3px; background: var(--panel-3); }
.nh-seg { position: absolute; top: 3px; bottom: 3px; display: block; padding: 0; border: 0; border-radius: 2px; }
.nh-seg.up { background: var(--ok-line); }
.nh-seg.slow { top: 1px; bottom: 1px; min-width: 3px; background: var(--warn); cursor: pointer; z-index: 1; }
.nh-seg.down { top: -2px; bottom: -2px; min-width: 4px; background: var(--bad-text); cursor: pointer; z-index: 2; }
.nh-seg.slow::before, .nh-seg.down::before { content: ''; position: absolute; inset: -4px -9px; } /* bigger to aim at than to see */
.nh-seg.slow:hover, .nh-seg.down:hover, .nh-seg:focus-visible { outline: 2px solid var(--text); outline-offset: 1px; }
.nh-laneaxis { margin-left: 170px; }
.nh-plot { display: grid; grid-template-columns: 44px minmax(0, 1fr); margin-top: 8px; }
.nh-y { position: relative; }
.nh-y span { position: absolute; right: 7px; transform: translateY(-50%); color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nh-area { position: relative; touch-action: pan-y; cursor: crosshair; }
.nh-area:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.nh-area svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; overflow: hidden; }
.nh-area line, .nh-area path { vector-effect: non-scaling-stroke; fill: none; }
.nh-grid { stroke: var(--line); stroke-width: 1; }
.nh-base { stroke: var(--line-2); stroke-width: 1; }
.nh-line { stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.nh-band { position: absolute; top: 0; bottom: 0; min-width: 2px; background: var(--bad-bg); box-shadow: inset 2px 0 0 var(--bad-line); }
.nh-cross { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--text-2); pointer-events: none; }
.nh-peak { position: absolute; padding: 0 4px; border-radius: 4px; background: rgba(255, 255, 255, .86); color: var(--text-2); font-size: 11px; font-weight: 650; white-space: nowrap; pointer-events: none; }
.nh-xwrap { margin-left: 44px; }
.nh-x { position: relative; height: 18px; margin-top: 3px; overflow: hidden; }
.nh-x span { position: absolute; transform: translateX(-50%); color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
#nh-tip { position: fixed; z-index: 9000; display: none; min-width: 150px; max-width: 300px; padding: 8px 10px; border-radius: 9px; background: var(--panel); border: 1px solid var(--line-2); box-shadow: 0 8px 22px rgba(17, 24, 39, .18); font-size: 12px; pointer-events: none; }
#nh-tip > div { display: flex; align-items: center; gap: 7px; min-width: 0; }
#nh-tip > div + div { margin-top: 3px; }
#nh-tip b { color: var(--text); white-space: nowrap; font-variant-numeric: tabular-nums; }
#nh-tip span { color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nh-tip-t { margin-bottom: 5px; color: var(--muted); font-weight: 650; font-variant-numeric: tabular-nums; }
.nh-scroll { overflow-x: auto; }
.nh-numscroll { max-height: 420px; overflow-y: auto; }
.nh-tbl td, .nh-tbl th { font-size: 13px; }
.nh-tbl .nh-n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nh-when { white-space: nowrap; font-variant-numeric: tabular-nums; }
.nh-why { min-width: 200px; color: var(--text-2); overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .nh-range { width: 100%; }
  .nh-range button { flex: 1; height: auto; min-height: 34px; padding: 4px 2px; line-height: 1.15; font-size: 12px; white-space: normal; }
  .nh-lane { grid-template-columns: minmax(0, 1fr); gap: 2px; margin-bottom: 4px; }
  .nh-laneaxis { margin-left: 0; }
  .nh-x span:nth-child(even) { display: none; }
  .nh-evtabs { width: 100%; }
  .nh-evtabs button { flex: 1; height: auto; min-height: 34px; padding: 4px 2px; line-height: 1.15; font-size: 12px; white-space: normal; }
}

/* ── Status screen: made to stay open on a second screen, read from a distance, in a dark room ───────────── */
body.hud-on {
  color-scheme: dark;
  --bg: #0b1020; --panel: #141a30; --panel-2: #1b2240; --panel-3: #262e50; --line: #2a3358; --line-2: #3d4874; --well: #0f1428;
  --text: #f2f4fa; --text-2: #cdd3e6; --muted: #a3acc7; --faint: #7f8aab; --accent: #93a4ff; --accent-2: #3b4bb5;
  --ok: #22c55e; --warn: #f5a524; --live: #ff4d55;
  --ok-bg: #10301f; --ok-line: #2c8a54; --ok-text: #86e5a8;
  --warn-bg: #36280c; --warn-line: #8a6414; --warn-text: #ffd27a;
  --bad-bg: #3a1418; --bad-line: #a12e36; --bad-text: #ff9aa0;
  --info-bg: #1b2350; --info-line: #36418a; --info-text: #b6c0ff;
}
.hud-on .top { background: var(--panel); }
.hud-on .top h1 { color: var(--text); }
.hud-on .nh-seg.down, .hud-on .nh-key.down { background: #ff4d55; }
.hud-on .btn { background: var(--panel-2); border-color: var(--line-2); color: var(--text); }
.hud-on .btn:hover { background: var(--panel-3); border-color: var(--faint); }
.hud-on .btn.primary { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }
.hud-on .btn.primary:hover { background: #4c5dc9; }
.hud-on .card { box-shadow: none; }
.hud-on .seg button { background: var(--panel-2); }
.hud-on .seg button.on { background: var(--accent-2); color: #fff; }
.hud-on .nh-peak { background: rgba(20, 26, 48, .88); color: var(--text); }
.hud-on .nh-host, .hud-on #nh-tip { --nh-s0: #8f96a8; --nh-s1: #3987e5; --nh-s2: #d95926; --nh-s3: #199e70; --nh-s4: #c98500; --nh-s5: #d55181; --nh-s6: #008300; --nh-s7: #9085e9; }
.hud-on #nh-tip { box-shadow: 0 8px 22px rgba(0, 0, 0, .5); }
/* (a window that is only this screen) */
html.hud-window .side, html.hud-window .scrim, html.hud-window .top, html.hud-window #offline, html.hud-window #updated, html.hud-window .chat, html.hud-window #stk-layer { display: none !important; }
html.hud-window .app { grid-template-columns: minmax(0, 1fr); }

.hud-board { container: hud / inline-size; display: flex; flex-direction: column; gap: 12px; min-height: 100%; padding: 12px; background: var(--bg); }
.hud-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; padding: 12px 18px; border-radius: var(--radius); border: 1px solid var(--line-2); color: #fff; }
.hud-head.lv-ok { background: #0f3d25; border-color: #1f7a43; }
.hud-head.lv-bad { background: #8a1c25; border-color: #d0434c; }
.hud-head.lv-warn { background: #6b4a08; border-color: #c28a1b; }
.hud-head.lv-info { background: var(--panel-3); }
.hud-head.lv-stale { background: #3a3f57; border: 2px dashed #f5a524; }
.hud-verdict { display: flex; align-items: center; gap: 14px; flex: 1 1 340px; min-width: 0; }
.hud-bigg { flex: none; display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; background: rgba(255, 255, 255, .16); font-size: 32px; font-weight: 800; font-style: normal; line-height: 1; }
.hud-verdict-t { min-width: 0; }
.hud-verdict h2 { font-size: 32px; font-weight: 800; line-height: 1.1; }
.hud-verdict p { font-size: 16px; color: rgba(255, 255, 255, .9); overflow-wrap: anywhere; }
.hud-air { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: rgba(0, 0, 0, .28); font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hud-air i { width: 12px; height: 12px; border-radius: 50%; background: #ff4d55; animation: blink 1.2s infinite; }
.hud-air.live { background: #c4141e; }
.hud-air.live i { background: #fff; }
.hud-id { min-width: 0; text-align: right; }
.hud-id b { display: block; font-size: 18px; overflow-wrap: anywhere; }
.hud-id small { display: block; color: rgba(255, 255, 255, .8); font-size: 12.5px; }
.hud-clock { font-size: 34px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
.hud-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.hud-head .btn { background: rgba(0, 0, 0, .28); border-color: rgba(255, 255, 255, .34); color: #fff; }
.hud-head .btn:hover { background: rgba(0, 0, 0, .44); border-color: rgba(255, 255, 255, .6); }

.hud-cols { display: grid; grid-template-columns: minmax(340px, 27%) minmax(0, 1fr); grid-template-areas: "left right" "talk right"; grid-template-rows: auto 1fr; gap: 12px; align-items: start; }
.hud-left, .hud-right { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.hud-left { grid-area: left; }
.hud-right { grid-area: right; }
.hud-talkwrap { grid-area: talk; min-width: 0; }
/* the audience's comments: a column of their own when there's room, so they never push a problem out of view */
.hud-talk .card-head { flex-wrap: wrap; margin-bottom: 8px; }
.hud-talk:not(.embed):not(:has(.hud-talk-why)) .card-head { margin-bottom: 0; }
.hud-talk-from { color: var(--muted); font-size: 12px; }
.hud-talk-why { margin-bottom: 8px; color: var(--text-2); font-size: 13.5px; }
.hud-talk.embed { display: flex; flex-direction: column; height: 460px; }
.hud-chat { flex: 1; min-height: 0; border-radius: 8px; overflow: hidden; background: var(--well); }
.hud-chat iframe { display: block; width: 100%; height: 100%; border: 0; }
@container hud (min-width: 1400px) {
  .hud-cols:has(.hud-talk.embed) { grid-template-columns: minmax(330px, 24%) minmax(0, 1fr) minmax(300px, 19%); grid-template-areas: "left right talk"; grid-template-rows: auto; }
  .hud-talk.embed { position: sticky; top: 12px; height: calc(100vh - 136px); }
  html:not(.hud-window) .hud-talk.embed { height: calc(100vh - 194px); }
}
.hud-left > [data-part], .hud-right > [data-part] { min-width: 0; }
.hud-board.stale .hud-now, .hud-board.stale .hud-events, .hud-board.stale .nh-host, .hud-board.stale .hud-issue:not([data-key="here"]) { opacity: .5; filter: grayscale(1); }

.hud-g { flex: none; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--panel-3); color: var(--muted); font-size: 13px; font-weight: 800; font-style: normal; line-height: 1; }
.lv-ok > .hud-g, .hud-none .hud-g { background: #16a34a; color: #fff; }
.lv-live > .hud-g { background: #e5343d; color: #fff; }
.lv-warn > .hud-g, .lv-warn .hud-issue-t .hud-g { background: #f5a524; color: #111; }
.lv-bad > .hud-g, .lv-bad .hud-issue-t .hud-g { background: #e5343d; color: #fff; }
.lv-info .hud-issue-t .hud-g { background: var(--accent-2); color: #fff; }

.hud-fix .card-head, .hud-events .card-head { margin-bottom: 8px; }
.hud-issues { display: flex; flex-direction: column; gap: 8px; }
.hud-issue { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel-2); }
.hud-issue.lv-bad { border-color: var(--bad-line); background: var(--bad-bg); }
.hud-issue.lv-warn { border-color: var(--warn-line); background: var(--warn-bg); }
.hud-issue-t { display: flex; align-items: flex-start; gap: 8px; }
.hud-issue-t b { flex: 1; min-width: 0; font-size: 15.5px; line-height: 1.3; overflow-wrap: anywhere; }
.hud-word { flex: none; padding: 1px 7px; border-radius: 6px; background: rgba(0, 0, 0, .3); font-size: 11.5px; font-weight: 700; }
.hud-issue-m { margin: 3px 0 0 30px; color: var(--text-2); font-size: 13px; font-variant-numeric: tabular-nums; }
.hud-why { margin: 6px 0 0 30px; font-size: 13.5px; color: var(--text); overflow-wrap: anywhere; }
.hud-cause { margin: 6px 0 0 30px; font-size: 13.5px; color: var(--text-2); }
.hud-steps { margin: 6px 0 0 30px; padding-left: 18px; font-size: 14px; }
.hud-steps li + li { margin-top: 3px; }
.hud-issue .btn { margin: 8px 0 0 30px; }
.hud-none { display: flex; align-items: center; gap: 8px; padding: 6px 2px; font-size: 16px; font-weight: 600; }

.hud-count { color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; }
.hud-droplist { display: flex; flex-direction: column; max-height: 46vh; overflow-y: auto; margin: 0 -6px; padding: 0 6px; }
.hud-drop { padding: 8px 0; border-top: 1px solid var(--line); }
.hud-drop:first-child { border-top: 0; padding-top: 0; }
.hud-drop-t { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; font-size: 14px; }
.hud-drop .hud-g { width: 18px; height: 18px; font-size: 11px; }
.hud-drop.drop .hud-g { background: #e5343d; color: #fff; }
.hud-drop.slow .hud-g { background: #f5a524; color: #111; }
.hud-drop-t time { color: var(--text-2); font-variant-numeric: tabular-nums; }
.hud-drop-t b { min-width: 0; overflow-wrap: anywhere; }
.hud-long { margin-left: auto; color: var(--text-2); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hud-drop-w { margin: 2px 0 0 26px; color: var(--text-2); font-size: 13px; overflow-wrap: anywhere; }
.hud-drop-b { display: flex; gap: 6px; margin: 6px 0 0 26px; }
.hud-drop-b .btn { height: 28px; padding: 0 10px; font-size: 12.5px; }
.hud-drop-fix .hud-cause, .hud-drop-fix .hud-steps { margin-left: 26px; font-size: 13px; }

.hud-now { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; }
.hud-group h4 { margin-bottom: 6px; color: var(--muted); font-size: 12px; font-weight: 700; }
.hud-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 6px; }
.hud-tile { display: flex; align-items: flex-start; gap: 8px; min-width: 0; padding: 7px 10px; border-radius: 9px; background: var(--panel-2); border: 1px solid var(--line); }
.hud-tile.lv-bad { background: var(--bad-bg); border-color: var(--bad-line); }
.hud-tile.lv-warn { background: var(--warn-bg); border-color: var(--warn-line); }
.hud-tile.lv-stale { border-style: dashed; border-color: var(--line-2); }
.hud-tile-t { display: flex; flex-direction: column; min-width: 0; }
.hud-tile-t b { color: var(--text-2); font-size: 12.5px; font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.hud-tile-t span { font-size: 16px; font-weight: 700; line-height: 1.25; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.hud-tile-t small { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }

.hud-bar { gap: 8px; }
.hud-right .nh-host > [data-part] { gap: 12px; }
.hud-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 12px; min-width: 0; }
.hud-charts .nh-card { padding: 12px 14px; min-width: 0; }
.hud-charts .nh-note { display: none; }
.hud-right .nh-tile { padding: 6px 12px; }
.hud-gone { margin: 40px auto; max-width: 560px; }
@media (max-width: 1100px) {
  .hud-cols { grid-template-columns: minmax(0, 1fr); grid-template-areas: "left" "right" "talk"; grid-template-rows: auto; }
  .hud-droplist { max-height: none; }
}
@media (max-width: 760px) {
  .hud-board { padding: 8px; }
  .hud-verdict { flex-basis: 100%; }
  .hud-verdict h2 { font-size: 26px; }
  .hud-id { text-align: left; }
  .hud-clock { font-size: 24px; }
  .hud-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hud-charts { grid-template-columns: minmax(0, 1fr); }
}

/* Group draw (แบ่งสาย) */
.dw-go { min-width: 180px; }
.dw-status { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; font-size: 14px; }
.dw-status select { height: 32px; margin-left: 6px; max-width: 260px; }
.dw-last { display: inline-flex; align-items: center; gap: 8px; }
.dw-disc { width: 26px; height: 26px; border-radius: 50%; flex: none; display: inline-grid; place-items: center; background: var(--tc); color: #fff; font-size: 12px; font-weight: 800; overflow: hidden; }
.dw-disc img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.dw-groups { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 10px; }
.dw-g { border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: var(--panel-2); display: grid; gap: 6px; align-content: start; min-width: 0; }
.dw-gh { display: flex; justify-content: space-between; align-items: baseline; font-weight: 800; font-size: 15px; }
.dw-gh small { color: var(--text-3, #94a3b8); font-weight: 600; }
.dw-chip { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line-2); background: var(--panel); border-radius: 8px; padding: 4px 8px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; text-align: left; min-width: 0; color: var(--text); }
.dw-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dw-chip:disabled { cursor: default; }
.dw-left { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 12px; }
.dw-teams { display: grid; gap: 4px; max-height: 360px; overflow: auto; }
.dw-team { display: flex; align-items: center; gap: 10px; padding: 4px 6px; border-radius: 8px; }
.dw-team:hover { background: var(--panel-2); }
.dw-team .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.dw-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dw-outs { display: grid; gap: 8px; }
.dw-out { display: grid; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; }
.dw-out-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dw-link { display: flex; align-items: center; gap: 8px; min-width: 0; }
.dw-link code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.dw-out-t { flex: 1; min-width: 140px; display: grid; }
.dw-out-t small { color: var(--text-3, #94a3b8); }
.dw-sw { width: 54px; height: 32px; border-radius: 6px; border: 1px solid var(--line-2); flex: none; background-color: #1a1f2b; }
.dw-bgpv { position: relative; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; border: 1px solid var(--line-2); display: grid; place-items: center; }
.dw-bgpv img, .dw-bgpv video, .dw-bgpv i { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.dw-bgpv b { position: relative; color: #fff; font-size: 22px; text-shadow: 0 2px 10px rgba(0,0,0,.6); }
@media (max-width: 700px) { .dw-2 { grid-template-columns: 1fr; } .dw-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.seg.dw-col { display: grid; }
.seg.dw-col button { border-right: 0; border-bottom: 1px solid var(--line-2); text-align: left; }
.seg.dw-col button:last-child { border-bottom: 0; }

/* Composition: a web page clip */
.ar-webov { display: flex; flex-wrap: wrap; gap: 6px; }
.ar-web2 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.ar-websz { gap: 6px; flex-wrap: wrap; }

/* Group draw: rules */
.dw-warn { color: var(--danger, #dc2626); font-weight: 600; }
.dw-rules { display: grid; gap: 8px; }
.dw-rh { display: flex; align-items: baseline; gap: 8px; margin-top: 4px; }
.dw-rh small { color: var(--text-3, #94a3b8); }
.dw-rule { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); }
.dw-rule i { font-style: normal; color: var(--text-3, #94a3b8); font-weight: 700; }
.dw-rchip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.dw-rchip .dw-disc { width: 20px; height: 20px; font-size: 10px; }
.dw-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px; max-height: 50vh; overflow: auto; }
.dw-pk { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; }
.dw-rh b { white-space: nowrap; }
.dw-rh small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.dw-last .dw-disc + .dw-disc { margin-left: -8px; box-shadow: 0 0 0 2px var(--panel); }

/* Scoreboard: the three graphics' on-air buttons */
.sbx-air { display: flex; gap: 8px; flex-wrap: wrap; }
.sbx-gbtn { display: flex; align-items: center; gap: 10px; padding: 8px 16px 8px 12px; border-radius: 12px; border: 2px solid var(--line); background: var(--panel-2); color: var(--text); cursor: pointer; font: inherit; text-align: left; min-width: 150px; transition: background .15s, border-color .15s; }
.sbx-gbtn:hover { border-color: var(--text-3, #94a3b8); }
.sbx-gbtn > span { display: grid; line-height: 1.15; }
.sbx-gbtn b { font-size: 15px; letter-spacing: .06em; white-space: nowrap; }
.sbx-gbtn b i { font-style: normal; font-size: 12px; background: #dc2626; color: #fff; border-radius: 999px; padding: 0 7px; margin-left: 4px; vertical-align: 2px; }
.sbx-gbtn small { font-size: 11px; font-weight: 700; letter-spacing: .12em; color: var(--text-3, #94a3b8); }
.sbx-gbtn.on { background: #dc2626; border-color: #dc2626; color: #fff; box-shadow: 0 0 0 3px rgba(220,38,38,.25); }
.sbx-gbtn.on small { color: #fff; }
.sbx-gbtn.on b i { background: #fff; color: #dc2626; }
/* Scoreboard: penalty timers */
.sbx-pn-adds { gap: 10px; }
.sbx-pn-add { display: grid; gap: 6px; padding: 10px; border: 1px solid var(--line); border-left: 6px solid var(--tc); border-radius: 10px; }
.sbx-pn-tm { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.sbx-pn-tm i { display: none; }
.sbx-pns { display: grid; gap: 6px; margin-top: 10px; }
.sbx-pn { display: grid; grid-template-columns: 6px auto 1fr auto auto; align-items: center; gap: 10px; padding: 6px 10px 6px 0; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); overflow: hidden; }
.sbx-pn .sw { align-self: stretch; background: var(--tc); }
.sbx-pn .tm { white-space: nowrap; }
.sbx-pn .who { color: var(--text-2, #cbd5e1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sbx-pn .t { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; min-width: 72px; text-align: right; color: #d97706; }
.sbx-pn.paused .t { color: var(--text-3, #94a3b8); }
.sbx-pn.done .t { color: #16a34a; font-size: 15px; letter-spacing: .06em; }

/* the Scoreboard page: your own looks for the other graphics */
.sbx-looks { border-top: 1px solid var(--line, rgba(127,127,127,.25)); padding-top: 10px; }
.sbx-looks h4 { margin: 0 0 8px; font-size: 13px; }
.sbx-looks h4 small { font-weight: 400; opacity: .7; }

/* Stream control: OBS scene collections */
.obs-col { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line, rgba(127,127,127,.25)); }
.obs-col .nm { flex: 1; min-width: 0; }
.obs-col small { display: block; opacity: .7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.obs-miss { max-height: 220px; overflow: auto; padding-left: 18px; word-break: break-all; }
