:root {
  --bg: #0b0e13; --panel: #131821; --panel2: #1a2130; --line: #263042; --text: #e6ebf2;
  --muted: #8b96a8; --accent: #3b82f6; --live: #ef4444; --backup: #f59e0b; --ok: #22c55e;
  --idle: #64748b; --danger: #dc2626; --radius: 10px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif; }
h1 { font-size: 18px; margin: 0; } h2 { font-size: 14px; margin: 0 0 10px; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.muted { color: var(--muted); } .count { color: var(--muted); font-weight: 400; }
code { font-family: var(--mono); font-size: 12px; }
[hidden] { display: none !important; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 10px 20px; position: sticky; top: 0; z-index: 5; color: #fff;
  background: linear-gradient(90deg, #8f1515 0%, #c81e1e 55%, #dc2626 100%);
  border-bottom: 1px solid #6b1010; box-shadow: 0 2px 14px rgba(0, 0, 0, .35); }
@media (max-width: 640px) { .topbar { padding: 10px 16px; } }
.tb-left { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
/* Everything on the red bar: white text, dark see-through chips. */
.topbar .brand-dot { background: #fff; box-shadow: 0 0 8px rgba(255, 255, 255, .8); }
.topbar .pill { background: rgba(0, 0, 0, .28); border-color: rgba(255, 255, 255, .22); color: #fee2e2; }
.topbar .pill.good { background: rgba(4, 47, 25, .6); border-color: rgba(134, 239, 172, .5); color: #dcfce7; }
.topbar .pill.bad { background: #fff; border-color: #fff; color: #991b1b; font-weight: 700; }
.topbar .host, .topbar .user { color: rgba(255, 255, 255, .88); }
.topbar .btn.ghost { color: #fff; border-color: rgba(255, 255, 255, .45); }
.topbar .btn.ghost:hover { background: rgba(0, 0, 0, .2); border-color: #fff; }
.topbar .muted { color: rgba(255, 255, 255, .75); }
.nav { display: flex; gap: 4px; }
.nav a { color: rgba(255, 255, 255, .82); text-decoration: none; padding: 6px 12px; border-radius: 7px; font-weight: 600; font-size: 13.5px; }
.nav a:hover { background: rgba(0, 0, 0, .18); color: #fff; }
.nav a[aria-current="page"] { background: rgba(0, 0, 0, .3); color: #fff; box-shadow: inset 0 -2px 0 #fff; }
.nav a:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
.brand { font-weight: 700; display: flex; align-items: center; gap: 8px; font-size: 15px; }
.brand-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--live); box-shadow: 0 0 10px var(--live); }
.health { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pill { padding: 3px 10px; border-radius: 999px; font-size: 12px; background: var(--panel2); color: var(--muted);
  border: 1px solid var(--line); }
.pill.good { color: #bbf7d0; border-color: #14532d; background: #0f2a1b; }
.pill.bad { color: #fecaca; border-color: #7f1d1d; background: #2a1111; }
.host { color: var(--muted); font-family: var(--mono); font-size: 12px; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; padding: 20px; max-width: 1500px; margin: 0 auto; }
@media (max-width: 1000px) { .layout { grid-template-columns: 1fr; padding: 16px; } }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.section-head.small { margin-bottom: 8px; } .section-head.small h2 { margin: 0; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 16px; }

.btn { background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 8px;
  padding: 7px 12px; font: inherit; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: #3a4760; } .btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: white; font-weight: 600; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: white; }
.btn.ghost { background: transparent; } .btn.small { padding: 4px 9px; font-size: 12px; }
.btn.link-danger { background: transparent; border-color: transparent; color: #f87171; }
a.btn { text-decoration: none; display: inline-block; }

label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
input, select { background: #0d1118; color: var(--text); border: 1px solid var(--line); border-radius: 7px;
  padding: 8px 10px; font: inherit; font-size: 14px; min-width: 0; }
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }
.row-end { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.hint { color: var(--muted); font-size: 12px; margin: 8px 0 0; } .hint.warn { color: #fbbf24; }
.form-error { color: #fca5a5; margin: 8px 0 0; font-size: 13px; }
.new-session { border-color: #2c4a7a; }

.sessions { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 14px; }
@media (max-width: 520px) { .sessions { grid-template-columns: 1fr; } }
.empty { text-align: center; padding: 50px 0; color: var(--text); }

.session { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  border-top: 3px solid var(--idle); display: flex; flex-direction: column; }
.session.live { border-top-color: var(--live); } .session.backup { border-top-color: var(--backup); }
.s-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 12px 14px 6px; }
.s-name { font-weight: 650; font-size: 15px; word-break: break-word; }
.s-id { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.badge { font-size: 11px; font-weight: 700; letter-spacing: .06em; padding: 3px 8px; border-radius: 6px;
  background: #1e2633; color: #cbd5e1; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--idle); }
.badge.live { background: #3b1010; color: #fecaca; } .badge.live::before { background: var(--live); animation: pulse 1.4s infinite; }
.badge.backup { background: #3a2a08; color: #fde68a; } .badge.backup::before { background: var(--backup); }
@keyframes pulse { 50% { opacity: .25; } }
.s-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 6px 14px 10px; }
.stat { background: #0f141c; border-radius: 7px; padding: 6px 8px; min-width: 0; }
.stat .v { font-weight: 650; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .l { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.s-alert { margin: 0 14px 10px; padding: 8px 10px; border-radius: 7px; font-size: 12.5px; background: #2b2109; color: #fde68a; border: 1px solid #5c4410; }
.s-alert.bad { background: #2a1111; color: #fecaca; border-color: #7f1d1d; }
.s-actions { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 14px 12px; }
.s-actions .spacer { flex: 1; }

.dests { border-top: 1px solid var(--line); padding: 10px 14px 12px; }
.dests-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.dests-head .t { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.dest { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 8px; align-items: center;
  padding: 7px 0; border-bottom: 1px dashed #222b3a; }
.dest:last-of-type { border-bottom: none; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--idle); }
.dot.connected { background: var(--ok); box-shadow: 0 0 6px var(--ok); } .dot.connecting { background: #60a5fa; }
.dot.reconnecting { background: var(--backup); animation: pulse 1s infinite; } .dot.failed { background: var(--live); }
.dot.disabled, .dot.stopped { background: transparent; border: 1px solid var(--idle); }
.session.out-stopped .out-row { box-shadow: inset 3px 0 0 var(--backup); }
.d-main { min-width: 0; }
.d-name { font-weight: 600; font-size: 13px; }
.d-sub { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-err { font-size: 11.5px; color: #fca5a5; word-break: break-word; }
.d-btns { display: flex; gap: 4px; }
.add-top { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.add-top input { flex: 1; min-width: 0; padding: 6px 8px; font-size: 12.5px; }
.proto-seg button { padding: 5px 12px; font-size: 12px; font-weight: 700; }
.add-dest { display: grid; grid-template-columns: 1.6fr 1fr; gap: 6px; margin-top: 6px; }
.add-dest.srt { grid-template-columns: 1.4fr 1fr 1fr auto; }
.add-dest input { padding: 6px 8px; font-size: 12.5px; }
.add-dest .lat { flex-direction: row; align-items: center; gap: 6px; white-space: nowrap; }
.add-dest .lat input { width: 76px; }
.add-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
.add-hint { margin: 0; }
.add-btns { display: flex; gap: 6px; flex-shrink: 0; }
@media (max-width: 640px) { .add-dest, .add-dest.srt { grid-template-columns: 1fr; } }

.activity { list-style: none; margin: 0; padding: 0; max-height: 420px; overflow: auto; }
.activity li { padding: 7px 0; border-bottom: 1px solid #1d2532; font-size: 12.5px; display: grid; grid-template-columns: 58px 1fr; gap: 8px; }
.activity time { color: var(--muted); font-family: var(--mono); font-size: 11px; padding-top: 1px; }
.activity .ev-live { color: #fca5a5; } .activity .ev-backup { color: #fde68a; } .activity .ev-ok { color: #86efac; }
.activity .ev-bad { color: #fca5a5; font-weight: 600; }
.activity .ev-hint { display: block; color: #fde68a; font-weight: 400; margin-top: 2px; }
.activity li.flash { animation: flash 1.2s; } @keyframes flash { from { background: #1d2a44; } }

.cards { list-style: none; margin: 0; padding: 0; }
.cards li { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid #1d2532; font-size: 12.5px; }
.cards .still { width: 64px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 4px; background: #000; flex: none; }
.cards .info { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.cards .f { font-family: var(--mono); font-size: 12px; } .cards .m { color: var(--muted); font-size: 11.5px; }
.card-form { display: grid; gap: 8px; margin-bottom: 10px; }

.dialog { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 12px;
  padding: 20px; width: min(760px, calc(100vw - 32px)); }
.dialog.narrow { width: min(440px, calc(100vw - 32px)); }
.dialog::backdrop { background: rgba(0,0,0,.6); }
.dialog h2 { color: var(--text); text-transform: none; letter-spacing: 0; font-size: 17px; }
.dialog-close { position: absolute; right: 14px; top: 14px; margin: 0; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.tab { background: none; border: none; color: var(--muted); padding: 8px 12px; font: inherit; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab.on { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.links-intro { margin: 0 0 12px; font-size: 13px; }
.link-block { background: #0f141c; border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; margin-bottom: 10px; }
.link-label { font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.tag { font-size: 10.5px; padding: 1px 6px; border-radius: 4px; font-weight: 600; }
.tag.rec { background: #0f2a1b; color: #86efac; }
.copy-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: center; margin: 4px 0; }
.copy-row:not(:has(.k)) { grid-template-columns: minmax(0, 1fr) auto; }
.copy-row .k { font-size: 11.5px; color: var(--muted); width: 56px; }
.copy-row code { background: #070a0f; border: 1px solid #1f2836; border-radius: 6px; padding: 6px 8px;
  overflow-x: auto; white-space: nowrap; display: block; user-select: all; }
.links-foot { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.links-foot label { flex-direction: row; align-items: center; gap: 8px; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #111827;
  border: 1px solid var(--line); padding: 10px 16px; border-radius: 9px; z-index: 50; box-shadow: 0 8px 30px rgba(0,0,0,.4); }
.toast.bad { border-color: #7f1d1d; color: #fecaca; }

/* ---- v2 polish ---- */
.user { color: var(--muted); font-size: 12px; }
.summary { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 16px; }
@media (max-width: 760px) { .summary { grid-template-columns: repeat(3, 1fr); } .sum .n { font-size: 18px; } }
.sum { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; }
.sum .n { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.sum .l { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.sum.live .n { color: #fca5a5; } .sum.backup .n { color: #fde68a; } .sum.warn .n { color: #fbbf24; }

.session { overflow: hidden; border-top: none; }
.thumb { position: relative; aspect-ratio: 16 / 9; background: #05070a; display: block; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity .3s; }
.thumb img.loading { opacity: .35; }
.thumb .ov { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between;
  padding: 10px; background: linear-gradient(180deg, rgba(0,0,0,.55), transparent 35%, transparent 65%, rgba(0,0,0,.65)); pointer-events: none; }
.thumb .ov-top, .thumb .ov-bot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.thumb .ov-bot { font-size: 12px; font-variant-numeric: tabular-nums; color: #e5e7eb; text-shadow: 0 1px 2px #000; }
.thumb .age { font-size: 11px; color: #cbd5e1; text-shadow: 0 1px 2px #000; }
.session.live .thumb { box-shadow: inset 0 0 0 2px var(--live); }
.session.backup .thumb { box-shadow: inset 0 0 0 2px var(--backup); }
.s-head { padding: 12px 14px 4px; }
.s-stats { grid-template-columns: repeat(3, 1fr); }
.s-actions select { padding: 4px 6px; font-size: 12px; max-width: 190px; }
.dests-head .btn { margin-left: auto; }
.add-wrap { margin-top: 6px; }
.chips { display: flex; gap: 4px; flex-wrap: wrap; }
.chip { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: #1e2633; color: var(--muted); }
.chip.ok { background: #0f2a1b; color: #86efac; } .chip.bad { background: #2a1111; color: #fca5a5; } .chip.warn { background: #2b2109; color: #fde68a; }

.login-page { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.login-box { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 28px;
  width: min(380px, 100%); display: grid; gap: 14px; }
.brand.big { font-size: 20px; } .login-box p { margin: 0; }
.login-box { border-top: 4px solid #c81e1e; }
.btn.wide { width: 100%; padding: 10px; }
.inline-check { flex-direction: row; align-items: center; gap: 6px; margin-top: 6px; }

/* ---- Phase 7: telemetry ---- */
.spark { margin: 0 14px 8px; display: flex; flex-direction: column; gap: 3px; }
.spark svg { width: 100%; height: 30px; display: block; overflow: visible; order: 2; }
.spark .read { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; min-height: 15px; order: 1; }
.s-health { margin: 0 14px 10px; display: grid; gap: 6px; }
.s-health:empty { display: none; }
.s-health .s-alert { margin: 0; display: flex; gap: 8px; align-items: flex-start; }
.s-health .ic { font-weight: 700; flex: none; }
.dialog.wide { width: min(1100px, calc(100vw - 32px)); max-height: calc(100vh - 40px); }
.hist-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { background: transparent; border: none; color: var(--muted); padding: 6px 12px; font: inherit; font-size: 12.5px; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--panel2); color: var(--text); font-weight: 600; }
.chart { position: relative; background: #0f141c; border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px 6px; margin-bottom: 10px; }
.chart-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.chart-title { font-weight: 600; font-size: 13px; } .chart-sub { color: var(--muted); font-size: 11.5px; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); }
.legend i { display: inline-block; width: 12px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 5px; }
.legend i.band { height: 10px; width: 12px; background: rgba(245,158,11,.22); border: 1px solid rgba(245,158,11,.5); }
.legend i.drop { width: 8px; height: 8px; border-radius: 50%; background: #f87171; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .grid { stroke: #222b3a; stroke-width: 1; } .chart .axis { fill: var(--muted); font-size: 10.5px; font-variant-numeric: tabular-nums; }
.chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .cross { stroke: #64748b; stroke-width: 1; stroke-dasharray: 3 3; }
.chart .empty { fill: var(--muted); font-size: 12px; }
/* Hover readout: drawn over the chart's header strip (right side), never over the data. */
.tip { position: absolute; top: 6px; right: 10px; pointer-events: none; background: #0f141c; padding: 0 0 0 10px;
  font-size: 11.5px; white-space: nowrap; z-index: 3; font-variant-numeric: tabular-nums; display: flex; gap: 12px; align-items: center; }
.tip > div { display: inline-flex; align-items: center; } .tip .t { color: var(--muted); }
.tip i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }
.hist-table { max-height: 320px; overflow: auto; border: 1px solid var(--line); border-radius: 9px; margin-bottom: 10px; }
.hist-table table { border-collapse: collapse; width: 100%; font-size: 12px; font-variant-numeric: tabular-nums; }
.hist-table th, .hist-table td { padding: 5px 9px; border-bottom: 1px solid #1d2532; text-align: right; }
.hist-table th:first-child, .hist-table td:first-child { text-align: left; } .hist-table th { position: sticky; top: 0; background: var(--panel2); color: var(--muted); font-weight: 600; }
.hist-h3 { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 14px 0 6px; }
.activity.tall { max-height: 260px; }
input.warn-input { border-color: #b45309; }

/* ---- short links ---- */
.grid4 { display: grid; grid-template-columns: 1fr 1fr 0.9fr 1.3fr; gap: 8px; }
@media (max-width: 700px) { .grid4 { grid-template-columns: 1fr 1fr; } }
.new-session .grid2 { grid-template-columns: 1.4fr 1fr 1fr; }
@media (max-width: 760px) { .new-session .grid2 { grid-template-columns: 1fr; } }
.link-card { background: #0f141c; border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; margin-bottom: 10px; }
.link-card.expired { opacity: .55; }
.link-card-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.link-card-head .who { font-weight: 650; font-family: var(--mono); font-size: 13px; }
.link-card-head .lbl { color: var(--muted); font-size: 12.5px; }
.link-card-head .sp { flex: 1; }
.link-new { border: 1px dashed #2c4a7a; border-radius: 9px; padding: 10px 12px; margin-top: 4px; }
.links-empty { color: var(--muted); font-size: 13px; padding: 4px 0 10px; }
#dlg-links { width: min(900px, calc(100vw - 32px)); }

/* ---- backup feed ---- */
.bf-row { display: flex; align-items: center; gap: 8px; margin: 0 14px 10px; padding: 7px 10px; background: #0f141c; border-radius: 7px; font-size: 12.5px; }
.bf-t { font-weight: 600; } .bf-state { color: var(--muted); } .bf-state.ok { color: #86efac; } .bf-state.off { color: #fbbf24; }
.badge.on-backup { background: #3a2a08; color: #fde68a; }
.grid4 { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.bf-row .spacer { flex: 1; }
.enc-h { font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 8px 0 2px; }
.enc-h.bak { color: #fbbf24; }
.lat-sel { padding: 3px 6px; font-size: 12px; }

/* ---- roles (Phase 8): hide what this role can't do; the server enforces it ---- */
body[data-role="viewer"] .op-only { display: none !important; }
body:not([data-role="admin"]) .admin-only { display: none !important; }
/* Users page */
.page { padding: 20px; max-width: 1200px; margin: 0 auto; }
@media (max-width: 640px) { .page { padding: 16px; } }
.users-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .users-grid { grid-template-columns: minmax(0, 1fr); } }
.table-wrap { overflow-x: auto; }
.users-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.users-table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
  font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.users-table td { padding: 9px 8px; border-bottom: 1px solid #1d2532; vertical-align: middle; white-space: nowrap; }
.users-table tr:last-child td { border-bottom: none; }
.users-table .u-name { font-family: var(--mono); font-size: 12.5px; }
.users-table .u-actions { text-align: right; }
.users-table .u-actions .btn + .btn { margin-left: 4px; }
.you { margin-left: 8px; font-family: inherit; font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: #fecaca; background: #3b1010; padding: 1px 6px; border-radius: 4px; }
.roles { margin: 14px 0 0; font-size: 12.5px; display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; }
.roles dt { font-family: var(--mono); color: var(--text); } .roles dd { margin: 0; color: var(--muted); }
/* Phones: each user is a two-line card (name + role, then date + actions). */
@media (max-width: 640px) {
  .users-table thead { display: none; }
  .users-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; padding: 6px 0;
    border-bottom: 1px solid #1d2532; }
  .users-table tr:last-child { border-bottom: none; }
  .users-table td { border: none; padding: 3px 4px; }
  .users-table td:nth-child(3) { font-size: 12px; }
  .bf-row { flex-wrap: wrap; }
  .bf-row .spacer { flex-basis: 0; }
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.air-seg button { padding: 3px 10px; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; }
.air-seg button.on { background: #3b1010; color: #fecaca; }
.air-seg button.pref { box-shadow: inset 0 -2px 0 var(--accent); }
.air-seg button[hidden] { display: none; }
.air-seg .card-btn.on { background: #3a2a06; color: #fde68a; }
.bf-state.held { color: #fde68a; font-weight: 600; }

/* Audio meters (studio, multiview): L/R, -60…0 dBFS; the dark cover shrinks as the level rises. */
.meter { position: absolute; right: 6px; bottom: 6px; top: 36px; width: 14px; display: flex; gap: 2px; }
.meter .ch { position: relative; flex: 1; border-radius: 2px; overflow: hidden;
  background: linear-gradient(to top, #15803d 0%, #22c55e 62%, #eab308 80%, #f97316 92%, #ef4444 100%); }
.meter .cover { position: absolute; left: 0; right: 0; top: 0; height: 100%; background: rgba(10, 12, 16, .9); }
.meter .hold { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: #e5e7eb; }
.meter .hold.clip { background: var(--live); }
.meter.silent .ch { opacity: .3; }

