/* 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; }
.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); }

main { width: 100%; margin: 0 auto; padding: 28px 20px; flex: 1; }
main.narrow { max-width: 460px; }
main.wide { max-width: 900px; }
main.page { max-width: 1200px; display: flex; flex-direction: column; gap: var(--gap); padding: 20px 24px; }

.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; }
.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: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; }
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; }
.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 .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 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; }
}
