/* Dealer Report Platform: the one stylesheet of the local site.

   Graphite and gold. A black bar and a graphite band frame the work surfaces in both modes;
   the work surfaces are crisp white in light mode and graphite on black in dark mode. Gold
   is the accent that carries hierarchy and action: the active tab, the primary button, the
   mark in front of a heading and the one figure that matters on a screen. It is never body
   text on a light surface.

   Every corner is square. Type is the system sans, Segoe UI first, on one scale:
     11/16 micro label (capitals, tracked)   12/16 caption   13/20 dense text   14/20 text
     16/24 heading   24/32 title   28/32 figure          weights 400, 600 and 700 only
   Space is counted in steps of 4: 4, 8, 12, 16, 24, 32, 48.

   Colors are roles, defined once for light and once for dark. Dark is declared twice: for the
   system setting, and for the choice made with the appearance buttons in the footer, which
   wins both ways. Nothing here is loaded from another computer: no web font, no image.

     bar, band, band-*    the frame, the same in both modes; band-* is what stands on it
     gold, gold-hi        the fill of the accent and its hover; gold-ink is the text on it
     gold-mark            a gold mark on a panel: at least 3:1 on the panel's surface
     gold-line            a gold line that carries a state: at least 3:1 on every work surface
     key                  the block behind the one figure that matters
     edge, rule           the border of a control, and the firm rule of a table or the board
     s1..s6, neg          chart colors: departments in their fixed order, and "takes away"
     deemph, total        the year before, and the printed totals: neutral on purpose
     paper, paper-*       a sheet of a workbook: white with black type in both modes, as Excel
                          shows it, because the workbook's own colors are chosen for white

   The chart colors were chosen with the color-blind check (lightness band, chroma, separation
   for protan and deutan readers and for full vision, 3:1 on the surface) against --surface of
   each mode. Check them again before changing one, or the surface under them. */

:root {
  color-scheme: light;
  --bar: #0a0a09; --band: #171716; --band-line: #33332f; --band-ink: #f4f4f1; --band-ink2: #b3b3ad;
  --band-good: #5cc878; --band-bad: #f0766a;
  --gold: #d4af37; --gold-hi: #e2c358; --gold-ink: #15120a;
  --page: #efefed; --surface: #ffffff; --surface2: #f5f5f3; --field: #ffffff; --key: #171716;
  --line: #e2e2de; --border: #c6c6c1; --edge: #7a7a74; --rule: #1b1b1a;
  --ink: #111110; --ink2: #474742; --muted: #686862;
  --gold-mark: #b0890e; --gold-line: #8f6f08; --focus: #111110;
  --good: #17692e; --bad: #b63230; --on-bad: #ffffff;
  --s1: #b0890e; --s2: #316ca5; --s3: #a54a28; --s4: #219e8f; --s5: #85356e; --s6: #5d822f;
  --neg: #b63230; --deemph: #73736e; --total: #3a3a37; --grid: #e2e2de; --axis: #9c9c96;
  --shade: rgba(10,10,9,0.55);
  --paper: #ffffff; --paper-ink: #000000; --paper-grid: #d6d6d2; --paper-rule: #6b6b66; --paper-mark: #8f6f08;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --bar: #0a0a09; --band: #171716; --band-line: #33332f; --band-ink: #f4f4f1; --band-ink2: #b3b3ad;
    --band-good: #5cc878; --band-bad: #f0766a;
    --gold: #d4af37; --gold-hi: #e2c358; --gold-ink: #15120a;
    --page: #0c0c0b; --surface: #161615; --surface2: #1e1e1c; --field: #0f0f0e; --key: #0a0a09;
    --line: #292927; --border: #363633; --edge: #77776f; --rule: #77776f;
    --ink: #f1f1ee; --ink2: #b8b8b1; --muted: #92928b;
    --gold-mark: #d4af37; --gold-line: #d4af37; --focus: #e2c358;
    --good: #5cc878; --bad: #f0766a; --on-bad: #15120a;
    --s1: #b38f23; --s2: #4475ba; --s3: #ab5039; --s4: #30a798; --s5: #a25492; --s6: #6e9441;
    --neg: #c8414a; --deemph: #6e6e68; --total: #b8b8b1; --grid: #292927; --axis: #5c5c56;
    --shade: rgba(0,0,0,0.7);
    --paper: #ffffff; --paper-ink: #000000; --paper-grid: #d6d6d2; --paper-rule: #6b6b66; --paper-mark: #8f6f08;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bar: #0a0a09; --band: #171716; --band-line: #33332f; --band-ink: #f4f4f1; --band-ink2: #b3b3ad;
  --band-good: #5cc878; --band-bad: #f0766a;
  --gold: #d4af37; --gold-hi: #e2c358; --gold-ink: #15120a;
  --page: #0c0c0b; --surface: #161615; --surface2: #1e1e1c; --field: #0f0f0e; --key: #0a0a09;
  --line: #292927; --border: #363633; --edge: #77776f; --rule: #77776f;
  --ink: #f1f1ee; --ink2: #b8b8b1; --muted: #92928b;
  --gold-mark: #d4af37; --gold-line: #d4af37; --focus: #e2c358;
  --good: #5cc878; --bad: #f0766a; --on-bad: #15120a;
  --s1: #b38f23; --s2: #4475ba; --s3: #ab5039; --s4: #30a798; --s5: #a25492; --s6: #6e9441;
  --neg: #c8414a; --deemph: #6e6e68; --total: #b8b8b1; --grid: #292927; --axis: #5c5c56;
  --shade: rgba(0,0,0,0.7);
  --paper: #ffffff; --paper-ink: #000000; --paper-grid: #d6d6d2; --paper-rule: #6b6b66; --paper-mark: #8f6f08;
}

/* ---- page frame ---- */
*, *::before, *::after { box-sizing: border-box; border-radius: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px; line-height: 20px; font-weight: 400;
  background: var(--page); color: var(--ink); min-height: 100vh; display: flex; flex-direction: column;
  overflow-wrap: anywhere;
}
[hidden] { display: none !important; }
::selection { background: var(--gold); color: var(--gold-ink); }
html { accent-color: var(--gold-line); }
h1, h2, h3, h4 { text-wrap: balance; }
p, li { text-wrap: pretty; }
.wrap { width: 100%; max-width: 1408px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
main { flex: 1 0 auto; width: 100%; padding-bottom: 48px; }
main:focus { outline: none; }
a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--gold-line); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
/* A heading or a region that is only given the focus by the page itself shows no ring. */
[tabindex="-1"]:focus, [tabindex="-1"]:focus-visible { outline: none; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 8px; top: -60px; z-index: 30; font: inherit; font-size: 13px; font-weight: 600;
  padding: 8px 16px; background: var(--gold); color: var(--gold-ink); border: 1px solid var(--gold-ink); cursor: pointer;
}
.skip:focus { top: 8px; outline-color: var(--band-ink); }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: var(--surface2); }
::-webkit-scrollbar-thumb { background: var(--edge); border: 3px solid var(--surface2); }
::-webkit-scrollbar-thumb:hover { background: var(--ink2); }

/* The frame: a black bar, and under it a graphite band that names the screen. Both keep
   their colors in light and in dark mode, so the keyboard ring on them is always gold. */
.top, .band, .foot { --focus: var(--gold-hi); }
.top { background: var(--bar); color: var(--band-ink); border-bottom: 1px solid var(--band-line); }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; min-height: 48px; }
.brand {
  display: inline-flex; align-items: center; gap: 12px; padding: 8px 0; color: var(--band-ink); text-decoration: none;
  font-size: 12px; line-height: 16px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
}
.brand::before { content: ""; flex: none; width: 10px; height: 10px; background: var(--gold); }
.top nav a {
  display: inline-flex; align-items: center; min-height: 28px; padding: 0 12px; border: 1px solid var(--band-line);
  color: var(--band-ink2); text-decoration: none; white-space: nowrap;
  font-size: 11px; line-height: 16px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
}
.top nav a:hover { color: var(--band-ink); border-color: var(--band-ink2); }

.band { background: var(--band); color: var(--band-ink); border-bottom: 1px solid var(--band-line); }
.band > .wrap { padding-top: 24px; padding-bottom: 24px; }
.band.tabbed > .wrap { padding-bottom: 0; }
.band h1 { color: var(--band-ink); }
.band .eyebrow { margin: 0 0 4px; color: var(--band-ink2); }
.band .sub { margin: 8px 0 0; color: var(--band-ink2); max-width: 76ch; }
.band a { color: var(--band-ink); text-decoration-color: var(--gold); }
.band-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.tabs { display: flex; margin: 24px 0 -1px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  flex: none; display: inline-flex; align-items: center; height: 40px; padding: 0 20px; margin-left: -1px;
  border: 1px solid var(--band-line); border-bottom: 0; color: var(--band-ink2); text-decoration: none;
  font-size: 13px; line-height: 16px; font-weight: 600; white-space: nowrap;
}
.tabs a:first-child { margin-left: 0; }
.tabs a:hover { color: var(--band-ink); background: var(--bar); }
.tabs a[aria-current="page"] { background: var(--page); color: var(--ink); box-shadow: inset 0 3px 0 var(--gold); }
.tabs a:focus-visible { outline-offset: -4px; }
.tabs a[aria-current="page"]:focus-visible { outline-color: var(--ink); }
.screen { padding-top: 24px; }
.screen:focus { outline: none; }
.screen > :first-child { margin-top: 0; }

/* ---- type ---- */
h1 { margin: 0; font-size: 24px; line-height: 32px; font-weight: 600; letter-spacing: -0.01em; }
h1:focus, h2:focus { outline: none; }
h2 { margin: 0; font-size: 16px; line-height: 24px; font-weight: 600; }
h3 { margin: 0; font-size: 14px; line-height: 20px; font-weight: 600; }
p { margin: 8px 0 0; }
.eyebrow, .micro { font-size: 11px; line-height: 16px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.sub { margin: 0; color: var(--ink2); max-width: 88ch; }
.note { margin: 4px 0 0; color: var(--ink2); font-size: 13px; line-height: 20px; }
.small { font-size: 12px; line-height: 16px; color: var(--ink2); }
.path { font-family: Consolas, "Cascadia Mono", ui-monospace, "SF Mono", Menlo, "DejaVu Sans Mono", monospace; font-size: 12px; line-height: 16px; }
.loading { color: var(--ink2); margin: 24px 0 0; }
.wrap.loading, .wrap.if-stuck { margin: 24px auto 0; }
/* Shown by the stylesheet alone when the page has not started after a while. */
.if-stuck { color: var(--ink2); visibility: hidden; animation: if-stuck 0s linear 6s forwards; }
@keyframes if-stuck { to { visibility: visible; } }

/* ---- panels ---- */
.card { background: var(--surface); border: 1px solid var(--border); margin: 24px 0 0; min-width: 0; }
figure.card { margin-left: 0; margin-right: 0; }
.card-head {
  display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 24px;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
}
.card-head > div:first-child, .card-head > figcaption { min-width: 0; flex: 1 1 280px; }
.card-head .note { max-width: 96ch; }
/* The gold mark in front of a heading. */
.marked { position: relative; padding-left: 14px; }
.marked::before { content: ""; position: absolute; left: 0; top: 6px; width: 4px; height: 12px; background: var(--gold-mark); }
.sheet-head .marked::before { background: var(--gold); }
.marked + .note { padding-left: 14px; }
.card-body { padding: 16px; min-width: 0; }
.card-body > :first-child { margin-top: 0; }
p.card-body { margin: 0; }
/* Messages of a panel that has no padded body: nothing shows while there is none. */
.card-notes { padding: 0 16px; }
.card-notes > :last-child { margin-bottom: 4px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; }
.cols > * { min-width: 0; }
.cols .card:first-child { margin-top: 0; }
@media (min-width: 1100px) { .cols { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); } }

/* ---- buttons and fields ---- */
.btn {
  font: inherit; font-size: 13px; line-height: 16px; font-weight: 600; min-height: 32px; padding: 7px 14px;
  border: 1px solid var(--edge); background: var(--surface); color: var(--ink);
  cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  white-space: nowrap;
}
.btn:hover { border-color: var(--ink); background: var(--surface2); }
.btn.primary { background: var(--gold); border-color: var(--gold-line); color: var(--gold-ink); }
.btn.primary:hover { background: var(--gold-hi); border-color: var(--gold-line); }
.btn.danger { color: var(--bad); border-color: var(--bad); }
.btn.danger:hover { background: var(--bad); color: var(--on-bad); }
.btn.small { min-height: 28px; padding: 5px 10px; font-size: 12px; }
.btn:active { background: var(--line); }
.btn.primary:active { background: var(--gold-mark); }
.btn.danger:active { background: var(--bad); color: var(--on-bad); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
input[type="text"], input[type="password"], input[type="date"], input[type="month"], select, textarea {
  font: inherit; font-size: 13px; line-height: 18px; color: var(--ink); background: var(--field);
  border: 1px solid var(--edge); padding: 6px 10px; min-height: 32px; width: 100%; max-width: 100%;
}
input::placeholder { color: var(--muted); opacity: 1; }
textarea { min-height: 80px; resize: vertical; display: block; }
select {
  appearance: none; -webkit-appearance: none; padding-right: 28px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: right 14px top 50%, right 9px top 50%; background-size: 5px 5px; background-repeat: no-repeat;
}
/* Where the browser lets the page draw the list of a choice itself, the list is square and in
   the site's colors, with a gold mark at the choice made. Elsewhere the browser's own list shows. */
@supports (appearance: base-select) {
  select, ::picker(select) { appearance: base-select; }
  select { align-items: center; }
  select::picker-icon { display: none; }
  ::picker(select) { margin: 2px 0; padding: 0; border: 1px solid var(--rule); background: var(--surface); color: var(--ink); }
  select option { min-height: 28px; padding: 6px 12px 6px 10px; gap: 8px; font-size: 13px; line-height: 16px; cursor: pointer; }
  select option::checkmark { content: ""; flex: none; width: 6px; height: 6px; background: var(--gold-mark); }
  select option:checked { font-weight: 600; }
  select option:hover { background: var(--surface2); }
  select option:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
}
input:hover, select:hover, textarea:hover { border-color: var(--ink); }
input:disabled, select:disabled, textarea:disabled { opacity: .5; cursor: not-allowed; border-color: var(--edge); }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--bad); box-shadow: inset 0 0 0 1px var(--bad); }
::-webkit-datetime-edit-day-field, ::-webkit-datetime-edit-month-field, ::-webkit-datetime-edit-year-field { border-radius: 0; }
label { font-weight: 600; font-size: 12px; line-height: 16px; }
.field { display: grid; gap: 4px; min-width: 0; align-content: start; }
.field .hint { font-size: 12px; line-height: 16px; color: var(--ink2); }
.field .err { font-size: 12px; line-height: 16px; color: var(--bad); font-weight: 600; }
.field .err:empty { display: none; }
.field .hint:empty { display: none; }
.field .hint.over { color: var(--bad); font-weight: 600; }

/* ---- signs, tags and messages ----
   A sign is drawn here, so it is the same square shape on every computer: an open square
   (nothing yet), a half-filled one (in part), a filled one, a tick and a cross. */
.ico { flex: none; display: inline-block; font-weight: 700; }
.ico.shape { width: 10px; height: 10px; border: 2px solid currentColor; }
.ico.shape.half { background: linear-gradient(90deg, currentColor 50%, transparent 50%); }
.ico.shape.full { background: currentColor; }
.ico.shape.tick { border: 0; width: 12px; position: relative; }
.ico.shape.tick::after {
  content: ""; position: absolute; left: 3px; top: -2px; width: 6px; height: 10px;
  border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.ico.shape.cross {
  border: 0;
  background:
    linear-gradient(45deg, transparent 42%, currentColor 42%, currentColor 58%, transparent 58%),
    linear-gradient(-45deg, transparent 42%, currentColor 42%, currentColor 58%, transparent 58%);
}
.tag {
  display: inline-flex; align-items: center; gap: 6px; min-height: 20px; padding: 1px 6px; border: 1px solid var(--border);
  color: var(--ink2); white-space: nowrap;
  font-size: 11px; line-height: 16px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
}
.tag .ico.shape { width: 8px; height: 8px; }
.tag .ico.shape.tick { width: 10px; }
.tag .ico.shape.tick::after { left: 2px; top: -2px; width: 5px; height: 9px; }
.tag.good .ico { color: var(--good); }
.tag.bad { border-color: var(--bad); color: var(--bad); }
.tag.solid { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.tag.gold { border-color: var(--gold); color: var(--gold); }
.tags { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.state { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); }
.state .ico { color: var(--muted); }
.state.good .ico { color: var(--good); }
.state.bad { color: var(--bad); font-weight: 600; }
.state.bad .ico { color: var(--bad); }

.msg {
  display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; margin: 12px 0 0;
  border: 1px solid var(--border); border-left: 3px solid var(--edge); background: var(--surface);
  font-size: 13px; line-height: 20px;
}
.msg > .ico {
  width: 20px; height: 20px; display: grid; place-items: center; border: 1px solid var(--edge); color: var(--ink2);
  font-size: 12px; line-height: 1;
}
.msg > .ico .ico.shape.tick { color: var(--good); }
.msg .body { min-width: 0; flex: 1 1 auto; }
.msg.bad { border-left-color: var(--bad); }
.msg.bad > .ico { background: var(--bad); border-color: var(--bad); color: var(--on-bad); }
.msg.warn { border-left-color: var(--ink); }
.msg.warn > .ico { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.msg.good { border-left-color: var(--good); }
.msg.good > .ico { border-color: var(--good); }
.msg ul { margin: 4px 0 0; padding-left: 18px; list-style: square; }
.msg .btn { margin-top: 12px; }
.msg .note { font-size: 13px; }
/* A message that is all a screen has to say, with its one way forward, gets room. */
.screen > .msg:only-child { max-width: 760px; padding: 16px 20px 20px; font-size: 14px; }

details > summary {
  cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 8px;
  color: var(--ink2); font-weight: 600; font-size: 13px; line-height: 20px; padding: 2px 0;
}
details > summary::-webkit-details-marker { display: none; }
details > summary::before {
  content: "+"; flex: none; width: 14px; height: 14px; display: grid; place-items: center;
  border: 1px solid var(--edge); color: var(--ink); font-size: 12px; line-height: 1; font-weight: 600;
}
details[open] > summary::before { content: "\2212"; }
details > summary:hover { color: var(--ink); }
details ul { margin: 4px 0 0; padding-left: 40px; list-style: square; }
.plain-list { margin: 8px 0 0; padding-left: 18px; list-style: square; }
.plain-list li { margin: 4px 0; }
.plain-list li::marker, details li::marker, .msg li::marker { color: var(--muted); }

/* ---- the stores: a register, one row per store ---- */
.reg { list-style: none; margin: 0; padding: 0; }
.reg-head, .reg-row {
  display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.25fr) minmax(0, 1.25fr) 368px;
  gap: 8px 24px; padding: 0 16px; align-items: start;
}
.reg-head { padding-top: 8px; padding-bottom: 8px; background: var(--surface2); border-bottom: 1px solid var(--rule); color: var(--ink2); }
.reg-row { padding-top: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.reg-row:last-child { border-bottom: 0; }
.reg-row:hover { background: var(--surface2); }
.reg-name { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.reg-name h2 a { text-decoration: none; }
.reg-name h2 a:hover { text-decoration: underline; text-decoration-color: var(--gold-line); text-decoration-thickness: 2px; }
.reg-row .where { margin: 0; color: var(--ink2); font-size: 13px; line-height: 20px; }
.reg-row .state, .reg-row .setup { font-size: 13px; line-height: 24px; }
/* What is read for the store: one line, or two when a reading failed and earlier months are kept. */
.reg-read { display: grid; justify-items: start; }
.reg-row .setup { margin: 0; color: var(--ink2); }
.reg-row details > summary { line-height: 24px; padding: 0; }
.reg-links { display: flex; flex-wrap: wrap; }
.reg-links a {
  padding: 0 12px; border-left: 1px solid var(--border); text-decoration: none; white-space: nowrap;
  font-size: 13px; line-height: 24px; font-weight: 600;
}
.reg-links a:first-child { padding-left: 0; border-left: 0; }
.reg-links a:hover { text-decoration: underline; text-decoration-color: var(--gold-line); text-decoration-thickness: 2px; }
.reg-tools { margin-top: 8px; }
.delete-confirm { display: grid; gap: 6px; margin-top: 8px; padding: 10px 12px; border: 1px solid var(--bad); border-left-width: 3px; max-width: 420px; }
.delete-confirm .note { margin: 0; }
.delete-confirm label { font-size: 12px; }
.found-list { list-style: none; margin: 4px 0 0; padding: 0; max-height: 240px; overflow: auto; border: 1px solid var(--border); }
.found-list li { border-bottom: 1px solid var(--line); }
.found-list li:last-child { border-bottom: 0; }
.found-list li.none { padding: 8px 12px; color: var(--ink2); font-size: 13px; }
.found-list button { display: grid; gap: 0; width: 100%; padding: 6px 12px; border: 0; background: var(--surface); color: var(--ink); font: inherit; font-size: 13px; line-height: 20px; text-align: left; cursor: pointer; }
.found-list button span { color: var(--ink2); font-size: 12px; line-height: 16px; }
.found-list button span.entity { color: var(--muted); font-size: 11px; }
.found-list button:hover { background: var(--surface2); box-shadow: inset 3px 0 0 var(--gold-mark); }
.found-list button:focus-visible { outline-offset: -2px; }
.reg-row.set-aside h2 a { color: var(--ink2); }
.find-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; }
.find-row .field { flex: 0 1 360px; }
@media (max-width: 1239px) {
  .reg-head { display: none; }
  .reg-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .reg-row > :first-child, .reg-links { grid-column: 1 / -1; }
  .reg { border-top: 2px solid var(--rule); }
}
@media (max-width: 640px) {
  .reg-row { grid-template-columns: minmax(0, 1fr); }
  /* Links that may wrap stand apart by space, not by a rule that would be left hanging. */
  .reg-links { gap: 0 20px; }
  .reg-links a { padding: 0; border-left: 0; text-decoration: underline; }
}

/* ---- statements ---- */
.add-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px 24px; align-items: stretch; }
@media (min-width: 1000px) { .add-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); } }
/* A line about what is going on stands clear of the two ways to add statements above it. */
.add-grid ~ .note { margin-top: 12px; }
/* The drop zone: a frame with four gold corner marks. */
.drop {
  border: 1px solid var(--border); padding: 32px 16px; text-align: center;
  background:
    linear-gradient(var(--gold-line), var(--gold-line)) left top / 16px 2px no-repeat,
    linear-gradient(var(--gold-line), var(--gold-line)) left top / 2px 16px no-repeat,
    linear-gradient(var(--gold-line), var(--gold-line)) right top / 16px 2px no-repeat,
    linear-gradient(var(--gold-line), var(--gold-line)) right top / 2px 16px no-repeat,
    linear-gradient(var(--gold-line), var(--gold-line)) left bottom / 16px 2px no-repeat,
    linear-gradient(var(--gold-line), var(--gold-line)) left bottom / 2px 16px no-repeat,
    linear-gradient(var(--gold-line), var(--gold-line)) right bottom / 16px 2px no-repeat,
    linear-gradient(var(--gold-line), var(--gold-line)) right bottom / 2px 16px no-repeat,
    var(--surface2);
  display: flex; flex-direction: column; justify-content: center;
}
.drop.over { border-color: var(--gold-line); box-shadow: inset 0 0 0 2px var(--gold-line); background: var(--surface); }
.drop .big { font-size: 16px; line-height: 24px; font-weight: 600; margin: 0; }
.drop .note { max-width: 64ch; margin-left: auto; margin-right: auto; }
.drop .row { justify-content: center; margin-top: 16px; }
.folder-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 8px; align-content: center; padding: 16px; border: 1px solid var(--border); }
.folder-form .field { display: contents; }
.folder-form label, .folder-form .hint, .folder-form .err { grid-column: 1 / -1; }
.folder-form label { font-size: 13px; line-height: 20px; margin-bottom: 4px; }
.folder-form input { grid-column: 1; grid-row: 2; }
.folder-form .btn { grid-column: 2; grid-row: 2; }
@media (max-width: 560px) {
  .folder-form { grid-template-columns: minmax(0, 1fr); }
  .folder-form input, .folder-form .btn { grid-column: 1; grid-row: auto; }
  .folder-form .btn { justify-self: start; margin-top: 4px; }
}
.review { margin-top: 16px; border: 1px solid var(--border); border-top: 2px solid var(--rule); padding: 12px 16px 16px; }
.review .row { margin-top: 12px; }
.file-list { list-style: none; margin: 8px 0 0; padding: 0; max-height: 240px; overflow: auto; border: 1px solid var(--border); }
.file-list li { display: flex; justify-content: space-between; gap: 16px; padding: 6px 12px; border-bottom: 1px solid var(--line); }
.file-list li:last-child { border-bottom: 0; }
.file-list .size { color: var(--ink2); white-space: nowrap; font-size: 12px; line-height: 16px; font-variant-numeric: tabular-nums; }
progress { appearance: none; -webkit-appearance: none; width: 100%; height: 10px; border: 1px solid var(--edge); background: var(--surface2); overflow: hidden; display: block; }
progress::-webkit-progress-bar { background: var(--surface2); }
progress::-webkit-progress-value { background: var(--gold-line); }
progress::-moz-progress-bar { background: var(--gold-line); }
/* While the program is still finding the statements among the files, the bar has no value:
   a block on it shows that work is going on, and moves unless motion is to be avoided. */
progress:indeterminate { background: var(--surface2) linear-gradient(var(--gold-line), var(--gold-line)) no-repeat 50% 0 / 30% 100%; }
progress:indeterminate::-webkit-progress-bar, progress:indeterminate::-webkit-progress-value { background: transparent; }
progress:indeterminate::-moz-progress-bar { background: transparent; }
@keyframes looking { from { background-position: -43% 0; } to { background-position: 143% 0; } }
progress + .note { margin-top: 8px; font-variant-numeric: tabular-nums; }
.log { list-style: none; margin: 16px 0 0; padding: 0; max-height: 304px; overflow: auto; border: 1px solid var(--border); border-top: 2px solid var(--rule); }
.log li { display: grid; grid-template-columns: 112px 80px minmax(0, 1fr); gap: 4px 16px; align-items: center; padding: 7px 12px; border-bottom: 1px solid var(--line); font-size: 13px; line-height: 20px; }
.log li:last-child { border-bottom: 0; }
.log li.wide { grid-template-columns: minmax(0, 1fr); color: var(--ink2); }
.log li > .tag { justify-self: start; }
.log .why { grid-column: 1 / -1; color: var(--ink2); }
/* On a phone: the result and the month on one line, the file under them. */
@media (max-width: 560px) {
  .log li { grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; }
  .log li > .path { grid-column: 1 / -1; }
}
.legend-words { margin: 0; padding: 12px 16px; list-style: none; display: grid; gap: 8px; font-size: 12px; line-height: 16px; color: var(--ink2); border-top: 1px solid var(--line); }
.legend-words li { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.file-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 0 24px; align-items: stretch; }

/* The figures of a summary: joined cells, the one that matters in gold on graphite. */
.stats { display: flex; flex-wrap: wrap; gap: 1px; margin: 16px 16px 0; padding: 1px; background: var(--border); width: fit-content; max-width: calc(100% - 32px); }
.stat { display: grid; gap: 0; padding: 8px 16px 10px; background: var(--surface); min-width: 104px; }
.stat b { font-size: 20px; line-height: 28px; font-weight: 600; }
.stat span { display: inline-flex; align-items: center; gap: 6px; color: var(--ink2); }
.stat .ico.shape { width: 8px; height: 8px; }
.stat.good .ico { color: var(--good); }
.stat.bad b, .stat.bad .ico { color: var(--bad); }
.stat.key { background: var(--key); box-shadow: inset 0 3px 0 var(--gold); }
.stat.key b { color: var(--gold); }
.stat.key span { color: var(--band-ink2); }

/* ---- tables: read like a statement ---- */
.table-wrap { overflow-x: auto; }
.table-wrap.ruled { margin-top: 16px; border-top: 1px solid var(--line); }
table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13px; line-height: 20px; font-variant-numeric: tabular-nums; }
th, td { padding: 6px 12px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line); background: var(--surface); }
thead th {
  padding: 8px 12px; background: var(--surface2); color: var(--ink2); border-bottom: 1px solid var(--rule);
  vertical-align: bottom; white-space: normal; overflow-wrap: normal; min-width: 84px;
  font-size: 11px; line-height: 16px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
}
th:first-child, td:first-child { text-align: left; position: sticky; left: 0; padding-left: 16px; }
th:last-child, td:last-child { padding-right: 16px; }
tbody tr:last-child > td { border-bottom: 0; }
tbody tr:hover > td { background: var(--surface2); }
td.neg { color: var(--bad); }
tr.before-total > td { border-bottom-color: var(--rule); }
tr.total > td { font-weight: 600; }
tbody tr.total:last-child > td { border-bottom: 3px double var(--rule); }
tr.year-start > td { border-top: 1px solid var(--edge); }
table.words th, table.words td { text-align: left; }
table.words td.path { white-space: normal; min-width: 300px; color: var(--ink2); }
thead th.long { min-width: 136px; }
/* In a table that scrolls sideways anyway, a path on one line keeps every row the same height.
   A break that is offered inside a path would still be taken there, so it is not offered. */
@media (max-width: 900px) { table.words td.path { white-space: nowrap; } table.words td.path wbr { display: none; } }
table.fit td:first-child { white-space: normal; min-width: 150px; }
table.fit thead th { min-width: 0; }
tr.fails > td, tbody tr.fails:hover > td { background: var(--surface); white-space: normal; padding: 0; position: static; }
.fail-box { position: sticky; left: 0; width: max-content; max-width: min(100%, calc(100vw - 64px)); margin: 0 16px 12px; padding: 12px 16px 16px; border: 1px solid var(--border); border-left: 3px solid var(--bad); }
.fail-box strong { color: var(--bad); }
.fail-box ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.fail-box li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 32px; align-items: start; padding-top: 8px; border-top: 1px solid var(--line); }
.fail-where { display: grid; gap: 2px; }
.fail-where span { color: var(--ink2); }
.fail-box dl { margin: 0; display: grid; grid-template-columns: repeat(3, auto); gap: 2px 24px; }
.fail-box dl div { display: grid; justify-items: end; }
.fail-box dt { color: var(--ink2); font-size: 11px; line-height: 16px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.fail-box dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) { .fail-box li { grid-template-columns: minmax(0, 1fr); } .fail-box dl div { justify-items: start; } }
.check { display: inline-flex; gap: 8px; align-items: center; white-space: nowrap; color: var(--ink2); }
.check .ico { color: var(--muted); }
.check.good { color: var(--ink); }
.check.good .ico { color: var(--good); }
.check.bad { color: var(--bad); font-weight: 600; white-space: normal; min-width: 130px; }
.check.bad .ico { color: var(--bad); }

/* ---- results: tiles, the dashboard grid, charts ---- */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; padding: 1px; background: var(--border); margin-top: 24px; }
@media (max-width: 900px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 340px) { .tiles { grid-template-columns: minmax(0, 1fr); } }
.tile { background: var(--surface); padding: 12px 16px 16px; min-width: 0; display: grid; grid-template-rows: subgrid; grid-row: span 5; align-content: start; }
.tile .label { color: var(--ink2); }
.tile .period { font-size: 12px; line-height: 16px; color: var(--muted); }
.tile .value { font-size: 28px; line-height: 32px; font-weight: 600; letter-spacing: -0.01em; margin-top: 8px; }
.tile .delta { font-size: 12px; line-height: 16px; margin-top: 4px; color: var(--ink2); min-height: 16px; }
.tile .delta b { font-weight: 600; white-space: nowrap; }
.tile .delta .up-good, .tile .delta .down-good { color: var(--good); }
.tile .delta .up-bad, .tile .delta .down-bad { color: var(--bad); }
.arrow { display: inline-block; width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; margin-right: 4px; }
.arrow.up { border-bottom: 7px solid currentColor; }
.arrow.down { border-top: 7px solid currentColor; }
.tile .src { font-size: 11px; line-height: 16px; color: var(--muted); margin-top: 8px; }
.tile.key { background: var(--key); color: var(--band-ink); box-shadow: inset 0 3px 0 var(--gold); }
.tile.key .label, .tile.key .period, .tile.key .delta, .tile.key .src { color: var(--band-ink2); }
.tile.key .value { color: var(--gold); }
.tile.key .delta .up-good, .tile.key .delta .down-good { color: var(--band-good); }
.tile.key .delta .up-bad, .tile.key .delta .down-bad { color: var(--band-bad); }
.tile.alert .value { color: var(--bad); }
.tile.flag { box-shadow: inset 3px 0 0 var(--ink); }
.tile.alert { box-shadow: inset 3px 0 0 var(--bad); }
/* The board's summary: three counts, and the open annual upside from its low to its high end. */
.tiles.counts { grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 2.4fr); }
.tiles.counts .tile { grid-row: span 2; }
.tiles.counts .range { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 12px; margin-top: 8px; }
.tiles.counts .range .value { margin-top: 0; }
.tiles.counts .range .to { color: var(--band-ink2); }
.tiles.counts .range div { display: grid; }
.tiles.counts .range small { color: var(--band-ink2); }
@media (max-width: 900px) {
  .tiles.counts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tiles.counts .tile.key { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .tile { padding: 8px 12px 12px; }
  .tile .value { font-size: 24px; }
}

.dash { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px; margin-top: 24px; align-items: stretch; }
.dash > * { grid-column: 1 / -1; margin: 0; min-width: 0; }
@media (min-width: 1240px) {
  .dash > .w8 { grid-column: span 8; }
  .dash > .w7 { grid-column: span 7; }
  .dash > .w6 { grid-column: span 6; }
  .dash > .w5 { grid-column: span 5; }
  /* The checks come first for a reader, and sit beside the first chart on a wide screen. */
  .dash > .side { grid-column: 9 / -1; grid-row: 1; }
  .dash > .side + .w8 { grid-column: 1 / 9; grid-row: 1; }
}
.checks { list-style: none; margin: 0; padding: 0; }
.checks li { display: grid; grid-template-columns: 12px minmax(0, 1fr); gap: 12px; align-items: start; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 13px; line-height: 20px; }
.checks li:last-child { border-bottom: 0; }
.checks .ico { margin-top: 5px; }
.checks .ok .ico { color: var(--good); }
.checks .todo { color: var(--ink2); }
.checks .todo .ico { color: var(--muted); }
.checks .warn { color: var(--bad); font-weight: 600; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0 0 12px; font-size: 12px; line-height: 16px; color: var(--ink2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; }
.legend i.line { height: 0; width: 14px; border-top: 2px solid; }
.plot { position: relative; width: 100%; }
.plot svg { display: block; width: 100%; height: auto; overflow: visible; }
.plot svg text { font-family: inherit; fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.plot svg text.strong { fill: var(--ink); font-size: 12px; font-weight: 600; }
.plot svg text.lbl { fill: var(--ink2); font-size: 12px; }
.plot svg text.halo { paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: bevel; }
.plot svg:focus-visible, .plot svg rect:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sources { color: var(--ink2); font-size: 13px; line-height: 20px; }
.sources ul { margin: 0; padding-left: 18px; list-style: square; max-width: 120ch; }
.sources li { margin: 0 0 8px; }
.sources li:last-child { margin-bottom: 0; }
.sources li::marker { color: var(--muted); }
#tip {
  position: fixed; z-index: 40; pointer-events: none; display: none; background: var(--surface); color: var(--ink);
  border: 1px solid var(--rule); padding: 8px 12px; font-size: 12px; line-height: 16px;
  min-width: 160px; max-width: 280px;
}
#tip.on { display: block; }
#tip .t { margin-bottom: 4px; color: var(--ink2); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
#tip .r { display: flex; align-items: center; gap: 12px; justify-content: space-between; padding: 2px 0; }
#tip .r span.k { display: inline-flex; align-items: center; gap: 6px; color: var(--ink2); }
#tip .r span.k i { display: inline-block; width: 8px; height: 8px; }
#tip .r b { font-variant-numeric: tabular-nums; font-weight: 600; }
#tip .sum { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 6px; }

/* ---- the Kanban board: five ruled columns ---- */
.board-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 24px; }
.board-head > div:first-child { min-width: 0; flex: 1 1 320px; }
.board { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: stretch; margin-top: 24px; border: 1px solid var(--border); border-top: 2px solid var(--rule); background: var(--surface2); }
.board[aria-busy="true"] { opacity: .6; pointer-events: none; }
@media (max-width: 1180px) { .board { grid-template-columns: repeat(5, minmax(232px, 1fr)); overflow-x: auto; } }
@media (max-width: 760px) { .board { grid-template-columns: minmax(0, 1fr); overflow-x: visible; } }
.col { min-width: 0; border-left: 1px solid var(--border); }
.col:first-child { border-left: 0; }
@media (max-width: 760px) { .col { border-left: 0; border-top: 1px solid var(--border); } .col:first-child { border-top: 0; } }
.col.over { outline: 2px solid var(--gold-line); outline-offset: -2px; background: var(--surface); }
.col-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 40px; padding: 8px 12px; background: var(--surface); border-bottom: 1px solid var(--border); }
.col-head h3 { font-size: 11px; line-height: 16px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.col-head .n { min-width: 24px; padding: 0 6px; border: 1px solid var(--edge); text-align: center; color: var(--ink); font-size: 12px; line-height: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.col .cards { list-style: none; margin: 0; padding: 8px; display: grid; gap: 8px; align-content: start; }
.col .cards:empty { display: none; }
.col .none { margin: 12px; font-size: 12px; line-height: 16px; color: var(--muted); }
.kcard { background: var(--surface); border: 1px solid var(--border); padding: 10px 12px 12px; display: grid; gap: 6px; min-width: 0; }
.kcard[draggable="true"] { cursor: grab; }
.kcard:hover { border-color: var(--edge); }
.kcard.dragging { opacity: .45; }
.kcard.blocked { box-shadow: inset 3px 0 0 var(--ink); }
.kcard.late { box-shadow: inset 3px 0 0 var(--bad); }
.kcard.finished { background: var(--surface2); }
.kcard.finished .k-title, .kcard.finished .k-line { color: var(--ink2); }
.kcard .k-title { font-size: 14px; line-height: 20px; font-weight: 600; margin: 2px 0 0; }
.kcard .k-line { margin: 0; font-size: 13px; line-height: 20px; color: var(--ink); font-variant-numeric: tabular-nums; }
/* The parts of a line stand side by side with a rule between them. A part that goes to the next
   line starts at the edge: its rule falls outside the line, where it is cut off. */
.kcard .k-parts { display: flex; flex-wrap: wrap; column-gap: 13px; overflow: hidden; position: relative; }
.kcard .k-parts .part { margin-left: -7px; padding-left: 7px; background: linear-gradient(var(--edge), var(--edge)) left 50% / 1px 12px no-repeat; }
.kcard .k-owner { color: var(--ink2); font-size: 12px; line-height: 16px; }
.kcard .k-owner.overdue { color: var(--bad); font-weight: 600; }
.kcard .k-action { color: var(--ink2); padding-top: 6px; border-top: 1px solid var(--line); }
.kcard .k-tools { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; margin-top: 2px; }
.kcard .k-move { color: var(--ink2); display: grid; gap: 2px; min-width: 0; }
.kcard .k-tools select { min-height: 28px; padding-top: 4px; padding-bottom: 4px; font-size: 12px; line-height: 18px; }
.board-note { margin-top: 16px; padding: 0; border-top: 0; max-width: 120ch; }
.board-note li { align-items: baseline; flex-wrap: nowrap; }
.board-note li::before { content: ""; flex: none; width: 4px; height: 4px; background: var(--muted); transform: translateY(-3px); }

/* ---- the card form ---- */
dialog.sheet {
  border: 1px solid var(--rule); background: var(--surface); color: var(--ink);
  padding: 0; width: min(760px, calc(100vw - 24px)); max-height: calc(100vh - 24px);
}
dialog.sheet::backdrop { background: var(--shade); }
.sheet form { display: flex; flex-direction: column; max-height: calc(100vh - 26px); }
.sheet-head { padding: 16px 24px; background: var(--band); color: var(--band-ink); border-bottom: 1px solid var(--band-line); }
.sheet-head .note { color: var(--band-ink2); }
.sheet-body { padding: 20px 24px 24px; overflow: auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; }
.sheet-body .full { grid-column: 1 / -1; }
.sheet-body .full:empty { display: none; }
.sheet-body .full > .msg { margin-top: 0; }
.sheet-body .trio { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 24px; }
@media (max-width: 620px) { .sheet-body, .sheet-body .trio { grid-template-columns: minmax(0, 1fr); } .sheet-body { padding: 16px; } .sheet-head { padding: 12px 16px; } }
.sheet-foot { padding: 12px 24px; border-top: 1px solid var(--border); background: var(--surface2); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sheet-foot .spacer { flex: 1 1 auto; }
@media (max-width: 620px) { .sheet-foot { padding: 12px 16px; } }

/* ---- reports ---- */
.report-list { list-style: none; margin: 0; padding: 0; }
.report-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.report-list li:last-child { border-bottom: 0; }
.report-list .what { min-width: 0; flex: 1 1 280px; }
.report-list .what strong { font-weight: 600; }
.report-list .what .note { margin-top: 0; display: flex; flex-wrap: wrap; gap: 0 16px; }
/* A report that can be made: its form, then what was made of it so far, newest first. */
.report .make { padding: 16px; border-bottom: 1px solid var(--line); }
.make-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 280px)); gap: 16px 24px; margin-bottom: 16px; }
.make-fields .full { grid-column: 1 / -1; max-width: 584px; }
.field .needed { font-weight: 400; color: var(--ink2); }
.make-progress { margin-top: 12px; max-width: 584px; }
.make-notes > .msg { max-width: 760px; }
.made-head { margin: 0; padding: 8px 16px; background: var(--surface2); color: var(--ink2); border-bottom: 1px solid var(--rule); }
.report .none-made { color: var(--ink2); }
.made-title { font-weight: 600; text-decoration: none; }
.made-title:hover { text-decoration: underline; text-decoration-color: var(--gold-line); text-decoration-thickness: 2px; }
.made-notes { margin-top: 4px; color: var(--ink2); font-size: 13px; line-height: 20px; }

/* ---- a workbook on the screen ----
   The frame follows light and dark. The sheet itself is paper: white with black type and the
   workbook's own colors in both modes. Column letters and row numbers stay in view; so do the
   rows and columns the workbook freezes. A line a cell asks for is drawn on its lower or right
   edge, which it shares with the next cell; the heavier of the two wins. */
.screen.wide { max-width: none; }
.book { display: flex; flex-direction: column; min-width: 0; background: var(--surface); border: 1px solid var(--border); border-top: 2px solid var(--rule); }
.book-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 10px 16px; }
.book-title { flex: 1 1 320px; min-width: 0; }
.book-title .note { margin-top: 0; display: flex; flex-wrap: wrap; gap: 0 16px; }
.book-notes .msg { margin: 0 16px 12px; }
.cellbar { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--surface2); font-size: 13px; line-height: 20px; }
.cellbar > span { padding: 5px 12px; min-height: 30px; }
.cell-name { text-align: center; font-weight: 600; border-right: 1px solid var(--border); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cell-text { min-width: 0; background: var(--field); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell-kind { border-left: 1px solid var(--border); color: var(--ink2); font-size: 12px; white-space: nowrap; }
.cell-kind:empty { display: none; }
.grid { flex: 1 1 0; min-height: 0; overflow: auto; background: var(--surface2); }
.grid:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.grid > .loading, .grid > .msg { margin: 16px; }
table.cells { width: auto; table-layout: fixed; font-variant-numeric: normal; background: var(--paper); }
table.cells th {
  min-width: 0; padding: 0 2px; background: var(--surface2); color: var(--ink2);
  border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
  font-size: 11px; line-height: 16px; font-weight: 600; letter-spacing: 0; text-transform: none;
  text-align: center; vertical-align: middle; white-space: nowrap; overflow: hidden;
}
table.cells thead th { position: sticky; top: 0; z-index: 4; height: 22px; border-bottom-color: var(--edge); }
table.cells thead th.corner { left: 0; z-index: 6; border-right-color: var(--edge); }
table.cells thead th.fx { z-index: 5; }
table.cells tbody th { position: sticky; left: 0; z-index: 4; font-weight: 400; border-right-color: var(--edge); }
table.cells tbody th.fy { z-index: 5; }
table.cells th.on { background: var(--gold); color: var(--gold-ink); font-weight: 600; }
table.cells tbody tr > td {
  position: static; padding: 0 3px; background: var(--paper); color: var(--paper-ink);
  border: 0 solid var(--paper-ink); border-right: 1px solid var(--paper-grid); border-bottom: 1px solid var(--paper-grid);
  font-family: Calibri, Carlito, "Segoe UI", Arial, sans-serif; font-size: 14.667px; line-height: 1.2; font-weight: 400;
  text-align: left; vertical-align: bottom; white-space: pre; overflow: hidden; cursor: cell;
}
table.cells tbody tr > td.ar { text-align: right; }
table.cells tbody tr > td.ac { text-align: center; }
table.cells tbody tr > td.vt { vertical-align: top; }
table.cells tbody tr > td.vm { vertical-align: middle; }
table.cells td .box { overflow: hidden; }
table.cells td .box.wr { white-space: pre-wrap; overflow-wrap: anywhere; }
/* The lines a workbook draws: dotted, dashed, thin, medium, double and thick, on each side. */
table.cells tbody tr > td.bb1 { border-bottom: 1px dotted var(--paper-ink); }
table.cells tbody tr > td.bb2 { border-bottom: 1px dashed var(--paper-ink); }
table.cells tbody tr > td.bb3 { border-bottom: 1px solid var(--paper-ink); }
table.cells tbody tr > td.bb4 { border-bottom: 2px solid var(--paper-ink); }
table.cells tbody tr > td.bb5 { border-bottom: 3px double var(--paper-ink); }
table.cells tbody tr > td.bb6 { border-bottom: 3px solid var(--paper-ink); }
table.cells tbody tr > td.br1 { border-right: 1px dotted var(--paper-ink); }
table.cells tbody tr > td.br2 { border-right: 1px dashed var(--paper-ink); }
table.cells tbody tr > td.br3 { border-right: 1px solid var(--paper-ink); }
table.cells tbody tr > td.br4 { border-right: 2px solid var(--paper-ink); }
table.cells tbody tr > td.br5 { border-right: 3px double var(--paper-ink); }
table.cells tbody tr > td.br6 { border-right: 3px solid var(--paper-ink); }
table.cells tbody tr > td.bt1 { border-top: 1px dotted var(--paper-ink); }
table.cells tbody tr > td.bt2 { border-top: 1px dashed var(--paper-ink); }
table.cells tbody tr > td.bt3 { border-top: 1px solid var(--paper-ink); }
table.cells tbody tr > td.bt4 { border-top: 2px solid var(--paper-ink); }
table.cells tbody tr > td.bt5 { border-top: 3px double var(--paper-ink); }
table.cells tbody tr > td.bt6 { border-top: 3px solid var(--paper-ink); }
table.cells tbody tr > td.bl1 { border-left: 1px dotted var(--paper-ink); }
table.cells tbody tr > td.bl2 { border-left: 1px dashed var(--paper-ink); }
table.cells tbody tr > td.bl3 { border-left: 1px solid var(--paper-ink); }
table.cells tbody tr > td.bl4 { border-left: 2px solid var(--paper-ink); }
table.cells tbody tr > td.bl5 { border-left: 3px double var(--paper-ink); }
table.cells tbody tr > td.bl6 { border-left: 3px solid var(--paper-ink); }
/* Frozen panes: above what scrolls under them, with a firm line where they end. */
table.cells tbody tr > td.fx { position: sticky; z-index: 1; }
table.cells tbody tr > td.fy { position: sticky; z-index: 2; }
table.cells tbody tr > td.fx.fy { z-index: 3; }
table.cells .fx-end { box-shadow: inset -1px 0 0 var(--paper-rule); }
table.cells .fy-end { box-shadow: inset 0 -1px 0 var(--paper-rule); }
table.cells .fx-end.fy-end { box-shadow: inset -1px 0 0 var(--paper-rule), inset 0 -1px 0 var(--paper-rule); }
/* The chosen cell: a gold frame with a white line inside it, so it shows on any fill. */
table.cells tbody tr > td.on { outline: 2px solid var(--paper-mark); outline-offset: -2px; box-shadow: inset 0 0 0 3px var(--paper); }
/* The place of rows that are not read yet. */
table.cells tbody tr.wait > td { padding: 0; background: var(--surface2); color: var(--ink2); border: 0; font: inherit; font-size: 12px; line-height: 16px; vertical-align: top; cursor: default; }
.wait-words { position: sticky; left: 16px; display: inline-block; padding: 12px 0; }
.sheet-tabs { display: flex; align-items: stretch; min-height: 36px; border-top: 1px solid var(--border); background: var(--surface2); }
.sheet-names { display: flex; min-width: 0; overflow-x: auto; scrollbar-width: thin; }
.sheet-names button {
  flex: none; font: inherit; font-size: 13px; line-height: 16px; font-weight: 600; min-height: 36px; padding: 0 16px;
  border: 0; border-right: 1px solid var(--border); background: transparent; color: var(--ink2); cursor: pointer; white-space: nowrap;
}
.sheet-names button:hover { background: var(--surface); color: var(--ink); }
.sheet-names button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: inset 0 -3px 0 var(--gold-mark); }
.sheet-names button:focus-visible { outline-offset: -3px; }
.sheet-size { margin-left: auto; align-self: center; padding: 0 16px; color: var(--ink2); font-size: 12px; line-height: 16px; white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) {
  .sheet-size { display: none; }
  .cellbar { grid-template-columns: 56px minmax(0, 1fr); }
  .cell-kind { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--border); min-height: 0; }
}

/* ---- footer: the lower edge of the frame ---- */
.foot { background: var(--band); color: var(--band-ink2); border-top: 1px solid var(--band-line); font-size: 12px; line-height: 16px; }
.foot-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px 48px; align-items: start; padding-top: 24px; padding-bottom: 32px; }
.foot p { margin: 0; }
.foot .local { position: relative; padding-left: 14px; color: var(--band-ink); font-size: 13px; line-height: 20px; font-weight: 600; max-width: 88ch; }
.foot .local::before { content: ""; position: absolute; left: 0; top: 4px; width: 4px; height: 12px; background: var(--gold); }
#foot-features { display: grid; gap: 4px; margin-top: 12px; padding-left: 14px; max-width: 110ch; }
#foot-features p { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 0 16px; }
#foot-features .micro { color: var(--band-ink); }
.foot .appearance { display: grid; gap: 8px; justify-items: start; }
.seg { display: flex; flex-wrap: wrap; }
.seg button {
  font: inherit; font-size: 12px; line-height: 16px; font-weight: 600; min-height: 32px; padding: 7px 12px; margin-left: -1px;
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; cursor: pointer;
  background: transparent; color: var(--band-ink2); border: 1px solid var(--band-line);
}
.seg button:first-child { margin-left: 0; }
.seg button:hover { color: var(--band-ink); background: var(--bar); }
.seg button[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); position: relative; }
.seg button[aria-pressed="true"]::before { content: ""; flex: none; width: 6px; height: 6px; background: currentColor; }
.seg button:focus-visible { position: relative; z-index: 1; }

/* ---- sign-in, and who is signed in (only when the site asks for sign-in) ---- */
.sign-in { max-width: 440px; }
.sign-in-form { display: grid; gap: 16px; }
.sign-in-form .err { margin: 0; font-size: 13px; line-height: 20px; color: var(--bad); font-weight: 600; }
.sign-in-form .err:empty { display: none; }
.foot .account { display: grid; gap: 8px; justify-items: start; margin-top: 16px; padding-left: 14px; }
.foot .account[hidden] { display: none; }
.foot .account form { display: grid; gap: 8px; max-width: 320px; }
.foot .account label { color: var(--band-ink); }
.foot .account .err { color: var(--band-ink); font-weight: 600; }
.foot .account .err:empty { display: none; }

@media (max-width: 860px) {
  .foot-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
  h1 { font-size: 20px; line-height: 28px; }
  .band > .wrap { padding-top: 16px; padding-bottom: 16px; }
  .tabs { margin-top: 16px; }
  .tabs a { padding: 0 12px; }
  .brand { letter-spacing: .1em; gap: 8px; }
  #foot-features p { grid-template-columns: minmax(0, 1fr); }
  .btn { min-height: 36px; }
  .btn.small { min-height: 32px; }
}
/* An iPhone zooms in when a field with type smaller than 16px is tapped; only it gets the larger type. */
@supports (-webkit-touch-callout: none) {
  input[type="text"], input[type="password"], input[type="date"], input[type="month"], select, textarea, .kcard .k-tools select { font-size: 16px; line-height: 20px; }
}
@media (prefers-reduced-motion: no-preference) {
  .btn, .tabs a, .seg button, .top nav a, .kcard, .sheet-names button { transition: background-color .12s ease, border-color .12s ease, color .12s ease; }
  progress:indeterminate { animation: looking 1.6s ease-in-out infinite; }
}

/* ---- personnel: figures against benchmarks, pay plans ---- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 24px; margin: 12px 0; }
td.wrap, th.wrap { white-space: normal; text-align: left; min-width: 180px; max-width: 420px; }
td.wrap details { margin-top: 4px; }
.bench + .bench { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.strong { font-weight: 600; }
table.plan-roles input.short { width: 7em; }
table.plan-roles input.wide { width: 14em; }
table.plan-roles td { text-align: left; }
pre.example { margin: 4px 0 12px; padding: 8px 12px; overflow-x: auto; background: var(--surface2); border: 1px solid var(--line); color: var(--ink); font-size: 12px; line-height: 18px; }

/* ---- a customer's first sign-in ---- */
.setup-step { margin: 0; font-size: 15px; line-height: 22px; }
.setup-line { margin: 0; font-size: 14px; line-height: 22px; }
.setup-key { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 15px; letter-spacing: 0.04em; word-break: break-all; user-select: all; }
