:root {
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --canvas: #f6f8fa;
  --surface: #ffffff;
  --brand: #0f766e;
  --brand-soft: #e6f4f2;
  --ok: #0f766e;
  --warn: #b45309;
  --err: #b91c1c;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: "Segoe UI", system-ui, -apple-system, sans-serif; font-size: 14px; color: var(--ink); background: var(--canvas); }
a { color: var(--brand); }
a:hover { color: #115e59; }
h1 { font-size: 22px; font-weight: 600; margin: 0; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
h2 { font-size: 15px; font-weight: 600; margin: 0; }
code, .code { font-family: Consolas, "Cascadia Mono", monospace; font-size: 12.5px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.ok { color: var(--ok); font-weight: 500; }
.warn { color: var(--warn); font-weight: 500; }
.err { color: var(--err); font-weight: 500; }
.narrow { max-width: 760px; }
.inline { display: inline; margin: 0; }

/* Top bar */
.topbar { height: 60px; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 28px; gap: 24px; flex-wrap: wrap; }
.topbar__left { display: flex; align-items: center; gap: 28px; }
.topbar__right { display: flex; align-items: center; gap: 16px; font-size: 13px; color: var(--muted); }
.topbar__right strong { color: var(--ink); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 16px; }
.nav { display: flex; gap: 4px; }
.nav__link { padding: 8px 14px; border-radius: 6px; color: #374151; text-decoration: none; }
.nav__link--active { background: var(--brand-soft); color: var(--brand); font-weight: 500; }

/* Page */
.page { max-width: 1280px; margin: 0 auto; padding: 24px 20px 40px; display: flex; flex-direction: column; gap: 20px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumbs { margin-bottom: -8px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; }
.card--flush { padding: 0; overflow: hidden; }
.card__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card:not(.card--flush) > .card__head { padding: 0 0 10px; border-bottom: 0; }
.card__foot { padding: 10px 16px; border-top: 1px solid var(--line); }

.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; min-width: 0; }
.tile__label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.tile__value { font-size: 28px; font-weight: 600; margin-top: 4px; }
.tile__value--sm { font-size: 15px; overflow-wrap: anywhere; }
.tile__sub { font-size: 13px; font-weight: 500; }
@media (max-width: 900px) { .tiles, .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grid-side { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 1000px) { .grid-2, .grid-side { grid-template-columns: 1fr; } }

/* Forms */
.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; padding: 14px 16px; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
label.check { flex-direction: row; align-items: center; gap: 8px; font-size: 13px; color: #374151; }
input[type=text], input[type=search], input[type=password], input:not([type]), select {
  height: 38px; border: 1px solid #d1d5db; border-radius: 6px; padding: 0 10px; font: inherit; font-size: 13px; color: var(--ink); background: #fff; min-width: 0;
}
input[type=search] { width: 280px; }
.form { display: flex; flex-direction: column; gap: 14px; margin-top: 12px; }
.form__row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

.btn { height: 38px; padding: 0 14px; border: 1px solid #d1d5db; border-radius: 8px; background: #fff; color: var(--ink); font: inherit; font-size: 13px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.btn:hover { background: #f9fafb; color: var(--ink); }
.btn--primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 500; }
.btn--primary:hover { background: #115e59; color: #fff; }
.btn--danger { border-color: #fecaca; color: var(--err); }
.btn--small { height: 32px; font-size: 12px; }
.btn--block { width: 100%; }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--brand); cursor: pointer; text-decoration: underline; }

details.menu { position: relative; }
details.menu > summary { list-style: none; }
details.menu > summary::-webkit-details-marker { display: none; }
.menu__body { position: absolute; right: 0; top: 44px; z-index: 5; width: 300px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px; box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12); margin: 0; }

/* Tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { background: #f9fafb; color: var(--muted); font-size: 12px; font-weight: 600; text-align: left; padding: 10px 14px; white-space: nowrap; }
.table td { padding: 11px 14px; border-top: 1px solid #f1f5f9; vertical-align: top; }
.table .num { text-align: right; white-space: nowrap; }
.row--warn { background: #fffbeb; }
.row--err { background: #fef2f2; }
.row--muted td { color: #9ca3af; }
.empty { text-align: center; color: var(--muted); padding: 28px; }

.status { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; white-space: nowrap; }
.status .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }
.status--ok { color: var(--ok); }
.status--warn { color: var(--warn); }
.status--err { color: var(--err); }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.badge--ok { background: var(--brand-soft); color: var(--ok); }
.badge--err { background: #fee2e2; color: #991b1b; }
.badge--grey { background: #f3f4f6; color: var(--muted); }

.alert { margin: 0; padding: 10px 14px; border-radius: 8px; font-size: 13px; }
.alert--ok { background: var(--brand-soft); border: 1px solid #b7e4dd; color: #134e4a; }
.alert--warn { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; margin-bottom: 12px; }
.alert--error { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.keybox { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.keybox__row { display: flex; gap: 8px; align-items: center; }
.keybox__row code { flex: 1; background: #fff; border: 1px solid #b7e4dd; border-radius: 6px; padding: 8px 10px; word-break: break-all; }
.keybox code { word-break: break-all; }

/* Heartbeat strip */
.strip { display: flex; gap: 3px; height: 40px; align-items: stretch; }
.strip__bar { flex: 1; border-radius: 2px; }
.strip__bar--ok { background: var(--brand); }
.strip__bar--miss { background: var(--err); }
.strip__bar--none { background: #e5e7eb; }
.strip__axis { display: flex; justify-content: space-between; margin-top: 4px; }

.log { font-family: Consolas, "Cascadia Mono", monospace; font-size: 12px; line-height: 1.6; padding: 10px 16px; display: flex; flex-direction: column; gap: 6px; max-height: 480px; overflow: auto; }
.log__line { display: grid; grid-template-columns: 130px 36px minmax(0, 1fr); gap: 10px; }

/* Login */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 40px 16px; }
.login__box { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 20px; }
.login__brand { display: flex; align-items: center; gap: 12px; justify-content: center; }
.login__title { font-weight: 600; font-size: 18px; }
.login .card h1 { font-size: 18px; }
.login label { font-size: 13px; color: #374151; }
.login input { height: 42px; font-size: 14px; }

/* Rollout progress on the Updates page */
.progress { height: 10px; border-radius: 999px; background: #f1f5f9; overflow: hidden; margin: 6px 0 10px; }
.progress__bar { display: block; height: 100%; background: var(--ok); }

/* Release notes on the Updates page */
.note { border-top: 1px solid var(--line); padding: 10px 0; }
.note:first-of-type { border-top: 0; }
.note > summary { cursor: pointer; display: flex; align-items: center; gap: 10px; }
.doc.doc--inline { max-width: none; margin: 0; padding: 6px 0 0 18px; font-size: 14px; }
.doc.doc--inline h3 { margin: 14px 0 6px; font-size: 14px; }

/* Public developer guide */
.doc { max-width: 880px; margin: 0 auto; padding: 28px 20px 56px; line-height: 1.6; font-size: 15px; }
.doc h1 { font-size: 28px; margin: 0 0 12px; }
.doc h2 { font-size: 20px; margin: 36px 0 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.doc h3 { font-size: 16px; font-weight: 600; margin: 24px 0 8px; }
.doc img { max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.doc code { background: var(--brand-soft); padding: 1px 5px; border-radius: 4px; }
.doc pre { background: #0f172a; color: #e2e8f0; padding: 14px 16px; border-radius: 8px; overflow-x: auto; line-height: 1.5; }
.doc pre code { background: none; padding: 0; color: inherit; font-size: 13px; }
.doc table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 14px; }
.doc th, .doc td { border: 1px solid var(--line); padding: 8px 10px; text-align: start; vertical-align: top; }
.doc th { background: var(--canvas); font-weight: 600; }
.doc li { margin: 4px 0; }
@media (max-width: 700px) { .doc table { display: block; overflow-x: auto; } }
