/* Tokens and components follow sparecores.com (sc-www: src/styles/theme.css, components/card.css, tables.css). */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("assets/fonts/inter-v3-latin-ext_latin-regular.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("assets/fonts/inter-v3-latin-ext_latin-500.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("assets/fonts/inter-v3-latin-ext_latin-600.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("assets/fonts/inter-v3-latin-ext_latin-700.woff2") format("woff2"); }
@font-face { font-family: "Roboto Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("assets/fonts/roboto-mono-v13-latin-ext_latin-regular.woff2") format("woff2"); }

:root {
  color-scheme: dark;
  --primary: #082f49;            /* sky-950 */
  --secondary: #0c3a58;          /* sky-975 */
  --emerald: #34d399;            /* emerald-400 */
  --emerald-soft: rgb(52 211 153 / 15%);
  --emerald-line: rgb(52 211 153 / 30%);
  --sky-300: #7dd3fc;
  --sky-400: #38bdf8;
  --sky-800: #075985;
  --text: #ffffff;
  --text-soft: #e5e7eb;          /* gray-200 */
  --muted: #9ca3af;              /* gray-400 */
  --yellow: #eab308;             /* yellow-500 */
  --red: #f87171;                /* red-400 */
  --track: #374151;              /* gray-700 */
  --font-sans: "Inter", system-ui, sans-serif;
  --font-mono: "Roboto Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--primary); color: var(--text); font-family: var(--font-sans); font-size: 16px; line-height: 1.5;
  scrollbar-gutter: stable; }
* { scrollbar-width: thin; scrollbar-color: var(--emerald) var(--track); }
a { color: var(--emerald); text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 3px; }
a:hover { color: #6b7280; }
.mono { font-family: var(--font-mono); letter-spacing: 0.125rem; }
.accent { color: var(--emerald); }
.muted { color: var(--muted); }

.content { max-width: 1400px; margin: 0 auto; }
.gutter { padding: 0 16px; }

.site-header { background: linear-gradient(180deg, var(--secondary) 7.11%, rgb(12 58 88 / 0%) 75.52%), var(--primary); padding: 10px 16px; }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.logo { height: 48px; width: auto; max-width: 60vw; display: block; }
.header-tag { font-size: 14px; color: var(--text-soft); white-space: nowrap; }

.intro { padding: 32px 0 8px; }
h1 { font-size: 30px; font-weight: 700; margin: 0 0 12px; display: flex; align-items: center; gap: 14px; }
h2 { font-size: 24px; font-weight: 300; color: var(--text-soft); margin: 0 0 14px; }
.lead { max-width: 52rem; color: var(--text-soft); font-weight: 300; margin: 0 0 8px; }
.meta { font-size: 14px; color: var(--muted); margin: 0; }
.meta.stale { color: var(--yellow); }
.hint { font-size: 14px; color: var(--muted); margin: -6px 0 14px; max-width: 60rem; }

.live-dot { position: relative; width: 12px; height: 12px; border-radius: 50%; background: var(--muted); flex: none; }
.live-dot.on { background: var(--emerald); }
.live-dot.on::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--emerald); opacity: .75;
  animation: ping 1.6s cubic-bezier(0, 0, .2, 1) infinite; }
@keyframes ping { 75%, 100% { transform: scale(2.2); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .live-dot.on::after { animation: none; } }

.sc-card { border: 1px solid var(--emerald); border-radius: 8px; background: var(--secondary); }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 16px; margin: 24px 0 8px; }
.tile { padding: 18px 20px; }
.tile-value { font-size: 30px; font-weight: 700; color: var(--emerald); line-height: 1.2; font-variant-numeric: tabular-nums; }
.tile-label { font-size: 14px; color: var(--text-soft); }

.block { margin: 40px 0; }

/* Now */
.idle { padding: 28px; display: flex; gap: 18px; align-items: flex-start; }
.idle-icon { width: 40px; height: 40px; flex: none; border-radius: 50%; border: 2px solid var(--emerald-line); display: grid; place-items: center; }
.idle-icon span { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.idle h3 { margin: 0 0 4px; font-size: 18px; font-weight: 600; }
.idle p { margin: 0; color: var(--text-soft); font-weight: 300; }

.runs { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.run { padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.run.queued { border-style: dashed; border-color: var(--emerald-line); background: var(--primary); }
.run-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; min-width: 0; }
.run-title { min-width: 0; }
.run-sku { display: block; font-family: var(--font-mono); font-size: 17px; overflow-wrap: break-word; }
.run-vendor { display: block; font-size: 13px; color: var(--muted); }
.run-head .badge { margin-left: auto; }
.progress { height: 8px; border-radius: 99px; background: var(--primary); overflow: hidden; border: 1px solid var(--emerald-line); }
.progress > div { height: 100%; background: var(--emerald); width: 0; transition: width .4s ease; }
.run-facts { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--text-soft); }
.run-facts b { font-weight: 500; color: var(--text); }
.tasks { display: flex; flex-wrap: wrap; gap: 4px; }
.task { font-family: var(--font-mono); font-size: 11px; padding: 1px 6px; border-radius: 4px; border: 1px solid var(--track); color: var(--muted); }
.task.done { border-color: var(--emerald-line); color: var(--emerald); background: var(--emerald-soft); }
.task.running { border-color: var(--sky-400); color: var(--sky-300); }
.task.failed { border-color: var(--red); color: var(--red); }

/* The logos come from sparecores.com, which shows them on a white rounded tile (dark logos stay readable). */
.vlogo { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 36px; height: 36px; padding: 4px;
  box-sizing: border-box; background: #fff; border-radius: 8px; }
.vlogo img { display: block; width: 100%; height: 100%; object-fit: contain; }
.vcell { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.vcell .vlogo { width: 28px; height: 28px; padding: 3px; border-radius: 6px; }

.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 500;
  white-space: nowrap; border: 1px solid var(--emerald-line); background: var(--emerald-soft); color: var(--emerald); }
.badge.info { border-color: rgb(56 189 248 / 35%); background: rgb(56 189 248 / 12%); color: var(--sky-300); }
.badge.warn { border-color: rgb(234 179 8 / 40%); background: rgb(234 179 8 / 12%); color: var(--yellow); }
.badge.bad { border-color: rgb(248 113 113 / 40%); background: rgb(248 113 113 / 12%); color: var(--red); }
.badge.plain { border-color: var(--track); background: transparent; color: var(--text-soft); }

/* Chart */
.chart-card { padding: 20px 20px 12px; }
.chart { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 6px; align-items: end; height: 180px; }
.bar { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; min-width: 0; }
.bar-fill { width: 100%; max-width: 40px; background: var(--emerald); border-radius: 4px 4px 0 0; min-height: 2px; }
.bar-fill.zero { background: var(--track); }
.bar-n { font-size: 11px; color: var(--text-soft); margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.chart-x { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 6px; margin-top: 6px; border-top: 1px solid var(--track); padding-top: 6px; }
.chart-x span { font-size: 11px; color: var(--muted); text-align: center; white-space: nowrap; overflow: hidden; }

/* Tables (sc-table) */
.table-wrap { overflow-x: auto; border-radius: 8px; border: 1px solid var(--sky-800); }
.sc-table { width: 100%; border-collapse: collapse; color: var(--text); }
.sc-table thead { background: var(--secondary); border-bottom: 1px solid var(--text-soft); }
.sc-table th { padding: 12px 20px; text-align: left; font-size: 12px; font-weight: 400; white-space: nowrap; }
.sc-table td { padding: 12px 20px; text-align: left; font-size: 14px; white-space: nowrap; }
.sc-table tbody tr:nth-child(odd) { background: var(--primary); }
.sc-table tbody tr:nth-child(even) { background: var(--secondary); }
.sc-table tbody tr:hover { outline: 1px solid var(--emerald); outline-offset: -1px; }
.sc-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.sc-table .sku { font-family: var(--font-mono); font-size: 13px; }
.sc-table .empty { color: var(--muted); text-align: center; height: 64px; }
.sc-table .dim { color: var(--muted); }
.sc-table .sub { display: block; font-size: 12px; color: var(--muted); white-space: normal; max-width: 10rem; margin-left: auto; }
.defs { margin-top: 12px; font-size: 14px; color: var(--text-soft); max-width: 60rem; }
.defs summary { cursor: pointer; color: var(--muted); }
.defs ul { margin: 8px 0 0; padding-left: 20px; font-weight: 300; }
.defs li { margin-bottom: 4px; }
.bar-col { min-width: 160px; }
.cov { display: flex; align-items: center; gap: 10px; }
.cov-track { flex: 1; height: 6px; border-radius: 99px; background: var(--track); overflow: hidden; min-width: 80px; }
.cov-track > div { height: 100%; background: var(--emerald); }
.cov-pct { font-variant-numeric: tabular-nums; width: 42px; text-align: right; font-size: 13px; }

/* Servers over time (timeline.js) */
.tl-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 10px; }
.tl-toolbar button { font: 500 14px var(--font-sans); color: var(--text-soft); background: transparent; border: 0; padding: 6px 12px; cursor: pointer; }
.tl-toolbar button.on { background: var(--emerald-soft); color: var(--emerald); }
.tl-ranges { display: inline-flex; border: 1px solid var(--emerald-line); border-radius: 8px; overflow: hidden; }
.tl-ranges button + button { border-left: 1px solid var(--emerald-line); }
.tl-now { border: 1px solid var(--emerald-line) !important; border-radius: 8px; }
.tl-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--muted); }
.tl-legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { display: inline-block; width: 16px; height: 10px; border-radius: 2px; }
.sw.spot { background: var(--emerald); }
.sw.od { background: var(--sky-400); }
.sw.starting { border: 1px dashed var(--muted); }
.sw.wait { border: 1px dashed var(--yellow); }
.sw.int { background: linear-gradient(90deg, var(--emerald) 70%, var(--red) 70%); }
.tl-frame { position: relative; border: 1px solid var(--emerald-line); border-radius: 12px; background: var(--secondary); overflow: hidden; }
.tl-axis { display: block; width: 100%; border-bottom: 1px solid var(--emerald-line); cursor: grab; touch-action: pan-y; }
.tl-scroll { max-height: 70vh; overflow-y: auto; overflow-x: hidden; }
#tl-chart { display: block; width: 100%; cursor: grab; touch-action: pan-y; }
.tl-dragging, .tl-dragging canvas { cursor: grabbing !important; }
.tl-tip { position: absolute; z-index: 2; max-width: 300px; padding: 10px 12px; border-radius: 8px; font-size: 13px; line-height: 1.45;
  background: var(--primary); border: 1px solid var(--emerald-line); box-shadow: 0 6px 24px rgb(0 0 0 / 40%); pointer-events: none; }
.tl-tip b { font-family: var(--font-mono); font-weight: 400; color: var(--text); }
.tl-tip .k { color: var(--muted); }
#tl-meta { margin-top: 8px; }

.site-footer { border-top: 1px solid var(--emerald); background: var(--secondary); padding: 32px 0 48px; margin-top: 56px; }
.footer-row p { margin: 0 0 6px; font-size: 14px; font-weight: 300; }

@media (max-width: 640px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile:last-child { grid-column: span 2; }
  .tile { padding: 14px; }
  .tile-value { font-size: 24px; }
  h1 { font-size: 24px; }
  .header-tag { display: none; }
  .logo { height: 36px; }
  .runs { grid-template-columns: 1fr; }
  .chart { height: 140px; gap: 3px; }
  .chart-x { gap: 3px; }
  .chart-x span:nth-child(even) { visibility: hidden; }
  .bar-n { font-size: 9px; }
  .sc-table th, .sc-table td { padding: 10px 12px; }
  .idle { padding: 20px; }
}
