/* Athena · a calm workspace
   Warm off-white sidebar beside a white page; the document table is the hero. One blue accent
   for links, actions, focus and selection. Soft tags only on restricted files. System UI sans.
   Direction contract: .impeccable/surfaces/. DESIGN.md records the system. */

:root {
  /* Surfaces */
  --page: #ffffff;
  --side: #f7f7f5;
  --hover: #efefed;
  --active: #e8e8e5;
  --well: #fbfbfa;
  --canvas: #ffffff;

  /* Page thumbnails (the drawn stand-in pages): one step darker than the lines so they read on white */
  --thumb-edge: #c3c2be;
  --thumb-ink: #97968f;
  --thumb-soft: #d3d2ce;

  /* Ink (warm near-black and two warm greys) */
  --ink: #37352f;
  --ink-2: #5f5e5b;
  --ink-3: #6f6e69;
  --ink-4: #a3a29e;

  /* Lines */
  --line: #e9e9e7;
  --line-2: #dcdcd9;

  /* Colour roles */
  /* Athena's colours, from the mark. Blue acts (links, buttons, focus, selection); navy is who and where (the tenant,
     page icons, counts waiting, the current step); sky is what was found (search and find highlights, a lit branch);
     red is the error and irreversible roles. Sky is a fill only: it's too light for text or thin lines. */
  --accent: #1e7ab6;
  --accent-deep: #196495;
  --accent-wash: #d9eaf7;
  --accent-ring: rgb(30 122 182 / 0.28);
  --navy: #0f6cbd;
  --sky: #5bcbf5;
  --sky-wash: #d6f1fc;

  /* Error and audited actions */
  --red: #b7121a;
  --red-deep: #8f0e14;
  --red-wash: #fdebeb;
  --red-line: #f2c4c6;
  --red-ring: rgb(183 18 26 / 0.2);

  /* Tags: each restricted class takes one of these soft colours (General has none); red is legal hold's alone */
  --tag-pink: #f5e0e9;    --tag-pink-ink: #4c2337;
  --tag-green: #dbeddb;   --tag-green-ink: #1c3829;
  --tag-blue: #d3e5ef;    --tag-blue-ink: #183347;
  --tag-purple: #e8deee;  --tag-purple-ink: #412454;
  --tag-orange: #fadec9;  --tag-orange-ink: #49290e;
  --tag-yellow: #fdecc8;  --tag-yellow-ink: #402c1b;
  --tag-brown: #eee0da;   --tag-brown-ink: #442a1e;
  --tag-hold: #ffe2dd;    --tag-hold-ink: #5d1715;

  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", Helvetica, Arial, sans-serif;

  --r: 6px;
  --r-tag: 4px;
  --r-pop: 8px;
  --r-pill: 999px;
  --pop-shadow: 0 0 0 1px rgb(15 15 15 / 0.05), 0 3px 6px rgb(15 15 15 / 0.08), 0 9px 24px rgb(15 15 15 / 0.14);
  --side-w: 248px;
  --top-h: 56px;

  /* The theme (US-121): the tenant's four colours, as ThemePalette shades them. A style element in the head sets them
     for the tenant (ThemeStyle); these are the default theme's, for a page without one. */
  --brand: #0f6cbd;
  --on-brand: #ffffff;
  --on-brand-2: rgb(255 255 255 / 0.78);
  --brand-hover: rgb(255 255 255 / 0.12);
  --brand-current: rgb(255 255 255 / 0.2);
  --on-brand-current: #ffffff;
  --menu: #0058a3;
  --on-menu: #ffffff;
  --on-menu-2: rgb(255 255 255 / 0.78);
  --menu-hover: rgb(255 255 255 / 0.12);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  color-scheme: light;
  accent-color: var(--accent);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--ink);
  background: var(--page);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent-ring); color: var(--ink); }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-deep); text-decoration: underline; text-underline-offset: 0.18em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { margin: 0; line-height: 1.25; text-wrap: balance; color: var(--ink); }
p { margin: 0; text-wrap: pretty; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.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;
}
.icon { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.icon--doc, .icon--folder { color: var(--ink-3); }

* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }

.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 60;
  background: var(--page); color: var(--ink); padding: 8px 12px; border-radius: var(--r);
}
.skip-link:focus { top: 8px; box-shadow: var(--pop-shadow); }

/* ───────────── The app: top bar over sidebar + page (US-120) ───────────── */

.app {
  display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); grid-template-rows: var(--top-h) auto;
  min-height: 100dvh;
}
.scrim { display: none; }

/* The top bar: Athena and the tenant on the left, search in the middle, help, the bell and the account on the right,
   in the theme's primary. */
.appbar {
  grid-column: 1 / -1; position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  height: var(--top-h); padding: 0 12px 0 16px;
  background: var(--brand); color: var(--on-brand);
}
.appbar-brand { display: inline-flex; align-items: center; gap: 10px; flex: none; color: var(--on-brand); font-size: 1.125rem; font-weight: 650; letter-spacing: -0.01em; }
.appbar-brand:hover { color: var(--on-brand); text-decoration: none; }
.appbar-mark { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: var(--r); background: #fff; }
.appbar-mark svg { width: 20px; height: 20px; }
.appbar-tenant { flex: 0 1 auto; min-width: 0; padding-left: 12px; border-left: 1px solid var(--brand-hover); }
.appbar .switcher > summary, .appbar .tenant-plain { min-height: 34px; color: var(--on-brand); font-weight: 500; }
.appbar .switcher > summary:hover, .appbar .switcher[open] > summary { background: var(--brand-hover); }
.appbar .switcher > summary .icon { color: var(--on-brand-2); }
.appbar .switcher .popover { right: auto; min-width: 17rem; color: var(--ink); }
.appbar .platform-plain .name { font-size: 0.8125rem; color: var(--on-brand-2); }

.appbar-search { position: relative; flex: 1 1 28rem; max-width: 36rem; margin: 0 auto; }
.appbar-search .icon { position: absolute; left: 11px; top: 50%; translate: 0 -50%; color: var(--ink-3); pointer-events: none; }
.appbar-search input {
  width: 100%; height: 36px; padding: 0 34px 0 36px;
  background: var(--page); border: 1px solid transparent; border-radius: var(--r);
  color: var(--ink);
  transition: box-shadow 120ms var(--ease-out);
}
.appbar-search input::placeholder { color: var(--ink-3); }
.appbar-search input:focus { outline: none; box-shadow: 0 0 0 3px rgb(255 255 255 / 0.45); }
.appbar-search kbd {
  position: absolute; right: 9px; top: 50%; translate: 0 -50%;
  min-width: 18px; padding: 1px 5px; border: 1px solid var(--line-2); border-radius: var(--r-tag);
  font: 600 0.6875rem/1.3 var(--font); color: var(--ink-3); text-align: center; background: var(--side);
}
.appbar-end { display: flex; align-items: center; gap: 4px; flex: none; margin-left: auto; }
.appbar-search + .appbar-end { margin-left: 0; }
.top-btn {
  position: relative; display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none;
  border: 0; border-radius: var(--r); background: none; color: var(--on-brand); list-style: none; cursor: pointer;
}
.top-btn::-webkit-details-marker { display: none; }
.top-btn:hover, details[open] > .top-btn { background: var(--brand-hover); color: var(--on-brand); text-decoration: none; }
.top-btn .icon { width: 18px; height: 18px; }
.top-btn:focus-visible, .appbar .switcher > summary:focus-visible, .account-menu > summary:focus-visible { outline: 2px solid var(--on-brand); outline-offset: 1px; }
.search-btn { display: none; }
.menu-btn { display: none; }
/* The bell: the sum of what's waiting, as a pill on its corner. */
.bell-count {
  position: absolute; top: 2px; right: 0; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: var(--r-pill); background: #fff; color: var(--brand); box-shadow: 0 0 0 2px var(--brand);
  font-size: 0.6875rem; font-weight: 700; line-height: 17px; text-align: center;
}
.alerts-menu, .account-menu { position: relative; }
.popover.popover--end { left: auto; right: 0; min-width: 17rem; }
.alerts-pop .popover-item .icon { color: var(--ink-3); }
.alerts-pop .nav-badge { margin-left: auto; }
.alerts-none { padding: 4px 8px 8px; font-size: 0.8125rem; color: var(--ink-2); max-width: 17rem; }
/* The bell's notices (round 47): what happened on your matters, the title over the matter's number. */
.alerts-pop { max-width: min(22rem, calc(100vw - 32px)); }
.alerts-notice { align-items: flex-start; padding-block: 6px; }
.alerts-notice > .icon { margin-top: 2px; color: var(--navy); }
.alerts-pop .alerts-notice > .icon { color: var(--navy); }
.alerts-pop .alerts-notice--bad > .icon { color: var(--red); }
.alerts-notice-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.alerts-notice .name { font-weight: 600; }
.alerts-notice-matter { font-size: 0.75rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.alerts-more { font-size: 0.8125rem; color: var(--ink-2); padding-left: 32px; }
/* What's waiting, as a page. */
.alerts-list { margin: 0; padding: 0; list-style: none; }
.alerts-row { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line); color: var(--ink); }
.alerts-list li:first-child .alerts-row { border-top: 0; }
.alerts-row:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
.alerts-row > .icon:first-child { color: var(--navy); }
.alerts-row .name { flex: 1; font-weight: 600; }
.alerts-what { color: var(--ink-2); }
.alerts-quiet { margin: 0; padding: 12px 16px; color: var(--ink-2); }
.alerts-row--notice { align-items: flex-start; }
.alerts-row--notice > .icon:first-child { margin-top: 3px; }
.alerts-row--bad > .icon:first-child { color: var(--red); }
.alerts-notice-body { display: flex; flex-direction: column; flex: 1; min-width: 0; gap: 2px; }
.alerts-notice-body .name { flex: none; }
.alerts-notice-detail { color: var(--ink-2); font-size: 0.875rem; overflow-wrap: anywhere; }
.alerts-when { color: var(--ink-2); font-size: 0.875rem; white-space: nowrap; }

/* A theme in small (US-121): the frame in the theme's own shades, for the pickers and the platform's theme pages. */
.theme-sample {
  display: grid; grid-template: 14px 1fr / 30% 1fr; width: 100%; aspect-ratio: 16 / 9; overflow: hidden;
  border: 1px solid var(--line); border-radius: 8px; background: var(--ts-canvas);
}
.theme-sample i { display: block; border-radius: 2px; }
.ts-bar { grid-column: 1 / -1; display: flex; align-items: center; gap: 6%; padding: 0 6px; background: var(--ts-brand); }
.ts-mark { width: 7px; height: 7px; background: var(--ts-on); opacity: 0.9; }
.ts-search { width: 34%; height: 6px; margin-left: 18%; background: #fff; opacity: 0.92; border-radius: 3px !important; }
.ts-dot { width: 6px; height: 6px; margin-left: auto; border-radius: 50% !important; background: var(--ts-on); opacity: 0.85; }
.ts-side { display: flex; flex-direction: column; gap: 5px; padding: 8px 7px; background: var(--ts-menu, var(--ts-brand)); }
.ts-side i { height: 5px; background: var(--ts-on-menu, var(--ts-on)); opacity: 0.45; }
.ts-side i:nth-child(3) { width: 70%; }
.ts-side .ts-now { height: 8px; margin-inline: -3px; background: var(--ts-current); opacity: 1; border-radius: 3px; }
.ts-page { display: flex; flex-direction: column; gap: 5px; padding: 9px 10px; min-width: 0; }
.ts-title { width: 46%; height: 7px; background: var(--ts-identity); }
.ts-line { width: 84%; height: 4px; background: #37352f; opacity: 0.16; }
.ts-line--short { width: 60%; }
.ts-row { display: flex; align-items: center; gap: 6px; margin-top: auto; }
.ts-chip { width: 28%; height: 9px; background: var(--ts-wash); border-radius: 5px !important; }
.ts-btn { width: 24%; height: 10px; margin-left: auto; background: var(--ts-accent); border-radius: 3px !important; }

.theme-colours { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: 4px 10px; margin: 0; padding: 0; list-style: none; font-size: 0.75rem; color: var(--ink-2); }
.theme-colours li { display: flex; align-items: center; gap: 6px; min-width: 0; }
.theme-colours code, .swatch-note code { font-size: 0.75rem; color: var(--ink-3); }
.tchip { display: inline-block; flex: none; width: 14px; height: 14px; border-radius: 4px; box-shadow: inset 0 0 0 1px rgb(15 15 15 / 0.14); vertical-align: -2px; }
.tchip--sm { width: 11px; height: 11px; margin-right: 3px; }
.swatch-note { margin: 4px 0 0; font-size: 0.75rem; color: var(--ink-3); }

.theme-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 12px; }
.theme-pick {
  position: relative; display: flex; flex-direction: column; gap: 8px; padding: 10px 10px 12px;
  border: 1px solid var(--line); border-radius: var(--r-pop); background: var(--page); cursor: pointer;
  transition: border-color 120ms, box-shadow 120ms;
}
.theme-pick:hover { border-color: var(--ink-4); }
.theme-pick:has(:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.theme-pick:has(:focus-visible) { box-shadow: 0 0 0 1px var(--accent), 0 0 0 4px var(--accent-ring); }
.theme-pick:has(:checked)::after {
  content: ""; position: absolute; top: 16px; right: 16px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 12px no-repeat;
  box-shadow: 0 0 0 2px #fff;
}
.theme-pick-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.theme-pick-name { font-weight: 600; margin-right: auto; }
.theme-pick-desc { font-size: 0.8125rem; color: var(--ink-2); }
.theme-edit { display: grid; grid-template-columns: minmax(0, 1fr) minmax(18rem, 24rem); gap: 16px; align-items: start; }
.theme-edit > .panel { margin: 0; }
.theme-preview { position: sticky; top: calc(var(--top-h) + 16px); display: flex; flex-direction: column; gap: 16px; }
.theme-preview .panel + .panel { margin-top: 0; }
.theme-preview-body { display: flex; flex-direction: column; gap: 10px; padding: 14px; }
.theme-preview-body .field-hint { margin: 0; }
.theme-preview .theme-sample { border-radius: 10px; }
.theme-colour-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 14px 18px; }
.theme-colour label { display: block; margin-bottom: 6px; font-size: 0.875rem; font-weight: 500; }
.theme-colour .field-hint, .theme-colour .field-error { margin-top: 5px; }
.colour-input { display: flex; align-items: center; gap: 8px; }
.colour-input input[type="color"] {
  flex: none; width: 38px; height: 36px; padding: 2px; border: 1px solid var(--line-2); border-radius: var(--r);
  background: var(--page); cursor: pointer;
}
.colour-input input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.colour-input input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 4px; }
.colour-input input[type="color"]::-moz-color-swatch { border: 0; border-radius: 4px; }
.colour-input input[data-colour] {
  width: 100%; max-width: 9rem; height: 36px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: var(--r);
  background: var(--page); color: var(--ink); font: 0.875rem/1 var(--mono, ui-monospace, monospace);
}
.colour-input input[data-colour]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.colour-input input[data-colour][aria-invalid="true"] { border-color: var(--red); }
.wearing-list a { color: var(--ink); }
@media (max-width: 1180px) {
  .theme-edit { grid-template-columns: minmax(0, 1fr); }
  .theme-preview { position: static; order: -1; }
}
.theme-picks--list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.theme-picks--list .theme-pick { padding: 8px 8px 10px; gap: 6px; }
.theme-picks--list .theme-pick:has(:checked)::after { top: 13px; right: 13px; }
.theme-inline { display: inline-flex; align-items: center; gap: 8px; vertical-align: middle; }
.theme-inline-sample { display: inline-block; width: 52px; }
.theme-inline-sample .theme-sample { border-radius: 4px; grid-template-rows: 5px 1fr; }
.theme-inline-sample .theme-sample i, .theme-inline-sample .ts-row { display: none; }
.theme-rows { margin: 0; padding: 0; list-style: none; }
.theme-row { display: grid; grid-template-columns: 11rem minmax(0, 1fr) auto; gap: 8px 18px; align-items: start; padding: 14px; }
.theme-row + .theme-row { border-top: 1px solid var(--line); }
.theme-row-sample { display: block; border-radius: 8px; }
.theme-row-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.theme-row-body .theme-pick-desc { margin: 0; max-width: 60ch; }
.theme-row-body .theme-colours { max-width: 28rem; }
.theme-row .theme-pick-name { margin-right: 0; }
a.theme-pick-name { color: var(--ink); text-decoration: none; }
a.theme-pick-name:hover { color: var(--accent); text-decoration: underline; }
.theme-row-meta { margin: 0; font-size: 0.75rem; color: var(--ink-3); }
.theme-row-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.theme-remove { margin-top: 4px; padding: 10px 12px; border-radius: var(--r); background: var(--well); font-size: 0.875rem; }
@media (max-width: 860px) {
  .theme-row { grid-template-columns: 7.5rem minmax(0, 1fr); }
  .theme-row-actions { grid-column: 1 / -1; justify-content: flex-start; }
}
.alerts-row > .icon:last-child { color: var(--ink-3); }

/* --uifirst-bar: the height of the prototype's design toolbar when it's shown (0 in the product), so the sidebar's foot
   is never hidden under it. The sidebar wears the theme's menu colour: its own inks and fills are re-pointed here, so
   the file plan tree and the menu need no rules of their own. */
.sidebar {
  position: sticky; top: var(--top-h); align-self: start;
  height: calc(100dvh - var(--top-h) - var(--uifirst-bar, 0px));
  display: flex; flex-direction: column;
  background: var(--menu);
  color: var(--on-menu-2);
  --ink: var(--on-menu); --ink-2: var(--on-menu-2); --ink-3: var(--on-menu-2); --ink-4: var(--on-menu-2);
  --hover: var(--menu-hover); --active: var(--brand-current); --line: var(--menu-hover);
  --sky-wash: var(--menu-hover); --accent: var(--on-menu); --accent-deep: var(--on-menu);
  scrollbar-color: var(--menu-hover) transparent;
}
.sb-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 8px 10px 16px; }
.sidebar .nav-row[aria-current] { color: var(--on-brand-current); }
.sidebar .nav-row[aria-current] > .icon { color: var(--on-brand-current); }
.sidebar .nav-badge { background: #fff; color: var(--menu); }
.sidebar .nav-badge--quiet { background: none; color: var(--on-menu-2); }
.sidebar .sb-caption { color: var(--on-menu-2); opacity: 0.85; }

/* Tenant switcher (the workspace switcher) */
.switcher { position: relative; }
.switcher > summary, .tenant-plain {
  display: flex; align-items: center; gap: 8px;
  min-height: 36px; padding: 4px 8px; border-radius: var(--r);
  color: var(--ink); font-weight: 600; list-style: none;
}
.switcher > summary { cursor: pointer; }
.switcher > summary::-webkit-details-marker { display: none; }
.switcher > summary:hover { background: var(--hover); }
.switcher > summary .name, .tenant-plain .name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.switcher > summary .icon { margin-left: 2px; color: var(--ink-3); }
.avatar {
  flex: none; display: inline-grid; place-items: center;
  width: 22px; height: 22px; border-radius: var(--r-tag);
  background: var(--navy); color: #fff;
  font-size: 0.75rem; font-weight: 650; line-height: 1;
}
.avatar--lg { width: 32px; height: 32px; border-radius: var(--r); font-size: 0.9375rem; }
.avatar--quiet { background: var(--active); color: var(--ink); }
/* A tenant's logo in place of its letter badge (US-037): kept in its box at its own proportions, on white. */
.avatar--logo { background: #fff; border: 1px solid var(--line); overflow: hidden; width: auto; min-width: 22px; max-width: 64px; padding: 1px 2px; }
.avatar--logo.avatar--lg { min-width: 32px; max-width: 96px; }
/* The picture's height is set outright: a percentage doesn't resolve inside the grid box, and a square logo then
   kept its full height and was cut off (owner, 2026-10-01). Box height less its border and padding. */
.avatar--logo img { display: block; height: 18px; width: auto; max-width: 100%; object-fit: contain; }
.avatar--logo.avatar--lg img { height: 28px; }
.page-title .avatar--logo.avatar--lg img { height: 26px; }
/* Settings › Logo: the logo on its own, and as the sidebar shows it. */
.logo-current { display: grid; gap: 12px; justify-items: start; padding: 14px 16px; }
.logo-upload, .theme-form { padding: 14px 16px; }
.logo-upload .panel-form-actions { margin-top: 16px; }
.logo-stage { display: grid; place-items: center; min-width: 200px; height: 96px; padding: 12px 20px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); }
.logo-stage img { max-height: 72px; max-width: 320px; object-fit: contain; }
.logo-stage--bar { display: flex; gap: 8px; height: auto; min-width: 0; padding: 8px 12px; background: var(--surface-2, var(--active)); font-weight: 600; }
.logo-stage--bar .avatar { height: 22px; }
.logo-stage--bar .avatar--logo img { max-width: 100%; max-height: none; }
.logo-facts { font-size: 0.8125rem; color: var(--ink-2); margin: 0; }
.logo-remove { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.logo-remove p { margin: 0; flex-basis: 100%; }

.popover {
  position: absolute; z-index: 40; top: calc(100% + 4px); left: 0; right: -24px;
  min-width: 15rem; padding: 6px;
  background: var(--page); border-radius: var(--r-pop); box-shadow: var(--pop-shadow);
  animation: pop-in 120ms var(--ease-out);
}
@keyframes pop-in { from { opacity: 0; translate: 0 -4px; } }
.popover-caption { padding: 6px 8px 4px; font-size: 0.75rem; font-weight: 600; color: var(--ink-3); }
.popover ul { margin: 0; padding: 0; list-style: none; }
.popover form { margin: 0; }
.popover-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  min-height: 34px; padding: 4px 8px; border: 0; border-radius: var(--r);
  background: none; color: var(--ink); text-align: left; text-decoration: none;
}
.popover-item:hover:not(:disabled) { background: var(--hover); color: var(--ink); text-decoration: none; }
.popover-item:disabled { cursor: default; }
.popover-item .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.popover-item .icon--check { color: var(--accent); }
.popover hr { border: 0; border-top: 1px solid var(--line); margin: 6px -6px; }
.popover-link { color: var(--ink-2); }

/* Navigation: file plans and their folder trees */
.sb-caption { padding: 14px 8px 4px; font-size: 0.75rem; font-weight: 600; color: var(--ink-3); }
.sb-note { padding: 4px 8px; font-size: 0.8125rem; color: var(--ink-3); }
.nav, .nav ul { margin: 0; padding: 0; list-style: none; }
.nav-row {
  display: flex; align-items: center; gap: 6px;
  min-height: 30px; padding: 3px 8px 3px calc(8px + var(--depth, 0) * 16px);
  border-radius: var(--r);
  color: var(--ink-2); text-decoration: none;
  transition: background-color 120ms var(--ease-out), color 120ms var(--ease-out);
}
.nav-row:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
.nav-row[aria-current] { background: var(--active); color: var(--ink); font-weight: 600; }
.nav-row[aria-current] > .icon { color: var(--navy); }
.nav-row .label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-row .count { flex: none; font-size: 0.75rem; color: var(--ink-3); font-weight: 400; }
.nav-row .chev { color: var(--ink-3); transition: rotate 120ms var(--ease-out); }
.nav-row.is-open .chev { rotate: 90deg; }
.nav-row .spacer { width: 16px; flex: none; }
.nav-row.unlinked .label { color: var(--ink-3); font-style: italic; }
.nav-row .only-you { flex: none; font-size: 0.6875rem; color: var(--ink-3); font-weight: 400; }
/* Under the plan list: making plans and seeing them all (US-009), quieter than the plans themselves. */
.rail-plan-links { margin-top: 2px; }
.nav-row--quiet { color: var(--ink-3); }
.nav-row--quiet .icon { width: 14px; height: 14px; }
.page-meta .only-you { font-size: 0.75rem; color: var(--ink-3); }
/* Signature: a "filed under" chip lights its folder here. */
.nav-row.lit { background: var(--sky-wash); color: var(--accent-deep); }
.nav-row.lit .count, .nav-row.lit .chev, .nav-row.lit .icon { color: var(--accent); }

/* The account menu: initials, your name and the tenant, opening down from the top bar. */
.account-menu > summary {
  display: flex; align-items: center; gap: 8px; padding: 4px 6px 4px 4px; margin-left: 4px;
  border-radius: var(--r); list-style: none; cursor: pointer; color: var(--on-brand);
  transition: background-color 120ms var(--ease-out);
}
.account-menu > summary::-webkit-details-marker { display: none; }
.account-menu > summary:hover, .account-menu[open] > summary, .account-menu > summary.is-current { background: var(--brand-hover); }
.account-menu > summary > .icon { flex: none; color: var(--on-brand-2); }
.avatar--me { width: 32px; height: 32px; border-radius: 50%; background: #fff; color: var(--brand); font-size: 0.75rem; font-weight: 700; }
.account-menu .who { min-width: 0; max-width: 12rem; line-height: 1.25; }
.account-menu .who b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-menu .who span { display: block; font-size: 0.75rem; color: var(--on-brand-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-menu .popover { color: var(--ink); }
.account-head { padding: 6px 8px 4px; line-height: 1.35; }
.account-head b { display: block; font-weight: 600; color: var(--ink); }
.account-head span { display: block; font-size: 0.75rem; color: var(--ink-3); overflow-wrap: anywhere; }
.popover-item > .icon { flex: none; color: var(--ink-3); }
.icon-btn {
  display: inline-grid; place-items: center; width: 30px; height: 30px; flex: none;
  border: 0; border-radius: var(--r); background: none; color: var(--ink-3);
}
.icon-btn:hover { background: var(--hover); color: var(--ink); }

/* Page column */
.page { min-width: 0; display: flex; flex-direction: column; background: var(--canvas); }
/* Where you are, above the page head (it was the old top bar's). */
.crumbs-bar { display: flex; align-items: center; min-height: 36px; padding: 8px 40px 0; }
.crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; min-width: 0; margin: 0; padding: 0; list-style: none; font-size: 0.875rem; }
.crumbs li { display: inline-flex; align-items: center; gap: 2px; min-width: 0; }
.crumbs li + li::before { content: "/"; padding: 0 4px; color: var(--ink-4); }
.crumbs a, .crumbs span {
  display: inline-block; padding: 2px 6px; border-radius: var(--r-tag);
  color: var(--ink-2); text-decoration: none; max-width: 16rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.crumbs a:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
.crumbs [aria-current] { color: var(--ink); }

.acting {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px;
  margin: 0 16px 4px; padding: 8px 12px;
  background: var(--red-wash); border-radius: var(--r);
  color: var(--ink); font-size: 0.8125rem;
}
.acting .icon { color: var(--red); }
.acting b { color: var(--red); font-weight: 650; }

.work { flex: 1; width: 100%; max-width: 100rem; padding: 20px 40px 96px; }
.work:focus { outline: none; }

/* ───────────── Page head, view tabs, toolbar ───────────── */

.page-head { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.page-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.page-title .icon { width: 28px; height: 28px; stroke-width: 1.3; color: var(--navy); }
.page-title h1 { font-size: 1.875rem; font-weight: 700; letter-spacing: -0.02em; }
.page-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding-left: 38px; font-size: 0.8125rem; color: var(--ink-3); }
.page-meta b { color: var(--ink); font-weight: 600; }
.levels span + span::before { content: "›"; margin: 0 5px; color: var(--ink-4); }

.view-tabs { display: flex; gap: 2px; margin: 0; padding: 0; list-style: none; border-bottom: 1px solid var(--line); }
.view-tabs a {
  display: inline-flex; align-items: center; gap: 6px;
  margin-bottom: -1px; padding: 6px 10px 8px;
  border-bottom: 2px solid transparent;
  color: var(--ink-3); font-weight: 500; text-decoration: none;
}
.view-tabs a:hover { color: var(--ink); text-decoration: none; }
.view-tabs a[aria-current] { color: var(--ink); border-bottom-color: var(--ink); }

/* Filters: compact chips; they apply on change (Apply stays for no-JS). */
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  min-height: 28px; padding: 0 4px 0 10px;
  border: 1px solid var(--line-2); border-radius: var(--r-pill);
  background: var(--page); color: var(--ink-2); font-size: 0.8125rem;
  transition: border-color 120ms var(--ease-out), background-color 120ms var(--ease-out);
}
.chip:hover { background: var(--well); }
.chip:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.chip.is-set { border-color: var(--accent); background: var(--accent-wash); color: var(--accent-deep); }
.chip > span { white-space: nowrap; }
summary.chip { list-style: none; cursor: pointer; padding-right: 8px; }
summary.chip::-webkit-details-marker { display: none; }
.chip b { font-weight: 500; color: var(--ink); max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip.is-set b { color: var(--accent-deep); }
.chip .icon--down { width: 14px; height: 14px; color: var(--ink-3); }
.filter { position: relative; }
.filter[open] > summary.chip { background: var(--hover); }
.filter-pop { right: auto; min-width: 14rem; max-height: 20rem; overflow-y: auto; }
.choice { display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 4px 8px; border-radius: var(--r); cursor: pointer; }
.choice:hover { background: var(--hover); }
.choice input { margin: 0; }
.pop-field { display: flex; flex-direction: column; gap: 4px; padding: 6px 8px; font-size: 0.8125rem; color: var(--ink-2); }
.pop-field input { height: 32px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--page); color: var(--ink); }
.pop-field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.filter-pop .btn { margin: 6px 8px 4px; }
.filters-toggle { display: none; padding-right: 10px; }
.filters-toggle .icon { width: 14px; height: 14px; }
.filters-clear { margin-left: 4px; font-size: 0.8125rem; }
/* Search results' filters sit under the search box, above the results panel. */
.search-filters { padding: 0 0 12px; border-bottom: 0; }
.chip select { field-sizing: content; }
.chip select, .chip input {
  border: 0; background: transparent; padding: 3px 6px 3px 0; min-height: 26px;
  color: var(--ink); font-size: 0.8125rem; border-radius: var(--r-pill);
}
.chip select:focus, .chip input:focus { outline: none; }
.chip input[type="text"], .chip input[type="search"] { width: 9.5rem; }
.chip input::placeholder { color: var(--ink-3); }
.chip--search { padding-left: 8px; }
.chip--search .icon { width: 14px; height: 14px; color: var(--ink-3); }
.chip--search input[type="search"] { width: 15rem; }
.js .filters-apply { display: none; }

/* ───────────── Panels: white surfaces on the canvas ───────────── */

.panel { background: var(--page); border: 1px solid var(--line); border-radius: var(--r-pop); }
.panel + .panel { margin-top: 16px; }
.view-tabs + .split, .view-tabs + .split .split-main > .panel:first-child { margin-top: 0; }
.view-tabs { margin-bottom: 14px; }
.panel-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px;
  padding: 8px 14px; border-bottom: 1px solid var(--line);
}
.panel-lead, .panel-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.panel-count { font-size: 0.8125rem; color: var(--ink-3); }
.panel-count b { color: var(--ink); font-weight: 600; }
.panel-title { font-size: 0.875rem; font-weight: 600; }
.panel-callout { margin: 12px 14px 0; }
.panel .filters { padding: 8px 14px; }
.panel .table th:first-child, .panel .table td:first-child { padding-left: 14px; }
.panel .table th:last-child, .panel .table td:last-child { padding-right: 14px; }
.panel .table tbody:last-of-type tr:last-child td { border-bottom: 0; }
.panel .table-foot { padding: 10px 14px; border-top: 1px solid var(--line); }
.panel .empty { padding: 40px 20px; }
.panel .table th { background: var(--page); }
.menu { position: relative; }
.popover-item[aria-current] { color: var(--accent-deep); font-weight: 600; }

/* Page thumbnails: a stand-in first page, drawn by document type. */
.thumb { width: 22px; height: 29px; flex: none; display: block; }
.thumb-page { fill: var(--page); stroke: var(--thumb-edge); stroke-width: 1.5; }
.thumb-ink { fill: var(--thumb-ink); }
.thumb-soft { fill: var(--thumb-soft); }
.thumb-band { fill: var(--line); }
.thumb-line { fill: none; stroke: var(--line); stroke-width: 1.25; }
.thumb-frame { fill: none; stroke: var(--line-2); stroke-width: 1.5; }
.thumb-seal { fill: none; stroke: var(--ink-4); stroke-width: 1.5; }
.table tr.is-selected td, .table tr.is-selected:hover td { background: var(--accent-wash); }
.table tr.is-selected .doc-link { color: var(--accent-deep); }

/* Side peek: one document beside the list. */
.split.has-peek { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
.split-main { min-width: 0; }
/* With the peek open, the view's own columns fold away (the peek lists every field). */
.has-peek .table .col-field, .has-peek .table td.field { display: none; }
.has-peek .table td.title { min-width: 12rem; width: auto; }
.has-peek .table .doc-meta { display: none; }
.has-peek .table td.filed-cell { width: 10.5rem; max-width: 10.5rem; }
.has-peek .table .filed { flex-wrap: nowrap; }
.has-peek .table .filed a { max-width: 8rem; }
/* One chip per row while the peek is open, with "+N" for the other filings. */
.has-peek .table .filed li:nth-child(n+2):not(.filed-more) { display: none; }
.filed-more { display: none; flex: none; padding: 1px 6px; border-radius: var(--r-tag); background: var(--hover); font-size: 0.75rem; color: var(--ink-3); }
.has-peek .table .filed-more { display: inline-block; }
/* One filter line while the peek is open: the chips fold behind "Filters". */
.js .has-peek .filters-toggle { display: inline-flex; }
.js .has-peek .filters:not(.is-open) .filter, .js .has-peek .filters:not(.is-open) .filters-clear { display: none; }
.peek {
  position: sticky; top: calc(var(--top-h) + 4px);
  max-height: calc(100dvh - var(--top-h) - 16px); overflow-y: auto;
  padding: 10px 16px 20px;
  background: var(--page); border: 1px solid var(--line); border-radius: var(--r-pop);
  animation: pop-in 120ms var(--ease-out);
}
.peek-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 -6px 10px; }
.peek-page { display: grid; justify-items: center; gap: 8px; padding: 18px 16px 12px; background: var(--canvas); border-radius: var(--r-pop); }
/* The page image opens the document, in the viewer. */
a.peek-page { color: inherit; text-decoration: none; }
a.peek-page:hover { background: var(--active); color: inherit; text-decoration: none; }
a.peek-page:hover .peek-pages { color: var(--accent-deep); }
.peek-page .thumb, .peek-page img { width: 132px; height: auto; }
.peek-pages { font-size: 0.75rem; color: var(--ink-3); }
.peek-title { margin: 16px 0 6px; font-size: 1.0625rem; font-weight: 600; line-height: 1.35; }
.peek .marks { margin: 0 0 4px; }
.props { margin: 12px 0 0; font-size: 0.8125rem; }
.props > div { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 12px; padding: 5px 0; border-bottom: 1px solid var(--line); }
.props dt { color: var(--ink-3); }
.props dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.props .names { flex-direction: column; gap: 2px; }
.props .names li + li::before { content: none; }
.peek-caption { margin: 18px 0 8px; font-size: 0.75rem; font-weight: 600; color: var(--ink-3); }
.peek-text { padding: 10px 12px; background: var(--well); border: 1px solid var(--line); border-radius: var(--r); font-size: 0.8125rem; line-height: 1.6; color: var(--ink-2); }
.peek .empty { padding: 24px 0; }

/* Recently opened */
.recent-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(max(15rem, calc(33.33% - 4px)), 1fr)); gap: 2px; margin: 0; padding: 6px; list-style: none; }
.recent-item { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 7px 8px; border-radius: var(--r); color: var(--ink); text-decoration: none; }
.recent-item:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
.recent-text { min-width: 0; line-height: 1.35; }
.recent-text b { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-text span { display: block; font-size: 0.75rem; color: var(--ink-3); }

/* ───────────── Settings: entity types and their fields ───────────── */

.page-head--actions { flex-direction: row; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 24px; }
.page-head--actions > .btn { margin-top: 6px; }
.type-meta { display: none; }
/* "Done" confirmations are neutral: the accent means selection, not success. */
.callout--done { color: var(--ink); }
.callout--done > .icon { color: var(--ink-2); }
.type-link { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 500; }
.type-link .icon { color: var(--ink-3); }
.type-link:hover { color: var(--accent-deep); text-decoration: none; }
.type-row .sub { margin-left: 24px; }

.fields-table td { vertical-align: middle; }
.fields-table .col-order { width: 1%; padding-right: 0; }
.order { display: flex; gap: 0; margin: 0; }
.icon-btn--sm { width: 24px; height: 24px; }
.icon-btn--down .icon { rotate: 180deg; }
.icon-btn--danger { color: var(--red); }
.icon-btn--danger:hover { background: var(--red-wash); color: var(--red); }
.icon-btn--danger:disabled, .icon-btn--danger:disabled:hover { background: none; color: var(--ink-3); opacity: 0.6; cursor: not-allowed; }
.btn:disabled, .icon-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.btn--quiet:disabled:hover { background: var(--page); }
.btn:not(.btn--quiet):not(.btn--danger):disabled:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.field-link { font-weight: 500; }
.kind-label { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); white-space: nowrap; }
.kind-label .icon { color: var(--ink-3); }
.flags { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.flag { display: inline-flex; align-items: center; gap: 4px; padding: 0 7px; border-radius: var(--r-tag); background: var(--hover); color: var(--ink-2); font-size: 0.75rem; font-weight: 500; line-height: 1.6; white-space: nowrap; }
.flag--quiet { background: none; color: var(--ink-3); padding-left: 0; }
.flag .icon { width: 12px; height: 12px; }
.fields-table .sub { max-width: 44ch; }

.hidden-list { margin: 0; padding: 4px 14px; list-style: none; }
.hidden-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.hidden-list li:last-child { border-bottom: 0; }
.hidden-list b { font-weight: 500; color: var(--ink); }
.hidden-list form { margin: 0; }
.hidden-actions { display: flex; gap: 6px; }

.danger-body { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding: 14px; }
.danger-text { margin-top: 2px; font-size: 0.8125rem; color: var(--ink-2); }

/* The side panel as an editor */
.peek-sub { margin: 4px 0 16px; font-size: 0.8125rem; color: var(--ink-3); }
.peek-note { margin: 0 0 14px; padding: 8px 10px; background: var(--well); border: 1px solid var(--line); border-radius: var(--r); font-size: 0.8125rem; color: var(--ink-2); }
.panel-form .form-field { margin-bottom: 16px; }
.form-field textarea, .form-field select {
  width: 100%; padding: 8px 11px;
  border: 1px solid var(--line-2); border-radius: var(--r);
  background: var(--page); color: var(--ink); font-size: 0.9375rem; line-height: 1.45;
  transition: border-color 120ms var(--ease-out), box-shadow 120ms var(--ease-out);
}
.form-field select {
  height: 38px; padding-block: 0; padding-right: 32px; appearance: none;
  background: var(--page) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%236f6e69' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4.5 6.25 3.5 3.5 3.5-3.5'/%3E%3C/svg%3E") no-repeat right 10px center / 14px;
}
.form-field textarea::placeholder { color: var(--ink-4); }
.form-field textarea { resize: vertical; }
.form-field textarea:focus, .form-field select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.form-field textarea[aria-invalid="true"], .form-field select[aria-invalid="true"] { border-color: var(--red); }
.form-field select:disabled { background-color: var(--well); color: var(--ink-2); }
.panel-form .form-field > input { height: 36px; font-size: 0.875rem; }
.panel-form .form-field textarea, .panel-form .form-field select { font-size: 0.875rem; }
.optional { font-weight: 400; font-style: italic; color: color-mix(in srgb, var(--ink-3) 55%, var(--ink-4)); margin-left: 4px; }
.field-error { margin-top: 5px; font-size: 0.8125rem; color: var(--red); }
.field-hint { margin-top: 5px; font-size: 0.8125rem; color: var(--ink-3); }
.panel-form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 16px; margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 0.875rem; }

fieldset.form-field { border: 0; padding: 0; margin: 0 0 16px; min-width: 0; }
fieldset.form-field > legend { padding: 0; margin-bottom: 6px; font-size: 0.8125rem; font-weight: 500; color: var(--ink-2); }
.kind-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.kind-option {
  position: relative; display: flex; align-items: flex-start; gap: 8px;
  padding: 8px 10px; border: 1px solid var(--line-2); border-radius: var(--r);
  cursor: pointer; transition: border-color 120ms var(--ease-out), background-color 120ms var(--ease-out);
}
.kind-option:hover { background: var(--well); }
.kind-option input { position: absolute; opacity: 0; pointer-events: none; }
.kind-option .icon { margin-top: 2px; color: var(--ink-3); }
.kind-option b { display: block; font-size: 0.8125rem; font-weight: 600; }
.kind-option small { display: block; font-size: 0.75rem; line-height: 1.35; color: var(--ink-3); }
.kind-option:has(input:checked) { border-color: var(--accent); background: var(--accent-wash); }
.kind-option:has(input:checked) .icon { color: var(--accent); }
.kind-option:has(input:checked) b { color: var(--accent-deep); }
.kind-option:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.kind-locked { padding: 10px 12px; background: var(--well); border: 1px solid var(--line); border-radius: var(--r); }
.kind-locked b { font-weight: 600; color: var(--ink); }
.kind-locked p { display: flex; gap: 6px; margin-top: 6px; font-size: 0.8125rem; color: var(--ink-2); }
.kind-locked p .icon { flex: none; width: 14px; height: 14px; margin-top: 2px; color: var(--ink-3); }
/* Choices, "points to" and the file's details a field can take show only for their type (the page works with both visible when :has is missing). */
.field-form:has(input[name="Form.Kind"]) .for-kind { display: none; }
.field-form:has(input[name="Form.Kind"][value="Text"]:checked) .for-Text,
.field-form:has(input[type="hidden"][name="Form.Kind"][value="Text"]) .for-Text,
.field-form:has(input[name="Form.Kind"][value="Number"]:checked) .for-Number,
.field-form:has(input[type="hidden"][name="Form.Kind"][value="Number"]) .for-Number,
.field-form:has(input[name="Form.Kind"][value="Date"]:checked) .for-Date,
.field-form:has(input[type="hidden"][name="Form.Kind"][value="Date"]) .for-Date,
.field-form:has(input[name="Form.Kind"][value="YesNo"]:checked) .for-YesNo,
.field-form:has(input[type="hidden"][name="Form.Kind"][value="YesNo"]) .for-YesNo,
.field-form:has(input[name="Form.Kind"][value="Select"]:checked) .for-Select,
.field-form:has(input[type="hidden"][name="Form.Kind"][value="Select"]) .for-Select,
.field-form:has(input[name="Form.Kind"][value="EntityReference"]:checked) .for-EntityReference,
.field-form:has(input[type="hidden"][name="Form.Kind"][value="EntityReference"]) .for-EntityReference,
.field-form:has(input[name="Form.Kind"][value="Location"]:checked) .for-Location,
.field-form:has(input[type="hidden"][name="Form.Kind"][value="Location"]) .for-Location { display: block; }
.checks { display: grid; gap: 4px; margin-top: 4px; }
.check { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; cursor: pointer; }
.check input { margin: 3px 0 0; width: 16px; height: 16px; flex: none; }
.check b { display: block; font-size: 0.875rem; font-weight: 600; }
.check small { display: block; font-size: 0.8125rem; color: var(--ink-3); }
.hide-field { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--line); }
.hide-field p { margin-bottom: 8px; font-size: 0.8125rem; color: var(--ink-3); }
.hide-field p.is-warning { color: var(--ink-2); }
.hide-field p.is-warning strong { color: var(--ink); font-weight: 600; }

/* Document types: access class and retention */
.field-hint--top { margin: -2px 0 8px; }
.class-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: 6px; }
.class-option {
  position: relative; display: flex; flex-direction: column; gap: 4px;
  padding: 9px 10px; border: 1px solid var(--line-2); border-radius: var(--r); cursor: pointer;
  transition: border-color 120ms var(--ease-out), background-color 120ms var(--ease-out);
}
.class-option:hover { background: var(--well); }
.class-option input { position: absolute; opacity: 0; pointer-events: none; }
.class-option b { font-size: 0.8125rem; font-weight: 600; }
.class-name { display: flex; align-items: center; gap: 8px; }
.current-mark { margin-left: auto; font-style: normal; font-size: 0.6875rem; font-weight: 600; color: var(--ink-3); }
.class-option:has(input:checked) .current-mark { color: var(--accent-deep); }
.class-option small { font-size: 0.75rem; line-height: 1.35; color: var(--ink-3); text-wrap: pretty; }
.class-option:has(input:checked) { border-color: var(--accent); background: var(--accent-wash); }
.class-option:has(input:checked) b, .class-option:has(input:checked) small { color: var(--accent-deep); }
.class-option:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
/* What the chosen class means (shown for the checked class only). */
.impact { display: none; gap: 8px; align-items: flex-start; margin-top: 10px; padding: 10px 12px; border-radius: var(--r); border: 1px solid var(--line); background: var(--well); font-size: 0.8125rem; color: var(--ink-2); }
.impact > .icon { flex: none; margin-top: 1px; color: var(--ink-3); }
.impact strong { color: var(--ink); font-weight: 600; }
/* Losing sight of documents is a consequence to confirm before saving: red, as for consequential actions. */
.impact--loss { background: var(--red-wash); border-color: var(--red-line); color: var(--ink); }
.impact--loss > .icon, .impact--loss strong { color: var(--red); }
.form-field > .confirm-loss { display: none; margin-top: 8px; }
.confirm-loss b { font-size: 0.875rem; font-weight: 500; }
.confirm-loss.is-invalid input { outline: 2px solid var(--red); outline-offset: 1px; }
.class-form:has(input[name="Details.AccessClassId"].loses:checked) .form-field > .confirm-loss, .form-field > .confirm-loss.is-invalid { display: flex; }
.check small.field-error { color: var(--red); }
/* A class change needs its reason (audited). */
.form-field > .reason-field { display: none; margin: 12px 0 0; }
.class-form:has(input[name="Details.AccessClassId"].changes:checked) .form-field > .reason-field, .form-field > .reason-field.is-invalid { display: block; }
.segmented { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; }
.segmented label { position: relative; padding: 6px 12px; font-size: 0.8125rem; color: var(--ink-2); cursor: pointer; border-left: 1px solid var(--line-2); }
.segmented label:first-child { border-left: 0; }
.segmented label:hover { background: var(--well); }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label:has(input:checked) { background: var(--accent-wash); color: var(--accent-deep); font-weight: 600; }
.segmented label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: -2px; }
.retention-amount { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; font-size: 0.875rem; color: var(--ink-2); }
.retention-amount label { margin: 0; }
.panel-form .retention-amount input { width: 4.5rem; height: 34px; }
.retention-after { white-space: nowrap; }
.hint-permanent { display: none; }
.retention:has(input[value="Permanent"]:checked) .hint-period { display: none; }
.retention:has(input[value="Permanent"]:checked) .hint-permanent { display: block; }
.retention:has(input[value="Years"]:checked) .unit-months, .retention:has(input[value="Months"]:checked) .unit-years { display: none; }
.retention:has(input[value="Permanent"]:checked) .retention-amount { display: none; }
.access-plain { color: var(--ink-2); }
.props--panel { margin: 0; padding: 2px 14px 6px; font-size: 0.875rem; }
.props--panel > div { grid-template-columns: 8rem minmax(0, 1fr); padding: 10px 0; }
.props--panel > div:last-child { border-bottom: 0; }
.props-note { display: block; margin-top: 2px; font-size: 0.8125rem; color: var(--ink-3); }

/* Platform: tenants */
a.tenant { color: var(--ink); text-decoration: none; }
a.tenant:hover { color: var(--ink); text-decoration: none; }
.platform-plain .brand-mark svg { display: block; width: 21px; height: 21px; }
.tenant-row .type-link .avatar { width: 22px; height: 22px; }
.page-meta--flush { padding-left: 0; }
.page-title .avatar--lg { width: 30px; height: 30px; font-size: 0.9375rem; }
/* A logo keeps its own width where a letter badge is a fixed square. */
.tenant-row .type-link .avatar--logo, .page-title .avatar--logo { width: auto; }
.head-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.class-list--two { grid-template-columns: 1fr 1fr; }
.people { margin: 0; padding: 4px 14px; list-style: none; }
.people li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.people li:last-child { border-bottom: 0; }
.people form { margin: 0; }
.people .tenant-text b { font-weight: 500; }
.sessions .tenant-text b { white-space: normal; }
.tenant-id { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 0.8125rem; color: var(--ink-2); }
.facts { display: grid; gap: 8px; margin: 0 0 18px; padding: 0; list-style: none; font-size: 0.8125rem; color: var(--ink-2); }
.facts li { display: flex; gap: 8px; align-items: flex-start; }
.facts .icon { flex: none; width: 14px; height: 14px; margin-top: 2px; color: var(--ink-3); }
.facts b { color: var(--ink); font-weight: 600; }
.acting form { margin: 0 0 0 auto; }
.acting-reason { display: block; margin-top: 2px; color: var(--ink-2); }
.acting .acting-leave, .look-inside .acting-leave { border-color: var(--red-line); color: var(--red); }
.acting .acting-leave:hover, .look-inside .acting-leave:hover { background: var(--page); color: var(--red); border-color: var(--red); }

/* Users and access classes */
.tab-count { font-size: 0.75rem; font-weight: 500; color: var(--ink-3); }
.person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.person-text { display: flex; flex-wrap: wrap; align-items: center; column-gap: 6px; min-width: 0; line-height: 1.35; }
.person-text .type-link { min-width: 0; }
.person-email { flex-basis: 100%; font-size: 0.8125rem; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person--head { margin-top: 12px; align-items: flex-start; }
.person--head .peek-title { display: flex; align-items: center; gap: 8px; margin: 4px 0 0; }
.table.members td.title, .has-peek .table.members td.title { width: 38%; }
.class-tags { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.class-plain { font-size: 0.8125rem; color: var(--ink); }
.class-tags .class-plain + .tag, .class-tags .tag + .class-plain { margin-left: 2px; }
.muted { color: var(--ink-3); }
.invited { display: inline-flex; align-items: center; gap: 10px; }
/* Users: one list of everyone, with a filter by status in the panel's bar (owner, 2026-10-12). */
.members-bar { flex-wrap: wrap; gap: 6px 14px; }
.members-filter { padding: 0; border-bottom: 0; }
.members-sum { margin: 0 0 0 auto; font-size: 0.8125rem; color: var(--ink-3); }
.flag--invited { background: var(--accent-wash); color: var(--accent-deep); }
.table.members tr.is-gone td { color: var(--ink-3); }
.table.members tr.is-gone .type-link, .table.members tr.is-gone .avatar { opacity: 0.7; }
.invited form { margin: 0; }
.class-list--rows { grid-template-columns: minmax(0, 1fr); }
.class-option.is-disabled { cursor: not-allowed; opacity: 0.5; }
.class-option.is-disabled:hover { background: none; }
.access-form .impact--loss { margin-top: 8px; }
.peek-more { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 0.8125rem; color: var(--ink-2); }
.peek-more p { margin: 0; }
.peek-more p + p { margin-top: 6px; }
.peek-more .peek-more-actions + p { margin-top: 14px; }
.peek-more .peek-caption { margin: 0 0 6px; }
.peek-more + .peek-more { margin-top: 16px; }
.peek-more-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.peek-more-actions form { margin: 0; }
.holder-list { margin: 0; padding: 0; list-style: none; font-size: 0.8125rem; }
.holder-list li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.holder-list li:last-child { border-bottom: 0; }
.holder-list span { color: var(--ink-3); }
.peek-count { margin: 6px 0 0; font-size: 0.75rem; color: var(--ink-3); }
.props + .peek-note { margin-top: 14px; }
.class-link { gap: 8px; }
.classes-table .type-row .sub { margin-left: 0; }
.peek-title .tag--lg { padding: 1px 8px; font-size: 0.9375rem; font-weight: 600; line-height: 1.5; }
.colour-field { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.swatches { display: flex; gap: 4px; }
.swatch { position: relative; display: inline-grid; place-items: center; width: 30px; height: 30px; border: 1px solid transparent; border-radius: var(--r); cursor: pointer; }
.swatch input { position: absolute; opacity: 0; pointer-events: none; }
.swatch-dot { display: block; width: 20px; height: 20px; padding: 0; border-radius: var(--r-tag); box-shadow: inset 0 0 0 1px rgb(15 15 15 / 0.08); }
.swatch:hover { background: var(--hover); }
.swatch:has(input:checked) { border-color: var(--accent); background: var(--accent-wash); }
.swatch:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.tag-preview { max-width: 12rem; overflow: hidden; text-overflow: ellipsis; }
.colour-field:has(input[value="Pink"]:checked) .tag-preview { background: var(--tag-pink); color: var(--tag-pink-ink); }
.colour-field:has(input[value="Green"]:checked) .tag-preview { background: var(--tag-green); color: var(--tag-green-ink); }
.colour-field:has(input[value="Blue"]:checked) .tag-preview { background: var(--tag-blue); color: var(--tag-blue-ink); }
.colour-field:has(input[value="Purple"]:checked) .tag-preview { background: var(--tag-purple); color: var(--tag-purple-ink); }
.colour-field:has(input[value="Orange"]:checked) .tag-preview { background: var(--tag-orange); color: var(--tag-orange-ink); }
.colour-field:has(input[value="Yellow"]:checked) .tag-preview { background: var(--tag-yellow); color: var(--tag-yellow-ink); }
.colour-field:has(input[value="Brown"]:checked) .tag-preview { background: var(--tag-brown); color: var(--tag-brown-ink); }
.table.classes-table td.title, .has-peek .table.classes-table td.title { width: 40%; min-width: 14rem; }
.classes-table td.num, .classes-table th.num { width: 1%; white-space: nowrap; padding-left: 20px; }
/* A held class, unticked: its "Holds" mark says what saving will do. */
.remove-mark { display: none; }
.class-option:has(input.was-held:not(:checked)) .hold-mark { display: none; }
.class-option:has(input.was-held:not(:checked)) .remove-mark { display: inline; color: var(--ink-2); }
.class-option:has(input.held:not(:checked)) .remove-mark { color: var(--red); }

/* Intake: batches, checking the cuts, separator sheets */
.head-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.empty-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.restricted-mark { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.restricted-mark .icon { width: 12px; height: 12px; }
.needs { display: block; margin-top: 3px; font-size: 0.75rem; font-weight: 600; color: var(--accent-deep); }
.needs-count { color: var(--accent-deep); }
.form-field > label.file-pick.drop, .file-pick.drop {
  display: grid; justify-items: center; gap: 4px; width: 100%; margin: 0; padding: 22px 16px;
  border: 1.5px dashed var(--line-2); border-radius: var(--r); background: var(--well); color: var(--ink-2); text-align: center; cursor: pointer;
  transition: border-color 120ms var(--ease-out), background-color 120ms var(--ease-out);
}
.file-pick.drop .icon { width: 20px; height: 20px; color: var(--ink-3); }
.file-pick.drop b { color: var(--accent); font-weight: 600; }
.file-pick.drop small { font-size: 0.75rem; color: var(--ink-3); }
.file-pick.drop:hover, .file-pick.drop.is-over { border-color: var(--accent); background: var(--accent-wash); text-decoration: none; }
.file-pick.drop.is-invalid { border-color: var(--red); }
.upload-list { display: grid; gap: 4px; }
.upload-list .file { position: relative; overflow: hidden; width: 100%; }
.file-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--line); }
.file-progress i { display: block; height: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform 120ms linear; }
.check.prefill b { font-weight: 600; }
.batch-files { margin: 0; padding: 4px 14px; list-style: none; }
.batch-files li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 0.875rem; }
.batch-files li:last-child { border-bottom: 0; }
.batch-files .icon { color: var(--ink-3); }
.batch-files small { color: var(--ink-3); font-size: 0.8125rem; }
.batch-files .is-failed small { color: var(--red); }
.batch-files .retry { margin: 0; }
/* A file that needs a password, or kept locked (owner, 2026-10-01): open it, keep it locked, or remove it. */
.batch-files .file-actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px 12px; margin-left: auto; }
.batch-files .file-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.batch-files .unlock-form { display: grid; grid-template-columns: minmax(10rem, 14rem) auto; gap: 4px 8px; align-items: center; }
.batch-files .unlock-form input[type="password"] { height: 28px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--page); font-size: 0.8125rem; }
.batch-files .unlock-form input[aria-invalid="true"] { border-color: var(--red); }
.batch-files .unlock-form .field-hint, .batch-files .unlock-form .field-error { grid-column: 1 / -1; margin: 0; }
.batch-files .is-locked small { color: var(--ink-2); }
.batch-files .is-removed { opacity: 0.6; }
.batch-files .is-removed .batch-file-name { text-decoration: line-through; }
.file-remove { position: relative; }
.file-remove > summary { list-style: none; cursor: pointer; }
.file-remove > summary::-webkit-details-marker { display: none; }
.file-remove-confirm { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: 18rem; display: grid; gap: 10px; justify-items: end; padding: 12px; background: var(--page); border-radius: var(--r-pop); box-shadow: var(--pop-shadow); }
.file-remove-confirm p { margin: 0; font-size: 0.8125rem; color: var(--ink-2); justify-self: start; }
/* A locked file's one stand-in tile. */
.pg.pg--locked { display: grid; place-items: center; align-content: center; background: var(--well, var(--active)); border-style: dashed; }
.pg--locked .icon { width: 22px; height: 22px; color: var(--ink-3); }
.batch-files .retry .file-pick { color: var(--ink); }
.cut-flow { display: grid; padding: 0 14px 6px; }
.doc-group { padding: 14px 0; border-top: 1px solid var(--line); }
.doc-group:first-child { border-top: 0; }
.doc-group--loose .doc-head h3 { color: var(--ink-3); }
.doc-group--removed .doc-head h3, .doc-group--removed .doc-sets { color: var(--ink-3); }
.doc-restore { font-size: 0.8125rem; }
.pg--gone { opacity: 0.45; }
.bpage-open.is-gone { cursor: default; }
.doc-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; margin-bottom: 10px; scroll-margin-top: calc(var(--top-h) + 12px); }
.doc-head h3 { margin: 0; font-size: 0.875rem; font-weight: 600; }
.doc-sets { font-size: 0.8125rem; color: var(--ink-2); }
.doc-head .join { margin: 0 0 0 auto; }
.bpages { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px 0; margin: 0; padding: 0; list-style: none; }
.bpage-item { display: flex; align-items: flex-start; }
.bpage { display: grid; justify-items: center; align-content: start; gap: 4px; width: 100px; font-size: 0.75rem; text-align: center; scroll-margin-top: calc(var(--top-h) + 12px); }
.page-no { color: var(--ink-3); }
.pg { position: relative; display: grid; align-content: start; gap: 5px; width: 64px; height: 86px; padding: 10px 8px; border: 1px solid var(--thumb-edge); border-radius: 2px; background: var(--page); }
.pg i { display: block; height: 2px; background: var(--thumb-soft); }
.pg i:first-child { width: 55%; background: var(--thumb-ink); }
.pg i:nth-child(3) { width: 80%; }
.pg--blank i { display: none; }
.pg--sheet { width: 36px; height: 48px; padding: 5px 4px; gap: 3px; flex: none; }
.pg--sheet i:first-child { width: 100%; height: 5px; background: var(--ink); }
.pg--sheet b { position: absolute; right: 4px; bottom: 4px; width: 11px; height: 11px; background: conic-gradient(var(--ink) 25%, transparent 0 50%, var(--ink) 0 75%, transparent 0) 0 0 / 4px 4px; }
.bpage.is-out .pg { opacity: 0.35; }
.bpage { position: relative; }
.bpage[draggable="true"] .pg { cursor: grab; }
/* A batch whose files are being read: a stand-in for each file's document, its pages pulsing one after the other
   until the real ones show (the page loads again by itself). Still under reduced motion. */
.cut-wait { margin: 0; padding: 12px 0; font-size: 0.8125rem; color: var(--ink-2); }
.doc-group--wait .doc-head h3 { font-weight: 500; color: var(--ink-2); }
.doc-group--wait .doc-sets { color: var(--ink-3); }
.pg--wait { animation: pg-wait 1.6s ease-in-out infinite; animation-delay: calc(var(--i, 0) * 140ms); }
@keyframes pg-wait { 50% { opacity: 0.4; } }
@media (prefers-reduced-motion: reduce) { .pg--wait { animation: none; } }
/* A thumbnail opens that page large in the viewer (a dialog with script, ?open= without). */
.bpage-open { display: block; border-radius: 3px; }
.bpage-open:hover .pg { border-color: var(--ink-4); }
.bpage.is-dragging { opacity: 0.4; }
/* Where a dragged page will land: an accent bar before or after the page it's over. */
.bpage.is-drop-before::before, .bpage.is-drop-after::after { content: ""; position: absolute; top: 0; width: 3px; height: 86px; border-radius: 2px; background: var(--accent); }
.bpage.is-drop-before::before { left: -8px; }
.bpage.is-drop-after::after { right: 10px; }
.bpage.is-moving { width: 17rem; grid-template-columns: 64px minmax(0, 1fr); justify-items: start; column-gap: 10px; text-align: left; }
.bpage.is-moving .bpage-open { grid-row: span 4; }
.move-form { display: grid; gap: 6px; margin: 2px 0 0; font-size: 0.75rem; color: var(--ink-2); }
.move-form select { height: 30px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--page); font: inherit; font-size: 0.8125rem; color: var(--ink); }
.move-actions { display: flex; align-items: center; gap: 12px; }
.bpage.is-flagged { width: 15rem; grid-template-columns: 64px minmax(0, 1fr); justify-items: start; column-gap: 10px; text-align: left; }
.bpage.is-flagged .bpage-open { grid-row: span 3; }
.bpage.is-flagged .pg { box-shadow: 0 0 0 2px var(--accent); }
.flag-text { display: flex; gap: 5px; align-items: flex-start; font-size: 0.75rem; line-height: 1.4; color: var(--ink-2); }
.flag-text .icon { flex: none; width: 12px; height: 12px; margin-top: 2px; color: var(--accent-deep); }
.page-action { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 10px; margin: 0; }
.link-btn { padding: 0; border: 0; background: none; font: inherit; font-size: 0.75rem; color: var(--accent); white-space: nowrap; cursor: pointer; }
.link-btn:hover { color: var(--accent-deep); text-decoration: underline; }
.cut-gap { display: flex; margin: 0; }
.cut-btn { position: relative; display: grid; place-items: center; width: 28px; height: 86px; padding: 0; border: 0; border-radius: var(--r-tag); background: none; color: var(--ink-3); cursor: pointer; }
/* On hover or focus, a dashed accent line shows where the new document would start. */
.cut-btn::before { content: ""; position: absolute; top: 2px; bottom: 2px; left: 50%; border-left: 1.5px dashed var(--line-2); }
.cut-btn .icon { position: relative; width: 16px; height: 16px; padding: 3px 0; background: var(--page); transform: rotate(90deg); }
.cut-btn:hover, .cut-btn:focus-visible { color: var(--accent); }
.cut-btn:hover::before, .cut-btn:focus-visible::before { border-left-color: var(--accent); }
.cut-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.sheet-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 0; border-top: 1px dashed var(--line-2); border-bottom: 1px dashed var(--line-2); scroll-margin-top: calc(var(--top-h) + 12px); }
.sheet-row + .doc-group { border-top: 0; }
.doc-group + .sheet-row, .sheet-row:first-child { margin-top: 0; }
.sheet-row.is-flagged { margin: 6px 0; padding: 10px; border: 0; border-radius: var(--r); box-shadow: 0 0 0 2px var(--accent); }
.sheet-row.is-ignored { opacity: 0.7; }
.sheet-text { flex: 1; min-width: 12rem; display: grid; gap: 4px; }
.sheet-text p { margin: 0; font-size: 0.8125rem; color: var(--ink-2); }
.sheet-text b { color: var(--ink); font-weight: 600; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.row-actions form { margin: 0; }
.confirm-bar { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 10px 14px; border-top: 1px solid var(--line); border-radius: 0 0 var(--r-pop) var(--r-pop); background: var(--page); font-size: 0.8125rem; color: var(--ink-2); }
.confirm-bar p, .confirm-bar form { margin: 0; }
.danger-actions { display: flex; align-items: center; gap: 16px; margin: 0; font-size: 0.875rem; }
.sheet-layout { display: grid; grid-template-columns: minmax(0, 24rem) minmax(0, 1fr); gap: 24px; align-items: start; }
.sheet-form { padding: 12px 14px 14px; }
.sheet-form .copies input { width: 6rem; }
.batches .type-row .sub { margin-left: 0; }
.sheet-preview { container-type: inline-size; display: grid; gap: 10px; max-width: 34rem; }
/* The sheet itself: sized from its width, so the preview and the A4 print are the same design. */
.sep-sheet {
  display: flex; flex-direction: column; aspect-ratio: 210 / 297; padding: 7% 8%;
  border: 1px solid var(--line-2); background: #fff; color: #111; font-size: 3.2cqi; line-height: 1.25;
}
.sep-top { display: flex; justify-content: space-between; gap: 1em; font-size: 0.55em; color: #555; }
.sep-body { display: flex; flex: 1; flex-direction: column; justify-content: center; gap: 0.7em; }
.sep-title { margin: 0; font-size: 1.1em; font-weight: 700; color: #555; }
.sep-line { margin: 0; font-size: 2.3em; font-weight: 750; letter-spacing: -0.01em; line-height: 1.08; overflow-wrap: anywhere; }
.sep-line small { display: block; margin-bottom: 0.2em; font-size: 0.3em; font-weight: 500; letter-spacing: 0; color: #555; }
.sep-line--plain { font-size: 1.1em; font-weight: 500; color: #333; }
.sep-restricted { align-self: flex-start; margin: 0.3em 0 0; padding: 0.1em 0.45em; border: 0.14em solid #111; font-size: 1.5em; font-weight: 800; letter-spacing: 0.08em; }
.sep-foot { display: flex; align-items: flex-end; gap: 1.2em; }
.sep-code { flex: none; width: 26%; fill: #111; }
.sep-how { font-size: 0.55em; color: #444; }
.sep-how p { margin: 0 0 0.5em; }
.print-sheets { margin: 0; padding: 24px; background: var(--canvas); }
.print-sheets .sep-sheet { width: min(100%, 210mm); margin: 0 auto 24px; font-size: calc(min(100vw - 48px, 210mm) * 0.032); }
.print-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; max-width: 210mm; margin: 0 auto 16px; font-size: 0.875rem; color: var(--ink-2); }
.print-bar p { margin: 0 auto 0 0; }
@media print {
  @page { size: A4; margin: 0; }
  .print-sheets { padding: 0; background: #fff; }
  .print-bar { display: none; }
  .print-sheets .sep-sheet { width: 210mm; height: 297mm; margin: 0; border: 0; font-size: calc(210mm * 0.032); break-after: page; }
}

/* Review: the queue beside the open document */
.chip-form { display: contents; }
/* Review (owner, 2026-10-12): the queue is the page until a document is open; then it folds into a bar beside the
   filters (where you are, before and after, All waiting) and the page and its form have the whole width. */
.review-layout { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.review-layout > .panel { margin: 0; }
.review-layout.has-doc > .review-list { display: none; }
.review-layout.has-doc.shows-queue > .review-list { display: block; position: absolute; z-index: 30; top: 0; right: 0; width: min(34rem, 100%); max-height: min(70vh, 40rem);
  overflow: auto; box-shadow: 0 12px 32px rgb(0 0 0 / 0.18); }
/* With a document open the line saying what Review is for gives its room to the document. */
.work:has(.review-layout.has-doc) .page-head .page-meta { display: none; }
.queue-bar { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.queue-at { font-size: 0.8125rem; color: var(--ink-2); white-space: nowrap; }
.queue-at b { color: var(--ink); }
.queue-step { padding-inline: 6px; }
.queue-step .icon, .queue-all .icon { width: 14px; height: 14px; }
.queue-step--back .icon { transform: rotate(180deg); }
.queue-step.is-off { opacity: 0.35; pointer-events: none; }
.queue-all .icon { transform: rotate(90deg); }
.queue-all[aria-expanded="true"] .icon { transform: rotate(-90deg); }
.name-box input { width: 100%; }
.name-picks { display: none; flex-wrap: wrap; gap: 4px 14px; margin: 4px 0 0; }
.js .name-picks.js-only { display: flex; }
.review-list form { margin: 0; }
.select-ready { margin: 0; padding: 8px 14px; border-bottom: 1px solid var(--line); }
.select-ready b { font-weight: 600; }
.review-items { margin: 0; padding: 0; list-style: none; }
.review-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.review-item:last-child { border-bottom: 0; }
.review-item:hover { background: var(--well); }
.review-item.is-selected { background: var(--accent-wash); }
.review-item input { flex: none; width: 16px; height: 16px; margin: 2px 0 0; }
.review-item input:disabled { opacity: 0.35; }
.review-link { display: grid; gap: 2px; min-width: 0; color: var(--ink); text-decoration: none; }
.review-link:hover { text-decoration: none; }
.review-link b { font-size: 0.875rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.review-item.is-selected .review-link b { color: var(--accent-deep); }
.review-sub, .review-meta { font-size: 0.75rem; color: var(--ink-3); }
.review-sub .conf-low, .review-sub .not-ready { color: var(--accent-deep); font-weight: 600; }
.review-head { display: grid; gap: 4px; padding: 14px 16px 12px; border-bottom: 1px solid var(--line); }
.review-head h2 { font-size: 1.0625rem; font-weight: 600; }
.review-head-meta { font-size: 0.8125rem; color: var(--ink-3); }
.review-body { display: grid; grid-template-columns: minmax(0, 3fr) minmax(20rem, 2fr); gap: 20px; padding: 16px; align-items: start; }
/* Every page of the waiting document, next to the suggestions; it stays in view while the form scrolls. */
.review-viewer { position: sticky; top: calc(var(--top-h) + 8px); min-width: 0; }
.review-form .form-field > label:not(.check), .review-form legend { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.conf { font-size: 0.75rem; font-weight: 500; color: var(--ink-3); }
.conf--low { font-weight: 600; color: var(--accent-deep); }
.conf--person { color: var(--ink-2); }
.mark { display: inline-flex; align-items: baseline; gap: 8px; }
/* JS-only: without script the ring stays until the person confirms. */
.looks-right { display: none; }
.js .looks-right { display: inline; }
.looks-right { padding: 0; border: 0; background: none; font: inherit; font-size: 0.75rem; font-weight: 600; color: var(--accent); cursor: pointer; }
.looks-right:hover { color: var(--accent-deep); text-decoration: underline; }
/* A doubtful suggestion wears the needs-you ring until the person touches it (site.js clears it). */
.is-doubtful > input, .is-doubtful > select, .review-links li.is-doubtful { box-shadow: 0 0 0 2px var(--accent); border-radius: var(--r); }
.review-links { display: grid; gap: 4px; margin: 0 0 8px; padding: 0; list-style: none; }
.review-links li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 8px; }
.review-links .check { padding: 6px 0; }
.add-link { width: 100%; }
.js .retype-btn { display: none; }
.retype-btn { margin-top: 6px; }
.review-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: 0 14px; }
.review-field--wide { grid-column: 1 / -1; }
/* A long text value keeps its line breaks wherever it's read in full. */
dd.is-long { white-space: pre-line; overflow-wrap: anywhere; }
.review-field { margin-bottom: 12px; }
.req { color: var(--ink-3); }
.review-access { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 4px 0 0; font-size: 0.8125rem; color: var(--ink-2); }
.review-access b { color: var(--ink); font-weight: 600; }
.review-access-note { flex-basis: 100%; color: var(--ink-3); }
.review-loss { display: flex; }
.review-actions { position: sticky; bottom: 0; background: var(--page); }

/* Support: tickets, the conversation, the queue */
.nav-badge { flex: none; margin-left: auto; min-width: 18px; padding: 0 5px; border-radius: var(--r-pill); background: var(--navy); color: #fff; font-size: 0.6875rem; font-weight: 600; line-height: 18px; text-align: center; }
.nav-row:has(.nav-badge) .label { flex: 1; }
/* A run still going, nothing waiting yet (US-102). */
.nav-badge--quiet { background: none; color: var(--ink-3); font-weight: 500; }
.unread-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.type-row.is-unread .type-link span:not(.sr-only) { font-weight: 650; }
.emails { margin-top: 16px; }
.emails-body { padding: 12px 14px 14px; font-size: 0.8125rem; }
.emails-body > p { margin: 0 0 10px; max-width: 72ch; color: var(--ink-2); }
.view-tabs .nav-badge { margin-left: 2px; }
.emails-form { margin: 0; }
.emails-form .check { max-width: 72ch; padding: 4px 0 0; }
.emails-body > .emails-saved { display: flex; align-items: center; gap: 6px; margin: 8px 0 0; color: var(--ink-2); }
.emails-body > .emails-saved--failed, .emails-saved--failed .icon { color: var(--red); }
.emails-saved .icon { width: 14px; height: 14px; }
.panel-title .icon { width: 14px; height: 14px; margin-right: 4px; vertical-align: -2px; color: var(--ink-3); }
.look-hint { margin: 0 0 10px; font-size: 0.8125rem; color: var(--ink-2); }
.look-actions { display: flex; gap: 8px; margin: 0 0 12px; }
.look-state { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 10px; font-size: 0.8125rem; color: var(--ink-2); }
.look-state .icon { flex: none; width: 14px; height: 14px; margin-top: 2px; color: var(--red); }
.look-state b { color: var(--red); font-weight: 600; }
.look-inside .facts { margin-bottom: 12px; }
.acting-ticket { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.entry-seen { color: var(--ink-3); }
.peek-actions { display: flex; gap: 8px; }
.status { display: inline-block; padding: 0 7px; border-radius: var(--r-tag); background: var(--hover); color: var(--ink-2); font-size: 0.75rem; font-weight: 500; line-height: 1.6; white-space: nowrap; }
.status--new, .status--open { color: var(--ink); font-weight: 600; }
.status--resolved, .status--closed { background: none; color: var(--ink-3); padding-left: 0; }
.urgent { font-weight: 600; color: var(--ink); white-space: nowrap; }
.urgent .icon { width: 13px; height: 13px; margin-right: 3px; vertical-align: -2px; }
/* In a page head the status sits on the canvas, so it takes the panel colour and a line to read as a chip. */
.page-meta .status:not(.status--resolved, .status--closed) { background: var(--page); box-shadow: inset 0 0 0 1px var(--line-2); }
.nowrap { white-space: nowrap; }
.overdue { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.overdue .icon { width: 13px; height: 13px; }
.overdue-count { color: var(--ink); }
.tickets td.title { width: 60%; }
.tickets .type-row .sub { margin-left: 0; }
.timeline { margin: 0; padding: 6px 14px 4px; list-style: none; }
.entry { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.entry:last-child { border-bottom: 0; }
.entry-body { flex: 1; min-width: 0; }
.entry-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; font-size: 0.8125rem; color: var(--ink-3); }
.entry-head b { font-size: 0.875rem; font-weight: 600; color: var(--ink); }
.entry-side { color: var(--ink-2); }
.entry-head time { margin-left: auto; white-space: nowrap; }
.entry-text { margin-top: 4px; white-space: pre-line; max-width: 72ch; }
.entry--note .entry-body { padding: 8px 10px; background: var(--well); border: 1px dashed var(--line-2); border-radius: var(--r); }
.entry-system { display: flex; gap: 10px; align-items: baseline; padding: 8px 0 8px 8px; border-bottom: 1px solid var(--line); font-size: 0.8125rem; color: var(--ink-3); }
.entry-system b { color: var(--ink-2); font-weight: 600; }
/* System lines keep their time at the right, like messages. */
.entry-system-time { flex: none; margin-left: auto; padding-left: 12px; white-space: nowrap; }
.entry-system .dot { width: 6px; height: 6px; margin: 0 8px 1px 2px; border-radius: 50%; background: var(--line-2); flex: none; }
.files { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; padding: 0; list-style: none; }
.file { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 8px; border: 1px solid var(--line); border-radius: var(--r); background: var(--page); font-size: 0.8125rem; }
.file span, .file a { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file small { color: var(--ink-3); white-space: nowrap; }
.file .icon { color: var(--ink-3); }
.refs { padding: 4px 14px 12px; }
.refs .field-hint { margin-top: 8px; }
.linkable { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; margin: 0; padding: 0; list-style: none; max-height: 16rem; overflow-y: auto; }
.check--row { align-items: center; padding: 6px 4px; border-radius: var(--r); }
.check--row:hover { background: var(--well); }
.check--row .thumb { width: 18px; height: 24px; }
.check--row span { flex: 1; min-width: 0; }
.check--row b { font-size: 0.8125rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.check--row small { font-size: 0.75rem; }
.attach { display: grid; gap: 6px; justify-items: start; padding: 8px 10px; border: 1px dashed var(--line-2); border-radius: var(--r); }
.attach .files { margin: 0; }
.files--picked { margin: 8px 0 0; }
.files[hidden] { display: none; }
.reply { padding: 12px 14px 14px; border-top: 1px solid var(--line); }
.reply .form-field { margin-bottom: 8px; }
.reply-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 12px; }
.file-pick { display: inline-flex; align-items: center; gap: 6px; margin-right: auto; font-size: 0.8125rem; color: var(--accent); cursor: pointer; }
.file-pick:hover { color: var(--accent-deep); text-decoration: underline; }
.file-pick:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
/* A picker in a form that can't be used now (a disabled fieldset) looks it, and takes no drop. */
fieldset:disabled .file-pick { opacity: 0.55; cursor: not-allowed; pointer-events: none; }
.reply-prompt { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; font-size: 0.8125rem; color: var(--ink-2); }
.reply-closed { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 12px 14px; border-top: 1px solid var(--line); background: var(--well); font-size: 0.875rem; color: var(--ink-2); }
.reply-tabs { margin: -4px 0 10px; }
.reply-tabs a { font-size: 0.8125rem; padding-bottom: 6px; }
.reply--note textarea { background: var(--well); border-style: dashed; }
.ticket-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.ticket-layout > * { min-width: 0; }
.ticket-side { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.ticket-side .panel + .panel { margin-top: 0; }
.side-forms { padding: 10px 14px 4px; }
.side-forms .form-field { margin-bottom: 12px; }
.side-forms .form-field select { height: 32px; font-size: 0.875rem; }
.queue-filters { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; margin-bottom: 14px; }
.segmented--links { margin: 0; padding: 0; list-style: none; background: var(--page); }
.segmented--links li { border-left: 1px solid var(--line-2); }
.segmented--links li:first-child { border-left: 0; }
.segmented--links a { display: block; padding: 5px 11px; font-size: 0.8125rem; color: var(--ink-2); text-decoration: none; }
.segmented--links a:hover { background: var(--well); color: var(--ink); text-decoration: none; }
.segmented--links a[aria-current] { background: var(--accent-wash); color: var(--accent-deep); font-weight: 600; }
a.chip { text-decoration: none; padding-right: 10px; }
a.chip:hover { text-decoration: none; }
.queue-tenant { margin: 0; }

/* ───────────── Buttons ───────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 32px; padding: 0 12px;
  border: 1px solid var(--accent); border-radius: var(--r);
  background: var(--accent); color: #fff;
  font-weight: 600; font-size: 0.875rem; text-decoration: none; white-space: nowrap;
  transition: background-color 120ms var(--ease-out), border-color 120ms var(--ease-out);
}
.btn:hover { background: var(--accent-deep); border-color: var(--accent-deep); color: #fff; text-decoration: none; }
.btn--quiet { background: var(--page); color: var(--ink); border-color: var(--line-2); }
.btn--quiet:hover { background: var(--hover); border-color: var(--line-2); color: var(--ink); }
.btn--block { width: 100%; min-height: 36px; }
/* Red actions, used sparingly: an irreversible delete, and suspending a tenant (it locks every member out). */
.btn--danger { background: var(--page); color: var(--red); border-color: var(--red-line); }
.btn--danger:hover { background: var(--red-wash); color: var(--red); border-color: var(--red-line); }
/* Red only when the delete can actually happen. */
.btn--danger:disabled, .btn--danger:disabled:hover { background: var(--page); color: var(--ink-3); border-color: var(--line-2); opacity: 0.7; }
.btn--danger-solid { background: var(--red); border-color: var(--red); color: #fff; }
.btn--danger-solid:hover { background: var(--red-deep); border-color: var(--red-deep); color: #fff; }
.btn--sm { min-height: 28px; padding: 0 10px; font-size: 0.8125rem; }

/* ───────────── The table ───────────── */

.table { width: 100%; border-collapse: collapse; }
.table caption { text-align: left; }
.table th {
  position: sticky; top: var(--top-h); z-index: 2;
  padding: 8px 10px; background: var(--page);
  border-bottom: 1px solid var(--line);
  text-align: left; font-size: 0.8125rem; font-weight: 500; color: var(--ink-3); white-space: nowrap;
}
.table td { padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th:first-child, .table td:first-child { padding-left: 2px; }
.table tbody tr:not(.group):hover td { background: var(--well); }
.table .num { text-align: right; }
.table .date { white-space: nowrap; color: var(--ink-2); width: 1%; }
.table .type { color: var(--ink-2); white-space: nowrap; }
.table .field { color: var(--ink-2); }
.table td.title { width: 52%; min-width: 18rem; max-width: 0; }
/* One line per document: icon, title (ellipsised), tags, then the grey number. */
.doc { display: flex; align-items: center; gap: 8px; min-width: 0; }
.doc-link { color: var(--ink); font-weight: 500; }
/* The title keeps its space first; the grey number gives way before it. */
.doc .doc-link { flex: 0 1 auto; min-width: 4rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc .marks { flex: none; margin-left: 0; }
.doc-meta { flex: 0 100 auto; min-width: 6.25em; overflow: hidden; text-overflow: ellipsis; font-size: 0.8125rem; color: var(--ink-3); white-space: nowrap; }
.doc-link:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--ink-4); }
.sub { display: block; margin-top: 1px; font-size: 0.8125rem; color: var(--ink-3); }
.type-inline { display: none; }

.group th {
  position: static; padding: 12px 2px 4px; background: none;
  border-bottom: 1px solid var(--line);
  font-size: 0.875rem; font-weight: 600; color: var(--ink);
}
.group-toggle {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 6px 2px 2px;
  border: 0; border-radius: var(--r-tag); background: none; color: inherit; font-weight: 600;
}
.group-toggle:hover { background: var(--hover); }
.group-toggle .chev { color: var(--ink-3); rotate: 90deg; transition: rotate 120ms var(--ease-out); }
.group-toggle[aria-expanded="false"] .chev { rotate: 0deg; }
.group-toggle .step + .step::before { content: "›"; margin: 0 6px; color: var(--ink-4); font-weight: 400; }
.group-head { display: inline-flex; align-items: center; gap: 6px; }
.group .count { font-weight: 400; color: var(--ink-3); }

/* Folders */
.folder-row a { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 500; }
.folder-row a:hover { text-decoration: none; color: var(--accent-deep); }
.folder-row a .icon { color: var(--ink-3); }
.folder-row.unlinked a { color: var(--ink-2); font-style: italic; }
.folder-row td.num { color: var(--ink-2); width: 1%; white-space: nowrap; }
.folder-row td.num .of { color: var(--ink-3); }

/* "Filed under" chips and linked names */
.filed, .names { display: flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 0; list-style: none; }
.filed a {
  display: inline-flex; align-items: center; gap: 4px; max-width: 16rem;
  padding: 1px 7px 1px 5px; border-radius: var(--r-tag);
  background: var(--hover); color: var(--ink-2); font-size: 0.8125rem; text-decoration: none;
  transition: background-color 120ms var(--ease-out), color 120ms var(--ease-out);
}
.filed a .icon { width: 13px; height: 13px; color: var(--ink-3); }
.filed a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filed a:hover, .filed a:focus-visible { background: var(--accent-wash); color: var(--accent-deep); text-decoration: none; }
.filed a:hover .icon, .filed a:focus-visible .icon { color: var(--accent); }
.names li { color: var(--ink-2); }
.names li + li::before { content: "·"; margin-right: 4px; color: var(--ink-4); }

/* Tags (restricted classes, legal hold) */
.marks { display: inline-flex; gap: 4px; margin-left: 6px; vertical-align: 1px; }
.tag {
  display: inline-block; padding: 0 6px; border-radius: var(--r-tag);
  font-size: 0.75rem; font-weight: 500; line-height: 1.55; white-space: nowrap;
}
.tag--pink { background: var(--tag-pink); color: var(--tag-pink-ink); }
.tag--green { background: var(--tag-green); color: var(--tag-green-ink); }
.tag--blue { background: var(--tag-blue); color: var(--tag-blue-ink); }
.tag--purple { background: var(--tag-purple); color: var(--tag-purple-ink); }
.tag--orange { background: var(--tag-orange); color: var(--tag-orange-ink); }
.tag--yellow { background: var(--tag-yellow); color: var(--tag-yellow-ink); }
.tag--brown { background: var(--tag-brown); color: var(--tag-brown-ink); }
.tag--hold { background: var(--tag-hold); color: var(--tag-hold-ink); }

.table-foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px;
  padding: 10px 2px; font-size: 0.8125rem; color: var(--ink-3);
}
.pager { display: flex; gap: 6px; }

/* ───────────── Callouts and empty states ───────────── */

.callout {
  display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap;
  padding: 12px 14px; margin-bottom: 16px;
  background: var(--well); border: 1px solid var(--line); border-radius: var(--r-pop);
  color: var(--ink-2);
}
.callout > .icon { margin-top: 2px; color: var(--ink-3); }
.callout-body { flex: 1; min-width: 12rem; }
.callout strong { color: var(--ink); font-weight: 600; }
.callout--error { background: var(--red-wash); border-color: var(--red-line); color: var(--ink); }
.callout--error > .icon, .callout--error strong { color: var(--red); }
.callout:focus { outline: none; }

.empty { padding: 48px 0 40px; max-width: 34rem; }
.empty h2 { font-size: 1.0625rem; font-weight: 600; margin-bottom: 6px; }
.empty p { color: var(--ink-2); }
.empty p + p, .empty p + .btn, .empty p + ul, .empty p + form { margin-top: 12px; }

/* ───────────── Search ───────────── */

.find { max-width: 56rem; }
.split.has-peek .find, .split.has-peek.find { max-width: none; }
.find > .panel, .find > .empty + .panel { margin-top: 16px; }
.find > .empty { padding: 28px 0 4px; }
.find-form { display: flex; gap: 8px; margin-bottom: 8px; }
.find-field { position: relative; flex: 1; }
.find-field .icon { position: absolute; left: 14px; top: 50%; translate: 0 -50%; width: 18px; height: 18px; color: var(--ink-3); pointer-events: none; }
.find-field input {
  width: 100%; height: 44px; padding: 0 14px 0 42px;
  border: 1px solid var(--line-2); border-radius: var(--r-pop);
  background: var(--page); font-size: 1rem; color: var(--ink);
  transition: border-color 120ms var(--ease-out), box-shadow 120ms var(--ease-out);
}
.find-field input::placeholder { color: var(--ink-3); }
.find-field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.find-form .btn { min-height: 44px; padding: 0 18px; border-radius: var(--r-pop); }
.find-count { margin: 16px 0 4px; font-size: 0.8125rem; color: var(--ink-3); }
.tries { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 14px 0 0; list-style: none; }
.tries a {
  display: inline-block; padding: 3px 10px; border-radius: var(--r-pill); border: 1px solid var(--line-2);
  color: var(--ink-2); font-size: 0.8125rem; text-decoration: none;
}
.tries a:hover { background: var(--hover); color: var(--ink); text-decoration: none; }

.hits { margin: 0; padding: 0; list-style: none; }
.hit { display: flex; gap: 12px; padding: 14px; border-bottom: 1px solid var(--line); }
.hit:last-child { border-bottom: 0; }
.hit > .thumb { margin-top: 2px; }
.hit.is-selected { background: var(--accent-wash); }
.hit.is-selected .doc-link { color: var(--accent-deep); }
.hit-main { flex: 1; min-width: 0; }
.hit-meta { display: flex; flex-wrap: wrap; margin-top: 2px; font-size: 0.8125rem; color: var(--ink-3); }
.hit-meta > span { white-space: nowrap; }
.hit-meta > span:not(:last-child)::after { content: "·"; margin: 0 6px; color: var(--ink-4); }
.hit-meta > span.names-inline { white-space: normal; }
.hit-main > .flag, .type-link + .flag { margin-left: 8px; vertical-align: 1px; }
.snippet { display: block; margin-top: 6px; font-size: 0.8125rem; line-height: 1.55; color: var(--ink-2); max-width: 70ch; }
.snippet mark { background: var(--sky-wash); color: var(--ink); border-radius: var(--r-tag); padding: 0 2px; box-shadow: inset 0 -1.5px 0 var(--accent); }
.found-in { display: block; margin-top: 4px; font-size: 0.75rem; color: var(--ink-3); }

/* ───────────── The gate: sign-in, sign-out, choosing a tenant ───────────── */

/* Two halves on a wide screen: the form, and a brand panel where Athena's mark is found among the documents. */
.gate-page { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 44%); }
.gate-page:not(:has(.gate-art)) { display: block; }
.gate-side { display: flex; flex-direction: column; min-height: 100dvh; min-width: 0; }
.gate-side > main { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.gate-side > main:focus { outline: none; }
/* A help article read signed out (US-034, "Help with signing in") sits in this frame too: the app's spacing around it. */
.gate-side > main:has(.help-article) { justify-content: flex-start; padding: 8px clamp(16px, 3vw, 32px) 32px; }
.gate-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 24px; padding: 16px 20px 18px; font-size: 0.75rem; color: var(--ink-3); }
.gate-art {
  position: sticky; top: 0; height: calc(100dvh - var(--uifirst-bar, 0px)); display: flex; flex-direction: column; justify-content: center; gap: 44px;
  padding: 56px clamp(40px, 6vw, 104px); background: var(--canvas); border-left: 1px solid var(--line); overflow: hidden;
}
.gate-field { display: block; width: 100%; max-width: 420px; height: auto; }
.gate-doc { fill: #e3e2de; }
.gate-doc--light { fill: #eae9e5; }
/* The one authored moment: the mark's squares light up in its order, navy to red, a beat after the page appears. */
.gate-lit { fill: var(--fill); transform-box: fill-box; transform-origin: center; animation: gate-found 560ms var(--ease-out) both; animation-delay: calc(380ms + var(--step) * 120ms); }
@keyframes gate-found { from { fill: #e3e2de; transform: scale(0.84); } }
.gate-pitch h2 { max-width: 19ch; font-size: 1.75rem; font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; color: var(--ink); text-wrap: balance; }
.gate-pitch ul { display: grid; gap: 12px; max-width: 30rem; margin: 22px 0 0; padding: 0; list-style: none; }
.gate-pitch li { display: flex; align-items: flex-start; gap: 10px; font-size: 0.9375rem; line-height: 1.45; color: var(--ink-2); }
.gate-pitch .icon { flex: none; width: 16px; height: 16px; margin-top: 3px; color: var(--ink-3); }
/* With the brand panel beside it, the form needs no mark of its own; on a phone it keeps one. */
.gate-page:has(.gate-art) .gate-mark { display: none; }
@media (max-width: 960px) {
  .gate-page { display: block; }
  .gate-art { display: none; }
  .gate-page:has(.gate-art) .gate-mark { display: block; }
}
@media (prefers-reduced-motion: reduce) { .gate-lit { animation: none; } }
.gate-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; }
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 700; font-size: 1rem; letter-spacing: -0.01em; text-decoration: none; }
.brand:hover { color: var(--ink); text-decoration: none; }
.brand svg { width: 24px; height: 24px; flex: none; }
.brand small { font-weight: 400; font-size: 0.8125rem; color: var(--ink-3); letter-spacing: 0; }
.gate-user { display: flex; align-items: center; gap: 10px; font-size: 0.8125rem; color: var(--ink-2); }
.gate-user form { margin: 0; }

.gate { width: auto; max-width: 22.5rem; margin: 40px auto 56px; padding: 0 20px; box-sizing: content-box; }
.gate--wide { max-width: 36rem; }
.gate-mark { display: block; width: 36px; height: 36px; margin-bottom: 22px; }
.gate-mark svg { display: block; width: 100%; height: 100%; }
/* The tenant's logo above "Join <tenant>" on the invitation page (US-037). */
.gate-tenant-logo { margin: 0 0 14px; }
.gate-tenant-logo img { display: block; max-height: 48px; max-width: 220px; object-fit: contain; }
.gate h1 { font-size: 1.625rem; font-weight: 700; letter-spacing: -0.02em; }
.gate-sub { margin-top: 6px; color: var(--ink-3); font-size: 0.875rem; }
.gate-sub b { font-weight: 600; color: var(--ink); white-space: nowrap; }
/* A member's linked PCs, in the Users page's panel (US-040). */
.peek-pcs { list-style: none; margin: 4px 0 8px; padding: 0; display: grid; gap: 6px; }
.peek-pcs li { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.peek-pcs span { display: grid; min-width: 0; }
.peek-pcs small { color: var(--ink-3); font-size: 0.75rem; }
/* Link a PC (US-040): the PC and its code, checked against the desktop client's. */
.gate .panel-form { margin-top: 20px; }
.link-facts { display: grid; gap: 10px; margin: 0 0 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel, var(--paper)); }
.link-facts div { display: grid; grid-template-columns: 4rem 1fr; gap: 8px; align-items: baseline; }
.link-facts dt { color: var(--ink-3); font-size: 0.8125rem; }
.link-facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.link-facts small { display: block; color: var(--ink-3); font-size: 0.75rem; margin-top: 2px; }
.link-code, .code-input { font-family: ui-monospace, "SF Mono", Consolas, monospace; letter-spacing: 0.08em; }
.link-code { font-size: 1.125rem; font-weight: 600; color: var(--ink); }
.code-input { text-transform: uppercase; font-size: 1.125rem; }
.gate-form { margin-top: 24px; }
.gate .callout { margin: 20px 0 0; }
.gate .callout + .gate-form { margin-top: 16px; }
.form-field { display: block; margin-bottom: 14px; }
.form-field > label:not(.check) { display: block; margin-bottom: 5px; font-size: 0.8125rem; font-weight: 500; color: var(--ink-2); }
.form-field > input, .reveal-field input, .retention-amount input, .mail-allow-row input {
  width: 100%; height: 38px; padding: 0 11px;
  border: 1px solid var(--line-2); border-radius: var(--r);
  background: var(--page); color: var(--ink); font-size: 0.9375rem;
  transition: border-color 120ms var(--ease-out), box-shadow 120ms var(--ease-out);
}
.form-field > input::placeholder, .reveal-field input::placeholder { color: var(--ink-4); }
.form-field > input:focus, .reveal-field input:focus, .retention-amount input:focus, .mail-allow-row input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.form-field > input[aria-invalid="true"], .reveal-field input[aria-invalid="true"], .retention-amount input[aria-invalid="true"], .mail-allow-row input[aria-invalid="true"] { border-color: var(--red); }
.form-field > input[aria-invalid="true"]:focus, .reveal-field input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px var(--red-ring); }
.form-field--code input { height: 48px; font-size: 1.375rem; letter-spacing: 0.35em; text-align: center; padding-left: calc(11px + 0.35em); }
.form-field--recovery input { height: 44px; font-size: 1.125rem; letter-spacing: 0.1em; text-align: center; text-transform: uppercase; }
.gate-alt { display: block; margin-top: 14px; text-align: center; font-size: 0.8125rem; }

/* Accepting an invitation (US-031): three steps, the authenticator's QR and key, the recovery codes. */
.js-only { display: none; }
.js .js-only { display: inline-flex; }
.gate-steps { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 16px 0 0; padding: 0; list-style: none; font-size: 0.8125rem; color: var(--ink-3); }
.gate-steps li { display: inline-flex; align-items: center; gap: 6px; }
.gate-steps .icon { width: 14px; height: 14px; color: var(--ink-2); }
.gate-steps li.is-done { color: var(--ink-2); }
.gate-steps li.is-current { color: var(--ink); font-weight: 600; }
.gate-step-n { display: inline-grid; place-items: center; width: 18px; height: 18px; border: 1px solid var(--line-2); border-radius: 50%; font-size: 0.6875rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.gate-steps li.is-current .gate-step-n { border-color: var(--navy); background: var(--navy); color: var(--page); }
.reveal-field { position: relative; }
.reveal-field input { padding-right: 64px; }
.reveal-toggle { display: none; position: absolute; top: 50%; right: 6px; transform: translateY(-50%); padding: 3px 8px; border: 0; border-radius: var(--r); background: none; font-size: 0.8125rem; color: var(--accent); cursor: pointer; }
.js .reveal-toggle { display: block; }
.reveal-toggle:hover { background: var(--hover); }
.auth-steps { margin: 0 0 20px; padding: 0; list-style: none; counter-reset: auth; font-size: 0.875rem; color: var(--ink-2); }
.auth-steps > li { position: relative; padding: 0 0 18px 30px; counter-increment: auth; }
.auth-steps > li::before { content: counter(auth); position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--well); font-size: 0.75rem; font-weight: 600; color: var(--ink-2); }
.auth-steps label { display: block; margin-bottom: 8px; color: var(--ink-2); font-weight: 400; }
.auth-steps .form-field { margin: 0; }
.auth-steps .form-field--code input { max-width: 15rem; }
.gate-form--narrow { max-width: 26rem; }
.auth-qr { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 20px; margin-top: 12px; }
.qr { display: block; width: 148px; height: 148px; border: 1px solid var(--line); border-radius: var(--r); }
.auth-key { flex: 1 1 12rem; min-width: 0; font-size: 0.8125rem; color: var(--ink-3); }
.auth-key code, .recovery-codes code { font-family: ui-monospace, "SF Mono", Consolas, monospace; color: var(--ink); }
.auth-key code { display: block; margin-top: 6px; font-size: 0.875rem; letter-spacing: 0.04em; line-height: 1.6; word-spacing: 0.2em; }
.auth-lead { font-size: 0.875rem; color: var(--ink-2); }
.recovery-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; margin: 14px 0 12px; padding: 14px 16px; list-style: none; border: 1px solid var(--line); border-radius: var(--r); background: var(--page); }
.recovery-codes code { font-size: 0.9375rem; letter-spacing: 0.06em; font-variant-numeric: tabular-nums; }
.recovery-actions { display: flex; gap: 8px; margin-bottom: 16px; }
.gate-form .check + .btn { margin-top: 12px; }
@media print {
  .gate:has(.recovery-codes) :is(.gate-mark, .gate-steps, .recovery-actions, .check, .btn, .gate-aside) { display: none !important; }
  /* My account's new codes: only the heading and the codes. */
  body:has(.me-codes) :is(.sidebar, .appbar, .crumbs-bar, .acting, .page-head, .callout, .work > .panel:not(.me-codes), .recovery-actions, .danger-text) { display: none !important; }
}
.gate-note { margin-top: 16px; font-size: 0.8125rem; color: var(--ink-3); }
/* Passkeys (US-061): "or", then the passkey button, under the password form. */
.gate-or { display: flex; align-items: center; gap: 12px; margin: 18px 0 14px; font-size: 0.75rem; color: var(--ink-4); text-transform: uppercase; letter-spacing: 0.08em; }
.gate-or::before, .gate-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.gate-passkey .gate-note { margin-top: 10px; text-align: center; }
.gate-passkey .gate-note.is-error { color: var(--red); }
.gate-aside { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 0.8125rem; color: var(--ink-3); }
.gate-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 24px; font-size: 0.875rem; }

/* Tenant list (the workspace list) */
.gate-caption { margin: 28px 0 8px; font-size: 0.8125rem; font-weight: 600; color: var(--ink-3); }
.gate .callout + .tenants { margin-top: 12px; }
.gate-warn { display: flex; align-items: baseline; gap: 8px; margin: -2px 0 10px; font-size: 0.8125rem; color: var(--ink-2); }
.tenants { margin: 0; padding: 4px; list-style: none; border: 1px solid var(--line); border-radius: var(--r-pop); }
.tenants form { margin: 0; }
.tenant {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 10px 10px; border: 0; border-radius: var(--r);
  background: none; color: var(--ink); text-align: left;
  transition: background-color 120ms var(--ease-out);
}
.tenant:hover { background: var(--hover); }
.tenant-text { flex: 1; min-width: 0; line-height: 1.35; }
.tenant-text b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tenant-text span { display: block; font-size: 0.8125rem; color: var(--ink-3); }
.tenant-state { flex: none; font-size: 0.8125rem; color: var(--ink-3); }
.tenant[aria-current] .tenant-state { color: var(--accent); display: inline-flex; align-items: center; gap: 4px; font-weight: 500; }
.tenant .go { color: var(--ink-4); }
.tenant:hover .go { color: var(--ink-2); }

/* ───────────── Narrow screens ───────────── */

@media (max-width: 1180px) {
  .work { padding-inline: 24px; }
  .split.has-peek { display: block; }
  .peek {
    position: fixed; inset: 0 0 0 auto; z-index: 55; width: min(400px, 100vw);
    max-height: none; border-radius: 0; border-width: 0 0 0 1px; box-shadow: var(--pop-shadow);
  }
  /* The drawer covers the page: a scrim behind it; the page underneath is inert (site.js). */
  .split.has-peek::before { content: ""; position: fixed; inset: 0; z-index: 54; background: rgb(15 15 15 / 0.22); }
  .table .col-type { display: none; }
  .table .type-inline { display: inline; }
}

/* The page viewer (US-016): one page at a time on the canvas, a thumbnail strip, the scanned text beside it.
   Without script (no .is-paged) every page shows, one under another, with its text; the controls hide. */
.viewer { container: viewer / inline-size; display: grid; min-width: 0; background: var(--canvas); border-radius: var(--r-pop); --v-scale: 1; --v-rot: 0deg; --v-chrome: 15rem; }
.viewer:focus { outline: none; }
.viewer-bar { display: none; align-items: center; flex-wrap: wrap; gap: 2px; padding: 6px 8px; border-bottom: 1px solid var(--line-2); }
.viewer.is-paged .viewer-bar { display: flex; }
.viewer-prev .icon { transform: rotate(180deg); }
.viewer-bar .icon-btn:disabled { opacity: 0.35; cursor: default; background: none; }
.viewer-count { min-width: 6.5rem; text-align: center; font-size: 0.8125rem; color: var(--ink-2); white-space: nowrap; }
.viewer-sep { width: 1px; height: 18px; margin: 0 6px; background: var(--line-2); }
.viewer-zoom { height: 30px; padding: 0 6px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--page); font-size: 0.8125rem; }
.viewer-text-btn { padding: 4px 6px; font-size: 0.8125rem; }
.viewer-text-btn[aria-expanded="true"] { color: var(--accent-deep); font-weight: 600; }
.viewer-find { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; height: 30px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--page); color: var(--ink-3); }
.viewer-find:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.viewer-find input { width: 10rem; min-width: 0; border: 0; outline: 0; background: none; font-size: 0.8125rem; color: var(--ink); }
.viewer-hits { font-size: 0.75rem; color: var(--ink-3); }
.viewer-hits:empty { display: none; }

.viewer-stage { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 20px; min-width: 0; padding: 20px; overflow-x: auto; }
.viewer.is-paged .viewer-page:not(.is-current) { display: none; }
.viewer-page { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "sheet" "cap" "side"; gap: 8px; margin: 0; min-width: 0; }
.viewer-sheet-wrap { grid-area: sheet; position: relative; width: min(100%, 52rem); margin-inline: auto; aspect-ratio: 210 / 297; }
.viewer[data-side] .viewer-sheet-wrap { aspect-ratio: 297 / 210; width: min(100%, 64rem); }
.viewer-sheet {
  position: absolute; top: 50%; left: 50%; width: 100%; aspect-ratio: 210 / 297;
  translate: -50% -50%; rotate: var(--v-rot); transition: rotate 160ms var(--ease-out);
  background: var(--page); box-shadow: 0 0 0 1px var(--thumb-edge), 0 2px 6px rgb(15 15 15 / 0.06);
}
.viewer[data-side] .viewer-sheet { width: calc(100% * 210 / 297); }
.viewer-img { object-fit: contain; }
/* Fit the page: the whole sheet in view. */
.viewer[data-zoom="page"] .viewer-sheet-wrap { width: min(100%, calc((100dvh - var(--v-chrome)) * 210 / 297)); }
.viewer[data-zoom="page"][data-side] .viewer-sheet-wrap { width: min(100%, calc((100dvh - var(--v-chrome)) * 297 / 210)); }
/* Zoomed: wider than the stage, which scrolls and can be dragged. */
.viewer[data-zoom="scale"] .viewer-stage { max-height: calc(100dvh - 12rem); overflow: auto; cursor: grab; }
.viewer[data-zoom="scale"] .viewer-stage.is-dragging, .viewer-stage.is-dragging { cursor: grabbing; user-select: none; }
.viewer-stage .viewer-img { cursor: grab; -webkit-user-drag: none; }
.viewer[data-zoom="scale"] .viewer-sheet-wrap { width: calc(100% * var(--v-scale)); max-width: none; }
.viewer[data-zoom="scale"] .viewer-page { justify-items: start; }

/* The drawn stand-in page, until a render exists. */
.vpage { container-type: inline-size; overflow: hidden; }
.vpage-body { position: absolute; inset: 0; display: grid; align-content: start; gap: 2.6cqi; padding: 12cqi 11cqi; }
.vpage i { display: block; height: max(2px, 0.9cqi); background: var(--thumb-soft); border-radius: 1px; }
.vpage i:nth-child(1) { width: 42%; height: max(3px, 1.6cqi); background: var(--thumb-ink); }
.vpage i:nth-child(2) { width: 26%; margin-bottom: 5cqi; }
.vpage i:nth-child(5n + 4) { width: 92%; }
.vpage i:nth-child(6) { width: 64%; margin-bottom: 3cqi; }
.vpage i:nth-child(11) { width: 58%; }
.vpage i:nth-child(12) { width: 30%; margin-top: 8cqi; background: var(--thumb-ink); }
.vpage--sheet b { display: block; width: 100%; height: 7cqi; background: var(--ink); }
.vpage--sheet i { width: 60%; margin-top: 3cqi; }
.vpage--sheet i:nth-child(2) { width: 60%; height: max(3px, 2cqi); margin-top: 8cqi; background: var(--thumb-ink); }
.vpage--sheet em { position: absolute; right: 11cqi; bottom: 11cqi; width: 26cqi; aspect-ratio: 1; background: conic-gradient(var(--ink) 25%, transparent 0 50%, var(--ink) 0 75%, transparent 0) 0 0 / 5cqi 5cqi; }
.viewer-page.is-failed .viewer-sheet { visibility: hidden; }
.viewer-failed { position: absolute; inset: 0; display: grid; place-content: center; gap: 4px; padding: 16px; text-align: center; font-size: 0.8125rem; color: var(--ink-2); background: var(--well); box-shadow: inset 0 0 0 1px var(--line-2); }
.viewer-failed[hidden] { display: none; }

.viewer-caption { grid-area: cap; display: flex; justify-content: center; flex-wrap: wrap; gap: 2px 10px; font-size: 0.75rem; color: var(--ink-3); }
.viewer-caption span + span { color: var(--ink-2); }
.viewer-caption span + span::before { content: "·"; margin-right: 10px; color: var(--ink-4); }
.viewer-side { grid-area: side; display: grid; align-content: start; gap: 12px; min-width: 0; }
.viewer-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.viewer-text { display: none; scroll-margin-top: calc(var(--top-h) + 12px); padding: 12px 14px; background: var(--page); border: 1px solid var(--line); border-radius: var(--r); }
.viewer:not(.is-paged) .viewer-text, .viewer.show-text .viewer-text { display: block; }
.viewer-text-head { margin-bottom: 6px; font-size: 0.75rem; font-weight: 600; color: var(--ink-3); }
.viewer-text p { white-space: pre-wrap; font-size: 0.8125rem; line-height: 1.6; color: var(--ink-2); max-width: 70ch; }
.viewer-text mark { background: var(--sky-wash); color: var(--ink); border-radius: var(--r-tag); padding: 0 2px; box-shadow: inset 0 -1.5px 0 var(--accent); }
.viewer.is-paged:not(.show-text) .viewer-page:not(:has(.viewer-actions)) .viewer-side { display: none; }
/* A narrow viewer (review's column, a phone): one row of controls, find below; zoom stays on + and −. */
@container viewer (max-width: 30rem) {
  .viewer-zoom, .viewer-sep { display: none; }
  .viewer-count { min-width: 0; padding: 0 4px; }
  .viewer-find { flex: 1 1 8rem; margin: 0 0 0 4px; }
  .viewer-find input { width: 100%; }
  .viewer-stage { padding: 12px; }
}
/* Room for the text beside the sheet, and for the page's actions when the page is fitted to the window. Fitted to the
   width (the default; owner, 2026-10-12), the page takes all of it and its actions sit under it. */
@container viewer (min-width: 44rem) {
  .viewer.show-text .viewer-page, .viewer[data-zoom="page"] .viewer-page:has(.viewer-actions) { grid-template-columns: minmax(0, 1fr) 18rem; grid-template-areas: "sheet side" "cap side"; align-items: start; column-gap: 20px; }
  .viewer.show-text .viewer-text { position: sticky; top: 0; max-height: calc(100dvh - 12rem); overflow: auto; }
  .viewer.show-text .viewer-page:has(.viewer-actions) .viewer-actions, .viewer[data-zoom="page"] .viewer-page:has(.viewer-actions) .viewer-actions { justify-content: flex-start; }
  /* Fitting the page, the sheet and its side sit together in the middle. */
  .viewer[data-zoom="page"].show-text .viewer-page, .viewer[data-zoom="page"] .viewer-page:has(.viewer-actions) { grid-template-columns: auto 18rem; justify-content: center; }
  .viewer[data-zoom="page"].show-text .viewer-sheet-wrap, .viewer[data-zoom="page"] .viewer-page:has(.viewer-actions) .viewer-sheet-wrap { width: min(calc(100cqi - 18rem - 60px), calc((100dvh - var(--v-chrome)) * 210 / 297)); }
  .viewer[data-zoom="page"][data-side].show-text .viewer-sheet-wrap, .viewer[data-zoom="page"][data-side] .viewer-page:has(.viewer-actions) .viewer-sheet-wrap { width: min(calc(100cqi - 18rem - 60px), calc((100dvh - var(--v-chrome)) * 297 / 210)); }
}

.viewer-strip { display: none; gap: 6px; margin: 0; padding: 8px 12px 10px; overflow-x: auto; list-style: none; border-top: 1px solid var(--line-2); }
.viewer.is-paged .viewer-strip { display: flex; }
.viewer-thumb { display: grid; justify-items: center; gap: 4px; padding: 5px 6px 3px; border: 0; border-radius: var(--r); background: none; font-size: 0.6875rem; color: var(--ink-3); }
.viewer-thumb:hover { background: var(--hover); }
.viewer-thumb .pg { width: 38px; height: 52px; padding: 6px 5px; gap: 3px; }
.viewer-thumb .pg--sheet { width: 38px; height: 52px; }
.viewer-thumb.is-current { background: var(--accent-wash); color: var(--accent-deep); font-weight: 600; }
.viewer-thumb.is-current .pg { border-color: var(--accent); }

/* Opened over another screen (intake): a dialog; Esc closes it. */
.viewer-dialog { width: min(76rem, calc(100vw - 32px)); height: calc(100dvh - 32px); max-height: none; padding: 0; overflow: hidden; border: 0; border-radius: var(--r-pop); background: var(--page); color: var(--ink); box-shadow: var(--pop-shadow); }
.viewer-dialog::backdrop { background: rgb(15 15 15 / 0.4); }
.viewer-dialog-head { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 18px; border-bottom: 1px solid var(--line); }
.viewer-dialog-head h2 { flex: 1; min-width: 0; font-size: 0.9375rem; font-weight: 600; }
.viewer-dialog-head form { margin: 0; }
.viewer-dialog[open] { display: flex; flex-direction: column; }
.viewer-dialog .viewer { flex: 1; min-height: 0; grid-template-rows: auto minmax(0, 1fr) auto; border-radius: 0; --v-chrome: 19rem; }
.viewer-dialog .viewer-stage, .viewer-dialog .viewer[data-zoom="scale"] .viewer-stage { max-height: none; overflow: auto; }
/* Without script the dialog is open but not modal: pin it over the page all the same. */
.viewer-dialog[open]:not(:modal) { position: fixed; inset: 16px; z-index: 70; margin: auto; }
.viewer-page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.viewer-page-actions form { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.viewer-page-actions .flag-text { flex-basis: 100%; font-size: 0.8125rem; }

/* A document's own page: its pages in the viewer, its details beside them (US-016). */
.doc-head-bar { justify-content: space-between; }
.doc-heading { display: grid; gap: 6px; min-width: 0; }
.doc-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.doc-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(18rem, 23rem); gap: 16px; align-items: start; }
.doc-pages { min-width: 0; }
/* A text file being written (US-069): the editor takes the page's width; the details come back when it's saved. */
.doc-layout.is-writing { grid-template-columns: minmax(0, 1fr); }
.doc-layout.is-writing > .doc-side { display: none; }
.doc-layout.is-writing .textfile { overflow: visible; }
.doc-layout.is-writing .text-editor { border: 0; border-radius: 0; }
/* Fitting the page leaves room for the head and actions above it, so the strip shows there are more pages. */
.doc-pages .viewer { --v-chrome: 24rem; }
/* One column held to the side's width: a panel's wide table (a type's lines) scrolls inside it instead of widening every panel
   past the page (owner, 2026-11-19: the page scrolled sideways). */
.doc-side { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; }
.doc-side > .panel { margin: 0; }
.doc-props { margin: 0; padding: 2px 14px 6px; }
.doc-props > div:last-child { border-bottom: 0; }
.doc-props small { font-size: 0.75rem; color: var(--ink-3); }
.doc-panel-note { padding: 12px 14px; font-size: 0.8125rem; color: var(--ink-3); }
.doc-filed { display: grid; gap: 12px; margin: 0; padding: 12px 14px; list-style: none; }
.doc-filed-view { display: block; margin-bottom: 4px; font-size: 0.75rem; font-weight: 600; color: var(--ink-3); }
.doc-versions { margin: 0; padding: 4px; list-style: none; }
.doc-versions a { display: grid; gap: 1px; padding: 8px 10px; border-radius: var(--r); font-size: 0.8125rem; color: var(--ink); text-decoration: none; }
.doc-versions a:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
.doc-versions .is-selected a { background: var(--accent-wash); }
.doc-versions b { font-weight: 600; }
.doc-versions .is-selected b { color: var(--accent-deep); }
.doc-current { font-weight: 400; color: var(--ink-3); }
.doc-versions span { color: var(--ink-2); }
.doc-versions small { font-size: 0.75rem; color: var(--ink-3); }
.doc-edit-body { padding: 14px; }
.doc-links { margin: 0 0 8px; padding: 0; list-style: none; }
.doc-links .check { padding: 4px 0; }
/* My account (US-033): rows of the person's sign-in, the change forms above them, recent sign-ins. */
.me-change, .me-codes { margin-bottom: 16px; }
.me-form { padding: 14px; }
.me-form .panel-title { margin-bottom: 4px; }
.me-form .danger-text { margin-bottom: 12px; max-width: 44rem; }
.me-form .form-field { max-width: 26rem; }
.me-code input { max-width: 15rem; }
.me-codes .recovery-codes { max-width: 26rem; }
.me-done { margin-left: auto; }
.me-rows { margin: 0; padding: 0; list-style: none; }
.me-rows li { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 12px 14px; }
.me-rows li + li { border-top: 1px solid var(--line); }
.me-rows li > div { min-width: 0; }
/* A choice and its Save on one row (US-103). */
.me-choice { display: flex; flex: none; align-items: center; gap: 8px; }
.me-choice select { max-width: 100%; }
@media (max-width: 640px) { .me-rows li:has(.me-choice) { flex-wrap: wrap; } .me-choice { flex: 1 1 100%; } }
.me-rows b { display: block; font-size: 0.875rem; font-weight: 600; }
.me-rows b .flag { display: inline-flex; margin-left: 8px; vertical-align: 1px; font-weight: 500; }
.me-rows span { display: block; margin-top: 2px; font-size: 0.8125rem; color: var(--ink-3); }
.me-rows .me-low { display: inline; font-weight: 600; color: var(--accent-deep); }
/* Passkeys (US-061): the add form under its heading, and a row's Rename and Remove (or its rename field). */
.me-form-head { padding: 14px 14px 0; }
.me-form-head .panel-title { margin-bottom: 4px; }
.me-form-head .danger-text { max-width: 44rem; }
.me-form-head + .me-form { padding-top: 12px; }
.gate-passkey[hidden], .passkey-add /* Check out… on a file plan's folder or a workspace (US-090, US-091): the figures under the question. */
.checkout-figures { margin: 6px 0 0; padding-left: 18px; color: var(--ink-2, #555); font-size: 13px; }
.checkout-figures li { margin: 2px 0; }
.checkout-figures li.checkout-size--big { color: #b06a12; font-weight: 600; }

.checkout-from { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; }

/* Pictures, sound and video (US-092): the Grid's tiles, the List's mark, the page's player and the viewer. */
.tile--media .tile-art .media-thumb { position: relative; display: grid; place-items: center; width: 100%; height: 100%; border-radius: 3px; overflow: hidden; }
.media-thumb--video { background: #1f1f1d; color: #fff; }
.media-thumb--sound { background: var(--accent-wash); color: var(--accent-deep); }
.media-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.85; border: 0 !important; box-shadow: none !important; }
.media-thumb .icon { position: relative; width: 38%; height: 38%; stroke-width: 1.2; }
.media-length { position: absolute; right: 6px; bottom: 6px; padding: 1px 6px; border-radius: 4px; background: rgb(0 0 0 / 0.66); color: #fff; font-size: 0.75rem; font-variant-numeric: tabular-nums; }
.media-thumb--sound .media-length { background: var(--accent-deep); }
.media-mark { display: inline-flex; margin-right: 5px; color: var(--accent); vertical-align: -2px; }
.media-mark .icon { width: 14px; height: 14px; }

.mediafile { background: var(--page); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.mediafile-stage { display: grid; place-items: center; gap: 14px; padding: 18px; background: var(--well); }
.mediafile-stage.is-video { background: #111; padding: 0; }
.mediafile-stage video { display: block; width: 100%; max-height: 70vh; background: #000; }
.mediafile-stage audio { width: min(520px, 100%); }
.mediafile-icon .icon { width: 56px; height: 56px; color: var(--accent); stroke-width: 1.1; }

/* Live Photos (US-097): the badge on the photo's tile and beside its title, the clip over the tile while it plays, the
   keyboard's button, and the line on its page. Playing copies (US-096): the page's player while one is being made. */
.tile--media .tile-art { position: relative; }
.live-badge { display: inline-flex; align-items: center; gap: 3px; padding: 1px 6px; border-radius: 4px; background: rgb(255 255 255 / 0.9); color: #1f1f1d; font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.02em; line-height: 1.4; vertical-align: 1px; }
.live-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid currentColor; box-shadow: 0 0 0 1.5px rgb(255 255 255 / 0.9), 0 0 0 2.5px currentColor; }
.tile-art > .live-badge { position: absolute; left: 6px; top: 6px; z-index: 1; box-shadow: 0 1px 2px rgb(0 0 0 / 0.25); }
.doc-link + .live-badge { margin-left: 6px; background: var(--well); color: var(--ink-2, #555); }
.live-clip { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 3px; background: #000; }
li:has(> .live-play) { position: relative; }
.live-play { position: absolute; left: 50%; top: 36%; transform: translate(-50%, -50%); padding: 4px 10px; border: 0; border-radius: 999px; background: rgb(0 0 0 / 0.72); color: #fff; font: inherit; font-size: 0.75rem; cursor: pointer; opacity: 0; pointer-events: none; }
li:focus-within > .live-play { opacity: 1; pointer-events: auto; }
.live-play:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; }
.livephoto-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 0 0 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--page); font-size: 0.875rem; }
.livephoto-bar .live-badge { background: var(--well); }
.livephoto-bar small { color: var(--ink-2, #555); margin-left: 4px; }
.livephoto-bar .btn { margin-left: auto; }
.mediafile-wait { display: grid; justify-items: center; gap: 12px; min-height: 220px; align-content: center; padding: 24px; color: #e4e3df; text-align: center; }
.mediafile-wait p { margin: 0; }
.mv-making .mv-frame { max-width: min(640px, 80vw); max-height: 50vh; border-radius: 6px; opacity: 0.55; }
.mv-live-clip { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: rgb(14 14 13 / 0.96); }

html.mv-open { overflow: hidden; }
.mv { position: fixed; inset: 0; z-index: 1000; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; background: rgb(14 14 13 / 0.96); color: #f3f3f1; }
.mv:focus { outline: none; }
.mv-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 14px 10px 20px; }
.mv-what { min-width: 0; }
.mv-title { margin: 0; font-size: 1rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mv-meta { margin: 2px 0 0; color: #b8b7b2; font-size: 0.8125rem; }
.mv-tools { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.mv-zoom { display: inline-flex; gap: 2px; margin-right: 8px; padding-right: 8px; border-right: 1px solid rgb(255 255 255 / 0.16); }
.mv-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 36px; height: 36px; padding: 0 8px; border: 0; border-radius: 6px; background: transparent; color: inherit; font: inherit; font-size: 0.875rem; cursor: pointer; text-decoration: none; }
.mv-btn:hover { background: rgb(255 255 255 / 0.1); }
.mv-btn:focus-visible { outline: 2px solid var(--sky); outline-offset: 1px; }
.mv-btn[aria-pressed="true"] { background: rgb(255 255 255 / 0.18); }
.mv-btn .icon { width: 18px; height: 18px; }
.mv-body { position: relative; display: grid; grid-template-columns: 56px minmax(0, 1fr) 56px; align-items: center; min-height: 0; }
.mv--info .mv-body { grid-template-columns: 56px minmax(0, 1fr) 56px 280px; }
.mv-stage { position: relative; display: grid; place-items: center; height: 100%; min-height: 0; overflow: hidden; touch-action: pan-y; }
.mv-nav { width: 44px; height: 64px; justify-self: center; }
.mv-nav .icon { width: 26px; height: 26px; }
.mv-nav:disabled { opacity: 0.25; cursor: default; }
.mv-picture { position: absolute; left: 50%; top: 50%; max-width: none; transform-origin: center; user-select: none; cursor: zoom-in; }
.mv-picture.is-zoomed { cursor: grab; }
.mv-video { max-width: 100%; max-height: 100%; background: #000; }
.mv-sound { display: grid; justify-items: center; gap: 16px; text-align: center; }
.mv-sound .icon { width: 72px; height: 72px; color: var(--sky); stroke-width: 1; }
.mv-sound p { margin: 0; font-size: 1rem; }
.mv-sound audio { width: min(520px, 80vw); }
.mv-trouble { display: grid; justify-items: center; gap: 12px; text-align: center; color: #e4e3df; }
.mv-trouble p { margin: 0; }
.mv-info { display: none; align-self: stretch; padding: 16px 20px; background: rgb(255 255 255 / 0.06); overflow: auto; font-size: 0.875rem; }
.mv--info .mv-info { display: block; }
.mv-info dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0 0 14px; }
.mv-info dt { color: #b8b7b2; }
.mv-info dd { margin: 0; }
.mv-info-open { color: var(--sky); }
.mv-foot { padding: 8px 20px 12px; text-align: center; color: #b8b7b2; font-size: 0.8125rem; font-variant-numeric: tabular-nums; }
/* Casting to a TV (US-136). */
.mv-btn[data-cast].is-casting { color: var(--sky); }
.mv-cast { display: flex; align-items: center; gap: 12px; margin: 0 auto 8px; max-width: 720px; padding: 8px 8px 8px 14px; border-radius: 8px; background: rgb(255 255 255 / 0.08); color: #f3f3f1; text-align: left; }
.mv-cast[hidden] { display: none; }
.mv-cast .icon { width: 18px; height: 18px; color: var(--sky); flex-shrink: 0; }
.mv-cast-what { flex: 1; min-width: 0; }
.mv-cast-what strong { font-weight: 600; }
.mv-cast-note, .mv-cast-hint { display: block; color: #b8b7b2; }
.mv-cast-note:empty, .mv-cast-hint:empty { display: none; }
.mv-cast .btn { flex-shrink: 0; }
.mv-remote { display: grid; justify-items: center; gap: 14px; text-align: center; }
.mv-remote .mv-frame { max-width: min(640px, 80vw); max-height: 45vh; border-radius: 6px; opacity: 0.45; }
.mv-remote > .icon { width: 72px; height: 72px; color: var(--sky); stroke-width: 1; }
.mv-remote p { margin: 0; }
.mv-remote-controls { display: flex; align-items: center; gap: 10px; width: min(520px, 80vw); font-variant-numeric: tabular-nums; font-size: 0.8125rem; color: #b8b7b2; }
.mv-remote-controls input[type="range"] { flex: 1; accent-color: var(--sky); }
.mv-remote-controls .btn { min-width: 5.5em; justify-content: center; }
.mv-demo-tv { position: absolute; right: 16px; bottom: 16px; z-index: 2; width: min(320px, 40vw); border: 1px solid rgb(255 255 255 / 0.25); border-radius: 8px; background: #000; overflow: hidden; box-shadow: 0 8px 24px rgb(0 0 0 / 0.5); }
.mv-demo-tv-name { margin: 0; padding: 4px 8px; background: rgb(255 255 255 / 0.1); font-size: 0.75rem; color: #e4e3df; }
.mv-demo-tv-screen { display: grid; place-items: center; aspect-ratio: 16 / 9; }
.mv-demo-tv-screen img, .mv-demo-tv-screen video { max-width: 100%; max-height: 100%; object-fit: contain; }
.mv-demo-tv-screen p { margin: 0; padding: 8px; color: #b8b7b2; font-size: 0.75rem; text-align: center; }
@media (max-width: 720px) {
  .mv-body, .mv--info .mv-body { grid-template-columns: minmax(0, 1fr); }
  .mv-nav { position: absolute; top: 50%; z-index: 1; transform: translateY(-50%); background: rgb(0 0 0 / 0.35); }
  .mv-nav--prev { left: 6px; } .mv-nav--next { right: 6px; }
  .mv-info { position: absolute; inset: auto 0 0 0; max-height: 50%; background: #1d1d1b; }
  .mv-zoom, .mv-btn--text span { display: none; }
}

/* Workspaces (US-091). */
.panel-note { margin: 0; padding: 10px 16px; color: var(--ink-2); font-size: 0.875rem; }
.plan-icon { display: grid; place-items: center; width: 32px; height: 32px; flex-shrink: 0; border-radius: 6px; background: var(--accent-wash); color: var(--accent-deep); }
.plan-icon .icon { width: 18px; height: 18px; }
.plan-row-desc { display: block; margin-top: 2px; color: var(--ink-3); font-size: 0.8125rem; }
.ws-desc { margin: 6px 0 0; max-width: 70ch; color: var(--ink-2); }
.ws-people { margin: 0; padding: 0 16px 8px; list-style: none; }
.ws-people li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.ws-people li:first-child { border-top: 0; }
.ws-people form { display: flex; gap: 6px; }
.ws-person { display: grid; flex: 1; min-width: 0; }
.ws-person small { color: var(--ink-3); }
.ws-role select { min-width: 120px; }
.ws-find { padding: 12px 16px; border-top: 1px solid var(--line); }
.ws-find label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 0.875rem; }
.input-row { display: flex; gap: 8px; }
.input-row input { flex: 1; min-width: 0; }
.ws-pick { margin: 0; padding: 0 16px; list-style: none; }
.ws-pick li { border-top: 1px solid var(--line); }
.ws-pick label { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; cursor: pointer; }
.ws-pick label span { display: grid; }
.ws-pick small { color: var(--ink-3); }
.ws-pick + .form-actions, .ws-pick ~ .form-actions { padding: 10px 16px 14px; }
.cell-sub { display: block; color: var(--ink-3); font-size: 0.75rem; }

.choice-list { margin: 0 0 10px; padding: 0; border: 0; display: grid; gap: 2px; }
.choice-list .choice small { color: var(--ink-3); margin-left: 4px; }
.choice-sub { margin: 4px 0 0 30px; }

[hidden] { display: none !important; }
.passkey-add .passkey-status { margin: 0 0 12px; max-width: 26rem; }
.passkey-add > .callout { margin: 0 0 12px; max-width: 44rem; }
.passkey-add > .field-hint { max-width: 26rem; margin: -4px 0 14px; }
/* The offer after a password sign-in (US-061): the callout with its two actions; hidden until script says the device can. */
.passkey-offer[hidden] { display: none !important; }
.passkey-offer { margin-bottom: 16px; }
.passkey-offer-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.guest-passkeys .me-rows { margin-top: 12px; border-top: 1px solid var(--line); }
.guest-passkeys-add { padding: 12px 14px 14px; }
.me-row-actions { display: flex; flex-shrink: 0; gap: 8px; }
.me-rename { display: flex; flex: 1; flex-wrap: wrap; align-items: center; gap: 8px; }
.me-rename input { flex: 1 1 14rem; max-width: 22rem; height: 32px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--page); color: var(--ink); font-size: 0.875rem; }
.me-rename input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.me-rename input[aria-invalid="true"] { border-color: var(--red); }
.me-rename .field-error { flex-basis: 100%; margin: 0; }
.me-signins td.date { width: 1%; white-space: nowrap; }
.me-signins td.title { width: 30%; min-width: 12rem; max-width: none; }

/* Processing (US-020): the two choices side by side, the current one named, and the history of the choice. */
.proc-change { margin-bottom: 16px; }
.proc-state { margin-top: 2px; }
.proc-state b { font-weight: 600; color: var(--ink); }
.proc-change-body { padding: 14px; }
.proc-change-body .panel-title { margin-bottom: 4px; }
.proc-change-body .danger-text { margin-bottom: 12px; max-width: 44rem; }
.proc-options { display: grid; grid-template-columns: 1fr 1fr; }
.proc-option { padding: 14px; }
.proc-option + .proc-option { border-left: 1px solid var(--line); }
.proc-option h3 { display: flex; align-items: center; gap: 8px; font-size: 0.9375rem; font-weight: 600; }
.proc-option:not(.is-current) h3 { color: var(--ink-2); }
.proc-option .props > div { grid-template-columns: 9rem minmax(0, 1fr); }
.proc-rate { font-weight: 600; font-variant-numeric: tabular-nums; }
.proc-who span, .proc-who small, .proc-history td.title small { display: block; }
.proc-who small, .proc-history td.title small { font-size: 0.75rem; color: var(--ink-3); }
.proc-history td.proc-reason { color: var(--ink-2); font-size: 0.8125rem; }
.proc-history td.date { width: 1%; white-space: nowrap; }
.proc-who span { white-space: nowrap; }
.proc-history td.title { width: 30%; min-width: 12rem; max-width: none; }

/* The audit log (US-022): filters as chips, the events newest first, an event's detail in the peek. */
.audit-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 16px; }
.audit-filters .chip input[type="date"] { border: 0; background: none; font: inherit; font-size: 0.8125rem; color: var(--ink); }
.chip-check { gap: 6px; cursor: pointer; }
.chip-check input { margin: 0; }
.audit-filters .audit-search { flex: 1 0 16rem; max-width: 24rem; height: 32px; }
/* With an event open the list gives up the tenant column; the peek names it. */
.split.has-peek .audit-table .audit-tenant { display: none; }
.audit-table td.date { width: 1%; }
.audit-who span { display: block; white-space: nowrap; }
.audit-who small { display: block; font-size: 0.75rem; color: var(--ink-3); white-space: nowrap; }
.audit-table td.audit-what { width: auto; }
.audit-reason { display: block; margin-top: 1px; font-size: 0.8125rem; color: var(--ink-2); }
.audit-group { display: block; margin-top: 1px; font-size: 0.75rem; color: var(--ink-3); }
.audit-support { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; color: var(--ink-2); }
.audit-support .icon { width: 12px; height: 12px; }
.audit-changes { margin-bottom: 4px; font-size: 0.8125rem; }
.audit-changes th, .audit-changes td { padding: 5px 8px 5px 0; }
.audit-session-head { font-size: 0.8125rem; color: var(--ink-2); }
.audit-session-head small { font-size: 0.75rem; color: var(--ink-3); }
.audit-session { display: grid; gap: 1px; margin: 8px 0 0; padding: 0; list-style: none; font-size: 0.8125rem; }
.audit-session a { display: block; padding: 5px 8px; border-radius: var(--r); color: var(--ink); text-decoration: none; }
.audit-session a:hover { background: var(--hover); text-decoration: none; }
.audit-session li.is-selected a { background: var(--accent-wash); color: var(--accent-deep); }
.audit-session span { color: var(--ink-3); font-variant-numeric: tabular-nums; margin-right: 6px; }

/* Pilot metrics (US-021): the targets as cards with a daily trend, then volumes, stage timings and what's behind a measure. */
.pilot-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 16px; }
.pilot-filters .chip input { border: 0; background: none; font: inherit; font-size: 0.8125rem; color: var(--ink); }
.pilot-targets { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 16px; margin-bottom: 16px; }
.pilot-targets > .panel { margin: 0; }
.pilot-card { display: grid; align-content: start; gap: 4px; padding: 14px 16px 16px; }
.pilot-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.pilot-card-head h2 { font-size: 0.875rem; font-weight: 600; }
.pilot-status { display: inline-flex; align-items: center; gap: 4px; font-size: 0.75rem; font-weight: 600; color: var(--ink-3); white-space: nowrap; }
.pilot-status .icon { width: 13px; height: 13px; }
.pilot-status.is-met { color: var(--ink-2); }
/* A missed target needs someone's attention: the accent, not red (it isn't an error). */
.pilot-status.is-missed { color: var(--accent-deep); }
.pilot-value { font-size: 1.875rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.pilot-card.is-reported .pilot-value { color: var(--ink-2); }
.pilot-target { font-size: 0.8125rem; color: var(--ink-2); }
.pilot-trend { display: block; width: 100%; height: 36px; margin-top: 8px; }
/* Days on target in sky, days that missed in navy (darker, so it reads without colour too); in the action blue only
   where the target itself isn't met, because that needs someone. The numbers are in the chart's text alternative. */
.pilot-trend rect { fill: var(--sky); }
.pilot-trend rect.off { fill: var(--navy); }
.pilot-trend rect.off.needs { fill: var(--accent); }
.pilot-trend line.target { stroke: var(--ink-3); stroke-width: 0.6; stroke-dasharray: 2 1.5; vector-effect: non-scaling-stroke; }
.pilot-trend-note { font-size: 0.6875rem; color: var(--ink-3); }
.pilot-measure { margin-top: 6px; font-size: 0.75rem; color: var(--ink-3); }
.pilot-drill { margin-top: 6px; font-size: 0.8125rem; font-weight: 500; }
.pilot-threshold { margin-top: 6px; font-size: 0.8125rem; color: var(--ink-2); }
.pilot-threshold summary { cursor: pointer; color: var(--ink-2); }
.pilot-threshold-form { display: grid; gap: 6px; margin-top: 8px; }
.pilot-threshold-input { display: flex; align-items: center; gap: 6px; }
.pilot-threshold-input input { width: 4.5rem; height: 32px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: var(--r); font: inherit; }
.pilot-threshold-form .btn { justify-self: start; }
.pilot-drill[aria-current] { font-weight: 600; color: var(--accent-deep); }
.pilot-numbers { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 0; margin: 0; }
.pilot-numbers > div { padding: 12px 14px; border-right: 1px solid var(--line); }
.pilot-numbers > div:last-child { border-right: 0; }
.pilot-per, .pilot-throughput { color: var(--ink-3); font-size: 0.8125rem; }
.pilot-numbers dt { font-size: 0.75rem; color: var(--ink-3); }
.pilot-numbers dd { margin: 2px 0 0; font-size: 1.25rem; font-weight: 600; color: var(--ink); }
.pilot-stages td.title { width: 30%; min-width: 8rem; }
.pilot-items { scroll-margin-top: calc(var(--top-h) + 12px); }
.pilot-items:focus { outline: none; }
.pilot-item-label { font-weight: 500; }
/* The printable report: an A4 column on screen, its own page margins in print (the separator sheet's are 0). */
@page pilot { size: A4; margin: 14mm 12mm; }
.pilot-print { page: pilot; max-width: 210mm; margin: 0 auto; padding: 16px 20px 32px; }
.pilot-print .pilot-numbers { grid-template-columns: repeat(5, 1fr); }
.pilot-print-bar { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; font-size: 0.875rem; }
.pilot-print-head { margin-bottom: 16px; }
.pilot-print-head h1 { font-size: 1.5rem; font-weight: 700; }
.pilot-print-head p { font-size: 0.8125rem; color: var(--ink-2); }
.pilot-signoff { margin-top: 24px; font-size: 0.8125rem; color: var(--ink-2); }
.pilot-sign { display: grid; grid-template-columns: 2fr 1.5fr 1fr; gap: 24px; margin-top: 28px; }
.pilot-sign span { padding-top: 6px; border-top: 1px solid var(--ink-3); font-size: 0.75rem; color: var(--ink-3); }
@media print {
  .gate-bar, .gate-art, .gate-foot, .pilot-print-bar { display: none !important; }
  .pilot-print { max-width: none; padding: 0; }
  .pilot-targets { grid-template-columns: repeat(5, 1fr); gap: 8px; }
  .pilot-card { padding: 10px; }
  .pilot-value { font-size: 1.375rem; }
  .pilot-trend-note, .pilot-measure { display: none; }
  .pilot-card, .panel { break-inside: avoid; box-shadow: none; }
  .pilot-signoff { break-inside: avoid; break-before: avoid; }
}

/* Legal holds, disposal and its log (US-017–019). */
.tag--restricted { background: var(--hover); color: var(--ink-2); }
.hold-choices { display: grid; gap: 6px; margin: 0 0 16px; padding: 0; list-style: none; }
.hold-choices form { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r); }
.hold-choices b { display: block; font-weight: 600; }
.hold-choices small { font-size: 0.75rem; color: var(--ink-3); }
.hold-reason { padding: 12px 14px; font-size: 0.875rem; color: var(--ink-2); max-width: 70ch; }
.hold-entities { display: grid; gap: 4px; margin: 0; padding: 12px 14px 4px; list-style: none; font-size: 0.875rem; }
.hold-entities small, .hold-list small { font-size: 0.75rem; color: var(--ink-3); }
.hold-list { flex-direction: column; gap: 2px; }
.hold-list li + li::before { content: none; }
.hold-lift { margin-bottom: 16px; }
.hold-lift-body { padding: 14px; }
.hold-lift-body .panel-title { margin-bottom: 4px; }
.hold-lift-body .danger-text { margin-bottom: 12px; }
.scope-part { margin-top: 4px; }
.blocked-note { font-weight: 600; color: var(--ink-2); }
.er-when { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.er-when .form-field { margin-bottom: 16px; }
.decide-option { padding: 6px 0; }
.decide-choices .check { padding: 2px 0; }
.decide-help { margin: 0 0 0 26px; font-size: 0.8125rem; color: var(--ink-3); max-width: 36ch; }
.disposal-docs td.pick { width: 1%; padding-right: 0; }
.disposal-docs td.pick input { width: 16px; height: 16px; margin: 3px 0 0; }
.disposal-hidden { display: flex; gap: 10px; margin: 0; }
.scope-find { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.scope-find input { flex: 1; min-width: 10rem; height: 32px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: var(--r); font: inherit; font-size: 0.875rem; }
.scope-find .field-hint { flex-basis: 100%; margin: 0; }
.js .scope-find { display: none; }
/* The red button shows only while disposing is chosen: it can't be undone. */
.decide .decide-dispose { display: none; }
.decide:has(input[value="Approve"]:checked) .decide-dispose { display: inline-flex; }
.decide:has(input[value="Approve"]:checked) .decide-record { display: none; }
.decide:has(input[value="Approve"]:checked) .decide-optional { visibility: hidden; }
.decide:not(:has(input[value="Refuse"]:checked)) .decide-review { display: none; }
.log-filters .chip input { border: 0; background: none; font: inherit; font-size: 0.8125rem; color: var(--ink); }
.log-table td.title { width: 26%; min-width: 12rem; }
.log-table td.title b { font-weight: 500; }
.log-hash { display: block; font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 0.6875rem; color: var(--ink-3); }
.log-decision .plan-row-text b { font-weight: 500; }
.log-lift { display: grid; gap: 6px; max-width: 32rem; margin: 8px 0 0; font-size: 0.8125rem; color: var(--ink-2); }
.log-lift input { height: 32px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: var(--r); font: inherit; font-size: 0.875rem; }

/* The file plan builder (US-009): the form beside a preview of the top folders. */
.plan-builder { display: grid; grid-template-columns: minmax(0, 1fr) minmax(16rem, 22rem); gap: 16px; align-items: start; }
.plan-builder > .panel { margin: 0; }
.plan-form { padding: 16px 18px 18px; }
.plan-section { margin: 0 0 22px; padding: 0 0 18px; border: 0; border-bottom: 1px solid var(--line); }
.plan-section > .form-field:last-child { margin-bottom: 0; }
fieldset.plan-section > legend { margin-bottom: 4px; font-size: 0.9375rem; font-weight: 600; color: var(--ink); }
.plan-levels { display: grid; gap: 8px; margin: 8px 0 10px; padding: 0; list-style: none; }
.plan-level { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 8px; align-items: start; }
.plan-level-no { display: grid; place-items: center; width: 24px; height: 36px; font-size: 0.8125rem; font-weight: 600; color: var(--ink-3); }
.plan-level-pick select { width: 100%; }
.plan-level-actions { display: flex; gap: 2px; padding-top: 3px; }
.plan-level-actions .icon-btn:disabled { opacity: 0.35; cursor: default; background: none; }
.plan-down .icon { transform: rotate(180deg); }
.plan-types, .plan-columns { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: 0 16px; margin-top: 4px; }
.plan-types .check, .plan-columns .check { padding: 5px 0; }
.plan-dated { display: grid; gap: 2px; margin: 14px 0 0; padding: 0; border: 0; min-width: 0; }
.plan-dated-legend { margin-bottom: 4px; padding: 0; font-size: 0.8125rem; font-weight: 500; color: var(--ink-2); }
.plan-dated .check { padding: 4px 0; }
.plan-dated-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.plan-dated-row input[type="number"], .plan-dated-row input[type="date"], .plan-dated-row select {
  height: 32px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: var(--r); background-color: var(--page); font-size: 0.875rem; color: var(--ink);
}
.plan-past-amount { width: 5rem; }
.plan-dated-row select.plan-past-unit { width: auto; flex: none; height: 32px; padding-right: 30px; background-position: right 8px center; font-size: 0.875rem; }
.plan-dated-row input[type="date"] { width: auto; }
.plan-dated-and { font-size: 0.875rem; color: var(--ink-3); }
/* A range's own fields are quiet until their choice is picked (typing in them picks it, site.js). */
.plan-dated-row:not(:has(input[type="radio"]:checked)) :is(input[type="number"], input[type="date"], select) { color: var(--ink-3); background-color: var(--well); }
.plan-share:has(input[data-was-shared="true"]:not(:checked)) .plan-unshare { display: flex; }
.plan-only-you { font-size: 0.875rem; color: var(--ink-2); }
.plan-delete { margin-right: auto; color: var(--red); }
.plan-delete:hover { color: var(--red-deep); }
.js [data-plan-refresh] { display: none; }
.plan-side { position: sticky; top: calc(var(--top-h) + 8px); padding: 14px 16px 16px; }
.plan-preview-title { margin-bottom: 8px; font-size: 0.875rem; font-weight: 600; }
.plan-preview-sum { margin-bottom: 8px; font-size: 0.8125rem; color: var(--ink-2); }
.plan-preview-sum b { color: var(--ink); font-weight: 600; }
.plan-preview-list { display: grid; gap: 1px; margin: 0 0 8px; padding: 0; list-style: none; font-size: 0.875rem; }
.plan-preview-list li { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: var(--r); }
.plan-preview-list li span:first-of-type { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-preview-list .icon { color: var(--ink-3); }
.plan-preview-list .count { font-size: 0.75rem; color: var(--ink-3); }
.plan-preview-list li.unlinked span:first-of-type { color: var(--ink-3); font-style: italic; }
.plan-preview-note { font-size: 0.75rem; color: var(--ink-3); }
.plan-preview[aria-busy="true"] { opacity: 0.6; }
.plan-preview-path { margin: -4px 0 8px; font-size: 0.8125rem; color: var(--ink-3); }
.plan-preview-problem { margin-bottom: 8px; font-size: 0.8125rem; color: var(--red); }
.plan-preview-list li.is-open { background: var(--well); }
.plan-preview-inside { display: block !important; padding: 0 0 4px 22px !important; }
.plan-preview-inside ul { display: grid; gap: 1px; margin: 0; padding: 0; list-style: none; font-size: 0.8125rem; }
.plan-preview-more { padding: 2px 6px; font-size: 0.75rem; color: var(--ink-3); }
.plan-mini { display: none; margin-top: 8px; font-size: 0.8125rem; color: var(--ink-2); }
.plan-col-count { margin-left: 4px; font-weight: 600; color: var(--ink-2); }
/* Every file plan: shared ones in their sidebar order (admins move them), then your own. */
.plan-list { margin: 0; padding: 0; list-style: none; }
.plan-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.plan-row:last-child { border-bottom: 0; }
.plan-order { display: flex; gap: 0; }
.plan-order form { margin: 0; }
.plan-order .icon-btn:disabled { opacity: 0.35; cursor: default; background: none; }
.plan-row-text { flex: 1; min-width: 0; display: grid; gap: 1px; }
.plan-row-meta { font-size: 0.8125rem; color: var(--ink-3); }
.plan-row-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.plan-row-actions form { margin: 0; }
@media (max-width: 1100px) {
  .plan-builder { grid-template-columns: minmax(0, 1fr); }
  .plan-side { position: static; }
  .plan-mini:not(:empty) { display: block; }
}
@media (max-width: 860px) {
  .plan-row { flex-wrap: wrap; }
  .plan-row-actions { flex-basis: 100%; }
}

/* Entities (US-008): a list per type, one entity's page, the new form and the quick create in a dialog. */
.entity-bar { flex-wrap: wrap; gap: 8px; justify-content: flex-start; }
.entity-bar .entity-search { flex: 1 1 16rem; max-width: 26rem; height: 32px; }
.entity-clear { font-size: 0.8125rem; }
.table.entities td.title { width: 34%; min-width: 14rem; }
.table.entities .col-field { color: var(--ink-2); }
.entity-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(18rem, 23rem); gap: 16px; align-items: start; }
.entity-main { display: grid; gap: 16px; min-width: 0; }
.entity-main > .panel { margin: 0; }
.entity-props > div { grid-template-columns: 9rem minmax(0, 1fr); }
.entity-note { margin: -4px 0 12px; font-size: 0.8125rem; color: var(--ink-3); }
.entity-history li { padding: 8px 10px; font-size: 0.8125rem; }
.entity-change { display: grid; gap: 1px; }
.entity-change span { color: var(--ink-2); }
.entity-change small { font-size: 0.75rem; color: var(--ink-3); }
.entity-plans { flex-direction: column; align-items: flex-start; gap: 6px; padding: 12px 14px; margin: 0; list-style: none; }
.entity-new { display: grid; gap: 12px; max-width: 40rem; }
.entity-type-pick { margin: 0; }
.entity-new > .panel { margin: 0; }
/* The same name in the type: a person decides, so it wears the needs-you ring (not an error). */
.same-name { display: grid; gap: 4px; margin-top: 6px; font-size: 0.8125rem; color: var(--ink-2); }
.same-name strong { color: var(--ink); font-weight: 600; }
.same-name .check { padding: 2px 0; }
.same-choices { display: grid; gap: 2px; margin: 6px 0 0; padding: 0; border: 0; }
.same-choices .check { padding: 4px 0; }
/* In the quick dialog the matches push the form down rather than being clipped by it. */
.quick-dialog .link-options { position: static; margin-top: 4px; box-shadow: none; border: 1px solid var(--line-2); }
.quick-dialog { width: min(32rem, calc(100vw - 32px)); height: fit-content; max-height: calc(100dvh - 32px); overflow: auto; }
.quick-dialog[open] { display: block; }
.entity-quick { margin: 0; }
.entity-quick-body { padding: 16px 18px 18px; }
.entity-quick-body .panel-form-actions { margin-top: 12px; }
.quick-cancel { font-size: 0.875rem; }
.panel.danger + .entity-layout, .merge-panel + .entity-layout { margin-top: 16px; }
.doc-delete { margin-bottom: 16px; }
/* Delete… sits at the left of the review form's actions, away from Skip and Confirm (owner, 2026-10-10). */
.review-actions .review-delete { margin-right: auto; }
.trash-title { font-weight: 500; color: var(--ink); }
.remember-device { margin: 4px 0 14px; }
.rules-form { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 24px; padding: 14px; }
.rules-form .check { flex: 1 1 28rem; }
.delete-rights { margin-top: 14px; }
/* Tenant admins delete what they see: the rights are only for members. */
.panel-form:has(input[type="radio"][value="TenantAdmin"]:checked) .delete-rights { display: none; }
.class-option--small { padding: 6px 10px; }
.class-option--small .class-name { font-size: 0.8125rem; }
.review-delete-confirm, .review-again-confirm { margin: 0 14px 14px; }
/* Review's head: the title, with what can be done about the document beside it (its notes, Suggest again). */
.review-head-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
.review-head-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 0.8125rem; }
.review-head-actions .btn .icon { width: 13px; height: 13px; margin-right: 3px; }
/* The form, then the document's notes under it. */
.review-side { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; }
.review-side > .notes { margin: 0; }
/* With its scanned text showing, the viewer scrolls with the page, so the text under the page can be reached. */
.review-viewer:has(.viewer.show-text) { position: static; }
/* Fitted to the width a page is taller than the window: it scrolls inside the viewer, which stays beside the form. */
.review-viewer .viewer:not(.show-text) .viewer-stage { max-height: calc(100dvh - var(--top-h) - 11rem); overflow-y: auto; }
.doc-note { margin: -8px 0 12px; font-size: 0.8125rem; color: var(--ink-3); text-align: right; }
/* Merging (US-030): find the one to keep, then compare field by field; the final step is red (it removes one). */
.merge-body { padding: 14px; }
.merge-intro { margin-bottom: 12px; font-size: 0.875rem; color: var(--ink-2); max-width: 70ch; }
.merge-find { display: grid; gap: 10px; max-width: 32rem; }
.merge-find-actions { display: flex; align-items: center; gap: 16px; font-size: 0.875rem; }
.link-match { display: flex; align-items: baseline; gap: 10px; padding: 7px 10px; border-radius: var(--r); color: var(--ink); font-size: 0.875rem; text-decoration: none; }
.link-match:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
.link-match b { flex: 1; min-width: 0; font-weight: 500; }
.link-match small { font-size: 0.75rem; color: var(--ink-3); }
.merge-table { margin-bottom: 16px; }
.merge-table th[scope="row"] { width: 12rem; font-weight: 400; color: var(--ink-3); text-align: left; }
.merge-table td { width: 80%; }
.merge-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; padding: 0; border: 0; min-width: 0; }
.merge-table tr.is-different td { color: var(--ink); }
.merge-choice { display: flex; align-items: flex-start; gap: 8px; padding: 4px 6px; border-radius: var(--r); cursor: pointer; }
.merge-choice:has(input:checked) { background: var(--accent-wash); }
.merge-choice input { flex: none; width: 16px; height: 16px; margin: 2px 0 0; }
.merge-choice:has(input:checked) span { font-weight: 600; color: var(--accent-deep); }
.merge-same { color: var(--ink-4); }
.merge-table tbody th { padding: 7px 10px 7px 2px; border-bottom: 1px solid var(--line); vertical-align: top; }
/* Which side a choice is from: the column heads show it on wide screens (screen readers still hear it); on a phone each choice shows it. */
.merge-side { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; font-weight: 400; color: var(--ink-3); }
.merge-changed { margin-top: 2px; color: var(--accent-deep); }
.merge-moves { margin-bottom: 16px; font-size: 0.875rem; }
.merge-moves h3 { margin-bottom: 4px; font-size: 0.8125rem; font-weight: 600; color: var(--ink-2); }
.merge-moves ul { margin: 0; padding-left: 18px; color: var(--ink-2); }
.merge-confirm { padding: 12px 0 0; border-top: 1px solid var(--line); }
.merge-confirm .danger-text strong { color: var(--ink); }
@media (max-width: 1180px) {
  .entity-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .entity-bar .entity-search { flex-basis: 100%; max-width: none; }
  /* Two dates on a phone: each says which it is. */
  .entity-docs td.date[data-label]::before { content: attr(data-label) ": "; color: var(--ink-4); }
  .disposal-docs td.date { display: block; padding-top: 0; }
  /* The tick gets its own gutter on a phone, left of the drawn page. */
  .disposal-docs tr:has(> td.pick) { position: relative; }
  /* Stage timings on a phone: each number says what it is. */
  /* An event on a phone: what happened first, then who, when and where on one line. */
  .audit-table tr { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 6px; }
  .audit-table td.audit-what { order: -1; flex-basis: 100%; padding-left: 0; }
  .audit-table tr > td.audit-who, .audit-table tr > td.date, .audit-table tr > td.audit-tenant { order: 1; margin: 0; padding: 2px 0 0; font-size: 0.75rem; color: var(--ink-3); width: auto; }
  .audit-table td.audit-who span, .audit-table td.audit-who small { display: inline; font-size: 0.75rem; color: var(--ink-2); }
  .audit-table td.audit-who small::before { content: ", "; }
  .audit-table td.audit-who::before { content: "· "; }
  /* A search hit's meta on a phone: one flowing line, each part after a dot, so no line ends on a stray "·". */
  .hit-meta { display: block; }
  .hit-meta > span { white-space: normal; }
  .hit-meta > span:not(:last-child)::after { content: none; }
  .hit-meta > span + span::before { content: "·"; margin: 0 6px; color: var(--ink-4); }
  /* My account on a phone: the button goes under its row's words; a sign-in reads result, then when, browser and place. */
  .me-rows li { flex-wrap: wrap; }
  .me-signins tr { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 6px; }
  .me-signins td.title { order: -1; flex-basis: 100%; }
  .me-signins tr > td { width: auto; padding: 2px 0 0; font-size: 0.75rem; color: var(--ink-3); }
  .me-signins tr > td.title { font-size: 0.875rem; color: var(--ink); }
  .me-signins tr > td:not(.title):not(.date)::before { content: "· "; }
  /* Processing on a phone: the choices stack; a change reads as its change, then when and who, then why. */
  .proc-options { grid-template-columns: 1fr; }
  .proc-option + .proc-option { border-left: 0; border-top: 1px solid var(--line); }
  .proc-history tr { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 6px; }
  .proc-history td.title { order: -1; flex-basis: 100%; }
  .proc-history tr > td.date, .proc-history tr > td.proc-who { order: 1; width: auto; padding: 2px 0 0; font-size: 0.75rem; color: var(--ink-3); }
  .proc-history td.proc-who span, .proc-history td.proc-who small { display: inline; font-size: 0.75rem; color: var(--ink-2); }
  .proc-history td.proc-who small::before { content: ", "; }
  .proc-history td.proc-who::before { content: "· "; }
  .proc-history tr > td.proc-reason { order: 2; flex-basis: 100%; padding-top: 2px; }
  /* A change on a phone: the field, then each value says whether it's before or after. */
  .audit-changes tr { padding: 8px 0; }
  .audit-changes td { padding: 1px 0; }
  .audit-changes td[data-label]::before { content: attr(data-label) ": "; color: var(--ink-3); }
  /* The tenant takes its own line rather than wrapping after a stray dot. */
  .audit-table tr > td.audit-tenant { flex-basis: 100%; padding-top: 0; }
  .pilot-stages td[data-label] { display: inline; }
  .pilot-stages td[data-label]::before { content: attr(data-label) "\00a0"; color: var(--ink-3); }
  .pilot-stages td[data-label] + td[data-label]::before { content: "\00a0\00b7\00a0" attr(data-label) "\00a0"; }
  .pilot-numbers { grid-template-columns: 1fr 1fr; }
  .pilot-numbers > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .pilot-numbers > div:last-child { grid-column: 1 / -1; border-bottom: 0; }
  .disposal-docs td.pick { position: absolute; left: 6px; top: 14px; width: auto; }
  .disposal-docs tr:has(> td.pick) .thumb { visibility: hidden; }
  .merge-table tbody th { border-bottom: 0; padding-bottom: 2px; }
  .merge-side { position: static; width: auto; height: auto; margin: 0; overflow: visible; clip: auto; white-space: normal; }
  .merge-pick { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}

/* Finding an entity to link: a search box; with script the matches drop down under it (a listbox). */
.link-find { position: relative; }
.link-find-row { display: flex; gap: 8px; }
.link-find-box { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--page); color: var(--ink-3); }
.link-find-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.link-find-box input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; font-size: 0.875rem; color: var(--ink); }
.link-find-box input::placeholder { color: var(--ink-4); }
.link-find.is-live .link-find-submit { display: none; }
/* A search that only works with script (review keeps its select for no-script). */
.link-find--js:not(.is-live) { display: none; }
/* "Link to another entity" opens the finder; it folds back to the button when left empty. */
.js .link-find[data-collapsible]:not(.is-open) { display: none; }
.js .link-more.is-hidden { display: none; }
.link-more { gap: 6px; }
.link-more .icon { width: 14px; height: 14px; }
.link-options li.is-create { border-top: 1px solid var(--line); border-radius: 0 0 var(--r) var(--r); }
.link-options li.is-create:first-child { border-top: 0; border-radius: var(--r); }
.link-options li.is-create b { color: var(--accent-deep); font-weight: 600; }
.link-options { position: absolute; left: 0; right: 0; top: 40px; z-index: 30; max-height: 16rem; margin: 0; padding: 4px; overflow-y: auto; list-style: none; background: var(--page); border-radius: var(--r-pop); box-shadow: var(--pop-shadow); }
.link-options[hidden] { display: none; }
.link-options li { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 7px 10px; border-radius: var(--r); font-size: 0.875rem; cursor: pointer; }
.link-options li[aria-selected="true"] { background: var(--accent-wash); }
.link-options li[aria-selected="true"] b { color: var(--accent-deep); }
.link-options b, .link-matches b { font-weight: 500; }
.link-options small, .link-matches small { flex: none; font-size: 0.75rem; color: var(--ink-3); }
.link-matches { display: grid; gap: 2px; margin: 8px 0 0; padding: 0; list-style: none; }
.link-matches button { display: flex; align-items: baseline; gap: 10px; width: 100%; padding: 7px 10px; border: 0; border-radius: var(--r); background: none; font-size: 0.875rem; text-align: left; }
.link-matches button:hover, .link-matches button:focus-visible { background: var(--hover); }
.link-matches b { flex: 1; min-width: 0; }
.link-add { font-size: 0.8125rem; font-weight: 600; color: var(--accent); }
.link-note { margin-top: 5px; font-size: 0.8125rem; color: var(--ink-3); }
.link-note:empty { display: none; }
.theirs b { font-weight: 600; color: var(--ink); }
@media (max-width: 1180px) {
  .doc-layout { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  /* A drawer of exactly the screen's height (not "auto": Safari then collapses the scrolling middle to nothing, and
     Chromium, with the desktop's align-self: start, made it as tall as its contents), so the middle scrolls. 100vh first
     for Safari before 15.4, which has no dvh. */
  /* It opens under the top bar, so the menu button that opened it stays there to close it. */
  .sidebar {
    position: fixed; top: var(--top-h); bottom: auto; left: 0; z-index: 50; align-self: stretch;
    width: min(20rem, 86vw);
    height: calc(100vh - var(--top-h) - var(--uifirst-bar, 0px));
    height: calc(100dvh - var(--top-h) - var(--uifirst-bar, 0px));
    translate: -100% 0; visibility: hidden;
    transition: translate 200ms var(--ease-out), visibility 0s linear 200ms;
    box-shadow: var(--pop-shadow);
  }
  .app[data-nav-open] .sidebar { translate: 0 0; visibility: visible; transition: translate 200ms var(--ease-out); }
  .app[data-nav-open] .scrim { display: block; position: fixed; inset: var(--top-h) 0 0 0; z-index: 45; background: rgb(15 15 15 / 0.28); }
  /* Phones: the menu drawer from the bar's left; search, the tenant's name and yours fold to their icons (the bell
     already says what's waiting, so the menu button carries no dot). */
  .appbar { gap: 4px; padding: 0 6px 0 4px; }
  .menu-btn { display: inline-grid; }
  .appbar-name, .appbar-tenant .name, .appbar-tenant .switcher > summary > .icon, .account-menu .who, .account-menu > summary > .icon { display: none; }
  .appbar-tenant { padding-left: 4px; }
  .appbar-search { display: none; }
  .search-btn { display: inline-grid; }
  .appbar-end { margin-left: auto; }
  /* The bell's list and the account menu open under the bar across the screen, never off its edge. */
  .appbar .popover.popover--end { position: fixed; top: calc(var(--top-h) + 4px); left: 8px; right: 8px; min-width: 0; }
  .crumbs-bar { padding: 8px 12px 0; }
  .work { padding: 16px 12px 96px; }
  .peek { width: 100vw; border: 0; }
  .panel-bar { padding: 8px 12px; }
  .ticket-layout { grid-template-columns: minmax(0, 1fr); }
  .sheet-layout { grid-template-columns: minmax(0, 1fr); }
  .queue-bar { margin-left: 0; flex-basis: 100%; }
  .work:has(.review-layout.has-doc) .queue-filters > :not(.queue-bar) { display: none; }
  .review-viewer { position: static; }
  .review-viewer .viewer:not(.show-text) .viewer-stage { max-height: none; overflow-y: visible; }
  .review-body { grid-template-columns: minmax(0, 1fr); padding: 12px; }
  .bpage-item:has(.is-flagged), .bpage.is-flagged, .bpage-item:has(.is-moving), .bpage.is-moving { width: 100%; }
  .cut-flow { padding-inline: 10px; }
  /* The Act inside form, once asked for, comes first on a phone rather than below the conversation. */
  .ticket-layout:has(.look-inside form.panel-form) > .ticket-side { order: -1; }
  .look-inside { scroll-margin-top: calc(var(--top-h) + 12px); }
  /* The status filter stays one row and scrolls sideways rather than orphaning its last option. */
  .queue-filters .segmented--links:first-child { flex-wrap: nowrap; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .queue-filters .segmented--links:first-child li { flex: none; }
  .queue-filters .segmented--links a { white-space: nowrap; }
  .timeline { padding-inline: 12px; }
  .entry-head time { margin-left: 0; }
  .reply { padding-inline: 12px; }
  /* Platform on phones: people rows wrap their chips under the name; callouts drop their action below. */
  /* Only rows with an invitation (chip + Resend) wrap; an active admin keeps one line. */
  .people li:has(> form) { flex-wrap: wrap; row-gap: 6px; }
  .people li:has(> form) .tenant-text { flex: 1 1 calc(100% - 44px); }
  .people li:has(> form) > .flag { margin-left: 34px; }
  .callout > .btn { margin-left: 24px; }
  .acting { display: block; }
  .acting > .icon { display: inline-block; vertical-align: -3px; margin-right: 6px; }
  .acting > span { display: inline; }
  .acting form { margin: 8px 0 0; }
  /* List group headings wrap inside the panel instead of running past it. */
  .group th { white-space: normal; }
  .group-head { display: flex; align-items: baseline; gap: 6px; max-width: 100%; }
  .group-toggle { flex: 0 1 auto; min-width: 0; flex-wrap: wrap; align-items: baseline; text-align: left; }
  .group-head .count { flex: none; }
  .props--panel > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  /* Fields: name across, then type and rules on one line; the move buttons sit top right. */
  .fields-table tr:has(> td.title) { position: relative; padding-right: 64px; }
  .table tr:has(> td.title) > td.col-order { position: absolute; top: 6px; right: 8px; width: auto; }
  .fields-table td.kind, .fields-table td.rules { order: 1; margin-right: 10px; }
  .fields-table td.kind::before, .fields-table td.rules::before { content: none; }
  /* Entity types and fields: one left edge for every line of a row. */
  body .panel .table tr.type-row, body .panel .fields-table tr:has(> td.title) { padding-left: 12px; }
  body .table tr.type-row > td.title, body .fields-table tr:has(> td.title) > td.title { margin-left: 0; }
  .type-row .type-link .icon { display: none; }
  .type-row .sub { margin-left: 0; }
  .type-row td:not(.title) { display: none; }
  .type-meta { display: block; margin-top: 2px; font-size: 0.8125rem; color: var(--ink-3); }
  .count-note { display: none; }
  .panel .filters { padding: 8px 12px; }
  .hit { padding: 12px; }
  .page-title h1 { font-size: 1.5rem; }
  .page-meta { padding-left: 0; }
  .table th { position: static; }
  .chip--search { flex: 1; min-width: 0; }
  .chip--search input[type="search"] { width: 100%; }
  .js .filters-toggle { display: inline-flex; }
  .filters.is-open .chip--search { flex-basis: 100%; }
  .js .filters:not(.is-open) .filter, .js .filters:not(.is-open) .filters-clear { display: none; }
  .filter-pop { position: fixed; left: 16px; right: 16px; top: auto; min-width: 0; }

  /* The table restacks: every row keeps its data, laid out as an entry. */
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: auto; }
  .table tr { padding: 10px 2px; border-bottom: 1px solid var(--line); }
  .table tr.group { padding: 0; border: 0; }
  .table tr.group th { display: block; }
  .table td { padding: 0; border: 0; }
  .table tbody tr:not(.group):hover td { background: none; }
  /* Entries: the title line, one grey meta line, then the other filings as chips. */
  .table tr:has(> td.title) { display: flex; flex-wrap: wrap; align-items: baseline; padding: 9px 2px; font-size: 0.8125rem; color: var(--ink-3); }
  .table tr:has(> td.title) > td.title { flex-basis: 100%; order: 0; min-width: 0; max-width: none; width: auto; margin-bottom: 2px; font-size: 0.875rem; color: var(--ink); }
  .table tr:has(> td.title) > td.field, .table tr:has(> td.title) > td.date, .table tr:has(> td.title) > td.type { order: 1; width: auto; color: var(--ink-3); white-space: nowrap; }
  .table tr:has(> td.title) > td.type::after, .table tr:has(> td.title) > td.field::after { content: "·"; margin: 0 6px; color: var(--ink-4); }
  .table tr:has(> td.title) > td.field::before { content: attr(data-label) " "; color: var(--ink-4); }
  .table tr:has(> td.title) > td.filed-cell { flex-basis: 100%; order: 2; margin-top: 4px; }
  .table .doc { display: block; position: relative; padding-left: 32px; min-height: 29px; }
  .table .doc > .thumb { position: absolute; left: 0; top: 0; }
  .table .doc .marks { margin-left: 6px; }
  .table .doc-meta { margin-left: 6px; }
  .table .doc-link { white-space: normal; }
  .table tr:has(> td.title) { padding-left: 34px; }
  .panel .table td:first-child, .panel .table td:last-child { padding-left: 0; padding-right: 0; }
  .panel .table tr:has(> td.title) { padding: 9px 12px 9px 44px; }
  .panel .table tr.folder-row { padding: 10px 12px; }
  .table tr:has(> td.title) > td.title { margin-left: -32px; }
  .table tr:has(> td.title) > td.filed-cell { padding-left: 0; }
  .table tr:has(> td.title) > td.type { padding-left: 0; }
  .table td.is-blank, .table td:empty { display: none; }
  /* No drawn page in the audit table: no room kept for one. */
  .panel .table.audit-table tr:has(> td.title), .panel .table.proc-history tr:has(> td.title), .panel .table.me-signins tr:has(> td.title), .panel .table.mail-recent tr:has(> td.title) { padding-left: 12px; }
  .audit-filters .audit-search { flex-basis: 100%; max-width: none; }
  .table.audit-table tr:has(> td.title) > td.title, .table.proc-history tr:has(> td.title) > td.title, .table.me-signins tr:has(> td.title) > td.title, .table.mail-recent tr:has(> td.title) > td.title { margin-left: 0; }
  /* A sign-in on a phone: the result, then "28 Sept 2026, 07:58 · Edge on Windows · Johannesburg, ZA". */
  .table.me-signins tr:has(> td.title) > td:not(.title) { order: 1; }
  .table td.num { text-align: left; }
  .folder-row { display: flex !important; justify-content: space-between; align-items: center; }
  .folder-row td.num::before { display: none !important; }
  .folder-row td.num { width: auto; flex: none; padding-left: 12px; }
  .find-form .btn { padding: 0 14px; }
  .gate { margin-top: 24px; padding: 0 16px; }
  .gate-bar { padding: 14px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0ms !important; animation-duration: 0ms !important; }
}

/* Page pictures in the thumbnails (GetBatchPageImage, GetDocumentPageImage): the stand-in's size, the page itself inside. */
.pg-img { padding: 0; object-fit: cover; object-position: top; }

/* A locked document where the page viewer would be (owner, 2026-10-01): Open it here, Download it, or Unlock it. */
.locked-viewer { min-height: 22rem; display: grid; background: var(--well, var(--active)); border: 1px solid var(--line); border-radius: var(--r); }
.locked-intro { display: grid; justify-items: center; align-content: center; gap: 10px; padding: 32px 20px; text-align: center; }
.locked-intro[hidden], .locked-pages[hidden] { display: none; }
.locked-badge { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--page); border: 1px solid var(--line); color: var(--ink-2); }
.locked-badge .icon { width: 24px; height: 24px; }
.locked-title { margin: 4px 0 0; font-size: 1.125rem; font-weight: 650; }
.locked-sub { margin: 0; max-width: 28rem; color: var(--ink-2); font-size: 0.875rem; }
.locked-open { display: grid; grid-template-columns: minmax(10rem, 16rem) auto; gap: 6px 8px; margin-top: 8px; }
.js .locked-open.js-only { display: grid; }
.locked-open input, .locked-unlock-form input { height: 32px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--page); font-size: 0.875rem; }
.locked-open input:focus, .locked-unlock-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.locked-open input[aria-invalid="true"], .locked-unlock-form input[aria-invalid="true"] { border-color: var(--red); }
.locked-note { grid-column: 1 / -1; margin: 0; font-size: 0.8125rem; color: var(--ink-3); }
.locked-note.is-error { color: var(--red); }
.locked-download { margin: 6px 0 0; font-size: 0.8125rem; color: var(--ink-3); }
.locked-download a { display: inline-flex; align-items: center; gap: 4px; font-weight: 500; }
.locked-download .icon { width: 14px; height: 14px; }
.locked-unlock { margin-top: 10px; max-width: 30rem; font-size: 0.8125rem; text-align: left; }
.locked-unlock > summary { cursor: pointer; color: var(--accent-deep); font-weight: 500; text-align: center; }
.locked-unlock-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 10px; padding: 12px; background: var(--page); border: 1px solid var(--line); border-radius: var(--r); }
.locked-unlock-form p { grid-column: 1 / -1; margin: 0; color: var(--ink-2); }
.locked-unlock-form .field-error { grid-column: 1 / -1; }
.locked-pages { display: grid; grid-template-rows: auto 1fr; min-height: 0; }
.locked-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--page); font-size: 0.8125rem; color: var(--ink-2); }
.locked-bar-title { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--ink); }
.locked-bar-title .icon { width: 14px; height: 14px; }
.locked-bar .btn { margin-left: auto; }
.locked-stage { display: grid; gap: 18px; padding: 16px; overflow: auto; max-height: 80vh; }
.locked-page { margin: 0; display: grid; gap: 6px; }
.locked-page canvas { display: block; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / 0.18); }
.locked-page figcaption { font-size: 0.75rem; color: var(--ink-3); text-align: center; }
/* Thumbnails and peeks of a locked document. */
.locked-thumb { display: grid; place-items: center; align-content: center; gap: 6px; background: var(--well, var(--active)); color: var(--ink-3); font-size: 0.75rem; text-align: center; }
.locked-thumb .icon { width: 22px; height: 22px; }
.locked-mark { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-2); font-weight: 500; }
.locked-mark .icon { width: 13px; height: 13px; }
.tag--locked { display: inline-flex; align-items: center; gap: 3px; background: var(--active); color: var(--ink-2); }
.tag--locked .icon { width: 11px; height: 11px; }
.peek-page .peek-locked { aspect-ratio: 60 / 78; width: 132px; border: 1px solid var(--line); border-radius: 3px; }
/* A sensitive document in review (owner, 2026-10-02): read locally, seen only by its uploader until filed. */
.review-sensitive { display: flex; gap: 8px; align-items: flex-start; margin: 8px 0 0; padding: 8px 10px; background: var(--well, var(--active)); border-radius: var(--r); font-size: 0.8125rem; color: var(--ink-2); }
.review-sensitive .icon { flex: none; width: 14px; height: 14px; margin-top: 2px; color: var(--ink-3); }
/* The AI couldn't read it (US-105): the same note, its icon in the accent so it's noticed. */
.review-ai-unread .icon { color: var(--accent-deep); }
/* A second reading that failed (Suggest again): the earlier suggestions still stand. */
.review-failed .icon { color: var(--red); }

/* A checked-out document (US-038): who holds it, and the holder's or an admin's actions. */
.checkout { margin-bottom: 16px; }
.checkout-head { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px 14px; padding: 12px 16px; }
.checkout-head > .icon { flex: none; width: 18px; height: 18px; margin-top: 2px; color: var(--ink-3); }
.checkout--mine .checkout-head > .icon { color: var(--accent); }
.checkout-text { flex: 1 1 18rem; min-width: 0; }
.checkout-title { margin: 0; font-size: 0.9375rem; font-weight: 650; }
.checkout-text p { margin: 2px 0 0; font-size: 0.8125rem; color: var(--ink-2); }
.checkout-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.checkout-actions form { margin: 0; }
.checkout-error { margin: 0; padding: 0 16px 12px; }
.checkout-form { padding: 4px 16px 16px; border-top: 1px solid var(--line); }
/* A file Athena can't show (US-039). */
.nopreview { min-height: 22rem; display: grid; justify-items: center; align-content: center; gap: 10px; padding: 32px 20px; text-align: center; background: var(--well, var(--active)); border: 1px solid var(--line); border-radius: var(--r); }
.tag--checkout { display: inline-flex; align-items: center; gap: 3px; background: var(--active); color: var(--ink-2); }
.tag--checkout.is-mine { background: var(--accent-wash); color: var(--accent-deep); }
.tag--checkout .icon { width: 11px; height: 11px; }
.checkout-person { padding: 10px 16px 4px; font-weight: 650; font-size: 0.875rem; list-style: none; }
.checkout-person small { font-weight: 400; color: var(--ink-3); margin-left: 6px; }
.checkout-list .ending { color: var(--red); font-weight: 500; }
.checkout-pick { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.entity-newfile { margin-left: auto; }
.entity-newfile + .checkout-pick { margin-left: 0; }
.checkout-pick select { height: 28px; padding: 0 28px 0 8px; border: 1px solid var(--line-2); border-radius: var(--r); background-color: var(--page); font-size: 0.8125rem; }

/* A file plan's Grid (owner, 2026-10-03): folders and files as icons, in three sizes. */
.tiles { --tile: 168px; display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--tile), 1fr)); gap: 12px; margin: 0; padding: 14px 16px; list-style: none; }
.tiles--s { --tile: 112px; gap: 8px; }
.tiles--l { --tile: 240px; gap: 16px; }
.tile { display: grid; justify-items: center; align-content: start; gap: 4px; height: 100%; padding: 10px 8px 12px; border: 1px solid transparent; border-radius: var(--r); color: var(--ink); text-decoration: none; text-align: center; }
.tile:hover { background: var(--hover); text-decoration: none; color: var(--ink); }
.tile:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.tile.is-selected { background: var(--accent-wash); border-color: var(--accent-line, var(--accent)); }
.tile-art { display: grid; place-items: center; width: 100%; aspect-ratio: 60 / 78; max-height: calc(var(--tile) * 1.1); overflow: hidden; }
.tile--folder .tile-art { aspect-ratio: 4 / 3; }
.tile--folder .tile-art .icon { width: 60%; height: 60%; color: var(--accent); stroke-width: 1.1; }
.tile--folder.unlinked .tile-art .icon { color: var(--ink-4); }
.tile--file .tile-art img, .tile--file .tile-art .thumb { width: auto; height: 100%; max-width: 100%; object-fit: contain; background: var(--page); border: 1px solid var(--thumb-edge); border-radius: 2px; box-shadow: 0 1px 2px rgb(0 0 0 / 0.06); }
.tile--file .tile-art .locked-thumb { width: 78%; height: 100%; border: 1px dashed var(--line-2); border-radius: 3px; }
.tile-name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 100%; font-size: 0.8125rem; font-weight: 500; line-height: 1.3; overflow-wrap: anywhere; }
.tile-meta { font-size: 0.75rem; color: var(--ink-3); }
.tile .marks { justify-content: center; }
.tiles--s .tile-name { font-size: 0.75rem; }
.tiles--s .tile-meta, .tiles--s .tile .marks { display: none; }
.tiles--l .tile-name { font-size: 0.875rem; }
.grid-size a { padding: 4px 10px; font-size: 0.75rem; }

/* A text file's contents on its page (owner, 2026-10-03). */
.textfile { display: grid; grid-template-rows: auto 1fr; min-height: 22rem; background: var(--page); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.textfile-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--well, var(--active)); }
.textfile-name { display: inline-flex; align-items: center; gap: 6px; margin-right: auto; font-size: 0.8125rem; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.textfile-name small { font-weight: 400; color: var(--ink-3); }
.textfile-name .icon { width: 14px; height: 14px; color: var(--ink-3); }
.textfile-body { margin: 0; padding: 16px 20px; max-height: 75vh; overflow: auto; }
.textfile-pre { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 0.8125rem; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 4; }
/* JSON keeps its lines (its indenting is the point): it scrolls sideways instead of wrapping. */
.textfile-pre--json { white-space: pre; overflow-wrap: normal; }
.textfile-note { margin: 0; padding: 8px 20px; font-size: 0.8125rem; color: var(--ink-3); border-top: 1px solid var(--line); }
.md { font-size: 0.9375rem; line-height: 1.6; color: var(--ink); }
.md > :first-child { margin-top: 0; }
.md h1, .md h2, .md h3, .md h4 { margin: 1.2em 0 0.4em; line-height: 1.25; }
.md h1 { font-size: 1.5rem; } .md h2 { font-size: 1.25rem; } .md h3 { font-size: 1.0625rem; } .md h4 { font-size: 0.9375rem; }
.md p, .md ul, .md ol, .md blockquote, .md pre, .md table { margin: 0 0 0.9em; }
.md ul, .md ol { padding-left: 1.4em; }
.md li > input[type="checkbox"] { margin-right: 6px; }
.md blockquote { padding: 2px 0 2px 12px; border-left: 3px solid var(--line-2); color: var(--ink-2); }
.md code { padding: 1px 4px; background: var(--well, var(--active)); border-radius: 3px; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 0.85em; }
.md pre { padding: 10px 12px; background: var(--well, var(--active)); border-radius: var(--r); overflow: auto; }
.md pre code { padding: 0; background: none; }
.md table { border-collapse: collapse; font-size: 0.875rem; }
.md th, .md td { padding: 5px 10px; border: 1px solid var(--line); text-align: left; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 1.4em 0; }
.md .md-dead-link { color: var(--ink-2); text-decoration: none; }
.segmented--sm a { padding: 4px 10px; font-size: 0.75rem; }
/* The builder's Opens as (owner, 2026-10-03): the view and the Grid's size on one line. */
.plan-opens-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.plan-opens .plan-gridsize { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 0.8125rem; color: var(--ink-2); }
.plan-opens .plan-gridsize select { width: auto; min-width: 8rem; height: 32px; }

/* A document's trail (owner, 2026-10-03): the plan and folders it was opened from. Long trails keep the ends and
   shorten the middle; on a phone, one link back to the folder above it. */
.crumbs-up { display: none; }
.crumbs--trail li:not(:first-child):not(:nth-last-child(-n+2)) a { max-width: 9rem; }
@media (max-width: 640px) {
  .crumbs--trail { display: none; }
  .crumbs-up { display: inline-flex; align-items: center; gap: 4px; min-width: 0; padding: 2px 6px; border-radius: var(--r-tag); color: var(--ink-2); font-size: 0.875rem; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .crumbs-up .icon { width: 14px; height: 14px; rotate: 180deg; flex: none; }
  .crumbs-up:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
}

/* Settings › AI (US-044): the tenant's keys, models, rules and use. */
.ai-state b { font-weight: 600; color: var(--ink); }
.ai-on::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--accent); vertical-align: 1px; }
/* Reading new documents (US-068): on a key, or left to the local model for want of one. */
.ai-off::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--red); vertical-align: 1px; }
.ai-reading { margin-top: 2px; }
.ai-read-count { border-top: 1px solid var(--line); }
.ai-keys { list-style: none; margin: 0; padding: 0; }
.ai-key + .ai-key { border-top: 1px solid var(--line); }
.ai-key-row { display: grid; grid-template-columns: minmax(12rem, 1fr) minmax(10rem, 1fr) auto; align-items: center; gap: 6px 16px; padding: 12px 14px; }
.ai-key-name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.ai-key-name b { font-weight: 600; min-width: 5.5rem; }
.ai-masked { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 0.8125rem; color: var(--ink-2); }
.ai-key-set { margin: 0; font-size: 0.8125rem; color: var(--ink-3); }
.ai-key-actions { display: flex; gap: 8px; justify-content: flex-end; }
.ai-key.is-unset .ai-key-name b { color: var(--ink-2); }
.ai-key-form { padding: 4px 14px 14px; max-width: 40rem; }
.ai-key-form .form-field > input { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }
.ai-remove { position: static; border-radius: 0; background: var(--red-wash); border-top-color: var(--red-line); }
.ai-remove .danger-text { max-width: 40rem; color: var(--ink); }
.ai-models, .ai-rules { padding: 14px; max-width: 40rem; }
.ai-models .panel-form-actions, .ai-rules .panel-form-actions { justify-content: flex-start; }
.ai-limit-row { display: flex; align-items: center; gap: 10px; font-size: 0.875rem; color: var(--ink-2); }
.panel-form .ai-limit-row input { width: 7rem; height: 36px; }
.empty--inline { padding: 18px 14px !important; }
.ai-use { position: relative; display: flex; align-items: flex-end; gap: 3px; height: 96px; margin: 18px 14px 0; border-bottom: 1px solid var(--line-2); }
.ai-use-bar { flex: 1; min-width: 0; border-radius: 2px 2px 0 0; background: var(--line-2); }
.ai-use-bar.is-today { background: var(--accent); }
.ai-use-limit { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--red); }
.ai-use-limit span { position: absolute; right: 0; bottom: 2px; padding: 0 4px; background: var(--page); font-size: 0.6875rem; color: var(--red); }
.panel .ai-use-foot { display: flex; justify-content: space-between; border-top: 0; padding-top: 4px; font-size: 0.75rem; color: var(--ink-3); }
@media (max-width: 720px) {
  .ai-key-row { grid-template-columns: 1fr auto; }
  .ai-key-set { grid-row: 2; grid-column: 1 / -1; }
}

/* Conversations (US-042, US-043): the thread and its question box beside the conversation's documents. Questions sit
   right in a quiet well; answers read as text, their [n] marks small links to the page cited. */
.convo { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.convo .panel + .panel { margin-top: 0; }
.convo-main { display: flex; flex-direction: column; min-height: min(70vh, 640px); }
.convo-thread { flex: 1; display: flex; flex-direction: column; gap: 18px; padding: 20px 20px 8px; }
.convo-intro { margin: auto 0; padding: 24px 0; max-width: 34rem; align-self: center; text-align: center; }
.convo-intro > .icon { width: 22px; height: 22px; color: var(--navy); }
.convo-intro h2 { margin: 8px 0 6px; font-size: 1.0625rem; font-weight: 600; }
.convo-intro p { color: var(--ink-2); }
.convo-suggest { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; }
.convo-suggest button { padding: 6px 12px; border: 1px solid var(--line-2); border-radius: var(--r-pill); background: var(--page); color: var(--ink); font: inherit; font-size: 0.8125rem; cursor: pointer; }
.convo-suggest button:hover { background: var(--hover); }
.convo-suggest button:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-ring); border-color: var(--accent); }
.msg { scroll-margin-top: 64px; }
.msg--q { align-self: flex-end; max-width: min(80%, 36rem); padding: 9px 13px; border-radius: 12px 12px 4px 12px; background: var(--side); border: 1px solid var(--line); }
.msg--q p { margin: 0; white-space: pre-wrap; }
.msg-at { font-size: 0.75rem; color: var(--ink-4); }
.msg--q .msg-at { display: block; margin-top: 2px; text-align: right; }
.msg--a { max-width: 44rem; }
.msg-by { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; font-size: 0.75rem; font-weight: 500; color: var(--ink-3); }
.msg-by .icon { width: 14px; height: 14px; color: var(--navy); }
.msg-text { font-size: 0.9375rem; line-height: 1.6; }
.msg-text p:last-child { margin-bottom: 0; }
.msg-text.is-streaming::after { content: ""; display: inline-block; width: 7px; height: 1em; margin-left: 2px; background: var(--ink-3); vertical-align: -2px; animation: convo-caret 1s steps(2) infinite; }
@keyframes convo-caret { 50% { opacity: 0; } }
.msg-wait { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-3); font-size: 0.875rem; }
.msg-wait::before { content: ""; width: 14px; height: 14px; border: 2px solid var(--line-2); border-top-color: var(--accent); border-radius: 50%; animation: convo-spin 0.8s linear infinite; }
@keyframes convo-spin { to { rotate: 360deg; } }
.cite { display: inline-block; min-width: 1.35em; margin: 0 1px; padding: 0 4px; border-radius: var(--r-tag); background: var(--accent-wash); color: var(--accent-deep); font-size: 0.6875rem; font-weight: 600; line-height: 1.5; text-align: center; text-decoration: none; vertical-align: 2px; }
.cite:hover { background: var(--accent); color: #fff; text-decoration: none; }
.msg-sources { margin: 10px 0 0; padding: 8px 0 0 1.6em; border-top: 1px solid var(--line); font-size: 0.8125rem; color: var(--ink-2); }
.msg-sources li { padding: 1px 0; }
.msg-sources li::marker { color: var(--accent-deep); font-weight: 600; font-size: 0.75rem; }
.msg--withheld { display: flex; gap: 10px; align-items: flex-start; max-width: 44rem; padding: 10px 12px; border: 1px dashed var(--line-2); border-radius: var(--r-pop); background: var(--well); color: var(--ink-2); font-size: 0.875rem; }
.msg--withheld .icon { flex: none; margin-top: 2px; color: var(--navy); }
.msg--withheld p { margin: 0; }
.msg--withheld b { color: var(--ink); font-weight: 600; }
.msg--failed { border-color: var(--red-line); background: var(--red-wash); }
.msg--failed .icon { color: var(--red); }
.msg--note { align-self: center; margin: 0; padding: 2px 10px; border-radius: var(--r-pill); background: var(--side); font-size: 0.75rem; color: var(--ink-3); text-align: center; }
.convo-ask { position: sticky; bottom: 0; padding: 12px 20px 16px; background: linear-gradient(to bottom, rgb(255 255 255 / 0), var(--page) 14px); border-radius: 0 0 var(--r-pop) var(--r-pop); }
.convo-ask .callout { margin-bottom: 10px; }
.convo-box { border: 1px solid var(--line-2); border-radius: 10px; background: var(--page); box-shadow: 0 1px 2px rgb(15 15 15 / 0.04); transition: border-color 120ms var(--ease-out), box-shadow 120ms var(--ease-out); }
.convo-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.convo-box textarea { display: block; width: 100%; min-height: 56px; max-height: 40vh; padding: 11px 13px 4px; border: 0; background: none; color: var(--ink); font: inherit; font-size: 0.9375rem; line-height: 1.5; resize: none; field-sizing: content; }
.convo-box textarea:focus { outline: none; }
.convo-box textarea::placeholder { color: var(--ink-4); }
.convo-box-bar { display: flex; align-items: center; gap: 10px; padding: 6px 8px 8px 10px; }
.convo-box-hint { flex: 1; min-width: 0; font-size: 0.75rem; color: var(--ink-3); }
.convo-box-note { display: flex; align-items: center; gap: 6px; margin: 0; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--well); border-radius: 10px 10px 0 0; font-size: 0.8125rem; color: var(--ink-2); }
.convo-model select { height: 28px; padding: 0 26px 0 8px; border: 1px solid var(--line); border-radius: var(--r); appearance: none; color: var(--ink-2); font: inherit; font-size: 0.75rem; cursor: pointer;
  background: var(--side) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%236f6e69' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4.5 6.25 3.5 3.5 3.5-3.5'/%3E%3C/svg%3E") no-repeat right 6px center / 12px; }
.convo-model select:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.ai-athena-model { margin: 0 0 12px; }
.convo-model--fixed { display: inline-flex; align-items: center; height: 28px; padding: 0 8px; border: 1px solid var(--line); border-radius: var(--r); color: var(--ink-2); font-size: 0.75rem; white-space: nowrap; }
.convo-blocked { display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--well); color: var(--ink-2); font-size: 0.875rem; }
.convo-blocked > .icon { flex: none; margin-top: 2px; color: var(--navy); }
.convo-blocked p { margin: 0; }
.convo-blocked p + p { margin-top: 4px; }
.convo-request { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.convo-request input { flex: 1; min-width: 12rem; height: 32px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: var(--r); font: inherit; font-size: 0.8125rem; }
.convo-request input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.convo-request .field-error { flex-basis: 100%; margin: 0; }
.convo-request--side { display: block; margin: 0; padding: 12px 14px; border-top: 1px solid var(--line); font-size: 0.8125rem; color: var(--ink-2); }
.convo-request--side p { margin: 0 0 8px; }
.convo-request--side input { width: 100%; }
.convo-docs { position: sticky; top: calc(var(--top-h) + 12px); }
.convo-doc-list { list-style: none; margin: 0; padding: 4px 0; }
.convo-doc { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 8px 40px 8px 14px; }
.convo-doc + .convo-doc { border-top: 1px solid var(--line); }
.convo-doc > a { font-size: 0.8125rem; font-weight: 500; color: var(--ink); text-decoration: none; line-height: 1.4; }
.convo-doc > a:hover { color: var(--accent); text-decoration: underline; }
.convo-doc-no { font-variant-numeric: tabular-nums; color: var(--ink-3); font-weight: 400; }
.convo-doc-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: 0.75rem; color: var(--ink-3); }
.convo-doc-meta .marks { display: contents; }
.convo-doc.is-blocked > a { color: var(--ink-3); }
.convo-doc-remove { position: absolute; top: 6px; right: 8px; margin: 0; }
.convo-add-link { padding: 4px 14px 12px; }
.convo-add-link .btn .icon { width: 14px; height: 14px; margin-right: 4px; }
.convo-add { padding: 10px 14px 12px; border-top: 1px solid var(--line); }
.convo-find { display: flex; gap: 6px; }
.convo-find input { flex: 1; min-width: 0; height: 32px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: var(--r); font: inherit; font-size: 0.8125rem; }
.convo-find input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.convo-add-none { margin: 10px 0 6px; font-size: 0.8125rem; }
.convo-add-done { font-size: 0.8125rem; }
.convo-found { list-style: none; margin: 8px 0 0; padding: 0; max-height: 360px; overflow: auto; }
.convo-found li { padding: 2px 0; }
.convo-found li + li { border-top: 1px solid var(--line); }
.convo-found .check { padding: 6px 0; font-size: 0.8125rem; }
.convo-found .check b { display: inline; font-weight: 400; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.convo-found .check small { display: flex; flex-wrap: wrap; align-items: center; gap: 0 4px; font-size: 0.75rem; }
.convo-found li.is-off .check { cursor: default; color: var(--ink-3); }
.convo-found-ask { display: inline-block; margin: 0 0 6px 26px; font-size: 0.75rem; }
.convo-add-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 10px; font-size: 0.8125rem; }
.convo-docs-foot { margin: 0; padding: 10px 14px; border-top: 1px solid var(--line); font-size: 0.75rem; color: var(--ink-3); }
.convo-head .page-meta .icon { width: 13px; height: 13px; margin-right: 3px; vertical-align: -2px; }
.convo-rename { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 0.875rem; }
.convo-rename input { width: min(28rem, 100%); height: 36px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: var(--r); font: inherit; font-size: 1.125rem; font-weight: 600; }
.convo-rename input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.convo-rename .field-error { flex-basis: 100%; margin: 0; }
.convo-confirm { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 16px; padding: 12px 14px; background: var(--red-wash); border-color: var(--red-line); }
.convo-confirm .danger-text { margin: 0; color: var(--ink); }
.convo-gone .empty { padding: 32px 24px; }
.convo-list { list-style: none; margin: 0; padding: 0; }
.convo-row { display: flex; align-items: center; gap: 16px; padding: 0 14px 0 0; }
.convo-row + .convo-row { border-top: 1px solid var(--line); }
.convo-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 11px 14px; color: var(--ink); text-decoration: none; }
.convo-row-main:hover { background: var(--hover); text-decoration: none; }
.convo-row-main:hover .convo-row-title { color: var(--accent); }
.convo-row-title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.convo-row-docs { font-size: 0.8125rem; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.convo-row-when { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; font-size: 0.8125rem; color: var(--ink-3); white-space: nowrap; }
.convo-row.is-gone .convo-row-title { color: var(--ink-3); font-style: italic; }
@media (max-width: 960px) {
  .convo { grid-template-columns: minmax(0, 1fr); }
  .convo-docs { position: static; order: -1; }
}
@media (max-width: 640px) {
  .convo-thread { padding: 14px 12px 6px; }
  .convo-ask { padding: 10px 12px 12px; }
  .convo-box-hint { display: none; }
  .msg--q { max-width: 92%; }
}
@media (prefers-reduced-motion: reduce) { .msg-text.is-streaming::after, .msg-wait::before { animation: none; } }

/* Ask AI on a document's page: a button, or a menu once the person has conversations to add it to. */
.ask-menu > summary { list-style: none; }
.ask-menu > summary::-webkit-details-marker { display: none; }
.ask-menu > summary .icon--down { width: 12px; height: 12px; margin-left: 2px; }
.ask-pop { left: auto; right: 0; width: 20rem; }
.ask-pop .popover-item { font-size: 0.8125rem; font: inherit; font-size: 0.8125rem; cursor: pointer; }
.ask-pop .popover-item .icon { width: 14px; height: 14px; color: var(--ink-3); flex: none; }
.ask-pop-count { min-width: 1.4rem; padding: 0 5px; border-radius: var(--r-pill); background: var(--side); font-size: 0.6875rem; color: var(--ink-3); text-align: center; }
.ask-pop .popover-caption { border-top: 1px solid var(--line); margin: 4px -6px 0; padding: 8px 14px 4px; }

/* AI access (US-046): requests to decide, and each class's rules and people. */
.ai-requests { list-style: none; margin: 0; padding: 0; }
.ai-request { padding: 14px; }
.ai-request + .ai-request { border-top: 1px solid var(--line); }
.ai-request-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; }
.ai-request-head p { margin: 0; }
.ai-request-head b { font-weight: 600; }
.ai-request-when { font-size: 0.8125rem; color: var(--ink-3); }
.ai-request-docs { margin: 8px 0 0; padding: 0; list-style: none; font-size: 0.8125rem; }
.ai-request-docs li { padding: 1px 0; }
.ai-request-why { margin: 8px 0 0; padding: 2px 0 2px 10px; border-left: 3px solid var(--line-2); color: var(--ink-2); font-size: 0.875rem; }
.ai-request-decide { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.ai-request-decide input { flex: 1; min-width: 12rem; max-width: 28rem; height: 32px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: var(--r); font: inherit; font-size: 0.8125rem; }
.ai-request-decide input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.ai-request-decide .field-error { flex-basis: 100%; margin: 0; }
.ai-request-scope { margin: 6px 0 0; font-size: 0.75rem; color: var(--ink-3); }
.ai-decided { border-top: 1px solid var(--line); }
.ai-decided > summary { padding: 10px 14px; font-size: 0.8125rem; color: var(--ink-2); cursor: pointer; }
.ai-decided-note { display: block; font-size: 0.75rem; color: var(--ink-3); }
.ai-classes .title a { text-decoration: none; }
.ai-classes .title .flag { margin-left: 8px; background: var(--navy); color: #fff; }
.ai-classes-sub { display: block; font-size: 0.75rem; }
.ai-class-tag { margin-left: 10px; align-self: center; }
.ai-who-note { margin: 0; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--well); font-size: 0.8125rem; color: var(--ink-2); }
.ai-who-role { display: block; font-size: 0.75rem; }
.ai-who-role .flag { font-size: 0.6875rem; }
.ai-who.is-quiet td { color: var(--ink-3); }
.ai-perm { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.ai-perm select { height: 30px; padding: 0 28px 0 10px; border: 1px solid var(--line-2); border-radius: var(--r); appearance: none; font: inherit; font-size: 0.8125rem; color: var(--ink);
  background: var(--page) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%236f6e69' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4.5 6.25 3.5 3.5 3.5-3.5'/%3E%3C/svg%3E") no-repeat right 8px center / 12px; }
.ai-perm select:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.ai-perm .field-error { flex-basis: 100%; margin: 0; }
.js .ai-perm-save { display: none; }

/* Access class owners (US-045): a toggle beside each holder in the class's panel. */
.holder-list--owners li { align-items: center; }
.holder-list--owners li > span { margin-left: auto; }
.owner-form { margin: 0; }
/* Users: what a role needs shows with it (US-072). A limited member has Sees only, and no delete rights or read-only. */
form:not(:has(input[type="radio"][value="Limited"]:checked)) [data-for-role="Limited"] { display: none; }
form:has(input[type="radio"][value="Limited"]:checked) [data-for-role="Member"] { display: none; }
.sees-only { margin-top: 12px; }
.plan-option { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.plan-option { cursor: default; }
.plan-option .check { flex: 1; min-width: 12rem; cursor: pointer; }
.plan-option:not(:has(input:checked)) .plan-folder { display: none; }
.sees-only legend { margin-top: 14px; }
.plan-folder select { max-width: 16rem; height: 30px; font-size: 0.8125rem; }
/* Read-only in a class (US-071): the same switch as Owner, beside it. */
.holder-list--owners li > span + .readonly-form { margin-left: 0; }
.tag--quiet { background: var(--well); color: var(--ink-2); }
.owner-toggle { display: inline-flex; align-items: center; gap: 3px; height: 24px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: var(--r-pill); background: var(--page); color: var(--ink-3); font: inherit; font-size: 0.75rem; cursor: pointer; }
.owner-toggle:hover { background: var(--hover); color: var(--ink); }
.owner-toggle[aria-pressed="true"] { border-color: transparent; background: var(--navy); color: #fff; }
.owner-toggle .icon { width: 12px; height: 12px; }
.owner-toggle:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-ring); }
.owns-mark { margin-left: 6px; padding: 0 6px; border-radius: var(--r-pill); background: var(--navy); color: #fff; font-size: 0.6875rem; font-weight: 500; line-height: 1.6; white-space: nowrap; }
.owns-mark--col { display: inline-block; margin: 4px 0 0; }

/* Notes on documents and entities (US-047): a thread under the details, Markdown shown formatted. */
.notes .note-form { padding: 10px 14px 12px; border-bottom: 1px solid var(--line); }
.note-tabs { gap: 2px; margin-bottom: 6px; }
.js .note-tabs { display: flex; }
.note-tabs button { padding: 3px 10px; border: 0; border-radius: var(--r); background: none; color: var(--ink-3); font: inherit; font-size: 0.75rem; font-weight: 500; cursor: pointer; }
.note-tabs button[aria-selected="true"] { background: var(--hover); color: var(--ink); }
.note-form textarea { display: block; width: 100%; min-height: 64px; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--page); color: var(--ink); font: inherit; font-size: 0.8125rem; line-height: 1.5; resize: vertical; }
.note-form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.note-form textarea[aria-invalid="true"] { border-color: var(--red); }
.note-preview { min-height: 64px; padding: 8px 10px; border: 1px dashed var(--line-2); border-radius: var(--r); background: var(--well); font-size: 0.8125rem; }
.note-preview[hidden] { display: none; }
.note-form-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px 10px; margin-top: 8px; font-size: 0.8125rem; }
.note-hint { flex: 1; min-width: 10rem; font-size: 0.6875rem; color: var(--ink-4); }
.js .js-hide { display: none; }
.note-list { list-style: none; margin: 0; padding: 0; }
.note { padding: 10px 14px; scroll-margin-top: 64px; }
.note + .note { border-top: 1px solid var(--line); }
.note-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; font-size: 0.75rem; color: var(--ink-3); }
.note-head b { color: var(--ink); font-weight: 600; font-size: 0.8125rem; }
.note-actions { display: inline-flex; gap: 10px; margin-left: auto; }
.note-actions a { font-size: 0.75rem; }
.note-text { margin-top: 4px; font-size: 0.8125rem; line-height: 1.55; overflow-wrap: anywhere; }
.note-text > :last-child { margin-bottom: 0; }
.note .note-form { padding: 6px 0 0; border: 0; }
.note-confirm { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 8px; padding: 8px 10px; border-radius: var(--r); background: var(--red-wash); font-size: 0.8125rem; }
.note-confirm p { flex-basis: 100%; margin: 0; }
.note-confirm--reason input { flex: 1; min-width: 10rem; height: 30px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: var(--r); font: inherit; font-size: 0.8125rem; }
.note-confirm .field-error { flex-basis: 100%; margin: 0; }
.note-confirm-actions { display: inline-flex; align-items: center; gap: 10px; }
.doc-convos { list-style: none; margin: 0; padding: 4px 0; }
.doc-convos a { display: flex; flex-direction: column; padding: 6px 14px; color: var(--ink); text-decoration: none; font-size: 0.8125rem; }
.doc-convos a:hover { background: var(--hover); text-decoration: none; }
.doc-convos a:hover span { color: var(--accent); }
.doc-convos small { font-size: 0.75rem; color: var(--ink-3); }
.doc-convos .is-gone span { color: var(--ink-3); font-style: italic; }
.popover-caption--first { border-top: 0 !important; margin-top: 0 !important; }
.note-text h1, .note-preview h1 { font-size: 1.0625rem; }
.note-text h2, .note-preview h2 { font-size: 0.9375rem; }
.note-text h3, .note-text h4, .note-preview h3, .note-preview h4 { font-size: 0.875rem; }
.note-text h1, .note-text h2, .note-text h3, .note-text h4 { margin: 0.6em 0 0.3em; }
.note-text > h1:first-child, .note-text > h2:first-child, .note-text > h3:first-child { margin-top: 0.2em; }
.ask-pop-convo .name small { display: block; font-size: 0.6875rem; color: var(--ink-3); font-weight: 400; }
.ask-pop-convo { align-items: flex-start; padding-top: 6px; padding-bottom: 6px; }
.ask-pop-convo .icon { margin-top: 2px; }

/* The note editor (US-047): a dialog, the note beside its live preview; stacked on a phone. */
.note-dialog { width: min(1080px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0; border: 0; border-radius: 12px; background: var(--page); color: var(--ink); box-shadow: var(--pop-shadow); }
.note-dialog::backdrop { background: rgb(15 15 15 / 0.42); }
.note-editor { display: flex; flex-direction: column; max-height: calc(100vh - 32px); }
.note-editor-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px 10px; border-bottom: 1px solid var(--line); }
.note-editor-head h2 { margin: 0; font-size: 1rem; font-weight: 600; }
.note-panes { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.note-pane { display: flex; flex-direction: column; min-height: 0; padding: 12px 18px; }
.note-pane + .note-pane { border-left: 1px solid var(--line); background: var(--well); }
.note-pane-label { margin-bottom: 6px; font-size: 0.75rem; font-weight: 600; color: var(--ink-3); text-transform: none; }
.note-pane textarea { flex: 1; min-height: 320px; width: 100%; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--page); color: var(--ink); font: 0.875rem/1.55 ui-monospace, "Cascadia Mono", Consolas, monospace; resize: none; }
.note-pane textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.note-pane .note-preview { flex: 1; min-height: 320px; overflow: auto; padding: 10px 12px; border: 1px solid var(--line); border-style: solid; background: var(--page); font-size: 0.875rem; line-height: 1.55; }
.note-editor > .md-help { margin: 0 18px; border-top: 1px solid var(--line); }
.note-editor-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 12px 18px 14px; border-top: 1px solid var(--line); }
.note-editor-count { flex: 1; font-size: 0.75rem; color: var(--ink-3); }
.md-help { font-size: 0.75rem; color: var(--ink-3); }
.md-help > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; padding: 8px 0; cursor: pointer; list-style: none; }
.md-help > summary::-webkit-details-marker { display: none; }
.md-help code { padding: 0 4px; border-radius: 3px; background: var(--side); font: 0.6875rem ui-monospace, "Cascadia Mono", Consolas, monospace; color: var(--ink-2); }
.md-help-more { margin-left: auto; color: var(--accent); font-weight: 500; }
.md-help-more::after { content: " ▾"; }
.md-help[open] .md-help-more::after { content: " ▴"; }
.md-help-table { width: 100%; border-collapse: collapse; margin-bottom: 6px; }
.md-help-table th, .md-help-table td { padding: 5px 8px; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
.md-help-table thead th { font-weight: 600; color: var(--ink-3); border-top: 0; }
.md-help-table tbody th { font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.md-help-table pre { margin: 0; font: 0.6875rem/1.5 ui-monospace, "Cascadia Mono", Consolas, monospace; color: var(--ink); white-space: pre-wrap; }
.md-help-table td.md { color: var(--ink); font-size: 0.75rem; }
.md-help-table td.md > :last-child { margin-bottom: 0; }
.md-help-table td.md h1, .md-help-table td.md .md-h1 { font-size: 0.9375rem; font-weight: 650; line-height: 1.25; margin: 0 0 2px; } .md-help-table td.md h2, .md-help-table td.md .md-h2 { font-size: 0.8125rem; font-weight: 650; line-height: 1.25; margin: 0; }
.js .md-help-table tbody tr { cursor: pointer; }
.js .md-help-table tbody tr:hover { background: var(--accent-wash); }
.note-dialog .md-help { max-height: 40vh; overflow: auto; }
/* The editor for a text or Markdown file (US-069): the notes editor's panes, on the page instead of in a dialog. */
.text-editor { border: 1px solid var(--line); border-radius: var(--r); background: var(--page); overflow: hidden; }
.text-panes { min-height: 26rem; }
.text-editor.is-plain .text-panes, .text-panes:has(> [data-text-preview-pane][hidden]) { grid-template-columns: 1fr; }
.text-panes .note-pane textarea, .text-panes .note-pane .note-preview { min-height: 24rem; max-height: 70vh; }
.text-md-help { margin: 0 18px; border-top: 1px solid var(--line); }
.text-md-help[hidden] { display: none; }
.text-md-help[open] { max-height: 22rem; overflow: auto; }
.text-md-help tbody tr { cursor: pointer; }
.text-md-help tbody tr:hover td, .text-md-help tbody tr:hover th { background: var(--well); }
.js .text-preview-btn { display: none; }
.text-write { margin-bottom: 16px; }
.text-write-foot { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; padding: 12px 16px; border-top: 1px solid var(--line); }
.text-write-foot .form-field { flex: 1 1 18rem; margin: 0; }
.text-write-foot .panel-form-actions { margin: 0; padding: 0; border: 0; }
.newfile { max-width: 72rem; }
.newfile-top { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 0 24px; padding: 16px; }
.newfile-top .form-field { margin-bottom: 14px; }
.newfile-about { margin: 0; font-size: 0.8125rem; color: var(--ink-2); }
.newfile-about .tag { vertical-align: 1px; }
.newfile-fields { padding: 0 16px 4px; border-top: 1px solid var(--line); }
.newfile-fields h2 { margin: 14px 0 10px; font-size: 0.8125rem; font-weight: 600; color: var(--ink-2); }
.newfile-fields-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: 0 20px; }
.newfile-editor { padding: 0 16px 16px; }
.newfile-foot { display: flex; align-items: center; justify-content: flex-end; gap: 14px; padding: 12px 16px; border-top: 1px solid var(--line); }
.newfile-foot .text-count { margin-right: auto; font-size: 0.8125rem; color: var(--ink-3); }
@media (max-width: 760px) {
  .newfile-top { grid-template-columns: 1fr; }
  .text-panes { grid-template-columns: 1fr; }
  .text-panes .note-pane + .note-pane { border-left: 0; border-top: 1px solid var(--line); }
}
.md-help-foot { margin: 4px 0 8px; }
.notes .panel-bar .btn .icon { width: 13px; height: 13px; margin-right: 3px; }
.note-form .md-help { margin-top: 6px; }
@media (max-width: 760px) {
  .note-dialog { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; }
  .note-editor { height: 100dvh; max-height: 100dvh; }
  .note-panes { grid-template-columns: 1fr; overflow: auto; }
  .note-pane + .note-pane { border-left: 0; border-top: 1px solid var(--line); }
  .note-pane textarea, .note-pane .note-preview { min-height: 180px; }
}

/* Ask about an entity (US-048): the documents to pick, by type, in a date range. */
.pick-filter { padding: 12px 20px; border-bottom: 1px solid var(--line); }
.pick-dates { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 0.8125rem; color: var(--ink-2); }
.pick-dates input[type="date"] { height: 30px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: var(--r); font: inherit; font-size: 0.8125rem; color: var(--ink); background: var(--page); }
.pick-undated { display: inline-flex; align-items: center; gap: 5px; }
.pick-ranges { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0 0; }
.pick-ranges a { padding: 2px 10px; border: 1px solid var(--line-2); border-radius: var(--r-pill); font-size: 0.75rem; color: var(--ink-2); text-decoration: none; }
.pick-ranges a:hover { background: var(--hover); }
.pick-ranges a[aria-current="true"] { border-color: transparent; background: var(--navy); color: #fff; }
.pick-form { flex: 1; display: flex; flex-direction: column; }
.pick-list { margin: 0; padding: 0; max-width: none; text-align: left; align-self: stretch; }
.pick-list[hidden] { display: none; }
.pick-all { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; padding: 4px 0 8px; border-bottom: 1px solid var(--line); }
.pick-all .check { padding: 4px 0; }
.pick-count { font-size: 0.8125rem; color: var(--ink-3); }
.pick-count.is-over { color: var(--red); font-weight: 500; }
.pick-hidden { margin: 8px 0 0; font-size: 0.8125rem; color: var(--ink-3); }
.pick-group { margin: 12px 0 0; padding: 0; border: 0; }
.pick-group legend { padding: 0; width: 100%; }
.pick-group legend .check { padding: 4px 0; }
.pick-group legend small { display: inline; margin-left: 6px; }
.pick-group ul { list-style: none; margin: 0 0 0 26px; padding: 0; }
.pick-group li { border-top: 1px solid var(--line); }
.pick-group .check--row { padding: 6px 0; font-size: 0.8125rem; }
.pick-group .check--row small { display: flex; flex-wrap: wrap; align-items: center; gap: 0 4px; font-size: 0.75rem; }
.pick-group li.is-off .check { cursor: default; color: var(--ink-3); }
.pick-no { font-variant-numeric: tabular-nums; color: var(--ink-3); }
.pick-about { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; font-size: 0.8125rem; }
.pick-about p { margin: 8px 0 0; color: var(--ink-2); }
.convo-about a { font-weight: 500; }
.pick-group legend .check b, .pick-all .check b { display: inline; }
.pick-group legend .check small { display: inline; margin-left: 6px; }
.pick-add-bar { display: flex; align-items: center; justify-content: flex-end; gap: 14px; font-size: 0.875rem; border-top: 1px solid var(--line); }
.pick-group li.is-in .check { color: var(--ink-2); }

/* ---- OptiTrust (US-049 to US-053) ---- */
.ot-top { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; align-items: start; margin-bottom: 16px; }
.ot-top > .panel { margin: 0; }
.ot-choices { border: 0; margin: 0; padding: 0; }
.ot-balance { padding: 14px 16px 16px; }
.ot-balance-n { margin: 0 0 10px; font-size: 0.875rem; color: var(--ink-2); }
.ot-balance-n b { font-size: 2rem; font-weight: 650; letter-spacing: -0.02em; color: var(--ink); font-variant-numeric: tabular-nums; margin-right: 4px; }
.ot-rates { margin: 0; display: grid; gap: 6px; }
.ot-rates div { display: flex; justify-content: space-between; gap: 12px; font-size: 0.8125rem; border-top: 1px solid var(--line); padding-top: 6px; }
.ot-rates dt { color: var(--ink-3); }
.ot-rates dd { margin: 0; color: var(--ink); text-align: right; }
.ot-stale { margin: 10px 0 0; font-size: 0.8125rem; }
.ot-people select { width: 100%; max-width: 15rem; }
.ot-people .form-field { margin: 0; }
.ot-people th[scope="row"] { font-weight: 600; }
.ot-people .sub { display: block; font-weight: 400; color: var(--ink-3); font-size: 0.8125rem; }
.ot-people-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 14px; border-top: 1px solid var(--line); }
.ot-people-actions p { margin: 0; font-size: 0.8125rem; }
@media (max-width: 900px) {
  .ot-top { grid-template-columns: 1fr; }
  .ot-people-actions { flex-direction: column; align-items: stretch; }
}
.ot-spend { padding: 6px 14px 14px; max-width: 40rem; }
.ot-spend .panel-form-actions { justify-content: flex-start; margin-top: 10px; }
.ot-people select { height: 34px; font-size: 0.875rem; }

/* Seal with OptiTrust (US-050) */
.tag--seal { display: inline-flex; align-items: center; gap: 3px; background: var(--tag-blue); color: var(--navy); margin-left: 6px; }
.tag--seal .icon { width: 12px; height: 12px; }
.seal-panel .panel-title { display: inline-flex; align-items: center; gap: 6px; }
.seal-form { padding: 14px 16px 16px; }
.seal-lead { margin: 0 0 14px; font-size: 0.875rem; color: var(--ink-2); max-width: 46rem; }
.seal-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px 28px; align-items: start; }
.seal-where { border: 0; margin: 0; padding: 0; }
.seal-where legend { font-size: 0.875rem; font-weight: 600; margin-bottom: 4px; }
.seal-canvas { position: relative; border: 1px solid var(--line-2); border-radius: var(--r); background: #fff; cursor: crosshair; max-width: 320px; overflow: hidden; }
.seal-canvas img { display: block; width: 100%; height: auto; }
.seal-mark { position: absolute; display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border: 1.5px solid var(--navy); border-radius: 999px;
  background: color-mix(in srgb, #fff 85%, var(--tag-blue)); color: var(--navy); font-size: 0.75rem; font-weight: 600; pointer-events: none; translate: 0 0; }
.seal-cost { margin-right: auto; font-size: 0.8125rem; }
@media (max-width: 900px) { .seal-grid { grid-template-columns: 1fr; } }

/* Public links (US-076): the Share panel, the card, the list, and the page an outsider opens */
.share-panel .panel-title { display: inline-flex; align-items: center; gap: 6px; }
.share-form, .share-made { padding: 14px 16px 16px; }
.share-lead { margin: 0 0 14px; font-size: 0.875rem; color: var(--ink-2); max-width: 46rem; }
.share-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px 28px; align-items: start; }
.share-grid .form-field { margin-bottom: 10px; }
.share-version { border: 0; margin: 0; padding: 0; }
.share-version legend { font-size: 0.875rem; font-weight: 600; margin-bottom: 2px; }
.share-forms { margin-bottom: 12px; }
.share-form-body { max-width: 46rem; }
.copy-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 0 0 8px; }
.copy-row .field-hint { margin: 0 8px 0 0; }
.copy-box { flex: 1; min-width: 0; height: 34px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--well); color: var(--ink); font: inherit; font-size: 0.8125rem; }
.copy-box--code { display: block; width: 100%; height: auto; padding: 8px 10px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 0.75rem; line-height: 1.45; resize: vertical; }
.link-card-frame { display: inline-block; margin: 0 0 12px; padding: 16px; border-radius: var(--r); background: var(--canvas); }
.doc-public-links .icon { width: 12px; height: 12px; margin-right: 4px; vertical-align: -1px; }
.links-tabs { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin: 0 0 14px; }
.links-longest, .links-change { margin-bottom: 16px; }
.links-change .share-grid > .field-hint, .links-change .panel-form-actions { grid-column: 1 / -1; }
.links-change fieldset { border: 0; margin: 0; padding: 0; }
.links-change fieldset legend { font-size: 0.875rem; font-weight: 600; }
.links-change .reveal-field { margin-top: 6px; }
.public-link-row { align-items: flex-start; }
.public-link-icon { flex: none; width: 32px; height: 32px; margin-top: 2px; }
.public-link-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 0.9375rem; }
.public-link-head .tag { display: inline-flex; align-items: center; gap: 3px; }
.public-link-head .tag .icon { width: 11px; height: 11px; }
.public-links .plan-row-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.public-link-purpose { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--ink-2); }
.public-link-when { flex: none; font-size: 0.8125rem; color: var(--ink-2); white-space: nowrap; padding-top: 2px; }
.public-link-when.ending b { color: #a85d00; }
.public-links-switch { margin: 0 0 4px; }
.confirm-inline { margin: 4px 0 10px; padding: 10px 12px; border: 1px solid var(--red-line); border-radius: var(--r); background: var(--red-wash); font-size: 0.8125rem; }
.confirm-inline p { margin: 0 0 8px; }
.confirm-inline form { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.public-link-tenant { margin: 0 0 18px; font-size: 1rem; font-weight: 600; color: var(--ink); }
.public-file { display: flex; align-items: center; gap: 14px; margin: 18px 0 22px; padding: 14px 16px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--page); }
.public-file-icon { flex: none; }
.public-file-title { margin: 0; font-size: 1rem; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.public-file-meta { margin: 2px 0 0; font-size: 0.8125rem; color: var(--ink-3); }
.public-link-foot { margin-top: 26px; font-size: 0.75rem; color: var(--ink-3); }
@media (max-width: 900px) { .share-grid { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .public-link-row { flex-wrap: wrap; }
  .public-link-when { order: 3; width: 100%; padding-left: 42px; }
  .public-link-row .row-actions { order: 4; width: 100%; padding-left: 42px; flex-wrap: wrap; }
}

/* The Bank check panel (US-051) */
.bank-check .panel-title { display: inline-flex; align-items: center; gap: 6px; }
.bank-empty, .bank-result, .bank-form { padding: 12px 14px 14px; }
.bank-empty p { margin: 0 0 10px; font-size: 0.875rem; color: var(--ink-2); }
.bank-why { font-size: 0.8125rem !important; }
.bank-verdict { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 0 0 8px; font-size: 1.125rem; font-weight: 650; letter-spacing: -0.01em; }
.bank-verdict::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--ink-4); align-self: center; }
.bank-verdict--ok::before { background: #2f8a50; }
.bank-verdict--warn::before { background: #c27a12; }
.bank-verdict--bad::before { background: var(--red); }
.bank-verdict--bad { color: var(--red); }
.bank-verdict--none::before { display: none; }
.bank-risk { font-size: 0.8125rem; font-weight: 500; color: var(--ink-3); }
.bank-issues { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 6px; }
.bank-issue { position: relative; padding-left: 16px; font-size: 0.8125rem; color: var(--ink-2); line-height: 1.45; }
.bank-issue::before { content: ""; position: absolute; left: 2px; top: 0.5em; width: 7px; height: 7px; border-radius: 50%; background: var(--ink-4); }
.bank-issue--danger::before { background: var(--red); }
.bank-issue--warning::before { background: #c27a12; }
.bank-issue--info::before { background: var(--accent); }
.bank-by { margin: 8px 0 0; font-size: 0.75rem; color: var(--ink-3); }
.bank-locked { font-size: 0.8125rem; color: var(--ink-2); }
.bank-lead, .bank-prefill { margin: 0 0 12px; font-size: 0.8125rem; color: var(--ink-2); }
.bank-names { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.bank-form .form-field > input { width: 100%; height: 34px; font-size: 0.875rem; }
.bank-form .panel-form-actions { margin-top: 6px; }
.bank-form .panel-form-actions .muted { margin-right: auto; font-size: 0.8125rem; }
.bank-history { border-top: 1px solid var(--line); padding: 8px 14px 10px; font-size: 0.8125rem; }
.bank-history summary { cursor: pointer; color: var(--ink-2); }
.bank-history ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.spinner { display: inline-block; flex: none; width: 14px; height: 14px; border: 2px solid var(--line-2); border-top-color: var(--accent); border-radius: 50%; animation: convo-spin 0.8s linear infinite; align-self: center; }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

/* Statement packs (US-052, US-053) */
.pack-new { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.pack-new > .panel { margin: 0; }
.pack-side-body { padding: 12px 14px 4px; }
.pack-side-body .form-field > input, .pack-side-body .form-field > select { width: 100%; height: 34px; font-size: 0.875rem; }
.pack-side-body .form-field { margin-bottom: 12px; }
.pack-purpose { border: 0; margin: 0 0 8px; padding: 0; }
.pack-sub { margin: 14px 0 4px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 0.875rem; font-weight: 600; }
.pack-prefill { margin: 0 0 10px; font-size: 0.8125rem; }
.pack-side-foot { padding: 12px 14px 14px; border-top: 1px solid var(--line); }
.pack-side-foot p { margin: 8px 0 0; font-size: 0.8125rem; }
.btn--block { width: 100%; justify-content: center; }
.pack-state { font-weight: 600; }
.pack-state--ok { color: #2f8a50; }
.pack-state--warn { color: #b06a12; }
.pack-inline-form { padding: 14px; max-width: 40rem; }
.pack-inline-form .form-field > input { width: 100%; height: 36px; }
.pack-statements td.title a { font-weight: 500; }
.pack-statements .doc-meta { display: block; font-size: 0.75rem; color: var(--ink-3); }
.pack-verdict { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; white-space: nowrap; }
.pack-verdict::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-4); }
.pack-verdict.bank-verdict--ok::before { background: #2f8a50; }
.pack-verdict.bank-verdict--warn::before { background: #c27a12; }
.pack-verdict.bank-verdict--bad { color: var(--red); }
.pack-verdict.bank-verdict--bad::before { background: var(--red); }
.pack-verdict.bank-verdict--none::before { display: none; }
.pack-verdict small { font-weight: 400; color: var(--ink-3); }
.pack-found { font-size: 0.8125rem; color: var(--ink-2); max-width: 28rem; }
.pack-remove { width: 1%; text-align: right; }
.tx-summary { display: flex; flex-wrap: wrap; gap: 8px 28px; padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 0.875rem; }
.tx-summary p { margin: 0; color: var(--ink-2); }
.tx-summary b { color: var(--ink); font-variant-numeric: tabular-nums; }
.tx-filters { padding: 10px 14px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.tx-table td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.tx-table td.tx-in, .tx-summary .tx-in b { color: #2a7a48; }
.tx-source { font-size: 0.8125rem; max-width: 16rem; }
@media (max-width: 1000px) { .pack-new { grid-template-columns: 1fr; } }
.pick-group .check--row small > * { flex: none; }
@media (max-width: 860px) {
  /* People's details: each choice says which it is once the table's heads are gone. */
  .ot-people td.ot-pick { padding: 4px 14px; }
  .ot-people td.ot-pick::before { content: attr(data-label); display: block; margin-bottom: 3px; font-size: 0.75rem; color: var(--ink-3); }
  /* A pack's statements: the date under the title, Take out last; the transactions' amounts say what they are. */
  .pack-statements td.pack-remove { order: 9; width: auto; text-align: left; }
  .tx-table td.num::before { content: attr(data-label) " "; color: var(--ink-4); }
  .tx-table td.tx-source { order: 8; }
}
@media (max-width: 860px) { .panel .table.ot-people td.ot-pick { padding-left: 14px; padding-right: 14px; } }
.pick-list.pack-pick { padding: 6px 20px 18px; }
.pack-rate-note { margin: 0 0 12px; font-size: 0.75rem; line-height: 1.45; }
.ot-seal-note { margin: 4px 0 0; font-size: 0.8125rem; }
.form-field[hidden] { display: none; }
/* A pack's transactions, per bank account (US-053) */
.tx-account { border-top: 1px solid var(--line); }
.tx-account-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 8px 20px; padding: 12px 14px 10px; }
.tx-account-head h3 { margin: 0; font-size: 0.9375rem; font-weight: 600; }
.tx-account-head h3 small { font-weight: 400; color: var(--ink-3); font-size: 0.8125rem; }
.tx-acct-no { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 0.8125rem; font-weight: 500; color: var(--ink-2); margin-left: 4px; }
.tx-account-head p { margin: 3px 0 0; font-size: 0.8125rem; }
.tx-account-side { display: flex; align-items: center; gap: 14px; }
.tx-totals { margin: 0; display: flex; gap: 14px; font-size: 0.8125rem; color: var(--ink-2); }
.tx-totals b { color: var(--ink); font-variant-numeric: tabular-nums; }
.tx-totals .tx-in b { color: #2a7a48; }
.tx-cat select { height: 30px; border: 1px solid var(--line-2); border-radius: 999px; padding: 0 28px 0 12px; font-size: 0.8125rem; background: var(--page); color: var(--ink); }
.tx-category { font-size: 0.8125rem; color: var(--ink-2); }

/* ---- Data rooms (US-054, US-055) ---- */
.room-ends { display: inline-flex; align-items: center; gap: 8px; font-size: 0.8125rem; white-space: nowrap; }
.hold-choices > li:not(:has(form)) { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r); }
@media (max-width: 640px) {
  .plan-row:has(.room-ends) { flex-wrap: wrap; }
}
.room-add { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 0.8125rem; }
.room-left-out { color: var(--ink-2); }
.room-group { padding: 4px 14px 12px; border-bottom: 1px solid var(--line); }
.room-group:last-child { border-bottom: 0; }
.room-group-title { margin: 12px 0 4px; font-size: 0.875rem; font-weight: 600; }
.room-type-title { margin: 8px 0 2px; font-size: 0.75rem; font-weight: 600; color: var(--ink-3); text-transform: none; }
.room-docs { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.room-docs li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 4px 0; }
.room-preview { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 4px 0 12px; padding: 10px 12px; background: var(--page); border-radius: var(--r); font-size: 0.875rem; }
.room-preview p { margin: 0; flex: 1 1 14rem; }
.room-upload-to { margin: 6px 0 0 28px; }
.room-activity { display: grid; gap: 6px; margin: 0 0 12px; padding: 0; list-style: none; font-size: 0.8125rem; }

/* ---- The guest frame (US-056): a data room guest's own small app ---- */
.guest-page { min-height: 100vh; display: flex; flex-direction: column; background: var(--canvas, var(--page)); }
.guest-bar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 10px 24px; background: var(--page); border-bottom: 1px solid var(--line); }
.guest-where { display: flex; align-items: center; gap: 10px; min-width: 0; margin-right: auto; color: var(--ink); text-decoration: none; }
.guest-where:hover { text-decoration: none; }
/* Outside a room (the help section) the bar shows Athena's mark: sized, so it doesn't squeeze the words beside it. */
.guest-where > svg { flex: none; width: 28px; height: 28px; }
.guest-where-text { display: grid; min-width: 0; line-height: 1.25; }
.guest-where-text small { font-size: 0.75rem; color: var(--ink-3); }
.guest-where-text b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.guest-menu { position: relative; }
.guest-menu > summary { display: flex; align-items: center; gap: 8px; padding: 4px 8px; border-radius: var(--r); cursor: pointer; list-style: none; font-size: 0.875rem; }
.guest-menu > summary::-webkit-details-marker { display: none; }
.guest-menu > summary:hover, .guest-menu[open] > summary { background: var(--hover); }
.guest-menu .popover { left: auto; right: 0; }
.guest-work { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 24px; }
.guest-foot { padding: 16px 24px; }
@media (max-width: 640px) {
  .guest-bar { padding: 8px 16px; gap: 8px; }
  .guest-name { display: none; }
  .guest-work { padding: 16px; }
}
.guest-tenant { display: flex; align-items: center; gap: 8px; }
.guest-wm-note { display: flex; align-items: center; gap: 6px; margin: 0 0 12px; }
.guest-find { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 6px; }
.guest-find .find-field { flex: 1 1 18rem; }
.guest-type { padding: 0 14px; }
.guest-docs { display: grid; margin: 0; padding: 0 14px 10px; list-style: none; }
.guest-docs li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.guest-docs li:last-child { border-bottom: 0; }
.guest-docs .icon { color: var(--ink-3); }
.guest-upload { padding: 14px; }
.guest-uploads-title { padding: 0 14px; }
.guest-crumbs { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 8px; font-size: 0.875rem; }
.guest-crumbs > a { display: inline-flex; align-items: center; gap: 4px; }
.guest-crumbs > a .icon { rotate: 180deg; }
.guest-pager { display: flex; gap: 6px; }
.guest-wm-wrap { min-width: 0; }
/* The watermark (US-056) as the page shows it; the real one is stamped into the pictures and downloads on the server. */
.guest-wm .viewer-sheet-wrap::after {
  content: var(--wm); position: absolute; inset: -10%; z-index: 2; display: grid; place-items: center;
  rotate: -28deg; white-space: pre; text-align: center; font-size: 0.8125rem; line-height: 1.6;
  color: rgb(40 40 40 / 0.16); pointer-events: none; overflow: hidden;
}
.guest-narrow { max-width: 34rem; margin: 8px auto 0; display: grid; gap: 12px; }
.guest-narrow .page-title { margin: 0; }
/* A select outside a form field (a filter beside a search box) looks like the form fields' selects. */
select.select {
  height: 38px; padding: 0 32px 0 11px; appearance: none;
  border: 1px solid var(--line-2); border-radius: var(--r); color: var(--ink); font-size: 0.875rem;
  background: var(--page) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%236f6e69' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4.5 6.25 3.5 3.5 3.5-3.5'/%3E%3C/svg%3E") no-repeat right 10px center / 14px;
  transition: border-color 120ms var(--ease-out), box-shadow 120ms var(--ease-out);
}
select.select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
select.select--sm { height: 32px; font-size: 0.8125rem; padding-right: 30px; background-position: right 8px center; }
.find-form select.select { height: 44px; border-radius: var(--r-pop); font-size: 0.9375rem; min-width: 11rem; }
.form-field .field-label { display: block; margin-bottom: 5px; font-size: 0.8125rem; font-weight: 500; color: var(--ink-2); }

/* A file plan's number columns: subtotals and the list's total or average (US-057) */
.plan-col { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; }
.plan-col .check { flex: 1 1 10rem; }
.plan-col--number:not(:has(input[type="checkbox"]:checked)) .plan-col-summary { display: none; }
.plan-col-summary { margin-left: 26px; }
.table .sum-row th, .table .sum-row td { font-weight: 600; font-variant-numeric: tabular-nums; border-top: 1px solid var(--line-2); background: var(--well); }
.table .sum-row th { font-size: 0.8125rem; color: var(--ink-2); text-align: left; }
.table .sum-row--total th, .table .sum-row--total td { border-top: 2px solid var(--line-2); background: var(--page); }
.table .sum-row .sum-kind { margin-right: 4px; font-size: 0.6875rem; font-weight: 500; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.03em; }
.table .sum-of { display: block; font-size: 0.6875rem; font-weight: 400; color: var(--ink-3); white-space: nowrap; }
.table .sum-row--total th .sum-of { display: inline; margin-left: 6px; }
/* Email intake (US-058): the address, held mail, allowed senders and recent mail. */
.mail-address-body { padding: 14px; }
.mail-address-body .facts { margin-bottom: 0; }
.mail-address-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 0 0 14px; }
.mail-address-text { padding: 6px 10px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--well); font-size: 0.9375rem; color: var(--ink); overflow-wrap: anywhere; }
.mail-address-text.is-off { color: var(--ink-3); text-decoration: line-through; }
.mail-held { margin: 0; padding: 0; list-style: none; }
.mail-held-item { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.mail-held-item:last-child { border-bottom: 0; }
.mail-held-text { min-width: 0; }
.mail-held-text p { margin: 0; }
.mail-held-from { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; font-size: 0.875rem; }
.mail-held-from > span:not(.flag) { color: var(--ink-3); font-size: 0.8125rem; }
.mail-held-subject { margin-top: 2px !important; color: var(--ink); }
.mail-held-files { display: flex; flex-wrap: wrap; gap: 2px 14px; margin: 6px 0 0; padding: 0; list-style: none; font-size: 0.8125rem; color: var(--ink-2); }
.mail-held-files .icon { width: 12px; height: 12px; vertical-align: -1px; color: var(--ink-3); }
.mail-held-when { margin-top: 6px !important; font-size: 0.75rem; }
.mail-held-warn { margin-top: 6px !important; padding: 6px 8px; border-radius: var(--r); background: var(--red-wash); color: var(--red-deep); font-size: 0.8125rem; }
.mail-held-actions { display: flex; flex: none; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.mail-flag--warn { background: var(--red-wash); color: var(--red-deep); }
.mail-flag--in { background: var(--tag-green); color: var(--tag-green-ink); }
.mail-flag--held { background: var(--tag-yellow); color: var(--tag-yellow-ink); }
.mail-allow { padding: 12px 14px; border-bottom: 1px solid var(--line); }
.mail-allow .form-field { margin: 0; }
.mail-allow-row { display: flex; gap: 8px; max-width: 32rem; }
.mail-allow-row input { flex: 1; min-width: 0; }
.mail-sender { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.mail-recent td.date { width: 1%; white-space: nowrap; }
.mail-recent td.title span, .mail-recent td.title small, .mail-recent td.mail-outcome small { display: block; }
.mail-recent td.title small, .mail-recent td.mail-outcome small { font-size: 0.75rem; color: var(--ink-3); }
.mail-recent td.mail-outcome { width: 34%; }
.mail-recent td.mail-outcome a { margin-left: 6px; font-size: 0.8125rem; }
.table-foot .pager { margin-left: auto; }
@media (max-width: 640px) {
  .mail-held-item { flex-direction: column; gap: 10px; }
  .mail-held-actions { justify-content: flex-start; }
  .mail-recent tr { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 6px; }
  .mail-recent td.title { order: -1; flex-basis: 100%; }
  .mail-recent tr > td.date { order: 1; width: auto; padding: 2px 0 0; font-size: 0.75rem; color: var(--ink-3); }
  .mail-recent tr > td.mail-outcome { order: 2; flex-basis: 100%; width: auto; padding-top: 4px; }
}
.mail-allow-row input { height: 36px; font-size: 0.875rem; }
.mail-allow-row .btn { height: 36px; }
.intake-change { margin-left: 8px; }
.mailbox-state { display: flex; align-items: center; gap: 6px; font-size: 0.8125rem; color: var(--ink-3); }
.mailbox-state .icon { width: 13px; height: 13px; }
/* The public API reference (US-060): a reading page in the gate's frame, top-aligned and wide. */
.gate-side > main:has(.dev-page) { justify-content: flex-start; }
.dev-page { width: 100%; max-width: 1180px; margin: 0 auto; padding: 24px 20px 64px; }
.dev-head { padding-bottom: 22px; margin-bottom: 26px; border-bottom: 1px solid var(--line); }
.dev-kicker { margin: 0 0 4px; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent-deep); }
.dev-head h1 { margin: 0 0 8px; font-size: 2rem; line-height: 1.15; }
.dev-lede { max-width: 46rem; margin: 0 0 12px; font-size: 1rem; line-height: 1.55; color: var(--ink-2); }
.dev-meta { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 0 0 16px; font-size: 0.8125rem; color: var(--ink-3); }
.dev-files { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.dev-files-note { flex-basis: 100%; font-size: 0.8125rem; color: var(--ink-3); }
.dev-head code, .dev-files-note code, .dev-note code, .dev-op-id code, .dev-errors code { padding: 1px 4px; border-radius: 3px; background: var(--well); font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 0.85em; color: var(--ink); overflow-wrap: anywhere; }
.dev-body { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: 40px; align-items: start; }
.dev-toc { position: sticky; top: 20px; max-height: calc(100dvh - 40px); overflow: auto; font-size: 0.8125rem; }
.dev-toc-title { margin: 0 0 8px; font-weight: 600; color: var(--ink-2); }
.dev-toc ol { margin: 0; padding: 0; list-style: none; }
.dev-toc ol ol { margin: 2px 0 6px 12px; }
.dev-toc a { display: block; padding: 3px 0; color: var(--ink-2); text-decoration: none; }
.dev-toc a:hover { color: var(--accent-deep); }
.dev-section { margin-bottom: 40px; scroll-margin-top: 16px; }
.dev-section > h2 { margin: 0 0 10px; font-size: 1.375rem; scroll-margin-top: 16px; }
.dev-group-summary { margin: 0 0 18px; color: var(--ink-2); }
.dev-op { margin-bottom: 18px; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--r-pop); background: var(--page); scroll-margin-top: 16px; }
.dev-op h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 4px; font-size: 1rem; }
.dev-route { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 0.9375rem; overflow-wrap: anywhere; }
.dev-method { padding: 1px 8px; border-radius: var(--r-tag); font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 0.75rem; font-weight: 700; }
.dev-method--get { background: var(--tag-blue); color: var(--tag-blue-ink); }
.dev-method--post { background: var(--tag-green); color: var(--tag-green-ink); }
.dev-method--delete { background: var(--red-wash); color: var(--red-deep); }
.dev-op-title { margin: 0 0 12px; font-weight: 600; }
.dev-op-id { margin-left: 8px; font-weight: 400; font-size: 0.8125rem; color: var(--ink-3); }
.dev-op-body h4 { margin-top: 1.1em; font-size: 0.8125rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-3); }
.dev-op-body table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.dev-op-body th, .dev-op-body td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.dev-op-body th { font-weight: 600; color: var(--ink-2); }
.dev-errors td.num { width: 1%; }
.dev-changes { margin: 0 0 12px; padding: 0; list-style: none; }
.dev-changes li { display: flex; flex-wrap: wrap; gap: 4px 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.dev-change-day { flex: none; width: 7.5rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.dev-changes li > span:last-child { flex: 1; min-width: 14rem; }
.dev-note { font-size: 0.875rem; color: var(--ink-2); }
@media (max-width: 900px) {
  .dev-body { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .dev-toc { position: static; max-height: none; margin-bottom: 24px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-pop); }
  .dev-op { padding: 14px; }
  .dev-head h1 { font-size: 1.625rem; }
}
.dev-errors td:nth-child(2) { white-space: nowrap; }

/* Linked documents (US-062): the panel, the finder, Athena's suggestions, a statement's transactions. */
.btn--xs { min-height: 24px; padding: 0 8px; font-size: 0.75rem; }
/* A document's own page (owner, 2026-10-12): Rename beside the title, and its entities linked in a panel of their own. */
.doc-rename { margin-left: 4px; flex: none; }
/* Templates (US-073). */
.templates-add { display: flex; flex-wrap: wrap; gap: 8px; }
.templates-filter { display: flex; align-items: center; gap: 8px; margin: 0; }
.templates-filter .link-find-box { height: 30px; min-width: 14rem; }
.templates-table .title .tag { margin-left: 8px; }
.send-in { margin: 0; }
.send-in-pick { cursor: pointer; }
.send-in-pick:focus-within { box-shadow: 0 0 0 3px var(--accent-ring); }
span.linked-doc { display: block; }
.doc-rename-form { max-width: 46rem; margin-bottom: 16px; }
/* Change type… (US-117): the type's fields to fill in, beside the values it has now. */
.page-meta .doc-type { display: inline-flex; align-items: center; gap: 6px; }
.page-meta .doc-retype { padding: 1px 8px; font-size: 0.75rem; }
.doc-retype-form { max-width: 58rem; margin-bottom: 16px; }
.retype-pick { max-width: 26rem; }
.retype-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 20px; margin-top: 6px; }
.retype-sub { margin: 0 0 8px; font-size: 0.8125rem; font-weight: 600; color: var(--ink-2); }
.retype-old { padding: 12px 14px; border-radius: var(--r); background: var(--page); box-shadow: inset 0 0 0 1px var(--line); align-self: start; }
.retype-values { display: grid; gap: 8px; margin: 0 0 10px; }
.retype-values dt { font-size: 0.75rem; color: var(--ink-3); }
.retype-values dd { margin: 0; overflow-wrap: anywhere; user-select: all; }
.retype-notes { display: grid; gap: 6px; margin: 14px 0 0; padding: 0; list-style: none; font-size: 0.8125rem; color: var(--ink-2); }
.retype-warn { display: flex; gap: 6px; align-items: flex-start; color: var(--ink); }
.retype-warn .icon { flex: none; width: 15px; height: 15px; margin-top: 2px; color: #b06a12; }
@media (max-width: 720px) { .retype-grid { grid-template-columns: 1fr; } .retype-old { order: -1; } }
.select-retype { margin: 10px 0 8px; max-width: 34rem; }
.entity-finder { display: grid; gap: 6px; padding: 4px 14px 14px; }
.entity-finder .link-find-row { align-items: center; }
.entity-finder .link-matches { margin-top: 2px; }
.entity-finder .link-matches form { margin: 0; }
/* A document's Linked to panel: the search that opens in place (owner, 2026-11-21). */
.doc-entities > .link-find { margin: 0 14px 14px; }
.doc-entities > .link-find .field-hint { margin: 6px 0 0; }
.entity-finder .field-hint { margin: 0; }
.doc-entities .linked-doc small { display: block; }
.linked { margin: 0; padding: 0; list-style: none; }
.linked li { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 10px 14px; }
.linked li + li { border-top: 1px solid var(--line); }
.linked-doc { display: grid; gap: 2px; min-width: 0; color: inherit; text-decoration: none; }
.linked-doc:hover b { color: var(--accent); text-decoration: underline; }
.linked-doc b { font-size: 0.875rem; font-weight: 600; }
.linked-doc span { font-size: 0.8125rem; color: var(--ink-2); overflow-wrap: anywhere; }
.linked-doc small { font-size: 0.75rem; color: var(--ink-3); }
.linked-line { display: inline-flex; gap: 4px; align-items: center; }
.linked-line .icon { width: 12px; height: 12px; }
.doc-panel-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 14px 14px; border-top: 1px solid var(--line); }
.link-finder { margin-bottom: 16px; }
.link-finder-line { display: flex; gap: 6px; align-items: center; margin: 0; padding: 10px 14px 0; font-size: 0.875rem; color: var(--ink-2); }
.link-filters { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-end; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.link-filter { display: grid; gap: 4px; font-size: 0.75rem; color: var(--ink-3); }
.link-filter input, .link-filter select { height: 32px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--page); color: var(--ink); font-size: 0.875rem; }
.link-filter--text { flex: 1 1 14rem; }
.link-filter--text input { width: 100%; }
.link-table .check-cell { width: 1%; }
.link-table label { display: grid; gap: 2px; cursor: pointer; }
.link-table label small { color: var(--ink-3); font-size: 0.75rem; }
.link-pick-actions { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: flex-end; padding: 10px 14px 14px; }
.link-pick-actions .muted { margin-right: auto; }
.doc-suggest { margin-bottom: 16px; }
.doc-suggest-note { display: flex; gap: 8px; align-items: center; margin: 0; padding: 12px 14px; font-size: 0.875rem; color: var(--ink-2); }
.doc-suggest-stale { color: var(--accent-deep); }
.doc-suggest-form { padding: 0 0 4px; }
.doc-suggest-group { margin: 0; padding: 10px 14px; border: 0; border-top: 1px solid var(--line); }
.doc-suggest-group legend { padding: 10px 0 4px; font-size: 0.75rem; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.04em; }
.doc-suggest-group ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.doc-suggest-group li.is-doubtful { border-radius: var(--r); box-shadow: 0 0 0 2px var(--accent-ring); padding: 2px 6px; }
.doc-suggest-group small { display: block; color: var(--ink-3); font-size: 0.75rem; }
.doc-suggest-change { color: var(--ink-2); }
.doc-suggest-actions { display: flex; gap: 8px; justify-content: flex-end; padding: 10px 14px; }
.doc-suggest-form .field-hint { padding: 0 14px 10px; margin: 0; text-align: right; }
.statement-lines { margin-top: 16px; }
.lines-table td.num, .lines-table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lines-linked { min-width: 14rem; }
.lines-link, .lines-suggest { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 0.8125rem; }
.lines-link + .lines-link, .lines-suggest { margin-top: 4px; }
.lines-suggest { color: var(--ink-2); }
.lines-suggest.is-doubtful span { color: var(--ink-3); }
.lines-more { display: inline-block; margin-top: 4px; font-size: 0.8125rem; }
.bank-lines { margin: 4px 0 12px; }
.bank-lines small { display: block; color: var(--ink-3); font-size: 0.75rem; }
.review-again-confirm { margin: 0 14px 12px; align-items: flex-start; }
/* Cutting a waiting document into the documents it is (US-075): its pages in a row, a tick where a document starts. */
.review-several a { font-weight: 600; white-space: nowrap; }
.review-cut { margin: 0 14px 12px; }
.doc-head-bar ~ .review-cut { margin: 0 0 16px; }
.review-cut-head { padding: 14px 14px 0; }
.review-cut form { padding: 12px 14px 14px; }
.cut-pages { display: flex; flex-wrap: wrap; gap: 12px 0; margin: 0 0 12px; padding: 0; list-style: none; }
.cut-page { position: relative; display: flex; flex-direction: column; gap: 4px; width: 172px; padding: 0 12px; border-left: 1.5px dashed transparent; font-size: 0.8125rem; }
/* Where a document starts: a dashed line down the page's left, as the batch's cuts are drawn. */
.cut-page.is-start { border-left: 1.5px dashed var(--accent); }
.cut-page:first-child.is-start { border-left-color: var(--line-2); }
.cut-page img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--r-tag); background: var(--page); }
.cut-page.is-start img { border-color: var(--line-2); }
.cut-page-n { font-weight: 600; }
.cut-page-first { color: var(--ink-3); }
.cut-page .check { padding: 0; gap: 6px; }
.cut-page .check input { margin-top: 2px; width: 15px; height: 15px; }
.cut-suggested { color: var(--accent-deep); font-size: 0.75rem; font-weight: 600; }
.review-cut-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; }
.cut-summary { margin: 0; font-size: 0.875rem; color: var(--ink-2); }
@media (max-width: 640px) { .cut-page { width: 50%; } }
.review-again-confirm .callout-body p { margin: 0; }
.review-again-actions { display: flex; gap: 12px; align-items: center; flex-shrink: 0; }
.review-doc-links small { overflow-wrap: anywhere; }
.lines-table td.tx-in { color: #2a7a48; }
@media (max-width: 860px) {
  /* Link a document… on a phone: the tick beside each entry, its amount labelled, the entities on a line of their own. */
  .link-table tr { position: relative; }
  .panel .table.link-table tr:has(> td.title) { padding-left: 48px; }
  .link-table td.check-cell { position: absolute; left: 16px; top: 11px; width: auto; }
  .panel .table.link-table td.title { margin-left: 0; }
  .link-table td.check-cell input { width: 18px; height: 18px; margin: 0; }
  .link-table td.field.is-empty { display: none; }
  .panel .table.link-table tr:has(> td.title) > td.field::before { content: "·\00a0\00a0" attr(data-label) " "; margin-left: 6px; }
  .panel .table.link-table tr:has(> td.title) > td.field::after { content: none; }
  .link-table td.link-entities { font-size: 0.75rem; color: var(--ink-3); white-space: normal; }
  /* A statement's transactions on a phone: date and description, then each amount saying what it is, then its links. */
  .panel .table.lines-table tr { display: flex; flex-wrap: wrap; gap: 2px 12px; padding: 10px 14px; }
  .lines-table td.date { order: 0; color: var(--ink-3); font-size: 0.8125rem; }
  .lines-table td[data-label="Description"] { order: 1; flex-basis: 100%; font-weight: 600; }
  .lines-table td.num { order: 2; text-align: left; font-size: 0.8125rem; }
  .lines-table td.num:empty { display: none; }
  .lines-table td.num::before { content: attr(data-label) " "; color: var(--ink-4); font-weight: 400; }
  .lines-table td.lines-linked { order: 3; flex-basis: 100%; min-width: 0; margin-top: 4px; }
}

/* Help (US-063, US-064). The panel: beside the page on a wide screen, over it on a narrow one. */
.guest-bar .help-btn .icon { width: 14px; height: 14px; margin-right: 4px; }
.nav-dot { margin-left: auto; }
.help-panel { position: fixed; top: var(--top-h); right: 0; bottom: 0; z-index: 45; display: flex; flex-direction: column; width: min(23.5rem, 100vw); background: var(--page); border-left: 1px solid var(--line); box-shadow: -10px 0 28px rgb(20 24 40 / 0.07); }
.help-panel[hidden] { display: none; }
.help-panel:focus { outline: none; }
.help-panel-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: var(--top-h); padding: 0 8px 0 16px; border-bottom: 1px solid var(--line); }
.help-panel-bar b { display: inline-flex; align-items: center; gap: 6px; font-size: 0.875rem; }
.help-panel-bar b .icon { width: 16px; height: 16px; color: var(--navy); }
.help-panel-content { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.help-loading { padding: 16px; font-size: 0.8125rem; color: var(--ink-3); }
/* Beside the page only where there's room for both; on anything narrower it lies over the page's right edge. */
@media (min-width: 1500px) {
  .has-help .app > .page, .has-help .guest-page { margin-right: 23.5rem; }
  .help-panel { box-shadow: none; }
}
/* A screen's help: in the panel, or on its own page. */
.help-body { padding: 16px 16px 20px; }
.help-title { font-size: 1.125rem; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 6px; }
.help-md { font-size: 0.875rem; line-height: 1.55; }
/* The tenant's own note in a screen's help (US-067): its house rules, above Athena's help. */
.help-note { margin: 10px 0 14px; padding: 10px 12px; border: 1px solid var(--line); border-left: 3px solid var(--navy); border-radius: var(--r); background: var(--canvas); }
.help-note:has(> .help-note-add) { padding: 0; border: 0; background: none; }
.help-note h3 { margin-bottom: 4px; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-3); }
.help-note-form h3 { font-size: 0.875rem; letter-spacing: 0; text-transform: none; color: var(--ink); }
.help-note-text { margin: 0; font-size: 0.875rem; line-height: 1.55; white-space: pre-line; overflow-wrap: anywhere; }
.help-note-by { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 8px 0 0; font-size: 0.75rem; color: var(--ink-3); }
.help-note-by span { margin-right: auto; }
.help-note-add { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0; font-size: 0.75rem; color: var(--ink-3); }
.help-note-form textarea { width: 100%; margin-top: 4px; }
.help-note-form .help-note-text { margin: 4px 0 8px; padding-left: 10px; border-left: 2px solid var(--line-2); color: var(--ink-2); }
.help-note-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.help-note-said { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; font-size: 0.8125rem; color: var(--ink-2); }
.help-note-said .icon { width: 14px; height: 14px; color: var(--green, var(--accent)); }
.help-md h2 { margin: 1.4em 0 0.5em; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-3); }
.help-md h3 { margin: 1.1em 0 0.3em; font-size: 0.875rem; font-weight: 600; }
.help-md p, .help-md ul, .help-md ol { margin-bottom: 0.6em; }
.help-md li { margin-bottom: 0.25em; }
.help-md code, .help-article-body code, kbd { padding: 1px 5px; border: 1px solid var(--line); border-radius: var(--r-tag); background: var(--canvas); font: 0.8125em/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; }
.help-more { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.help-more h3 { margin-bottom: 6px; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-3); }
.help-more ul, .help-related, .help-topic ul, .help-news-teasers { list-style: none; margin: 0; padding: 0; }
.help-more li, .help-related li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; padding: 3px 0; font-size: 0.875rem; }
.help-foot { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 0.8125rem; }
.help-none h2 { font-size: 1rem; font-weight: 600; margin-bottom: 4px; }
.help-none p { font-size: 0.875rem; color: var(--ink-2); margin-bottom: 8px; }
.help-screen-page { max-width: 44rem; }
.help-screen-back { margin-bottom: 10px; font-size: 0.875rem; }
.help-screen-back .icon { width: 14px; height: 14px; transform: rotate(180deg); vertical-align: -2px; }
/* The help section. */
.help-find { margin-bottom: 16px; max-width: 46rem; align-items: center; }
.help-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 17rem); gap: 16px; align-items: start; }
.help-side > .panel + .panel { margin-top: 16px; }
.help-topics { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 16px; align-items: start; }
.help-topics > .panel { margin: 0; }
.help-topic { padding: 14px 16px 12px; }
.help-topic-head h2 { font-size: 1rem; font-weight: 650; }
.help-topic-head p { margin-top: 2px; font-size: 0.8125rem; color: var(--ink-3); }
.help-topic ul { margin-top: 10px; }
.help-topic li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; padding: 4px 0; font-size: 0.875rem; }
.help-hits { margin-bottom: 16px; }
.help-hit-list { list-style: none; margin: 0; padding: 0; }
.help-hit-list li { padding: 10px 14px; border-top: 1px solid var(--line-2); font-size: 0.875rem; }
.help-hit-list li:first-child { border-top: 0; }
.help-hit-topic { margin-left: 8px; font-size: 0.75rem; color: var(--ink-3); }
.help-hit-list p { margin-top: 2px; font-size: 0.8125rem; color: var(--ink-2); }
.help-news-teasers li { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 7px 14px; font-size: 0.8125rem; }
.help-news-teasers li span { flex: none; color: var(--ink-3); font-size: 0.75rem; }
.help-news-teasers li.is-new a { font-weight: 600; }
.help-card-foot { padding: 4px 14px 12px; font-size: 0.8125rem; }
.help-related { padding: 8px 14px 10px; }
.tag--new { background: var(--accent-wash); color: var(--accent-deep); }
/* An article. */
.help-article { padding: 22px 26px 18px; }
.help-article-topic { display: flex; align-items: center; gap: 8px; font-size: 0.8125rem; color: var(--ink-3); }
.help-article-head h1, .help-article .empty h1 { margin: 4px 0 6px; font-size: 1.625rem; font-weight: 700; letter-spacing: -0.02em; }
.help-article-summary { margin-bottom: 12px; font-size: 1rem; color: var(--ink-2); max-width: 60ch; }
.help-article-head .btn .icon { width: 14px; height: 14px; margin-left: 4px; }
.help-article-body { margin-top: 18px; max-width: 68ch; }
.help-article-body h2 { font-size: 1.125rem; }
.help-helped { margin-top: 24px; padding-top: 14px; border-top: 1px solid var(--line); }
.help-helped-form { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px 10px; font-size: 0.875rem; }
.help-helped-form > b { padding-top: 5px; }
.help-helped-no > summary { list-style: none; cursor: pointer; }
.help-helped-no > summary::-webkit-details-marker { display: none; }
.help-helped-no[open] { flex-basis: 100%; }
.help-helped-missing { display: grid; gap: 6px; margin-top: 10px; max-width: 34rem; }
.help-helped-missing .btn { justify-self: start; }
.help-helped-thanks { display: flex; align-items: center; gap: 6px; font-size: 0.875rem; }
.help-helped-thanks .icon { width: 16px; height: 16px; color: var(--accent); }
.help-updated { margin-top: 10px; font-size: 0.75rem; color: var(--ink-3); }
/* What's new. */
.help-news { max-width: 46rem; }
.help-news-list { list-style: none; margin: 0; padding: 0; }
.help-news-item { padding: 16px 18px; border-top: 1px solid var(--line-2); scroll-margin-top: calc(var(--top-h) + 8px); }
.help-news-item:first-child { border-top: 0; }
.help-news-when { display: flex; align-items: center; gap: 8px; font-size: 0.75rem; color: var(--ink-3); }
.help-news-item h2 { margin: 2px 0 6px; font-size: 1rem; font-weight: 650; }
.help-news-item .md { font-size: 0.875rem; }
.help-news-links { display: flex; gap: 16px; font-size: 0.8125rem; }
@media (max-width: 900px) {
  .help-layout { grid-template-columns: minmax(0, 1fr); }
  .help-article { padding: 16px; }
}

/* Guided tours and getting started (US-065). A step dims the page and leaves one thing lit, within reach. */
[data-tour] { scroll-margin-top: calc(var(--top-h) + 14px); }
.tour-scrim { position: fixed; inset: 0; z-index: 80; background: rgb(20 24 40 / 0.5); }
.tour-ring { position: fixed; z-index: 81; pointer-events: none; border-radius: 8px; box-shadow: 0 0 0 2px var(--accent), 0 0 0 6px var(--accent-ring); transition: left 0.18s, top 0.18s, width 0.18s, height 0.18s; }
.tour-ring[hidden] { display: none; }
.tour-card { position: fixed; z-index: 82; width: min(22rem, calc(100vw - 24px)); max-height: calc(100vh - 24px); overflow-y: auto; padding: 16px 18px 14px; background: var(--page); border-radius: var(--r-pop); box-shadow: var(--pop-shadow), 0 14px 44px rgb(20 24 40 / 0.28); }
.tour-card:focus { outline: none; }
.tour-card--wide { width: min(30rem, calc(100vw - 24px)); }
.tour-card--centre { left: 50%; top: 50%; transform: translate(-50%, -50%); }
.tour-card--dock { left: 12px; right: 12px; top: auto; bottom: 12px; width: auto; max-height: 62vh; transform: none; }
.tour-card--dock.is-top { top: 12px; bottom: auto; }
.tour-count { margin-bottom: 4px; font-size: 0.75rem; color: var(--ink-3); }
.tour-count span { font-variant-numeric: tabular-nums; }
.tour-card h2 { margin-bottom: 6px; font-size: 1rem; font-weight: 650; letter-spacing: -0.01em; }
.tour-body { font-size: 0.875rem; line-height: 1.5; color: var(--ink-2); }
.tour-body p { margin-bottom: 0.5em; }
.tour-body strong { color: var(--ink); }
.tour-picture { display: block; width: 100%; height: auto; margin-top: 10px; border: 1px solid var(--line-2); border-radius: 6px; }
.tour-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.tour-actions .link-btn { color: var(--ink-3); }
.tour-nav { display: flex; gap: 8px; }
.has-tour [data-tour-offer] { display: none; }
@media (prefers-reduced-motion: reduce) { .tour-ring { transition: none; } }
/* The offers, at the top of a page. */
.tour-offer { margin-bottom: 16px; }
.tour-offer > .icon { color: var(--navy); }
.tour-offer-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
/* Getting started: a new tenant's steps. */
.getting-started { margin-bottom: 16px; scroll-margin-top: calc(var(--top-h) + 8px); }
.getting-started .panel-title .icon { width: 16px; height: 16px; margin-right: 6px; color: var(--navy); vertical-align: -3px; }
.gs-away { margin-left: auto; }
.gs-bar { height: 4px; background: var(--line); }
.gs-bar span { display: block; height: 100%; background: var(--accent); }
.gs-steps { list-style: none; margin: 0; padding: 0; }
.gs-steps li { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--line); }
.gs-tick { flex: none; display: grid; place-items: center; width: 20px; height: 20px; border: 1.5px solid var(--line-2); border-radius: 50%; }
.gs-tick .icon { width: 12px; height: 12px; }
.gs-steps li.is-done .gs-tick { border-color: var(--accent); background: var(--accent); color: #fff; }
.gs-steps li.is-next .gs-tick { border-color: var(--accent); }
.gs-what { flex: 1; min-width: 0; }
.gs-what b { display: block; font-size: 0.875rem; font-weight: 600; }
.gs-what > span { display: block; margin-top: 1px; font-size: 0.8125rem; color: var(--ink-3); }
.gs-steps li.is-done .gs-what b { font-weight: 500; color: var(--ink-3); }
.gs-actions { flex: none; display: flex; gap: 8px; }
/* Help › Tours, and a tour as a page. */
.tours { max-width: 56rem; }
.tour-list, .tour-step-list { margin: 0; padding: 0; list-style: none; }
.tour-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--line); scroll-margin-top: calc(var(--top-h) + 8px); }
.tour-row:first-child { border-top: 0; }
.tour-state { flex: none; display: grid; place-items: center; width: 20px; height: 20px; border: 1.5px solid var(--line-2); border-radius: 50%; }
.tour-state .icon { width: 12px; height: 12px; }
.tour-state--done { border-color: var(--accent); background: var(--accent); color: #fff; }
.tour-state--part { border-color: var(--accent); background: linear-gradient(90deg, var(--accent) 50%, transparent 50%); }
.tour-what { flex: 1; min-width: 0; }
.tour-what b { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 0.875rem; font-weight: 600; }
.tour-what > span { display: block; margin-top: 1px; font-size: 0.8125rem; color: var(--ink-2); }
.tour-what > .tour-meta { color: var(--ink-3); }
.tour-row-actions { flex: none; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.tour-steps { max-width: 46rem; }
.tour-step-list { counter-reset: step; }
.tour-step-list li { position: relative; padding: 12px 16px 12px 48px; border-top: 1px solid var(--line); counter-increment: step; font-size: 0.875rem; }
.tour-step-list li::before { content: counter(step); position: absolute; left: 16px; top: 12px; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--canvas); font-size: 0.75rem; font-weight: 600; color: var(--ink-2); }
.tour-step-list li > b { display: block; font-weight: 600; }
.tour-step-list li p { margin-top: 2px; }
.help-show-me { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 2px 0 12px; font-size: 0.8125rem; color: var(--ink-3); }
.help-show-me .icon, .help-article-go .btn--quiet .icon { width: 14px; height: 14px; margin-right: 4px; }
.help-article-go { display: flex; flex-wrap: wrap; gap: 8px; }
.help-tour-next { padding-bottom: 6px; }
@media (max-width: 640px) {
  .gs-steps li, .tour-row { flex-wrap: wrap; }
  .gs-actions, .tour-row-actions { flex-basis: 100%; justify-content: flex-start; padding-left: 32px; }
}

/* An entity's other names (US-074): under its name on its page, and beside a row a search found by one. */
.page-aka { margin: 2px 0 4px; padding-left: 38px; font-size: 0.875rem; color: var(--ink-2); overflow-wrap: anywhere; }
.found-as { display: block; font-size: 0.75rem; color: var(--ink-3); overflow-wrap: anywhere; }

/* A limited member's plan that grants nothing any more (US-072): struck through in their panel until it's saved away. */
.plans-gone { margin: 8px 0 0; padding: 0; list-style: none; font-size: 0.8125rem; color: var(--ink-3); }
.plans-gone s { color: var(--ink-2); }

/* ---- Design round 32: what a file says (US-077, US-078) ---- */
.conf--quiet { color: var(--ink-3); font-style: italic; }
.spot { display: inline-flex; align-items: center; gap: 4px; }
.spot .icon { width: 13px; height: 13px; color: var(--ink-3); }
.spot-map { margin-left: 8px; font-size: 0.75rem; }
.from-file { display: block; margin-top: 2px; font-size: 0.75rem; color: var(--ink-3); }
.field-hint .icon { width: 12px; height: 12px; vertical-align: -1px; color: var(--ink-3); }
.sources { display: grid; gap: 2px; }
.sources .check { padding: 6px 0; }
.source-file { padding: 6px 0 6px 26px; }
.source-file-head b { display: block; font-size: 0.875rem; font-weight: 600; }
.source-file-head small { display: block; font-size: 0.8125rem; color: var(--ink-3); }
.source-details { margin-top: 6px; }
.source-details:not([hidden]) { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.field-form:has(input[name="Form.Kind"]) .source-details.for-kind { display: none; }
.field-form:has(input[name="Form.Kind"][value="Date"]:checked) .source-details.for-Date,
.field-form:has(input[type="hidden"][name="Form.Kind"][value="Date"]) .source-details.for-Date,
.field-form:has(input[name="Form.Kind"][value="Text"]:checked) .source-details.for-Text,
.field-form:has(input[type="hidden"][name="Form.Kind"][value="Text"]) .source-details.for-Text,
.field-form:has(input[name="Form.Kind"][value="Number"]:checked) .source-details.for-Number,
.field-form:has(input[type="hidden"][name="Form.Kind"][value="Number"]) .source-details.for-Number,
.field-form:has(input[name="Form.Kind"][value="Location"]:checked) .source-details.for-Location,
.field-form:has(input[type="hidden"][name="Form.Kind"][value="Location"]) .source-details.for-Location,
.field-form:has(input[name="Form.Kind"][value="YesNo"]:checked) .source-details.for-YesNo,
.field-form:has(input[type="hidden"][name="Form.Kind"][value="YesNo"]) .source-details.for-YesNo,
.field-form:has(input[name="Form.Kind"][value="Select"]:checked) .source-details.for-Select,
.field-form:has(input[type="hidden"][name="Form.Kind"][value="Select"]) .source-details.for-Select { display: flex; }
.source-detail { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8125rem; cursor: pointer; }
.source-detail input { margin: 0; }
.fields-table .kind .sub { display: block; margin-top: 2px; font-size: 0.75rem; color: var(--ink-3); }
.fill-progress { margin-bottom: 14px; }
.file-details dd { color: var(--ink-2); }

/* ---- Design round 32: common types (US-079, US-080) ---- */
.inline-form { display: inline; margin-left: 10px; }
.retention-row { display: flex; gap: 8px; align-items: center; }
.retention-row .retention-n { width: 5rem; }
tr.is-retired .type-link, li.is-retired .type-link { color: var(--ink-3); }
.common-offers { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 1px; background: var(--line); }
.common-offers li { display: grid; gap: 4px; align-content: start; padding: 14px 16px; background: var(--page); }
.common-offers li.is-added { background: var(--well); }
.common-offer-name { display: inline-flex; align-items: center; gap: 8px; font-size: 0.9375rem; }
.common-offer-name .icon { color: var(--ink-3); }
.common-offers .sub { font-size: 0.8125rem; color: var(--ink-2); }
.common-offer-meta { font-size: 0.75rem; color: var(--ink-3); }
.common-add { max-width: 46rem; }
.common-add-body { padding: 4px 18px 18px; }
.common-field { border-bottom: 1px solid var(--line); }
.common-field:last-of-type { border-bottom: 0; }
.common-field .kind-label { display: inline-flex; align-items: center; gap: 4px; }
.common-field .kind-label .icon { width: 12px; height: 12px; }
.common-ref { margin: 0 0 10px 26px; padding: 8px 12px; background: var(--well); border-radius: var(--r); }
.common-ref select { margin: 2px 0 6px 26px; max-width: 20rem; }
.common-ref-fields { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0 0 4px 26px; }
.common-retention { margin: 14px 0 12px; }
.common-origin { display: flex; align-items: center; gap: 6px; margin: 16px 0 12px; font-size: 0.8125rem; color: var(--ink-2); }
.common-origin .icon { width: 14px; height: 14px; color: var(--ink-3); }
details.common-missing { display: block; margin: 16px 0; padding: 10px 14px; background: var(--page); border: 1px solid var(--line); border-radius: var(--r); }
details.common-missing summary { display: flex; align-items: center; gap: 6px; cursor: pointer; list-style: none; }
details.common-missing summary::-webkit-details-marker { display: none; }
details.common-missing summary .link { color: var(--accent-deep); text-decoration: underline; }
details.common-missing[open] summary .link { display: none; }
details.common-missing ul { margin: 10px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; }
details.common-missing li { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.starter-sets { margin: 0; padding: 0; list-style: none; }
.starter-sets li { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.starter-sets li:last-child { border-bottom: 0; }
.starter-set-head .sub { display: block; font-size: 0.8125rem; color: var(--ink-2); }
.starter-set-types { margin: 6px 0 0; font-size: 0.8125rem; color: var(--ink); }
.starter-set-meta { margin: 4px 0 0; font-size: 0.75rem; color: var(--ink-3); }
.set-types { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.set-types legend { width: 100%; margin-bottom: 4px; }
.starter-choices .check { padding: 6px 0; }

/* ---- Design round 32: sharing without the place (US-081) ---- */
.room-places-body { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 12px 16px; font-size: 0.8125rem; color: var(--ink-2); }
.room-places-body p { flex: 1; min-width: 16rem; margin: 0; }
.share-place .field-hint { margin-bottom: 4px; }

/* ---- Design round 32: Knowledge (US-082, US-083) ---- */
.knowledge-ask { margin-bottom: 16px; }
.knowledge-ask-form { padding: 12px 16px 14px; }
.knowledge-ask-form textarea { width: 100%; resize: vertical; }
.knowledge-ask-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 8px; }
.knowledge-ask-bar .convo-box-hint { flex: 1; min-width: 14rem; }
.knowledge-only { padding: 0; font-size: 0.8125rem; }
.knowledge-ask-off { padding: 14px 16px; font-size: 0.875rem; color: var(--ink-2); }
.knowledge-recent { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 0 16px 12px; font-size: 0.8125rem; color: var(--ink-3); }
.knowledge-topic { padding: 4px 16px 10px; }
.knowledge-articles { margin: 0; padding: 0; list-style: none; }
.knowledge-articles li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.knowledge-articles li:last-child { border-bottom: 0; }
.knowledge-articles .sub, .knowledge-articles .plan-row-meta { flex-basis: 100%; }
.knowledge-articles .sub { font-size: 0.8125rem; color: var(--ink-2); }
.article-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 18rem; gap: 16px; align-items: start; }
@media (max-width: 960px) { .article-layout { grid-template-columns: 1fr; } }
.article-body { padding: 18px 22px; }
.article-side .panel + .panel { margin-top: 16px; }
.article-history { margin: 0; padding: 6px 14px 10px; list-style: none; font-size: 0.8125rem; }
.article-history li { display: grid; padding: 6px 0; border-bottom: 1px solid var(--line); }
.article-history li:last-child { border-bottom: 0; }
.article-history small { color: var(--ink-3); }
.article-approval .sub { display: block; margin-top: 2px; font-size: 0.75rem; color: var(--ink-3); }
.article-edit { max-width: 60rem; }
.article-edit-body { padding: 4px 18px 18px; }
.article-edit textarea.article-text { width: 100%; min-height: 22rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.8125rem; }
.article-preview { margin-top: 10px; padding: 14px 18px; border: 1px dashed var(--line-2); border-radius: var(--r); }
.article-conflict { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 760px) { .article-conflict { grid-template-columns: 1fr; } }
.article-conflict pre { max-height: 20rem; overflow: auto; padding: 10px; background: var(--well); border-radius: var(--r); font-size: 0.75rem; white-space: pre-wrap; }
.related-pick { display: grid; gap: 4px; margin-top: 6px; }
.search-articles { margin-bottom: 16px; }
.search-articles ul { margin: 0; padding: 4px 16px 10px; list-style: none; }
.search-articles li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 6px 0; }
.search-articles .sub { flex-basis: 100%; font-size: 0.8125rem; color: var(--ink-2); }
.convo-knowledge { margin: 0 0 10px; font-size: 0.8125rem; color: var(--ink-2); }
.ai-knowledge { padding: 12px 16px 14px; font-size: 0.8125rem; color: var(--ink-2); }
.ai-knowledge > p { margin: 0 0 10px; }
.ai-knowledge-switch { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 10px; }
.ai-knowledge-switch .field-hint { flex-basis: 100%; margin: 0; }

/* ---- Design round 32: Stream (US-084) ---- */
.stream-key-body { display: grid; gap: 10px; padding: 12px 16px 14px; font-size: 0.8125rem; }
.stream-choices-body { padding: 4px 16px 16px; }
.stream-choices-body .room-group-title { margin-top: 14px; }
.stream-table td input[type="checkbox"] { width: 16px; height: 16px; }
.stream-table .sub { display: block; font-size: 0.75rem; color: var(--ink-3); }
.stream-entity { margin: 0 0 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); }
.stream-entity legend { padding: 0 4px; font-weight: 600; font-size: 0.875rem; }
.stream-entity-ticks { display: flex; flex-wrap: wrap; align-items: center; gap: 0 18px; }
.stream-email { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8125rem; }
.stream-refused-title { padding: 0 16px; }
.stream-refused { margin: 0; padding: 0 16px 12px; list-style: none; font-size: 0.8125rem; }
.stream-refused li { padding: 4px 0; }
.stream-refused .sub { display: block; color: var(--ink-3); }

/* Select… (US-093): the bar over a list while its tick boxes show, the boxes on rows, results and tiles, and what's ticked. */
.select-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 8px 14px; background: var(--accent-wash); border-bottom: 1px solid var(--line); font-size: 0.8125rem; }
.select-all { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); cursor: pointer; }
.select-count { margin: 0; color: var(--ink-2); }
.select-count b { color: var(--accent-deep); font-variant-numeric: tabular-nums; }
.select-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-left: auto; }
.select-actions .btn .icon { width: 13px; height: 13px; margin-right: 3px; }
.select-actions .btn:disabled { opacity: 0.45; cursor: not-allowed; }
.select-hint, .select-problem { flex-basis: 100%; margin: 0; }
.select-hint { color: var(--ink-3); }
.select-confirm { margin-top: 12px; }
input.select-box { width: 16px; height: 16px; margin: 0; cursor: pointer; }
[data-select-row] { cursor: pointer; }
.table th.select-col, .table td.select-cell { width: 28px; padding-right: 0; }
.table td.select-cell input.select-box { margin-top: 6px; }
.table tr.is-ticked td { background: var(--accent-wash); }
.hits.is-selecting .hit { align-items: flex-start; }
.hits.is-selecting .hit > .select-box { margin-top: 6px; flex: none; }
.hit.is-ticked { background: var(--accent-wash); }
.tiles.is-selecting > li { position: relative; }
.tiles.is-selecting > li > .select-box { position: absolute; top: 14px; left: 14px; z-index: 2; width: 18px; height: 18px; background: var(--page); }
.tiles.is-selecting > li.is-ticked .tile { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--accent-wash); }
@media (max-width: 720px) {
  .select-actions { margin-left: 0; }
  .panel .table.is-selecting tr:has(> td.select-cell) { position: relative; padding-left: 72px; }
  .table.is-selecting td.select-cell { position: absolute; left: 12px; top: 9px; width: auto; }
}

/* Settings › Check-out (US-094): the number with its words, and what it means. */
.co-form { padding: 14px; max-width: 44rem; }
.co-form .panel-form-actions { justify-content: flex-start; }
.co-explain { margin: 14px 0 0; padding-left: 18px; color: var(--ink-2); font-size: 0.8125rem; line-height: 1.55; }
.co-explain li { margin: 4px 0; }

/* An entity's Media (US-095): small tiles, Add media and Sync to this PC in the bar, and a drop target while dragging. */
.media-panel { position: relative; }
.media-panel .panel-title .icon { margin-right: 6px; }
.media-panel .panel-actions form { display: inline-flex; align-items: center; gap: 8px; }
.media-add-btn { position: relative; cursor: pointer; }
.media-add-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.media-syncing { display: inline-flex; align-items: center; gap: 4px; font-size: 0.8125rem; color: var(--accent-deep); }
.media-syncing .icon { width: 13px; height: 13px; }
.media-sending { margin: 0; padding: 8px 14px; background: var(--accent-wash); color: var(--accent-deep); font-size: 0.8125rem; }
.media-panel.is-dropping { outline: 2px dashed var(--accent); outline-offset: -4px; background: var(--accent-wash); }
.media-panel.is-dropping::after { content: "Drop to add them to Media"; position: absolute; inset: 44px 0 0; display: grid; place-items: center; font-weight: 600; color: var(--accent-deep); pointer-events: none; }
.media-tiles { padding: 12px 14px; }
.media-pager { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 0 14px 12px; font-size: 0.8125rem; color: var(--ink-3); }
.media-foot { margin: 0; font-size: 0.8125rem; color: var(--ink-3); }

/* hidden means hidden: last, so it wins over any rule above that gives an element a display of its own (.plan-col,
   label.check, .note-pane, a narrow screen's table rows, .gate-foot each showed while hidden, 2026-10-15). */

/* Demo tenants and storage (US-099, US-100, round 38). */
.demo-terms { margin-top: 12px; padding: 12px 14px; border-radius: var(--r-tag); background: var(--hover); }
.demo-terms .form-field:last-child { margin-bottom: 0; }
.form-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 0 16px; }
.flag--demo { margin-left: 6px; }
.sort-link { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 2px; }
.sort-link:hover { text-decoration: underline; }
.sort-link .icon { width: 12px; height: 12px; }
td.num .sub { display: block; white-space: nowrap; color: var(--ink-3); font-size: 0.75rem; }
.demo-banner { display: flex; align-items: center; gap: 8px; padding: 8px 20px; background: var(--accent-soft, var(--hover)); color: var(--ink); font-size: 0.875rem; border-bottom: 1px solid var(--line); }
.demo-banner .icon { width: 16px; height: 16px; flex: none; }
.storage-line { color: var(--ink-2); }
.storage-line b { color: var(--ink); }
.meter { display: block; height: 6px; border-radius: 3px; background: var(--hover); overflow: hidden; margin-top: 6px; max-width: 20rem; }
.meter > span { display: block; height: 100%; background: var(--ink-3); }
.meter--full > span { background: var(--accent-deep); }
.storage-panel .panel-body { padding: 14px 20px 16px; }
.storage-panel .storage-line { margin: 0 0 4px; font-size: 1rem; }
.storage-panel .callout { margin: 12px 0 0; }
.storage-panel .callout-body p { margin: 0 0 4px; }
.has-peek .col-storage { display: none; }

/* Lines on a document (US-107). */
.lines-empty { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 0 16px 14px 0; }
.lines-empty .panel-note { flex: 1 1 360px; }
.lines-columns { border: 0; margin: 0; padding: 0; }
.lines-columns legend, .lines-form fieldset legend { font-size: 0.8125rem; font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.lines-form fieldset { border: 0; margin: 0; padding: 0; }
.lines-columns ol { display: grid; gap: 6px; margin: 6px 0 0; padding: 0; list-style: none; }
.lines-columns li { display: grid; grid-template-columns: minmax(0, 1fr) 7.5rem; gap: 6px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.lines-columns li input:last-child { grid-column: 1 / -1; }
.lines-check { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 0.875rem; }
.lines-remove { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.review-lines { border: 0; margin: 16px 0 0; padding: 0; min-width: 0; }
.review-lines > legend { font-size: 0.8125rem; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.lines-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); }
.lines-table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }
.lines-table th { padding: 6px 8px; text-align: left; font-weight: 600; color: var(--ink-2); background: var(--well, var(--active)); border-bottom: 1px solid var(--line); }
.lines-table th.num, .lines-table td.num input { text-align: right; }
.lines-table td.num input { min-width: 4.5rem; max-width: 7rem; }
.lines-table td { padding: 2px 4px; border-bottom: 1px solid var(--line); }
.lines-table tr:last-child td { border-bottom: 0; }
.lines-table td input { width: 100%; min-width: 10rem; padding: 4px 6px; border: 1px solid transparent; border-radius: 4px; background: none; font: inherit; color: var(--ink); }
.lines-table td input:focus { outline: none; border-color: var(--accent); background: var(--page); }
.lines-table tr.is-doubtful td { background: var(--accent-wash, rgba(0, 87, 143, 0.06)); }
.lines-row-end { width: 1%; white-space: nowrap; text-align: right; }
.lines-row-end .conf { margin-right: 6px; font-size: 0.75rem; color: var(--ink-3); }
.lines-remove-row { display: inline-flex; padding: 4px; border-radius: 4px; color: var(--ink-3); cursor: pointer; vertical-align: middle; }
.lines-remove-row input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.lines-remove-row:has(input:checked) { background: var(--red-wash); color: var(--red); }
.lines-remove-row:has(input:focus-visible) { outline: 2px solid var(--accent); }
.lines-remove-row .icon { width: 14px; height: 14px; }
.lines-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 8px; }
.lines-foot p { margin: 0; font-size: 0.8125rem; }
.lines-foot .field-hint { flex: 1 1 100%; }
.lines-foot .icon { width: 14px; height: 14px; vertical-align: -2px; }
.lines-check-ok { color: var(--ink-2); }
.lines-check-off { color: var(--accent-deep); }
.lines-table td.lines-none { padding: 10px 8px; color: var(--ink-3); }
.lines-table:not(:has(input)) td { padding: 6px 8px; }
.doc-lines .lines-foot { padding: 0 14px 12px; }
.doc-lines .lines-scroll { margin: 0 14px; }
.doc-lines-actions { display: flex; justify-content: flex-end; gap: 12px; align-items: center; padding: 0 14px 14px; }
.plan-chart-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 0.875rem; color: var(--ink-2); }
/* A file plan's chart (US-108). */
.plan-chart { margin: 0 0 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--page); }
.plan-chart > summary { display: flex; align-items: baseline; gap: 12px; cursor: pointer; list-style: none; }
.plan-chart > summary::-webkit-details-marker { display: none; }
.plan-chart-title { font-size: 0.875rem; font-weight: 600; color: var(--ink); }
.plan-chart-fold { margin-left: auto; font-size: 0.8125rem; color: var(--accent); }
.plan-chart:not([open]) .plan-chart-fold::before { content: "Show chart"; }
.plan-chart:not([open]) .plan-chart-fold { font-size: 0; }
.plan-chart:not([open]) .plan-chart-fold::before { font-size: 0.8125rem; }
.chart-bars { display: grid; gap: 6px; margin: 12px 0 0; padding: 0; list-style: none; }
.chart-bars li { display: grid; grid-template-columns: minmax(6rem, 14rem) minmax(0, 1fr) auto; align-items: center; gap: 10px; font-size: 0.8125rem; }
.chart-bar-label { overflow: hidden; color: var(--ink-2); text-overflow: ellipsis; white-space: nowrap; }
.chart-bar-track { display: block; height: 14px; }
.chart-bar { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--accent); }
.chart-bar-value { color: var(--ink); font-variant-numeric: tabular-nums; text-align: right; }
.chart-line { display: block; width: 100%; max-width: 760px; height: auto; margin-top: 10px; overflow: visible; }
.chart-grid { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart-axis { fill: var(--ink-3); font-size: 11px; }
.chart-path { fill: none; stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.chart-dot { fill: var(--accent); stroke: var(--page); stroke-width: 2; }
.chart-pie-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; margin-top: 10px; }
.chart-pie { width: 180px; height: 180px; flex: none; }
.chart-slice { stroke: var(--page); stroke-width: 2; }
.chart-legend { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: 0.8125rem; }
.chart-legend li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.chart-swatch { width: 12px; height: 12px; border-radius: 3px; }
.chart-legend-label { color: var(--ink-2); }
.chart-legend-value { color: var(--ink); font-variant-numeric: tabular-nums; }
.plan-chart-note { margin: 6px 0 0; font-size: 0.75rem; color: var(--ink-3); }
.plan-chart-table { margin-top: 10px; font-size: 0.8125rem; }
.plan-chart-table > summary { color: var(--accent); cursor: pointer; }
.plan-chart-table table { margin-top: 8px; }

/* Who has none this period (US-109): a link chip per expected document, and the period's bar above the list. */
a.chip { padding-right: 10px; text-decoration: none; }
a.chip.is-set { padding-right: 6px; }
a.chip .icon { width: 12px; height: 12px; }
.missing-bar { justify-content: flex-start; gap: 8px 12px; background: var(--well); }
.period-step { display: inline-flex; align-items: center; gap: 8px; }
.period-step b { min-width: 7rem; text-align: center; font-weight: 600; }
.period-now { font-size: 0.8125rem; }
.period-dates { color: var(--ink-3); font-size: 0.8125rem; font-variant-numeric: tabular-nums; }
.missing-bar .btn:last-child:not(.period-step .btn) { margin-left: auto; }

/* Demo requests on Platform › Tenants (US-112) */
.demo-requests { margin-bottom: 16px; }
.dr-list { list-style: none; margin: 0; padding: 0; }
.dr-item { padding: 12px 16px; border-top: 1px solid var(--line); display: grid; gap: 4px; }
.dr-who { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.dr-who .flag { margin-left: 4px; }
.dr-use { margin: 0; color: var(--ink-2); }
.dr-when { margin: 0; color: var(--ink-3); font-size: 0.8125rem; }
.dr-actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; margin-top: 6px; }
.dr-more > summary { list-style: none; cursor: pointer; }
.dr-more > summary::-webkit-details-marker { display: none; }
.dr-form { display: grid; gap: 6px; margin-top: 8px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--well); width: min(420px, 100%); }
.dr-form label { font-size: 0.8125rem; font-weight: 600; }
.dr-form textarea { font: inherit; padding: 6px 8px; border: 1px solid var(--line-2); border-radius: var(--r); }
.dr-form .btn { justify-self: start; }
.demo-requests .panel-empty { margin: 0; padding: 12px 16px; color: var(--ink-3); }
.gate-new { margin-top: 4px; padding-top: 16px; border-top: 1px solid var(--line); }
.gate-more { display: inline-block; margin-top: 24px; font-weight: 600; color: var(--accent); text-decoration: none; }
.gate-more:hover { text-decoration: underline; }
/* Beside the panel's own link, the line under the form is only for screens without the panel (US-110). */
.gate-page:has(.gate-art) .gate-new { display: none; }
@media (max-width: 960px) { .gate-page:has(.gate-art) .gate-new { display: block; } }

/* Platform › Questions (US-115) */
.aq-budget { margin-bottom: 16px; }
.aq-meter { height: 6px; margin: 4px 16px 12px; border-radius: 3px; background: var(--active); overflow: hidden; }
.aq-meter span { display: block; height: 100%; background: var(--accent); }
.aq-meter span.is-high { background: var(--tag-orange-ink); }
.aq-rest { margin: 0 16px 12px; display: flex; gap: 6px; align-items: center; color: var(--tag-yellow-ink); background: var(--tag-yellow); padding: 8px 12px; border-radius: var(--r); }
.aq-form { padding: 0 16px 12px; display: grid; gap: 12px; max-width: 420px; }
.aq-changed { margin: 0 16px 12px; font-size: 0.8125rem; color: var(--ink-3); }
.aq-list { list-style: none; margin: 0; padding: 0; }
.aq-item { border-top: 1px solid var(--line); }
.aq-item summary { display: grid; gap: 2px; padding: 10px 16px; cursor: pointer; list-style: none; }
.aq-item summary::-webkit-details-marker { display: none; }
.aq-item summary:hover { background: var(--hover); }
.aq-q { font-weight: 500; }
.aq-meta { font-size: 0.8125rem; color: var(--ink-3); }
.aq-a { padding: 4px 16px 14px 32px; color: var(--ink-2); }
.aq-a p { margin: 0 0 6px; }
.aq-src { font-size: 0.8125rem; color: var(--ink-3); }
.flag--amber { background: var(--tag-yellow); color: var(--tag-yellow-ink); }

/* Ask how to… (US-114), in the help panel and on Help's front page */
.ask-how { display: grid; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--well); }
.ask-how--page { padding: 16px; }
.ask-how-log { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; max-height: 40vh; overflow: auto; }
.ask-how-log:empty { display: none; }
.ask-how-turn { display: grid; gap: 6px; }
.ask-how-q { justify-self: end; max-width: 90%; margin: 0; padding: 6px 10px; border-radius: 10px 10px 2px 10px; background: var(--accent-wash); color: var(--navy); font-size: 0.875rem; }
.ask-how-a { padding: 8px 10px; border-radius: 10px 10px 10px 2px; background: var(--page); border: 1px solid var(--line); font-size: 0.875rem; }
.ask-how-a p { margin: 0 0 6px; } .ask-how-a p:last-child { margin: 0; }
.ask-how-a--not { background: var(--tag-yellow); border-color: transparent; color: var(--tag-yellow-ink); }
.ask-how-a--problem { background: var(--red-wash); border-color: var(--red-line); }
.ask-how-src { font-size: 0.8125rem; color: var(--ink-3); }
.ask-how-form { display: flex; gap: 6px; }
.ask-how-form input { flex: 1; min-width: 0; font: inherit; font-size: 0.875rem; padding: 6px 10px; min-height: 32px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--page); }
.ask-how-note { margin: 0; font-size: 0.75rem; color: var(--ink-3); }
.linkish { font: inherit; background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; text-decoration: underline; }
.ask-how-front { margin: 0 0 20px; overflow: hidden; } .ask-how-front .ask-how { border-bottom: 0; }


/* Guided help (US-116): the person's guide at the top of the help panel, its page, and "How do I…" in Search */
.guide-host:empty { display: none; }
.help-panel .guide-host { max-height: 55vh; overflow-y: auto; overscroll-behavior: contain; border-bottom: 1px solid var(--line); }
.guide { display: grid; gap: 10px; padding: 14px 16px; background: var(--page); }
.guide-head { display: grid; gap: 2px; }
.guide-kicker { margin: 0; display: flex; align-items: center; gap: 6px; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; color: var(--accent); }
.guide-title { margin: 0; font-size: 1rem; line-height: 1.35; color: var(--navy); }
.guide-lead { margin: 0; font-size: 0.8125rem; color: var(--ink-3); }
.guide-lead p { margin: 0; }
.guide-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; counter-reset: none; }
.guide-step { display: grid; grid-template-columns: 24px 1fr; gap: 10px; padding: 8px 8px 8px 6px; border-radius: var(--r); }
.guide-step--next { background: var(--accent-wash); }
.guide-mark { display: grid; place-items: center; width: 22px; height: 22px; border-radius: var(--r-pill); border: 1.5px solid var(--line-2); font-size: 0.75rem; font-weight: 600; color: var(--ink-3); background: var(--page); }
.guide-step--next .guide-mark { border-color: var(--accent); background: var(--accent); color: #fff; }
.guide-step--done .guide-mark, .guide-step--ticked .guide-mark { border-color: transparent; background: var(--tag-green); color: var(--tag-green-ink); }
.guide-mark .icon { width: 13px; height: 13px; }
.guide-step-text { display: grid; gap: 4px; min-width: 0; }
.guide-step-title { margin: 1px 0 0; font-size: 0.875rem; font-weight: 600; color: var(--ink); }
.guide-step--done .guide-step-title, .guide-step--ticked .guide-step-title { font-weight: 500; color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--line-2); }
.guide-step--adminsjob .guide-step-title { color: var(--ink-3); }
.guide-step-body { font-size: 0.8125rem; color: var(--ink-2, var(--ink)); }
.guide-step-body p { margin: 0; }
.guide-step-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.guide-step-acts form { display: inline; }
.guide-step-acts .linkish { font-size: 0.8125rem; color: var(--ink-3); }
.guide-done-line { margin: 0; display: flex; align-items: center; gap: 6px; font-size: 0.875rem; font-weight: 600; color: var(--tag-green-ink); }
.guide-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
.guide-foot form { margin-left: auto; }
.guide-src { margin: 0; font-size: 0.75rem; color: var(--ink-3); }
.ask-how-a--guide { background: var(--accent-wash); border-color: transparent; color: var(--navy); }
.guide-page { padding: 16px; display: grid; gap: 16px; max-width: 46rem; }
.guide-page .guide { padding: 0; }
.guide-none { margin: 0; color: var(--ink-3); }
.guide-ask { display: grid; gap: 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.guide-ask label { font-weight: 600; font-size: 0.875rem; }
.guide-ask-row { display: flex; gap: 6px; }
.guide-ask-row input { flex: 1; min-width: 0; font: inherit; font-size: 0.875rem; padding: 6px 10px; min-height: 32px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--page); }
/* "How do I…" on the Search page, above the results */
.search-howto { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; padding: 8px 12px; border-radius: var(--r); background: var(--accent-wash); color: var(--navy); font-size: 0.875rem; }
.search-howto .icon { color: var(--accent); }
.search-howto span { flex: 1; min-width: 12rem; }
/* ... and under the sidebar's Search box */
.sb-howto { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; padding: 4px; border-radius: var(--r-pop); background: var(--page); box-shadow: var(--pop-shadow); }
.sb-howto-opt { display: grid; grid-template-columns: 1fr auto; gap: 0 8px; width: 100%; padding: 6px 8px; border: 0; border-radius: var(--r); background: none; font: inherit; text-align: left; cursor: pointer; color: var(--ink); }
.sb-howto-opt:hover, .sb-howto-opt:focus-visible { background: var(--accent-wash); outline: none; }
.sb-howto-kicker { grid-column: 1; font-size: 0.6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.02em; color: var(--accent); }
.sb-howto-q { grid-column: 1; font-size: 0.8125rem; overflow-wrap: anywhere; }
.sb-howto-hint { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-size: 0.75rem; color: var(--ink-3); }
/* "Show me": the button to press, lit for a few seconds */
.guide-lit { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: var(--r); animation: guide-pulse 1.4s var(--ease-out) 3; }
/* On the lit control's top-right corner (guide.js sets left and top), out of the layout: nothing beside it moves. */
.guide-here { position: absolute; z-index: 40; transform: translate(-70%, -60%); padding: 1px 7px; border-radius: var(--r-pill); background: var(--accent); color: #fff; font-size: 0.6875rem; font-weight: 600; line-height: 1.5; white-space: nowrap; pointer-events: none; }
@keyframes guide-pulse { 0% { outline-color: var(--accent-ring); } 50% { outline-color: var(--accent); } 100% { outline-color: var(--accent-ring); } }
@media (prefers-reduced-motion: reduce) { .guide-lit { animation: none; } }
.guide-page .guide-kicker { display: none; }

.search-howto--task { background: var(--accent); color: #fff; }
.search-howto--task .icon { color: #fff; }
.search-howto--task .btn { background: #fff; color: var(--accent-deep); border-color: #fff; }
.search-howto--empty { display: grid; justify-items: start; gap: 8px; margin: 0 0 18px; padding: 12px 14px; }
.search-howto-lead { margin: 0; }
.sb-howto-opt[aria-selected="true"] { background: var(--accent-wash); }
.sb-howto-opt--search { grid-template-columns: 1fr auto; }
.sb-howto-foot { margin: 2px 8px 4px; font-size: 0.6875rem; color: var(--ink-3); }
.search-howto .btn .icon { color: inherit; }
/* Guided help (US-116): asked to see something, where it is */
.ask-how-a--there { background: var(--page); border-color: var(--accent); }
.there { display: grid; gap: 6px; }
.there-title { margin: 0; font-weight: 600; color: var(--navy); }
.there-lead p { margin: 0; }
.there-open { margin: 2px 0; }
.there-how { display: flex; flex-wrap: wrap; gap: 4px; align-items: baseline; font-size: 0.8125rem; color: var(--ink-3); }
.there-page { padding: 4px 0; }
.callout--info { background: var(--accent-wash); border-color: transparent; color: var(--navy); }
.callout--info > .icon { color: var(--accent); }

/* Round 44: export and import a type (US-118). xfer-* rules go here. */
.xfer-head-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.form-field textarea.xfer-json { width: 100%; font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 0.8125rem; line-height: 1.5; tab-size: 2; white-space: pre; overflow: auto; resize: vertical; }
.xfer-out .xfer-json { min-height: 18rem; background: var(--canvas); color: var(--ink); }
.xfer-body { display: grid; gap: 16px; padding: 4px 18px 18px; }
.xfer-paste { max-width: 46rem; }
.xfer-paste .xfer-json { min-height: 16rem; }
.xfer-holds { margin: 4px 0 16px; }
.xfer-actions { align-items: center; }
.xfer-actions > a:first-child { margin-right: auto; }
.xfer-left .callout-body ul { margin: 6px 0 0; padding-left: 18px; }
.xfer-left .callout-body li + li { margin-top: 2px; }
.xfer-there { margin-bottom: 4px; }

/* Round 44: a document type from a document (US-119). fromdoc-* rules go here. */
.fromdoc-start { max-width: 46rem; }
.fromdoc-start fieldset { border: 0; margin: 0; min-width: 0; }
.fromdoc-start fieldset:disabled { opacity: 0.55; }
.fromdoc-body { padding: 4px 18px 18px; }
.fromdoc-note { display: flex; gap: 8px; align-items: flex-start; margin: 4px 0 12px; font-size: 0.8125rem; color: var(--ink-2); }
.fromdoc-note .icon { flex: none; width: 14px; height: 14px; margin-top: 2px; color: var(--ink-3); }
.fromdoc-drafts { max-width: 46rem; margin-top: 16px; }
.fromdoc-draft-list { margin: 0; padding: 0; list-style: none; }
.fromdoc-draft-list li { display: grid; gap: 2px; padding: 10px 18px; border-top: 1px solid var(--line); }
.fromdoc-draft-list a { display: inline-flex; align-items: center; gap: 8px; }
.fromdoc-draft-list a .icon { color: var(--ink-3); }
.fromdoc-draft-list .sub { font-size: 0.8125rem; color: var(--ink-2); }
.fromdoc-reading { max-width: 46rem; }
.fromdoc-reading-line { display: flex; gap: 10px; align-items: center; margin: 0; padding: 16px 18px 4px; color: var(--ink-2); }
.fromdoc-reading .panel-form-actions { margin: 0; padding: 4px 18px 14px; border-top: 0; }
.fromdoc-failed-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.fromdoc-layout { display: grid; grid-template-columns: 15rem minmax(0, 46rem); gap: 24px; align-items: start; }
.fromdoc-sample { position: sticky; top: 16px; display: grid; gap: 4px; }
.fromdoc-sample p { margin: 0; }
.fromdoc-sample .sub { font-size: 0.75rem; color: var(--ink-3); }
.fromdoc-page { display: block; width: 100%; height: auto; max-height: 22rem; object-fit: contain; object-position: top; background: var(--well); border: 1px solid var(--line); border-radius: var(--r); }
.fromdoc-file { display: grid; place-items: center; align-content: center; gap: 6px; aspect-ratio: 3 / 4; background: var(--well); border: 1px solid var(--line); border-radius: var(--r); color: var(--ink-3); font-size: 0.8125rem; }
.fromdoc-file .icon { width: 28px; height: 28px; }
.fromdoc-sample .fromdoc-file-name { margin-top: 6px; overflow-wrap: anywhere; font-size: 0.875rem; }
.fromdoc-main { display: grid; gap: 16px; min-width: 0; }
.fromdoc-like { margin: 0; flex-wrap: wrap; }
.fromdoc-fields, .fromdoc-lines { border: 0; padding: 0; margin: 18px 0 8px; min-width: 0; }
.fromdoc-field { padding: 10px 0; border-bottom: 1px solid var(--line); }
.fromdoc-field.is-added { border-bottom: 0; }
.fromdoc-field-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.fromdoc-field-line > input[type="checkbox"] { flex: none; }
.fromdoc-field-name { flex: 1 1 12rem; min-width: 0; font-weight: 600; }
.fromdoc-field.is-added .fromdoc-field-name { font-weight: 400; }
.fromdoc-field-line select { flex: none; width: auto; }
.fromdoc-plus { display: inline-grid; place-items: center; width: 16px; color: var(--ink-3); }
.fromdoc-plus .icon { width: 14px; height: 14px; }
.fromdoc-mini { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8125rem; color: var(--ink-2); white-space: nowrap; }
.fromdoc-field-more { display: grid; gap: 6px; margin: 6px 0 0 28px; }
.fromdoc-field-more input, .fromdoc-field-more textarea { font-size: 0.8125rem; }
.fromdoc-seen { margin: 0; font-size: 0.75rem; color: var(--ink-3); }
.fromdoc-seen b { font-weight: 500; color: var(--ink-2); }
.fromdoc-seen.is-unsure { color: var(--accent-deep); }
.fromdoc-field:has(> .fromdoc-field-line > input[type="checkbox"]:not(:checked)) :is(.fromdoc-field-name, .fromdoc-field-more, select, .fromdoc-mini) { opacity: 0.5; }
.fromdoc-lines-body { margin: 8px 0 0 26px; padding: 4px 14px 2px; background: var(--well); border-radius: var(--r); }
.fromdoc-lines:has(input[name="Form.KeepLines"]:not(:checked)) .fromdoc-lines-body { opacity: 0.5; }
.fromdoc-label { display: block; margin-bottom: 4px; font-weight: 600; font-size: 0.875rem; }
.fromdoc-columns { display: grid; gap: 6px; }
.fromdoc-column { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.4fr); gap: 6px; }
.fromdoc-date { margin: 14px 0 12px; }
.fromdoc-field input:not([type="checkbox"]), .fromdoc-column input {
  width: 100%; height: 34px; padding: 0 10px;
  border: 1px solid var(--line-2); border-radius: var(--r);
  background: var(--page); color: var(--ink); font-size: 0.875rem;
  transition: border-color 120ms var(--ease-out), box-shadow 120ms var(--ease-out);
}
.fromdoc-field .fromdoc-field-name { width: auto; font-size: 0.9375rem; }
.fromdoc-field-more input:not([type="checkbox"]) { height: 32px; font-size: 0.8125rem; }
.fromdoc-field input:not([type="checkbox"])::placeholder, .fromdoc-column input::placeholder { color: var(--ink-4); }
.fromdoc-field input:not([type="checkbox"]):focus, .fromdoc-column input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.fromdoc-field input[aria-invalid="true"], .fromdoc-field textarea[aria-invalid="true"] { border-color: var(--red); }
.fromdoc-field select, .fromdoc-column select, .fromdoc-field textarea { padding: 6px 10px; border: 1px solid var(--line-2); border-radius: var(--r); background-color: var(--page); color: var(--ink); font-size: 0.875rem; }
.fromdoc-field select, .fromdoc-column select { height: 34px; padding-block: 0; padding-right: 30px; appearance: none;
  background: var(--page) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%236f6e69' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4.5 6.25 3.5 3.5 3.5-3.5'/%3E%3C/svg%3E") no-repeat right 9px center / 13px; }
.fromdoc-field select:focus, .fromdoc-column select:focus, .fromdoc-field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.fromdoc-field textarea { width: 100%; resize: vertical; }
@media (max-width: 960px) {
    .fromdoc-layout { grid-template-columns: minmax(0, 1fr); }
    .fromdoc-sample { position: static; grid-template-columns: 5rem minmax(0, 1fr); column-gap: 12px; }
    .fromdoc-sample > :is(img, .fromdoc-file) { grid-row: span 4; }
    .fromdoc-file span { display: none; }
}
@media (max-width: 640px) {
    .fromdoc-field-more, .fromdoc-lines-body { margin-left: 0; }
    .fromdoc-column { grid-template-columns: minmax(0, 1fr) auto; }
    .fromdoc-column input:last-child { grid-column: 1 / -1; }
}

/* Round 44: a re-typed document back in Review (US-117). retyped-* rules go here. */
.retyped-values { margin: 0 0 18px; padding: 12px 14px; border-radius: var(--r); background: var(--page); box-shadow: inset 0 0 0 1px var(--line); }
.retyped-values .retype-values { grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 8px 16px; }
.retyped-values .field-hint { margin: 0; }
.retyped-row { color: var(--ink-2); }

/* Round 46: engagements (US-123). eng-* rules go here. */
.eng-ref { display: inline-grid; place-items: center; min-width: 32px; height: 32px; padding: 0 6px; flex-shrink: 0; border-radius: var(--r);
  background: var(--accent-wash); color: var(--accent-deep); font-weight: 650; font-size: 0.875rem; letter-spacing: 0.02em; }
.eng-ref--big { min-width: 40px; height: 40px; font-size: 1.0625rem; }
.eng-sections .plan-row-text { min-width: 0; }
.eng-sec-actions { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; margin-left: auto; }
.eng-sec-actions form { display: contents; }
.eng-confirm { list-style: none; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.eng-confirm .callout { margin: 0; }
.eng-sec-names { display: grid; grid-template-columns: 8rem minmax(0, 1fr); gap: 12px; }
.eng-ref-field input { text-transform: uppercase; font-weight: 600; }
.eng-ref-field input::placeholder { text-transform: none; font-weight: 400; }
.eng-types { grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); column-gap: 18px; }
.eng-fixed { margin: 2px 0 0; }
.eng-fixed-label { margin: 0 0 5px; font-size: 0.8125rem; font-weight: 500; color: var(--ink-2); }
.eng-form > div.form-field:last-of-type { margin-bottom: 0; }
.panel-foot { margin: 0; padding: 10px 16px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 0.8125rem; }
.eng-new-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 12px 18px; }
.eng-team-pick select { flex: none; width: 10rem; margin-left: auto; height: 32px; }
/* An engagement form inside a panel keeps the panel's 16px inset (as its notes and lists do). */
.panel > .eng-form { padding: 14px 16px 16px; }
.eng-form .ws-people { padding-inline: 0; }
/* The engagement pages' search rows and the team's part select wear the form controls' look. */
.eng-input input, .eng-role select {
  height: 34px; padding: 0 11px;
  border: 1px solid var(--line-2); border-radius: var(--r);
  background-color: var(--page); color: var(--ink); font-size: 0.875rem;
  transition: border-color 120ms var(--ease-out), box-shadow 120ms var(--ease-out);
}
.eng-input input::placeholder { color: var(--ink-4); }
.eng-role select {
  width: 9rem; padding-right: 32px; appearance: none;
  background: var(--page) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%236f6e69' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4.5 6.25 3.5 3.5 3.5-3.5'/%3E%3C/svg%3E") no-repeat right 10px center / 14px;
}
.eng-input input:focus, .eng-role select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.eng-input input[aria-invalid="true"] { border-color: var(--red); }
.eng-role, .eng-input { align-items: center; }
.eng-takes { margin: 4px 0 0; }
.eng-form-callout { margin: 12px 16px 0; }
.eng-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.eng-search input { height: 28px; width: 11rem; padding: 0 10px; border: 1px solid var(--line-2); border-radius: var(--r-pill); background: var(--page); color: var(--ink); font-size: 0.8125rem; }
.eng-search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.eng-table .meter { max-width: 7rem; margin-top: 4px; }
.eng-reviewed { font-size: 0.8125rem; color: var(--ink-2); white-space: nowrap; }

/* The status, as steps: where it is, where it's been, and the ones the person may move it to. */
.eng-status { margin: 4px 0 18px; }
.eng-status ol { display: flex; flex-wrap: wrap; gap: 0; margin: 0 0 6px; padding: 0; list-style: none; }
.eng-status li { display: flex; align-items: center; }
.eng-status li + li::before { content: ""; width: 28px; height: 2px; margin: 0 2px; background: var(--line-2); }
.eng-status li.is-past::before, .eng-status li.is-here::before { background: var(--accent); }
.eng-status li:first-child::before { display: none; }
.eng-status button, .eng-step { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 12px 0 6px;
  border: 1px solid transparent; border-radius: var(--r-pill); background: none; color: var(--ink-3); font: inherit; font-size: 0.875rem; font-weight: 500; }
.eng-status button { cursor: pointer; border-color: var(--line-2); background: var(--page); color: var(--ink-2);
  transition: border-color 120ms var(--ease-out), background-color 120ms var(--ease-out), color 120ms var(--ease-out); }
.eng-status button:hover { border-color: var(--accent); color: var(--accent-deep); background: var(--accent-wash); }
.eng-status button:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-ring); }
.eng-step-dot { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-2); background: var(--page); }
.eng-step-dot .icon { width: 12px; height: 12px; }
.eng-status .is-past .eng-step { color: var(--ink-2); }
.eng-status .is-past .eng-step-dot { border-color: var(--accent); background: var(--accent); color: #fff; }
.eng-status .is-here .eng-step { background: var(--accent-wash); color: var(--accent-deep); font-weight: 650; }
.eng-status .is-here .eng-step-dot { border-color: var(--accent); background: var(--accent); color: #fff; box-shadow: 0 0 0 4px var(--accent-ring); }
.eng-status .field-hint { margin: 0; }

/* A section: its sections as tabs, what it gathers, and what's left out. */
.eng-gathers { margin: 6px 0 0; font-size: 0.875rem; color: var(--ink-2); }
.eng-section-tabs { margin: 0 0 14px; overflow-x: auto; }
.eng-section-tabs ul { display: flex; gap: 6px; margin: 0; padding: 2px; list-style: none; }
.eng-section-tabs a { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--line-2); border-radius: var(--r-pill);
  color: var(--ink-2); font-size: 0.8125rem; white-space: nowrap; text-decoration: none; }
.eng-section-tabs a b { color: var(--accent-deep); font-weight: 650; }
.eng-section-tabs a:hover { background: var(--hover); text-decoration: none; }
.eng-section-tabs a[aria-current] { border-color: var(--accent); background: var(--accent-wash); color: var(--accent-deep); }
@media (max-width: 960px) { .eng-section-tabs a:not([aria-current]) span { display: none; } }
.eng-docs .is-left-out .doc-link { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--ink-4); }
.eng-why { display: block; margin-top: 4px; font-size: 0.8125rem; color: var(--ink-2); }
.eng-why small { color: var(--ink-3); margin-left: 4px; }
.eng-found { color: var(--ink-3); font-size: 0.8125rem; }
.eng-leave-row td { background: var(--accent-wash); }
.eng-leave { display: grid; gap: 6px; }
.eng-leave label { font-weight: 600; font-size: 0.875rem; }
.eng-leave input { flex: 1; min-width: 12rem; }
@media (max-width: 640px) { .eng-sec-names { grid-template-columns: minmax(0, 1fr); } .eng-status li + li::before { width: 10px; } }

/* Round 46, US-124 to US-128: the engagement's tabs, roll forward, requests, the client's page, bank year, samples, sign-off. */
.eng-tabs { margin-top: 2px; }
.eng-tabs .tab-count { min-width: 20px; padding: 0 6px; border-radius: var(--r-pill); background: var(--hover); text-align: center; }
.eng-tabs a[aria-current] .tab-count { background: var(--accent-wash); color: var(--accent-deep); }
.eng-tabs .tab-count--due { background: var(--tag-yellow); color: var(--tag-yellow-ink); }
.eng-views { margin-top: -4px; }
.eng-views .icon { width: 15px; height: 15px; }
.eng-form .form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 4px; font-size: 0.875rem; }
.eng-form fieldset { margin: 0 0 16px; padding: 0; border: 0; min-width: 0; }
.eng-form legend { margin-bottom: 6px; padding: 0; font-size: 0.875rem; font-weight: 500; color: var(--ink); }
.eng-form input[type="date"], .eng-form input[type="number"], .smp-key input, .eng-form textarea { height: 36px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: var(--r);
  background: var(--page); color: var(--ink); font: inherit; font-size: 0.875rem; width: 100%; }
.eng-form textarea { height: auto; padding: 8px 10px; line-height: 1.45; }
.eng-form input[type="date"]:focus, .eng-form input[type="number"]:focus, .smp-key input:focus, .eng-form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.eng-form [aria-invalid="true"] { border-color: var(--red); }
.eng-pair-tight { gap: 8px; }
.eng-ref--sm { min-width: 24px; height: 22px; padding: 0 5px; font-size: 0.75rem; border-radius: var(--r-tag); }
.eng-ref--sample { background: var(--tag-purple); color: var(--tag-purple-ink); }
.eng-overdue { color: var(--red); font-weight: 600; }
.eng-sign { flex: none; }
.eng-sign-link { text-decoration: none; }
.eng-sign-link:hover { text-decoration: underline; }
.eng-sections .plan-row > .btn { flex: none; }
.eng-suggest { border-color: var(--accent); background: var(--accent-wash); }
.eng-suggest .icon { color: var(--accent-deep); }

/* Roll forward: what comes along. */
.eng-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; padding: 0; list-style: none; }
.eng-chips li { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border: 1px solid var(--line-2); border-radius: var(--r-pill); font-size: 0.8125rem; color: var(--ink-2); }
.eng-chips b { color: var(--accent-deep); font-weight: 650; }
.eng-chips small { color: var(--ink-3); }
.eng-standard { margin-top: 4px; font-size: 0.8125rem; color: var(--ink-3); }
.eng-standard summary { cursor: pointer; }
.eng-standard .eng-chips { margin-top: 8px; }
.eng-carry { display: grid; gap: 8px; margin: 0; padding: 12px 14px; list-style: none; border-radius: var(--r-pop); background: var(--well); font-size: 0.875rem; color: var(--ink-2); }
.eng-carry li { display: flex; align-items: flex-start; gap: 10px; }
.eng-carry .icon { flex: none; width: 16px; height: 16px; margin-top: 2px; color: var(--accent-deep); }
.eng-carry b { color: var(--ink); font-weight: 600; }
.eng-roll-team .ws-people { padding: 0; }

/* Requests to the client. */
.req-filters { padding: 10px 14px; border-bottom: 1px solid var(--line); }
.req-filters .chip { padding: 0 10px; text-decoration: none; }
.req-filters .chip b { color: var(--ink-3); font-weight: 600; }
.req-filters .chip.is-set b { color: var(--accent-deep); }
.req-table td { vertical-align: top; }
.req-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 4px; font-size: 0.8125rem; color: var(--ink-3); }
.req-due { white-space: nowrap; font-size: 0.875rem; color: var(--ink-2); }
.req-col-got { font-size: 0.8125rem; color: var(--ink-3); white-space: nowrap; }
.req-table tr.is-quiet .doc-link { color: var(--ink-3); }
.has-peek .req-col-got { display: none; }
.req-contacts { padding: 4px 16px; }
.req-add-contact { border-top: 1px solid var(--line); }
.req-options { border-top: 1px solid var(--line); padding-top: 6px !important; }
.req-options .check { padding: 6px 0; }
.req-mails { margin: 0; padding: 4px 16px 10px; list-style: none; }
.req-mails li { display: grid; grid-template-columns: 10.5rem minmax(0, 1fr); gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 0.875rem; color: var(--ink-2); }
.req-mails li:last-child { border-bottom: 0; }
.req-mails b { color: var(--ink); font-weight: 600; }
.req-mail-when { color: var(--ink-3); font-size: 0.8125rem; font-variant-numeric: tabular-nums; }
.req-peek .marks { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.req-due-mark { font-size: 0.8125rem; color: var(--ink-2); }
.req-note { margin: 10px 0 0; padding: 8px 12px; border-radius: var(--r); background: var(--well); font-size: 0.875rem; color: var(--ink-2); }
.req-note small { margin-left: 6px; color: var(--ink-3); }
.req-peek .callout { margin: 12px 0 0; }
.req-docs, .req-uploads, .req-pick { display: grid; margin: 0; padding: 0; list-style: none; }
.req-docs li { display: flex; flex-direction: column; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 0.875rem; }
.req-docs small, .req-uploads small { color: var(--ink-3); font-size: 0.8125rem; }
.req-uploads li { display: flex; align-items: flex-start; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 0.875rem; }
.req-uploads li > span:not(.tag) { display: flex; flex-direction: column; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.req-uploads .icon { flex: none; margin-top: 2px; color: var(--ink-3); }
.req-up-note { font-style: italic; }
.req-pick { max-height: 20rem; overflow-y: auto; margin: 6px 0 10px; border: 1px solid var(--line); border-radius: var(--r); padding: 0 10px; }
.req-pick li + li { border-top: 1px solid var(--line); }
.req-pick .check { padding: 8px 0; }
.req-form { margin-top: 4px; }
.req-more { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.req-more form { display: contents; }
.btn--danger-text { color: var(--red); }
.btn--danger-text:hover { background: var(--red-wash); color: var(--red-deep); }

/* The client contact's page. */
.guest-req-summary { margin: 0 0 14px; padding: 12px 16px; border-radius: var(--r-pop); background: var(--accent-wash); color: var(--accent-deep); font-size: 0.9375rem; }
.guest-req-summary p { margin: 0; }
.guest-req-summary .icon { width: 18px; height: 18px; vertical-align: -3px; margin-right: 4px; }
.guest-req-lines { margin: 0; padding: 0; list-style: none; }
.guest-req { padding: 14px 16px; border-bottom: 1px solid var(--line); scroll-margin-top: calc(var(--top-h, 56px) + 12px); }
.guest-req:last-child { border-bottom: 0; }
.guest-req.is-open { background: color-mix(in srgb, var(--accent-wash) 45%, var(--page)); }
.guest-req.is-done .guest-req-text b { color: var(--ink-2); font-weight: 500; }
.guest-req-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px 20px; }
.guest-req-text { display: grid; gap: 4px; min-width: 0; flex: 1 1 20rem; }
.guest-req-text b { font-size: 1rem; font-weight: 600; line-height: 1.4; }
.guest-req-note { font-size: 0.875rem; color: var(--ink-2); }
.guest-req-state { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.guest-req-state .tag .icon { width: 12px; height: 12px; vertical-align: -1px; }
.guest-req .guest-uploads { padding: 8px 0 0; }
.guest-req-upload { margin-top: 12px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-pop); background: var(--page); }
.guest-req-foot { margin: 16px 0 0; text-align: center; }

/* A year of bank statements. */
.eng-check { margin-bottom: 14px; }
.bank-packs { margin: 0 0 14px; font-size: 0.875rem; color: var(--ink-2); }
.bank-packs b { color: var(--ink); font-weight: 600; }
.bank-pack-meta { color: var(--ink-3); }
.bank-acct { scroll-margin-top: calc(var(--top-h, 56px) + 12px); }
.bank-year { padding: 16px 16px 4px; }
.bank-track { position: relative; height: 14px; border-radius: 7px; background: var(--hover); overflow: hidden; }
.bank-cover { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--tag-green-ink) 55%, var(--tag-green)); }
.bank-gap { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(135deg, var(--red) 0 3px, var(--red-wash) 3px 7px); }
.bank-break { position: absolute; top: -2px; bottom: -2px; width: 3px; margin-left: -1px; background: var(--tag-orange-ink); box-shadow: 0 0 0 2px var(--page); }
.bank-months { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); margin: 4px 0 0; padding: 0; list-style: none; font-size: 0.6875rem; color: var(--ink-3); }
.bank-months li { padding-left: 2px; border-left: 1px solid var(--line-2); }
.bank-facts { display: grid; margin: 8px 0 0; padding: 0 16px 6px; font-size: 0.875rem; }
.bank-facts > div { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: 14px; padding: 9px 0; border-top: 1px solid var(--line); }
.bank-facts dt { color: var(--ink-3); }
.bank-facts dd { margin: 0; color: var(--ink); display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.bank-facts small { color: var(--ink-3); font-size: 0.8125rem; }
.bank-ok { display: inline-flex; align-items: center; gap: 6px; color: var(--tag-green-ink); font-weight: 500; }
.bank-ok .icon { width: 14px; height: 14px; }
.bank-break-text { display: block; flex-basis: 100%; color: var(--ink-2); }
.bank-ye dd { display: grid; gap: 8px; justify-items: start; }
.bank-ye-figs { display: flex; flex-wrap: wrap; gap: 6px 28px; }
.bank-ye-figs > span { display: grid; gap: 1px; }
.bank-ye-figs small { font-size: 0.75rem; color: var(--ink-3); font-weight: 400; }
.bank-ye-figs b { font-size: 1.0625rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.bank-ye-figs .eng-overdue b { color: var(--red); }
.bank-ye-figs .bank-ok { display: grid; }
.bank-ye-who { display: block; }
.bank-figure { display: grid; gap: 6px; width: 100%; max-width: 30rem; }
.bank-figure label { font-size: 0.8125rem; font-weight: 500; color: var(--ink-2); }
.bank-figure .input-row { gap: 8px; align-items: center; }
.bank-figure input { font-variant-numeric: tabular-nums; }
.bank-statements { border-top: 1px solid var(--line); }
.bank-statements td small { display: block; }
.bank-statements tr.is-break td { background: color-mix(in srgb, var(--tag-orange) 45%, var(--page)); }
.table .num, .table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Samples. */
.smp-key { display: grid; grid-template-columns: minmax(0, 1fr) auto 8rem; gap: 8px; align-items: center; font-size: 0.875rem; color: var(--ink-3); }
.smp-key select { height: 36px; }
.smp-random { max-width: 7rem; }
.smp-preview { margin: 0 0 14px; }
.smp-table td { vertical-align: top; }
.smp-counts { font-size: 0.875rem; color: var(--ink-2); white-space: nowrap; }
.smp-counts b { color: var(--ink); }
.smp-table .meter { max-width: 9rem; }
.smp-table .meter > span { background: var(--accent); }
.smp-drawn { font-size: 0.875rem; white-space: nowrap; }
.smp-drawn small { display: block; color: var(--ink-3); font-size: 0.8125rem; }
.smp-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin: 0 0 14px; }
.smp-summary p { margin: 0; font-size: 0.9375rem; }
.smp-summary .meter { flex: 1 1 12rem; max-width: 24rem; margin: 0; height: 8px; display: flex; }
.meter--split > span { flex: none; }
.meter .meter-ok { background: color-mix(in srgb, var(--tag-green-ink) 55%, var(--tag-green)); }
.meter .meter-bad { background: var(--red); }
.smp-summary-counts { display: flex; flex-wrap: wrap; gap: 6px; }
.smp-items td { vertical-align: top; }
.smp-items .smp-col-n { width: 4.5rem; }
.smp-n { display: inline-block; min-width: 2.6rem; padding: 1px 6px; border-radius: var(--r-tag); background: var(--well); font-size: 0.75rem; font-weight: 600; color: var(--ink-2); text-align: center; font-variant-numeric: tabular-nums; }
.smp-items tr.smp-group th { padding: 12px 14px 6px; background: var(--page); border-bottom: 1px solid var(--line); text-align: left; font-size: 0.8125rem; font-weight: 600; color: var(--ink); }
.smp-items tr.smp-group th span { margin-left: 6px; font-weight: 400; color: var(--ink-3); }
.smp-items .req-meta { display: block; }
.smp-step { display: inline-flex; gap: 2px; }
.smp-choices { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 14px; padding: 0; border: 0; }
.smp-choice { position: relative; display: inline-flex; }
.smp-choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.smp-choice span { display: inline-flex; align-items: center; min-height: 34px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: var(--r-pill); font-size: 0.875rem; font-weight: 500; color: var(--ink-2);
  transition: border-color 120ms var(--ease-out), background-color 120ms var(--ease-out), color 120ms var(--ease-out); }
.smp-choice:hover span { border-color: var(--accent); }
.smp-choice input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-ring); }
.smp-choice input:checked + span { border-color: var(--ink-2); background: var(--well); color: var(--ink); }
.smp-choice--ok input:checked + span { border-color: var(--tag-green-ink); background: var(--tag-green); color: var(--tag-green-ink); }
.smp-choice--bad input:checked + span { border-color: var(--red); background: var(--red-wash); color: var(--red-deep); }
.smp-remove { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }

/* Sign-off: prepared, reviewed, changes since, review notes. */
.signoff { margin-top: 16px; scroll-margin-top: calc(var(--top-h, 56px) + 12px); }
.signoff-marks { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.signoff-mark { display: grid; align-content: start; gap: 6px; padding: 14px 16px; }
.signoff-mark + .signoff-mark { border-left: 1px solid var(--line); }
.signoff-label { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.02em; color: var(--ink-3); }
.signoff-label .icon { width: 14px; height: 14px; }
.signoff-who { margin: 0; font-size: 0.875rem; color: var(--ink-2); }
.signoff-who b { color: var(--ink); font-weight: 600; }
.signoff-who .icon { width: 15px; height: 15px; margin-right: 2px; vertical-align: -2px; color: var(--tag-green-ink); }
.signoff-mark.is-empty .signoff-who { color: var(--ink-3); }
.signoff-ref, .signoff-said { margin: 0; font-size: 0.875rem; color: var(--ink-2); }
.signoff-said { font-style: italic; }
.signoff-blocked { display: flex; align-items: flex-start; gap: 6px; margin: 0; padding: 8px 10px; border-radius: var(--r); background: var(--well); font-size: 0.8125rem; color: var(--ink-2); }
.signoff-blocked .icon { flex: none; width: 14px; height: 14px; margin-top: 2px; }
.signoff-form { display: grid; gap: 6px; }
.signoff-form label { font-size: 0.8125rem; font-weight: 500; color: var(--ink-2); }
.signoff-form input, .signoff-form textarea { width: 100%; min-height: 34px; padding: 6px 10px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--page); color: var(--ink); font: inherit; font-size: 0.875rem; }
.signoff-form input:focus, .signoff-form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.signoff-form .input-row { gap: 8px; }
.signoff-form .input-row input { width: 8rem; flex: none; text-transform: uppercase; font-weight: 600; }
.signoff-form .input-row input::placeholder { text-transform: none; font-weight: 400; }
.signoff-actions { display: flex; align-items: center; gap: 14px; font-size: 0.875rem; }
.signoff-changed { margin: 0 16px 14px; padding: 10px 14px; border-radius: var(--r-pop); background: color-mix(in srgb, var(--tag-orange) 55%, var(--page)); }
.signoff-changed .signoff-label { color: var(--tag-orange-ink); }
.signoff-changed ul { margin: 6px 0 0; padding: 0; list-style: none; font-size: 0.875rem; color: var(--ink); }
.signoff-changed li { display: flex; flex-wrap: wrap; gap: 2px 8px; padding: 3px 0; }
.signoff-changed small { color: var(--ink-2); }
.signoff-notes { display: grid; gap: 10px; padding: 14px 16px 16px; border-top: 1px solid var(--line); }
.signoff-note-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.signoff-note { display: grid; gap: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-pop); scroll-margin-top: calc(var(--top-h, 56px) + 12px); }
.signoff-note.is-closed { background: var(--well); border-color: transparent; }
.signoff-note.is-closed .signoff-note-text { color: var(--ink-2); }
.signoff-note-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.signoff-note-head small { color: var(--ink-3); font-size: 0.8125rem; }
.signoff-note-text { margin: 0; font-size: 0.9375rem; line-height: 1.5; color: var(--ink); }
.signoff-answer { margin: 0; padding-left: 12px; border-left: 1px solid var(--line-2); font-size: 0.875rem; color: var(--ink-2); }
.signoff-answer small { color: var(--ink-3); }
.signoff-note-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.signoff-note-actions .signoff-form { width: 100%; }
.signoff-add { margin-top: 4px; }

/* The Review tab. */
.rv-progress { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 28px; margin: 0 0 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-pop); background: var(--page); }
.rv-figure p { margin: 0; font-size: 1.0625rem; }
.rv-figure b { font-size: 1.375rem; font-weight: 700; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.rv-figure .meter { width: 14rem; height: 8px; }
.rv-figure .meter > span { background: color-mix(in srgb, var(--tag-green-ink) 55%, var(--tag-green)); }
.rv-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; margin: 0; padding: 0; list-style: none; font-size: 0.875rem; color: var(--ink-2); }
.rv-facts b { color: var(--ink); }
.rv-progress .field-hint { flex-basis: 100%; margin: 0; }
.rv-notes { display: grid; margin: 0; padding: 4px 16px 10px; list-style: none; }
.rv-notes li { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.rv-notes li:last-child { border-bottom: 0; }
.rv-notes li > .tag { flex: none; margin-top: 2px; }
.rv-notes small { color: var(--ink-3); font-size: 0.8125rem; }
.rv-notes .signoff-note-text { margin: 2px 0 4px; font-size: 0.875rem; }
.rv-table td { vertical-align: top; }
.rv-what { display: inline-flex; align-items: center; gap: 8px; }
.rv-mark { font-size: 0.875rem; white-space: nowrap; }
.rv-mark small { display: block; color: var(--ink-3); font-size: 0.8125rem; }
.rv-go { margin-left: 8px; }

@media (max-width: 960px) {
  .signoff-mark + .signoff-mark { border-left: 0; border-top: 1px solid var(--line); }
  .req-mails li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .bank-facts > div { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .smp-key { grid-template-columns: minmax(0, 1fr); }
  .rv-mark { white-space: normal; }
}


/* Round 47: a law firm's matters (US-129 to US-133). mat-*, bun-*, chr-*, fica-*, set-* rules go here. */

/* Shared: a warning callout (amber), a dot on a tab, a sub-line under a panel's bar, and choice rows. */
.callout--warn { background: color-mix(in srgb, var(--tag-yellow) 60%, var(--page)); border-color: color-mix(in srgb, var(--tag-yellow-ink) 22%, var(--tag-yellow)); color: var(--ink); }
.callout--warn > .icon { color: var(--tag-yellow-ink); }
.callout--warn .btn { margin-left: auto; }
.tab-dot { display: inline-block; width: 7px; height: 7px; margin-left: -2px; border-radius: 50%; background: #d98a00; box-shadow: 0 0 0 2px var(--page); }
.panel-sub { margin: 0; font-size: 0.8125rem; font-weight: 400; color: var(--ink-3); }
section.panel > .panel-sub { padding: 10px 16px 0; color: var(--ink-2); font-size: 0.875rem; max-width: 70ch; }
.mat-choice { position: relative; display: flex; align-items: flex-start; gap: 10px; margin: 0 0 6px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--r); cursor: pointer;
  transition: border-color 120ms var(--ease-out), background-color 120ms var(--ease-out); }
.field-hint.set-fixed { margin: -4px 0 18px; }
.form-field > label.mat-choice { display: flex; margin: 0 0 6px; font-size: inherit; font-weight: 400; color: inherit; }
.mat-choice:hover { border-color: var(--accent); }
.mat-choice input { flex: none; width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--accent); }
.mat-choice > span { display: grid; gap: 2px; min-width: 0; }
.mat-choice b { font-size: 0.875rem; font-weight: 600; color: var(--ink); }
.mat-choice small { font-size: 0.8125rem; color: var(--ink-3); line-height: 1.4; }
.mat-choice:has(input:checked) { border-color: var(--accent); background: var(--accent-wash); }
.mat-choice:has(input:checked) b { color: var(--accent-deep); }
.mat-choice:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.mat-choice.is-off { cursor: not-allowed; opacity: 0.6; }
.mat-choice.is-off:hover { border-color: var(--line-2); }
fieldset:has(> .mat-choice) { margin: 0 0 14px; padding: 0; border: 0; min-width: 0; }
fieldset:has(> .mat-choice) > legend { margin-bottom: 6px; padding: 0; font-size: 0.875rem; font-weight: 500; color: var(--ink); }

/* The matter's head: its number set apart from its description. */
.mat-title h1 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; }
.mat-number { font-variant-numeric: tabular-nums; letter-spacing: 0.01em; color: var(--accent-deep); }
.mat-desc { min-width: 0; }
.mat-table .mat-number { margin-right: 4px; font-weight: 650; }

/* Where the matter stands: Intake with its two checks, Open, Closed. */
.mat-status { display: grid; gap: 10px; margin: 6px 0 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-pop); background: var(--well); }
.mat-status-title { margin: 0; font-size: 1rem; font-weight: 600; line-height: 1.4; text-wrap: balance; }
.mat-status-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.mat-status-actions form { margin: 0; }
.mat-status-actions .field-hint { margin: 0; }
.mat-checks { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.mat-checks li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 8px 10px; border-radius: var(--r); background: var(--page); font-size: 0.875rem; color: var(--ink-2); }
.mat-checks li b { color: var(--ink); font-weight: 600; }
.mat-checks li > .btn { margin-left: auto; }
.mat-check-mark { display: inline-grid; place-items: center; flex: none; width: 20px; height: 20px; border: 2px solid var(--line-2); border-radius: 50%; background: var(--page); }
.mat-check-mark .icon { width: 12px; height: 12px; }
.mat-checks li.is-done .mat-check-mark { border-color: var(--tag-green-ink); background: var(--tag-green-ink); color: #fff; }
.mat-without { margin: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--page); }
.mat-without .form-actions { display: flex; align-items: center; gap: 14px; font-size: 0.875rem; }
.mat-without-line { display: flex; align-items: flex-start; gap: 8px; margin: 0; font-size: 0.875rem; color: var(--tag-orange-ink); }
.mat-without-line .icon { flex: none; width: 15px; height: 15px; margin-top: 2px; }
.mat-closing { display: grid; gap: 8px; padding: 10px 12px; border: 1px solid var(--red-line); border-radius: var(--r); background: var(--red-wash); font-size: 0.875rem; }
.mat-closing p { margin: 0; }
.mat-closing strong { color: var(--red-deep); }
.mat-closed-line { margin: 0; font-size: 0.875rem; color: var(--ink-3); }
.mat-back { font-size: 0.875rem; }

/* New matter: the carried names, the client's number, the kinds, the parties. */
.mat-carried, .mat-fica-line { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 12px; padding: 8px 12px; border-radius: var(--r); font-size: 0.875rem; }
.mat-carried { background: var(--accent-wash); color: var(--accent-deep); }
.mat-fica-line { background: color-mix(in srgb, var(--tag-yellow) 60%, var(--page)); color: var(--tag-yellow-ink); }
.mat-carried .icon, .mat-fica-line .icon { flex: none; width: 15px; height: 15px; margin-top: 2px; }
.panel > .mat-carried { margin: 12px 16px 0; }
.mat-prefix { width: 6rem !important; text-transform: uppercase; font-weight: 600; letter-spacing: 0.04em; }
.mat-next { margin: 6px 0 0; font-size: 0.875rem; color: var(--ink-2); }
.mat-next b { color: var(--accent-deep); font-variant-numeric: tabular-nums; }
.mat-kinds { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 8px; }
.mat-kind { position: relative; display: grid; gap: 3px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--r); cursor: pointer;
  transition: border-color 120ms var(--ease-out), background-color 120ms var(--ease-out); }
.mat-kind:hover { border-color: var(--accent); }
.mat-kind input { position: absolute; opacity: 0; pointer-events: none; }
.mat-kind-name { font-size: 0.875rem; font-weight: 600; color: var(--ink); }
.mat-kind-sections { font-size: 0.75rem; line-height: 1.4; color: var(--ink-3); }
.mat-kind:has(input:checked) { border-color: var(--accent); background: var(--accent-wash); }
.mat-kind:has(input:checked) .mat-kind-name { color: var(--accent-deep); }
.mat-kind:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.mat-party-pick, .mat-party-found { display: grid; margin: 0 0 10px; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: var(--r); }
.mat-party-pick li, .mat-party-found li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 7px 10px; font-size: 0.875rem; }
.mat-party-pick li + li, .mat-party-found li + li { border-top: 1px solid var(--line); }
.mat-party-name { flex: 1 1 12rem; min-width: 0; color: var(--ink); }
.mat-party-name small { margin-left: 4px; color: var(--ink-3); font-size: 0.8125rem; }
.mat-party-pick select, .mat-party-found select, .mat-add-row select { height: 30px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--page); color: var(--ink); font-size: 0.8125rem; }
.mat-party-new { background: var(--well); }
.mat-party-found { margin-top: 8px; }
.mat-fica-mark { display: inline-block; padding: 0 5px; border-radius: var(--r-tag); background: var(--tag-yellow); color: var(--tag-yellow-ink); font-size: 0.6875rem; font-weight: 650; letter-spacing: 0.03em; vertical-align: 1px; }

/* Parties and the conflict check. */
.mat-parties-table td { vertical-align: top; }
.mat-parties-table th:nth-child(1) { width: 28%; }
.mat-parties-table th:nth-child(2) { width: 12%; }
.mat-parties-table th:nth-child(3) { width: 30%; }
.mat-parties-table .doc-meta, .fica-lines .doc-meta { display: block; margin: 2px 0 0; white-space: normal; }
.mat-party-actions { white-space: nowrap; text-align: right; }
.mat-party-actions form { display: inline-block; margin: 0 0 0 6px; }
.mat-party-edit, .mat-add-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 0.875rem; }
.mat-party-edit input:not([type="hidden"]), .mat-add-row input { flex: 1 1 12rem; height: 30px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--page); color: var(--ink); font: inherit; font-size: 0.8125rem; }
.mat-party-edit select { height: 30px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--page); font-size: 0.8125rem; }
.mat-party-edit input:focus, .mat-add-row input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.mat-add { display: grid; gap: 8px; padding: 14px 16px; border-top: 1px solid var(--line); background: var(--well); }
.mat-add label { font-size: 0.8125rem; font-weight: 500; color: var(--ink-2); }
.mat-add .field-hint { margin: 0; }
.mat-add-form { display: grid; gap: 8px; }
.mat-check { display: grid; gap: 10px; padding: 14px 16px; }
.mat-check-who { margin: 0; font-size: 0.875rem; color: var(--ink-2); }
.mat-check-words { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 0.8125rem; color: var(--ink-3); }
.mat-check-words .icon { width: 14px; height: 14px; }
.mat-check-names { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.mat-check-names li { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border: 1px solid var(--line-2); border-radius: var(--r-pill); font-size: 0.8125rem; color: var(--ink-2); }
.mat-check-names b { color: var(--ink); font-weight: 600; }
.mat-hits { color: var(--red); font-weight: 600; }
.mat-nohits { color: var(--ink-3); }
.mat-check-none { display: flex; align-items: center; gap: 8px; margin: 0; padding: 10px 12px; border-radius: var(--r); background: var(--tag-green); color: var(--tag-green-ink); font-size: 0.875rem; }
.mat-check-none .icon { width: 15px; height: 15px; }
.mat-hits-list { display: grid; margin: 0; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: var(--r); }
.mat-hits-list li { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px 10px; padding: 9px 12px; font-size: 0.875rem; color: var(--ink-2); }
.mat-hits-list li + li { border-top: 1px solid var(--line); }
.mat-hits-list li.is-foremost { background: var(--red-wash); }
.mat-hits-list b { color: var(--ink); font-weight: 600; }
.mat-hit-text { flex: 1 1 18rem; min-width: 0; line-height: 1.5; }
.mat-close-spelling { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: var(--r-tag); background: var(--well); color: var(--ink-3); font-size: 0.75rem; }
.mat-hit-hidden { color: var(--ink-3); font-style: italic; }
.mat-outcome { display: flex; align-items: center; gap: 8px; margin: 0; padding: 10px 12px; border-radius: var(--r); font-size: 0.875rem; font-weight: 500; }
.mat-outcome--noconflict { background: var(--tag-green); color: var(--tag-green-ink); }
.mat-outcome--waived { background: var(--tag-yellow); color: var(--tag-yellow-ink); }
.mat-outcome--declined { background: var(--tag-hold); color: var(--tag-hold-ink); }
.mat-outcome-form { display: grid; gap: 4px; margin-top: 4px; padding-top: 14px; border-top: 1px solid var(--line); max-width: 40rem; }
.mat-outcome-form fieldset { margin: 0 0 8px; padding: 0; border: 0; }
.mat-outcome-form legend { margin-bottom: 6px; font-size: 0.875rem; font-weight: 600; }
.mat-outcome-form .form-field > input { width: 100%; }
.mat-outcome-form > .btn { justify-self: start; }
.mat-earlier { border-top: 1px solid var(--line); font-size: 0.875rem; }
.mat-earlier summary { padding: 10px 16px; cursor: pointer; color: var(--ink-2); font-weight: 500; }
.mat-earlier ul { margin: 0; padding: 0 16px 10px; list-style: none; }
.mat-earlier li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 7px 0; border-top: 1px solid var(--line); color: var(--ink-2); }
.mat-earlier li > span { flex: 1 1 20rem; }
.mat-check--earlier { flex-basis: 100%; padding: 10px 12px; border-radius: var(--r); background: var(--well); }
.mat-conflicts { display: grid; gap: 16px; margin-bottom: 16px; }
.mat-conflicts .panel + .panel { margin-top: 0; }
.mat-conflicts.has-check { grid-template-columns: minmax(16rem, 2fr) minmax(0, 3fr); align-items: start; }
.mat-conflicts .panel-form { padding: 14px 16px 16px; }
.mat-conflicts textarea { width: 100%; }
.mat-check > .btn { justify-self: start; }
.mat-opened-as { margin: 0; font-size: 0.875rem; }
.mat-own-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0 0 38px; padding: 8px 12px; border-radius: var(--r); background: var(--accent-wash); color: var(--accent-deep); font-size: 0.875rem; }
.mat-own-line .icon { width: 15px; height: 15px; }
.mat-side-closed { border-top: 1px solid var(--line); font-size: 0.8125rem; }
.mat-side-closed summary { padding: 8px 14px; cursor: pointer; color: var(--ink-3); }

/* Court bundles: the list. */
.bun-new { display: grid; gap: 4px; margin: 12px 16px 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-pop); background: var(--well); max-width: 40rem; }
.bun-new .form-field > input { width: 100%; }
.bun-new .form-actions { display: flex; align-items: center; gap: 14px; font-size: 0.875rem; }
.bun-list { display: grid; margin: 10px 0 0; padding: 0; list-style: none; }
.bun-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 12px 16px; border-top: 1px solid var(--line); scroll-margin-top: calc(var(--top-h, 56px) + 12px); }
.bun-icon { display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: var(--r); background: var(--accent-wash); color: var(--accent-deep); }
.bun-icon .icon { width: 18px; height: 18px; }
.bun-main { display: grid; gap: 2px; flex: 1 1 14rem; min-width: 0; }
.bun-name { font-size: 0.9375rem; font-weight: 600; color: var(--ink); }
a.bun-name { text-decoration: none; }
a.bun-name:hover { color: var(--accent); text-decoration: underline; }
.bun-meta { display: inline-flex; align-items: center; gap: 4px; font-size: 0.8125rem; color: var(--ink-3); }
.bun-meta .icon { width: 13px; height: 13px; }
.bun-state { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 0.8125rem; }
.bun-state small { color: var(--ink-3); font-size: 0.8125rem; }
.bun-actions { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-left: auto; }
.bun-delete { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; font-size: 0.8125rem; }
.bun-row .bun-delete { padding: 6px 10px; border-radius: var(--r); background: var(--red-wash); color: var(--ink); }

/* One bundle: the head, how it stands, the choices. */
.bun-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 16px; margin: 4px 0 14px; }
.bun-head .page-title .icon { color: var(--accent-deep); }
.bun-title { margin: 0; font-size: 1.25rem; font-weight: 650; letter-spacing: -0.01em; }
.bun-head .head-actions { margin-top: 0; }
.bun-head .head-actions form { margin: 0; }
.bun-status { display: grid; gap: 10px; margin-bottom: 14px; }
.bun-status:empty { display: none; }
.bun-status > .callout { margin: 0; }
.bun-making { display: grid; gap: 6px; padding: 14px 16px; border: 1px solid var(--accent-wash); border-radius: var(--r-pop); background: color-mix(in srgb, var(--accent-wash) 40%, var(--page)); }
.bun-making p { margin: 0; font-size: 0.875rem; }
.bun-making b { color: var(--accent-deep); font-weight: 600; font-variant-numeric: tabular-nums; }
.panel > .bun-making { margin: 12px 16px; }
.bun-progress { position: relative; height: 8px; border-radius: 4px; background: var(--page); box-shadow: inset 0 0 0 1px var(--accent-wash); overflow: hidden; }
.bun-progress > span { position: absolute; inset: 0 auto 0 0; border-radius: 4px; background: var(--accent); transition: width 600ms var(--ease-out); overflow: hidden; }
.bun-progress > span::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgb(255 255 255 / 0.45), transparent); animation: bun-sheen 1.6s linear infinite; }
@keyframes bun-sheen { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .bun-progress > span { transition: none; } .bun-progress > span::after { animation: none; } }
.bun-note { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 0.8125rem; color: var(--ink-3); }
.bun-note .icon { flex: none; width: 13px; height: 13px; }
.panel > .bun-note, .chr-foot > .bun-note { padding: 10px 16px; }
.chr-foot > .bun-note { padding: 0; }
.bun-problems ul { margin: 6px 0 0; padding-left: 18px; font-size: 0.875rem; }
.bun-problems p { margin: 0; }
.bun-problems li + li { margin-top: 2px; }
.bun-problems a { margin-left: 4px; font-weight: 500; }
.bun-made { display: flex; align-items: center; gap: 8px; margin: 0; padding: 9px 12px; border-radius: var(--r); background: var(--tag-green); color: var(--tag-green-ink); font-size: 0.875rem; }
.bun-made .icon { width: 15px; height: 15px; flex: none; }
.bun-choices { margin-bottom: 16px; }
.bun-choices > summary { cursor: pointer; list-style: none; }
.bun-choices > summary::-webkit-details-marker { display: none; }
.bun-choices > summary::after { content: ""; flex: none; width: 7px; height: 7px; margin: 0 2px 3px 4px; border-right: 1.5px solid var(--ink-3); border-bottom: 1.5px solid var(--ink-3); transform: rotate(45deg); transition: transform 160ms var(--ease-out); }
.bun-choices[open] > summary::after { margin-bottom: -3px; transform: rotate(-135deg); }
.bun-choices > summary .panel-sub { margin-left: auto; text-align: right; }
.bun-choices:not([open]) > summary { border-bottom: 0; }
.bun-choices-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 4px 20px; align-items: start; padding: 14px 16px 16px; }
.bun-choices-form .form-field { grid-column: 1 / -1; max-width: 28rem; margin-bottom: 8px; }
.bun-choices-form .form-field > input { width: 100%; }
.bun-checks { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 0 24px; font-size: 0.875rem; }
.bun-checks .check { padding: 4px 0; }
.bun-choices-form > .btn { grid-column: 1 / -1; justify-self: start; margin-top: 6px; }

/* A bundle's sections and the documents in them, dragged or moved with arrows. */
.bun-section { scroll-margin-top: calc(var(--top-h, 56px) + 12px); }
.bun-section .panel-lead { flex-direction: column; align-items: flex-start; gap: 2px; }
.bun-section .panel-title { display: flex; align-items: center; gap: 8px; font-size: 0.9375rem; }
.bun-letter { display: inline-grid; place-items: center; flex: none; min-width: 26px; height: 26px; padding: 0 6px; border-radius: var(--r); background: var(--accent-wash); color: var(--accent-deep); font-size: 0.8125rem; font-weight: 700; }
.bun-section-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.bun-section-actions form { margin: 0; }
.bun-rename { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; flex: 1; font-size: 0.875rem; }
.bun-rename input:not([type="hidden"]) { flex: 1 1 14rem; height: 32px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: var(--r); font: inherit; font-size: 0.875rem; }
.bun-rename input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.bun-rename .field-error { flex-basis: 100%; margin: 0; }
.bun-entries { margin: 0; padding: 0; list-style: none; }
.bun-entry { position: relative; display: flex; align-items: center; gap: 10px; padding: 9px 14px 9px 8px; border-bottom: 1px solid var(--line); background: var(--page); scroll-margin-top: calc(var(--top-h, 56px) + 12px);
  transition: background-color 120ms var(--ease-out), opacity 120ms var(--ease-out); }
.bun-entry:last-child { border-bottom: 0; }
.bun-entry:hover { background: var(--well); }
.bun-entry:target { background: color-mix(in srgb, var(--accent-wash) 55%, var(--page)); }
.bun-entry.is-bad { background: var(--red-wash); }
.bun-grip { display: inline-grid; place-items: center; flex: none; width: 18px; height: 28px; border-radius: var(--r-tag); color: var(--ink-4); font-size: 0.75rem; letter-spacing: -0.15em; cursor: grab; user-select: none; }
.bun-entry:hover .bun-grip { background: var(--hover); color: var(--ink-2); }
.bun-entry[draggable="true"] { cursor: grab; }
.bun-entry.is-dragging { opacity: 0.45; }
.bun-entry.is-drop-before { box-shadow: inset 0 2px 0 var(--accent); }
.bun-entry.is-drop-after { box-shadow: inset 0 -2px 0 var(--accent); }
.bun-empty.is-drop-into { background: var(--accent-wash); box-shadow: inset 0 0 0 2px var(--accent); color: var(--accent-deep); }
.bun-entry-main { display: grid; gap: 2px; flex: 1 1 auto; min-width: 0; }
.bun-desc { font-size: 0.875rem; font-weight: 500; color: var(--ink); overflow-wrap: anywhere; }
a.bun-desc { text-decoration: none; }
a.bun-desc:hover { color: var(--accent); text-decoration: underline; }
.bun-entry-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; font-size: 0.75rem; color: var(--ink-3); }
.bun-entry-meta .icon { width: 12px; height: 12px; vertical-align: -1px; }
.bun-bad { color: var(--red); font-weight: 600; }
.bun-range { flex: none; min-width: 4.5rem; padding: 2px 8px; border-radius: var(--r-tag); background: var(--well); color: var(--ink-2); font-size: 0.75rem; font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; }
.bun-entry-actions { display: inline-flex; flex: none; align-items: center; gap: 4px; }
.bun-entry-actions form { margin: 0; }
.bun-entry-edit { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; flex: 1; font-size: 0.875rem; }
.bun-entry-edit input:not([type="hidden"]) { height: 32px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: var(--r); font: inherit; font-size: 0.875rem; }
.bun-entry-edit input[name="Description"] { flex: 1 1 16rem; }
.bun-entry-edit input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.bun-entry-edit .field-error { flex-basis: 100%; margin: 0; }
.bun-empty { margin: 0; padding: 18px 16px; color: var(--ink-3); font-size: 0.875rem; text-align: center; border-bottom: 1px dashed var(--line-2); }
.bun-foot { margin: 0; padding: 8px 14px; border-top: 1px solid var(--line); }
.bun-picker { display: grid; gap: 10px; padding: 14px 16px; border-top: 1px solid var(--line); background: var(--well); }
.bun-picker label[for="bun-q"] { font-size: 0.8125rem; font-weight: 500; color: var(--ink-2); }
.bun-picker select { height: 34px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--page); font-size: 0.8125rem; }
.bun-found { display: grid; max-height: 22rem; margin: 0 0 10px; padding: 0 10px; overflow-y: auto; list-style: none; border: 1px solid var(--line); border-radius: var(--r); background: var(--page); }
.bun-found li + li { border-top: 1px solid var(--line); }
.bun-found .check { align-items: center; padding: 7px 0; font-size: 0.875rem; }
.bun-found-title { flex: 1; min-width: 0; color: var(--ink); }
.bun-found .check small { flex: none; }
.bun-picker .form-actions { display: flex; align-items: center; gap: 14px; font-size: 0.875rem; }
.bun-add { margin: 12px 0 16px; }
.bun-add-section { display: grid; gap: 6px; margin: 12px 0 16px; padding: 14px 16px; }
.bun-add-section > label { font-size: 0.8125rem; font-weight: 500; color: var(--ink-2); }
.bun-add-section .input-row { align-items: center; font-size: 0.875rem; }
.bun-versions td { vertical-align: middle; }
.bun-version-actions { white-space: nowrap; text-align: right; }
.bun-version-actions form { display: inline-block; margin: 0 0 0 6px; }
.bun-version-actions form { margin: 0; }
.bun-section + .bun-section { margin-top: 12px; }

/* Chronology. */
.chr-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.chr-warning { display: flex; align-items: center; gap: 8px; margin: 0; padding: 8px 16px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--tag-yellow) 45%, var(--page)); color: var(--tag-yellow-ink); font-size: 0.8125rem; }
.chr-warning .icon { flex: none; width: 14px; height: 14px; }
section.panel > .callout { margin: 12px 16px; }
.chr-make { display: grid; gap: 8px; margin: 12px 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-pop); background: var(--well); }
.chr-make fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.chr-make legend { margin-bottom: 8px; font-size: 0.875rem; font-weight: 600; }
.chr-sections { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 0 16px; font-size: 0.875rem; }
.chr-sections .check { padding: 4px 0; }
.chr-dates { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; font-size: 0.875rem; color: var(--ink-2); }
.chr-dates input { height: 32px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--page); font: inherit; font-size: 0.875rem; }
.chr-dates input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.chr-scope { display: flex; flex-wrap: wrap; gap: 4px 10px; margin: 0; padding: 8px 12px; border-radius: var(--r); background: var(--accent-wash); color: var(--accent-deep); font-size: 0.875rem; }
.chr-scope.is-too-many { background: var(--red-wash); color: var(--red-deep); }
.chr-make .form-actions, .chr-edit .form-actions { display: flex; align-items: center; gap: 14px; font-size: 0.875rem; }
.chr-made { display: grid; gap: 6px; padding: 10px 16px; border-bottom: 1px solid var(--line); font-size: 0.875rem; color: var(--ink-2); }
.chr-made > p { display: flex; align-items: center; gap: 6px; margin: 0; }
.chr-made > p .icon { width: 14px; height: 14px; color: var(--tag-green-ink); }
.chr-notread summary { cursor: pointer; color: var(--ink-3); font-size: 0.8125rem; }
.chr-notread ul { margin: 6px 0 0; padding-left: 18px; font-size: 0.8125rem; }
.chr-notread small { color: var(--ink-3); }
.chr-new { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.chr-add-link { margin: 0; padding: 10px 16px; }
.chr-edit { display: grid; gap: 8px; }
.chr-add { margin: 12px 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-pop); background: var(--well); }
.chr-fields { display: grid; grid-template-columns: 10rem minmax(0, 1fr) 14rem; gap: 12px; align-items: start; }
.chr-fields .form-field { margin: 0; }
.chr-fields label { display: block; margin-bottom: 4px; font-size: 0.8125rem; font-weight: 500; color: var(--ink-2); }
.chr-fields input, .chr-fields textarea { width: 100%; padding: 6px 10px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--page); color: var(--ink); font: inherit; font-size: 0.875rem; }
.chr-fields input { height: 34px; }
.chr-fields textarea { line-height: 1.45; resize: vertical; }
.chr-fields input:focus, .chr-fields textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.chr-fields [aria-invalid="true"] { border-color: var(--red); }
.chr-fields .field-hint, .chr-fields .field-error { margin: 4px 0 0; }
.chr-table td { vertical-align: top; }
.chr-date { font-variant-numeric: tabular-nums; }
.chr-what { min-width: 16rem; line-height: 1.5; color: var(--ink); }
.chr-what .tag { margin-left: 6px; }
.chr-mark { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: var(--r-tag); background: var(--well); color: var(--ink-3); font-size: 0.75rem; white-space: nowrap; }
.chr-source { font-size: 0.8125rem; }
.chr-source .chr-mark { margin-left: 0; }
.chr-row-actions { white-space: nowrap; text-align: right; }
.chr-row-actions form { display: inline-block; margin: 0 0 0 6px; }
.chr-table tr.is-removed td { color: var(--ink-3); }
.chr-table tr.is-removed .chr-what { text-decoration: line-through; text-decoration-color: var(--ink-4); }
.chr-table tr.is-editing td { background: var(--well); }
.chr-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--line); }
.chr-foot:not(:has(*)) { display: none; }

/* A client's FICA. */
.fica-kind .callout-body { display: grid; gap: 10px; }
.fica-kind .callout-body p { margin: 0; }
.fica-kind-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: 6px; }
.fica-kind-choices .mat-choice { margin: 0; background: var(--page); }
.fica-kind .btn { justify-self: start; }
.fica-lines td { vertical-align: top; }
.fica-why, .fica-how { display: block; margin-top: 3px; font-size: 0.75rem; color: var(--ink-3); }
.fica-how { font-style: italic; }
.fica-choose { text-align: right; }
.fica-choose-form { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 6px; font-size: 0.8125rem; text-align: left; }
.fica-choose-form select { max-width: 18rem; height: 30px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--page); font-size: 0.8125rem; }
.fica-choose-form .field-error { flex-basis: 100%; margin: 0; text-align: right; }
.fica-ask { display: grid; gap: 10px; padding: 14px 16px; font-size: 0.875rem; }
.fica-ask p { margin: 0; }
.fica-asked { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--ink-2); }
.fica-asked .icon { width: 15px; height: 15px; color: var(--ink-3); }
.fica-ask-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.fica-ask-form label { font-weight: 500; color: var(--ink-2); }
.fica-ask-form select { height: 32px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--page); font-size: 0.875rem; }
.fica-ask-form .field-hint, .fica-ask-form .field-error { flex-basis: 100%; margin: 0; }
.fica-ask-form .btn { order: 9; }
.fica-who { margin: 0; padding: 14px 16px; color: var(--ink-3); font-size: 0.875rem; }
.fica-verify { display: grid; gap: 14px; padding: 14px 16px 16px; max-width: 44rem; }
.fica-verify fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.fica-verify legend { margin-bottom: 8px; font-size: 0.875rem; font-weight: 600; }
.fica-how-field { display: grid; grid-template-columns: minmax(8rem, 14rem) minmax(0, 1fr); align-items: center; gap: 4px 12px; margin: 0 0 6px; }
.fica-how-field label { font-size: 0.875rem; color: var(--ink-2); }
.fica-how-field .field-error { grid-column: 2; margin: 0; }
.fica-verify input:not([type="radio"]) { width: 100%; height: 34px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--page); color: var(--ink); font: inherit; font-size: 0.875rem; }
.fica-verify input:not([type="radio"]):focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.fica-verify [aria-invalid="true"] { border-color: var(--red) !important; }
.fica-verify fieldset:has(> .mat-choice) { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.fica-verify fieldset:has(> .mat-choice) > legend, .fica-verify fieldset:has(> .mat-choice) > .field-error { grid-column: 1 / -1; }
.fica-verify fieldset > .mat-choice { margin: 0; }
.fica-verify > .btn { justify-self: start; }
.fica-history { margin: 0; padding: 4px 16px 10px; list-style: none; }
.fica-history li { display: grid; grid-template-columns: 10.5rem 10rem minmax(0, 1fr); gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 0.875rem; color: var(--ink-2); }
.fica-history li:last-child { border-bottom: 0; }
.fica-history .date { color: var(--ink-3); font-size: 0.8125rem; font-variant-numeric: tabular-nums; }
.fica-none { margin: 0; padding: 14px 16px; }
.fica-side-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; padding: 12px 14px 0; font-size: 0.8125rem; }
.fica-side-kind-name { color: var(--ink-2); }
.fica-side .doc-panel-note { padding-top: 6px; }
.fica-side-kind { display: grid; gap: 6px; padding: 12px 14px; font-size: 0.8125rem; }
.fica-side-kind label { font-weight: 500; color: var(--ink-2); }
.fica-side-row { display: flex; gap: 6px; }
.fica-side-row select { flex: 1; min-width: 0; height: 30px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--page); font-size: 0.8125rem; }
.fica-side-kind .field-error { margin: 0; }

/* Settings › Matters and its FICA page. */
.set-mat-types { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 0 18px; }
.set-party-types { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 0 18px; }
.set-digits { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -2px 0 10px 38px; font-size: 0.8125rem; color: var(--ink-2); }
.set-digits select { width: 5rem; height: 30px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--page); font-size: 0.8125rem; }
.set-digits .field-error { flex-basis: 100%; margin: 0; }
fieldset:has(input[value="ByHand"]:checked) .set-digits { opacity: 0.5; }
.set-example { margin: 0; padding: 8px 12px; border-radius: var(--r); background: var(--well); font-size: 0.875rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.set-kind { border-top: 1px solid var(--line); scroll-margin-top: calc(var(--top-h, 56px) + 12px); }
.panel-bar + .set-kind { border-top: 0; }
.set-kind-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 12px 16px 6px; }
.set-kind-name { margin: 0; font-size: 0.9375rem; font-weight: 650; }
.set-kind-meta { margin: 2px 0 0; font-size: 0.8125rem; color: var(--ink-3); }
.set-kind-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 0 14px; flex: 1; }
.set-kind-form .form-field > input { width: 100%; height: 34px; }
.set-kind-form .panel-form-actions { grid-column: 1 / -1; margin-top: 4px; }
.set-kind > .callout { margin: 6px 16px; }
.set-kind > .plan-list { margin: 0 16px; border: 1px solid var(--line); border-radius: var(--r); }
.set-kind > .panel-note { padding-top: 4px; color: var(--ink-3); }
.set-kind-foot { margin: 0; padding: 8px 16px 14px; }
.set-template { display: flex; align-items: center; gap: 8px; margin: 0 16px 8px; padding: 7px 12px; border-radius: var(--r); background: color-mix(in srgb, var(--tag-yellow) 60%, var(--page)); color: var(--tag-yellow-ink); font-size: 0.8125rem; }
.set-template .icon { flex: none; width: 14px; height: 14px; }
.set-sec-form { margin: 10px 16px 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-pop); background: var(--well); }
.set-sec-title { margin: 0 0 12px; font-size: 0.875rem; font-weight: 600; }
.set-kind-new { margin: 0; padding: 14px 16px 16px; border-top: 1px solid var(--line); }
.set-fica-clients { margin: 0 0 14px; font-size: 0.875rem; color: var(--ink-2); }
.set-review { display: grid; grid-template-columns: repeat(3, minmax(0, 10rem)); gap: 12px; }
.set-review .form-field { margin: 0; }
.set-review select { width: 100%; }

/* The document type's "Counted from" (US-131). */
.retention-from { display: grid; gap: 2px; margin-top: 12px; }
.retention-from-label { font-size: 0.8125rem; font-weight: 500; color: var(--ink-2); }
.retention-from .check { align-items: center; padding: 4px 0; font-size: 0.875rem; }
.retention-from .check input { margin: 0; }
.retention-from .field-hint { margin: 2px 0 0; }

@media (max-width: 960px) {
  .mat-conflicts.has-check { grid-template-columns: minmax(0, 1fr); }
  .chr-fields { grid-template-columns: minmax(0, 1fr); }
  .fica-how-field { grid-template-columns: minmax(0, 1fr); }
  .fica-how-field .field-error { grid-column: 1; }
  .fica-history li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .fica-verify fieldset:has(> .mat-choice) { grid-template-columns: minmax(0, 1fr); }
  .bun-entry { flex-wrap: wrap; }
  .bun-entry-actions { width: 100%; justify-content: flex-end; }
  .bun-choices > summary .panel-sub { margin-left: 0; text-align: left; flex-basis: 100%; }
  .set-review { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mat-own-line { margin-left: 0; }
}

/* Round 48: a demo set up for a firm (US-135). */
.flag--firm { background: var(--accent-wash); color: var(--navy); }
.firm-setup { color: var(--ink-2); }

[hidden] { display: none !important; }
