/* Groundwork — one stylesheet for the whole app.
 *
 * The look borrows from carbonless duplicate forms: one part is kept by the
 * circle, one by the person, each on its own colour of paper. That is how
 * Groundwork stores consent (the circle's records in the circle's repo, the
 * person's acceptance in their own), so the colours carry meaning:
 *   rose edge   = lives in a circle's repo
 *   canary edge = lives in a person's own repo
 * Ballpoint blue is for anything you can act on, and for signatures.
 *
 * Type: Atkinson Hyperlegible Next (made for legibility) for everything,
 * Atkinson Hyperlegible Mono only for record data. Both are served from /fonts.
 */

@font-face { font-family: 'Atkinson Next'; src: url('/fonts/next.woff2') format('woff2'); font-weight: 200 800; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Atkinson Next'; src: url('/fonts/next-ext.woff2') format('woff2'); font-weight: 200 800; font-style: normal; font-display: swap; unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Atkinson Next'; src: url('/fonts/next-italic.woff2') format('woff2'); font-weight: 200 800; font-style: italic; font-display: swap; }
@font-face { font-family: 'Atkinson Mono'; src: url('/fonts/mono.woff2') format('woff2'); font-weight: 200 800; font-display: swap; }

:root {
  --font: 'Atkinson Next', system-ui, sans-serif;
  --mono: 'Atkinson Mono', ui-monospace, monospace;

  --paper: #f6f7f4;      /* the desk */
  --sheet: #ffffff;      /* a form */
  --ink: #23262d;        /* graphite: body text */
  --ink-2: #4f5561;
  --ink-3: #737a86;
  --pen: #233a9a;        /* ballpoint: actions, links, signatures */
  --pen-hover: #172a7a;
  --pen-wash: #e9ecf8;
  --rule: #ccd3df;       /* the blue-grey of printed form lines */
  --rule-strong: #9aa6b8;
  --rose: #edb9c5;       /* circle's copy */
  --rose-wash: #fbeef1;
  --rose-ink: #87263f;
  --canary: #ecd86f;     /* person's copy */
  --canary-wash: #fcf7da;
  --canary-ink: #5f5009;
  --stamp: #b02a2f;      /* ended, refused */
  --ok: #1d6a46;         /* accepted, holds */
  --ok-wash: #e6f3ec;
  --focus: #e2a400;

  --radius: 5px;
  --step--1: 0.85rem;
  --step-0: 1.0625rem;
  --step-1: 1.33rem;
  --step-2: 1.66rem;
  --step-3: 2.08rem;
  --step-4: 2.6rem;
  --measure: 66ch;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #15171c; --sheet: #1d2027; --ink: #e7e9ee; --ink-2: #b2b8c4; --ink-3: #8b92a0;
    --pen: #a8b6ff; --pen-hover: #c9d2ff; --pen-wash: #262c45; --rule: #343a47; --rule-strong: #4b5262;
    --rose: #7a3446; --rose-wash: #2b1d22; --rose-ink: #f2b5c4;
    --canary: #8a7a22; --canary-wash: #2a2717; --canary-ink: #efe09a;
    --stamp: #ff8a8f; --ok: #7fd3a5; --ok-wash: #18302a; --focus: #ffcc4d;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 var(--step-0)/1.55 var(--font); font-feature-settings: 'kern';
  -webkit-font-smoothing: antialiased; min-height: 100vh;
}
gw-app { display: flex; flex-direction: column; min-height: 100vh; }
main { flex: 1; width: 100%; max-width: 74rem; margin: 0 auto; padding: 1.5rem 1rem 4rem; outline: none; }
/* The page moves focus to <main> after each navigation so screen readers start there; no ring for that. */
main:focus, main:focus-visible { outline: none; }
@media (min-width: 700px) { main { padding: 2.25rem 2rem 5rem; } }

h1, h2, h3, h4 { line-height: 1.18; margin: 0 0 .5em; font-weight: 720; letter-spacing: -0.012em; text-wrap: balance; }
h1 { font-size: var(--step-3); }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); }
h4 { font-size: var(--step-0); }
@media (min-width: 700px) { h1 { font-size: var(--step-4); } }
p, ul, ol { margin: 0 0 1em; max-width: var(--measure); }
p { text-wrap: pretty; }
a { color: var(--pen); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--pen-hover); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
.mono, code, pre { font-family: var(--mono); font-size: .86em; }
.lede { font-size: var(--step-1); line-height: 1.45; color: var(--ink-2); }
.lede-small { color: var(--ink-2); }
.hint { font-size: var(--step--1); color: var(--ink-3); }
.muted { color: var(--ink-3); }
.stack > * + * { margin-top: 1rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── Frame ─────────────────────────────────────────────────────────────── */
.skip { position: absolute; left: -999px; top: .5rem; background: var(--sheet); padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: .5rem; }
.masthead {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.5rem;
  padding: .75rem 1rem; border-bottom: 1px solid var(--rule); background: var(--paper);
}
@media (min-width: 700px) { .masthead { padding: .9rem 2rem; } }
.wordmark { display: inline-flex; align-items: center; gap: .55rem; font-weight: 760; font-size: 1.2rem; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
.wordmark:hover { color: var(--pen); text-decoration: none; }
.mainnav { display: flex; flex-wrap: wrap; gap: .25rem 1.1rem; flex: 1; }
.mainnav a { color: var(--ink-2); text-decoration: none; padding: .25rem 0; border-bottom: 2px solid transparent; }
.mainnav a:hover, .mainnav a[aria-current='page'] { color: var(--ink); border-bottom-color: var(--pen); }
.nav-sandbox { color: var(--canary-ink) !important; }
.account { margin-left: auto; }
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; padding: .25rem .5rem; border-radius: var(--radius); }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary:hover { background: var(--pen-wash); }
.menu-body { position: absolute; right: 0; top: calc(100% + .35rem); z-index: 20; min-width: 15rem; background: var(--sheet); border: 1px solid var(--rule-strong); border-radius: var(--radius); padding: .4rem; display: grid; gap: .1rem; box-shadow: 0 8px 24px -12px rgb(0 0 0 / .35); }
.menu-body a, .menu-item { display: block; text-align: left; padding: .5rem .6rem; border-radius: 3px; background: none; border: 0; font: inherit; color: var(--ink); text-decoration: none; cursor: pointer; }
.menu-body a:hover, .menu-item:hover { background: var(--pen-wash); }
.menu-label { font-size: var(--step--1); color: var(--ink-3); margin: .4rem .6rem .1rem; }
.sandbox-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; padding: .55rem 1rem;
  background: var(--canary-wash); border-bottom: 2px solid var(--canary); color: var(--canary-ink); font-size: var(--step--1);
}
@media (min-width: 700px) { .sandbox-bar { padding: .55rem 2rem; } }
.sandbox-bar p { margin: 0; flex: 1 1 18rem; }
.actor-pick { display: inline-flex; align-items: center; gap: .5rem; font-weight: 650; }
.actor-pick select { font: inherit; padding: .3rem .4rem; border: 1px solid var(--canary); border-radius: var(--radius); background: var(--sheet); color: var(--ink); }
.colophon { border-top: 1px solid var(--rule); padding: 1.5rem 1rem 2rem; color: var(--ink-3); font-size: var(--step--1); }
@media (min-width: 700px) { .colophon { padding: 1.5rem 2rem 2.5rem; } }
.colophon p { margin: 0 0 .5rem; }
.colophon-links { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; }

/* ── Controls ──────────────────────────────────────────────────────────── */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 2.6rem;
  padding: .5rem 1rem; border: 1.5px solid var(--rule-strong); border-radius: var(--radius); background: var(--sheet);
  color: var(--ink); font: 600 var(--step-0)/1.2 var(--font); text-decoration: none; cursor: pointer;
}
.button:hover { border-color: var(--pen); color: var(--pen); text-decoration: none; }
.button-primary { background: var(--pen); border-color: var(--pen); color: var(--sheet); }
.button-primary:hover { background: var(--pen-hover); border-color: var(--pen-hover); color: var(--sheet); }
.button-danger { color: var(--stamp); border-color: color-mix(in srgb, var(--stamp) 50%, transparent); }
.button-danger:hover { color: var(--stamp); border-color: var(--stamp); }
.button-small { min-height: 2rem; padding: .25rem .65rem; font-size: var(--step--1); }
.button-quiet { border-color: transparent; background: transparent; color: var(--pen); padding-inline: .4rem; }
.button-quiet:hover { border-color: transparent; text-decoration: underline; }
.button[disabled], .button[aria-busy='true'] { opacity: .55; cursor: progress; }
.icon-button { border: 0; background: none; color: var(--ink-2); font-size: 1.1rem; padding: .35rem .55rem; border-radius: var(--radius); cursor: pointer; }
.icon-button:hover { background: var(--pen-wash); color: var(--ink); }
.inline-actions { display: inline-flex; flex-wrap: wrap; gap: .4rem; margin-left: .5rem; vertical-align: middle; }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-top: 1rem; }

.field { display: grid; gap: .3rem; }
.field > span { font-weight: 650; }
.field > .hint { margin: 0; }
input:not([type=checkbox]):not([type=radio]), textarea, select {
  width: 100%; font: inherit; color: var(--ink); background: var(--sheet);
  border: 1.5px solid var(--rule-strong); border-radius: var(--radius); padding: .55rem .7rem;
}
textarea { resize: vertical; min-height: 4.5rem; line-height: 1.45; }
input:focus, textarea:focus, select:focus { border-color: var(--pen); outline: 3px solid color-mix(in srgb, var(--focus) 60%, transparent); outline-offset: 0; }
input:user-invalid, textarea:user-invalid { border-color: var(--stamp); }
.check { display: flex; gap: .55rem; align-items: flex-start; cursor: pointer; }
.check input { margin-top: .35rem; width: 1.05rem; height: 1.05rem; accent-color: var(--pen); }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-weight: 650; margin-bottom: .4rem; padding: 0; }
.choices { display: grid; gap: .5rem; }
@media (min-width: 640px) { .choices-2 { grid-template-columns: 1fr 1fr; } }
.choice { display: flex; gap: .65rem; align-items: flex-start; border: 1.5px solid var(--rule); border-radius: var(--radius); padding: .7rem .8rem; cursor: pointer; background: var(--sheet); }
.choice:has(input:checked) { border-color: var(--pen); background: var(--pen-wash); }
.choice input { margin-top: .3rem; accent-color: var(--pen); }
.choice strong { display: block; }
.choice span { color: var(--ink-2); font-size: var(--step--1); }

/* ── Sheets and copies ─────────────────────────────────────────────────── */
.sheet { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1.1rem 1.2rem; }
.copy-circle { border-left: 6px solid var(--rose); }
.copy-person { border-left: 6px solid var(--canary); }
.copy-tag { display: inline-block; font-size: var(--step--1); font-weight: 650; padding: .05rem .5rem; border-radius: 999px; }
.copy-tag-circle { background: var(--rose-wash); color: var(--rose-ink); }
.copy-tag-person { background: var(--canary-wash); color: var(--canary-ink); }
.section { margin-top: 2.25rem; }
.section > h2, .section > h3 { margin-bottom: .75rem; }
.ruled > * + * { border-top: 1px solid var(--rule); }

/* ── People ────────────────────────────────────────────────────────────── */
gw-person { display: inline-block; vertical-align: middle; }
.person { display: inline-flex; align-items: center; gap: .45rem; color: inherit; text-decoration: none; max-width: 100%; }
a.person:hover .person-name { color: var(--pen); text-decoration: underline; }
.avatar { width: 1.6rem; height: 1.6rem; border-radius: 50%; object-fit: cover; flex: none; background: var(--pen-wash); }
.avatar-blank { display: inline-grid; place-items: center; font-weight: 700; font-size: .8rem; color: var(--pen); }
.person-m .avatar { width: 2.2rem; height: 2.2rem; }
.person-l .avatar { width: 3rem; height: 3rem; }
.person-text { display: inline-flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.person-name { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-handle { font-size: var(--step--1); color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Badges, notices, toasts ───────────────────────────────────────────── */
.badge { display: inline-block; font-size: .78rem; font-weight: 650; padding: .08rem .5rem; border-radius: 999px; border: 1px solid var(--rule-strong); color: var(--ink-2); white-space: nowrap; vertical-align: .1em; }
.badge-active, .badge-accepted { border-color: var(--ok); color: var(--ok); }
.badge-proposed, .badge-pending, .badge-evolving, .badge-virtual { border-style: dashed; border-color: var(--pen); color: var(--pen); }
.badge-revoked, .badge-declined, .badge-withdrawn, .badge-expired { border-color: var(--stamp); color: var(--stamp); }
.badge-archived, .badge-resigned, .badge-superseded { color: var(--ink-3); }
.flag { font-size: .78rem; font-weight: 650; }
.flag-fail { color: var(--stamp); }
.notice { border: 1px solid var(--rule); border-left: 4px solid var(--pen); background: var(--sheet); padding: .8rem 1rem; border-radius: var(--radius); margin: 1rem 0; }
.notice p:last-child { margin-bottom: 0; }
.notice-error { border-left-color: var(--stamp); }
.notice-warn { border-left-color: var(--canary); background: var(--canary-wash); }
.notice-ok { border-left-color: var(--ok); }
#toasts { position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%); display: grid; gap: .5rem; z-index: 100; width: min(36rem, calc(100% - 2rem)); }
.toast { background: var(--ink); color: var(--paper); padding: .7rem 1rem; border-radius: var(--radius); box-shadow: 0 10px 28px -14px rgb(0 0 0 / .5); }
.toast-error { background: var(--stamp); color: #fff; }
.loading { color: var(--ink-3); padding: 2rem 0; }
#boot { max-width: 74rem; margin: 3rem auto; padding: 0 2rem; }

/* ── Dialogs ───────────────────────────────────────────────────────────── */
dialog.dialog { width: min(40rem, calc(100% - 1.5rem)); max-height: calc(100% - 2rem); padding: 0; border: 1px solid var(--rule-strong); color: var(--ink); }
dialog.dialog-wide { width: min(56rem, calc(100% - 1.5rem)); }
dialog::backdrop { background: rgb(20 22 30 / .45); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem 1.2rem; border-bottom: 1px solid var(--rule); position: sticky; top: 0; background: var(--sheet); z-index: 1; }
.dialog-head h2 { font-size: var(--step-1); margin: 0; }
.dialog-body { padding: 1.1rem 1.2rem 1.3rem; }

/* ── Records ───────────────────────────────────────────────────────────── */
.records { margin-top: .6rem; }
.records > summary { cursor: pointer; color: var(--pen); font-size: var(--step--1); font-weight: 600; width: fit-content; }
.records .count { color: var(--ink-3); font-weight: 400; }
.record { margin: .6rem 0 0; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.record.copy-circle { border-left: 5px solid var(--rose); }
.record.copy-person { border-left: 5px solid var(--canary); }
.record figcaption { display: flex; flex-wrap: wrap; gap: .25rem .8rem; align-items: baseline; padding: .45rem .75rem; border-bottom: 1px solid var(--rule); font-size: var(--step--1); }
.record .nsid { font-weight: 700; }
.record .where { color: var(--ink-3); }
.record pre { margin: 0; padding: .6rem .75rem; overflow-x: auto; font-size: .8rem; line-height: 1.5; color: var(--ink-2); }

/* ── Seal ──────────────────────────────────────────────────────────────── */
.sigil { display: block; overflow: visible; }
.sigil-archived { filter: grayscale(1); opacity: .6; }

/* ── Home ──────────────────────────────────────────────────────────────── */
.hero { display: grid; gap: 2rem; align-items: center; padding: 1rem 0 2.5rem; border-bottom: 1px solid var(--rule); }
@media (min-width: 880px) { .hero { grid-template-columns: 1.35fr 1fr; padding: 2rem 0 3.25rem; } }
@media (min-width: 880px) { .hero-sandbox { grid-template-columns: 1fr 1fr; align-items: start; } }
.hero h1 { font-size: var(--step-3); line-height: 1.1; }
.hero .lede { max-width: 46ch; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 1.25rem; counter-reset: step; max-width: none; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(4, 1fr); } }
.steps li { counter-increment: step; border-top: 2px solid var(--ink); padding-top: .6rem; }
.steps li::before { content: counter(step); font-weight: 760; font-size: var(--step-1); color: var(--pen); display: block; margin-bottom: .2rem; }
.steps h3 { font-size: var(--step-0); margin-bottom: .35rem; }
.steps p { font-size: var(--step--1); color: var(--ink-2); }
@media (min-width: 760px) { .forwho { grid-template-columns: repeat(3, 1fr); } }
.lookup { display: flex; gap: .5rem; max-width: 34rem; }
.lookup input { flex: 1; }

/* ── Front page: a note from the person who runs it, not a pitch ─────── */
.front { max-width: 42rem; }
.front h1 { font-size: var(--step-3); margin-bottom: .6rem; }
.front .kicker { margin: 0 0 .4rem; }
.front ul, .plain-steps { padding-left: 1.2rem; }
.front li, .plain-steps li { margin-bottom: .45rem; }
.signature-line { color: var(--ink-2); font-style: italic; }
.proto-tag { display: inline-block; font: 700 .72rem/1.4 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--stamp); border: 1.5px dashed var(--stamp); border-radius: 3px; padding: .05rem .4rem; text-decoration: none; }
a.proto-tag:hover { color: var(--stamp); text-decoration: none; background: color-mix(in srgb, var(--stamp) 8%, transparent); }
.masthead .proto-tag { margin-left: -.9rem; }
.notice-risk { border-left-color: var(--stamp); border-style: dashed; border-left-style: solid; }

/* ── Desk and lists ────────────────────────────────────────────────────── */
.desk { display: grid; gap: 2rem; }
@media (min-width: 900px) { .desk { grid-template-columns: 1.4fr 1fr; align-items: start; } }
.list { list-style: none; padding: 0; margin: 0; max-width: none; }
.list > li { padding: .8rem 0; border-top: 1px solid var(--rule); }
.list > li:last-child { border-bottom: 1px solid var(--rule); }
.circle-row { display: grid; grid-template-columns: auto 1fr; gap: .25rem 1rem; align-items: center; text-decoration: none; color: inherit; }
.circle-row .sigil { grid-row: span 2; }
.circle-row-name { font-weight: 700; font-size: var(--step-1); }
a.circle-row:hover .circle-row-name { color: var(--pen); text-decoration: underline; }
.circle-row-aim { color: var(--ink-2); font-size: var(--step--1); margin: 0; }
.offer-row { display: grid; gap: .35rem; }

/* ── Circle page ───────────────────────────────────────────────────────── */
.circle-layout { display: grid; gap: 2rem; }
.circle-layout > * { min-width: 0; } /* long record addresses wrap instead of widening the page */
@media (min-width: 940px) { .circle-layout { grid-template-columns: 17.5rem 1fr; gap: 3rem; } .circle-side { position: sticky; top: 1.5rem; align-self: start; } }
.circle-side .sigil { margin: 0 0 1rem; }
.circle-side h1 { font-size: var(--step-3); margin-bottom: .6rem; }
.circle-side dl { margin: 0; }
.circle-side dt { font-size: var(--step--1); font-weight: 700; color: var(--ink-3); margin-top: .9rem; }
.circle-side dd { margin: .15rem 0 0; }
.circle-side .meta { font-size: var(--step--1); color: var(--ink-3); margin-top: 1rem; }
.tabs { display: flex; flex-wrap: wrap; gap: .1rem 1.25rem; border-bottom: 1px solid var(--rule); margin-bottom: 1.5rem; }
.tabs a { padding: .5rem 0; color: var(--ink-2); text-decoration: none; border-bottom: 3px solid transparent; margin-bottom: -1px; font-weight: 600; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current='page'] { color: var(--ink); border-bottom-color: var(--pen); }
.toolbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: 1.25rem; }
.toolbar .spacer { flex: 1; }
.live { display: inline-flex; align-items: center; gap: .4rem; font-size: var(--step--1); color: var(--ink-3); }
.live::before { content: ''; width: .5rem; height: .5rem; border-radius: 50%; background: var(--ok); }
.live-off::before { background: var(--ink-3); }

/* Roles as entries in a register, not cards. */
.role-entry { display: grid; gap: .5rem; padding: 1.1rem 0 1.2rem 1rem; border-top: 1px solid var(--rule); position: relative; }
.role-entry::before { content: ''; position: absolute; left: 0; top: 1.15rem; bottom: 1.2rem; width: 4px; background: var(--pen); border-radius: 2px; }
.role-entry.is-proposed::before { background: repeating-linear-gradient(var(--pen) 0 5px, transparent 5px 9px); }
.role-entry.is-archived::before { background: var(--rule-strong); }
.role-entry:last-child { border-bottom: 1px solid var(--rule); }
.role-head { display: flex; flex-wrap: wrap; gap: .4rem .8rem; align-items: baseline; }
.role-head h3 { margin: 0; font-size: var(--step-1); }
.role-head h3 a { color: inherit; text-decoration: none; }
.role-head h3 a:hover { color: var(--pen); text-decoration: underline; }
.role-domain { color: var(--ink-2); margin: 0; }
.role-cols { display: grid; gap: .75rem 1.5rem; font-size: var(--step--1); }
@media (min-width: 760px) { .role-cols { grid-template-columns: repeat(3, 1fr); } }
.role-cols h4 { font-size: var(--step--1); color: var(--ink-3); margin: 0 0 .25rem; }
.role-cols ul { margin: 0; padding-left: 1.05rem; }
.holders { display: flex; flex-wrap: wrap; gap: .4rem 1rem; align-items: center; }
.caps { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; }
.cap { display: grid; }
.cap-label { font-weight: 600; }
.cap-desc { color: var(--ink-2); }
.cap-machine { color: var(--pen); font-size: .78rem; overflow-wrap: anywhere; }

/* Journal: a ledger with a date column. */
.journal { list-style: none; padding: 0; margin: 0; max-width: none; }
.journal > li { display: grid; grid-template-columns: 5.5rem 1fr; gap: .2rem 1rem; padding: .8rem 0; border-top: 1px solid var(--rule); }
.journal time { color: var(--ink-3); font-size: var(--step--1); padding-top: .15rem; font-variant-numeric: tabular-nums; }
.journal .entry-text { margin: 0; }
.journal .entry-meta { font-size: var(--step--1); color: var(--ink-3); margin: .2rem 0 0; display: flex; flex-wrap: wrap; gap: .2rem .7rem; align-items: center; }
.journal .entry-type { font-size: .75rem; color: var(--ink-3); }
.filters { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.filters button { font: inherit; font-size: var(--step--1); border: 1px solid var(--rule-strong); background: var(--sheet); color: var(--ink-2); border-radius: 999px; padding: .2rem .75rem; cursor: pointer; }
.filters button[aria-pressed='true'] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ── The ceremony: a two-part form ─────────────────────────────────────── */
.ceremony { max-width: 46rem; margin: 0 auto; }
.ceremony-part { background: var(--sheet); border: 1px solid var(--rule); padding: 1.4rem 1.4rem 1.6rem; position: relative; }
@media (min-width: 700px) { .ceremony-part { padding: 1.8rem 2rem 2rem; } }
.part-circle { border-radius: var(--radius) var(--radius) 0 0; border-top: 8px solid var(--rose); }
.part-person { border-radius: 0 0 var(--radius) var(--radius); border-bottom: 8px solid var(--canary); background: linear-gradient(var(--canary-wash), var(--sheet) 6rem); }
.perforation { height: 0; border-top: 2px dashed var(--rule-strong); position: relative; margin: 0 .9rem; }
.perforation::before, .perforation::after { content: ''; position: absolute; top: -.6rem; width: 1.1rem; height: 1.1rem; border-radius: 50%; background: var(--paper); border: 1px solid var(--rule); }
.perforation::before { left: -1.55rem; } .perforation::after { right: -1.55rem; }
.part-label { position: absolute; top: .55rem; right: 1rem; font-size: .75rem; font-weight: 700; }
.part-circle .part-label { color: var(--rose-ink); }
.part-person .part-label { color: var(--canary-ink); }
.ceremony h1 { font-size: var(--step-3); margin: .3rem 0 .2rem; }
.ceremony .from { color: var(--ink-2); margin-bottom: 1rem; }
.form-field { display: grid; grid-template-columns: 1fr; gap: .15rem 1.5rem; padding: .9rem 0; border-top: 1px solid var(--rule); }
@media (min-width: 700px) { .form-field { grid-template-columns: 10rem 1fr; } }
.form-field > h2 { font-size: var(--step--1); font-weight: 700; color: var(--ink-3); margin: .15rem 0 0; }
.form-field > div > :last-child { margin-bottom: 0; }
.fries { font-size: .72rem; color: var(--ink-3); display: block; margin-top: .25rem; font-weight: 600; }
.fries abbr { text-decoration: none; border-bottom: 1px dotted; cursor: help; }
.signature { margin-top: 1rem; }
.signature textarea { font-size: var(--step-1); font-style: italic; border: 0; border-bottom: 2px solid var(--pen); border-radius: 0; background: transparent; padding: .4rem .1rem; min-height: 5.5rem; color: var(--pen); }
.signature textarea:focus { outline: none; border-bottom-color: var(--focus); }
.signed { font-size: var(--step-1); font-style: italic; color: var(--pen); border-bottom: 2px solid var(--pen); padding: .3rem .1rem .5rem; margin: .4rem 0 .3rem; max-width: none; }
.signed-by { font-size: var(--step--1); color: var(--ink-3); }
.stamp {
  display: inline-block; transform: rotate(-3deg); border: 3px double currentColor; border-radius: 6px;
  padding: .25rem .9rem; font-weight: 800; font-size: var(--step-1); letter-spacing: .02em;
}
.stamp-ok { color: var(--ok); }
.stamp-no { color: var(--stamp); }
.tear { animation: tear .7s cubic-bezier(.3,.7,.2,1) both; }
@keyframes tear { 0% { transform: translateY(0) rotate(0); } 45% { transform: translateY(10px) rotate(.6deg); } 100% { transform: translateY(0) rotate(0); } }
.stamp-in { animation: stamp .45s cubic-bezier(.2,1.6,.4,1) .35s both; }
@keyframes stamp { from { transform: rotate(-3deg) scale(1.8); opacity: 0; } to { transform: rotate(-3deg) scale(1); opacity: 1; } }

/* Signatures elsewhere (role holders, in their own words). */
.url-line { overflow-wrap: anywhere; color: var(--ink-2); }
.statement { margin: .25rem 0 0; font-style: italic; color: var(--ink-2); max-width: var(--measure); }
.statement::before { content: '“'; } .statement::after { content: '”'; }
.holder-block { display: grid; gap: .3rem; padding: .9rem 0; border-top: 1px solid var(--rule); }

/* ── Check authority ───────────────────────────────────────────────────── */
.check-form { display: grid; gap: 1rem; max-width: 46rem; }
@media (min-width: 760px) { .check-form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; } }
.verdict { display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin: 1.5rem 0 1rem; }
.verdict .stamp { font-size: var(--step-2); }
.trace { list-style: none; padding: 0; margin: 0; max-width: 48rem; }
.trace li { display: grid; grid-template-columns: 1.6rem 1fr; gap: .6rem; padding: .55rem 0; border-top: 1px solid var(--rule); }
.trace li::before { content: '✓'; font-weight: 800; color: var(--ok); text-align: center; }
.trace li.no::before { content: '✕'; color: var(--stamp); }
.trace a { font-size: var(--step--1); }

/* ── Conformance ───────────────────────────────────────────────────────── */
.findings { list-style: none; padding: 0; margin: 0; max-width: none; }
.findings li { padding: .7rem 0 .7rem 1rem; border-top: 1px solid var(--rule); border-left: 4px solid var(--rule); }
.findings li.fail { border-left-color: var(--stamp); }
.findings li.warn { border-left-color: var(--canary); }
.findings .level { font-size: .75rem; font-weight: 700; color: var(--ink-3); display: block; }

/* ── Agents ────────────────────────────────────────────────────────────── */
.brief { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1rem 1.1rem; max-height: 34rem; overflow: auto; font-size: .82rem; line-height: 1.55; }

/* ── Wizard ────────────────────────────────────────────────────────────── */
.wizard { max-width: 48rem; }
.progress { display: flex; gap: .4rem; list-style: none; padding: 0; margin: 0 0 1.5rem; flex-wrap: wrap; max-width: none; }
.progress li { flex: 1 1 8rem; border-top: 4px solid var(--rule); padding-top: .35rem; font-size: var(--step--1); color: var(--ink-3); }
.progress li[aria-current='step'] { border-top-color: var(--pen); color: var(--ink); font-weight: 650; }
.progress li.done { border-top-color: var(--ok); }
.row-2 { display: grid; gap: 1rem; grid-template-columns: 1fr 6rem; }
.role-pick-name { font-weight: 650; }
.template-roles { display: grid; gap: .5rem; }
.role-pick { display: grid; grid-template-columns: auto 1fr; gap: .2rem .7rem; align-items: start; border: 1px solid var(--rule); background: var(--sheet); border-radius: var(--radius); padding: .65rem .8rem; }
.role-pick input[type=checkbox] { margin-top: .35rem; accent-color: var(--pen); }
.role-pick .role-pick-domain { grid-column: 2; color: var(--ink-2); font-size: var(--step--1); margin: 0; }
.write-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .3rem; max-width: none; font-size: var(--step--1); }
.write-list li { display: flex; gap: .6rem; align-items: baseline; padding: .3rem .6rem; border-left: 4px solid var(--rose); background: var(--sheet); }
.write-list li.person { border-left-color: var(--canary); }
.write-list .mono { color: var(--ink-3); }

/* ── Person page, inspector ────────────────────────────────────────────── */
.person-head { display: flex; gap: 1rem; align-items: center; margin-bottom: 1.5rem; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1rem; font-size: var(--step--1); margin: 0 0 1rem; }
.kv dt { color: var(--ink-3); font-weight: 650; }
.kv dd { margin: 0; overflow-wrap: anywhere; }

/* ── Typeahead ─────────────────────────────────────────────────────────── */
.typeahead { position: relative; }
.typeahead-list { position: absolute; left: 0; right: 0; top: calc(100% + 2px); z-index: 5; background: var(--sheet); border: 1px solid var(--rule-strong); border-radius: var(--radius); list-style: none; margin: 0; padding: .25rem; max-height: 16rem; overflow: auto; max-width: none; box-shadow: 0 8px 24px -12px rgb(0 0 0 / .35); }
.typeahead-list button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: .45rem .5rem; border-radius: 3px; cursor: pointer; font: inherit; color: inherit; }
.typeahead-list button:hover, .typeahead-list button[aria-selected='true'] { background: var(--pen-wash); }
.chosen { display: flex; align-items: center; gap: .6rem; padding: .4rem .5rem; border: 1.5px solid var(--pen); border-radius: var(--radius); background: var(--pen-wash); }

/* ── Tests page ────────────────────────────────────────────────────────── */
.test-list { list-style: none; padding: 0; max-width: none; }
.test-list li { padding: .4rem 0; border-top: 1px solid var(--rule); font-size: var(--step--1); }
.test-list .pass { color: var(--ok); font-weight: 700; }
.test-list .fail { color: var(--stamp); font-weight: 700; }

/* ── Callback page ─────────────────────────────────────────────────────── */
.callback-main { max-width: 32rem; margin: 20vh auto; padding: 0 1.5rem; }


/* ── Needs attention (care.js) ─────────────────────────────────────────── */
.care { border: 1px solid var(--rule); border-left: 4px solid var(--canary); background: var(--canary-wash); border-radius: var(--radius); padding: .9rem 1.1rem .6rem; margin-bottom: 1.5rem; }
.care h2 { font-size: var(--step-0); margin: 0 0 .5rem; }
.care ul { list-style: none; padding: 0; margin: 0; max-width: none; display: grid; gap: .1rem; }
.care li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .35rem 1rem; padding: .45rem 0; border-top: 1px solid color-mix(in srgb, var(--canary) 45%, transparent); }
.care li:first-child { border-top: 0; }
.care li.care-note { color: var(--ink-2); font-size: var(--step--1); }
.care .hint { margin: .4rem 0 0; }

/* ── The sandbox tour ──────────────────────────────────────────────────── */
.tour .tour-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .25rem 1rem; }
.tour h2 { font-size: var(--step-1); margin: 0; }
.tour > .hint { margin: .35rem 0 .9rem; }
.tour-steps { list-style: none; padding: 0; margin: 0; counter-reset: tour; display: grid; gap: .2rem; max-width: none; }
.tour-steps li { counter-increment: tour; position: relative; padding: .55rem 0 .55rem 2.3rem; border-top: 1px solid var(--rule); }
.tour-steps li::before { content: counter(tour); position: absolute; left: 0; top: .5rem; width: 1.6rem; height: 1.6rem; border-radius: 50%; display: grid; place-items: center; font-weight: 750; font-size: .85rem; border: 1.5px solid var(--rule-strong); color: var(--ink-3); background: var(--sheet); }
.tour-steps li.next::before { border-color: var(--pen); color: var(--pen); }
.tour-steps li.done::before { content: '✓'; background: var(--ok); border-color: var(--ok); color: var(--sheet); }
.tour-steps li.done strong { color: var(--ink-3); text-decoration: line-through; text-decoration-thickness: 1px; }
.tour-steps p { margin: .15rem 0 .45rem; font-size: var(--step--1); color: var(--ink-2); }
.tour-steps li:not(.next) p { color: var(--ink-3); }
.tour-pill { font-weight: 650; color: var(--canary-ink); }
.sandbox-people { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; list-style: none; padding: 0; margin: 0; max-width: none; }
.sandbox-people .menu-item[aria-pressed='true'] { background: var(--canary-wash); outline: 1.5px solid var(--canary); }

/* ── Charter by date ───────────────────────────────────────────────────── */
.field-inline { display: inline-flex; align-items: center; gap: .6rem; }
.field-inline > span { white-space: nowrap; }
.field-inline input { width: auto; padding: .35rem .5rem; }
.charter-date { font-weight: 700; font-size: var(--step-1); margin: .25rem 0 .5rem; }

/* ── About ─────────────────────────────────────────────────────────────── */
.prose { max-width: 46rem; }
.copies-demo { display: grid; gap: 1rem; }
@media (min-width: 700px) { .copies-demo { grid-template-columns: 1fr 1fr; } }
.copies-demo p { margin: .5rem 0 0; font-size: var(--step--1); color: var(--ink-2); }
.fries-list { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1.2rem; margin: 0; }
.fries-list dt { font-weight: 700; }
.fries-list dd { margin: 0; color: var(--ink-2); }
.lexicon-list { columns: 2 16rem; padding-left: 1.1rem; max-width: none; }
.lexicon-list a { font-size: .8rem; }
.verdict-line { font-weight: 700; font-size: var(--step-1); }
.verdict-line.pass { color: var(--ok); }
.verdict-line.fail { color: var(--stamp); }

/* ── Print: the charter ────────────────────────────────────────────────── */
@media print {
  :root { --paper: #fff; --sheet: #fff; --ink: #000; --ink-2: #222; --ink-3: #555; --pen: #1b2c7a; }
  .masthead, .colophon, .sandbox-bar, .tabs, .toolbar, .actions, .no-print, #toasts, gw-records, .care { display: none !important; }
  main { padding: 0; max-width: none; }
  .circle-layout { display: block; }
  .circle-side { margin-bottom: 1.5rem; }
  .role-entry { break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
}

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