:root {
  --bg: #0E1116; --surface: #171B22; --surface-hi: #222833; --line: #2A313D;
  --brand: #1FA37A; --brand-hi: #2CC795; --accent: #F2B134; --text: #F4F6F8; --dim: #9AA4B2; --danger: #E5484D;
  --radius: 12px;
  --vvh: 100dvh; --vvw: 100%; --vv-off: 0px;
}
* { box-sizing: border-box; }
html {
  height: 100%;
  height: 100svh;
  height: 100dvh;
  height: -webkit-fill-available;
  color-scheme: dark;
}
html, body { margin: 0; min-height: 100%; min-height: 100svh; min-height: 100dvh; min-height: -webkit-fill-available;
  background: var(--bg); color: var(--text);
  font: 15px/1.45 Inter, "Segoe UI", system-ui, -apple-system, sans-serif; overflow-x: hidden;
  -webkit-text-size-adjust: 100%; }
body {
  min-height: var(--vvh, 100dvh);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}
button, a, summary, label, input, select, textarea, tr.click, .mv-pane, .mv-ch, .mv-audio, .list .item, .tabs button {
  touch-action: manipulation; -webkit-tap-highlight-color: rgba(31,163,122,.25); }
h1, h2, h3 { font-family: Montserrat, "Segoe UI Semibold", system-ui, sans-serif; margin: 0 0 6px; }
h1 { font-size: 26px; } h2 { font-size: 20px; } h3 { font-size: 16px; }
a { color: var(--brand-hi); }
.hidden { display: none !important; }
.eyebrow { color: var(--accent); font: 600 12px/1 Montserrat, sans-serif; letter-spacing: .12em; text-transform: uppercase; margin: 0 0 6px; }
.dim { color: var(--dim); } .error { color: var(--danger); min-height: 1.2em; }
.mail-result {
  margin: 16px 0; padding: 14px 16px; border-radius: 10px; border: 2px solid var(--accent);
  background: rgba(242,177,52,.14); color: var(--text); font-weight: 650; font-size: 15px; line-height: 1.4;
}
.mail-result.ok { border-color: var(--brand); background: rgba(31,163,122,.16); }
.mail-result.bad { border-color: var(--danger); background: rgba(229,72,77,.16); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; border: 0;
}
fieldset { border: 0; padding: 0; margin: 0; min-inline-size: 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.btn { border: 1px solid var(--line); background: var(--surface-hi); color: var(--text); border-radius: 8px;
  padding: 9px 14px; font: inherit; cursor: pointer;
  -webkit-appearance: none; appearance: none; }
a.btn {
  display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none; text-align: center; box-sizing: border-box;
}
.btn:active:not(:disabled) { border-color: var(--brand); }
.btn.primary, a.btn.primary { background: var(--brand); border-color: var(--brand); font-weight: 600; color: #fff; }
.btn.primary:active:not(:disabled) { background: var(--brand-hi); }
.btn.danger { color: var(--danger); }
.btn.ghost { background: transparent; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.icon-btn {
  display: inline-grid; place-items: center;
  width: 44px; min-width: 44px; height: 44px; min-height: 44px;
  padding: 0; flex: 0 0 44px;
}
.btn.icon-btn svg { width: 22px; height: 22px; display: block; }
input, select, textarea { width: 100%; max-width: 100%; min-width: 0; background: var(--bg); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 9px 11px; font: inherit; font-size: 16px; margin-top: 4px; color-scheme: dark; }
input[type="date"], input[type="time"], input[type="datetime-local"], input[type="file"] {
  min-height: 44px; display: block; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 3px solid var(--brand); outline-offset: 2px; border-color: transparent; }
label { display: block; margin: 12px 0; color: var(--dim); font-size: 13px; }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 42px; }
.pw-eye { position: absolute; right: 4px; bottom: 4px; width: 34px; height: 34px; padding: 0; margin: 0;
  border: 0; background: transparent; color: var(--dim); cursor: pointer; display: grid; place-items: center; }
.pw-eye:active, .pw-eye[aria-pressed="true"] { color: var(--text); }
.pw-eye svg { width: 18px; height: 18px; display: block; }
.pw-eye .eye-off { display: none; }
.pw-eye[aria-pressed="true"] .eye-on { display: none; }
.pw-eye[aria-pressed="true"] .eye-off { display: block; }
label.check { display: flex; gap: 10px; align-items: flex-start; color: var(--text); font-size: 14px; }
label.check input { width: auto; margin-top: 3px; accent-color: var(--brand); }
.send-channels { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.send-channels .check { margin: 0; align-items: center; }
.send-channels .check input { margin-top: 0; }
.auth { min-height: 100%; min-height: 100svh; min-height: 100dvh; min-height: -webkit-fill-available; min-height: var(--vvh, 100dvh);
  display: grid; align-items: safe center; justify-items: center; padding: 16px; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
.auth-card { width: min(420px, 100%); }
.auth-logo { height: 90px; display: block; margin-bottom: 16px; }

.snoop { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; background: var(--accent); color: #111; padding: 10px 16px; font-weight: 600;
  position: sticky; top: 0; z-index: 12; }
.snoop .btn { background: #111; color: var(--text); border-color: #111; min-height: 44px; }
.shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100%; min-height: 100svh; min-height: 100dvh;
  min-height: -webkit-fill-available; min-height: var(--vvh, 100dvh); min-width: 0; }
.side { background: var(--surface); border-right: 1px solid var(--line); padding: 18px 14px; display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto; gap: 14px; align-content: stretch;
  position: sticky; top: 0; height: 100vh; height: 100svh; height: 100dvh; height: -webkit-fill-available; height: var(--vvh, 100dvh);
  min-height: 0; min-width: 0; overflow: hidden; overscroll-behavior: contain; }
.brand { display: flex; gap: 12px; align-items: center; font: 700 18px Montserrat, sans-serif; }
.brand img { height: 44px; } .brand small { display: block; font: 12px Inter, sans-serif; color: var(--dim); }
body[data-panel-product="goat"] .brand img { width: 44px; object-fit: contain; border-radius: 8px; }
body[data-panel-product="goat"] .auth-logo { height: 88px; width: auto; max-width: 120px; object-fit: contain; }
nav { display: flex; flex-direction: column; gap: 2px; min-height: 0; min-width: 0;
  overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.side-foot { flex: none; position: relative; z-index: 2; margin: 0; padding-top: 10px;
  background: var(--surface); border-top: 1px solid var(--line); display: grid; gap: 8px; }
.side-foot .btn { display: block; width: 100%; }
nav .sec { color: var(--dim); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; margin: 14px 10px 4px; }
nav a { color: var(--text); text-decoration: none; padding: 8px 10px; border-radius: 8px; display: flex; justify-content: space-between; }
nav a:active { background: var(--surface-hi); }
nav a.on { background: var(--brand); font-weight: 600; }
nav a .pill { background: var(--danger); border-radius: 10px; padding: 0 7px; font-size: 12px; }
main { padding: 28px 32px; max-width: 1400px; width: 100%; min-width: 0; min-height: 0; }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.player-headline { margin-top: 10px; }
.player-row-compact { margin-top: 6px; }
.chip.player-ver { border-color: var(--brand); color: var(--text); background: rgba(31,163,122,.12); font-weight: 600; }
.cmd-queue td { vertical-align: top; }
.head-actions { max-width: 1100px; align-items: flex-end; }
.head-actions > .btn, .head-actions > a.btn { flex: 1 1 auto; min-width: 140px; }
.head-group { margin: 0; min-width: 200px; flex: 1 1 200px; color: var(--dim); font-size: 12px; }
.head-group select { margin-top: 2px; min-height: 40px; font-size: 16px; }
label.head-push.check { flex: 0 1 auto; min-width: 200px; margin: 0; align-items: center; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-hi); }
label.head-push.check input { width: 20px; height: 20px; margin: 0; flex: 0 0 auto; accent-color: var(--brand); }
label.head-push.check:focus-within { outline: 3px solid var(--brand); outline-offset: 2px; }
body[data-role="Venue"] [data-staff-only],
body[data-role="Venue"] a[href="#/codes"],
body[data-role="Venue"] a[href="#/billing"],
body[data-role="Venue"] a[href="#/support"],
body[data-role="Venue"] a[href="#/branding"],
body[data-role="Venue"] a[href="#/account"],
body[data-role="Venue"] a[href="#/maintenance"],
body[data-role="Venue"] a[href="#/affiliates"],
body[data-role="Venue"] a[href="#/dashboard"],
body[data-role="Venue"] a[href="#/groups"],
body[data-role="Venue"] a[href="#/profiles"],
body[data-role="Venue"] a[href="#/portals"],
body[data-role="Venue"] a[href="#/reports"],
body[data-role="Venue"] a[href="#/expired"] { display: none !important; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.stat b { font: 700 30px Montserrat, sans-serif; display: block; }
.stat.warn b { color: var(--accent); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--dim); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
tr.click { cursor: pointer; } tr.click:active td, tr.click:focus-visible td { background: var(--surface-hi); }
tr.group-row td { background: rgba(56, 132, 214, .16); font-weight: 600; }
tr.group-row:active td { background: rgba(56, 132, 214, .22); }
tr.group-row td:first-child { font-weight: 400; }
table input[type="checkbox"] {
  width: 18px !important; height: 18px; min-width: 18px; min-height: 18px;
  margin: 0; accent-color: var(--brand); cursor: pointer; position: relative; z-index: 2;
}
tr.group-member td:nth-child(2) { padding-left: 28px; }
tr.suspended td { opacity: .7; }
tr.ky-missing td { background: rgba(242,177,52,.12); }
.mono { font-family: Consolas, ui-monospace, monospace; font-size: 13px; }
.chip { display: inline-block; border-radius: 6px; padding: 2px 8px; font-size: 12px; background: var(--surface-hi); color: var(--text); }
.chip.ok { background: rgba(31,163,122,.2); color: var(--brand-hi); } .chip.warn { background: rgba(242,177,52,.18); color: var(--accent); }
.chip.bad { background: rgba(229,72,77,.18); color: var(--danger); }
.table-wrap { overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; container-type: inline-size; max-inline-size: 100%; min-width: 0; }
.form-grid { display: grid; gap: 0 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-grid.profile-grid {
  gap: 8px 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.form-grid.profile-grid > label { margin: 0; }
.form-grid.profile-grid .span-2 { grid-column: span 2; }
.form-grid.profile-grid .span-3 { grid-column: 1 / -1; }
.profile-card { padding: 16px; }
.profile-card h2 { margin-bottom: 10px; }
.profile-flags { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 10px 0 4px; }
.profile-flags .check { margin: 0; flex: 1 1 240px; }
.profile-card .actions { margin-top: 10px; }
@media (max-width: 960px) { .form-grid.profile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) {
  .form-grid, .form-grid.profile-grid { grid-template-columns: 1fr; }
  .form-grid.profile-grid .span-2 { grid-column: 1 / -1; }
}
.filter-row { align-items: end; margin-bottom: 12px; }
.dash-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 960px) { .dash-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.spark { display: flex; align-items: flex-end; gap: 3px; height: 120px; margin-top: 12px; }
.spark span { flex: 1; min-width: 0; background: var(--brand); border-radius: 3px 3px 0 0; opacity: .85; }
.client-grid, .tile-grid {
  display: grid;
  gap: 12px;
  width: 100%;
  align-items: start;
  grid-auto-flow: dense;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  container-type: inline-size;
}
.client-grid > .card, .tile-grid > .card { min-width: 0; padding: 14px 16px; }
.client-grid h2, .tile-grid h2 { font-size: 15px; margin-bottom: 8px; }
.tile-wide { grid-column: span 2; }
@container (max-width: 600px) { .tile-wide { grid-column: 1 / -1; } }
@media (max-width: 720px) { .tile-wide { grid-column: 1 / -1; } }
.kv-compact { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
@media (max-width: 520px) { .kv-compact { grid-template-columns: 1fr; } }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.kv b { font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.mail-list { list-style: none; margin: 0; padding: 0; max-height: 11rem; overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.mail-list li { display: flex; flex-direction: column; gap: 2px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.mail-list button.open-mail { appearance: none; background: none; border: 0; padding: 0; color: var(--brand-hi); font: inherit; text-align: left; cursor: pointer; }
.mail-view { display: block; width: 100%; height: min(60dvh, 640px); border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.mail-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; max-height: min(60dvh, 640px); overflow: auto; background: var(--bg); padding: 12px; border-radius: 8px; font: 13px/1.45 ui-monospace, SFMono-Regular, Consolas, monospace; }
.pager { margin-top: 12px; max-width: 420px; }
.topbar { display: none; }
.nav-overlay { display: none; }
.col-picker { position: relative; flex: 0 0 auto; }
.col-picker > summary { list-style: none; }
.col-picker > summary::-webkit-details-marker { display: none; }
.col-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 5; min-width: 220px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,.45); }
.col-menu .check { margin: 6px 0; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 16px 0; }
.tabs button { background: transparent; border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 7px 12px; cursor: pointer; font: inherit;
  -webkit-appearance: none; appearance: none; }
.tabs button.on { background: var(--brand); border-color: var(--brand); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 180px; }
.list { display: flex; flex-direction: column; gap: 6px; }
.list .item { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; }
.pay-qr-thumb { display: block; max-width: 120px; max-height: 120px; width: auto; height: auto; margin: 6px 0; border-radius: 8px; background: #fff; }
.brand-slot { margin-bottom: 16px; }
.brand-preview { display: block; max-width: 320px; max-height: 180px; width: auto; height: auto; margin: 10px 0; border-radius: 8px; background: #111; object-fit: contain; }
.brand-preview.empty { display: grid; place-items: center; width: 320px; height: 120px; color: var(--dim); border: 1px dashed var(--line); }
.modal {
  position: fixed; left: 0; right: 0; width: 100%;
  top: var(--vv-off, 0px); height: var(--vvh, 100dvh); max-height: var(--vvh, 100dvh);
  background: rgba(14,17,22,.8); background: color-mix(in srgb, #0E1116 80%, transparent);
  display: grid; align-items: safe center; justify-items: center;
  padding: 16px; padding-bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 10; overflow: hidden; overscroll-behavior: contain;
}
.modal-card { width: min(640px, 100%); max-height: min(90dvh, calc(var(--vvh, 100dvh) - 32px));
  overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; min-height: 0; min-width: 0; }
.modal-card.wide { width: min(980px, 100%); }
/* Multiview pick: fit viewport; scroll channels (and grid) only; keep footer actions visible */
.modal-card:has(.mv-pick) {
  display: flex; flex-direction: column; overflow: hidden;
  max-height: min(90dvh, calc(var(--vvh, 100dvh) - 32px));
}
.modal-card:has(.mv-pick) > *:not(.mv-pick) { flex-shrink: 0; }
.modal-card:has(.mv-pick) > .mv-pick {
  flex: 1 1 auto; min-height: 0; margin-top: 8px; overflow: hidden;
  grid-template-rows: auto minmax(0, 1fr); align-items: stretch;
}
.modal-card:has(.mv-pick) .mv-ch-col {
  display: flex; flex-direction: column; min-height: 0; overflow: hidden;
}
.modal-card:has(.mv-pick) .mv-chs {
  flex: 1 1 auto; min-height: 0; max-height: none;
}
.modal-card:has(.mv-pick) > .actions {
  flex-shrink: 0; margin-top: 12px; padding-top: 12px;
  border-top: 1px solid var(--line);
}
.actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); background: var(--surface-hi); border: 1px solid var(--brand);
  padding: 10px 18px; border-radius: 10px; z-index: 20;
  bottom: calc(20px + env(safe-area-inset-bottom));
  top: auto; }
.save-flash { display: inline-block; margin-left: 10px; color: var(--brand-hi); font: 600 13px Inter, sans-serif;
  letter-spacing: 0; text-transform: none; opacity: 0; transition: opacity .15s ease; pointer-events: none; }
.save-flash.on { opacity: 1; }
.setting { display: grid; grid-template-columns: 1fr 260px; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.setting > label { margin: 0; color: var(--text); font-size: 14px; }
.setting .k { font-size: 12px; color: var(--dim); }
.setting input[type="checkbox"][switch] {
  appearance: none; -webkit-appearance: none; width: 48px; height: 28px; margin: 0; padding: 0;
  justify-self: end; border-radius: 14px; background: var(--surface-hi); border: 1px solid var(--line);
  position: relative; cursor: pointer; accent-color: var(--brand);
}
.setting input[type="checkbox"][switch]::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px;
  border-radius: 50%; background: var(--text); transition: transform .15s ease;
}
.setting input[type="checkbox"][switch]:checked { background: var(--brand); border-color: var(--brand); }
.setting input[type="checkbox"][switch]:checked::after { transform: translateX(20px); }
.setting input[type="checkbox"][switch]:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); margin: 14px 0; padding: 6px 16px 12px; }
legend { color: var(--accent); font: 600 12px Montserrat, sans-serif; letter-spacing: .1em; text-transform: uppercase; padding: 0 6px; }
@media (max-width: 860px) {
  .shell { display: flex; flex-direction: column; grid-template-columns: unset; }
  .topbar {
    display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 8;
    width: 100%; background: var(--surface); border-bottom: 1px solid var(--line); padding: 10px 12px;
  }
  .nav-toggle {
    min-height: 44px; min-width: 44px; border: 1px solid var(--line); border-radius: 8px;
    background: var(--surface-hi); color: var(--text); font: inherit; cursor: pointer; padding: 8px 12px;
  }
  .topbar .brand img { height: 32px; }
  .side-brand { display: none; }
  .nav-overlay {
    display: block; position: fixed; left: 0; right: 0; width: 100%;
    top: var(--vv-off, 0px); height: var(--vvh, 100dvh);
    background: rgba(14,17,22,.65); z-index: 9;
  }
  .nav-overlay[hidden] { display: none !important; }
  .side {
    position: fixed; left: 0; right: auto; width: min(280px, 88svw, 88vw);
    top: var(--vv-off, 0px); height: var(--vvh, 100dvh); z-index: 10;
    transform: translateX(-105%); transition: transform .2s ease; border-right: 1px solid var(--line);
    padding-bottom: 0;
  }
  .side-foot { padding-bottom: max(10px, env(safe-area-inset-bottom)); }
  .shell.nav-open .side { transform: none; }
  nav { flex-direction: column; flex-wrap: nowrap; }
  nav .sec { display: block; }
  nav a, .btn, .tabs button, .list .item button {
    min-height: 44px; padding: 12px 14px;
  }
  .btn.icon-btn { width: 44px; min-width: 44px; height: 44px; padding: 0; }
  main { padding: 16px 12px 28px; }
  .setting { grid-template-columns: 1fr; }
  .head { align-items: stretch; }
  .head .row { max-width: none !important; }
  .row > * { min-width: 0; flex: 1 1 100%; }
  .actions { flex-wrap: wrap; }
  .actions .btn, .head .btn, .head a.btn { flex: 1 1 auto; text-align: center; }
  .info-grid { grid-template-columns: 1fr; }
  .auth { padding: 12px; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .auth-card { width: min(420px, 100%); padding: 18px 16px; }
  .auth-logo { height: 72px; }
  .modal { padding: 10px; padding-bottom: max(10px, env(safe-area-inset-bottom)); align-items: end; }
  .modal-card { width: 100%; max-height: min(92dvh, calc(var(--vvh, 100dvh) - 20px)); }
  .modal-card:has(.mv-pick) { max-height: min(92dvh, calc(var(--vvh, 100dvh) - 20px)); }
  .toast { left: 12px; right: 12px; transform: none; bottom: max(16px, env(safe-area-inset-bottom)); }
  .col-menu { right: auto; left: 0; }
}

/* Stacked table cards when the table itself is narrow (phones ~390px, or a squeezed pane). */
@container (width < 640px) {
  .table-wrap table, .table-wrap thead, .table-wrap tbody, .table-wrap tr, .table-wrap th, .table-wrap td {
    display: block; width: 100%;
  }
  .table-wrap thead { display: none; }
  .table-wrap tbody tr {
    margin-block-end: 12px; border: 1px solid var(--line); border-radius: 12px;
    padding: 8px 10px; background: var(--bg);
  }
  .table-wrap td {
    border-bottom: none; padding: 8px 4px;
  }
  .table-wrap td[data-label]::before {
    content: attr(data-label);
    display: block; font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
    color: var(--dim); margin-bottom: 2px;
  }
  .table-wrap td:not([data-label])::before,
  .table-wrap td[data-label=""]::before { content: none; display: none; }
  tr.group-member td:nth-child(2) { padding-left: 4px; }
}

/* Device Information tiles */
.info-grid { display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 8px; }
@media (max-width: 860px) {
  .info-grid { grid-template-columns: 1fr; }
}
.info-tile { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border: 1px solid var(--line, #2a313c); border-radius: 14px; background: var(--surface-hi); min-width: 0; }
.info-ic { flex: 0 0 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; background: rgba(31,163,122,.15); }
.info-label { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; opacity: .7; font-weight: 700; }
.info-value { font-weight: 700; margin-top: 2px; overflow-wrap: anywhere; }
.meter { height: 6px; border-radius: 4px; background: var(--line); margin-top: 6px; overflow: hidden; max-width: 260px; }
.meter > span { display: block; height: 100%; background: var(--brand-hi); }
.meter.warn > span { background: var(--accent); }
.meter.low > span { background: var(--danger); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.aff-pick { max-height: 40dvh; overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 12px; margin: 8px 0 16px; background: var(--bg); }
.aff-pick .check { margin: 8px 0; }

.tpl-list { list-style: none; margin: 12px 0 0; padding: 0; }
.tpl-list li { border-top: 1px solid var(--line); }
.tpl-list button {
  display: flex; flex-direction: column; gap: 4px; width: 100%; text-align: left;
  background: transparent; border: 0; color: inherit; font: inherit; cursor: pointer;
  padding: 14px 8px; border-radius: 0;
}
.tpl-list button:active { background: var(--surface-hi); }
.tpl-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.tpl-chips .tpl-chip {
  font-family: ui-monospace, Consolas, monospace; font-size: 12px;
  background: #E8EEF6; color: #0E1116; border: 1px solid #C5D0DE; cursor: pointer;
}
.tpl-chips .tpl-chip:active { background: #F4F6F8; color: #0E1116; }
.rte-bar { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.rte {
  min-height: 280px; max-height: 70dvh; overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text);
  font: inherit; line-height: 1.5;
}
.rte:focus { outline: 2px solid var(--brand-hi); outline-offset: 1px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; padding: 8px 14px; }
.seg button.on { background: var(--surface-hi); font-weight: 700; }
.cat-editor .seg { margin-bottom: 12px; }
.cat-fr { display: grid; gap: 0 12px; grid-template-columns: 1fr 1fr auto; align-items: end; margin: 12px 0; }
.cat-fr .row { grid-column: 1 / -1; }
.cat-fr #catFrHint { grid-column: 1 / -1; margin: 0; }
.cat-handle { cursor: grab; width: 36px; color: var(--dim); user-select: none; }
tr.dragging { opacity: .45; }
tr.cat-usa td { background: rgba(31,163,122,.12); }
.cat-table input { margin: 0; }
@media (max-width: 720px) { .cat-fr { grid-template-columns: 1fr; } }
.mv-meta { display: block; font-size: 12px; color: var(--dim); margin-top: 4px; }
.mv-grid { display: grid; gap: 10px; position: relative; z-index: 2; align-items: stretch; }
.mv-grid.one .mv-pane { min-height: 160px; }
.mv-pane {
  position: relative; isolation: isolate; min-height: 112px; border: 1px dashed var(--line); border-radius: 12px;
  padding: 0; background: var(--bg); cursor: pointer; text-align: left; color: inherit; font: inherit;
}
.mv-pane-idx {
  position: absolute; top: 6px; left: 8px; z-index: 3; pointer-events: none;
  font: 700 13px/1 Montserrat, system-ui, sans-serif; color: var(--dim);
}
.mv-pick-pane {
  position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column;
  width: auto; height: auto; margin: 0;
  padding: 22px 44px 10px 10px; border: 0; background: transparent; color: inherit; font: inherit;
  text-align: left; cursor: pointer; align-items: flex-start; justify-content: flex-start;
}
.mv-pane:not(.filled) .mv-pick-pane { align-items: center; justify-content: center; padding: 22px 44px 10px; }
.mv-pane-add {
  display: block; font-size: 32px; font-weight: 300; line-height: 1; color: var(--dim);
}
.mv-pane:active, .mv-pane:focus-visible, .mv-pane:has(.mv-pick-pane:focus-visible) { border-style: solid; border-color: var(--brand); }
.mv-pane.filled { border-style: solid; }
.mv-pane.sel { border-style: solid; border-width: 3px; border-color: var(--brand-hi); }
.mv-pane.audio { border-style: solid; border-color: var(--brand); }
.mv-grid.chrome-idle .mv-pane.sel { border-width: 1px; border-color: var(--line); }
.mv-grid.chrome-idle .mv-pane.audio { border-width: 2px; border-color: var(--brand); }
.mv-grid.chrome-idle .mv-pane:focus-visible { border-color: var(--line); }
.mv-pane b { display: block; font-size: 16px; line-height: 1.25; }
.mv-audio {
  -webkit-appearance: none; appearance: none;
  display: inline-flex; align-items: center; justify-content: center;
  position: absolute; right: 6px; bottom: 6px; z-index: 2;
  min-width: 34px; min-height: 34px; padding: 5px;
  border-radius: 8px; border: 0; color: #fff;
  cursor: pointer; pointer-events: auto;
}
.mv-audio svg { width: 18px; height: 18px; display: block; }
.mv-audio.off { background: var(--danger); }
.mv-audio.on { background: var(--brand); }
.mv-audio:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.mv-sticky {
  position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 8px;
  margin: 14px -4px 0; padding: 12px 4px max(12px, env(safe-area-inset-bottom));
  background: linear-gradient(180deg, transparent, var(--surface) 18%);
}
.mv-sticky .btn { flex: 1 1 140px; min-height: 48px; }
.mv-sticky .mv-run-toggle { flex: 1 1 100%; font-weight: 700; letter-spacing: 0.02em; }
.mv-run-toggle.push { background: var(--brand); border-color: var(--brand); color: #fff; }
.mv-run-toggle.stop {
  background: var(--danger); border-color: var(--danger); color: #fff;
}
.mv-run-toggle.stop:hover:not(:disabled) { background: #f2555a; border-color: #f2555a; }
#mvpl, #mvcats { max-height: none; overflow: visible; }
.mv-pane-pick-eyebrow { margin: 0 0 6px; }
.mv-pick-toolbar { display: flex; flex-direction: column; gap: 8px; margin-bottom: 6px; }
.mv-pick-field { display: block; margin: 0; font: 600 11px/1.2 Montserrat, sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.mv-pick-field select,
.mv-pick-field input[type="search"],
.mv-pick-field input:not([type="checkbox"]) {
  display: block; width: 100%; margin-top: 5px; min-height: 44px; padding: 8px 10px;
  font: 400 16px/1.25 Inter, system-ui, sans-serif; letter-spacing: normal; text-transform: none; color: var(--text);
  border-radius: 8px; border: 1px solid var(--line); background: var(--bg);
}
.mv-pl-select option:disabled { color: var(--danger); }
.modal-card:has(.mv-pick-compact) {
  display: flex; flex-direction: column; overflow: hidden;
  max-height: min(92dvh, calc(var(--vvh, 100dvh) - 16px));
}
.modal-card:has(.mv-pick-compact) > *:not(.mv-pick-compact) { flex-shrink: 0; }
.modal-card:has(.mv-pick-compact) > .mv-pick-compact {
  flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 6px; overflow: hidden;
}
.modal-card:has(.mv-pick-compact) .mv-pick-cat { flex-shrink: 0; margin: 0; }
.modal-card:has(.mv-pick-compact) .mv-ch-col {
  flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden;
}
.modal-card:has(.mv-pick-compact) .mv-chs {
  flex: 1 1 auto; min-height: 0; max-height: none;
}
.modal-card:has(.mv-pick-compact) > .actions { flex-shrink: 0; margin-top: 8px; padding-top: 8px; }
.mv-pl { margin: 0 0 12px; }
.mv-pl .mv-pick-h { margin-bottom: 8px; }
.seg.mv-pl-seg {
  display: flex; flex-wrap: wrap; width: 100%; overflow: visible; gap: 0;
}
.seg.mv-pl-seg button {
  -webkit-appearance: none; appearance: none;
  flex: 1 1 auto; min-width: 72px; min-height: 44px; font-size: 16px; font-weight: 700;
}
.seg.mv-pl-seg button.on { background: var(--brand); color: #fff; }
.mv-pick { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 8px; }
.mv-pick-h {
  margin: 0 0 6px; font: 700 11px/1 Montserrat, sans-serif;
  letter-spacing: .1em; text-transform: uppercase; color: var(--dim);
}
.mv-cat-col, .mv-ch-col { min-width: 0; }
label.mv-cat-col { margin: 0; color: inherit; font-size: inherit; }
#mvcats { min-height: 44px; }
@media (max-width: 640px) {
  .mv-pane { min-height: 148px; }
  .mv-pick-pane { padding: 10px 46px 10px 12px; }
  .mv-pane b { font-size: 18px; }
  .mv-audio { min-width: 40px; min-height: 40px; }
  #mvcats { min-height: 48px; font-size: 16px; }
  .seg.mv-pl-seg button { min-height: 48px; }
  .mv-chs { max-height: min(52dvh, calc(92dvh - 260px)); }
  .modal-card:has(.mv-pick) .mv-chs { max-height: none; }
  .mv-ch { padding: 14px 16px; font-size: 16px; min-height: 48px; }
  #mvsize { display: flex; width: 100%; }
  #mvsize button { flex: 1; min-height: 48px; }
}
@media (min-width: 641px) {
  .mv-pick { grid-template-columns: minmax(220px, 280px) 1fr; align-items: start; gap: 12px; }
  .modal-card:has(.mv-pick) > .mv-pick { grid-template-rows: minmax(0, 1fr); align-items: stretch; }
  .mv-cat-col { position: sticky; top: 0; }
  .modal-card:has(.mv-pick) .mv-cat-col { position: static; align-self: start; }
}
.mv-chs { overflow: auto; overscroll-behavior: contain; max-height: 52vh; max-height: 52dvh; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); -webkit-overflow-scrolling: touch; }
.mv-ch { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: inherit; font: inherit; padding: 9px 12px; cursor: pointer;
  -webkit-appearance: none; appearance: none; }
.mv-ch:active { background: var(--surface-hi); }
.cat-move { display: none; }
@media (max-width: 860px) {
  html, body, .shell, .auth { min-height: var(--vvh, 100dvh); }
  .cat-handle { width: auto; }
  .cat-move { display: flex; gap: 6px; margin-top: 6px; }
  .pw-eye { width: 44px; height: 44px; }
}
.mv-ch.on { background: rgba(31,163,122,.18); font-weight: 700; }
.seg.mv-pl-seg button.mv-pl-full {
  border-color: #c44; color: #f07178; background: rgba(196, 68, 68, .14);
}
.seg.mv-pl-seg button.mv-pl-full.on {
  border-color: #e05555; background: rgba(224, 85, 85, .22);
}
.mv-secondary-actions {
  display: flex; flex-direction: row; flex-wrap: nowrap; align-items: center;
  gap: 8px; margin-top: 10px;
}
.mv-secondary-actions .btn {
  flex: 1 1 0; min-width: 0; min-height: 40px; padding: 8px 10px;
  font-size: 14px; font-weight: 600; margin-top: 0;
}
.mv-presets { margin-top: 12px; padding-top: 8px; border-top: 1px solid var(--line); }
.mv-pr {
  padding: 8px 0; border-bottom: 1px solid var(--line);
}
.mv-pr-main { min-width: 0; }
.mv-pr-title-row { display: flex; align-items: center; gap: 6px; }
.mv-pr-name {
  flex: 1; min-width: 0; margin: 0; padding: 6px 8px; border-radius: 8px;
  border: 1px solid transparent; background: transparent; color: var(--text);
  font: 650 15px/1.25 Inter, system-ui, sans-serif;
}
.mv-pr-name:focus { border-color: var(--line); background: var(--bg); outline: none; }
.mv-pr-name::placeholder { color: var(--dim); font-weight: 500; }
.mv-pr-meta { font-size: 14px; line-height: 1.35; margin: 2px 0 0; padding-left: 8px; }
.mv-pr-del {
  color: var(--danger); border-color: rgba(229, 72, 77, .55); background: rgba(229, 72, 77, .12);
  flex-shrink: 0; min-height: 36px; min-width: 36px; padding: 6px;
}
.mv-pr-del svg { width: 18px; height: 18px; }
@media (hover: hover) and (pointer: fine) {
  .mv-pr-del:hover { color: #fff; border-color: var(--danger); background: var(--danger); }
}
.mv-pr-actions {
  display: flex; flex-wrap: nowrap; gap: 8px; justify-content: flex-start;
  margin-top: 8px; padding-left: 8px;
}
.mv-pr-actions .btn { min-height: 42px; min-width: 76px; padding: 8px 14px; font-size: 15px; flex: 0 0 auto; }
.tpl-preview { display: block; width: 100%; min-height: 420px; border: 1px solid var(--line); border-radius: 8px; background: #f4f6f8; }

/* Fine pointer hover only — iOS keeps :hover sticky after tap. */
@media (hover: hover) and (pointer: fine) {
  .btn:hover:not(:disabled) { border-color: var(--brand); }
  .btn.primary:hover:not(:disabled) { background: var(--brand-hi); }
  .pw-eye:hover { color: var(--text); }
  nav a:hover { background: var(--surface-hi); }
  tr.click:hover td { background: var(--surface-hi); }
  tr.group-row:hover td { background: rgba(56, 132, 214, .22); }
  .tpl-list button:hover { background: var(--surface-hi); }
  .tpl-chips .tpl-chip:hover { background: #F4F6F8; color: #0E1116; }
  .mv-pane:hover { border-style: solid; border-color: var(--brand); }
  .mv-ch:hover { background: var(--surface-hi); }
}

html:has(#modal:not(.hidden)),
html:has(.shell.nav-open) {
  overflow: hidden;
  overscroll-behavior: none;
}

@supports not (backdrop-filter: blur(1px)) {
  .modal { background: rgba(14, 17, 22, .88); }
  .nav-overlay { background: rgba(14, 17, 22, .78); }
}

/* GOAT venue panel — phones and tablets (goat.mdetv.dev + Venue role) */
body[data-panel-product="goat"] select,
body[data-role="Venue"] select,
body[data-panel-product="goat"] input,
body[data-role="Venue"] input {
  font-size: 16px;
}
.venue-box-cards { display: none; gap: 12px; margin-bottom: 12px; }
.venue-box-card { display: grid; gap: 10px; padding: 16px; }
.venue-box-card-title { font-size: 18px; line-height: 1.3; }
.venue-box-id { font-size: 12px; margin-top: 4px; word-break: break-all; }
.venue-box-card-actions { display: grid; grid-template-columns: 1fr; gap: 8px; }
.venue-box-card-actions .btn,
button.venue-mv-cta {
  display: flex; width: 100%; min-height: 52px; font-size: 17px; font-weight: 600;
  align-items: center; justify-content: center; color: #fff;
}
.mv-player-select { width: 100%; min-height: 48px; }
@media (max-width: 860px) {
  body[data-panel-product="goat"] .head.venue-head,
  body[data-role="Venue"] .head.venue-head,
  body[data-panel-product="goat"] .head.venue-mv-head,
  body[data-role="Venue"] .head.venue-mv-head {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  body[data-panel-product="goat"] .venue-mv-cta,
  body[data-role="Venue"] .venue-mv-cta {
    width: 100%;
    min-height: 52px;
    font-size: 17px;
    text-align: center;
  }
  body[data-panel-product="goat"] .venue-box-table,
  body[data-role="Venue"] .venue-box-table { display: none; }
  body[data-panel-product="goat"] .venue-box-cards,
  body[data-role="Venue"] .venue-box-cards { display: grid; }
  body[data-panel-product="goat"] .mv-sticky,
  body[data-role="Venue"] .mv-sticky {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0;
    padding: 12px max(12px, env(safe-area-inset-left)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-right));
    background: var(--surface);
    border-top: 1px solid var(--line);
    box-shadow: 0 -10px 28px rgba(0, 0, 0, .35);
    z-index: 25;
  }
  /* Pane picker sheet must sit above fixed Push/Stop (z-index 25) */
  body[data-panel-product="goat"] #modal:not(.hidden),
  body[data-role="Venue"] #modal:not(.hidden) {
    z-index: 30;
  }
  body[data-panel-product="goat"]:has(#modal:not(.hidden)) .mv-sticky,
  body[data-role="Venue"]:has(#modal:not(.hidden)) .mv-sticky {
    visibility: hidden;
    pointer-events: none;
  }
  body[data-panel-product="goat"]:has(#modal:not(.hidden)) #toast,
  body[data-role="Venue"]:has(#modal:not(.hidden)) #toast {
    z-index: 35;
  }
  body[data-panel-product="goat"] main:has(.mv-sticky),
  body[data-role="Venue"] main:has(.mv-sticky) {
    padding-bottom: calc(84px + env(safe-area-inset-bottom));
  }
  body[data-panel-product="goat"] .toast,
  body[data-role="Venue"] .toast {
    bottom: calc(84px + env(safe-area-inset-bottom));
    z-index: 24;
  }
  body[data-panel-product="goat"] .mv-sticky .btn,
  body[data-role="Venue"] .mv-sticky .btn {
    min-height: 52px;
    font-size: 17px;
    flex: 1 1 100%;
  }
  body[data-panel-product="goat"] .venue-mv-presets > .dim,
  body[data-role="Venue"] .venue-mv-presets > .dim {
    display: none;
  }
  body[data-panel-product="goat"] .mv-presets,
  body[data-role="Venue"] .mv-presets {
    margin-top: 10px;
    padding-top: 6px;
  }
  body[data-panel-product="goat"] .mv-pr-actions .btn,
  body[data-role="Venue"] .mv-pr-actions .btn {
    min-height: 44px;
    min-width: 80px;
  }
  body[data-panel-product="goat"] .modal:has(.mv-pick-compact),
  body[data-role="Venue"] .modal:has(.mv-pick-compact) {
    align-items: stretch; justify-items: stretch;
    padding: 0; padding-top: max(6px, env(safe-area-inset-top));
  }
  body[data-panel-product="goat"] .modal-card:has(.mv-pick-compact),
  body[data-role="Venue"] .modal-card:has(.mv-pick-compact) {
    width: 100%; max-width: none; margin-top: auto;
    max-height: min(94dvh, calc(var(--vvh, 100dvh) - env(safe-area-inset-top)));
    border-radius: 16px 16px 0 0;
    padding: 14px 12px max(16px, env(safe-area-inset-bottom));
  }
  body[data-panel-product="goat"] .modal-card:has(.mv-pick-compact) > .actions,
  body[data-role="Venue"] .modal-card:has(.mv-pick-compact) > .actions {
    display: flex; gap: 10px; justify-content: stretch;
  }
  body[data-panel-product="goat"] .modal-card:has(.mv-pick-compact) > .actions .btn,
  body[data-role="Venue"] .modal-card:has(.mv-pick-compact) > .actions .btn {
    flex: 1 1 0; min-height: 48px;
  }
  body[data-panel-product="goat"] .modal-card:has(.mv-pick-compact) .mv-chs,
  body[data-role="Venue"] .modal-card:has(.mv-pick-compact) .mv-chs {
    max-height: none;
  }
  body[data-panel-product="goat"] .modal-card:has(.mv-pick-compact) #mvperr:not(.hidden),
  body[data-role="Venue"] .modal-card:has(.mv-pick-compact) #mvperr:not(.hidden) {
    margin: 4px 0 0; font-size: 13px;
  }
}
@media (min-width: 861px) and (max-width: 1100px) {
  body[data-panel-product="goat"] .venue-box-card-actions,
  body[data-role="Venue"] .venue-box-card-actions {
    grid-template-columns: 1fr 1fr;
  }
}
