/*
 * Saldoscope, the whole stylesheet.
 *
 * A file and not a style attribute, because the content security policy forbids inline style
 * and that is worth keeping: the screens show somebody's whole financial position, and the
 * cheapest defence against an injected fragment doing anything is a policy that allows nothing
 * from anywhere else.
 *
 * Deliberately plain. This is a tool somebody reads figures in, so what matters is that a
 * column of numbers lines up, that an unfinished row is obvious, and that it survives being
 * printed.
 */

:root {
    color-scheme: light dark;
    --ink: #16191d;
    --ink-soft: #565d66;
    --paper: #fbfbfa;
    --panel: #ffffff;
    --line: #d9dce1;
    --accent: #1c5d99;
    --warn-ink: #6b4b00;
    --warn-bg: #fff5d6;
    --error-ink: #8a1c1c;
    --error-bg: #fdecec;
    --ok-ink: #1c5f36;
    --ok-bg: #e9f6ed;
}

@media (prefers-color-scheme: dark) {
    :root {
        --ink: #e8eaed;
        --ink-soft: #a3abb5;
        --paper: #161a1f;
        --panel: #1d2228;
        --line: #333a43;
        --accent: #7fb2e0;
        --warn-ink: #f0d79a;
        --warn-bg: #3a2f13;
        --error-ink: #f3b5b5;
        --error-bg: #3a1c1c;
        --ok-ink: #a9dcbd;
        --ok-bg: #17301f;
    }
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.bar {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--panel);
    border-bottom: 1px solid var(--line);
}

.brand {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--ink);
    text-decoration: none;
}

.bar nav { display: flex; gap: 1rem; }
.bar nav a { color: var(--accent); text-decoration: none; }
.bar nav a:hover { text-decoration: underline; }
.bar .signout { margin-left: auto; }

.bar .signout button {
    background: none;
    border: 1px solid var(--line);
    color: var(--ink-soft);
    padding: 0.3rem 0.7rem;
    border-radius: 4px;
    cursor: pointer;
    font: inherit;
    font-size: 0.9rem;
}

/* The whole width of the window. The owner asked for it on 2026-11-13: a year of months is wider
 * than any fixed column, and every centimetre the page leaves empty is a month scrolled away.
 * Running text keeps its own measure through `.intro` and `.hint`. */
main {
    max-width: none;
    margin: 0;
    padding: 1rem clamp(0.75rem, 2vw, 2rem) 1.5rem;
}

h1 { font-size: 1.5rem; margin: 0 0 0.75rem; }
h2 { font-size: 1.15rem; margin: 1.75rem 0 0.5rem; }

.intro, .hint {
    color: var(--ink-soft);
    max-width: 46rem;
}

.hint { display: block; font-size: 0.875rem; margin-top: 0.25rem; }

.flash, .error, .warn, .ok {
    padding: 0.6rem 0.9rem;
    border-radius: 4px;
    border: 1px solid transparent;
}

.flash, .ok { background: var(--ok-bg); color: var(--ok-ink); }
.error { background: var(--error-bg); color: var(--error-ink); }
.warn { background: var(--warn-bg); color: var(--warn-ink); }

table.grid {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    background: var(--panel);
}

table.grid th, table.grid td {
    text-align: left;
    padding: 0.3rem 0.6rem;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

table.grid thead th {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ink-soft);
}

/* An unfinished row has to be findable in a table of sixteen without reading every line. */
table.grid tr.open th[scope="row"] { box-shadow: inset 3px 0 0 var(--warn-ink); }
table.grid tr.open .state { color: var(--warn-ink); font-weight: 600; }

select, input[type="month"], input[type="email"], input[type="password"] {
    font: inherit;
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--paper);
    color: var(--ink);
    max-width: 100%;
}

select { min-width: 14rem; }

button[type="submit"] {
    font: inherit;
    padding: 0.5rem 1.1rem;
    border: 0;
    border-radius: 4px;
    background: var(--accent);
    color: #ffffff;
    cursor: pointer;
}

form.narrow { max-width: 22rem; }
form.narrow label { display: block; margin: 1rem 0 0.25rem; }
form.narrow input { width: 100%; }
form.narrow button { margin-top: 1.25rem; }

.field label { font-weight: 600; margin-right: 0.5rem; }

footer {
    margin: 1.5rem 0 2rem;
    padding: 0 clamp(0.75rem, 2vw, 2rem);
    color: var(--ink-soft);
    font-size: 0.875rem;
}

/* Present for a screen reader, out of the way for everybody else. */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

@media print {
    .bar, button, .signout { display: none; }
    body { background: #fff; color: #000; }
}

/* The figures table: numbers right-aligned and tabular, so a column reads as a column. */
table.figures td.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

table.figures tr.level-0 th[scope="row"] { font-weight: 600; }
table.figures tr.level-1 th[scope="row"],
table.plan tr.level-1 th[scope="row"] { font-weight: 400; padding-left: 1.9rem; }
table.figures td.basis { color: var(--ink-soft); font-size: 0.85rem; }

ul.findings { padding-left: 1.2rem; }
ul.findings li.error { color: var(--error-ink); }
ul.findings li.warning { color: var(--warn-ink); }

/* ------------------------------------------------------------------ the grid */

.toolbar { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.toolbar .spacer { flex: 1 1 auto; }
.toolbar input[type="number"] { width: 4.5rem; }

.download {
    color: var(--accent);
    text-decoration: none;
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 0.35rem 0.7rem;
    white-space: nowrap;
}
.download:hover { text-decoration: underline; }

/* Wide content scrolls inside its own box so the page never scrolls sideways. */
.scroller { overflow-x: auto; }

/* The figures table gets a viewport of its own, and this is the one piece of layout in the whole
 * application that is not simply "let the page be as long as it is".
 *
 * The reason, reported by the owner: with a whole financial year on screen the table is wider
 * than the window and forty rows tall, so the horizontal scrollbar sat at the bottom of the table
 * and reaching it meant scrolling past every figure first, at which point the column headings
 * were gone too. Both halves of that are fixed by giving the table a box: the bar is at the
 * bottom edge of what is visible, and the heading row and label column stay put inside it.
 *
 * The height is generous rather than tight, so on a tall screen the box is simply the table and
 * nothing about the page changes. `dvh` rather than `vh` because a phone's address bar makes `vh`
 * taller than what is actually visible, which would put the bar back off screen. */
.grid-viewport {
    overflow: auto;
    max-height: min(72dvh, 60rem);
    overscroll-behavior: contain;
    /* A hint that there is more to the right: the shadow appears only while the box can still be
     * scrolled that way, because the background attachment stops at the edge of the content. */
    background:
        linear-gradient(to right, var(--panel) 30%, rgba(0, 0, 0, 0)) left center / 3rem 100% no-repeat,
        linear-gradient(to left, var(--panel) 30%, rgba(0, 0, 0, 0)) right center / 3rem 100% no-repeat,
        radial-gradient(farthest-side at 0 50%, rgba(0, 0, 0, 0.16), rgba(0, 0, 0, 0)) left center / 1rem 100% no-repeat,
        radial-gradient(farthest-side at 100% 50%, rgba(0, 0, 0, 0.16), rgba(0, 0, 0, 0)) right center / 1rem 100% no-repeat;
    background-attachment: local, local, scroll, scroll;
}

.status { min-height: 1.5rem; margin: 0.75rem 0 0; color: var(--ok-ink); }
.status:empty { border: 0; padding: 0; }

/* The label column stays put while the months scroll past it.
 *
 * Necessary rather than decorative since the report shows a whole financial year: twelve columns
 * are about two and a half times the width of the pane, and a table where the row label has
 * scrolled out of view is a grid of numbers nobody can read. The background is explicit because a
 * sticky cell is transparent by default and the figures would slide underneath it. */
table.figures th[scope="row"] {
    white-space: nowrap;
    position: sticky;
    left: 0;
    z-index: 1;
    background: var(--panel);
}
/* The heading row stays while the rows scroll under it. Without it a figure in the lower half
 * of a twelve month table is a number with no month above it. */
table.figures thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--panel);
    /* A line under the whole heading row, drawn as a shadow because a sticky cell's own border
     * scrolls away with the cell it belongs to. */
    box-shadow: 0 1px 0 var(--line);
}
/* The corner belongs to both, so it needs the higher layer and both offsets. */
table.figures thead th:first-child {
    position: sticky;
    left: 0;
    top: 0;
    z-index: 3;
    background: var(--panel);
}
/* A rule down its right edge, so it is visible that the column is pinned rather than that the
 * table simply starts there. */
table.figures th[scope="row"] {
    box-shadow: 1px 0 0 var(--line);
}
table.figures thead th:first-child {
    box-shadow: 1px 0 0 var(--line), 0 1px 0 var(--line);
}
table.figures thead .month { display: block; font-size: 0.95rem; color: var(--ink); }
/* Its own classes, not `ok` and `warn`: those carry the block styling of a message, padding and
 * border and background included, and a small count in a table header wearing it reads as an
 * error rather than as a count. Seen on the screen rather than reasoned about. */
table.figures thead .coverage {
    display: block;
    font-size: 0.75rem;
    font-weight: 400;
    font-variant-numeric: tabular-nums;
}
table.figures thead .coverage.complete { color: var(--ok-ink); }
table.figures thead .coverage.partial { color: var(--warn-ink); }

/* A derived or summed row is the one somebody checks against their own sheet first. */
table.figures tr.derived th[scope="row"], table.figures tr.sum th[scope="row"] { font-weight: 600; }
table.figures tr.derived td.num, table.figures tr.sum td.num { font-weight: 600; }
table.figures td.gap .value { color: var(--ink-soft); }

/* The copy button stays out of the way until the row is under the pointer, so a column of
 * figures reads as a column of figures. It is always reachable by keyboard. */
button.copy {
    font: inherit;
    font-size: 0.8rem;
    line-height: 1;
    padding: 0.15rem 0.35rem;
    margin-left: 0.35rem;
    border: 1px solid var(--line);
    border-radius: 3px;
    background: var(--paper);
    color: var(--ink-soft);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.1s;
}
tr:hover button.copy, button.copy:focus, button.copy.copied { opacity: 1; }
button.copy .icon { display: block; }
button.copy:hover { color: var(--accent); border-color: var(--accent); }
button.copy.copied { background: var(--ok-bg); color: var(--ok-ink); border-color: var(--ok-ink); }
thead button.copy { opacity: 1; }

ul.findings li .when {
    display: inline-block;
    min-width: 5rem;
    color: var(--ink-soft);
    font-variant-numeric: tabular-nums;
}

@media print {
    button.copy, .toolbar, .status { display: none; }
    /* On paper there is no scrolling and no viewport: the table is as tall as it is, and a box
     * with a maximum height would simply cut it off at the first page. */
    .scroller, .grid-viewport { overflow: visible; max-height: none; }
    table.figures thead th, table.figures th[scope="row"] { position: static; }
}

/* ----------------------------------------------------------- the data screen */

/* Their own class names throughout, never `ok` and `warn`: those carry the block styling of a
 * message, and a table full of small indicators wearing it reads as a wall of alerts rather than
 * as a table of counts. Seen on the screen rather than reasoned about. */
table.months th[scope="row"] { white-space: nowrap; }
table.months td.source, table.months th.source { white-space: nowrap; text-align: center; }
/* The two actions sit side by side rather than wrapping, and small, because twelve rows of them
 * would otherwise be the widest thing on a screen whose subject is the figures. */
table.months td.state { white-space: nowrap; }
table.months td.state button { padding: 0.2rem 0.5rem; font-size: 0.8rem; }
table.months td.source .rows { display: inline-block; font-weight: 600; }
table.months a.rows { text-decoration: none; border-bottom: 1px dotted currentColor; }
table.months .flag { color: var(--warn-ink); font-weight: 700; margin-left: 0.15rem; }
table.months .coverage { font-variant-numeric: tabular-nums; }
table.months .coverage.complete { color: var(--ok-ink); }
table.months .coverage.partial { color: var(--warn-ink); }
table.months .coverage.none { color: var(--ink-soft); }
table.log td.when, table.log td.ip { white-space: nowrap; font-variant-numeric: tabular-nums; }
table.log .detail {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.1rem 0.5rem;
    margin: 0;
    font-size: 0.8rem;
}
table.log .detail dt { color: var(--ink-soft); }
table.log .detail dd { margin: 0; overflow-wrap: anywhere; }
form.filter .field { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: baseline; }

.rows { display: block; font-variant-numeric: tabular-nums; }
.rows.filled { color: var(--ink); }
.rows.empty { color: var(--ink-soft); }
.rows.unassigned { color: var(--warn-ink); }
.run { display: block; font-size: 0.78rem; color: var(--ink-soft); }
/* Set apart from the months by a rule down the left, because they are not months: nothing in
 * them is copied, and a reader scanning across should notice where the measured figures end. */
table.figures th.plan, table.figures td.plan { border-left: 2px solid var(--line); }
table.figures td.plan { color: var(--ink-soft); }

/* The running total under the month figure, quieter than it, because it is the figure to check
 * against rather than the figure being reported. */
table.figures .running {
    display: block;
    font-size: 0.78rem;
    color: var(--ink-soft);
    font-variant-numeric: tabular-nums;
}
.checkbox { display: inline-flex; align-items: center; gap: 0.35rem; }

/* The row action sits in the label cell, which is pinned, so it stays reachable however far
 * the months have been scrolled. Faint until the row is hovered, because forty of them shown at
 * full strength would compete with the figures they belong to. */
table.figures th[scope="row"] button.copy.row {
    margin-left: 0.4rem;
    opacity: 0.25;
}
table.figures tr:hover th[scope="row"] button.copy.row,
table.figures th[scope="row"] button.copy.row:focus-visible { opacity: 1; }

/* The findings, shut until somebody opens them.
 *
 * A `details` element and not an overlay driven by script. The findings are the part of this
 * screen that must never be unreachable: a figure without its caveat is half an answer, and an
 * overlay that depends on JavaScript is exactly the thing that goes missing. Native, works with
 * the keyboard, and needs nothing loaded. */
.findings-panel {
    margin: 1rem 0;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--panel);
}
.findings-panel > summary {
    padding: 0.6rem 0.9rem;
    cursor: pointer;
    font-weight: 600;
    color: var(--warn-ink);
}
.findings-panel > summary:hover { background: var(--warn-bg); }
.findings-panel[open] > summary { border-bottom: 1px solid var(--line); }
.findings-panel > .intro, .findings-panel > ul { padding: 0 0.9rem; }
.findings-panel > ul { padding-bottom: 0.6rem; }

table.roles td.role, table.roles th.role { text-align: center; }
table.roles th[scope="row"] { font-weight: 400; }
table.roles .changed { display: block; color: var(--warn-ink); font-size: 0.7rem; }

table.system th[scope="row"] { font-weight: 400; }
table.system td { vertical-align: top; }
.system-ok { color: var(--ok-ink); }
.system-warn { color: var(--warn-ink); }
.system-failed { color: var(--error-ink); font-weight: 600; }

table.uploads th[scope="row"] { font-weight: 400; word-break: break-all; }
table.uploads .upload-read { color: var(--ok-ink); }
table.uploads .upload-frozen { color: var(--warn-ink); }
table.uploads .upload-vjv { color: var(--ok-ink); }
table.uploads .upload-older { color: var(--ink-soft); }
table.uploads .upload-susa_pdf, table.uploads .upload-failed,
table.uploads .upload-vjv_differs { color: var(--error-ink); }

a.run { text-decoration: none; border-bottom: 1px dotted currentColor; }
a.run:hover { text-decoration: none; border-bottom-style: solid; }
table.grid.facts th[scope="row"] { width: 12rem; }
pre.technical {
    margin: 0.4rem 0 1rem;
    padding: 0.6rem 0.8rem;
    background: var(--panel-soft, #f3f4f6);
    border: 1px solid var(--line);
    border-radius: 4px;
    font-size: 0.8rem;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
dl.detail.wide { max-width: 48rem; }
.warn-text { color: var(--warn-ink); }

.note {
    display: block;
    font-size: 0.75rem;
    color: var(--ink-soft);
    margin-top: 0.15rem;
    max-width: 18rem;
    overflow-wrap: anywhere;
}
.run-ok { color: var(--ok-ink); }
.run-failed { color: var(--error-ink); }
.run-drift_reported, .run-skipped_frozen { color: var(--warn-ink); }
table.months .state-open { color: var(--ok-ink); }
table.months .state-frozen { color: var(--warn-ink); font-weight: 600; }
table.months tr.frozen th[scope="row"] { box-shadow: inset 3px 0 0 var(--ink-soft); }
table.months td.state { white-space: nowrap; }
table.months form.inline { display: inline; }
table.months form.inline button {
    font: inherit;
    font-size: 0.8rem;
    padding: 0.15rem 0.45rem;
    margin-left: 0.35rem;
    border: 1px solid var(--line);
    border-radius: 3px;
    background: var(--paper);
    color: var(--ink-soft);
    cursor: pointer;
}
table.months form.inline button:hover { color: var(--accent); border-color: var(--accent); }

/* ------------------------------------------------------- the key assignment */

nav.tabs { display: flex; gap: 1rem; margin: 0 0 1rem; border-bottom: 1px solid var(--line); }
nav.tabs a {
    color: var(--accent);
    text-decoration: none;
    padding: 0.4rem 0.2rem;
    border-bottom: 2px solid transparent;
}
nav.tabs a.here { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
nav.tabs a:hover { text-decoration: underline; }

table.keys th[scope="row"] { font-variant-numeric: tabular-nums; white-space: nowrap; }
table.keys td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.keys td.since { white-space: nowrap; }
table.keys td.since .muted { color: var(--ink-soft); margin-left: 0.4rem; }
table.keys form.inline { display: inline-flex; gap: 0.3rem; align-items: center; }
table.keys select { min-width: 11rem; }
table.keys .target { display: inline-flex; align-items: center; gap: 0.2rem; margin-right: 0.7rem; }
table.keys .target button {
    font: inherit;
    line-height: 1;
    padding: 0 0.3rem;
    border: 1px solid var(--line);
    border-radius: 3px;
    background: var(--paper);
    color: var(--ink-soft);
    cursor: pointer;
}
table.keys .target button:hover { color: var(--error-ink); border-color: var(--error-ink); }

/* ------------------------------------------------------------ the settings */

table.settings th[scope="row"] { max-width: 22rem; }
table.settings th[scope="row"] .hint { font-weight: 400; }
table.settings td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.settings form.inline { display: inline-flex; gap: 0.35rem; align-items: center; flex-wrap: wrap; }
table.settings input[type="text"] {
    font: inherit;
    padding: 0.3rem 0.45rem;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--paper);
    color: var(--ink);
}

/* --------------------------------------------------------- account and users */

ul.powers { margin: 0; padding-left: 1.1rem; }
ul.powers li { color: var(--ink-soft); }

table.users tr.inactive th[scope="row"], table.users tr.inactive td { color: var(--ink-soft); }
table.users tr.inactive th[scope="row"] { box-shadow: inset 3px 0 0 var(--ink-soft); }
table.users form.inline { display: inline-flex; gap: 0.3rem; align-items: center; margin-right: 0.4rem; }
table.users form.inline button {
    font: inherit;
    font-size: 0.8rem;
    padding: 0.2rem 0.5rem;
    border: 1px solid var(--line);
    border-radius: 3px;
    background: var(--paper);
    color: var(--ink-soft);
    cursor: pointer;
}
table.users form.inline button:hover { color: var(--accent); border-color: var(--accent); }
table.users .hint { display: block; }
table.users .hint.warn { color: var(--warn-ink); background: none; padding: 0; border: 0; }

/* The date of the DATEV document behind a month, and the year-to-date proof on the data screen. */
table.months .stand { display: block; font-size: 0.75rem; color: var(--ink-soft); white-space: nowrap; }
.proof { margin-bottom: 1.25rem; }
.proof-verdict { font-weight: 600; }
table.proof-accounts td.zero { color: var(--error-ink); font-weight: 600; }
table.proof-accounts th[scope="row"], table.proof-rows th[scope="row"] { font-weight: 400; white-space: nowrap; }

/* ------------------------------------------------------- minimal, 2026-11-13 */

body { font-size: 15px; }

/* The bar: four screens and one menu for the rest. */
.bar { padding: 0.5rem clamp(0.75rem, 2vw, 2rem); gap: 1rem; flex-wrap: wrap; }
.bar nav { align-items: center; flex-wrap: wrap; }
.bar details.more { position: relative; }
.bar details.more > summary { color: var(--ink-soft); cursor: pointer; list-style: none; }
.bar details.more > summary::-webkit-details-marker { display: none; }
.bar details.more > summary::after { content: " \25BE"; }
.bar details.more .menu {
    position: absolute;
    z-index: 10;
    top: 1.8rem;
    left: 0;
    display: flex;
    flex-direction: column;
    min-width: 12rem;
    padding: 0.4rem 0;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 4px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}
.bar details.more .menu a { padding: 0.35rem 0.9rem; }

h1 { font-size: 1.35rem; margin-bottom: 0.5rem; }
.intro { margin: 0 0 0.75rem; }
.toolbar { gap: 0.4rem 0.6rem; }
select { min-width: 0; }

/* The row of figures read first. */
.glance {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
    gap: 0.6rem;
    margin: 0.9rem 0 0.4rem;
}
.glance .tile {
    display: flex;
    flex-direction: column;
    padding: 0.6rem 0.8rem;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--ink);
    text-decoration: none;
}
.glance .label { font-size: 0.8rem; color: var(--ink-soft); }
.glance .label .span { margin-left: 0.3rem; }
.glance .figure { font-size: 1.35rem; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.3; }
.glance .figure.negative { color: var(--error-ink); }
.glance .sub { font-size: 0.78rem; color: var(--ink-soft); }
.glance .check-ok { border-color: var(--ok-ink); background: var(--ok-bg); }
.glance .check-ok .figure { color: var(--ok-ink); }
.glance .check-differs { border-color: var(--warn-ink); background: var(--warn-bg); }
.glance .check-differs .figure { color: var(--warn-ink); }
.glance a.tile:hover { box-shadow: 0 0 0 1px currentColor inset; }

/* The figures table, denser, and a month without DATEV quieter than the rest. */
table.figures { font-size: 0.9rem; }
table.figures thead th { text-transform: none; letter-spacing: 0; font-size: 0.85rem; }
table.figures .muted, table.figures .muted .value { color: var(--ink-soft); }
table.figures thead th.muted .month { color: var(--ink-soft); }
thead button.copy { opacity: 0; }
thead th:hover button.copy, thead button.copy:focus { opacity: 1; }


/* Panels that hold detail rather than news: closed, and not in a warning colour. */
.findings-panel.quiet > summary { color: var(--ink-soft); font-weight: 500; }
.findings-panel.quiet > summary:hover { background: var(--paper); }
.findings-panel > .scroller, .findings-panel > h3, .findings-panel > table { margin: 0 0.9rem 0.9rem; }

/* What there is to do, one line each. */
ul.todos { list-style: none; margin: 0.5rem 0 1rem; padding: 0; max-width: 60rem; }
ul.todos li {
    padding: 0.4rem 0.7rem;
    margin-bottom: 0.3rem;
    border-left: 3px solid var(--line);
    background: var(--panel);
}
ul.todos li.warn { border-left-color: var(--warn-ink); }
ul.todos li.ok { border-left-color: var(--ok-ink); color: var(--ok-ink); }
ul.todos li a { margin-left: 0.4rem; white-space: nowrap; }

/* The data screen's months: a date per source, nothing else. */
table.months .read { white-space: nowrap; font-variant-numeric: tabular-nums; }
table.months .read a { color: var(--ink); text-decoration: none; border-bottom: 1px dotted var(--ink-soft); }
table.months .read.failed { color: var(--error-ink); font-weight: 600; }
table.months .tick { color: var(--ok-ink); margin-right: 0.25rem; }
.proof-line { margin: 0.2rem 0; }
.proof-line.ok::before { content: "\2713  "; color: var(--ok-ink); }
.proof-line.error::before { content: "\26A0  "; }
.proof-line.ok, .proof-line.error, .proof-line.warn { background: none; border: 0; padding: 0; }
.proof-line.error { color: var(--error-ink); }

@media (max-width: 40rem) {
    .bar nav { gap: 0.4rem 0.8rem; font-size: 0.95rem; }
    .glance { grid-template-columns: 1fr 1fr; }
    .glance .figure { font-size: 1.1rem; }
    table.figures th[scope="row"] { white-space: normal; min-width: 8.5rem; max-width: 9.5rem; }
}

/* The copy actions take no room of their own: absolutely placed inside the cell, so a column is
 * as narrow as its widest figure and a year fits the window. */
table.figures td.num { position: relative; }
table.figures td.num button.copy {
    position: absolute;
    top: 50%;
    left: 0.1rem;
    transform: translateY(-50%);
    margin: 0;
    padding: 0.1rem 0.25rem;
}
/* The block action only for the cell under the pointer, laid over the figure's right edge. */
table.figures td.num button.copy.block { left: auto; right: 0.15rem; z-index: 1; opacity: 0; }
table.figures tr:hover td.num button.copy.block { opacity: 0; }
table.figures td.num:hover button.copy.block, table.figures td.num button.copy.block:focus { opacity: 1; }
table.figures td.num { padding-left: 1.4rem; }
table.figures thead th button.copy.column {
    position: absolute;
    top: 0.15rem;
    left: 0.15rem;
    margin: 0;
    padding: 0.05rem 0.25rem;
    font-size: 0.7rem;
}
table.figures thead th { vertical-align: bottom; }
table.figures thead .coverage.partial { color: var(--ink-soft); font-size: 0.7rem; }
table.months .read.stale a { color: var(--warn-ink); font-weight: 600; }
table.months .read.stale .tick { color: var(--warn-ink); }
table.keys .proposal { display: block; max-width: 34rem; margin-top: 0.2rem; font-size: 0.78rem; color: var(--ok-ink); }
table.figures tr.ratio th[scope="row"] { font-style: italic; font-weight: 400; }
table.figures tr.ratio td { color: var(--ink-soft); font-style: italic; }
table.figures tr.ratio td.negative { color: var(--error-ink); }
.fetch { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin: 0.25rem 0 0.5rem; }
.fetch .hint { margin: 0; }

/* Rows marked for copying, and the bar that says how many. */
table.figures tbody th[scope="row"] { cursor: pointer; user-select: none; }
table.figures tr.marked th[scope="row"], table.figures tr.marked td { background: #dbe8f6; }
@media (prefers-color-scheme: dark) {
    table.figures tr.marked th[scope="row"], table.figures tr.marked td { background: #23384f; }
}
.selection-bar {
    position: fixed;
    left: 50%;
    bottom: 1rem;
    transform: translateX(-50%);
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    max-width: calc(100vw - 2rem);
    padding: 0.5rem 0.9rem;
    background: var(--panel);
    border: 1px solid var(--accent);
    border-radius: 6px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
}
.selection-bar[hidden] { display: none; }
.selection-bar [data-count] { font-weight: 600; }
.selection-bar button.quiet { background: none; color: var(--ink-soft); border: 1px solid var(--line); }
.selection-bar .hint { margin: 0; font-size: 0.78rem; max-width: 30rem; }

/* ------------------------------------------------------- settings, 2026-11-16 */

/* One line per value: what it is, what it is now, and a click opens the change and the past in
 * the same place. */
.settings-group { max-width: 64rem; margin-bottom: 1.5rem; }
.settings-group h2 { margin: 1.25rem 0 0.4rem; }
details.setting {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 6px;
    margin-bottom: 0.4rem;
}
details.setting > summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 1rem;
    padding: 0.55rem 0.9rem;
    cursor: pointer;
    list-style: none;
}
details.setting > summary::-webkit-details-marker { display: none; }
details.setting > summary:hover { background: var(--paper); }
details.setting[open] > summary { border-bottom: 1px solid var(--line); }
details.setting .what { display: flex; flex-direction: column; min-width: 0; }
details.setting .name { font-weight: 600; }
details.setting .what .hint { margin: 0; font-size: 0.8rem; }
details.setting .now { display: flex; flex-direction: column; align-items: flex-end; }
details.setting .now .value { font-size: 1.1rem; font-weight: 600; font-variant-numeric: tabular-nums; }
details.setting .now .since { font-size: 0.78rem; color: var(--ink-soft); }
details.setting .open {
    font-size: 0.85rem;
    color: var(--accent);
    white-space: nowrap;
}
details.setting .open::after { content: " \25BE"; }
details.setting[open] .open::after { content: " \25B4"; }
.setting-body { padding: 0.7rem 0.9rem 0.8rem; }
.setting-form { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: flex-end; margin-bottom: 0.6rem; }
.setting-form label { display: flex; flex-direction: column; gap: 0.15rem; font-size: 0.8rem; color: var(--ink-soft); }
.setting-form label.grow { flex: 1 1 12rem; }
.setting-form input[type="text"], .setting-form input[type="month"] {
    font: inherit;
    font-size: 0.95rem;
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--paper);
    color: var(--ink);
}
.setting-form label.grow input { width: 100%; }
ol.setting-history { list-style: none; margin: 0; padding: 0; font-size: 0.88rem; }
ol.setting-history li {
    display: flex;
    gap: 0.9rem;
    flex-wrap: wrap;
    padding: 0.25rem 0;
    border-top: 1px dashed var(--line);
}
ol.setting-history .value { font-weight: 600; font-variant-numeric: tabular-nums; min-width: 6rem; }
ol.setting-history .span { color: var(--ink-soft); }
ol.setting-history .note { color: var(--ink-soft); font-style: italic; }
@media (max-width: 40rem) {
    details.setting > summary { grid-template-columns: minmax(0, 1fr) auto; }
    details.setting .open { display: none; }
}
details.setting .now.missing .value { color: var(--warn-ink); }

/* ------------------------------------------------- one scrollbar, 2026-11-16 */

/* The page is the only thing that scrolls, in both directions. Asked for by the owner: a table that
 * scrolls inside a page that scrolls means two scrollbars, and on a small screen the inner one is
 * the one that gets in the way. With no scrolling box around the tables, the heading row and the
 * row names stay put against the window itself (`position: sticky` finds the nearest scrolling
 * ancestor, which is now the page), so nothing of what the box was for is lost. A table wider than
 * the window widens the page instead. */
.scroller, .grid-viewport {
    overflow: visible;
    max-height: none;
    min-height: 0;
    background: none;
}

/* Except on a phone. A page wider than the screen makes a phone's browser shrink the whole page
 * until it fits, so everything becomes too small to read; there the table, and only the table,
 * is swiped sideways. Still never a box that scrolls up and down inside the page. */
@media (max-width: 47.99rem) {
    .scroller, .grid-viewport { overflow-x: auto; overflow-y: visible; }
}

/* Correcting or removing an earlier value, from its own line in the history. */
ol.setting-history li { align-items: baseline; }
ol.setting-history details.fix { margin-left: auto; }
ol.setting-history details.fix > summary { cursor: pointer; color: var(--accent); font-size: 0.82rem; list-style: none; }
ol.setting-history details.fix > summary::-webkit-details-marker { display: none; }
ol.setting-history details.fix[open] { flex-basis: 100%; margin-left: 0; padding: 0.5rem 0 0.2rem; }
.setting-remove { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.setting-remove .hint { margin: 0; }
button.danger { background: var(--error-ink); }

/* A column of figures has its heading over the figures: right-aligned like them. Before, only the
 * cells were, so in a table with few wide columns a year stood at the left edge of its column and
 * its figure at the right, closer to the next year than to its own. Asked for by the owner. */
table.grid th.num { text-align: right; }

/* The tax table has three years. Stretched over the full width the gaps between them were wider
 * than the figures, so it takes the width it needs; every column the same, a year reads as one. */
table.grid.tax { width: auto; min-width: min(100%, 40rem); }
/* The same columns in both tax tables, so the calculation lines up under the sums. */
@media (min-width: 48rem) {
    table.grid.tax { width: 50rem; max-width: 100%; table-layout: fixed; }
    table.grid.tax thead th.num { width: 10rem; }
}
table.grid.tax tbody th[scope="row"] { font-weight: 400; }
table.grid.tax tbody tr.sum th[scope="row"] { font-weight: 600; }

/* The tax table in three blocks: trade tax, income tax, both together. Each block heading spans the
 * row; the last line of the last block, what is still to pay in all, is the figure that counts. */
table.grid.tax tr.group th {
    padding-top: 0.9rem;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ink-soft);
    font-weight: 600;
    border-bottom-color: var(--ink-soft);
}
table.grid.tax tbody tr:not(.group) th[scope="row"] { padding-left: 1.2rem; }
table.grid.tax tr.total th, table.grid.tax tr.total td { font-size: 1.05rem; font-weight: 700; }
.findings-panel > details.tax-how { margin: 0 0.9rem 0.9rem; }
.findings-panel > details.tax-how > summary { cursor: pointer; color: var(--accent); font-size: 0.9rem; }
.findings-panel > details.tax-how > .scroller { margin: 0; }

/* The sum after December: set off from the months by a line, so it does not read as a thirteenth. */
table.figures th.sum-col, table.figures td.sum-col { border-left: 2px solid var(--line); font-weight: 600; }
table.figures td.sum-col { padding-left: 0.8rem; }

/* What is open in taxes, from the owner's side: red and minus to pay, green and plus back. The
 * legend under the intro says it once, instead of every line spelling it out. */
table.grid.tax td.pay, .tile .figure.pay, .tax-legend .pay { color: var(--error-ink); }
table.grid.tax td.refund, .tile .figure.refund, .tax-legend .refund { color: var(--ok-ink); }
.tax-legend { display: inline-flex; gap: 0.7rem; margin-left: 0.4rem; white-space: nowrap; }
.tax-legend .pay, .tax-legend .refund { font-weight: 600; }

/* The newest booked month beside the one before, as the first tile, two columns wide. */
.glance .tile.months { grid-column: span 2; padding: 0.45rem 0.8rem; }
.glance table.month-pair { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
.glance table.month-pair th, .glance table.month-pair td { padding: 0.08rem 0.4rem; text-align: right; white-space: nowrap; }
.glance table.month-pair thead th { font-size: 0.8rem; font-weight: 500; color: var(--ink-soft); }
.glance table.month-pair tbody th { text-align: left; font-size: 0.8rem; font-weight: 500; color: var(--ink-soft); padding-left: 0; }
.glance table.month-pair td { font-size: 0.95rem; }
.glance table.month-pair tr.result td { font-weight: 600; border-top: 1px solid var(--line); }
.glance table.month-pair td.negative { color: var(--error-ink); }
/* The month before in a quieter tone, so the newest reads first. */
.glance table.month-pair td:nth-child(3), .glance table.month-pair thead th:nth-child(3) { color: var(--ink-soft); }
.glance table.month-pair td.negative:nth-child(3) { color: var(--error-ink); }

/* A running year twice: on its booked months, quieter, and projected. Four columns need more room. */
table.grid.tax th.so-far, table.grid.tax td.so-far { color: var(--ink-soft); }
@media (min-width: 48rem) {
    table.grid.tax.wide { width: 60rem; }
}

/* The contracts table: its shares in a quieter line, like the EBIT margin under the figures. */
table.grid.contracts tr.ratio-line th, table.grid.contracts tr.ratio-line td { color: var(--ink-soft); font-style: italic; }
table.grid.contracts th.so-far, table.grid.contracts td.so-far { color: var(--ink-soft); border-left: 1px solid var(--line); }
table.grid.contracts tbody th[scope="row"] { font-weight: 400; }
table.grid.contracts tbody tr.sum th[scope="row"] { font-weight: 600; }
