:root {
  color-scheme: dark;
  --bg: #101725;
  --panel: #121a27;
  --line: #8aaad32d;
  --muted: #a8b8cb;
  --ink: #f1f6ff;
  --accent: #a7caff;
}

/* Premium Operations Pass 1: smoked-glass command center. */
:root {
  color-scheme: dark;
  --bg: #020712;
  --panel: #071521;
  --line: #89bfe12e;
  --muted: #86a0b4;
  --ink: #eef8ff;
  --accent: #55dded;
  --good: #54d6a3;
  --warn: #f2c96b;
  --bad: #ff7584;
}
body {
  background:
    radial-gradient(circle at 72% 17%, #329dd622, transparent 30rem),
    linear-gradient(100deg, #020811f2, #030c18d1 48%, #020810f2),
    url('/factory-atmosphere.webp') center top / max(100vw, 1440px) auto fixed no-repeat,
    var(--bg);
}
header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(180deg, #020912f5, #030c17dc);
  border-color: var(--line);
  box-shadow: 0 16px 40px #00000038;
  backdrop-filter: blur(22px) saturate(125%);
}
.panel, #login, .operator-strip button, .view-switcher {
  background: linear-gradient(145deg, #102739c7, #05111eea);
  border-color: var(--line);
  box-shadow: inset 0 1px #ffffff0f, 0 20px 55px #0000003d;
  backdrop-filter: blur(22px) saturate(118%);
}
.operator-strip { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.operator-strip button {
  min-width: 0;
  padding: 8px 10px;
  text-align: left;
  border-radius: 9px;
}
.operator-strip span, .operator-strip small { display: block; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.operator-strip span { font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.operator-strip strong { display: block; margin: 2px 0; color: var(--ink); font-size: 15px; overflow: hidden; text-overflow: ellipsis; }
.operator-strip small { font-size: 8px; }
.metric, .run-list-row, .worker { background: #0a1b2bbd; border-color: var(--line); }
.view-switcher { position: sticky; top: 55px; z-index: 10; backdrop-filter: blur(18px); }
.view-switcher button[aria-selected='true'] { background: #16415bba; border-color: #5bd7ef61; }
#panel-runs:not([hidden]) { display: grid; grid-template-columns: minmax(620px, 1.25fr) minmax(440px, .75fr); gap: 12px; align-items: start; }
#panel-runs > .jobs-panel { min-width: 0; }
#detail { position: sticky; top: 108px; max-height: calc(100vh - 122px); overflow: auto; scrollbar-width: thin; }
.detail-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mission-stages { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.mission-stage { display: grid; grid-template-columns: auto 1fr; gap: 1px 8px; align-items: center; padding: 9px; border: 1px solid var(--line); border-radius: 8px; background: #071726cc; }
.mission-stage .stage-number { grid-row: 1 / 3; display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid currentColor; border-radius: 50%; color: var(--muted); font-size: 10px; }
.mission-stage small { color: var(--muted); text-transform: uppercase; font-size: 8px; letter-spacing: .08em; }
.mission-stage[data-state='complete'] { border-color: #54d6a361; }
.mission-stage[data-state='complete'] .stage-number, .mission-stage[data-state='complete'] small { color: var(--good); }
.mission-stage[data-state='pending'] { border-color: #f2c96b61; }
.mission-stage[data-state='pending'] .stage-number, .mission-stage[data-state='pending'] small { color: var(--warn); }
.mission-stage[data-state='failed'] { border-color: #ff758466; }
.mission-stage[data-state='failed'] .stage-number, .mission-stage[data-state='failed'] small { color: var(--bad); }
.worker-grid { grid-template-columns: repeat(6, minmax(110px, 1fr)); gap: 6px; }
.worker { padding: 8px; }
.worker h4 { display: inline-block; margin-right: 5px; }
.worker p { margin: 4px 0; font-size: 9px; }
.worker[data-state='running'], .worker[data-state='active'], .worker[data-state='starting'] { border-color: #55dded66; }
.worker[data-state='completed'] { border-color: #54d6a35c; }
.worker[data-state='failed'], .worker[data-state='interrupted'], .worker[data-state='cancelled'] { border-color: #ff758466; }
.worker[data-state='waiting'], .worker[data-state='stopping'] { border-color: #f2c96b4d; }
.detail-tabs { display: flex; gap: 4px; margin-top: 16px; padding: 3px; overflow-x: auto; border: 1px solid var(--line); border-radius: 9px; background: #030e19c7; }
.detail-tabs button { flex: 1 0 80px; border-color: transparent; background: transparent; color: var(--muted); }
.detail-tabs button[aria-selected='true'] { color: var(--ink); background: #16415bba; border-color: #5bd7ef61; }
.detail-panels > section { min-height: 180px; }
#logs, #events { list-style: none; padding: 0; }
#logs li, #events li { padding: 8px; border-bottom: 1px solid var(--line); font-size: 11px; color: var(--muted); }

@media (max-width: 1250px) {
  #panel-runs:not([hidden]) { grid-template-columns: minmax(0, 1fr); }
  #detail { position: static; max-height: none; }
}

@media (max-width: 820px) {
  :root { color-scheme: dark; --bg: #020712; --panel: #071521; --line: #89bfe12e; --muted: #91aabd; --ink: #eef8ff; --accent: #55dded; }
  body { color: var(--ink); background: linear-gradient(180deg, #020912d6, #020810f5 42rem), url('/factory-atmosphere.webp') 38% top / auto 620px no-repeat, var(--bg); }
  header { background: #020912ed; border-color: var(--line); }
  header span { display: none; }
  .panel, #login { color: var(--ink); background: linear-gradient(145deg, #102739e8, #05111ef5); border-color: var(--line); }
  .operator-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; overflow: visible; }
  .operator-strip button { min-height: 54px; padding: 6px 7px; color: var(--ink); background: #0a1b2be8; border-color: var(--line); }
  .view-switcher { top: 0; display: flex; overflow-x: auto; background: #030e19ed; border-color: var(--line); }
  .view-switcher button { min-width: 96px; color: var(--muted); background: transparent; border-color: transparent; }
  .view-switcher button[aria-selected='true'] { color: var(--ink); background: #16415b; border-color: #5bd7ef61; }
  .run-list-row, .metric, .agent-table tr, .queue-table tr, .jobs-table tr { color: var(--ink); background: #0a1b2be8; border-color: var(--line); }
  .agent-table td:nth-child(1) .cell-main { color: var(--ink); }
  .agent-table td:nth-child(6), .agent-table td:nth-child(7) { display: block; grid-column: 1 / -1; }
  .agent-table .row-actions button, button, input, select { color: var(--ink); background: #10283be8; border-color: #8abbd052; }
  .agent-table .row-actions .danger { color: #ffc1c7; background: #3e2631; border-color: #ff758452; }
  thead th, thead th:last-child, th:last-child, td:last-child { background: #0b1d2d; }
  tbody tr:hover td { background-color: #112b40; }
  dialog { color: var(--ink); background: #071521; border-color: #71cadd66; }
  dialog::backdrop { background: #000b; }
  .worker-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .route-grid { grid-template-columns: minmax(0, 1fr); }
  .mission-stages { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 390px) {
  main { padding: 7px; }
  .operator-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .worker-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

@media (prefers-contrast: more) {
  :root { --line: #addaf26b; --muted: #b5c9d7; }
  .panel, .worker, .metric, .operator-strip button { backdrop-filter: none; background: #071521; }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #0a152d65, #101725ad), url('/factory-atmosphere.webp') center top / cover fixed, var(--bg);
  color: var(--ink);
  font: 13px/1.5 Inter, ui-sans-serif, system-ui, sans-serif;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid #a9c4eb33;
  background: #0e1728b5;
  padding: 14px 32px;
  backdrop-filter: blur(12px);
}
header span, .section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: #cad7e9;
}
.brand { letter-spacing: .08em; font-size: 13px; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: #d8e7ff; }
main { max-width: 1800px; margin: auto; padding: 18px 30px 32px; }
h1 { font-size: 18px; letter-spacing: .12em; font-weight: 650; margin: 0; }
h2 { font-size: 12px; letter-spacing: .08em; font-weight: 650; margin: 0; }
h3 { font-size: 13px; margin: 0 0 10px; }
p { color: var(--muted); }
button, input, select {
  font: inherit;
  color: var(--ink);
  border: 1px solid #809bc24a;
  border-radius: 6px;
  padding: 7px 11px;
  background: #1c293b;
}
button { cursor: pointer; white-space: nowrap; font-size: 12px; transition: background .15s, border-color .15s; }
button:hover:enabled { border-color: #a7caffb3; background: #26374e; }
button:disabled { opacity: .4; cursor: default; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
input[type='checkbox'] { width: 14px; height: 14px; margin: 0; accent-color: #87b5fb; cursor: pointer; }
.heading, .panel-heading, .filters, .bulk, .pagination {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}
.heading { margin-bottom: 16px; }
#refresh { background: #233953e8; border-color: #bad4ff69; }
.section-label { margin-bottom: 8px; }
.operator-strip {
  display: grid;
  grid-template-columns: 0.75fr 1.5fr 1.25fr 1fr 0.7fr 1.2fr;
  gap: 7px;
  margin-bottom: 12px;
}
.operator-signal { min-width: 0; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: #111b2ded; }
.operator-signal span { display: block; color: var(--muted); font-size: 8px; text-transform: uppercase; letter-spacing: .08em; }
.operator-signal strong { display: block; margin-top: 3px; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.operator-signal.healthy { border-color: #5cb99a52; }
.operator-signal.active { border-color: #75aef066; background: #16263c; }
.operator-signal.alert { border-color: #e078806b; background: #35232d; }
.operator-signal.quiet strong { color: #8294a9; font-weight: 500; }
.view-switcher { display: flex; gap: 4px; overflow-x: auto; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: #0d1624c7; scrollbar-width: thin; }
.view-switcher button { flex: 0 0 auto; min-width: 92px; border-color: transparent; background: transparent; color: var(--muted); }
.view-switcher button[aria-selected='true'] { color: var(--ink); background: #26384f; border-color: #91b3df4a; }
.view-panel { min-width: 0; }
.overview-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.overview-card { margin-top: 12px; min-height: 112px; }
.overview-card .section-label { display: block; margin-bottom: 13px; }
.summary-line { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.summary-line > div { min-width: 0; }
.summary-line strong, .summary-line span { display: block; }
.summary-line strong { font-size: 14px; line-height: 1.3; overflow-wrap: anywhere; }
.summary-line div span { margin-top: 5px; color: var(--muted); font-size: 11px; }
.operator-notice { margin-top: 12px; padding: 10px 13px; border: 1px solid #d29b4e5c; border-radius: 8px; background: #3b3022d9; color: #f2d8a7; }
.current-runs { margin-top: 10px; }
.current-runs .panel-heading > div { min-width: 0; }
.run-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.run-list-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 7px; background: #141e2d; }
.run-list-row div { min-width: 0; }
.run-list-row strong, .run-list-row div span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.run-list-row div span { color: var(--muted); font-size: 10px; margin-top: 2px; }
.run-list-row button { padding: 4px 8px; }
.empty-state { margin: 0; }
.panel {
  min-width: 0;
  padding: 16px 18px;
  background: #121a27ef;
  border: 1px solid #9dbbe43b;
  border-radius: 11px;
  margin: 16px 0 0;
  box-shadow: inset 0 1px 0 #dbe9ff0a, 0 8px 22px #0610252e;
}
.panel-heading { min-width: 0; margin-bottom: 12px; }
.panel-heading h2 span { color: var(--muted); letter-spacing: 0; font-weight: 400; }
#updated { color: var(--muted); font-size: 11px; white-space: nowrap; }
.status-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 8px; }
.metric { min-width: 0; padding: 10px 12px; background: #141e2ded; border: 1px solid var(--line); border-radius: 7px; }
.metric span { display: block; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .07em; }
.metric strong { display: block; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; margin-top: 3px; line-height: 1.35; }
.metric.is-unavailable { opacity: .56; }
.metric.is-unavailable strong { font-size: 11px; font-weight: 400; }
#status .metric { background: #111b2deb; border-color: #a6c7f13d; }
.pool-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); }
.pool-grid .metric { background: #1b2839; padding: 9px 11px; }
.pool-grid .metric strong { font-size: 19px; }
.pool-grid.unavailable .metric strong { font-size: 12px; color: var(--muted); margin-top: 7px; }
.orchestration-panel { border-top: 1px solid var(--line); margin-top: 15px; padding-top: 14px; }
.orchestration-panel .panel-heading { margin-bottom: 9px; }
.orchestration-panel h3 { font-size: 11px; letter-spacing: .08em; margin: 0; }
.queue-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.queue-grid .metric { padding: 7px 11px; }
.queue-grid .metric strong { font-size: 16px; }
.queue-grid.unavailable .metric strong { font-size: 12px; color: var(--muted); }
#queue-note { margin: 8px 0; }
.orchestration-panel .queue-table-scroll { max-height: 260px; }
.queue-table { min-width: 830px; }
.queue-table td:first-child, .queue-table th:first-child { width: 66px; }
.queue-table td:nth-child(2) .cell-main { max-width: 260px; }
.queue-table td:nth-child(3) .cell-main { max-width: 220px; }
.queue-table td:nth-child(6) .cell-main { max-width: 190px; }
.queue-table td:last-child, .queue-table th:last-child { position: static; box-shadow: none; width: 90px; }
.badge.ready { color: #aed0ff; background: #294569; }
.badge.done { color: #9be3c7; background: #23463f; }
.badge.blocked, .badge.staged { color: #edce96; background: #453d2d; }
.panel-note { font-size: 11px; margin: 10px 0 0; }
.compact-toggle, .history-toggle { display: flex; grid-template-columns: auto 1fr; align-items: center; justify-content: flex-start; width: fit-content; gap: 7px; color: var(--muted); font-size: 11px; }
.compact-toggle { margin: 8px 0; }
.history-toggle { margin: 2px 0 12px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px; background: #172233; }
.run-tools { margin: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.run-tools summary { width: fit-content; padding: 8px 0; color: var(--muted); cursor: pointer; font-size: 10px; }
.run-tools .bulk { margin-top: 0; }
.quiet-label { color: var(--muted); font-size: 10px; }
.diagnostics-grid { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
#workspace-note { margin: 10px 0; }
#workspace-note:empty { display: none; }
.filters { justify-content: flex-start; flex-wrap: wrap; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.filters label { flex: 0 1 180px; }
.filters button { align-self: flex-end; }
label { display: grid; gap: 4px; color: var(--muted); font-size: 10px; }
label input, label select { min-width: 0; width: 100%; }
.bulk { justify-content: flex-start; flex-wrap: wrap; gap: 7px; margin: 11px 0; }
.bulk button { padding: 5px 9px; font-size: 11px; }
.bulk span { margin-right: auto; color: var(--muted); font-size: 11px; }
.danger { color: #ffb6b6; border-color: #ba6e724d; background: #3e263133; }
.table-scroll { overflow: auto; max-width: 100%; max-height: 520px; border: 1px solid var(--line); border-radius: 7px; }
.agent-table-scroll { max-height: 300px; margin-top: 12px; }
table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 11px; }
.jobs-table { min-width: 1040px; }
.agent-table { min-width: 960px; }
th { text-align: left; color: #b6c7dc; font-weight: 500; font-size: 9px; text-transform: uppercase; letter-spacing: .05em; padding: 9px 10px; border-bottom: 1px solid #8aaad338; white-space: nowrap; }
thead th { position: sticky; top: 0; background: #1b283a; z-index: 1; }
td { padding: 9px 10px; border-bottom: 1px solid #8aaad31f; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background-color: #1c2b3e; }
td:first-child, th:first-child { padding-left: 12px; }
.jobs-table td:first-child, .jobs-table th:first-child { width: 32px; padding-right: 4px; }
.cell-main, .cell-secondary { display: block; max-width: 220px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cell-main { color: var(--ink); font-weight: 500; }
.cell-secondary { font-size: 10px; line-height: 1.45; color: var(--muted); margin-top: 2px; }
.jobs-table td:nth-child(2) .cell-main { font-weight: 600; }
.jobs-table td:nth-child(3) .cell-secondary { max-width: 150px; }
.agent-table td:nth-child(2) .cell-main { max-width: 210px; }
.agent-table td:nth-child(3) .cell-main { max-width: 180px; }
.agent-table td:nth-child(4) .cell-main { max-width: 180px; }
.row-actions { display: flex; gap: 5px; align-items: center; }
.row-actions button { padding: 4px 8px; font-size: 11px; }
th:last-child, td:last-child { position: sticky; right: 0; background: var(--panel); z-index: 2; box-shadow: -5px 0 8px #0a12264d; width: 110px; }
thead th:last-child { background: #1b283a; z-index: 3; }
.empty-row { padding: 20px; color: var(--muted); text-align: center; position: static !important; }
.badge { display: inline-block; border-radius: 5px; padding: 3px 7px; background: #2c394c; font-size: 10px; white-space: nowrap; color: #c3d0e1; }
.badge.active, .badge.running, .badge.starting { color: #aed0ff; background: #294569; }
.badge.failed { color: #ffb3ba; background: #4a2e3b; }
.badge.completed, .badge.online { color: #9be3c7; background: #23463f; }
.badge.cancelled, .badge.stopping, .badge.stopped { color: #edce96; background: #453d2d; }
.badge.unknown-live, .badge.unknown_live, .badge.unavailable, .badge.unconfigured { color: #ebc897; background: #443b2d; }
.pagination { justify-content: flex-end; margin-top: 11px; }
.pagination span { color: var(--muted); font-size: 11px; }
.pagination button { padding: 5px 10px; font-size: 11px; }
.storage-panel .status-grid { margin-top: 12px; }
.storage-panel summary { cursor: pointer; font-size: 12px; font-weight: 650; letter-spacing: .08em; }
.storage-panel .metric { padding: 8px 10px; }

/* Desktop Operations console. Mobile styling above remains the established compact layout. */


@media (max-width: 820px) {
  .desktop-operator-strip { display: none; }
  .tab-counts { display: none; }
  .header-actions { display: contents; }
  #theme-toggle { display: none; }
}
.storage-panel .metric strong { font-size: 12px; }
.agent-detail { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 14px; }
.agent-detail .panel-heading { margin-bottom: 8px; }
.agent-detail h3 { margin: 0; overflow-wrap: anywhere; }
.agent-detail dl { margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 18px; }
.agent-detail dt { font-size: 10px; color: var(--muted); }
.agent-detail dd { margin: 3px 0 0; font-size: 12px; overflow-wrap: anywhere; }
.worker-grid { display: grid; grid-template-columns: repeat(6, minmax(125px, 1fr)); gap: 10px; }
.worker { padding: 12px; border: 1px solid var(--line); border-radius: 7px; }
.worker h4 { margin: 0 0 10px; }
.worker p { font-size: 11px; margin: 7px 0; overflow-wrap: anywhere; }
.detail-grid, .route-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.route-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#detail h3 { margin-top: 18px; }
#detail .panel-heading { scroll-margin-top: 12px; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--muted); font-size: 11px; }
#events { max-height: 400px; overflow: auto; list-style: none; padding: 0; }
#events li { padding: 8px; border-bottom: 1px solid var(--line); font-size: 11px; color: var(--muted); }
#events .error { color: #ffabab; }
#events .warning { color: #edcd93; }
#artifacts { max-height: 260px; overflow: auto; padding-left: 20px; }
#message { color: #e0edff; margin: 0 0 12px; font-size: 12px; }
#message:empty { display: none; }
dialog { width: min(500px, calc(100vw - 32px)); background: var(--panel); color: var(--ink); border: 1px solid #a7caff69; border-radius: 12px; padding: 24px; }
dialog h2 { font-size: 16px; letter-spacing: 0; }
dialog::backdrop { background: #0009; backdrop-filter: blur(3px); }
#login { max-width: 430px; padding: 24px; border: 1px solid var(--line); border-radius: 10px; background: #121a27ed; }
#login h2 { margin-bottom: 15px; }
#login-form { display: grid; gap: 15px; }
[hidden] { display: none !important; }
@media (min-width: 1500px) { #status { grid-template-columns: repeat(7, minmax(0, 1fr)); } }
@media (max-width: 1100px) {
  .operator-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .overview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pool-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .worker-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .agent-detail dl { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  :root {
    color-scheme: dark;
    --bg: #020712;
    --panel: #071521;
    --line: #89bfe12e;
    --muted: #91aabd;
    --ink: #eef8ff;
    --accent: #55dded;
  }
  html, body { max-width: 100%; }
  html { overflow-x: clip; }
  body { overflow-x: visible; }
  body { background: linear-gradient(180deg, #f7fbff, #edf4fb 48%, #e8f0f8); font-size: 12px; }
  header { display: grid; grid-template-columns: minmax(0, 1fr) auto; padding: 8px 10px; background: #ffffffed; border-color: #cedbea; }
  header span { display: none; }
  header a:last-child { font-size: 11px; }
  main { width: 100%; min-width: 0; padding: 8px; }
  h1 { font-size: 13px; letter-spacing: .06em; }
  .heading { gap: 8px; margin-bottom: 8px; }
  #refresh { padding: 6px 9px; background: #e5effa; border-color: #abc4df; }
  .section-label { margin-bottom: 5px; color: #52708f; font-size: 8px; }
  .operator-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; margin-bottom: 6px; }
  .operator-signal { min-width: 0; padding: 5px 6px; background: #fff; border-color: #c8d7e7; }
  .operator-signal span { font-size: 7px; }
  .operator-signal strong { font-size: 10px; }
  .operator-signal.alert { background: #fae7e9; border-color: #e1aab2; }
  .view-switcher { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; overflow: visible; margin: 0; background: #e5eef8; border-color: #c4d4e5; }
  .view-switcher button { min-width: 0; padding: 6px 2px; color: #526a84; font-size: 10px; overflow: hidden; text-overflow: ellipsis; }
  .view-switcher button[aria-selected='true'] { color: #123d68; background: #fff; border-color: #afc5dc; }
  .overview-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .overview-card { min-height: 0; margin-top: 7px; }
  .overview-card .section-label { margin-bottom: 7px; }
  .summary-line strong { font-size: 12px; }
  .run-list { grid-template-columns: minmax(0, 1fr); }
  .run-list-row { background: #f7faff; border-color: #d1dfed; }
  .operator-notice { margin-top: 7px; color: #6f4a0a; background: #fff4db; border-color: #e8cc91; }
  .panel { padding: 10px; margin-top: 9px; background: #ffffffed; border-color: #c8d7e7; border-radius: 9px; box-shadow: 0 4px 14px #24466712; }
  .panel-heading { align-items: flex-start; flex-wrap: wrap; gap: 8px; }
  .workspace-panel > .panel-heading { margin-bottom: 7px; }
  .badge { color: #405a75; background: #e6edf5; }
  .badge.active, .badge.running, .badge.starting, .badge.ready { color: #145b9f; background: #dcecff; }
  .badge.completed, .badge.online, .badge.done { color: #176744; background: #daf2e7; }
  .badge.failed { color: #a12e3b; background: #f9e1e5; }
  .badge.cancelled, .badge.stopping, .badge.stopped, .badge.blocked, .badge.staged { color: #765516; background: #f5ead2; }
  #status, .pool-grid, .queue-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding-bottom: 2px; }
  #status .metric, .pool-grid .metric, .queue-grid .metric { display: flex; align-items: baseline; gap: 4px; min-width: 0; padding: 4px 5px; background: #f2f7fc; border-color: #d4e0ec; overflow: hidden; }
  #status .metric span, .pool-grid .metric span, .queue-grid .metric span { min-width: 0; overflow: hidden; font-size: 7px; white-space: nowrap; text-overflow: ellipsis; }
  #status .metric strong, .pool-grid .metric strong, .queue-grid .metric strong { display: inline; margin: 0; font-size: 12px; line-height: 1; }
  #workspace-note { margin: 5px 0 6px; font-size: 9px; }
  .agent-table-scroll { max-height: 430px; margin-top: 5px; border: 0; overflow: visible; }
  .agent-table { display: block; min-width: 0; font-size: 10px; }
  .agent-table thead { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
  .agent-table tbody { display: grid; gap: 4px; }
  .agent-table tr { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr) auto; gap: 3px 6px; align-items: center; padding: 6px 7px; border: 1px solid #cfdeec; border-radius: 7px; background: #071724; }
  .agent-table td { display: block; min-width: 0; padding: 0; border: 0; background: transparent !important; }
  .agent-table td:nth-child(1) { grid-column: 1 / 4; grid-row: 1; }
  .agent-table td:nth-child(2) { grid-column: 1; grid-row: 2; }
  .agent-table td:nth-child(3) { grid-column: 2; grid-row: 2; }
  .agent-table td:nth-child(4) { grid-column: 3; grid-row: 2; }
  .agent-table td:nth-child(1) .cell-main { font-weight: 700; color: #173c63; }
  .agent-table td:nth-child(1) .cell-secondary { display: inline; margin-left: 5px; }
  .agent-table td:nth-child(2) .cell-main::before { content: 'Repo '; color: var(--muted); font-weight: 400; }
  .agent-table td:nth-child(3) .cell-main::before { content: 'Branch '; color: var(--muted); font-weight: 400; }
  .agent-table td:nth-child(4) .cell-main::before { content: 'Model '; color: var(--muted); font-weight: 400; }
  .agent-table td:nth-child(5) { grid-column: 4; grid-row: 1; }
  .agent-table td:nth-child(6), .agent-table td:nth-child(7) { display: none; }
  .agent-table td:nth-child(8) { grid-column: 4; grid-row: 2; width: auto; background: transparent; box-shadow: none; }
  .agent-table .cell-main, .agent-table .cell-secondary { max-width: 100% !important; }
  .agent-table .cell-secondary { font-size: 8px; }
  .agent-table .row-actions { justify-content: flex-end; }
  .agent-table .row-actions { gap: 3px; }
  .agent-table .row-actions button { min-height: 26px; padding: 3px 6px; font-size: 9px; color: #174f87; background: #e7f1fb; border-color: #b8cde2; }
  .agent-table .row-actions .danger { color: #9a2734; background: #f9e6e9; border-color: #e5b9c0; }
  .agent-table .empty-row { grid-column: 1 / -1; padding: 12px; position: static; }
  .orchestration-panel { margin-top: 9px; padding-top: 9px; }
  .orchestration-panel .queue-table-scroll { max-height: 180px; }
  .queue-table-scroll { border: 0; overflow: visible; max-height: none !important; }
  .queue-table { display: block; min-width: 0; }
  .queue-table thead { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  .queue-table tbody { display: grid; gap: 6px; }
  .queue-table tr { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 3px 8px; padding: 8px 9px; border: 1px solid #cfdeec; border-radius: 8px; background: #071724; }
  .queue-table td { display: block; min-width: 0; padding: 0; border: 0; background: transparent !important; }
  .queue-table td:nth-child(1) { grid-column: 1; grid-row: 1; }
  .queue-table td:nth-child(2) { grid-column: 2; grid-row: 1; }
  .queue-table td:nth-child(5) { grid-column: 3; grid-row: 1; }
  .queue-table td:nth-child(3), .queue-table td:nth-child(4), .queue-table td:nth-child(6) { grid-column: 2 / -1; }
  .queue-table td:nth-child(3) .cell-main::before { content: 'Repo  '; color: var(--muted); font-weight: 400; }
  .queue-table td:nth-child(4) .cell-main::before { content: 'Model  '; color: var(--muted); font-weight: 400; }
  .queue-table td:nth-child(6) .cell-main::before { content: 'Depends on  '; color: var(--muted); font-weight: 400; }
  .queue-table td:nth-child(7) { grid-column: 1; grid-row: 2 / 5; color: var(--muted); }
  .queue-table .cell-main, .queue-table .cell-secondary { max-width: 100% !important; }
  thead th { background: #edf4fb; }
  tbody tr:hover td { background-color: #eef5fc; }
  th:last-child, td:last-child { background: #fff; box-shadow: -5px 0 8px #45678914; }
  thead th:last-child { background: #edf4fb; }
  .filters { gap: 8px; }
  .filters label { flex: 1 1 135px; }
  .bulk span { flex: 1 0 100%; order: -1; }
  .jobs-panel > .table-scroll { border: 0; max-height: none; overflow: visible; }
  .jobs-table { display: block; min-width: 0; }
  .jobs-table thead { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  .jobs-table tbody { display: grid; gap: 7px; }
  .jobs-table tr { position: relative; display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 4px 8px; padding: 9px 9px 9px 8px; border: 1px solid #cfdeec; border-radius: 8px; background: #071724; }
  .jobs-table td { display: block; min-width: 0; width: auto !important; padding: 0 !important; border: 0; background: transparent !important; box-shadow: none !important; }
  .jobs-table td:nth-child(1) { grid-column: 1; grid-row: 1; }
  .jobs-table td:nth-child(2) { grid-column: 2; grid-row: 1; }
  .jobs-table td:nth-child(3) { grid-column: 3; grid-row: 1; }
  .jobs-table td:nth-child(4), .jobs-table td:nth-child(5), .jobs-table td:nth-child(8) { display: none; }
  .jobs-table td:nth-child(6), .jobs-table td:nth-child(7) { grid-column: 2 / -1; }
  .jobs-table td:nth-child(9) { grid-column: 2 / -1; position: static; }
  .jobs-table .cell-main, .jobs-table .cell-secondary { max-width: 100% !important; }
  .pagination { gap: 8px; justify-content: space-between; flex-wrap: wrap; }
  .detail-grid, .route-grid { grid-template-columns: minmax(0, 1fr); }
  .worker-grid, .agent-detail dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  dialog { background: #fff; color: var(--ink); border-color: #aec6df; }
  dialog::backdrop { background: #17324f66; }
  #login { padding: 16px; background: #fff; }
  button, input, select { color: var(--ink); background: #f3f7fb; border-color: #b9cadc; }
}

/* Keep the premium theme authoritative after the legacy responsive rules. */
body {
  background: radial-gradient(circle at 72% 17%, #329dd622, transparent 30rem), linear-gradient(100deg, #020811f2, #030c18d1 48%, #020810f2), url('/factory-atmosphere.webp') center top / max(100vw, 1440px) auto fixed no-repeat, var(--bg);
}
header { background: linear-gradient(180deg, #020912f5, #030c17dc); border-color: var(--line); }
.panel, #login, .operator-strip button, .view-switcher { background: linear-gradient(145deg, #102739e8, #05111ef5); border-color: var(--line); }
.operator-strip { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.operator-strip button { min-width: 0; text-align: left; }
.view-switcher { position: sticky; top: 55px; z-index: 10; }
#panel-runs:not([hidden]) { display: grid; grid-template-columns: minmax(620px, 1.25fr) minmax(440px, .75fr); gap: 12px; align-items: start; }
#detail { position: sticky; top: 108px; max-height: calc(100vh - 122px); overflow: auto; }
.worker-grid { grid-template-columns: repeat(6, minmax(110px, 1fr)); }

@media (max-width: 1250px) {
  #panel-runs:not([hidden]) { grid-template-columns: minmax(0, 1fr); }
  #detail { position: static; max-height: none; }
}

@media (max-width: 820px) {
  :root { color-scheme: dark; --bg: #020712; --panel: #071521; --line: #89bfe12e; --muted: #91aabd; --ink: #eef8ff; --accent: #55dded; }
  body { color: var(--ink); background: linear-gradient(180deg, #020912d6, #020810f5 42rem), url('/factory-atmosphere.webp') 38% top / auto 620px no-repeat, var(--bg); }
  header { background: #020912ed; border-color: var(--line); }
  .panel, #login { color: var(--ink); background: linear-gradient(145deg, #102739e8, #05111ef5); border-color: var(--line); }
  .operator-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .operator-strip button, button, input, select { color: var(--ink); background: #10283be8; border-color: #8abbd052; }
  .view-switcher { top: 0; display: flex; overflow-x: auto; background: #030e19ed; border-color: var(--line); }
  .view-switcher button { min-width: 96px; color: var(--muted); background: transparent; border-color: transparent; }
  .view-switcher button[aria-selected='true'] { color: var(--ink); background: #16415b; border-color: #5bd7ef61; }
  .run-list-row, .metric, .agent-table tr, .queue-table tr, .jobs-table tr { color: var(--ink); background: #0a1b2be8; border-color: var(--line); }
  .agent-table td:nth-child(1) .cell-main { color: var(--ink); }
  .agent-table .row-actions button { color: var(--ink); background: #10283be8; border-color: #8abbd052; }
  .agent-table .row-actions .danger { color: #ffc1c7; background: #3e2631; border-color: #ff758452; }
  thead th, thead th:last-child, th:last-child, td:last-child { background: #0b1d2d; }
  tbody tr:hover td { background-color: #112b40; }
  dialog { color: var(--ink); background: #071521; border-color: #71cadd66; }
  dialog::backdrop { background: #000b; }
  .worker-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mission-stages, .route-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 390px) {
  .operator-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .worker-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Premium Operations Pass 2: dense orbital command deck. */
:root {
  --bg: #01050c;
  --panel: #07131f;
  --panel-deep: #040c15;
  --line: #82b4ce30;
  --line-strong: #8fcde752;
  --muted: #91a9ba;
  --ink: #edf7fc;
  --accent: #62c9df;
  --good: #55d39b;
  --warn: #e9bd5e;
  --bad: #ef7180;
}

html { background: var(--bg); }
body {
  background:
    linear-gradient(105deg, #01050cf5 0%, #03101bd9 48%, #01050cf3 100%),
    radial-gradient(ellipse at 82% 12%, #d59d4324 0 6%, transparent 25%),
    url('/bh-gold.webp') right -8vw top -12vw / min(52vw, 760px) auto no-repeat fixed,
    url('/factory-atmosphere.webp') center top / cover no-repeat fixed,
    var(--bg);
  font-size: 12px;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(90deg, transparent 49.9%, #9ed3e008 50%, transparent 50.1%), linear-gradient(#9ed3e006 1px, transparent 1px);
  background-size: 100% 100%, 100% 48px;
}
header {
  min-height: 45px;
  padding: 9px 24px;
  background: #020913e8;
  border-color: var(--line-strong);
  box-shadow: 0 14px 34px #0009, inset 0 -1px #b9eafa0a;
}
header span, .section-label { color: #acc5d4; }
main { max-width: 1920px; padding: 10px 20px 24px; }
.heading { margin-bottom: 8px; }
h1 { font-size: 15px; }
button, input, select {
  border-color: #7eacc342;
  background: #0c2130dc;
}
button:hover:enabled { border-color: #85d4e59c; background: #123044; }
#refresh { padding: 5px 10px; background: #0b2637d9; border-color: #78c4d968; }

.operator-strip {
  gap: 5px;
  margin-bottom: 7px;
}
.operator-strip button {
  position: relative;
  min-height: 57px;
  padding: 6px 10px 7px;
  overflow: hidden;
  border-radius: 7px;
  background: linear-gradient(145deg, #0c2232e6, #04101bea);
  box-shadow: inset 0 1px #d7f6ff0c, 0 8px 22px #0005;
}
.operator-strip button::after {
  content: '';
  position: absolute;
  inset: auto 8px 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, #65cadf8f, transparent);
}
.operator-strip button:hover { transform: translateY(-1px); }
.operator-strip span { font-size: 8px; }
.operator-strip strong { margin: 1px 0; font-size: 14px; line-height: 1.2; }
.operator-strip small { color: #718c9f; }

.view-switcher {
  top: 45px;
  gap: 2px;
  padding: 2px;
  border-radius: 7px;
  background: #020b14e8;
  box-shadow: 0 12px 28px #0007;
}
.view-switcher button { min-width: 84px; padding: 5px 11px; font-size: 10px; }
.view-switcher button[aria-selected='true'] {
  background: linear-gradient(180deg, #16425a, #0d2b3d);
  border-color: #6bc8dc69;
  box-shadow: inset 0 1px #c9f6ff16;
}

.panel, #login {
  padding: 11px 13px;
  margin-top: 8px;
  border-radius: 8px;
  background: linear-gradient(145deg, #0b1d2bd9, #030c15ed);
  border-color: var(--line);
  box-shadow: inset 0 1px #e4f7ff0b, 0 12px 32px #0006;
  backdrop-filter: blur(18px) saturate(112%);
}
.panel-heading { margin-bottom: 7px; }
.section-label { margin-bottom: 4px; font-size: 8px; }
.overview-grid { gap: 6px; }
.overview-card { min-height: 86px; margin-top: 7px; padding: 9px 11px; }
.overview-card .section-label { margin-bottom: 8px; }
.summary-line strong { font-size: 12px; }
.summary-line div span { margin-top: 3px; font-size: 9px; }
.current-runs { margin-top: 6px; }
.run-list { gap: 5px; }
.run-list-row { gap: 7px; padding: 6px 8px; background: #071724d9; }
.operator-notice { margin-top: 7px; padding: 7px 10px; }

.status-grid { gap: 5px; }
.metric { padding: 7px 9px; border-radius: 6px; background: #071724d1; }
.metric span { font-size: 8px; }
.metric strong { margin-top: 2px; font-size: 12px; }
.pool-grid .metric, .queue-grid .metric { padding: 6px 8px; background: #091a28d9; }
.pool-grid .metric strong { font-size: 15px; }
.queue-grid .metric strong { font-size: 14px; }
.panel-note, #workspace-note { margin: 6px 0; }
.compact-toggle { margin: 5px 0; }
.history-toggle { margin: 1px 0 7px; padding: 5px 8px; background: #081824cc; }
.filters { gap: 7px; padding-bottom: 7px; }
.filters label { flex-basis: 150px; }
.filters input, .filters select { padding: 5px 8px; }
.run-tools { margin: 6px 0; }
.run-tools summary { padding: 5px 0; }
.bulk { margin: 6px 0; }

.table-scroll { max-height: 460px; border-radius: 6px; background: #030b14a8; }
.agent-table-scroll { max-height: 390px; margin-top: 7px; }
.orchestration-panel .queue-table-scroll { max-height: 390px; }
table { font-size: 10px; }
th { padding: 6px 7px; font-size: 8px; background: #081824ed; }
thead th, thead th:last-child { background: #081824f5; }
td { padding: 6px 7px; }
td:first-child, th:first-child { padding-left: 8px; }
.cell-secondary { margin-top: 1px; font-size: 9px; line-height: 1.3; }
tbody tr:hover td { background-color: #0d2637; }
th:last-child, td:last-child { background: #06121e; box-shadow: -5px 0 9px #0006; }
.row-actions { gap: 3px; }
.row-actions button { padding: 3px 6px; font-size: 9px; }
.badge {
  padding: 2px 6px;
  border: 1px solid #a9c9da26;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 650;
  letter-spacing: .025em;
  background: #172736;
}
.badge.active, .badge.running, .badge.starting, .badge.ready {
  color: #b9f1fb;
  border-color: #62cfdf69;
  background: #0c4250;
  box-shadow: 0 0 12px #42c4d52b;
}
.badge.completed, .badge.online, .badge.done {
  color: #aef0d2;
  border-color: #55d39b59;
  background: #123d33;
}
.badge.interrupted, .badge.waiting, .badge.stopping, .badge.cancelled,
.badge.canceled, .badge.blocked, .badge.staged, .badge.unavailable,
.badge.unconfigured, .badge.unknown-live, .badge.unknown_live {
  color: #f4d58e;
  border-color: #e9bd5e61;
  background: #40351e;
}
.badge.failed, .badge.stopped {
  color: #ffc0c8;
  border-color: #ef718073;
  background: #48232c;
}

#panel-runs:not([hidden]) {
  grid-template-columns: minmax(0, 1fr) minmax(600px, .9fr);
  gap: 8px;
  max-width: 100%;
  overflow: clip;
}
#detail {
  top: 83px;
  max-height: calc(100vh - 94px);
  padding: 10px;
  border-color: #77bfd54a;
  background: linear-gradient(150deg, #0b2232ed, #020a13f5);
  box-shadow: inset 3px 0 #65c7da24, 0 18px 44px #000a;
}
#detail > .panel-heading {
  margin: -10px -10px 9px;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  background: #06131ee0;
}
#detail h3 { margin-top: 10px; }
#detail-status { grid-template-columns: repeat(4, minmax(0, 1fr)); }
#detail-status .metric { padding: 5px 7px; }
.detail-section-heading { margin-top: 9px; }
.mission-stages { gap: 5px; }
.mission-stage {
  position: relative;
  padding: 7px;
  overflow: hidden;
  background: #061521e8;
}
.mission-stage::after { content: ''; position: absolute; inset: auto 0 0; height: 2px; background: #6f87954a; }
.mission-stage:nth-child(1) { background: linear-gradient(145deg, #0a2331e8, #061521e8); }
.mission-stage:nth-child(2) { background: linear-gradient(145deg, #152436e8, #071421e8); }
.mission-stage:nth-child(3) { background: linear-gradient(145deg, #102821e8, #06151ae8); }
.mission-stage[data-state='complete']::after { background: var(--good); }
.mission-stage[data-state='pending']::after { background: var(--warn); }
.mission-stage[data-state='failed']::after { background: var(--bad); }
.mission-stage .stage-number { width: 21px; height: 21px; }
.route-grid { gap: 5px; }
.route-grid .metric { padding: 6px 7px; }
.route-grid pre { margin: 4px 0 0; font-size: 9px; }

.worker-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; }
.worker {
  min-width: 0;
  padding: 6px;
  border-radius: 6px;
  background: linear-gradient(150deg, #081b28e8, #040e17ed);
  box-shadow: inset 0 1px #d9f8ff0a;
}
.worker p { overflow-wrap: anywhere; }
.worker h4 { margin: 0 4px 5px 0; color: #dff7fc; font-size: 11px; }
.worker p { margin: 3px 0; font-size: 8px; line-height: 1.35; color: var(--muted); }
.worker[data-state='running'], .worker[data-state='active'], .worker[data-state='starting'] { border-color: #62cfdf8c; box-shadow: inset 0 2px #62cfdf8c, 0 0 16px #41c3d51b; }
.worker[data-state='completed'] { border-color: #55d39b6b; box-shadow: inset 0 2px #55d39b70; }
.worker[data-state='interrupted'], .worker[data-state='waiting'], .worker[data-state='stopping'], .worker[data-state='cancelled'], .worker[data-state='canceled'] { border-color: #e9bd5e70; box-shadow: inset 0 2px #e9bd5e6b; }
.worker[data-state='failed'], .worker[data-state='stopped'] { border-color: #ef718080; box-shadow: inset 0 2px #ef71807d; }
.detail-tabs { margin-top: 10px; }
.detail-panels > section { min-height: 120px; }
#logs li, #events li { padding: 5px 6px; font-size: 9px; }

.storage-panel summary { font-size: 10px; }
.storage-panel .status-grid { margin-top: 7px; }
.storage-panel .metric { padding: 6px 8px; }
.pagination { margin-top: 7px; }

@media (max-width: 1250px) {
  #panel-runs:not([hidden]) { grid-template-columns: minmax(0, 1fr); }
  #detail { position: static; max-height: none; }
}

@media (max-width: 820px) {
  body {
    background:
      linear-gradient(180deg, #01060de8, #020a13f8 34rem),
      url('/bh-gold.webp') right -150px top -40px / 430px auto no-repeat,
      url('/factory-atmosphere.webp') 38% top / auto 620px no-repeat,
      var(--bg);
  }
  body::before { display: none; }
  header { min-height: 38px; padding: 7px 9px; background: #010710f2; }
  main { padding: 7px; }
  .view-switcher { top: 0; }
  .panel, #login { padding: 9px; background: linear-gradient(145deg, #0b1d2bef, #030c15f7); }
  .operator-strip button { min-height: 50px; }
  .overview-card { min-height: 0; }
  #status .metric, .pool-grid .metric, .queue-grid .metric { color: var(--ink); background: #081a28e8; border-color: var(--line); }
  .agent-table tr, .queue-table tr, .jobs-table tr { background: #071724ed; border-color: var(--line); }
  .agent-table td:nth-child(1) .cell-main { color: var(--ink); }
  .agent-table .row-actions button { color: var(--ink); background: #0c2638; border-color: var(--line-strong); }
  .jobs-table td:nth-child(4), .jobs-table td:nth-child(5), .jobs-table td:nth-child(8) { display: block; grid-column: 2 / -1; }
  .mission-stages { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #detail-status { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .worker-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .worker p { font-size: 9px; }
  dialog, #login { color: var(--ink); background: #06131e; border-color: var(--line-strong); }
}

@media (max-width: 520px) {
  .mission-stages { grid-template-columns: minmax(0, 1fr); }
  .overview-grid { grid-template-columns: minmax(0, 1fr); }
  .run-list { grid-template-columns: minmax(0, 1fr); }
}

/* Final desktop Operations fidelity. The established mobile contract above is unchanged. */


@media (max-width: 390px) {
  .worker-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .operator-strip button:hover { transform: none; }
}

@media (prefers-contrast: more) {
  :root { --line: #b7e4f078; --line-strong: #d0f2faad; --muted: #c0d2dc; }
  body { background-color: #01050c; }
  .panel, #login, .operator-strip button, .view-switcher, .metric, .worker { background: #06131e; backdrop-filter: none; box-shadow: none; }
  .badge { border-width: 2px; }
}

/* Final resilience and narrow-screen parity. */
.operator-strip strong, .operator-strip small {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
}

@media (max-width: 820px) {
  html, body { max-width: 100%; }
  html { overflow-x: clip; }
  body { overflow-x: visible; }
  main, .panel, [role='tabpanel'], .table-scroll { min-width: 0; max-width: 100%; }
  .panel, [role='tabpanel'] { overflow-x: clip; }
  .table-scroll, .jobs-panel > .table-scroll, .agent-table-scroll, .queue-table-scroll {
    overflow-x: auto;
    overscroll-behavior-x: contain;
  }
  .view-switcher { display: flex; overflow-x: auto; scrollbar-width: thin; }
  .view-switcher button {
    flex: 0 0 auto;
    min-width: max-content;
    min-height: 40px;
    padding-inline: 12px;
    overflow: visible;
    text-overflow: clip;
  }
  button, input, select { min-height: 40px; }
  input[type='checkbox'] { width: 20px; height: 20px; min-height: 20px; }
  .row-actions button, .agent-table .row-actions button { min-height: 40px; padding: 6px 9px; }
  .jobs-table td:nth-child(4), .jobs-table td:nth-child(5), .jobs-table td:nth-child(8) {
    display: block;
    grid-column: 2 / -1;
  }
  .jobs-table td:nth-child(4) .cell-main::before { content: 'Route  '; color: var(--muted); font-weight: 400; }
  .jobs-table td:nth-child(4) .cell-secondary::before { content: 'Resource  '; color: var(--muted); font-weight: 400; }
  .jobs-table td:nth-child(5) .cell-main::before { content: 'Actual model  '; color: var(--muted); font-weight: 400; }
  .jobs-table td:nth-child(8) .cell-main::before { content: 'Storage  '; color: var(--muted); font-weight: 400; }
  .jobs-table .cell-main, .jobs-table .cell-secondary {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 390px) {
  .jobs-table tr { grid-template-columns: 20px minmax(0, 1fr); }
  .jobs-table td:nth-child(3), .jobs-table td:nth-child(4), .jobs-table td:nth-child(5),
  .jobs-table td:nth-child(6), .jobs-table td:nth-child(7), .jobs-table td:nth-child(8),
  .jobs-table td:nth-child(9) { grid-column: 2; }
  .jobs-table td:nth-child(3) { grid-row: auto; justify-self: start; }
  .row-actions { flex-wrap: wrap; justify-content: flex-start; }
}

/* Phone operations console contract. Keep this final so legacy theme passes cannot
   expand the live console back into a vertically stacked desktop dashboard. */
@media (max-width: 520px) {
  html { overflow-x: clip; }
  body { overflow-x: visible; font-size: 11px; }
  header {
    min-height: 38px;
    height: 38px;
    padding: 5px 9px;
    gap: 6px;
  }
  header .brand { min-width: 0; font-size: 11px; letter-spacing: .05em; }
  header .brand::after { content: ' OPERATIONS'; font-weight: 650; }
  header a:last-child { font-size: 9px; }
  main { padding: 7px 8px 16px; }
  .heading { min-height: 36px; margin: 0; justify-content: flex-end; }
  .heading h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  #refresh { min-height: 36px; padding: 5px 9px; font-size: 10px; }
  #message:empty { display: none; }

  .operator-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    margin-bottom: 5px;
  }
  .operator-strip button {
    min-height: 42px;
    height: 42px;
    padding: 3px 6px;
    border-radius: 7px;
  }
  .operator-strip span { font-size: 7px; line-height: 1; }
  .operator-strip strong { margin: 2px 0 0; font-size: 12px; line-height: 1.05; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .operator-strip small { display: none; }
  .view-switcher {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    height: 34px;
    padding: 2px;
    overflow: visible;
  }
  .view-switcher button {
    min-width: 0;
    min-height: 28px;
    padding: 3px 1px;
    font-size: 9px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .operator-notice { min-height: 0; max-height: 34px; margin-top: 5px; padding: 5px 8px; overflow: hidden; font-size: 9px; line-height: 1.25; }
  .overview > .panel-heading { margin: 5px 0 0; min-height: 24px; align-items: center; }
  .overview > .panel-heading .section-label, .overview > .panel-heading .quiet-label { display: none; }
  .overview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
  .overview-card {
    min-height: 64px;
    max-height: 70px;
    margin-top: 0;
    padding: 7px 8px;
    overflow: hidden;
    border-radius: 8px;
  }
  .overview-card .section-label { margin-bottom: 4px; font-size: 7px; }
  .overview-card .summary-line { gap: 4px; }
  .overview-card .summary-line strong { font-size: 11px; line-height: 1.15; }
  .overview-card .summary-line div span { margin-top: 2px; font-size: 9px; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .overview-card .badge { padding: 2px 4px; font-size: 7px; }
  .current-runs { margin-top: 5px; padding: 7px 8px; }
  .current-runs .panel-heading { min-height: 30px; margin-bottom: 4px; flex-wrap: nowrap; }
  .current-runs .panel-heading .section-label { display: none; }
  .current-runs .panel-heading button { min-height: 36px; padding: 4px 7px; font-size: 9px; }
  .run-list { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .run-list-row { min-height: 42px; padding: 5px 7px; }

  .panel { padding: 8px; margin-top: 6px; border-radius: 8px; }
  .panel-heading { gap: 5px; margin-bottom: 6px; }
  .history-toggle { min-height: 36px; margin: 0 0 5px; padding: 4px 7px; }
  .filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px 6px;
    padding-bottom: 6px;
  }
  .filters label { min-width: 0; font-size: 9px; }
  .filters input, .filters select, .filters button { width: 100%; min-height: 36px; height: 36px; padding: 4px 7px; font-size: 11px; }
  .run-tools { margin: 4px 0; }
  .run-tools summary { min-height: 32px; padding: 7px 0; }
  .jobs-table tbody, .agent-table tbody, .queue-table tbody { gap: 5px; }
  .jobs-table tr {
    grid-template-columns: 18px minmax(0, 1fr) auto;
    gap: 3px 6px;
    min-height: 110px;
    max-height: 140px;
    padding: 7px;
    overflow: hidden;
  }
  .jobs-table td:nth-child(3) { grid-column: 3; grid-row: 1; }
  .jobs-table td:nth-child(4), .jobs-table td:nth-child(5), .jobs-table td:nth-child(8) { display: block; grid-column: 2 / -1; }
  .jobs-table td:nth-child(6), .jobs-table td:nth-child(7) { grid-column: 2 / -1; }
  .jobs-table td:nth-child(9) { position: absolute; right: 6px; bottom: 6px; }
  .jobs-table .cell-main, .jobs-table .cell-secondary { font-size: 9px; line-height: 1.2; }
  .jobs-table td:nth-child(2) .cell-secondary { display: none; }
  .jobs-table .row-actions button { min-height: 36px; }

  .agent-table tr { grid-template-columns: minmax(0, 1fr) auto; gap: 3px 6px; padding: 7px; }
  .agent-table td:nth-child(1) { grid-column: 1; }
  .agent-table td:nth-child(5) { grid-column: 2; }
  .agent-table td:nth-child(2), .agent-table td:nth-child(3), .agent-table td:nth-child(4),
  .agent-table td:nth-child(6), .agent-table td:nth-child(7) { display: block; grid-column: 1; grid-row: auto; }
  .agent-table td:nth-child(6) .cell-main::before { content: 'Elapsed '; color: var(--muted); font-weight: 400; }
  .agent-table td:nth-child(7) .cell-main::before { content: 'Lease '; color: var(--muted); font-weight: 400; }
  .agent-table td:nth-child(8) { grid-column: 2; grid-row: 2 / 7; align-self: end; }
  .agent-table .row-actions button { min-height: 36px; }
  .queue-table tr { gap: 2px 6px; padding: 7px 8px; border-radius: 8px; }
  .queue-table td:nth-child(3), .queue-table td:nth-child(4) { display: none; }
}

/* Only these new ornaments are hidden in the established mobile composition. */
.operations-symbols, .desktop-only, .ops-icon, .factory-light { display: none; }
.desktop-command-row, .panel-title { display: contents; }
.panel-heading h2 .mobile-copy { color: inherit; font-weight: inherit; letter-spacing: inherit; }

/* Approved Execution Queue composition. All visual changes are desktop-only. */
@media (min-width: 821px) {
  :root {
    color-scheme: light;
    --bg: #ecf1f6;
    --panel: #ffffff;
    --soft: #f4f8fb;
    --table-head: #edf3f8;
    --line: #c2d1dd;
    --line-strong: #9db8ca;
    --ink: #1c3349;
    --muted: #5c768d;
    --accent: #1684bb;
    --good: #139561;
    --warn: #a76c00;
    --bad: #ce3f51;
    --good-bg: #e5f6ed;
    --warn-bg: #fff4d5;
    --bad-bg: #fff0f1;
    --accent-bg: #e6f3fc;
    --selected: #eaf5fc;
    --shadow: 0 8px 26px #233c5510;
  }
  :root[data-operations-theme='dark'] {
    color-scheme: dark;
    --bg: #030b14;
    --panel: #071522;
    --soft: #0b2030;
    --table-head: #0d2232;
    --line: #254356;
    --line-strong: #355f79;
    --ink: #e5f2ff;
    --muted: #91b3ce;
    --accent: #35b6f2;
    --good: #2bd38b;
    --warn: #efc34d;
    --bad: #fa6576;
    --good-bg: #0d372c;
    --warn-bg: #3b3015;
    --bad-bg: #351921;
    --accent-bg: #102e44;
    --selected: #0c2a3e;
    --shadow: 0 10px 28px #0003;
  }
  html { background: var(--bg); }
  body { background: linear-gradient(135deg, #f4f7fa, #e8eef4); color: var(--ink); font-size: 13px; }
  :root[data-operations-theme='dark'] body { background: linear-gradient(135deg, #071420, #020810); }
  body::before { display: none; }
  .desktop-only { display: block; }
  .mobile-copy, .mobile-operator-strip { display: none; }
  .ops-icon { display: block; width: 24px; height: 24px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; color: var(--accent); }
  a { color: var(--accent); }
  a:hover { color: var(--ink); }
  header { height: 50px; min-height: 50px; padding: 0 26px; gap: 15px; background: var(--panel); color: var(--ink); border-bottom: 1px solid var(--line); box-shadow: 0 2px 10px #233c5506; backdrop-filter: none; }
  .brand { font-size: 17px; letter-spacing: .05em; color: var(--ink); }
  .brand strong { color: var(--accent); }
  header .header-page { padding-left: 15px; margin-right: auto; border-left: 1px solid var(--line-strong); color: var(--muted); font-size: 14px; font-weight: 400; letter-spacing: 0; }
  header .owner-label { position: absolute; left: 50%; transform: translateX(-50%); color: var(--muted); font-size: 11px; letter-spacing: .13em; }
  .header-actions { display: flex; align-items: center; gap: 17px; margin-left: auto; }
  .header-actions a { display: flex; align-items: center; gap: 8px; font-size: 12px; }
  .admin-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
  #theme-toggle { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border-radius: 50%; font-size: 16px; }
  main { position: relative; width: min(calc(100% - 64px), 1540px); max-width: 1540px; margin: auto; padding: 14px 0 28px; }
  .heading { position: absolute; top: 57px; right: 0; min-height: 0; margin: 0; }
  .heading h1 { display: none; }
  #message:empty { display: none; }
  #message:not(:empty) { margin: 0 0 12px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--soft); color: var(--ink); }
  button, input, select { color: var(--ink); background: var(--panel); border: 1px solid var(--line-strong); border-radius: 5px; font-size: 12px; }
  button:hover:enabled { color: var(--ink); background: var(--accent-bg); border-color: var(--accent); }
  button:disabled { opacity: .5; cursor: not-allowed; }
  #refresh { padding: 3px 9px; font-size: 10px; background: var(--soft); border-color: var(--line); color: var(--muted); }
  input[type='checkbox'] { width: 14px; height: 14px; min-height: 14px; margin: 0; accent-color: var(--accent); }
  .desktop-command-row { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(0, 940px) minmax(130px, 1fr); align-items: start; gap: 22px; height: 82px; margin-bottom: 16px; }
  .desktop-intro { padding-top: 7px; }
  .desktop-intro strong { font-size: 14px; font-weight: 600; }
  .desktop-intro p { margin: 3px 0 0; font-size: 12px; line-height: 1.5; }
  .desktop-clock { padding-top: 8px; text-align: right; color: var(--muted); font-size: 11px; }
  .desktop-clock span { display: block; }
  .desktop-operator-strip { display: grid; grid-template-columns: .86fr 1.16fr 1.4fr 1fr .85fr; gap: 0; height: 82px; padding: 9px 6px; margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 9px; box-shadow: 0 3px 12px #243c5510; backdrop-filter: none; }
  .desktop-operator-strip button { display: grid; grid-template-columns: 30px minmax(0, 1fr); grid-template-rows: auto auto auto; align-content: center; column-gap: 11px; min-height: 0; padding: 1px 17px; background: transparent; border: 0; border-right: 1px solid var(--line); border-radius: 0; box-shadow: none; transform: none; backdrop-filter: none; }
  .desktop-operator-strip button:last-child { border-right: 0; }
  .desktop-operator-strip button::after { display: none; }
  .desktop-operator-strip button:hover:enabled { background: var(--soft); transform: none; }
  .desktop-operator-strip .ops-icon, .factory-light { grid-column: 1; grid-row: 1 / 4; align-self: center; width: 27px; height: 27px; }
  .factory-light { display: block; width: 22px; height: 22px; margin: auto; border-radius: 50%; background: #96a7b4; }
  [data-state='online'] .factory-light { background: #0ccc72; box-shadow: 0 0 14px #0ccc723d; }
  [data-state='failed'] .factory-light { background: var(--bad); }
  .desktop-operator-strip button:last-child .ops-icon { color: var(--bad); }
  .desktop-operator-strip button[data-state='online']:last-child .ops-icon { color: var(--good); }
  .desktop-operator-strip button[data-state='unavailable'] .ops-icon { color: var(--muted); }
  .desktop-operator-strip span, .desktop-operator-strip strong, .desktop-operator-strip small { grid-column: 2; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .desktop-operator-strip span { color: var(--muted); font-size: 10px; font-weight: 400; letter-spacing: .02em; text-transform: none; }
  .desktop-operator-strip strong { margin: 1px 0; color: var(--ink); font-size: 13px; line-height: 1.35; font-weight: 700; }
  .desktop-operator-strip small { color: var(--muted); font-size: 10px; line-height: 1.4; }
  .view-switcher { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: static; gap: 5px; padding: 0; margin: 0 18px; border: 0; border-radius: 0; background: none; box-shadow: none; backdrop-filter: none; overflow: visible; }
  .view-switcher button { display: flex; align-items: center; gap: 11px; min-width: 0; min-height: 55px; padding: 10px 16px; font-size: 13px; font-weight: 600; color: var(--muted); text-align: left; background: var(--soft); border: 1px solid var(--line); border-radius: 9px 9px 0 0; box-shadow: none; }
  .view-switcher button .ops-icon { width: 23px; height: 23px; }
  .view-switcher button[aria-selected='true'] { color: var(--ink); background: linear-gradient(180deg, var(--accent-bg), var(--panel)); border-color: var(--accent); border-bottom-color: var(--panel); box-shadow: inset 0 2px 0 color-mix(in srgb, var(--accent) 30%, transparent); }
  .tab-counts { display: contents; }
  .tab-alerts { display: inline-flex; gap: 8px; margin-left: 6px; }
  .tab-count { display: inline-grid; place-items: center; min-width: 25px; height: 25px; padding: 0 7px; font-size: 12px; font-weight: 650; font-style: normal; line-height: 1; border: 1px solid #0000000a; border-radius: 10px; box-shadow: inset 0 1px 0 #ffffff30; }
  .tab-count.bad { background: #dc4555; color: #fff; }
  .tab-count.warn { background: #f3c64d; color: #4b3600; }
  .tab-count.good { margin-left: auto; background: #139a65; color: #fff; }
  .tab-count.unknown { color: var(--muted); background: var(--table-head); border-color: var(--line); box-shadow: none; }
  .view-panel { min-width: 0; }
  .panel, #login { width: 100%; max-width: none; min-width: 0; margin: -1px 0 0; padding: 19px; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 13px; box-shadow: var(--shadow); backdrop-filter: none; }
  #login { max-width: 440px; margin: 15px auto; }
  #workspace-panel, #orchestration-panel, #panel-runs > .jobs-panel, #panel-diagnostics > .diagnostics-panel, #panel-diagnostics > .storage-panel { width: 100%; max-width: none; margin-left: 0; margin-right: 0; }
  h2, .panel-heading h2 span { margin: 0; color: var(--ink); font-size: 22px; font-weight: 650; line-height: 1.3; letter-spacing: -.015em; }
  .panel-heading h2 .mobile-copy { display: none; }
  .panel-heading h2 .desktop-only { display: inline; }
  .panel-heading { align-items: center; min-height: 65px; margin-bottom: 14px; gap: 16px; }
  .panel-title { display: flex; align-items: center; gap: 16px; min-width: 0; }
  .title-icon { width: 51px; height: 51px; padding: 13px; border: 1px solid var(--line); border-radius: 50%; background: var(--soft); }
  .section-label { display: block; margin: 0 0 3px; color: var(--muted); font-size: 10px; font-weight: 650; letter-spacing: .12em; }
  .section-label .desktop-only { display: inline; }
  .panel-description { margin: 3px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
  .panel-note, #updated, .quiet-label { color: var(--muted); font-size: 11px; }
  #panel-overview > .panel-heading, .overview-grid { display: none; }
  .operator-notice { padding: 8px 12px; margin: 0 0 10px; background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 30%, var(--line)); color: var(--warn); font-size: 12px; }
  .current-runs { width: 100%; margin-top: -1px; }
  #overview-runs { display: none; }
  .queue-heading { gap: 18px; }
  .queue-heading #queue-badge { display: none; }
  .queue-controls { display: flex; align-items: center; gap: 10px; margin-left: auto; }
  .queue-controls input, .queue-controls select, .queue-controls button { height: 36px; font-size: 11px; }
  .queue-controls select { width: 108px; padding: 6px 9px; background: var(--soft); }
  .queue-search { position: relative; display: block; width: 218px; }
  .queue-search .ops-icon { position: absolute; left: 10px; top: 10px; width: 16px; height: 16px; color: var(--muted); }
  .queue-search input { width: 100%; padding: 6px 9px 6px 34px; background: var(--soft); }
  input::placeholder { color: var(--muted); opacity: 1; }
  .queue-cleanup { position: relative; }
  .queue-cleanup button { display: flex; align-items: center; gap: 8px; width: 158px; justify-content: center; padding: 6px 8px; }
  .queue-cleanup .ops-icon { width: 16px; height: 16px; color: inherit; }
  .queue-cleanup small { position: absolute; top: 39px; left: 0; width: 100%; color: var(--muted); font-size: 9px; text-align: center; }
  .queue-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); width: 100%; gap: 10px; margin: 14px 0 16px; padding: 0; border: 0; overflow: visible; }
  .queue-grid .metric { display: grid; grid-template-columns: 35px minmax(0, 1fr); grid-template-rows: auto auto auto; align-content: center; column-gap: 12px; min-height: 78px; padding: 10px 14px; background: var(--soft); border: 1px solid var(--line); border-radius: 7px; }
  .queue-grid .metric .ops-icon { grid-column: 1; grid-row: 1 / 4; align-self: center; width: 29px; height: 29px; }
  .queue-grid .metric span, .queue-grid .metric strong, .queue-grid .metric small { grid-column: 2; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .queue-grid .metric span { font-size: 10px; text-transform: none; letter-spacing: .02em; color: var(--muted); }
  .queue-grid .metric strong { margin: 1px 0; font-size: 16px; line-height: 1.3; color: var(--ink); }
  .queue-grid .metric small { font-size: 10px; color: var(--muted); }
  .queue-grid [data-metric='ready'] .ops-icon { color: var(--good); fill: currentColor; }
  .queue-grid [data-metric='blocked'] .ops-icon { color: var(--bad); fill: var(--bad-bg); }
  .queue-grid .metric.is-unavailable .ops-icon { color: var(--muted); fill: none; }
  .queue-grid .metric.is-unavailable strong { font-size: 12px; }
  #queue-note { display: none; }
  #orchestration-panel[data-available='false'] #queue-note { display: block; margin: 4px 0 14px; }
  .pool-grid { display: flex; gap: 0; width: fit-content; margin: 8px 0 14px; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
  .pool-grid .metric { min-width: 105px; padding: 7px 13px; background: var(--soft); border: 0; border-right: 1px solid var(--line); border-radius: 0; }
  .pool-grid .metric:last-child { border-right: 0; }
  .pool-grid .metric span { font-size: 10px; }
  .pool-grid .metric strong { margin: 2px 0 0; font-size: 17px; }
  .pool-grid [data-metric='starting'], .pool-grid [data-metric='stopping'], .pool-grid [data-metric='writers'], .pool-grid [data-metric='repo-leases'] { display: none; }
  .canonical-lanes { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin: 0 0 12px; color: var(--muted); font-size: 11px; }
  .canonical-lanes span:not(:first-child) { padding: 4px 9px; border: 1px solid var(--line); border-radius: 5px; background: var(--soft); }
  .canonical-lanes b { margin-right: 3px; color: var(--accent); font-weight: 650; }
  .table-scroll, .agent-table-scroll, .orchestration-panel .queue-table-scroll, .jobs-panel > .table-scroll { max-width: 100%; max-height: none; min-width: 0; overflow-x: auto; margin-top: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 7px; }
  table, .queue-table, .agent-table, .jobs-table { display: table; width: 100%; min-width: 0; table-layout: fixed; font-size: 12px; }
  th, td, td:first-child, th:first-child { padding: 7px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; overflow: hidden; }
  th, thead th, thead th:last-child { position: static; height: 30px; color: var(--muted); background: var(--table-head); font-size: 10px; font-weight: 700; letter-spacing: .055em; text-transform: uppercase; }
  td { height: 39px; color: var(--ink); }
  th:last-child, td:last-child { position: static; width: auto; background: transparent; box-shadow: none; z-index: auto; }
  thead th:last-child { background: var(--table-head); }
  tbody tr:hover td { background: var(--soft); }
  tbody tr.is-selected td { background: var(--selected); }
  .cell-main, .cell-secondary { max-width: 100% !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cell-main { color: var(--ink); font-weight: 400; line-height: 1.3; }
  .cell-secondary { color: var(--muted); margin-top: 1px; font-size: 10.5px; line-height: 1.2; }
  .queue-table .queue-model-column { display: none; }
  .queue-table td { padding-top: 5px; padding-bottom: 5px; }
  .queue-table td:first-child, .queue-table th:first-child { position: relative; width: 110px; padding-left: 49px; padding-right: 6px; }
  .queue-table td:nth-child(3), .queue-table th:nth-child(3) { width: 21%; }
  .queue-table td:nth-child(5), .queue-table th:nth-child(5) { width: 9%; }
  .queue-table td:nth-child(6), .queue-table th:nth-child(6) { width: 13%; }
  .queue-table td:nth-child(7), .queue-table th:nth-child(7) { width: 14%; }
  .queue-table td:last-child, .queue-table th:last-child { width: 210px; text-align: left; }
  .queue-table td:nth-child(2) .cell-main { font-weight: 600; }
  .queue-table .queue-select, #queue-select-page { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); }
  .priority-tag { display: inline-block; width: 42px; padding: 3px 3px; border: 1px solid var(--line-strong); border-radius: 4px; color: var(--muted); background: var(--soft); font-size: 10px; font-weight: 650; line-height: 1; text-align: center; }
  .priority-tag[data-tone='bad'] { color: var(--bad); background: var(--bad-bg); border-color: color-mix(in srgb, var(--bad) 50%, transparent); }
  .priority-tag[data-tone='warn'] { color: var(--warn); background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 50%, transparent); }
  .priority-tag[data-tone='accent'] { color: var(--accent); background: var(--accent-bg); border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
  .queue-table td[data-stale] .cell-main { display: inline; font-size: 11px; }
  .queue-table td[data-stale] .ops-icon { display: inline-block; vertical-align: -3px; width: 15px; height: 15px; margin-right: 7px; color: var(--muted); }
  .queue-table td[data-stale='true'] .cell-main, .queue-table td[data-stale='true'] .ops-icon, .stale-label { color: var(--bad); font-weight: 650; }
  .stale-label { margin-left: 8px; font-size: 10px; }
  .is-stale { color: var(--bad); }
  .row-actions { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; }
  .row-actions button { height: 27px; min-height: 27px; padding: 3px 8px; font-size: 11px; }
  .queue-unsupported { display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
  .queue-unsupported .ops-icon { width: 13px; height: 13px; color: inherit; }
  .queue-unsupported:first-child .ops-icon { fill: currentColor; }
  .queue-more { min-width: 30px; color: var(--muted); background: var(--soft); }
  .danger { color: var(--bad); background: var(--bad-bg); border-color: color-mix(in srgb, var(--bad) 50%, transparent); }
  .badge { display: inline-block; padding: 3px 8px; font-size: 10px; font-weight: 650; line-height: 1.2; letter-spacing: 0; color: var(--muted); background: var(--soft); border: 1px solid var(--line); border-radius: 999px; }
  .badge.active, .badge.running, .badge.starting, .badge.ready { color: var(--accent); background: var(--accent-bg); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
  .badge.online, .badge.completed, .badge.done { color: var(--good); background: var(--good-bg); border-color: color-mix(in srgb, var(--good) 40%, transparent); }
  .badge.failed, .badge.blocked { color: var(--bad); background: var(--bad-bg); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
  .badge.staged, .badge.cancelled, .badge.stopping, .badge.stopped { color: var(--warn); background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
  .badge.unavailable, .badge.unknown-live, .badge.unknown_live, .badge.unconfigured { color: var(--muted); background: var(--table-head); border-color: var(--line); }
  .queue-footer { display: flex; align-items: center; gap: 16px; min-height: 36px; margin-top: 13px; color: var(--muted); font-size: 11px; }
  #queue-selection-status { font-size: 10px; }
  .queue-pagination, #queue-pages { display: flex; align-items: center; gap: 8px; }
  .queue-pagination { margin-left: auto; }
  .queue-pagination button { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; background: var(--soft); border-color: transparent; }
  .queue-pagination [aria-current='page'] { border-color: var(--accent); color: var(--accent); background: var(--accent-bg); }
  .queue-pagination > button { font-size: 19px; }
  .empty-row { height: 95px; padding: 24px !important; color: var(--muted); }
  .agent-table th:nth-child(1) { width: 17%; }
  .agent-table th:nth-child(2) { width: 12%; }
  .agent-table th:nth-child(3) { width: 19%; }
  .agent-table th:nth-child(4) { width: 14%; }
  .agent-table th:nth-child(5) { width: 9%; }
  .agent-table th:nth-child(6) { width: 12%; }
  .agent-table th:nth-child(7) { width: 6%; }
  .agent-table th:last-child { width: 130px; }
  .agent-table td, .activity-table td, .jobs-table td { height: 48px; }
  .agent-detail { background: var(--soft); border-color: var(--line); }
  .activity-table th:first-child { width: 100px; }
  .activity-table th:nth-child(2) { width: 28%; }
  .activity-table th:nth-child(3) { width: 21%; }
  .activity-table th:nth-child(4) { width: 19%; }
  .activity-table th:nth-child(5) { width: 17%; }
  .activity-table th:last-child { width: 70px; }
  #panel-runs:not([hidden]) { display: block; }
  #detail { position: static; width: 100%; max-height: none; margin: 14px 0 0; overflow: visible; }
  #factory-jobs-title #job-count { font-size: 14px; font-weight: 400; color: var(--muted); }
  .history-toggle { display: inline-flex; margin: 0 14px 8px 0; padding: 0; border: 0; background: none; }
  .filters { display: inline-flex; flex-wrap: wrap; gap: 8px; padding: 8px 0; border: 0; border-radius: 0; background: none; }
  .filters label { flex: 0 1 160px; color: var(--muted); font-size: 10px; }
  .filters input, .filters select { height: 32px; padding: 5px 9px; font-size: 12px; background: var(--soft); }
  .filters button { height: 32px; padding: 5px 10px; }
  .run-tools { margin: 4px 0 10px; border-color: var(--line); }
  .run-tools summary { padding: 6px 0; color: var(--muted); font-size: 11px; }
  .bulk span { color: var(--muted); }
  .jobs-table th:first-child, .jobs-table td:first-child { width: 32px; padding: 7px 8px; }
  .jobs-table th:nth-child(2) { width: 20%; }
  .jobs-table th:nth-child(3) { width: 11%; }
  .jobs-table th:nth-child(4) { width: 18%; }
  .jobs-table th:nth-child(5) { width: 13%; }
  .jobs-table th:nth-child(6) { width: 13%; }
  .jobs-table th:nth-child(7) { width: 13%; }
  .jobs-table th:nth-child(8) { width: 6%; }
  .jobs-table th:last-child { width: 115px; }
  .jobs-table th, .jobs-table td { padding-left: 8px; padding-right: 8px; }
  .metric, #status .metric, .worker, .mission-stage, .detail-tabs { color: var(--ink); background: var(--soft); border-color: var(--line); }
  .metric span { color: var(--muted); }
  .detail-tabs button[aria-selected='true'] { color: var(--ink); background: var(--accent-bg); border-color: var(--accent); }
  .route-grid pre, #gates { background: var(--soft); color: var(--ink); }
  .diagnostics-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .diagnostics-grid [data-metric='factory-host'], .diagnostics-grid [data-metric='active-runs'], .diagnostics-grid [data-metric='queued-runs'], .diagnostics-grid [data-metric='failed-historical-runs'], .diagnostics-grid [data-metric='actual-served-model'], .diagnostics-grid [data-metric='gpu-model'], .diagnostics-grid [data-metric='selected-compute'], .diagnostics-grid [data-metric='stored-run-data'] { display: none; }
  .diagnostics-grid .metric { padding: 13px 15px; border-radius: 7px; }
  .diagnostics-grid .metric span { font-size: 10px; }
  .diagnostics-grid .metric strong { font-size: 14px; }
  .storage-panel { margin-top: 14px !important; padding: 12px 16px; box-shadow: none; }
  .storage-panel summary { color: var(--muted); font-size: 12px; letter-spacing: 0; }
  dialog { background: var(--panel); color: var(--ink); border-color: var(--line-strong); box-shadow: var(--shadow); }
  dialog h2 { font-size: 18px; }
  dialog::backdrop { background: #102a4766; }
  @media (max-width: 1600px) {
    .orchestration-panel .panel-heading { min-height: 60px; margin-bottom: 12px; }
    .queue-grid { margin: 12px 0 14px; }
    .queue-grid .metric { min-height: 74px; }
    .queue-table td { padding-top: 4px; padding-bottom: 4px; }
    .queue-footer { min-height: 32px; margin-top: 11px; }
  }
  @media (max-width: 1250px) {
    .queue-heading { flex-wrap: wrap; }
    .queue-controls { margin-left: auto; margin-top: 2px; }
    .view-switcher button { gap: 7px; padding: 10px; font-size: 12px; }
    .tab-alerts { gap: 4px; margin-left: 2px; }
    .tab-count { min-width: 22px; height: 22px; font-size: 11px; }
    .desktop-operator-strip button { padding: 1px 9px; column-gap: 8px; }
  }
  @media (max-width: 1100px) {
    main { width: calc(100% - 32px); padding-top: 42px; }
    .desktop-command-row { grid-template-columns: minmax(0, 1fr); }
    .desktop-intro, .desktop-clock { display: none; }
    .heading { top: 10px; }
    .owner-label { display: none; }
    .queue-grid .metric { padding: 9px; grid-template-columns: 25px minmax(0, 1fr); gap: 8px; }
    .queue-grid .metric .ops-icon { width: 24px; height: 24px; }
    .queue-table td:last-child, .queue-table th:last-child { width: 195px; }
    .queue-table th, .queue-table td { padding-left: 8px; padding-right: 8px; }
    .stale-label { display: none; }
  }
}

/* Compact pool inventory. Staged inspection is separate from observed workers. */
.pool-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; margin: 8px 0; }
.pool-tabs button { min-width: 0; white-space: normal; padding: 8px; font-size: 11px; }
.pool-tabs button[aria-selected='true'] { color: var(--ink); border-color: var(--accent); background: var(--accent-bg, var(--soft)); box-shadow: inset 0 -2px var(--accent); }
.pool-inventory, .pool-status-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.pool-inventory { margin-left: auto; color: var(--muted); font-size: 11px; }
.pool-inventory strong { color: var(--ink); margin-right: 4px; }
.pool-status-panel { padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--soft); }
.pool-status-line { font-size: 11px; }
.pool-status-panel p { margin: 4px 0 0; font-size: 10px; line-height: 1.4; color: var(--muted); }
.workers-heading { margin-top: 12px; }
.workers-heading h3 { margin: 0; font-size: 16px; }
.workers-source { font-size: 10px; color: var(--muted); }
.workspace-observation { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 12px; margin: 5px 0; }
.workspace-observation #workspace-note { margin: 0; }
.agent-placeholder td { color: var(--muted); font-size: 10px; }
.agent-placeholder .placeholder-label { font-size: 10px; font-weight: 500; }
.run-secondary-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-bottom: 8px; }
.run-secondary-controls #updated { margin-left: auto; order: 2; }
@media (min-width: 821px) {
  .workspace-panel > .pool-heading { min-height: 42px; margin: 0 0 8px; }
  .pool-heading .title-icon { width: 38px; height: 38px; padding: 9px; }
  .pool-heading h2 { font-size: 20px; }
  .workers-heading { min-height: 40px; margin-bottom: 4px; gap: 10px; }
  .workers-heading .pool-grid { margin: 0 0 0 auto; max-width: 72%; overflow: visible; }
  .workers-heading .pool-grid .metric { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 6px 10px; }
  .workers-heading .pool-grid .metric strong { margin: 0; font-size: 15px; }
  .workers-heading .pool-grid [data-metric='starting'], .workers-heading .pool-grid [data-metric='stopping'], .workers-heading .pool-grid [data-metric='writers'], .workers-heading .pool-grid [data-metric='repo-leases'] { display: none; }
  .canonical-lanes { margin: 6px 0; gap: 5px; }
  .canonical-lanes span:not(:first-child) { padding: 2px 7px; }
  .workspace-panel .compact-toggle { margin: 5px 0; }
  .agent-table td { height: 37px; padding-top: 5px; padding-bottom: 5px; }
  .agent-table .agent-placeholder td { height: 37px; }
  .queue-grid { margin: 9px 0 12px; }
  .queue-grid .metric { grid-template-columns: 27px minmax(0, 1fr) auto; grid-template-rows: auto auto; min-height: 50px; padding: 7px 11px; column-gap: 10px; row-gap: 0; }
  .queue-grid .metric .ops-icon { grid-column: 1; grid-row: 1 / 3; width: 25px; height: 25px; }
  .queue-grid .metric span { grid-column: 2; grid-row: 1; }
  .queue-grid .metric small { grid-column: 2; grid-row: 2; }
  .queue-grid .metric strong { grid-column: 3; grid-row: 1 / 3; align-self: center; margin: 0; font-size: 16px; }
  .queue-grid .queue-oldest strong { font-size: 13px; }
  .runs-heading { display: flex; flex-wrap: nowrap; gap: 18px; align-items: center; }
  .runs-heading .filters { display: flex; flex-wrap: nowrap; align-items: end; gap: 8px; margin: 0 0 0 auto; padding: 0; border: 0; min-width: 0; }
  .runs-heading .filters label { width: 132px; min-width: 0; }
  .runs-heading .filters input, .runs-heading .filters select { width: 100%; min-width: 0; }
  .runs-heading .filters button { white-space: nowrap; margin: 0; }
  .runs-heading .panel-description { margin-bottom: 0; }
  .run-secondary-controls .history-toggle { margin: 0; }
  .run-tools { margin-top: 0; }
}
@media (min-width: 821px) and (max-width: 1400px) {
  .workspace-panel { padding: 14px; }
  .workers-heading .pool-grid .metric { padding: 6px 8px; gap: 5px; }
  .runs-heading .filters label { width: 112px; }
  .runs-heading .panel-title { gap: 10px; }
  .runs-heading .title-icon { width: 40px; height: 40px; padding: 9px; }
  .runs-heading h2, .runs-heading h2 span { font-size: 19px; }
  .runs-heading .panel-description { font-size: 10px; }
}
@media (min-width: 821px) and (max-width: 1100px) {
  .workers-heading { flex-wrap: wrap; }
  .workers-heading .pool-grid { max-width: 100%; }
  .runs-heading { flex-wrap: wrap; }
  .runs-heading .filters { flex-wrap: wrap; }
}
@media (max-width: 820px) {
  .pool-heading, .workers-heading { flex-wrap: wrap; }
  .pool-inventory { margin-left: 0; gap: 5px 10px; font-size: 9px; }
  .pool-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pool-tabs button { min-height: 36px; font-size: 10px; padding: 6px; }
  .pool-status-line { gap: 6px 10px; font-size: 10px; }
  .workers-heading .pool-grid { width: 100%; margin: 5px 0; }
  .workers-heading h3 { font-size: 13px; }
  .workers-source { font-size: 9px; }
  .runs-heading .filters { width: 100%; }
  .run-secondary-controls { font-size: 9px; }
  .agent-placeholder td { white-space: normal; overflow-wrap: anywhere; }
}
@media (min-width: 821px) and (max-height: 850px) {
  main { padding-top: 8px; }
  .desktop-command-row { height: 64px; margin-bottom: 10px; }
  .desktop-operator-strip { height: 64px; padding-top: 5px; padding-bottom: 5px; }
  .heading { top: 42px; }
  .view-switcher button { min-height: 42px; padding-top: 7px; padding-bottom: 7px; }
  .workspace-panel { padding: 12px; }
  .workspace-panel > .pool-heading { min-height: 34px; margin-bottom: 5px; }
  .pool-heading .title-icon { width: 32px; height: 32px; padding: 7px; }
  .pool-heading h2 { font-size: 18px; }
  .pool-tabs { margin: 5px 0; }
  .pool-tabs button { padding-top: 6px; padding-bottom: 6px; }
  .pool-status-panel { padding-top: 6px; padding-bottom: 6px; }
  .workers-heading { margin-top: 8px; min-height: 34px; }
  .workspace-observation { margin: 4px 0; }
  .agent-table td, .agent-table .agent-placeholder td { height: 34px; padding-top: 4px; padding-bottom: 4px; }
}
@media (max-width: 820px) {
  .agent-table .agent-placeholder { grid-template-columns: minmax(0, 1fr); }
  .agent-table .agent-placeholder td { grid-column: 1 / -1; grid-row: auto; }
}

/* Verified short-desktop tagline and narrow numeric-KPI polish. */
@media (min-width: 821px) and (max-height: 850px) {
  .desktop-intro { padding-top: 2px; }
  .desktop-intro strong { display: block; font-size: 12px; line-height: 16px; }
  .desktop-intro p { margin: 2px 0 0; font-size: 11px; line-height: 14px; }
}
@media (max-width: 820px) {
  .workers-heading .pool-grid .metric strong { flex: 0 0 auto; white-space: nowrap; }
}


/* Existing owner discard-wave control; wraps instead of squeezing queue filters. */
@media (min-width: 821px) {
  .queue-controls { flex-wrap: wrap; justify-content: flex-end; }
  .queue-pending-cleanup { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; max-width: 100%; }
  .queue-pending-cleanup label { color: var(--muted); font-size: 10px; }
  .queue-pending-cleanup select { width: 130px; }
  .queue-pending-cleanup button { width: auto; white-space: nowrap; }
}


/* Owner-supplied Factory wallpapers; visual-only, no layout or behavior changes. */
:root { --operations-wallpaper: url('/operations-dark.png'); --operations-glass: #071522ed; --operations-glass-soft: #0b2030ed; }
@media (min-width: 821px) {
  :root { --operations-wallpaper: url('/operations-light.png'); --operations-glass: #ffffffeb; --operations-glass-soft: #f2f7fbe8; }
  :root[data-operations-theme='dark'] { --operations-wallpaper: url('/operations-dark.png'); --operations-glass: #071522eb; --operations-glass-soft: #0b2030e8; }
}
body, :root[data-operations-theme='dark'] body {
  background: var(--operations-wallpaper) center center / cover fixed no-repeat, var(--bg);
}
body::before { display: none; }
.panel, #login, .desktop-operator-strip, .view-switcher button, .metric, .worker, .run-list-row,
:root[data-operations-theme='dark'] .panel, :root[data-operations-theme='dark'] .desktop-operator-strip {
  background: var(--operations-glass);
  backdrop-filter: blur(10px) saturate(105%);
  -webkit-backdrop-filter: blur(10px) saturate(105%);
}
.pool-status-panel, .agent-detail, .queue-grid .metric, .route-grid .metric,
.table-scroll, .jobs-panel > .table-scroll { background: var(--operations-glass-soft); }
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .panel, #login, .desktop-operator-strip, .view-switcher button, .metric, .worker, .run-list-row,
  .pool-status-panel, .agent-detail, .queue-grid .metric, .route-grid .metric,
  .table-scroll, .jobs-panel > .table-scroll { background: var(--panel); backdrop-filter: none; -webkit-backdrop-filter: none; }
}

/* Nested Queue sources retain the existing panel and stacked-row language. */
.queue-subtabs { display: flex; gap: .5rem; margin-bottom: .75rem; }
.queue-subtabs [aria-selected="true"] { border-color: var(--accent, #6d78df); font-weight: 700; }
.dispatcher-rows { display: grid; gap: .65rem; }
.dispatcher-row { border: 1px solid var(--line); border-radius: .6rem; padding: .8rem; }
.dispatcher-row .panel-heading { margin-bottom: .35rem; flex-wrap: wrap; }
.dispatcher-row strong { overflow-wrap: anywhere; min-width: 0; }
.dispatcher-row p, #dispatcher-detail dd { overflow-wrap: anywhere; }
.dispatcher-row p { margin: .25rem 0; }
#dispatcher-counts { margin-bottom: .75rem; }
#dispatcher-detail dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .75rem; }
#dispatcher-detail dd { margin: .2rem 0 0; }

/* Menus use a body popup so table/panel overflow cannot clip actions. */
.operations-action-popup[hidden] { display: none !important; }
.operations-action-popup { position: fixed; z-index: 1000; display: grid; gap: 8px; padding: 12px; width: min(300px, calc(100vw - 16px)); max-height: calc(100dvh - 16px); overflow-y: auto; background: var(--panel, var(--soft)); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px #0005; }
.operations-action-popup button, .operations-action-popup select, .operations-action-popup [role="menuitem"] { min-height: 44px; width: 100%; font-size: 14px; white-space: normal; }
.operations-action-popup #queue-action-limit { display: grid; gap: 8px; font-size: 14px; position: static; }
.row-actions .operations-menu-trigger, .agent-table .row-actions .operations-menu-trigger, .jobs-table .row-actions .operations-menu-trigger, .operations-menu-trigger { min-width: 44px; width: 44px; min-height: 44px; height: 44px; padding: 6px; font-size: 24px; flex: 0 0 44px; }
.queue-subtabs { flex-wrap: wrap; }
.queue-subtabs button { min-height: 44px; font-size: 14px; }
.queue-subtabs [data-queue-tab="execution"] { margin-left: auto; }
.queue-controls { display: flex; flex-wrap: wrap; gap: 8px; max-width: 100%; }
@media(max-width:820px) { .queue-controls > label, .queue-controls > select { display: none; } .queue-subtabs { gap: 6px; } .queue-subtabs button { flex: 1 1 28%; padding: 8px; } .queue-subtabs [data-queue-tab="execution"] { flex-basis: 100%; } }


/* Resource observation continuation: capacity is never inferred from jobs. */
.resource-tiles { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin:10px 0; }
.resource-tile { min-width:0; padding:12px; }
.resource-tile h3 { margin:0 0 6px; font-size:14px; }
.resource-observation p { margin:6px 0; font-size:12px; line-height:1.5; overflow-wrap:anywhere; }
.resource-item { border-top:1px solid var(--border, #7775); padding:8px 0; overflow-wrap:anywhere; }
.resource-current-mobile { display:none; }
@media (max-width:820px) {
  .resource-tiles { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .resource-tile { padding:8px; }
  .resource-current-mobile { display:block; padding:10px; border-top:1px solid var(--border, #7775); overflow-wrap:anywhere; }
  .resource-current-mobile p { font-size:12px; line-height:1.5; }
}

/* Mobile usability: final overrides after the legacy compact passes. */
@media (max-width: 820px) {
  /* Keep navigation in normal flow so sticky layers cannot obscure focus. */
  header, .view-switcher { position: static; }
  html { overflow-x: visible; }
  header { height: auto; min-height: 44px; }
  header a:last-child { font-size: 12px; }
  #refresh { min-height: 44px; font-size: 12px; }
  .workspace-panel > .pool-heading { display: block; margin-bottom: 4px; }
  .pool-heading h2 { margin: 0; }
  .pool-inventory { gap: 2px 8px; }
  .pool-status-line { gap: 2px 8px; }
  /* Only noninteractive context moves; tab, toggle, row and detail focus order stays intact. */
  .workspace-panel { display: flex; flex-direction: column; }
  .workspace-panel > .pool-heading { order: 0; }
  .workspace-panel > .pool-tabs { order: 1; }
  .workspace-panel > .pool-status-panel { order: 2; }
  .workers-heading { display: contents; }
  .workers-heading > div:first-child { order: 3; margin-top: 2px; }
  .workspace-panel > .compact-toggle { order: 4; margin: 2px 0; }
  .workspace-panel > .agent-table-scroll { order: 5; }
  .workspace-panel > .agent-detail { order: 6; }
  .workers-heading > .pool-grid { order: 7; }
  .workspace-panel > .workspace-observation { order: 8; }
  .pool-heading .panel-title > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
  .pool-heading .section-label { margin: 0; font-size: 11px; }
  .heading { margin-bottom: 2px; }
  .workspace-panel { margin-top: 4px; padding: 8px; }
  .pool-tabs { margin: 4px 0; }
  .workers-source { display: block; }
  html { scroll-padding-top: 12px; }
  .desktop-operator-strip { display: none; }
  .mobile-operator-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
  button, input:not([type='checkbox']), select, .run-tools summary,
  .compact-toggle, .history-toggle, header a { min-height: 44px; }
  button { min-width: 44px; }
  input:not([type='checkbox']), select { font-size: 16px; height: auto; }
  .compact-toggle, .history-toggle { display: flex; align-items: center; gap: 8px; font-size: 12px; }
  .view-switcher { height: auto; padding: 2px; }
  .view-switcher button { min-height: 44px; padding: 5px 1px; font-size: 11px; white-space: normal; overflow: visible; overflow-wrap: anywhere; }
  .operator-strip button { min-height: 44px; padding: 5px 7px; }
  .operator-strip span, .operator-strip small { font-size: 10px; letter-spacing: 0; white-space: normal; overflow: visible; }
  .operator-strip strong { font-size: 13px; overflow-wrap: anywhere; overflow: visible; }
  .pool-tabs button { min-height: 44px; font-size: 12px; }
  .pool-inventory, .pool-status-line, .pool-status-panel p, .workers-source,
  #workspace-note, .workspace-observation, .run-secondary-controls { font-size: 12px; line-height: 1.35; }
  .pool-status-panel { padding: 6px 8px; }
  .workers-heading { margin-top: 8px; gap: 4px; }
  .workers-heading .pool-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px; margin: 4px 0; }
  .workers-heading .pool-grid .metric { display: flex; justify-content: space-between; gap: 6px; padding: 4px 6px; overflow: visible; }
  .workers-heading .pool-grid .metric span { font-size: 12px; white-space: normal; overflow: visible; text-overflow: clip; }
  .workers-heading .pool-grid .metric strong { font-size: 14px; white-space: nowrap; overflow: visible; }
  .agent-table-scroll, .jobs-panel > .table-scroll { max-height: none; overflow: visible; }
  .agent-table tr, .jobs-table tr { grid-template-columns: minmax(0, 1fr); max-height: none; height: auto; overflow: visible; gap: 7px; padding: 10px; }
  .agent-table td:nth-child(n), .jobs-table td:nth-child(n) { grid-column: 1 / -1; grid-row: auto; position: static; width: auto; max-width: none; height: auto; white-space: normal; overflow: visible; }
  .agent-table .cell-main, .agent-table .cell-secondary,
  .jobs-table .cell-main, .jobs-table .cell-secondary { font-size: 13px; line-height: 1.4; white-space: normal; overflow-wrap: anywhere; overflow: visible; text-overflow: clip; max-width: none; }
  .jobs-table td:nth-child(2) .cell-secondary { display: block; }
  .row-actions { display: flex; flex-wrap: wrap; gap: 8px; }
  .agent-table .row-actions button, .jobs-table .row-actions button { min-height: 44px; min-width: 64px; flex: 1; font-size: 13px; }
  .jobs-table td:first-child { min-height: 44px; display: flex; align-items: center; }
  .jobs-table td:first-child input { width: 44px; height: 44px; }
  #detail { position: static; max-height: none; overflow: visible; }
  .agent-detail dl, .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .agent-detail dd, #detail { overflow-wrap: anywhere; }
  .agent-detail dt, .agent-detail dd, #detail .worker p, #detail .worker h4,
  #detail .route-grid pre, #detail .metric span, #detail small, #detail .quiet-label,
  #detail .badge, #detail .detail-panels { font-size: 12px; line-height: 1.4; }
  .detail-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: visible; }
  .detail-tabs button { min-width: 44px; padding: 6px 4px; font-size: 12px; white-space: normal; overflow-wrap: anywhere; }
  #detail-status { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #detail .metric { min-width: 0; height: auto; overflow: visible; }
  #detail .metric span, #detail .metric strong { white-space: normal; overflow-wrap: anywhere; }
  #detail .metric strong { font-size: 14px; }
  .operator-notice, .overview-card { max-height: none; overflow: visible; }
  .overview-card .summary-line div span { white-space: normal; overflow-wrap: anywhere; }
  .filters input, .filters select, .filters button { min-height: 44px; height: auto; font-size: 16px; }
  .filters label { font-size: 12px; }
  dialog { box-sizing: border-box; max-width: calc(100vw - 24px); }
}


/* Installed-reader compatibility: compact evidence cards; retain wallpaper/themes. */
.overview .resource-tile { min-height:0; height:auto; padding:12px; align-self:start; }
.resource-tiles { align-items:start; }
.resource-tile p { margin:4px 0; font-size:12px; line-height:1.4; overflow-wrap:anywhere; }
.resource-tile small { display:block; font-size:11px; line-height:1.4; }
.resource-state { font-weight:600; }
.resource-reason { color:var(--muted,#91afc5); }
#queue-view-status { margin:8px 0; font-size:12px; line-height:1.4; }
.agent-pagination { flex-wrap:wrap; gap:8px; }
.agent-pagination span { flex:1; min-width:150px; font-size:12px; }
@media (max-width:820px) {
  .pool-tabs { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .overview .resource-tile { padding:9px; }
  .resource-tiles { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .resource-tile p { font-size:11px; }
  .agent-pagination button { min-height:44px; }
}

.resource-source-details { margin-top:6px; font-size:11px; }
.resource-source-details summary { cursor:pointer; }
@media (min-width:1201px) { .resource-tiles { grid-template-columns:repeat(6,minmax(0,1fr)); } }
