/* CRP Dispatch v0.4 — neutral, utilitarian box console.
   This is CSS over the working v0.3.3 layout; audio, authentication and
   replay logic remain in the existing application unchanged. */
:root {
  --ink: #e4ebef;
  --muted: #acbdc6;
  --cyan: #3899c0;
  --cyan2: #2c7291;
  --edge: #73828d;
  --deep: #1f292f;
  --panel: #29343a;
  --header: #25343d;
}
html { background: #202a30; }
body { background: #202a30; font: 11px Tahoma, Verdana, Arial, sans-serif; letter-spacing: 0; }
button, input, select { font-family: Tahoma, Verdana, Arial, sans-serif; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid #99d5f5; outline-offset: 2px; }
.dispatch { height: 100vh; min-height: 700px; overflow: hidden; }
.top-header { flex: 0 0 48px; height: 48px; min-height: 48px; background: #243541; border-bottom: 2px solid #5a8ca4; padding: 0 11px; gap: 14px; }
.wordmark { gap: 11px; font-size: 13px; letter-spacing: .045em; color: #f3f6f8; }
.logo { border-radius: 2px; width: 33px; height: 30px; background: #176c9d; border: 1px solid #4aa3d2; font-size: 10px; box-shadow: none; }
.system-strip { height: 34px; padding: 4px 12px; background: #18272f; border: 1px solid #526875; }
.system-strip small { font-size: 8px; color: #a5bac6; }
.system-strip b { font-size: 9px; color: #f3f6f7; }
.header-actions .micro-btn { height: 28px; font-size: 9px; }
.micro-btn, .filter-btn { background: #40505a; border: 1px solid #75838c; border-radius: 1px; box-shadow: none; }
.micro-btn.active, .filter-btn.active { background: #286782; border-color: #65a9c9; }
.filter-header { flex: 0 0 33px; height: 33px; min-height: 33px; padding: 0 12px; background: #303a40; color: #c5d5db; font-size: 9px; border-bottom: 1px solid #5a656c; }
.filter-header .filter-btn { font-size: 9px; padding: 5px 10px; }
.filter-right { color: #b5ccd7; }
.module-header { flex: 0 0 26px; height: 26px; min-height: 26px; padding: 0 12px; background: #222f38; color: #a6bfce; font-size: 9px; }
.body-layout { grid-template-columns: 58px minmax(0,1fr) 278px; min-height: 0; overflow: hidden; }
.side-rail { background: #273640; border-right: 2px solid #607683; padding: 9px 5px; gap: 7px; }
.rail-button { height: 54px; background: #3e4c56; border: 1px solid #6b818e; border-radius: 2px; padding: 5px 2px; }
.rail-button.active { background: #245f7e; border-color: #72b5d0; box-shadow: inset 0 0 0 1px #91cce5; }
.rail-button>span { font-size: 15px; background: #243942; border-color: #8ea7b6; min-width: 25px; height: 25px; }
.rail-button small { font-size: 7px; letter-spacing: .03em; }
.main-stage { position: relative; min-height: 0; height: 100%; padding: 10px 12px; overflow: auto; background: #2f3e46; isolation: isolate; }
.main-stage:before { content: ''; position: absolute; inset: 0; z-index: -2; background: linear-gradient(130deg,#34434a 0%,#2a3840 70%,#27343c 100%); }
.console-watermark { position: absolute; pointer-events: none; z-index: -1; top: 18%; right: 3.5%; width: min(48%,520px); max-height: 75%; object-fit: contain; opacity: .105; filter: grayscale(1) brightness(1.55) contrast(1.1); mix-blend-mode: screen; }
.selected-resource { position: relative; width: min(100%, 900px); margin-bottom: 8px; height: 53px; border: 1px solid #8797a0; background: #24343d; padding: 6px 10px; }
.selected-symbol { background: #1a688c; border-color: #5ba3c7; width: 32px; height: 30px; }
.selection-info small, .selected-meta small { color: #b4cbd6; font-size: 8px; }
.selection-info b { color: #e6f0f5; font-size: 12px; }
.selection-info>span { color: #a6c5d2; font-size: 8px; }
.selected-meta b { font-size: 9px; }
.group-bar { width: min(100%, 900px); height: 27px; background: #354b58; color: #eff5f7; border: 1px solid #82919a; font-size: 10px; }
.zone-stack { width: min(100%, 900px); display: flex; flex-direction: column; gap: 9px; padding: 7px 0 18px; overflow: visible; }
.zone-section { border: 1px solid #86929a; background: #384750; scroll-margin-top: 8px; }
.zone-title { height: 27px; color: #f1f5f8; background: #3b5667; border-bottom: 1px solid #8fa3ae; font-size: 10px; letter-spacing: .035em; padding: 0 10px; }
.zone-title small { color: #d2e1e9; font-size: 9px; }
.zone-row { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; padding: 8px; background: #35444d; overflow: visible; }
.zone-row .resource-tile { height: 159px; min-width: 0; border: 1px solid #628aa0; background: #222f37; box-shadow: inset 0 0 0 1px #172b34; border-radius: 1px; }
.zone-row .resource-tile.subscribed { border: 2px solid #75c4e8; box-shadow: inset 0 0 0 1px #2d688a; }
.zone-row .resource-tile.subscribed.selected { border-color: #afd6eb; box-shadow: inset 0 0 0 1px #4d9cc3; }
.zone-row .resource-tile.transmitting { border: 2px solid #dfbd50; box-shadow: inset 0 0 0 1px #f4d36a; }
.zone-row .tile-top { height: 35px; min-height: 35px; padding: 5px 7px 4px; background: #33637e; border-bottom: 1px solid #83a8ba; align-items: center; }
.tile-name { color: #fff; font-size: 11px; letter-spacing: .02em; }
.tile-caption { color: #c5dee8; font-size: 8px; }
.tile-badge { color: #e5f1f5; font-size: 8px; border-color: #99b7c4; background: #264456; padding: 3px 5px; }
.zone-row .resource-tile .tile-info { height: 25px; min-height: 25px; background: #30434e; border-bottom: 1px solid #567080; padding: 4px 7px; gap: 5px; }
.tile-info span { background: #263b46; border-color: #688a9c; color: #d8e7ee; font-size: 8px; padding: 2px 5px; }
.zone-row .tile-roster { flex: 1 1 auto; height: auto; min-height: 28px; padding: 6px 7px 3px; margin: 6px 7px 0; font-size: 9px; line-height: 1.4; color: #d7e7ef; border: 1px solid #50646e; background: #14232d; }
.zone-row .tile-last { flex: 0 0 auto; height: 18px; padding: 4px 8px 2px; color: #a2c6d7; font-size: 8px; }
.zone-row .tile-foot { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); grid-template-rows: 25px 24px; column-gap: 5px; row-gap: 3px; align-items: center; padding: 3px 7px 6px; margin-top: auto; }
.zone-row .tile-foot>.monitor-btn, .zone-row .tile-foot>.ptt { height: 25px; border-radius: 1px; font-size: 9px; font-weight: 900; flex: unset; }
.zone-row .tile-foot>.monitor-btn { background: #356a89; border: 1px solid #77b2d0; }
.zone-row .tile-foot>.monitor-btn.on { background: #247fa6; border-color: #92cce5; color: #fff; }
.zone-row .tile-foot>.ptt { background: #e1c632; border: 1px solid #f9e078; color: #101b21; }
.zone-row .tile-foot>.tile-vol { grid-column: 1 / -1; min-width: 0; display: grid; grid-template-columns: 72px minmax(0,1fr); align-items: center; gap: 5px; background: #283943; padding: 2px 6px; border: 1px solid #526a76; }
.tile-vol-header { font-size: 8px; color: #cfe0e8; gap: 3px; }
.tile-vol-value { font-size: 8px; }
.tile-vol input[type=range] { width: 100%; accent-color: #5eafce; height: 14px; }
.stage-empty { display: none!important; }
.right-panel { height: 100%; background: #303c44; border-left: 2px solid #687782; }
.aside-heading { min-height: 37px; padding: 6px 10px; background: #3b5362; border-bottom: 1px solid #718994; }
.aside-heading small { font-size: 8px; color: #bdcfda; }
.aside-heading b { font-size: 11px; }
.aside-heading .micro-btn { padding: 4px 6px; font-size: 8px; }
.replay-count { font-size: 8px; color: #d9ebf4; }
.activity-log { min-height: 170px; max-height: 340px; background: #28343b; border-bottom: 1px solid #72818a; }
.activity-entry { min-height: 58px; padding: 8px 10px; background: #2b3942; border-bottom: 1px solid #61737e; border-left: 3px solid #5b9cbe; }
.entry-top { font-size: 10px; color: #bfdae8; }
.entry-top b { color: #fff; }
.entry-detail { font-size: 9px; color: #b2cad5; }
.replay-btn { background: #315f7b; border: 1px solid #7099b1; border-radius: 1px; font-size: 9px; }
.unit-empty { color: #b7c6cf; padding: 12px 10px; font-size: 10px; }
.action-stack { gap: 6px; padding: 9px; }
.stack-button { height: 36px; font-size: 9px; border: 1px solid #668fa6; background: #355f75; }
.unit-list { background: #293740; min-height: 66px; max-height: none; }
.unit-row { font-size: 10px; border-bottom-color: #526674; }
.console-desk { min-height: 82px; height: 82px; background: #273640; border-top: 2px solid #7a929e; display: grid; grid-template-columns: 155px minmax(220px,1.25fr) 190px minmax(190px,1fr) 83px; align-items: stretch; gap: 8px; padding: 9px 12px; }
.desk-section, .desk-clock { background: #202f38; border: 1px solid #677e8b; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; padding: 7px 10px; gap: 5px; min-width: 0; }
.desk-kicker { color: #acc3d0; font-size: 9px; font-weight: 700; letter-spacing: .05em; }
.desk-secondary { border: 1px solid #83a6bb; background: #3a6075; color: #f5f9fb; font-size: 10px; font-weight: 800; padding: 8px; cursor: pointer; border-radius: 1px; }
.desk-audio .desk-secondary { width: 100%; }
.console-action { border: 1px solid #6ba8c9; background: #236487; color: #f5fbff; border-radius: 1px; display: flex; flex-direction: column; gap: 4px; align-items: center; justify-content: center; user-select: none; touch-action: none; }
.console-action b { font-size: 14px; letter-spacing: .035em; }
.console-action small { color: #c7e3f1; font-size: 9px; }
.console-action:disabled { background: #38525f; opacity: .65; }
.console-action.transmitting { background: #b37c2a; border-color: #e8c071; }
.desk-clock { align-items: center; gap: 2px; }
.desk-clock strong { color: #e2f2fa; font-size: 26px; font-weight: 700; letter-spacing: .09em; font-variant-numeric: tabular-nums; }
.desk-status-main { display: flex; gap: 5px; align-items: center; font-size: 10px; color: #f4fafc; }
.desk-status-main b { color: #f4fafc; }
.desk-mini { color: #b7cbd6; font-size: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; width: 100%; }
.setup-button { align-self: stretch; }
.settings-stage { background: #2c3c45; }
.settings-stage .selected-resource { width: 100%; }
.settings-form { max-width: 1000px; }
.settings-card { background: #2a3943; border-color: #798f9b; }
.settings-title { color: #b7e1f4; border-color: #8296a0; }
.settings-card p { color: #bacfd8; }
@media(max-width:1350px) {
  .body-layout { grid-template-columns: 52px minmax(0,1fr) 255px; }
  .zone-stack, .selected-resource, .group-bar { width: min(100%, 820px); }
  .zone-row { gap: 5px; padding: 6px; }
  .console-watermark { right: 1%; width: min(44%,450px); }
  .console-desk { grid-template-columns: 128px minmax(180px,1.3fr) 165px minmax(140px,1fr) 70px; }
}
@media(max-width:1050px) {
  .system-strip { position: static; transform: none; }
  .body-layout { grid-template-columns: 52px minmax(0,1fr); }
  .right-panel { grid-column: 2; grid-row: 2; height: auto; max-height: 300px; border-top: 1px solid #71828c; border-left: 0; }
  .main-stage { min-height: 620px; }
  .zone-stack, .selected-resource, .group-bar { width: 100%; }
  .console-watermark { right: 4%; opacity: .07; }
  .console-desk { height: auto; min-height: 78px; grid-template-columns: 110px minmax(180px,1fr) 145px 150px; padding: 6px; }
  .setup-button { display: none; }
}
@media(max-width:680px) {
  .dispatch { min-height: 100vh; height: auto; overflow: visible; }
  .top-header { min-height: 52px; flex-wrap: wrap; height: auto; padding: 7px; }
  .system-strip { display: none; }
  .body-layout { grid-template-columns: 42px minmax(0,1fr); overflow: visible; }
  .side-rail { padding: 5px 2px; }
  .rail-button { height: 48px; }
  .main-stage { height: auto; padding: 6px; overflow: visible; min-height: 540px; }
  .zone-row { grid-template-columns: repeat(1,minmax(0,1fr)); }
  .zone-row .resource-tile { height: 157px; }
  .console-watermark { width: 90%; right: 5%; top: 24%; }
  .selected-meta>div { display: none; }
  .selected-resource { padding: 4px; }
  .console-desk { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; height: auto; }
  .desk-clock { grid-row: 1; grid-column: 2; }
  .transmit-action { grid-row: 2; grid-column: 1 / -1; min-height: 64px; }
  .desk-status { grid-column: 1 / -1; }
  .desk-audio { grid-row: 1; grid-column: 1; }
  .right-panel { max-height: none; }
  .filter-header { padding: 4px; height: auto; }
  .filter-right { display: none; }
}

/* Keep the desk clock on one row on English (US) systems. */
.desk-clock strong { white-space: nowrap; font-size: 24px; }
