/* verus pages: only what capture.css does not already give. Every colour is a token. */
html, body { background: var(--background); color: var(--foreground); }
body { font: 400 15px/22px var(--font-sans); }
button, input, select, textarea { font: inherit; color: inherit; }
code { font-family: var(--font-mono); font-size: 0.92em; }
[hidden] { display: none !important; }

/* Shell: the rail and one centred column */
.shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; }
.shell > .cap-rail { position: sticky; top: env(safe-area-inset-top, 0px); height: 100vh; }
.cap-rail__brand .title { letter-spacing: -0.02em; }
.cap-rail__item .cap-ico { color: inherit; }
.cap-main { overflow: visible; min-width: 0; }
.cap-page { padding-left: max(var(--space-12), env(safe-area-inset-left, 0px)); padding-right: max(var(--space-12), env(safe-area-inset-right, 0px)); }
.cap-page--wide { max-width: 1120px; }
.cap-page__lede { margin: calc(var(--space-8) * -1 + var(--space-3)) 0 var(--space-8); }
.section { display: grid; gap: var(--space-3); }
.section + .section { margin-top: var(--space-12); }
.stack { display: grid; gap: var(--space-3); }
.row-gap { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }

/* Sign in: one quiet column, the orb above it */
.signin { min-height: 100vh; display: grid; place-items: center; padding-block: var(--space-12); padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.signin__col { width: 100%; max-width: 400px; display: grid; justify-items: center; gap: var(--space-6); text-align: center; }
.signin__col .display { text-wrap: balance; }
.signin__col .body { max-width: 360px; }
.providers { width: 100%; display: grid; gap: var(--space-2); }
.providers .cap-btn { height: 44px; justify-content: center; font-size: 15px; }
.providers svg { width: 16px; height: 16px; fill: currentColor; }
.signin__foot { padding-top: var(--space-6); border-top: 1px solid var(--border); width: 100%; }

/* Tables of keys sit flush with the page */
.table-wrap { overflow-x: auto; border-top: 1px solid var(--border); }
.cap-table th { padding-top: var(--space-3); }
.cap-table td { padding-top: var(--space-3); padding-bottom: var(--space-3); vertical-align: middle; }
.cap-table td:last-child, .cap-table th:last-child { text-align: right; padding-right: 0; }
.cap-table tr.revoked td { color: var(--muted-foreground); }
.cap-tabs { margin-bottom: 0; }
.cap-tabs + * { margin-top: var(--space-4); }

/* Rulebook rows without a switch */
.cap-bookrow { grid-template-columns: minmax(0, 1fr); }
.cap-bookrow__open { margin-right: calc(var(--space-4) * -1); }

/* Rule review */
.cap-rulelist__item span:nth-child(2) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cap-rulelist__item { grid-template-columns: 20px minmax(0, 1fr) auto; }
.review-head { display: grid; justify-items: end; gap: var(--space-3); }
.progress-line { display: flex; align-items: center; gap: var(--space-3); margin: var(--space-6) 0 var(--space-4); }
.progress-line .cap-progress { flex: 1; max-width: 320px; }
.signed { display: inline-flex; align-items: center; gap: var(--space-2); }
/* A passage's number in its document, where the prototype's made-up rules gave a section. */
.cap-log__ref { color: var(--muted-foreground); font-variant-numeric: tabular-nums; }

/* Activity: the review list, made to fold on a phone */
.cap-review__row { width: 100%; border: 0; background: none; color: inherit; text-align: left; cursor: pointer; font: inherit; }
.cap-review__row { grid-template-columns: 20px 210px minmax(0, 1fr) 120px 140px 76px 20px; }
.cap-review__key { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cap-review__row .cap-ico { color: var(--muted-foreground); }
.cap-review__ref { font-family: var(--font-mono); font-size: 13px; font-weight: 500; }
.cap-review__body .stack { align-content: start; }
.cap-review__body .stack p { max-width: 60ch; }
.ledger { list-style: none; margin: 0; padding: 0; display: grid; align-content: start; gap: var(--space-3); }
.ledger li { display: grid; gap: 2px; padding-left: var(--space-3); border-left: 1px solid var(--border-strong); }
.summary { margin-bottom: var(--space-4); }
/* Why a verdict is so: each deciding rule's proof, as verus words it, line by line */
.cap-why__rule { display: grid; gap: 2px; padding-left: var(--space-3); border-left: 1px solid var(--border-strong); }
.cap-why__proof { white-space: pre-wrap; overflow-wrap: anywhere; }
.cap-why__changes { margin: 0; padding-left: var(--space-4); display: grid; gap: 2px; }

/* Code and the key shown once */
.code { margin: 0; overflow-x: auto; font: 400 13px/20px var(--font-mono); color: var(--foreground); white-space: pre; }
.keybox { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-radius: var(--radius-sm); background: var(--background); border: 1px solid var(--border); }
.keybox code { flex: 1; min-width: 0; word-break: break-all; font-size: 13px; }

/* Forms in dialogs */
.field { display: grid; gap: var(--space-1); }
.field .small { color: var(--muted-foreground); }
.input { height: 36px; padding: 0 var(--space-3); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--card); color: var(--foreground); font: 400 15px/22px var(--font-sans); width: 100%; }
.input::placeholder { color: var(--faint-foreground); }
.cap-select { width: 100%; height: 36px; font-size: 15px; }
.cap-btn--danger { color: var(--destructive); }
.overlay .cap-scrim { position: fixed; inset: 0; z-index: 20; }


@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .shell > .cap-rail { position: static; height: auto; width: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: var(--space-1); padding: var(--space-3) max(16px, env(safe-area-inset-right, 0px)) var(--space-3) max(16px, env(safe-area-inset-left, 0px)); border-right: 0; border-bottom: 1px solid var(--border); }
  .cap-rail__brand { padding: 0 var(--space-2) 0 0; width: 100%; }
  .cap-rail__item, button.cap-rail__item, a.cap-rail__item { width: auto; }
  .cap-rail__foot { display: none; }
  .cap-page { padding: var(--space-8) max(16px, env(safe-area-inset-right, 0px)) 120px max(16px, env(safe-area-inset-left, 0px)); }
  .cap-page__head { flex-direction: column; align-items: flex-start; }
  .review-head { justify-items: start; }
  .display { font-size: 36px; line-height: 40px; }
  .cap-review__row { grid-template-columns: 20px minmax(0, 1fr) auto 20px; row-gap: var(--space-1); }
  .cap-review__reason, .cap-review__key, .cap-review__value { display: none; }
  .cap-review__body { grid-template-columns: 1fr; }
}

.signin__foot { text-wrap: balance; }

/* The rulebooks a new key can use, picked one by one */
.pick { display: grid; gap: 2px; max-height: 220px; overflow-y: auto; padding: var(--space-1); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.pick[data-over="true"] { border-color: var(--destructive); }
.pick__row { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: var(--space-3); align-items: start; padding: var(--space-2); border-radius: var(--radius-sm); cursor: pointer; }
.pick__row > span { display: grid; }
.pick__row input { margin-top: 3px; }
