/* The look of the accounting screens, written to be lifted.

   Five sections, in this order:
     1 Tokens            every colour, space, radius and size, light then dark
     2 Base              elements
     3 Shell             top bar, left rail and its foot, stage, page header
     4 Components        buttons, fields, tables, dialogs, notices, tags,
                         empty states, cards, paper
     5 This application  what only the accounting screens need

   Sections 1 to 4 say nothing about accounting: another site can take them
   as they are. Everything is styled by a class or an element. The site's
   policy forbids a style written on an element, a web font and a picture
   from another address, so there is none of those here.

   Light and dark follow the reader's system setting. */

/* ==========================================================================
   1 Tokens
   ========================================================================== */

:root {
  color-scheme: light;

  /* The page, the surfaces and the lines: neutral greys. */
  --bg: #ffffff;
  --bg-subtle: #f6f7f9;
  --bg-inset: #eceef2;
  --surface: #ffffff;
  --line: #dde1e6;
  --line-strong: #c6ccd4;
  /* The edge of what is pressed or typed into: a field, a button, a switch.
     It stands at 3 to 1 or better against the page, the rail and an inset
     surface, in the light and in the dark. */
  --line-field: #7f8892;
  --ink: #1f2328;
  --muted: #59636e;

  /* The one accent: a warm orange. Primary buttons, the marked page, links
     and the focus ring. */
  --accent: #c2410c;
  --accent-solid: #c2410c;
  --accent-solid-hover: #9a3412;
  --accent-soft: #fdf0e8;
  --on-accent: #ffffff;
  --focus: #c2410c;

  /* Green, amber and red: accepted, warning and refused, and nothing else. */
  --ok-bg: #e9f6ee;
  --ok-ink: #1a6334;
  --ok-line: #b5dfc3;
  --warn-bg: #fff6dd;
  --warn-ink: #7a4d00;
  --warn-line: #ecd596;
  --bad-bg: #fdeeed;
  --bad-ink: #a8231c;
  --bad-line: #f1c0bc;
  --bad-solid: #b3261e;
  --bad-solid-hover: #8f1d17;

  --shadow-high: 0 16px 48px rgba(31, 35, 40, 0.24);
  --backdrop: rgba(31, 35, 40, 0.5);

  /* Faces: the system's own. No web font is loaded. */
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;

  /* Sizes of text, and the two weights. */
  --text: 14px;
  --text-table: 13px;
  --text-small: 12px;
  --text-tiny: 11px;
  --text-title: 20px;
  --text-heading: 16px;
  /* The product's name in the top bar, the title of a dialog, and a number
     shown large. */
  --text-brand: 15px;
  --text-dialog: 18px;
  --text-figure: 30px;
  --weight: 400;
  --weight-strong: 600;

  /* Space, on a step of four. */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;

  --radius: 8px;
  --radius-small: 6px;
  --radius-large: 12px;

  /* The shell: the height of the top bar, the width of the rail, and the
     widest the content of the stage runs. */
  --topbar: 56px;
  --rail: 248px;
  --stage: 1440px;
  --stage-gutter: 32px;
  /* The room the content of the stage has: what the window leaves beside the
     rail, up to the widest the content runs. What is under an open row of a
     table keeps to it, so that it is all in sight while a wide table is
     scrolled sideways in its frame. */
  --stage-room: min(100vw - var(--rail) - 2 * var(--stage-gutter), var(--stage));
  /* The widest a line of reading text runs, and the width of a page that is
     one form. */
  --measure: 100ch;
  --column: 860px;
  /* The width a page that keeps a list of records is held to: its header and
     its list both end there, so that the button in the header stands
     directly above the buttons on the rows, and neither is far from the
     names at the left. */
  --reading: 1120px;
  /* The least width of a table whose rows open, and of one whose open rows
     hold a list of many columns. */
  --records: 920px;
  --records-wide: 1120px;
  /* The height of a button, an input and a pick list, so that they line up. */
  --control: 32px;
  --control-small: 26px;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;

    --bg: #0f1115;
    --bg-subtle: #15181d;
    --bg-inset: #1f232a;
    --surface: #171a20;
    --line: #2a2f37;
    --line-strong: #3a414b;
    --line-field: #6b7480;
    --ink: #e6e8eb;
    --muted: #9aa3ad;

    --accent: #ff9b5e;
    --accent-solid: #c2470f;
    /* Under the pointer a solid button goes darker here too, not lighter, so
       that its white label keeps its contrast. */
    --accent-solid-hover: #a83c0c;
    --accent-soft: #33200f;
    --on-accent: #ffffff;
    --focus: #ff9b5e;

    --ok-bg: #12281a;
    --ok-ink: #8fe0ab;
    --ok-line: #24523a;
    --warn-bg: #2e2410;
    --warn-ink: #f2cf7c;
    --warn-line: #5c4a1c;
    --bad-bg: #33181a;
    --bad-ink: #ffaba3;
    --bad-line: #6b2c2c;
    --bad-solid: #c93a31;
    --bad-solid-hover: #a82f27;

    --shadow-high: 0 16px 48px rgba(0, 0, 0, 0.7);
    --backdrop: rgba(0, 0, 0, 0.7);
  }
}

/* ==========================================================================
   2 Base
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: var(--weight) var(--text)/1.5 var(--font);
  color: var(--ink);
  background: var(--bg);
}

h1, h2, h3 { margin: 0; font-weight: var(--weight-strong); line-height: 1.3; }
h1 { font-size: var(--text-title); }
h2 { margin: var(--space-5) 0 var(--space-2); font-size: var(--text-heading); }
h3 { margin: var(--space-4) 0 var(--space-2); font-size: var(--text); }
p { margin: 0 0 var(--space-2); }
ul { margin: 0 0 var(--space-2); padding-left: var(--space-5); }
strong, b { font-weight: var(--weight-strong); }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code, pre, .mono { font-family: var(--mono); font-size: var(--text-small); }
code { overflow-wrap: anywhere; }

/* A visible ring on everything the keyboard can reach. */
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Said to a screen reader, and not shown. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* An icon is an SVG element the script makes. It takes the colour of the text
   it stands in. */
.icon {
  flex: none;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ==========================================================================
   3 Shell
   Three regions, the same on every page: the top bar, the left rail with its
   foot, and the stage. A page begins with a page header.
   ========================================================================== */

/* ---- The way past the top bar and the rail, for a reader with a keyboard:
   the first stop of the page, in sight only while it has the cursor. */

.skip-link {
  position: fixed;
  top: var(--space-2);
  left: var(--space-2);
  z-index: 40;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--line-field);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-weight: var(--weight-strong);
  transform: translateY(-300%);
}
.skip-link:focus { transform: none; }
/* The page takes the cursor from that link only so that the next Tab starts
   inside it. It is not something to press, so it is drawn no ring. */
main:focus { outline: none; }

/* ---- The top bar: the product, the big categories, the activity line */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--topbar);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
/* What the bar holds stops where the stage stops, so that on a very wide
   window nothing sits at the far edge. */
.topbar-inner {
  display: flex;
  align-items: stretch;
  height: 100%;
  max-width: calc(var(--rail) + var(--stage) + 2 * var(--stage-gutter));
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  width: var(--rail);
  padding: 0 var(--space-5);
  font-size: var(--text-brand);
  font-weight: var(--weight-strong);
  color: var(--ink);
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand::before {
  content: "";
  flex: none;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: var(--accent-solid);
}
.brand:focus-visible { outline-offset: -4px; }

/* The first category stands over the left edge of the page's title. */
.topnav {
  display: flex;
  align-items: stretch;
  gap: var(--space-1);
  padding-left: calc(var(--stage-gutter) - var(--space-3));
}
.topnav a {
  display: flex;
  align-items: center;
  padding: 0 var(--space-3);
  border-bottom: 2px solid transparent;
  color: var(--muted);
  white-space: nowrap;
}
.topnav a:hover { color: var(--ink); text-decoration: none; }
.topnav a.active { border-bottom-color: var(--accent); color: var(--ink); font-weight: var(--weight-strong); }
.topnav a:focus-visible { outline-offset: -4px; }

.activity {
  align-self: center;
  min-width: 0;
  margin-left: auto;
  padding: 0 var(--stage-gutter) 0 var(--space-4);
  overflow: hidden;
  color: var(--muted);
  font-size: var(--text-small);
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---- The rail beside the stage */

.shell {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  align-items: start;
  max-width: calc(var(--rail) + var(--stage) + 2 * var(--stage-gutter));
}

/* The rail is as tall as the window under the top bar, and stays while the
   stage scrolls. Its foot is pinned to the bottom. What stands in it is a
   little lower than the same thing on a page, with small gaps, so that the
   controls, the pages and the foot are all in sight in a short window. */
.rail {
  --control: 32px;
  --control-small: 22px;
  --rail-gap: var(--space-2);
  position: sticky;
  top: var(--topbar);
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--topbar));
  height: calc(100dvh - var(--topbar));
  background: var(--bg-subtle);
  border-right: 1px solid var(--line);
}
/* In a window too short even for that, the body of the rail scrolls under a
   thin bar and the foot stays where it is. */
.rail-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: var(--space-3);
  min-height: 0;
  padding: var(--space-3) var(--space-3) var(--space-2);
  overflow-y: auto;
  scrollbar-width: thin;
}
.rail-title {
  margin: 0 0 var(--space-1);
  padding: 0 var(--space-3);
  color: var(--muted);
  font-size: var(--text-tiny);
  font-weight: var(--weight-strong);
  letter-spacing: 0.08em;
  line-height: 1.5;
  text-transform: uppercase;
}
/* A heading of the rail with a small button at the right end of its line. */
.rail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  min-height: var(--control-small);
  margin: 0 var(--space-3) var(--space-1);
}
.rail-head > .rail-title { margin: 0; padding: 0; }

/* The controls: stacked top to bottom, each under a small label. */
.controls { display: flex; flex-direction: column; }
.controls > .field { gap: 2px; margin: 0 var(--space-3) var(--rail-gap); line-height: 1.35; }
.controls > :last-child { margin-bottom: 0; }
.controls input, .controls select { width: 100%; min-width: 0; }
/* A box that holds a date and a time of day has the rail's full width, and
   is set a size smaller, so that the whole of its value can be read. */
.controls input[type="datetime-local"] { padding: 0 6px; font-size: var(--text-table); }
.field-note { margin-left: var(--space-1); color: var(--muted); font-weight: var(--weight); }

/* The pages of the category on show, the one on show marked. */
.rail-nav { display: flex; flex-direction: column; gap: 2px; }
.rail-nav a {
  position: relative;
  display: flex;
  align-items: center;
  min-height: var(--control);
  padding: 0 var(--space-3);
  border-radius: var(--radius-small);
  color: var(--ink);
  line-height: 1.3;
}
.rail-nav a:hover { background: var(--bg-inset); text-decoration: none; }
.rail-nav a[aria-current="page"] { background: var(--accent-soft); font-weight: var(--weight-strong); }
.rail-nav a[aria-current="page"]::before {
  content: "";
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 0;
  width: 3px;
  border-radius: 3px;
  background: var(--accent);
}

/* A window under about 760px tall: the same things, a little lower again. */
@media (max-height: 760px) {
  .rail { --control: 30px; --rail-gap: 6px; }
  .rail-body { gap: 10px; padding-top: 10px; }
}

/* ---- The foot of the rail: two rows, the organisation, then the person */

.rail-foot {
  display: flex;
  flex: none;
  flex-direction: column;
  gap: 2px;
  padding: 6px var(--space-3) var(--space-2);
  border-top: 1px solid var(--line);
}
/* A square with a letter in it stands for the organisation, a round one for
   the person. */
.mark {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-small);
  background: var(--ink);
  color: var(--bg);
  font-size: var(--text-small);
  font-weight: var(--weight-strong);
  line-height: 1;
}
.mark.round { border: 1px solid var(--line-strong); border-radius: 50%; background: var(--surface); color: var(--ink); }

.foot-org > * {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--control);
  padding: 0 var(--space-2);
  border-radius: var(--radius-small);
  color: var(--ink);
  font-weight: var(--weight-strong);
}
.foot-org .foot-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.foot-org .icon { color: var(--muted); }
.foot-org > a:hover { background: var(--bg-inset); text-decoration: none; }
.foot-org > a:hover .icon { color: var(--ink); }
/* Marked while the pages it leads to are on show. */
.foot-org > a.active { background: var(--accent-soft); }
.foot-org > a.active .icon { color: var(--accent); }

/* The person's row is two lines. The first is a round mark, who it is, and
   at its right end the way out, as a small quiet button. The second says the
   rest, side by side, and has the row's whole width, under the mark and the
   button too: the rail is narrow, and the line is to be read whole. `who`
   and `session` lay nothing out themselves: what each holds is set on the
   row's own grid. Words about a way out that failed stand under the row. */
.foot-person {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 2px var(--space-2);
  padding: 2px var(--space-2) 0;
}
.who, .session { display: contents; }
.who > .mark { grid-area: 1 / 1 / 2 / 2; }
.who-name {
  grid-area: 1 / 2 / 2 / 3;
  overflow: hidden;
  font-weight: var(--weight-strong);
  line-height: 24px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.who-facts {
  display: flex;
  grid-area: 2 / 1 / 3 / 4;
  min-width: 0;
  color: var(--muted);
  font-size: var(--text-small);
  line-height: 16px;
  white-space: nowrap;
}
/* What comes first gives way, with the whole of it on hover; the last, the
   day, is always whole. */
.who-line { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.who-line:last-child { flex: none; }
.who-line + .who-line::before { content: "\00B7"; margin: 0 5px; }
.session > button { grid-area: 1 / 3 / 2 / 4; }
.session-note { grid-area: 3 / 1 / 4 / 4; color: var(--muted); font-size: var(--text-small); line-height: 1.35; }
.session-note:empty { display: none; }

/* ---- The stage: the notices, then the page */

.stage { min-width: 0; padding: var(--space-5) var(--stage-gutter) 64px; }
.notices > * { margin: 0 0 var(--space-3); }

/* Every page begins the same way: its title, one line under it that says
   what is on show, and at the right end of the row its actions. */
.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3) var(--space-5);
  margin: 0 0 var(--space-4);
  padding: 0 0 var(--space-4);
  border-bottom: 1px solid var(--line);
}
.page-heading { flex: 1 1 320px; min-width: 0; }
.page-heading h1 { overflow-wrap: anywhere; }
/* The title takes the cursor when the page changes, so that a reader with a
   keyboard starts at the new page and a screen reader says its name. */
.page-heading h1:focus-visible { outline-offset: 4px; border-radius: 2px; }
.page-heading .lede { margin: var(--space-1) 0 0; }
.page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }

/* A page that keeps a list of records, each with its buttons on its row, is
   held to one reading width: its header and its list both end there. So the
   button in the header stands directly above the buttons on the rows, and on
   a wide window neither is a long way from the names at the left. A page of
   wide tables of figures is not held: it has the whole stage. */
.reading { max-width: var(--reading); }

/* Reading text keeps to a comfortable line. */
.lede { max-width: var(--measure); margin: 0 0 var(--space-3); color: var(--muted); }
.meta { color: var(--muted); font-size: var(--text-small); }
.meta:empty { display: none; }
p.meta { max-width: var(--measure); margin: var(--space-2) 0; }
.footnote { margin-top: var(--space-5); }
/* A page that is one form: one column of a comfortable width. */
.column { max-width: var(--column); }

/* ---- Narrow windows: the rail stacks above the stage */

@media (max-width: 900px) {
  /* The rail is above the stage, so the stage has the window's width. A
     number shown large is a size smaller. */
  :root { --stage-room: calc(100vw - 2 * var(--space-4)); --text-figure: 24px; }
  .topbar { position: static; height: auto; min-height: var(--topbar); }
  .topbar-inner { flex-wrap: wrap; }
  .brand { width: auto; min-height: var(--topbar); padding: 0 var(--space-4); }
  .topnav { min-height: var(--topbar); padding-left: 0; }
  .activity { flex: 1 1 100%; margin: 0; padding: 0 var(--space-4) var(--space-2); }
  .shell { display: block; }
  .rail { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .rail-body { gap: var(--space-4); padding: var(--space-4) var(--space-1); overflow: visible; }
  /* The controls side by side where there is room, and the pages in a row. */
  .controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); align-items: end; gap: var(--space-3) 0; }
  .controls > .rail-head { grid-column: 1 / -1; margin-bottom: 0; }
  .controls > .field { margin-bottom: 0; }
  .rail-nav { flex-direction: row; flex-wrap: wrap; gap: var(--space-1); padding: 0 var(--space-2); }
  .rail-nav .rail-title { flex: 1 1 100%; padding: 0 var(--space-1); }
  .rail-foot { flex-direction: row; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); padding: var(--space-2) var(--space-3); }
  .foot-org { flex: 0 1 auto; min-width: 0; }
  .foot-person { flex: 0 1 auto; min-width: 0; }
  .stage { padding: var(--space-4) var(--space-4) var(--space-7); }
}

/* ==========================================================================
   4 Components
   ========================================================================== */

/* ---- Buttons
   A button with no class is the secondary one: outlined. `primary` is the
   solid one, and a page header or a dialog has at most one. `quiet` has no
   outline until it is pointed at. `danger` is for what takes something out
   of use. `small` is for a button on a row. A link that should look like a
   button takes the class `button`. The outline is the stronger line, the
   one a field has, so that the box of a button can be seen. */

button, input, select, textarea { font: inherit; color: inherit; }

button, a.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--control);
  margin: 0;
  padding: 0 var(--space-3);
  border: 1px solid var(--line-field);
  border-radius: var(--radius);
  background: var(--bg-subtle);
  color: var(--ink);
  font-size: var(--text);
  font-weight: var(--weight-strong);
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
}
a.button:hover { text-decoration: none; }
button:hover:not(:disabled), a.button:hover { background: var(--bg-inset); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

button.primary, a.button.primary { border-color: var(--accent-solid); background: var(--accent-solid); color: var(--on-accent); }
button.primary:hover:not(:disabled), a.button.primary:hover { border-color: var(--accent-solid-hover); background: var(--accent-solid-hover); }

button.quiet, a.button.quiet { border-color: transparent; background: transparent; }
button.quiet:hover:not(:disabled), a.button.quiet:hover { background: var(--bg-inset); }

button.danger { color: var(--bad-ink); }
button.danger:hover:not(:disabled) { border-color: var(--bad-solid); background: var(--bad-solid); color: var(--on-accent); }
button.danger.primary { border-color: var(--bad-solid); background: var(--bad-solid); color: var(--on-accent); }
button.danger.primary:hover:not(:disabled) { border-color: var(--bad-solid-hover); background: var(--bad-solid-hover); }

button.small, a.button.small { min-height: var(--control-small); padding: 0 var(--space-2); border-radius: var(--radius-small); font-size: var(--text-small); }

/* A button that reads as a link: an id that opens what it names. */
button.link {
  display: inline;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: var(--accent);
  font-family: var(--mono);
  font-size: var(--text-small);
  font-weight: var(--weight);
  line-height: inherit;
  white-space: inherit;
}
button.link:hover:not(:disabled) { background: transparent; text-decoration: underline; }

/* The buttons of one row, side by side. */
.row-actions { display: inline-flex; gap: var(--space-2); align-items: center; }

/* ---- Fields */

input, select, textarea {
  max-width: 100%;
  border: 1px solid var(--line-field);
  border-radius: var(--radius-small);
  background: var(--surface);
}
input, select { min-height: var(--control); padding: 0 var(--space-2); }
textarea { display: block; width: 100%; padding: var(--space-2); font: var(--text-small)/1.5 var(--mono); resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: 16px; height: 16px; min-height: 0; margin: 0; padding: 0; accent-color: var(--accent-solid); }
input[type="file"] { padding: var(--space-1); }
/* The button a browser draws inside a file box takes the look of a small
   secondary button, in the light and in the dark. */
input[type="file"]::file-selector-button { min-height: var(--control-small); margin-right: var(--space-2); padding: 0 var(--space-2); border: 1px solid var(--line-field); border-radius: var(--radius-small); background: var(--bg-subtle); color: var(--ink); font-family: inherit; font-size: var(--text-small); font-weight: var(--weight-strong); cursor: pointer; }
input[type="file"]::file-selector-button:hover { background: var(--bg-inset); }
input:disabled, select:disabled, textarea:disabled { opacity: 0.55; cursor: not-allowed; }
/* An example in an empty box is in the quiet colour at its full strength: a
   browser's own fading of it would take it under 4.5 to 1. */
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--focus); outline-offset: 0; }

/* One labelled control: the label, the control, a hint, and the words of a
   refusal that names it. */
.field { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; font-size: var(--text-small); }
.field > span:first-child, .field > label, .field-label, .field-head > label { font-weight: var(--weight-strong); }
/* The label of a control with a small button at the right end of its line. */
.field-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.field-head > button { min-height: 20px; padding: 0 6px; font-size: var(--text-tiny); }
.field input, .field select { width: 100%; font-size: var(--text); }
.field.wide { grid-column: 1 / -1; }
.field .hint, .hint { color: var(--muted); font-size: var(--text-small); font-weight: var(--weight); }
.field.check { flex-direction: row; flex-wrap: wrap; align-items: center; gap: var(--space-2); font-size: var(--text); }
.field.check > span:first-child, .field.check > span { font-weight: var(--weight); }
.field.check input { width: 16px; }
.field.rejected input, .field.rejected select, .field.rejected textarea, fieldset.rejected { border-color: var(--bad-solid); box-shadow: 0 0 0 1px var(--bad-solid); }
.field-reject {
  display: block;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-small);
  background: var(--bad-bg);
  color: var(--bad-ink);
  font: var(--text-small)/1.4 var(--mono);
  font-weight: var(--weight);
  overflow-wrap: anywhere;
}

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--space-3) var(--space-4); }
fieldset { min-width: 0; margin: var(--space-4) 0 0; padding: var(--space-3) var(--space-4) var(--space-4); border: 1px solid var(--line); border-radius: var(--radius); }
legend { padding: 0 var(--space-1); font-size: var(--text-small); font-weight: var(--weight-strong); }
.radio-row { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); }
.radio-row label { display: flex; align-items: center; gap: var(--space-2); }
/* Radio buttons, one to a line, each with its words. */
.choices { display: flex; flex-direction: column; gap: var(--space-2); }
.choices label { display: flex; align-items: flex-start; gap: var(--space-2); }
.choices label input { margin-top: 3px; }
.choices > textarea, .choices > input { margin-top: var(--space-1); }
.choices > span.hint { display: block; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin-top: var(--space-4); }

/* A switch of two or three parts: radio buttons drawn as one control. The
   part that is chosen is told from the others by more than its fill: it has
   a ring in the colour of the text. */
.segmented { display: grid; grid-auto-columns: 1fr; grid-auto-flow: column; gap: 2px; padding: 2px; border: 1px solid var(--line-field); border-radius: var(--radius-small); background: var(--bg-inset); }
.segmented label { position: relative; display: block; cursor: pointer; }
.segmented input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.segmented span { display: block; min-height: calc(var(--control) - 6px); padding: 0 var(--space-2); border-radius: 4px; color: var(--muted); font-size: var(--text-table); font-weight: var(--weight-strong); line-height: calc(var(--control) - 6px); text-align: center; }
.segmented input:checked + span { background: var(--surface); box-shadow: 0 0 0 1px var(--ink); color: var(--ink); }
.segmented input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 1px; }
.segmented input:disabled, .segmented input:disabled + span { cursor: not-allowed; }
.segmented input:disabled + span { opacity: 0.55; }

/* A row of controls above a list: filters, a count, a button. */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin: 0 0 var(--space-3); }
.toolbar label { display: flex; align-items: center; gap: var(--space-2); color: var(--muted); font-size: var(--text-small); font-weight: var(--weight-strong); }
.toolbar input, .toolbar select { font-size: var(--text); font-weight: var(--weight); color: var(--ink); }
.toolbar > .meta { max-width: var(--measure); }

/* ---- Tables
   A table stands in a frame, `wrap`. The frame is as wide as the table needs
   and no wider, so that a row's figures stay near its name on a wide window;
   a small table is still given a fair width. A table wider or taller than
   its place scrolls inside the frame, and its header row stays. */

.wrap {
  width: fit-content;
  min-width: min(100%, 640px);
  max-width: 100%;
  max-height: max(280px, calc(100vh - 240px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.wrap.short { max-height: max(220px, 46vh); }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--text-table); }
th, td { padding: 7px var(--space-2); border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; white-space: nowrap; }
th:first-child, td:first-child { padding-left: var(--space-3); }
th:last-child, td:last-child { padding-right: var(--space-3); }
tbody > tr:last-child > th, tbody > tr:last-child > td { border-bottom: 0; }
tbody + tbody > tr:first-child > th, tbody + tbody > tr:first-child > td { border-top: 1px solid var(--line); }
thead th { position: sticky; top: 0; z-index: 1; background: var(--bg-subtle); color: var(--muted); font-size: var(--text-small); font-weight: var(--weight-strong); border-bottom: 1px solid var(--line); }
tfoot td { position: sticky; bottom: 0; background: var(--bg-subtle); border-top: 1px solid var(--line); border-bottom: 0; font-weight: var(--weight-strong); }
/* The first column stays while a wide table is scrolled sideways, so a row
   can still be told from the next. */
.wrap th:first-child:not([colspan]), .wrap td:first-child:not([colspan]) { position: sticky; left: 0; }
.wrap td:first-child:not([colspan]) { background: var(--surface); }
.wrap thead th:first-child, .wrap tfoot td:first-child { z-index: 2; }
.wrap tfoot td:first-child:not([colspan]) { background: var(--bg-subtle); }
/* The actions of a row are on the row, in its last column. That column is as
   wide as its buttons and no wider: where a table has width to spare, the
   other columns take it. */
th.actions, td.actions { width: 0; }
.wrap th.actions, .wrap td.actions { border-left: 1px solid var(--line); }
.wrap td.actions { background: var(--surface); }
.wrap tfoot td.actions { background: var(--bg-subtle); }
/* On a window about 1300px wide or wider that column stays while a table is
   scrolled sideways, so that a row's buttons are in reach at the far end of
   a wide table. On a narrower window it scrolls with the table, as every
   column does under 900px: a column that stayed there would stand over the
   columns before it and hide them. */
@media (min-width: 1300px) {
  .wrap th.actions, .wrap td.actions { position: sticky; right: 0; }
  .wrap thead th.actions { z-index: 2; }
}
/* A column of numbers: right-aligned, in figures of one width. */
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; }
/* An id or a code. It keeps one line. */
td.mono { font-family: var(--mono); font-size: var(--text-small); }
/* A long id: one line still. Where the table has room it is shown whole.
   Where the table is tight this is the cell that gives way, cut short with
   the whole of it on hover, before the table is made to scroll sideways. */
td.yields { min-width: 18ch; white-space: normal; }
td.yields > span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; line-clamp: 1; overflow: hidden; overflow-wrap: anywhere; }
td.wrapcell { min-width: 22ch; max-width: 60ch; white-space: normal; overflow-wrap: anywhere; }
/* A second line in a cell, quieter than the first. */
.cell-note { display: block; color: var(--muted); font-family: var(--font); font-size: var(--text-small); font-weight: var(--weight); }
/* A cell that is cut short at a width, with the whole of it on hover: a long
   line, a name, a short value. */
td.clip { max-width: 56ch; overflow: hidden; text-overflow: ellipsis; }
td.clip.name { max-width: 30ch; }
td.clip.narrow { max-width: 16ch; }
/* A table of many columns: a heading folds to two lines before the table is
   made to scroll sideways. */
table.tight thead th { white-space: normal; }
td input { min-height: var(--control-small); font-size: var(--text-table); }
td input.num { width: 14ch; text-align: right; font-variant-numeric: tabular-nums; }
td button.small { vertical-align: middle; }
/* A row that can be pressed. With the cursor on it, its ring is drawn on its
   cells, top and bottom on each and a side on the first and the last: an
   outline round the row itself would be painted over by the cells that stay
   while the table is scrolled sideways. */
tr.clickable { cursor: pointer; }
tr.clickable:hover > td { background: var(--bg-subtle); }
tr.clickable:focus-visible { outline: none; }
tr.clickable:focus-visible > td { background: var(--bg-subtle); box-shadow: inset 0 2px 0 var(--focus), inset 0 -2px 0 var(--focus); }
tr.clickable:focus-visible > td:first-child { box-shadow: inset 2px 0 0 var(--focus), inset 0 2px 0 var(--focus), inset 0 -2px 0 var(--focus); }
tr.clickable:focus-visible > td:last-child { box-shadow: inset -2px 0 0 var(--focus), inset 0 2px 0 var(--focus), inset 0 -2px 0 var(--focus); }
tr.clickable:focus-visible > td:only-child { box-shadow: inset 0 0 0 2px var(--focus); }
/* A row that is out of use: shown, quieter. */
tr.quiet > td { color: var(--muted); }
/* The first column and the column of a row's buttons stay while a table is
   scrolled sideways, and take the colour of a row that is pointed at with
   the rest of it. */
.wrap tr.clickable:hover > td, .wrap tr.clickable:focus-visible > td { background: var(--bg-subtle); }

/* ---- A table whose rows open
   One row is one record, with its buttons on the row. Pressed, the row opens
   to show what belongs to the record under it. The frame grows with the rows
   that are open and the page scrolls: a frame that scrolled would put one
   scrolling list inside another. */

/* The table is as wide as its own columns need, with a fair width as its
   least. What is under an open row does not set the width (it is given none
   of its own, below), so the table is the same width with a row open as with
   every row closed. */
.wrap.grows { min-width: min(100%, var(--records)); max-height: none; }
.wrap.grows.wide { min-width: min(100%, var(--records-wide)); }
/* On a page that is held to the reading width (`reading`, in the shell) the
   list fills that width, so that it ends where the page header ends: the
   buttons on its rows stand directly under the button in the header that
   adds to it. It is not stretched across the stage. */
.reading .wrap.grows { width: 100%; }
/* The line between records is drawn above each, so a row that is closed and
   a row that is open end the same way. */
table.records > tbody > tr > td { border-top: 1px solid var(--line); border-bottom: 0; }
table.records > tbody > tr:first-child > td { border-top: 0; }
/* The name of a record is the button that opens its row. The arrowhead
   beside it points down while the row is open. */
button.disclosure {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 0;
  padding: 2px 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  font-size: inherit;
  font-weight: var(--weight-strong);
  line-height: inherit;
  text-align: left;
  white-space: inherit;
}
button.disclosure:hover:not(:disabled) { background: transparent; }
button.disclosure .icon { width: 14px; height: 14px; color: var(--muted); transition: transform 120ms ease; }
button.disclosure[aria-expanded="true"] .icon { transform: rotate(90deg); color: var(--accent); }
@media (prefers-reduced-motion: reduce) {
  button.disclosure .icon { transition: none; }
}
/* An open row and what is under it read as one block, marked at its left
   edge. */
.wrap tr.record.open > td, tr.detail > td { background: var(--bg-subtle); }
tr.record.open > td:first-child, tr.detail > td { box-shadow: inset 3px 0 0 var(--accent); }
table.records > tbody > tr.detail > td { padding: 0; border-top: 0; white-space: normal; }
/* What is under an open row stands under the record's name. Its parts stand
   side by side where there is room, and one under another where there is
   not. It is as wide as the row, or as the frame where the table is wider
   than its frame, and stays in sight while such a table is scrolled
   sideways. */
.detail-body {
  position: sticky;
  left: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--space-4) var(--space-6);
  width: 0;
  min-width: min(100%, calc(var(--stage-room) - 2px));
  padding: var(--space-2) var(--space-4) var(--space-5) calc(var(--space-3) + 14px + var(--space-2));
}
.detail-part { min-width: 0; max-width: 100%; margin: 0; }
/* A line of words under an open row has the row's width to itself, so the
   tables that follow it begin at the left, under the record's name. */
.detail-body > p.detail-part { flex: 0 0 100%; max-width: 100%; margin: 0; }
.detail-part.wide { flex: 1 1 100%; }
.detail-part > .wrap { min-width: 0; }
.detail-part > .meta { margin: 0 0 var(--space-2); }
.detail-part > .wrap + .meta { margin: var(--space-2) 0 0; }
.detail-body .empty { padding: var(--space-3) var(--space-4); background: var(--surface); }

/* A heading with the button that adds to what it heads directly beside it. */
.section-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); min-height: var(--control-small); margin: 0 0 var(--space-2); }
.section-head > h2, .section-head > h3 { margin: 0; }

/* A short table of facts: what a thing is, row by row. A fact that is a
   figure is right-aligned, so that a column of them reads down. */
table.facts { width: auto; max-width: 100%; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table.facts th { padding-right: var(--space-5); color: var(--muted); font-size: var(--text-small); font-weight: var(--weight-strong); vertical-align: top; }
table.facts td { white-space: normal; overflow-wrap: anywhere; }
table.facts td.num { padding-left: var(--space-6); white-space: nowrap; }

/* Two or three parts of a page side by side where there is room, and one
   under another where there is not. */
.side-by-side { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0 var(--space-6); }
.side-by-side > * { min-width: 0; max-width: 100%; }
.side-by-side > * > h2:first-child { margin-top: var(--space-2); }

/* ---- A table read as a report
   Lines in groups, each group under its heading and closed by its totals,
   the way a printed statement is set out. A total is in the stronger weight
   with a rule above its figure, and the last total of a group, or of the
   table, has a double rule under its figure. */

table.report tr.group-head > th { padding-top: var(--space-3); background: var(--bg-subtle); color: var(--ink); font-size: var(--text-table); font-weight: var(--weight-strong); }
/* The lines of a group, and its totals, stand in from its heading. */
table.report tbody.group > tr:not(.group-head) > :first-child { padding-left: var(--space-5); }
table.report tr.subtotal > th, table.report tr.subtotal > td { font-weight: var(--weight-strong); }
table.report tr.subtotal > th { color: var(--ink); }
table.report tr.subtotal.last > td.num, table.report tfoot td.num { border-top: 1px solid var(--ink); border-bottom: 3px double var(--ink); }
table.report tr.subtotal.last > th, table.report tr.subtotal.last > td { padding-bottom: var(--space-2); }
/* A group that has no line of its own still shows its heading and totals. */
table.report tbody.group + tbody.group > tr.group-head > th { border-top: 1px solid var(--line); }

/* ---- Dialogs
   Centred, the page behind dimmed. A title, the form, and at the foot the
   actions, the primary one last. */

dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: var(--space-5);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-large);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-high);
}
dialog.wide { width: min(760px, calc(100vw - 32px)); }
dialog::backdrop { background: var(--backdrop); }
dialog h2 { margin: 0 0 var(--space-3); font-size: var(--text-dialog); }
dialog .field { margin-bottom: var(--space-3); }
dialog .form-grid .field { margin-bottom: 0; }
dialog fieldset { margin: 0 0 var(--space-3); }
dialog .form-grid + fieldset { margin-top: var(--space-3); }
.dialog-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--space-2); margin-top: var(--space-5); padding-top: var(--space-4); border-top: 1px solid var(--line); }
/* Words beside the actions stand at the left, away from the buttons. */
.dialog-actions > .meta { flex: 1 1 12ch; margin-right: auto; }

/* ---- A panel at the side for reading one thing, over the page
   It opens against the right edge of the stage. On a window wider than the
   shell that is not the window's edge: nothing stands at the far edge of a
   wide window, and the panel does not either. */

.drawer {
  position: fixed;
  top: 0;
  right: max(0px, calc(100vw - var(--rail) - var(--stage) - 2 * var(--stage-gutter)));
  bottom: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  width: min(560px, 100vw);
  background: var(--surface);
  border-right: 1px solid var(--line);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow-high);
}
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; overflow-wrap: anywhere; }
.drawer-body { padding: var(--space-3) var(--space-5) var(--space-5); overflow: auto; }
.drawer-body table.facts { width: 100%; }
.drawer pre { margin: var(--space-2) 0 0; padding: var(--space-3); border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-subtle); line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---- Notices
   Each starts with a word that says what it is: the colour only repeats it. */

.error, .warning, .accepted { max-width: var(--measure); padding: 10px var(--space-3); border: 1px solid; border-radius: var(--radius); }
.error { border-color: var(--bad-line); background: var(--bad-bg); color: var(--bad-ink); }
.warning { border-color: var(--warn-line); background: var(--warn-bg); color: var(--warn-ink); }
.accepted { border-color: var(--ok-line); background: var(--ok-bg); color: var(--ok-ink); }
p.error, p.warning, p.accepted { margin: 0 0 var(--space-3); }
.error p, .warning p, .accepted p { margin: 0 0 var(--space-1); }
.error > :last-child, .warning > :last-child, .accepted > :last-child { margin-bottom: 0; }
.error a, .warning a, .accepted a, .error button.link, .warning button.link, .accepted button.link { color: inherit; text-decoration: underline; }
/* A notice that stands directly above a table, or above an empty list. */
.error + .wrap, .warning + .wrap, .accepted + .wrap, .error + .empty, .warning + .empty, .accepted + .empty, .empty + .wrap { margin-top: var(--space-3); }
/* A table inside a notice keeps the page's own colours. */
.error .wrap, .warning .wrap, .accepted .wrap, .error table.facts, .warning table.facts, .accepted table.facts { margin-top: var(--space-2); color: var(--ink); }
/* What a form's send came to, under the form. */
.result { margin-top: var(--space-3); overflow-wrap: anywhere; }
.result:empty { margin-top: 0; }
/* What the last change made in a dialog came to, on the page, above the list
   it changed. */
.page-notices > * { margin: 0 0 var(--space-3); }
.page-notices { overflow-wrap: anywhere; }
.rejects { margin: var(--space-1) 0 0; padding-left: var(--space-5); }
.rejects code { font-weight: var(--weight-strong); }

/* ---- Tags: a word in a small pill. The word carries the meaning. */

.tag { display: inline-block; padding: 0 var(--space-2); border: 1px solid var(--line-strong); border-radius: 999px; color: var(--muted); font-family: var(--font); font-size: var(--text-small); font-weight: var(--weight-strong); line-height: 18px; white-space: nowrap; vertical-align: middle; }
.tag.ok { border-color: var(--ok-line); background: var(--ok-bg); color: var(--ok-ink); }
.tag.warn { border-color: var(--warn-line); background: var(--warn-bg); color: var(--warn-ink); }
.tag.bad { border-color: var(--bad-line); background: var(--bad-bg); color: var(--bad-ink); }
.tag button.link { color: inherit; text-decoration: underline; }

/* ---- An empty list: what the list is for, and the button that fills it */

.empty { max-width: var(--measure); padding: var(--space-5); border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--muted); }
.empty p { margin: 0 0 var(--space-2); }
.empty p:first-child { color: var(--ink); font-weight: var(--weight-strong); }
.empty > :last-child { margin-bottom: 0; }
.empty .empty-action { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); }

/* ---- Cards: one thing in a frame */

.card { min-width: 0; padding: var(--space-4) var(--space-5); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.card > :first-child { margin-top: 0; }

@media (max-width: 900px) {
  .wrap { max-height: 70vh; }
  /* Too narrow for the first column to stay: the whole table scrolls. */
  .wrap th:first-child:not([colspan]), .wrap td:first-child:not([colspan]) { position: static; }
  /* Its heading still stays at the top, and no longer at the side: a heading
     that stayed at the side would stand over the headings beside it. */
  .wrap thead th:first-child { position: sticky; left: auto; }
}

/* ---- Paper
   A printed page is the page alone: no top bar, no rail and no side panel.
   A table is printed whole, however wide or long it is: its frame cuts
   nothing off, nothing stays in place, and a cell folds where it must. */

@media print {
  .skip-link, .topbar, .rail, .drawer { display: none; }
  .shell { display: block; max-width: none; }
  .stage { padding: 0; }
  .reading { max-width: none; }
  .wrap, .wrap.short, .wrap.grows { width: auto; min-width: 0; max-width: none; max-height: none; overflow: visible; }
  th, td, td.mono { white-space: normal; overflow-wrap: anywhere; }
  td.clip, td.clip.name, td.clip.narrow { max-width: none; overflow: visible; }
  td.yields > span { display: inline; }
  thead th, tfoot td, .wrap th:first-child:not([colspan]), .wrap td:first-child:not([colspan]), .wrap th.actions, .wrap td.actions, .detail-body { position: static; }
  .detail-body { width: auto; min-width: 0; }
}

/* ==========================================================================
   5 This application
   What only the accounting screens need.
   ========================================================================== */

/* ---- The pin banner: the books are being read at a close */

.pin-banner { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); max-width: var(--measure); margin: 0 0 var(--space-4); padding: var(--space-2) var(--space-3); border: 1px solid var(--line-strong); border-left: 4px solid var(--accent); border-radius: var(--radius); background: var(--bg-subtle); font-size: var(--text-table); }
.pin-banner .figure-inline { font-variant-numeric: tabular-nums; font-weight: var(--weight-strong); }
.pin-banner > button { margin-left: auto; }

/* ---- In a table: the name that leads a cell, and what follows it */

.lead { font-weight: var(--weight-strong); }
.rest { color: var(--muted); }

/* ---- Journals: one block per journal, its lines under its head */

tbody.journal > tr.journal-head > th { padding-top: var(--space-3); background: var(--bg-subtle); font-weight: var(--weight); white-space: normal; }
.journal-line { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3); }
.journal-line .lead { font-variant-numeric: tabular-nums; }

/* ---- A figure the server computed, shown large */

.figure-card { max-width: var(--column); margin-bottom: var(--space-4); }
.figure-card p { margin: var(--space-1) 0 0; }
.figure-label { color: var(--muted); font-size: var(--text-small); font-weight: var(--weight-strong); }
.figure { font-size: var(--text-figure); font-weight: var(--weight-strong); line-height: 1.3; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.figure small { color: var(--muted); font-size: var(--text); font-weight: var(--weight); }

/* ---- Parts of the command forms */

/* The box a file is pasted into is tall. A box of a few lines in a dialog,
   and the box of a ticket's tags, are as tall as their lines. */
.field textarea { min-height: 12em; }
dialog .field textarea { min-height: 0; }
.field textarea.tags { min-height: 0; }
.id-row { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-2); }
.id-row select { flex: 0 1 auto; max-width: 46%; }
.id-row input { flex: 1 1 auto; min-width: 0; }
.id-row input.qty { flex: 0 1 12ch; }
td input.ccy { width: 7ch; }
fieldset .toolbar { margin: var(--space-2) 0 0; }
.resolve-outcome { margin-top: var(--space-2); }
.resolve-outcome > * { margin: 0 0 var(--space-2); }

/* ---- File intakes: the daily batch and the check-in */

.job-status { max-width: var(--column); padding: var(--space-3) var(--space-4); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius); background: var(--surface); overflow-wrap: anywhere; }
.job-status > p { margin: 0 0 var(--space-2); }
.job-status > :last-child { margin-bottom: 0; }
.job-status .wrap { margin-top: var(--space-2); }
.id-list { display: flex; flex-wrap: wrap; gap: 2px var(--space-3); max-height: 22vh; margin: var(--space-1) 0; padding: var(--space-2); overflow: auto; border: 1px solid var(--ok-line); border-radius: var(--radius-small); }
.file-facts { margin-top: var(--space-3); }
.file-facts > * + * { margin-top: var(--space-2); }
.file-facts table.facts { width: 100%; }
.format { max-width: var(--measure); }
.format li { margin-bottom: var(--space-1); }
pre.example { width: fit-content; max-width: 100%; margin: 0; padding: var(--space-3); overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-subtle); line-height: 1.5; }

/* ---- Access keys */

/* The one box a new key is shown in, and the box of a login subject. */
textarea.secret, textarea.subject { font-size: var(--text-table); line-height: 1.5; word-break: break-all; }
.key-note { margin: var(--space-2) 0 0; font-size: var(--text-table); }

/* ---- The company sign-in: one plain page in place of the screens */

.gate { max-width: 76ch; }
.gate p { margin: 0 0 var(--space-3); }
.gate .error, .gate .warning { margin: 0 0 var(--space-3); }
.gate-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: var(--space-4) 0 var(--space-3); }
