:root {
  color-scheme: dark;
  --bg: #07110f;
  --bg-soft: #0a1714;
  --sidebar: #081411;
  --panel: #0d1c18;
  --panel-2: #10241e;
  --panel-3: #142a23;
  --border: rgba(173, 219, 199, 0.12);
  --border-strong: rgba(173, 219, 199, 0.2);
  --text: #f2f8f5;
  --muted: #91a79d;
  --dim: #60766c;
  --mint: #77f2bd;
  --mint-strong: #30d990;
  --mint-soft: rgba(119, 242, 189, 0.1);
  --gold: #f0bc5e;
  --gold-soft: rgba(240, 188, 94, 0.12);
  --red: #ff786e;
  --red-soft: rgba(255, 120, 110, 0.11);
  --blue: #78a9ff;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.25);
  --radius: 14px;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body {
  margin: 0;
  background:
    radial-gradient(circle at 88% -10%, rgba(48, 217, 144, 0.08), transparent 32rem),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  min-height: 100vh;
}
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 2px;
}
.is-hidden { display: none !important; }
.align-right { text-align: right; }

.login {
  align-items: center;
  background:
    linear-gradient(rgba(119, 242, 189, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(119, 242, 189, 0.035) 1px, transparent 1px),
    #06100d;
  background-size: 48px 48px;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  overflow: hidden;
  padding: 24px;
  position: relative;
}
.login-glow {
  border-radius: 999px;
  filter: blur(100px);
  opacity: 0.35;
  pointer-events: none;
  position: absolute;
}
.login-glow-a { background: #19c77d; height: 320px; right: 8%; top: -150px; width: 320px; }
.login-glow-b { background: #9e6f22; bottom: -180px; height: 360px; left: 4%; width: 360px; }
.login-card {
  backdrop-filter: blur(18px);
  background: linear-gradient(145deg, rgba(17, 39, 32, 0.96), rgba(8, 22, 18, 0.96));
  border: 1px solid var(--border-strong);
  border-radius: 22px;
  box-shadow: var(--shadow);
  max-width: 440px;
  padding: 42px;
  position: relative;
  width: 100%;
}
.login-card::before {
  background: linear-gradient(90deg, transparent, var(--mint), var(--gold), transparent);
  border-radius: 22px 22px 0 0;
  content: "";
  height: 2px;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
}
.brand-mark {
  align-items: flex-end;
  background: var(--mint-soft);
  border: 1px solid rgba(119, 242, 189, 0.22);
  border-radius: 12px;
  display: flex;
  gap: 3px;
  height: 44px;
  justify-content: center;
  margin-bottom: 28px;
  padding: 11px;
  width: 44px;
}
.brand-mark span { background: var(--mint); border-radius: 2px; display: block; width: 5px; }
.brand-mark span:nth-child(1) { height: 10px; }
.brand-mark span:nth-child(2) { height: 20px; }
.brand-mark span:nth-child(3) { background: var(--gold); height: 15px; }
.brand-mark-small { border-radius: 9px; height: 34px; margin: 0; padding: 8px; width: 34px; }
.brand-mark-small span { width: 4px; }
.eyebrow, .panel-kicker, .nav-label {
  color: var(--mint);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  margin: 0;
  text-transform: uppercase;
}
.login-card h1 { font-size: clamp(30px, 7vw, 42px); letter-spacing: -0.045em; line-height: 1; margin: 8px 0 14px; }
.login-copy { color: var(--muted); font-size: 15px; line-height: 1.65; margin: 0 0 30px; }
.login-card label { color: #bfd0c8; display: block; font-size: 12px; font-weight: 650; margin: 0 0 8px; }
.password-row { display: flex; margin-bottom: 14px; position: relative; }
input, select, textarea {
  background: rgba(5, 15, 12, 0.85);
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  color: var(--text);
  min-height: 40px;
  padding: 0 12px;
}
input::placeholder, textarea::placeholder { color: var(--dim); }
input:hover, select:hover, textarea:hover { border-color: rgba(119, 242, 189, 0.3); }
.password-row input { font-family: var(--mono); padding-right: 70px; width: 100%; }
.icon-button {
  background: transparent;
  border: 0;
  color: var(--mint);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 10px;
  position: absolute;
  right: 8px;
  top: 11px;
}
.button {
  align-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  cursor: pointer;
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  gap: 10px;
  justify-content: center;
  min-height: 39px;
  padding: 0 15px;
  transition: 150ms ease;
}
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: 0.45; transform: none; }
.button-primary {
  background: var(--mint);
  border-color: var(--mint);
  box-shadow: 0 8px 26px rgba(48, 217, 144, 0.16);
  color: #062016;
}
.button-primary:hover { background: #91f8ca; }
.button-quiet { background: var(--panel); color: #c6d7cf; }
.button-danger { background: var(--red-soft); border-color: rgba(255, 120, 110, 0.35); color: var(--red); }
.button-full { justify-content: space-between; margin-top: 4px; width: 100%; }
.text-button {
  background: transparent;
  border: 0;
  color: var(--mint);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  padding: 4px 0;
  text-transform: uppercase;
}
.form-error { color: var(--red); font-size: 12px; min-height: 18px; }
.security-note { border-top: 1px solid var(--border); color: var(--dim); font-family: var(--mono); font-size: 9px; margin-top: 14px; padding-top: 16px; text-align: center; }
.lock-icon { color: var(--mint); font-size: 7px; margin-right: 5px; }

.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  background: linear-gradient(180deg, rgba(10, 25, 20, 0.98), rgba(5, 15, 12, 0.98));
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  left: 0;
  position: sticky;
  top: 0;
  z-index: 40;
}
.sidebar-brand { align-items: center; border-bottom: 1px solid var(--border); display: flex; gap: 11px; min-height: 76px; padding: 18px; }
.sidebar-brand strong { display: block; font-size: 14px; letter-spacing: -0.02em; }
.sidebar-brand small { color: var(--dim); display: block; font-family: var(--mono); font-size: 8px; letter-spacing: 0.08em; margin-top: 4px; text-transform: uppercase; }
.nav { padding: 18px 12px; }
.nav-label { color: var(--dim); font-size: 8px; margin: 18px 11px 8px; }
.nav-label:first-child { margin-top: 0; }
.nav-item {
  align-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9px;
  color: #789087;
  cursor: pointer;
  display: flex;
  font-size: 12px;
  font-weight: 600;
  gap: 10px;
  margin: 2px 0;
  min-height: 42px;
  padding: 0 11px;
  text-align: left;
  transition: 120ms ease;
  width: 100%;
}
.nav-item:hover { background: rgba(119, 242, 189, 0.05); color: #cce0d6; }
.nav-item.is-active { background: var(--mint-soft); border-color: rgba(119, 242, 189, 0.16); color: var(--mint); }
.nav-icon { align-items: center; display: flex; font-family: var(--mono); font-size: 16px; justify-content: center; width: 18px; }
.nav-count { background: rgba(255, 255, 255, 0.05); border-radius: 99px; color: var(--muted); font: 700 9px/1 var(--mono); margin-left: auto; padding: 5px 7px; }
.nav-item.is-active .nav-count { background: rgba(119, 242, 189, 0.12); color: var(--mint); }
.live-dot, .status-beacon {
  background: var(--mint-strong);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(48, 217, 144, 0.1);
  display: inline-block;
  height: 7px;
  margin-left: auto;
  width: 7px;
}
.status-beacon { animation: pulse 2s infinite; margin: 0; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(48, 217, 144, 0); opacity: 0.7; } }
.sidebar-status { border-top: 1px solid var(--border); margin-top: auto; padding: 17px 20px 20px; }
.status-line { align-items: center; color: #bed3ca; display: flex; font-size: 10px; font-weight: 650; gap: 9px; }
.sidebar-status p { color: var(--dim); font: 9px/1.5 var(--mono); margin: 8px 0 10px; }

.main { min-width: 0; }
.topbar {
  align-items: center;
  backdrop-filter: blur(18px);
  background: rgba(7, 17, 15, 0.86);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  min-height: 76px;
  padding: 13px clamp(18px, 3vw, 34px);
  position: sticky;
  top: 0;
  z-index: 30;
}
.topbar-title { align-items: center; display: flex; gap: 12px; }
.topbar h2 { font-size: 21px; letter-spacing: -0.03em; margin: 4px 0 0; }
.topbar .eyebrow { color: var(--dim); font-size: 8px; }
.topbar-actions { align-items: center; display: flex; gap: 12px; }
.range-control {
  background: rgba(5, 15, 12, 0.7);
  border: 1px solid var(--border);
  border-radius: 9px;
  display: flex;
  padding: 3px;
}
.range-control button {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--dim);
  cursor: pointer;
  font: 700 9px/1 var(--mono);
  padding: 8px 9px;
}
.range-control button.is-active { background: var(--panel-3); color: var(--mint); }
.updated { color: var(--dim); font: 9px/1.4 var(--mono); }
.mobile-menu { background: transparent; border: 0; cursor: pointer; display: none; font-size: 20px; padding: 6px; }
.notice { background: var(--gold-soft); border-bottom: 1px solid rgba(240, 188, 94, 0.22); color: #f6d69b; font-size: 11px; padding: 11px 34px; }
.view { display: none; padding: clamp(18px, 3vw, 34px); }
.view.is-active { display: block; }

.metric-grid { display: grid; gap: 12px; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 16px; }
.metric {
  background: linear-gradient(145deg, rgba(15, 35, 29, 0.95), rgba(10, 26, 21, 0.95));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-height: 136px;
  overflow: hidden;
  padding: 20px;
  position: relative;
}
.metric::after { background: var(--mint); bottom: 0; content: ""; height: 2px; left: 20px; opacity: 0.2; position: absolute; right: 20px; }
.metric-accent {
  background:
    radial-gradient(circle at 90% 0%, rgba(119, 242, 189, 0.18), transparent 45%),
    linear-gradient(145deg, #123026, #0c211a);
  border-color: rgba(119, 242, 189, 0.2);
}
.metric-head { align-items: center; color: var(--muted); display: flex; font-family: var(--mono); font-size: 9px; font-weight: 700; justify-content: space-between; letter-spacing: 0.09em; text-transform: uppercase; }
.metric-icon { align-items: center; background: var(--mint-soft); border-radius: 7px; color: var(--mint); display: flex; font-size: 13px; height: 28px; justify-content: center; width: 28px; }
.metric-icon-warn { background: var(--gold-soft); color: var(--gold); }
.metric strong { display: block; font: 700 31px/1 var(--mono); letter-spacing: -0.05em; margin: 17px 0 8px; }
.metric small { color: var(--dim); font-size: 10px; }

.dashboard-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr); }
.panel {
  background: linear-gradient(145deg, rgba(14, 32, 27, 0.96), rgba(10, 25, 21, 0.96));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.09);
  min-width: 0;
  overflow: hidden;
}
.panel-wide { grid-column: 1 / -1; }
.panel-flush { min-height: 200px; }
.panel-heading { align-items: center; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; min-height: 67px; padding: 15px 18px; }
.panel-kicker { color: var(--dim); font-size: 8px; margin-bottom: 6px; }
.panel h3, .modal h3 { font-size: 14px; letter-spacing: -0.015em; margin: 0; }
.legend { color: var(--dim); font: 9px/1 var(--mono); }
.legend-dot { background: var(--mint); border-radius: 50%; display: inline-block; height: 6px; margin-right: 5px; width: 6px; }
.chart { min-height: 220px; padding: 20px 18px 14px; }
.chart svg { display: block; height: 190px; overflow: visible; width: 100%; }
.chart-line { fill: none; filter: drop-shadow(0 8px 12px rgba(48, 217, 144, 0.2)); stroke: var(--mint); stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.2; }
.chart-area { fill: url("#traffic-gradient"); }
.chart-grid { stroke: rgba(173, 219, 199, 0.08); stroke-width: 1; }
.chart-label { fill: var(--dim); font: 8px var(--mono); }
.chart-empty { align-items: center; color: var(--dim); display: flex; font: 10px var(--mono); justify-content: center; min-height: 180px; }

.health-list { padding: 5px 18px; }
.health-row { align-items: center; border-bottom: 1px solid var(--border); display: grid; gap: 10px; grid-template-columns: 10px minmax(0, 1fr) auto; min-height: 58px; }
.health-row:last-child { border-bottom: 0; }
.health-indicator { background: var(--dim); border-radius: 50%; height: 8px; width: 8px; }
.health-indicator.operational { background: var(--mint-strong); box-shadow: 0 0 12px rgba(48, 217, 144, 0.45); }
.health-indicator.degraded { background: var(--gold); }
.health-indicator.down { background: var(--red); }
.health-name { font-size: 11px; font-weight: 700; }
.health-meta { color: var(--dim); font: 8px/1.6 var(--mono); }
.health-latency { color: var(--muted); font: 10px var(--mono); text-align: right; }
.service-bars { padding: 12px 18px 18px; }
.service-bar { margin: 13px 0; }
.service-bar-head { display: flex; font-size: 10px; justify-content: space-between; margin-bottom: 7px; }
.service-bar-head span:last-child { color: var(--muted); font-family: var(--mono); }
.bar-track { background: rgba(255, 255, 255, 0.04); border-radius: 99px; height: 5px; overflow: hidden; }
.bar-fill { background: linear-gradient(90deg, var(--mint-strong), var(--mint)); border-radius: inherit; height: 100%; min-width: 2px; }

.table-wrap { overflow: auto; }
table { border-collapse: collapse; min-width: 760px; width: 100%; }
th {
  background: rgba(5, 15, 12, 0.34);
  color: var(--dim);
  font: 700 8px/1 var(--mono);
  letter-spacing: 0.08em;
  padding: 11px 16px;
  text-align: left;
  text-transform: uppercase;
}
td { border-top: 1px solid var(--border); color: #c3d5cd; font-size: 10px; padding: 12px 16px; vertical-align: middle; }
tbody tr { transition: background 100ms ease; }
tbody tr:hover { background: rgba(119, 242, 189, 0.025); }
.mono { font-family: var(--mono); }
.endpoint { color: #dbeae3; font-family: var(--mono); max-width: 330px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.method { color: var(--blue); font: 700 9px var(--mono); }
.badge { border: 1px solid var(--border); border-radius: 99px; display: inline-flex; font: 700 8px/1 var(--mono); padding: 5px 7px; text-transform: uppercase; }
.badge-success { background: var(--mint-soft); border-color: rgba(119, 242, 189, 0.19); color: var(--mint); }
.badge-warn { background: var(--gold-soft); border-color: rgba(240, 188, 94, 0.22); color: var(--gold); }
.badge-error { background: var(--red-soft); border-color: rgba(255, 120, 110, 0.24); color: var(--red); }
.badge-neutral { color: var(--muted); }
.empty-row td { color: var(--dim); font: 10px/1.6 var(--mono); padding: 30px; text-align: center; }

.section-heading { align-items: center; display: flex; justify-content: space-between; margin-bottom: 16px; min-height: 42px; }
.section-copy { color: var(--muted); font-size: 12px; line-height: 1.6; margin: 0; max-width: 650px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-row select, .filter-row input { color: #b7cbc1; font-size: 10px; min-height: 38px; }
.filter-row input { min-width: 220px; }
.service-grid { display: grid; gap: 14px; grid-template-columns: repeat(3, minmax(250px, 1fr)); }
.service-card {
  background:
    radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--service-color) 12%, transparent), transparent 44%),
    linear-gradient(145deg, rgba(15, 35, 29, 0.97), rgba(9, 24, 19, 0.97));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-height: 225px;
  overflow: hidden;
  padding: 20px;
  position: relative;
}
.service-card::before { background: var(--service-color); content: ""; height: 2px; left: 0; position: absolute; right: 0; top: 0; }
.service-card-head { align-items: flex-start; display: flex; justify-content: space-between; }
.service-card h3 { font-size: 16px; margin: 0 0 6px; }
.service-slug { color: var(--dim); font: 8px var(--mono); }
.service-url { color: var(--muted); font: 9px/1.5 var(--mono); margin: 18px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.service-stats { display: grid; gap: 8px; grid-template-columns: repeat(3, 1fr); }
.service-stat { background: rgba(4, 14, 11, 0.48); border: 1px solid var(--border); border-radius: 8px; padding: 10px; }
.service-stat strong { display: block; font: 700 14px/1 var(--mono); }
.service-stat small { color: var(--dim); display: block; font: 7px/1.3 var(--mono); margin-top: 5px; text-transform: uppercase; }
.service-card-actions { align-items: center; display: flex; justify-content: space-between; margin-top: 17px; }
.service-card-actions .health-meta { text-align: right; }
.action-menu { display: flex; gap: 5px; justify-content: flex-end; }
.action-button {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  font: 700 8px/1 var(--mono);
  padding: 7px 8px;
  text-transform: uppercase;
}
.action-button:hover { border-color: rgba(119, 242, 189, 0.3); color: var(--mint); }
.action-button.danger:hover { border-color: rgba(255, 120, 110, 0.4); color: var(--red); }
.customer-name { color: var(--text); font-size: 11px; font-weight: 700; }
.customer-email { color: var(--dim); font: 8px/1.6 var(--mono); }
.key-display { color: #b8cec3; font: 9px var(--mono); }
.traffic-heading { align-items: center; }
.live-control { align-items: center; color: var(--muted); display: flex; font: 9px var(--mono); gap: 8px; }
.live-control .live-dot { margin: 0; }
.traffic-strip { border-bottom: 1px solid var(--border); display: flex; gap: 2px; height: 34px; overflow: hidden; padding: 8px 16px; }
.traffic-pip { align-self: flex-end; background: var(--mint-strong); border-radius: 1px; flex: 1; max-width: 8px; min-height: 2px; opacity: 0.5; }
.traffic-pip.error { background: var(--red); opacity: 0.85; }

.modal-backdrop {
  align-items: center;
  backdrop-filter: blur(10px);
  background: rgba(1, 7, 5, 0.72);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 20px;
  position: fixed;
  z-index: 100;
}
.modal {
  background: linear-gradient(145deg, #11261f, #091914);
  border: 1px solid var(--border-strong);
  border-radius: 17px;
  box-shadow: var(--shadow);
  max-height: min(760px, calc(100vh - 40px));
  max-width: 610px;
  overflow: auto;
  width: 100%;
}
.modal-heading { align-items: center; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; padding: 19px 22px; }
.modal-close { background: transparent; border: 0; color: var(--muted); cursor: pointer; font-size: 24px; }
.modal-body { padding: 22px; }
.form-grid { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.field { min-width: 0; }
.field-full { grid-column: 1 / -1; }
.field label { color: #9eb3aa; display: block; font-size: 10px; font-weight: 650; margin-bottom: 7px; }
.field input, .field select, .field textarea { width: 100%; }
.field textarea { min-height: 78px; padding-top: 10px; resize: vertical; }
.field-help { color: var(--dim); font: 8px/1.5 var(--mono); margin-top: 5px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 22px; }
.secret-box { background: rgba(4, 14, 11, 0.7); border: 1px solid rgba(119, 242, 189, 0.25); border-radius: 10px; margin: 16px 0; padding: 16px; }
.secret-box code { color: var(--mint); display: block; font: 11px/1.6 var(--mono); overflow-wrap: anywhere; }
.warning-box { background: var(--gold-soft); border: 1px solid rgba(240, 188, 94, 0.22); border-radius: 9px; color: #eacb95; font-size: 10px; line-height: 1.6; padding: 12px; }
.danger-box { background: var(--red-soft); border-color: rgba(255, 120, 110, 0.25); color: #ffaaa3; }

.toast-region { bottom: 22px; display: grid; gap: 8px; max-width: 360px; position: fixed; right: 22px; z-index: 150; }
.toast {
  animation: toast-in 180ms ease-out;
  background: #173127;
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--mint);
  border-radius: 9px;
  box-shadow: var(--shadow);
  color: #dceae4;
  font-size: 11px;
  line-height: 1.5;
  padding: 12px 15px;
}
.toast.error { border-left-color: var(--red); }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } }
.skeleton { animation: shimmer 1.4s linear infinite; background: linear-gradient(90deg, rgba(255,255,255,.025), rgba(255,255,255,.065), rgba(255,255,255,.025)); background-size: 200% 100%; border-radius: 6px; }
.skeleton-row { height: 42px; margin: 10px 0; }
@keyframes shimmer { to { background-position: -200% 0; } }

@media (max-width: 1100px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .panel-wide { grid-column: auto; }
  .service-grid { grid-template-columns: repeat(2, minmax(250px, 1fr)); }
  .updated { display: none; }
}

@media (max-width: 760px) {
  .shell { display: block; }
  .sidebar { box-shadow: var(--shadow); position: fixed; transform: translateX(-102%); transition: transform 180ms ease; width: 236px; }
  .sidebar.is-open { transform: translateX(0); }
  .mobile-menu { display: block; }
  .topbar { min-height: 68px; }
  .topbar-actions .button { display: none; }
  .range-control button { padding: 7px; }
  .view { padding: 18px 14px 34px; }
  .notice { padding: 10px 14px; }
  .metric-grid { gap: 9px; grid-template-columns: 1fr 1fr; }
  .metric { min-height: 120px; padding: 15px; }
  .metric strong { font-size: 25px; }
  .service-grid { grid-template-columns: 1fr; }
  .section-heading { align-items: stretch; flex-direction: column; gap: 12px; }
  .section-heading .button { align-self: flex-start; }
  .filter-row { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .filter-row input { grid-column: 1 / -1; min-width: 0; }
  .traffic-heading .live-control { align-self: flex-start; }
}

@media (max-width: 480px) {
  .login-card { padding: 30px 22px; }
  .topbar { padding: 10px 12px; }
  .topbar-title .eyebrow { display: none; }
  .range-control button:nth-child(1), .range-control button:nth-child(3) { display: none; }
  .metric-grid { grid-template-columns: 1fr; }
  .metric { min-height: 112px; }
  .form-grid { grid-template-columns: 1fr; }
  .field-full { grid-column: auto; }
  .modal-backdrop { padding: 10px; }
  .modal-body { padding: 18px; }
}

/* control-plane/1 authority strip */
.cp-truth { margin: 0 0 18px; padding: 12px 14px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--panel); display: grid; gap: 10px; }
.cp-truth[hidden] { display: none; }
.cp-truth-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.cp-truth-title { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.cp-mode, .cp-drift { font: 600 12px var(--mono); padding: 4px 9px; border-radius: 999px; border: 1px solid var(--border-strong); }
.cp-mode-mirror_mode, .cp-mode-migration_mode { color: var(--gold); background: var(--gold-soft); }
.cp-mode-source_of_truth { color: var(--mint); background: var(--mint-soft); }
.cp-drift.is-drift { color: var(--red); background: var(--red-soft); }
.cp-drift.is-zero { color: var(--mint); background: var(--mint-soft); }
.cp-products { display: flex; flex-wrap: wrap; gap: 8px; }
.cp-chip { display: inline-flex; gap: 8px; align-items: center; font: 12px var(--mono); padding: 4px 9px; border-radius: 8px; border: 1px solid var(--border); color: var(--muted); }
.cp-chip strong { color: var(--text); font-weight: 600; }
.cp-state-controlled span { color: var(--mint); }
.cp-state-mirrored span, .cp-state-partial span { color: var(--gold); }
.cp-state-unmanaged span { color: var(--red); }
