/* The dashboard: a broadcast control room.  Dark only.  One loud color, kept for On Air and Put It Up;
   the previews are the color on the page.  Nothing under 14 px. */

@font-face { font-family: 'Archivo'; src: url('/fonts/archivo-variable.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Anton'; src: url('/fonts/anton.woff2') format('woff2'); font-display: swap; }

:root {
  --ground: #100E0C; --panel: #191613; --raised: #231F1B; --line: #332D27; --line-strong: #4A423A;
  --text: #EFE9DF; --dim: #A79D90; --signal: #E5170F; --signal-hot: #FF3A2E; --ok: #57C27A;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--ground); color: var(--text); font: 500 15px/1.35 'Archivo', system-ui, sans-serif; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
[hidden] { display: none !important; }

.wordmark { font: 400 28px/1 'Anton', Impact, sans-serif; letter-spacing: .05em; margin: 0; }
.label { color: var(--dim); font-size: 14px; font-weight: 600; white-space: nowrap; }

/* Sign-in */
.signin { display: flex; align-items: center; justify-content: center; min-height: 100%; padding: 16px; }
.signin-card { width: 340px; max-width: 100%; display: flex; flex-direction: column; gap: 12px; padding: 32px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; }
.signin-card .wordmark { font-size: 36px; text-align: center; margin-bottom: 12px; }
.signin-card label { color: var(--dim); font-weight: 600; }
.signin-card input { height: 60px; padding: 0 14px; font-size: 32px; letter-spacing: .3em; text-align: center; background: var(--ground); border: 1px solid var(--line-strong); border-radius: 4px; }
.go { height: 52px; border: 0; border-radius: 4px; background: var(--signal); color: #fff; font: 400 22px 'Anton', Impact, sans-serif; letter-spacing: .05em; }
.signin-message { min-height: 22px; margin: 0; color: var(--signal-hot); text-align: center; font-weight: 600; }

/* Top bar */
.console { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.top { display: flex; align-items: center; gap: 22px; padding: 8px 16px; background: var(--panel); border-bottom: 1px solid var(--line); flex: none; }
.onair { display: flex; align-items: center; gap: 9px; min-width: 0; font-size: 16px; font-weight: 700; color: var(--dim); }
.onair .text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.onair .lamp { flex: none; width: 13px; height: 13px; border-radius: 50%; border: 2px solid var(--line-strong); }
.onair.is-on { color: #fff; }
.onair.is-on .lamp { background: var(--signal-hot); border-color: var(--signal-hot); box-shadow: 0 0 10px var(--signal-hot); }
.saved { color: var(--dim); font-size: 14px; white-space: nowrap; }
.top-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; flex: none; }
.takedown { height: 46px; padding: 0 18px; border: 1px solid var(--line-strong); border-radius: 4px; background: transparent; font-weight: 700; }
.takedown:hover:not(:disabled) { background: var(--raised); }
.takedown:disabled { color: #7d746a; border-color: var(--line); cursor: default; }
.putup {
  height: 54px; min-width: 216px; padding: 0 30px; border: 0; border-radius: 4px; background: #4a1613; color: #d9a9a5;
  font: 400 28px/1 'Anton', Impact, sans-serif; letter-spacing: .06em;
}
.putup.armed { background: var(--signal); color: #fff; box-shadow: 0 0 0 1px var(--signal-hot), 0 0 24px rgba(229, 23, 15, .55); }
.putup.armed:hover { background: var(--signal-hot); }
.nowhere { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 9px 16px; background: #FFD400; color: #14110E; font-size: 16px; font-weight: 700; }
.nowhere[hidden] { display: none; }
.nowhere .mini { padding: 5px 12px; border: 1px solid #14110E; background: #14110E; color: #fff; font-size: 15px; font-weight: 800; }
.alert { flex: none; padding: 9px 16px; background: var(--signal); color: #fff; font-size: 16px; font-weight: 700; }

/* The desk */
.desk { flex: 1; min-height: 0; display: grid; grid-template-columns: 296px minmax(0, 1fr); }
.side { display: flex; flex-direction: column; min-height: 0; padding: 12px; gap: 10px; background: var(--panel); border-right: 1px solid var(--line); }
.new { flex: none; height: 44px; border: 1px solid var(--line-strong); border-radius: 4px; background: var(--raised); font-weight: 700; }
.new:hover { border-color: var(--text); }
.side-title { margin: 6px 0 0; color: var(--dim); font-size: 14px; font-weight: 600; }
.list { flex: 1; min-height: 0; overflow-y: auto; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
/* The row buttons get their own reserved strip, so they can never appear under a click meant for the row. */
.row { position: relative; padding-bottom: 30px; border: 1px solid transparent; border-radius: 4px; }
.row:hover, .row:focus-within { background: var(--raised); }
.row.current { background: var(--raised); border-color: var(--line-strong); }
.row-load { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 0 10px; width: 100%; padding: 7px 8px 4px; background: none; border: 0; text-align: left; align-items: center; }
.row-chip { grid-row: span 2; width: 38px; height: 38px; border-radius: 3px; display: flex; align-items: center; justify-content: center; font: 400 22px 'Anton', Impact, sans-serif; border: 1px solid rgba(255, 255, 255, .16); }
.row-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 7px; }
.row-name .dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--signal-hot); box-shadow: 0 0 6px var(--signal-hot); }
.row-when { color: var(--dim); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-actions { position: absolute; right: 6px; bottom: 5px; left: 8px; display: none; gap: 4px; }
.row:hover .row-actions, .row:focus-within .row-actions { display: flex; }
.row-actions .mini { height: 24px; padding: 0 7px; }
.mini { height: 26px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: 3px; background: var(--panel); font-size: 14px; font-weight: 600; white-space: nowrap; }
.mini:hover { border-color: var(--text); }
.mini.up { background: var(--signal); border-color: var(--signal); color: #fff; font-weight: 800; }
.mini.up:hover { background: var(--signal-hot); }
.quiet { border: 0; background: none; color: var(--dim); font-size: 14px; padding: 6px; }
.quiet:hover { color: var(--text); }
.signout { flex: none; align-self: flex-start; }

.editor { min-width: 0; min-height: 0; overflow-y: auto; padding: 10px 16px 12px; display: flex; flex-direction: column; gap: 9px; }
.row-top { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
.field-name { display: flex; align-items: center; gap: 10px; flex: 1 1 280px; max-width: 520px; }
.field-name input { flex: 1; min-width: 0; height: 36px; padding: 0 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 4px; font-weight: 700; }
.group { display: flex; align-items: center; gap: 10px; min-width: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { height: 32px; min-width: 34px; padding: 0 11px; display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 3px; background: var(--panel); font-size: 14px; font-weight: 600; white-space: nowrap; }
.chip:hover:not(:disabled) { border-color: var(--line-strong); background: var(--raised); }
.chip.on, .chip.on:hover:not(:disabled) { background: var(--text); border-color: var(--text); color: #14110E; }
.chip.some { border-style: dashed; border-color: var(--text); }
.chip:disabled { color: #7d746a; cursor: default; }
.chip.on:disabled { background: #6a635a; border-color: #6a635a; color: #14110E; }
.swatch { width: 15px; height: 15px; border-radius: 2px; border: 1px solid rgba(255, 255, 255, .35); display: inline-flex; align-items: center; justify-content: center; font-size: 0; }
.tag-mixed { padding: 1px 6px; border: 1px dashed var(--dim); border-radius: 3px; color: var(--text); font-size: 14px; font-weight: 600; }

/* Screen columns */
.columns { display: grid; gap: 12px; justify-content: start; }
.col { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.monitor { padding: 5px 5px 7px; background: #060505; border: 1px solid var(--line); border-radius: 5px; }
.clip { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #000; }
.stage { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; transform-origin: 0 0; }
.col-status { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; font-size: 14px; font-weight: 600; }
.conn { display: flex; align-items: center; gap: 6px; white-space: nowrap; color: var(--dim); }
.conn::before { content: ''; width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--line-strong); }
.conn.up { color: var(--text); }
.conn.up::before { background: var(--ok); border-color: var(--ok); }
.air { color: var(--dim); }
.air.matches { color: var(--signal-hot); }
.col-link { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; font-size: 14px; }
.col-link .url { color: var(--dim); margin-right: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.col-link a.mini { display: inline-flex; align-items: center; color: inherit; text-decoration: none; }
.col textarea { width: 100%; height: 66px; resize: vertical; padding: 7px 9px; background: var(--panel); border: 1px solid var(--line-strong); border-radius: 4px; font-size: 16px; font-weight: 600; line-height: 1.3; }
.col textarea:focus { border-color: var(--text); outline: none; }
.col textarea[readonly] { color: var(--dim); border-color: var(--line); }
.same { display: flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 600; }
.same input { width: 16px; height: 16px; accent-color: #EFE9DF; margin: 0; }
.tip { margin: 0; color: var(--dim); font-size: 14px; line-height: 1.3; }

/* Look */
.look { display: flex; flex-direction: column; gap: 6px; padding: 9px 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 5px; }
.look-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 22px; }
.look .group > .label:first-child { min-width: 58px; }
.look .sub .label:first-child { min-width: 0; }
.crawl-text { width: 300px; max-width: 100%; height: 32px; padding: 0 9px; background: var(--ground); border: 1px solid var(--line-strong); border-radius: 3px; }
.crawl-text:disabled { color: #7d746a; border-color: var(--line); }
.picker { display: flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 600; }
.picker input { width: 40px; height: 30px; padding: 0; border: 1px solid var(--line-strong); background: none; }
.warn { color: #FFC24A; font-size: 14px; font-weight: 700; }

.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 5; display: flex; align-items: center; gap: 14px; padding: 10px 16px; background: var(--text); color: #14110E; border-radius: 5px; font-weight: 700; box-shadow: 0 6px 30px rgba(0, 0, 0, .6); max-width: calc(100vw - 32px); }
.toast button { padding: 4px 10px; border: 1px solid #14110E; border-radius: 3px; background: none; color: #14110E; font-weight: 800; }

/* Touch: the row buttons are always there, and targets are finger-sized. */
@media (hover: none) {
  .row-actions { position: static; display: flex; padding: 0 8px 8px; background: none; }
  .row { padding-bottom: 0; }
  .mini, .row-actions .mini { height: 38px; padding: 0 12px; }
  .chip { height: 42px; }
}

/* Phone: one column, Put It Up stays in view. */
@media (max-width: 820px) {
  .console { height: auto; min-height: 100vh; overflow: visible; }
  .top { position: sticky; top: 0; z-index: 4; flex-wrap: wrap; gap: 6px 12px; padding: 8px 12px; }
  .wordmark { font-size: 22px; }
  .onair { flex: 1; font-size: 15px; }
  .saved { display: none; }
  .top-actions { width: 100%; margin: 0; }
  .takedown { flex: none; }
  .putup { flex: 1; min-width: 0; }
  .desk { display: block; }
  .side { border-right: 0; border-bottom: 1px solid var(--line); }
  .list { max-height: none; overflow: visible; }
  .editor { overflow: visible; padding: 12px; }
  .columns { grid-template-columns: minmax(0, 1fr) !important; }
  .row-actions { position: static; display: flex; padding: 0 8px 8px; background: none; }
  .row { padding-bottom: 0; }
  .field-name { flex-basis: 100%; }
  .look .group { flex-wrap: wrap; }
  .look-row { align-items: flex-start; }
}

@media (prefers-reduced-motion: no-preference) {
  .putup, .chip, .mini { transition: background-color .12s, border-color .12s, box-shadow .12s; }
}
