:root {
  color-scheme: light;
  --bg: #f3f5f2;
  --surface: #ffffff;
  --surface-2: #eef2ef;
  --ink: #17201e;
  --muted: #65706d;
  --line: #d8dfdb;
  --accent: #096b57;
  --accent-2: #a94f20;
  --good: #167149;
  --warn: #9a650b;
  --bad: #a23b35;
  --radius: 6px;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  --sans: "IBM Plex Sans", Inter, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.42;
  letter-spacing: 0;
}
button, input, select { font: inherit; letter-spacing: 0; }
a { color: inherit; }
:focus-visible { outline: 3px solid rgba(9, 107, 87, .28); outline-offset: 2px; }

.shell { width: min(1480px, 100%); margin: 0 auto; padding: 0 24px; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(243, 245, 242, .96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.topbar__inner { min-height: 56px; display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: baseline; gap: 9px; min-width: 170px; text-decoration: none; }
.brand strong { font-size: 19px; font-weight: 700; }
.brand span { color: var(--muted); font: 11px/1.2 var(--mono); }
.nav { display: flex; align-items: center; gap: 3px; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 7px 9px;
  color: var(--muted);
  text-decoration: none;
  border-radius: 4px;
  white-space: nowrap;
}
.nav a:hover,
.nav a.is-active { color: var(--ink); background: var(--surface-2); }
.service-state { margin-left: auto; display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 3px rgba(154, 101, 11, .12); }
.dot[data-state="ok"] { background: var(--good); box-shadow: 0 0 0 3px rgba(22, 113, 73, .12); }
.dot[data-state="error"] { background: var(--bad); box-shadow: 0 0 0 3px rgba(162, 59, 53, .12); }

main { padding: 18px 0 42px; }
.page-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
  margin-bottom: 12px;
}
.eyebrow { margin: 0 0 3px; color: var(--accent); font: 600 11px/1.2 var(--mono); text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 4px; font-size: 28px; line-height: 1.08; }
.page-head p { margin-bottom: 0; max-width: 82ch; color: var(--muted); }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.button {
  min-height: 40px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.button:hover { border-color: #aeb9b4; background: #fafcfb; }
.button--primary { border-color: rgba(9, 107, 87, .26); background: #e6f2ee; color: #064f41; }

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.metric { min-width: 0; padding: 9px 14px 10px; }
.metric + .metric { border-left: 1px solid var(--line); }
.metric span { display: block; color: var(--muted); font-size: 10px; }
.metric strong { display: block; margin-top: 2px; font: 600 19px/1.12 var(--mono); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.metric small { display: block; margin-top: 1px; color: var(--muted); font-size: 10px; }

.layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(300px, .72fr); gap: 10px; align-items: start; }
.layout > * { min-width: 0; }
.surface {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.surface + .surface { margin-top: 10px; }
.surface__head {
  min-height: 52px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.surface__head h2 { margin: 0; font-size: 15px; }
.surface__head p { margin: 1px 0 0; color: var(--muted); font-size: 11px; }
.surface__body { padding: 12px; }

.pill-row { display: flex; flex-wrap: wrap; gap: 6px; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8faf8;
  color: var(--muted);
  font-size: 12px;
}
.pill strong { color: var(--ink); font-family: var(--mono); font-weight: 600; }

.card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.mini-card {
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfb;
}
.mini-card h3 { margin: 0 0 5px; font-size: 13px; }
.mini-card p { margin: 0; color: var(--muted); font-size: 12px; }
.mini-card strong { display: block; margin-bottom: 4px; font: 600 17px/1.1 var(--mono); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: #f8faf8; color: var(--muted); font-size: 9px; font-weight: 600; white-space: nowrap; }
td { font-size: 12px; }
td code { font: 12px var(--mono); color: var(--accent); white-space: nowrap; }
.numeric { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.status { color: var(--muted); font-size: 12px; }
.status[data-state="ok"] { color: var(--good); }
.status[data-state="warn"] { color: var(--warn); }
.status[data-state="error"] { color: var(--bad); }

.timeline { display: grid; gap: 8px; }
.timeline-item { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.timeline-item:last-child { border-bottom: 0; }
.timeline-item strong { font: 600 12px/1.2 var(--mono); color: var(--accent); }
.timeline-item p { margin: 0; color: var(--muted); font-size: 12px; }

.footer { border-top: 1px solid var(--line); padding: 15px 0 24px; color: var(--muted); font-size: 11px; }
.footer__inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer a { text-decoration-color: #aeb9b4; text-underline-offset: 3px; }

.empty, .notice { color: var(--muted); }
.notice { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: #fbfcfb; }

@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .page-head { grid-template-columns: 1fr; }
  .page-actions { justify-content: flex-start; }
}

@media (max-width: 700px) {
  .shell { padding: 0 14px; }
  .topbar__inner { min-height: 52px; gap: 8px; }
  .brand { min-width: 0; }
  .brand span, .service-state span { display: none; }
  .nav { flex: 1 1 auto; }
  .nav a { min-height: 44px; padding: 6px; font-size: 10px; }
  main { padding: 12px 0 32px; }
  h1 { font-size: 23px; }
  .page-head p { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-size: 11px; }
  .button { min-height: 44px; }
  .metrics { display: flex; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; }
  .metrics::-webkit-scrollbar { display: none; }
  .metric { flex: 0 0 132px; scroll-snap-align: start; padding: 8px 10px; }
  .metric strong { font-size: 17px; }
  .card-grid { grid-template-columns: 1fr; }
  .surface__head { align-items: flex-start; flex-direction: column; }
  .timeline-item { grid-template-columns: 1fr; gap: 3px; }
  .table-wrap th:first-child,
  .table-wrap td:first-child { position: sticky; left: 0; z-index: 1; min-width: 96px; background: var(--surface); }
  .table-wrap th:first-child { z-index: 2; background: #f8faf8; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; }
}
