:root {
  --bg: #f6f6f4;
  --surface: #ffffff;
  --surface-2: #f0efeb;
  --fg: #1b1c1f;
  --muted: #5d6068;
  --faint: #8a8d94;
  --border: #e2e1dc;
  --primary: #1b1c1f;
  --primary-fg: #ffffff;
  --ok: #2f7d4f;
  --warn: #9a7a2e;
  --bad: #b2453a;
  --info: #3c6aa8;
  color-scheme: light;
}
/* Night: chosen in the sidebar, or the device's setting when the choice is Auto. */
:root[data-theme="dark"] {
  --bg: #0d0e11;
  --surface: #15171b;
  --surface-2: #1d2026;
  --fg: #eceef2;
  --muted: #a3a7b0;
  --faint: #737782;
  --border: #2a2d34;
  --primary: #eceef2;
  --primary-fg: #0d0e11;
  --ok: #6fbf8a;
  --warn: #d4b36a;
  --bad: #e07a6e;
  --info: #86a9dc;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0e11;
    --surface: #15171b;
    --surface-2: #1d2026;
    --fg: #eceef2;
    --muted: #a3a7b0;
    --faint: #737782;
    --border: #2a2d34;
    --primary: #eceef2;
    --primary-fg: #0d0e11;
    --ok: #6fbf8a;
    --warn: #d4b36a;
    --bad: #e07a6e;
    --info: #86a9dc;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font: 14px/1.5 "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
}
a { color: inherit; text-underline-offset: 3px; }
code, .mono { font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; }
.shell { display: flex; min-height: 100vh; }
.side { width: 220px; flex-shrink: 0; border-right: 1px solid var(--border); padding: 20px 14px; display: flex; flex-direction: column; gap: 4px; }
.brand { font-weight: 600; margin: 0 8px 18px; }
.brand small { display: block; font-weight: 400; color: var(--faint); font-size: 12px; }
.side a { text-decoration: none; padding: 7px 10px; border-radius: 6px; color: var(--muted); }
.side a:hover, .side a.on { background: var(--surface-2); color: var(--fg); }
.side form { padding: 0 2px; }
.side .who { color: var(--faint); font-size: 12px; margin: 0 8px 6px; overflow-wrap: anywhere; }
main { flex: 1; min-width: 0; padding: 28px 32px 60px; max-width: 1180px; }
h1 { font-size: 22px; font-weight: 600; margin: 0 0 4px; letter-spacing: -0.01em; }
h2 { font-size: 15px; font-weight: 600; margin: 32px 0 10px; }
.lede { color: var(--muted); margin: 0 0 22px; max-width: 70ch; }
.eyebrow { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); margin: 0 0 4px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 8px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; text-decoration: none; display: block; }
.card .k { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); }
.card .v { font-size: 22px; font-weight: 600; margin-top: 4px; }
.card .d { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
a.card:hover { border-color: var(--faint); }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); font-weight: 500; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; white-space: nowrap; }
.empty { color: var(--muted); padding: 18px 14px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; white-space: nowrap; }
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.pill.ok::before { background: var(--ok); }
.pill.warn::before { background: var(--warn); }
.pill.bad::before { background: var(--bad); }
.pill.info::before { background: var(--info); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 14px; }
.tabs a { text-decoration: none; padding: 5px 11px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); font-size: 13px; }
.tabs a.on { background: var(--fg); color: var(--bg); border-color: var(--fg); }
form.stack { display: grid; gap: 12px; max-width: 560px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
label.check { display: flex; align-items: center; gap: 8px; color: var(--fg); }
input, select, textarea {
  font: inherit; color: var(--fg); background: var(--surface); border: 1px solid var(--border);
  border-radius: 7px; padding: 8px 10px; width: 100%;
}
input[type="checkbox"] { width: auto; }
textarea { min-height: 70px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--info); outline-offset: 1px; }
.hint { color: var(--faint); font-size: 12px; }
button, .button {
  font: inherit; font-weight: 500; cursor: pointer; border-radius: 7px; padding: 8px 14px;
  border: 1px solid var(--primary); background: var(--primary); color: var(--primary-fg); text-decoration: none; display: inline-block;
}
button.secondary, .button.secondary { background: transparent; color: var(--fg); border-color: var(--border); }
button.danger { background: transparent; color: var(--bad); border-color: var(--bad); }
button.link { background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.notice { border: 1px solid var(--border); border-left: 3px solid var(--ok); background: var(--surface); padding: 10px 14px; border-radius: 8px; margin: 0 0 18px; }
.notice.bad { border-left-color: var(--bad); }
details.box { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; margin-top: 12px; }
details.box summary { cursor: pointer; font-weight: 500; }
details.box[open] summary { margin-bottom: 12px; }
.auth { max-width: 380px; margin: 12vh auto; padding: 0 16px; }
.auth .panel { padding: 22px; overflow: visible; }
.qr { background: #fff; padding: 10px; border-radius: 8px; width: 220px; height: 220px; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; padding: 14px 16px; }
dl.facts dt { color: var(--faint); }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .shell { flex-direction: column; }
  .side { width: auto; flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--border); padding: 12px 16px; align-items: center; }
  .brand { margin: 0 12px 0 0; }

  .side .who { display: none; }
  main { padding: 20px 16px 48px; }
}
.tabs.spaced { margin-top: 16px; }
form.revoke { margin-top: 8px; min-width: 240px; }
.mono .faint { font-family: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif; font-size: 12px; }
.theme { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; padding: 2px; border: 1px solid var(--border); border-radius: 8px; margin: 0 2px 12px; }
.theme button { background: transparent; color: var(--muted); border: 0; padding: 5px 0; font-size: 12.5px; border-radius: 6px; }
.theme button:hover { color: var(--fg); }
.theme button[aria-pressed="true"] { background: var(--surface-2); color: var(--fg); }
.side .theme-label { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); margin: 0 8px 4px; }
.side .bottom { margin-top: auto; }
.side .bottom form { margin: 0; }
@media (max-width: 760px) {
  .side .bottom { margin: 0 0 0 auto; display: flex; gap: 8px; align-items: center; }
  .side .theme-label { display: none; }
  .theme { margin: 0; width: 170px; }
}
