/* Racko status v2 — follows the OS theme (toggle overrides). Brand red is chrome only;
   data and status use the reserved status palette, always with a text label. */
:root {
  color-scheme: light;
  --brand: #e5322d;
  --band: #0b0b0c;
  --bg: #f6f6f4;
  --surface: #ffffff;
  --surface-2: #f2f2ef;
  --line: #e6e6e1;
  --text: #0f0f10;
  --text-2: #4b4b47;
  --muted: #74746e;
  --empty: #e4e4df;
  --st-good: #0ca30c;
  --st-warning: #fab219;
  --st-serious: #ec835a;
  --st-critical: #d03b3b;
  --st-pending: #a1a1aa;
  --st-maint: #2a78d6;
  --series: #2a78d6;
  --shadow: 0 1px 2px rgba(16, 16, 16, .04), 0 1px 12px rgba(16, 16, 16, .04);
  --radius: 16px;
  --font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0b0b0c; --surface: #141416; --surface-2: #1b1b1e; --line: #26262a;
    --text: #f2f2f2; --text-2: #c2c2c8; --muted: #8a8a93; --empty: #2a2a2f;
    --st-pending: #6b7280; --st-maint: #3987e5; --series: #3987e5; --shadow: none;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0b0c; --surface: #141416; --surface-2: #1b1b1e; --line: #26262a;
  --text: #f2f2f2; --text-2: #c2c2c8; --muted: #8a8a93; --empty: #2a2a2f;
  --st-pending: #6b7280; --st-maint: #3987e5; --series: #3987e5; --shadow: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 var(--font); }
body { overflow-x: hidden; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
a:hover { color: var(--brand); }
.wrap { max-width: 880px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }

/* Brand band */
.band { background: var(--band); border-bottom: 3px solid var(--brand); }
.band .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 64px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #fff; }
.brand img { height: 28px; width: auto; display: block; }
.brand .tag { font-weight: 600; color: #c8c8cf; border-left: 1px solid #3a3a40; padding-left: 12px; }
.top-actions { display: flex; gap: 8px; align-items: center; }
.env { font-size: 11px; font-weight: 700; letter-spacing: .08em; padding: 3px 9px; border-radius: 999px;
  background: #1f1f23; color: #d4d4da; border: 1px solid #34343a; }
.btn { font: inherit; font-size: 13px; color: #d4d4da; background: transparent; border: 1px solid #34343a;
  border-radius: 999px; padding: 5px 12px; cursor: pointer; text-decoration: none; }
.btn:hover { color: #fff; border-color: #5a5a62; }

main { padding: 28px 0 8px; }

/* Hero */
.hero { display: flex; gap: 16px; align-items: flex-start; padding: 22px 24px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); position: relative; overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--hero, var(--st-good)); }
.hero .ico { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: var(--hero); color: #fff; font-weight: 800; font-size: 18px; }
.hero h1 { margin: 0; font-size: 24px; line-height: 1.25; letter-spacing: -0.015em; }
.hero p { margin: 6px 0 0; color: var(--text-2); max-width: 62ch; }
.lvl-good { --hero: var(--st-good); } .lvl-warning { --hero: var(--st-warning); }
.lvl-serious { --hero: var(--st-serious); } .lvl-critical { --hero: var(--st-critical); }
.lvl-pending { --hero: var(--st-pending); } .lvl-maint { --hero: var(--st-maint); }
.lvl-warning .ico { color: #1a1a19; }
.stale { margin-top: 12px; padding: 10px 14px; border-radius: 12px; border: 1px dashed var(--st-warning);
  background: var(--surface); font-size: 14px; }
.meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 16px; margin: 12px 4px 0; }

/* Sections */
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 36px 4px 12px; }
h2.sec { font-size: 17px; letter-spacing: -0.01em; margin: 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }

/* Component rows */
.svc { padding: 18px 22px; }
.svc + .svc { border-top: 1px solid var(--line); }
.svc-head { display: flex; align-items: center; gap: 12px; }
.svc-name { font-weight: 600; }
.svc-about { color: var(--muted); font-size: 13px; }
.svc-right { margin-left: auto; text-align: right; white-space: nowrap; }
.pill { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; }
.pill i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); display: inline-block;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 22%, transparent); }
.pill[data-s="1"] { --c: var(--st-good); } .pill[data-s="0"] { --c: var(--st-critical); }
.pill[data-s="2"] { --c: var(--st-pending); } .pill[data-s="3"] { --c: var(--st-maint); }
.days { width: 100%; height: 34px; display: block; margin-top: 12px; }
.days-legend { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.days-legend .mid { color: var(--text-2); font-weight: 600; }
.strip { width: 100%; height: 22px; display: block; }
details.more { margin-top: 10px; }
details.more summary { cursor: pointer; color: var(--text-2); font-size: 13px; list-style: none; display: inline-flex; gap: 6px; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::before { content: "＋"; color: var(--muted); }
details.more[open] summary::before { content: "－"; }
.detail-box { margin-top: 10px; padding: 12px 14px; background: var(--surface-2); border-radius: 12px; }

/* Charts */
.chart { width: 100%; height: auto; display: block; margin-top: 8px; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { stroke: var(--muted); stroke-width: 1; opacity: .5; }
.chart .tick { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .line { fill: none; stroke: var(--series); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: var(--series); opacity: .08; }
.chart .cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .dot { fill: var(--series); stroke: var(--surface); stroke-width: 2; }
.tip { position: fixed; z-index: 10; display: none; pointer-events: none; background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 11px; font-size: 12px; line-height: 1.5;
  box-shadow: 0 8px 28px rgba(0,0,0,.18); max-width: 280px; }

/* Failover */
.fo { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: stretch; }
.fo .site { padding: 18px 20px; }
.fo .arrow { display: grid; place-items: center; color: var(--muted); font-size: 20px; }
.fo .site h3 { margin: 0 0 2px; font-size: 15px; }
.fo .active { outline: 2px solid var(--st-good); outline-offset: -2px; }
.badge { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 2px 8px;
  border-radius: 999px; border: 1px solid var(--line); color: var(--text-2); white-space: nowrap; }

/* Incidents */
.inc-day { margin: 18px 4px 8px; font-size: 13px; font-weight: 700; color: var(--text-2); }
.inc { padding: 16px 20px; display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; }
.inc + .inc { border-top: 1px solid var(--line); }
.inc .dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; background: var(--c, var(--st-critical)); grid-row: span 3; }
.inc.resolved .dot { --c: var(--st-good); }
.inc .t { font-weight: 600; }
.inc .w { font-size: 13px; color: var(--text-2); }
.inc .w b { color: var(--text); font-weight: 600; }
.empty-state { padding: 22px; text-align: center; color: var(--muted); }

footer.site-foot { margin: 44px 0 0; padding: 22px 0 36px; border-top: 1px solid var(--line); color: var(--muted);
  font-size: 13px; display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: space-between; }
footer.site-foot a { color: var(--text-2); font-weight: 600; }

/* Ops dashboard */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.kpi { padding: 16px 18px; }
.kpi .k { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.kpi .v { font-size: 26px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi .s { font-size: 13px; color: var(--text-2); }
.grid2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.mon { padding: 18px 20px; }
.mon .stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
.mon .stats div { background: var(--surface-2); border-radius: 10px; padding: 6px 9px; }
.mon .stats b { display: block; font-variant-numeric: tabular-nums; }
.mon .err { margin-top: 8px; font-size: 12px; color: var(--st-critical); font-family: Consolas, Menlo, monospace; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th, table.data td { text-align: left; padding: 9px 14px; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
table.data th { color: var(--muted); font-weight: 600; border-top: 0; }
.wrap.wide { max-width: 1120px; }

@media (max-width: 720px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .grid2 { grid-template-columns: 1fr; }
  .fo { grid-template-columns: 1fr; }
  .fo .arrow { transform: rotate(90deg); }
  .hero { padding: 18px; }
  .hero h1 { font-size: 20px; }
  .brand .tag { display: none; }
  .svc { padding: 16px; }
  .mon .stats { grid-template-columns: repeat(2, 1fr); }
  table.data .hide-sm { display: none; }
}
@media (forced-colors: active) { .pill i, .days rect, .strip rect { forced-color-adjust: none; } }
@media (max-width: 480px) {
  .band .env { display: none; }
  .top-actions { gap: 6px; }
  .btn { padding: 5px 10px; }
}
