/* Booth - dark control-room theme shared with Talkback: ink surfaces, Line Media red as the only
   accent (mute, on air, errors), one colour per booth. */

:root {
  --bg: #0E0F11;
  --panel: #17191C;
  --panel-2: #1F2226;
  --well: #0A0B0C;
  --line: #2B2F34;
  --line-soft: #22262A;
  --text: #E9ECEF;
  --dim: #A3ACB4;
  --faint: #8A949D;
  --ink: #111214;
  --accent: #DC2626;
  --accent-text: #F87171;
  --accent-soft: rgba(220, 38, 38, .16);
  --green: #22C55E;
  --yellow: #EAB308;
  --orange: #F97316;
  --booth: #3B82F6;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 20px rgba(0, 0, 0, .35);
  --font: 'Barlow Semi Condensed', -apple-system, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
html { font-size: 16px; color-scheme: dark; }
body { background: var(--bg); color: var(--text); font-family: var(--font); line-height: 1.35; -webkit-font-smoothing: antialiased; min-height: 100vh; }
svg.ic { width: 20px; height: 20px; stroke: currentColor; stroke-width: 1.9; fill: none; stroke-linecap: round; stroke-linejoin: round; flex: none; }
button { font-family: inherit; color: inherit; background: none; border: none; cursor: pointer; }
a { color: var(--text); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

input, select, textarea { font-family: inherit; font-size: 15px; color: var(--text); background: var(--well); border: 1.5px solid var(--line); border-radius: 8px; padding: 9px 11px; width: 100%; outline: none; }
input::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus { border-color: var(--dim); }
input[type=range] { padding: 0; height: 28px; accent-color: var(--text); background: none; border: none; }
input[type=color] { padding: 2px; height: 38px; width: 44px; flex: none; }
label.fld { display: block; margin-bottom: 12px; }
label.fld > span, .lbl { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); margin-bottom: 5px; }
.fld-row { display: flex; gap: 10px; align-items: flex-end; }
.fld-row > * { flex: 1; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 10px; font-weight: 700; font-size: 15px; background: var(--text); color: var(--ink); border: 1.5px solid var(--text); min-height: 42px; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.sm { padding: 6px 11px; font-size: 13.5px; min-height: 34px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.iconbtn { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: var(--dim); border: 1.5px solid var(--line); background: var(--panel); flex: none; }
.iconbtn:hover { color: var(--text); }
.iconbtn.on { color: var(--text); border-color: var(--dim); }

.chip { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 11.5px; font-weight: 500; color: var(--dim); padding: 5px 10px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--panel); white-space: nowrap; }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.chip.ok .dot { background: var(--green); }
.chip.warn .dot { background: var(--yellow); animation: blink 1s infinite; }
.chip.bad .dot { background: var(--accent); }
.chip.air { font-family: var(--font); font-weight: 700; letter-spacing: .12em; font-size: 12px; }
.chip.air.live { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip.air.warn { border-color: var(--yellow); color: var(--yellow); }
@keyframes blink { 50% { opacity: .3; } }

.muted { color: var(--dim); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); }
.row { display: flex; align-items: center; gap: 10px; }
.sp { flex: 1; }
.err { color: var(--accent-text); font-size: 14px; min-height: 18px; margin: 6px 0; }
.card { background: var(--panel); border: 1px solid var(--line-soft); border-radius: 14px; padding: 16px; box-shadow: var(--shadow); }

#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 100; pointer-events: none; }
.toast { background: var(--text); color: var(--ink); padding: 9px 16px; border-radius: 10px; font-weight: 600; font-size: 14px; box-shadow: var(--shadow); transition: opacity .4s, transform .4s; }
.toast.bad { background: var(--accent); color: #fff; }
.toast.out { opacity: 0; transform: translateY(8px); }

/* header */
.top { position: sticky; top: 0; z-index: 20; height: 56px; padding: 0 16px; background: rgba(14, 15, 17, .94); border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; gap: 10px; }
.top .logo { height: 24px; width: auto; mix-blend-mode: screen; flex: none; }
.top h1 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.top h1 b { color: var(--text); }
.boothtag { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; font-size: 14px; padding: 4px 10px 4px 4px; border-radius: 8px; background: var(--panel); border: 1.5px solid var(--line); white-space: nowrap; }
.boothtag b { font-family: var(--mono); font-size: 12px; background: var(--booth); color: #fff; border-radius: 5px; padding: 3px 6px; letter-spacing: .06em; }

/* login */
.hero { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 40px 24px; gap: 12px; }
.hero .logo { height: 40px; mix-blend-mode: screen; }
.hero .kicker { font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--dim); font-weight: 700; }
.hero h2 { font-size: 30px; font-weight: 700; line-height: 1.1; }
.hero p { color: var(--dim); max-width: 440px; font-size: 15.5px; }
.hero form { width: 100%; max-width: 340px; text-align: left; margin-top: 8px; }

/* ---------------------------------------------------------------- booth */

body.booth { overflow: hidden; height: 100vh; }
.stage { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; padding: 14px 16px; height: calc(100vh - 56px); }
.progcol { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
/* 16:9 as wide as the column allows, capped by the window height minus the header and strip. */
.program { display: grid; grid-template-columns: minmax(0, 1fr) 46px; gap: 8px; flex: none; }
.screen { position: relative; background: #000; border-radius: 12px; overflow: hidden; border: 1px solid var(--line-soft); display: grid; place-items: center; aspect-ratio: 16 / 9; max-height: calc(100vh - 56px - 28px - 76px - 12px); width: 100%; }
.screen video { width: 100%; height: 100%; object-fit: contain; display: block; }
.slate { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: var(--dim); background: repeating-linear-gradient(135deg, #0b0c0e 0 18px, #101215 18px 36px); }
.slate b { display: block; color: var(--text); font-size: 20px; margin: 10px 0 4px; }
.slate svg.ic { width: 40px; height: 40px; margin: 0 auto; }
.screen .feedinfo { position: absolute; left: 10px; bottom: 10px; font-family: var(--mono); font-size: 11px; color: rgba(255, 255, 255, .75); background: rgba(0, 0, 0, .55); padding: 3px 7px; border-radius: 6px; }
.vmeter { background: var(--well); border: 1px solid var(--line-soft); border-radius: 10px; padding: 8px 5px 6px; display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 0; }
.vmeter canvas { flex: 1; width: 36px; min-height: 0; }
.vmeter .cap { font-size: 10px; font-weight: 700; letter-spacing: .1em; color: var(--dim); }

.strip { display: flex; align-items: stretch; gap: 10px; flex: none; }
.mutebtn { width: 210px; flex: none; display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-radius: 14px; background: var(--panel); border: 2px solid var(--green); text-align: left; }
.mutebtn .ic { width: 30px; height: 30px; color: var(--green); }
.mutebtn b { display: block; font-size: 20px; letter-spacing: .04em; }
.mutebtn span { display: block; font-size: 12.5px; color: var(--dim); }
.mutebtn kbd { font-family: var(--mono); font-size: 11.5px; border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; color: var(--text); background: var(--well); }
.mutebtn.muted { background: var(--accent); border-color: var(--accent); }
.mutebtn.muted .ic, .mutebtn.muted span { color: #fff; }
.mutebtn.muted kbd { background: rgba(0, 0, 0, .25); border-color: rgba(255, 255, 255, .4); color: #fff; }
.tile { background: var(--panel); border: 1px solid var(--line-soft); border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; justify-content: center; gap: 6px; min-width: 0; }
.tile.grow { flex: 1; }
.tile .lbl { margin: 0; display: flex; align-items: center; gap: 6px; }
.tile .lbl .sp { flex: 1; }
.hmeter { width: 100%; height: 14px; display: block; }
.devname { font-size: 13px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.camtoggle { display: flex; align-items: center; gap: 8px; font-weight: 700; padding: 0 14px; border-radius: 14px; background: var(--panel); border: 1.5px solid var(--line); color: var(--dim); }
.camtoggle.on { color: var(--text); border-color: var(--dim); }

/* Warnings sit on top of the picture: they never push the mute button out of the window. */
.hints { position: absolute; top: 10px; left: 10px; right: 10px; z-index: 2; display: flex; flex-direction: column; gap: 8px; }
.hint { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; font-weight: 600; font-size: 14.5px; background: rgba(40, 32, 6, .92); border: 1px solid rgba(234, 179, 8, .6); }
.hint.bad { background: rgba(60, 12, 12, .92); border-color: rgba(220, 38, 38, .7); }
.hint .ic { color: var(--yellow); }
.hint.bad .ic { color: var(--accent-text); }
.hint .btn { margin-left: auto; }

.side { display: flex; flex-direction: column; gap: 12px; min-height: 0; overflow-y: auto; }
.panel { background: var(--panel); border: 1px solid var(--line-soft); border-radius: 14px; padding: 12px; }
.panel h3 { font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.voice { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px; padding: 8px 0; border-top: 1px solid var(--line-soft); }
.voice:first-of-type { border-top: none; padding-top: 0; }
.voice .face { width: 64px; height: 48px; border-radius: 8px; background: var(--well); overflow: hidden; display: grid; place-items: center; color: var(--faint); font-weight: 700; font-size: 18px; position: relative; }
.voice .face video { width: 100%; height: 100%; object-fit: cover; }
.voice .face video.mirror { transform: scaleX(-1); }
.voice.talking .face { box-shadow: 0 0 0 2px var(--green); }
.voice .who { display: flex; align-items: center; gap: 6px; min-width: 0; }
.voice .who b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.voice .who .ic { width: 16px; height: 16px; }
.voice .who .st { margin-left: auto; display: flex; gap: 4px; color: var(--dim); }
.voice .who .st .bad { color: var(--accent-text); }
.voice.off { opacity: .5; }
.voice .ctl { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.voice .ctl input[type=range] { height: 20px; }
.switch { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--dim); cursor: pointer; white-space: nowrap; }
.switch input { width: auto; accent-color: var(--text); }
.q { display: inline-flex; gap: 2px; align-items: flex-end; height: 12px; }
.q i { width: 3px; background: var(--line); border-radius: 1px; }
.q i:nth-child(1) { height: 4px; } .q i:nth-child(2) { height: 8px; } .q i:nth-child(3) { height: 12px; }
.q.excellent i, .q.good i:nth-child(-n+2) { background: var(--green); }
.q.poor i:nth-child(1) { background: var(--yellow); }
.q.lost i:nth-child(1) { background: var(--accent); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 13px; }
.kv dt { color: var(--dim); }
.kv dd { font-family: var(--mono); font-size: 12px; text-align: right; }

/* lobby + dialogs */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(5, 6, 7, .82); display: grid; place-items: center; padding: 20px; overflow-y: auto; }
.dialog { width: 100%; max-width: 560px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 22px; box-shadow: var(--shadow); }
.dialog h2 { font-size: 24px; margin-bottom: 4px; }
.dialog p.lead { color: var(--dim); margin-bottom: 16px; }
.dialog .grid2 { display: grid; grid-template-columns: 1fr 200px; gap: 16px; }
.preview { width: 200px; aspect-ratio: 16 / 9; background: var(--well); border-radius: 10px; overflow: hidden; display: grid; place-items: center; color: var(--faint); font-size: 13px; }
.preview video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.seg { display: flex; border: 1.5px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { flex: 1; padding: 9px 8px; font-weight: 600; font-size: 14px; color: var(--dim); display: flex; align-items: center; justify-content: center; gap: 6px; }
.seg button.on { background: var(--text); color: var(--ink); }
.note { font-size: 13px; color: var(--dim); margin-top: 5px; }
a.btn { text-decoration: none; }
.getapp { width: 100%; max-width: 440px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); text-align: left; }
.getapp-t { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.getapp-t span { color: var(--dim); }
.getapp-l { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 2px; }
.dialog .getapp { max-width: none; margin-top: 14px; }
.dialog .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.keycap { font-family: var(--mono); font-size: 14px; padding: 8px 12px; border: 1.5px solid var(--line); border-radius: 8px; background: var(--well); min-width: 120px; text-align: center; }
.keycap.listening { border-color: var(--yellow); color: var(--yellow); }

@media (max-width: 980px) {
  body.booth { overflow: auto; height: auto; }
  .stage { grid-template-columns: 1fr; height: auto; }
  .screen { max-height: none; }
  .strip { flex-wrap: wrap; }
  .mutebtn { width: 100%; }
  .dialog .grid2 { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------- admin */

.wrap { padding: 18px 16px 60px; max-width: 1180px; margin: 0 auto; }
.section-t { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); margin: 26px 2px 10px; display: flex; align-items: center; gap: 8px; }
.events { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.events a.card { text-decoration: none; display: block; }
.events a.card:hover { border-color: var(--line); }
.events h3 { font-size: 18px; margin-bottom: 4px; }
.field-copy { display: flex; gap: 6px; }
.field-copy input { font-family: var(--mono); font-size: 13px; }
.booths { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; }
.boothcard { border-top: 4px solid var(--booth); }
.boothcard h3 { display: flex; align-items: center; gap: 8px; font-size: 18px; }
.boothcard h3 b { font-family: var(--mono); font-size: 13px; background: var(--booth); color: #fff; padding: 2px 7px; border-radius: 5px; }
.people { margin: 10px 0; }
.person { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-top: 1px solid var(--line-soft); }
.person .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line); flex: none; }
.person .dot.on { background: var(--green); }
.person .nm { flex: 1; min-width: 0; }
.person .nm b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person .nm span { font-family: var(--mono); font-size: 11.5px; color: var(--dim); }
.person .icons { display: flex; gap: 4px; color: var(--dim); }
.person .icons .ic { width: 16px; height: 16px; }
.person .icons .bad { color: var(--accent-text); }
.person .iconbtn { width: 32px; height: 32px; border-radius: 8px; }
.person .iconbtn .ic { width: 16px; height: 16px; }
.invite { font-family: var(--mono); font-size: 13px; white-space: pre-wrap; background: var(--well); border: 1px solid var(--line); border-radius: 10px; padding: 12px; user-select: all; }
.statusline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }

/* ---------------------------------------------------------------- venue sender */

.sender { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 14px; padding: 14px 16px; max-width: 1500px; margin: 0 auto; }
.sender .screen { max-height: calc(100vh - 56px - 28px - 70px); }
@media (max-width: 980px) { .sender { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- admin outputs */

.outs { display: grid; grid-template-columns: repeat(auto-fill, minmax(480px, 1fr)); gap: 12px; }
.outcard { border-top: 4px solid var(--booth); }
.outcard h3 { display: flex; align-items: center; gap: 8px; font-size: 18px; margin-bottom: 10px; }
.outcard h3 b { font-family: var(--mono); font-size: 13px; background: var(--booth); color: #fff; padding: 2px 7px; border-radius: 5px; }
.dest { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-top: 1px solid var(--line-soft); }
.dest .nm { flex: 1; min-width: 0; }
.dest .nm b { display: block; }
.dest .nm span { display: block; font-family: var(--mono); font-size: 11.5px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dest .iconbtn { width: 32px; height: 32px; border-radius: 8px; }
.dest .iconbtn .ic { width: 16px; height: 16px; }
.dest .dot, .statusdot { width: 9px; height: 9px; border-radius: 50%; background: var(--line); flex: none; }
.dest .dot.ok { background: var(--green); }
.dest .dot.warn { background: var(--yellow); animation: blink 1s infinite; }
.dest .dot.bad { background: var(--accent); }
.mixgrid { display: grid; grid-template-columns: auto minmax(0, 1fr) 56px; gap: 4px 10px; align-items: center; font-size: 13.5px; margin-top: 6px; }
.mixgrid span.v { font-family: var(--mono); font-size: 12px; text-align: right; color: var(--dim); }
.mixgrid input[type=range] { height: 22px; }
.outsub { font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); margin: 14px 0 4px; display: flex; align-items: center; gap: 8px; }
.outrep { font-family: var(--mono); font-size: 12px; color: var(--dim); margin-top: 8px; }
.feedmodes { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.feedmodes > div { border: 1px solid var(--line-soft); border-radius: 12px; padding: 12px; background: var(--panel-2); }
.feedmodes h4 { font-size: 15px; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
@media (max-width: 860px) { .feedmodes { grid-template-columns: 1fr; } .outs { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- multiview */

.mv { display: grid; gap: 10px; padding: 10px; justify-content: center; align-content: start; }
.mv-tile { background: var(--panel); border: 1px solid var(--line-soft); border-top: 3px solid var(--booth); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; }
.mv-head { height: 34px; display: flex; align-items: center; gap: 8px; padding: 0 10px; }
.mv-head .tag { font-family: var(--mono); font-size: 12px; background: var(--booth); color: #fff; border-radius: 5px; padding: 2px 6px; }
.mv-head .nm { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mv-head .chip { padding: 3px 8px; }
.mv-dests { display: flex; gap: 4px; }
.mv-dests .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.mv-dests .dot.ok { background: var(--green); }
.mv-dests .dot.warn { background: var(--yellow); animation: blink 1s infinite; }
.mv-dests .dot.bad { background: var(--accent); }
.mv-pic { position: relative; aspect-ratio: 16 / 9; background: #000; }
.mv-pic iframe, .mv-pic video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; object-fit: contain; background: #000; }
.mv-badge { position: absolute; left: 8px; top: 8px; font-family: var(--mono); font-size: 11.5px; background: rgba(0, 0, 0, .7); color: var(--text); border-radius: 6px; padding: 3px 7px; }
.mv-foot { height: 44px; display: flex; align-items: center; gap: 10px; padding: 0 10px; }
.mv-meters { display: flex; align-items: center; gap: 6px; width: 40%; min-width: 110px; }
.mv-meters span { font-family: var(--mono); font-size: 8.5px; line-height: 10px; color: var(--dim); text-align: right; }
.mv-meters canvas { flex: 1; height: 30px; display: block; min-width: 0; }
.mv-foot [data-mvhold] { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.mv-foot .iconbtn { width: 32px; height: 32px; border-radius: 8px; }
.mv-foot .iconbtn.on { color: var(--green); border-color: var(--green); }
.seg.sm button { padding: 4px 9px; font-size: 12.5px; }
.seg button[disabled] { opacity: .4; pointer-events: none; }

/* layouts */
.layoutseg { flex-wrap: wrap; }
.layoutseg button { flex: 1 1 auto; padding: 7px 10px; font-size: 13.5px; }
.layoutseg button.on { background: var(--accent); color: #fff; }
.btn.on { border-color: var(--yellow); color: var(--yellow); }
.mv-layout { width: auto; padding: 3px 6px; font-size: 12.5px; border-radius: 6px; height: 26px; }

/* ---------------------------------------------------------------- chat */

.chat { display: flex; flex-direction: column; min-height: 0; position: relative; }
.chat-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 8px; }
.chat-tabs button { display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; border-radius: 8px; border: 1.5px solid var(--line); font-size: 13px; font-weight: 600; color: var(--dim); border-left: 3px solid var(--c, var(--line)); }
.chat-tabs button.on { color: var(--text); background: var(--panel-2); border-color: var(--dim); border-left-color: var(--c, var(--dim)); }
.chat-tabs .ic { width: 15px; height: 15px; }
.chat-tabs .badge, .badge { font-family: var(--mono); font-size: 10.5px; font-weight: 600; background: var(--accent); color: #fff; border-radius: 999px; padding: 1px 6px; }
.chat-sources { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 6px; font-size: 12px; }
.chat-sources .ok { color: var(--green); }
.chat-sources .bad { color: var(--accent-text); }
.chat-list { flex: 1; min-height: 120px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding-right: 2px; }
.chat .msg { background: var(--panel-2); border: 1px solid var(--line-soft); border-radius: 9px; padding: 6px 9px; }
.chat .msg.mine { background: #1a2229; }
.chat .msg.mention { border-color: var(--yellow); }
.chat .msg.alert { border-color: var(--accent); background: rgba(220, 38, 38, .12); }
.chat .msg.paid { border-color: var(--yellow); background: rgba(234, 179, 8, .1); }
.chat .meta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--dim); }
.chat .meta .t { font-family: var(--mono); font-size: 10.5px; margin-left: auto; }
.chat .who { color: var(--text); font-size: 13px; display: inline-flex; align-items: center; gap: 5px; }
.chat .who.crew { color: var(--yellow); }
.chat .who i, .chat .bt { font-style: normal; font-family: var(--mono); font-size: 10px; font-weight: 600; letter-spacing: .04em; padding: 1px 4px; border-radius: 4px; background: var(--line); color: var(--text); }
.chat .who.crew i { background: rgba(234, 179, 8, .2); color: var(--yellow); }
.chat .tag { display: inline-flex; align-items: center; gap: 3px; color: var(--accent-text); font-weight: 700; }
.chat .tag .ic { width: 13px; height: 13px; }
.chat .txt { font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 2px; }
.chat .at { font-weight: 700; }
.chat .at.me { background: rgba(234, 179, 8, .25); border-radius: 3px; padding: 0 2px; }
.chat .pf { font-style: normal; font-family: var(--mono); font-size: 9.5px; font-weight: 600; color: #fff; padding: 1px 4px; border-radius: 4px; margin-right: 2px; }
.chat .fw { color: var(--dim); padding: 0 2px; }
.chat .fw .ic { width: 15px; height: 15px; }
.chat .fw:hover { color: var(--text); }
.chat-more { position: absolute; left: 50%; transform: translateX(-50%); bottom: 64px; background: var(--text); color: var(--ink); font-weight: 700; font-size: 12.5px; padding: 4px 12px; border-radius: 999px; box-shadow: var(--shadow); }
.chat-form { margin-top: 8px; }
.chat-row { display: flex; gap: 6px; align-items: flex-end; }
.chat-row textarea { resize: none; min-height: 40px; max-height: 110px; font-size: 14px; }
.chat-as { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; font-size: 12.5px; color: var(--dim); }
.chat-as input[name=as] { width: 120px; padding: 4px 8px; font-size: 13px; }

/* booth: chat fills the side column */
.side .chatpanel { flex: 1 1 auto; min-height: 300px; display: flex; flex-direction: column; }
.side .chatpanel .chat { flex: 1; }
.side details.panel summary { cursor: pointer; font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); display: flex; align-items: center; gap: 8px; list-style: none; }
.side details.panel[open] summary { margin-bottom: 10px; }
.notes { white-space: pre-wrap; font-size: 14px; line-height: 1.4; }

/* crew chat drawer */
.drawer { position: fixed; top: 56px; right: 0; bottom: 0; width: 400px; z-index: 30; background: var(--panel); border-left: 1px solid var(--line); box-shadow: -10px 0 30px rgba(0, 0, 0, .35); padding: 12px; display: flex; flex-direction: column; }
.drawer .chat { flex: 1; }
.drawer h3 { font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
body.drawer-open .wrap { margin-right: 400px; }
body.drawer-open .mv, body.drawer-open .hp { margin-right: 400px; }
.iconbtn .badge { position: absolute; top: -5px; right: -5px; }
.iconbtn { position: relative; }
@media (max-width: 980px) { .drawer { width: 100%; } body.drawer-open .wrap, body.drawer-open .mv, body.drawer-open .hp { margin-right: 0; } }

/* ---------------------------------------------------------------- health */

.hp { padding: 12px 16px 40px; }
.hp-alerts { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.hp-alert { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; border: 1px solid rgba(234, 179, 8, .6); background: rgba(40, 32, 6, .9); font-size: 14px; }
.hp-alert.bad { border-color: rgba(220, 38, 38, .75); background: rgba(60, 12, 12, .9); }
.hp-alert .ic { color: var(--yellow); }
.hp-alert.bad .ic { color: var(--accent-text); }
.hp-alert b { white-space: nowrap; }
.hp-alert i { margin-left: auto; font-style: normal; font-family: var(--mono); font-size: 12px; color: var(--dim); white-space: nowrap; }
.hp-ok { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; border: 1px solid rgba(34, 197, 94, .5); color: var(--green); font-weight: 600; }
.hp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(520px, 1fr)); gap: 12px; }
.hp-card { padding: 12px 14px; }
.hp-booth { border-top: 4px solid var(--booth); }
.hp-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.hp-head .tag { font-family: var(--mono); font-size: 12px; background: var(--booth); color: #fff; border-radius: 5px; padding: 2px 6px; }
.hp-head .nm { font-weight: 700; font-size: 17px; }
.hp-top { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 12px; margin-bottom: 10px; }
.hp-thumb { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: 8px; overflow: hidden; }
.hp-thumb iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.hp-thumb .iconbtn { position: absolute; right: 6px; bottom: 6px; width: 30px; height: 30px; border-radius: 8px; background: rgba(14, 15, 17, .85); }
.hp-thumb .iconbtn.on { color: var(--green); border-color: var(--green); }
.hp-dest { display: flex; align-items: center; gap: 7px; font-size: 13px; padding: 2px 0; }
.hp-dest span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hp-levels { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 6px; font-family: var(--mono); font-size: 10.5px; color: var(--dim); }
.hp-bar { display: inline-block; width: 70px; height: 7px; border-radius: 3px; background: var(--line); overflow: hidden; vertical-align: middle; }
.hp-bar i { display: block; height: 100%; background: var(--green); }
.hp-issues { margin-top: 6px; font-size: 13px; }
.hp-issues .bad { color: var(--accent-text); }
.hp-issues .warn { color: var(--yellow); }
.hp-people { width: 100%; border-collapse: collapse; font-size: 13px; }
.hp-people th { text-align: left; font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); padding: 4px 6px; border-bottom: 1px solid var(--line-soft); }
.hp-people td { padding: 6px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.hp-people td.warn { color: var(--yellow); }
.hp-people td.bad { color: var(--accent-text); font-weight: 700; }
.hp-people .app { margin-left: 6px; font-family: var(--mono); font-size: 10px; color: var(--dim); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; }
.hp-why { font-size: 12px; color: var(--yellow); margin-top: 2px; }
tr.bad .hp-why { color: var(--accent-text); }
.hp-flags { display: flex; gap: 4px; }
.hp-flags .ic { width: 16px; height: 16px; color: var(--dim); }
.hp-flags .ic.ok { color: var(--green); }
.hp-flags .ic.bad { color: var(--accent-text); }
.lv { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--line); flex: none; vertical-align: middle; }
.lv.ok { background: var(--green); }
.lv.warn { background: var(--yellow); }
.lv.bad { background: var(--accent); animation: blink 1s infinite; }
.mv-people { display: flex; gap: 3px; }
@media (max-width: 700px) { .hp-grid { grid-template-columns: 1fr; } .hp-top { grid-template-columns: 1fr; } }

/* crew intercom in the booth */
.crewbtn { display: flex; align-items: center; gap: 8px; padding: 0 14px; border-radius: 14px; background: var(--panel); border: 1.5px solid var(--line); color: var(--dim); text-align: left; touch-action: none; user-select: none; }
.crewbtn .ic { width: 24px; height: 24px; }
.crewbtn b { display: block; font-size: 14px; letter-spacing: .04em; color: var(--text); }
.crewbtn span { display: block; font-size: 12px; }
.crewbtn kbd { font-family: var(--mono); font-size: 11px; border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; background: var(--well); }
.crewbtn.on { background: var(--yellow); border-color: var(--yellow); color: var(--ink); }
.crewbtn.on b { color: var(--ink); }
