/* Passport, modernized (docs/brand/system.md): a navy cover with a thin gold rule, warm visa-page paper, entry stamps
   for entities and statuses, serif headings, monospaced figures.
   Every color, font, size, space, radius, shadow and duration is a token below; components never use a raw value.
   This file is the Passport theme and the default. Another theme is a stylesheet under themes/ that sets the same
   tokens for `data-theme="<id>"` (acctg/themes.py lists them). Light, dark or the system's choice is `data-mode`
   (absent: the system's). The two dark blocks must stay identical (a test holds them to it). Dark and every other
   theme apply on a screen only, so paper is always Passport light. No inline styles anywhere (strict CSP). */

/* Self-hosted type, Latin subsets, open licenses (fonts/README.md). Text outside the subset falls back by itself. */
@font-face { font-family: "Source Serif 4"; font-style: normal; font-weight: 200 900; font-display: swap;
             src: url("fonts/source-serif-4-latin-opsz.woff2") format("woff2");
             unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: "Public Sans"; font-style: normal; font-weight: 100 900; font-display: swap;
             src: url("fonts/public-sans-latin-wght.woff2") format("woff2");
             unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap;
             src: url("fonts/ibm-plex-mono-latin-400.woff2") format("woff2");
             unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 600; font-display: swap;
             src: url("fonts/ibm-plex-mono-latin-600.woff2") format("woff2");
             unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212; }

:root, .as-light, .look-passport {
  /* Color. Names say the job, not the hue, except the four stamp inks (navy, red, green, amber). */
  --paper: #f5f2e9; --card: #fdfcf7; --ink: #18223a; --muted: #525b72; --line: #e3ded0; --field-line: #8d8774;
  --rule: #827d6b; --cover: #16233f; --seal: #263a66; --cover-ink: #c3cbdc; --cover-hi: #ffffff; --cover-line: #6f7fa6;
  --gold: #c6a457; --gold-ink: #d9bd72; --gold-on: #16233f;
  --link: #27468a; --red: #a3302c; --green: #2f6344; --amber: #7d5a14; --navy: #16233f;
  /* The stamp inks on the cover, which is navy in light and dark alike: the inks stamps have on the dark page, a
     cream for "All entities" and a quiet one for an entity that is closed. A test holds the four to the dark inks. */
  --cover-navy: #a9c0f5; --cover-red: #f0958d; --cover-green: #8fcea2; --cover-amber: #e2bf70;
  --cover-cream: #efe7d3; --cover-quiet: #a3adc4;
  --success: var(--green); --warning: var(--amber); --danger: var(--red);
  --primary: #16233f; --primary-ink: #ffffff; --focus: #27468a;
  --head: #ece8db; --head-ink: #18223a; --row: #ffffff; --row-alt: #f8f6f0; --row-ink: #0f1729;
  --notice: #f8eed2; --mrz: #ece8dc; --mrz-ink: #74798a; --menu: #fffefb; --shade: #16233f; --sheet: #ffffff; --sheet-ink: #000000;
  /* Type: a display serif, a text face, figures. Sizes step by 1.2 from 15px, rounded to whole pixels. */
  --font-display: "Source Serif 4", Charter, "Bitstream Charter", "Iowan Old Style", "Sitka Text", Cambria, Georgia, serif;
  --font-text: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-figures: "IBM Plex Mono", ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;
  --serif: var(--font-display); --sans: var(--font-text); --mono: var(--font-figures);
  --text-4xs: .375rem; --text-3xs: .5rem; --text-2xs: .625rem; --text-xs: .75rem; --text-sm: .8125rem; --text-base: .9375rem; --text-lg: 1.125rem; --text-xl: 1.375rem;
  --text-2xl: 1.625rem; --text-3xl: 1.9375rem; --text-4xl: 2.3125rem; --text-5xl: 2.8125rem; --text-6xl: 3.375rem;
  --leading-tight: 1.2; --leading: 1.5; --tracking-caps: .08em; --tracking-brand: .16em;
  /* Space: a 4px grid. */
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px; --space-6: 32px;
  --space-7: 48px; --space-8: 64px; --space-9: 96px; --gap: var(--space-3);
  /* Shape: small corners, hairlines, two shadows (a menu, a window). */
  --radius-sm: 3px; --radius: 5px; --radius-lg: 8px; --radius-pill: 999px;
  --border: 1px solid var(--line); --border-field: 1px solid var(--field-line);
  --shadow-1: 0 1px 2px color-mix(in srgb, var(--shade) 8%, transparent), 0 8px 24px color-mix(in srgb, var(--shade) 14%, transparent);
  --shadow-2: 0 2px 6px color-mix(in srgb, var(--shade) 10%, transparent), 0 20px 56px color-mix(in srgb, var(--shade) 24%, transparent);
  --scrim: color-mix(in srgb, var(--shade) 50%, transparent);
  /* Motion: quick for a press, medium for a menu, slow only for a figure opening into its sources. */
  --dur-1: 120ms; --dur-2: 200ms; --dur-3: 320ms;
  --ease: cubic-bezier(.2, .7, .2, 1); --ease-in-out: cubic-bezier(.4, 0, .2, 1);
  font-family: var(--sans);
  color-scheme: light;
}
@media (prefers-reduced-motion: reduce) {
  :root { --dur-1: 0ms; --dur-2: 0ms; --dur-3: 0ms; }
}
@media screen and (prefers-color-scheme: dark) {
  :root:not([data-mode="light"]) {
    --paper: #0e1525; --card: #151e33; --ink: #e8ebf3; --muted: #a3adc4; --line: #27324f; --field-line: #6f7b9c;
    --rule: #6272a0; --cover: #16233f; --seal: #22325a; --cover-ink: #b6c0d8; --gold-ink: #dcc27c;
    --link: #a9c0f5; --red: #f0958d; --green: #8fcea2; --amber: #e2bf70; --navy: #a9c0f5;
    --primary: #dcc27c; --primary-ink: #0e1525; --focus: #dcc27c;
    --head: #1d2845; --head-ink: #eef1f7; --row: #151e33; --row-alt: #1a243d; --row-ink: #f1f4f9;
    --notice: #33301c; --mrz: #0a101e; --mrz-ink: #6c7793; --menu: #1a2440; --shade: #000000;
    color-scheme: dark;
  }
}
@media screen {
  :root[data-mode="dark"], .as-dark {
    --paper: #0e1525; --card: #151e33; --ink: #e8ebf3; --muted: #a3adc4; --line: #27324f; --field-line: #6f7b9c;
    --rule: #6272a0; --cover: #16233f; --seal: #22325a; --cover-ink: #b6c0d8; --gold-ink: #dcc27c;
    --link: #a9c0f5; --red: #f0958d; --green: #8fcea2; --amber: #e2bf70; --navy: #a9c0f5;
    --primary: #dcc27c; --primary-ink: #0e1525; --focus: #dcc27c;
    --head: #1d2845; --head-ink: #eef1f7; --row: #151e33; --row-alt: #1a243d; --row-ink: #f1f4f9;
    --notice: #33301c; --mrz: #0a101e; --mrz-ink: #6c7793; --menu: #1a2440; --shade: #000000;
    color-scheme: dark;
  }
}

/* A sample of a theme inside another page (class "look"): the three short font names are read again here, so they
   follow the sample's own theme and not the page's. */
.look { --serif: var(--font-display); --sans: var(--font-text); --mono: var(--font-figures); }

/* ------------------------------------------------------------------ page frame */

* { box-sizing: border-box; }
html { height: 100%; }
/* The window is the frame: the cover on top, the footer pinned at the bottom, and only the page
   between them scrolls. The footer's top is the bottom of every page. */
body { margin: 0; background: var(--paper); color: var(--ink); line-height: var(--leading); font-size: var(--text-base);
       display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden; }
.scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: .16em; }
a:hover { text-decoration-thickness: 2px; }
/* One focus ring everywhere: the focus color on paper, gold on the cover (its menus are paper again). */
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.cover :focus-visible { outline-color: var(--gold-ink); }
.cover .menu :focus-visible { outline-color: var(--focus); }

.cover { background: var(--cover); border-bottom: 1px solid var(--gold); color: var(--cover-ink);
         display: flex; align-items: center; justify-content: space-between; gap: 16px;
         padding: 0 20px; min-height: 52px; flex: none; }
.brand { font-family: var(--serif); font-weight: 600; color: var(--gold-ink); letter-spacing: var(--tracking-brand);
         text-decoration: none; font-size: var(--text-base); white-space: nowrap; }
.cover-title { position: absolute; left: 50%; transform: translateX(-50%); color: var(--cover-hi); text-decoration: none;
               font-family: var(--serif); letter-spacing: .08em; white-space: nowrap; }
@media (max-width: 760px) { .cover-title { position: static; transform: none; } }
.sections { display: flex; gap: 4px; align-items: stretch; align-self: stretch; margin-left: auto; flex-wrap: nowrap; }
.sections a { color: var(--cover-ink); text-decoration: none; padding: 0 10px; display: flex; align-items: center;
              white-space: nowrap;
border-bottom: 2px solid transparent; margin-bottom: -1px; font-size: var(--text-base);
              transition: color var(--dur-1) var(--ease); }
.sections a:hover { color: var(--cover-hi); }
/* The name is the way to Today, and the menu has no Today item (founder, 2026-11-28). So in the signed-in header the
   name is a link as tall as the bar, like a section's, and on Today it is marked by the very rule that marks the
   current section: the same line under it, the same tint. Its word stays where it was (the margin takes the padding
   back) and keeps its own face and ink. */
body:not(.site) .cover > a.brand { align-self: stretch; display: flex; align-items: center; padding: 0 10px;
                                   margin: 0 0 -1px -10px; border-bottom: 2px solid transparent;
                                   transition: color var(--dur-1) var(--ease); }
body:not(.site) .cover > a.brand:hover { color: var(--cover-hi); }
.brand .badge { font-family: var(--sans); letter-spacing: 0; }
.sections a[aria-current="page"], body:not(.site) .cover > a.brand[aria-current="page"] {
  border-bottom-color: var(--gold-ink); background: color-mix(in srgb, var(--cover-hi) 7%, transparent); }
.sections a[aria-current="page"] { color: var(--cover-hi); }
/* Where the system's colors replace ours, a line that was see-through is drawn and the tint is gone: only the current
   one keeps its line, and it is filled in the system's own selection colors. The others' lines take the page's color
   and stand clear of the cover's own rule, so that rule is not broken under them. */
@media (forced-colors: active) {
  .sections a, body:not(.site) .cover > a.brand { border-bottom-color: Canvas; margin-bottom: 0; }
  .sections a[aria-current="page"], body:not(.site) .cover > a.brand[aria-current="page"],
  details.more .menu a[aria-current="page"] {
    forced-color-adjust: none; background: Highlight; color: HighlightText; border-bottom-color: Highlight; }
}

main { width: 100%; margin: 0 auto; padding: 28px 20px; flex: 1; }
main.narrow { max-width: 460px; }
main.wide { max-width: none; }
main.page { max-width: none; display: flex; flex-direction: column; gap: var(--gap); padding: 20px 24px; }
/* Every signed-in page uses the whole window (founder, 2026-10-30). Running text and narrow forms keep a readable line
   inside it, so they do not stretch across a wide screen; tables, grids and cards fill the width. Sign-in pages stay narrow. */
main.page p, main.wide p, main.page > ul, main.page > ol, main.page > .sub, main.page > .note,
main.wide > p, main.wide > ul, main.wide > ol, main.wide > .sub, main.wide > .note,
main.page .card > p, main.page .card > ul, main.page .card > ol, main.wide .card > p, main.wide .card > ul, main.wide .card > ol,
main.page details > p, main.wide details > p { max-width: 72ch; }
main.page > form:not(.filters):not(.wideform), main.wide > form:not(.filters):not(.wideform),
main.page .card > form:not(.filters):not(.wideform), main.wide .card > form:not(.filters):not(.wideform) { max-width: 44rem; }

.mrz { flex: none; background: var(--mrz); color: var(--mrz-ink); border-top: 1px solid var(--line);
       font-family: var(--mono); font-size: var(--text-xs); letter-spacing: .14em; padding: 4px 20px;
       white-space: nowrap; overflow: hidden; text-overflow: clip; }

/* The sections fold into one menu when they don't fit beside the title. nav.js measures and
   sets .nav-collapsed on <html>; without scripts, a width does it instead. The header never
   wraps and never scrolls. */
details.more { display: none; position: relative; margin-left: auto; flex: none; }
details.more > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px;
                         color: var(--cover-hi); padding: 6px 10px; border: 1px solid transparent; border-radius: var(--radius); }
details.more > summary:hover, details.more[open] > summary { border-color: var(--gold); }
details.more > summary::-webkit-details-marker { display: none; }
.bars, .bars::before, .bars::after { display: block; width: 18px; height: 2px; background: var(--gold-ink); }
.bars { position: relative; }
.bars::before, .bars::after { content: ""; position: absolute; left: 0; }
.bars::before { top: -6px; } .bars::after { top: 6px; }
details.more .menu { width: 220px; padding: 8px; }
details.more .menu a { padding: 8px 10px; border-radius: var(--radius-sm); text-decoration: none; color: var(--ink); }
details.more .menu a:hover { background: color-mix(in srgb, var(--ink) 10%, transparent); }
details.more .menu a[aria-current="page"] { font-weight: 600; box-shadow: inset 3px 0 0 var(--gold); }
html.nav-collapsed .sections { display: none; }
html.nav-collapsed details.more { display: block; }
@media (max-width: 760px) {
  html:not(.js) .sections { display: none; }
  html:not(.js) details.more { display: block; }
}
/* On a phone the button sits left of the middle, so a menu hung from its right edge ran off the left of the window.
   There the menu is pinned to the window instead: just under the cover, a little in from each side. */
@media (max-width: 520px) {
  details.more .menu { position: fixed; top: 56px; left: 8px; right: 8px; width: auto; }
}
@media (max-width: 420px) {
  .here { display: none; }
  .brand { letter-spacing: .1em; font-size: var(--text-base); }
}

/* ------------------------------------------------------------------ account menu */

details.account { position: relative; flex: none; }
details.account > summary { list-style: none; cursor: pointer; width: 32px; height: 32px; border-radius: 50%;
                            background: var(--seal); color: var(--gold-ink); display: flex; align-items: center;
                            justify-content: center; font-size: var(--text-sm); letter-spacing: .04em;
                            border: 1px solid var(--gold); }
details.account > summary::-webkit-details-marker { display: none; }
details.account > summary > .account-word { display: none; }       /* the person's name on the button: NoVentanas only */
.menu { position: absolute; right: 0; top: 42px; z-index: 10; width: 270px; background: var(--menu); color: var(--ink);
        border: var(--border); border-radius: var(--radius); padding: 14px;
        box-shadow: var(--shadow-1); }
.menu .who { font-weight: 600; word-break: break-all; margin: 0; }
.menu .cap { margin: 12px 0 4px; }
.menu a, .menu button.link { display: block; padding: 4px 0; }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 10px 0; }
.segmented { display: flex; border: var(--border-field); border-radius: var(--radius); overflow: hidden; }
.segmented button { flex: 1; margin: 0; border: 0; border-radius: 0; padding: 5px 4px; font-size: var(--text-sm);
                    font-weight: 500; background: transparent; color: var(--ink); }
.segmented button + button { border-left: 1px solid var(--line); }
.segmented button[aria-pressed="true"], .segmented button[aria-pressed="true"]:hover { background: var(--primary); color: var(--primary-ink); }
/* Four or more choices: two to a row, each in full, hairlines between them. */
.segmented.two-rows { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); }
.segmented.two-rows button { background: var(--menu); border-left: 0; }
.segmented.two-rows button[aria-pressed="true"] { background: var(--primary); }

/* ------------------------------------------------------------------ type */

h1, h2, .serif { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: var(--text-2xl); line-height: var(--leading-tight); margin: 0 0 6px; }
h2 { font-size: var(--text-lg); line-height: 1.3; margin: 0 0 8px; }
.cap { font-size: var(--text-xs); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--muted); font-weight: 600; }
.lead { color: var(--muted); margin: 0 0 18px; }
.fine { color: var(--muted); font-size: var(--text-sm); margin-top: 14px; }
.muted { color: var(--muted); }
.fig, td.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
td.num { text-align: right; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ------------------------------------------------------------------ cards and lists */

.card { background: var(--card); border: var(--border); border-radius: var(--radius);
        padding: var(--space-4) 20px; margin: 0 0 var(--gap); }
.page .card { margin: 0; }
.card.recommended { border-color: var(--navy); box-shadow: inset 0 3px 0 var(--gold); }
.tag { display: inline-block; font-size: var(--text-xs); font-weight: 600; text-transform: uppercase;
       letter-spacing: var(--tracking-caps); color: var(--amber); margin: 0 0 4px; }
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: 8px 0; border-bottom: 1px solid var(--line); }
ul.plain li:last-child { border-bottom: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--gap); }
.grid .card { margin: 0; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
ul.perms { list-style: none; padding: 0; margin: 8px 0; columns: 2; }
ul.perms li { padding: 2px 0; }

/* A list of things to do: a colored dot, the words, and the action on the right. */
ul.todo { list-style: none; margin: 0; padding: 0; }
ul.todo li { display: flex; align-items: baseline; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
ul.todo li:last-child { border-bottom: 0; }
ul.todo .what { flex: 1; }
ul.todo .go { white-space: nowrap; font-weight: 500; }
/* Getting started on Today: the next steps, each one line, one button, and an eye that hides the step (or, among
   the hidden ones, shows it again). The eye is an icon with a spoken label and stands no taller than the words. */
form.inline-go { display: inline-flex; align-items: baseline; gap: 6px; margin: 0; }
button.link.eye { display: inline-flex; align-self: center; padding: 3px 4px; margin: -3px 0; line-height: 1; color: var(--muted); }
button.link.eye .icon { width: 1.3em; height: 1.3em; vertical-align: 0; }
button.link.eye:hover, button.link.eye:focus-visible { color: var(--link); }
form.inline-go input[type=text] { width: 12em; }
/* On a phone the words take the whole line and the actions sit under them, in line with the words, so a long
   sentence is not squeezed into a column beside two links (dsa157/benco 51). */
@media (max-width: 520px) {
  ul.todo li { flex-wrap: wrap; row-gap: 4px; }
  ul.todo .what { flex: 1 1 calc(100% - 19px); }
  ul.todo .what + * { margin-left: 19px; }
  /* A step with a name to type: the field gives way, so the eye stays on the form's line. */
  ul.todo li > form.inline-go:has(input[type=text]) { flex: 1 1 0; min-width: 0; }
  ul.todo form.inline-go input[type=text] { flex: 1 1 6em; min-width: 5em; width: auto; }
  ul.todo form.inline-go:has(input[type=text]) button.primary { flex: none; width: auto; }
}
.start { margin-bottom: 14px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.start-title { margin: 0 0 2px; font-size: var(--text-base); }
.start-away { margin-top: 12px; font-size: var(--text-base); }
/* BUG-011: easy to notice, still small: a pill with the count, like a button. */
.start-away > summary { display: inline-block; cursor: pointer; color: var(--link); font-weight: 600; font-size: var(--text-sm);
                        padding: 2px 12px; border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--card); }
.start-away > summary:hover, .start-away > summary:focus-visible { border-color: var(--link); }
.start-away[open] > summary { margin-bottom: 6px; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; transform: translateY(-1px); }
.dot.red { background: var(--red); } .dot.gold { background: var(--gold); } .dot.blue { background: var(--link); }
.dot.green { background: var(--green); }

/* ------------------------------------------------------------------ stamps */

/* An entry stamp: one crisp frame with a hairline inside it, set in one ink. Tilted a little, and only where stamps
   stand in a row or alone. */
.stamp { display: inline-block; color: var(--navy); border: 1.5px solid currentColor;
         outline: 1px solid color-mix(in srgb, currentColor 55%, transparent); outline-offset: -4px;
         border-radius: var(--radius-sm); padding: 6px 12px; font-size: var(--text-xs); line-height: 1.35;
         letter-spacing: var(--tracking-caps); text-transform: uppercase; text-align: center; font-weight: 600;
         text-decoration: none; }
.stamp .fig { letter-spacing: .02em; font-weight: 400; text-transform: none; }
/* What the Passport stamp adds to an entity's stamp and to the header's control (stamps.css): a date and a layer of
   frame and decoration. Hidden here, so every other theme and every plain stamp is as it was. */
.stamp > .dt, .stamp > .wr, details.entity-pick > summary > .wr { display: none; }
a.stamp:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.stamp.navy { color: var(--navy); } .stamp.red { color: var(--red); }
.stamp.green { color: var(--green); } .stamp.amber { color: var(--amber); }
.stamps { display: flex; flex-wrap: wrap; gap: 18px 16px; align-items: center; padding: 6px 2px; }
.stamps .stamp:nth-child(3n+1) { transform: rotate(-1.5deg); }
.stamps .stamp:nth-child(3n+2) { transform: rotate(1deg); }
.stamps .stamp:nth-child(3n) { transform: rotate(-.75deg); }
/* A stamp that stands by itself (a page header, a panel) is tilted as Today's first stamp is. */
.stamp.lone { transform: rotate(-1.5deg); }
a.stamp { transition: background-color var(--dur-1) var(--ease); }
a.stamp:hover { background: color-mix(in srgb, currentColor 7%, transparent); }
.stamp.closed { color: var(--muted); border-style: dashed; outline-style: dashed; }
details.closed-books { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 8px; }
details.closed-books > summary { cursor: pointer; list-style: none; color: var(--link); font-size: var(--text-sm); padding: 4px 0; }
details.closed-books > summary::-webkit-details-marker { display: none; }
details.closed-books[open] .show, details.closed-books:not([open]) .hide { display: none; }

/* ------------------------------------------------------------------ forms and buttons */

label { display: block; font-weight: 600; margin: 8px 0 6px; }
label.check { display: flex; gap: 8px; align-items: center; font-weight: 400; margin: 0; }
label.check input { width: auto; }
/* A field's edge is the field color: it must be seen against the page (3 to 1), unlike a hairline. */
input, select { font: inherit; color: var(--ink); background: var(--row); border: var(--border-field);
                border-radius: var(--radius); }
input { width: 100%; padding: 10px 12px; font-size: 1rem; }
select { padding: 8px 10px; max-width: 100%; }      /* as wide as its longest choice, never wider than its box */
textarea { font: inherit; color: var(--ink); background: var(--row); border: var(--border-field);
           border-radius: var(--radius); width: 100%; padding: 10px 12px; }   /* drawn like an input */
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
button, .button { display: inline-block; margin-top: 12px; padding: 9px 16px; font: inherit; font-weight: 600;
                  border-radius: var(--radius); border: 1px solid var(--navy); background: transparent;
                  color: var(--navy); cursor: pointer; text-decoration: none;
                  transition: background-color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease),
                              color var(--dur-1) var(--ease); }
button.primary, .button.primary { background: var(--primary); color: var(--primary-ink); border-color: var(--primary);
                                  width: 100%; text-align: center; }
button.danger { color: var(--red); border-color: var(--red); }
button.link { background: none; border: none; padding: 0; margin: 0; color: var(--link); font-weight: 400;
              text-decoration: underline; }
button.small { margin: 0 0 0 4px; padding: 4px 10px; font-size: var(--text-base); }
/* Hover, only on the plain kinds: a button a page drew its own way keeps its own hover. */
button:not([class]):hover, button.small:hover, .button:hover { background: color-mix(in srgb, var(--navy) 9%, transparent); }
button.primary:hover, .button.primary:hover { background: color-mix(in srgb, var(--primary) 86%, var(--primary-ink)); }
button.danger:hover { background: color-mix(in srgb, var(--red) 9%, transparent); }
button:disabled, .button[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
form.inline { display: inline; }

.error { color: var(--red); font-weight: 600; }
.notice { background: var(--notice); padding: 10px 12px; border-radius: var(--radius); }
.pill { font-size: var(--text-xs); padding: 1px 7px; border: var(--border); border-radius: var(--radius-pill); color: var(--muted); }

.codes { font-family: var(--mono); font-size: var(--text-lg); padding-left: 2em; white-space: nowrap; }
.codes li { padding: 2px 0; }
.secret { font-family: var(--mono); word-break: break-all; }
.qr { display: block; margin: 8px auto; background: var(--sheet); border-radius: var(--radius); }

/* ------------------------------------------------------------------ tables: built for reading figures */

/* The header is a quiet band of small capitals over a rule, as on a passport's data page; the figures carry the
   weight. A cell's padding is two tokens, so density is one class: .dense on a table or on its box. */
table { --cell-y: 7px; --cell-x: 10px; width: 100%; border-collapse: collapse; font-size: var(--text-base);
        background: var(--row); color: var(--row-ink); }
table.dense, .dense table { --cell-y: 3px; --cell-x: 8px; font-size: var(--text-sm); }
th { background: var(--head); color: var(--head-ink); font-size: var(--text-xs); font-weight: 600; letter-spacing: .05em;
     text-transform: uppercase; text-align: left; padding: var(--cell-y) var(--cell-x); border-bottom: 1px solid var(--rule); }
td { padding: var(--cell-y) var(--cell-x); border-bottom: 1px solid var(--line); }
th.num { text-align: right; }
tbody tr:nth-child(even) td { background: var(--row-alt); }
.card table { border-radius: var(--radius-sm); overflow: hidden; }
/* On a phone a plain table straight inside a card scrolls sideways inside the card, never past its edge (Settings:
   where you're signed in, added addresses). A table in a .tablebox already scrolls there. */
@media (max-width: 520px) {
  .card > table:not([class]) { display: block; max-width: 100%; overflow-x: auto; }
  .card > table:not([class]) time { white-space: nowrap; }       /* a date and time on one line, not five */
}

/* ------------------------------------------------------------------ Today */

.today-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.today-head h1 { margin: 2px 0 0; }
.today { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: var(--gap); align-items: start; }
.today .side { display: flex; flex-direction: column; gap: var(--gap); }
.add { font-size: var(--text-sm); }

/* ------------------------------------------------------------------ structure */

/* A page whose cards scroll inside themselves, so the page itself never does on a laptop. On a
   small screen the page scrolls instead, above the footer. */
@media (min-width: 761px) {
  main.fill { min-height: 0; }
}
.structure-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.structure-head h1 { margin: 2px 0 0; }
form.as-of { display: flex; align-items: center; gap: 8px; }
form.as-of label { margin: 0; font-size: var(--text-sm); }
form.as-of input { width: auto; padding: 5px 8px; font-size: var(--text-base); }
form.as-of button { margin: 0; }
.structure { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
             gap: var(--gap); }
.structure .card { overflow: auto; min-height: 0; }
/* "There is more this way": a box that scrolls inside itself fades at an edge while content lies beyond it. Two
   lengths, registered so they can change smoothly, driven by the box's own scroll position where a browser can tie
   a style to that. A box with nothing to scroll fades nothing. Used by the table box and the folders list. */
@property --fade-start { syntax: "<length>"; inherits: false; initial-value: 0px; }
@property --fade-end { syntax: "<length>"; inherits: false; initial-value: 0px; }
@keyframes more-behind {
  0% { --fade-start: 0px; --fade-end: 28px; }
  4%, 96% { --fade-start: 28px; --fade-end: 28px; }
  100% { --fade-start: 28px; --fade-end: 0px; }
}
/* The fade is a mask, and a mask also hides anything of the box's that is drawn outside it: a menu floated over the
   page from a row was cut away by a mask that was always on. So the mask is part of the animation: a box with
   nothing to scroll has no running animation and so no mask, and what leaves it is drawn as before. */
@keyframes more-behind-across {
  from, to { mask-image: linear-gradient(to right, transparent, black var(--fade-start),
                                         black calc(100% - var(--fade-end)), transparent); }
}
@keyframes more-behind-down {
  from, to { mask-image: linear-gradient(to bottom, transparent, black var(--fade-start),
                                         black calc(100% - var(--fade-end)), transparent); }
}
/* The map: an org chart of stamps, each owner above what it owns, its share on the line between. */
.org { overflow-x: auto; padding: 12px 0 8px; }   /* room above: the scroller clips, and the top stamp is tilted */
.org ul { display: flex; justify-content: center; list-style: none; margin: 0; padding: 0; position: relative; }
/* The chart is as wide as it needs and at least as wide as its card, so it centers when it fits and scrolls to
   every side when it does not; a centered row wider than its box would spill off the left, out of reach. */
.org > ul { width: max-content; min-width: 100%; box-sizing: border-box; }
.org li { display: flex; flex-direction: column; align-items: center; position: relative; padding: 0 6px; }
.org li > ul { padding-top: 16px; }
.org li > ul::before { content: ""; position: absolute; top: 0; left: 50%; height: 16px;
                       border-left: 1px solid var(--rule); }
.org li li { padding-top: 16px; }
.org li li::before, .org li li::after { content: ""; position: absolute; top: 0; width: 50%; height: 16px;
                                        border-top: 1px solid var(--rule); }
.org li li::before { right: 50%; }
.org li li::after { left: 50%; border-left: 1px solid var(--rule); }
.org li li:first-child::before, .org li li:last-child::after { border-top: 0; }
.org li li:only-child::before { display: none; }
.org li li:last-child::before { border-right: 1px solid var(--rule); border-radius: 0 var(--radius) 0 0; right: 50%; width: 50%; }
.org li li:last-child:not(:only-child)::after { border-left: 0; }
.org li li:first-child:not(:only-child)::after { border-radius: var(--radius) 0 0 0; }
.org > ul > li { padding-bottom: 6px; }
.org .stake { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: var(--text-xs); color: var(--muted);
              background: var(--card); padding: 0 4px; margin: 2px 0 6px; }
.org .stamp { max-width: 190px; }
.org li:nth-child(3n+1) > .stamp { transform: rotate(-1.5deg); }     /* tilted as Today's stamps are */
.org li:nth-child(3n+2) > .stamp { transform: rotate(1deg); }
.org li:nth-child(3n) > .stamp { transform: rotate(-.75deg); }
.org .stamp .fig { white-space: nowrap; }
.org a.stamp.picked { background: var(--notice); box-shadow: 0 0 0 4px var(--card), 0 0 0 5.5px var(--gold); }
.stake { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: var(--text-sm); color: var(--muted); }
.meta { color: var(--muted); font-size: var(--text-sm); }
.small { font-size: var(--text-sm); }
.answers h2 { margin-bottom: 0; }
/* The entity's stamp keeps its shape; the buttons beside it wrap under it when the card is narrow, so the card
   never scrolls sideways. */
.answers-head { display: flex; flex-wrap: wrap; justify-content: flex-start; align-items: flex-start; gap: 8px 12px; }
.answers-head h2 { flex: none; margin-right: auto; }
.answers-head .button { margin: 0; flex: none; font-size: var(--text-sm); padding: 6px 12px; }
.structure.docs { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.treatment { margin: 0 0 10px; color: var(--muted); }
.answers > .answers-head { margin-bottom: 12px; }   /* what follows sits clear of the tilted stamp */
.answers h3.cap, .answers h4.cap { margin: 10px 0 2px; }
ul.owners { list-style: none; margin: 0 0 6px; padding: 0; }
ul.owners li { padding: 2px 0; }
details.more-owners > summary { cursor: pointer; list-style: none; color: var(--link); font-size: var(--text-sm); }
details.more-owners > summary::-webkit-details-marker { display: none; }
/* The three-valued answer: yes, no, or unknown. The word says it; the shape repeats it (filled, outlined, dashed),
   so nothing rests on color. Unknown is never drawn as a quieter no. */
.verdict { display: inline-block; min-width: 5.4em; text-align: center; font-family: var(--mono); font-size: var(--text-xs);
           font-weight: 600; letter-spacing: var(--tracking-caps); text-transform: uppercase; border: 1.5px solid currentColor;
           border-radius: var(--radius-sm); padding: 1px 6px; }
.verdict:empty { visibility: hidden; }      /* a question with a list for an answer keeps the column, not an empty box */
.verdict.yes { background: var(--navy); border-color: var(--navy); color: var(--card); }
.verdict.no { color: var(--muted); }
.verdict.unknown { color: var(--amber); border-style: dashed; background: var(--notice); }
details.answer { border-top: 1px solid var(--line); padding: 8px 0; }
details.answer:first-of-type { margin-top: 10px; }
details.answer > summary { cursor: pointer; list-style: none; display: grid; grid-template-columns: auto minmax(0, 1fr);
                           gap: 2px 10px; align-items: baseline; }
details.answer > summary::-webkit-details-marker { display: none; }
details.answer .q { font-weight: 600; }
details.answer .gist { grid-column: 2; color: var(--muted); font-size: var(--text-sm); overflow: hidden;
                       display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
details.answer[open] .gist { display: none; }
details.answer ul { margin: 6px 0 0; padding-left: 18px; font-size: var(--text-base); }
details.answer li { padding: 2px 0; }

/* ------------------------------------------------------------------ small screens (scrolling allowed) */

@media (max-width: 760px) {
  .cover { padding: 0 14px; gap: 10px; }
  main, main.page { padding: 16px; }
  .today { grid-template-columns: minmax(0, 1fr); }
  .structure, .structure.docs { grid-template-columns: minmax(0, 1fr); flex: none; }
  .structure .card { overflow: visible; }
  ul.perms { columns: 1; }
  table { font-size: var(--text-sm); }
}

/* ------------------------------------------------------------------ person panel (Structure) */

.person h3.cap { margin: 12px 0 2px; }
table.mini { font-size: var(--text-sm); }
table.mini th, table.mini td { padding: 3px 8px; }
table.mini tr.past td { color: var(--muted); }
details.record { border-top: 1px solid var(--line); padding: 6px 0; }
details.record > summary { cursor: pointer; font-weight: 600; font-size: var(--text-base); }
details.record label { margin: 6px 0 2px; font-size: var(--text-sm); }
details.record input, details.record select { padding: 5px 8px; font-size: var(--text-base); width: 100%; }
details.record .two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
details.record button { margin-top: 8px; }

/* ------------------------------------------------------------------ documents folders */




.structure.folders { grid-template-columns: minmax(0, 1fr) minmax(0, 2.2fr); }
ul.tree, ul.tree ul { list-style: none; margin: 0; padding: 0; }
ul.tree ul { padding-left: 16px; }
ul.tree a { display: block; padding: 3px 6px; border-radius: var(--radius-sm); text-decoration: none; font-size: var(--text-base); }
ul.tree a:hover, ul.tree a.over { background: var(--paper); }
ul.tree a.here { background: var(--notice); font-weight: 600; }
ul.tree a.over { outline: 2px dashed var(--gold); }
.count { font-family: var(--mono); font-size: var(--text-xs); color: var(--muted); }
form.newfolder { display: flex; gap: 6px; align-items: center; margin-top: 8px; }
form.newfolder input { padding: 5px 8px; font-size: var(--text-base); }
form.newfolder button { margin: 0; }
/* On a laptop the card does not scroll as a whole: that hid "New folder" under the fold with no sign of it
   (dsa157/benco 48). The list scrolls inside the card, fading where it has more, and making a folder stays in view. */
@media (min-width: 761px) {
  .structure.folders > .card:first-child { display: flex; flex-direction: column; overflow: hidden; }
  .structure.folders div.tree-full { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
  .structure.folders form.newfolder, .structure.folders .tree-note { flex: none; }
  @supports (animation-timeline: scroll()) {
    .structure.folders div.tree-full { animation: more-behind linear both, more-behind-down linear both;
                                       animation-timeline: scroll(self block); }
  }
}
td.acts { white-space: nowrap; }
td.acts form { margin-left: 8px; }
td.acts select { padding: 2px 4px; font-size: var(--text-sm); max-width: 9em; }
tr.dragging { opacity: .5; }
tr[draggable="true"] { cursor: grab; }

/* Documents header, resizable columns, the three-dot menu. */
.doc-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; }
.doc-head .crumbs { margin: 0; }
form.company-pick { display: flex; align-items: center; gap: 8px; margin: 0 0 0 auto; }
.company-name { font-family: var(--serif); font-size: var(--text-lg); }
form.company-pick select { padding: 4px 8px; font-size: var(--text-sm); width: 9.5em; }
form.company-pick button { margin: 0; }
table.resizable { table-layout: fixed; }
table.resizable th { position: relative; }
/* The date is always ten characters, so its column is a fixed width at every size: as a share of the table it was
   cut to "2023-0..." on anything narrower than a wide laptop. "Belongs to" takes what the others leave. */
table.resizable .c-name { width: 34%; } table.resizable .c-kind { width: 16%; } table.resizable .c-date { width: 6.5rem; } table.resizable .c-menu { width: 44px; }
table.resizable td.cut { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.resizable th .grip { position: absolute; top: 0; right: 0; width: 7px; height: 100%; cursor: col-resize; }
table.resizable th .grip::after { content: ""; position: absolute; top: 20%; bottom: 20%; right: 3px; border-right: 1px solid var(--head-ink); opacity: .35; }
table.resizable th .grip:hover::after, table.resizing th .grip::after { opacity: 1; }
table.resizing { user-select: none; cursor: col-resize; }
td.acts { text-align: right; overflow: visible; }
details.rowmenu { position: relative; display: inline-block; }
details.rowmenu > summary { list-style: none; cursor: pointer; padding: 0 8px; font-size: var(--text-lg); line-height: 1.2; border-radius: var(--radius-sm); }
details.rowmenu > summary::-webkit-details-marker { display: none; }
details.rowmenu > summary:hover, details.rowmenu[open] > summary { background: var(--paper); }
.menu-pop { position: absolute; right: 0; top: 100%; z-index: 5; min-width: 11rem; text-align: left; background: var(--card); border: var(--border); border-radius: var(--radius); box-shadow: var(--shadow-1); padding: 4px; }
.menu-pop.floating { position: fixed; right: auto; bottom: auto; }
/* Every item of a menu of actions is the same row, whether it is a link or a form's button (founder, 2026-11-28: one
   drawn as a button did not fit the menu). The menu keeps a little room inside its border, so the band under the
   pointer never touches the border: the paper-colored band that ran edge to edge read as a gap in it. */
.menu-pop a, .menu-pop button { display: block; width: 100%; margin: 0; padding: 6px 10px; border: 0; border-radius: var(--radius-sm); background: none; box-shadow: none; text-align: left; font: inherit; font-size: var(--text-base); font-weight: 400; color: var(--ink); text-decoration: none; cursor: pointer; }
.menu-pop a:hover, .menu-pop button:hover { background: color-mix(in srgb, var(--ink) 10%, transparent); }
.menu-pop :is(a, button):focus-visible { outline-offset: -2px; }
.menu-pop button.danger { color: var(--red); }
.menu-pop form, td.acts .menu-pop form { margin: 0; }
/* A step with something to choose first (a folder, a file): ruled off edge to edge, its buttons rows like the rest. */
.menu-pop .menu-move, td.acts .menu-pop form.menu-move { padding: 4px; border-bottom: 1px solid var(--line); border-top: 1px solid var(--line); margin: 4px -4px; }
.menu-pop .menu-move > :is(select, input, label):not(.sr, [type="hidden"]) { display: block; width: calc(100% - 20px); margin: 2px 10px 4px; }
.menu-pop .menu-move label select { width: 100%; }
/* Where the system's colors replace ours the band is the system's own selection, as in any menu. It has the last
   word over every theme's own button and menu colors, or a theme's ink could be left on the selection's fill. */
@media (forced-colors: active) {
  .menu-pop :is(a, button):hover, details.more .menu a:hover { forced-color-adjust: none; background: Highlight !important;
                                                               color: HighlightText !important; text-decoration: none !important; }
}
[hidden] { display: none !important; }
details.rowmenu { width: 30px; display: block; margin-left: auto; }
details.rowmenu > summary { text-align: center; padding: 0; }
table.resizable td.num { white-space: nowrap; }
/* On a phone four columns and the menu do not fit: the date ran under the three dots. The table keeps a width it
   can be read at and its box scrolls sideways. The menu column stays at the right
   edge, with a rule on its left where the other columns pass behind it. The menu itself floats over the page
   (folders.js), so the scrolling box does not clip it. */
@media (max-width: 760px) {
  .tablebox.inflow:has(> table.resizable) { overflow-x: auto; }
  .tablebox.inflow > table.resizable { min-width: 34rem; overflow: visible; }   /* a table that clips cannot hold a column still */
  table.resizable th.c-menu, table.resizable td.acts { position: sticky; right: 0; box-shadow: -1px 0 0 var(--line); }
  table.resizable tbody tr:nth-child(odd) td.acts { background: var(--row); }   /* even rows have their own (app.css) */
}

/* Narrow screens: the folder tree becomes a dropdown with "new folder" beside it, and the documents sit below. */
.folder-pick { display: none; }
@media (max-width: 760px) {
  .structure.folders { grid-template-columns: minmax(0, 1fr); flex: none; }
  .structure.folders > .card:first-child { display: flex; align-items: center; gap: 8px; }
  .structure.folders .tree-full { display: none; }
  .folder-pick { display: flex; flex: 1 1 0; min-width: 0; gap: 6px; }
  .folder-pick select { width: 100%; min-width: 0; padding: 6px 8px; }
  .structure.folders form.newfolder { flex: 1 1 0; min-width: 0; margin: 0; }
  .structure.folders form.newfolder input { min-width: 0; }
}

/* The count beside Arrivals in the header (static/live.js keeps it current). */
.badge { display: inline-block; min-width: 1.25em; margin-left: .4em; padding: 0 .35em; border-radius: var(--radius-pill); background: var(--gold); color: var(--gold-on); font-size: var(--text-xs); font-weight: 700; line-height: 1.35; text-align: center; }


/* The entity picker in the header, on the cover. */
details.entity-pick { position: relative; flex: none; }
details.entity-pick > summary { list-style: none; cursor: pointer; padding: 4px 28px 4px 12px; font-size: var(--text-sm); max-width: 16em;
                                background: var(--seal); color: var(--cover-hi); border: 1px solid var(--cover-line); border-radius: var(--radius);
                                white-space: nowrap; overflow: hidden; text-overflow: ellipsis; position: relative; }
details.entity-pick > summary::-webkit-details-marker { display: none; }
details.entity-pick > summary::after { content: "\25be"; position: absolute; right: 10px; top: 50%; transform: translateY(-52%); }
details.entity-pick .menu { width: 300px; top: 36px; max-height: 70vh; overflow: auto; }
details.entity-pick .menu .cap { margin-top: 0; }
/* The control names the entity in effect, with a swatch of its stamp color: the same color its stamp has on every page,
   so the wrong company is seen at a glance now that the stamp no longer stands beside the tabs. On the cover the
   swatch has a light ring, or a navy one would vanish into it. */
.swatch { display: inline-block; flex: none; width: 10px; height: 10px; margin-right: 7px; border-radius: var(--radius-sm);
          background: currentColor; vertical-align: -1px; }
.swatch.navy { color: var(--navy); } .swatch.red { color: var(--red); }
.swatch.green { color: var(--green); } .swatch.amber { color: var(--amber); }
details.entity-pick > summary .swatch { box-shadow: 0 0 0 1.5px var(--cover-hi); }
details.entity-pick > summary .pick-code { color: inherit; opacity: .8; }
details.entity-pick > summary .pick-fig { display: none; }                      /* the stamp's small line: Passport only */
/* Passport (no data-theme): the closed control is the entity's own stamp, in the inks stamps have on the dark page,
   its name over its tag, with a small arrow inside the right edge (founder, 2026-11-25). Straight, not tilted: it is a
   control in a bar. "All entities" is a cream stamp; a closed entity is dashed, as its stamp is everywhere. The swatch
   goes, since the stamp carries the color. Ledger and NoVentanas keep the plain control. */
html:not([data-theme]) details.entity-pick > summary {
  max-width: 15em; padding: 3px 26px 3px 12px; background: none; color: var(--cover-cream);
  border: 1.5px solid currentColor; border-radius: var(--radius-sm);
  outline: 1px solid color-mix(in srgb, currentColor 55%, transparent); outline-offset: -4px;
  font-size: var(--text-xs); line-height: 1.3; letter-spacing: var(--tracking-caps); text-transform: uppercase;
  text-align: center; font-weight: 600; transition: background-color var(--dur-1) var(--ease); }
html:not([data-theme]) details.entity-pick > summary[data-ink="navy"] { color: var(--cover-navy); }
html:not([data-theme]) details.entity-pick > summary[data-ink="red"] { color: var(--cover-red); }
html:not([data-theme]) details.entity-pick > summary[data-ink="green"] { color: var(--cover-green); }
html:not([data-theme]) details.entity-pick > summary[data-ink="amber"] { color: var(--cover-amber); }
html:not([data-theme]) details.entity-pick > summary[data-closed] { color: var(--cover-quiet); border-style: dashed; outline-style: dashed; }
html:not([data-theme]) details.entity-pick > summary:hover,
html:not([data-theme]) details.entity-pick[open] > summary { background: color-mix(in srgb, currentColor 14%, transparent); }
html:not([data-theme]) details.entity-pick > summary:focus-visible { outline: 2px solid var(--gold-ink); outline-offset: 2px; }
html:not([data-theme]) details.entity-pick > summary .swatch,
html:not([data-theme]) details.entity-pick > summary .pick-code { display: none; }
html:not([data-theme]) details.entity-pick > summary .pick-name,
html:not([data-theme]) details.entity-pick > summary .pick-fig { display: block; overflow: hidden; text-overflow: ellipsis; }
html:not([data-theme]) details.entity-pick > summary .pick-fig { font-family: var(--mono); letter-spacing: .02em; font-weight: 400; text-transform: none; }
html:not([data-theme]) details.entity-pick > summary::after { right: 8px; }
html:not([data-theme]) details.entity-pick .menu { top: calc(100% + 6px); }
/* With no entity yet, the control's place holds "Add company", drawn as the control is. */
a.entity-add { flex: none; padding: 4px 12px; font-size: var(--text-sm); background: var(--seal); color: var(--cover-hi);
               border: 1px solid var(--cover-line); border-radius: var(--radius); text-decoration: none; white-space: nowrap; }
a.entity-add:hover, a.entity-add:focus-visible { border-color: var(--gold); }      /* two called the same: the code tells them apart */
ul.pick-list { list-style: none; margin: 0; padding: 0; }
ul.pick-list a:not(.stamp) { display: block; padding: 5px 6px; border-radius: var(--radius-sm); text-decoration: none; }
ul.pick-list a:not(.stamp):hover, ul.pick-list a:not(.stamp):focus-visible { background: var(--paper); }
ul.pick-list a:not(.stamp)[aria-current="true"], ul.pick-list span.pick-row { font-weight: 700; box-shadow: inset 3px 0 0 var(--gold); }
ul.pick-list span.pick-row { padding: 5px 6px; }
/* Up to eight entities: each one's own stamp, one to a row, straight, the one in effect ringed. */
ul.pick-list.stamped { display: grid; gap: 9px; padding: 2px 3px 4px; }
ul.pick-list.stamped .stamp { display: block; margin: 0; }
ul.pick-list.stamped .stamp.picked { background: var(--notice); box-shadow: 0 0 0 3px var(--menu), 0 0 0 4.5px var(--gold); }
/* More than eight: one plain line each (its color, its name, its code and place) under a search box that stays in view. */
ul.pick-list a.pick-row, ul.pick-list span.pick-row { display: flex; align-items: baseline; }
.pick-row-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-code { flex: none; margin-left: 8px; font-family: var(--mono); font-size: var(--text-xs); color: var(--muted); font-weight: 400;
             white-space: nowrap; }
.pick-row .swatch { align-self: center; }
details.entity-pick .menu:has(.pick-search) { width: 360px; }       /* room for a name beside its code */
@media (max-width: 520px) { details.entity-pick .menu:has(.pick-search) { width: 300px; } }
form.pick-search { position: sticky; top: -14px; z-index: 1; margin: 0 0 6px; padding: 4px 0; background: var(--menu); }
form.pick-search input { padding: 6px 8px; font-size: 1rem; }
.pick-none { margin: 6px; }
a.pick-add { display: block; position: sticky; bottom: -14px; margin: 8px 0 0; padding: 8px 6px; border-top: 1px solid var(--line);
             background: var(--menu); font-weight: 600; text-decoration: none; }
a.pick-add:hover, a.pick-add:focus-visible { background: var(--paper); }
/* The Books list's own search, for someone with many entities (and where the header's search lands with no script). */
form.pick-find { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; margin: 0 0 14px; }
form.pick-find .field { flex: 0 1 18rem; }
form.pick-find label { margin-top: 0; }
form.pick-find button { margin: 0; }
/* A page's way back, above its title. */
.backline { margin: 0; font-size: var(--text-base); }
tr.picked td { background: var(--notice); }
/* A secret typed in a plain box: a password box would have the browser offer to save it, with the field before it as the username. */
input.masked-entry { -webkit-text-security: disc; }
.fact-void { text-decoration: line-through; opacity: .7; }
.fact-void strong, .fact-void .meta { text-decoration: none; }
details.act { display: inline-block; }
details.act > summary { cursor: pointer; font-size: var(--text-sm); }
details.act label { display: block; margin: 4px 0 2px; font-size: var(--text-sm); }
details.act input { padding: 4px 6px; font-size: var(--text-sm); }

/* The public walk-through video (demo server, /watch) */
video.walkthrough { display: block; width: 100%; max-width: 1380px; height: auto; margin: 0 0 18px; }

/* ================================================================== the system's own components (docs/brand/system.md)
   Shown on the staff page /internal/design. Each is built on the tokens alone. */

/* Icons: one small set, drawn on a 24 grid with a 1.5 stroke, in the color of the words beside them (_icons.html). */
.icon { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }
.icon.lg { width: 1.5rem; height: 1.5rem; }

/* A seal: a round mark for a state a person gave their name to (signed off, verified). Used once on a page. */
.seal-mark { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; color: var(--navy);
             border: 1.5px solid currentColor; outline: 1px solid color-mix(in srgb, currentColor 55%, transparent);
             outline-offset: -5px; font-size: var(--text-2xs); font-weight: 600; letter-spacing: var(--tracking-caps);
             text-transform: uppercase; text-align: center; line-height: 1.2; transform: rotate(-6deg); }
.seal-mark.green { color: var(--green); } .seal-mark.amber { color: var(--amber); } .seal-mark.red { color: var(--red); }
.seal-mark.open { border-style: dashed; outline-style: dashed; color: var(--muted); }

/* An empty state: what belongs here and the one thing to do about it. No picture. */
.empty { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-1); padding: var(--space-5);
         border: 1px dashed var(--rule); border-radius: var(--radius); color: var(--muted); }
.empty strong { color: var(--ink); font-family: var(--serif); font-size: var(--text-lg); font-weight: 600; }
.empty .button, .empty button { margin-top: var(--space-2); }

/* The answer with what would settle it: the badge, the question, and one line naming the missing fact. */
.answer3 { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px var(--space-3); align-items: baseline; }
.answer3 .q { font-weight: 600; }
.answer3 .settle { grid-column: 2; color: var(--muted); font-size: var(--text-sm); }

/* A figure that opens into its sources: the one moment worth animating. The figure itself is the control. Its panel
   is a popover (no script): it comes in from the right, its lines arrive in order, and the total at the bottom
   restates the figure, so the reader sees the parts add up. Where popovers are not supported the panel is a plain
   block under the figure. Every duration is a token, so reduced motion makes it instant. */
button.fig-open { font: inherit; font-family: var(--mono); font-variant-numeric: tabular-nums; color: inherit; cursor: pointer;
                  margin: 0; padding: 0 3px; border: 0; border-bottom: 1px dashed var(--rule); border-radius: 0;
                  background: none; }
button.fig-open:hover, button.fig-open[aria-expanded="true"] { background: color-mix(in srgb, var(--gold) 26%, transparent);
                                                              border-bottom: 1px solid var(--gold); }
.sources { color: var(--ink); background: var(--card); border: var(--border); border-radius: var(--radius); padding: 0; }
.sources-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3);
                padding: var(--space-4) var(--space-5) var(--space-3); border-bottom: var(--border); }
.sources-head .amount { display: block; font-family: var(--mono); font-variant-numeric: tabular-nums;
                        font-size: var(--text-3xl); line-height: var(--leading-tight); letter-spacing: -.02em; }
.sources-head button { margin: 0; padding: 4px; border-color: transparent; line-height: 0; }
.sources-body { flex: 1 1 auto; min-height: 0; overflow: auto; padding: var(--space-2) var(--space-5); }
.sources ol { list-style: none; margin: 0; padding: 0; }
.src-part { padding: var(--space-3) 0; border-bottom: var(--border); }
.src-part:last-child { border-bottom: 0; }
.src-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 var(--space-3); align-items: baseline; }
.src-row .what { font-weight: 600; }
.src-row .fig { text-align: right; }
.src-lines { list-style: none; margin: var(--space-1) 0 0; padding: 0 0 0 var(--space-3); border-left: 2px solid var(--line); }
.src-lines li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 var(--space-3); padding: 3px 0;
                font-size: var(--text-sm); color: var(--muted); }
.src-lines .fig { color: var(--ink); }
.sources-foot { padding: var(--space-3) var(--space-5) var(--space-4); border-top: 1px solid var(--rule); background: var(--paper); }
.sources-foot .sum { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-3); font-weight: 600; }
.sources-foot .sum .fig { box-shadow: 0 -2px 0 var(--card), 0 -3px 0 var(--gold); }   /* the ruled total of a ledger */
.sources-foot .rule-line { margin: var(--space-2) 0 0; font-size: var(--text-sm); color: var(--muted); }
@supports selector(:popover-open) {
  .sources[popover] { position: fixed; inset: 0 0 0 auto; width: min(460px, 100vw); height: 100dvh; max-height: none;
                      margin: 0; border: 0; border-left: var(--border); border-radius: 0; box-shadow: var(--shadow-2); overflow: hidden;
                      flex-direction: column; translate: 100% 0; opacity: 0;
                      transition: translate var(--dur-3) var(--ease), opacity var(--dur-2) var(--ease),
                                  overlay var(--dur-3) allow-discrete, display var(--dur-3) allow-discrete; }
  .sources[popover]:popover-open { display: flex; translate: 0 0; opacity: 1; }
  @starting-style { .sources[popover]:popover-open { translate: 100% 0; opacity: 0; } }
  .sources[popover]::backdrop { background: var(--scrim); opacity: 0;
                                transition: opacity var(--dur-3) var(--ease), overlay var(--dur-3) allow-discrete,
                                            display var(--dur-3) allow-discrete; }
  .sources[popover]:popover-open::backdrop { opacity: 1; }
  @starting-style { .sources[popover]:popover-open::backdrop { opacity: 0; } }
  .sources[popover]:popover-open .src-part, .sources[popover]:popover-open .sources-foot { animation: src-in var(--dur-3) var(--ease) backwards; }
  .sources[popover]:popover-open .src-part:nth-child(1) { animation-delay: calc(var(--dur-1) * .75); }
  .sources[popover]:popover-open .src-part:nth-child(2) { animation-delay: calc(var(--dur-1) * 1.25); }
  .sources[popover]:popover-open .src-part:nth-child(3) { animation-delay: calc(var(--dur-1) * 1.75); }
  .sources[popover]:popover-open .src-part:nth-child(4) { animation-delay: calc(var(--dur-1) * 2.25); }
  .sources[popover]:popover-open .src-part:nth-child(n+5) { animation-delay: calc(var(--dur-1) * 2.75); }
  .sources[popover]:popover-open .sources-foot { animation-delay: calc(var(--dur-1) * 3.5); }
}
@keyframes src-in { from { opacity: 0; translate: 12px 0; } }
