/* Boots Bot status page - self-contained stylesheet (brand tokens copied from the docs) */
:root {
  --primary: #ff9f43;
  --primary-strong: #b45309;   /* orange as text on light backgrounds (AA) */
  --on-primary: #3b1f00;
  --secondary: #38bdf8;
  --secondary-strong: #0369a1; /* links on light backgrounds (AA) */
  --focus-ring: var(--primary-strong);
  --bg: #f7f8fa;
  --surface: #ffffff;
  --text: #1d2330;
  --muted: #5f6675;
  --border: #e4e7ec;
  --radius: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Status colors: *-text is AA on *-bg and on --surface, bars are >= 3:1 on --surface */
  --ok-text: #1f7a52;
  --ok-bg: #e7f6ee;
  --ok-bar: #2f9e6a;
  --slow-text: #8a4b00;
  --slow-bg: #fff4e0;
  --slow-bar: #c77700;
  --down-text: #b42318;
  --down-bg: #fdecec;
  --down-bar: #e5484d;
  --empty-bar: #e4e7ec;
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #ffa94d;
    --primary-strong: #ffb870;
    --on-primary: #2b1600;
    --secondary: #4fc3f7;
    --secondary-strong: #7dd3fc;
    --focus-ring: var(--primary);
    --bg: #11141a;
    --surface: #1a1e26;
    --text: #e8eaf0;
    --muted: #9aa3b2;
    --border: #2b313c;

    --ok-text: #6ee7a8;
    --ok-bg: #12291f;
    --ok-bar: #34c27f;
    --slow-text: #fbbf24;
    --slow-bg: #2d2412;
    --slow-bar: #f5b13d;
    --down-text: #ff9b9b;
    --down-bg: #2f1719;
    --down-bar: #f06368;
    --empty-bar: #2b313c;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--secondary-strong); }
a:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; border-radius: 3px; }
h1, h2 { line-height: 1.25; margin: 0; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.1rem; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }

/* Top bar */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.7rem 1.25rem;
  background: var(--surface);
  border-bottom: 3px solid var(--primary);
}
.brand { color: var(--text); text-decoration: none; font-weight: 700; white-space: nowrap; }
.brand-sub { color: var(--primary-strong); font-weight: 400; margin-left: 0.3rem; }
.topbar-link { font-size: 0.95rem; }

.container {
  flex: 1;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 2rem 1rem 1rem;
}

/* Icons */
.icon {
  width: 1.25em; height: 1.25em; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* Overall banner */
.banner {
  display: flex; align-items: center; gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  border: 1px solid currentColor;
  margin-bottom: 1.5rem;
}
.banner .icon { width: 2.5rem; height: 2.5rem; }
.banner h1 { color: inherit; }
.banner-meta { margin: 0.25rem 0 0; font-size: 0.9rem; color: var(--text); }
.banner-ok { background: var(--ok-bg); color: var(--ok-text); }
.banner-slow { background: var(--slow-bg); color: var(--slow-text); }
.banner-down { background: var(--down-bg); color: var(--down-text); }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}
.card > h2 { margin-bottom: 0.75rem; }

/* Components */
.components { list-style: none; margin: 0; padding: 0; }
.component {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--border);
}
.component:first-child { border-top: 0; padding-top: 0.25rem; }
.component-name { font-weight: 600; }
.component-detail { display: block; font-weight: 400; font-size: 0.875rem; color: var(--muted); }

.pill {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.875rem; font-weight: 600;
  white-space: nowrap;
}
.pill-ok { background: var(--ok-bg); color: var(--ok-text); }
.pill-slow { background: var(--slow-bg); color: var(--slow-text); }
.pill-down { background: var(--down-bg); color: var(--down-text); }

/* History strip */
.history-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.history { display: flex; gap: 2px; height: 36px; }
.bar { flex: 1 1 0; min-width: 0; border-radius: 2px; }
.bar-ok { background: var(--ok-bar); }
.bar-slow { background: var(--slow-bar); }
.bar-down { background: var(--down-bar); }
.bar-empty { background: var(--empty-bar); }
.history-scale {
  display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; flex-wrap: wrap;
  margin-top: 0.5rem;
}
.legend { display: inline-flex; gap: 0.9rem; flex-wrap: wrap; }
.legend > span { display: inline-flex; align-items: center; gap: 0.35rem; }
.dot { display: inline-block; width: 0.7rem; height: 0.7rem; border-radius: 2px; }

.refresh-note { text-align: center; margin: 0; }

/* Footer */
.footer {
  text-align: center;
  padding: 1.5rem 1rem 2rem;
  border-top: 1px solid var(--border);
  margin-top: 1.5rem;
}
.footer p { margin: 0.25rem 0; }

@media (max-width: 560px) {
  .container { padding-top: 1.25rem; }
  .banner { padding: 1rem; gap: 0.75rem; }
  .banner .icon { width: 2rem; height: 2rem; }
  h1 { font-size: 1.25rem; }
  .card { padding: 1rem; }
  .component { flex-wrap: wrap; gap: 0.4rem; }
  .history { gap: 1px; height: 30px; }
  .history-scale { justify-content: center; }
  .history-scale > span:first-child, .history-scale > span:last-child { display: none; }
}
