/* Sanďbox status page. Dependency-free; follows the system theme, optional manual override. */
:root {
  color-scheme: dark;
  --bg: #0b0c0e; --surface: #131416; --line: #24262a; --text: #ededef; --muted: #8d9097; --soft: #5f636a;
  --done: #3ecf8e; --active: #f5a524; --todo: #2a2c31; --blocked: #f2555a; --unverified: #8d9097;
  --sans: "Inter var", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #fafafa; --surface: #ffffff; --line: #e7e7ea; --text: #111113; --muted: #6b6e76; --soft: #a3a6ad;
    --done: #18a96b; --active: #d98a00; --todo: #e9eaed; --blocked: #dc3e43; --unverified: #6b6e76;
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #fafafa; --surface: #ffffff; --line: #e7e7ea; --text: #111113; --muted: #6b6e76; --soft: #a3a6ad;
  --done: #18a96b; --active: #d98a00; --todo: #e9eaed; --blocked: #dc3e43; --unverified: #6b6e76;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--sans); }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: 16px; top: -48px; padding: 8px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; z-index: 2; }
.skip:focus { top: 12px; }

header, main, footer { width: min(720px, 100% - 32px); margin: 0 auto; }
header { display: flex; align-items: center; justify-content: space-between; padding: 28px 0 0; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 600; letter-spacing: -.01em; text-decoration: none; }
.brand span:last-child { color: var(--muted); font-weight: 400; }
.mark { width: 20px; height: 20px; border-radius: 6px; background: var(--text); position: relative; }
.mark::after { content: ""; position: absolute; inset: 6px; border-radius: 2px; background: var(--bg); }
nav { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--muted); }
nav a { text-decoration: none; }
nav a:hover, .about a:hover, footer a:hover, .key:hover { color: var(--text); }
.theme { width: 28px; height: 28px; padding: 0; border: 1px solid var(--line); border-radius: 7px; background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.theme::before { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid currentColor; background: linear-gradient(90deg, currentColor 50%, transparent 50%); }
.theme:hover { color: var(--text); }

main { padding: 40px 0 8px; }
.about { margin: 0 0 28px; max-width: 60ch; color: var(--muted); }
.about a { color: var(--text); text-underline-offset: 3px; text-decoration-color: var(--soft); }

.banner { --tone: var(--active); display: flex; gap: 14px; align-items: flex-start; padding: 18px 20px; border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--tone) 30%, transparent); background: color-mix(in srgb, var(--tone) 7%, transparent); }
.banner.done { --tone: var(--done); } .banner.failed { --tone: var(--blocked); }
.banner .dot { margin-top: 7px; }
h1 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -.015em; }
.banner p { margin: 2px 0 0; color: var(--muted); }
.updated { margin: 10px 2px 0; font-size: 12px; color: var(--muted); }
.updated a { text-underline-offset: 2px; }

section { margin-top: 44px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
h2 { margin: 0; font-size: 14px; font-weight: 600; }
.key { font-size: 12px; color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; flex-wrap: wrap; }
.key i { width: 8px; height: 8px; border-radius: 2px; margin: 0 5px 0 12px; background: var(--todo); }
.key i:first-child { margin-left: 0; }
.key i.done { background: var(--done); } .key i.active { background: var(--active); }

.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--unverified); }
.done .dot, .passed .dot { background: var(--done); box-shadow: 0 0 0 3px color-mix(in srgb, var(--done) 22%, transparent); }
.active .dot { background: var(--active); box-shadow: 0 0 0 3px color-mix(in srgb, var(--active) 22%, transparent); }
.failed .dot, .blocked .dot { background: var(--blocked); }

.components { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.components li { padding: 14px 18px 16px; border-top: 1px solid var(--line); }
.components li:first-child { border-top: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.row .id { width: 32px; flex: none; font: 12px var(--mono); color: var(--muted); }
.row .name { min-width: 0; font-weight: 500; text-decoration: none; }
.row a.name:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--soft); }
.tag { padding: 1px 6px; border-radius: 5px; border: 1px solid var(--line); font-size: 11px; font-weight: 400; color: var(--muted); white-space: nowrap; }
.state { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.state.passed { color: var(--done); } .state.failed { color: var(--blocked); }
.bar { display: flex; gap: 3px; height: 6px; margin: 12px 0 0 42px; }
.bar a { flex: 1; border-radius: 2px; background: var(--todo); transition: opacity .15s; }
.bar a.done { background: var(--done); } .bar a.active { background: var(--active); } .bar a.blocked { background: var(--blocked); }
.bar:hover a { opacity: .55; } .bar a:hover, .bar a:focus-visible { opacity: 1; }
.meta { margin: 7px 0 0 42px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

.phases { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 10px; background: var(--surface); overflow: hidden; }
.phases li { padding: 14px 14px 12px; border-left: 1px solid var(--line); }
.phases li:first-child { border-left: 0; }
.phases .id { font: 12px var(--mono); color: var(--muted); }
.phases .name { display: block; margin: 2px 0 10px; font-weight: 500; line-height: 1.3; min-height: 2.6em; }
.phases .count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.phases .count b { color: var(--text); font-weight: 600; }
.phases .track { display: block; height: 4px; margin-top: 6px; border-radius: 2px; background: var(--todo); overflow: hidden; }
.phases .track span { display: block; height: 100%; background: var(--done); }
.phases li.current { background: color-mix(in srgb, var(--active) 7%, transparent); box-shadow: inset 0 2px 0 var(--active); }

.changes { border-left: 1px solid var(--line); margin-left: 4px; }
.day { position: relative; padding: 0 0 18px 22px; }
.day::before { content: ""; position: absolute; left: -5px; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--bg); border: 1px solid var(--soft); }
.day h3 { margin: 0 0 6px; font-size: 13px; font-weight: 600; }
.day ul { list-style: none; margin: 0; padding: 0; }
.day li { display: flex; gap: 10px; padding: 3px 0; color: var(--muted); }
.day li a { color: var(--text); text-decoration: none; }
.day li a:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--soft); }
.day li span { flex: none; width: 34px; font: 12px/21px var(--mono); }

footer { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 20px 0 48px; margin-top: 28px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
footer a { text-decoration: none; }

@media (max-width: 640px) {
  header { padding-top: 20px; }
  main { padding-top: 28px; }
  .phases { grid-template-columns: 1fr; }
  .phases li { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; column-gap: 8px; border-left: 0; border-top: 1px solid var(--line); }
  .phases li:first-child { border-top: 0; }
  .phases .name { margin: 0; min-height: 0; }
  .phases .track { grid-column: 1 / -1; }
  .phases li.current { box-shadow: inset 2px 0 0 var(--active); }
  .bar, .meta { margin-left: 0; }
  .key { display: none; }
}
@media (prefers-reduced-motion: reduce) { .bar a { transition: none; } }
