[hidden] {
  display: none !important;
}
:root {
  font-size: clamp(16px, 0.91vw, 32px);
  --ground: #f2f4f6;
  --surface: #fff;
  --line: #cdd4dc;
  --ink: #18242e;
  --muted: #4f606f;
  --accent: #19618a;
  --good: #216846;
  --warn: #845900;
  --bad: #a73131;
  --active: #126596;
  --soft: #e9f2f8;
}
[data-bs-theme="dark"] {
  --ground: #10161b;
  --surface: #192127;
  --line: #364149;
  --ink: #edf1f4;
  --muted: #abb8c1;
  --accent: #a4cee7;
  --good: #8fd2ae;
  --warn: #e9c079;
  --bad: #ffa9a4;
  --active: #8dccf1;
  --soft: #202e38;
}
body {
  background: var(--ground);
  color: var(--ink);
  font: 1rem/1.4 var(--tblr-font-sans-serif, system-ui);
  font-variant-numeric: tabular-nums;
}
header,
nav,
main {
  padding-inline: clamp(1rem, 2.5vw, 4rem);
}
header,
.tools,
.brand,
.heading,
.card-header,
.pager,
footer,
#notices {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
header {
  padding-block: 0.8rem;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.brand {
  justify-content: flex-start;
  font-size: 1.12rem;
  letter-spacing: -0.025em;
}
.brand img {
  width: 1.85rem;
}
.tools {
  gap: 0.6rem;
}
.tools img,
.card-header img {
  width: 1.15rem;
}
header img,
.card-header img {
  opacity: 0.88;
}
[data-bs-theme="dark"] header img,
[data-bs-theme="dark"] .card-header img {
  filter: invert(1);
}
.btn {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
  border-radius: 0.35rem;
  box-shadow: none;
}
.health,
.flag {
  font-weight: 600;
}
.health:before,
.flag:before {
  content: "";
  display: inline-block;
  width: 0.48em;
  height: 0.48em;
  margin-right: 0.48em;
  background: currentColor;
  border-radius: 100%;
}
.good {
  color: var(--good);
}
.warn {
  color: var(--warn);
}
.bad,
.priority {
  color: var(--bad);
}
.active-tx {
  color: var(--active);
}
.muted,
small,
label,
footer,
.eyebrow {
  color: var(--muted);
}
.nav-tabs {
  background: var(--surface);
  border-color: var(--line);
  gap: 1.5rem;
}
.nav-tabs .nav-link {
  padding: 0.6rem 0.12rem;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: none;
  color: var(--muted);
}
.nav-tabs .nav-link[aria-current] {
  color: var(--ink);
  border-color: var(--accent);
  font-weight: 650;
}
main {
  padding-bottom: 0.8rem;
}
.heading {
  padding-block: 1.15rem;
}
.eyebrow,
th {
  font-size: 0.74rem;
  font-weight: 650;
  letter-spacing: 0.085em;
  text-transform: uppercase;
}
.heading h1 {
  font-size: 2rem;
  letter-spacing: -0.045em;
  line-height: 1.12;
  margin: 0.15rem 0 0;
}
.datetime {
  text-align: right;
  display: grid;
  gap: 0.08rem;
}
.datetime time {
  font-size: 1.7rem;
  letter-spacing: 0.02em;
  line-height: 1.1;
  font-weight: 600;
}
.datetime span {
  font-size: 0.85rem;
  color: var(--muted);
}
.card {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  box-shadow: none;
  min-width: 0;
  overflow: hidden;
}
.card-header {
  min-height: 0;
  padding: 0.75rem 1.1rem;
  border-color: var(--line);
}
h2 {
  font-size: 1.05rem;
  line-height: 1.3;
  letter-spacing: -0.015em;
  margin: 0;
}
.card-header small {
  font-size: 0.75rem;
}
.card-body {
  padding: 1rem 1.1rem;
  overflow: auto;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  padding: 0.9rem 0;
}
.metrics > div {
  padding: 0 1.2rem;
  border-left: 1px solid var(--line);
}
.metrics > div:first-child {
  border: 0;
}
.metrics label {
  display: block;
  font-size: 0.86rem;
}
.metrics strong {
  display: block;
  font-size: 1.85rem;
  letter-spacing: -0.04em;
  font-weight: 600;
}
.radio-grid,
.info-grid {
  display: grid;
  gap: 0.85rem;
  margin-top: 0.85rem;
}
.radio-grid {
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
}
.info-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.scroll,
.caller {
  overflow: auto;
  min-height: 0;
}
.table {
  margin: 0;
  color: var(--ink);
  --tblr-table-bg: transparent;
}
.table td,
.table thead th {
  border-color: var(--line);
  padding: 0.47rem 1.1rem;
  color: var(--ink);
}
.table thead th {
  color: var(--muted);
  background: var(--ground);
  font-size: 0.72rem;
}
.table td {
  overflow-wrap: anywhere;
}
.table td small {
  display: block;
}
.inventory .table {
  table-layout: fixed;
}
.inventory th:first-child {
  width: 49%;
}
.inventory th:nth-child(2) {
  width: 19%;
}
.inventory tr.on {
  background: var(--soft);
}
.caller,
.recent {
  padding: 1rem 1.2rem;
}
.caller {
  flex: 1;
}
.caller strong {
  font-size: 1.65rem;
  letter-spacing: -0.035em;
}
.caller article + article {
  margin-top: 0.65rem;
}
.recent {
  border-top: 1px solid var(--line);
}
.recent .eyebrow {
  margin-bottom: 0.35rem;
}
.entry-title {
  display: block;
  font-weight: 650;
  font-size: 1.13rem;
  overflow-wrap: anywhere;
}
.entry-meta {
  display: block;
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.86rem;
}
.preview {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0.4rem 0;
}
.card-body a,
dialog a {
  color: var(--accent);
}
.club-total {
  font-size: 1.6rem;
  font-weight: 650;
}
.event {
  border-top: 1px solid var(--line);
  padding-top: 0.5rem;
  margin-top: 0.5rem;
}
.linkbtn {
  border: 0;
  background: none;
  color: var(--accent);
  text-decoration: underline;
  padding: 0;
  font: inherit;
}
audio {
  width: 100%;
  height: 2rem;
  margin-top: 0.4rem;
}
#notices {
  flex-direction: row;
  padding: 0.65rem 1rem;
  margin-top: 0.85rem;
  border-left: 3px solid var(--accent);
}
#notice {
  overflow-wrap: anywhere;
}
#notice-nav {
  display: flex;
  gap: 0.3rem;
}
footer {
  padding-top: 0.65rem;
  font-size: 0.78rem;
}
.filters,
.pager,
#ranks {
  display: flex;
  gap: 0.7rem;
  padding: 0.8rem 1rem;
}
.filters input {
  max-width: 26rem;
}
.filters select {
  width: auto;
}
.pager {
  justify-content: flex-end;
}
.pager span {
  margin-right: auto;
}
#ranks {
  padding: 0.3rem 0 1rem;
  flex-wrap: wrap;
}
#ranks section {
  flex: 1;
  min-width: 14rem;
  padding: 0.85rem 1rem;
}
dialog {
  width: min(36rem, 94vw);
  max-height: 85vh;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  padding: 1.4rem;
}
dialog::backdrop {
  background: #0009;
}
#close {
  float: right;
}
dialog p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.wall nav,
.wall #theme,
.wall #notice-nav,
.wall audio,
.wall .linkbtn {
  display: none;
}
@media (min-width: 1500px) and (min-aspect-ratio: 14/9) {
  .radio-grid {
    height: clamp(13rem, 34vh, 26rem);
  }
  .info-grid {
    height: clamp(10rem, 22vh, 17rem);
  }
  #notices {
    max-height: none;
    overflow: visible;
  }
}
@media (max-width: 1499px) {
  .radio-grid {
    min-height: 15rem;
  }
  .inventory .scroll,
  .caller {
    max-height: 21rem;
  }
}
@media (max-width: 850px) {
  .radio-grid {
    grid-template-columns: 1fr 1fr;
  }
  .info-grid {
    grid-template-columns: 1fr 1fr;
  }
  .info-grid > .card:last-child {
    grid-column: 1/-1;
  }
  .tools {
    gap: 0.4rem;
  }
}
@media (max-width: 630px) {
  header {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .brand {
    font-size: 1.04rem;
  }
  .tools {
    width: 100%;
    justify-content: flex-end;
  }
  .tools .health {
    margin-right: auto;
  }
  .btn,
  .nav-link {
    min-height: 44px;
  }
  .nav-tabs {
    justify-content: space-between;
    gap: 0;
  }
  .heading {
    gap: 0.4rem;
  }
  .heading h1 {
    font-size: 1.55rem;
  }
  .datetime time {
    font-size: 1.35rem;
  }
  .datetime span {
    font-size: 0.72rem;
  }
  .metrics {
    grid-template-columns: 1fr 1fr;
    row-gap: 0.8rem;
  }
  .metrics > div:nth-child(3) {
    border: 0;
  }
  .metrics strong {
    font-size: 1.5rem;
  }
  .radio-grid,
  .info-grid {
    grid-template-columns: 1fr;
  }
  .channel {
    grid-row: 1;
  }
  .card-header,
  .card-body,
  .caller,
  .recent {
    padding: 0.8rem;
  }
  .table td,
  .table thead th {
    padding: 0.55rem;
  }
  .inventory .scroll {
    max-height: 26rem;
  }
  #detail .scroll {
    overflow-x: auto;
  }
  #detail table {
    min-width: 38rem;
  }
  .filters {
    flex-wrap: wrap;
  }
  .filters select {
    width: 100%;
  }
  #notices {
    align-items: flex-start;
  }
}

/* Keep the full seven-row inventory and dispatch player visible on a 16:9 wallboard. */
@media (min-width: 1500px) and (min-aspect-ratio: 14/9) {
  header {
    padding-block: 0.6rem;
  }
  .heading {
    padding-block: 0.8rem;
  }
  .metrics {
    padding-block: 0.7rem;
  }
  .inventory td {
    padding-block: 0.26rem;
  }
  .inventory td small {
    display: inline;
    margin-inline-start: 0.55em;
    white-space: normal;
  }
  .info-grid {
    height: clamp(11rem, 23vh, 18rem);
  }
  .card-body {
    padding-block: 0.65rem;
  }
}
@media (min-width: 631px) and (max-width: 850px) {
  .radio-grid {
    grid-template-columns: 1fr;
  }
  .inventory .scroll {
    max-height: 24rem;
  }
}
nav.nav-tabs {
  padding-inline: clamp(1rem, 2.5vw, 4rem);
}

[data-bs-theme=light]{--ground:#dce2e7;--line:#a6b2bb;--muted:#40505c}
:root[data-palette=violet]{--accent:#703f98}
:root[data-palette=teal]{--accent:#09696c}
:root[data-palette=slate]{--accent:#4b5969}
:root[data-bs-theme=dark][data-palette=violet]{--accent:#d9b2ff}
:root[data-bs-theme=dark][data-palette=teal]{--accent:#83dcd2}
:root[data-bs-theme=dark][data-palette=slate]{--accent:#bdc9d7}
header{border-top:3px solid var(--accent);background:color-mix(in srgb,var(--accent) 8%,var(--surface))}
#brand-icon{filter:none;opacity:1;width:2rem;height:2rem;object-fit:contain}
#palette{width:auto;color:var(--ink);border-color:var(--line)}
.wall #palette{display:none}
.inventory a{color:var(--accent)}
.inventory tr.good{background:color-mix(in srgb,var(--good) 13%,var(--surface))}
.inventory tr.bad{background:color-mix(in srgb,var(--bad) 13%,var(--surface))}
.channel.receiving{border-color:var(--good);background:color-mix(in srgb,var(--good) 7%,var(--surface))}
@media(prefers-reduced-motion:no-preference){.channel.receiving{animation:hud-rx 2.8s ease-in-out infinite alternate}@keyframes hud-rx{from{box-shadow:inset 0 0 .15rem transparent}to{box-shadow:inset 0 0 1.25rem color-mix(in srgb,var(--good) 35%,transparent)}}}

.tools { flex:0 0 auto; justify-content:flex-end; }
#palette { flex:0 0 auto; width:7.3rem; }
#wall { display:inline-flex; flex:0 0 auto; width:auto; align-items:center; justify-content:center; white-space:nowrap; gap:.45rem; padding-inline:.8rem; }
#wall img { flex:none; margin:0; }

:root[data-palette=violet],:root[data-palette=teal],:root[data-palette=slate] {
  --ground:color-mix(in srgb,var(--accent) 12%,#dce2e7);
}
:root[data-bs-theme=dark]:is([data-palette=violet],[data-palette=teal],[data-palette=slate]) {
  --ground:color-mix(in srgb,var(--accent) 8%,#10161b);
  --surface:color-mix(in srgb,var(--accent) 7%,#192127);
}

body { margin:0; }
header, nav, main { box-sizing:border-box; }
#notices { margin:0 0 .85rem; border-color:var(--notice-color,var(--line)); border-left-color:var(--notice-color,var(--accent)); }
.notice-banner[data-accent="red"] { --notice-color:#df5353; }
.notice-banner[data-accent="green"] { --notice-color:#329b62; }
.notice-banner[data-accent="blue"] { --notice-color:#418be1; }
.notice-banner[data-accent="purple"] { --notice-color:#a679e6; }
.notice-banner[data-accent="amber"] { --notice-color:#c48b22; }
.notice-banner[data-accent="high"] { --notice-color:#e25151; }
.notice-banner[data-accent="high"] { background:color-mix(in srgb,#e25151 13%,var(--surface)); }
@media (min-width:631px) and (max-width:1200px) { .metrics { grid-template-columns:repeat(3,minmax(0,1fr)); row-gap:.75rem; } }

html, body { margin: 0; padding: 0; }
header { display:grid; grid-template-columns:minmax(0,1fr) auto minmax(0,1fr); }
header .brand { justify-self:start; min-width:0; }
header .datetime { justify-self:center; text-align:center; }
header .tools { justify-self:end; }
main { padding-top:.85rem; }
#notices { height:auto; max-height:none; overflow:visible; }
#notices > div:first-child { min-width:0; }
footer { justify-content:center; text-align:center; }
@media(max-width:850px) {
 header { grid-template-columns:1fr auto 1fr; gap:.4rem; }
 header .brand { grid-column:1/-1; justify-self:center; }
 header .datetime { grid-column:2; }
 header .tools { grid-column:1/-1; justify-self:center; width:auto; }
}

#on-air-link { display:inline-flex; align-items:center; gap:.4rem; color:var(--accent); text-underline-offset:.16em; }

#weather-card[data-level="watch"] { border-color:#c68a1d; box-shadow:inset 0 0 0 1px #c68a1d; }
#weather-card[data-level="warning"] { border-color:#df4545; box-shadow:inset 0 0 0 1px #df4545; }
#weather { display:flex; flex-direction:column; align-items:flex-start; gap:.16rem; line-height:1.25; }
#weather small { color:var(--muted); }

#notices { display:grid; gap:.45rem; padding:0; border:0; justify-content:stretch; }
.notice-banner { padding:.55rem 1rem; border-color:var(--notice-color,var(--line)); border-left:3px solid var(--notice-color,var(--accent)); overflow-wrap:anywhere; }
.inventory th:first-child { width:auto; }
#previous-dispatch { margin-top:.45rem; padding-top:.4rem; border-top:1px solid var(--line); }
#weather-card { position:relative; }
#weather-link { color:var(--accent); }
#weather-link::after { content:""; position:absolute; inset:0; z-index:1; }
#weather-card .card-header, #weather-card h2 { position:static; }
.weather-content { display:flex; align-items:flex-start; justify-content:space-between; gap:.5rem; }
#weather { font-size:1.08rem; min-width:0; }
#weather strong { font-size:1.35rem; }
#weather-radar { width:clamp(4rem,26%,8rem); max-height:6rem; object-fit:contain; border-radius:.25rem; }
@media(max-width:480px){.inventory th,.inventory td{padding-inline:.3rem;} }

@media(min-width:1500px) { .notice-banner { padding-block:.30rem; } }

.panel-link { color:var(--accent); }
.card:has(.panel-link[href]) { cursor:pointer; }
