/* Панель ведущего — плотная рабочая раскладка для ноутбука */
body { background: var(--bg-app); font-size: 14px; }
.hbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 20px; padding: 8px 16px; background: var(--green-800); color: #fff; }
.hbrand { display: flex; align-items: center; gap: 8px; font-family: var(--font-serif); font-size: 17px; font-weight: 600; white-space: nowrap; }
.hbrand img { width: 28px; height: 28px; }
.hbrand b { color: var(--gold-light); }
.hbrand em { font-family: var(--font-sans); font-style: normal; font-size: 12px; font-weight: 500; opacity: .7; margin-left: 4px; }
.tabs { display: flex; gap: 4px; }
.tabs button { background: transparent; border: 0; color: rgba(255,255,255,.75); padding: 8px 12px; border-radius: 8px; font-weight: 600; font-size: 13px; }
.tabs button.on { background: rgba(255,255,255,.14); color: #fff; }
.hstatus { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: 13px; }
.hstatus .room { font-weight: 800; letter-spacing: .12em; background: rgba(255,255,255,.14); padding: 4px 10px; border-radius: 6px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: var(--muted); flex: none; }
.dot.on { background: var(--success); }
.dot.off { background: var(--danger); }

.login { display: grid; place-items: center; min-height: 80vh; }
.login .panel { width: 360px; }
.tab { display: none; }
.tab.on { display: block; }
.grid3 { display: grid; grid-template-columns: 290px minmax(0, 1fr) 380px; gap: 12px; padding: 12px; align-items: start; }
.col { display: grid; gap: 12px; min-width: 0; }
.script { position: sticky; top: 58px; max-height: calc(100vh - 70px); display: grid; grid-template-rows: auto 1fr; }
.right { position: sticky; top: 58px; max-height: calc(100vh - 70px); overflow: auto; }
.wide { padding: 16px; display: grid; gap: 12px; max-width: 1400px; margin: 0 auto; }

.panel { background: var(--bg-base); border: 1px solid var(--border-subtle); border-radius: 12px; padding: 14px; display: grid; gap: 10px; box-shadow: 0 1px 2px hsl(var(--shadow-color) / .06); }
.panel:empty { display: none; }
.panel h2, .panel h3 { margin: 0; font-size: 15px; }
.panel h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-secondary); }
.ph { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-secondary); }
.ph a { text-transform: none; letter-spacing: 0; font-weight: 600; color: var(--text-link); text-decoration: none; }
.muted { color: var(--text-secondary); }
.small { font-size: 12px; }
.warn { background: var(--warn-soft); color: var(--warn-ink); border-radius: 8px; padding: 8px 10px; font-weight: 600; font-size: 13px; }
.alert { border-color: var(--gold); box-shadow: 0 0 0 2px var(--warn-soft); }

.b { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--border-default); background: var(--bg-base); font-weight: 600; font-size: 13px; color: var(--text-primary); white-space: nowrap; }
.b:hover { background: var(--bg-hover); }
.b:disabled { opacity: .4; cursor: default; }
.b.primary { background: var(--green-800); border-color: var(--green-800); color: #fff; }
.b.primary:hover { background: var(--accent-hover); }
.b.accent { background: var(--gold); border-color: var(--gold); color: var(--green-900); }
.b.ok { background: var(--ok-soft); border-color: transparent; color: var(--ok-ink); }
.b.bad { background: var(--bad-soft); border-color: transparent; color: var(--bad-ink); }
.b.sm { min-height: 28px; padding: 3px 8px; font-size: 12px; }
.b.big { min-height: 44px; font-size: 14px; padding: 8px 16px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inp, select.inp, textarea.inp { min-height: 36px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--field-border); background: var(--field-bg); font-size: 13px; }
.inp:focus { outline: none; border-color: var(--field-focus); background: var(--bg-base); }
textarea.inp { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; line-height: 1.45; }

.navbtns { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; margin-bottom: 8px; }
.navbtns .b { min-height: 44px; font-size: 14px; }
.steps { list-style: none; margin: 0; padding: 4px; overflow: auto; background: var(--bg-base); border: 1px solid var(--border-subtle); border-radius: 12px; }
.steps li { display: grid; grid-template-columns: 26px 1fr; gap: 6px; align-items: center; padding: 6px 8px; border-radius: 8px; cursor: pointer; font-size: 13px; line-height: 1.3; }
.steps li:hover { background: var(--bg-hover); }
.steps li .n { font-size: 11px; color: var(--text-tertiary); font-variant-numeric: tabular-nums; text-align: right; }
.steps li.done { color: var(--text-tertiary); }
.steps li.cur { background: var(--green-800); color: #fff; font-weight: 700; }
.steps li.cur .n { color: rgba(255,255,255,.7); }
.steps li.sec { margin-top: 6px; }
.steps li.sec::before { content: ''; grid-column: 1 / -1; border-top: 1px solid var(--border-subtle); margin: -4px 0 4px; }

.step-head { display: flex; align-items: center; gap: 12px; }
.step-head h2 { font-size: 18px; flex: 1; }
.step-head .timer { width: 54px; height: 54px; }
.step-head .timer .t-num { font-size: 17px; }
.badge { display: inline-flex; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--bg-subtle); color: var(--text-secondary); white-space: nowrap; }
.badge.open { background: var(--ok-soft); color: var(--ok-ink); }
.badge.closed { background: var(--warn-soft); color: var(--warn-ink); }
.badge.revealed { background: var(--accent-soft); color: var(--accent-soft-ink); }
.ctrls { display: flex; flex-wrap: wrap; gap: 8px; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; font-size: 13px; }
.kv > span:nth-child(odd) { color: var(--text-secondary); }
.fact-l { display: grid; grid-template-columns: 22px 1fr auto; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 8px; background: var(--bg-subtle); }
.fact-l.lie { background: var(--warn-soft); }

table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-tertiary); font-weight: 700; padding: 6px 8px; border-bottom: 1px solid var(--border-default); }
table.t td { padding: 6px 8px; border-bottom: 1px solid var(--border-subtle); vertical-align: middle; }
table.t td.num, table.t th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.t tr.neg td.num { color: var(--danger); }
.st { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.st.ok, .st.accepted { background: var(--ok-soft); color: var(--ok-ink); }
.st.disputed { background: var(--warn-soft); color: var(--warn-ink); }
.st.rejected { background: var(--bad-soft); color: var(--bad-ink); }

.pl { display: grid; grid-template-columns: 12px 1fr auto auto; gap: 8px; align-items: center; padding: 6px 4px; border-bottom: 1px solid var(--border-subtle); font-size: 13px; }
.pl:last-child { border-bottom: 0; }
.pl .nm { min-width: 0; }
.pl .nm b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl .nm small { color: var(--text-tertiary); font-size: 11px; }
.pl .sc { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--green-800); min-width: 36px; text-align: right; }
.pl .ic { display: flex; gap: 4px; align-items: center; }
.tag { font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 4px; background: var(--bg-subtle); color: var(--text-secondary); white-space: nowrap; }
.tag.ans { background: var(--ok-soft); color: var(--ok-ink); }
.tag.wait { background: var(--warn-soft); color: var(--warn-ink); }
.tag.jk { background: var(--warn-soft); color: var(--warn-ink); }
.pl.off { opacity: .55; }
details.pmenu summary { list-style: none; cursor: pointer; padding: 2px 6px; border-radius: 6px; color: var(--text-tertiary); font-weight: 800; }
details.pmenu summary::-webkit-details-marker { display: none; }
details.pmenu[open] summary { background: var(--bg-subtle); }
details.pmenu .menu { position: absolute; right: 16px; z-index: 30; background: var(--bg-base); border: 1px solid var(--border-default); border-radius: 10px; box-shadow: var(--shadow-md); padding: 6px; display: grid; gap: 4px; min-width: 210px; }

.preview .pv-box { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; border: 1px solid var(--border-default); background: #000; }
.preview iframe { position: absolute; left: 0; top: 0; width: 1600px; height: 900px; border: 0; transform-origin: 0 0; pointer-events: none; }

.mini-board { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.mini-board .ct { font-size: 11px; font-weight: 700; text-align: center; color: var(--text-secondary); padding: 4px 2px; line-height: 1.2; min-height: 34px; display: grid; place-items: center; }
.mini-board button { min-height: 36px; border-radius: 6px; border: 0; background: var(--accent-soft); color: var(--accent-soft-ink); font-weight: 800; position: relative; }
.mini-board button:disabled { background: var(--bg-subtle); color: var(--text-tertiary); cursor: default; }
.mini-board button.active { background: var(--green-800); color: var(--gold-light); }
.mini-board button .fl { position: absolute; top: 1px; right: 3px; font-size: 9px; font-weight: 700; color: var(--warn-ink); }

.pv-pair { display: grid; grid-template-columns: 1fr 360px; gap: 12px; align-items: start; }
.pv-screen { width: 100%; aspect-ratio: 16 / 9; border: 1px solid var(--border-default); border-radius: 8px; overflow: hidden; position: relative; background: #000; }
.pv-screen iframe { position: absolute; left: 0; top: 0; width: 1600px; height: 900px; border: 0; transform-origin: 0 0; }
.pv-phone { width: 360px; height: 700px; border: 8px solid #1a1d23; border-radius: 28px; overflow: hidden; background: var(--beige); }
.pv-phone iframe { width: 100%; height: 100%; border: 0; }
.cards2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.kbd { font-family: ui-monospace, Menlo, monospace; font-size: 11px; padding: 1px 5px; border: 1px solid var(--border-default); border-radius: 4px; background: var(--bg-subtle); }
@media (max-width: 1280px) { .grid3 { grid-template-columns: 250px minmax(0, 1fr) 320px; } }

.modal { position: fixed; inset: 0; z-index: 100; background: rgba(11, 32, 27, .45); display: grid; place-items: center; padding: 16px; }
.modal .panel { width: min(440px, 100%); box-shadow: var(--shadow-lg); gap: 16px; }
.modal h2 { font-size: 16px; line-height: 1.4; }

.pmenu { position: relative; }
.pm-btn { border: 0; background: transparent; cursor: pointer; padding: 4px 8px; border-radius: 6px; color: var(--text-tertiary); font-weight: 800; font-size: 15px; }
.pm-btn.on, .pm-btn:hover { background: var(--bg-subtle); color: var(--text-primary); }
.pmenu .menu { position: absolute; right: 0; top: 100%; z-index: 30; background: var(--bg-base); border: 1px solid var(--border-default); border-radius: 10px; box-shadow: var(--shadow-md); padding: 6px; display: grid; gap: 4px; min-width: 230px; }
.pl { grid-template-columns: 28px 1fr auto auto; }
.pl .nm .dot { width: 7px; height: 7px; vertical-align: 1px; }
.judge { display: flex; gap: 8px; align-items: center; background: var(--warn-soft); border-radius: 10px; padding: 10px 12px; }
.judge > div { flex: 1; }
