/* Calm, neutral base. Brand color (ink) is separate from status colors. Drafting-sheet details on the review page only. */
:root {
  --paper: #fafafa;
  --surface: #ffffff;
  --ink: #18181b;
  --muted: #64646c;
  --line: #e4e4e7;
  --line-strong: #c9c9cf;
  --tint: #f4f4f5;
  --primary: #18181b;
  --primary-ink: #ffffff;
  --link: #1d4ed8;
  --focus: #2563eb;
  --ok: #15803d;
  --ok-bg: #e7f6ec;
  --info: #a15c07;
  --info-bg: #fdf3e1;
  --bad: #b91c1c;
  --bad-bg: #fdeaea;
  --rev: #c2410c;
  --ins: #dcfce7;
  --del: #fee2e2;
  --shadow: 0 -6px 18px rgba(24, 24, 27, .08);
  --radius: 8px;
  --radius-sm: 6px;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Consolas, Menlo, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  /* Type scale */
  --t-xs: .75rem;
  --t-sm: .875rem;
  --t-md: 1rem;
  --t-lg: 1.125rem;
  --t-xl: 1.5rem;
  --t-2xl: 1.875rem;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f0f11;
    --surface: #18181b;
    --ink: #f4f4f5;
    --muted: #a1a1aa;
    --line: #2a2a2f;
    --line-strong: #3f3f46;
    --tint: #202024;
    --primary: #f4f4f5;
    --primary-ink: #18181b;
    --link: #93b4fb;
    --focus: #93b4fb;
    --ok: #4ade80;
    --ok-bg: #12301d;
    --info: #f5b74e;
    --info-bg: #33260f;
    --bad: #f87171;
    --bad-bg: #3a1717;
    --rev: #fb923c;
    --ins: #14361f;
    --del: #3f1a1a;
    --shadow: 0 -6px 18px rgba(0, 0, 0, .45);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: var(--t-md)/1.55 var(--sans); }
h1 { font-size: var(--t-2xl); line-height: 1.2; margin: 0 0 .5rem; letter-spacing: -.02em; font-weight: 650; text-wrap: balance; }
h2 { font-size: var(--t-lg); line-height: 1.3; margin: 2.25rem 0 .75rem; font-weight: 600; letter-spacing: -.01em; }
h3 { font-size: var(--t-md); margin: 1.5rem 0 .5rem; font-weight: 600; }
h4 { font-size: var(--t-md); margin: 0 0 .4rem; font-weight: 600; }
a { color: var(--link); text-underline-offset: 2px; }
code { font: .86em var(--mono); overflow-wrap: anywhere; }
code.block { display: block; color: var(--muted); }
pre.command { background: var(--tint); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .7rem .8rem; overflow-x: auto; font: .82rem/1.5 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }

/* Header */
header.site { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; align-items: center; padding: .65rem 1.25rem; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { color: var(--ink); text-decoration: none; font-weight: 650; letter-spacing: -.01em; }
.nav { display: flex; gap: .25rem; flex: 1; flex-wrap: wrap; }
.nav a { color: var(--muted); text-decoration: none; font-size: var(--t-sm); padding: .3rem .6rem; border-radius: var(--radius-sm); }
.nav a:hover { color: var(--ink); background: var(--tint); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--tint); font-weight: 550; }
.who { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem 1rem; font-size: var(--t-sm); }
.who form { margin: 0; }
.name { color: var(--muted); }
.live { font: var(--t-xs) var(--mono); color: var(--muted); }
.live[data-state="live"] { color: var(--ok); }
.live[data-state="live"]::before { content: "● "; }

/* Controls */
button, a.button { font: inherit; font-size: var(--t-sm); font-weight: 500; padding: .5rem .9rem; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); cursor: pointer; border-radius: var(--radius-sm); line-height: 1.4; }
button:hover, a.button:hover { background: var(--tint); }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
button.primary, a.button.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); font-weight: 600; }
button.primary:hover, a.button.primary:hover { opacity: .9; background: var(--primary); }
button.danger { background: var(--bad); border-color: var(--bad); color: var(--surface); }
button.danger:hover { background: var(--bad); opacity: .9; }
button.link { border: 0; background: none; padding: 0; color: var(--link); text-decoration: underline; text-underline-offset: 2px; font-weight: 400; }
input, textarea, select { font: inherit; width: 100%; padding: .5rem .65rem; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); border-radius: var(--radius-sm); }
label { font-size: var(--t-sm); font-weight: 600; }
.stack { display: flex; flex-direction: column; gap: .5rem; align-items: stretch; }
.stack button { align-self: flex-start; }
summary { cursor: pointer; }

/* Sign-in screens */
.auth { display: flex; justify-content: center; padding: 8vh 1rem 2rem; }
.auth-card { max-width: 30rem; width: 100%; }
.auth-card h1 { font-size: var(--t-2xl); }
.lede { color: var(--muted); max-width: 46rem; }
.quiet { margin-top: 2rem; font-size: var(--t-sm); color: var(--muted); }
.quiet form { margin-top: .75rem; }

/* App shell: page plus an activity panel that sits beside it on wide screens */
.shell { max-width: 96rem; margin: 0 auto; }
.page { max-width: 80rem; margin: 0 auto; padding: 1.75rem 1.25rem 1.5rem; min-width: 0; }
.page.narrow { max-width: 44rem; }
.activity { padding: 0 1.25rem 2rem; min-width: 0; }
.activity h2 { margin-top: .5rem; font-size: var(--t-sm); color: var(--muted); }
#timeline { list-style: none; margin: 0; padding: .25rem 0; max-height: 16rem; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); font-size: var(--t-sm); }
#timeline:empty::before { content: "Nothing has happened here yet."; display: block; padding: .6rem .8rem; color: var(--muted); }
@media (min-width: 80rem) {
  .shell { display: grid; grid-template-columns: minmax(0, 1fr) 20rem; }
  .activity { position: sticky; top: 0; align-self: start; max-height: 100vh; display: flex; flex-direction: column; padding: 1.75rem 1.25rem 1.5rem 0; }
  #timeline { max-height: none; flex: 1; min-height: 0; }
  .activity .row { grid-template-columns: 2.75rem minmax(0, 1fr); }
  .activity .who-tag { grid-column: 2; }
  .activity .what { grid-column: 2; }
}

.head { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .8rem; }
.head h1 { margin: 0; }
.crumb { margin: 0 0 .35rem; font-size: var(--t-sm); }
.crumb a { color: var(--muted); }
.muted { color: var(--muted); font-weight: 400; }
.empty { color: var(--muted); padding: 1.25rem; border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.notice { background: var(--info-bg); border-radius: var(--radius-sm); padding: .65rem .85rem; }
.error { color: var(--bad); background: var(--bad-bg); border-radius: var(--radius-sm); padding: .5rem .85rem; }
.summary { white-space: pre-wrap; max-width: 46rem; }

.pair-code { font: 700 2.5rem/1.2 var(--mono); letter-spacing: .15em; padding: 1rem 0; }

/* Tables */
.table-scroll { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: var(--t-sm); }
th { text-align: left; font-size: var(--t-xs); color: var(--muted); font-weight: 500; background: var(--tint); }
th, td { padding: .6rem .8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--tint); }

/* Status: filled pill with a dot, colored by meaning, never by brand */
.badge { display: inline-flex; align-items: center; gap: .35rem; font-size: var(--t-xs); font-weight: 500; line-height: 1.6; padding: 0 .55rem; border-radius: 999px; white-space: nowrap; color: var(--muted); background: var(--tint); }
.badge::before { content: ""; width: .45rem; height: .45rem; border-radius: 50%; background: currentColor; }
.badge-approved, .badge-accepted, .badge-added { color: var(--ok); background: var(--ok-bg); }
.badge-in_review, .badge-submitted, .badge-pending, .badge-changed { color: var(--info); background: var(--info-bg); }
.badge-changes_requested, .badge-removed, .badge-returned { color: var(--bad); background: var(--bad-bg); }
.badge-requested, .badge-provided { color: var(--info); background: var(--info-bg); }
.progress-row { display: inline-flex; align-items: center; gap: .6rem; font-size: var(--t-sm); margin-bottom: .4rem; }
.checklist { margin-top: .25rem; }
progress { appearance: none; -webkit-appearance: none; width: 7rem; height: .5rem; border: 0; border-radius: 999px; background: var(--tint); overflow: hidden; vertical-align: middle; }
td progress { width: 4.5rem; }
progress::-webkit-progress-bar { background: var(--tint); border-radius: 999px; }
progress::-webkit-progress-value { background: var(--ok); border-radius: 999px; }
progress::-moz-progress-bar { background: var(--ok); border-radius: 999px; }
.conn { font-size: var(--t-sm); display: inline-flex; align-items: center; gap: .35rem; }
.conn::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: currentColor; }
.conn-ok { color: var(--ok); }
.conn-new { color: var(--info); }
.check-help { font-size: var(--t-sm); color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.check-help q { color: var(--ink); }
.ready { font-size: var(--t-sm); }
.ready.has-blockers { color: var(--bad); }
.ready.clear { color: var(--ok); }
.level { color: var(--bad); font-size: var(--t-xs); font-weight: 600; }

/* Workflow page */
.columns { display: grid; grid-template-columns: minmax(0, 1fr) 18rem; gap: 3rem; align-items: start; margin-top: .5rem; }
@media (max-width: 860px) { .columns { grid-template-columns: minmax(0, 1fr); gap: 0; } }
.col-side h2 { font-size: var(--t-sm); color: var(--muted); margin-top: 1.75rem; }

.proc-section { margin-top: 1.75rem; }
.proc-section h3 { font-size: var(--t-xs); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 .25rem; font-weight: 600; }
.proc-section h3 .muted { font-weight: 400; letter-spacing: 0; }
/* One line per item until it is opened. No boxes: a hairline between items is enough. */
.proc-entry { border-top: 1px solid var(--line); padding: .55rem 0 .55rem .75rem; margin: 0; position: relative; }
.proc-entry:last-of-type { border-bottom: 1px solid var(--line); }
.proc-entry > summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "title level" "lead lead" "counts counts"; gap: .05rem .6rem; list-style: none; padding-right: 1.5rem; }
.proc-entry > summary::-webkit-details-marker { display: none; }
.proc-entry > summary::after { content: "+"; position: absolute; right: .35rem; top: .5rem; color: var(--muted); font-size: 1.1rem; line-height: 1; }
.proc-entry[open] > summary::after { content: "–"; }
.proc-entry > summary:hover .entry-title { text-decoration: underline; text-underline-offset: 3px; }
.entry-title { grid-area: title; font-weight: 600; }
.proc-entry > summary .level { grid-area: level; align-self: center; }
.entry-lead { grid-area: lead; color: var(--muted); font-size: var(--t-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proc-entry[open] .entry-lead { white-space: normal; }
.entry-counts { grid-area: counts; color: var(--muted); font-size: var(--t-xs); }
.proc-entry[open] > summary { margin-bottom: .5rem; }
.proc-entry[open] > summary .entry-lead, .proc-entry[open] > summary .entry-counts { display: none; }
.proc-entry.flagged { box-shadow: inset 3px 0 0 var(--bad); }
.supporting { margin-top: 2rem; }
.supporting > summary { font-size: var(--t-sm); font-weight: 600; color: var(--ink); }
.supporting > summary .muted { font-weight: 400; }
.all-checks { margin-top: 1rem; font-size: var(--t-sm); }
.col-side .all-checks { margin-top: 1.75rem; }
.all-checks > summary { color: var(--muted); font-weight: 600; }
.all-checks[open] > summary { margin-bottom: .5rem; }

/* The process at a glance: inputs, numbered steps, outputs. Nodes link to their cards. */
.flow { display: flex; align-items: center; gap: .75rem; margin: 1.5rem 0 0; padding: 1rem 1.1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); contain: inline-size; min-width: 0; }
.flow-col { display: flex; flex-direction: column; gap: .35rem; flex: none; max-width: 14rem; }
.flow-steps { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; list-style: none; margin: 0; padding: 0; flex: 0 1 auto; min-width: 0; }
.flow-steps li { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.flow-steps li + li::before { content: ""; width: 1.25rem; height: 1px; background: var(--line-strong); flex: none; }
.flow-arrow { flex: none; width: 1.5rem; height: 1px; background: var(--line-strong); position: relative; }
.flow-arrow::after { content: ""; position: absolute; right: -1px; top: -.3rem; border: .3rem solid transparent; border-left: .45rem solid var(--line-strong); }
.node { display: inline-flex; align-items: center; gap: .45rem; font-size: var(--t-sm); color: var(--ink); text-decoration: none; padding: .35rem .7rem; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--paper); max-width: 18rem; min-width: 0; }
.node:hover { border-color: var(--ink); }
.node-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.node-input, .node-output { border-radius: var(--radius-sm); background: var(--tint); border-color: var(--line); font-size: var(--t-xs); padding: .25rem .55rem; }
.node-step { font-weight: 550; }
.node-no { display: inline-grid; place-items: center; width: 1.35rem; height: 1.35rem; border-radius: 50%; background: var(--ink); color: var(--paper); font-size: .7rem; font-weight: 700; flex: none; }
.node.flagged { border-color: var(--bad); border-style: dashed; }
.node.flagged .node-no { background: var(--bad); }
.node-comments { font-size: .68rem; padding: 0 .4rem; border-radius: 999px; background: var(--info-bg); color: var(--info); font-weight: 600; }
@media (max-width: 760px) {
  .flow { flex-direction: column; align-items: stretch; }
  .flow-col { max-width: none; flex-direction: row; flex-wrap: wrap; }
  .flow-arrow { width: 1px; height: 1.25rem; margin: 0 auto; }
  .flow-arrow::after { right: -.3rem; top: auto; bottom: -1px; border: .3rem solid transparent; border-top: .45rem solid var(--line-strong); }
  .flow-steps { flex-direction: column; align-items: stretch; }
  .flow-steps li + li::before { width: 1px; height: 1rem; margin-left: 1.3rem; }
  .flow-steps li { flex-direction: column; align-items: stretch; gap: 0; }
}

/* Where it stands, and only what blocks it */
.status { margin: 1rem 0 0; }
.status-line { margin: 0; font-size: var(--t-sm); }
.status-line .has-blockers { color: var(--bad); font-weight: 600; }
.status-line .clear { color: var(--ok); font-weight: 600; }
.next { list-style: none; margin: .5rem 0 0; padding: 0; font-size: var(--t-sm); }
.next li { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; padding: .4rem 0; border-top: 1px solid var(--line); }
.next li::before { content: "→"; color: var(--bad); flex: none; margin-right: -.4rem; }
.next li span { flex: 1; }
.next li a { white-space: nowrap; font-size: var(--t-sm); }
dl { margin: 0; display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: .3rem .75rem; font-size: var(--t-sm); }
dt { color: var(--muted); }
dd { margin: 0; overflow-wrap: anywhere; }
dd ul { margin: 0; padding-left: 1.1rem; }
@media (max-width: 520px) { dl { grid-template-columns: minmax(0, 1fr); } dd { margin-bottom: .4rem; } }
.facts { font-size: var(--t-sm); }
.facts.wide { margin: .75rem 0; }
.hash { font-size: .78rem; }

.checklist, .questions, .evidence, .versions, .requests { list-style: none; margin: 0; padding: 0; font-size: var(--t-sm); }
.checklist > li { display: flex; gap: .55rem; padding: .25rem 0; }
.mark { width: 1rem; flex: none; font-weight: 700; text-align: center; color: var(--muted); }
.checklist > .ok .mark { color: var(--ok); }
.checklist > .ok .check-label { color: var(--muted); }
.checklist > .blocker .mark { color: var(--bad); }
.issues { margin: .15rem 0 0; padding: 0; list-style: none; font-size: .84rem; color: var(--muted); }
.questions > li, .evidence > li, .versions > li, .requests > li { padding: .5rem 0; border-bottom: 1px solid var(--line); }
.evidence .muted { display: block; font-size: .82rem; }
.versions a { margin-left: .5rem; }

/* Review page: title block, revision clouds, sticky decision bar */
.title-block { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: 1rem 0 .5rem; border: 1.5px solid var(--ink); border-radius: 2px; background: var(--surface); font-size: var(--t-sm); }
.title-block > div { padding: .45rem .7rem; border-left: 1px solid var(--line-strong); min-width: 0; }
.title-block > div:first-child { border-left: 0; }
.title-block > .span { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line-strong); }
.title-block dt { font: 600 .68rem var(--mono); text-transform: uppercase; letter-spacing: .07em; }
.title-block dd { overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .title-block { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .title-block > div:nth-child(3) { border-left: 0; }
  .title-block > div:nth-child(n+3) { border-top: 1px solid var(--line-strong); }
}

.diff { display: flex; flex-direction: column; gap: .6rem; }
.diff-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem .85rem; }
.diff-item.diff-changed { border: 1.5px dashed var(--rev); border-radius: 14px; }
.diff-item summary { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.diff-item dl { margin-top: .6rem; }
/* Revision triangle, as on a drawing */
.rev { display: inline-grid; place-items: end center; width: 1.9rem; height: 1.55rem; padding-bottom: .12rem; font: 700 .6rem/1 var(--mono); color: var(--primary-ink); background: var(--rev); clip-path: polygon(50% 0, 100% 100%, 0 100%); flex: none; }
del, ins { display: block; text-decoration: none; padding: .05rem .4rem; white-space: pre-wrap; border-radius: 4px; }
del { background: var(--del); text-decoration: line-through; text-decoration-color: var(--muted); }
ins { background: var(--ins); }
ins + del, del + ins { margin-top: .2rem; }

.decision { position: sticky; bottom: 0; z-index: 5; margin: 2rem -1.25rem 0; padding: .85rem 1.25rem calc(.85rem + env(safe-area-inset-bottom, 0px)); background: var(--surface); border-top: 1px solid var(--line-strong); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: .6rem; }
.decision form { margin: 0; }
.decision p { margin: 0; font-size: var(--t-sm); }
.decision .error { margin: 0; }
.decision-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; }
.changes-form > summary { font-size: var(--t-sm); font-weight: 500; color: var(--ink); }
.changes-form[open] > summary { margin-bottom: .5rem; }

/* Timeline rows */
.row { display: grid; grid-template-columns: 3rem 11rem minmax(0, 1fr); gap: .1rem .75rem; padding: .35rem .8rem; border-bottom: 1px solid var(--tint); }
.row:last-child { border-bottom: 0; }
.row time { color: var(--muted); font: .78rem var(--mono); padding-top: .1rem; }
.who-tag { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.via { font-size: var(--t-xs); }
.row .what { overflow-wrap: anywhere; }
.row.collapsed .what { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .where { display: block; color: var(--muted); font-size: var(--t-xs); }
@media (max-width: 620px) { .row { grid-template-columns: 3rem minmax(0, 1fr); } .row .who-tag { display: none; } }

/* Connect page */
.connect { max-width: 64rem; }
.connect-url { background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: .9rem 1rem; margin: 1.25rem 0 1.5rem; }
.connect-url .label { display: block; font-size: var(--t-xs); color: var(--muted); font-weight: 500; margin-bottom: .35rem; }
.copy-row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.copy-row code { font-size: 1.05rem; font-weight: 600; overflow-wrap: anywhere; }
.command-block { display: flex; gap: .5rem; align-items: flex-start; margin: .4rem 0; }
.command-block pre.command { flex: 1; margin: 0; min-width: 0; }
button.copy { padding: .3rem .6rem; font-size: .8rem; flex: none; }
.clients { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr)); gap: 1rem; }
.client { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .95rem 1.1rem; min-width: 0; }
.client.wide { margin-top: 1rem; }
.client h3 { margin: 0 0 .5rem; }
.client ol { margin: 0; padding-left: 1.2rem; }
.client p { margin: .5rem 0; }
a.button { display: inline-block; text-decoration: none; }
.consent .facts { margin: 1rem 0; }
.consent .scopes { padding-left: 1.2rem; }
.consent-actions form { display: flex; gap: .75rem; }

a.button.google { display: block; text-align: center; font-weight: 600; }
.divider { display: flex; align-items: center; gap: .75rem; color: var(--muted); font-size: var(--t-sm); margin: 1.25rem 0; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
#code { font: 600 1.5rem/1.2 var(--mono); letter-spacing: .3em; max-width: 12rem; }

/* Shared bits for the people, comments, history and file pages */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.site-foot { max-width: 80rem; margin: 0 auto; padding: 1.5rem 1.25rem 2rem; font-size: var(--t-xs); }
.site-foot a { color: var(--muted); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .95rem 1.1rem; margin: 1rem 0; }
.panel h2 { margin-top: 0; }
.chip { display: inline-block; font-size: var(--t-xs); padding: .05rem .5rem; margin: 0 .3rem .3rem 0; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--muted); }
a.small { font-size: var(--t-sm); font-weight: 400; margin-left: .5rem; }
label.check { display: flex; align-items: center; gap: .45rem; font-weight: 400; }
label.check input { width: auto; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .5rem .75rem; margin: 0; display: flex; flex-wrap: wrap; gap: .25rem 1rem; }
legend { font-size: var(--t-sm); font-weight: 600; padding: 0 .25rem; }
.pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); gap: .5rem; }
.pair > div { display: flex; flex-direction: column; gap: .3rem; }

/* People */
.people-list { display: flex; flex-direction: column; gap: .6rem; }
.person { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; }
.person header { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .7rem; font-size: var(--t-sm); }
.person-actions { display: flex; flex-wrap: wrap; gap: .6rem 1.5rem; align-items: flex-end; margin-top: .6rem; }
form.inline { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: 0; }
form.inline label { flex-basis: 100%; font-weight: 500; color: var(--muted); }
form.inline select { width: auto; max-width: 14rem; }
.danger-zone > summary { font-size: var(--t-sm); color: var(--bad); }
.danger-zone[open] { flex-basis: 100%; }
.project-roles { margin: .5rem 0 0; }
.invite-results { list-style: none; padding: 0; margin: .4rem 0 0; font-size: var(--t-sm); }
.invite-results li { padding: .25rem 0; }
.invite-results li.bad strong { color: var(--bad); }

/* Your assignment, questions and comments */
.mine .respond-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: .75rem; }
.mine .respond-row form { margin: 0; }
.mine .respond p { margin: 0 0 .6rem; }
.delegate { margin-top: .5rem; }
.delegate > summary, .ask > summary, .comment-form > summary, .upload-form > summary { font-size: var(--t-sm); color: var(--link); }
.delegate[open] > summary, .ask[open] > summary { margin-bottom: .5rem; }
.questions-panel details, .requests-panel details { margin-top: .4rem; }
.request-files { margin: .3rem 0 0; padding-left: 1.1rem; }
.requests .respond-row { margin-top: .4rem; }
.thread { margin-top: .5rem; }
.comments { list-style: none; margin: .4rem 0; padding: 0 0 0 .75rem; border-left: 2px solid var(--line-strong); font-size: var(--t-sm); }
.comments li { padding: .2rem 0 .4rem; }
.comments li p { margin: .15rem 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.comments time { color: var(--muted); font-size: var(--t-xs); }
.comment-form[open] > summary { margin-bottom: .4rem; }
.comment-count { display: inline-block; margin-left: .5rem; padding: 0 .45rem; font-size: var(--t-xs); font-weight: 500; border-radius: 999px; background: var(--info-bg); color: var(--info); }
.general-comments { margin-top: 1rem; }

/* History */
.revisions { list-style: none; margin: 1rem 0 0; padding: 0; }
.revision { border-left: 2px solid var(--line-strong); padding: 0 0 1.1rem 1rem; position: relative; }
.revision::before { content: ""; position: absolute; left: -.4rem; top: .35rem; width: .7rem; height: .7rem; border-radius: 50%; background: var(--surface); border: 2px solid var(--ink); }
.rev-head { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem; font-size: var(--t-sm); }
.rev-head time { color: var(--muted); font: .78rem var(--mono); }
.rev-no { font: 700 .75rem var(--mono); }
.revision details { margin-top: .35rem; }
.revision details > summary { font-size: var(--t-sm); }
.revision .diff { margin-top: .5rem; }

/* Files */
.digest { margin: .25rem 0 0; color: var(--ink); font-size: .84rem; }
.digest-full { white-space: pre-wrap; margin: 0; }
.shot { margin: 1rem 0; }
.shot svg { display: block; width: 100%; height: auto; max-height: 80vh; background: var(--tint); border: 1px solid var(--line); border-radius: var(--radius); }
.note-box rect { fill: none; stroke: var(--rev); stroke-width: 3; vector-effect: non-scaling-stroke; }
.note-box circle { fill: var(--rev); }
.note-box text { fill: var(--primary-ink); font-family: var(--sans); font-weight: 700; text-anchor: middle; dominant-baseline: central; }
.notes { font-size: var(--t-sm); padding-left: 1.4rem; }
.notes li { padding: .2rem 0; }
.notes li::marker { color: var(--rev); font-weight: 700; }
.file-text { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; overflow-x: auto; max-height: 70vh; font: .82rem/1.5 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.prose { max-width: 44rem; }
.prose li { margin: .3rem 0; }

/* Test lab */
.acting-banner { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; padding: .55rem 1.25rem; background: var(--info-bg); color: var(--ink); border-bottom: 2px solid var(--info); font-size: var(--t-sm); position: sticky; top: 0; z-index: 10; }
.acting-banner form { margin: 0; }
.acting-banner select { width: auto; padding: .3rem .5rem; }
.acting-banner button { padding: .3rem .7rem; }
.lab-org .head h2 { margin: 0; }
.lab-people { list-style: none; padding: 0; margin: .5rem 0; }
.lab-people li { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; padding: .4rem 0; border-bottom: 1px solid var(--line); }
.lab-people li > span { flex: 1; min-width: 12rem; }
.lab-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.lab-actions form { margin: 0; }
.mailbox { list-style: none; padding: 0; }
.mailbox li { padding: .5rem 0; border-bottom: 1px solid var(--line); font-size: var(--t-sm); }
.mail-text { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .7rem .8rem; font: .82rem/1.5 var(--mono); }

/* Phones */
@media (max-width: 640px) {
  /* The work list becomes one card per process, each value labelled. */
  table.work thead { display: none; }
  table.work, table.work tbody, table.work tr, table.work td { display: block; width: 100%; }
  table.work tr { padding: .6rem .8rem; border-bottom: 1px solid var(--line); }
  table.work tbody tr:last-child { border-bottom: 0; }
  table.work td { border: 0; padding: .15rem 0; display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: .5rem; }
  table.work td::before { content: attr(data-label); color: var(--muted); font-size: var(--t-xs); padding-top: .15rem; }
  table.work td:first-child { grid-template-columns: minmax(0, 1fr); font-weight: 600; }
  table.work td:first-child::before { content: none; }
  table.work td:empty { display: none; }
  tbody tr:hover td { background: none; }
}
@media (max-width: 520px) {
  header.site { padding: .6rem 1rem; }
  .page { padding: 1.25rem 1rem 1rem; }
  .activity { padding: 0 1rem 1.5rem; }
  .decision { margin: 1.5rem -1rem 0; padding-left: 1rem; padding-right: 1rem; }
  h1 { font-size: var(--t-xl); }
  .consent-actions form { flex-wrap: wrap; }
  .proc-entry { padding: .75rem .8rem; }
  .decision-row button.primary { width: 100%; }
  .decision-row form { width: 100%; }
  form.inline select { max-width: 100%; flex: 1; }
  .site-foot { padding: 1rem; }
}

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }

/* Add a file, on the process page */
.upload-form { margin: 0 0 .75rem; font-size: var(--t-sm); }
.upload-form summary { cursor: pointer; }
.upload-form[open] > summary { margin-bottom: .4rem; }
.upload-form input[type="file"] { width: 100%; max-width: 100%; }
