:root {
  --bg-night: #061221;
  --bg-deep: #020812;
  --bg-panel: rgba(5, 20, 36, 0.82);
  --bg-panel-strong: rgba(7, 29, 51, 0.92);
  --line-soft: rgba(113, 180, 228, 0.22);
  --line-strong: rgba(113, 180, 228, 0.4);
  --text-main: #ecf5ff;
  --text-muted: #97b1c8;
  --text-dim: #6f8ca7;
  --ok: #22d4a9;
  --warn: #f4ba53;
  --critical: #ff6c73;
  --accent: #62c5ff;
  --accent-2: #3f86ff;
  --font-ui: "Space Grotesk", "Avenir Next", "Trebuchet MS", sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Menlo, monospace;
  --shadow-soft: 0 8px 30px rgba(0, 0, 0, 0.25);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: var(--font-ui);
  color: var(--text-main);
  background:
    radial-gradient(circle at 12% 8%, rgba(49, 108, 174, 0.35), transparent 38%),
    radial-gradient(circle at 86% 12%, rgba(0, 126, 167, 0.3), transparent 34%),
    linear-gradient(160deg, var(--bg-night), var(--bg-deep));
}

canvas,
img,
svg {
  max-width: 100%;
}

.shell {
  width: min(1440px, calc(100% - clamp(16px, 3vw, 40px)));
  margin: 18px auto 30px;
}

.shell-dashboard {
  display: grid;
  gap: 14px;
}

.console-nav-shell {
  min-height: 108px;
  width: 100%;
}

.masthead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 4px;
  min-height: 112px;
}

.eyebrow {
  margin: 0;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0.01em;
}

.masthead h1 {
  margin-top: 4px;
  font-size: clamp(1.4rem, 1.35vw + 1rem, 2.15rem);
  line-height: 1.2;
}

.subline {
  margin: 7px 0 0;
  color: var(--text-muted);
  font-size: 0.92rem;
  min-height: 1.3em;
}

.page-masthead .subline {
  min-height: 2.5em;
  line-height: 1.35;
}

.control-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

button,
select,
input {
  min-height: 44px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(6, 24, 42, 0.88);
  color: var(--text-main);
  padding: 10px 12px;
  font: inherit;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

input::placeholder {
  color: var(--text-dim);
}

button {
  cursor: pointer;
  font-weight: 600;
}

button:hover,
select:hover,
input:hover,
input:focus,
select:focus,
button:focus {
  outline: none;
  border-color: var(--line-strong);
}

button:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 2px solid rgba(98, 197, 255, 0.72);
  outline-offset: 1px;
}

button:disabled {
  opacity: 0.65;
  cursor: progress;
}

button.danger {
  background: rgba(72, 13, 25, 0.84);
  border-color: rgba(255, 108, 115, 0.35);
}

.health-strip,
.kpi-grid {
  display: grid;
  gap: 12px;
}

.health-strip {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.kpi-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.health-item,
.kpi-item,
.panel {
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: var(--bg-panel);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-soft);
}

.health-item,
.kpi-item {
  padding: 12px 14px;
  min-height: 92px;
}

.health-label,
.kpi-label,
.meta {
  color: var(--text-muted);
}

.health-label,
.kpi-label {
  font-size: 0.8rem;
  margin-bottom: 6px;
}

.health-value,
.kpi-value {
  font-size: clamp(1.1rem, 1.3vw + 0.72rem, 1.9rem);
  font-weight: 700;
  line-height: 1.2;
}

.kpi-sub,
.health-sub {
  margin-top: 6px;
  color: var(--text-dim);
  font-size: 0.84rem;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.delta {
  font-size: 0.77rem;
  border-radius: 999px;
  padding: 3px 9px;
  border: 1px solid transparent;
  margin-left: 6px;
}

.delta.up.good,
.badge.secure,
.badge.info,
.badge.resolved,
.badge.sent,
.badge.success {
  color: var(--ok);
  border-color: rgba(34, 212, 169, 0.35);
  background: rgba(34, 212, 169, 0.12);
}

.delta.up.bad,
.delta.down.bad,
.badge.critical,
.badge.failed,
.badge.high,
.badge.active-critical {
  color: var(--critical);
  border-color: rgba(255, 108, 115, 0.36);
  background: rgba(255, 108, 115, 0.13);
}

.delta.down.good,
.delta.flat,
.badge.warning,
.badge.warn,
.badge.retrying,
.badge.active-warning,
.badge.queued,
.badge.processing {
  color: var(--warn);
  border-color: rgba(244, 186, 83, 0.35);
  background: rgba(244, 186, 83, 0.12);
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 3px 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.72rem;
  font-weight: 600;
  border: 1px solid transparent;
}

.insight-grid,
.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 12px;
}

.insight-grid > *,
.main-grid > *,
.side-stack > * {
  min-width: 0;
}

.panel {
  padding: 14px;
}

.panel-head {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
  min-width: 0;
}

.panel-head h2,
.panel-head h3 {
  font-size: 1.08rem;
  line-height: 1.3;
}

.meta {
  margin: 4px 0 0;
  font-size: 0.85rem;
  line-height: 1.4;
}

.chart-shell {
  margin-top: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--bg-panel-strong);
  padding: 10px;
  min-height: 320px;
}

.chart-shell.small {
  min-height: 260px;
}

.chart-shell canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.action-plan {
  margin-top: 12px;
  border: 1px dashed var(--line-soft);
  border-radius: 12px;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.action-plan .title {
  font-size: 1.03rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.action-plan .body {
  color: var(--text-muted);
  line-height: 1.45;
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.action-plan .focus-line {
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(5, 30, 56, 0.65);
  border: 1px solid rgba(98, 197, 255, 0.24);
  display: grid;
  gap: 6px;
}

.between {
  align-items: center;
}

.log-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.log-controls input {
  min-width: 240px;
}

.table-wrap {
  margin-top: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  max-height: 520px;
  overflow: auto;
  background: rgba(8, 30, 52, 0.55);
}

table {
  width: 100%;
  min-width: 940px;
  border-collapse: collapse;
  font-size: 0.86rem;
}

thead {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(11, 41, 70, 0.97);
}

th,
td {
  text-align: left;
  padding: 9px 10px;
  border-bottom: 1px solid rgba(120, 171, 215, 0.15);
  vertical-align: top;
}

th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  white-space: nowrap;
}

td {
  white-space: nowrap;
}

td:nth-child(2),
td.request-id,
td.error-cell {
  white-space: normal;
  overflow-wrap: anywhere;
}

td.mono {
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.process-command {
  display: inline-block;
  max-width: 100%;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  overflow-wrap: anywhere;
  white-space: normal;
}

tbody tr:hover {
  background: rgba(18, 56, 89, 0.33);
}

.side-stack {
  display: grid;
  gap: 12px;
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.mini-item {
  border: 1px dashed var(--line-soft);
  border-radius: 10px;
  padding: 9px;
}

.mini-item p {
  margin: 0;
}

.mini-item .value {
  margin-top: 6px;
  font-weight: 700;
  font-size: 1.02rem;
  overflow-wrap: anywhere;
}

.diagnostics {
  margin-top: 12px;
  display: grid;
  gap: 7px;
}

.diagnostics p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.alert-summary {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.alert-list {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
  max-height: 500px;
  overflow: auto;
}

.alert-item {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 10px;
  background: rgba(8, 31, 54, 0.65);
}

.alert-item .top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 6px;
}

.alert-item p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.empty-state {
  color: var(--text-dim);
  font-size: 0.9rem;
  padding: 12px;
  text-align: center;
}

.empty-cell {
  white-space: normal;
  text-align: center;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.auth-card {
  width: min(480px, 100%);
  background: var(--bg-panel);
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  padding: 24px;
  backdrop-filter: blur(10px);
}

.auth-card h1 {
  margin: 0;
  font-size: 1.52rem;
}

.auth-card p {
  margin: 8px 0 14px;
  color: var(--text-muted);
}

.auth-section {
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 12px;
  background: rgba(6, 27, 46, 0.8);
}

.auth-section[hidden] {
  display: none !important;
}

.auth-section-secondary {
  background: rgba(8, 24, 40, 0.8);
}

.auth-section + .auth-section,
.auth-section + .auth-fallback {
  margin-top: 12px;
}

.auth-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.auth-section h2 {
  margin: 0;
  font-size: 1.01rem;
}

.auth-hint {
  margin: 8px 0;
  color: var(--text-dim);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.auth-actions {
  display: grid;
  margin-bottom: 10px;
}

.auth-card label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-muted);
  font-size: 0.86rem;
}

.auth-card input {
  width: 100%;
  margin-bottom: 12px;
}

.auth-card form {
  margin: 0;
}

.auth-card button {
  width: 100%;
}

.auth-fallback {
  margin-top: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(5, 20, 36, 0.7);
  padding: 8px 10px;
}

.auth-fallback > summary {
  cursor: pointer;
  color: var(--text-muted);
  font-weight: 600;
  list-style: none;
}

.auth-fallback > summary::-webkit-details-marker {
  display: none;
}

.auth-fallback > form {
  margin-top: 10px;
}

.error {
  color: var(--critical);
  min-height: 1.2em;
  font-size: 0.92rem;
}

.auth-meta {
  margin: 6px 0 0;
  min-height: 1.2em;
  color: var(--text-dim);
  font-size: 0.86rem;
}

.console-nav-shell {
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: rgba(4, 22, 39, 0.92);
  box-shadow: var(--shadow-soft);
  padding: 10px 12px;
  display: grid;
  gap: 10px;
}

.console-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.84rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.console-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, #7efbe6, #1bb6a6);
  box-shadow: 0 0 10px rgba(34, 212, 169, 0.55);
}

.console-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.console-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border-radius: 999px;
  border: 1px solid rgba(98, 197, 255, 0.22);
  background: rgba(8, 33, 58, 0.72);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 600;
  padding: 8px 14px;
  transition: border-color 0.14s ease, color 0.14s ease, background 0.14s ease;
}

.console-tab:hover {
  color: var(--text-main);
  border-color: rgba(98, 197, 255, 0.52);
}

.console-tab.active {
  color: var(--text-main);
  border-color: rgba(98, 197, 255, 0.72);
  background: linear-gradient(135deg, rgba(18, 72, 113, 0.95), rgba(10, 48, 82, 0.95));
}

.page-masthead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  padding: 4px 2px;
  min-height: 112px;
}

.ops-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--bg-panel);
  padding: 10px 12px;
}

.ops-subnav-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(98, 197, 255, 0.25);
  background: rgba(8, 33, 58, 0.7);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 12px;
  transition: border-color 0.14s ease, color 0.14s ease, background 0.14s ease;
}

.ops-subnav-chip:hover {
  color: var(--text-main);
  border-color: rgba(98, 197, 255, 0.55);
}

.ops-subnav-chip.active {
  color: var(--text-main);
  border-color: rgba(98, 197, 255, 0.72);
  background: linear-gradient(135deg, rgba(18, 72, 113, 0.95), rgba(10, 48, 82, 0.95));
}

.page-grid {
  display: grid;
  gap: 12px;
}

.ops-filter-row {
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--bg-panel);
  padding: 10px 12px;
}

.ops-filter-row .control-row {
  flex-wrap: wrap;
}

.ops-filter-row select {
  flex: 1 1 180px;
}

.ops-filter-row .meta {
  margin-top: 8px;
}

.page-grid > * {
  min-width: 0;
}

.page-grid-1 {
  grid-template-columns: 1fr;
}

.page-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.page-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.page-grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.summary-item {
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: var(--bg-panel);
  box-shadow: var(--shadow-soft);
  padding: 12px 14px;
  min-height: 96px;
}

.summary-label {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-bottom: 6px;
}

.summary-value {
  font-size: clamp(1.08rem, 1.2vw + 0.76rem, 1.82rem);
  font-weight: 700;
  line-height: 1.2;
}

.summary-sub {
  margin-top: 8px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--text-dim);
  font-size: 0.84rem;
}

.panel-body {
  margin-top: 10px;
  min-width: 0;
}

.kv-list {
  display: grid;
  gap: 8px;
}

.kv-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  border-bottom: 1px dashed rgba(120, 171, 215, 0.2);
  padding-bottom: 7px;
}

.kv-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.kv-row span {
  color: var(--text-muted);
  font-size: 0.86rem;
}

.kv-row strong {
  color: var(--text-main);
  font-size: 0.92rem;
  overflow-wrap: anywhere;
}

.page-table-wrap {
  max-height: none;
}

.page-table-wrap table {
  min-width: 0;
}

.probe-status {
  display: grid;
  gap: 8px;
}

.probe-status p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.ops-hints {
  display: grid;
  gap: 8px;
}

.ops-hint-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.ops-hints code {
  display: block;
  overflow-wrap: anywhere;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(6, 24, 42, 0.84);
  color: var(--text-main);
  padding: 8px 10px;
}

.ops-copy-btn {
  min-height: 40px;
  padding: 8px 12px;
  white-space: nowrap;
}

.ops-runner {
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(7, 25, 43, 0.65);
  padding: 10px;
  display: grid;
  gap: 10px;
}

.ops-runner.running {
  border-color: rgba(244, 186, 83, 0.45);
}

.ops-command-list {
  display: grid;
  gap: 10px;
}

.ops-command-card {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(6, 24, 42, 0.82);
  padding: 10px;
  display: grid;
  gap: 8px;
}

.ops-command-card code {
  display: block;
  border: 1px solid rgba(120, 171, 215, 0.25);
  border-radius: 8px;
  background: rgba(4, 18, 33, 0.88);
  padding: 8px;
  overflow-wrap: anywhere;
}

.ops-command-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.ops-console-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.ops-console-toolbar .meta {
  flex: 1 1 220px;
  margin: 0;
}

.ops-console-output {
  margin: 0;
  min-height: 200px;
  max-height: 340px;
  overflow: auto;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(3, 13, 24, 0.95);
  padding: 10px;
  color: #d8e9fb;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.ops-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(98, 197, 255, 0.25);
  border-top-color: rgba(98, 197, 255, 0.95);
  border-radius: 999px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.ops-spinner.active {
  opacity: 1;
  animation: ops-spin 0.8s linear infinite;
}

@keyframes ops-spin {
  to {
    transform: rotate(360deg);
  }
}

.toast-mount {
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 9999;
  display: grid;
  gap: 8px;
  width: min(380px, calc(100vw - 24px));
  pointer-events: none;
}

.ops-toast {
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  background: rgba(5, 26, 45, 0.95);
  color: var(--text-main);
  box-shadow: var(--shadow-soft);
  padding: 10px 12px;
  font-size: 0.86rem;
  line-height: 1.35;
  transform: translateY(0);
  opacity: 1;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.ops-toast.secure {
  border-color: rgba(34, 212, 169, 0.45);
}

.ops-toast.warning {
  border-color: rgba(244, 186, 83, 0.45);
}

.ops-toast.critical {
  border-color: rgba(255, 108, 115, 0.55);
}

.ops-toast.hide {
  opacity: 0;
  transform: translateY(6px);
}

.ops-visual-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.ops-bar-chart {
  display: grid;
  gap: 10px;
}

.ops-bar-row {
  display: grid;
  grid-template-columns: minmax(84px, 130px) minmax(0, 1fr) minmax(120px, 180px);
  gap: 10px;
  align-items: center;
}

.ops-bar-label {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.ops-bar-track {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(120, 171, 215, 0.14);
}

.ops-bar-segment {
  display: block;
  min-height: 10px;
}

.ops-bar-segment.secure {
  background: rgba(34, 212, 169, 0.88);
}

.ops-bar-segment.warning {
  background: rgba(244, 186, 83, 0.9);
}

.ops-bar-segment.critical {
  background: rgba(255, 108, 115, 0.92);
}

.ops-bar-meta {
  color: var(--text-dim);
  font-size: 0.78rem;
  text-align: right;
  overflow-wrap: anywhere;
}

.process-command {
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 1280px) {
  .health-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .page-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .page-grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chart-shell {
    min-height: 285px;
  }

  .chart-shell.small {
    min-height: 235px;
  }
}

@media (max-width: 1024px) {
  .masthead {
    align-items: flex-start;
    flex-direction: column;
    min-height: 0;
  }

  .page-masthead {
    align-items: flex-start;
    flex-direction: column;
    min-height: 0;
  }

  .console-nav-shell {
    min-height: 122px;
  }

  .control-row {
    width: 100%;
    flex-wrap: wrap;
  }

  .ops-subnav-chip {
    flex: 1 1 148px;
  }

  .insight-grid,
  .main-grid {
    grid-template-columns: 1fr;
  }

  .insight-grid .panel-action {
    order: 1;
  }

  .insight-grid .panel-delivery {
    order: 2;
  }

  .insight-grid .panel-risk {
    order: 3;
  }

  .insight-grid .panel-errors {
    order: 4;
  }

  .main-grid .side-stack {
    order: 1;
  }

  .main-grid .panel-logs {
    order: 2;
  }
}

@media (max-width: 820px) {
  .console-nav-shell {
    min-height: 154px;
  }

  .health-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kpi-grid,
  .mini-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .page-grid-4,
  .page-grid-3,
  .page-grid-2 {
    grid-template-columns: 1fr;
  }

  .ops-visual-grid {
    grid-template-columns: 1fr;
  }

  .ops-bar-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .ops-bar-meta {
    text-align: left;
  }

  .ops-hint-row {
    grid-template-columns: 1fr;
  }

  .ops-copy-btn {
    width: 100%;
  }

  .panel {
    padding: 12px;
  }

  .panel-head h2,
  .panel-head h3 {
    font-size: 1rem;
  }

  .meta {
    font-size: 0.82rem;
  }

  .chart-shell {
    min-height: 235px;
    padding: 8px;
  }

  .chart-shell.small {
    min-height: 210px;
  }

  .log-controls {
    width: 100%;
    justify-content: flex-start;
    gap: 6px;
  }

  .log-controls input,
  .log-controls select,
  .log-controls button {
    width: 100%;
    min-width: 0;
  }

  .console-tabs {
    width: 100%;
  }

  .console-tab {
    flex: 1 1 48%;
  }

  .table-wrap {
    max-height: none;
    overflow: visible;
    border: none;
    background: transparent;
    margin-top: 10px;
  }

  table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0 8px;
  }

  thead {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    border: 0;
  }

  tbody,
  tr,
  td {
    display: block;
    width: 100%;
  }

  tbody tr {
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    background: var(--bg-panel-strong);
    padding: 8px 10px;
    box-shadow: var(--shadow-soft);
  }

  tbody tr td {
    padding: 7px 0;
    border-bottom: 1px dashed rgba(120, 171, 215, 0.2);
    white-space: normal;
    display: grid;
    grid-template-columns: minmax(95px, 38%) 1fr;
    gap: 10px;
    align-items: baseline;
  }

  tbody tr td:last-child {
    border-bottom: 0;
  }

  tbody tr td::before {
    content: attr(data-label);
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.7rem;
    font-weight: 600;
  }

  tbody tr td.empty-cell {
    display: block;
    text-align: center;
    border-bottom: 0;
    padding: 8px 6px;
  }

  tbody tr td.empty-cell::before {
    content: none;
  }
}

@media (max-width: 640px) {
  .console-nav-shell {
    min-height: 200px;
  }

  .shell {
    width: min(1440px, calc(100% - 16px));
    margin-top: 12px;
  }

  .masthead h1 {
    font-size: clamp(1.2rem, 1.1rem + 1.2vw, 1.55rem);
  }

  .subline {
    font-size: 0.85rem;
  }

  .page-masthead .subline {
    min-height: 3.1em;
  }

  .control-row select,
  .control-row button,
  .control-row input {
    width: 100%;
  }

  .ops-subnav {
    padding: 9px;
    gap: 8px;
  }

  .ops-subnav-chip {
    flex: 1 1 100%;
    width: 100%;
  }

  .ops-console-toolbar button {
    width: 100%;
  }

  .ops-console-output {
    min-height: 180px;
    max-height: 280px;
  }

  .health-strip,
  .kpi-grid,
  .mini-grid {
    grid-template-columns: 1fr;
  }

  .console-tab {
    flex: 1 1 100%;
  }

  .health-item,
  .kpi-item {
    min-height: 86px;
  }

  .health-value,
  .kpi-value {
    font-size: 1.5rem;
  }

  .chart-shell {
    min-height: 210px;
  }

  .chart-shell.small {
    min-height: 190px;
  }

  .alert-item .top {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 420px) {
  .console-nav-shell {
    min-height: 236px;
  }

  .shell {
    width: calc(100% - 12px);
  }

  .eyebrow {
    font-size: 0.67rem;
  }

  .panel {
    padding: 10px;
    border-radius: 14px;
  }

  .health-item,
  .kpi-item {
    padding: 10px 11px;
  }

  .chart-shell {
    min-height: 190px;
    padding: 7px;
  }

  .chart-shell.small {
    min-height: 170px;
  }

  tbody tr td {
    grid-template-columns: minmax(80px, 34%) 1fr;
    gap: 8px;
  }
}

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