:root {
  --bg: #f7f7f5; --surface: #ffffff; --border: #e4e4e0; --text: #1c1c1a; --muted: #6b6b66;
  --up: #22a06b; --degraded: #d4a017; --down: #d93f3f; --none: #dcdcd7;
  --banner-up: #e8f6ef; --banner-degraded: #fbf4df; --banner-down: #fbe9e9;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121211; --surface: #1b1b1a; --border: #2c2c2a; --text: #ececea; --muted: #9a9a94;
    --none: #34342f; --banner-up: #13291f; --banner-degraded: #2c2512; --banner-down: #301818;
  }
}
:root[data-theme="dark"] {
  --bg: #121211; --surface: #1b1b1a; --border: #2c2c2a; --text: #ececea; --muted: #9a9a94;
  --none: #34342f; --banner-up: #13291f; --banner-degraded: #2c2512; --banner-down: #301818;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
h1 { font-size: 22px; margin: 0; letter-spacing: -0.01em; }
h1 a { color: inherit; text-decoration: none; }
.updated { color: var(--muted); font-size: 13px; }
.banner {
  display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-radius: 10px;
  background: var(--banner-up); font-weight: 600; margin-bottom: 28px;
}
.banner.degraded { background: var(--banner-degraded); }
.banner.down { background: var(--banner-down); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--up); flex: none; }
.dot.degraded { background: var(--degraded); }
.dot.down { background: var(--down); }
.dot.unknown { background: var(--none); }
section { margin-bottom: 28px; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 0 0 10px; font-weight: 600; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.row { padding: 14px 16px; }
.row + .row { border-top: 1px solid var(--border); }
.row-head { display: flex; align-items: center; gap: 10px; }
.name { font-weight: 600; flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; }
.ext { color: var(--muted); display: inline-flex; padding: 2px; border-radius: 4px; }
.ext:hover { color: var(--text); background: var(--bg); }
.ext svg { width: 13px; height: 13px; }
.state { font-size: 13px; color: var(--muted); white-space: nowrap; }
.state.down { color: var(--down); font-weight: 600; }
.state.degraded { color: var(--degraded); font-weight: 600; }
.bars { display: flex; gap: 2px; height: 28px; margin-top: 10px; }
.bars span { flex: 1; border-radius: 2px; background: var(--none); min-width: 0; }
.bars span.up { background: var(--up); }
.bars span.degraded { background: var(--degraded); }
.bars span.down { background: var(--down); }
.bar-legend { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin-top: 6px; }
.incident { padding: 12px 16px; }
.incident + .incident { border-top: 1px solid var(--border); }
.incident-title { font-weight: 600; }
.incident-meta { color: var(--muted); font-size: 13px; }
.empty { padding: 14px 16px; color: var(--muted); }
footer { color: var(--muted); font-size: 13px; text-align: center; }
footer a { color: inherit; }
@media (max-width: 520px) { .bars { gap: 1px; } .bars span:nth-child(-n+60) { display: none; } }

/* ---- Chrome: the texs.org home badge (CHROME-SPEC.md §9) + top-right link ---- */
.topbar { position: relative; height: 136px; }
.home-badge {
  position: absolute; top: 32px; left: 32px; width: 72px; height: 72px; border-radius: 40px;
  background: url(https://texs.org/assets/tex-sound.avif) 50% / contain no-repeat;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); transition: transform 0.2s ease;
}
.home-badge:hover { transform: scale(1.1); }
.top-link {
  position: absolute; top: 48px; right: 32px; display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font-size: 14px; font-weight: 600; text-decoration: none; transition: border-color 0.15s;
}
.top-link:hover { border-color: var(--muted); }
@media (max-width: 768px) {
  .topbar { height: 112px; }
  .home-badge { top: 24px; left: 24px; }
  .top-link { top: 38px; right: 16px; }
}
main { max-width: 760px; margin: 0 auto; padding: 0 16px 64px; }
.lede { color: var(--muted); margin: 6px 0 24px; }
