:root {
  --ink: #17211d;
  --muted: #58645f;
  --paper: #f6f5f0;
  --surface: #ffffff;
  --line: #d7ddd8;
  --brand: #155c48;
  --brand-strong: #0d4435;
  --accent: #d7652d;
  --attention-bg: #fff0e8;
  --partial-bg: #fff8da;
  --ok-bg: #e8f5ef;
  --unavailable-bg: #eef1ef;
  --focus: #155c48;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button { font: inherit; }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 10; background: var(--ink); color: white; padding: .75rem 1rem; }
.skip-link:focus { top: 1rem; }
.app-shell { min-height: 100vh; display: grid; grid-template: auto 1fr / 15.5rem minmax(0, 1fr); }
.topbar { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 1.5rem; color: white; background: var(--brand-strong); }
.eyebrow { margin: 0 0 .15rem; color: #cbe4da; font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; }
.brand { margin: 0; font-size: 1.2rem; font-weight: 750; }
.quiet-button { border: 1px solid #a8c9bc; border-radius: .55rem; padding: .55rem .8rem; color: white; background: transparent; cursor: pointer; }
.sidebar { padding: 1.25rem 1rem; border-right: 1px solid var(--line); background: #edf2ef; }
.sidebar nav { display: grid; gap: .35rem; }
.nav-button { width: 100%; border: 0; border-radius: .55rem; padding: .7rem .8rem; text-align: left; color: var(--ink); background: transparent; cursor: pointer; }
.nav-button:hover { background: #dfe9e4; }
.nav-button[aria-current="page"] { color: white; background: var(--brand); font-weight: 700; }
.boundary-note { margin: 2rem .5rem 0; color: var(--muted); font-size: .8rem; line-height: 1.5; }
main { min-width: 0; padding: clamp(1.25rem, 3vw, 3rem); }
.live-status:empty { display: none; }
.live-status { margin-bottom: 1rem; padding: .75rem 1rem; border-left: .3rem solid var(--brand); background: var(--ok-bg); }
h1 { max-width: 46rem; margin: 0 0 .5rem; font-size: clamp(1.75rem, 4vw, 2.7rem); line-height: 1.08; }
h2 { margin: 0; font-size: 1.15rem; }
.intro { max-width: 50rem; margin: 0 0 1.5rem; color: var(--muted); line-height: 1.6; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin: 1rem 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); gap: 1rem; }
.card { min-width: 0; border: 1px solid var(--line); border-radius: .9rem; padding: 1rem; background: var(--surface); box-shadow: 0 1px 1px rgb(20 40 31 / 4%); }
.card-button { width: 100%; color: inherit; text-align: left; cursor: pointer; }
.card-button:hover { border-color: var(--brand); box-shadow: 0 4px 16px rgb(13 68 53 / 10%); }
.card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; }
.status-pill { display: inline-flex; border-radius: 999px; padding: .25rem .55rem; font-size: .75rem; font-weight: 750; }
.status-attention { color: #7b2d0e; background: var(--attention-bg); }
.status-complete, .status-information, .status-healthy { color: #14513f; background: var(--ok-bg); }
.status-partial, .status-delayed, .status-stale { color: #674f00; background: var(--partial-bg); }
.status-unavailable, .status-unknown, .status-empty { color: #44504b; background: var(--unavailable-bg); }
.summary-row { display: flex; flex-wrap: wrap; gap: .5rem 1rem; margin: 1rem 0 0; color: var(--muted); font-size: .85rem; }
.section-stack { display: grid; gap: 1rem; margin-top: 1.5rem; }
.section-card { border-left: .35rem solid var(--brand); }
.section-card[data-status="attention"] { border-left-color: var(--accent); }
.metadata { display: grid; grid-template-columns: minmax(8rem, .45fr) 1fr; gap: .5rem 1rem; margin: 1rem 0 0; }
.metadata dt { color: var(--muted); }
.metadata dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.event-list { margin: .8rem 0 0; padding: 0; list-style: none; }
.event-list li { padding: .65rem 0; border-top: 1px solid var(--line); }
.empty-state, .error-state { max-width: 42rem; border-radius: .8rem; padding: 1rem; background: var(--unavailable-bg); }
.error-state { border-left: .35rem solid var(--accent); background: var(--attention-bg); }
.primary-button { border: 0; border-radius: .55rem; padding: .65rem .9rem; color: white; background: var(--brand); cursor: pointer; }
.secondary-button { border: 1px solid var(--brand); border-radius: .55rem; padding: .6rem .85rem; color: var(--brand); background: white; cursor: pointer; }
.subtle { color: var(--muted); font-size: .85rem; }

@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); padding: .75rem; }
  .sidebar nav { display: flex; gap: .35rem; overflow-x: auto; padding-bottom: .25rem; }
  .nav-button { width: auto; white-space: nowrap; }
  .boundary-note { display: none; }
  main { padding: 1.25rem 1rem 2rem; }
  .metadata { grid-template-columns: 1fr; gap: .15rem; }
  .metadata dd { margin-bottom: .6rem; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; } }
