/* ── Avenir Next LT Pro (self-hosted) ─────────────────────────────── */
@font-face { font-family: 'Avenir Next LT Pro'; src: url('/fonts/AvenirNextLTPro-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Avenir Next LT Pro'; src: url('/fonts/AvenirNextLTPro-It.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Avenir Next LT Pro'; src: url('/fonts/AvenirNextLTPro-Medium.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Avenir Next LT Pro'; src: url('/fonts/AvenirNextLTPro-MediumIt.woff2') format('woff2'); font-weight: 500; font-style: italic; font-display: swap; }
@font-face { font-family: 'Avenir Next LT Pro'; src: url('/fonts/AvenirNextLTPro-Bold.woff2') format('woff2'); font-weight: 600 800; font-style: normal; font-display: swap; }
@font-face { font-family: 'Avenir Next LT Pro'; src: url('/fonts/AvenirNextLTPro-BoldIt.woff2') format('woff2'); font-weight: 600 800; font-style: italic; font-display: swap; }
/* The scrolling wall: Heavy Condensed Italic */
@font-face { font-family: 'Avenir Next LT Pro Heavy Cn'; src: url('/fonts/AvenirNextLTPro-HeavyCnIt.woff2') format('woff2'); font-weight: 900; font-style: italic; font-display: block; }

:root {
  --red: #d12030;
  --red-deep: #951621;
  --ink: #130305;
  --box: rgba(40, 6, 10, 0.82);
  --white: #fff;
  --soft: rgba(255, 255, 255, 0.8);
  --display: 'Avenir Next LT Pro Heavy Cn', 'Avenir Next Condensed', 'Arial Narrow', sans-serif;
  --text: 'Avenir Next LT Pro', 'Avenir Next', Avenir, 'Segoe UI', system-ui, sans-serif;
  --gutter: clamp(16px, 2.8vw, 48px);
  --wall-size: clamp(50px, 9.6vw, 148px);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--red);
  color: var(--white);
  font-family: var(--text);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}
button, input, select, textarea { font-family: inherit; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.eyebrow {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
}

/* ── The TOWN HALL wall ─────────────────────────────── */
.hero { position: relative; overflow: hidden; }
.wall {
  display: flex;
  flex-direction: column;
  user-select: none;
  pointer-events: none;
}
.hero .wall {
  -webkit-mask-image: linear-gradient(#000 0 70%, transparent 98%);
          mask-image: linear-gradient(#000 0 70%, transparent 98%);
  margin-top: calc(var(--wall-size) * -0.42);  /* first row bleeds off the top, like the mockup */
}
.wall-row {
  white-space: nowrap;
  font-family: var(--display);
  font-style: italic;
  font-weight: 900;
  font-size: var(--wall-size);
  line-height: 1.08;
  text-transform: uppercase;
  color: transparent;
  -webkit-text-stroke: max(2px, calc(var(--wall-size) * 0.022)) var(--ink);
}
.wall-row.static { align-self: center; }
.wall-seq { display: inline-flex; flex: none; }
/* padding (not margin/gap) so both copies in a track are exactly the same width */
.wall-seq span { padding-right: 0.3em; }
/* Two identical copies side by side; moving by exactly one copy (-50%) loops with no visible jump */
.wall-track {
  display: inline-flex;
  will-change: transform;
  /* duration is set by wall.js so the speed matches on every screen size */
  animation: wall-loop 600s linear infinite;
}
.wall-track.reverse { animation-direction: reverse; }
@keyframes wall-loop {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-50%, 0, 0); }
}
.wall-row .solid {
  color: #fff;
  -webkit-text-stroke: 0;
  background: linear-gradient(#fff 30%, #f7dfe1);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 18px rgba(80, 0, 10, 0.25));
}
@media (prefers-reduced-motion: reduce) { .wall-track { animation: none; } }

/* ── Sign-in ─────────────────────────────── */
.login-card {
  position: relative;
  z-index: 2;
  width: min(460px, calc(100% - 2 * var(--gutter)));
  margin: calc(var(--wall-size) * -0.6) auto 80px;
  padding: 34px 34px 30px;
  background: var(--box);
  border-radius: 10px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(60, 0, 8, 0.35);
  backdrop-filter: blur(6px);
}
.login-card h2 { margin: 8px 0 6px; font-size: 30px; font-weight: 600; }
.login-sub { margin: 0; color: var(--soft); }
.orgs { margin: 18px 0 24px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.org {
  position: relative; display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 8px 5px 13px; border-radius: 999px; cursor: help;
  background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, 0.4);
  font: 500 14px var(--text);
}
.org:hover, .org:focus-visible, .org.open { background: rgba(255,255,255,.12); outline: none; }
.org:focus-visible { box-shadow: 0 0 0 3px rgba(255,255,255,.45); }
.org-i {
  display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 50%;
  background: rgba(255,255,255,.2); font: italic 600 11px var(--text);
}
.org-tip {
  position: absolute; bottom: calc(100% + 10px); left: 50%; z-index: 10;
  width: 240px; padding: 10px 12px; border-radius: 6px;
  background: #fff; color: #2b1a1c; box-shadow: 0 10px 30px rgba(0,0,0,.3);
  font: 400 13px/1.45 var(--text); text-align: left; white-space: normal;
  opacity: 0; visibility: hidden; transform: translate(-50%, 4px);
  transition: opacity .15s, transform .15s, visibility .15s;
}
.org-tip::after {
  content: ''; position: absolute; top: 100%; left: 50%; margin-left: -6px;
  border: 6px solid transparent; border-top-color: #fff;
}
.org-tip .nowrap { white-space: nowrap; }
.org:hover .org-tip, .org:focus-visible .org-tip, .org.open .org-tip {
  opacity: 1; visibility: visible; transform: translate(-50%, 0);
}
.btn-ms {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  width: 100%; height: 48px; padding: 0 20px;
  background: #fff; color: #5e5e5e; border: 0; border-radius: 4px;
  font: 600 15px var(--text); cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.btn-ms:hover { box-shadow: 0 6px 20px rgba(0,0,0,.25); transform: translateY(-1px); }
.btn-ms:disabled { opacity: .7; cursor: progress; transform: none; }
.login-error {
  margin: 18px 0 0; padding: 12px 14px; border-radius: 6px;
  background: rgba(255,255,255,.12); border-left: 3px solid #ffd2d6; text-align: left; font-size: 14px;
}
.dev-login { display: grid; gap: 10px; text-align: left; margin-top: 6px; }
.dev-login label { display: grid; gap: 4px; font-size: 13px; color: var(--soft); }
.dev-login input, .dev-login select {
  height: 38px; padding: 0 10px; border-radius: 4px; border: 0; font: 15px var(--text);
}
.dev-flag { margin: 0 0 4px; font-size: 12px; color: #ffd27a; text-align: center; }

/* ── Signed-in page ─────────────────────────────── */
.userbar {
  position: absolute; top: 14px; right: var(--gutter); z-index: 5;
  display: flex; align-items: center; gap: 16px;
  padding: 6px 8px 6px 14px; border-radius: 999px;
  background: rgba(30, 4, 8, .55); backdrop-filter: blur(6px);
  font-size: 14px;
}
.who { display: inline-flex; align-items: center; gap: 8px; }
.org-chip { font-size: 12px; padding: 2px 9px; border-radius: 999px; background: rgba(255,255,255,.16); }
.userbar-actions { display: inline-flex; gap: 4px; }
.userbar a, .link-btn {
  color: #fff; background: none; border: 0; font: inherit; cursor: pointer;
  padding: 4px 10px; border-radius: 999px; text-decoration: none;
}
.userbar a:hover, .link-btn:hover { background: rgba(255,255,255,.14); }

.stream-wrap { padding: 0 var(--gutter); margin-top: calc(var(--wall-size) * -0.35); position: relative; z-index: 2; }
.stream-meta {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap;
  margin: 0 2px 10px;
}
.next { font-size: 15px; color: var(--soft); }
.next b { color: #fff; font-weight: 600; }
.next-label {
  display: inline-block; margin-right: 10px; padding: 3px 10px; border-radius: 999px;
  background: rgba(30, 4, 8, .55); color: #fff; font-size: 12px; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase; vertical-align: 1px;
}
.next-label.live { background: #fff; color: #b31826; }
.next-label.live::before { content: ''; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: #d12030; vertical-align: 1px; }
.stream-frame { background: #000; box-shadow: 0 24px 60px rgba(60, 0, 8, .35); }
.stream-frame iframe { display: block; border: 0; }

.catchup {
  position: relative; overflow: hidden;
  margin: clamp(48px, 6vw, 96px) var(--gutter) 0;
  background: var(--red-deep);
  min-height: clamp(300px, 26vw, 460px);
  display: grid; place-items: center;
  box-shadow: 0 10px 30px rgba(60,0,8,.25);
}
.catchup .wall { position: absolute; inset: -0.3em 0 auto; --wall-size: clamp(44px, 7.4vw, 116px); }
.catchup .wall-row { -webkit-text-stroke-color: #120002; line-height: 1.18; }
.catchup-box {
  position: relative; z-index: 1;
  width: min(660px, calc(100% - 32px));
  padding: 30px 36px 26px; text-align: center;
  background: var(--box); border-radius: 6px;
}
.catchup-box h2 { margin: 10px 0 18px; font-size: clamp(24px, 2.6vw, 40px); line-height: 1.3; font-weight: 500; }
.btn-light {
  background: #fff; color: #b31826; border: 0; border-radius: 4px;
  padding: 11px 20px; font: 500 18px var(--text); cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.btn-light:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,0,0,.3); }

.recordings { margin: 0 var(--gutter); padding: 32px clamp(16px, 2.5vw, 36px) 40px; background: var(--red-deep); border-top: 1px solid rgba(0,0,0,.25); }
.recordings h2 { margin: 0 0 18px; font-size: 22px; font-weight: 600; }
.rec-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.rec {
  display: flex; flex-direction: column; gap: 6px; height: 100%;
  padding: 18px 18px 16px; border-radius: 6px; background: var(--box);
  color: #fff; text-decoration: none; text-align: left; border: 0; font: inherit; width: 100%; cursor: pointer;
  transition: transform .15s, background .15s;
}
.rec:hover { transform: translateY(-2px); background: rgba(20, 2, 5, .9); }
.rec-date { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--soft); }
.rec-title { font-size: 19px; font-weight: 600; }
.rec-desc { font-size: 14px; color: var(--soft); flex: 1; line-height: 1.45; }
.rec-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.rec-play { font-size: 14px; font-weight: 600; }
.rec-len { font-size: 13px; color: var(--soft); font-variant-numeric: tabular-nums; }
.rec-play::before { content: '▶'; font-size: 11px; margin-right: 7px; }
.rec-empty { color: var(--soft); }

.foot { text-align: center; font-size: 13px; color: rgba(255,255,255,.7); padding: 28px var(--gutter) 36px; }

.player {
  width: min(1100px, 94vw); padding: 0; border: 0; border-radius: 8px; background: #000; color: #fff;
}
.player::backdrop { background: rgba(20, 0, 4, .8); }
.player-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 8px 8px 16px; background: #1a0306; }
.player video { display: block; width: 100%; aspect-ratio: 16/9; background: #000; }
.player-msg { margin: 0; padding: 60px 24px; text-align: center; color: var(--soft); }
.dev-login .check { display: flex; align-items: center; gap: 8px; color: #fff; font-size: 14px; }
.dev-login .check input { height: auto; width: 16px; height: 16px; }

/* ── Admin ─────────────────────────────── */
.hero-short .wall { -webkit-mask-image: linear-gradient(#000 0 55%, transparent 95%); mask-image: linear-gradient(#000 0 55%, transparent 95%); }
.admin { width: min(1100px, calc(100% - 2 * var(--gutter))); margin: calc(var(--wall-size) * -0.9) auto 60px; position: relative; z-index: 2; }
.admin-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; font-size: 14px; flex-wrap: wrap; }
.admin-top .back { color: #fff; text-decoration: none; font-weight: 600; }
.admin-top #admin-who { color: var(--soft); }
.admin-card { background: var(--box); border-radius: 8px; padding: 24px; }
.admin-card h2 { margin: 0 0 4px; font-size: 22px; }
.admin-note { color: var(--soft); margin: 0 0 18px; font-size: 14px; line-height: 1.5; }
.admin-note.small { margin: 16px 0 0; font-size: 13px; }
.admin-denied { text-align: center; }

.tabs { display: flex; gap: 4px; margin-bottom: -1px; overflow-x: auto; }
.tabs button {
  background: rgba(40, 6, 10, .45); color: rgba(255,255,255,.8); border: 0; cursor: pointer;
  padding: 11px 16px; border-radius: 8px 8px 0 0; font: 600 14px var(--text); white-space: nowrap;
}
.tabs button[aria-selected="true"] { background: var(--box); color: #fff; }
.tabs + .panel { border-top-left-radius: 0; }
.panel { border-top-left-radius: 0; }

.preview-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 16px; margin-bottom: 20px; border-radius: 6px; background: var(--red); }
.preview-label { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: rgba(255,255,255,.75); }
.preview-bar .next { color: rgba(255,255,255,.9); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.form-grid label, .admin label { display: grid; gap: 6px; font-size: 13px; color: var(--soft); }
.form-grid .span-2 { grid-column: 1 / -1; }
.tz { font-size: 12px; opacity: .8; }
.admin input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=range]), .admin textarea {
  width: 100%; min-height: 40px; padding: 8px 10px; border-radius: 4px; border: 1px solid transparent;
  font: 15px var(--text); color: #1a1a1a; background: #fff;
}
.admin textarea { resize: vertical; line-height: 1.4; }
.admin input:focus, .admin textarea:focus { outline: 3px solid rgba(255,255,255,.45); outline-offset: 1px; }
.form-actions { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.form-actions .btn-light { font-size: 16px; padding: 9px 22px; }
.admin .check { display: inline-flex; align-items: center; gap: 8px; color: #fff; font-size: 14px; margin-right: auto; }
.admin .check input { width: 16px; height: 16px; }
.saved { font-size: 13px; color: #b9f1c9; }
.saved.error { color: #ffd2d6; }

.panel-head { margin-bottom: 8px; display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.panel-head-actions { display: flex; align-items: center; gap: 8px; }
.panel-head .btn-light { font-size: 15px; padding: 9px 16px; }
.panel-head .btn-light:disabled { opacity: .5; cursor: not-allowed; transform: none; }
/* Shade connection box */
.shade-box { margin: 8px 0 20px; border-radius: 6px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14); }
.shade-box summary {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px; cursor: pointer; list-style: none;
  font-weight: 600; font-size: 15px;
}
.shade-box summary::-webkit-details-marker { display: none; }
.shade-box summary::before { content: '▸'; font-size: 12px; transition: transform .15s; }
.shade-box[open] summary::before { transform: rotate(90deg); }
.shade-box form { padding: 0 16px 18px; }
.pill.warn { background: #b26a00; }
.label-row { display: flex; justify-content: space-between; align-items: center; }
.link-btn.small { font-size: 13px; padding: 2px 8px; color: #fff; text-decoration: underline; }
.field-help { font-size: 12px; line-height: 1.45; color: var(--soft); }
.drive-field { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.drive-field label { flex: 1 1 280px; }
.drive-field .btn-small { height: 40px; padding: 0 14px; font-size: 14px; }
.drive-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.drive-pick {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%;
  padding: 10px 12px; border-radius: 6px; cursor: pointer; text-align: left;
  background: rgba(0,0,0,.25); color: #fff; border: 1px solid rgba(255,255,255,.15); font: 14px var(--text);
}
.drive-pick span { font-size: 12px; color: var(--soft); word-break: break-all; }
.drive-pick.match span { color: #b9f1c9; }
.drive-pick.chosen { border-color: #fff; box-shadow: 0 0 0 2px rgba(255,255,255,.35); }
.form-actions .btn-light:disabled { opacity: .6; cursor: progress; transform: none; }

.rec-admin { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.rec-row { padding: 16px; border-radius: 6px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); }
.rec-row.is-hidden { opacity: .6; }
.rec-row-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 12px; font-size: 13px; color: var(--soft); }
.rec-row .form-actions { margin-top: 12px; }

.inline-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.inline-form input { flex: 1 1 260px; max-width: 380px; }
.inline-form .btn-light { font-size: 15px; padding: 9px 16px; }
.admin-list { list-style: none; margin: 0; padding: 0; }
.admin-list .who-email { font-weight: 600; }
.admin-list .actions { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.role-badge { font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: rgba(255,255,255,.16); }
.role-badge.role-owner { background: #fff; color: #b31826; }
.admin-list .who-email { white-space: nowrap; }
.admin-list .meta { flex: 1 1 200px; min-width: 0; }
.admin-list .actions { flex: none; }
.inline-form select { height: 40px; padding: 0 10px; border-radius: 4px; border: 0; font: 15px var(--text); color: #1a1a1a; }
.perm-table { width: 100%; max-width: 640px; margin: 0 0 22px; border-collapse: collapse; font-size: 14px; }
.perm-table th, .perm-table td { padding: 8px 10px; border-bottom: 1px solid rgba(255,255,255,.12); }
.perm-table th { text-align: left; }
.perm-table .c { text-align: center; width: 90px; }
.perm-table .yes { color: #b9f1c9; font-weight: 700; }
.perm-table .no { color: rgba(255,255,255,.45); }
.admin-list li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid rgba(255,255,255,.12); }

.admin-list .meta { color: var(--soft); font-size: 13px; margin-right: auto; }

.admin table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin th, .admin td { padding: 10px 8px; text-align: left; border-bottom: 1px solid rgba(255,255,255,.12); }
.admin th { font-weight: 600; color: var(--soft); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.admin .num { text-align: right; font-variant-numeric: tabular-nums; }
.admin .actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.btn-small { background: #fff; color: #b31826; border: 0; border-radius: 4px; padding: 6px 10px; font: 500 13px var(--text); cursor: pointer; text-decoration: none; }
.btn-small[disabled] { opacity: .5; cursor: not-allowed; }
.pill { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,.14); white-space: nowrap; }
.pill.ok { background: #1f7a3f; }

@media (max-width: 640px) {
  .userbar { position: static; margin: 10px var(--gutter) 0; justify-content: space-between; border-radius: 8px; }
  .stream-wrap { margin-top: 16px; }
  .stream-frame iframe { min-height: 0 !important; } /* keep 16:9 on phones */
  .catchup-box { padding: 22px 18px; }
  .admin .hide-sm { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .admin-list li { flex-wrap: wrap; }
}

/* ── Main page: branded "Up next" screen in the player area ── */
.stream-frame { position: relative; }
.page-slate {
  position: relative; overflow: hidden; display: grid; place-items: center;
  aspect-ratio: 16 / 9; min-height: 340px; background: var(--red-deep);
}
/* Photo + colour overlay (set on the admin page; these are the defaults until settings load) */
.page-slate, .display-slate {
  --slate-image: url('/brand/slate-default.jpg');
  --slate-color: #CF202F;
  --slate-opacity: .7;
}
.slate-bg { position: absolute; inset: 0; background: #2a0508 var(--slate-image) center / cover no-repeat; }
.slate-overlay { position: absolute; inset: 0; background: var(--slate-color); opacity: var(--slate-opacity); }
.page-slate-card {
  position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 8px;
  max-width: calc(100% - 32px); padding: clamp(18px, 2.4vw, 32px) clamp(20px, 3.4vw, 48px);
  border-radius: 8px; background: var(--box); text-align: center;
}
.page-slate-card .next-label { margin: 0; }
.page-slate-title { font-size: clamp(22px, 3vw, 44px); font-weight: 600; line-height: 1.15; }
.page-slate-when { font-size: clamp(14px, 1.5vw, 20px); color: var(--soft); }
.next-label.onair { background: #fff; color: #b31826; }
.next-label.onair::before { content: ''; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: #d12030; vertical-align: 1px; animation: blink 1.4s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .next-label.onair::before { animation: none; } }

/* ── Admin: branded screen ── */
.section-gap { margin-top: 34px !important; }
.brand-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.brand-preview { min-height: 0; border-radius: 6px; }
.brand-preview .page-slate-title { font-size: clamp(18px, 2vw, 28px); }
.brand-preview .page-slate-when { font-size: 13px; }
.brand-controls { display: grid; gap: 8px; }
.brand-controls .label-strong { margin-top: 8px; display: block !important; }
.brand-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.file-btn { display: inline-flex !important; align-items: center; height: 36px; padding: 0 14px; font-size: 14px !important; color: #b31826 !important; cursor: pointer; }
input[type=color] { width: 44px; height: 36px; padding: 2px; border: 0; border-radius: 4px; background: #fff; cursor: pointer; }
.admin input.hex-input { width: 110px !important; min-height: 36px !important; height: 36px; font-family: ui-monospace, Menlo, monospace !important; text-transform: uppercase; }
input[type=range] { width: 100%; accent-color: #fff; }
@media (max-width: 760px) { .brand-grid { grid-template-columns: 1fr; } }

/* ── Admin: live status ── */
.live-box { margin-top: 0; margin-bottom: 26px; }
.btn-end {
  background: #fff; color: #b31826; border: 2px solid #fff; border-radius: 4px; cursor: pointer;
  padding: 9px 18px; font: 700 15px var(--text); letter-spacing: .01em;
}
.btn-end:hover { background: #ffe9ec; }
.btn-end:disabled { opacity: .6; cursor: progress; }
.pill.live { background: #fff; color: #b31826; font-weight: 700; }
.pill.live::before { content: ''; display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: #d12030; vertical-align: 1px; animation: blink 1.4s ease-in-out infinite; }
.drive-field select { height: 40px; padding: 0 10px; border-radius: 4px; border: 0; font: 15px var(--text); color: #1a1a1a; width: 100%; }

/* ── Admin: settings boxes, chips, displays ── */
.settings-box { margin: 14px 0 26px; padding: 16px 18px; border-radius: 6px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14); display: grid; gap: 10px; }
.settings-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.settings-head h2, .settings-head h3 { margin: 0; }
.admin h3 { font-size: 17px; margin: 18px 0 8px; }
.settings-box h3 { margin: 0; }
.settings-box .admin-note.small { margin: 0; }
.settings-box .shade-box { margin: 6px 0 0; background: rgba(0,0,0,.18); }
.label-strong { font-size: 14px !important; font-weight: 600; color: #fff !important; }
.table-title { margin-top: 6px !important; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 4px 4px 12px; border-radius: 999px; background: #fff; color: #2b1a1c; font-size: 14px; }
.chip button { border: 0; background: transparent; color: #b31826; font-size: 18px; line-height: 1; width: 26px; height: 26px; border-radius: 50%; cursor: pointer; }
.chip button:hover { background: #f6dfe2; }
.chip-empty { color: var(--soft); font-size: 14px; }
.settings-box .inline-form { margin: 0; }
.settings-box .inline-form .btn-small { height: 40px; padding: 0 16px; font-size: 14px; }
.settings-box .form-actions { margin-top: 0; }
.btn-small:disabled { opacity: .5; cursor: not-allowed; }
.radio-set { border: 0; padding: 0; margin: 14px 0 18px; display: grid; gap: 10px; }
.radio-set legend { font-weight: 600; margin-bottom: 8px; font-size: 14px; }
.radio-set[disabled] { opacity: .5; }
.radio-set .check { align-items: flex-start !important; gap: 10px; line-height: 1.45; max-width: 760px; cursor: pointer; }
.radio-set .check input { width: 16px; height: 16px; margin: 2px 0 0; flex: none; accent-color: #fff; }
.radio-set .opt { display: grid; gap: 2px; }
.radio-set .opt b { font-weight: 600; }
.radio-set .opt small { font-size: 13px; color: var(--soft); }
.copy-row { display: flex; gap: 8px; margin: 6px 0 4px; flex-wrap: wrap; }
.copy-row input { flex: 1 1 360px; font-family: ui-monospace, Menlo, monospace !important; font-size: 13px !important; }
.copy-row .btn-small { height: 40px; display: inline-flex; align-items: center; padding: 0 14px; font-size: 14px; }
.label-tip { display: flex; align-items: center; gap: 8px; }
.tip { position: relative; display: inline-flex; }
.tip-btn {
  width: 18px; height: 18px; border-radius: 50%; border: 0; padding: 0; cursor: help;
  background: rgba(255,255,255,.22); color: #fff; font: italic 600 12px var(--text);
}
.tip-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.tip-box {
  position: absolute; left: calc(100% + 10px); top: 50%; z-index: 20; width: 300px;
  padding: 10px 12px; border-radius: 6px; background: #fff; color: #2b1a1c;
  font: 400 13px/1.45 var(--text); box-shadow: 0 10px 30px rgba(0,0,0,.3);
  opacity: 0; visibility: hidden; transform: translate(-4px, -50%); transition: opacity .15s, transform .15s, visibility .15s;
}
.tip-box::before { content: ''; position: absolute; right: 100%; top: 50%; margin-top: -6px; border: 6px solid transparent; border-right-color: #fff; }
.tip:hover .tip-box, .tip-btn:focus-visible + .tip-box, .tip.open .tip-box { opacity: 1; visibility: visible; transform: translate(0, -50%); }
@media (max-width: 640px) {
  .tip-box { left: auto; right: -40px; top: calc(100% + 8px); transform: translateY(-4px); width: min(280px, 80vw); }
  .tip:hover .tip-box, .tip-btn:focus-visible + .tip-box, .tip.open .tip-box { transform: none; }
  .tip-box::before { display: none; }
}
.modal { width: min(440px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: 10px; background: #3a070d; color: #fff; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.modal::backdrop { background: rgba(20, 0, 4, .65); }
.modal form { padding: 22px 24px 18px; }
.modal h3 { margin: 0 0 8px; font-size: 19px; }
.modal p { margin: 0 0 20px; color: var(--soft); font-size: 15px; line-height: 1.5; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }
.modal-actions .btn-light { font-size: 15px; padding: 8px 16px; }
.screens-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 10px 0 8px; }
.screens-status { font-size: 14px; color: var(--soft); }
.screens-status.on { color: #b9f1c9; font-weight: 600; }
.screens-row .btn-small { height: 36px; padding: 0 14px; font-size: 14px; }

/* ── Signage display (OptiSigns) ─────────────────────────────── */
body.display { margin: 0; height: 100vh; overflow: hidden; cursor: none; background: var(--red); }
.display-stream { position: fixed; inset: 0; width: 100vw; height: 100vh; border: 0; background: #000; }
.display-slate { position: fixed; inset: 0; overflow: hidden; display: grid; place-items: center; }

.display-next {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; gap: 1.2vh;
  padding: 2.4vh 4vw; border-radius: 12px; background: var(--box); text-align: center;
  width: max-content; max-width: 86vw;
}
.display-next .next-label { font-size: clamp(14px, 2vh, 28px); margin: 0; }
.display-next-title { font-size: clamp(28px, 5.5vh, 84px); font-weight: 600; line-height: 1.1; }
.display-next-when { font-size: clamp(18px, 3vh, 44px); color: var(--soft); }
