/* Recoil Hosting–inspired status layout: blue / white palette with dark mode default */

:root {
  --bg: #0b1220;
  --surface: #111a2e;
  --border: #22314f;
  --text: #f8fafc;
  --muted: #9fb0d1;

  --ok: #22c55e;
  --ok-soft: rgba(34, 197, 94, 0.16);

  --warn: #f59e0b;
  --warn-soft: rgba(245, 158, 11, 0.16);

  --bad: #ef4444;
  --bad-soft: rgba(239, 68, 68, 0.16);

  --unknown: #94a3b8;
  --unknown-soft: rgba(148, 163, 184, 0.14);

  --accent: #3b82f6;
  --accent-strong: #2563eb;
  --accent-soft: rgba(59, 130, 246, 0.16);

  --radius: 12px;
  --radius-lg: 16px;
  --font: "Inter", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;

  --shadow: 0 1px 2px rgba(0, 0, 0, 0.22), 0 12px 30px rgba(2, 8, 23, 0.45);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f4f8ff;
    --surface: #ffffff;
    --border: #dbe7ff;
    --text: #0f172a;
    --muted: #5b6b87;

    --ok: #16a34a;
    --ok-soft: #dcfce7;

    --warn: #d97706;
    --warn-soft: #fef3c7;

    --bad: #dc2626;
    --bad-soft: #fee2e2;

    --unknown: #94a3b8;
    --unknown-soft: #eef2f7;

    --accent: #2563eb;
    --accent-strong: #1d4ed8;
    --accent-soft: #dbeafe;

    --shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(37, 99, 235, 0.08);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
}

a {
  color: var(--accent);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(11, 18, 32, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: inherit;
}

.logo-badge {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(145deg, #3b82f6, #1d4ed8);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.35);
}

.logo-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.logo-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.logo-tag {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 500;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

.last-sync {
  font-size: 0.78rem;
}

.shell {
  max-width: 1080px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.status-hero {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.35rem 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.status-hero-ok {
  border-color: rgba(34, 197, 94, 0.35);
  background: linear-gradient(135deg, #111a2e 0%, rgba(34, 197, 94, 0.08) 100%);
}

.status-hero-warn {
  border-color: rgba(245, 158, 11, 0.35);
  background: linear-gradient(135deg, #111a2e 0%, rgba(245, 158, 11, 0.08) 100%);
}

.status-hero-bad {
  border-color: rgba(239, 68, 68, 0.35);
  background: linear-gradient(135deg, #111a2e 0%, rgba(239, 68, 68, 0.08) 100%);
}

.status-hero-unknown {
  border-color: var(--border);
  background: linear-gradient(135deg, #111a2e 0%, rgba(148, 163, 184, 0.06) 100%);
}

.status-hero-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  color: var(--text);
}

.status-hero-ok .status-hero-icon {
  color: var(--ok);
  border-color: rgba(34, 197, 94, 0.35);
  background: var(--ok-soft);
}

.status-hero-warn .status-hero-icon {
  color: var(--warn);
  border-color: rgba(245, 158, 11, 0.35);
  background: var(--warn-soft);
}

.status-hero-bad .status-hero-icon {
  color: var(--bad);
  border-color: rgba(239, 68, 68, 0.35);
  background: var(--bad-soft);
}

.status-hero-title {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 1.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.status-hero-sub {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.subscribe-strip {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  padding: 0.65rem 1rem;
  border-radius: var(--radius);
  border: 1px dashed var(--border);
  background: rgba(59, 130, 246, 0.06);
  font-size: 0.85rem;
  color: var(--muted);
}

.subscribe-label {
  font-weight: 600;
  color: var(--text);
}

.subscribe-hint {
  flex: 1;
  min-width: 200px;
}

.subscribe-actions {
  display: flex;
  gap: 0.35rem;
}

.chip {
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  cursor: not-allowed;
}

.panel {
  margin-top: 1.75rem;
  padding: 1.35rem 1.25rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel-tight {
  padding: 1.15rem 1.1rem;
}

.panel-head {
  margin-bottom: 1rem;
}

.panel-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.panel-desc {
  margin: 0.35rem 0 0;
  font-size: 0.88rem;
  color: var(--muted);
  max-width: 72ch;
}

.panel-desc a {
  text-decoration: none;
  font-weight: 500;
}

.panel-desc a:hover {
  text-decoration: underline;
}

.monitor-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.monitor {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem;
  background: rgba(255, 255, 255, 0.02);
}

.monitor-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.monitor-id {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 0.35rem;
  flex-shrink: 0;
}

.dot-ok {
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

.dot-warn {
  background: #facc15;
  box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.22);
}

.dot-bad {
  background: var(--bad);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.dot-unknown {
  background: var(--unknown);
}

.monitor-name {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 600;
}

.monitor-host {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.pill {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.pill-ok {
  background: var(--ok-soft);
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.35);
}

.pill-warn {
  background: var(--warn-soft);
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.35);
}

.pill-bad {
  background: var(--bad-soft);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.35);
}

.pill-unknown {
  background: var(--unknown-soft);
  color: #cbd5e1;
  border-color: var(--border);
}

.monitor-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.65rem 1rem;
  margin-top: 1rem;
}

.metric-wide {
  grid-column: 1 / -1;
}

.metric-k {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
}

.metric-v {
  font-size: 0.88rem;
  color: var(--text);
}

.monitor-url {
  margin: 0.85rem 0 0;
  font-size: 0.78rem;
  word-break: break-all;
}

.monitor-url a {
  color: var(--muted);
  text-decoration: none;
}

.monitor-url a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.hm-block {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.hm-row {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  gap: 0.75rem;
  align-items: center;
}

@media (max-width: 640px) {
  .hm-row {
    grid-template-columns: 1fr;
  }
}

.hm-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
}

.hm-track {
  display: flex;
  align-items: stretch;
  gap: 3px;
  min-height: 28px;
  padding: 4px 0;
  overflow-x: auto;
}

.hm-track-compact .hm-cell {
  width: 5px;
  min-width: 5px;
}

.hm-cell {
  flex: 1;
  min-width: 8px;
  border-radius: 3px;
  min-height: 24px;
}

.hm-ok {
  background: linear-gradient(180deg, #4ade80, #16a34a);
}

.hm-warn {
  background: linear-gradient(180deg, #facc15, #ca8a04);
}

.hm-bad {
  background: linear-gradient(180deg, #fb7185, #dc2626);
}

.hm-none {
  background: #24324d;
}

.spark-wrap {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.spark-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.spark-body {
  color: var(--accent);
}

.sparkline {
  display: block;
  width: 100%;
  max-width: 320px;
  height: auto;
}

.spark-meta {
  display: flex;
  gap: 1rem;
  margin-top: 0.35rem;
  font-size: 0.72rem;
  color: var(--muted);
}

.spark-empty {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.split {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 900px) {
  .split {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.incident-feed {
  list-style: none;
  margin: 0;
  padding: 0;
}

.incident-item {
  display: flex;
  gap: 0.65rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}

.incident-item:last-child {
  border-bottom: none;
}

.incident-body {
  flex: 1;
  min-width: 0;
}

.incident-title {
  font-weight: 600;
  font-size: 0.9rem;
}

.incident-meta {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.15rem;
  word-break: break-word;
}

.incident-empty {
  padding: 0.5rem 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.analytics-compact {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.mini-stat {
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.02);
}

.mini-stat.wide {
  grid-column: 1 / -1;
}

.mini-label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.mini-val {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--accent);
}

.mini-bars {
  display: flex;
  align-items: flex-end;
  gap: 0.35rem;
  min-height: 72px;
  padding-top: 0.25rem;
}

.pv-bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  height: 72px;
}

.pv-fill {
  width: 100%;
  max-width: 36px;
  margin-top: auto;
  border-radius: 4px 4px 2px 2px;
  background: linear-gradient(180deg, #60a5fa, #2563eb);
  min-height: 4px;
}

.pv-lbl {
  font-size: 0.65rem;
  color: var(--muted);
}

.check-log {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 200px;
  overflow: auto;
  font-size: 0.72rem;
}

.check-log li {
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
}

.check-log li:last-child {
  border-bottom: none;
}

.tag {
  display: inline-block;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  margin-right: 0.35rem;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
}

.tag-ok {
  background: var(--ok-soft);
  color: #86efac;
}

.tag-warn {
  background: var(--warn-soft);
  color: #fcd34d;
}

.tag-bad {
  background: var(--bad-soft);
  color: #fca5a5;
}

.foot {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--muted);
}

.foot a {
  color: var(--accent);
  text-decoration: none;
}

.foot a:hover {
  text-decoration: underline;
}

.mono {
  font-family: var(--mono);
}

.muted {
  color: var(--muted);
}

.tiny {
  font-size: 0.75rem;
}

@media (prefers-color-scheme: light) {
  .topbar {
    background: rgba(244, 248, 255, 0.9);
  }

  .monitor,
  .mini-stat {
    background: #f8fbff;
  }

  .subscribe-strip {
    background: rgba(37, 99, 235, 0.05);
  }

  .status-hero-ok {
    background: linear-gradient(135deg, #ffffff 0%, #effaf3 100%);
  }

  .status-hero-warn {
    background: linear-gradient(135deg, #ffffff 0%, #fff8eb 100%);
  }

  .status-hero-bad {
    background: linear-gradient(135deg, #ffffff 0%, #fff1f2 100%);
  }

  .status-hero-unknown {
    background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
  }

  .status-hero-icon {
    background: #ffffff;
  }

  .hm-none {
    background: #dbe7ff;
  }

  .pill-ok {
    color: #166534;
  }

  .pill-warn {
    color: #854d0e;
  }

  .pill-bad {
    color: #991b1b;
  }

  .pill-unknown {
    color: #4b5563;
  }

  .tag-ok {
    color: #166534;
  }

  .tag-warn {
    color: #854d0e;
  }

  .tag-bad {
    color: #991b1b;
  }
}