/*
 * Sumline components. The class names match the app (src/Sumline.Web/wwwroot/app.css), so this file can replace
 * those rules there. Colours come only from tokens: a theme.css supplies the theme's, this file the shared ones below.
 *
 * The underscore is the one recurring motif: the active tab, the current page, a key figure and a total stand on a
 * short bar in the theme's accent. Nothing else uses the accent colour.
 */

/* Shared tokens: status colours are the same in every theme, so "overdue" always looks overdue. */
:root {
  --green: #16733f; --green-tint: #e5f4ea;
  --amber: #a15f00; --amber-tint: #fff4e0;
  --red: #b42318; --red-tint: #fdecea;
  --focus: #ffd23f;
  --radius: 14px; --radius-small: 8px;
  --shadow: rgb(0 0 0 / 8%);
}
:root[data-theme="dark"] {
  --green: #5cc98c; --green-tint: #12301f; --amber: #f0b45a; --amber-tint: #33270f; --red: #f2786b; --red-tint: #3a1c19; --shadow: rgb(0 0 0 / 40%);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --green: #5cc98c; --green-tint: #12301f; --amber: #f0b45a; --amber-tint: #33270f; --red: #f2786b; --red-tint: #3a1c19; --shadow: rgb(0 0 0 / 40%);
  }
}

/* Hidden means hidden, whatever display a component sets (a field error waiting for its moment). */
[hidden] { display: none !important; }

/* ---- The underscore ---- */
.underscore { display: block; width: 1.5rem; height: 3px; border-radius: 2px; background: var(--accent); }

/* ---- Icons (from icons/icons.svg) ---- */
.i { width: 1.25rem; height: 1.25rem; flex: none; vertical-align: -0.25em; }
.i--16 { width: 1rem; height: 1rem; }

/* ---- Buttons ----
 * The primary button takes the brand tile's colour; secondary buttons are tinted surfaces without an outline.
 * Buttons carry no underscore: it marks where you are (menu, tab, page), and under a label it reads as a link.
 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  min-height: 2.6rem; padding: 0.5rem 1.15rem; font: inherit; font-size: 0.875rem; font-weight: 600; line-height: 1.2;
  text-decoration: none; white-space: nowrap; color: var(--ink); background: var(--tint); border: 0; border-radius: 10px; cursor: pointer;
  transition: background-color 0.12s, color 0.12s;
}
.btn:hover { background: color-mix(in srgb, var(--tint) 70%, var(--line-strong)); }
.btn:focus-visible, .segmented button:focus-visible, .tabs a:focus-visible, .pager a:focus-visible, .input:focus-visible, .check input:focus-visible, .toggle input:focus-visible + span {
  outline: 3px solid var(--focus); outline-offset: 2px;
}
/* Light: the brand tile with white text. Dark: the theme's light link colour with page-coloured text (set by theme.css). */
.btn--primary { color: var(--primary-text, #fff); background: var(--primary, var(--brand-tile)); }
.btn--primary:hover { background: color-mix(in srgb, var(--primary, var(--brand-tile)) 85%, var(--primary-text, #fff)); }
.btn--quiet { color: var(--muted); background: transparent; }
.btn--quiet:hover { color: var(--ink); background: var(--tint); }
.btn--danger { color: var(--red); background: var(--red-tint); }
.btn--danger:hover { background: color-mix(in srgb, var(--red-tint) 80%, var(--red)); }
.btn--small { min-height: 2.1rem; padding: 0.3rem 0.8rem; font-size: 0.8125rem; border-radius: 8px; }
.btn--icon { padding: 0; width: 2.6rem; }
.btn--icon.btn--small { width: 2.1rem; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.4; cursor: not-allowed; pointer-events: none; }
.button-row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }

/* ---- Forms ---- */
.field { display: grid; gap: 0.3rem; min-width: 0; }
.field > label, .field__label { font-size: 0.8125rem; font-weight: 600; color: var(--ink); }
.field__hint { font-size: 0.75rem; color: var(--muted); }
.field-error { display: flex; gap: 0.3rem; align-items: center; color: var(--red); font-size: 0.75rem; font-weight: 500; }
.input {
  width: 100%; min-height: 2.5rem; padding: 0.45rem 0.7rem; font: inherit; font-size: 0.875rem; color: var(--ink);
  background: var(--input-bg); border: 1px solid var(--line-strong); border-radius: var(--radius-small);
}
.input::placeholder { color: var(--muted); }
.input--num { text-align: right; font-variant-numeric: tabular-nums; }
.input[aria-invalid="true"] { border-color: var(--red); }
select.input { -webkit-appearance: none; appearance: none; padding-right: 2rem; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: right 1rem center, right 0.7rem center; background-size: 0.3rem 0.3rem; background-repeat: no-repeat; }
.form-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); }
.check { display: inline-flex; gap: 0.5rem; align-items: center; font-size: 0.875rem; cursor: pointer; }
.check input { width: 1.1rem; height: 1.1rem; accent-color: var(--blue-dark); margin: 0; }
.toggle { display: inline-flex; gap: 0.6rem; align-items: center; font-size: 0.875rem; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
/* The track is the span right after the checkbox; the label's own text (and any badge in it) is not. */
.toggle input + span { position: relative; flex: none; width: 2.25rem; height: 1.3rem; border-radius: 999px; background: var(--line-strong); transition: background 0.15s; }
.toggle input + span::after { content: ""; position: absolute; top: 0.15rem; left: 0.15rem; width: 1rem; height: 1rem; border-radius: 50%; background: #fff; transition: transform 0.15s; }
.toggle input:checked + span { background: var(--blue-dark); }
.toggle input:checked + span::after { transform: translateX(0.95rem); }

/* Radio buttons: a round mark that fills with the primary colour. Choice cards are radios with a description. */
.radio-group { display: grid; gap: 0.5rem; margin: 0; padding: 0; border: 0; min-width: 0; }
.radio-group legend { padding: 0; margin-bottom: 0.35rem; font-size: 0.8125rem; font-weight: 600; }
.radio { display: inline-flex; gap: 0.55rem; align-items: center; font-size: 0.875rem; cursor: pointer; }
.radio input, .choice input { appearance: none; flex: none; width: 1.15rem; height: 1.15rem; margin: 0; border: 1.5px solid var(--line-strong); border-radius: 50%; background: var(--input-bg); display: grid; place-items: center; cursor: pointer; }
.radio input::after, .choice input::after { content: ""; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--primary, var(--brand-tile)); transform: scale(0); transition: transform 0.12s; }
.radio input:checked, .choice input:checked { border-color: var(--primary, var(--brand-tile)); }
.radio input:checked::after, .choice input:checked::after { transform: scale(1); }
.radio input:focus-visible, .choice input:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.radio input:disabled { opacity: 0.45; cursor: not-allowed; }
.radio:has(input:disabled) { color: var(--muted); cursor: not-allowed; }
.choices { display: grid; gap: 0.5rem; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); }
.choice { display: grid; grid-template-columns: auto 1fr; gap: 0.15rem 0.6rem; align-items: start; padding: 0.75rem 0.85rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-small); cursor: pointer; }
.choice input { margin-top: 0.1rem; grid-row: span 2; }
.choice b { font-size: 0.875rem; }
.choice small { color: var(--muted); font-size: 0.75rem; }
.choice--check input, .choice--check input::after { border-radius: 3px; }
.choice:has(input:checked) { border-color: var(--primary, var(--brand-tile)); box-shadow: inset 0 0 0 1px var(--primary, var(--brand-tile)); }

/* Steps: where a person is in a few steps (the new-company wizard). Done steps are filled and lead back; the current is ringed. */
.steps { display: flex; gap: 0.5rem; margin: 0 0 1.25rem; padding: 0; list-style: none; }
.steps__step { flex: 1 1 0; min-width: 0; display: flex; align-items: center; gap: 0.5rem; color: var(--muted); font-size: 0.8125rem; }
.steps__step:not(:last-child)::after { content: ""; flex: 1 1 1rem; min-width: 0.5rem; height: 1px; background: var(--line-strong); }
.steps__go { display: flex; align-items: center; gap: 0.5rem; min-width: 0; font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.steps__go:hover .steps__label { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.steps__go:focus-visible .steps__number { outline: 3px solid var(--focus); outline-offset: 2px; }
.steps__number { flex: none; display: grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; border: 1.5px solid var(--line-strong); background: var(--card); font-weight: 600; font-variant-numeric: tabular-nums; }
.steps__label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.steps__step--done { color: var(--ink); }
.steps__step--done .steps__number { background: var(--accent); border-color: var(--accent); color: var(--card); }
.steps__step--current { color: var(--ink); font-weight: 600; }
.steps__step--current .steps__number { border: 2px solid var(--accent-text); color: var(--accent-text); background: var(--tint); }
@media (max-width: 40rem) {
    .steps__step:not(.steps__step--current) .steps__label { display: none; }
    .steps__step { flex: 0 1 auto; }
    .steps__step--current { flex: 1 1 auto; }
}

/* The register's data in the new-company wizard: read-only, and credited. */
.wizard > fieldset + fieldset, .wizard__aside, .wizard .register-facts + fieldset, .wizard .register-source + fieldset { margin-top: 1.25rem; }
.wizard__aside { margin-bottom: 1.25rem; }
.wizard__aside h3 { margin: 0 0 0.25rem; font-size: 1rem; }
.register-facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1rem; margin: 0; }
.register-facts dt { color: var(--muted); font-size: 0.8125rem; }
.register-facts dd { margin: 0; }
.register-source { color: var(--muted); font-size: 0.75rem; margin-top: 0.75rem; }

/* Segmented control: a small set of mutually exclusive filters. */
.segmented { display: inline-flex; flex-wrap: wrap; gap: 0.25rem; padding: 0.25rem; border: 1px solid var(--line); border-radius: 999px; background: var(--card); }
.segmented button { border: 0; background: none; color: var(--muted); font: inherit; font-size: 0.8125rem; padding: 0.35rem 0.9rem; border-radius: 999px; cursor: pointer; }
.segmented button.active, .segmented button[aria-pressed="true"] { background: var(--tint); color: var(--accent-text); font-weight: 600; }
.segmented .count { margin-left: 0.3rem; font-variant-numeric: tabular-nums; opacity: 0.8; }

/* Typeahead / picker */
.picker { position: relative; }
.picker__list { position: absolute; z-index: 5; inset: calc(100% + 4px) 0 auto; margin: 0; padding: 0.3rem; list-style: none; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-small); box-shadow: 0 8px 24px var(--shadow); }
.picker__list li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.45rem 0.6rem; border-radius: 6px; font-size: 0.875rem; cursor: pointer; }
.picker__list li small { color: var(--muted); }
.picker__list li[aria-selected="true"] { background: var(--tint); }
.picker__list mark { background: none; color: var(--accent-text); font-weight: 600; }

/* A picker for the keyboard (Combobox): the list scrolls, the marked choice is bold and ringed too, so it shows without colour. */
.combo .picker__list { max-height: 18rem; overflow-y: auto; min-width: 14rem; }
.combo .picker__list li[aria-selected="true"] { font-weight: 600; box-shadow: inset 0 0 0 1px var(--line-strong); }
.combo .picker__list li[aria-disabled="true"] { cursor: default; }

/* A card's heading with a tool at its end (the star of a customer, an invoice). */
.card__title { display: flex; gap: 0.5rem; align-items: center; justify-content: space-between; }
.card__title > :first-child { margin: 0; }

/* ---- The star of a page: put it in the menu ---- */
.star-toggle { display: inline-grid; place-items: center; flex: none; width: 2.1rem; height: 2.1rem; padding: 0; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--muted); cursor: pointer; }
.star-toggle svg { width: 16px; height: 16px; fill: none; }
.star-toggle:hover:not(:disabled) { color: var(--ink); background: var(--tint); }
.star-toggle.is-on { color: var(--accent-text); border-color: var(--accent); }
.star-toggle.is-on svg { fill: currentColor; }
.star-toggle:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ---- Status ---- */
/* A status always carries a dot and a word, never colour alone. */
.status { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.15rem 0.6rem 0.15rem 0.5rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; white-space: nowrap; color: var(--muted); background: var(--page); border: 1px solid var(--line); }
.status::before { content: ""; width: 0.45rem; height: 0.45rem; border-radius: 50%; background: currentColor; }
.status--draft { border-style: dashed; }
.status--sent { color: var(--accent-text); background: var(--tint); border-color: transparent; }
.status--paid { color: var(--green); background: var(--green-tint); border-color: transparent; }
.status--overdue { color: var(--amber); background: var(--amber-tint); border-color: transparent; }
.status--error { color: var(--red); background: var(--red-tint); border-color: transparent; }
.status--credited { color: var(--muted); background: var(--page); }
.status--credited::before { background: none; border: 1.5px solid currentColor; }
.badge { display: inline-block; white-space: nowrap; padding: 0.1rem 0.55rem; border-radius: 999px; background: var(--tint); color: var(--accent-text); font-size: 0.75rem; font-weight: 600; }
.badge--count { min-width: 1.4rem; text-align: center; background: var(--blue-dark); color: #fff; font-variant-numeric: tabular-nums; }

/* ---- Notices ---- */
.notice { display: flex; gap: 0.75rem; align-items: flex-start; padding: 0.85rem 1rem; border-radius: var(--radius-small); background: var(--tint); color: var(--ink); font-size: 0.875rem; border: 1px solid transparent; }
.notice .i { color: var(--accent-text); margin-top: 0.05rem; }
.notice b { display: block; margin-bottom: 0.1rem; }
.notice--warning { background: var(--amber-tint); }
.notice--warning .i { color: var(--amber); }
.notice--error { background: var(--red-tint); }
.notice--error .i { color: var(--red); }
.notice--success { background: var(--green-tint); }
.notice--success .i { color: var(--green); }
.notice > div { flex: 1; min-width: 0; }
.notice .btn { margin-left: auto; }
/* The support banner: a staff member is inside the company, by invitation. Always visible, never dismissible. */
.support-banner { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; padding: 0.6rem 1rem; background: var(--amber-tint); color: var(--ink); border-bottom: 2px solid var(--amber); font-size: 0.875rem; }
.support-banner .i { color: var(--amber); }
/* Break-glass: a staff member is inside without an invitation (docs/adr/0034). Red tint, red underline and a red word. */
.support-banner--emergency { background: var(--red-tint); border-bottom-color: var(--red); }
.support-banner--emergency strong, .support-banner--emergency .i { color: var(--red); }
/* Viewing as one of the company's people (docs/adr/0060): the brand's tint and an accent underline, read-only. */
.support-banner--viewas { background: var(--tint); border-bottom-color: var(--accent-text); }
.support-banner--viewas strong { color: var(--accent-text); }
/* A demo company (no verified CVR number): everything works inside, nothing goes out. Dashed: not the real thing yet. */
.support-banner--demo { background: var(--tint); border-bottom: 2px dashed var(--accent-text); }
.support-banner--demo strong, .support-banner--demo b { color: var(--accent-text); }

/* ---- Cards and tiles ---- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; min-width: 0; }
.card__head { display: flex; gap: 0.75rem; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 1rem; }
.card__head h3 { margin: 0; font-size: 1rem; }
.card__foot { display: flex; gap: 0.5rem; justify-content: flex-end; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.card--flush { padding: 0; overflow: hidden; }
.card--flush .card__head { padding: 1rem 1.25rem 0; }
.tiles { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
/* A navigation tile: icon, title on an underscore, one line of description. The whole tile is the link. */
.tile { position: relative; display: grid; gap: 0.5rem; align-content: start; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.25rem; }
.tile .i { color: var(--ink); width: 1.5rem; height: 1.5rem; }
.tile h3 { margin: 0; font-size: 1rem; }
.tile h3 a { color: inherit; text-decoration: none; }
.tile h3 a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.tile p { margin: 0; color: var(--muted); font-size: 0.8125rem; }
.tile:has(a):hover { border-color: var(--accent-text); box-shadow: 0 2px 10px var(--shadow); }
.tile:has(a):hover h3 a { color: var(--accent-text); }
.tile h3 a:focus-visible { outline: none; }
.tile h3 a:focus-visible::after { outline: 3px solid var(--focus); outline-offset: 2px; }
/* A key figure: the number stands on the underscore. */
.figure { display: grid; gap: 0.35rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem; min-width: 0; }
.figure__label { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.figure__value { font-size: 1.6rem; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); line-height: 1.1; }
.figure__value small { font-size: 0.8125rem; font-weight: 500; color: var(--muted); margin-left: 0.25rem; }
.figure__note { font-size: 0.8125rem; color: var(--muted); }
.figure__note a { color: var(--accent-text); }

/* ---- Lists ---- */
.table { width: 100%; border-collapse: collapse; font-size: 0.875rem; background: var(--card); }
.table th { text-align: left; font-weight: 600; color: var(--muted); font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.05em; background: var(--page); }
.table th, .table td { padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:hover { background: var(--page); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table td a:not(.btn) { color: var(--ink); font-weight: 600; text-decoration: none; }
.table td a:not(.btn):hover { color: var(--accent-text); text-decoration: underline; }
.table td small { display: block; color: var(--muted); font-size: 0.75rem; }
.table tfoot td { font-weight: 600; border-bottom: 0; }
/* The total line: a rule in the accent, the underscore drawn across the column. */
.table tfoot .num { box-shadow: inset 0 2px 0 var(--accent); }
.table-scroll { overflow-x: auto; }
.row-actions { display: flex; gap: 0.25rem; justify-content: flex-end; }
/* A plain list of things with one action each. */
.list { margin: 0; padding: 0; list-style: none; }
.list li { display: flex; gap: 0.75rem; align-items: center; padding: 0.75rem 0; border-bottom: 1px solid var(--line); min-width: 0; }
.list li:last-child { border-bottom: 0; }
.list__main { flex: 1; min-width: 0; display: grid; }
.list__main b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list__main small { color: var(--muted); font-size: 0.8125rem; }
.avatar { display: grid; place-items: center; flex: none; width: 2.25rem; height: 2.25rem; border-radius: 50%; background: var(--tint); color: var(--accent-text); font-size: 0.8125rem; font-weight: 600; }
.avatar--tile { border-radius: 8px; overflow: hidden; background: none; }
.avatar--tile svg { width: 100%; height: 100%; }
/* Facts: label and value pairs, e.g. on an entry or a customer. */
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.45rem 1.25rem; margin: 0; font-size: 0.875rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; min-width: 0; }
/* The activity log: who did what, newest first. */
.history { margin: 0; padding: 0; list-style: none; display: grid; }
.history li { position: relative; display: grid; gap: 0.1rem; padding: 0 0 1rem 1.4rem; font-size: 0.875rem; }
.history li::before { content: ""; position: absolute; left: 0.3rem; top: 0.45rem; width: 0.45rem; height: 0.45rem; border-radius: 50%; background: var(--line-strong); }
.history li::after { content: ""; position: absolute; left: calc(0.3rem + 0.2rem); top: 1.1rem; bottom: 0.1rem; width: 1px; background: var(--tint); }
.history li:last-child::after { display: none; }
.history time { font-size: 0.75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.history--staff::before { background: var(--amber) !important; }

/* ---- Navigation ---- */
.crumbs { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0; padding: 0; list-style: none; font-size: 0.8125rem; color: var(--muted); }
.crumbs li + li::before { content: "/"; margin-right: 0.4rem; color: var(--line-strong); }
.crumbs a { color: var(--muted); }
.crumbs [aria-current] { color: var(--ink); font-weight: 600; }
/* Tabs: the active one stands on the underscore. */
.tabs { display: flex; gap: 1.25rem; overflow-x: auto; border-bottom: 1px solid var(--line); }
.tabs a { position: relative; padding: 0.6rem 0 0.75rem; color: var(--muted); font-size: 0.875rem; font-weight: 500; text-decoration: none; white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current] { color: var(--ink); font-weight: 600; }
.tabs a[aria-current]::after { content: ""; position: absolute; left: 0; bottom: -1px; width: min(100%, 1.75rem); height: 3px; border-radius: 2px; background: var(--accent); }
/* Pager: page numbers for long lists; the current page stands on the underscore. */
.pager { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; align-items: center; justify-content: space-between; font-size: 0.8125rem; color: var(--muted); }
.pager__pages { display: flex; gap: 0.15rem; align-items: center; }
.pager a, .pager span[aria-current] { position: relative; display: inline-grid; place-items: center; min-width: 2rem; height: 2rem; padding: 0 0.4rem; border-radius: 6px; color: var(--ink); text-decoration: none; font-variant-numeric: tabular-nums; }
.pager a:hover { background: var(--tint); }
.pager span[aria-current] { font-weight: 700; }
.pager span[aria-current]::after { content: ""; position: absolute; left: 50%; bottom: 0.15rem; width: 1rem; height: 2.5px; border-radius: 2px; background: var(--accent); transform: translateX(-50%); }
.pager .gap { padding: 0 0.2rem; }
.pager a[aria-disabled="true"] { color: var(--line-strong); pointer-events: none; }
/* Side navigation: icon and word. The current page's word stands on the underscore, like the S in the mark. */
.sidenav { display: grid; gap: 0.15rem; }
.sidenav a { position: relative; display: flex; gap: 0.6rem; align-items: center; min-height: 2.5rem; padding: 0.45rem 0.7rem; border-radius: var(--radius-small); color: var(--muted); font-size: 0.875rem; font-weight: 500; text-decoration: none; }
.sidenav a:hover { color: var(--ink); background: var(--page); }
.sidenav a[aria-current] { color: var(--ink); font-weight: 600; }
.sidenav a[aria-current] .sidenav__label::after { content: ""; position: absolute; left: 0; bottom: -0.3rem; width: 1.25rem; height: 3px; border-radius: 2px; background: var(--accent); }
/* Counts on the menu share one width and centre, so 1 and 10 line up. */
.sidenav .badge--count { margin-left: auto; align-self: center; display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box;
  min-width: 1.75rem; height: 1.3rem; padding: 0 0.4rem; line-height: 1; }
.sidenav__label { position: relative; }
.sidenav__section { margin: 0.75rem 0 0.25rem 0.7rem; font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }

/* Top bar: brand, sections, company switcher and the person. The active section stands on the underscore. */
.topbar { display: flex; align-items: center; gap: 1.25rem; height: 3.75rem; padding: 0 1rem; background: var(--header-bg); border-bottom: 1px solid var(--line); min-width: 0; }
.topbar__brand { display: flex; gap: 0.5rem; align-items: center; font-weight: 700; color: var(--ink); text-decoration: none; white-space: nowrap; }
.topbar__brand svg { width: 1.6rem; height: 1.6rem; }
.topnav { display: flex; gap: 1.1rem; overflow-x: auto; min-width: 0; align-self: stretch; }
.topnav a { position: relative; display: flex; align-items: center; color: var(--muted); font-size: 0.875rem; font-weight: 500; text-decoration: none; white-space: nowrap; }
.topnav a:hover { color: var(--ink); }
.topnav a[aria-current] { color: var(--ink); font-weight: 600; }
.topnav a[aria-current]::after { content: ""; position: absolute; left: 0; bottom: 0.6rem; width: 1.25rem; height: 3px; border-radius: 2px; background: var(--accent); }
.topbar__tools { display: flex; gap: 0.5rem; align-items: center; margin-left: auto; }
.switcher { display: inline-flex; gap: 0.5rem; align-items: center; max-width: 16rem; padding: 0.3rem 0.6rem 0.3rem 0.35rem; font: inherit; font-size: 0.875rem; font-weight: 600; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 999px; cursor: pointer; }
.switcher:hover { border-color: var(--line-strong); }
.switcher svg { width: 1.5rem; height: 1.5rem; flex: none; }
.switcher span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.switcher::after { content: ""; flex: none; width: 0.35rem; height: 0.35rem; border: solid var(--muted); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg) translateY(-0.1rem); margin-left: 0.15rem; }

/* Dropdown menu: the company switcher and the person menu. */
.menu { display: grid; gap: 0.1rem; min-width: 15rem; padding: 0.35rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-small); box-shadow: 0 12px 32px var(--shadow); }
.menu__label { padding: 0.5rem 0.6rem 0.25rem; font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.menu__item { display: flex; gap: 0.6rem; align-items: center; padding: 0.5rem 0.6rem; border-radius: 6px; color: var(--ink); font-size: 0.875rem; text-decoration: none; }
.menu__item:hover, .menu__item:focus-visible { background: var(--page); outline: none; }
.menu__item:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.menu__item svg:first-child { color: var(--muted); }
.menu__item > svg.tile-mark { width: 1.75rem; height: 1.75rem; color: inherit; }
.menu__item span { display: grid; flex: 1; min-width: 0; }
.menu__item small { color: var(--muted); font-size: 0.75rem; }
.menu__item[aria-current] { background: var(--tint); font-weight: 600; }
.menu__item[aria-current]::after { content: ""; width: 0.9rem; height: 3px; border-radius: 2px; background: var(--accent); flex: none; }
.menu__item--danger { color: var(--red); }
.menu__item--danger svg:first-child { color: var(--red); }
.menu hr { margin: 0.3rem 0; border: 0; border-top: 1px solid var(--line); }

/* Bottom bar on phones: four destinations and "more". The active one has the underscore under its icon. */
/* Five places, the first four for the person's own items; Menu always in the last, at the right, however many there are. */
.bottombar { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); background: var(--header-bg); border-top: 1px solid var(--line); padding: 0.35rem 0.25rem calc(0.35rem + env(safe-area-inset-bottom, 0px)); }
.bottombar__menu { grid-column: -2 / -1; }
.bottombar a { position: relative; display: grid; justify-items: center; gap: 0.2rem; padding: 0.3rem 0 0.45rem; color: var(--muted); font-size: 0.6875rem; font-weight: 500; text-decoration: none; }
.bottombar a .i { width: 1.4rem; height: 1.4rem; }
.bottombar a[aria-current] { color: var(--ink); font-weight: 600; }
.bottombar a[aria-current]::after { content: ""; position: absolute; bottom: 0; width: 1rem; height: 3px; border-radius: 2px; background: var(--accent); }

/* ---- Empty state, toast, confirmation ---- */
.empty { display: grid; gap: 0.6rem; justify-items: center; text-align: center; padding: 2rem 1rem; color: var(--muted); font-size: 0.875rem; }
.empty > svg { width: 3rem; height: 3rem; color: var(--line-strong); }
.empty h3 { margin: 0; color: var(--ink); font-size: 1rem; }
.empty p { margin: 0; max-width: 32ch; }
.toast { display: inline-flex; gap: 0.75rem; align-items: center; padding: 0.7rem 0.9rem 0.7rem 1rem; border-radius: var(--radius-small); background: var(--brand-tile); color: #fff; font-size: 0.875rem; box-shadow: 0 8px 24px var(--shadow); }
.toast .i { color: var(--accent); }
.toast a { color: #fff; font-weight: 600; }
/* Confirmation happens on the page, beside the action, not in a browser dialog. */
.confirm { display: grid; gap: 0.75rem; padding: 1rem; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--card); box-shadow: 0 8px 24px var(--shadow); }
.confirm h3 { margin: 0; font-size: 1rem; }
.confirm p { margin: 0; color: var(--muted); font-size: 0.875rem; }
.confirm .button-row { justify-content: flex-end; }

/* ---- Tables, continued ---- */
/* Cells break only between words (a page that wraps anywhere would split account numbers); headings stay on one line. */
.table th, .table td { overflow-wrap: normal; vertical-align: middle; }
.table th { white-space: nowrap; }
.table td a:not(.btn) { font-weight: 500; }
.table td small:empty { display: none; }
/* Row actions may sit on the cell itself: it stays a table cell, with compact buttons. */
td.row-actions { display: table-cell; vertical-align: middle; }
.table .row-actions .btn { min-height: 2rem; padding: 0.25rem 0.65rem; font-size: 0.8125rem; }

/* ---- Upload: a drop zone around a file input ---- */
.dropzone { position: relative; display: flex; gap: 0.9rem; align-items: center; padding: 1.1rem 1.25rem; margin-bottom: 1rem;
  border: 1.5px dashed var(--line-strong); border-radius: var(--radius); background: var(--card); cursor: pointer; }
.dropzone:hover, .dropzone:focus-within { border-color: var(--accent-text); background: var(--tint); }
/* The hidden file field has the focus: the whole zone shows it. */
.dropzone:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.dropzone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; padding: 0; min-height: 0; }
.dropzone .i { width: 1.6rem; height: 1.6rem; color: var(--accent-text); flex: none; }
.dropzone span { display: grid; gap: 0.15rem; }
.dropzone small { color: var(--muted); }
.dropzone--busy { opacity: 0.6; pointer-events: none; }
.dropzone--tall { min-height: 24rem; justify-content: center; flex-direction: column; text-align: center; }

/* ---- Voucher cards: documents waiting for something to happen (the inbox) ---- */
.voucher-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); }
.voucher { display: grid; gap: 0.75rem; padding: 0.9rem; margin: 0; align-content: start; }
.voucher__preview { display: grid; place-items: center; gap: 0.3rem; height: 9rem; border-radius: var(--radius-small); background: var(--page);
  color: var(--muted); text-decoration: none; overflow: hidden; }
.voucher__preview img { width: 100%; height: 100%; object-fit: cover; }
.voucher__preview .i { width: 2rem; height: 2rem; }
.voucher__kind { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; }
.voucher__text { display: grid; min-width: 0; }
.voucher__text b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voucher__actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }
/* A phone: a row per voucher, the thumbnail beside its name and actions, so a screen shows several. */
@media (max-width: 40rem) {
  .voucher-list { grid-template-columns: minmax(0, 1fr); gap: 0.5rem; }
  .voucher { grid-template-columns: 4.5rem minmax(0, 1fr); gap: 0.35rem 0.75rem; padding: 0.65rem; align-items: center; }
  .voucher__preview { height: 4.5rem; grid-row: span 2; gap: 0.1rem; }
  .voucher__preview .i { width: 1.4rem; height: 1.4rem; }
  .voucher__kind { font-size: 0.6875rem; }
}

/* ---- Split view: the document on the left, what is done with it on the right ---- */
.split-view { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.voucher-view { position: sticky; top: calc(var(--header-h, 4rem) + 1rem); display: grid; gap: 0.5rem; }
.voucher-view iframe, .voucher-view > img { width: 100%; height: min(78vh, 60rem); border: 1px solid var(--line); border-radius: var(--radius-small); background: #fff; }
.voucher-view > img { height: auto; max-height: 78vh; object-fit: contain; }
.voucher-view__meta { margin: 0; }
@media (max-width: 1100px) { .split-view { grid-template-columns: minmax(0, 1fr); } .voucher-view { position: static; } .voucher-view iframe { height: 60vh; } }
/* A phone: enough of the voucher to read it, and the form within reach. */
@media (max-width: 40rem) { .voucher-view iframe { height: 42vh; } }

/* ---- Line cards: entry lines with a wide text above their fields (bill lines, journal lines on narrow screens) ---- */
.line-cards { display: grid; gap: 0.6rem; }
.line-card { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(7rem, 0.8fr) auto; gap: 0.5rem 0.6rem; align-items: end;
  padding: 0.75rem; border: 1px solid var(--line); border-radius: var(--radius-small); background: var(--page); }
.line-card__wide { grid-column: 1 / -1; }
.line-card label { display: grid; gap: 0.25rem; font-size: 0.8125rem; font-weight: 600; }
.line-card input, .line-card select { width: 100%; min-height: 2.4rem; font-size: 0.875rem; }
.line-card .field-error { grid-column: 1 / -1; }
.line-card__remove { align-self: end; }
@media (max-width: 40rem) { .line-card { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .line-card__remove { justify-self: end; } }

/* ---- Help: the manual inside the app ---- */
/* The header's "?": opens the manual's page for where you are. */
.help-link { display: inline-grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 50%; border: 1px solid var(--line);
  background: var(--page); color: var(--accent-text); font-weight: 700; text-decoration: none; }
.help-link:hover { background: var(--tint); }
/* The index: a band with the search, then the pages as tiles. */
.help-hero { display: flex; gap: 1rem; align-items: flex-start; margin-bottom: 1.75rem; padding: 1.5rem; border-radius: var(--radius); background: var(--tint); }
.help-hero h1 { margin: 0 0 0.25rem; }
.help-hero p { margin: 0; color: var(--muted); max-width: 44rem; }
.help-hero__icon { width: 2.5rem; height: 2.5rem; color: var(--accent-text); margin-top: 0.2rem; }
.help-search { display: grid; gap: 0.3rem; max-width: 30rem; margin-top: 1rem; font-size: 0.8125rem; font-weight: 600; }
.help-search input { width: 100%; font-size: 1rem; padding: 0.65rem 0.9rem; border-radius: 999px; }
.help-section-title { font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 0 0 0.75rem; }
.help-tiles, .help-results { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.85rem; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); }
.help-results { grid-template-columns: 1fr; max-width: 48rem; }
.help-tile { position: relative; display: flex; gap: 0.85rem; align-items: flex-start; padding: 1rem 1.1rem; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); }
.help-tile p { margin: 0.25rem 0 0; color: var(--muted); font-size: 0.875rem; line-height: 1.5; }
.help-tile__icon { flex: none; color: var(--accent-text); margin-top: 0.1rem; }
.help-tile__title { font-weight: 600; color: var(--ink); text-decoration: none; }
.help-tile__title::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.help-tile:hover { border-color: var(--accent-text); box-shadow: 0 4px 14px var(--shadow); }
.help-tile:hover .help-tile__title { color: var(--accent-text); }
.help-tile__title:focus-visible { outline: none; }
.help-tile__title:focus-visible::after { outline: 3px solid var(--focus); outline-offset: 2px; }
/* The opening page leads, full width, standing on the underscore. */
.help-tile--lead { grid-column: 1 / -1; padding: 1.25rem 1.4rem; }
.help-tile--lead .help-tile__title { font-size: 1.15rem; }
.help-tile--lead .help-tile__title::before { content: ""; position: absolute; left: 1.4rem; bottom: 0.9rem; width: 1.5rem; height: 3px; border-radius: 2px; background: var(--accent); }
.help-results mark { background: var(--tint); color: var(--ink); border-radius: 3px; padding: 0 0.1em; }
/* An article, with "On this page" beside it on wide screens, and the pages before and after. */
.help-page { display: grid; gap: 1.25rem; align-items: start; margin-top: 0.5rem; }
.help-page--toc { grid-template-columns: minmax(0, 1fr) 14rem; }
@media (max-width: 60rem) { .help-page--toc { grid-template-columns: minmax(0, 1fr); } }
.help-article { max-width: 48rem; line-height: 1.65; margin: 0; }
.help-article__icon { color: var(--accent-text); margin-bottom: 0.5rem; }
.help-article h1 { margin-top: 0; }
.help-article h2 { margin-top: 1.75rem; }
.help-article p, .help-article li { max-width: 68ch; }
.help-article code { font-size: 0.85em; background: var(--tint); padding: 0.05em 0.35em; border-radius: 4px; }
.help-article table { border-collapse: collapse; margin: 1rem 0; font-size: 0.875rem; }
.help-article th, .help-article td { border-bottom: 1px solid var(--line); padding: 0.4rem 0.75rem 0.4rem 0; text-align: left; }
/* The manual's pictures (the images folder beside its pages): the full width of the text, a thin frame all round. */
.help-article p:has(> img) { max-width: none; }
.help-article img { display: block; max-width: 100%; height: auto; margin: 0.75rem 0; border: 1px solid var(--line); border-radius: var(--radius-small); }
.help-topic { scroll-margin-top: calc(var(--header-h, 4rem) + 1rem); }
.help-toc { position: sticky; top: calc(var(--header-h, 4rem) + 1rem); font-size: 0.875rem; }
.help-toc__title { margin: 0 0 0.5rem; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.help-toc ol { list-style: none; margin: 0; padding: 0 0 0 0.75rem; border-left: 1px solid var(--line); display: grid; gap: 0.4rem; }
.help-toc a { color: var(--muted); text-decoration: none; }
.help-toc a:hover { color: var(--accent-text); }
.help-pager { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1.5rem; max-width: 48rem; }
.help-pager__link { display: grid; gap: 0.15rem; padding: 0.75rem 1rem; border: 1px solid var(--line); border-radius: var(--radius-small);
  background: var(--card); color: var(--ink); font-weight: 600; text-decoration: none; }
.help-pager__link:hover { border-color: var(--accent-text); }
.help-pager__link--next { margin-left: auto; text-align: right; }

/* ---- Key figures in a row ---- */
.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 0.75rem; margin-bottom: 1rem; }

/* ---- Selectable rows: a list you pick one line from, to work on it beside the list ---- */
.table tbody tr.is-selectable { cursor: pointer; }
.table tbody tr.is-selectable:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
/* Drawn like the menu: a light fill on hover; the chosen line's first cell in ink with the brand's underscore under it. */
.table tbody tr.is-selectable:hover { background: var(--page); }
.table tbody tr[aria-selected="true"] td:first-child { position: relative; color: var(--ink); font-weight: 600; }
.table tbody tr[aria-selected="true"] td:first-child::after { content: ""; position: absolute; left: 0.8rem; bottom: 0.3rem; width: 1.25rem; height: 3px; border-radius: 2px; background: var(--accent); }

/* ---- Linked rows: a row whose main link has .row-link opens from anywhere on the row (the app's tables.js) ---- */
.table tbody tr:has(.row-link) { cursor: pointer; }
.table tbody tr:has(.row-link):hover { background: var(--tint); }
.table tbody tr:has(.row-link):hover .row-link { text-decoration: underline; }

/* ---- Suggestions: what something could be, best first, each with its action ---- */
.suggestions { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.suggestion { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 0.75rem; align-items: center; padding: 0.65rem 0.8rem;
  border: 1px solid var(--line); border-radius: var(--radius-small); background: var(--card); }
.suggestion__text { display: grid; min-width: 0; }
.suggestion__text b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggestion__text small { color: var(--muted); font-size: 0.75rem; }
.suggestion .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.suggestion--exact { border-color: var(--accent-text); box-shadow: inset 0 -3px 0 var(--accent); }
@media (max-width: 40rem) { .suggestion { grid-template-columns: minmax(0, 1fr) auto; } .suggestion .btn { grid-column: 1 / -1; justify-self: start; } }


/* ---- Folders: where things are filed, with how many; a column beside the list, a scrolling row on a phone ---- */
.folders { display: grid; gap: 0.15rem; align-content: start; }
.folder { display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem 0.7rem; border-radius: var(--radius-small); color: var(--ink);
  text-decoration: none; font-size: 0.875rem; }
.folder .i { width: 18px; height: 18px; color: var(--muted); flex: none; }
.folder__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder .count { color: var(--muted); font-size: 0.75rem; font-variant-numeric: tabular-nums; }
/* Drawn like the menu: quiet until hovered; the open folder in ink with the brand's underscore under its name (on the row,
   as the name clips long names). */
.folder { position: relative; color: var(--muted); font-weight: 500; }
.folder:hover { color: var(--ink); background: var(--page); }
.folder[aria-current="page"] { color: var(--ink); font-weight: 600; }
.folder[aria-current="page"]::after { content: ""; position: absolute; left: calc(0.7rem + 18px + 0.6rem); bottom: 0.2rem; width: 1.25rem; height: 3px; border-radius: 2px; background: var(--accent); }
@media (max-width: 48rem) {
  .folders { display: flex; overflow-x: auto; gap: 0.25rem; padding-bottom: 0.25rem; }
  .folder { flex: none; }
}

/* ---- Toolbar above a list: search first, filters after ---- */
.toolbar { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 0.75rem; }
.toolbar__search { flex: 1 1 14rem; min-width: 0; }
.toolbar__search .input { width: 100%; }
.toolbar > .input, .toolbar > label:not(.toolbar__search) .input { width: auto; }
/* A note beside a field with a caption: level with the field, not with its caption. */
.toolbar > span { align-self: flex-end; display: inline-flex; align-items: center; min-height: 2.5rem; }

/* ---- Group rows: a heading row that splits a long table, e.g. by month ---- */
.table tbody tr.table__group th { padding: 1rem 0.75rem 0.35rem; background: none; border-bottom: 1px solid var(--line); color: var(--muted);
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; text-align: left; }
.table tbody tr.table__group:hover { background: none; }
@media (max-width: 40rem) { .table tbody tr.table__group { display: block; } .table tbody tr.table__group th { display: block; } }

/* ---- A total row inside a table (the VAT payable between the VAT and the boxes) ---- */
.table tbody tr.table__total td { font-weight: 700; border-top: 1.5px solid var(--ink); }
.table tbody tr.table__total td.num { box-shadow: inset 0 -3px 0 var(--accent); }

/* Date field (DateInput): typed text, with a calendar button that opens the browser's own date picker */
.date-input { position: relative; display: flex; align-items: center; min-width: 0; }
.date-input > input[type="text"] { flex: 1; min-width: 0; padding-right: 1.9rem; }
.date-input__native { position: absolute; right: 0; bottom: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; border: 0; padding: 0; }
.date-input__pick { position: absolute; right: 0.3rem; display: inline-grid; place-items: center; width: 1.4rem; height: 1.4rem; padding: 0; border: 0; border-radius: 4px; background: transparent; color: var(--muted); cursor: pointer; }
.date-input__pick:hover { color: var(--ink); background: var(--tint); }
.date-input__pick:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---- Chat (Sumline, docs/adr/0039): the list of conversations, the message list, the composer, presence, the header button and the side panel ---- */
.chat { display: grid; grid-template-columns: minmax(13rem, 17rem) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.chat-list { display: grid; gap: 0.25rem; position: sticky; top: calc(var(--header-h, 4rem) + 1rem); max-height: calc(100vh - var(--header-h, 4rem) - 2rem); overflow-y: auto; }
.chat-list__heading { margin: 0.75rem 0 0.25rem; color: var(--muted); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.chat-list__items { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.1rem; }
.chat-list__item { display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0.6rem 0.5rem; border-radius: var(--radius-small); color: var(--ink); text-decoration: none; font-size: 0.9rem; }
.chat-list__item:hover { background: var(--page); }
/* The open conversation's name stands on the underscore, as the current page does in the side menu. */
.chat-list__item[aria-current] { font-weight: 600; }
.chat-list__item.is-unread .chat-list__name { font-weight: 700; }
.chat-list__name { position: relative; flex: 1; min-width: 0; overflow-x: clip; overflow-y: visible; text-overflow: ellipsis; white-space: nowrap; }
.chat-list__item[aria-current] .chat-list__name::after { content: ""; position: absolute; left: 0; bottom: -0.3rem; width: 1.25rem; height: 3px; border-radius: 2px; background: var(--accent); }
/* A record's thread says what the record is: "Faktura 24 Byggeriet Nord A/S". */
.chat-list__kind { flex: none; color: var(--muted); font-size: 0.75rem; }
.chat-pane__record { margin: 0.15rem 0 0; }
.chat-list--panel { position: static; max-height: none; overflow: visible; }
.chat-list__mention { color: var(--accent-text); font-weight: 700; }

/* A column: the log takes the free height whatever else is shown (a header or not, the typing line, live regions,
   replies, uploads, an error), never a counted row of a grid. */
.chat-pane { display: flex; flex-direction: column; gap: 0.5rem; min-height: min(70vh, 44rem); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; }
.chat-pane--compact { min-height: 0; border: 0; padding: 0; background: none; }
.chat-pane > * { flex: none; }
.chat-pane > .chat-log { flex: 1 1 auto; min-height: min(8rem, 30vh); }
.chat-pane__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.chat-pane__title { margin: 0; font-size: 1.125rem; }
.chat-pane__tools { display: flex; align-items: center; gap: 0.5rem; }
.field--inline { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; }
.input--small { min-height: 2.1rem; padding: 0.25rem 0.5rem; }

.chat-log { overflow-y: auto; max-height: min(60vh, 40rem); padding-right: 0.25rem; scroll-behavior: smooth; }
.chat-pane--compact .chat-log { max-height: 50vh; }
.chat-log__more { text-align: center; margin: 0 0 0.5rem; }
.chat-messages { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.15rem; }
.chat-message { padding: 0.45rem 0.6rem; border-radius: var(--radius-small); }
.chat-message:hover, .chat-message:focus-within { background: color-mix(in srgb, var(--tint) 55%, transparent); }
.chat-message:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.chat-message--mention { background: var(--amber-tint); }
.chat-message__mentioned { color: var(--amber); font-size: 0.75rem; font-weight: 600; }
.chat-message--deleted .chat-message__text { font-style: italic; }
.chat-message__head { display: flex; align-items: baseline; gap: 0.5rem; flex-wrap: wrap; }
.chat-message__head .avatar { align-self: center; }
.avatar--small { width: 1.6rem; height: 1.6rem; font-size: 0.6875rem; }
.chat-message__author { font-size: 0.9rem; }
.chat-message__text { margin: 0.15rem 0 0 2.1rem; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; }
.chat-message__actions { display: none; gap: 0.25rem; margin: 0.2rem 0 0 2.1rem; }
.chat-message:hover .chat-message__actions, .chat-message:focus-within .chat-message__actions { display: flex; }
@media (hover: none) { .chat-message__actions { display: flex; } }
.chat-quote { margin: 0.2rem 0 0 2.1rem; padding: 0.25rem 0.6rem; border-radius: var(--radius-small); background: var(--tint); color: var(--muted); font-size: 0.85rem; }
.chat-files { list-style: none; margin: 0.35rem 0 0 2.1rem; padding: 0; display: grid; gap: 0.35rem; }
.chat-file { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; font-size: 0.875rem; }
.chat-file img { display: block; max-width: min(18rem, 100%); max-height: 14rem; border-radius: var(--radius-small); border: 1px solid var(--line); }
.chat-receipt { margin: 0.15rem 0 0 2.1rem; text-align: right; }
.chat-day, .chat-new { display: flex; align-items: center; gap: 0.75rem; margin: 0.6rem 0 0.3rem; color: var(--muted); font-size: 0.75rem; font-weight: 600; }
.chat-day::before, .chat-day::after, .chat-new::before, .chat-new::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.chat-new { color: var(--red); }
.chat-new::before, .chat-new::after { background: var(--red); }
.chat-typing { min-height: 1.2em; margin: 0; }

.chat-composer { display: grid; gap: 0.4rem; border-top: 1px solid var(--line); padding-top: 0.6rem; }
.chat-composer.is-drop, .chat-composer:has(.is-drop) { outline: 2px dashed var(--accent-text); outline-offset: 4px; border-radius: var(--radius-small); }
.chat-composer__text { width: 100%; min-height: 3rem; max-height: 12rem; resize: vertical; font: inherit; line-height: 1.4; }
.chat-composer__actions { display: flex; align-items: center; gap: 0.5rem; justify-content: flex-end; flex-wrap: wrap; }
.chat-composer__attach { position: relative; margin-right: auto; }
.chat-composer__context { display: flex; align-items: center; gap: 0.5rem; margin: 0; color: var(--muted); }
.chat-uploads { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.35rem; }
.chat-uploads li { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.1rem 0.25rem 0.1rem 0.6rem; border-radius: 999px; background: var(--tint); }
.chat-mention { display: flex; gap: 0.5rem; align-items: flex-start; }
.chat-mention .combo { flex: 1; }
/* The composer sits at the foot of the page or the drawer: its colleagues open above the field, not off the screen. */
.chat-mention .picker__list { inset: auto 0 calc(100% + 4px); max-height: min(18rem, 45vh); }
.chat-people { display: grid; gap: 0.35rem; border: 0; padding: 0; margin: 0.5rem 0; }
.chat-people legend { font-weight: 600; margin-bottom: 0.35rem; }
.chat-form { margin-bottom: 1rem; }

/* Presence: a dot beside a person, green while they have a page or an app open. */
.presence { display: inline-block; flex: none; width: 0.6rem; height: 0.6rem; border-radius: 50%; border: 1.5px solid var(--muted); background: transparent; }
.presence--online { border-color: var(--green); background: var(--green); }

/* The header's chat button: a round button like the help link, with the unread count. A link to the chat page on a
   phone (the bottom bar has Chat too), the side panel's button on a wider screen. */
.chat-launch { position: relative; display: inline-grid; place-items: center; flex: none; width: 2.25rem; height: 2.25rem; padding: 0; border-radius: 50%;
  border: 1px solid var(--line); background: var(--page); color: var(--ink); cursor: pointer; text-decoration: none; }
.chat-launch:hover, .chat-launch[aria-expanded="true"] { background: var(--tint); }
.chat-launch .i { width: 18px; height: 18px; }
.chat-launch .badge--count { position: absolute; top: -0.35rem; right: -0.5rem; min-width: 1.15rem; padding: 0 0.3rem; font-size: 0.625rem; line-height: 1.15rem; }
.chat-launch--panel { display: none; }
/* On a phone the bottom bar has Chat already, and the header has no room to spare. */
@media (max-width: 39.99rem) { body:has(.bottombar) .chat-launch--page { display: none; } }
@media (min-width: 60rem) {
  .chat-launch--page { display: none; }
  .chat-launch--panel { display: inline-grid; }
}

/* The side panel: docked to the right below the header, the full height. On a wide screen (90rem) the page narrows beside
   it; narrower, it lies over the page; on a phone it takes the width, above the bottom bar. */
:root { --chat-panel-w: 24rem; }
.chat-panel-toggle { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 15; box-shadow: 0 4px 16px var(--shadow); }
/* Never over a page's last controls (the invoice's Issue now, the bill's Approve): room below the content for it, and
   below a side panel that stays in view, so they scroll clear of it. */
body:has(.chat-panel-toggle) .content { padding-bottom: 6rem; }
body:has(.chat-panel-toggle) :is(.invoice-side, .bank-panel, .booking-panel) { padding-bottom: 3.5rem; }
.chat-panel { position: fixed; z-index: 16; top: var(--chat-panel-top, var(--header-h, 4rem)); right: 0; bottom: 0; width: min(var(--chat-panel-w), 100vw);
  display: flex; flex-direction: column; gap: 0.6rem; padding: 0.75rem 1rem 1rem; background: var(--card); border-left: 1px solid var(--line);
  box-shadow: -8px 0 24px var(--shadow); }
.chat-panel__head { display: flex; align-items: center; gap: 0.25rem; }
.chat-panel__title { flex: 1; margin: 0; font-size: 1rem; }
.chat-panel__switch { align-self: flex-start; }
.chat-panel__body { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow-y: auto; margin: 0 -0.35rem; padding: 0.2rem 0.35rem; } /* room for the focus ring */
.chat-panel__back { margin: 0 0 0.25rem; }
.chat-panel .chat-pane--compact { flex: 1; min-height: 0; }
.chat-panel .chat-pane--compact .chat-log { max-height: none; }
@media (min-width: 90rem) {
  .shell:has(.chat-panel) { width: calc(100% - var(--chat-panel-w)); margin-left: max(0px, calc((100% - var(--chat-panel-w) - 90rem) / 2)); margin-right: var(--chat-panel-w); }
  body:has(.chat-panel) .footer { padding-right: calc(var(--chat-panel-w) + 1rem); }
  .chat-panel { box-shadow: none; }
}
@media (max-width: 59.99rem) {
  .chat-panel { width: 100vw; border-left: 0; }
  body:has(.bottombar) .chat-panel { bottom: calc(var(--bottombar-h, 3.75rem) + env(safe-area-inset-bottom, 0px)); }
  body:has(.bottombar) .chat-panel-toggle { bottom: calc(var(--bottombar-h, 3.75rem) + 0.75rem + env(safe-area-inset-bottom, 0px)); }
}

@media (max-width: 52rem) {
  .chat { grid-template-columns: minmax(0, 1fr); }
  .chat-list { position: static; max-height: none; }
}

/* The client card's records (ADR 0041): a quiet list, newest first, a photo at a readable size. */
.record-list { list-style: none; margin: 0.75rem 0 0; padding: 0; }
.record-list li { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding: 0.6rem 0; border-bottom: 1px solid var(--line); }
.record-list li:last-child { border-bottom: 0; }
.record-list p { margin: 0.2rem 0; }
.record-list img { display: block; max-width: min(240px, 100%); height: auto; margin: 0.35rem 0; border: 1px solid var(--line); border-radius: var(--radius-small); }

/* The product a scanned barcode found in a stock count (ADR 0043): a tint, not a bar. */
.table tr.row--found td { background: var(--tint); }

/* A code shown once to pass on (a link's invitation, ADR 0046): large, spaced, easy to read out. */
.code-display { font-family: var(--font-mono, ui-monospace, monospace); font-size: 1.4rem; letter-spacing: 0.08em; margin: 0.5rem 0 1rem; }

/* ---- Recipes and diet plans (ADR 0064) ----
   The library as tiles with the dish's photo; a recipe's photo beside its ingredients; the form with what a portion gives
   beside it; the figures in a table with the total in bold; a plan's meals as blocks of items. A target missed is said in
   words and tinted, never a coloured bar. */
/* A row's name in a table (th scope="row"): it reads as the row's first cell, not as a column heading. */
.table tbody th[scope="row"] { font-size: inherit; font-weight: 500; color: var(--ink); text-transform: none; letter-spacing: 0; background: none; text-align: left; }
/* The library: a tile per recipe, the photo (4:3) over its name, a blank tint when it has none. */
.recipe-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: 1rem; margin: 0.5rem 0 1rem; padding: 0; list-style: none; }
.recipe-tile { display: grid; gap: 0.25rem; align-content: start; min-width: 0; }
.recipe-tile a { display: grid; gap: 0.35rem; color: var(--ink); text-decoration: none; font-weight: 600; border-radius: var(--radius-small); }
.recipe-tile a:hover .recipe-tile__name { color: var(--accent-text); text-decoration: underline; }
.recipe-tile a:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.recipe-tile img, .recipe-tile__blank { display: block; width: 100%; aspect-ratio: 4 / 3; height: auto; object-fit: cover; border-radius: var(--radius-small); border: 1px solid var(--line); background: var(--tint); }
.recipe-tile .badge { justify-self: start; }
/* A recipe: its photo beside the ingredients from a tablet's width up, above them on a phone. */
.recipe-head { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); }
.recipe-photo { display: block; width: 100%; max-width: 28rem; height: auto; border-radius: var(--radius-small); border: 1px solid var(--line); }
@media (min-width: 48rem) { .recipe-head:has(.recipe-photo) { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); } }
/* The recipe's form with what a portion gives beside it, staying in view on a wide screen. */
.recipe-edit { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 64rem) { .recipe-edit { grid-template-columns: minmax(0, 3fr) minmax(16rem, 2fr); } .recipe-edit__figures { position: sticky; top: 1rem; } }
/* Beside the recipe form: what each ingredient gives a portion, its share of the energy as a thin bar, and one that
   lacks data tinted, with a word saying why. */
.recipe-parts { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.recipe-parts h3 { margin: 0 0 0.5rem; font-size: 1rem; }
.recipe-parts__lacking { color: var(--amber); font-weight: 600; }
.recipe-parts__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.recipe-part { position: relative; display: grid; gap: 0.2rem; padding: 0.5rem 0.6rem; border-radius: 8px; background: var(--page); }
.recipe-part--lacking { background: var(--amber-tint); }
/* A part with a food opens the food's page from anywhere on it: the link's area stretched over the card. */
.recipe-part__link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.recipe-part:has(.recipe-part__link):hover { background: var(--tint); }
.recipe-part--lacking:has(.recipe-part__link):hover { background: var(--amber-tint); }
.recipe-part .status { justify-self: start; white-space: normal; }
.recipe-part__head { display: flex; gap: 0.75rem; justify-content: space-between; align-items: baseline; }
.recipe-part__head .num { white-space: nowrap; font-variant-numeric: tabular-nums; }
.recipe-part__figures { display: flex; flex-wrap: wrap; gap: 0.15rem 0.75rem; font-variant-numeric: tabular-nums; }
.recipe-part__share { height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.recipe-part__share span { display: block; height: 100%; background: var(--accent); }
/* A recipe as a PDF: the number of portions, down and up, then the download. */
.recipe-pdf { display: flex; flex-wrap: wrap; gap: 0.5rem 0.75rem; align-items: center; margin: 0.25rem 0 1rem; }
.recipe-edit__pdf { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.recipe-edit__pdf h3 { margin: 0 0 0.5rem; font-size: 1rem; }
.recipe-edit__pdf .recipe-pdf { margin-bottom: 0.25rem; }
.stepper { display: inline-flex; align-items: center; gap: 0.25rem; }
.stepper .input { width: 4.5rem; }
/* A food's page on a phone: the core nutrients as tiles, the rest one line each in folded groups (a tap shows each
   source's value), instead of the side-by-side table, which is for wide screens. */
.food-phone { display: none; }
@media (max-width: 40rem) {
  .food-wide { display: none; }
  .food-phone { display: grid; gap: 0.75rem; }
}
.food-phone__title { margin: 0; font-size: 1rem; }
.food-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; }
.food-tile { display: grid; align-content: start; gap: 0.1rem; padding: 0.55rem 0.65rem; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); }
.food-tile__label { color: var(--muted); font-size: 0.75rem; }
.food-tile__value { font-size: 1.0625rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.food-tile__value small { font-size: 0.75rem; font-weight: 400; color: var(--muted); }
.food-tile__range { color: var(--amber); font-size: 0.6875rem; }
.food-group { border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); }
.food-group > summary { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; padding: 0.6rem 0.8rem; font-weight: 600; color: var(--ink); cursor: pointer; }
.food-lines { list-style: none; margin: 0; padding: 0 0.8rem 0.4rem; }
.food-lines > li + li { border-top: 1px solid var(--line); }
.food-line > summary { display: flex; justify-content: space-between; align-items: baseline; gap: 0.75rem; padding: 0.4rem 0; cursor: pointer; list-style: none; color: var(--ink); font-weight: 400; }
.food-line > summary::-webkit-details-marker { display: none; }
.food-line__name { min-width: 0; overflow-wrap: anywhere; }
.food-line__value { white-space: nowrap; font-weight: 600; font-variant-numeric: tabular-nums; }
.food-line__sources { list-style: none; margin: 0 0 0.4rem; padding: 0.3rem 0.5rem; border-radius: 6px; background: var(--page); font-size: 0.8125rem; }
.food-line__sources li { display: flex; justify-content: space-between; gap: 0.75rem; color: var(--muted); }
.food-line__sources li.is-used { color: var(--ink); font-weight: 600; }
/* A recipe's page on a phone: the photo, the tags as chips and the actions in a row; what a portion gives as the food
   page's tiles; the ingredients and what each gives as one list; the method as steps. The folds are for wide screens. */
.recipe-phone { display: none; }
@media (max-width: 40rem) {
  .recipe-wide { display: none; }
  .recipe-phone { display: grid; gap: 0.75rem; }
}
.recipe-phone .recipe-photo { max-width: none; border-radius: var(--radius); }
.recipe-phone__meta { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0; }
.recipe-phone__tag { background: var(--page); color: var(--ink); border: 1px solid var(--line); }
.recipe-phone__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; }
.recipe-phone__actions .recipe-pdf { margin: 0; gap: 0.5rem; }
.recipe-phone__actions .stepper .input { width: 3.25rem; }
.recipe-phone > p { margin: 0; }
.recipe-phone__method { padding: 0 0.8rem 0.7rem; }
.recipe-phone__facts { padding: 0 0.8rem 0.6rem; margin: 0; }
.recipe-phone__more { display: flex; flex-wrap: wrap; gap: 0.5rem; }
/* The food database's page: its sources listed under the search, apart from the hits. */
.food-database__sources { margin-top: 1.5rem; }
/* A food's page: each source's values side by side; where they differ, said in a word in the amber colour. */
.food-sources th small { font-weight: 400; }
.food-sources__differ { color: var(--amber); font-weight: 600; }
.food-sources__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.5rem 1rem; }
.food-sources__head h2 { margin: 0; }
.food-sources__group th { padding: 0; background: var(--tint); }
.food-sources__fold { display: flex; align-items: baseline; gap: 0.5rem; width: 100%; padding: 0.55rem 0.6rem; border: 0; background: none; color: var(--ink); font: inherit; font-weight: 700; text-align: left; cursor: pointer; }
.food-sources__group th:has(.food-sources__fold:hover) { background: color-mix(in srgb, var(--tint) 70%, var(--line)); }
.food-line__help { margin: 0 0 0.4rem; }
.fodmap-badge { margin-inline-start: 0.35rem; vertical-align: 0.1em; }
.recipe-fodmap { margin: 0.6rem 0 0; }
/* On a phone a value's line is the source's name, wrapping if it must, and the number at the right: a source's name
   (LIVSMEDELSDATABASEN) is longer than the folded table's label column. */
@media (max-width: 40rem) {
  .table.food-sources td { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding-left: 0; }
  .table.food-sources td::before { position: static; flex: 1 1 auto; min-width: 0; width: auto; overflow-wrap: anywhere; }
  /* A long nutrient's name wraps, and a row is never wider than the table: the rows are grid items, which grow to
     their widest unbreakable line (and a table's heading never wraps) unless told not to. */
  .table.food-sources tbody tr { min-width: 0; }
  .table.food-sources th[scope="row"] { display: block; white-space: normal; }
}
/* What food gives (energy, protein, carbohydrate, fat, fibre): a row a portion, a meal or a day; the total in bold. */
.table tbody tr.nutrition__total th, .table tbody tr.nutrition__total td { font-weight: 700; color: var(--ink); }
/* A plan's day: its meals as blocks divided by a line, the name and what the meal gives on one line, then its items. */
.plan-meal { padding: 0.75rem 0; border-top: 1px solid var(--line); }
.plan-meal:first-child { padding-top: 0; border-top: 0; }
.plan-meal__head { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: baseline; justify-content: space-between; }
.plan-meal__head h3, .plan-meal__name { margin: 0; font-weight: 600; }
.plan-meal__name { max-width: 16rem; }
.plan-items { margin: 0.5rem 0; padding: 0; list-style: none; }
.plan-items li { display: flex; flex-wrap: wrap; gap: 0.35rem 0.5rem; align-items: center; padding: 0.25rem 0; }
.plan-items li > span:first-child { flex: 1 1 12rem; min-width: 0; }
.plan-items input[type="number"] { width: 5.5rem; text-align: right; font-variant-numeric: tabular-nums; }
.plan-items__note { flex: 1 1 8rem; max-width: 14rem; }
/* A few fields and their buttons on one line, wrapping on a phone (a day's name, adding to a meal, a nutrient). */
.inline-fields { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: end; margin: 0.5rem 0; }
.inline-fields > label { display: grid; gap: 0.25rem; font-size: 0.8125rem; font-weight: 600; }
/* A figure off its target (under 90 % or over 110 %): attention's amber tint and the word ("· for lidt"), never a colour
   alone. The amber tint, not the theme's, as the theme's tint is too close to a dark card to be seen. */
.table td.target-off { background: var(--amber-tint); color: var(--amber); font-weight: 600; white-space: nowrap; }

/* ---- Booking on a phone and today's agenda (#339, #340) ----
   On a phone the calendar has two tabs: one day as a calendar (the week's grid with one column, the default) or the week
   as a list. The time now is a line across today's column in the accent, like the underscore. An appointment business's
   overview opens on today's times in order, the next one said in words on a badge, the ones gone by quiet. */
.booking-phone, .booking-dayview { display: none; }
.booking-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--accent); pointer-events: none; z-index: 1; }
.booking-now::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
/* The day between its arrows, "Mandag 16. november", in the link colour when it is today; "I dag" leads back. */
.booking-dayview__nav { margin-bottom: 0.5rem; }
.booking-dayview__nav h3 { flex: 1; margin: 0; font-size: 0.9375rem; text-align: center; }
.booking-dayview__nav h3::first-letter { text-transform: uppercase; }
.booking-dayview__nav h3.is-today { color: var(--accent-text); }
.booking-week--day .booking-week__body { min-width: 0; grid-template-columns: 3rem minmax(0, 1fr); }
@media (max-width: 48rem) {
  .booking-phone.segmented { display: inline-flex; margin-bottom: 0.75rem; }
  .booking-dayview { display: block; }
  .booking-dayview .booking-week { display: block; overflow: visible; }
  .booking-agenda--hidden { display: none !important; }
}
/* Today's agenda: a card with "I dag", the count and the way to the calendar, then a line per appointment. */
.today-agenda { margin-bottom: 1rem; }
.today-agenda__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem 0.9rem; margin-bottom: 0.5rem; }
.today-agenda__head h2 { margin: 0; }
.today-agenda__head .btn { margin-left: auto; }
.today-agenda__list { margin: 0; padding: 0; list-style: none; }
.today-agenda__list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.75rem; padding: 0.55rem 0; border-bottom: 1px solid var(--line); }
.today-agenda__list li:last-child { border-bottom: 0; }
.today-agenda__time { min-width: 6.5rem; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 0.875rem; }
.today-agenda__who { flex: 1 1 12rem; min-width: 0; }
.today-agenda__list li.is-past { opacity: 0.6; }
.today-agenda__list li:has(.today-agenda__who a) { position: relative; cursor: pointer; }
.today-agenda__list li:has(.today-agenda__who a):hover { background: var(--tint); }
.today-agenda__who a { color: inherit; text-decoration: none; }
.today-agenda__who a::after { content: ""; position: absolute; inset: 0; }
.today-agenda__who a:hover, .today-agenda__who a:focus-visible { text-decoration: underline; }
.today-agenda__list li.is-next .today-agenda__time { color: var(--ink); font-weight: 600; }

/* ---- Help tip: a small "?" beside a label, its text on hover, focus or a tap ---- */
.help-tip { position: relative; display: inline-flex; vertical-align: middle; }
.help-tip__button { display: inline-grid; place-items: center; width: 1.15rem; height: 1.15rem; padding: 0; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--card); color: var(--muted); font-size: 0.7rem; font-weight: 600; line-height: 1; cursor: help; }
.help-tip__button:hover, .help-tip__button:focus-visible { color: var(--ink); border-color: var(--ink); }
.help-tip__text { position: absolute; z-index: 20; left: -0.5rem; bottom: calc(100% + 6px); width: max-content; max-width: min(20rem, 80vw); padding: 0.5rem 0.65rem; border-radius: var(--radius-small); background: var(--ink); color: var(--card); font-size: 0.8rem; font-weight: 400; line-height: 1.4; text-align: left; white-space: normal; box-shadow: 0 8px 24px var(--shadow); visibility: hidden; opacity: 0; transition: opacity 0.12s; pointer-events: none; }
.help-tip:hover .help-tip__text, .help-tip__button:focus-visible + .help-tip__text, .help-tip.is-open .help-tip__text { visibility: visible; opacity: 1; }
