/* Mercury11 -- ported from design/design-reference (screens/*.html are the
   source of truth for layout, spacing, type and color). Below 760px the rail
   becomes a top bar and cards stack.

   THEMES. The light palette is the design reference's. The dark one is
   derived from it: the same hues, the ground and ink swapped, the accent and
   amber lifted until text on them passes WCAG AA. Every color in this file
   is a token below -- nothing hard-coded -- so both palettes cover every
   screen. <html data-theme> is rendered by the server (app/pages.py):
   "dark" forces the dark palette, "light" the light one, and "system" (and
   no attribute) follows the device. The dark block appears twice (forced,
   and the device's choice); a test keeps the two identical. */

:root {
  --ground: #F6F4EE;
  --surface: #FFFFFF;
  --surface-2: #FBFAF7;
  --sunken: #EFEDE5;
  --ink: #16201C;
  --ink-2: #2E3A34;
  --ink-3: #4A544E;
  --muted: #5E6863;
  --accent: #1A5C49;
  --accent-soft: #E6EFEA;
  --accent-ink: #134536;
  --amber: #7A4F0F;
  --amber-soft: #F7EFDF;
  --danger: #8A3524;
  --danger-soft: #F6E4DF;
  --border: #E4DFD5;
  --border-2: #EFEBE2;
  --field: #D9D3C7;
  --inset: #ECE7DC;
  --soft-border: #C9D6CF;
  --soft-fill: #F3F8F5;
  --chip: #F0EDE5;
  --on-accent: #FFFFFF;
  --banner-ink: #5A3D0C;
  --needs-fill: #FDF8EF;
  --needs-icon: #F5E8CE;
  --dropzone-border: #C3BCAB;
  --lede-ink: #3C4641;
  --row-tint: #FBFDFB;
  --amber-border: #E6D3AE;
  --scrim: rgba(246, 244, 238, 0);
  --qr-ground: #FFFFFF;
  --backdrop: rgba(14, 19, 17, 0.45);
  --chart-1: #1A5C49;
  --chart-2: #8A5A12;
  --chart-3: #3C659E;
  --chart-4: #8A3524;
  --chart-grid: #E4DFD5;
  --chart-axis: #8C948F;
  color-scheme: light;
  --serif: "Fraunces", Georgia, serif;
  --sans: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

:root[data-theme="dark"] {
  --ground: #121815;
  --surface: #19211D;
  --surface-2: #1D2622;
  --sunken: #0E1311;
  --ink: #ECEAE3;
  --ink-2: #D6D4CC;
  --ink-3: #BCBFB8;
  --muted: #A3AAA5;
  --accent: #7CC4A8;
  --accent-soft: #1F3A31;
  --accent-ink: #A9DCC7;
  --amber: #E6B96E;
  --amber-soft: #33291A;
  --danger: #F0A08D;
  --danger-soft: #3B221C;
  --border: #2D3833;
  --border-2: #242E29;
  --field: #3E4A44;
  --inset: #29332E;
  --soft-border: #33514A;
  --soft-fill: #1B2C26;
  --chip: #232C28;
  --on-accent: #0E1311;
  --banner-ink: #F2D9AA;
  --needs-fill: #251F16;
  --needs-icon: #3A2E1A;
  --dropzone-border: #4A5650;
  --lede-ink: #C7CAC3;
  --row-tint: #1B2420;
  --amber-border: #5A4527;
  --scrim: rgba(18, 24, 21, 0);
  --qr-ground: #FFFFFF;
  --backdrop: rgba(0, 0, 0, 0.6);
  --chart-1: #7CC4A8;
  --chart-2: #E6B96E;
  --chart-3: #8FB3E8;
  --chart-4: #F0A08D;
  --chart-grid: #2D3833;
  --chart-axis: #6E7A74;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #121815;
    --surface: #19211D;
    --surface-2: #1D2622;
    --sunken: #0E1311;
    --ink: #ECEAE3;
    --ink-2: #D6D4CC;
    --ink-3: #BCBFB8;
    --muted: #A3AAA5;
    --accent: #7CC4A8;
    --accent-soft: #1F3A31;
    --accent-ink: #A9DCC7;
    --amber: #E6B96E;
    --amber-soft: #33291A;
    --danger: #F0A08D;
    --danger-soft: #3B221C;
    --border: #2D3833;
    --border-2: #242E29;
    --field: #3E4A44;
    --inset: #29332E;
    --soft-border: #33514A;
    --soft-fill: #1B2C26;
    --chip: #232C28;
    --on-accent: #0E1311;
    --banner-ink: #F2D9AA;
    --needs-fill: #251F16;
    --needs-icon: #3A2E1A;
    --dropzone-border: #4A5650;
    --lede-ink: #C7CAC3;
    --row-tint: #1B2420;
    --amber-border: #5A4527;
    --scrim: rgba(18, 24, 21, 0);
    --qr-ground: #FFFFFF;
    --backdrop: rgba(0, 0, 0, 0.6);
    --chart-1: #7CC4A8;
    --chart-2: #E6B96E;
    --chart-3: #8FB3E8;
    --chart-4: #F0A08D;
    --chart-grid: #2D3833;
    --chart-axis: #6E7A74;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--sans); background: var(--ground); color: var(--ink); }
a { color: var(--accent); }
button { font-family: var(--sans); }
[hidden] { display: none !important; }
.num, .mono { font-family: var(--mono); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------------------------------------------------------- brand */
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink);
  text-decoration: none; }
.mark { flex-shrink: 0; }
.wordmark { font-family: var(--serif); font-size: 21px; font-weight: 500;
  letter-spacing: -0.42px; font-variation-settings: "opsz" 36; }

/* ---------------------------------------------------------------- buttons */
.btn { min-height: 44px; padding: 0 20px; border-radius: 8px; font-size: 14px;
  cursor: pointer; font-weight: 500; }
.btn:disabled { cursor: not-allowed; opacity: 0.55; }
.btn-primary { border: 0; background: var(--accent); color: var(--on-accent); }
.btn-secondary { border: 1px solid var(--field); background: transparent; color: var(--ink-2);
  font-weight: 400; padding: 0 18px; }
.btn-soft { min-height: 42px; border: 1px solid var(--soft-border); background: var(--soft-fill);
  color: var(--accent-ink); font-size: 13.5px; }
.btn-link { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0;
  font-size: 13px; font-weight: 500; }
.link-btn { display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none; }
.btn-wide { width: 100%; min-height: 50px; border-radius: 9px; font-size: 15.5px; }

input[type=text], input[type=email], input[type=password], select {
  width: 100%; min-height: 44px; padding: 0 14px; border: 1px solid var(--field);
  border-radius: 8px; font-family: var(--sans); font-size: 14px; color: var(--ink);
  background: var(--surface-2); }
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------------------------------------------------------------- shell */
.shell { display: flex; min-height: 100vh; }
.rail { width: 224px; flex-shrink: 0; padding: 24px 16px; border-right: 1px solid var(--border);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.rail .brand { padding: 0 8px 26px; }
.rail-nav { display: flex; flex-direction: column; gap: 2px; }
.rail-item { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px;
  border-radius: 8px; color: var(--ink-2); font-size: 14px; text-decoration: none; }
.rail-item svg { flex-shrink: 0; }
.rail-item .rail-label { flex-grow: 1; }
.rail-item[aria-current="page"] { background: var(--accent-soft); color: var(--accent-ink);
  font-weight: 500; }
.rail-item:hover { background: var(--sunken); }
.rail-item[aria-current="page"]:hover { background: var(--accent-soft); }
.pill-count { font-family: var(--mono); font-size: 11px; padding: 2px 7px; border-radius: 20px;
  background: var(--amber-soft); color: var(--amber); }
.rail-sub { display: flex; flex-direction: column; gap: 1px; padding: 2px 0 2px 26px; }
.rail-subitem { display: flex; align-items: center; min-height: 32px; padding: 0 12px;
  border-radius: 6px; color: var(--ink-3); font-size: 13px; text-decoration: none;
  overflow-wrap: anywhere; }
.rail-subitem:hover { background: var(--sunken); }
.rail-subitem[aria-current="page"] { color: var(--accent-ink); font-weight: 500; }
.rail-spacer { flex-grow: 1; }
.rail-foot { padding: 14px 12px 4px; border-top: 1px solid var(--border); }
.rail-foot-row { display: flex; align-items: flex-start; gap: 8px; }
.rail-who { flex-grow: 1; min-width: 0; }
.rail-gear { display: inline-flex; align-items: center; justify-content: center; width: 36px;
  height: 36px; margin: -6px -8px 0 0; border-radius: 8px; color: var(--muted); flex-shrink: 0; }
.rail-gear:hover { background: var(--sunken); color: var(--ink); }
.rail-gear[aria-current="page"] { background: var(--accent-soft); color: var(--accent-ink); }
.rail-business { font-size: 13px; font-weight: 500; overflow-wrap: anywhere; }
.rail-user { font-size: 12px; color: var(--muted); padding-top: 2px; overflow-wrap: anywhere; }
button.rail-gear { border: 0; background: none; cursor: pointer; padding: 0; position: relative; }
.rail-gear[aria-expanded="true"] { background: var(--sunken); color: var(--ink); }
.gear-count { position: absolute; top: -2px; right: -4px; }
/* The gear's menu: above the gear at the foot of the rail. */
.gear-menu-wrap { position: relative; flex-shrink: 0; }
.gear-menu { position: absolute; right: -8px; bottom: calc(100% + 12px); z-index: 20;
  min-width: 190px; padding: 6px; display: flex; flex-direction: column; gap: 2px;
  background: var(--surface); border: 1px solid var(--field); border-radius: 10px; }
.gear-menu[hidden] { display: none; }
.gear-item { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 36px; padding: 0 10px; border: 0; border-radius: 6px; background: none;
  color: var(--ink); font: inherit; font-size: 13.5px; text-align: left; text-decoration: none;
  cursor: pointer; }
.gear-item:hover, .gear-item:focus-visible { background: var(--sunken); }
.gear-item[aria-current="page"] { color: var(--accent-ink); font-weight: 500; }

.pane { flex-grow: 1; min-width: 0; padding: 30px 36px; display: flex; flex-direction: column; }
#pane-body { display: flex; flex-direction: column; gap: 18px; flex-grow: 1; min-width: 0; }
.banner { background: var(--amber-soft); color: var(--banner-ink); border-radius: 10px; padding: 10px 14px;
  font-size: 13.5px; margin-bottom: 16px; }
.banner[data-banner] { display: flex; gap: 10px; align-items: flex-start; }
.banner[data-banner][hidden] { display: none; }
.banner[data-banner] > span { flex: 1; }
.banner-dismiss { flex: none; border: 0; background: none; color: inherit; font-size: 18px;
  line-height: 1; padding: 0 2px; cursor: pointer; border-radius: 4px; }
.banner-dismiss:hover { background: var(--amber-border); }
.rail-bell { position: relative; }
.bell-count { position: absolute; top: -2px; right: -4px; }
.loading, .empty { color: var(--muted); font-size: 14px; }
.error-text { color: var(--danger); font-size: 13.5px; }

/* ---------------------------------------------------------------- page heads */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 32px; }
.page-head h1, .h1 { margin: 0; font-family: var(--serif); font-size: 27px; font-weight: 600;
  letter-spacing: -0.3px; }
.page-lede { margin: 7px 0 0; font-size: 14.5px; line-height: 1.6; color: var(--ink-3);
  max-width: 640px; }
.count-pill { flex-shrink: 0; font-family: var(--mono); font-size: 12px; color: var(--muted);
  background: var(--surface); border: 1px solid var(--border); padding: 8px 13px;
  border-radius: 20px; }
.section-label { font-size: 11px; letter-spacing: 0.7px; text-transform: uppercase;
  color: var(--muted); }
h2.section { margin: 0 0 4px; font-size: 16px; font-weight: 500; }
.section-lede { margin: 0 0 14px; font-size: 13.5px; color: var(--muted); }
.source-group { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.source-group-head { padding-top: 8px; overflow-wrap: anywhere; }

/* ---------------------------------------------------------------- cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 22px 24px; display: flex; flex-direction: column; gap: 13px; min-width: 0; }
.badge-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.badge { font-family: var(--mono); font-size: 11px; letter-spacing: 0.4px; padding: 4px 10px;
  border-radius: 6px; background: var(--accent-soft); color: var(--accent-ink); }
.badge-amber { background: var(--amber-soft); color: var(--amber); }
.card-meta { font-size: 12px; color: var(--muted); }
.observation { margin: 0; font-size: 17px; line-height: 1.55; font-weight: 500;
  overflow-wrap: anywhere; }
.usually { margin: 0; font-size: 14px; line-height: 1.6; color: var(--ink-3); }
.ask-label { font-size: 14.5px; font-weight: 500; padding-top: 4px; }
.card-actions { display: flex; align-items: center; gap: 10px; padding-top: 2px; flex-wrap: wrap; }
.evidence { font-size: 12.5px; color: var(--muted); padding-left: 4px; overflow-wrap: anywhere; }
.members-only { margin: 0; font-size: 13.5px; color: var(--muted); background: var(--surface-2);
  border: 1px solid var(--inset); border-radius: 8px; padding: 10px 14px; }

.small-list { display: flex; flex-direction: column; gap: 9px; }
.small-card { background: var(--surface-2); border: 1px solid var(--inset); border-radius: 12px;
  padding: 15px 20px; display: flex; align-items: flex-start; gap: 13px; }
.small-card svg { flex-shrink: 0; margin-top: 2px; }
.small-card .grow { flex-grow: 1; min-width: 0; }
.small-card.is-retired { background: transparent; }
.small-card.is-retired .small-title { color: var(--ink-2); }
.small-title { margin: 0; font-size: 14.5px; line-height: 1.5; font-weight: 500;
  overflow-wrap: anywhere; }
.small-body { margin: 4px 0 0; font-size: 13.5px; line-height: 1.55; color: var(--ink-3);
  overflow-wrap: anywhere; }
.small-meta { flex-shrink: 0; font-size: 12px; color: var(--muted); }

/* ---------------------------------------------------------------- sources */
.source-list { background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  overflow: hidden; }
.source-row { display: flex; align-items: center; gap: 15px; padding: 17px 22px;
  border-bottom: 1px solid var(--border-2); }
.source-row:last-child { border-bottom: 0; }
.source-row.needs-you { background: var(--needs-fill); }
.source-icon { width: 38px; height: 38px; flex-shrink: 0; border-radius: 9px;
  background: var(--accent-soft); display: flex; align-items: center; justify-content: center; }
.needs-you .source-icon { background: var(--needs-icon); }
.source-text { flex-grow: 1; min-width: 0; }
.source-name { font-size: 15px; font-weight: 500; overflow-wrap: anywhere; }
.source-meta { font-size: 13px; color: var(--muted); padding-top: 2px; overflow-wrap: anywhere; }
.source-meta.problem { color: var(--danger); }
.status-pill { flex-shrink: 0; display: flex; align-items: center; gap: 7px; font-size: 12.5px;
  padding: 6px 12px; border-radius: 20px; background: var(--accent-soft); color: var(--accent-ink); }
.status-pill.partial { background: var(--amber-soft); color: var(--amber); }
.status-pill.failed { background: var(--danger-soft); color: var(--danger); }
.status-pill.pending { background: var(--sunken); color: var(--muted); }
a.source-name { display: block; color: var(--ink); text-decoration: none; }
a.source-name:hover { text-decoration: underline; }
.source-meta .btn-link { font-size: 13px; text-align: left; }
.source-meta.kept { font-size: 12.5px; }
.source-row.compact { padding: 11px 22px; }
.source-row.compact .source-icon, .source-row.compact .monogram { width: 30px; height: 30px; }
.history-host:empty { display: none; }
.history-panel { margin-top: 12px; padding: 14px 16px; border: 1px solid var(--border-2);
  border-radius: 10px; background: var(--surface-2); }
.export-steps { margin: 0 0 12px; padding-left: 20px; display: grid; gap: 8px; font-size: 13.5px;
  color: var(--ink-2); }
.export-steps .step-title { font-weight: 500; color: var(--ink); }
.dropzone.small { display: block; padding: 14px; font-size: 13px; }
.history-drop { margin-top: 4px; }
.history-choice { margin: 12px 0; font-size: 13.5px; color: var(--ink-2); }
.history-choice p { margin: 0 0 6px; }
.history-choice input[type=date], .extend-form input[type=date] { font-size: 13.5px; }
.extend-form .key-row input[type=date] { flex: 0 1 220px; font-family: inherit; }
.detail-card { margin-top: 18px; display: flex; flex-direction: column; gap: 8px; }
/* Single-field forms and short panels: about 560px of content, never the
   page's whole width (brief 18 Part 4 item 10). A card holding a table or a
   wide list (a mapping, the personal columns) keeps the page's width. */
.detail-card:not(#mapping):not(#personal), #upload-panel, #custom-reconnect-form, .key-row,
.rename-form, .pin-row, .build-add, .dock-form { max-width: 560px; }
.detail-card p { margin: 0; }
.subsection { margin: 12px 0 0; font-size: 14px; font-weight: 500; }
.reminder-form .choice input[type=number] { width: 64px; margin: 0 4px; }
#staff-code-form input[type=number] {
  width: 140px; min-height: 44px; padding: 0 14px; border: 1px solid var(--field);
  border-radius: 8px; font-family: var(--sans); font-size: 14px; color: var(--ink);
  background: var(--surface-2); }
.extend-form { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }

.add-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1100px) { .add-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.add-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 19px 20px; display: flex; flex-direction: column; gap: 9px; }
.add-card.is-disabled { opacity: 0.6; }
.add-card-title { font-size: 15px; font-weight: 500; }
.add-card p { margin: 0; font-size: 13px; line-height: 1.55; color: var(--ink-3); flex-grow: 1; }
.coming { font-size: 12px; color: var(--muted); }

.dropzone { border: 1px dashed var(--dropzone-border); border-radius: 10px; padding: 22px; text-align: center;
  font-size: 13.5px; color: var(--ink-2); background: var(--surface-2); cursor: pointer; }
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.progress { height: 6px; border-radius: 6px; background: var(--sunken); overflow: hidden; }
.progress > span { display: block; height: 100%; width: 0; background: var(--accent);
  transition: width 0.15s; }
.mapping { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.mapping th { text-align: left; font-weight: 500; font-size: 12px; color: var(--muted);
  padding: 6px 8px; border-bottom: 1px solid var(--border); }
.mapping td { padding: 7px 8px; border-bottom: 1px solid var(--border-2);
  overflow-wrap: anywhere; }
.mapping td.num { text-align: right; }
.cli { margin: 0; font-family: var(--mono); font-size: 12.5px; line-height: 1.55;
  background: var(--surface-2); border: 1px solid var(--inset); border-radius: 10px;
  padding: 14px 16px; overflow-x: auto; white-space: pre; color: var(--ink-2); }
.upload-summary { font-size: 13.5px; color: var(--ink-3); line-height: 1.6; }
.scroll-x { overflow-x: auto; max-width: 100%; }

/* ---------------------------------------------------------------- ask */
.ask-pane { display: flex; flex-direction: column; gap: 18px; flex-grow: 1; min-width: 0; }
.thread { display: flex; flex-direction: column; gap: 22px; flex-grow: 1; }
.turn { display: flex; flex-direction: column; gap: 14px; }
.ask-title { margin: 0 0 6px; font-family: var(--serif); font-size: 26px; font-weight: 500; }
#ask-send { white-space: nowrap; flex-shrink: 0; }
.ask-hint { margin: 0; font-size: 13.5px; color: var(--ink-3); }
.asked-label { font-size: 11px; letter-spacing: 0.7px; text-transform: uppercase;
  color: var(--muted); padding-bottom: 6px; }
.asked { font-family: var(--serif); font-size: 25px; font-weight: 500; letter-spacing: -0.2px;
  overflow-wrap: anywhere; }
.answer-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 26px 28px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.status-line { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.status-line::before { content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); animation: pulse 1.2s infinite ease-in-out; }
@keyframes pulse { 50% { opacity: 0.25; } }
.answer { font-size: 15px; line-height: 1.65; color: var(--ink-2); overflow-wrap: anywhere;
  min-width: 0; }
.answer p { margin: 0 0 10px; }
.answer p:last-child { margin-bottom: 0; }
.answer ul, .answer ol { margin: 0 0 10px; padding-left: 22px; }
.answer h3, .answer h4 { font-size: 15px; margin: 12px 0 6px; }
.answer code { font-family: var(--mono); font-size: 13px; background: var(--sunken);
  padding: 1px 4px; border-radius: 4px; }
.answer table { border-collapse: collapse; font-size: 13.5px; margin: 4px 0 10px; }
.answer th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12.5px;
  border-bottom: 1px solid var(--border); padding: 6px 12px 6px 0; }
.answer td { border-bottom: 1px solid var(--border-2); padding: 6px 12px 6px 0;
  font-family: var(--mono); font-size: 13px; }
.answer .table-wrap { overflow-x: auto; max-width: 100%; }
.provenance { border-top: 1px solid var(--border-2); padding-top: 15px; display: flex;
  flex-direction: column; gap: 10px; }
.provenance-line { display: flex; align-items: center; gap: 9px; font-size: 12.5px;
  color: var(--muted); flex-wrap: wrap; }
.source-chip { background: var(--chip); padding: 4px 9px; border-radius: 6px; color: var(--ink-2);
  overflow-wrap: anywhere; }
.rules-list { margin: 0; padding-left: 20px; font-size: 13px; line-height: 1.55;
  color: var(--ink-3); }
.chips { display: flex; gap: 9px; flex-wrap: wrap; }
.chip-link { text-decoration: none; }
.chip-pill { margin-bottom: 10px; }
.composer-wrap .chips { margin-bottom: 12px; }
.chip-pill[aria-expanded="true"] { border-color: var(--accent); }
.chip { font-size: 13px; color: var(--ink-2); background: var(--surface);
  border: 1px solid var(--border); border-radius: 20px; padding: 9px 15px; cursor: pointer;
  text-align: left; }
.chip:hover { border-color: var(--soft-border); }
.composer-wrap { position: sticky; bottom: 0; padding: 12px 0 0;
  background: linear-gradient(to bottom, var(--scrim), var(--ground) 30%); }
.composer { background: var(--surface); border: 1px solid var(--field); border-radius: 12px;
  padding: 13px 16px; display: flex; align-items: center; gap: 14px; }
.composer input { flex-grow: 1; min-width: 0; border: 0; outline: none; font-size: 15px;
  background: transparent; min-height: 44px; padding: 0; }
.composer input:focus-visible { outline: none; }
.composer:focus-within { border-color: var(--accent); }
.ask-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ask-toolbar #new-question { margin-left: auto; }
.ask-layout { display: flex; flex-direction: column; gap: 14px; flex-grow: 1; min-width: 0; }
.ask-cols { display: flex; gap: 24px; flex-grow: 1; min-width: 0; align-items: flex-start; }
.ask-cols .ask-pane { align-self: stretch; }
.convos { width: 236px; flex-shrink: 0; position: sticky; top: 30px; max-height: calc(100vh - 60px);
  overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding-right: 4px; }
.convo-toggle { display: inline-flex; align-items: center; gap: 6px; min-height: 44px;
  padding: 0 12px 0 6px; border: 0; border-radius: 8px; background: none; color: var(--ink-2);
  font-size: 13.5px; font-weight: 500; cursor: pointer; }
.convo-toggle:hover { background: var(--sunken); }
.convo-toggle svg { transition: transform 0.15s ease; }
.convo-toggle[aria-expanded="true"] svg { transform: rotate(90deg); }
.convo-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.convo { display: flex; align-items: flex-start; gap: 4px; border-radius: 8px; padding: 2px; min-width: 0; }
.convo:hover, .convo:focus-within, .convo.is-current { background: var(--sunken); }
.convo.is-current { background: var(--accent-soft); }
.convo-open { flex-grow: 1; min-width: 0; text-align: left; background: none; border: 0; cursor: pointer;
  padding: 7px 8px; display: flex; flex-direction: column; gap: 2px; color: var(--ink-2); }
.convo-title { font-size: 13.5px; line-height: 1.4; overflow-wrap: anywhere; }
.convo-when { font-size: 11.5px; color: var(--muted); }
.convo-acts { display: flex; flex-direction: column; gap: 2px; padding-top: 4px; opacity: 0; }
.convo:hover .convo-acts, .convo:focus-within .convo-acts { opacity: 1; }
.convo-act { font-size: 11.5px; color: var(--muted); background: none; border: 0; cursor: pointer;
  padding: 2px 6px; text-align: right; }
.convo-act:hover { color: var(--ink); }
.convo-rename { min-height: 36px; font-size: 13.5px; background: var(--surface); }
.convo-empty { font-size: 13px; color: var(--muted); padding: 6px 8px; }

/* ---------------------------------------------------------------- people */
.people { width: 100%; border-collapse: collapse; font-size: 14px; }
.people th { text-align: left; font-size: 12px; font-weight: 500; color: var(--muted);
  padding: 8px 10px 8px 0; border-bottom: 1px solid var(--border); }
.people td { padding: 10px 10px 10px 0; border-bottom: 1px solid var(--border-2);
  vertical-align: middle; overflow-wrap: anywhere; }
.people select { width: auto; min-height: 36px; }
.invite-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.invite-form .field { flex: 1 1 220px; }
.invite-form select { width: auto; }
.dev-link { font-family: var(--mono); font-size: 12px; background: var(--surface-2);
  border: 1px solid var(--inset); border-radius: 8px; padding: 10px 12px; overflow-wrap: anywhere; }

/* ---------------------------------------------------------------- auth */
.auth-body { min-height: 100vh; }
.auth { max-width: 452px; margin: 0 auto; padding: 48px 16px; display: flex;
  flex-direction: column; align-items: center; gap: 28px; }
.auth-brand { align-self: center; }
.auth-card { width: 100%; background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 30px 30px 26px; }
.auth-card h1 { margin: 0; font-family: var(--serif); font-size: 29px; line-height: 1.18;
  font-weight: 600; letter-spacing: -0.6px; }
.auth-card .lede { margin: 10px 0 22px; font-size: 15px; line-height: 1.6; color: var(--lede-ink); }
.auth-card .lede:empty { display: none; }
#auth-form { display: flex; flex-direction: column; gap: 15px; }
.field label, label.field-label { display: block; font-size: 13.5px; font-weight: 500;
  padding-bottom: 6px; }
.auth-card input[type=text], .auth-card input[type=email], .auth-card input[type=password] {
  min-height: 46px; border-radius: 9px; font-size: 15px; background: var(--surface); }
.auth-card input[readonly] { background: var(--surface-2); color: var(--muted); }
.optional { font-weight: 400; color: var(--muted); }
.hint { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); }
.form-error { margin: 0; color: var(--danger); font-size: 13.5px; }
/* Continue with Google / Microsoft, above the email form (app/signin.py). */
.signin-providers { display: flex; flex-direction: column; gap: 10px; margin: 0 0 6px; }
.signin-or { display: flex; align-items: center; gap: 12px; margin: 8px 0 14px; color: var(--ink-3);
  font-size: 13px; }
.signin-or::before, .signin-or::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
#signin-error { margin: 0 0 14px; }
.form-note { margin: 0; color: var(--accent-ink); font-size: 13.5px; overflow-wrap: anywhere; }
.auth-links { margin: 18px 0 0; font-size: 13.5px; text-align: center; color: var(--muted); }
.fine { margin: 14px 0 0; font-size: 12.5px; line-height: 1.55; color: var(--muted); }

/* ---------------------------------------------------------------- the second
   factor (brief 18): the /2fa page, backup codes, the step-up dialog */
.tfa section { display: grid; gap: 14px; }
.tfa-or { margin: 4px 0; text-align: center; font-size: 13.5px; color: var(--muted); }
.tfa-step { margin: 0; font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.tfa-app { display: grid; gap: 12px; }
.tfa-qr { display: block; width: 190px; height: 190px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--qr-ground); }
.tfa-secret { overflow-wrap: anywhere; color: var(--ink); }
.auth-card input[inputmode=numeric], .auth-card input[autocomplete=one-time-code] {
  min-height: 46px; border-radius: 9px; font-size: 17px; letter-spacing: 0.08em;
  font-family: var(--mono); background: var(--surface); }
.tfa-remember { display: flex; gap: 8px; align-items: center; margin: 14px 0 0;
  font-size: 13.5px; color: var(--ink-2); }
.backup-codes { margin: 0; padding: 14px 18px 14px 38px; display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 18px; font-size: 14.5px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; }
.tfa-code-actions { margin: 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
dialog.stepup { width: min(420px, calc(100vw - 32px)); padding: 24px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface); color: var(--ink); }
dialog.stepup::backdrop { background: var(--backdrop); }
dialog.stepup h2 { margin: 0 0 6px; font-family: var(--serif); font-size: 22px; }
.stepup-form { display: grid; gap: 12px; margin-top: 12px; }
.stepup-form input { min-height: 42px; border-radius: 9px; font-size: 16px; }
.stepup-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.person-actions { white-space: nowrap; }
.person-actions .btn-link { margin-right: 10px; }
.settings-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 0; }
@media (max-width: 420px) {
  .backup-codes { grid-template-columns: 1fr; }
  .person-actions { white-space: normal; }
}

/* ---------------------------------------------------------------- rules
   (screens/Rules.html) */
.filter-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.filter-sep { width: 1px; height: 22px; background: var(--border); margin: 0 4px; }
.rule-list { display: flex; flex-direction: column; gap: 10px; }
.rule { background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 18px 22px; display: flex; gap: 18px; align-items: flex-start; min-width: 0; }
.rule.direct { border-color: var(--soft-border); border-left: 3px solid var(--accent);
  background: var(--row-tint); padding-left: 20px; }
.rule.is-retired { background: var(--surface-2); }
.rule.is-retired .rule-text { color: var(--ink-3); }
.rule-num { flex-shrink: 0; font-family: var(--mono); font-size: 12px; color: var(--muted);
  width: 26px; padding-top: 3px; }
.rule-body { flex-grow: 1; min-width: 0; }
.rule-text { font-size: 15px; line-height: 1.55; overflow-wrap: anywhere; white-space: pre-wrap; }
.rule-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px;
  color: var(--muted); margin-top: 8px; overflow-wrap: anywhere; }
.rule-tag { font-family: var(--mono); font-size: 10px; letter-spacing: 0.4px; padding: 3px 7px;
  border-radius: 5px; background: var(--sunken); color: var(--ink-2); overflow-wrap: anywhere; }
.rule-tag.tag-all { background: var(--accent-soft); color: var(--accent-ink); }
.retired-line { color: var(--danger); }
.rule-actions { flex-shrink: 0; display: flex; gap: 6px; }
.rule-act { font-size: 12.5px; color: var(--muted); background: var(--surface); padding: 5px 9px;
  min-height: 32px; border-radius: 6px; border: 1px solid var(--border); cursor: pointer; }
.rule-act:hover { color: var(--ink); border-color: var(--field); }
.rule-history { margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.rule-history summary { cursor: pointer; width: fit-content; }
.rule-history ol { margin: 8px 0 0; padding-left: 20px; display: flex; flex-direction: column;
  gap: 8px; }
.rule-old { color: var(--ink-3); font-size: 13.5px; line-height: 1.5; overflow-wrap: anywhere;
  white-space: pre-wrap; }
.rule-form { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.rule-form textarea { width: 100%; min-height: 76px; padding: 10px 14px; border: 1px solid var(--field);
  border-radius: 8px; font-family: var(--sans); font-size: 14px; color: var(--ink);
  background: var(--surface); resize: vertical; }
.rule-form-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.rule-form-row label { display: flex; flex-direction: column; gap: 6px; padding: 0; }
.rule-form-row select { width: auto; min-width: 160px; }
.rules-foot { padding: 16px 20px; background: var(--surface-2); border: 1px solid var(--inset);
  border-radius: 12px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.rules-foot p { margin: 0; font-size: 13.5px; line-height: 1.6; color: var(--ink-3); }
.rules-foot .card-meta { flex-shrink: 0; white-space: nowrap; }

/* ---------------------------------------------------------------- catalog
   (screens/Catalog.html) */
.crumbs { font-size: 12.5px; color: var(--muted); padding-bottom: 6px; }
.crumbs a { text-decoration: underline; text-underline-offset: 2px; }
/* The first stop on every app page (WCAG 2.4.1): off screen until focused. */
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 50; padding: 8px 14px;
  border-radius: 8px; background: var(--surface); color: var(--accent-ink);
  border: 1px solid var(--field); font-size: 14px; text-decoration: none; }
.skip-link:focus { top: 12px; }
.pane:focus { outline: none; }
.crumbs .sep { padding: 0 5px; }
.catalog-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.search { flex: 1 1 260px; display: flex; align-items: center; gap: 10px; background: var(--surface);
  border: 1px solid var(--field); border-radius: 10px; padding: 0 14px; min-height: 44px; }
.search input { border: 0; background: transparent; padding: 0; min-height: 42px; }
.search input:focus-visible { outline: none; }
.search:focus-within { border-color: var(--accent); }
.filter-chip { font-size: 13px; padding: 10px 14px; min-height: 40px; border-radius: 20px;
  background: var(--surface); border: 1px solid var(--border); color: var(--ink-2); cursor: pointer; }
.filter-chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--ground); }
/* The section chips: sticky under the search (app.js sets top below the
   rail when the rail is a top bar), one row that scrolls sideways. */
.cat-chips { position: sticky; top: 0; z-index: 4; display: flex; gap: 6px; overflow-x: auto;
  scrollbar-width: thin; padding: 8px 0; margin: -8px 0; background: var(--ground); }
.cat-chips[hidden] { display: none; }
.cat-chip { flex-shrink: 0; white-space: nowrap; font-size: 12.5px; padding: 6px 12px; min-height: 36px;
  border-radius: 18px; background: var(--surface); border: 1px solid var(--border); color: var(--ink-2);
  cursor: pointer; }
.cat-chip[aria-current="true"] { background: var(--accent-soft); border-color: var(--soft-border);
  color: var(--accent-ink); font-weight: 500; }
.cat-section { display: flex; flex-direction: column; gap: 10px; scroll-margin-top: var(--jump-offset, 64px); }
.cat-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding-top: 6px; }
.cat-head h2 { margin: 0; font-size: 15px; font-weight: 500; }
.cat-head small { font-size: 12px; color: var(--muted); }
.tool-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.tool-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px 18px; display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.tool-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.monogram { width: 36px; height: 36px; border-radius: 9px; display: flex; align-items: center;
  justify-content: center; font-family: var(--mono); font-size: 15px; font-weight: 500;
  background: var(--sunken); color: var(--ink-2); flex-shrink: 0; }
.monogram.is-live { background: var(--accent-soft); color: var(--accent-ink); }
.monogram.big { width: 48px; height: 48px; border-radius: 12px; font-size: 20px; }
.method { font-family: var(--mono); font-size: 10px; letter-spacing: 0.4px; padding: 3px 7px;
  border-radius: 5px; }
.method-oauth { background: var(--accent-soft); color: var(--accent-ink); }
.method-key { background: var(--sunken); color: var(--ink-2); }
.method-file { background: var(--amber-soft); color: var(--amber); }
.method-api, .method-database { background: var(--sunken); color: var(--ink-2); }
.tool-name { font-size: 14.5px; font-weight: 500; overflow-wrap: anywhere; }
.tool-holds { font-size: 12.5px; color: var(--muted); line-height: 1.5; flex-grow: 1;
  overflow-wrap: anywhere; }
.tool-action { min-height: 36px; border-radius: 8px; font-size: 13px; font-weight: 500;
  display: flex; align-items: center; justify-content: center; text-decoration: none; gap: 6px;
  cursor: pointer; padding: 0 10px; }
.tool-action.connect { background: var(--accent); color: var(--on-accent); border: 0; }
.tool-action.request { border: 1px solid var(--field); background: var(--surface); color: var(--ink-2);
  font-weight: 400; }
.tool-action.request[aria-pressed="true"] { border-color: var(--soft-border); background: var(--soft-fill);
  color: var(--accent-ink); }
.tool-action .asked { color: var(--muted); font-size: 12px; font-family: var(--sans); }
/* Request beside "Upload a file" (B-file 2): two equal halves, always side
   by side; in a narrow card each label wraps inside its half. */
.tool-split { display: flex; gap: 6px; }
.tool-split > .tool-action { flex: 1 1 0; min-width: 0; text-align: center; flex-wrap: wrap;
  column-gap: 4px; row-gap: 0; padding: 4px 6px; line-height: 1.3; min-height: 40px; }
/* Outlined like Request, but its label is the brand green: the active half. */
.tool-action.upload-file { border: 1px solid var(--field); background: var(--surface);
  color: var(--accent); }
.tool-action.upload-file[disabled] { color: var(--muted); cursor: not-allowed; }
.tool-alt { align-self: center; font-size: 12.5px; padding: 2px 0; }
/* Deleting a source: the one destructive action on its page. */
.btn.danger { color: var(--danger); border-color: currentColor; }
.btn-primary.danger { background: var(--danger); color: var(--ground); border-color: transparent; }
.danger-zone { margin-top: 12px; background: var(--danger-soft); color: var(--ink); }
.tool-note { font-size: 12px; color: var(--muted); }
.tool-note a { font-weight: 500; }
.dont-see { padding: 18px 22px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; }
.dont-see-title { font-size: 14.5px; font-weight: 500; }
.dont-see p { margin: 4px 0 14px; font-size: 13px; color: var(--muted); }
.dont-see p.form-note { margin: 10px 0 0; }
.dont-see p.form-note:empty { display: none; }
/* Three doors on one row, every control the same height; they stack when
   the row runs out of width. */
.dont-see-row { display: flex; align-items: stretch; gap: 10px; flex-wrap: wrap; }
.dont-see-row form { display: flex; gap: 10px; flex: 1 1 340px; min-width: 0; margin: 0; }
.dont-see-row form input { flex: 1 1 auto; min-width: 0; }
.dont-see-row .btn, .dont-see-row input, .door-link { height: 44px; min-height: 44px;
  box-sizing: border-box; }
.dont-see-row .btn { flex-shrink: 0; }
.door-link { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  padding: 0 16px; border-radius: 8px; border: 1px solid var(--soft-border);
  background: var(--soft-fill); color: var(--accent-ink); font-size: 13.5px; font-weight: 500;
  text-decoration: none; white-space: nowrap; }
.door-talk { border-color: var(--field); background: transparent; color: var(--ink-2);
  font-weight: 400; }
.door-talk .door-lead { color: var(--muted); }
@media (max-width: 760px) {
  .dont-see-row form, .door-link { flex: 1 1 100%; }
}

/* ---------------------------------------------------------------- connect
   (screens/Connect.html) */
.connect-head { display: flex; align-items: center; gap: 14px; }
.connect-head h1 { margin: 0; font-family: var(--serif); font-size: 28px; font-weight: 600;
  letter-spacing: -0.4px; }
.connect-head p { margin: 4px 0 0; font-size: 13.5px; color: var(--muted); }
.connect-cols { display: flex; gap: 20px; align-items: flex-start; }
.connect-main { flex-grow: 1; min-width: 0; background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 24px 26px; display: flex; flex-direction: column; gap: 18px; }
.connect-side { width: 320px; flex-shrink: 0; display: flex; flex-direction: column; gap: 14px; }
.step { display: flex; gap: 14px; align-items: flex-start; }
.step > div:not(.step-n) { flex-grow: 1; min-width: 0; }
.step-n { flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft);
  color: var(--accent-ink); display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 12px; margin-top: 1px; }
.step-title { font-size: 15px; font-weight: 500; }
.step-text { margin: 4px 0 0; font-size: 13.5px; color: var(--ink-3); line-height: 1.6; }
.step-text p { margin: 0; }
.step-text code { font-family: var(--mono); font-size: 12.5px; }
.step-text strong { font-weight: 500; color: var(--ink); }
.perms { background: var(--surface-2); border: 1px solid var(--inset); border-radius: 10px;
  padding: 6px 14px; margin-top: 10px; }
.perm { display: flex; align-items: center; gap: 10px; font-size: 13.5px; padding: 8px 0;
  border-bottom: 1px solid var(--border-2); flex-wrap: wrap; }
.perm:last-child { border-bottom: 0; }
.perm-name { font-family: var(--mono); font-size: 12.5px; color: var(--ink-2); width: 170px; flex-shrink: 0; }
.perm-access { color: var(--accent-ink); }
.perm-why { color: var(--muted); font-size: 12.5px; }
.key-row { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.key-row input { flex: 1 1 240px; font-family: var(--mono); font-size: 13.5px; background: var(--surface); }
.key-fields { flex: 1 1 240px; display: grid; gap: 8px; }
.key-fields input { width: 100%; font-family: var(--mono); font-size: 13.5px; background: var(--surface); margin-top: 4px; }
.check { border-radius: 12px; padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.check.ok { background: var(--accent-soft); border: 1px solid var(--soft-border); }
.check.refused { background: var(--amber-soft); border: 1px solid var(--amber-border); }
.check.unverified { background: var(--amber-soft); border: 1px solid var(--amber-border); }
.check-title { display: flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 500; }
.check.ok .check-title { color: var(--accent-ink); }
.check.refused .check-title, .check.unverified .check-title { color: var(--amber); }
.check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 20px;
  font-size: 13px; color: var(--ink-2); }
.check-grid .muted { color: var(--muted); }
.check-grid .bad { color: var(--danger); font-weight: 500; }
.check-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.check-actions span { font-size: 12.5px; color: var(--muted); }
.side-card { background: var(--surface-2); border: 1px solid var(--inset); border-radius: 14px;
  padding: 18px 22px; }
.side-card.white { background: var(--surface); border-color: var(--border); }
.side-title { display: flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 500;
  margin-bottom: 8px; }
.side-card p { margin: 0; font-size: 13px; line-height: 1.6; color: var(--ink-3); }
.bullets { display: flex; flex-direction: column; gap: 9px; font-size: 13.5px; color: var(--ink-3);
  line-height: 1.5; margin: 0; padding: 0; list-style: none; }
.bullets li { display: flex; gap: 10px; }
.bullets li::before { content: ""; flex-shrink: 0; width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent); margin-top: 8px; }
.notice { font-size: 13.5px; line-height: 1.6; color: var(--amber); background: var(--amber-soft);
  border-radius: 10px; padding: 12px 14px; margin: 0; }

/* ---------------------------------------------------------------- requests */
.requests { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.requests th { text-align: left; font-size: 12px; font-weight: 500; color: var(--muted);
  padding: 8px 10px 8px 0; border-bottom: 1px solid var(--border); }
.requests td { padding: 9px 10px 9px 0; border-bottom: 1px solid var(--border-2);
  overflow-wrap: anywhere; vertical-align: top; }

/* ---------------------------------------------------------------- narrow */
@media (hover: none) { .convo-acts { opacity: 1; } }

@media (max-width: 1100px) {
  .tool-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .connect-cols { flex-direction: column; }
  .connect-side { width: 100%; }
}

@media (max-width: 760px) {
  .shell { flex-direction: column; }
  .ask-cols { flex-direction: column; gap: 12px; }
  .convos { width: 100%; position: static; max-height: 45vh; padding: 12px; background: var(--surface);
    border: 1px solid var(--border); border-radius: 12px; }
  .convo-acts { opacity: 1; }
  .rule { flex-wrap: wrap; gap: 10px 14px; padding: 15px 16px; }
  .rule.direct { padding-left: 14px; }
  .rule-body { flex-basis: calc(100% - 44px); }
  .rule-actions { margin-left: 40px; }
  .rules-foot { flex-direction: column; align-items: flex-start; }
  .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .connect-main { padding: 18px 16px; }
  .check-grid { grid-template-columns: minmax(0, 1fr); }
  .perm-name { width: auto; }
  .requests thead { display: none; }
  .requests tr { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 10px 0;
    border-bottom: 1px solid var(--border-2); }
  .requests td { border: 0; padding: 0; }
  .rail { width: auto; height: auto; position: sticky; top: 0; z-index: 5; flex-direction: row;
    flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 10px 16px;
    border-right: 0; border-bottom: 1px solid var(--border); background: var(--ground); }
  .rail .brand { padding: 0; margin-right: auto; }
  .rail .mark { width: 34px; height: 23px; }
  .rail .wordmark { font-size: 18px; }
  .rail-nav { order: 3; flex-direction: row; flex-wrap: wrap; gap: 2px; width: 100%; }
  .rail-item { min-height: 40px; padding: 0 10px; gap: 6px; font-size: 13.5px; }
  .rail-item .rail-label { flex-grow: 0; }
  .rail-spacer { display: none; }
  .rail-foot { order: 2; border-top: 0; padding: 0; text-align: right; display: flex;
    align-items: center; gap: 4px; }
  .rail-business, .rail-user, .rail-who { display: none; }
  .rail-gear { margin: 0; }
  .gear-menu { bottom: auto; top: calc(100% + 8px); right: 0; }
  .pane { padding: 20px 16px; }
  .page-head { flex-direction: column; gap: 12px; }
  .add-grid { grid-template-columns: minmax(0, 1fr); }
  .card, .answer-card { padding: 18px 16px; }
  .source-row { flex-wrap: wrap; padding: 15px 16px; }
  .small-card { flex-wrap: wrap; padding: 14px 16px; }
  .small-meta { width: 100%; padding-left: 30px; }
  .asked { font-size: 21px; }
  .auth-card { padding: 24px 18px; }
  .people thead { display: none; }
  .people tr { display: flex; flex-wrap: wrap; gap: 6px 12px; padding: 10px 0;
    border-bottom: 1px solid var(--border-2); }
  .people td { border: 0; padding: 0; }
}

@media (max-width: 420px) {
  .tool-grid { grid-template-columns: minmax(0, 1fr); }
}

/* empty status and result holders take no room */
.upload-summary:empty, #upload-panel .small-list:empty { display: none; }

/* After signing in: pick the property or site a source reads. */
.choices { display: grid; gap: 8px; margin: 12px 0; }
.choice { display: flex; gap: 10px; align-items: center; padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  cursor: pointer; overflow-wrap: anywhere; }
.finding-details { margin: 8px 0 0; }

/* ---------------------------------------------------------------- settings */
.settings-layout { display: flex; gap: 28px; align-items: flex-start; }
.settings-nav { display: flex; flex-direction: column; gap: 2px; width: 180px; flex-shrink: 0; }
.settings-tab { display: flex; align-items: center; min-height: 40px; padding: 0 12px;
  border-radius: 8px; color: var(--ink-2); text-decoration: none; font-size: 14px; }
.settings-tab:hover { background: var(--sunken); }
.settings-tab[aria-current="page"] { background: var(--accent-soft); color: var(--accent-ink);
  font-weight: 500; }
.settings-body { flex-grow: 1; min-width: 0; }
.section-head { margin-bottom: 14px; }
.section-title { margin: 0; font-family: var(--serif); font-size: 21px; font-weight: 500;
  color: var(--ink); }
.settings-card { max-width: 560px; }
.settings-facts { display: grid; grid-template-columns: 120px 1fr; gap: 10px 16px; margin: 0; }
.settings-facts dt { color: var(--muted); font-size: 13.5px; }
.settings-facts dd { margin: 0; color: var(--ink); font-size: 14px; }
.settings-slot { max-width: 560px; border: 1px dashed var(--field); background: var(--surface-2); }
.settings-slot .slot-label { font-size: 11.5px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--amber); }
.settings-slot p { margin: 6px 0 0; color: var(--ink-3); font-size: 13.5px; line-height: 1.55; }
.settings-form { display: grid; gap: 16px; }
.settings-form .field label { display: block; font-size: 13px; color: var(--ink-3);
  margin-bottom: 6px; }
.choice-title { font-weight: 500; color: var(--ink); }

/* ---------------------------------------------------------------- export */
.export-row { display: flex; align-items: center; gap: 12px; margin: 8px 0 4px; }
.export-row .btn-link { font-size: 13px; }

@media (max-width: 759px) {
  .settings-layout { flex-direction: column; gap: 14px; }
  .settings-nav { flex-direction: row; flex-wrap: wrap; width: 100%; }
  .settings-tab { min-height: 36px; }
  .settings-facts { grid-template-columns: 1fr; gap: 2px; }
  .settings-facts dd { margin-bottom: 8px; }
}

/* ---------------------------------------------------------------- charts
   (app/static/charts.js; screens/Dashboard.html). Marks are colored by the
   --chart-* tokens; every label is HTML text. */
.chart-mark[data-series="1"] { --series: var(--chart-1); }
.chart-mark[data-series="2"] { --series: var(--chart-2); }
.chart-mark[data-series="3"] { --series: var(--chart-3); }
.chart-mark[data-series="4"] { --series: var(--chart-4); }
rect.chart-mark, circle.chart-mark { fill: var(--series); }
polyline.chart-mark { fill: none; stroke: var(--series); stroke-width: 2; stroke-linejoin: round;
  stroke-linecap: round; vector-effect: non-scaling-stroke; }
.chart-grid { stroke: var(--chart-grid); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart-axis { stroke: var(--chart-axis); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.chart-body { display: flex; gap: 8px; min-width: 0; }
.chart-y { display: flex; flex-direction: column; justify-content: space-between; height: 180px;
  margin-top: -7px; margin-bottom: 7px; font-family: var(--mono); font-size: 10.5px;
  color: var(--muted); text-align: right; min-width: 34px; }
.chart-plot { flex-grow: 1; min-width: 0; }
.chart-svg { display: block; width: 100%; height: 180px; overflow: visible; }
.chart-x { position: relative; height: 18px; margin-top: 6px; font-size: 10.5px;
  color: var(--muted); }
.chart-x span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.chart-x span.first { transform: none; left: 0 !important; }
.chart-x span.last { transform: none; left: auto !important; right: 0; }
.chart-key { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--ink-3); }
.chart-key-item { display: inline-flex; align-items: center; gap: 6px; }
.chart-swatch { width: 10px; height: 10px; border-radius: 2px; background: var(--series); }
/* The window before (compare): dashed, thinner, in its series' colour. */
polyline.chart-mark.prior { stroke-width: 1.5; stroke-dasharray: 5 4; }
circle.chart-mark.prior { fill: none; stroke: var(--series); stroke-width: 1.5; }
.chart-swatch.prior { height: 0; border-radius: 0; background: none;
  border-top: 2px dashed var(--series); }
.chart-empty { margin: 8px 0; }
/* Series of very different sizes (app/chartscale.py): a small chart each,
   stacked, or a second axis on the right. */
.chart-panels { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.chart-panel .chart-y, .chart-panel .chart-svg { height: 108px; }
.chart-y.right { text-align: left; }
.bar-list { display: flex; flex-direction: column; gap: 9px; }
.bar-line { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px;
  padding-bottom: 4px; }
.bar-name { color: var(--ink-2); overflow-wrap: anywhere; }
.bar-value { color: var(--ink-3); white-space: nowrap; }
.bar-track { height: 7px; background: var(--border-2); border-radius: 4px; }
.bar-fill { height: 7px; background: var(--series); border-radius: 4px; }
.chart-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.chart-table th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px;
  padding: 6px 10px 6px 0; border-bottom: 1px solid var(--border); }
.chart-table td { padding: 7px 10px 7px 0; border-bottom: 1px solid var(--border-2);
  color: var(--ink-2); overflow-wrap: anywhere; }
.chart-table .num { text-align: right; font-family: var(--mono); white-space: nowrap; }
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat-value { font-size: 27px; font-weight: 500; letter-spacing: -0.8px; color: var(--ink); }
.stat-change { font-size: 12px; color: var(--muted); }
.stat-change[data-tone="good"] { color: var(--accent); }
.stat-change[data-tone="bad"] { color: var(--danger); }
/* A tile's badges, and the ones a board's tiles share (in its header). */
.board-badges, .tile-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.board-badges:empty, .tile-badges:empty { display: none; }
.badge-note summary { cursor: pointer; list-style: none; display: inline-block; }
.badge-note summary::-webkit-details-marker { display: none; }
.badge-note[open] { flex-basis: 100%; }
.badge-note p { margin: 6px 0 0; font-size: 12px; color: var(--ink-2); max-width: 70ch; }

/* Ask: a chart an answer drew, and pinning it */
.answer-charts { display: flex; flex-direction: column; gap: 12px; }
.answer-charts:empty { display: none; }
.chart-card { margin: 12px 0 0; padding: 14px 16px; border: 1px solid var(--border);
  border-radius: 10px; background: var(--surface-2); display: flex; flex-direction: column;
  gap: 10px; min-width: 0; }
.chart-title { font-size: 14px; font-weight: 500; color: var(--ink); }
.pin-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.add-all { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pin-row select, .pin-row input, .add-all select { min-height: 36px; padding: 0 10px;
  border: 1px solid var(--field);
  border-radius: 8px; background: var(--surface); color: var(--ink); font-family: var(--sans);
  font-size: 13px; }

/* ---------------------------------------------------------------- dashboards */
.board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px; }
.board-card { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  text-decoration: none; }
.board-card:hover { border-color: var(--field); }
/* "New dashboard": the grid's dashed last tile (brief 18 Part 4 item 6). */
.board-new { border-style: dashed; border-color: var(--dropzone-border); background: transparent;
  text-align: left; font: inherit; cursor: pointer; min-height: 96px; justify-content: center; }
.board-new:hover { border-color: var(--accent); }
.archived-boards summary { cursor: pointer; font-weight: 500; color: var(--ink); }
.archived-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column;
  gap: 10px; }
.archived-list li { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.share-panel { gap: 10px; max-width: 560px; }
.share-panel h2 { margin: 0; font-size: 16px; font-weight: 500; font-family: var(--sans); }
.share-choice, .share-person { display: flex; gap: 8px; align-items: center; color: var(--ink-2); }
.share-people { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin: 0;
  display: flex; flex-direction: column; gap: 6px; }
.share-people legend { font-size: 12px; color: var(--muted); padding: 0 4px; }
.board-who { margin: 4px 0 0; }
.board-name { font-family: var(--serif); font-size: 18px; font-weight: 500; color: var(--ink);
  overflow-wrap: anywhere; }
.empty-board p { margin: 8px 0 0; color: var(--ink-3); font-size: 14px; line-height: 1.55; }
.board-head { align-items: flex-start; }
.board-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.board-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.board-bar .export-row { margin: 0 0 0 auto; }
.range-custom { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.range-custom input { min-height: 36px; padding: 0 8px; border: 1px solid var(--field);
  border-radius: 8px; background: var(--surface); color: var(--ink); font-family: var(--sans); }
.rename-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rename-form input { min-height: 40px; padding: 0 12px; border: 1px solid var(--field);
  border-radius: 8px; background: var(--surface); color: var(--ink); font-family: var(--serif);
  font-size: 20px; min-width: 0; }
.tile-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 12px; }
/* A dashboard built from a prompt (brief 18 Part 4 item 6): the empty state
   is the prompt box, then a preview to keep tiles from. */
.tile-grid > .build-panel { grid-column: 1 / -1; }
.build-panel h2, .dock-title { margin: 0; font-size: 16px; font-weight: 500; font-family: var(--sans); }
.build-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.build-form textarea { flex: 1 1 320px; min-height: 72px; resize: vertical; font: inherit;
  padding: 10px 12px; border: 1px solid var(--field); border-radius: 8px; background: var(--surface);
  color: var(--ink); }
.build-form input[type="text"], .dock-form input { flex: 1 1 240px; font: inherit; padding: 9px 12px;
  border: 1px solid var(--field); border-radius: 8px; background: var(--surface); color: var(--ink); }
.build-preview { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px;
  align-items: start; }
.build-add { flex: 1 1 420px; flex-wrap: nowrap; }
@media (max-width: 520px) { .build-add { flex-wrap: wrap; } }
.build-preview:empty { display: none; }
.build-keep { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; color: var(--ink-2); }
.build-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
/* "Ask about this dashboard", docked above the tiles. */
.dock { gap: 12px; }
.dock-thread { display: flex; flex-direction: column; gap: 10px; max-height: 480px; overflow-y: auto; }
.dock-thread:empty { display: none; }
.dock-question { margin: 0; font-weight: 500; color: var(--ink); }
.dock-answer { display: flex; flex-direction: column; gap: 8px; }
.dock-form { display: flex; gap: 10px; flex-wrap: wrap; }
.dock-proposal { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 10px 12px;
  border: 1px solid var(--amber-border); border-radius: 8px; background: var(--amber-soft); }
.dock-proposal p { margin: 0; color: var(--banner-ink); }
/* Reports (brief 18 Part 4 item 7). */
.report-form textarea { width: 100%; min-height: 96px; resize: vertical; font: inherit; padding: 10px 12px;
  border: 1px solid var(--field); border-radius: 8px; background: var(--surface); color: var(--ink);
  box-sizing: border-box; }
.report-list { display: flex; flex-direction: column; gap: 10px; }
.report-row, .schedule-row { display: flex; flex-direction: column; gap: 4px; text-decoration: none; padding: 14px 18px; }
.report-row[data-status="failed"] .card-meta { color: var(--danger); }
.report-body { display: flex; flex-direction: column; gap: 10px; max-width: 760px; line-height: 1.6; }
.report-asked { margin-top: 18px; }
.report-body h2 { margin: 14px 0 0; font-size: 18px; font-weight: 500; font-family: var(--serif); }
.report-body h3 { margin: 10px 0 0; font-size: 15px; font-weight: 500; }

/* A new dashboard's "Nothing here yet" spans the grid, not one column. */
.tile-grid > .empty { grid-column: 1 / -1; }
.tile { grid-column: span 6; display: flex; flex-direction: column; gap: 12px; min-width: 0;
  padding: 16px 18px; }
.tile-stat, .tile-findings { grid-column: span 3; }
.tile-table { grid-column: span 12; }
.tile-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.tile-title { margin: 0; font-size: 14px; font-weight: 500; color: var(--ink);
  font-family: var(--sans); overflow-wrap: anywhere; }
.tile-stat .tile-title, .tile-findings .tile-title { font-size: 12.5px; font-weight: 400;
  color: var(--muted); }
.tile-actions { display: flex; gap: 10px; flex-shrink: 0; }
.tile-actions .btn-link { font-size: 12px; }
.tile-body { flex-grow: 1; min-width: 0; }
.tile-foot { display: flex; flex-direction: column; gap: 4px; }
.tile-foot .card-meta { font-size: 11.5px; overflow-wrap: anywhere; }
.tile-rules-line .btn-link, .tile-rules-line .card-meta { font-size: 11.5px; }
.tile-rules { font-size: 12px; margin: 4px 0 0; }
.tile-error { margin: 0; }
.tile-gap { font-size: 11.5px; color: var(--amber); overflow-wrap: anywhere; }
.rule-tag.tag-status { background: var(--accent-soft); color: var(--accent-ink); }
.rule-tag.status-held { background: var(--amber-soft); color: var(--amber); }
.rule-tag.status-retired { background: var(--sunken); color: var(--ink-3); }

@media (max-width: 1100px) {
  .tile-stat, .tile-findings { grid-column: span 6; }
  .tile { grid-column: span 12; }
  .tile.tile-stat, .tile.tile-findings { grid-column: span 6; }
}
@media (max-width: 759px) {
  .tile, .tile.tile-stat, .tile.tile-findings { grid-column: span 12; }
  .board-bar .export-row { margin: 0; }
  .rail-sub { display: none; }
}

/* ------------------------------------------------ plans and the meter (brief 13) */
.meter-card { display: flex; flex-direction: column; gap: 10px; }
.meter-line { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.meter-count { font-family: var(--serif); font-size: 22px; font-weight: 500; }
.meter-bar { height: 10px; border-radius: 6px; background: var(--sunken); overflow: hidden; }
.meter-fill { display: block; height: 100%; background: var(--accent); }
.meter-fill.high { background: var(--amber); }
.meter-fill.full { background: var(--danger); }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 12px 0; }
.plan-card { border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; display: flex;
  flex-direction: column; gap: 6px; align-items: flex-start; }
.plan-card.is-current { border-color: var(--accent); }
.plan-name { font-weight: 600; }
.ask-paused { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; margin-bottom: 12px; }
.ask-paused-title { margin: 0; font-weight: 500; }
.banner .btn-link { margin-left: 6px; }
.invite-code code { font-size: 13px; letter-spacing: 0.5px; }
#upload-panel.is-open { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ------------------------------------------------ the private-beta page */
.site-head { display: flex; justify-content: space-between; align-items: center; gap: 16px;
  max-width: 1040px; margin: 0 auto; padding: 22px 16px; }
.site-nav a { font-weight: 500; }
.beta { max-width: 1040px; margin: 0 auto; padding: 8px 16px 64px; display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 440px); gap: 40px; align-items: start; }
.beta-kicker { margin: 0 0 8px; font-size: 12px; letter-spacing: 0.8px; text-transform: uppercase;
  color: var(--accent-ink); font-weight: 600; }
.beta-intro h1 { margin: 0; font-family: var(--serif); font-size: 38px; line-height: 1.15;
  font-weight: 500; letter-spacing: -0.4px; }
.beta-intro .lede { margin: 16px 0; font-size: 16px; line-height: 1.65; color: var(--lede-ink); }
.beta-code-line { font-size: 14px; color: var(--ink-3); }
.news-card textarea { width: 100%; min-height: 160px; resize: vertical; font: inherit; font-size: 14px;
  padding: 10px 12px; border: 1px solid var(--field); border-radius: 10px; background: var(--surface); color: var(--ink); }
.beta-card textarea { width: 100%; font: inherit; font-size: 14px; padding: 10px 12px;
  border: 1px solid var(--field); border-radius: 10px; background: var(--surface); color: var(--ink); }
.beta-card select { width: 100%; }
.beta-card .field { margin-bottom: 14px; }
.limit-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; }
.limit-controls select { width: auto; min-height: 34px; }
.limit-controls input { width: 130px; min-height: 34px; padding: 0 10px; border: 1px solid var(--field);
  border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; font-size: 13px; }
.beta-done h2 { margin: 0 0 8px; font-family: var(--serif); font-weight: 500; }
.beta-done:focus { outline: none; }
@media (max-width: 820px) {
  .beta { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .beta-intro h1 { font-size: 30px; }
}

/* ------------------------------------------------------------------ spaces
   Brief 10: the switcher at the top of the rail, a source's space, rules
   set above this space, held rules and their review, stale answers, and
   notifications. Tokens only, so both palettes cover them. */
.space-switcher { display: flex; flex-direction: column; gap: 4px; padding: 4px 10px 14px; }
.space-switcher-label { font-family: var(--mono); font-size: 10px; letter-spacing: 0.6px;
  text-transform: uppercase; color: var(--muted); }
.space-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column;
  gap: 1px; max-height: 240px; overflow-y: auto; }
.space-item { display: block; width: 100%; min-height: 32px; padding: 0 8px; border: 0;
  border-radius: 6px; background: none; color: var(--ink-3); font: inherit; font-size: 13px;
  text-align: left; cursor: pointer; overflow-wrap: anywhere; }
.space-item:hover { background: var(--sunken); color: var(--ink); }
.space-item[aria-current="true"] { background: var(--accent-soft); color: var(--accent-ink);
  font-weight: 500; cursor: default; }
.space-item[data-depth="1"] { padding-left: 20px; }
.space-item[data-depth="2"] { padding-left: 32px; }
.space-item[data-depth="3"] { padding-left: 44px; }
.space-item[data-depth="4"], .space-item[data-depth="5"] { padding-left: 56px; }
.source-space { font-family: var(--mono); font-size: 11px; letter-spacing: 0.3px; color: var(--accent-ink);
  padding-top: 2px; }
.rule-tag.tag-set-by { background: var(--chip); color: var(--ink-2); }
.rule.is-inherited { background: var(--surface-2); }
.rule.is-held, .rule.is-pending { border-left: 3px solid var(--amber-border); }
.review-line { color: var(--ink-3); }
.review-note { overflow-wrap: anywhere; }
.held-why { font-size: 13px; line-height: 1.5; color: var(--amber); background: var(--amber-soft);
  border-radius: 8px; padding: 8px 10px; margin-top: 8px; overflow-wrap: anywhere; }
.held-conflict { font-size: 13px; color: var(--ink-3); padding: 4px 10px 0; overflow-wrap: anywhere; }
.stale-flag { font-size: 12.5px; color: var(--amber); background: var(--amber-soft); border-radius: 8px;
  padding: 6px 10px; margin: 6px 0; }
.ask-space { margin: 6px 2px 0; font-size: 12.5px; color: var(--muted); }
.ask-space strong { color: var(--ink-2); font-weight: 600; }
.rail-notify { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.notification { display: block; text-decoration: none; color: var(--ink); }
.notification.is-unread { border-left: 3px solid var(--accent); }
.notification-title { font-weight: 600; font-size: 14px; }
.person-role { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 2px 0;
  font-size: 13px; }
.person-space { color: var(--ink-3); }
.super-cell { white-space: nowrap; font-size: 13px; }
.choice-inline { display: inline-flex; align-items: center; gap: 6px; }
.space-name { overflow-wrap: anywhere; }
tr.is-archived td { color: var(--muted); }

/* /app/staff/contact (brief 14) */
.contact-request { display: flex; flex-direction: column; gap: 6px; }
.contact-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.contact-who { font-size: 14px; color: var(--ink-2); overflow-wrap: anywhere; }
.contact-message { white-space: pre-wrap; overflow-wrap: anywhere; margin: 4px 0; }
.contact-request .btn { align-self: flex-start; }

/* The staff console (brief 15) */
.staff-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px;
  margin: 12px 0 20px; }
.staff-stat { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; }
.staff-stat-value { font-size: 22px; color: var(--ink); overflow-wrap: anywhere; }
.staff-alert { background: var(--danger-soft); color: var(--danger); border: 1px solid var(--danger);
  border-radius: 8px; padding: 10px 14px; margin-bottom: 16px; font-size: 14px; }
.staff-alert a { color: var(--danger); }
.staff-table tr.is-trouble td { background: var(--danger-soft); color: var(--danger); }
.staff-table .num { text-align: right; white-space: nowrap; }
.staff-table th .btn-link { font: inherit; color: inherit; }
.attention-count { color: var(--danger); font-weight: 600; }
.staff-filters { flex-wrap: wrap; gap: 10px; align-items: center; }
.staff-tree { list-style: none; margin: 0 0 16px; padding: 0; font-size: 14px; }
.staff-tree li { padding: 4px 0; border-bottom: 1px solid var(--border-2); }
.audit-json { font-size: 12px; max-width: 260px; overflow-wrap: anywhere; }
.invite-mail.is-not-sent { color: var(--amber); }
.invite-actions { margin: 4px 0 0; font-size: 13px; }
#staff-note { width: 100%; }

/* Guided file mapping (app/ingest/mapper.py): the conversation with the assistant. */
.mapping-turns { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 12px; }
.mapping-turn { padding: 8px 12px; border-radius: 10px; border: 1px solid var(--border); max-width: 100%; }
.mapping-turn p { margin: 0; overflow-wrap: anywhere; }
.mapping-turn.person { align-self: flex-end; background: var(--border-2); }
.mapping-turn.note { border-style: dashed; color: var(--muted); font-size: 0.92em; }
.mapping-who { font-size: 0.8em; color: var(--muted); margin-bottom: 2px; }
.mapping-excluded { color: var(--muted); }
.mapping textarea { flex: 1; min-width: 0; }

/* ---------------------------------------------------------------- a source's activity (4.10) */
.activity-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.activity-item { font-size: 13.5px; color: var(--ink); overflow-wrap: anywhere; }
/* ---------------------------------------------------------------- scheduled reports */
.schedule-panel { display: flex; flex-direction: column; gap: 10px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.panel-head h2 { margin: 0; }
.schedule-form { display: flex; flex-direction: column; gap: 12px; }
.schedule-form select, .schedule-form input[type="time"], .schedule-form input[type="number"] {
  min-height: 36px; padding: 0 10px; border: 1px solid var(--field); border-radius: 8px;
  background: var(--surface); color: var(--ink); font: inherit; font-size: 13.5px; }
.schedule-form input[type="number"] { width: 90px; }

/* A report's Exceptions (amber: a warning, never red) and its footer. */
.report-exceptions { background: var(--amber-soft); border-left: 3px solid var(--amber);
  color: var(--banner-ink); border-radius: 0 8px 8px 0; padding: 10px 14px; margin: 0 0 14px; }
.report-exceptions > :last-child { margin-bottom: 0; }
.report-footer { border-top: 1px solid var(--border); margin-top: 18px; padding-top: 10px;
  font-size: 12.5px; color: var(--muted); }
.report-footer p { margin: 4px 0; overflow-wrap: anywhere; }
/* The public demo's banner (app/demo.py): what this is, and the way out. */
.banner-demo > span { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.banner-demo .banner-cta { margin-left: auto; }

/* Google Sheets' Picker window (app/templates/picker.html): a heading, a line
   and the button; Google's Picker opens over it. */
.picker-body { margin: 0; min-height: 100vh; background: var(--ground); color: var(--ink);
  font-family: var(--sans); }
.picker-main { max-width: 480px; margin: 0 auto; padding: 48px 24px; display: flex;
  flex-direction: column; gap: 16px; align-items: flex-start; }
.picker-title { margin: 0; font-family: var(--serif); font-size: 24px; font-weight: 600; }
.picker-lede { margin: 0; color: var(--ink-3); font-size: 14.5px; line-height: 1.6; }
