:root {
  color-scheme: dark;
  --bg: #071019;
  --panel: #101c28;
  --panel-2: #142433;
  --line: #24394b;
  --text: #edf6fb;
  --muted: #93a9b8;
  --blue: #47b5ff;
  --cyan: #49e3cf;
  --green: #55d99b;
  --amber: #ffc766;
  --red: #ff7185;
  --shadow: 0 16px 50px rgba(0, 0, 0, .24);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 90% -10%, rgba(71, 181, 255, .15), transparent 30rem),
    radial-gradient(circle at 0 40%, rgba(73, 227, 207, .07), transparent 24rem),
    var(--bg);
}
a { color: var(--blue); text-decoration: none; }
a:hover { color: #88d2ff; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid rgba(71, 181, 255, .75); outline-offset: 2px; }

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid rgba(147, 169, 184, .14);
  background: rgba(7, 16, 25, .88);
  backdrop-filter: blur(18px);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1480px, calc(100% - 32px));
  min-height: 72px;
  margin: 0 auto;
  gap: 28px;
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); min-width: max-content; }
.brand:hover { color: var(--text); }
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(73, 227, 207, .45);
  border-radius: 13px;
  color: var(--cyan);
  background: linear-gradient(145deg, rgba(73, 227, 207, .16), rgba(71, 181, 255, .08));
  font-size: .76rem;
  font-weight: 900;
  letter-spacing: .12em;
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: .98rem; letter-spacing: .01em; }
.brand small { margin-top: 2px; color: var(--muted); font-size: .72rem; }
.primary-nav { display: flex; align-items: center; min-width: 0; gap: 4px; overflow-x: auto; }
.primary-nav a {
  padding: 10px 13px;
  border-radius: 10px;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 650;
  white-space: nowrap;
}
.primary-nav a:hover { color: var(--text); background: rgba(255,255,255,.05); }
.primary-nav a.active { color: var(--text); background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); }
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  background: var(--panel-2);
  font-size: .78rem;
  font-weight: 750;
  cursor: pointer;
  white-space: nowrap;
}
.theme-toggle:hover { border-color: var(--blue); }

.page-shell { width: min(1480px, calc(100% - 32px)); margin: 0 auto; padding: 38px 0 64px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.page-heading-main { display: flex; align-items: center; min-width: 0; gap: 20px; }
.page-heading-main > div { min-width: 0; }
.page-logo {
  flex: 0 0 82px;
  width: 82px;
  height: 82px;
  object-fit: contain;
  filter: drop-shadow(0 10px 22px rgba(0,119,255,.18));
}
.eyebrow { margin: 0 0 8px; color: var(--cyan); font-size: .72rem; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(1.8rem, 4vw, 3rem); line-height: 1.05; letter-spacing: -.04em; }
h2 { font-size: 1.1rem; letter-spacing: -.01em; }
.refresh-control { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .8rem; white-space: nowrap; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px rgba(85,217,155,.12); }
.live-dot.is-paused { background: var(--muted); box-shadow: 0 0 0 5px rgba(126,149,166,.1); }
.link-button { padding: 0; border: 0; color: var(--blue); background: none; cursor: pointer; }
.gesture-hint { margin: -16px 0 22px; color: var(--muted); font-size: .72rem; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.metric-card {
  display: block;
  position: relative;
  overflow: hidden;
  min-height: 116px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--text);
  background: linear-gradient(145deg, rgba(20,36,51,.96), rgba(12,24,34,.96));
  box-shadow: var(--shadow);
  transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}
.metric-card:hover { color: var(--text); border-color: rgba(71,181,255,.58); transform: translateY(-2px); box-shadow: 0 18px 54px rgba(0,0,0,.3); }
.metric-card::after { content: ""; position: absolute; right: -35px; bottom: -55px; width: 120px; height: 120px; border-radius: 50%; background: rgba(71,181,255,.06); }
.metric-card span { display: block; color: var(--muted); font-size: .76rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.metric-card strong { display: block; margin-top: 12px; font-size: 2rem; line-height: 1; }
.metric-card small { display: block; margin-top: 13px; color: var(--blue); font-size: .68rem; font-weight: 800; }
.metric-card small span { display: inline; color: inherit; font-size: inherit; letter-spacing: 0; text-transform: none; }
.metric-card.live { border-color: rgba(85,217,155,.36); }
.metric-card.live strong { color: var(--green); }
.metric-card.warn strong { color: var(--amber); }

.panel { min-width: 0; margin-top: 20px; border: 1px solid var(--line); border-radius: 17px; background: rgba(16,28,40,.9); box-shadow: var(--shadow); }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.panel-header > * { min-width: 0; }
.panel-header h2 { margin: 0; }
.panel-header p { margin: 4px 0 0; color: var(--muted); font-size: .82rem; overflow-wrap: anywhere; }
.panel-header > .muted { flex: 0 0 auto; white-space: nowrap; }
.panel-body { padding: 20px; }
.panel-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.subsection-heading { margin: 26px 0 12px; }
.subsection-heading h3 { margin-bottom: 4px; font-size: .95rem; }
.subsection-heading p { margin-bottom: 0; color: var(--muted); font-size: .78rem; }

.ops-metric-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.ops-metric { min-width: 0; padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: rgba(7,16,25,.56); }
.ops-metric span, .ops-metric strong, .ops-metric small { display: block; }
.ops-metric span { color: var(--muted); font-size: .65rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.ops-metric strong { margin-top: 9px; font-size: 1.18rem; overflow-wrap: anywhere; }
.ops-metric small { margin-top: 6px; color: var(--muted); font-size: .68rem; overflow-wrap: anywhere; }
.empty-state.compact { padding: 24px 14px; }

.status-overview {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  position: relative;
  overflow: hidden;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: linear-gradient(145deg, rgba(20,36,51,.98), rgba(10,22,32,.96));
  box-shadow: var(--shadow);
}
.status-overview::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--green); }
.status-overview-symbol { width: 18px; height: 18px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 8px rgba(85,217,155,.11); }
.status-overview-degraded::after, .status-overview-degraded .status-overview-symbol { background: var(--amber); }
.status-overview-degraded .status-overview-symbol { box-shadow: 0 0 0 8px rgba(255,199,102,.11); }
.status-overview-outage::after, .status-overview-outage .status-overview-symbol { background: var(--red); }
.status-overview-outage .status-overview-symbol { box-shadow: 0 0 0 8px rgba(255,113,133,.11); }
.status-overview-copy .eyebrow { margin-bottom: 5px; }
.status-overview-copy h2 { margin-bottom: 5px; font-size: clamp(1.25rem, 3vw, 1.7rem); }
.status-overview-copy p:last-child { margin-bottom: 0; color: var(--muted); font-size: .82rem; line-height: 1.5; }
.status-overview-count { min-width: 130px; padding-left: 20px; border-left: 1px solid var(--line); text-align: right; }
.status-overview-count strong, .status-overview-count span, .status-overview-count small { display: block; }
.status-overview-count strong { color: var(--green); font-size: 1.8rem; line-height: 1; }
.status-overview-degraded .status-overview-count strong { color: var(--amber); }
.status-overview-outage .status-overview-count strong { color: var(--red); }
.status-overview-count span { margin-top: 5px; font-size: .72rem; font-weight: 800; text-transform: uppercase; }
.status-overview-count small { margin-top: 7px; color: var(--muted); font-size: .66rem; }
.status-core-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 16px; }
.status-card { min-width: 0; padding: 17px; border: 1px solid var(--line); border-radius: 14px; background: rgba(16,28,40,.9); box-shadow: var(--shadow); }
.status-card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.status-card-top > span:first-child { color: var(--muted); font-size: .69rem; font-weight: 800; letter-spacing: .045em; text-transform: uppercase; }
.status-card > strong { display: block; margin-top: 13px; font-size: 1.08rem; overflow-wrap: anywhere; }
.status-card > p { margin: 6px 0 0; color: var(--muted); font-size: .74rem; line-height: 1.5; }
.status-feed-table td:first-child { min-width: 180px; }
.status-cell-stack, .status-cell-stack > span { display: block; min-width: 0; }
.status-cell-stack > span { margin-top: 3px; }
.status-guide .link-type-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.admin-form { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)) auto; align-items: end; gap: 12px; }
.admin-form .button { white-space: nowrap; }
.configuration-layout { display: grid; gap: 20px; }
.settings-section { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: rgba(7,16,25,.35); }
.settings-section h3 { margin-bottom: 5px; font-size: 1rem; }
.settings-section > p { margin-bottom: 16px; color: var(--muted); font-size: .78rem; }
.profile-editor { padding: 0; overflow: hidden; }
.profile-editor > summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 18px; cursor: pointer; list-style: none; }
.profile-editor > summary::-webkit-details-marker { display: none; }
.profile-editor > summary strong { display: block; font-size: .95rem; }
.profile-editor > summary small { display: block; margin-top: 4px; color: var(--muted); font-size: .72rem; }
.profile-editor > summary::after { content: "+"; order: 3; font-size: 1.2rem; font-weight: 800; }
.profile-editor[open] > summary { border-bottom: 1px solid var(--line); }
.profile-editor[open] > summary::after { content: "−"; }
.profile-editor-body { padding: 18px; }
.settings-grid { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 14px; }
.settings-grid .field-wide { grid-column: span 2; }
.settings-grid .field-full { grid-column: 1 / -1; }
.settings-actions { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 18px; }
.settings-actions p { max-width: 800px; margin: 0; color: var(--muted); font-size: .76rem; }
.control-file-editor { min-height: 230px !important; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .78rem; }
.settings-meta { color: var(--muted); font-size: .75rem; }
.routing-guide { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0 0 16px; }
.routing-guide div { min-width: 0; padding: 12px; border: 1px solid rgba(71,181,255,.2); border-radius: 11px; background: rgba(71,181,255,.055); }
.routing-guide strong { display: block; margin-bottom: 5px; font-size: .76rem; }
.routing-guide span { display: block; color: var(--muted); font-size: .69rem; line-height: 1.45; overflow-wrap: anywhere; }

.filter-bar { display: grid; grid-template-columns: minmax(220px, 1fr) 180px auto auto; align-items: end; gap: 12px; }
.filter-disclosure { margin-top: 2px; border: 1px solid var(--line); border-radius: 12px; background: rgba(16,28,40,.62); }
.filter-disclosure summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 13px; color: var(--muted); font-size: .76rem; font-weight: 800; cursor: pointer; list-style: none; }
.filter-disclosure summary::-webkit-details-marker { display: none; }
.filter-disclosure summary::after { content: "+"; display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid var(--line); border-radius: 8px; color: var(--text); font-size: 1rem; line-height: 1; }
.filter-disclosure[open] summary { border-bottom: 1px solid var(--line); color: var(--text); }
.filter-disclosure[open] summary::after { content: "−"; }
.filter-disclosure .filter-bar { padding: 12px; }
.filter-disclosure .field label { font-size: .69rem; }
.filter-disclosure .field input,
.filter-disclosure .field select,
.filter-disclosure .button { min-height: 36px; padding-top: 7px; padding-bottom: 7px; font-size: .78rem; }
.link-type-guide { margin-top: 16px; }
.link-type-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.link-type-grid article { min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); }
.link-type-grid article > strong { display: block; margin-top: 9px; color: var(--text); font-size: .95rem; }
.link-type-grid article p { margin: 5px 0 0; color: var(--muted); font-size: .75rem; line-height: 1.5; }
.link-source-note { margin: 0; padding: 0 18px 16px; color: var(--muted); font-size: .74rem; line-height: 1.5; }
.field { min-width: 0; }
.field label { display: block; margin: 0 0 6px; color: var(--muted); font-size: .75rem; font-weight: 700; }
.field input, .field select, .field textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  background: #0a1620;
}
.field input::placeholder { color: #607889; }
.field textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.field-help { margin: 6px 0 0; color: var(--muted); font-size: .69rem; line-height: 1.45; }
.field input[readonly] { color: var(--muted); background: rgba(147,169,184,.06); cursor: not-allowed; }
.checkbox-field { display: flex; align-items: flex-start; gap: 9px; padding-top: 6px; }
.checkbox-field input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--blue); }
.checkbox-field label { color: var(--text); font-size: .82rem; font-weight: 700; }
.settings-checkbox-group { margin: 0; padding: 10px 12px 12px; border: 1px solid var(--line); border-radius: 10px; }
.settings-checkbox-group legend { padding: 0 5px; color: var(--muted); font-size: .75rem; font-weight: 750; }
.settings-checkbox-group label { display: inline-flex; align-items: center; gap: 7px; margin: 4px 18px 0 0; color: var(--text); font-size: .8rem; font-weight: 700; }
.settings-checkbox-group input { width: 18px; height: 18px; accent-color: var(--blue); }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 15px;
  border: 1px solid rgba(71,181,255,.35);
  border-radius: 10px;
  color: #04131e;
  background: var(--blue);
  font-weight: 800;
  cursor: pointer;
}
.button:hover { color: #04131e; background: #78caff; }
.button-secondary { color: var(--text); border-color: var(--line); background: var(--panel-2); }
.button-secondary:hover { color: var(--text); background: #1b3042; }
.button-danger { color: #fff; border-color: rgba(255,113,133,.42); background: #a93045; }
.button-danger:hover { color: #fff; background: #c83b52; }
.button-small { min-height: 34px; padding: 6px 11px; font-size: .8rem; }

.table-wrap { width: 100%; min-width: 0; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .86rem; }
th { padding: 12px 14px; color: var(--muted); font-size: .7rem; letter-spacing: .06em; text-align: left; text-transform: uppercase; white-space: nowrap; }
td { padding: 13px 14px; border-top: 1px solid rgba(36,57,75,.68); vertical-align: middle; }
tbody tr:hover { background: rgba(71,181,255,.035); }
.call-sign { color: var(--text); font-weight: 850; letter-spacing: .03em; }
.callsign-link { display: inline-flex; align-items: center; gap: 4px; color: var(--text); font-weight: 850; }
.callsign-link:hover { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
.callsign-link span { color: var(--blue); font-size: .66em; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-wrap: anywhere; word-break: break-word; }
.nowrap { white-space: nowrap; }
.wiresx-nodes-table { min-width: 1280px; table-layout: fixed; }
.wiresx-nodes-table th,
.wiresx-nodes-table td { padding-right: 12px; padding-left: 12px; }
.wiresx-nodes-table th:nth-child(1) { width: 7%; }
.wiresx-nodes-table th:nth-child(2) { width: 9%; }
.wiresx-nodes-table th:nth-child(3) { width: 6%; }
.wiresx-nodes-table th:nth-child(4) { width: 8%; }
.wiresx-nodes-table th:nth-child(5) { width: 16%; }
.wiresx-nodes-table th:nth-child(6) { width: 12%; }
.wiresx-nodes-table th:nth-child(7) { width: 9%; }
.wiresx-nodes-table th:nth-child(8) { width: 9%; }
.wiresx-nodes-table th:nth-child(9) { width: 9%; }
.wiresx-nodes-table th:nth-child(10) { width: 15%; }
.wiresx-nodes-table td:nth-child(1),
.wiresx-nodes-table td:nth-child(2) { min-width: 0; white-space: normal; overflow-wrap: anywhere; }
.wiresx-nodes-table td:nth-child(3),
.wiresx-nodes-table td:nth-child(4),
.wiresx-nodes-table td:nth-child(7) { white-space: nowrap; overflow-wrap: normal; word-break: normal; }
.wiresx-nodes-table td:nth-child(6) { white-space: normal; overflow-wrap: anywhere; word-break: normal; }
.wiresx-nodes-table td:nth-child(8),
.wiresx-nodes-table td:nth-child(9) { white-space: normal; overflow-wrap: anywhere; }
.time-stack, .position-stack { display: grid; gap: 3px; }
.time-stack small, .position-stack small { color: var(--muted); font-size: .68rem; }
.position-stack > .mono { white-space: normal; overflow-wrap: normal; word-break: normal; }
.feed-details-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 14px; }
.empty-state { padding: 50px 20px; color: var(--muted); text-align: center; }
.badge { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 8px; border-radius: 999px; font-size: .68rem; font-weight: 850; white-space: nowrap; }
.badge-success { color: #87f2bd; background: rgba(85,217,155,.13); }
.badge-danger { color: #ff9cab; background: rgba(255,113,133,.13); }
.badge-warning { color: #ffd993; background: rgba(255,199,102,.13); }
.badge-info { color: #91d6ff; background: rgba(71,181,255,.13); }
.badge-neutral { color: #bac9d2; background: rgba(147,169,184,.12); }

.alert { margin: 0 0 18px; padding: 13px 15px; overflow-wrap: anywhere; border: 1px solid; border-radius: 12px; font-size: .88rem; }
.alert-warning { color: #ffe3af; border-color: rgba(255,199,102,.32); background: rgba(255,199,102,.09); }
.alert-danger { color: #ffc0ca; border-color: rgba(255,113,133,.35); background: rgba(255,113,133,.09); }
.alert-success { color: #adf4ce; border-color: rgba(85,217,155,.32); background: rgba(85,217,155,.09); }
.alert-info { color: #bce5ff; border-color: rgba(71,181,255,.32); background: rgba(71,181,255,.09); }

.service-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.service-card { padding: 20px; border: 1px solid var(--line); border-radius: 15px; background: var(--panel); }
.service-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.service-card h2 { margin-bottom: 5px; }
.service-card p { color: var(--muted); font-size: .82rem; }
.service-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 18px 0; }
.service-meta div { padding: 10px; border-radius: 10px; background: rgba(7,16,25,.62); }
.service-meta span, .service-meta strong { display: block; }
.service-meta span { color: var(--muted); font-size: .67rem; text-transform: uppercase; }
.service-meta strong { margin-top: 4px; font-size: .82rem; overflow-wrap: anywhere; }
.state-indicator { display: inline-flex; align-items: center; gap: 8px; font-size: .78rem; font-weight: 850; text-transform: uppercase; }
.state-indicator::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 4px rgba(255,113,133,.1); }
.state-indicator.active::before { background: var(--green); box-shadow: 0 0 0 4px rgba(85,217,155,.1); }

.log-viewer { max-height: 640px; margin: 0; padding: 18px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; color: #c8d8e3; background: #040a0f; font: .78rem/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; word-break: break-word; }
.audit-list { display: grid; gap: 8px; }
.audit-row { display: grid; grid-template-columns: 170px 1fr 150px; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: .82rem; }
.audit-row:first-child { border-top: 0; }

.login-shell { display: grid; place-items: center; min-height: calc(100vh - 150px); }
.login-card { width: min(440px, 100%); padding: 30px; border: 1px solid var(--line); border-radius: 18px; background: rgba(16,28,40,.95); box-shadow: var(--shadow); }
.login-card h1 { margin-bottom: 8px; font-size: 2rem; }
.login-card > p { color: var(--muted); }
.login-card .field { margin-top: 16px; }
.login-card .button { width: 100%; margin-top: 20px; }

.site-footer { display: flex; justify-content: space-between; gap: 20px; width: min(1480px, calc(100% - 32px)); margin: 0 auto; padding: 22px 0 32px; border-top: 1px solid var(--line); color: var(--muted); font-size: .76rem; }
.site-footer > div { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links { white-space: nowrap; }

@media (max-width: 900px) {
  .header-inner { align-items: flex-start; flex-direction: column; gap: 10px; padding: 13px 0; }
  .primary-nav { width: 100%; }
  .page-shell { padding-top: 26px; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .filter-bar { grid-template-columns: 1fr 1fr; }
  .service-grid { grid-template-columns: 1fr; }
  .ops-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .routing-guide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feed-details-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .status-core-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .status-guide .link-type-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .link-type-grid { grid-template-columns: 1fr; }
  .status-core-grid, .status-guide .link-type-grid { grid-template-columns: 1fr; }
  .table-wrap { overflow: visible; }
  table.responsive-table,
  .responsive-table tbody,
  .responsive-table tr,
  .responsive-table td { display: block; width: 100%; min-width: 0; }
  .responsive-table { min-width: 0; table-layout: auto; }
  .responsive-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;
  }
  .responsive-table tbody { padding: 10px; }
  .responsive-table tr {
    margin-bottom: 10px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(7,16,25,.34);
  }
  .responsive-table tr:last-child { margin-bottom: 0; }
  .responsive-table td,
  .wiresx-nodes-table td:nth-child(n) {
    display: grid;
    grid-template-columns: minmax(100px, 34%) minmax(0, 1fr);
    align-items: start;
    gap: 12px;
    min-height: 42px;
    padding: 10px 12px;
    border-top: 1px solid rgba(36,57,75,.68);
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
  }
  .responsive-table td:first-child { border-top: 0; }
  .responsive-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: .66rem;
    font-weight: 800;
    letter-spacing: .055em;
    line-height: 1.45;
    text-transform: uppercase;
  }
  .responsive-table td > .badge { justify-self: start; }
  .responsive-table .nowrap { white-space: normal; }
  :root[data-theme="light"] .responsive-table tr { background: rgba(232,241,247,.5); }
}

@media (max-width: 580px) {
  .header-inner, .page-shell, .site-footer { width: min(100% - 22px, 1480px); }
  .brand { width: 100%; min-width: 0; }
  .header-inner { gap: 8px; padding: 10px 0 8px; }
  .brand-mark { flex: 0 0 38px; width: 38px; height: 38px; border-radius: 11px; }
  .brand strong { font-size: .9rem; overflow-wrap: anywhere; }
  .brand small { display: none; }
  .primary-nav { flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; }
  .primary-nav::-webkit-scrollbar { display: none; }
  .primary-nav a, .theme-toggle { flex: 0 0 auto; }
  .primary-nav a { min-height: 40px; padding: 10px; font-size: .8rem; }
  .theme-toggle { min-height: 40px; padding: 8px 10px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .status-overview { grid-template-columns: auto minmax(0, 1fr); padding: 18px; }
  .status-overview-count { grid-column: 2; width: 100%; padding: 12px 0 0; border-top: 1px solid var(--line); border-left: 0; text-align: left; }
  .page-logo { flex-basis: 70px; width: 70px; height: 70px; }
  .gesture-hint { margin-top: -10px; }
  .metric-grid { gap: 9px; }
  .metric-card { min-height: 96px; padding: 15px; }
  .metric-card strong { font-size: 1.65rem; }
  .filter-bar { grid-template-columns: 1fr; }
  .ops-metric-grid, .admin-form { grid-template-columns: 1fr; }
  .feed-details-grid { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .settings-grid .field-wide, .settings-grid .field-full { grid-column: auto; }
  .routing-guide { grid-template-columns: 1fr; }
  .panel { border-radius: 14px; }
  .panel-header { align-items: stretch; flex-direction: column; gap: 12px; padding: 16px 14px; }
  .panel-header .panel-actions { align-items: flex-start; flex-direction: column; width: 100%; }
  .panel-header .button { max-width: 100%; white-space: normal; }
  .panel-body { padding: 14px; }
  .settings-section { padding: 14px; }
  .settings-actions { align-items: stretch; flex-direction: column; }
  .settings-actions > .panel-actions { align-items: stretch; flex-direction: column; width: 100%; }
  .settings-actions > .panel-actions .field,
  .settings-actions > .panel-actions .button { width: 100%; }
  .control-file-editor { min-height: 180px !important; }
  .service-meta { grid-template-columns: 1fr; }
  .audit-row { grid-template-columns: 1fr; gap: 4px; }
  .site-footer { flex-direction: column; }
  .footer-links { white-space: normal; }
}

@media (max-width: 420px) {
  .page-heading-main { gap: 13px; }
  .page-logo { flex-basis: 58px; width: 58px; height: 58px; }
  .responsive-table td,
  .wiresx-nodes-table td:nth-child(n) { grid-template-columns: minmax(88px, 31%) minmax(0, 1fr); gap: 9px; padding: 9px 10px; }
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f7fa;
  --panel: #ffffff;
  --panel-2: #eaf2f7;
  --line: #cbd9e3;
  --text: #122634;
  --muted: #607685;
  --blue: #087cc1;
  --cyan: #078b7d;
  --green: #087f51;
  --amber: #9a6500;
  --red: #b62d45;
  --shadow: 0 14px 36px rgba(24, 54, 72, .1);
}
:root[data-theme="light"] body {
  background:
    radial-gradient(circle at 90% -10%, rgba(8,124,193,.11), transparent 30rem),
    radial-gradient(circle at 0 40%, rgba(7,139,125,.07), transparent 24rem),
    var(--bg);
}
:root[data-theme="light"] .site-header { background: rgba(248, 251, 253, .91); }
:root[data-theme="light"] .metric-card { background: linear-gradient(145deg, #ffffff, #edf5f9); }
:root[data-theme="light"] .status-overview { background: linear-gradient(145deg, #ffffff, #edf5f9); }
:root[data-theme="light"] .panel,
:root[data-theme="light"] .login-card,
:root[data-theme="light"] .status-card { background: rgba(255,255,255,.94); }
:root[data-theme="light"] .filter-disclosure { background: rgba(255,255,255,.82); }
:root[data-theme="light"] .field input,
:root[data-theme="light"] .field select,
:root[data-theme="light"] .field textarea { color: var(--text); background: #ffffff; }
:root[data-theme="light"] .service-meta div,
:root[data-theme="light"] .ops-metric,
:root[data-theme="light"] .settings-section { background: rgba(232,241,247,.65); }
:root[data-theme="light"] .routing-guide div { border-color: rgba(8,124,193,.2); background: rgba(8,124,193,.055); }
:root[data-theme="light"] tbody tr:hover { background: rgba(8,124,193,.045); }
:root[data-theme="light"] .button-secondary,
:root[data-theme="light"] .theme-toggle { color: var(--text); background: #edf4f8; }
:root[data-theme="light"] .button-secondary:hover { color: var(--text); background: #dceaf2; }
:root[data-theme="light"] .alert-warning { color: #6e4700; background: #fff6df; }
:root[data-theme="light"] .alert-danger { color: #8d1f33; background: #fff0f3; }
:root[data-theme="light"] .alert-success { color: #08663f; background: #eaf9f1; }
:root[data-theme="light"] .alert-info { color: #075f93; background: #eaf6fd; }
:root[data-theme="light"] .badge-success { color: #08663f; background: #dff6e9; }
:root[data-theme="light"] .badge-danger { color: #8d1f33; background: #fde5e9; }
:root[data-theme="light"] .badge-warning { color: #7a5000; background: #fff0cc; }
:root[data-theme="light"] .badge-info { color: #075f93; background: #dff2fd; }
:root[data-theme="light"] .badge-neutral { color: #4d6575; background: #e5edf2; }

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