:root {
  color-scheme: dark;
  --bg: #07090a;
  --panel: #0b0e0f;
  --panel-2: #101415;
  --panel-3: #15191b;
  --line: #252b2d;
  --line-strong: #353d40;
  --text: #f1f3f2;
  --muted: #8e9694;
  --muted-2: #68706e;
  --gold: #e9b522;
  --gold-hover: #f2c63b;
  --gold-soft: rgba(233, 181, 34, .12);
  --green: #42d98a;
  --green-soft: rgba(66, 217, 138, .12);
  --red: #f06c63;
  --red-soft: rgba(240, 108, 99, .12);
  --amber: #f0b64a;
  --radius: 6px;
  --shadow: 0 22px 60px rgba(0, 0, 0, .44);
  font-family: Bahnschrift, "Segoe UI", Arial, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; background: var(--bg); }
body { min-height: 100vh; margin: 0; overflow-x: hidden; background: var(--bg); color: var(--text); }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .55; }
[hidden] { display: none !important; }
.icon { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.status-dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: var(--red); }
.status-dot.online { background: var(--green); box-shadow: 0 0 0 3px rgba(66, 217, 138, .08); }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 108px minmax(0, 1fr); }
.nav-rail { position: fixed; z-index: 35; inset: 0 auto 0 0; width: 108px; border-right: 1px solid var(--line); background: #090b0c; display: flex; flex-direction: column; }
.rail-brand { height: 69px; border-bottom: 1px solid var(--line); display: grid; place-items: center; align-content: center; gap: 0; overflow: hidden; }
.rail-brand img { width: 50px; height: 40px; object-fit: contain; }
.rail-brand span { margin-top: -5px; color: var(--gold); font-size: 9px; font-weight: 800; }
.rail-nav { display: grid; padding-top: 7px; }
.rail-nav button { position: relative; min-height: 61px; border: 0; background: transparent; color: #adb3b1; display: grid; place-items: center; align-content: center; gap: 5px; font-size: 11px; }
.rail-nav button:hover { color: var(--text); background: #101314; }
.rail-nav button.active { color: var(--gold); background: var(--gold-soft); }
.rail-nav button.active::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--gold); }
.rail-nav .icon { width: 21px; height: 21px; }
.rail-footer { margin-top: auto; min-height: 66px; border-top: 1px solid var(--line); display: grid; place-items: center; align-content: center; gap: 2px; }
.rail-footer strong { font-size: 19px; }
.rail-footer span { color: var(--muted); font-size: 10px; }

.workspace { grid-column: 2; min-width: 0; min-height: 100vh; display: grid; grid-template-rows: 64px minmax(0, 1fr) 35px; }
.topbar { position: sticky; z-index: 30; top: 0; min-width: 0; border-bottom: 1px solid var(--line); background: rgba(8, 10, 11, .98); display: grid; grid-template-columns: minmax(220px, 340px) minmax(340px, 1fr) auto; align-items: center; gap: 16px; padding: 0 13px 0 22px; }
.station-block { min-width: 0; display: flex; align-items: center; gap: 20px; }
.station-block > strong { white-space: nowrap; font-size: 14px; }
.device-picker { min-width: 0; flex: 1 1 auto; display: grid; gap: 2px; }
.device-picker span { color: var(--muted-2); font-size: 9px; text-transform: uppercase; }
.device-picker select { width: 100%; height: 30px; min-height: 30px; padding: 2px 24px 2px 0; border: 0; background: transparent; color: #bdc3c1; font-size: 11px; outline: none; }
.system-status { min-width: 0; display: flex; justify-content: center; gap: clamp(14px, 3vw, 34px); color: #c7cdcb; }
.system-status > span { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.system-status b { font-size: 11px; font-weight: 500; }
.system-status .icon { width: 16px; height: 16px; }
.system-status > span:nth-child(2) .icon { color: var(--green); }
.system-status > span:nth-child(3) .icon { color: var(--green); }
.top-actions { display: flex; align-items: center; gap: 6px; padding-left: 17px; border-left: 1px solid var(--line); }

.main { min-width: 0; padding: 22px 24px 18px; overflow: hidden; }
.page { width: 100%; height: 100%; }
.page-heading { min-height: 69px; padding-bottom: 16px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.page-heading h1 { margin: 0; font-size: 23px; line-height: 1.1; }
.page-heading p { margin: 7px 0 0; color: var(--muted); font-size: 11px; }
.page-counter { min-width: 80px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--muted); text-align: center; font-size: 11px; }

.button { min-height: 36px; padding: 7px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: #111517; color: var(--text); display: inline-flex; align-items: center; justify-content: center; gap: 7px; text-decoration: none; font-size: 11px; font-weight: 600; white-space: nowrap; }
.button:hover { border-color: #4b5558; background: #171c1e; }
.button.primary { border-color: var(--gold); background: var(--gold); color: #17140a; }
.button.primary:hover { background: var(--gold-hover); }
.button.danger { border-color: #713b39; color: #ffaaa4; background: var(--red-soft); }
.button.icon-only { width: 38px; padding: 0; }
.button.compact { min-height: 30px; width: 30px; padding: 0; }
.button .icon { width: 16px; height: 16px; }

.summary-band { min-height: 350px; margin-top: 18px; border: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr); }
.on-air-block, .next-block { padding: clamp(26px, 4vw, 54px); display: flex; flex-direction: column; justify-content: center; }
.on-air-block { background: #0b0f0f; border-right: 1px solid var(--line); }
.eyebrow { color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.eyebrow.gold { color: var(--gold); }
.summary-band h2 { margin: 12px 0 8px; font-size: 28px; line-height: 1.15; overflow-wrap: anywhere; }
.summary-band p { margin: 0; color: var(--muted); font-size: 12px; }
.live-status { margin-top: 32px; display: inline-flex; align-items: center; gap: 8px; color: var(--green); font-size: 11px; }
.metrics { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); display: flex; gap: 24px; flex-wrap: wrap; color: var(--muted); font-size: 10px; }
.metrics strong { color: var(--text); font-size: 16px; }

.company-workspace { height: calc(100% - 70px); min-height: 500px; margin-top: 18px; border-top: 1px solid var(--line); display: grid; grid-template-columns: 255px minmax(0, 1fr); }
.company-pane { min-width: 0; padding: 10px 10px 12px 0; border-right: 1px solid var(--line); overflow: hidden; }
.company-pane-head { height: 28px; padding: 0 10px; color: var(--muted-2); display: flex; justify-content: space-between; align-items: center; font-size: 9px; text-transform: uppercase; }
.company-pane-head strong { min-width: 22px; height: 20px; border: 1px solid var(--line); border-radius: 4px; display: grid; place-items: center; color: var(--muted); }
.company-list { display: grid; gap: 6px; max-height: calc(100vh - 196px); overflow-y: auto; padding-right: 7px; }
.company-item { width: 100%; min-height: 68px; padding: 10px; border: 1px solid transparent; border-radius: var(--radius); background: transparent; color: var(--text); text-align: left; display: grid; grid-template-columns: 42px minmax(0, 1fr); align-items: center; gap: 10px; }
.company-item:hover { border-color: var(--line); background: #0e1112; }
.company-item.active { border-color: #8d6c13; background: var(--gold-soft); }
.company-avatar { width: 42px; height: 42px; border-radius: 4px; background: #eceeee; color: #181b1c; display: grid; place-items: center; font-size: 13px; font-weight: 800; }
.company-item strong, .company-item small { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.company-item strong { font-size: 12px; }
.company-item small { margin-top: 5px; color: var(--muted); font-size: 9px; }
.company-operation { min-width: 0; padding: 15px 0 0 18px; overflow: hidden; }
.company-head { min-height: 78px; padding-bottom: 13px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.company-head h2 { margin: 8px 0 5px; font-size: 20px; }
.company-head p { margin: 0; color: var(--muted); font-size: 10px; }
.company-actions { display: flex; align-items: center; gap: 7px; }
.source-toolbar { min-height: 44px; padding: 8px 0; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.source-toolbar > div { min-width: 0; display: flex; gap: 6px; flex-wrap: wrap; }
.source-toolbar > span { color: #b6bcba; font-size: 9px; white-space: nowrap; }
.source-chip { min-height: 27px; padding: 4px 8px; border: 1px solid var(--line-strong); border-radius: 4px; display: inline-flex; align-items: center; gap: 6px; color: #d5dad8; font-size: 9px; }
.source-chip .icon { width: 14px; height: 14px; color: var(--green); }

.queue-table-wrap { width: 100%; overflow-x: auto; }
.queue-table-head, .queue-table-row { min-width: 880px; display: grid; grid-template-columns: 38px minmax(230px, 1.5fr) 78px 116px 116px 86px 144px; align-items: center; gap: 10px; }
.queue-table-head { min-height: 47px; border-bottom: 1px solid var(--line); color: #b2b8b6; font-size: 9px; text-transform: uppercase; }
.queue-table-row { min-height: 61px; border-bottom: 1px solid var(--line); font-size: 10px; }
.queue-table-row.on-air { background: rgba(233, 181, 34, .035); }
.queue-position { color: var(--muted); text-align: center; font-weight: 700; }
.queue-file { min-width: 0; }
.queue-file strong, .queue-file small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-file strong { font-size: 11px; }
.queue-file small { margin-top: 5px; color: var(--muted-2); font-size: 9px; }
.source-mark { width: 28px; height: 28px; border: 1px solid var(--line-strong); border-radius: 4px; display: grid; place-items: center; color: var(--green); }
.source-mark .icon { width: 15px; height: 15px; }
.queue-date { color: #d1d5d4; white-space: nowrap; }
.status-badge { width: fit-content; min-width: 62px; padding: 5px 7px; border: 1px solid var(--line-strong); border-radius: 4px; color: #d2d6d5; text-align: center; font-size: 9px; text-transform: uppercase; }
.status-badge.live { border-color: #907016; color: var(--gold); background: var(--gold-soft); }
.status-badge.urgent { border-color: #97514d; color: #ffaaa4; background: var(--red-soft); }
.row-actions { display: flex; justify-content: flex-end; gap: 4px; }
.row-actions .button { color: #c6cdca; }
.table-empty { min-width: 880px; min-height: 180px; border-bottom: 1px solid var(--line); display: grid; place-items: center; color: var(--muted); font-size: 11px; }

.queue-editor-list { margin-top: 18px; border-top: 1px solid var(--line); }
.queue-editor-row { min-height: 78px; padding: 11px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 42px minmax(180px, 1fr) minmax(380px, .9fr) auto; align-items: center; gap: 12px; }
.queue-editor-row .company-avatar { width: 36px; height: 36px; color: var(--muted); background: var(--panel-3); }
.queue-editor-title { min-width: 0; }
.queue-editor-title strong, .queue-editor-title small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-editor-title small { margin-top: 5px; color: var(--muted); font-size: 10px; }
.date-editor { display: grid; grid-template-columns: 1.2fr .8fr 1.2fr .8fr; gap: 6px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field label { color: #aeb5b2; font-size: 10px; font-weight: 600; }
input, select, textarea { width: 100%; min-width: 0; min-height: 38px; padding: 7px 9px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: #0c1011; color: var(--text); outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(233, 181, 34, .08); }
.date-editor input { min-height: 34px; padding: 5px 7px; color-scheme: dark; font-size: 10px; }

.source-grid { margin-top: 18px; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(3, minmax(200px, 1fr)); }
.source-item { min-height: 118px; padding: 17px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.source-item:nth-child(3n) { border-right: 0; }
.source-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.source-top strong { font-size: 12px; }
.source-state { display: inline-flex; align-items: center; gap: 6px; color: var(--green); font-size: 9px; text-transform: uppercase; }
.source-state.error { color: var(--red); }
.source-state.waiting { color: var(--amber); }
.source-item p { margin: 20px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }

.activity-list { margin-top: 18px; border-top: 1px solid var(--line); }
.activity-row { min-height: 48px; padding: 10px 4px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 120px 72px minmax(0, 1fr); gap: 16px; align-items: center; }
.activity-row time { color: var(--muted); font-size: 10px; }
.activity-result { display: inline-flex; align-items: center; gap: 6px; color: var(--green); font-size: 9px; text-transform: uppercase; }
.activity-result.error { color: var(--red); }
.activity-row p { margin: 0; color: #d2d6d5; font: 10px/1.45 Consolas, monospace; overflow-wrap: anywhere; }
.empty-state { min-height: 180px; display: grid; place-items: center; color: var(--muted); font-size: 11px; text-align: center; }

.update-summary { min-height: 44px; padding: 14px 4px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.update-list { border-top: 1px solid var(--line); }
.update-row { min-height: 118px; padding: 16px 4px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 48px minmax(250px, 1fr) 105px 100px auto; align-items: center; gap: 16px; }
.update-icon { width: 44px; height: 44px; border: 1px solid #725a18; border-radius: var(--radius); background: var(--gold-soft); color: var(--gold); display: grid; place-items: center; }
.update-icon .icon { width: 22px; height: 22px; }
.update-copy { min-width: 0; }
.update-copy strong, .update-copy small { display: block; }
.update-copy strong { font-size: 13px; }
.update-copy small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.update-copy p { max-width: 720px; margin: 10px 0 0; color: #adb4b1; font-size: 9px; line-height: 1.45; }
.update-version small, .update-version strong, .update-version em { display: block; }
.update-version small { color: var(--muted); font-size: 8px; text-transform: uppercase; }
.update-version strong { margin-top: 5px; font-size: 16px; }
.update-version em { margin-top: 3px; color: var(--muted); font-size: 9px; font-style: normal; }
.update-state { display: inline-flex; align-items: center; gap: 6px; color: var(--gold); font-size: 9px; white-space: nowrap; }
.update-state.current { color: var(--green); }
.update-state .icon { width: 15px; height: 15px; }
.update-download { justify-self: end; }

.statusbar { min-width: 0; padding: 0 18px; border-top: 1px solid var(--line); background: #090b0c; display: flex; align-items: center; gap: 28px; color: var(--muted); font-size: 9px; }
.statusbar > span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.statusbar .icon { width: 14px; height: 14px; }
.statusbar strong { color: #d5dad8; font-weight: 500; }
.statusbar-spacer { flex: 1 1 auto; }

.modal-backdrop, .sheet-backdrop { position: fixed; z-index: 90; inset: 0; padding: 20px; background: rgba(0, 0, 0, .72); }
.modal-backdrop { display: grid; place-items: center; }
.modal { width: min(460px, 100%); padding: 24px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: #0d1112; box-shadow: var(--shadow); }
.modal h2 { margin: 8px 0 0; font-size: 20px; }
.modal p { margin: 10px 0 18px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.modal-actions { margin-top: 20px; display: flex; justify-content: flex-end; gap: 8px; }
.access-modal { padding-top: 18px; }
.access-logo { width: 76px; height: 64px; margin-bottom: 8px; object-fit: contain; }

.sheet-backdrop { display: flex; justify-content: flex-end; padding: 0; }
.upload-sheet { width: min(510px, 100%); height: 100%; padding: 24px; border-left: 1px solid var(--line-strong); background: #0b0f10; box-shadow: var(--shadow); overflow-y: auto; }
.sheet-head { margin-bottom: 22px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.sheet-head h2 { margin: 6px 0 4px; font-size: 22px; }
.sheet-head p { margin: 0; color: var(--muted); font-size: 10px; }
.file-drop { position: relative; min-height: 154px; padding: 22px; border: 1px dashed #4b5355; border-radius: var(--radius); background: #0e1213; display: grid; place-items: center; align-content: center; gap: 8px; text-align: center; cursor: pointer; }
.file-drop:hover { border-color: var(--gold); background: var(--gold-soft); }
.file-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.file-drop > .icon { width: 28px; height: 28px; color: var(--gold); }
.file-drop strong { font-size: 12px; }
.file-drop small { color: var(--muted); font-size: 9px; }
.file-selected { min-height: 58px; margin-top: 10px; padding: 9px 10px; border: 1px solid var(--line); background: var(--panel-2); display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 9px; }
.file-selected > .icon { color: var(--gold); }
.file-selected strong, .file-selected small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-selected strong { font-size: 11px; }
.file-selected small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.date-section { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.date-section-title { margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.date-section-title strong { font-size: 12px; }
.date-section-title span { color: var(--muted); font-size: 9px; }
.upload-grid { display: grid; grid-template-columns: 1fr .72fr; gap: 10px; }
.upload-grid input { color-scheme: dark; }
.upload-progress { margin-top: 18px; padding: 13px; border: 1px solid var(--line); background: var(--panel-2); }
.upload-progress > div:first-child { display: flex; justify-content: space-between; gap: 10px; }
.upload-progress strong { font-size: 10px; }
.upload-progress span { color: var(--muted); font-size: 9px; text-align: right; }
.upload-progress.error { border-color: #824743; background: #1b1010; }
.upload-progress.error strong, .upload-progress.error span { color: #ffaaa4; }
.progress-track { height: 3px; margin-top: 12px; background: #252b2d; overflow: hidden; }
.progress-track i { display: block; width: 10%; height: 100%; background: var(--gold); transition: width .25s ease; }
.upload-progress.error .progress-track i { background: var(--red); }
.upload-actions { margin-top: 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.upload-actions .button { width: 100%; }

.toast-stack { position: fixed; z-index: 120; right: 18px; bottom: 48px; width: min(390px, calc(100vw - 36px)); display: grid; gap: 8px; pointer-events: none; }
.toast { min-height: 48px; padding: 12px 14px; border: 1px solid #4a5557; border-radius: var(--radius); background: #121719; box-shadow: var(--shadow); color: var(--text); font-size: 11px; display: flex; align-items: center; animation: toast-in .18s ease-out; }
.toast.success { border-color: #286847; color: #9be7bd; }
.toast.error { border-color: #824743; color: #ffaaa4; background: #1b1010; }
.toast.pending { border-color: #735b1b; color: #f1cb65; }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } }

.mobile-nav { display: none; }

@media (max-width: 1080px) {
  .system-status > span:nth-child(3) { display: none; }
  .topbar { grid-template-columns: minmax(210px, 1fr) auto auto; }
  .company-workspace { grid-template-columns: 220px minmax(0, 1fr); }
  .company-head { align-items: flex-start; }
  .company-actions .button:not(.primary):not(.icon-only) { width: 38px; padding: 0; font-size: 0; }
  .queue-editor-row { grid-template-columns: 40px minmax(150px, 1fr) minmax(330px, 1fr); }
  .queue-editor-row > .row-actions { grid-column: 2 / -1; }
}

@media (max-width: 760px) {
  .app-shell { display: block; }
  .nav-rail { display: none; }
  .workspace { min-height: 100vh; display: block; }
  .topbar { position: sticky; height: 66px; padding: 7px 10px; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
  .station-block { gap: 8px; }
  .station-block > strong { display: none; }
  .device-picker span { display: none; }
  .device-picker select { height: 38px; min-height: 38px; padding: 7px 25px 7px 8px; border: 1px solid var(--line); background: #0e1213; color: var(--text); font-size: 11px; }
  .system-status { display: none; }
  .top-actions { gap: 5px; padding-left: 0; border-left: 0; }
  .top-actions #uploadOpen { width: 38px; padding: 0; }
  .top-actions #uploadOpen span:last-child { display: none; }
  .top-actions #scanAll, .top-actions #disconnect { display: none; }
  .main { padding: 17px 13px 88px; overflow: visible; }
  .page-heading { min-height: 62px; padding-bottom: 13px; }
  .page-heading h1 { font-size: 19px; }
  .page-heading p { line-height: 1.4; }
  .summary-band { min-height: 0; grid-template-columns: 1fr; }
  .on-air-block, .next-block { min-height: 210px; padding: 25px 20px; }
  .on-air-block { border-right: 0; border-bottom: 1px solid var(--line); }
  .summary-band h2 { font-size: 22px; }
  .company-workspace { height: auto; min-height: 0; margin-top: 12px; display: block; border-top: 0; }
  .company-pane { padding: 0 0 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .company-pane-head { display: none; }
  .company-list { max-height: none; padding: 0 0 3px; display: flex; overflow-x: auto; scroll-snap-type: x proximity; }
  .company-item { min-width: 180px; min-height: 58px; padding: 8px; grid-template-columns: 36px minmax(0, 1fr); scroll-snap-align: start; }
  .company-avatar { width: 36px; height: 36px; }
  .company-operation { padding: 16px 0 0; overflow: visible; }
  .company-head { display: block; }
  .company-head h2 { font-size: 18px; }
  .company-actions { margin-top: 14px; display: grid; grid-template-columns: 1fr 38px 1fr; }
  .company-actions .button { width: 100%; }
  .company-actions .button:not(.primary):not(.icon-only) { width: 100%; font-size: 11px; }
  .source-toolbar { align-items: flex-start; }
  .source-toolbar > span { display: none; }
  .queue-table-wrap { overflow: visible; }
  .queue-table-head { display: none; }
  .queue-table-row { min-width: 0; min-height: 0; padding: 13px 0; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 9px; align-items: start; }
  .queue-table-row > .source-mark { grid-column: 3; grid-row: 1; }
  .queue-table-row > .queue-date { grid-column: 2 / -1; }
  .queue-table-row > .status-badge { grid-column: 2; }
  .queue-table-row > .row-actions { grid-column: 2 / -1; justify-content: flex-start; }
  .table-empty { min-width: 0; min-height: 130px; }
  .queue-editor-row { padding: 14px 0; grid-template-columns: 36px minmax(0, 1fr); align-items: start; }
  .queue-editor-row > .date-editor, .queue-editor-row > .row-actions { grid-column: 1 / -1; }
  .date-editor { grid-template-columns: 1fr 1fr; }
  .row-actions { justify-content: flex-start; }
  .source-grid { grid-template-columns: 1fr; }
  .source-item, .source-item:nth-child(3n) { border-right: 0; }
  .activity-row { grid-template-columns: 88px minmax(0, 1fr); gap: 8px; }
  .activity-row p { grid-column: 1 / -1; }
  .statusbar { display: none; }
  .update-row { padding: 15px 0; grid-template-columns: 44px minmax(0, 1fr); gap: 10px; }
  .update-copy p { font-size: 9px; }
  .update-version { grid-column: 2; }
  .update-state { grid-column: 2; }
  .update-download { grid-column: 1 / -1; width: 100%; justify-self: stretch; }
  .mobile-nav { position: fixed; z-index: 50; inset: auto 0 0; height: calc(67px + env(safe-area-inset-bottom)); padding: 6px 3px env(safe-area-inset-bottom); border-top: 1px solid var(--line); background: rgba(9, 11, 12, .98); display: grid; grid-template-columns: repeat(6, 1fr); }
  .mobile-nav button { border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; align-content: center; gap: 4px; font-size: 9px; }
  .mobile-nav button.active { color: var(--gold); }
  .mobile-nav .icon { width: 19px; height: 19px; }
  .modal-backdrop { align-items: end; padding: 0; }
  .modal { width: 100%; padding: 22px 18px calc(22px + env(safe-area-inset-bottom)); border-radius: var(--radius) var(--radius) 0 0; }
  .modal-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .upload-sheet { height: auto; max-height: 94vh; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line-strong); border-left: 0; align-self: flex-end; }
  .file-drop { min-height: 125px; }
  .upload-grid { grid-template-columns: 1fr 1fr; }
  .upload-actions { position: sticky; bottom: 0; padding-top: 12px; background: #0b0f10; }
  .toast-stack { bottom: 76px; right: 10px; width: calc(100vw - 20px); }
}

@media (max-width: 390px) {
  .top-actions #refresh { display: none; }
  .company-actions { grid-template-columns: minmax(0, 1fr) 38px minmax(0, 1fr); }
  .company-actions .button { padding-inline: 7px; }
  .upload-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .upload-actions { grid-template-columns: 1fr; }
}
