/* KC CLOUD — Enterprise server status page (+ dark/light) */
.st-body {
  --st-bg: #0a101c;
  --st-bg-glow-a: rgba(0, 168, 160, 0.11);
  --st-bg-glow-b: rgba(74, 163, 255, 0.07);
  --st-surface: rgba(16, 26, 42, 0.94);
  --st-surface-2: rgba(0, 0, 0, 0.2);
  --st-text: #d7e2f1;
  --st-text-strong: #ffffff;
  --st-muted: #8fa3bd;
  --st-faint: #6f849e;
  --st-border: rgba(148, 176, 210, 0.16);
  --st-border-soft: rgba(148, 176, 210, 0.1);
  --st-accent: #00a8a0;
  --st-ok: #34d399;
  --st-down: #f87171;
  --st-warn: #e8a54b;
  --st-tile: linear-gradient(165deg, rgba(22, 34, 52, 0.98), rgba(12, 18, 30, 0.96));
  --st-input-bg: rgba(16, 26, 42, 0.95);
  --st-shadow: 0 12px 36px rgba(0, 0, 0, 0.22);
  --st-header-bg: rgba(10, 16, 28, 0.88);
  color: var(--st-text);
  background:
    radial-gradient(900px 420px at 10% -8%, var(--st-bg-glow-a), transparent 55%),
    radial-gradient(700px 380px at 100% 0%, var(--st-bg-glow-b), transparent 50%),
    var(--st-bg);
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-text-size-adjust: 100%;
}

html[data-theme="light"] .st-body {
  --st-bg: #eef3f8;
  --st-bg-glow-a: rgba(0, 140, 130, 0.1);
  --st-bg-glow-b: rgba(30, 100, 180, 0.07);
  --st-surface: #ffffff;
  --st-surface-2: rgba(15, 40, 70, 0.04);
  --st-text: #2a3b52;
  --st-text-strong: #0f172a;
  --st-muted: #5b6f88;
  --st-faint: #7a8fa8;
  --st-border: rgba(40, 70, 110, 0.14);
  --st-border-soft: rgba(40, 70, 110, 0.1);
  --st-accent: #0d8f88;
  --st-ok: #059669;
  --st-down: #dc2626;
  --st-warn: #c47a14;
  --st-tile: linear-gradient(165deg, #ffffff, #f4f8fc);
  --st-input-bg: #ffffff;
  --st-shadow: 0 10px 28px rgba(20, 40, 70, 0.08);
  --st-header-bg: rgba(255, 255, 255, 0.92);
  color: var(--st-text);
}

.st-body .bg-grid {
  display: none;
}

.st-main {
  padding: 1.5rem 0 3rem;
}

.st-wrap {
  width: min(1180px, calc(100% - 1.25rem));
  margin: 0 auto;
  display: grid;
  gap: 1rem;
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
}

.st-card {
  background: var(--st-surface);
  border: 1px solid var(--st-border);
  border-radius: 14px;
  padding: 1.15rem 1.25rem 1.25rem;
  box-shadow: var(--st-shadow);
}

.st-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--st-border-soft);
}

.st-card-head h2 {
  font-family: "Syne", sans-serif;
  font-size: 1.1rem;
  color: var(--st-text-strong);
  letter-spacing: -0.02em;
}

.st-muted {
  color: var(--st-muted);
  font-size: 0.86rem;
  margin-top: 0.2rem;
}

.st-chip {
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--st-muted);
  border: 1px solid var(--st-border);
  border-radius: 999px;
  padding: 0.28rem 0.65rem;
  white-space: nowrap;
}

/* Theme toggle + mobile nav tools */
.st-nav-tools {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: auto;
}

.st-theme-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--st-border, rgba(148, 176, 210, 0.22));
  background: var(--st-surface-2, rgba(0, 0, 0, 0.2));
  color: var(--st-text, #d7e2f1);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 650;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  cursor: pointer;
  min-height: 40px;
  white-space: nowrap;
}

.st-theme-btn:hover {
  border-color: rgba(0, 168, 160, 0.45);
  color: var(--st-text-strong, #fff);
}

.st-theme-ico {
  font-size: 1rem;
  line-height: 1;
}

html[data-theme="light"] .st-body .site-header {
  background: var(--st-header-bg);
  border-bottom: 1px solid var(--st-border);
  backdrop-filter: blur(10px);
}

html[data-theme="light"] .st-body .site-header .brand,
html[data-theme="light"] .st-body .nav-links a {
  color: var(--st-text-strong);
}

html[data-theme="light"] .st-body .site-footer {
  background: #e4ebf3;
  color: var(--st-muted);
  border-top: 1px solid var(--st-border);
}

html[data-theme="light"] .st-body .site-footer a {
  color: var(--st-text);
}

/* Hero */
.st-hero {
  display: flex;
  justify-content: space-between;
  gap: 1.25rem;
  align-items: center;
  flex-wrap: wrap;
}

.st-kicker {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--st-accent);
  font-weight: 700;
}

.st-hero h1 {
  font-family: "Syne", sans-serif;
  font-size: clamp(1.45rem, 4.5vw, 2.1rem);
  color: var(--st-text-strong);
  letter-spacing: -0.03em;
  margin: 0.25rem 0 0.35rem;
}

.st-sub {
  color: var(--st-muted);
  font-size: 0.95rem;
  max-width: 36rem;
}

.st-hero-right {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.st-overall {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  padding: 0.7rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(148, 176, 210, 0.16);
  background: rgba(0, 0, 0, 0.2);
  min-width: 11rem;
}

.st-overall.ok {
  border-color: rgba(52, 211, 153, 0.4);
  background: rgba(52, 211, 153, 0.08);
}

.st-overall.bad {
  border-color: rgba(248, 113, 113, 0.4);
  background: rgba(248, 113, 113, 0.08);
}

.st-overall.warn {
  border-color: rgba(232, 165, 75, 0.4);
  background: rgba(232, 165, 75, 0.08);
}

.st-overall-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #64748b;
  box-shadow: 0 0 0 4px rgba(100, 116, 139, 0.15);
}

.st-overall.ok .st-overall-dot {
  background: #34d399;
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.18);
}

.st-overall.bad .st-overall-dot {
  background: #f87171;
  box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.18);
}

.st-overall.warn .st-overall-dot {
  background: #e8a54b;
  box-shadow: 0 0 0 4px rgba(232, 165, 75, 0.18);
}

.st-overall strong {
  display: block;
  color: #fff;
  font-size: 1rem;
}

.st-overall span {
  display: block;
  font-size: 0.78rem;
  color: #8fa3bd;
}

.st-btn {
  border: 1px solid rgba(148, 176, 210, 0.22);
  background: linear-gradient(180deg, #00b8b0, #008f88);
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.65rem 1.1rem;
  border-radius: 10px;
  cursor: pointer;
}

.st-btn:hover {
  filter: brightness(1.06);
}

/* KPIs */
.st-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem;
}

.st-kpi {
  background: var(--st-surface);
  border: 1px solid var(--st-border);
  border-radius: 14px;
  padding: 0.95rem 1rem;
  min-width: 0;
}

.st-kpi.up { border-color: rgba(52, 211, 153, 0.35); }
.st-kpi.down { border-color: rgba(248, 113, 113, 0.35); }

.st-kpi span {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8fa3bd;
  font-weight: 700;
}

.st-kpi strong {
  display: block;
  margin-top: 0.3rem;
  font-family: "Syne", sans-serif;
  font-size: clamp(1.25rem, 4vw, 1.65rem);
  color: var(--st-text-strong);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.st-kpi.up strong { color: var(--st-ok); }
.st-kpi.down strong { color: var(--st-down); }

.st-kpi em {
  display: block;
  margin-top: 0.25rem;
  font-style: normal;
  font-size: 0.75rem;
  color: var(--st-faint);
}

.st-updated {
  color: var(--st-faint);
  font-size: 0.82rem;
  margin: -0.15rem 0 0.15rem;
}

.st-maint-banner {
  padding: 0.85rem 1.1rem;
  border-radius: 12px;
  border: 1px solid rgba(232, 165, 75, 0.45);
  background: rgba(232, 165, 75, 0.12);
  color: var(--st-warn);
  font-weight: 600;
  font-size: 0.95rem;
}

html[data-theme="light"] .st-maint-banner {
  color: #8a5400;
  background: rgba(232, 165, 75, 0.18);
}

.st-countdown {
  font-size: 0.8rem;
  color: var(--st-muted);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--st-border);
  background: var(--st-surface-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.st-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}

.st-toolbar input,
.st-toolbar select {
  border: 1px solid var(--st-border);
  background: var(--st-input-bg);
  color: var(--st-text);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  font: inherit;
  font-size: 0.9rem;
  min-height: 44px;
}

.st-toolbar input {
  min-width: min(240px, 100%);
  flex: 1 1 160px;
}

.st-toolbar select {
  flex: 1 1 120px;
  max-width: 100%;
}

.st-subscribe {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-left: auto;
}

.st-btn-ghost {
  background: transparent !important;
  border: 1px solid rgba(148, 176, 210, 0.25) !important;
  color: #c5d4e8 !important;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
}

.st-btn-ghost:hover {
  border-color: rgba(0, 168, 160, 0.45) !important;
  color: #fff !important;
}

.st-badge-box {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(148, 176, 210, 0.12);
}

.st-code-sm {
  display: block;
  margin-top: 0.45rem;
  font-size: 0.72rem;
  color: #8fa3bd;
  word-break: break-all;
}

.st-tile.paused,
.st-tile.maintenance {
  border-color: rgba(232, 165, 75, 0.3);
}

.st-inc a {
  color: inherit;
  text-decoration: none;
}

.st-inc a:hover {
  color: #00a8a0;
}

.st-badge.maintenance,
.st-badge.config {
  color: #1c1408;
  background: #e8a54b;
}


/* —— Monitor tiles —— */
.st-tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.85rem;
}

.st-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  text-align: left;
  width: 100%;
  padding: 1.05rem 1.1rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--st-border);
  background: var(--st-tile);
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.st-tile::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: #64748b;
}

.st-tile.up {
  border-color: rgba(52, 211, 153, 0.28);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
}

.st-tile.up::before {
  background: linear-gradient(90deg, #34d399, #00a8a0);
}

.st-tile.down {
  border-color: rgba(248, 113, 113, 0.35);
  box-shadow: 0 10px 28px rgba(248, 113, 113, 0.08);
}

.st-tile.down::before {
  background: linear-gradient(90deg, #f87171, #ef4444);
}

.st-tile.config {
  border-color: rgba(232, 165, 75, 0.35);
}

.st-tile.config::before {
  background: #e8a54b;
}

.st-tile:hover {
  transform: translateY(-3px);
  border-color: rgba(0, 168, 160, 0.45);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.28);
}

.st-tile:focus-visible {
  outline: 2px solid #00a8a0;
  outline-offset: 2px;
}

.st-tile-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.65rem;
}

.st-tile-name {
  font-family: "Syne", sans-serif;
  font-size: 1.05rem;
  color: var(--st-text-strong);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0;
}

.st-tile-kind {
  margin: 0.28rem 0 0;
  font-size: 0.78rem;
  color: var(--st-muted);
  word-break: break-word;
}

.st-badge {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.32rem 0.55rem;
  border-radius: 999px;
  border: 1px solid transparent;
}

.st-badge.up {
  color: #052e1f;
  background: #34d399;
  border-color: rgba(52, 211, 153, 0.6);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.15);
}

.st-badge.down {
  color: #fff;
  background: #ef4444;
  border-color: rgba(248, 113, 113, 0.7);
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.15);
  animation: st-pulse-down 1.6s ease infinite;
}

.st-badge.config {
  color: #1c1408;
  background: #e8a54b;
}

@keyframes st-pulse-down {
  0%, 100% { box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.15); }
  50% { box-shadow: 0 0 0 6px rgba(248, 113, 113, 0.08); }
}

.st-tile-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.st-tile-stat {
  background: var(--st-surface-2);
  border: 1px solid var(--st-border-soft);
  border-radius: 10px;
  padding: 0.55rem 0.6rem;
}

.st-tile-stat span {
  display: block;
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--st-faint);
  font-weight: 700;
}

.st-tile-stat strong {
  display: block;
  margin-top: 0.2rem;
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
  color: var(--st-text);
  letter-spacing: -0.02em;
}

.st-tile-stat strong.good { color: var(--st-ok); }
.st-tile-stat strong.mid { color: var(--st-warn); }
.st-tile-stat strong.bad { color: var(--st-down); }
.st-tile-stat strong.up-txt { color: var(--st-ok); }
.st-tile-stat strong.down-txt { color: var(--st-down); }

.st-tile-stat.wide {
  grid-column: 1 / -1;
}

.st-tile-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding-top: 0.15rem;
  border-top: 1px solid var(--st-border-soft);
  font-size: 0.78rem;
  color: var(--st-faint);
}

.st-tile-foot em {
  font-style: normal;
  color: var(--st-accent);
  font-weight: 600;
}

/* Legacy list helpers retained for modal internals */
.st-mon-list {
  display: grid;
  gap: 0.75rem;
}

.st-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #64748b;
  flex-shrink: 0;
}

.st-dot.up { background: #34d399; box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.15); }
.st-dot.down { background: #f87171; box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.15); }
.st-dot.config { background: #e8a54b; }

/* Timeline bar */
.st-tl {
  margin-top: 0.35rem;
}

.st-tl-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: #6f849e;
  margin-bottom: 0.35rem;
}

.st-tl-bar {
  display: flex;
  height: 14px;
  border-radius: 7px;
  overflow: hidden;
  border: 1px solid rgba(148, 176, 210, 0.12);
  background: rgba(100, 116, 139, 0.15);
}

.st-tl-seg {
  height: 100%;
  min-width: 2px;
}

.st-tl-seg.up { background: #34d399; }
.st-tl-seg.down { background: #f87171; }
.st-tl-seg.config { background: #e8a54b; }
.st-tl-seg.unknown { background: #475569; }

.st-empty {
  color: #8fa3bd;
  font-size: 0.92rem;
  text-align: center;
  padding: 1.5rem 1rem;
  border: 1px dashed rgba(148, 176, 210, 0.18);
  border-radius: 10px;
  grid-column: 1 / -1;
}

/* Detail modal */
.st-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.st-modal[hidden] {
  display: none !important;
}

.st-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 8, 16, 0.72);
  backdrop-filter: blur(4px);
  cursor: pointer;
}

.st-modal-panel {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  max-height: min(88dvh, 720px);
  overflow: auto;
  border-radius: 16px;
  border: 1px solid var(--st-border);
  background: var(--st-surface);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.35);
  animation: st-modal-in 0.22s ease;
  -webkit-overflow-scrolling: touch;
}

@keyframes st-modal-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.st-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1.15rem 1.2rem 0.95rem;
  border-bottom: 1px solid rgba(148, 176, 210, 0.12);
}

.st-modal-title-wrap {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  min-width: 0;
}

.st-modal-status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-top: 0.55rem;
  background: #64748b;
  flex-shrink: 0;
}

.st-modal-status-dot.up {
  background: #34d399;
  box-shadow: 0 0 0 5px rgba(52, 211, 153, 0.18);
}

.st-modal-status-dot.down {
  background: #f87171;
  box-shadow: 0 0 0 5px rgba(248, 113, 113, 0.18);
}

.st-modal-status-dot.config {
  background: #e8a54b;
}

.st-modal-head h2 {
  font-family: "Syne", sans-serif;
  font-size: 1.25rem;
  color: var(--st-text-strong);
  letter-spacing: -0.02em;
  margin: 0.1rem 0 0;
  word-break: break-word;
}

.st-modal-close {
  border: 1px solid rgba(148, 176, 210, 0.2);
  background: rgba(0, 0, 0, 0.25);
  color: #c5d4e8;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 10px;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.st-modal-close:hover {
  color: #fff;
  border-color: rgba(0, 168, 160, 0.45);
}

.st-modal-body {
  padding: 1rem 1.2rem 1.25rem;
  display: grid;
  gap: 1rem;
}

.st-detail-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(148, 176, 210, 0.14);
  background: rgba(0, 0, 0, 0.22);
}

.st-detail-banner.up {
  border-color: rgba(52, 211, 153, 0.35);
  background: rgba(52, 211, 153, 0.08);
}

.st-detail-banner.down {
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(248, 113, 113, 0.08);
}

.st-detail-banner strong {
  display: block;
  font-size: 1.15rem;
  color: #fff;
}

.st-detail-banner.up strong { color: #34d399; }
.st-detail-banner.down strong { color: #f87171; }

.st-detail-banner span {
  font-size: 0.82rem;
  color: #8fa3bd;
}

.st-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.st-detail-cell {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(148, 176, 210, 0.12);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
}

.st-detail-cell span {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #6f849e;
  font-weight: 700;
}

.st-detail-cell strong {
  display: block;
  margin-top: 0.25rem;
  color: #e8eef7;
  font-size: 0.98rem;
  word-break: break-word;
}

.st-detail-cell strong.good { color: #34d399; }
.st-detail-cell strong.mid { color: #e8a54b; }
.st-detail-cell strong.bad { color: #f87171; }

.st-detail-section h3 {
  font-family: "Syne", sans-serif;
  font-size: 0.95rem;
  color: #fff;
  margin: 0 0 0.55rem;
}

.st-detail-inc {
  display: grid;
  gap: 0.4rem;
  max-height: 160px;
  overflow: auto;
}

.st-detail-inc article {
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  border: 1px solid rgba(248, 113, 113, 0.2);
  background: rgba(248, 113, 113, 0.06);
  font-size: 0.82rem;
  color: #c5d4e8;
}

/* Incidents */
.st-incident-list {
  display: grid;
  gap: 0.55rem;
  max-height: 560px;
  overflow: auto;
}

.st-inc {
  display: grid;
  grid-template-columns: 8px 1fr;
  gap: 0.7rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid rgba(148, 176, 210, 0.12);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.16);
}

.st-inc-rail {
  width: 8px;
  border-radius: 999px;
  background: #f87171;
}

.st-inc strong {
  display: block;
  color: #fff;
  font-size: 0.9rem;
}

.st-inc p {
  margin: 0.2rem 0 0;
  color: #8fa3bd;
  font-size: 0.8rem;
  line-height: 1.4;
}

/* Charts */
.st-chart-wrap {
  height: 300px;
  position: relative;
}

.st-chart-wrap-sm {
  height: 240px;
}

@media (max-width: 1000px) {
  .st-layout {
    grid-template-columns: 1fr;
  }
  .st-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .st-subscribe {
    margin-left: 0;
    width: 100%;
  }
  .st-subscribe .st-btn-ghost {
    flex: 1;
    justify-content: center;
    min-height: 44px;
  }
}

@media (max-width: 760px) {
  .st-body .site-header .nav {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .st-nav-tools {
    order: 2;
  }

  .st-main {
    padding: 1rem 0 2.5rem;
    padding-bottom: calc(2.5rem + env(safe-area-inset-bottom, 0));
  }

  .st-card {
    padding: 1rem;
    border-radius: 12px;
  }

  .st-hero {
    flex-direction: column;
    align-items: stretch;
    gap: 0.9rem;
  }

  .st-hero-right {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.55rem;
  }

  .st-overall {
    grid-column: 1 / -1;
    min-width: 0;
    width: 100%;
  }

  .st-countdown {
    justify-self: start;
  }

  .st-btn {
    min-height: 44px;
    padding: 0.7rem 1rem;
  }

  .st-card-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .st-chip {
    align-self: flex-start;
  }

  .st-kpis {
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
  }

  .st-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .st-toolbar input,
  .st-toolbar select {
    width: 100%;
    max-width: none;
    flex: none;
  }

  .st-tile-grid {
    grid-template-columns: 1fr;
  }

  .st-tile:hover {
    transform: none;
  }

  .st-tile:active {
    transform: scale(0.99);
  }

  .st-modal {
    padding: 0;
    align-items: end;
  }

  .st-modal-panel {
    width: 100%;
    max-height: min(92dvh, 100%);
    border-radius: 16px 16px 0 0;
    margin: 0;
  }

  .st-chart-wrap {
    height: 220px;
  }

  .st-chart-wrap-sm {
    height: 200px;
  }

  .st-detail-grid {
    grid-template-columns: 1fr;
  }

  .st-incident-list {
    max-height: none;
  }

  .st-body .footer-bottom {
    flex-direction: column;
    gap: 0.4rem;
    text-align: center;
    font-size: 0.85rem;
  }
}

@media (max-width: 420px) {
  .st-kpis {
    grid-template-columns: 1fr;
  }

  .st-theme-btn [data-theme-label] {
    /* keep short label */
  }

  .st-hero-right {
    grid-template-columns: 1fr;
  }

  .st-countdown,
  .st-btn {
    width: 100%;
    text-align: center;
    justify-content: center;
  }
}

/* Reduce hover motion when user prefers less motion */
@media (prefers-reduced-motion: reduce) {
  .st-tile,
  .st-modal-panel {
    transition: none;
    animation: none;
  }
}

body.st-modal-open {
  overflow: hidden;
}

/* —— One-screen dashboard layout —— */
.st-dash-screen {
  overflow: hidden;
}

.st-dash-screen .site-header {
  position: sticky;
  top: 0;
  z-index: 40;
}

.st-dash-screen .st-main {
  height: calc(100dvh - var(--st-header-h, 64px) - var(--st-footer-h, 36px));
  min-height: 0;
  padding: 0.35rem 0 0.25rem;
  overflow: hidden;
}

.st-dash-screen .st-wrap {
  height: 100%;
  width: min(1320px, calc(100% - 0.85rem));
  gap: 0.4rem;
  grid-template-rows: auto auto minmax(0, 1fr);
  display: grid;
}

.st-dash-head {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto minmax(220px, 2.2fr) auto;
  align-items: center;
  gap: 0.65rem 0.85rem;
  padding: 0.55rem 0.85rem !important;
  margin: 0;
}

.st-dash-title h1 {
  font-size: 1.15rem;
  margin: 0.1rem 0 0;
  line-height: 1.1;
}

.st-dash-title .st-kicker {
  font-size: 0.62rem;
}

.st-dash-head .st-overall {
  min-width: 0;
  padding: 0.45rem 0.65rem;
  border-radius: 10px;
}

.st-dash-head .st-overall strong {
  font-size: 0.82rem;
}

.st-dash-head .st-overall span {
  font-size: 0.68rem;
}

.st-kpis-compact {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.35rem;
}

.st-kpis-compact .st-kpi {
  padding: 0.35rem 0.45rem;
  border-radius: 10px;
  text-align: center;
}

.st-kpis-compact .st-kpi span {
  font-size: 0.58rem;
}

.st-kpis-compact .st-kpi strong {
  margin-top: 0.1rem;
  font-size: 0.95rem;
}

.st-dash-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
  min-width: 7.5rem;
}

.st-dash-actions .st-countdown {
  padding: 0.35rem 0.5rem;
  font-size: 0.72rem;
  text-align: center;
}

.st-btn-sm {
  padding: 0.42rem 0.65rem !important;
  font-size: 0.78rem !important;
  border-radius: 8px !important;
  min-height: 0 !important;
}

.st-toolbar-compact {
  gap: 0.35rem;
  padding: 0 0.1rem;
}

.st-toolbar-compact input,
.st-toolbar-compact select {
  padding: 0.38rem 0.55rem;
  font-size: 0.78rem;
  min-height: 34px;
  border-radius: 8px;
}

.st-toolbar-compact input {
  min-width: 0;
  flex: 0 1 140px;
}

.st-toolbar-compact select {
  flex: 0 1 96px;
}

.st-toolbar-compact .st-updated {
  flex: 1 1 auto;
  margin: 0;
  font-size: 0.72rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.st-toolbar-compact .st-subscribe {
  margin-left: auto;
  gap: 0.3rem;
}

.st-toolbar-compact .st-btn-ghost {
  padding: 0.35rem 0.55rem !important;
  font-size: 0.72rem !important;
}

.st-monitors-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0.55rem 0.75rem 0.65rem !important;
  overflow: hidden;
}

.st-card-head-compact {
  margin-bottom: 0.45rem !important;
  padding-bottom: 0.45rem !important;
}

.st-card-head-compact h2 {
  font-size: 0.92rem;
}

.st-card-head-compact .st-muted {
  font-size: 0.72rem;
  margin-top: 0.05rem;
}

.st-tile-grid-compact {
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 0.45rem;
  align-content: start;
  overflow: auto;
  min-height: 0;
  flex: 1;
  padding-right: 0.15rem;
}

.st-tile-compact {
  gap: 0.45rem;
  padding: 0.55rem 0.6rem 0.5rem;
  border-radius: 10px;
  min-height: 0;
}

.st-tile-compact::before {
  height: 2px;
}

.st-tile-compact:hover {
  transform: translateY(-1px);
}

.st-tile-compact .st-tile-name {
  font-size: 0.82rem;
  line-height: 1.15;
}

.st-tile-compact .st-tile-kind {
  font-size: 0.65rem;
  margin-top: 0.12rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.st-tile-compact .st-badge {
  font-size: 0.58rem;
  padding: 0.18rem 0.38rem;
}

.st-tile-head-text {
  min-width: 0;
  flex: 1;
}

.st-tile-metrics {
  display: flex;
  justify-content: space-between;
  gap: 0.25rem;
  font-size: 0.68rem;
  color: var(--st-faint);
  border-top: 1px solid var(--st-border-soft);
  padding-top: 0.35rem;
}

.st-tile-metrics b {
  display: block;
  font-size: 0.78rem;
  color: var(--st-text);
  font-variant-numeric: tabular-nums;
}

.st-tile-metrics b.good { color: var(--st-ok); }
.st-tile-metrics b.mid { color: var(--st-warn); }
.st-tile-metrics b.bad { color: var(--st-down); }

.st-offscreen-charts {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.st-footer-compact {
  padding: 0.35rem 0 !important;
}

.st-footer-compact .footer-bottom {
  padding: 0.15rem 0 !important;
  font-size: 0.78rem;
}

.st-footer-compact img {
  vertical-align: middle;
}

@media (max-width: 980px) {
  .st-dash-head {
    grid-template-columns: 1fr 1fr;
  }

  .st-dash-title {
    grid-column: 1 / -1;
  }

  .st-kpis-compact {
    grid-column: 1 / -1;
  }

  .st-dash-actions {
    flex-direction: row;
    align-items: center;
    grid-column: 1 / -1;
  }

  .st-dash-actions .st-countdown {
    flex: 1;
  }
}

@media (max-width: 760px) {
  .st-dash-screen .st-main {
    height: auto;
    min-height: calc(100dvh - var(--st-header-h, 64px));
    overflow: visible;
  }

  .st-dash-screen .st-wrap {
    height: auto;
    display: block;
  }

  .st-monitors-panel {
    min-height: 280px;
    max-height: none;
  }

  .st-tile-grid-compact {
    max-height: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .st-kpis-compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .st-toolbar-compact {
    flex-wrap: wrap;
  }

  .st-toolbar-compact .st-updated {
    width: 100%;
    order: 5;
  }
}
