/* The look of Trajan Plan (financial-planning-demo/src/domain/tokens.ts and its
   ui/buttonStyles.ts, ui/Modal.tsx): Poppins, 12px words, 13px section headings, 11px
   tracked capitals for captions, 11px Bright Red errors. Every button's label is 12px
   semibold; Berry fills a feature's own act (Build, Resend Link, a dialog's act), Bright Red
   a delete, and every other button is white. */

/* The page's own copies of Poppins (assets/page/fonts/, scripts/make_page_files.py). */
@font-face { font-family: Poppins; font-weight: 400; src: url(/fonts/Poppins-Regular.woff2) format("woff2"); }
@font-face { font-family: Poppins; font-weight: 500; src: url(/fonts/Poppins-Medium.woff2) format("woff2"); }
@font-face { font-family: Poppins; font-weight: 600; src: url(/fonts/Poppins-SemiBold.woff2) format("woff2"); }
@font-face { font-family: Poppins; font-weight: 700; src: url(/fonts/Poppins-Bold.woff2) format("woff2"); }

:root {
  --text: #1e1e2f;
  --muted: #64748b;
  --faint: #94a3b8;
  --surface: #ffffff;
  --subtle: #f8fafc;
  --muted-bg: #f1f5f9;
  --background: #f3f3f3;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --berry: #a81e57;
  --midnight: #154666;
  --cornflower: #2a7ea6;
  --charcoal: #272f33;
  --danger: #dc2626;
  --link: #0165fc;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--background); color: var(--text); font: 400 12px/1.45 Poppins, sans-serif; }
button, input, select, textarea { font: inherit; color: inherit; }

/* The frame of every page but the sign-in page (templates/_frame.html): the sidebar down
   the left, and beside it the top bar over the page, both Charcoal, so the two read as
   one frame around the page, as Trajan Plan's do. The body is as tall as its page, not the
   window (as `html, body` would make it): the sidebar and the bar stay put only within
   it, so however far a long page scrolls. */
body.framed { display: flex; height: auto; min-height: 100vh; }
.workspace { flex: 1; min-width: 0; }
.bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 28px;
       height: 44px; padding: 0 24px; background: var(--charcoal); color: #fff; }
/* A section's tabs, at the bar's start, each a button of the standard 30px: under the
   pointer, a faint white wash; the one showing, filled white, as the sidebar's row for
   where you are is. */
.tabs { display: flex; align-items: center; gap: 4px; height: 100%; margin-left: -14px; }
.tabs button { padding: 0 14px; border: 0; border-radius: 4px; background: none;
               color: rgba(255, 255, 255, 0.75); font-weight: 500; cursor: pointer; }
.tabs button:hover:not(:disabled) { color: #fff; background: rgba(255, 255, 255, 0.08); }
.tabs button[aria-current="page"], .tabs button[aria-current="page"]:hover {
  background: var(--surface); color: var(--charcoal); }
/* DEV, the laptop's app: a Cornflower pill after the tabs. */
.dev-pill { padding: 2px 10px; border-radius: 999px; background: var(--cornflower);
            color: #fff; font-size: 11px; font-weight: 600; letter-spacing: 0.6px; }
.dev-pill[hidden] { display: none; }
.tabs + .dev-pill { margin-left: -14px; }

/* The sidebar (templates/_sidebar.html), as Trajan Plan's (financial-planning-demo,
   app/src/screens/shell/Sidebar.tsx), and as wide: 188px, or 56px folded to its icons. Its
   head is the top bar's height, so the logo sits on the bar's line. Above the page, so a
   folded row's bubble hangs over it. */
.sidebar { position: sticky; top: 0; z-index: 8; flex-shrink: 0; display: flex; flex-direction: column; gap: 4px;
           width: 188px; height: 100vh; padding: 0 8px 12px; background: var(--charcoal); color: #fff; }
.folded .sidebar { width: 56px; }
.side-logo { display: flex; align-items: center; justify-content: center; flex-shrink: 0; height: 44px; }
.side-logo img { display: block; }
.side-logo .logo-open { width: 164px; height: 40px; }
.side-logo .logo-folded, .folded .side-logo .logo-open { display: none; }
.folded .side-logo .logo-folded { display: block; width: 32px; height: 32px; }
.side-middle { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 4px; }
.side-foot { display: flex; flex-direction: column; gap: 4px; }
.side-foot form { display: flex; }
/* On Home, the app's name where a section's tabs would be, as the sign-in page heads
   itself: capitals, tracked, as large as the column holds. */
.side-app { padding: 8px 0 4px; font-size: 22px; font-weight: 700; line-height: 1.2; letter-spacing: 1.5px;
            text-align: center; text-transform: uppercase; }
.folded .side-app { display: none; }
/* A row: its icon, then its name. Under the pointer, a faint white wash; where you are,
   filled white, the one light row in the column. */
.sidebar .side-row { position: relative; display: flex; align-items: center; gap: 8px; width: 100%; height: auto;
                     padding: 8px 12px; border: 0; border-radius: 4px; background: none; color: #fff;
                     font: 600 12px/18px Poppins, sans-serif; text-align: left; white-space: normal; cursor: pointer; }
.sidebar .side-row:hover:not(:disabled) { background: rgba(255, 255, 255, 0.08); text-decoration: none; }
.sidebar .side-row[aria-current="page"], .sidebar .side-row[aria-current="page"]:hover {
  background: var(--surface); color: var(--charcoal); }
.sidebar .side-row:focus-visible { outline: 2px solid rgba(255, 255, 255, 0.6); outline-offset: -2px; }
.side-icon { flex-shrink: 0; }
/* The fold button: its chevrons alone, at the column's right edge, pointing the way a
   press moves the column. */
.sidebar .side-fold { align-self: flex-end; width: auto; padding: 8px; }
.folded .sidebar .side-fold svg { transform: scaleX(-1); }
/* Folded: each row its icon alone, in the middle of the column, and its name in a bubble
   beside it on hover, for the eye; a screen reader has the name, hidden, either way. */
.folded .sidebar .side-row, .folded .sidebar .side-fold { align-self: stretch; justify-content: center; padding: 8px 0; }
.folded .side-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%);
                     white-space: nowrap; }
.bubble { display: none; position: absolute; top: 50%; left: calc(100% + 16px); z-index: 9; transform: translateY(-50%);
          padding: 8px 12px; border-radius: 6px; background: #475569; color: #fff; font: 400 11px/16px Poppins, sans-serif;
          white-space: nowrap; box-shadow: 0 4px 12px rgba(30, 30, 47, 0.12); pointer-events: none; }
.folded .side-row:hover .bubble, .folded .side-row:focus-visible .bubble { display: block; }
/* The ToC: a button among the tabs, and the contents' two pages hanging from the bar
   side by side, as wide as the bar less its padding, so they are large enough to read;
   each of their lines a link tinted berry under the pointer. The bar, not the button,
   places it. */
.toc { display: flex; align-items: center; height: 100%; }
.tabs .toc > button[aria-expanded="true"] { color: #fff; background: rgba(255, 255, 255, 0.08); }
.toc-pop { position: absolute; top: 100%; left: 24px; right: 24px; z-index: 6; padding: 8px; background: var(--surface);
           border: 1px solid var(--border-strong); border-top: 0; border-radius: 0 0 8px 8px;
           box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18); }
.toc-pop[hidden] { display: none; }
.toc-sheet { position: relative; }
.toc-sheet img { display: block; width: 100%; border-radius: 4px; }
.toc-link { position: absolute; border-radius: 2px; }
.toc-link:hover, .toc-link:focus-visible { background: rgba(168, 30, 87, 0.14); outline: none; }
/* The hazard icon, white on the bar, and its pop-up of warnings beneath it. */
.hazard { position: relative; display: flex; align-items: center; height: 100%; }
.hazard[hidden] { display: none; }
.hazard > button { height: 34px; width: 34px; padding: 0; border: 0; background: none; display: flex;
                   align-items: center; justify-content: center; }
.hazard > button:hover:not(:disabled) { background: rgba(255, 255, 255, 0.08); }
.hazard-tip { display: none; position: absolute; top: calc(100% - 6px); left: 0; z-index: 6; min-width: 280px;
              max-width: 420px; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 8px;
              background: var(--surface); color: var(--text); font-size: 13px; line-height: 1.45;
              box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18); }
.hazard-tip div + div { margin-top: 4px; }
.hazard:hover .hazard-tip, .hazard:focus-within .hazard-tip, .hazard.open .hazard-tip { display: block; }
.edition { margin-left: auto; display: flex; gap: 16px; align-items: center; }
.quarter { font-size: 13px; font-weight: 600; }

/* The page starts beside the sidebar, open or folded, 24px in as the top bar's tabs are,
   never centred in the space left: on a wide screen that would leave a wide gap beside
   the sidebar. Past 1400px it leaves the room at the right. */
main { padding: 20px 24px 48px; max-width: 1400px; }

/* The landing page: a white card for each module, the whole card a link to it, its icon
   left of its name. */
.modules { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.module { display: flex; align-items: center; gap: 10px; padding: 22px 18px; background: var(--surface);
          border: 1px solid var(--border); border-radius: 10px; color: var(--text); font-size: 14px; font-weight: 600; }
.module-icon { flex-shrink: 0; }
.module:hover { border-color: var(--border-strong); box-shadow: 0 2px 8px rgba(30, 30, 47, 0.08);
                text-decoration: none; }
.module:focus-visible { outline: 2px solid rgba(1, 101, 252, 0.25); border-color: var(--link); }

/* shared pieces */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 16px 18px; }
.card + .card { margin-top: 16px; }
h2 { margin: 0 0 12px; font-size: 13px; font-weight: 600; }
/* A card's heading with a button of its own at the right. */
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
/* A card's heading with words beside it: DEV's warning. */
.card-title { display: flex; align-items: baseline; gap: 14px; }
.decks > .dev-warning { margin-bottom: 10px; }
.caption { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; }
.error { font-size: 11px; color: var(--danger); }
.complete { font-size: 11px; color: var(--midnight); font-weight: 600; }
.note { font-size: 11px; color: var(--muted); }
button { height: 30px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: 6px;
         background: var(--surface); font-weight: 600; cursor: pointer; white-space: nowrap; }
button:hover:not(:disabled) { background: var(--muted-bg); }
button:disabled { opacity: 0.5; cursor: default; }
button.feature { background: var(--berry); border-color: var(--berry); color: #fff; }
button.feature:hover:not(:disabled) { background: #8f1949; }
button.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
button.danger:hover:not(:disabled) { background: #b91c1c; }
/* A row's own button: a white square, its glyph 15px, a delete's in Bright Red. */
button.icon { width: 30px; padding: 0; display: inline-flex; align-items: center; justify-content: center;
              color: var(--danger); }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
input[type=date], input[type=text], input[type=email], input[type=password], textarea {
  width: 100%; padding: 6px 8px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--surface); }
textarea { resize: vertical; min-height: 34px; line-height: 1.45; }
textarea:focus, input:focus, :is(dialog, .model-editor) select:focus { outline: 2px solid rgba(1, 101, 252, 0.25); border-color: var(--link); }
.field { margin-bottom: 14px; }
/* "Slide Name:" and the name, atop a slide's box. */
.slide-name { display: flex; align-items: baseline; gap: 6px; margin-bottom: 14px; }
.field .caption { display: block; margin-bottom: 4px; }
/* A box's label, and beside it the pop-up icon, whose pop-up shows the box's words filled
   as the slide will show them (app.js, fillsCaption): shown while the pointer is on the
   icon, and kept open by a click. */
.caption-row { display: flex; align-items: center; gap: 4px; margin-bottom: 4px; }
.field .caption-row .caption { margin-bottom: 0; }
.fills-pop { position: relative; display: inline-flex; }
.fills-pop[hidden] { display: none; }
.fills-pop > button { height: 18px; width: 18px; padding: 0; border: 0; border-radius: 4px; background: none;
                      color: var(--muted); display: inline-flex; align-items: center; justify-content: center; }
.fills-pop > button:hover:not(:disabled) { background: var(--muted-bg); color: var(--text); }
.fills-tip { display: none; position: absolute; top: 100%; left: 0; z-index: 4; width: max-content;
             max-width: min(440px, calc(100vw - 48px)); padding: 8px 10px; border: 1px solid var(--border-strong);
             border-radius: 8px; background: var(--surface); color: var(--text); white-space: pre-wrap;
             overflow-wrap: anywhere; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18); }
.fills-pop:hover .fills-tip, .fills-pop.open .fills-tip { display: block; }

/* tables */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--border); }
td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td.actions { white-space: nowrap; text-align: right; }
td.actions button + button { margin-left: 6px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.series-title { font-size: 13px; font-weight: 600; }
.slide-names { display: grid; gap: 4px; margin-bottom: 4px; }

/* slides */
.slides { display: grid; grid-template-columns: 300px 1fr; gap: 16px; align-items: start; }
.slide-list { position: sticky; top: 64px; max-height: calc(100vh - 84px); overflow-y: auto; padding: 6px; }
/* A problem kept at the top of its card however far it is scrolled, in bigger words than
   a box's own: a drop refused in DEV, or an order not saved, atop the list, which scrolls
   itself; a box not saved atop the slide's card, under the bar as the page scrolls. */
.drop-refused, .unsaved { position: sticky; z-index: 2; padding: 8px 12px; font-size: 13px; font-weight: 600;
                          color: var(--danger); background: var(--surface); border-bottom: 1px solid var(--border); }
.drop-refused:empty, .unsaved:empty { display: none; }
.drop-refused { top: -6px; margin: -6px -6px 6px; }
.unsaved { top: 44px; margin: -16px -18px 14px; padding: 8px 18px; border-radius: 10px 10px 0 0; }
.slide-item { display: grid; grid-template-columns: 92px 1fr; gap: 10px; align-items: center; width: 100%;
              padding: 6px; border-left: 3px solid transparent; border-radius: 6px; cursor: pointer; }
.slide-item:hover { background: var(--muted-bg); }
.slide-item.on { background: var(--muted-bg); }
.slide-item.unfilled { border-left-color: var(--danger); }
.slide-item:focus-visible { outline: 2px solid rgba(1, 101, 252, 0.25); }
.slide-item[draggable="true"] { cursor: grab; }
/* While a slide is dragged: it fades, and a berry line shows where it would land. */
.slide-item.dragging { opacity: 0.4; }
.slide-item.drop-before, .slide-item.drop-after, .archive-head.drop-after { position: relative; }
.drop-before::before, .drop-after::after { content: ""; position: absolute; left: 0; right: 0; height: 2px;
                                           border-radius: 1px; background: var(--berry); pointer-events: none; }
.drop-before::before { top: -1px; }
.drop-after::after { bottom: -1px; }
/* The Archive, under the deck's slides: its heading, and an empty one's place to drop. */
.archive-head { margin: 14px 0 0; padding: 10px 6px 6px; border-top: 1px solid var(--border); }
.archive-empty { height: 56px; margin: 4px 6px 6px; border: 1px dashed var(--border-strong); border-radius: 6px; }
.slide-item img { width: 92px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 3px; border: 1px solid var(--border); }
.slide-item .t { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.slide-item .n { font-size: 11px; color: var(--muted); }
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; align-items: start; }

/* Factsheets' Models tab, laid out as the Slides tab is: the list of models, then of
   portfolio managers, then of sets of disclosures, kept in view down the left; the one
   chosen in a card beside it, its short fields two to a row above its long ones. */
.models { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }
.model-list { position: sticky; top: 64px; max-height: calc(100vh - 84px); overflow-y: auto; padding: 6px; }
.model-item { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 7px 8px;
                  border-radius: 6px; cursor: pointer; }
.model-item:hover, .model-item.on { background: var(--muted-bg); }
.model-item:focus-visible { outline: 2px solid rgba(1, 101, 252, 0.25); }
.model-item .n { flex-shrink: 0; font-size: 11px; color: var(--muted); }
.list-head { display: flex; align-items: center; justify-content: space-between; margin: 14px 0 0;
             padding: 10px 8px 6px; border-top: 1px solid var(--border); font-size: 11px; font-weight: 600;
             color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; }
.list-head:first-child { margin-top: 0; padding-top: 4px; border-top: 0; }
/* A list's "+", as the Users page's beside its title. */
:is(.users, .list-head) button.add { display: inline-flex; align-items: center; justify-content: center; width: 20px;
  height: 20px; padding: 0; border: 1px solid var(--charcoal); border-radius: 10px; background: var(--charcoal);
  color: #fff; font-size: 14px; line-height: 1; }
:is(.users, .list-head) button.add:hover:not(:disabled) { background: var(--charcoal); opacity: 0.85; }
/* A card's own act at its foot: Delete. */
.card-foot { display: flex; justify-content: flex-end; margin-top: 4px; padding-top: 14px; border-top: 1px solid var(--border); }
/* A manager's headshot, as the factsheet frames it, 3 wide by 4 tall, and its buttons. */
.photo-row { display: flex; align-items: flex-end; gap: 14px; margin-bottom: 14px; }
.photo-buttons { display: flex; gap: 8px; }
/* Frame Photo: the frame, which the photo always fills, dragged about in it. */
.photo-frame { position: relative; width: 240px; height: 320px; margin: 0 auto 12px; overflow: hidden;
               border: 1px solid var(--border-strong); border-radius: 6px; background: #fff; cursor: grab;
               touch-action: none; }
.photo-frame.dragging { cursor: grabbing; }
.photo-frame:focus-visible { outline: 2px solid rgba(1, 101, 252, 0.25); }
.photo-frame img { position: absolute; left: 0; top: 0; max-width: none; user-select: none; pointer-events: none; }
.dialog-body .zoom { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.dialog-body .zoom .caption { margin: 0; }
.dialog-body .zoom input { flex: 1; accent-color: var(--charcoal); }
.model-editor h2 { margin: 0 0 14px; }
.headshot { display: block; width: 120px; aspect-ratio: 3 / 4; border: 1px solid var(--border); border-radius: 6px; }
.short-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; }
.preview { width: 100%; border-radius: 6px; border: 1px solid var(--border); display: block; }
.figures { position: sticky; top: 64px; max-height: calc(100vh - 84px); overflow-y: auto; }
/* Each figure a row: its name, and its value at the right. A value that doesn't fit beside
   its name goes under it, still at the right; a number never breaks, and words break only
   at their spaces. */
.figures dl { margin: 0; }
.figures dl > div { display: flex; flex-wrap: wrap; column-gap: 10px; }
.figures dl > div + div { margin-top: 2px; }
.figures dt { min-width: 0; font-family: ui-monospace, Menlo, monospace; font-size: 11px; color: var(--muted);
              overflow-wrap: anywhere; }
.figures dd { margin: 0 0 0 auto; font-size: 11px; text-align: right; font-variant-numeric: tabular-nums; }
.figures h2 + dl { margin-bottom: 14px; }

/* A slide's text box, edited as the slide shows it: a heading bold and larger. */
.rich { width: 100%; min-height: 34px; padding: 6px 8px; border: 1px solid var(--border-strong); border-radius: 6px;
        background: var(--surface); line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.rich:focus { outline: 2px solid rgba(1, 101, 252, 0.25); border-color: var(--link); }
.rich .heading, .fills-tip .heading { font-weight: 700; font-size: 1.15em; }
/* On the laptop every box is read-only (app.js), shaded so it doesn't look typeable. */
textarea[readonly], .rich[contenteditable="false"] { background: var(--muted-bg); border-color: var(--border); }
textarea[readonly]:focus, .rich[contenteditable="false"]:focus { outline: none; border-color: var(--border); }
.tools { display: flex; align-items: center; gap: 4px; margin-bottom: 4px; }
button.tool { height: 26px; min-width: 28px; padding: 0 8px; }
/* A toolbar button whose look the selection has: light grey, as if held down. */
button.tool[aria-pressed="true"], button.tool[aria-pressed="true"]:hover:not(:disabled) {
  background: var(--border); border-color: var(--faint); }
.tools .size { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; font-size: 12px; color: var(--muted); }
.tools select { height: 26px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--surface); }

/* The sign-in page, as Trajan Plan's (financial-planning-demo, server/src/web/
   sign-in-page.ts): a white card in the middle of the page, the Trajan Wealth logo, the
   app's name in Berry capitals, Trajan Plan's fields, and Charcoal buttons. */
body.signing-in { display: flex; flex-direction: column; }
.signing-in main { flex: 1 0 auto; display: flex; align-items: center; justify-content: center; width: 100%;
                   max-width: none; padding: 16px; }
.signing-in form { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 12px; padding: 24px;
                   background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
                   box-shadow: 0 4px 12px rgba(30, 30, 47, 0.12); }
.signing-in img { width: 180px; height: 44px; object-fit: contain; object-position: left; margin-bottom: 8px; }
.signing-in h1 { margin: 0; text-align: center; text-transform: uppercase; font-size: 30px; font-weight: 700;
                 letter-spacing: 1.5px; color: var(--berry); }
.signing-in .field { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.signing-in input { padding: 8px 12px; border-color: var(--border); font-size: 12px; }
.signing-in input:focus { outline: revert; border-color: var(--border); }
.signing-in input:placeholder-shown { font-style: italic; }
.signing-in input::placeholder { color: var(--muted); opacity: 1; }
.signing-in .error, .signing-in .note { margin: 0; }
.signing-in .note { font-size: 12px; color: var(--text); }
.signing-in .error:empty, .signing-in .note:empty { display: none; }
.signing-in button { align-self: flex-start; min-width: 84px; height: auto; display: flex; align-items: center;
                     justify-content: center; padding: 8px 16px; background: var(--charcoal);
                     border: 1px solid var(--charcoal); border-radius: 6px; color: #fff; font-size: 12px; }
.signing-in button:hover:not(:disabled) { background: var(--charcoal); }
.signing-in button.link { min-width: 0; padding: 0; background: none; border: 0; color: var(--text); font-weight: 400;
                          text-decoration: underline; }
.signing-in button.link:hover:not(:disabled) { background: none; }
.signing-in .dev { display: flex; flex-direction: column; padding-top: 12px; border-top: 1px solid var(--border); }
.signing-in footer { padding: 0 12px 8px; font-size: 11px; color: var(--muted); }
.signing-in .spinner { width: 18px; height: 18px; border-color: rgba(255, 255, 255, 0.35); border-top-color: #fff; }

/* The Users page and the Audit Log, as Trajan Plan's (financial-planning-demo,
   app/src/screens/users/UsersPage.tsx and docs/audit-log.md there): one card filling the
   page, its title (and the Users page's "+") at the left and the latest answer at the
   right; then the table in a frame of its own, the headings on a grey band, the rows
   striped. */
main.users-page, main.audit-page { max-width: none; padding: 12px; }
:is(.users, .audit).card { display: flex; flex-direction: column; gap: 12px; padding: 12px; border-radius: 8px; }
:is(.users, .audit) .card-head { flex-wrap: wrap; margin: 0; }
.users .card-title { align-items: center; gap: 8px; }
/* The Audit Log's Module dropdown, beside its title: the section showing. */
.audit .card-title { align-items: center; gap: 24px; }
.audit .module-choice { display: flex; align-items: center; gap: 8px; }
:is(.users, .audit) h2 { margin: 0; font-size: 16px; font-weight: 600; }
.corner-notes { max-width: 360px; margin-left: auto; text-align: right; }
.corner-notes .note { font-size: 12px; color: var(--text); }
.table-frame { overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; }
/* Each table laid out by the widths `sizeColumns` gives its columns (app/static/common.js). */
:is(.users, .audit) table { table-layout: fixed; }
:is(.users, .audit) thead tr { background: var(--muted-bg); }
:is(.users, .audit) th { height: 38px; padding: 4px 8px; border-bottom: 1px solid var(--border); font-size: 11px;
                         font-weight: 700; white-space: nowrap; }
:is(.users, .audit) th button.sort { display: inline-flex; align-items: center; gap: 4px; height: auto; padding: 0;
                                     border: 0; background: none; font-size: 11px; font-weight: 700; }
:is(.users, .audit) th button.sort:hover:not(:disabled) { background: none; text-decoration: underline; }
:is(.users, .audit) td { height: 40px; padding: 4px 8px; border-bottom: 0; vertical-align: middle; }
:is(.users, .audit) tbody tr:nth-child(even) { background: var(--subtle); }
.users td { overflow-wrap: break-word; }
.users .you { margin-left: 4px; }
/* A row that opens Edit User: a pointer, a grey under it while pointed at, and the focus
   ring inside it when the keyboard reaches it. */
.users tr.editable { cursor: pointer; }
.users tbody tr.editable:hover { background: var(--muted-bg); }
.users tr.editable:focus-visible { outline: 2px solid rgba(1, 101, 252, 0.25); outline-offset: -2px; }
/* A dropdown as Trajan Plan draws its own: white, a grey edge, and a grey caret. */
:is(.audit, dialog, .model-editor) select { min-width: 140px; height: 28px; padding: 4px 26px 4px 8px;
  border: 1px solid var(--border-strong); border-radius: 4px; appearance: none; font-size: 12px;
  background: var(--surface) no-repeat right 8px center
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0h10L5 6z' fill='%2364748b'/%3E%3C/svg%3E"); }
.users td.actions { width: 1%; }
.users button.resend { height: 28px; padding: 4px 12px; }
.users button.icon { width: 24px; height: 24px; }

/* The Audit Log fills the window below the bar and never scrolls itself: its table's frame
   does, both ways, under headings pinned to its top, as tall as its lines up to the room
   the window leaves, with the pager under it. Each column has a least width, and a window
   narrower than all of them scrolls the table sideways rather than squeezing them. */
main.audit-page { display: flex; flex-direction: column; height: calc(100vh - 44px); }
.audit.card { min-height: 0; }
.audit .table-frame { min-height: 0; overflow: auto; }
.audit .table-frame.loading { opacity: 0.55; }
.audit thead { position: sticky; top: 0; z-index: 1; }
.audit thead tr { background: var(--muted-bg); }
.audit th .heading { display: flex; align-items: center; gap: 4px; }
/* Its scrollbars painted, so they show without a scroll begun: on a Mac they are
   otherwise drawn only while scrolling, and a table wider than the window would give no
   sign of its last columns. */
.audit .table-frame::-webkit-scrollbar { width: 10px; height: 10px; }
.audit .table-frame::-webkit-scrollbar-track { background: var(--subtle); }
.audit .table-frame::-webkit-scrollbar-thumb { border: 2px solid var(--subtle); border-radius: 5px;
                                               background: var(--border-strong); }
.audit td { vertical-align: top; padding-top: 11px; overflow-wrap: break-word; }
/* The funnel in each heading, grey, the filter row's switch. */
.audit button.funnel { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px;
                       padding: 0; border: 0; border-radius: 4px; background: none; color: var(--muted); }
.audit button.funnel:hover:not(:disabled) { background: var(--border); }
/* The filter row: under each heading its own box, as compact as the table's dropdowns. */
.audit tr.filters th { height: auto; padding: 6px 8px; font-weight: 400; vertical-align: top; }
.audit tr.filters input[type=text] { height: 28px; padding: 4px 8px; font-size: 12px; }
.audit tr.filters select { width: 100%; min-width: 0; }
.audit .when-filter { display: flex; flex-direction: column; gap: 6px; }
.audit .when-filter label { display: flex; flex-direction: column; gap: 2px; }
.audit .when-filter input[type=date] { height: 28px; padding: 4px 6px; border: 1px solid var(--border-strong);
                                       border-radius: 4px; font-size: 12px; }
/* A value of at most two lines, each item of a list on its own; one cut short is a link
   that opens it whole. */
.audit .clamp { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
                white-space: pre-line; }
.audit .clamp.more { color: var(--link); text-decoration: underline; cursor: pointer; }
/* Restore, in a deletion's After, as compact as the Users page's Resend Link. */
.audit button.restore { height: 28px; margin-top: -6px; padding: 4px 12px; }
.audit td.empty { padding: 16px 8px; color: var(--muted); }
dialog p.value { max-height: 60vh; overflow-y: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
/* The pager: Rows per page at the left; which lines show, of how many, and the arrows at
   the right. */
.audit .pager { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.audit .pager .page-size, .audit .pager .page-turn { display: flex; align-items: center; gap: 8px; }
.audit .pager .page-size span { font-weight: 600; }
.audit .pager select { min-width: 72px; }
.audit .pager button.step { display: inline-flex; align-items: center; justify-content: center; width: 28px;
                            height: 28px; padding: 0; border: 0; background: none; color: var(--text); }
.audit .pager button.step:disabled { color: var(--faint); opacity: 1; }

/* decks */
.decks td { vertical-align: middle; }
.files a + a { margin-left: 12px; }

/* dialogs: 400px, the width Trajan Plan gives a question or a short form; the header,
   body, and foot share one side padding, so their edges line up. */
dialog { width: min(400px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: 14px; color: var(--text);
         box-shadow: 0 4px 12px rgba(30, 30, 47, 0.12); }
dialog::backdrop { background: rgba(30, 30, 47, 0.45); }
dialog header { padding: 12px 16px 8px; border-bottom: 1px solid var(--border); }
dialog header h2 { margin: 0; font-size: 16px; }
.dialog-body { padding: 16px; }
.dialog-body p { margin: 0; }
.dialog-body .caption { display: block; margin-bottom: 4px; }
.dialog-body .error { margin-top: 4px; }
/* The New User and Edit User dialogs: Role and Status dropdowns as wide as the dialog's
   Email, and under Modules a tick for each, one to a line. */
.dialog-body select, .model-editor select { width: 100%; height: auto; padding: 6px 26px 6px 8px;
  font-size: inherit; border-radius: 6px; }
.dialog-body fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.dialog-body fieldset:not(:last-child) { margin-bottom: 14px; }
.dialog-body > .field:last-child { margin-bottom: 0; }
.dialog-body legend { padding: 0; }
.tick-row { display: flex; align-items: center; gap: 8px; width: fit-content; margin-top: 8px; cursor: pointer; }
.tick-row input { width: 16px; height: 16px; margin: 0; accent-color: var(--charcoal); cursor: inherit; }
.tick-row:has(input:disabled) { cursor: default; }
dialog footer { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--border); }
dialog footer .problem { flex: 1; }
/* Cancel and the act are one item, so a narrow window never parts them. */
.pair { display: flex; gap: 8px; margin-left: auto; flex-shrink: 0; }
dialog footer button { height: 32px; min-width: 84px; padding: 0 16px; }
.spinner { display: inline-block; width: 12px; height: 12px; border: 2px solid rgba(255, 255, 255, 0.4);
           border-top-color: #fff; border-radius: 50%; animation: spin 0.8s linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Factsheets: a model that can't be built yet, in red in the Models tab's list, and why at
   the top of its card; and the Build dialog's choice of All Models or Chosen Models, a tick
   for each model in a list of its own that scrolls, a model that can't be built in red
   with why under its name. */
.model-item .t.unfilled { color: var(--danger); }
.unfilled-why { margin-bottom: 8px; }
.which { display: flex; gap: 18px; margin-bottom: 10px; }
.which .choice, .model-ticks .tick { display: flex; align-items: center; gap: 6px; }
.model-ticks { display: flex; flex-direction: column; gap: 4px; max-height: 320px; overflow-y: auto;
               padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; }
.model-ticks[hidden] { display: none; }
.model-ticks .tick { flex-wrap: wrap; }
.model-ticks .tick .error { flex-basis: 100%; padding-left: 22px; }
.model-ticks .tick.unfilled > span { color: var(--danger); }

