/* The "passport" look: a navy cover with a thin gold rule, warm visa-page paper, entry
   stamps for companies and statuses, serif headings, monospaced figures.
   Themes: light, dark, or the system's choice (no data-theme attribute). Every color is a
   token below; components never use a raw color. No inline styles anywhere (strict CSP). */

:root {
  --paper: #f6f4ec; --card: #fffefa; --ink: #1c2741; --muted: #545d74; --line: #e2ddcf;
  --cover: #1b2b4b; --seal: #2c4170; --cover-ink: #c7cfe0; --cover-hi: #ffffff; --gold: #c6a457; --gold-ink: #d9bd72;
  --link: #2a4a8a; --red: #a8332f; --green: #3d6a4c; --amber: #85601a; --navy: #1b2b4b;
  --primary: #1b2b4b; --primary-ink: #ffffff;
  --head: #1b2b4b; --head-ink: #ffffff; --row: #ffffff; --row-alt: #f1f4f9; --row-ink: #0f1729;
  --notice: #fbf1d9; --mrz: #ebe7db; --mrz-ink: #7d8396; --menu: #fffefa;
  --serif: Charter, "Bitstream Charter", "Iowan Old Style", "Sitka Text", Cambria, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;
  --radius: 8px; --gap: 14px; --rule: #b9b3a3;
  font-family: var(--sans);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #121a2e; --card: #1a2440; --ink: #e9ecf3; --muted: #a6b0c6; --line: #2e3a5c;
    --cover: #0b1222; --cover-ink: #b9c3da; --gold-ink: #dcc27c;
    --link: #a4bdf2; --red: #f2928a; --green: #92cfa3; --amber: #e4c06e; --navy: #a4bdf2;
    --primary: #dcc27c; --primary-ink: #121a2e;
    --head: #0b1222; --head-ink: #f2f4f8; --row: #1a2440; --row-alt: #212d4f; --row-ink: #f4f6fa;
    --notice: #3a3119; --mrz: #0e1528; --mrz-ink: #6f7a96; --menu: #1f2a49; --rule: #4a587e;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #121a2e; --card: #1a2440; --ink: #e9ecf3; --muted: #a6b0c6; --line: #2e3a5c;
  --cover: #0b1222; --cover-ink: #b9c3da; --gold-ink: #dcc27c;
  --link: #a4bdf2; --red: #f2928a; --green: #92cfa3; --amber: #e4c06e; --navy: #a4bdf2;
  --primary: #dcc27c; --primary-ink: #121a2e;
  --head: #0b1222; --head-ink: #f2f4f8; --row: #1a2440; --row-alt: #212d4f; --row-ink: #f4f6fa;
  --notice: #3a3119; --mrz: #0e1528; --mrz-ink: #6f7a96; --menu: #1f2a49; --rule: #4a587e;
  color-scheme: dark;
}

/* ------------------------------------------------------------------ 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: 1.5; font-size: 15px;
       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); }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.cover { background: var(--cover); border-bottom: 2px 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); color: var(--gold-ink); letter-spacing: .16em; text-decoration: none;
         font-size: 1rem; 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: -2px; font-size: .92rem; }
.sections a:hover { color: var(--cover-hi); }
.sections a[aria-current="page"] { color: var(--cover-hi); border-bottom-color: var(--gold-ink);
                                   background: color-mix(in srgb, var(--gold-ink) 14%, transparent); }

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: .72rem; letter-spacing: .14em; padding: 5px 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: 6px; }
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); border-radius: 1px; }
.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: 6px; text-decoration: none; color: var(--ink); }
details.more .menu a:hover { background: var(--paper); }
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; }
}
@media (max-width: 420px) {
  .here { display: none; }
  .brand { letter-spacing: .1em; font-size: .9rem; }
}

/* ------------------------------------------------------------------ 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: .8rem; letter-spacing: .04em;
                            border: 1px solid var(--gold); }
details.account > summary::-webkit-details-marker { display: none; }
.menu { position: absolute; right: 0; top: 42px; z-index: 10; width: 270px; background: var(--menu); color: var(--ink);
        border: 1px solid var(--line); border-radius: var(--radius); padding: 14px;
        box-shadow: 0 10px 30px rgba(10, 20, 40, .18); }
.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: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.segmented button { flex: 1; margin: 0; border: 0; border-radius: 0; padding: 5px 4px; font-size: .85rem;
                    font-weight: 500; background: transparent; color: var(--ink); }
.segmented button + button { border-left: 1px solid var(--line); }
.segmented button[aria-pressed="true"] { 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; }
h1 { font-size: 1.6rem; line-height: 1.25; margin: 0 0 6px; }
h2 { font-size: 1.1rem; margin: 0 0 8px; }
.cap { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.lead { color: var(--muted); margin: 0 0 18px; }
.fine { color: var(--muted); font-size: .88rem; 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: 1px solid var(--line); border-radius: var(--radius);
        padding: 18px 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: .72rem; font-weight: 600; text-transform: uppercase;
       letter-spacing: .08em; 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, Dismiss. */
form.inline-go { display: inline-flex; align-items: baseline; gap: 6px; margin: 0; }
form.inline-go input[type=text] { width: 12em; }
.start { margin-bottom: 14px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.start-title { margin: 0 0 2px; font-size: .95rem; }
.start-away { margin-top: 12px; font-size: .9rem; }
.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 */

.stamp { display: inline-block; color: var(--navy); border: 1.5px solid currentColor; outline: 1px solid currentColor;
         outline-offset: 2px; border-radius: 5px; padding: 4px 10px; font-size: .72rem; line-height: 1.35;
         letter-spacing: .08em; text-transform: uppercase; text-align: center; font-weight: 600;
         text-decoration: none; }
.stamp .fig { letter-spacing: .04em; font-weight: 400; text-transform: none; }
.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(-2deg); }
.stamps .stamp:nth-child(3n+2) { transform: rotate(1.5deg); }
.stamps .stamp:nth-child(3n) { transform: rotate(-1deg); }
/* A stamp that stands by itself (a page header, a panel) is tilted as Today's first stamp is. */
.stamp.lone { transform: rotate(-2deg); }
a.stamp:hover { background: var(--paper); }
.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: .88rem; 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; }
input, select { font: inherit; color: var(--ink); background: var(--row); border: 1px solid var(--line);
                border-radius: 6px; }
input { width: 100%; padding: 10px 12px; font-size: 1rem; }
select { padding: 8px 10px; }
textarea { font: inherit; color: var(--ink); background: var(--row); border: 1px solid var(--line);
           border-radius: 6px; width: 100%; padding: 10px 12px; }   /* drawn like an input */
button, .button { display: inline-block; margin-top: 12px; padding: 9px 16px; font: inherit; font-weight: 600;
                  border-radius: 6px; border: 1px solid var(--navy); background: transparent;
                  color: var(--navy); cursor: pointer; text-decoration: none; }
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: .9rem; }
form.inline { display: inline; }

.error { color: var(--red); font-weight: 600; }
.notice { background: var(--notice); padding: 10px 12px; border-radius: 6px; }
.pill { font-size: .72rem; padding: 1px 7px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); }

.codes { font-family: var(--mono); font-size: 1.05rem; 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: #fff; border-radius: 6px; }

/* ------------------------------------------------------------------ tables: built for reading figures */

table { width: 100%; border-collapse: collapse; font-size: .92rem; background: var(--row); color: var(--row-ink); }
th { background: var(--head); color: var(--head-ink); font-weight: 600; text-align: left; padding: 7px 10px; }
td { padding: 7px 10px; border-bottom: 1px solid var(--line); }
tbody tr:nth-child(even) td { background: var(--row-alt); }
.card table { border-radius: 6px; overflow: hidden; }

/* ------------------------------------------------------------------ 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: .88rem; }

/* ------------------------------------------------------------------ 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: .88rem; }
form.as-of input { width: auto; padding: 5px 8px; font-size: .92rem; }
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; }
/* The map: an org chart of stamps, each owner above what it owns, its share on the line between. */
.org { overflow-x: auto; padding: 4px 0 8px; }
.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 6px 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: 6px 0 0 0; }
.org > ul > li { padding-bottom: 6px; }
.org .stake { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: .74rem; 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(-2deg); }     /* tilted as Today's stamps are */
.org li:nth-child(3n+2) > .stamp { transform: rotate(1.5deg); }
.org li:nth-child(3n) > .stamp { transform: rotate(-1deg); }
.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: .8rem; color: var(--muted); }
.meta { color: var(--muted); font-size: .85rem; }
.small { font-size: .88rem; }
.answers h2 { margin-bottom: 0; }
.answers-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.answers-head .button { margin: 0; flex: none; font-size: .88rem; 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: .88rem; }
details.more-owners > summary::-webkit-details-marker { display: none; }
.verdict { display: inline-block; min-width: 4.6em; text-align: center; font-family: var(--mono); font-size: .72rem;
           font-weight: 700; letter-spacing: .08em; text-transform: uppercase; border: 1.5px solid currentColor;
           border-radius: 4px; padding: 0 6px; }
.verdict.yes { color: var(--navy); } .verdict.no { color: var(--muted); } .verdict.unknown { color: var(--amber); }
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: .88rem; 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: .9rem; }
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: .82rem; }
}

/* ------------------------------------------------------------------ person panel (Structure) */

.person h3.cap { margin: 12px 0 2px; }
table.mini { font-size: .84rem; }
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: .92rem; }
details.record label { margin: 6px 0 2px; font-size: .84rem; }
details.record input, details.record select { padding: 5px 8px; font-size: .9rem; 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: 4px; text-decoration: none; font-size: .92rem; }
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: .76rem; color: var(--muted); }
form.newfolder { display: flex; gap: 6px; align-items: center; margin-top: 8px; }
form.newfolder input { padding: 5px 8px; font-size: .9rem; }
form.newfolder button { margin: 0; }
td.acts { white-space: nowrap; }
td.acts form { margin-left: 8px; }
td.acts select { padding: 2px 4px; font-size: .84rem; 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: 1.15rem; }
form.company-pick select { padding: 4px 8px; font-size: .88rem; width: 9.5em; }
form.company-pick button { margin: 0; }
table.resizable { table-layout: fixed; }
table.resizable th { position: relative; }
table.resizable .c-name { width: 34%; } table.resizable .c-kind { width: 18%; } table.resizable .c-belongs { width: 28%; } table.resizable .c-date { width: 14%; } 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: 1.2rem; line-height: 1.2; border-radius: 4px; }
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: 1px solid var(--line); border-radius: 6px; box-shadow: 0 4px 14px rgba(0,0,0,.18); padding: 4px 0; }
.menu-pop.floating { position: fixed; right: auto; bottom: auto; }
.menu-pop a, .menu-pop button { display: block; width: 100%; margin: 0; padding: 6px 12px; border: 0; border-radius: 0; background: none; text-align: left; font: inherit; font-size: .9rem; font-weight: 400; color: var(--ink); text-decoration: none; cursor: pointer; }
.menu-pop a:hover, .menu-pop button:hover { background: var(--paper); }
.menu-pop button.danger { color: var(--red); }
.menu-pop form { margin: 0; }
.menu-pop .menu-move { padding: 4px 12px; border-bottom: 1px solid var(--line); border-top: 1px solid var(--line); margin: 4px 0; }
.menu-pop .menu-move select { width: 100%; margin-bottom: 2px; }
.menu-pop .menu-move button { padding: 4px 0; }
[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; }

/* 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: 999px; background: var(--gold); color: #1b2b4b; font-size: .72rem; 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: .86rem; max-width: 16em;
                                background: var(--seal); color: var(--cover-hi); border: 1px solid var(--cover-ink); border-radius: 6px;
                                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; }
ul.pick-list { list-style: none; margin: 0; padding: 0; }
ul.pick-list a { display: block; padding: 5px 6px; border-radius: 4px; text-decoration: none; }
ul.pick-list a:hover, ul.pick-list a:focus-visible { background: var(--paper); }
ul.pick-list a[aria-current="true"] { font-weight: 700; box-shadow: inset 3px 0 0 var(--gold); }
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: .85rem; }
details.act label { display: block; margin: 4px 0 2px; font-size: .84rem; }
details.act input { padding: 4px 6px; font-size: .88rem; }
