/* Dark Command Center: shared foundations, shell, live operations and inbox. */
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #081321; --rail: #0b1929; --surface: #0d1e30; --surface-2: #11253a; --surface-3: #173149;
  --border: #213b51; --border-strong: #35536b; --text: #edf5fc; --text-soft: #c4d5e5;
  --muted: #8fa9bf; --muted-2: #718ba2; --cyan: #50c8e7; --lime: #59dd91; --amber: #ffb44f; --red: #ff858b;
  --accent-soft: #13374c; --success-soft: #123a31; --warning-soft: #3b3021; --danger-soft: #3c2634;
  --overlay: #020912b8; --shadow: 0 24px 80px #02081280;
}
html[data-theme="light"] {
  color-scheme: light;
  --bg: #edf3f8; --rail: #f8fbfe; --surface: #ffffff; --surface-2: #f2f7fb; --surface-3: #e3edf5;
  --border: #d4e0eb; --border-strong: #a6bdcf; --text: #132b40; --text-soft: #34536a;
  --muted: #526d82; --muted-2: #647d91; --cyan: #007797; --lime: #167a49; --amber: #9a5900; --red: #be3046;
  --accent-soft: #e2f3fa; --success-soft: #e4f5ec; --warning-soft: #fff3df; --danger-soft: #ffebef;
  --overlay: #122d4670; --shadow: 0 24px 70px #14334e22;
}
body { font-size: 14px; line-height: 1.45; }
body::before { display: none; }
svg { flex-shrink: 0; }
[data-icon] { display: inline-flex; align-items: center; justify-content: center; }
[data-icon] > svg { width: 20px; height: 20px; }
a { color: var(--cyan); }
button, input, select, textarea { font-family: var(--sans); }
button:disabled { cursor: not-allowed; opacity: .5; }
.shell { display: grid; grid-template-columns: 240px minmax(0,1fr); overflow-x: clip; }
.rail { position: sticky; inset: 0 auto auto 0; z-index: 35; display: flex; flex-direction: column; align-items: stretch; width: 240px; height: 100dvh; padding: 26px 14px 18px; overflow-y: auto; scrollbar-width: thin; background: var(--rail); border: 0; border-right: 1px solid var(--border); }
.brand { display: flex; justify-content: flex-start; gap: 12px; min-height: 40px; padding: 0 9px; }
.command-mark { width: 43px; height: 37px; color: var(--cyan); }
.rail .brand { display: flex; }
.rail .brand .brand-copy { display: block; }
.brand b { color: var(--text); font: 550 21px/1.1 var(--sans); letter-spacing: -.5px; }
.brand small { margin-top: 6px; color: var(--muted); font: 10px/1.2 var(--sans); letter-spacing: .25px; }
.nav { display: grid; flex: 0 0 auto; grid-template-columns: minmax(0,1fr); justify-content: stretch; gap: 6px; margin-top: 34px; }
.nav a { position: relative; display: grid; grid-template-columns: 20px minmax(0,1fr) auto; align-items: center; justify-items: stretch; gap: 11px; width: 100%; min-height: 59px; padding: 12px 10px; color: var(--text-soft); border: 1px solid transparent; border-radius: 7px; }
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a.active { color: var(--cyan); background: var(--accent-soft); border: 1px solid color-mix(in srgb,var(--cyan) 40%,var(--border)); box-shadow: inset 3px 0 0 var(--cyan); }
.nav-icon { display: flex; width: 20px; font-size: inherit; }
.rail .nav a .nav-text { position: static; display: block; width: auto; max-width: none; padding: 0; color: inherit; background: none; border: 0; border-radius: 0; box-shadow: none; font-size: 12px; line-height: 1.4; font-weight: 550; pointer-events: auto; opacity: 1; transform: none; }
.nav-text small { display: block; margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 10px; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.nav-count { display: grid; place-items: center; min-width: 21px; height: 21px; color: var(--bg); background: var(--cyan); border-radius: 50%; font-size: 10px; }
.rail-bottom { display: grid; justify-content: stretch; justify-items: stretch; width: 100%; gap: 19px; margin-top: auto; padding: 30px 10px 0; }
.rail-pulse { display: flex; justify-content: flex-start; gap: 11px; padding-bottom: 17px; color: var(--muted); border-bottom: 1px solid var(--border); font: 11px/1.55 var(--sans); letter-spacing: 0; }
.rail-pulse span { display: grid; }
.rail-pulse span[data-icon] { display: flex; }
.rail-pulse strong { color: var(--lime); font-size: 12px; }
.rail-pulse small { color: var(--muted); font-size: 10px; }
.operator-identity { display: flex; align-items: center; gap: 11px; color: var(--text-soft); font-size: 12px; }
.operator-avatar { display: grid; place-items: center; width: 32px; height: 32px; color: var(--cyan); background: var(--accent-soft); border: 1px solid var(--border-strong); border-radius: 50%; font-size: 10px; }
.operator-identity small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.logout { display: flex; justify-content: flex-start; gap: 10px; width: 100%; height: 34px; padding: 0; color: var(--muted); font: 12px var(--sans); letter-spacing: 0; }
.logout:hover { color: var(--text); background: transparent; }
.main { min-width: 0; padding: 0; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; gap: 20px; height: 68px; padding: 0 26px; background: color-mix(in srgb,var(--bg) 97%,transparent); border-bottom: 1px solid var(--border); }
.gateway-status { display: flex; align-items: center; gap: 8px; white-space: nowrap; font-size: 12px; }
.gateway-status > i { width: 7px; height: 7px; background: var(--lime); border-radius: 50%; box-shadow: 0 0 12px color-mix(in srgb,var(--lime) 25%,transparent); }
.gateway-status > span { color: var(--lime); }
.gateway-status > b { margin-left: 8px; padding-left: 15px; color: var(--muted); border-left: 1px solid var(--border); font-size: 11px; font-weight: 400; }
.gateway-status.is-offline > i { background: var(--amber); box-shadow: none; }
.gateway-status.is-offline > span { color: var(--amber); }
.topbar-right { display: flex; gap: 10px; }
.theme-toggle, .notify-btn { width: 37px; height: 37px; background: transparent; border-color: var(--border); border-radius: 7px; }
.theme-toggle { font-size: 23px; }
.command-search { position: relative; display: flex; align-items: center; gap: 10px; width: min(380px,38%); margin-left: auto; padding: 0 11px; color: var(--muted); background: var(--surface); border: 1px solid var(--border); border-radius: 6px; }
.command-search > [data-icon] svg { width: 17px; height: 17px; }
.command-search input { width: 100%; min-width: 0; height: 36px; padding: 0; color: var(--text); background: none; border: 0; outline: 0; font-size: 11px; }
.command-search:focus-within { border-color: var(--cyan); box-shadow: 0 0 0 2px var(--accent-soft); }
.command-search kbd { flex-shrink: 0; padding: 2px 4px; color: var(--muted); border: 1px solid var(--border); border-radius: 3px; font: 10px var(--sans); }
.command-search-results { position: absolute; z-index: 50; top: calc(100% + 10px); right: 0; width: min(440px,calc(100vw - 32px)); max-height: 65vh; padding: 8px; overflow: auto; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px; box-shadow: var(--shadow); }
.command-search-results > p { margin: 7px 9px 11px; color: var(--muted); font-size: 11px; }
.command-search-results > a, .command-search-results > button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px; color: var(--text); background: none; border: 0; border-radius: 5px; text-align: left; text-decoration: none; font-size: 13px; }
.command-search-results > :is(a,button):hover { background: var(--accent-soft); }
.command-search-results svg { width: 18px; height: 18px; color: var(--cyan); }
.command-search-results span { min-width: 0; }
.command-search-results small { display: block; margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.mobile-menu, .topbar .mobile-compose, .navigation-scrim { display: none; }
.page { min-height: calc(100vh - 120px); padding: 0 26px 28px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 120px; margin: 0; padding: 27px 0 24px; border: 0; }
.overview-heading { min-height: 100px; padding: 20px 0 18px; }
.page-heading h1 { margin: 0 0 8px; color: var(--text); font-size: 31px; font-weight: 550; line-height: 1.2; letter-spacing: -1px; }
.page-heading p { display: block; max-width: 700px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.page-heading .eyebrow { display: none; }
.heading-actions { display: flex; flex-shrink: 0; gap: 10px; align-items: center; }
.heading-note { display: none; }
.primary, .secondary, .danger { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 39px; padding: 10px 14px; border-radius: 6px; font: 550 12px/1.3 var(--sans); letter-spacing: 0; text-decoration: none; }
.primary { color: #152131; background: #ffb44f; border: 1px solid #ffb44f; box-shadow: none; }
.primary:hover { color: #152131; background: #ffc775; border-color: #ffc775; }
.secondary { color: var(--text-soft); background: var(--surface); border: 1px solid var(--border-strong); }
.secondary:hover { color: var(--cyan); background: var(--accent-soft); border-color: var(--cyan); }
.danger { color: var(--red); background: var(--danger-soft); border: 1px solid color-mix(in srgb,var(--red) 45%,var(--border)); }
.primary [data-icon] svg, .secondary [data-icon] svg { width: 17px; height: 17px; }
.card { min-width: 0; margin: 0; overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: none; }
.card-head { padding: 18px 20px; }
.card h2 { margin: 0; font-size: 17px; font-weight: 550; letter-spacing: -.3px; }
.card h3 { font-size: 13px; }
.empty-state { margin: 14px; padding: 24px 18px; color: var(--muted); background: var(--surface-2); border: 1px dashed var(--border-strong); border-radius: 6px; font: 12px/1.6 var(--sans); letter-spacing: 0; }
.section-kicker { font-size: 11px; }
input, select, textarea { border-radius: 5px; font-size: 13px; }
input::placeholder, textarea::placeholder { color: var(--muted-2); }
.text-link { font-size: 12px; }
.command-telemetry { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); margin-bottom: 18px; background: transparent; border-block: 1px solid var(--border-strong); }
.command-telemetry article { display: flex; align-items: center; gap: 13px; min-height: 76px; padding: 12px 20px; border-right: 1px solid var(--border); }
.command-telemetry article:last-child { border-right: 0; }
.command-telemetry article > [data-icon] { width: 32px; color: var(--cyan); }
.command-telemetry article > [data-icon] svg { width: 28px; height: 28px; }
.command-telemetry strong { display: flex; align-items: baseline; gap: 6px; color: var(--text); font-size: 29px; font-weight: 550; line-height: 1.1; letter-spacing: -.7px; }
.command-telemetry b { font-weight: inherit; }
.command-telemetry em { color: var(--muted); font-size: 18px; font-weight: 400; font-style: normal; }
.command-telemetry div > span { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; }
.command-telemetry .attention-metric > [data-icon] { color: var(--amber); }
.command-grid { min-width: 0; }
.command-main { display: grid; align-content: start; gap: 0; min-width: 0; }
.delivery-card { min-width: 0; border-bottom: 1px solid var(--border-strong); }
.delivery-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 0; }
.delivery-heading h2, .command-traffic-head h2 { margin: 0; color: var(--text); font-size: 18px; font-weight: 550; letter-spacing: -.35px; }
.delivery-heading p, .command-traffic-head p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.delivery-trace { display: flex; gap: 0; padding: 21px 2px 11px; }
.delivery-trace > .empty-state { width: 100%; margin: 0; }
.delivery-step { position: relative; flex: 1; display: grid; justify-items: center; align-content: start; gap: 7px; min-width: 0; text-align: center; }
.delivery-step::before { content: ""; position: absolute; z-index: 0; top: 14px; right: 50%; width: 100%; height: 1px; background: var(--border-strong); }
.delivery-step:first-child::before { display: none; }
.delivery-step.done::before { background: var(--cyan); }
.delivery-step.done:not(:first-child)::before { transform-origin: left center; animation: delivery-route-fill .35s ease-out both; animation-delay: calc(var(--step-index) * 380ms); }
.delivery-step.current:not(:first-child)::after { content: ""; position: absolute; z-index: 1; top: 13px; left: -50%; width: 20%; height: 3px; background: linear-gradient(90deg,transparent,var(--cyan),transparent); border-radius: 3px; animation: delivery-packet 2.2s linear infinite; }
.delivery-node { position: relative; z-index: 1; display: grid; place-items: center; width: 29px; height: 29px; margin-bottom: 2px; color: var(--muted); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 50%; font-size: 15px; }
.delivery-node svg { width: 16px; height: 16px; }
.delivery-node > i { width: 6px; height: 6px; background: var(--muted); border-radius: 50%; }
.delivery-step.done .delivery-node { color: var(--bg); background: var(--cyan); border-color: var(--cyan); }
.delivery-step.done .delivery-node { animation: delivery-node-arrive .45s cubic-bezier(.2,.85,.25,1.25) both; animation-delay: calc(var(--step-index) * 380ms + 200ms); }
.delivery-step.current .delivery-node { border-color: var(--cyan); animation: delivery-await 2.2s ease-in-out infinite; }
.delivery-step.error .delivery-node { color: var(--red); background: var(--danger-soft); border-color: var(--red); }
.delivery-step strong { color: var(--text-soft); font-size: 11px; font-weight: 550; }
.delivery-step small { max-width: 145px; padding: 0 4px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.delivery-modem { margin: 0 0 18px; color: var(--muted); font-size: 11px; }
@keyframes delivery-route-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes delivery-route-fill-vertical { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes delivery-node-arrive { from { opacity: .35; transform: scale(.65); box-shadow: 0 0 0 0 transparent; } 70% { box-shadow: 0 0 0 8px color-mix(in srgb,var(--cyan) 13%,transparent); } to { opacity: 1; transform: scale(1); box-shadow: 0 0 0 0 transparent; } }
@keyframes delivery-await { 0%,100% { box-shadow: 0 0 0 0 color-mix(in srgb,var(--cyan) 14%,transparent); } 50% { box-shadow: 0 0 0 7px color-mix(in srgb,var(--cyan) 10%,transparent); } }
@keyframes delivery-packet { 0% { opacity: 0; transform: translateX(0); } 12%,82% { opacity: 1; } 100% { opacity: 0; transform: translateX(500%); } }
@keyframes delivery-packet-vertical { 0% { opacity: 0; transform: translateY(0); } 12%,82% { opacity: 1; } 100% { opacity: 0; transform: translateY(300%); } }
.command-traffic-card { min-width: 0; }
.command-traffic-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 0 10px; }
.ledger-live { white-space: nowrap; font-size: 11px; }
.command-traffic-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 0 0 11px; }
.traffic-filter-tabs { display: flex; gap: 19px; padding: 0; background: transparent; border: 0; border-radius: 0; }
.traffic-filter-tabs button { min-height: 32px; padding: 6px 1px; color: var(--muted); background: transparent; border: 0; border-bottom: 2px solid transparent; border-radius: 0; font: 500 11px var(--sans); white-space: nowrap; }
.traffic-filter-tabs button.active { color: var(--cyan); background: transparent; border-bottom-color: var(--cyan); }
.traffic-filter-tabs button:hover { color: var(--text); }
.traffic-search { display: flex; align-items: center; gap: 8px; flex: 1; max-width: 230px; min-width: 165px; color: var(--muted); }
.traffic-search svg { width: 16px; height: 16px; }
.traffic-search input { width: 100%; min-width: 0; height: 32px; padding: 0; background: transparent; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; font-size: 11px; }
.command-traffic-scroll { overflow: auto; }
.command-traffic-table { width: 100%; min-width: 700px; border-collapse: collapse; font-size: 11px; }
.command-traffic-table th { height: 37px; padding: 9px 12px; color: var(--muted); background: transparent; border-block: 1px solid var(--border-strong); font-weight: 500; text-align: left; white-space: nowrap; }
.command-traffic-table td { max-width: 145px; height: 50px; padding: 9px 12px; color: var(--text-soft); border-bottom: 1px solid var(--border); }
.command-traffic-table th:first-child, .command-traffic-table td:first-child { padding-left: 0; }
.command-traffic-table tbody tr:hover { background: var(--surface-2); }
.command-traffic-table tbody tr.selected { background: color-mix(in srgb,var(--accent-soft) 35%,transparent); box-shadow: inset 2px 0 0 var(--cyan); }
.command-traffic-table time { color: var(--muted); white-space: nowrap; font-size: 10px; }
.traffic-direction { display: inline-flex; align-items: center; gap: 6px; }
.traffic-direction svg { width: 14px; height: 14px; color: var(--cyan); }
.traffic-direction.in svg { color: var(--lime); }
.traffic-direction.call svg { color: var(--amber); }
.traffic-party { display: inline-block; color: var(--text-soft); white-space: nowrap; font: 10px var(--mono); }
.traffic-body, .traffic-modem { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.command-traffic-table .traffic-body { width: 28%; max-width: 230px; color: var(--muted); }
.traffic-more { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; color: var(--muted); background: none; border: 0; font-size: 18px; line-height: 1; }
.traffic-more svg { width: 15px; height: 15px; }
.traffic-more:hover { color: var(--cyan); }
.traffic-actions { display: flex; align-items: center; justify-content: flex-start; gap: 3px; }
.message-status { display: inline-block; padding: 4px 7px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; font: 550 10px/1.2 var(--sans); letter-spacing: 0; text-transform: capitalize; white-space: nowrap; }
.message-status.received, .message-status.delivered { color: var(--lime); background: var(--success-soft); border-color: color-mix(in srgb,var(--lime) 35%,var(--border)); }
.message-status.submitted, .message-status.sending { color: var(--cyan); background: var(--accent-soft); border-color: color-mix(in srgb,var(--cyan) 35%,var(--border)); }
.message-status.failed, .message-status.unknown { color: var(--red); background: var(--danger-soft); border-color: color-mix(in srgb,var(--red) 35%,var(--border)); }
.message-status.queued { color: var(--amber); background: var(--warning-soft); border-color: color-mix(in srgb,var(--amber) 35%,var(--border)); }
.message-status.ringing { color: var(--amber); background: var(--warning-soft); border-color: color-mix(in srgb,var(--amber) 35%,var(--border)); }
.message-status.answered { color: var(--cyan); background: var(--accent-soft); border-color: color-mix(in srgb,var(--cyan) 35%,var(--border)); }
.message-status.missed { color: var(--red); background: var(--danger-soft); border-color: color-mix(in srgb,var(--red) 35%,var(--border)); }
.message-status.ended, .message-status.rejected { color: var(--muted); background: var(--surface-2); border-color: var(--border); }
.command-traffic-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 45px; padding: 10px 0; color: var(--muted); font-size: 11px; }
.command-traffic-foot a { text-decoration: none; white-space: nowrap; }
.footer { display: flex; gap: 15px; margin: 0 26px; padding: 16px 0; color: var(--muted-2); border-color: var(--border); font: 10px var(--sans); letter-spacing: 0; }
.call-policy-card { margin-top: 20px; }
.health-strip.is-warning { color: var(--amber); background: var(--warning-soft); border-color: color-mix(in srgb,var(--amber) 40%,var(--border)); }
.health-strip.is-error { color: var(--red); background: var(--danger-soft); border-color: color-mix(in srgb,var(--red) 40%,var(--border)); }

/* The message workspace is two panes, not another navigation column. */
.messages-workspace { display: grid; grid-template-columns: minmax(0,1fr) 280px; gap: 20px; min-height: 540px; overflow: visible; background: transparent; border: 0; }
.message-views { display: none; }
.messages-ledger, .message-workspace-inspector { min-width: 0; overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; }
.messages-stream-tabs { display: flex; min-height: 55px; padding: 0 16px; }
.messages-stream-tabs { overflow-x: auto; overflow-y: hidden; }
.messages-stream-tabs .tab::after { bottom: 0; }
.messages-stream-tabs .tab { padding-inline: 17px; font-size: 12px; }
.message-workspace-inspector { display: block; grid-column: auto; align-self: start; }
.workspace-inspector-head { min-height: 56px; padding: 0 18px; }
.workspace-inspector-head small { font: 10px var(--sans); }
.workspace-inspector-empty { padding: 65px 22px; }
.workspace-inspector-empty h3 { font-size: 15px; }
.workspace-inspector-empty p { font-size: 12px; line-height: 1.65; }
.inspector-body { padding: 22px 18px; }
.inspector-body dt { font-size: 11px; }
.inspector-body dd { font-size: 12px; }
.inspector-body h3 { font-size: 18px; }
.message-inspector-body { padding: 20px 18px; }
.message-inspector-direction { font-size: 11px; }
.message-inspector-body h3 { font-size: 17px; }
.message-inspector-body blockquote { font-size: 13px; line-height: 1.6; }
.message-inspector-body dt { font-size: 11px; }
.message-inspector-body dd { font-size: 12px; line-height: 1.6; }
.messages-ledger .table-toolbar { justify-content: flex-end; padding: 12px 18px; background: var(--surface); }
.table-toolbar label { color: var(--muted); font: 11px var(--sans); letter-spacing: 0; }
.table-toolbar select { min-height: 34px; font-size: 12px; }
.messages-ledger .message-table { min-width: 720px; font-size: 12px; }
.message-table th { padding: 12px; font-size: 10px; }
.message-table td { padding: 16px 12px; color: var(--text-soft); font-size: 12px; }
.message-table td small { color: var(--muted); font: 10px/1.5 var(--sans); }
.cell-number { color: var(--text); font: 11px var(--mono); }
.body-link { color: var(--text-soft); font-size: 12px; }
.message-action { min-height: 29px; padding: 6px 8px; color: var(--text-soft); background: var(--surface-2); border-color: var(--border-strong); border-radius: 4px; font: 10px var(--sans); }
.message-action:hover { color: var(--cyan); border-color: var(--cyan); }
.pager { flex-wrap: wrap; gap: 12px; padding: 15px 18px; color: var(--muted); background: var(--surface); }
.pager-range, .pager-size, .pager-page { color: var(--muted); font: 10px var(--sans); }
.pager-nav button { min-height: 32px; font-size: 11px; }
.pager-size select { min-height: 30px; font-size: 11px; }

@media (min-width: 1680px) {
  .page { max-width: 1840px; margin-inline: auto; padding-inline: 34px; }
  .command-grid { grid-template-columns: minmax(0,1fr); }
  .command-traffic-table { font-size: 12px; }
  .command-traffic-table td { height: 54px; }
}
@media (max-width: 1250px) {
  .shell { grid-template-columns: 218px minmax(0,1fr); }
  .rail { width: 218px; padding-inline: 10px; }
  .nav-text { font-size: 11px; }
  .nav-text small { font-size: 9px; }
  .topbar, .page { padding-inline: 20px; }
  .gateway-status > b { display: none; }
  .delivery-heading { flex-wrap: wrap; }
  .command-telemetry article { padding: 12px 15px; gap: 10px; }
  .command-telemetry strong { font-size: 25px; }
  .messages-workspace { grid-template-columns: minmax(0,1fr); }
  .message-workspace-inspector { display: none; }
  .overview-heading { align-items: flex-start; }
  .overview-heading h1 { font-size: 27px; }
  .overview-heading .heading-actions .secondary { display: none; }
}
@media (max-width: 1050px) {
  .command-telemetry article { gap: 8px; padding: 12px; }
  .command-telemetry article > [data-icon] { width: 22px; }
  .command-telemetry div > span { font-size: 10px; }
}
@media (max-width: 800px) {
  .shell { display: block; }
  .rail { position: fixed; inset: 0 auto 0 0; z-index: 60; width: 250px; height: 100dvh; padding: 24px 14px 18px; visibility: hidden; transform: translateX(-101%); transition: transform .2s ease, visibility .2s; }
  .navigation-open .rail { visibility: visible; transform: translateX(0); box-shadow: var(--shadow); }
  .navigation-open { overflow: hidden; }
  .navigation-scrim { position: fixed; z-index: 55; inset: 0; display: block; width: 100vw; height: 100dvh; padding: 0; background: var(--overlay); border: 0; }
  .nav { margin-top: 30px; }
  .nav a { min-height: 55px; }
  .nav-text { font-size: 12px; }
  .nav-text small { font-size: 10px; }
  .topbar { gap: 14px; height: 64px; padding: 0 18px; }
  .mobile-menu { display: grid; flex-shrink: 0; place-items: center; width: 35px; height: 35px; }
  .command-search { width: auto; flex: 1; }
  .command-search kbd { display: none; }
  .gateway-status { font-size: 11px; }
  .page { padding-inline: 18px; }
  .page-heading { min-height: 115px; padding: 25px 0 22px; }
  .overview-heading { min-height: 96px; padding: 19px 0 17px; }
  .page-heading h1 { font-size: 28px; }
  .command-telemetry article { padding: 12px 16px; }
  .command-telemetry div > span { font-size: 11px; }
  .footer { margin-inline: 18px; }
}
@media (max-width: 760px) {
  .messages-ledger .message-table { min-width: 0; }
}
@media (max-width: 600px) {
  .topbar { gap: 10px; flex-wrap: nowrap; height: 61px; padding-inline: 14px; }
  .topbar-right { gap: 6px; }
  .command-search { position: static; padding: 0 8px; }
  .command-search input { height: 34px; font-size: 11px; }
  .command-search input::placeholder { color: transparent; }
  .command-search-results { top: 65px; right: 14px; width: calc(100vw - 28px); }
  .gateway-status > span { display: none; }
  .gateway-status { gap: 0; }
  .theme-toggle, .notify-btn { width: 33px; height: 34px; }
  .topbar .mobile-compose { display: inline-flex; min-height: 34px; width: 34px; padding: 7px; }
  .page { min-height: calc(100vh - 120px); padding: 0 14px 22px; }
  .page-heading { display: flex; align-items: flex-start; gap: 16px; min-height: 0; padding: 25px 0 21px; }
  .overview-heading { padding: 19px 0 16px; }
  .page-heading h1 { font-size: 25px; letter-spacing: -.7px; }
  .page-heading p { font-size: 12px; }
  .page-heading .heading-actions { display: none; }
  .page-heading > .secondary { min-height: 34px; padding: 8px 10px; font-size: 10px; }
  .page-heading > .secondary [data-icon] { display: none; }
  .command-telemetry { grid-template-columns: 1fr 1fr; margin-bottom: 18px; }
  .command-telemetry article { gap: 11px; min-height: 72px; padding: 11px 14px; }
  .command-telemetry article:nth-child(2) { border-right: 0; }
  .command-telemetry article:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  .command-telemetry strong { font-size: 25px; }
  .command-telemetry em { font-size: 15px; }
  .command-main { gap: 0; }
  .delivery-heading { gap: 12px; padding: 0; }
  .delivery-heading h2, .command-traffic-head h2 { font-size: 16px; }
  .delivery-heading p, .command-traffic-head p { font-size: 11px; }
  .delivery-trace { flex-direction: column; align-items: stretch; gap: 0; padding: 18px 0 5px; }
  .delivery-step { grid-template-columns: 29px 1fr; justify-items: start; align-items: start; gap: 2px 14px; min-height: 54px; padding-bottom: 15px; text-align: left; }
  .delivery-node { grid-row: span 2; margin: 0; }
  .delivery-step::before { top: -27px; right: auto; left: 14px; width: 1px; height: 40px; }
  .delivery-step.done:not(:first-child)::before { transform-origin: center top; animation-name: delivery-route-fill-vertical; }
  .delivery-step.current:not(:first-child)::after { top: -27px; left: 13px; width: 3px; height: 12px; animation-name: delivery-packet-vertical; }
  .delivery-step strong { margin-top: 2px; font-size: 12px; }
  .delivery-step small { max-width: none; padding: 0; font-size: 11px; }
  .delivery-modem { margin-inline: 0; overflow-wrap: anywhere; }
  .command-traffic-head { padding: 17px 0 11px; }
  .ledger-live { font-size: 10px; }
  .command-traffic-controls { gap: 9px; padding: 0 0 11px; }
  .traffic-filter-tabs { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); width: 100%; }
  .traffic-filter-tabs button { min-width: 0; padding: 7px 3px; font-size: 10px; }
  .traffic-search { max-width: none; }
  .command-traffic-scroll { overflow: visible; }
  .command-traffic-table, .command-traffic-table tbody { display: block; width: 100%; min-width: 0; }
  .command-traffic-table thead { display: none; }
  .command-traffic-table tbody tr { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 7px 10px; padding: 11px 0; border-bottom: 1px solid var(--border); }
  .command-traffic-table tbody td { display: block; width: auto; max-width: none; height: auto; padding: 0; border: 0; }
  .command-traffic-table td:first-child { padding-left: 0; }
  /* Cells: 1 actions, 2 time, 3 type, 4 party, 5 activity, 6 modem, 7 status. */
  .command-traffic-table td:nth-child(1) { grid-column: 1; grid-row: 1; }
  .command-traffic-table td:nth-child(3) { grid-column: 2; grid-row: 1; justify-self: end; }
  .command-traffic-table td:nth-child(4) { grid-column: 1; grid-row: 2; min-width: 0; }
  .command-traffic-table td:nth-child(7) { grid-column: 2; grid-row: 2; justify-self: end; }
  .command-traffic-table td:nth-child(5) { grid-column: 1 / -1; grid-row: 3; min-width: 0; }
  .command-traffic-table td:nth-child(6) { grid-column: 1; grid-row: 4; min-width: 0; color: var(--muted); font-size: 10px; }
  .command-traffic-table td:nth-child(2) { grid-column: 2; grid-row: 4; justify-self: end; }
  .command-traffic-table .traffic-body { width: 100%; max-width: none; }
  .command-traffic-table .traffic-more { width: 23px; height: 20px; }
  .command-traffic-table tbody td[colspan] { grid-column: 1 / -1; grid-row: auto; }
  .command-traffic-foot { flex-wrap: wrap; gap: 9px; padding: 11px 0; }
  .footer { flex-wrap: wrap; justify-content: space-between; gap: 9px; margin-inline: 14px; font-size: 9px; }
  .footer > span:nth-child(2) { display: none; }
  .messages-workspace { min-height: 0; }
  .messages-ledger .message-table { min-width: 0; table-layout: auto; }
  .messages-ledger .message-table thead { display: none; }
  .messages-ledger .message-table, .messages-ledger .message-table tbody, .messages-ledger .message-table tr, .messages-ledger .message-table td { display: block; width: 100%; }
  .messages-ledger .message-table tr { padding: 16px 18px; border-bottom: 1px solid var(--border); }
  .messages-ledger .message-table td { padding: 6px 0; border: 0; }
  .message-table td[data-label]::before { color: var(--muted); font: 10px var(--sans); letter-spacing: 0; }
  .body-link { font-size: 14px; }
  .message-action { min-height: 33px; font-size: 11px; }
  .pager { justify-content: center; }
  .pager-range { width: 100%; text-align: center; }
}
@media (max-width: 360px) {
  .traffic-filter-tabs { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
