/* Lowertown Pulse — "operations terminal" theme.
   Dark-first (a back-of-house instrument read in a dim bar), monospace-forward for
   all data/labels/status so numbers and columns align like a departure board; a
   clean sans is reserved for human prose (event titles, post copy, track names).
   Strong semantic status colour is the backbone of the honest-freshness design. */

:root {
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Menlo", "Consolas", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;

  /* dark (default) */
  --bg: #0c0e12;
  --bg-glow: #141a26;
  --panel: #14171e;
  --panel-2: #1a1f29;
  --line: #262d3a;
  --line-soft: #1e2530;
  --ink: #e8edf4;
  --ink-dim: #8a97a8;
  --ink-faint: #5a6473;
  --ok: #3fd07a;
  --stale: #eab029;
  --error: #ff5d4d;
  --inactive: #5a6577;
  --accent: #5cb2ff;
  --ok-bg: rgba(63, 208, 122, 0.13);
  --stale-bg: rgba(234, 176, 41, 0.14);
  --error-bg: rgba(255, 93, 77, 0.13);
  --inactive-bg: rgba(90, 101, 119, 0.16);
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.02) inset, 0 8px 24px rgba(0, 0, 0, 0.35);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #eef1f5;
    --bg-glow: #e2e8f1;
    --panel: #ffffff;
    --panel-2: #f4f6fa;
    --line: #dce1ea;
    --line-soft: #e7ebf1;
    --ink: #10151d;
    --ink-dim: #55606f;
    --ink-faint: #8a94a3;
    --ok: #1a9e51;
    --stale: #b07d09;
    --error: #d33a2c;
    --inactive: #8894a5;
    --accent: #1f7fd6;
    --ok-bg: rgba(26, 158, 81, 0.10);
    --stale-bg: rgba(176, 125, 9, 0.12);
    --error-bg: rgba(211, 58, 44, 0.10);
    --inactive-bg: rgba(136, 148, 165, 0.14);
    --shadow: 0 1px 2px rgba(16, 21, 29, 0.06), 0 6px 18px rgba(16, 21, 29, 0.08);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; overflow-x: hidden; }

body {
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background:
    radial-gradient(1100px 460px at 82% -8%, var(--bg-glow), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

.ico {
  width: 1em; height: 1em; flex: none;
  vertical-align: -0.14em;
}

/* ---- shell + header ---- */

.app-shell { max-width: 1400px; margin: 0 auto; padding: clamp(14px, 3vw, 30px); }

.app-header {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  padding-bottom: 16px; margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.app-header h1 {
  margin: 0; font-size: clamp(15px, 2.4vw, 19px);
  font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 12px;
}
.app-header h1::before {
  content: ""; width: 9px; height: 9px; border-radius: 50%;
  background: var(--ok); box-shadow: 0 0 0 0 var(--ok);
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(63, 208, 122, 0.5); }
  70% { box-shadow: 0 0 0 7px rgba(63, 208, 122, 0); }
  100% { box-shadow: 0 0 0 0 rgba(63, 208, 122, 0); }
}
.conn-status { color: var(--ink-faint); font-size: 12px; letter-spacing: 0.04em; }

/* ---- tile grid ---- */

.tiles { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 760px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.tile {
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 15px 16px 16px;
  box-shadow: var(--shadow);
  animation: rise 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
}
.tile-display { animation-delay: 0.02s; }
.tile-sales { animation-delay: 0.06s; }
.tile-music { animation-delay: 0.10s; }
.tile-staffing { animation-delay: 0.14s; }
.tile-events { animation-delay: 0.18s; }
.tile-social { animation-delay: 0.22s; }
.tile-pipelines { animation-delay: 0.26s; }
.tile-actions { animation-delay: 0.30s; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .tile { animation: none; } .app-header h1::before { animation: none; } }

.tile-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 12px;
}
.tile-title { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.tile-title h2 {
  margin: 0; font-size: 12px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tile-ico { width: 15px; height: 15px; color: var(--ink-faint); }
.status-line { display: inline-flex; align-items: center; gap: 7px; flex: none; }
.age { color: var(--ink-faint); font-size: 11.5px; letter-spacing: 0.03em; }

/* ---- status dots ---- */

.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; }
.dot-ok { background: var(--ok); box-shadow: 0 0 7px -1px var(--ok); }
.dot-stale { background: var(--stale); box-shadow: 0 0 7px -1px var(--stale); }
.dot-error { background: var(--error); box-shadow: 0 0 7px -1px var(--error); }
.dot-missing { background: var(--error); box-shadow: 0 0 8px 0 var(--error); }
.dot-inactive { background: var(--inactive); }

.status-ok { color: var(--ok); }
.status-stale { color: var(--stale); }
.status-error, .status-missing { color: var(--error); }
.status-inactive { color: var(--inactive); }

/* ---- error inset + banner ---- */

.inset {
  display: flex; gap: 9px; align-items: flex-start;
  padding: 11px 12px; border-radius: 9px; margin-bottom: 4px;
  background: var(--stale-bg); border: 1px solid transparent;
}
.inset-ico { width: 15px; height: 15px; margin-top: 2px; flex: none; }
.inset-error { background: var(--error-bg); color: var(--error); }
.inset-stale, .inset-missing { background: var(--stale-bg); color: var(--stale); }
.inset-inactive { background: var(--inactive-bg); color: var(--ink-dim); }
.inset p { margin: 0; }
.inset-reason { font-size: 13px; }
.inset-lastgood { font-size: 11.5px; opacity: 0.8; margin-top: 2px; }

.banner {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 11px; border-radius: 8px; margin: 0 0 11px;
  font-size: 12.5px; background: var(--stale-bg); color: var(--stale);
}

/* ---- key/value + prose helpers ---- */

.kv { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 10px 0 0; }
.kv dt { color: var(--ink-faint); font-size: 11.5px; letter-spacing: 0.05em; text-transform: uppercase; }
.kv dd { margin: 0; color: var(--ink); }
.empty { color: var(--ink-faint); font-size: 13px; padding: 6px 0; }

/* ---- 1. display ---- */

/* The poster IS the card — but it must never DRIVE the grid row's height.
   The image is absolutely positioned inside a flex-growing box whose natural
   height matches the old card (min-height 300), so the tile contributes the
   same height as before while the poster expands to fill whatever extra room
   the row's tallest sibling creates. Click-through opens the full-res image. */
.tile-display { display: flex; flex-direction: column; }
.display-box { position: relative; flex: 1; min-height: 300px; }
.display-box > .display-link, .display-box > .display-thumb-empty { position: absolute; inset: 0; }
.display-link:hover .display-thumb, .display-link:focus-visible .display-thumb { filter: brightness(1.04); }
.display-thumb {
  width: 100%; height: 100%; object-fit: contain;
  border-radius: 8px; background: var(--panel-2); border: 1px solid var(--line-soft);
  display: block;
}
.tile-display .pi-line { flex: none; }
.disp-next { margin-left: auto; color: var(--ink-dim); font-size: 12px; }
.display-thumb-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; color: var(--ink-faint); aspect-ratio: auto; min-height: 90px; padding: 20px;
  text-align: center; font-size: 12.5px;
}
.display-thumb-empty .ico { width: 26px; height: 26px; }
.ovr-badge {
  position: absolute; top: 8px; left: 8px;
  background: var(--stale); color: #1a1206; font-weight: 700;
  font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 5px;
}
.pi-line { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; }
.run-errors { display: flex; gap: 6px; color: var(--error); font-size: 12px; margin: 8px 0 0; }

/* ---- 2. pipelines: departure-board grid ---- */

/* Pipelines spans the full grid (like Actions) and flows its rows into as many
   ~300px columns as fit — 1 up on phones, several across on desktop. */
.tile-pipelines { grid-column: 1 / -1; }
/* quiet-when-healthy: one summary line, problem rows above the fold, the
   full roster behind an expander */
.pipe-summary { display: flex; align-items: center; gap: 9px; margin: 0; color: var(--ink-dim); font-size: 13px; }
.pipe-summary-bad { color: var(--error); font-weight: 600; }
.check-list-bad { margin-top: 10px; }
.check-list-bad .check-schedule { color: var(--error); }
.pipe-all { margin-top: 10px; }
.pipe-all > summary {
  cursor: pointer; list-style: none; color: var(--accent);
  font-size: 11.5px; letter-spacing: 0.06em; min-height: 24px;
  display: inline-flex; align-items: center;
}
.pipe-all > summary::-webkit-details-marker { display: none; }
.pipe-all > summary:hover, .pipe-all > summary:focus-visible { text-decoration: underline; }
.check-list {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  column-gap: 28px;
}
.check-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  grid-template-areas: "dot name status age" ".   sch  sch    sch";
  align-items: center; column-gap: 10px; row-gap: 1px;
  padding: 8px 0; border-bottom: 1px solid var(--line-soft);
}
.check-row:last-child { border-bottom: 0; }
.check-ico { grid-area: dot; display: inline-flex; align-items: center; color: var(--ink-faint); }
.check-ico svg { width: 15px; height: 15px; }
.check-name { grid-area: name; text-align: left; color: var(--ink); }
.check-stat { grid-area: status; display: inline-flex; align-items: center; justify-content: flex-end; }
.check-age { grid-area: age; color: var(--ink-dim); text-align: right; min-width: 3.2em; }
.check-schedule { grid-area: sch; color: var(--ink-faint); font-size: 11px; }

/* ---- 3. today ---- */

.event-group + .event-group { margin-top: 12px; }
.event-day {
  margin: 0 0 7px; font-size: 11px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent);
}
.event-list { list-style: none; margin: 0; padding: 0; }
.event-row {
  /* fixed time column (fits "11:30am-1:30pm") so titles and badge rows align
     across rows — each row is its own grid, so an auto column would resolve to
     a different width per row */
  display: grid; grid-template-columns: 104px 1fr; gap: 4px 12px;
  padding: 9px 0; border-bottom: 1px solid var(--line-soft);
}
.event-row:last-child { border-bottom: 0; }
.event-when { color: var(--ink-dim); font-size: 12px; padding-top: 1px; }
.event-title { font-family: var(--sans); font-weight: 600; color: var(--ink); line-height: 1.35; }
.event-cal { color: var(--ink-faint); font-size: 11px; letter-spacing: 0.04em; margin-top: 1px; }

/* tap-to-reveal description + cover art under the title */
.event-details summary.event-title { cursor: pointer; list-style: none; }
.event-details summary.event-title::-webkit-details-marker { display: none; }
.event-more-ico { width: 12px; height: 12px; color: var(--ink-faint); margin-left: 5px; transition: transform 0.15s ease-out; }
.event-details[open] .event-more-ico { transform: rotate(180deg); }
.event-more { margin-top: 7px; }
.event-cover {
  display: block; width: 100%; max-width: 240px; margin-bottom: 6px;
  border-radius: 8px; border: 1px solid var(--line-soft); background: var(--panel-2);
}
.event-desc { margin: 0; font-family: var(--sans); font-size: 12.5px; color: var(--ink-dim); line-height: 1.45; }
.event-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }

/* promo pills — status-tinted, icon + label, deliberately NOT button-shaped */
.promo {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; letter-spacing: 0.02em; line-height: 1;
  padding: 4px 8px; border-radius: 6px; white-space: nowrap;
  background: var(--inactive-bg); color: var(--ink-dim);
}
.promo .ico { width: 12px; height: 12px; }
.promo-ok { background: var(--ok-bg); color: var(--ok); }
.promo-stale { background: var(--stale-bg); color: var(--stale); }
.promo-error { background: var(--error-bg); color: var(--error); }
.promo-dim { background: var(--inactive-bg); color: var(--ink-dim); }

/* linked pills (website/sling/social when a real URL is available) — same pill
   shape as a static .promo, but visually signal "tappable" with an underline that
   only appears on hover/focus, so the row doesn't read as button-heavy at rest. */
a.promo-link { text-decoration: none; cursor: pointer; }
a.promo-link:hover, a.promo-link:focus-visible { text-decoration: underline; filter: brightness(1.12); }

/* social pill is a tap-to-reveal disclosure; keep it pill-shaped, hide the marker */
.social-badge-details { display: inline-block; }
.social-badge-details summary {
  list-style: none; cursor: pointer; min-height: 44px;
  display: inline-flex; align-items: center;
}
.social-badge-details summary::-webkit-details-marker { display: none; }
.social-badge-details .matched-post-title {
  display: block; margin-top: 5px; padding: 6px 8px;
  font-family: var(--sans); font-size: 12px; color: var(--ink-dim);
  background: var(--panel-2); border-radius: 6px; border: 1px solid var(--line-soft);
}
/* the 44px tap target must not visually inflate the pill row */
.event-badges .social-badge-details summary { min-height: 0; }
.event-badges .social-badge-details { position: relative; }
.event-badges .social-badge-details summary::before {
  content: ""; position: absolute; inset: -11px -4px; /* invisible ~44px-tall hit area */
}

/* ---- 4. social ---- */

/* promo needs-attention zone — leads the card; quiet when clear */
.promo-clear { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; color: var(--ink-dim); font-size: 12.5px; }
.attn-zone { margin: 0 0 13px; padding-bottom: 12px; border-bottom: 1px solid var(--line-soft); }
.attn-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.attn-list { list-style: none; margin: 9px 0 0; padding: 0; }
.attn-item { display: flex; align-items: baseline; gap: 9px; margin: 4px 0 0; font-size: 12.5px; min-width: 0; }
.attn-due { flex: none; color: var(--ink-faint); font-size: 11.5px; min-width: 7.5em; }
.attn-overdue { color: var(--error); font-weight: 700; }
.attn-what { font-family: var(--sans); color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.stat-row { display: flex; flex-wrap: wrap; gap: 16px; margin: 0 0 12px; }
.stat { color: var(--ink-dim); font-size: 12px; }
.stat b { color: var(--ink); font-size: 16px; font-weight: 700; margin-right: 3px; }
.stat-ok { color: var(--ok); }
.stat-error { color: var(--error); }

.post-groups { max-height: 340px; overflow-y: auto; }
.post-section-head {
  margin: 14px 0 4px; font-size: 11px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-dim);
}
.post-section-head:first-child { margin-top: 0; }
.post-list { list-style: none; margin: 0; padding: 0; }
.post-list-errored { margin-bottom: 2px; }
.post-row {
  display: grid; grid-template-columns: auto 1fr; gap: 9px;
  padding: 10px 0; border-bottom: 1px solid var(--line-soft);
}
.post-row:last-child { border-bottom: 0; }
.post-row .dot { margin-top: 5px; }
.post-body { min-width: 0; }
.post-meta { display: flex; align-items: center; gap: 8px; }
.post-platform { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; color: var(--ink); font-size: 12.5px; }
.post-platform .ico { width: 13px; height: 13px; color: var(--ink-dim); }
.post-date { color: var(--ink-faint); font-size: 11.5px; }
.post-link {
  min-height: 44px; margin-left: auto;
  display: inline-flex; align-items: center; color: var(--accent); text-decoration: none;
}
.post-link .ico { width: 14px; height: 14px; }
.post-content {
  font-family: var(--sans); font-size: 12.5px; color: var(--ink-dim);
  line-height: 1.4; margin-top: 2px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
/* An errored row inverts the normal post row: the provider's reason is the
   headline and the post copy (when shown at all) is the supporting line. The age
   pushes right so a column of failures reads as "how stale is each of these". */
.post-error { display: block; margin-top: 3px; color: var(--error); font-size: 12.5px; line-height: 1.35; }
/* The badge run (channel · ×N · field · stuck · age) can outgrow a narrow card, so
   let it wrap — but never mid-phrase: "failed 3d ago" stays one unit. */
.post-row-err .post-meta { flex-wrap: wrap; row-gap: 5px; }
.post-row-err .post-date { margin-left: auto; white-space: nowrap; }
.post-err-dupe, .post-err-field, .post-err-stuck {
  font-size: 10.5px; line-height: 1; padding: 3px 6px; border-radius: 5px; white-space: nowrap;
}
.post-err-dupe { background: var(--error-bg); color: var(--error); font-weight: 700; }
.post-err-field { background: var(--inactive-bg); color: var(--ink-dim); font-family: var(--mono); }
.post-err-stuck { background: var(--stale-bg); color: var(--stale); }
/* Overflow roll-up: present but deliberately quiet — cold failures should not
   compete with the live queue for attention. */
.post-err-more {
  margin: 6px 0 0; font-size: 11.5px; color: var(--ink-faint);
  border-bottom: 1px dotted var(--line-soft); display: inline-block; cursor: help;
}

/* ---- 5. music ---- */

.now-playing {
  display: flex; align-items: center; gap: 10px; margin: 0;
  font-family: var(--sans);
}
.now-playing .np-ico { width: 20px; height: 20px; color: var(--ok); flex: none; }
.np-cover { width: 84px; height: 84px; flex: none; border-radius: 8px; object-fit: cover; background: var(--panel-2); border: 1px solid var(--line-soft); }
.now-playing b { font-size: 19px; line-height: 1.25; display: block; color: var(--ink); }
.np-artist { color: var(--ink-dim); font-size: 14.5px; margin-top: 2px; display: block; }
.now-playing-empty { color: var(--ink-faint); font-family: var(--mono); font-size: 13px; }
/* source pill (queued by staff / smart shuffle) — upper right of the
   now-playing row so the playback/volume line never wraps around it */
.np-src-pill { margin-left: auto; align-self: flex-start; flex: none; font-family: var(--mono); }
.playback-state {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px;
  margin: 10px 0 0; color: var(--ok); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.1em;
}

/* volume meter — live level as a slim bar on the 0–16 Soundtrack scale;
   drifts red with a target tick when staff moved it off the scheduler's slot */
.playback-state .promo { text-transform: none; letter-spacing: 0.02em; }

/* transport + volume stepper buttons — quiet ghost controls, 44px hit areas
   via the same invisible-inset trick as the event-badge summaries */
.transport { display: inline-flex; gap: 4px; }
.ctl-btn, .vol-btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 22px; padding: 0; flex: none;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px;
  color: var(--ink-dim); font: inherit; font-size: 13px; line-height: 1;
  cursor: pointer;
}
.ctl-btn .ico { width: 12px; height: 12px; }
.ctl-btn:hover, .vol-btn:hover { color: var(--ink); border-color: var(--ink-faint); }
.ctl-btn:disabled, .vol-btn:disabled, .sched-option:disabled { opacity: 0.45; cursor: default; }
.ctl-btn::before, .vol-btn::before { content: ""; position: absolute; inset: -11px -6px; }

/* queue peek — staff-queued songs holding off the rotation; amber like the pill */
.queue-peek { margin: 10px 0 0; font-size: 12.5px; color: var(--stale); }
.queue-peek summary { cursor: pointer; min-height: 24px; }
.queue-tracks {
  margin: 6px 0 0; padding-left: 22px;
  font-family: var(--sans); font-size: 12px; color: var(--ink-dim);
}
.queue-tracks li { margin: 2px 0; }
.queue-note { margin: 10px 0 0; font-size: 12.5px; color: var(--stale); }
.vol {
  display: inline-flex; align-items: center; gap: 7px; margin-left: auto;
  color: var(--ink-dim); text-transform: none; letter-spacing: 0.03em;
}
.vol .ico { width: 13px; height: 13px; }
.vol-num { font-weight: 700; color: var(--ink); }
.vol-off .vol-num { color: var(--error); }
.vol-target { font-size: 10.5px; }
.vol-bar {
  position: relative; width: 56px; height: 4px; flex: none;
  border-radius: 2px; background: var(--panel-2);
  box-shadow: 0 0 0 1px var(--line-soft) inset;
}
.vol-fill {
  position: absolute; top: 0; bottom: 0; left: 0;
  border-radius: 2px; background: var(--ink-dim);
}
.vol-off { color: var(--error); }
.vol-off .vol-fill { background: var(--error); }
.vol-tick {
  position: absolute; top: -3px; bottom: -3px; width: 2px;
  background: var(--ink); border-radius: 1px;
}

/* slot zone — playing source, on-schedule pill, slot window + progress, chips */
.music-slot { margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.slot-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.slot-source { font-weight: 600; font-size: 13px; color: var(--ink); }

/* schedule chooser — a quiet "change" disclosure opening a small option menu */
.sched-pick { position: relative; font-size: 11.5px; }
.sched-pick summary {
  cursor: pointer; color: var(--accent); list-style: none;
  min-height: 24px; display: inline-flex; align-items: center;
}
.sched-pick summary::-webkit-details-marker { display: none; }
.sched-pick summary:hover, .sched-pick summary:focus-visible { text-decoration: underline; }
.sched-options {
  position: absolute; left: 0; top: 100%; z-index: 5; margin-top: 6px;
  display: flex; flex-direction: column; gap: 2px;
  min-width: 170px; padding: 6px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: var(--shadow); color: var(--ink-dim);
}
.sched-option {
  text-align: left; background: none; border: 0; border-radius: 6px;
  padding: 8px 9px; color: var(--ink); cursor: pointer;
  font-family: var(--sans); font-size: 12.5px; line-height: 1.2;
}
.sched-option:hover, .sched-option:focus-visible { background: var(--inactive-bg); }
.slot-progress-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.slot-time { color: var(--ink-faint); font-size: 11px; letter-spacing: 0.03em; flex: none; }
.slot-progress {
  position: relative; flex: 1; height: 3px;
  border-radius: 2px; background: var(--line-soft); overflow: hidden;
}
.slot-progress span {
  position: absolute; top: 0; bottom: 0; left: 0;
  background: var(--accent); border-radius: 2px;
}
.slot-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; padding: 0; }
.slot-chips li {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--sans); font-size: 12px; line-height: 1.3; color: var(--ink);
  background: var(--panel-2); border: 1px solid var(--line-soft);
  border-radius: 6px; padding: 4px 9px;
}
.slot-chips .chip-live { border-color: var(--accent); }
.chip-live .ico { width: 10px; height: 10px; color: var(--accent); }

/* zone activity — who touched the music, from SYB's log + Pulse's audit log */
.zone-activity-wrap { margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.zone-activity-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-dim); margin-bottom: 6px;
}
.act-full {
  background: none; border: 0; padding: 0; cursor: pointer;
  font: inherit; letter-spacing: 0.06em; text-transform: none; color: var(--accent);
}
.act-full:hover, .act-full:focus-visible { text-decoration: underline; }
.act-line {
  display: flex; align-items: baseline; gap: 8px; margin: 4px 0 0;
  font-size: 12px; color: var(--ink-dim); min-width: 0;
}
.act-when { flex: none; color: var(--ink-faint); font-size: 11px; min-width: 4.5em; }
.act-src { flex: none; font-size: 9.5px; letter-spacing: 0.08em; padding: 1px 5px; border-radius: 4px; }
.act-src-syb { background: var(--inactive-bg); color: var(--ink-dim); }
.act-src-dashboard { background: var(--ok-bg); color: var(--ok); }
.act-src-board { background: rgba(92, 178, 255, 0.14); color: var(--accent); }
.act-src-external { background: var(--stale-bg); color: var(--stale); }
.act-src-scheduler { background: var(--inactive-bg); color: var(--ink-dim); }
.act-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act-text b { color: var(--ink); font-weight: 600; }
.act-empty { color: var(--ink-faint); }

/* full-log dialog — app-level, survives tile repaints */
.activity-dialog {
  width: min(560px, calc(100vw - 32px)); max-height: 80vh;
  background: var(--panel); color: var(--ink);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
  padding: 16px 18px; font-family: var(--mono);
}
.activity-dialog::backdrop { background: rgba(6, 8, 12, 0.6); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.dlg-head h2 { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-dim); }
.dlg-close {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px;
  color: var(--ink-dim); font: inherit; font-size: 12px; padding: 5px 10px; cursor: pointer;
}
.dlg-close:hover { color: var(--ink); }
.dlg-note {
  margin: 0 0 10px; padding: 8px 10px; border-radius: 8px;
  background: var(--stale-bg); color: var(--stale); font-size: 11.5px; line-height: 1.45;
}
.dlg-list { overflow-y: auto; max-height: 56vh; }
.dlg-list .act-text { white-space: normal; }

/* service footer — the automation jobs behind this tile, pipelines-style.
   The music tile is a flex column so this row pins to the tile's bottom edge
   instead of leaving dead space below it when a neighbor tile is taller. */
.tile-music { display: flex; flex-direction: column; }
.tile-music .svc-row { margin-top: auto; padding-top: 14px; }
.tile-music .music-today { margin: 12px 0 0; color: var(--ink-dim); font-size: 12px; font-variant-numeric: tabular-nums; }
.tile-music .music-slot { margin-bottom: 2px; }
.svc-row {
  display: flex; flex-wrap: wrap; gap: 8px 18px;
  margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--line-soft);
}
.svc { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-dim); font-size: 12px; }
.svc-next { color: var(--ink-faint); }
.svc-detail { margin: 7px 0 0; color: var(--error); font-size: 12px; }

/* ---- 6. sales ---- */

.sales-big { margin: 0; font-size: clamp(30px, 6vw, 40px); font-weight: 700; letter-spacing: -0.02em; line-height: 1; }
.sales-big.sales-empty { font-size: 18px; color: var(--ink-faint); font-weight: 500; }
.sales-sub { display: block; font-size: 12px; font-weight: 400; color: var(--ink-faint); letter-spacing: 0.03em; margin-top: 6px; }
.sales-sub2 { margin: 6px 0 0; font-size: 12px; color: var(--ink-faint); letter-spacing: 0.03em; }
.sales-compare { margin: 6px 0 0; color: var(--ink-dim); font-size: 13px; }
.sales-compare.sales-empty { color: var(--ink-faint); }
.sales-big .delta-chip { font-size: 13px; vertical-align: 4px; margin-left: 10px; }

/* zoned layout: today | yesterday | daily bars | weekly — same thin rules the
   music card uses, so each comparison reads inside its own zone */
.sales-zone { margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.zone-head {
  margin: 0 0 5px; font-size: 11px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-dim);
}
.sales-yline { margin: 0; display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.sales-yline > b { font-size: 17px; color: var(--ink); }
.sales-vs { color: var(--ink-dim); font-size: 12.5px; }
/* yesterday's bar: solid fill + ring, tying it to the Yesterday zone above */
.bar-hot .bar { background: var(--accent); box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--accent) 55%, transparent); }
.bar-hot .bar-label { color: var(--ink); font-weight: 600; }
.sales-live-note { margin: 6px 0 0; color: var(--ink-faint); font-size: 12px; font-style: italic; }
.sales-delta { margin: 12px 0 0; color: var(--ink-dim); font-size: 12.5px; }
.delta-chip { font-weight: 700; padding: 1px 6px; border-radius: 5px; margin-left: 2px; }
.delta-up { color: var(--ok); background: var(--ok-bg); }
.delta-down { color: var(--error); background: var(--error-bg); }

.mini-bars { display: flex; align-items: flex-end; gap: 6px; height: 82px; margin: 16px 0 8px; }
.bar-col { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar {
  width: 100%; border-radius: 4px 4px 2px 2px;
  height: calc(6px + var(--v, 0) * 62px);
  background: linear-gradient(to top, var(--accent), color-mix(in srgb, var(--accent) 60%, transparent));
  transition: filter .12s ease;
}
.bar-col:hover .bar { filter: brightness(1.08); }
.bar-empty { height: 6px; background: repeating-linear-gradient(45deg, var(--line), var(--line) 3px, transparent 3px, transparent 6px); border: 1px dashed var(--line); }
.bar-label { color: var(--ink-faint); font-size: 10.5px; }
/* Styled hover tooltip above each bar (native title stays as accessible fallback). */
.bar-tip {
  position: absolute; bottom: calc(100% - 14px); left: 50%; transform: translateX(-50%) translateY(4px);
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 4px 8px; border-radius: 6px; white-space: nowrap;
  background: var(--ink); color: var(--panel);
  font-size: 10px; line-height: 1.3; text-align: center;
  opacity: 0; pointer-events: none; transition: opacity .12s ease, transform .12s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .18); z-index: 5;
}
.bar-tip b { font-size: 12px; font-weight: 700; }
.bar-col:hover .bar-tip { opacity: 1; transform: translateX(-50%) translateY(0); }
.sales-weekly { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.weekly-head { margin: 0; color: var(--ink-dim); font-size: 12.5px; font-family: var(--mono); letter-spacing: 0.02em; }
.weekly-head b { color: var(--ink); font-family: var(--sans); font-size: 20px; font-weight: 700; letter-spacing: -0.01em; margin: 0 5px 0 6px; }
.weekly-sub { color: var(--ink-faint); font-size: 11.5px; }
.sales-weekly .mini-bars { margin: 12px 0 4px; }
.sales-caption { margin: 6px 0 0; color: var(--ink-faint); font-size: 11px; line-height: 1.4; }

/* ---- 7. staffing ---- */

.staff-head {
  margin: 0 0 7px; font-size: 11px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-dim);
}
.staff-list { list-style: none; margin: 0 0 11px; padding: 0; }
/* Shift count under the next day's schedule — matches .sales-caption's
   quiet footnote treatment rather than competing with the rows above it. */
.staff-note { margin: -4px 0 11px; color: var(--ink-faint); font-size: 11px; }
.staff-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  grid-template-areas: "dot name pos time";
  align-items: center; column-gap: 10px; row-gap: 1px;
  padding: 8px 0; border-bottom: 1px solid var(--line-soft);
}
.staff-row:last-child { border-bottom: 0; }
.staff-row .dot { grid-area: dot; }
.staff-avatar {
  grid-area: dot; width: 28px; height: 28px; border-radius: 50%;
  object-fit: cover; display: block; border: 1px solid var(--line-soft); background: var(--panel-2);
}
.staff-initial {
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-dim); font-size: 12px; font-weight: 700;
}
.staff-ending { color: var(--stale); font-weight: 600; }
.staff-late .staff-time { color: var(--error); font-weight: 600; }
.staff-late .staff-name { color: var(--error); }
.staff-done { opacity: 0.62; }
.staff-done .staff-avatar { filter: grayscale(1); }
.staff-name { grid-area: name; text-align: left; color: var(--ink); }
.staff-pos { grid-area: pos; color: var(--ink-dim); font-size: 12px; }
.staff-time { grid-area: time; color: var(--ink-faint); text-align: right; min-width: 5em; font-size: 12px; }

/* ---- actions ---- */

.tile-actions { grid-column: 1 / -1; margin-top: 4px; }
.action-buttons { display: flex; flex-wrap: wrap; gap: 9px; }
.action-btn {
  display: inline-flex; align-items: center; gap: 7px; min-height: 44px;
  font-family: var(--mono); font-size: 12.5px; color: var(--ink);
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 8px; padding: 0 14px; cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.05s;
}
.action-btn::before { content: ""; width: 14px; height: 14px; flex: none;
  background: var(--accent);
  -webkit-mask: no-repeat center / contain; mask: no-repeat center / contain;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M13 2 3 14h7l-1 8 10-12h-7l1-8Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M13 2 3 14h7l-1 8 10-12h-7l1-8Z'/%3E%3C/svg%3E"); }
.action-btn:hover { border-color: var(--accent); background: var(--panel); }
.action-btn:active { transform: translateY(1px); }
.action-btn:disabled { opacity: 0.5; cursor: default; }
.action-result {
  font-family: var(--mono); font-size: 12px; color: var(--ink-dim);
  white-space: pre-wrap; word-break: break-word; margin: 12px 0 0;
  max-height: 220px; overflow: auto;
}
.action-result:empty { display: none; }
.quick-links { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.quick-link {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px;
  font-size: 12.5px; color: var(--ink-dim); text-decoration: none;
  padding: 0 12px; border-radius: 8px; border: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.quick-link .ico { width: 13px; height: 13px; }
.quick-link:hover { color: var(--accent); border-color: var(--line); }

/* ---- login ---- */

.login-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card {
  width: 100%; max-width: 340px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 14px; padding: 30px 26px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px;
}
.login-card h1 {
  margin: 0 0 6px; font-size: 15px; letter-spacing: 0.2em; text-transform: uppercase;
  text-align: center; display: flex; align-items: center; justify-content: center; gap: 10px;
}
.login-card h1::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.login-card label { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); }
.login-card input {
  font-family: var(--mono); font-size: 15px; color: var(--ink);
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px;
  padding: 12px 13px; min-height: 44px;
}
.login-card input:focus { outline: none; border-color: var(--accent); }
.login-submit {
  min-height: 44px; font-family: var(--mono); font-size: 13px; letter-spacing: 0.06em;
  color: #05130a; background: var(--ok); border: 0; border-radius: 9px;
  cursor: pointer; font-weight: 700; margin-top: 4px;
}
.login-submit:hover { filter: brightness(1.06); }
.login-error { color: var(--error); font-size: 12.5px; margin: 2px 0 0; min-height: 1em; text-align: center; }

/* ---- Board card (ops → iPad alerts) ---- */
.tile-board { grid-column: 1 / -1; }
.alert-form { display: flex; flex-direction: column; gap: 9px; margin-bottom: 14px; }
.alert-input {
  min-height: 44px; padding: 0 12px; font: inherit; font-size: 14px; color: var(--ink);
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px;
}
.alert-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.alert-note-input { font-size: 13px; }
.alert-form-row { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }
.alert-at { display: inline-flex; gap: 6px; align-items: center; }
.alert-time { width: 120px; font-family: var(--mono); }
.alert-form-msg { margin: 0; min-height: 1.2em; font-family: var(--mono); font-size: 12px; color: var(--ink-dim); }
.alert-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-soft); }
.alert-row { display: flex; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line-soft); font-size: 13.5px; }
.alert-main { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.alert-kind { font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-faint); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; }
.alert-row-note { color: var(--ink-dim); font-size: 12.5px; }
.alert-state { flex: none; font-family: var(--mono); font-size: 12px; color: var(--ink-dim); }
.alert-acked .alert-state { color: var(--ok); }
.alert-cancelled { opacity: .55; }
.alert-cancelled .alert-row-text { text-decoration: line-through; }
.alert-cancel { min-height: 32px; padding: 0 10px; font-family: var(--mono); font-size: 12px; color: var(--ink-dim); background: none; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }
.alert-cancel:hover { color: var(--ink); border-color: var(--accent); }
.alert-cancel:disabled { opacity: .5; cursor: default; }
