
:root {
  --surface: #ffffff; --surface-sunken: #f6f7f9; --surface-hover: #f1f3f4;
  --line: #dadce0; --line-strong: #80868b;
  --ink: #1f2328; --ink-muted: #5f6670;
  --key: #0a6e6a; --key-soft: #e3f3f1; --on-key: #ffffff;
  --signal: #e8a317;
  --ok: #1e7e34; --warn: #a35200; --danger: #c5221f;
  --sans: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --surface: #1b1d21; --surface-sunken: #131416; --surface-hover: #24272c;
    --line: #34373d; --line-strong: #6b7178;
    --ink: #e8eaed; --ink-muted: #9aa0a6;
    --key: #4fc1b9; --key-soft: #12302e; --on-key: #0b1f1e;
    --signal: #f2b84b;
    --ok: #6cc487; --warn: #f2b84b; --danger: #f28b82;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--surface-sunken); color: var(--ink); font: 14px/20px var(--sans); }
a { color: var(--key); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--key); outline-offset: 2px; border-radius: 4px; }

.topbar { position: sticky; top: 0; z-index: 2; height: 56px; display: flex; align-items: center; gap: 16px;
  padding: 0 24px; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 28px; height: 28px; color: var(--key); display: grid; }
.brand-mark svg { width: 28px; height: 28px; }
.legal { max-width: 720px; margin: 0 auto; padding: 32px 16px 64px; line-height: 1.6; }
.legal h2 { margin-top: 32px; }
.legal .brand { text-decoration: none; color: inherit; }
.login-body { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.login { width: 100%; max-width: 360px; }
.login-brand { justify-content: center; font-size: 22px; margin-bottom: 24px; }
.login h1 { margin: 0; }
.login .muted { text-align: center; font-size: 12px; margin-top: 16px; }
.field { display: grid; gap: 6px; font-weight: 500; }
.field input { height: 40px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 4px; font: 14px var(--sans);
  background: var(--surface); color: var(--ink); }
.field input:focus { outline: 2px solid var(--key); outline-offset: -1px; border-color: var(--key); }
.form-error { margin: 0; color: var(--danger); }
.field select { height: 40px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: 4px; font: 14px var(--sans);
  background: var(--surface); color: var(--ink); }
.invite { display: grid; grid-template-columns: 2fr 1.4fr 1fr auto; gap: 12px; align-items: end; }
.row-fields { display: grid; grid-template-columns: 1fr 1.4fr 160px; gap: 12px; }
table.perms { border: 1px solid var(--line); border-radius: 8px; border-collapse: separate; border-spacing: 0; overflow: hidden; }
table.perms th, table.perms td { padding: 8px 16px; }
table.perms td:not(:first-child), table.perms th:not(:first-child) { text-align: center; width: 90px; }
table.perms input { width: 18px; height: 18px; accent-color: var(--key); }
details summary { cursor: pointer; }
details.change > summary { list-style: none; } details.change > summary::-webkit-details-marker { display: none; }
details.change[open] { flex-basis: 100%; }
details.change form { margin-top: 12px; }
.row-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; align-items: flex-start; }
.ticks { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.ticks .muted { flex-basis: 100%; margin: 0; font-size: 12px; }
.tick { display: inline-flex; gap: 6px; align-items: center; font-weight: 500; }
.tick input { width: 18px; height: 18px; accent-color: var(--key); }
@media (max-width: 760px) { .invite, .row-fields { grid-template-columns: 1fr; } table.perms td:not(:first-child), table.perms th:not(:first-child) { width: auto; padding: 8px; } }
.topbar .spacer { flex: 1; }
.env { font-size: 12px; color: var(--ink-muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; }

.shell { display: grid; grid-template-columns: 256px minmax(0, 1fr); min-height: calc(100vh - 56px); }
.nav { background: var(--surface); border-right: 1px solid var(--line); padding: 12px 12px 12px 0; }
.nav a { display: flex; align-items: center; gap: 16px; height: 40px; padding: 0 16px 0 24px; color: var(--ink);
  border-radius: 0 999px 999px 0; font-weight: 500; }
.nav a:hover { background: var(--surface-hover); text-decoration: none; }
.nav a[aria-current="page"] { background: var(--key-soft); color: var(--key); }
.nav svg { width: 20px; height: 20px; flex: none; }

main { padding: 24px 32px 48px; max-width: 1120px; width: 100%; }
h1 { font-size: 24px; line-height: 32px; font-weight: 600; margin: 0 0 4px; letter-spacing: -0.01em; }
.lede { color: var(--ink-muted); margin: 0 0 24px; }
h2 { font-size: 16px; line-height: 24px; font-weight: 600; margin: 0; }

.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-body { padding: 16px 20px; }
.stat-label { color: var(--ink-muted); font-size: 12px; line-height: 16px; }
.stat { font-size: 28px; line-height: 36px; font-weight: 600; margin: 4px 0 2px; letter-spacing: -0.01em; }
.stat small { font-size: 14px; font-weight: 400; color: var(--ink-muted); }
.meter { height: 6px; background: var(--surface-hover); border-radius: 999px; overflow: hidden; margin-top: 10px; }
.meter > span { display: block; height: 100%; background: var(--key); }
.meter.high > span { background: var(--signal); }
.muted { color: var(--ink-muted); }
.stack > * + * { margin-top: 16px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 20px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; font-weight: 500; color: var(--ink-muted); background: var(--surface); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-hover); }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.empty { padding: 32px 20px; text-align: center; color: var(--ink-muted); }

.status { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; white-space: nowrap; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status.ok { color: var(--ok); } .status.warn { color: var(--warn); } .status.bad { color: var(--danger); } .status.off { color: var(--ink-muted); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 16px; border-radius: 4px;
  font: 500 14px/20px var(--sans); cursor: pointer; border: 1px solid var(--line); background: var(--surface); color: var(--key); white-space: nowrap; }
.btn:hover { background: var(--surface-hover); text-decoration: none; }
.btn.primary { background: var(--key); border-color: var(--key); color: var(--on-key); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--danger); }
.btn.small { height: 32px; padding: 0 12px; }
.muted.small { font-size: 12px; }
form.inline { display: inline; margin: 0; }

.copy { display: flex; align-items: center; gap: 8px; }
.copy code, pre { font: 13px/20px var(--mono); background: var(--surface-sunken); border: 1px solid var(--line); border-radius: 4px; }
.copy code { flex: 1; min-width: 0; padding: 7px 12px; overflow-x: auto; white-space: nowrap; }
pre { padding: 12px 16px; margin: 0; overflow-x: auto; }

.levels { list-style: none; margin: 0; padding: 0; }
.levels li { display: flex; align-items: center; gap: 16px; padding: 14px 20px; border-top: 1px solid var(--line); }
.levels li:first-child { border-top: 0; }
.levels .what { flex: 1; min-width: 0; }
.levels .what b { display: block; font-weight: 500; }
.levels .what span { color: var(--ink-muted); }
.check { width: 20px; height: 20px; color: var(--ok); flex: none; }

.notice { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: 8px; margin-bottom: 16px;
  background: var(--key-soft); color: var(--ink); border: 1px solid var(--line); }
.notice.warn { background: var(--surface); border-color: var(--signal); }
.notice svg { width: 20px; height: 20px; flex: none; color: var(--key); margin-top: 0; }
.notice.warn svg { color: var(--warn); }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 24px; margin: 0; }
dl.facts dt { color: var(--ink-muted); } dl.facts dd { margin: 0; }
ol.steps { margin: 0; padding-left: 20px; } ol.steps li + li { margin-top: 8px; }

@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .topbar { padding: 0 16px; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .nav { min-width: 0; }
  .nav { display: flex; overflow-x: auto; padding: 0 8px; border-right: 0; border-bottom: 1px solid var(--line); }
  .nav a { border-radius: 0; padding: 0 12px; gap: 8px; height: 48px; white-space: nowrap; }
  .nav a[aria-current="page"] { background: none; box-shadow: inset 0 -2px var(--key); }
  main { padding: 16px 16px 40px; }
  th, td { padding: 10px 12px; }
  .hide-sm { display: none; }
  .card-head { flex-wrap: wrap; }
}
