/* HQ components. Every colour, size and type value comes from tokens.css
   (generated from design/tokens.json). No literal colours in this file. */

*, *::before, *::after { box-sizing: border-box; }
/* The topbar is sticky: keep focus and anchor jumps out from under it. */
html { -webkit-text-size-adjust: 100%; scroll-padding-top: var(--topbar); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 20px;
  font-feature-settings: "cv11", "ss01";
}
a { color: var(--link); }
a:hover { color: var(--link-hover); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); font-size: 12px; line-height: 18px; }
.muted { color: var(--ink-3); }

/* ---- App shell -------------------------------------------------------- */
.shell { min-height: 100vh; display: flex; flex-wrap: wrap; }
.sidebar {
  flex: 1 1 var(--sidebar); max-width: 100%;
  background: var(--surface); border-right: 1px solid var(--border);
  padding: 14px var(--space-6);
  display: flex; flex-direction: column; gap: var(--space-8);
}
.main-col { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; }
/* Side by side, the sidebar holds the viewport: it doesn't scroll away with the page, and the
   user sits at the bottom of the screen, not of the content. 792px = sidebar (232) + the main
   column's basis (560), where the two stop wrapping; a media query can't read the tokens. */
@media (min-width: 792px) {
  .sidebar { position: sticky; top: 0; align-self: flex-start; height: 100vh; height: 100dvh; overflow-y: auto; }
}

.brand { display: flex; align-items: center; gap: var(--space-5); padding: var(--space-2) var(--space-3); font-weight: 600; }
.brand-mark {
  width: var(--control-sm); height: var(--control-sm); border-radius: var(--radius-sm);
  background: var(--ink); color: var(--surface);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
}
.brand-sub { display: block; font-size: 12px; line-height: 16px; font-weight: 400; color: var(--ink-3); }

.nav { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-1); }
.nav-label { margin: 0 0 var(--space-3); padding: 0 var(--space-4); font-size: 12px; line-height: 16px; font-weight: 500; color: var(--ink-3); }
.nav-item {
  display: flex; align-items: center; gap: var(--space-5);
  height: var(--nav-item); padding: 0 var(--space-4); border-radius: var(--radius-sm);
  color: var(--ink-2); text-decoration: none;
}
.nav-item:hover { background: var(--surface-sunken); color: var(--ink); }
.nav-item[aria-current="page"] { background: var(--surface-sunken); color: var(--ink); font-weight: 600; }
.nav-item[aria-disabled="true"] { color: var(--ink-disabled); pointer-events: none; }
.nav-item svg { flex: none; }
.nav-count {
  margin-left: auto; padding: 0 7px; border-radius: var(--radius-pill);
  background: var(--warn-soft); color: var(--warn-ink);
  font-size: 12px; line-height: 18px; font-weight: 600; font-variant-numeric: tabular-nums;
}

.sidebar-user {
  margin-top: auto; display: flex; align-items: center; gap: var(--space-5);
  padding: var(--space-4) var(--space-3); border-top: 1px solid var(--line);
}
.sidebar-user-name { display: flex; flex-direction: column; min-width: 0; }
.sidebar-user-name > :first-child { font-weight: 500; }
.sidebar-user-name > :last-child { font-size: 12px; line-height: 16px; color: var(--ink-3); }
.sidebar-user > .btn { margin-left: auto; }

.avatar {
  flex: none; width: var(--control-sm); height: var(--control-sm); border-radius: var(--radius-pill);
  background: var(--accent); color: var(--on-accent);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
}
.avatar--neutral { background: var(--neutral-soft); color: var(--neutral-ink); }

/* Setup steps: the onboarding checklist in the sidebar */
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-1); }
.step {
  display: flex; align-items: center; gap: var(--space-5);
  height: var(--nav-item); padding: 0 var(--space-4); border-radius: var(--radius-sm); color: var(--ink-2);
}
.step-mark {
  flex: none; width: 20px; height: 20px; border-radius: var(--radius-pill);
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--control-border); font-size: 11px; font-weight: 600; color: var(--ink-2);
}
.step[aria-current="step"] { background: var(--surface-sunken); color: var(--ink); font-weight: 600; }
.step[aria-current="step"] .step-mark { border: 2px solid var(--accent); color: var(--ink); }
.step--done .step-mark { border: 0; background: var(--ok-soft); color: var(--ok-ink); }

/* ---- Topbar ----------------------------------------------------------- */
/* Sticky, so the page's title stays in view; above the row menus (z-index 10). */
.topbar {
  position: sticky; top: 0; z-index: 20;
  height: var(--topbar); padding: 0 var(--space-9);
  background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: var(--space-6);
}
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; gap: var(--space-4); font-size: 13px; line-height: 18px; color: var(--ink-3); }
.crumbs li + li::before { content: "/"; margin-right: var(--space-4); color: var(--ink-3); }
.crumbs a { color: var(--ink-3); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.crumbs [aria-current="page"] { color: var(--ink); font-weight: 500; }
.topbar-end { margin-left: auto; display: flex; align-items: center; gap: var(--space-6); font-size: 13px; color: var(--ink-3); }

.search {
  display: flex; align-items: center; gap: var(--space-4);
  width: 240px; max-width: 40vw; height: var(--nav-item); padding: 0 var(--space-5);
  border: 1px solid var(--control-border); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--ink-3);
}
.search:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.search input { flex: 1 1 auto; min-width: 0; border: 0; background: transparent; font-size: 13px; color: var(--ink); }
.search input:focus { outline: none; }
.search input::placeholder { color: var(--ink-3); }
.kbd {
  font-family: var(--font-mono); font-size: 11px; line-height: 16px; padding: 0 var(--space-2);
  border: 1px solid var(--border); border-radius: var(--radius-xs); background: var(--surface); color: var(--ink-3);
}

/* ---- Page ------------------------------------------------------------- */
.page { flex: 1 0 auto; padding: var(--space-9); display: flex; flex-direction: column; gap: var(--space-7); }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-6); }
.page-head > div { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.page-title { margin: 0; font-size: 20px; line-height: 28px; font-weight: 600; letter-spacing: -0.01em; text-wrap: balance; }
.page-sub { margin: 0; font-size: 13px; line-height: 18px; color: var(--ink-2); max-width: 70ch; }
.cols { display: flex; flex-wrap: wrap; gap: var(--space-7); align-items: flex-start; }
.cols > .col-main { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: var(--space-7); }
.cols > .col-side { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: var(--space-7); }

/* ---- Stat tiles ------------------------------------------------------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--space-6); }
.stat {
  padding: var(--space-6) var(--space-7); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  display: flex; flex-direction: column; gap: var(--space-2);
}
.stat-label { font-size: 12px; line-height: 16px; color: var(--ink-3); }
.stat-value { font-size: 22px; line-height: 28px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat-value--warn { color: var(--warn-ink); }
.stat-value--ok { color: var(--ok-ink); }

/* ---- Panels ----------------------------------------------------------- */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); min-width: 0; }
.panel-head {
  padding: var(--space-6) var(--space-7); border-bottom: 1px solid var(--line);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-6);
}
.panel-title { margin: 0; font-size: 14px; line-height: 20px; font-weight: 600; }
.panel-body { padding: var(--space-7); display: flex; flex-direction: column; gap: var(--space-6); }
.panel-foot { padding: var(--space-5) var(--space-7); font-size: 12px; line-height: 16px; color: var(--ink-3); }
.panel > .table-wrap:last-child, .panel > .table:last-child { border-bottom-left-radius: var(--radius-md); border-bottom-right-radius: var(--radius-md); }

/* ---- Tables ----------------------------------------------------------- */
.table-wrap { overflow-x: auto; position: relative; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 18px; }
.table th, .table td { padding: var(--space-4) var(--space-6); border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.table th:first-child, .table td:first-child { padding-left: var(--space-7); }
.table th:last-child, .table td:last-child { padding-right: var(--space-7); }
.table thead th { font-size: 12px; line-height: 16px; font-weight: 500; color: var(--ink-3); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .group th {
  padding-top: var(--space-3); padding-bottom: var(--space-3);
  background: var(--bg); font-size: 12px; line-height: 16px; font-weight: 600; color: var(--ink-2);
}
.table .group th span { font-weight: 400; color: var(--ink-3); }
.table .row--root td { background: var(--bg); font-weight: 600; }
.table .indent { padding-left: calc(var(--space-7) + 18px); }
.cell-key { font-family: var(--font-mono); font-size: 12px; white-space: nowrap; }
.cell-nowrap { white-space: nowrap; }
.cell-actions { white-space: nowrap; text-align: right; }
.table td.cell-actions { padding-top: var(--space-3); padding-bottom: var(--space-3); }
.cell-actions > * + * { margin-left: var(--space-3); }
.inline-form { display: inline; }
/* Long text cut to two lines; the title attribute carries all of it. */
.clamp { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; color: var(--ink-2); font-size: 12px; line-height: 16px; }

/* ---- Tree: branches that fold, leaves in shared columns ---------------- */
/* Every row, branch or leaf, uses the same grid, so columns line up at any depth. The first
   cell is indented by --level, and a guide line is drawn for each ancestor. */
.tree { font-size: 13px; line-height: 18px; --step: 20px; }
.tree-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  column-gap: var(--space-6); align-items: center;
  padding: var(--space-4) var(--space-7) var(--space-4) 0; border-bottom: 1px solid var(--line);
  background-image: repeating-linear-gradient(to right, transparent 0 calc(var(--step) - 1px), var(--border) calc(var(--step) - 1px) var(--step));
  background-size: calc((var(--level, 1) - 1) * var(--step)) 100%; background-repeat: no-repeat;
}
.tree-key { padding-left: calc(var(--space-7) + (var(--level, 1) - 1) * var(--step)); min-width: 0; overflow-wrap: anywhere; }
.tree-top { background-color: var(--surface-sunken); }
.tree-leaves { list-style: none; margin: 0; padding: 0; }
.tree .cell-key { white-space: normal; overflow-wrap: anywhere; }
/* A record: its key small on top, the value it proposes in full, then what it replaces, why,
   the full text folded, and where it came from. The buttons sit at the top on the right. */
.tree-leaves > .tree-row { align-items: start; padding-top: var(--space-5); padding-bottom: var(--space-5); }
.leaf > * { margin: 0; }
.leaf > * + * { margin-top: var(--space-2); }
.leaf-key { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); color: var(--ink-2); }
.leaf-value { font-size: 14px; line-height: 20px; color: var(--ink); max-width: 80ch; }
.leaf-was { font-size: 13px; color: var(--ink-2); max-width: 80ch; }
.leaf-why { font-size: 13px; color: var(--ink-2); max-width: 80ch; }
.leaf-warn { font-size: 13px; color: var(--warn-ink); max-width: 80ch; }
.leaf-from { font-size: 12px; line-height: 16px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.leaf-body > summary { cursor: pointer; font-size: 12px; color: var(--accent-ink); width: fit-content; }
.leaf-body > summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.leaf-text { margin-top: var(--space-3); padding: var(--space-4) var(--space-5); max-width: 80ch; max-height: 24rem; overflow: auto;
  white-space: pre-wrap; font-size: 13px; line-height: 20px; color: var(--ink-2); background: var(--surface-sunken); border-radius: var(--radius-xs); }
@media (max-width: 720px) {
  .tree-leaves > .tree-row { grid-template-columns: minmax(0, 1fr); row-gap: var(--space-4); }
  .tree-leaves .cell-actions { text-align: left; padding-left: calc(var(--space-7) + (var(--level) - 1) * var(--step) + var(--space-4)); }
}
.tree-leaves .tree-key { padding-left: calc(var(--space-7) + (var(--level) - 1) * var(--step) + var(--space-4)); }
/* A branch row is as tall with its Confirm all as without it. */
.tree-top, .branch > summary { min-height: 44px; }
.branch > summary { list-style: none; cursor: pointer; }
.branch > summary::-webkit-details-marker { display: none; }
.branch > summary .tree-key { display: flex; align-items: baseline; gap: var(--space-3); }
.branch > summary .tree-key::before {
  content: ""; width: 6px; height: 6px; flex: none; align-self: center; margin-right: var(--space-2);
  border-right: 1.5px solid var(--ink-3); border-bottom: 1.5px solid var(--ink-3); transform: rotate(-45deg);
}
.branch[open] > summary .tree-key::before { transform: rotate(45deg); }
.branch > summary:hover { background-color: var(--bg); }
.branch > summary:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.branch-name { font-weight: 600; color: var(--ink); }
.branch .branch .branch-name { font-weight: 500; color: var(--ink-2); }

/* ---- Pills, tags, dots ------------------------------------------------ */
.pill {
  display: inline-flex; align-items: center; gap: var(--space-3);
  padding: var(--space-1) var(--space-4); border-radius: var(--radius-pill);
  font-size: 12px; line-height: 16px; font-weight: 500; white-space: nowrap;
  background: var(--neutral-soft); color: var(--neutral-ink);
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: var(--radius-pill); background: var(--neutral-dot); }
.pill--plain::before { display: none; }
.pill--warn { background: var(--warn-soft); color: var(--warn-ink); }
.pill--warn::before { background: var(--warn-dot); }
.pill--ok { background: var(--ok-soft); color: var(--ok-ink); }
.pill--ok::before { background: var(--ok-dot); }
.pill--accent { background: var(--accent-soft); color: var(--accent-ink); }
.pill--accent::before, .pill--role::before { display: none; }

.tag {
  display: inline-block; padding: 1px var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-xs);
  font-size: 12px; line-height: 16px; color: var(--ink-2); white-space: nowrap;
}

.dot-label { display: inline-flex; align-items: center; gap: var(--space-3); white-space: nowrap; }
.dot-label::before { content: ""; width: 8px; height: 8px; border-radius: var(--radius-pill); background: var(--neutral-dot); }
.dot-label--ok::before { background: var(--ok-dot); }
.dot-label--warn::before { background: var(--warn-dot); }

/* ---- Buttons ---------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-3);
  height: var(--control-md); padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid transparent; font-size: 13px; line-height: 18px; font-weight: 500;
  text-decoration: none; white-space: nowrap;
}
.btn--sm { height: var(--control-sm); padding: 0 var(--space-5); font-size: 12px; line-height: 16px; }
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { color: var(--on-accent); filter: brightness(0.92); }
.btn--secondary { background: var(--surface); color: var(--ink); border-color: var(--border-strong); }
.btn--secondary:hover { color: var(--ink); background: var(--surface-sunken); }
.btn--dark { background: var(--ink); color: var(--surface); }
.btn--dark:hover { color: var(--surface); filter: brightness(1.25); }
.btn--danger { background: var(--danger-fill); color: var(--on-danger); }
.btn--danger:hover { color: var(--on-danger); filter: brightness(0.92); }
.btn--link { background: transparent; color: var(--link); padding-left: var(--space-4); padding-right: var(--space-4); }
.btn--link:hover { color: var(--link-hover); text-decoration: underline; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.5; pointer-events: none; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: var(--control-sm); height: var(--control-sm); border-radius: var(--radius-sm);
  border: 1px solid transparent; background: transparent; color: var(--ink-2);
}
.icon-btn:hover, .icon-btn[aria-expanded="true"] { background: var(--surface-sunken); color: var(--ink); }

/* Segmented control: one choice among a few views or filters */
.seg { display: inline-flex; padding: var(--space-1); border-radius: var(--radius-sm); background: var(--surface-sunken); }
.seg > a, .seg > button {
  display: inline-flex; align-items: center; height: 26px; padding: 0 var(--space-5);
  border: 0; border-radius: var(--radius-inner); background: transparent;
  font-size: 12px; line-height: 16px; font-weight: 500; color: var(--ink-2); text-decoration: none; white-space: nowrap;
}
.seg > a:hover, .seg > button:hover { color: var(--ink); }
.seg > [aria-pressed="true"], .seg > [aria-current="page"] {
  background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-raised);
}

/* Row menu: the vertical-ellipsis menu for everything but the primary action */
.menu-wrap { position: relative; display: inline-block; }
.menu {
  position: absolute; right: 0; top: calc(100% + var(--space-2)); z-index: 10;
  min-width: 184px; padding: var(--space-2); margin: 0; list-style: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-overlay); text-align: left;
}
.menu[hidden] { display: none; }
.menu-item {
  display: flex; width: 100%; align-items: center; height: 30px; padding: 0 var(--space-5);
  border: 0; border-radius: var(--radius-xs); background: transparent;
  font-size: 13px; color: var(--ink); text-align: left; white-space: nowrap;
}
.menu-item:hover, .menu-item:focus-visible { background: var(--surface-sunken); }
.menu-item--danger { color: var(--danger); }

/* ---- Forms ------------------------------------------------------------ */
.field { display: flex; flex-direction: column; gap: var(--space-3); }
.field-label { font-size: 13px; line-height: 18px; font-weight: 500; }
.field-hint { font-size: 12px; line-height: 16px; color: var(--ink-3); }
.input {
  width: 100%; height: var(--control-md); padding: 0 var(--space-5);
  border: 1px solid var(--control-border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); font-size: 14px;
}
.input::placeholder { color: var(--ink-3); }
.input-group { display: flex; }
.input-group .input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-suffix {
  display: inline-flex; align-items: center; padding: 0 var(--space-5);
  border: 1px solid var(--control-border); border-left: 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--surface-sunken); color: var(--ink-2); font-size: 13px; white-space: nowrap;
}
.fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.fieldset > legend { padding: 0; margin-bottom: var(--space-4); font-size: 14px; line-height: 20px; font-weight: 600; }
.choice { display: flex; align-items: flex-start; gap: var(--space-4); }
.choice input { margin: 2px 0 0; accent-color: var(--accent); width: 16px; height: 16px; flex: none; }
.choice-text { display: flex; flex-direction: column; }
.choice-text > :last-child:not(:first-child) { font-size: 12px; line-height: 16px; color: var(--ink-3); }
input[type="radio"], input[type="checkbox"] { accent-color: var(--accent); }

/* A read-only value people copy: an address, a key */
.copy-field {
  display: flex; align-items: center; gap: var(--space-4);
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-5);
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-sunken);
}
.copy-field code { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; font-family: var(--font-mono); font-size: 12px; line-height: 18px; }

/* ---- Messages --------------------------------------------------------- */
/* ---- Conflicts: pairs the contradiction check raised ------------------ */
.conflicts { border-bottom: 1px solid var(--line); }
.conflicts-head {
  padding: var(--space-5) var(--space-7); display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-5);
  background: var(--surface-sunken); border-bottom: 1px solid var(--line);
}
.conflicts-title { margin: 0; margin-right: auto; font-size: 13px; line-height: 18px; font-weight: 600; }
.conflicts-none { margin: 0; padding: var(--space-5) var(--space-7); font-size: 13px; }
.pairs { list-style: none; margin: 0; padding: 0; }
.pair {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--space-6); align-items: start;
  padding: var(--space-5) var(--space-7); border-bottom: 1px solid var(--line); font-size: 13px; line-height: 18px;
}
.pair:last-child { border-bottom: 0; }
.pair-body { min-width: 0; overflow-wrap: anywhere; }
.pair-body > * { margin: 0; }
.pair-body > * + * { margin-top: var(--space-4); }
.pair-reason { max-width: 80ch; }
.pair-side { padding-left: var(--space-5); border-left: 2px solid var(--border); }
.pair-letter { font-weight: 600; color: var(--ink); }
.pair .cell-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--space-3); max-width: 22rem; }
.pair .cell-actions > * + * { margin-left: 0; }
@media (max-width: 720px) {
  .pair { grid-template-columns: minmax(0, 1fr); row-gap: var(--space-4); }
  .pair .cell-actions { justify-content: flex-start; max-width: none; }
}

.receipt {
  margin: 0; padding: var(--space-4) var(--space-6); border-radius: var(--radius-sm);
  background: var(--code-bg); color: var(--code-ink);
  font-family: var(--font-mono); font-size: 12.5px; line-height: 20px; overflow-wrap: anywhere;
}
.codeblock {
  margin: 0; padding: var(--space-6) 14px; border-radius: var(--radius-sm);
  background: var(--code-bg); color: var(--code-ink);
  font-family: var(--font-mono); font-size: 12.5px; line-height: 20px; white-space: pre-wrap; overflow-wrap: anywhere;
}
.info { margin: 0; padding: var(--space-5) var(--space-6); border-radius: var(--radius-md); background: var(--bg); color: var(--ink-2); font-size: 13px; line-height: 1.5; }
.error { margin: 0; padding: var(--space-5) var(--space-6); border-radius: var(--radius-sm); background: var(--danger-soft); color: var(--danger); font-size: 13px; line-height: 18px; }
.empty { padding: 40px var(--space-7); text-align: center; color: var(--ink-2); font-size: 13px; line-height: 18px; }
.empty strong { display: block; margin-bottom: var(--space-2); color: var(--ink); font-size: 14px; }

/* Person cell: avatar, name as the edit link, email */
.person { display: flex; align-items: center; gap: var(--space-5); min-width: 0; }
.person > div { display: flex; flex-direction: column; min-width: 0; }
.person a { color: var(--ink); font-weight: 500; text-decoration: none; }
.person a:hover { color: var(--link); text-decoration: underline; }
.person span { font-size: 12px; line-height: 16px; color: var(--ink-3); }

/* Activity: a timestamped list */
.activity { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.activity li { display: flex; gap: var(--space-6); padding: var(--space-4) 0; border-bottom: 1px solid var(--line); font-size: 13px; line-height: 18px; }
.activity li:last-child { border-bottom: 0; }
.activity time { flex: none; font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* Definition list: label and value pairs in a side panel */
.facts { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: var(--space-4) var(--space-7); font-size: 13px; line-height: 18px; }
.facts dt { color: var(--ink-3); }
.facts dd { margin: 0; min-width: 0; }

/* ---- Bottom action bar (onboarding steps) ----------------------------- */
.action-bar {
  margin-top: auto; padding: var(--space-6) var(--space-9);
  border-top: 1px solid var(--border); background: var(--surface);
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-6);
}

/* ---- Dialog ----------------------------------------------------------- */
.dialog {
  width: min(440px, 100%); padding: 0; border: 0; border-radius: var(--radius-lg);
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-dialog);
}
.dialog::backdrop { background: var(--scrim); }
.dialog-head { padding: var(--space-8) var(--space-9) 0; display: flex; flex-direction: column; gap: var(--space-2); }
.dialog-head > :first-child:not(:only-child) { font-size: 12px; line-height: 16px; font-weight: 500; color: var(--ink-3); }
.dialog-title { margin: 0; font-size: 18px; line-height: 26px; font-weight: 600; }
.dialog-body { padding: var(--space-8) var(--space-9); display: flex; flex-direction: column; gap: var(--space-7); }
.dialog-foot {
  padding: 14px var(--space-9); border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-6); font-size: 12px; color: var(--ink-3);
}

/* ---- Bare page: sign-in, an unknown address, no access ---------------- */
.bare {
  max-width: 440px; margin: 0 auto; padding: calc(var(--space-9) * 2) var(--space-7);
  display: flex; flex-direction: column; gap: var(--space-7);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
