/*
 * Finance Cockpit, Interaction Service: the one stylesheet of the own GUI (A13.7a, TD-M1 B12.x "GUI layout and theming").
 * Served by the service itself: no build step, no framework, no third-party request, system font stack only, no font file, no image reference.
 *
 * DESIGN SYSTEM (UX refresh U1, CFO feedback 2026-10-15: "more modern"). Look: white and light neutral surfaces, generous whitespace, large bold headlines,
 * ONE accent (the Logicstream orange) on the primary buttons, the active navigation item and the icons, soft cards, dark footer line. Structure of this file:
 *   1. tokens (the single :root block: colours, spacing scale, radius, shadow, typography scale)
 *   2. base and page frame (top bar, left navigation, page header, footer, responsive collapse)
 *   3. components: card, KPI tile, tabs (segmented and pill), buttons, badges and status chips, form fields, tables, alerts, empty state, skeleton
 *   4. screen specific rules of the existing pages (kept class names; they use the tokens only)
 * Every component class below can be used by a new view; the existing pages are restyled through their existing class names.
 *
 * DENSITY (UX step U2, CFO feedback 2026-10-16: "more compact, as much as possible on ONE screen"). COMPACT is the default and the only density a user sees on a
 * desktop: base font 13 px, small text 12 px, line height 1.35, controls 30 px high, table rows 4 px above and below, cards padded 12 px, a left navigation of 176 px and a thin top
 * bar. The previous (comfortable) sizes are kept as the custom properties `--comfortable-*` in the :root block. They are applied (a) on a touch device and on a screen narrower
 * than 900 px (media query near the end of the file: 44 px touch targets stay usable) and (b) by the class `density-comfortable` on html or body, which a later user preference
 * "Pohodlné zobrazení / Comfortable" can set (the preference itself is NOT built). Every size in this file comes from a density token, so one switch changes the whole GUI.
 *
 * THE PALETTE IS THE ONLY THING TO CHANGE. All colours of the GUI are the custom properties of the single :root block
 * below; no rule further down uses a colour literal. To apply the brand: replace the values in that block (and only there),
 * then run `python3 tools/contrast_check.py`, which checks every foreground/background
 * pair listed in the "pair:" comments of the block against WCAG AA (4.5:1) and fails when one is below.
 * There is no dark theme: the page keeps one light palette. The rules for increased contrast and reduced motion are at the end of the file.
 */

/* Refused form fields (lease card and other forms): the red mark of a control and its message under it. */
.field-invalid { border-color: var(--color-danger); }
.field-error { color: var(--color-danger); font-size: 0.9em; }

:root {
  /* Logicstream palette, derived 2026-10-11 from the pixels of the company logo (orange about #F09030, grey about #686868);
   NOT an official brand guide: replace the values here when exact brand codes exist. Orange is never used as text on white
   (2.4:1): it carries dark text (--color-brand-contrast) or is a rule/accent; links use the darkened orange --color-accent. */
  --color-primary: #686868;            /* secondary dark: language switch, graph line, user chip */
  --color-primary-contrast: #ffffff;   /* text on --color-primary */
  --color-brand: #f09030;              /* THE accent: primary buttons, active navigation item, icons, highlights */
  --color-brand-contrast: #1f1f1f;     /* text on --color-brand */
  --color-brand-soft: #fdf0e0;         /* light tint of the accent: active navigation item, icon slot (text: --color-text) */
  --color-bg: #f6f6f3;                 /* page background (light warm neutral) */
  --color-surface: #ffffff;            /* cards, tables, inputs, top bar */
  --color-surface-alt: #ecece8;        /* table header, hover rows, segmented tabs track */
  --color-zebra: #faf9f6;              /* every second table row */
  --color-line: #e2e1db;               /* decorative hairlines of cards, rows and dividers (not the border of a control) */
  --color-text: #1f2124;               /* body text */
  --color-muted: #55585d;              /* secondary text, notes, labels */
  --color-border: #8c8c8c;             /* borders of inputs and buttons (graphic object, at least 3:1) */
  --color-accent: #a64b00;             /* links, secondary highlights (darkened brand orange, AA on white) */
  --color-success: #1b6a38;            /* strong success colour (badge background) */
  --color-success-contrast: #ffffff;   /* text on --color-success */
  --color-success-soft: #e2f3e7;       /* success area background (text: --color-text) */
  --color-warning: #f2c230;            /* strong warning colour (badge background, shadow mark) */
  --color-warning-contrast: #222222;   /* text on --color-warning */
  --color-warning-soft: #fdf3d0;       /* warning area background (banner, text: --color-text) */
  --color-orange-soft: #fde8d0;         /* planned orders: row of the state overload (Produkce) */
  --color-orange: #f6a04d;              /* planned orders: badge of the state overload */
  --color-orange-line: #b85c00;
  --color-orange-text: #3b1d00;
  --color-danger: #b3261e;             /* strong danger colour (badge and danger button background) */
  --color-danger-contrast: #ffffff;    /* text on --color-danger */
  --color-danger-soft: #fce8e6;        /* refusal and error background (text: --color-danger-text) */
  --color-danger-text: #8a1b15;        /* text of refusal and error messages */
  --color-info-soft: #e9f0f8;          /* information area background (text: --color-text) */
  --color-info: #1f5a99;               /* strong information colour (badge background: marked paid) */
  --color-info-contrast: #ffffff;      /* text on --color-info */
  --color-notimpl: #5a4a8a;            /* border and accent of the badge "Not yet implemented" (Runs and calendar, TL-52) */
  --color-notimpl-soft: #ece8f5;       /* background of that badge (text: --color-text) */
  --color-focus: #1f2124;              /* focus ring, visible on --color-bg and --color-surface */
  --color-footer-bg: #1f2124;          /* dark footer line */
  --color-footer-text: #e3e4e6;        /* text on the footer */
  --color-footer-muted: #b4b7bc;       /* build identification on the footer */
  --zone-green: #228b22;               /* covenant headroom zones (A19.1.2): bar next to the zone word, never the only carrier */
  --zone-orange: #d4a000;
  --zone-red: #cc0000;
  --series-3: #6a3d9a;                 /* fifth line of the portfolio comparison chart (dots) */

  /* Pairs checked by tools/contrast_check.py (foreground, background); every pair must reach 4.5:1.
   * pair: --color-text --color-bg
   * pair: --color-text --color-surface
   * pair: --color-text --color-surface-alt
   * pair: --color-text --color-zebra
   * pair: --color-text --color-brand-soft
   * pair: --color-muted --color-bg
   * pair: --color-muted --color-surface
   * pair: --color-muted --color-surface-alt
   * pair: --color-muted --color-zebra
   * pair: --color-primary-contrast --color-primary
   * pair: --color-brand-contrast --color-brand
   * pair: --color-accent --color-bg
   * pair: --color-accent --color-surface
   * pair: --color-accent --color-surface-alt
   * pair: --color-accent --color-brand-soft
   * pair: --color-success-contrast --color-success
   * pair: --color-success --color-surface
   * pair: --color-text --color-success-soft
   * pair: --color-warning-contrast --color-warning
   * pair: --color-text --color-warning-soft
   * pair: --color-danger-contrast --color-danger
   * pair: --color-danger-text --color-danger-soft
   * pair: --color-danger-text --color-surface
   * pair: --color-text --color-info-soft
   * pair: --color-info-contrast --color-info
   * pair: --color-text --color-notimpl-soft
   * pair: --color-notimpl --color-surface
   * pair: --color-focus --color-bg
   * pair: --color-focus --color-surface
   * pair: --color-primary --color-surface
   * pair: --color-primary --color-bg
   * pair: --color-footer-text --color-footer-bg
   * pair: --color-footer-muted --color-footer-bg
   */

  /* DENSITY TOKENS, compact (the default). Typography scale and weights (system font stack, no external font). */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-size: 0.8125rem;              /* 13 px base */
  --line-height: 1.35;
  --text-xs: 0.6875rem;                /* 11 px: build line, micro labels only */
  --text-sm: 0.75rem;                  /* 12 px: small text, table headers, notes */
  --text-md: 0.8125rem;
  --text-lg: 0.9375rem;
  --text-xl: 1.125rem;
  --text-2xl: 1.4375rem;
  --text-kpi: 1.5rem;
  --weight-normal: 400;
  --weight-medium: 600;
  --weight-bold: 700;

  /* Spacing scale, radius and shadow. */
  --space-1: 0.1875rem;
  --space-2: 0.375rem;
  --space-3: 0.625rem;
  --space-4: 0.875rem;
  --space-5: 1.25rem;
  --space-6: 1.75rem;
  --radius-sm: 0.25rem;
  --radius: 0.375rem;
  --radius-lg: 0.625rem;
  --radius-pill: 999px;
  --shadow-1: 0 1px 2px rgba(31, 33, 36, 0.06), 0 1px 3px rgba(31, 33, 36, 0.05);
  --shadow-2: 0 4px 14px rgba(31, 33, 36, 0.10);

  /* Component sizes. Hit areas: every control is at least 24 px (--hit-min); the small button is exactly that. */
  --control-height: 1.875rem;          /* input, select, button: 30 px */
  --control-pad-y: 0.25rem;
  --control-pad-x: 0.625rem;
  --btn-height: 1.875rem;
  --btn-sm-height: 1.5rem;             /* 24 px */
  --btn-lg-height: 2.25rem;
  --hit-min: 1.5rem;
  --table-pad-y: 0.25rem;              /* row padding 4 px */
  --table-pad-x: 0.5rem;
  --card-pad: 0.75rem;                 /* 12 px */
  --nav-pad-y: 0.35rem;
  --icon-size: 1rem;
  --tab-pad-y: 0.3125rem;

  /* Frame dimensions. */
  --sidebar-width: 11rem;              /* 176 px */
  --page-max: 110rem;
  --topbar-height: 2.5rem;

  /* COMFORTABLE density (the sizes before U2). Not used by default: copied over the tokens above on touch devices and narrow screens (media query below) and by the class
     `.density-comfortable`. Frame dimensions (sidebar, top bar) are not part of it. */
  --comfortable-font-size: 1rem;
  --comfortable-line-height: 1.55;
  --comfortable-text-xs: 0.75rem;
  --comfortable-text-sm: 0.875rem;
  --comfortable-text-md: 1rem;
  --comfortable-text-lg: 1.125rem;
  --comfortable-text-xl: 1.375rem;
  --comfortable-text-2xl: 1.875rem;
  --comfortable-text-kpi: 1.75rem;
  --comfortable-space-1: 0.25rem;
  --comfortable-space-2: 0.5rem;
  --comfortable-space-3: 1rem;
  --comfortable-space-4: 1.5rem;
  --comfortable-space-5: 2rem;
  --comfortable-space-6: 3rem;
  --comfortable-control-height: 2.75rem;
  --comfortable-control-pad-y: 0.55rem;
  --comfortable-control-pad-x: 1rem;
  --comfortable-btn-height: 2.75rem;
  --comfortable-btn-sm-height: 2.25rem;
  --comfortable-btn-lg-height: 3rem;
  --comfortable-hit-min: 2.75rem;
  --comfortable-table-pad-y: 0.5rem;
  --comfortable-table-pad-x: 1rem;
  --comfortable-card-pad: 1.5rem;
  --comfortable-nav-pad-y: 0.55rem;
  --comfortable-icon-size: 1.25rem;
  --comfortable-tab-pad-y: 0.5rem;
  --mes-sum-bg: #dce6f2;              /* summary columns and rows of the Produkce tables (MES-UX-5) */
  --mes-seg-1: #2f5d8a; --mes-seg-2: #7ea0c6; --mes-seg-3: #b08a3e; --mes-seg-4: #5f8a5a;   /* chart segments of the Produkce charts (MES-UX-15, 18) */
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 100%; }
body {
  margin: 0; background: var(--color-bg); color: var(--color-text);
  font-family: var(--font-sans); font-size: var(--font-size); line-height: var(--line-height);
  min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--color-accent); }
h1 { font-size: var(--text-2xl); line-height: 1.2; letter-spacing: -0.01em; font-weight: var(--weight-bold); margin: 0; }
h2 { font-size: var(--text-xl); line-height: 1.3; font-weight: var(--weight-bold); margin: var(--space-4) 0 var(--space-2); }
h3 { font-size: var(--text-lg); line-height: 1.35; font-weight: var(--weight-medium); margin: var(--space-3) 0 var(--space-2); }
p { margin: 0 0 var(--space-2); }

/* Visible focus for every interactive element. */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, label.menu-button:focus-visible {
  outline: 3px solid var(--color-focus); outline-offset: 2px;
}

/* Icons (inline svg from Icons.php): size from the font, colour from the text around (stroke is currentColor). */
.icon { width: var(--icon-size); height: var(--icon-size); flex: 0 0 auto; display: inline-block; vertical-align: -0.2em; }

/* Top bar: slim, white, the logo on the left, help links, language switch. Stays on top while the page scrolls. */
.app-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-3);
  min-height: var(--topbar-height); padding: var(--space-1) var(--space-4);
  background: var(--color-surface); color: var(--color-text);
  border-bottom: 1px solid var(--color-line); box-shadow: var(--shadow-1);
}
.app-header a { color: var(--color-text); }
.brand { font-weight: var(--weight-bold); font-size: var(--text-lg); text-decoration: none; display: inline-flex; align-items: center; gap: var(--space-2); }
.brand-logo { height: 1.5rem; width: auto; }
.header-right { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.header-right .help-link { color: var(--color-muted); font-size: var(--text-sm); text-decoration: none; padding: var(--space-1) var(--space-2); border-radius: var(--radius); }
.header-right .help-link:hover { background: var(--color-surface-alt); color: var(--color-text); }
.notify { background: var(--color-warning); color: var(--color-warning-contrast); border-radius: var(--radius-pill); padding: 0 var(--space-2); font-weight: var(--weight-bold); font-size: var(--text-sm); }
.lang { display: flex; gap: 2px; padding: 2px; background: var(--color-surface-alt); border-radius: var(--radius-pill); }
.lang a { padding: 0 var(--space-3); border-radius: var(--radius-pill); text-decoration: none; font-size: var(--text-sm); line-height: 1.7; color: var(--color-muted); }
.lang a:hover { color: var(--color-text); }
.lang a[aria-current="true"] { background: var(--color-primary); color: var(--color-primary-contrast); font-weight: var(--weight-bold); }
.header-left { display: flex; align-items: center; gap: var(--space-3); }
.role { color: var(--color-muted); font-size: var(--text-sm); padding: 0 var(--space-2); border-left: 1px solid var(--color-line); }

/* Menu button for a narrow screen: a label for the checkbox #nav-toggle (first child of the body), so the menu opens with CSS only. Hidden on a wide screen. */
.menu-button { display: none; align-items: center; justify-content: center; width: var(--control-height); height: var(--control-height); border-radius: var(--radius); border: 1px solid var(--color-border); background: var(--color-surface); color: var(--color-text); cursor: pointer; }
.menu-button:hover { background: var(--color-surface-alt); }
.nav-toggle:focus-visible ~ .app-header .menu-button { outline: 3px solid var(--color-focus); outline-offset: 2px; }
.nav-toggle:checked ~ .app-header .menu-button { background: var(--color-brand-soft); border-color: var(--color-brand); }

/* Page frame: navigation on the left, the page in a centred column of limited width. */
.layout { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); gap: var(--space-4); padding: var(--space-3) var(--space-4) var(--space-5); flex: 1; width: 100%; max-width: var(--page-max); margin: 0 auto; }
.layout.no-nav { grid-template-columns: minmax(0, 1fr); max-width: 64rem; }
.layout > nav { position: sticky; top: calc(var(--topbar-height) + var(--space-4)); align-self: start; background: transparent; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.layout > nav a { display: flex; align-items: center; gap: var(--space-2); padding: var(--nav-pad-y) var(--space-3); border-radius: var(--radius); text-decoration: none; color: var(--color-text); font-weight: var(--weight-medium); }
.layout > nav a .icon { color: var(--color-muted); }
.layout > nav a:hover { background: var(--color-surface-alt); }
.layout > nav a:hover .icon { color: var(--color-text); }
.layout > nav a[aria-current="page"] { background: var(--color-brand-soft); color: var(--color-text); font-weight: var(--weight-bold); box-shadow: inset 3px 0 0 var(--color-brand); }
.layout > nav a[aria-current="page"] .icon { color: var(--color-accent); }
.layout > nav .nav-logout { margin-top: var(--space-2); border-top: 1px solid var(--color-line); border-radius: 0 0 var(--radius) var(--radius); padding-top: var(--space-3); color: var(--color-muted); font-weight: var(--weight-normal); }
.layout > nav .who { color: var(--color-muted); font-size: var(--text-sm); padding: var(--space-2) var(--space-3); margin-bottom: var(--space-2); overflow-wrap: anywhere; background: var(--color-surface); border: 1px solid var(--color-line); border-radius: var(--radius); }
main { min-width: 0; }
.page-header { margin: 0 0 var(--space-3); }
main > h1 { margin: 0 0 var(--space-3); }
.page-subtitle { margin: var(--space-1) 0 0; color: var(--color-muted); font-size: var(--text-lg); }
.back { display: inline-block; margin-bottom: var(--space-2); font-size: var(--text-sm); }

/* Tables (UX refresh U1). Horizontal hairlines only, a calm header row, zebra rows, right-aligned figures (class num), a compact variant (class compact) and a scroll
   container (class table-scroll; add table-tall for a bounded height with the header row sticky). A table with more than 10 rows carries class "sticky": its header row stays visible while scrolling. */
table { border-collapse: separate; border-spacing: 0; width: 100%; background: var(--color-surface); border: 1px solid var(--color-line); border-radius: var(--radius); margin: 0 0 var(--space-3); box-shadow: var(--shadow-1); }
th, td { text-align: left; vertical-align: top; padding: var(--table-pad-y) var(--table-pad-x); border: 0; border-bottom: 1px solid var(--color-line); overflow-wrap: anywhere; }
tbody tr:last-child > th, tbody tr:last-child > td, table > tr:last-child > th, table > tr:last-child > td { border-bottom: 0; }
th { background: var(--color-surface-alt); font-weight: var(--weight-medium); font-size: var(--text-sm); color: var(--color-text); }
thead tr:first-child > th:first-child { border-top-left-radius: calc(var(--radius) - 1px); }
thead tr:first-child > th:last-child { border-top-right-radius: calc(var(--radius) - 1px); }
/* header words never break letter by letter; badges and chips in a cell keep their text on one line; the register id stays whole (the wide table scrolls in its container) */
th { overflow-wrap: normal; }
td .badge, td .status { white-space: nowrap; }
table.bc-list td:first-child { white-space: nowrap; overflow-wrap: normal; }
table.sticky th { position: sticky; top: var(--topbar-height); z-index: 1; }
:where(tbody tr:nth-child(even)) > td { background: var(--color-zebra); }
tbody tr:hover td, tr:hover > td { background: var(--color-surface-alt); }
table.facts th { width: 40%; font-weight: var(--weight-medium); }
table.facts :where(tr:nth-child(even)) > td { background: var(--color-surface); }
/* row headers of a body take the surface colour so that the zebra stripes do not break at the first column */
:where(tbody) > tr > th[scope="row"] { background: var(--color-surface); }
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.compact th, table.compact td { padding: var(--space-1) var(--space-2); font-size: var(--text-sm); }
.table-tall { max-height: 70vh; overflow: auto; }
.table-tall table.sticky th, .table-tall thead th { top: 0; }
tr.sev-row > th.sev { border-left: 6px solid var(--color-border); background: var(--color-surface); font-weight: 400; white-space: nowrap; }
tr.sev-high > th.sev { border-left-color: var(--color-danger); }
tr.sev-norm > th.sev { border-left-color: var(--color-warning); }
tr.sev-info > th.sev { border-left-color: var(--color-accent); }
.sev-mark::before { content: "\25A0\00A0"; }
.sev-mark-high::before { color: var(--color-danger); }
.sev-mark-norm::before { color: var(--color-warning); }
.sev-mark-info::before { content: "\25A1\00A0"; color: var(--color-accent); }

.cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-3); align-items: start; }
/* Cards (sections of W2 and of every page): white, rounded, soft shadow. A card may start with a header row (class card-header): an icon slot (class card-icon,
   an inline svg from Icons.php) and the heading; an h2 or h3 that is the first child of the card is the heading without the slot. */
.card { background: var(--color-surface); border: 1px solid var(--color-line); border-radius: var(--radius-lg); box-shadow: var(--shadow-1); padding: var(--card-pad); margin-bottom: var(--space-3); }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; padding-bottom: var(--space-2); margin-bottom: var(--space-3); border-bottom: 1px solid var(--color-line); }
.card-header { display: flex; align-items: center; gap: var(--space-3); margin: 0 0 var(--space-3); padding-bottom: var(--space-2); border-bottom: 1px solid var(--color-line); }
.card-header > h2, .card-header > h3 { margin: 0; flex: 1 1 auto; }
.card-icon { display: inline-flex; align-items: center; justify-content: center; width: 1.75rem; height: 1.75rem; flex: 0 0 auto; border-radius: var(--radius); background: var(--color-brand-soft); color: var(--color-accent); }
.card-accent { border-left: 6px solid var(--color-warning); }
.card-sev-high { border-left-color: var(--color-danger); }
.card-sev-info { border-left-color: var(--color-accent); }
.meta { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-3); align-items: center; margin-bottom: var(--space-3); color: var(--color-muted); }
ul.plain { list-style: none; padding: 0; margin: 0; }
.note { margin: var(--space-2) 0 0; }
.card-decide { border-left: 6px solid var(--color-primary); }

/* Badges: small pills. A status chip (class status plus status-ok, status-warn, status-bad, status-info or status-muted) always carries a WORD and a symbol in front of it,
   never colour alone (the symbol comes from CSS, the word is the text of the element). */
.badge { display: inline-block; padding: 0 var(--space-2); border-radius: var(--radius-pill); background: var(--color-surface-alt); color: var(--color-text); border: 1px solid var(--color-line); font-size: var(--text-sm); line-height: 1.6; }
.status { display: inline-flex; align-items: center; gap: var(--space-1); padding: 0 var(--space-3) 0 var(--space-2); border-radius: var(--radius-pill); font-size: var(--text-sm); font-weight: var(--weight-medium); line-height: 1.7; border: 1px solid var(--color-line); background: var(--color-surface-alt); color: var(--color-text); }
.status::before { font-weight: var(--weight-bold); }
.status-ok { background: var(--color-success-soft); border-color: var(--color-success); }
.status-ok::before { content: "\2713"; color: var(--color-success); }
.status-warn { background: var(--color-warning-soft); border-color: var(--color-warning); }
.status-warn::before { content: "\25B2"; color: var(--color-accent); }
.status-bad { background: var(--color-danger-soft); border-color: var(--color-danger); color: var(--color-danger-text); }
.status-bad::before { content: "\2715"; color: var(--color-danger); }
.status-info { background: var(--color-info-soft); border-color: var(--color-info); }
.status-info::before { content: "\2139"; color: var(--color-info); }
.status-muted::before { content: "\2022"; color: var(--color-muted); }
/* Not yet implemented (TL-52): same chip family, no symbol (icon-less), a dashed border and its own colour token; the word carries the meaning. */
.status-notimpl { background: var(--color-notimpl-soft); border: 1px dashed var(--color-notimpl); }
/* Unmatched bank lines of the cash cockpit (C2): the type is a WORD in a coloured badge (AR blue, AP amber, Bank grey); the colour only supports the word. */
.exc-type { font-weight: 600; }
.exc-type-ar { background: var(--color-info); color: var(--color-info-contrast); border-color: var(--color-info); }
.exc-type-ap { background: var(--color-warning); color: var(--color-warning-contrast); border-color: var(--color-warning); }
.exc-type-bank { background: var(--color-primary); color: var(--color-primary-contrast); border-color: var(--color-primary); }
.exc-table td { vertical-align: top; }
.exc-form { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.exc-form input[name="note"] { min-width: 9rem; }
.exc-staged { margin: 0 0 var(--space-2); }
.exc-problems { margin: var(--space-2) 0; }
.exc-details summary { cursor: pointer; font-size: var(--text-sm); }
.badge-tier-1 { background: var(--color-success); color: var(--color-success-contrast); border-color: var(--color-success); }
.badge-tier-2 { background: var(--color-warning); color: var(--color-warning-contrast); border-color: var(--color-warning); }
.badge-tier-3 { background: var(--color-danger); color: var(--color-danger-contrast); border-color: var(--color-danger); }
.shadow { background: var(--color-warning); color: var(--color-warning-contrast); border-radius: var(--radius); padding: 0 var(--space-1); }

/* Payment release cycle (P-18): state badges awaiting amber, exported grey, marked paid blue, internal dispute red, paid green. */
.badge-pay-amber { background: var(--color-warning); color: var(--color-warning-contrast); border-color: var(--color-warning); }
.badge-pay-grey { background: var(--color-surface-alt); color: var(--color-text); border-color: var(--color-border); }
.badge-pay-blue { background: var(--color-info); color: var(--color-info-contrast); border-color: var(--color-info); }
.badge-pay-red { background: var(--color-danger); color: var(--color-danger-contrast); border-color: var(--color-danger); font-weight: 700; }
.badge-pay-green { background: var(--color-success); color: var(--color-success-contrast); border-color: var(--color-success); }
.dispute-facts { color: var(--color-danger-text); }
tr.pay-dispute > td { background: var(--color-danger-soft); }
/* a wide list scrolls inside its own box on a narrow screen instead of widening the page */
.table-scroll { overflow-x: auto; max-width: 100%; position: relative; }
/* position: relative makes the scroll box the containing block of .visually-hidden labels inside it, so they are clipped with the box and cannot widen the page (AC-M2-174). */
.table-scroll .visually-hidden, .exc-form .visually-hidden, .exc-table .visually-hidden { left: 0; top: 0; }
.exc-table td { position: relative; }
table.payments th, table.payments td { overflow-wrap: normal; }
table.payments td:nth-child(2), table.payments td:nth-child(4) { white-space: nowrap; }
table.payments td.num { text-align: right; }
table.payments td:nth-child(7) { overflow-wrap: anywhere; min-width: 11rem; }
table.payments td button, table.payments td .button { white-space: nowrap; }
ul.items li.item-dispute { border-left-color: var(--color-danger); }
.chip-pay { border-color: var(--color-info); }

/* Alerts: slim banners (UX refresh U1) instead of big boxes. Component classes alert + alert-info, alert-warning, alert-error, alert-success; the existing message classes
   map onto them: .refusal is an error, .banner a warning, .notice information. The type is carried by the symbol and by the text, the colour is an addition. */
.alert, .refusal, .banner, .notice { display: block; padding: var(--space-1) var(--space-3); margin: 0 0 var(--space-3); border-radius: var(--radius); border: 1px solid var(--color-line); border-left-width: 4px; font-size: var(--text-sm); line-height: 1.5; color: var(--color-text); }
.alert::before, .banner::before, .notice::before { font-weight: var(--weight-bold); margin-right: var(--space-2); }
.alert-info, .notice { background: var(--color-info-soft); border-left-color: var(--color-info); }
.alert-info::before, .notice::before { content: "\2139"; color: var(--color-info); }
.alert-warning, .banner { background: var(--color-warning-soft); border-left-color: var(--color-warning); }
.alert-warning::before, .banner::before { content: "\25B2"; color: var(--color-accent); }
.alert-error, .refusal { background: var(--color-danger-soft); border-left-color: var(--color-danger); color: var(--color-danger-text); font-weight: var(--weight-medium); }
.alert-error::before, .refusal::before { content: "\26A0"; margin-right: var(--space-2); color: var(--color-danger); }
.alert-success { background: var(--color-success-soft); border-left-color: var(--color-success); }
.alert-success::before { content: "\2713"; color: var(--color-success); }
.alert > p:last-child, .banner > p:last-child, .notice > p:last-child, .refusal > p:last-child { margin-bottom: 0; }

/* Empty state: a quiet centred box with a short sentence (and an optional icon, title and action inside: empty-icon, empty-title). */
.empty { background: var(--color-surface); color: var(--color-muted); border: 1px dashed var(--color-border); border-radius: var(--radius-lg); padding: var(--space-5) var(--space-4); margin: 0 0 var(--space-3); text-align: center; }
.empty-icon { color: var(--color-accent); display: block; margin: 0 auto var(--space-2); }
.empty-icon .icon { width: 2rem; height: 2rem; }
.empty-title { display: block; color: var(--color-text); font-size: var(--text-lg); font-weight: var(--weight-bold); margin-bottom: var(--space-1); }

/* Skeleton: placeholder shapes while content loads (the shimmer stops when the user asks for reduced motion). skeleton-line, skeleton-block and skeleton-kpi set the size. */
.skeleton { display: block; border-radius: var(--radius); background: linear-gradient(90deg, var(--color-surface-alt) 25%, var(--color-zebra) 50%, var(--color-surface-alt) 75%); background-size: 200% 100%; animation: skeleton-shimmer 1.4s linear infinite; }
.skeleton-line { height: 0.9rem; margin-bottom: var(--space-2); }
.skeleton-block { height: 8rem; }
.skeleton-kpi { height: 5.5rem; }
@keyframes skeleton-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* Forms (UX refresh U1): label above the control, helper text under it (field-help), error text (field-error), visible border, a clear focus ring, required mark by CSS only
   (no change of the label text). */
form p { margin-bottom: var(--space-2); }
label { display: block; font-weight: var(--weight-medium); margin-bottom: var(--space-1); }
label.required::before { content: "* "; color: var(--color-danger-text); }
input, select, textarea { display: block; width: 100%; max-width: 26rem; font: inherit; color: var(--color-text); background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); padding: var(--control-pad-y) var(--control-pad-x); min-height: var(--control-height); }
input:hover, select:hover, textarea:hover { border-color: var(--color-text); }
input:focus, select:focus, textarea:focus { border-color: var(--color-accent); }
input[disabled], select[disabled], textarea[disabled] { background: var(--color-surface-alt); color: var(--color-muted); }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--color-danger); }
.field-help { display: block; margin-top: var(--space-1); color: var(--color-muted); font-size: var(--text-sm); font-weight: var(--weight-normal); }
.field-error { display: block; margin-top: var(--space-1); color: var(--color-danger-text); font-size: var(--text-sm); font-weight: var(--weight-medium); }
form.inline p { display: flex; flex-wrap: wrap; gap: var(--space-3); }
form.inline label { flex: 1 1 12rem; }

/* Buttons (UX refresh U1). Default and .primary: the accent colour with dark text. Variants: .secondary (outline), .ghost (text only), .danger (red); sizes: .btn-sm, .btn-lg. */
button, .button { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); font: inherit; font-weight: var(--weight-medium); line-height: 1.3; cursor: pointer; border-radius: var(--radius); padding: var(--control-pad-y) var(--space-4); min-height: var(--btn-height);
  background: var(--color-brand); color: var(--color-brand-contrast); border: 1px solid var(--color-brand); text-decoration: none; }
button:hover, .button:hover { filter: brightness(0.94); }
button.secondary, .button.secondary { background: var(--color-surface); color: var(--color-text); border: 1px solid var(--color-border); }
button.secondary:hover, .button.secondary:hover { background: var(--color-surface-alt); filter: none; }
button.ghost, .button.ghost { background: transparent; color: var(--color-accent); border-color: transparent; }
button.ghost:hover, .button.ghost:hover { background: var(--color-brand-soft); filter: none; }
button.danger, .button.danger, button.secondary.bc-reject { background: var(--color-danger); color: var(--color-danger-contrast); border-color: var(--color-danger); }
button.secondary.bc-reject { background: var(--color-surface); color: var(--color-danger-text); }
button.secondary.bc-reject:hover { background: var(--color-danger-soft); }
.btn-sm { min-height: var(--btn-sm-height); padding: var(--space-1) var(--space-3); font-size: var(--text-sm); }
.btn-lg { min-height: var(--btn-lg-height); padding: var(--space-2) var(--space-5); font-size: var(--text-lg); }
button:disabled { cursor: not-allowed; background: var(--color-surface-alt); color: var(--color-muted); border-color: var(--color-line); }
button:disabled:hover { filter: none; }
.login-card { max-width: 24rem; margin: var(--space-5) auto; padding: var(--space-4); box-shadow: var(--shadow-2); border-top: 4px solid var(--color-brand); }
.login-card button { width: 100%; }
.muted { color: var(--color-muted); font-size: var(--text-sm); }


/* W1 and W5: filter chips (links), search field, row action, item lists, run details, button row. */
.toolbar { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-3); align-items: center; justify-content: space-between; margin-bottom: var(--space-3); }
.chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.chip { display: inline-block; min-height: var(--hit-min); line-height: 1.5; padding: var(--space-1) var(--space-3); border: 1px solid var(--color-line); border-radius: var(--radius-pill); background: var(--color-surface); color: var(--color-text); text-decoration: none; font-size: var(--text-sm); box-shadow: var(--shadow-1); }
.chip:hover { background: var(--color-surface-alt); }
.chip-on { background: var(--color-brand); color: var(--color-brand-contrast); border-color: var(--color-brand); font-weight: var(--weight-bold); }
.chip-on:hover { background: var(--color-brand); }
.search { display: flex; gap: var(--space-2); align-items: center; }
.search input { max-width: 16rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
table.inbox th, table.inbox td { overflow-wrap: normal; }
table.inbox td:nth-child(2) { overflow-wrap: anywhere; width: 45%; }
table.inbox .badge, table.inbox button { white-space: nowrap; }
table.ranking td:nth-child(-n+7) { overflow-wrap: normal; white-space: nowrap; }
table.ranking th { overflow-wrap: normal; }
form.rowaction { margin: 0; }
form.rowaction p { margin: 0; }
ul.items { list-style: none; padding: 0; margin: 0 0 var(--space-3); }
ul.items li { background: var(--color-surface); border: 1px solid var(--color-border); border-left: 6px solid var(--color-border); border-radius: var(--radius); padding: var(--space-2) var(--space-3); margin-bottom: var(--space-1); }
ul.items li.item-info { border-left-color: var(--color-accent); }
ul.items li.item-norm { border-left-color: var(--color-warning); }
.footnote { margin-top: var(--space-2); }
.actions { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; margin-bottom: var(--space-3); }
details.run-details { margin-top: var(--space-3); background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); padding: var(--space-2) var(--space-3); }
/* The run output keeps its text in the page (tests read it) but takes a bounded height: the inbox stays short. */
.run-scroll { max-height: 16rem; overflow: auto; margin-top: var(--space-2); }
details.run-details > summary { cursor: pointer; font-weight: 600; }

/* Warning banner of an installation with the second factor switched off: first element of every page (BR-M1-16). */
.banner-top { margin: 0; border-radius: 0; border-width: 0 0 4px 0; text-align: center; font-weight: 700; }

/* Help link in the header and the help pages (BR-M1-18). */
.help-link { text-decoration: underline; }
.help-index { padding-left: var(--space-4); }
.help ul { margin: 0; padding-left: var(--space-4); }
.help li { margin-bottom: var(--space-1); }
.help ul.terms { columns: 2 16rem; }
.help dl.glossary { margin: var(--space-3) 0 0; }
.help dl.glossary dt { font-weight: 700; margin-top: var(--space-3); }
.help dl.glossary dd { margin: var(--space-1) 0 0; }
.help :target { background: var(--color-warning-soft); outline: 2px solid var(--color-brand); }

/* Process view (help/process): five lanes side by side, steps as cards; lanes stack below 900 px. Colours from the tokens only. */
.lanes { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--space-2); align-items: start; margin-bottom: var(--space-3); }
.lane { background: var(--color-surface-alt); border: 1px solid var(--color-border); border-radius: var(--radius); padding: var(--space-2); }
.lane > h3 { margin-top: 0; }
.step { background: var(--color-surface); border: 1px solid var(--color-border); border-left: 6px solid var(--color-primary); border-radius: var(--radius); padding: var(--space-2); margin-bottom: var(--space-2); font-size: var(--text-sm); }
.lane-0 .step { border-left-color: var(--color-accent); }
.lane-2 .step { border-left-color: var(--color-brand); }
.lane-3 .step { border-left-color: var(--color-success); }
.lane-4 .step { border-left-color: var(--color-danger); }
.step h4 { margin: 0 0 var(--space-1); font-size: var(--text-md); }
.step-id { background: var(--color-primary); color: var(--color-primary-contrast); border-radius: var(--radius); padding: 0 var(--space-1); }
.step dl { margin: 0; }
.step dt { font-weight: 700; color: var(--color-muted); }
.step dd { margin: 0 0 var(--space-1); overflow-wrap: anywhere; }
.step:target { outline: 3px solid var(--color-brand); }
.process-table { font-size: var(--text-sm); }
.process code, .step code { background: var(--color-info-soft); padding: 0 var(--space-1); border-radius: var(--radius); overflow-wrap: anywhere; }

/* Business cases (MVP-2 step A2b): status, workspace and verification badges, the confirmation form with the passage beside the value, methods table. Tokens only. */
.badge-bc-draft, .badge-bc-archived { background: var(--color-surface-alt); color: var(--color-text); border-color: var(--color-border); }
.badge-bc-pending_review { background: var(--color-warning); color: var(--color-warning-contrast); border-color: var(--color-warning); }
.badge-bc-confirmed { background: var(--color-info); color: var(--color-info-contrast); border-color: var(--color-info); }
.badge-bc-evaluated { background: var(--color-success); color: var(--color-success-contrast); border-color: var(--color-success); }
.badge-ws-board { background: var(--color-primary); color: var(--color-primary-contrast); border-color: var(--color-primary); }
.badge-ws-cfo, .badge-ws-ceo, .badge-bc-primary, .badge-bc-latest { background: var(--color-brand); color: var(--color-brand-contrast); border-color: var(--color-brand); }
.badge-ver-verified { background: var(--color-success); color: var(--color-success-contrast); border-color: var(--color-success); }
.badge-ver-classified { background: var(--color-info); color: var(--color-info-contrast); border-color: var(--color-info); }
.badge-ver-not_verified { background: var(--color-danger); color: var(--color-danger-contrast); border-color: var(--color-danger); font-weight: 700; }
.badge-ver-missing { background: var(--color-warning); color: var(--color-warning-contrast); border-color: var(--color-warning); }
.badge-bc-ai { background: var(--color-info); color: var(--color-info-contrast); border-color: var(--color-info); }
.badge-bc-noai { background: var(--color-warning); color: var(--color-warning-contrast); border-color: var(--color-warning); font-weight: 700; }
.badge-bc-pol-open { background: var(--color-warning); color: var(--color-warning-contrast); border-color: var(--color-warning); }
.badge-bc-pol-approved { background: var(--color-success); color: var(--color-success-contrast); border-color: var(--color-success); }
.badge-bc-pol-rejected { background: var(--color-danger); color: var(--color-danger-contrast); border-color: var(--color-danger); }
.badge-bc-pol-withdrawn, .badge-bc-pol-expired { background: var(--color-surface-alt); color: var(--color-text); border-color: var(--color-border); }
fieldset.bc-field { background: var(--color-surface); border: 1px solid var(--color-border); border-left: 6px solid var(--color-border); border-radius: var(--radius); margin: 0 0 var(--space-3); padding: var(--space-2) var(--space-3); min-width: 0; }
fieldset.bc-field legend { font-weight: 700; padding: 0 var(--space-1); }
fieldset.bc-field-not_verified { border-left-color: var(--color-danger); }
fieldset.bc-field-missing { border-left-color: var(--color-warning); }
fieldset.bc-field-verified { border-left-color: var(--color-success); }
fieldset.bc-field-classified { border-left-color: var(--color-info); }
.bc-field-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-3); align-items: start; }
.bc-source blockquote { margin: 0; padding: var(--space-2) var(--space-3); background: var(--color-info-soft); border-left: 4px solid var(--color-accent); overflow-wrap: anywhere; }
.bc-value input, .bc-value select, .bc-value textarea { max-width: 100%; }
.bc-object { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: var(--space-2) var(--space-3); }
.bc-dl { display: grid; grid-template-columns: minmax(10rem, 16rem) minmax(0, 1fr); gap: var(--space-1) var(--space-3); margin: 0 0 var(--space-3); }
.bc-dl dt { font-weight: 700; color: var(--color-muted); }
.bc-dl dd { margin: 0; overflow-wrap: anywhere; }
tr.bc-primary > th, tr.bc-primary > td { background: var(--color-warning-soft); font-weight: 700; }
tr.bc-changed > th, tr.bc-changed > td { background: var(--color-warning-soft); }
tr.bc-latest > td { font-weight: 600; }
table.bc-components td.num { white-space: nowrap; text-align: right; }
/* Methods table (Calculations tab): a scroll container (.table-scroll) with the method name as a sticky first column that never wraps letter by letter, figures that do not wrap, a
   sentence for a method without a value that wraps by words, and the primary marker as a small badge beside the name. Tokens only. */
table.bc-methods { width: auto; min-width: 100%; }
table.bc-methods th[scope="row"] { white-space: nowrap; overflow-wrap: normal; word-break: normal; min-width: 12rem; position: sticky; left: 0; z-index: 1; background: var(--color-surface-alt); }
table.bc-methods th[scope="col"] { white-space: nowrap; overflow-wrap: normal; }
/* the headers of the numeric columns sit over their numbers (right); the first header names the metric (left) */
table.bc-methods th[scope="col"] { text-align: right; vertical-align: bottom; }
table.bc-methods th[scope="col"]:first-child { text-align: left; }
table.bc-methods td { white-space: nowrap; text-align: right; min-width: 9rem; overflow-wrap: normal; }
table.bc-methods td:not(.bc-m-ok) { white-space: normal; text-align: left; min-width: 14rem; max-width: 22rem; }
table.bc-methods tr.bc-primary > th[scope="row"] { background: var(--color-warning-soft); }
table.bc-methods .badge-bc-primary { font-size: 0.75rem; line-height: 1.4; padding: 0 var(--space-1); margin-left: var(--space-1); white-space: nowrap; vertical-align: middle; }
.bc-flags ul { margin: var(--space-1) 0 0; padding-left: var(--space-4); }
.bc-no-benefit { font-weight: 700; }
table.bc-components th, table.bc-components td { overflow-wrap: normal; }
label.check { display: inline-block; font-weight: 400; margin-right: var(--space-3); }
label.check input { display: inline-block; width: auto; margin-right: var(--space-1); }
.bc-filter p { align-items: flex-end; }
.pager { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; margin-top: var(--space-2); }
.bc-flow-table { font-size: var(--text-sm); }
.bc-confirm-all { margin-bottom: var(--space-3); }
ul.bc-sources blockquote { margin: var(--space-1) 0 var(--space-2); padding: var(--space-1) var(--space-3); background: var(--color-info-soft); border-left: 4px solid var(--color-accent); }

/* Cash cockpit W3 (MVP-2 A3a): inline SVG chart and weekly tables. Colours are the tokens above only; lines also differ by dash pattern, the lowest week by a ring and a word. */
.cash-figure { margin: var(--space-3) 0; }
.cash-chart { display: block; width: 100%; max-width: 48rem; height: auto; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); }
.cash-chart .cash-grid { stroke: var(--color-surface-alt); stroke-width: 1; }
.cash-chart .cash-axis { stroke: var(--color-muted); stroke-width: 1; }
.cash-chart .cash-tick, .cash-chart .cash-axis-label { fill: var(--color-muted); font-size: 11px; font-family: var(--font-sans); }
.cash-chart .cash-line-base { stroke: var(--color-primary); stroke-width: 3; }
.cash-chart .cash-line-with { stroke: var(--color-accent); stroke-width: 3; stroke-dasharray: 9 4; }
.cash-chart .cash-line-buffer { stroke: var(--color-danger); stroke-width: 2; stroke-dasharray: 2 4; }
.cash-chart .cash-line-cov { stroke: var(--color-text); stroke-width: 2; stroke-dasharray: 12 3 2 3; }
.cash-chart .cash-min { fill: none; stroke: var(--color-text); stroke-width: 2.5; }
.cash-chart .cash-min-with { stroke: var(--color-accent); }
.cash-legend { list-style: none; display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); padding: 0; margin: var(--space-2) 0 0; }
.cash-legend .swatch { display: inline-block; width: 2.25rem; height: 0; margin-right: var(--space-2); vertical-align: middle; border-top: 3px solid var(--color-primary); }
.cash-legend .swatch-with { border-top: 3px dashed var(--color-accent); }
.cash-legend .swatch-buffer { border-top: 3px dotted var(--color-danger); }
.cash-legend .swatch-cov { border-top: 3px dashed var(--color-text); }
.cash-legend .swatch-min { width: 0.9rem; height: 0.9rem; border: 2.5px solid var(--color-text); border-radius: 50%; }
/* Forecast F2: P10/P50/P90 band chart (inline SVG, BandChart.php). P50 solid, P10 dashed, P90 dotted; the area between P10 and P90 is shaded. */
.band-chart { display: block; width: 100%; max-width: 48rem; height: auto; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); }
.band-chart .band-grid { stroke: var(--color-surface-alt); stroke-width: 1; }
.band-chart .band-axis { stroke: var(--color-muted); stroke-width: 1; }
.band-chart .band-tick, .band-chart .band-axis-label { fill: var(--color-muted); font-size: 11px; font-family: var(--font-sans); }
.band-chart .band-area { fill: var(--color-accent); fill-opacity: 0.15; stroke: none; }
.band-chart .band-p50 { stroke: var(--color-primary); stroke-width: 3; }
.band-chart .band-p10 { stroke: var(--color-danger); stroke-width: 2; stroke-dasharray: 9 4; }
.band-chart .band-p90 { stroke: var(--color-accent); stroke-width: 2; stroke-dasharray: 2 4; }
.band-chart .band-buffer { stroke: var(--color-danger); stroke-width: 1; stroke-dasharray: 1 5; }
.band-chart .band-min { fill: none; stroke: var(--color-text); stroke-width: 2.5; }
.band-chart .band-hit:focus rect, .band-chart .band-hit:hover rect { fill: var(--color-accent); fill-opacity: 0.08; outline: none; }
.cash-legend .swatch-band-p50 { border-top: 3px solid var(--color-primary); }
.cash-legend .swatch-band-p10 { border-top: 3px dashed var(--color-danger); }
.cash-legend .swatch-band-p90 { border-top: 3px dotted var(--color-accent); }
table.cash-table th, table.cash-table td { overflow-wrap: normal; }
table.cash-table td.num { text-align: right; white-space: nowrap; }
table.cash-table tr.is-min > th, table.cash-table tr.is-min > td { background: var(--color-warning-soft); }
table.cash-table tr.cash-total > th, table.cash-table tr.cash-total > td { border-top: 2px solid var(--color-border); }
.cash-min-mark { color: var(--color-danger-text); }
.cash-stale { color: var(--color-danger-text); font-weight: 700; }
.badge-r9-on { background: var(--color-success); color: var(--color-success-contrast); border-color: var(--color-success); font-weight: 700; }
.badge-r9-off { background: var(--color-surface-alt); color: var(--color-text); border-color: var(--color-border); }
.badge-bc-approved { background: var(--color-brand); color: var(--color-brand-contrast); border-color: var(--color-brand); }

/* Guided entry of a business case (step A4, A18.10): step list, meaning lines, source badges, AI proposal blocks, component tables. Only palette colours. */
ol.bc-steps { display: flex; flex-wrap: wrap; gap: var(--space-2); list-style: none; margin: 0; padding: 0; }
ol.bc-steps li { padding: var(--space-1) var(--space-2); border: 1px solid var(--color-border); border-radius: var(--radius); background: var(--color-surface); }
ol.bc-steps li.bc-step-current { background: var(--color-brand); color: var(--color-brand-contrast); border-color: var(--color-brand); font-weight: 700; }
ol.bc-steps li .bc-step-locked { color: var(--color-muted); }
.bc-field-block { margin: 0 0 var(--space-3); }
fieldset.bc-line, fieldset.bc-addrow, fieldset.bc-radios { border: 1px solid var(--color-border); border-radius: var(--radius); margin: 0 0 var(--space-3); padding: var(--space-2) var(--space-3); min-width: 0; }
fieldset.bc-line legend, fieldset.bc-addrow legend, fieldset.bc-radios legend { font-weight: 700; padding: 0 var(--space-1); }
.bc-section { margin: 0 0 var(--space-4); }
.bc-sub { margin: 0 0 var(--space-2); }
.bc-meaning { margin: var(--space-1) 0 var(--space-1); font-size: var(--text-sm); font-style: italic; color: var(--color-muted); }
.bc-meaning .bc-what, .bc-meaning .bc-example { font-weight: 700; font-style: normal; }
.bc-term { font-size: var(--text-sm); font-weight: 400; color: var(--color-muted); }
.bc-req { color: var(--color-danger-text); }
.bc-badges { margin: 0 0 var(--space-1); }
label.bc-radio { display: block; font-weight: 400; margin: 0 0 var(--space-1); }
label.bc-radio input { display: inline-block; width: auto; margin-right: var(--space-2); }
.badge-src-doc { background: var(--color-info); color: var(--color-info-contrast); border-color: var(--color-info); }
.badge-src-ai { background: var(--color-brand); color: var(--color-brand-contrast); border-color: var(--color-brand); }
.badge-src-policy { background: var(--color-success); color: var(--color-success-contrast); border-color: var(--color-success); }
.badge-src-user { background: var(--color-surface-alt); color: var(--color-text); border-color: var(--color-border); }
.badge-src-system { background: var(--color-success-soft); color: var(--color-text); border-color: var(--color-success); }
details.bc-src { display: inline-block; vertical-align: top; }
details.bc-src summary { cursor: pointer; display: inline-block; }
details.bc-src blockquote { margin: var(--space-1) 0; padding: var(--space-2) var(--space-3); background: var(--color-info-soft); border-left: 4px solid var(--color-accent); overflow-wrap: anywhere; }
.bc-proposal { margin: 0 0 var(--space-2); padding: var(--space-2) var(--space-3); border: 1px dashed var(--color-brand); border-radius: var(--radius); background: var(--color-warning-soft); }
.bc-proposal button { display: inline-block; margin-right: var(--space-2); }
.bc-ai-wait { color: var(--color-muted); }
/* One-page review (step A5): green = from the document, amber = AI proposals, red = to fill in. The group is told apart by a heading badge and a left rule, never by colour alone. */
section.bc-group { border-left: 6px solid var(--color-border); }
section.bc-green { border-left-color: var(--color-info); }
/* The group headings of the review are small; the document group is a light tint, not a full-colour banner */
section.bc-group > h3 { font-size: 1rem; margin: var(--space-1) 0; }
section.bc-group > h3 .badge { font-size: .7rem; padding: 0 var(--space-1); vertical-align: middle; }
section.bc-green { background: var(--color-info-soft); }
section.bc-amber { border-left-color: var(--color-brand); }
section.bc-red { border-left-color: var(--color-danger); }
.bc-amber-list { list-style: none; padding: 0; margin: 0; }
li.bc-amber-item { margin: 0 0 var(--space-3); padding: var(--space-2) var(--space-3); border: 1px dashed var(--color-brand); border-radius: var(--radius); background: var(--color-warning-soft); }
li.bc-amber-item.bc-status-accepted, li.bc-amber-item.bc-status-changed { background: var(--color-success-soft); border-style: solid; }
li.bc-amber-item.bc-status-rejected, li.bc-amber-item.bc-status-not_used { background: var(--color-info-soft); border-style: solid; }
.badge-origin { background: var(--color-surface); color: var(--color-text); border-color: var(--color-border); }
.bc-assumption { margin: 0 0 var(--space-1); }
details.bc-change { margin: var(--space-1) 0; }
details.bc-change summary, details.bc-green-list summary { cursor: pointer; }
form.bc-prop-form button { display: inline-block; margin-right: var(--space-2); }
.bc-tick label { font-weight: 600; }
.bc-prompt-text { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 28rem; overflow: auto; background: var(--color-info-soft); padding: var(--space-2) var(--space-3); border-left: 4px solid var(--color-border); }
table.bc-comp input { max-width: 100%; }
table.bc-comp tr.bc-sum th, table.bc-comp tr.bc-total th { background: var(--color-surface-alt); }
tr.bc-diff-components_below_total > th, tr.bc-diff-components_below_total > td, tr.bc-diff-components_above_total > th, tr.bc-diff-components_above_total > td, tr.bc-diff-differs > th, tr.bc-diff-differs > td,
tr.bc-diff-mismatch > th, tr.bc-diff-mismatch > td { background: var(--color-warning-soft); }
table.bc-review th[scope="row"] { text-align: left; font-weight: 600; }
.bc-buttons button, .bc-buttons a.button { min-height: var(--btn-lg-height); min-width: var(--hit-min); }
section.bc-assessment { border-left: 6px solid var(--color-brand); }

/* Tabs of the business case card (w13c1 to w13c6) and of the entry (w14t). The bar is a list of links (server-rendered, works without a script); the active tab is a raised segment
   with an accent rule (aria-selected carries it too, not only the look). On a narrow screen the bar scrolls sideways inside its own box instead of widening the page. */
.tabbar { margin: 0 0 var(--space-3); }
.tabs { display: flex; flex-wrap: nowrap; gap: 2px; margin: 0; padding: var(--space-1); list-style: none; overflow-x: auto; max-width: 100%; background: var(--color-surface-alt); border-radius: var(--radius-lg); width: fit-content; }
.tabs > li { flex: 0 0 auto; }
/* Segmented tabs (default): a grey track, the active tab is a white raised segment with an accent rule below the label. */
.tab { display: block; padding: var(--tab-pad-y) var(--space-4); background: transparent; color: var(--color-muted); text-decoration: none; white-space: nowrap; border: 1px solid transparent; border-radius: var(--radius); font-weight: var(--weight-medium); }
.tab:hover { background: var(--color-surface); color: var(--color-text); }
.tab-on, .tab-on:hover { background: var(--color-surface); color: var(--color-text); font-weight: var(--weight-bold); box-shadow: var(--shadow-1), inset 0 -3px 0 var(--color-brand); }
.tab-locked:not(.tab-on) { color: var(--color-muted); font-style: italic; }
/* The text of a prompt or of a model context: wrapped at the width of the window, never wider than the page. */
.ai-prompt { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 100%; box-sizing: border-box; margin: 0; padding: var(--space-2); background: var(--color-surface-alt); border-radius: var(--radius-md); font: inherit; font-size: 0.9em; }
.prompt-item { margin: var(--space-2) 0; }
.tabs-sub { margin-bottom: var(--space-2); flex-wrap: nowrap; width: 100%; max-width: 100%; overflow-x: auto; }
/* Lease tab: the status filter is one bar above the list; on a card the form sits on the left and the actions in the right column (wraps under the form on a narrow screen). */
.ls-filterbar { display: flex; flex-wrap: wrap; gap: 2px; margin-bottom: var(--space-2); max-width: 100%; }
.ls-card-layout > .card { min-width: 0; margin-bottom: var(--space-3); box-sizing: border-box; }
.ls-card-layout > .card:first-child { min-width: 0; }
.ls-actions input[type="text"], .ls-actions input[type="date"] { max-width: 100%; box-sizing: border-box; }
.ai-prompt-details { margin-top: var(--space-2); }
.ai-prompt-details > summary { cursor: pointer; font-weight: var(--weight-bold); padding: var(--space-1) 0; }
.ai-prompt-details .ai-prompt { max-height: 32rem; overflow: auto; margin-top: var(--space-2); }
.prompt-screen { min-width: 0; max-width: 100%; }
.prompt-card { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.prompt-editor { display: grid; gap: var(--space-2); min-width: 0; }
.prompt-editor label { font-weight: var(--weight-bold); }
.prompt-editor textarea { width: 100%; max-width: 100%; box-sizing: border-box; min-height: 18rem; font: inherit; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9em; white-space: pre-wrap; overflow-wrap: anywhere; padding: var(--space-2); border: 1px solid var(--color-line); border-radius: var(--radius-md); background: var(--color-surface); color: var(--color-text); }
.tab:focus-visible { outline: 3px solid var(--color-focus); outline-offset: -3px; }
.tabpanel:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 2px; }
/* Pill tabs (opt-in: class tabbar-pills on the bar): separate rounded pills, the active one in the accent colour. */
.tabbar-pills .tabs { background: transparent; padding: 0; gap: var(--space-2); width: auto; }
.tabbar-pills .tab { border-color: var(--color-line); background: var(--color-surface); border-radius: var(--radius-pill); box-shadow: var(--shadow-1); }
.tabbar-pills .tab-on, .tabbar-pills .tab-on:hover { background: var(--color-brand); color: var(--color-brand-contrast); border-color: var(--color-brand); box-shadow: none; }
.bc-card-head > h2 { margin-top: 0; }
/* Business case progress: the six steps of the card; the current step is the one the person must do next */
.bc-progress-card { padding: 0.5rem 0.75rem; }
.bc-progress { display: flex; flex-wrap: wrap; gap: 0.4rem; list-style: none; margin: 0; padding: 0; }
.bc-progress .bc-step { padding: 0.3rem 0.6rem; border: 1px solid var(--color-line); border-radius: 6px; font-size: var(--text-sm); }
.bc-progress .bc-step-state { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.03em; color: var(--color-muted); }
.bc-progress .bc-step-done { background: var(--color-surface-alt); }
.bc-progress .bc-step-current { background: var(--color-info-soft); border-width: 2px; border-color: var(--color-accent); font-weight: 600; }
.bc-progress .bc-step-todo { color: var(--color-muted); }
/* the arrow between two steps shows the order of the workflow (the last step has none) */
.bc-progress .bc-step:not(:last-child)::after { content: "\2192"; margin-left: 0.4rem; color: var(--color-muted); }
/* Inputs tab in two columns (one on a narrow screen); the source is a plain index after the value */
.bc-cols { columns: 2 22rem; column-gap: 1.5rem; }
.bc-cols > .bc-blk { break-inside: avoid; }
@media (max-width: 760px) { .bc-cols { columns: 1; } }
.bc-src-idx { font-size: var(--text-xs); color: var(--color-muted); margin-left: 0.3rem; }
/* the case header box takes half the width of the page (full width on a narrow screen) */
#in-header { width: 50%; }
@media (max-width: 760px) { #in-header { width: 100%; } }
.bc-src-note { font-size: var(--text-sm); margin: 0.2rem 0 0.6rem; }
/* Inputs tab: one compact table; the blocks are table groups with a head row; the source is a numbered badge explained by the legend */
.bc-in-summary { margin: 0.5rem 0; }
.bc-src-legend { display: flex; flex-wrap: wrap; gap: 0.5rem 0.9rem; align-items: center; margin: 0.25rem 0 0.6rem; font-size: var(--text-sm); }
.bc-src-item { display: inline-flex; gap: 0.3rem; align-items: center; }
.bc-compact .bc-in-head > th { background: var(--color-surface-alt); padding-top: 0.5rem; text-align: left; }
.bc-compact .bc-in-letter { display: inline-block; min-width: 1.4rem; font-weight: 700; color: var(--color-muted); }
.bc-compact .bc-in-state { font-size: var(--text-sm); font-weight: 400; }
.bc-compact .bc-in-missing .bc-in-state { color: var(--color-danger-text); font-weight: 600; }
.bc-compact .bc-in-complete .bc-in-state { color: var(--color-success); }
.bc-compact .bc-in-empty .bc-in-state { color: var(--color-muted); }
.bc-compact .bc-src-idx { min-width: 1.4rem; text-align: center; }
.bc-in-foot { margin-top: 0.6rem; }
.bc-passages blockquote { margin: 0; font-style: italic; }
/* source passages: the passage takes the widest column, the check column only as wide as its badges (fixed proportions, so the last column does not grow) */
.bc-passages { table-layout: fixed; width: 100%; }
.bc-passages th:nth-child(1), .bc-passages td:nth-child(1) { width: 50%; }
.bc-passages th:nth-child(2), .bc-passages td:nth-child(2) { width: 33%; }
.bc-passages th:nth-child(3), .bc-passages td:nth-child(3) { width: 17%; }
@media (max-width: 760px) { .bc-passages { table-layout: auto; } }

/* KPI tile (UX refresh U1): label, big number, delta, status. The status is a word with a symbol (kpi-status plus status-ok, status-warn or status-bad of the chips above);
   the tile top rule takes the colour of the status (kpi-ok, kpi-warn, kpi-bad). The direction of the delta is a symbol (kpi-delta-up, -down, -flat) and the judgement a class (is-good, is-bad). */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: var(--space-3); margin: 0 0 var(--space-3); }
.kpi { background: var(--color-surface); border: 1px solid var(--color-line); border-top: 3px solid var(--color-line); border-radius: var(--radius-lg); box-shadow: var(--shadow-1); padding: var(--space-2) var(--space-3); min-width: 0; }
.kpi-ok { border-top-color: var(--color-success); }
.kpi-warn { border-top-color: var(--color-warning); }
.kpi-bad { border-top-color: var(--color-danger); }
.kpi-label { display: block; color: var(--color-muted); font-size: var(--text-sm); font-weight: var(--weight-medium); }
.kpi-value { display: block; font-size: var(--text-kpi); font-weight: var(--weight-bold); line-height: 1.2; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kpi-delta { display: inline-block; margin-top: var(--space-1); font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--color-muted); }
.kpi-delta-up::before { content: "\25B2\00A0"; }
.kpi-delta-down::before { content: "\25BC\00A0"; }
.kpi-delta-flat::before { content: "\25AC\00A0"; }
.kpi-delta.is-good { color: var(--color-success); }
.kpi-delta.is-bad { color: var(--color-danger-text); }
.kpi-status { margin: var(--space-1) 0 0; }


/* Inputs tab: groups by source, collapsible (details), one row per fact. */
details.bc-src-group { margin: 0 0 var(--space-3); border: 1px solid var(--color-border); border-left-width: 6px; border-radius: var(--radius); background: var(--color-surface); padding: var(--space-2) var(--space-3); }
details.bc-src-group > summary { cursor: pointer; font-weight: 600; }
details.bc-src-group-document { border-left-color: var(--color-info); }
details.bc-src-group-ai { border-left-color: var(--color-brand); }
details.bc-src-group-policy { border-left-color: var(--color-success); }
details.bc-src-group-user { border-left-color: var(--color-border); }
details.bc-src-group table { margin-top: var(--space-2); }
table.bc-inputs th[scope="row"] { width: 28%; font-weight: 600; }
details.bc-src-group summary:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 2px; }

/* The three cards of the cash cockpit (w3c: Minimum balance, Covenant headroom, Alternative portfolios) and of the tab "Scenarios and cash flow": side by side on a wide screen, stacked on a narrow one. */
.cash-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); align-items: start; margin: 0 0 var(--space-3); }
.cash-cards > .card { margin-bottom: 0; min-width: 0; }
.cash-cards dl.bc-dl { grid-template-columns: minmax(0, 1fr); gap: 0; }
.cash-cards dl.bc-dl dd { margin: 0 0 var(--space-2); overflow-wrap: normal; }
/* the amount tables (money, FTE, working capital) keep their numbers on one line; the key-value table of the inputs wraps its text */
table.bc-inputs.bc-compact td:nth-child(n+3) { white-space: nowrap; overflow-wrap: normal; }
#scenario-selector select { max-width: 16rem; }

/* Covenant headroom zones (A19.1) and the portfolio comparison (A19.2). The zone is carried by the WORD and a symbol in the cell; the colour (a bar and a soft background) is an addition.
   Bar colours are the specified zone colours (green #228B22, orange #D4A000, red #CC0000); text stays --color-text on the soft backgrounds (contrast of the tokens above). */
.zone { display: inline-block; padding: 0.1rem var(--space-2); border-left: 6px solid var(--color-border); white-space: nowrap; }
.zone-green { border-left-color: var(--zone-green); background: var(--color-success-soft); }
.zone-orange { border-left-color: var(--zone-orange); background: var(--color-warning-soft); }
.zone-red { border-left-color: var(--zone-red); background: var(--color-danger-soft); }
.zone-none { border-left-color: transparent; }
.zone-symbol { display: inline-block; min-width: 1em; font-weight: 700; }
.zone-line { display: block; margin-bottom: var(--space-1); }
td.zone-cell { white-space: nowrap; }
.cmp-table thead th { position: sticky; top: 0; background: var(--color-surface-alt); z-index: 1; }
.cmp-table tbody th[scope="row"] { position: sticky; left: 0; background: var(--color-surface); text-align: left; }
.cmp-table tr.cmp-group th { background: var(--color-surface-alt); text-align: left; }
.cmp-table td.num { text-align: right; white-space: normal; min-width: 9rem; }
.cmp-pos { font-weight: 700; color: var(--color-success); }
.cmp-neg { font-weight: 700; color: var(--color-danger-text); }
.cmp-nosim { color: var(--color-danger-text); }
.cmp-form fieldset { border: 1px solid var(--color-border); border-radius: var(--radius); }
.cmp-line { fill: none; stroke-width: 3; }
.cmp-line.cmp-s0 { stroke: var(--color-primary); }
.cmp-line.cmp-s1 { stroke: var(--color-accent); stroke-dasharray: 9 4; }
.cmp-line.cmp-s2 { stroke: var(--color-info); stroke-dasharray: 3 3; }
.cmp-line.cmp-s3 { stroke: var(--color-success); stroke-dasharray: 14 3 3 3; }
.cmp-line.cmp-s4 { stroke: var(--series-3); stroke-dasharray: 1 4; stroke-linecap: round; }
.cmp-mark { fill: var(--color-surface); stroke-width: 2.5; }
.cmp-mark.cmp-s0 { stroke: var(--color-primary); } .cmp-mark.cmp-s1 { stroke: var(--color-accent); } .cmp-mark.cmp-s2 { stroke: var(--color-info); }
.cmp-mark.cmp-s3 { stroke: var(--color-success); } .cmp-mark.cmp-s4 { stroke: var(--series-3); }
.cmp-mark-fill { fill: var(--color-text); }
.cmp-hit { fill: transparent; stroke: none; }
.cmp-swatch { vertical-align: middle; margin-right: var(--space-2); }

/* Footer: a dark line with the product label and the build identification (commit, build time) and the warning of a service/worker commit mismatch. */
.app-footer { margin-top: auto; padding: var(--space-3) var(--space-4); background: var(--color-footer-bg); color: var(--color-footer-text); font-size: var(--text-sm); }
.app-footer a { color: var(--color-footer-text); }
.app-footer .build-info { display: block; color: var(--color-footer-muted); font-size: var(--text-xs); }
.app-footer .build-mismatch { margin-top: var(--space-2); background: var(--color-warning-soft); color: var(--color-text); }

/* Cash cockpit (UX refresh U1): the run line is a strip, the three cards are tiles with an accent rule and the first figure of each is large, the labels small. */
.cash-head { background: var(--color-surface); border: 1px solid var(--color-line); border-radius: var(--radius); padding: var(--space-2) var(--space-3); box-shadow: var(--shadow-1); }
.cash-cards > .card { border-top: 3px solid var(--color-brand); }
.cash-cards dl.bc-dl dt { font-size: var(--text-sm); }
.cash-cards dl.bc-dl dd { font-size: var(--text-lg); font-weight: var(--weight-medium); font-variant-numeric: tabular-nums; }
.cash-cards dl.bc-dl dd strong { font-size: var(--text-xl); }

/* Increased contrast requested by the user: strong borders instead of hairlines. */
@media (prefers-contrast: more) {
  .card, table, .kpi, .layout > nav .who, .alert, .refusal, .banner, .notice { border-color: var(--color-border); }
  th, td { border-bottom-color: var(--color-border); }
}
/* Reduced motion: no shimmer and no smooth scrolling. */
@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; }
  html { scroll-behavior: auto; }
}

/* Narrow screens (900 px and below): single column, the navigation collapses behind the menu button (CSS only: the checkbox #nav-toggle). */
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: var(--space-3); padding: var(--space-3); }
  .menu-button { display: inline-flex; }
  .layout > nav { display: none; position: static; background: var(--color-surface); border: 1px solid var(--color-line); border-radius: var(--radius-lg); box-shadow: var(--shadow-1); padding: var(--space-2); }
  .nav-toggle:checked ~ .layout > nav { display: flex; }
  .app-header { padding: var(--space-1) var(--space-3); }
  .role { display: none; }
  h1 { font-size: var(--text-xl); }
  .page-subtitle { font-size: var(--text-md); }
  .cols { grid-template-columns: minmax(0, 1fr); }
  .lanes { grid-template-columns: minmax(0, 1fr); }
  .bc-field-grid { grid-template-columns: minmax(0, 1fr); }
  .bc-dl { grid-template-columns: minmax(0, 1fr); }
  .cash-cards { grid-template-columns: minmax(0, 1fr); }
  .card { padding: var(--space-3); }
  table.bc-inputs th[scope="row"] { width: auto; }
  ol.bc-steps { flex-direction: column; }
  th, td { padding: var(--space-1) var(--space-2); }
}

/* Cash cockpit increment C1: the extra lines of a KPI tile (definition, source, change) and the subtotal row of the position table. Tokens only. */
.kpi-line { margin: var(--space-1) 0 0; font-size: var(--text-sm); line-height: 1.4; overflow-wrap: anywhere; }
.kpi-source { display: block; margin-top: var(--space-2); font-size: var(--text-sm); }
.cash-na { color: var(--color-muted); }
table.cash-table tr.cash-subtotal > th, table.cash-table tr.cash-subtotal > td { background: var(--color-surface-alt); }
table.cash-position th[scope="row"] { text-align: left; font-weight: var(--weight-medium); }

/* R2 checkbox and field patterns */
/* Check box (R2): a compact custom box with a check mark, the label next to it (clickable), a one-line explanation under the label, aligned with it. Markup from BcView::checkbox:
   .check-row > input[type=checkbox] + label + .check-help. The general rule "input { width: 100%; min-height }" made the box a big empty square; these rules undo that for boxes. */
.check-row { display: grid; grid-template-columns: 1.25rem 1fr; column-gap: var(--space-2); align-items: start; margin: 0 0 var(--space-2); max-width: 46rem; }
.check-row input[type="checkbox"], label input[type="checkbox"] { appearance: none; -webkit-appearance: none; display: inline-block; width: 1.25rem; min-width: 1.25rem; height: 1.25rem; min-height: 1.25rem; margin: 0.1rem 0 0; padding: 0; border: 2px solid var(--color-text); border-radius: 4px; background: var(--color-surface); cursor: pointer; position: relative; accent-color: var(--color-accent); }
.check-row input[type="checkbox"]:checked, label input[type="checkbox"]:checked { background: var(--color-accent); border-color: var(--color-accent); }
.check-row input[type="checkbox"]:checked::after, label input[type="checkbox"]:checked::after { content: ""; position: absolute; left: 0.34rem; top: 0.08rem; width: 0.3rem; height: 0.65rem; border: solid var(--color-surface); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.check-row input[type="checkbox"]:focus-visible, label input[type="checkbox"]:focus-visible { outline: 3px solid var(--color-brand); outline-offset: 2px; }
.check-row input[type="checkbox"][disabled] { opacity: 0.6; cursor: not-allowed; }
.check-row label { display: block; margin: 0; font-weight: var(--weight-medium); cursor: pointer; }
.check-row .check-help { grid-column: 2; display: block; color: var(--color-muted); font-size: var(--text-sm); line-height: 1.4; }
fieldset > .check-row, .bc-tick, .bc-bulk-tick { margin-top: var(--space-2); }
td > .check-row { margin: 0; max-width: 16rem; }
.bc-line-tag { font-weight: var(--weight-normal); color: var(--color-muted); }
.bc-line-tag + .bc-term, .bc-line-tag { overflow-wrap: anywhere; }
.bc-shared { padding: var(--space-3); background: var(--color-surface-alt); border-radius: var(--radius); }
details.bc-per-line { margin-top: var(--space-2); }
details.bc-per-line > summary { cursor: pointer; font-weight: var(--weight-medium); }

/* Progress bar of the extraction (R2): role="progressbar" with aria-valuenow; the fill width comes from the class pw-N (no inline style); an indeterminate stage shows a slow moving stripe. */
.progress { position: relative; height: 1rem; margin: var(--space-2) 0; background: var(--color-surface-alt); border: 1px solid var(--color-border); border-radius: 999px; overflow: hidden; }
.progress-fill { display: block; height: 100%; background: var(--color-accent); border-radius: 999px; transition: width 0.4s ease; }
.progress-indeterminate .progress-fill { background-image: linear-gradient(90deg, color-mix(in srgb, var(--color-surface) 35%, transparent) 25%, transparent 25%, transparent 50%, color-mix(in srgb, var(--color-surface) 35%, transparent) 50%, color-mix(in srgb, var(--color-surface) 35%, transparent) 75%, transparent 75%); background-size: 1.5rem 1.5rem; animation: progress-stripes 2.4s linear infinite; }
@keyframes progress-stripes { from { background-position: 0 0; } to { background-position: 3rem 0; } }
@media (prefers-reduced-motion: reduce) { .progress-indeterminate .progress-fill { animation: none; } .progress-fill { transition: none; } }
.job-file { margin: 0 0 var(--space-1); overflow-wrap: anywhere; }
.pw-0 { width: 0%; }
.pw-1 { width: 1%; }
.pw-2 { width: 2%; }
.pw-3 { width: 3%; }
.pw-4 { width: 4%; }
.pw-5 { width: 5%; }
.pw-6 { width: 6%; }
.pw-7 { width: 7%; }
.pw-8 { width: 8%; }
.pw-9 { width: 9%; }
.pw-10 { width: 10%; }
.pw-11 { width: 11%; }
.pw-12 { width: 12%; }
.pw-13 { width: 13%; }
.pw-14 { width: 14%; }
.pw-15 { width: 15%; }
.pw-16 { width: 16%; }
.pw-17 { width: 17%; }
.pw-18 { width: 18%; }
.pw-19 { width: 19%; }
.pw-20 { width: 20%; }
.pw-21 { width: 21%; }
.pw-22 { width: 22%; }
.pw-23 { width: 23%; }
.pw-24 { width: 24%; }
.pw-25 { width: 25%; }
.pw-26 { width: 26%; }
.pw-27 { width: 27%; }
.pw-28 { width: 28%; }
.pw-29 { width: 29%; }
.pw-30 { width: 30%; }
.pw-31 { width: 31%; }
.pw-32 { width: 32%; }
.pw-33 { width: 33%; }
.pw-34 { width: 34%; }
.pw-35 { width: 35%; }
.pw-36 { width: 36%; }
.pw-37 { width: 37%; }
.pw-38 { width: 38%; }
.pw-39 { width: 39%; }
.pw-40 { width: 40%; }
.pw-41 { width: 41%; }
.pw-42 { width: 42%; }
.pw-43 { width: 43%; }
.pw-44 { width: 44%; }
.pw-45 { width: 45%; }
.pw-46 { width: 46%; }
.pw-47 { width: 47%; }
.pw-48 { width: 48%; }
.pw-49 { width: 49%; }
.pw-50 { width: 50%; }
.pw-51 { width: 51%; }
.pw-52 { width: 52%; }
.pw-53 { width: 53%; }
.pw-54 { width: 54%; }
.pw-55 { width: 55%; }
.pw-56 { width: 56%; }
.pw-57 { width: 57%; }
.pw-58 { width: 58%; }
.pw-59 { width: 59%; }
.pw-60 { width: 60%; }
.pw-61 { width: 61%; }
.pw-62 { width: 62%; }
.pw-63 { width: 63%; }
.pw-64 { width: 64%; }
.pw-65 { width: 65%; }
.pw-66 { width: 66%; }
.pw-67 { width: 67%; }
.pw-68 { width: 68%; }
.pw-69 { width: 69%; }
.pw-70 { width: 70%; }
.pw-71 { width: 71%; }
.pw-72 { width: 72%; }
.pw-73 { width: 73%; }
.pw-74 { width: 74%; }
.pw-75 { width: 75%; }
.pw-76 { width: 76%; }
.pw-77 { width: 77%; }
.pw-78 { width: 78%; }
.pw-79 { width: 79%; }
.pw-80 { width: 80%; }
.pw-81 { width: 81%; }
.pw-82 { width: 82%; }
.pw-83 { width: 83%; }
.pw-84 { width: 84%; }
.pw-85 { width: 85%; }
.pw-86 { width: 86%; }
.pw-87 { width: 87%; }
.pw-88 { width: 88%; }
.pw-89 { width: 89%; }
.pw-90 { width: 90%; }
.pw-91 { width: 91%; }
.pw-92 { width: 92%; }
.pw-93 { width: 93%; }
.pw-94 { width: 94%; }
.pw-95 { width: 95%; }
.pw-96 { width: 96%; }
.pw-97 { width: 97%; }
.pw-98 { width: 98%; }
.pw-99 { width: 99%; }
.pw-100 { width: 100%; }
fieldset + button, fieldset + .bc-buttons { margin-top: var(--space-3); }

/* ===================================================================================================================================================================
   UX step U2 (2026-10-16): compact design, comfortable density on touch, info button, slim toolbar, cash cockpit layout, notice list, count badges, accordion.
   =================================================================================================================================================================== */

/* Comfortable density: the --comfortable-* tokens of the :root block copied over the working tokens. The first rule is the touch and narrow-screen restore (44 px controls, 16 px
   text); it is set on body because the :root block may not be repeated. The second is the class `density-comfortable` (on html or body) for a later user preference.
   The two lists are identical on purpose: custom properties cannot be copied in groups. */
@media (max-width: 900px), (pointer: coarse) {
  body {
    --font-size: var(--comfortable-font-size); --line-height: var(--comfortable-line-height); --text-xs: var(--comfortable-text-xs); --text-sm: var(--comfortable-text-sm);
    --text-md: var(--comfortable-text-md); --text-lg: var(--comfortable-text-lg); --text-xl: var(--comfortable-text-xl); --text-2xl: var(--comfortable-text-2xl); --text-kpi: var(--comfortable-text-kpi);
    --space-1: var(--comfortable-space-1); --space-2: var(--comfortable-space-2); --space-3: var(--comfortable-space-3); --space-4: var(--comfortable-space-4); --space-5: var(--comfortable-space-5);
    --space-6: var(--comfortable-space-6); --control-height: var(--comfortable-control-height); --control-pad-y: var(--comfortable-control-pad-y); --control-pad-x: var(--comfortable-control-pad-x);
    --btn-height: var(--comfortable-btn-height); --btn-sm-height: var(--comfortable-btn-sm-height); --btn-lg-height: var(--comfortable-btn-lg-height); --hit-min: var(--comfortable-hit-min);
    --table-pad-y: var(--comfortable-table-pad-y); --table-pad-x: var(--comfortable-table-pad-x); --card-pad: var(--comfortable-card-pad); --nav-pad-y: var(--comfortable-nav-pad-y);
    --icon-size: var(--comfortable-icon-size); --tab-pad-y: var(--comfortable-tab-pad-y);
  }
}
.density-comfortable {
  --font-size: var(--comfortable-font-size); --line-height: var(--comfortable-line-height); --text-xs: var(--comfortable-text-xs); --text-sm: var(--comfortable-text-sm);
  --text-md: var(--comfortable-text-md); --text-lg: var(--comfortable-text-lg); --text-xl: var(--comfortable-text-xl); --text-2xl: var(--comfortable-text-2xl); --text-kpi: var(--comfortable-text-kpi);
  --space-1: var(--comfortable-space-1); --space-2: var(--comfortable-space-2); --space-3: var(--comfortable-space-3); --space-4: var(--comfortable-space-4); --space-5: var(--comfortable-space-5);
  --space-6: var(--comfortable-space-6); --control-height: var(--comfortable-control-height); --control-pad-y: var(--comfortable-control-pad-y); --control-pad-x: var(--comfortable-control-pad-x);
  --btn-height: var(--comfortable-btn-height); --btn-sm-height: var(--comfortable-btn-sm-height); --btn-lg-height: var(--comfortable-btn-lg-height); --hit-min: var(--comfortable-hit-min);
  --table-pad-y: var(--comfortable-table-pad-y); --table-pad-x: var(--comfortable-table-pad-x); --card-pad: var(--comfortable-card-pad); --nav-pad-y: var(--comfortable-nav-pad-y);
  --icon-size: var(--comfortable-icon-size); --tab-pad-y: var(--comfortable-tab-pad-y);
}

/* Info button: a round "i" (24 px hit area) that opens a small panel with the definition and the source of a figure. Native details element, no script. The panel opens under the
   button, aligned to its right edge, and stays inside the viewport on a narrow screen (max-width). Markup from Info::button(). */
details.info { position: relative; display: inline-block; flex: 0 0 auto; vertical-align: middle; }
summary.info-btn { list-style: none; display: inline-flex; align-items: center; justify-content: center; width: var(--hit-min); height: var(--hit-min); border-radius: 50%; cursor: pointer;
  border: 1px solid var(--color-border); background: var(--color-surface); color: var(--color-muted); font-size: var(--text-sm); font-weight: var(--weight-bold); font-style: italic; font-family: Georgia, serif; line-height: 1; }
summary.info-btn::-webkit-details-marker { display: none; }
summary.info-btn:hover, details.info[open] > summary.info-btn { background: var(--color-brand-soft); color: var(--color-text); border-color: var(--color-brand); }
summary.info-btn:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 2px; }
.info-body { position: absolute; z-index: 15; top: calc(100% + 4px); right: 0; width: 22rem; max-width: min(22rem, calc(100vw - 2rem)); padding: var(--space-2) var(--space-3);
  background: var(--color-surface); color: var(--color-text); border: 1px solid var(--color-border); border-radius: var(--radius); box-shadow: var(--shadow-2); font-size: var(--text-sm); font-weight: var(--weight-normal); font-style: normal; text-align: left; }
.info-body p { margin: 0 0 var(--space-2); font-size: var(--text-sm); }
.info-body p:last-child { margin-bottom: 0; }

/* Slim card and slim toolbar: a thin white strip instead of a full card (selector row, run details). */
.card-slim { padding: var(--space-2) var(--space-3); margin-bottom: var(--space-3); border-radius: var(--radius); box-shadow: none; }
details#run.card { padding: var(--space-2) var(--space-3); margin-bottom: var(--space-3); border-radius: var(--radius); box-shadow: none; }
details#run.card > summary, details.card-slim > summary { cursor: pointer; font-weight: var(--weight-medium); }
form.cash-selector { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-4); }
form.cash-selector p { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); max-width: 100%; }
form.cash-selector label { margin: 0; white-space: nowrap; }
form.cash-selector select { width: auto; max-width: min(16rem, 100%); min-width: 0; }
#selector > p { margin: var(--space-1) 0 0; font-size: var(--text-sm); }
#cash-result { margin: var(--space-1) 0 0; font-size: var(--text-sm); }

/* KPI tile head: title on the left, info button on the right. */
.kpi-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); min-height: var(--hit-min); }
.kpi-head .kpi-label { flex: 1 1 auto; }
.kpi .kpi-line { margin: 0; }
.kpi .kpi-value { margin-top: 0; }
.cash-pair { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-3); align-items: start; margin: 0 0 var(--space-3); }
.cash-pair > .card { margin-bottom: 0; min-width: 0; }
.card-header .info { margin-left: auto; }
.card-header { margin-bottom: var(--space-2); padding-bottom: var(--space-1); }
.card-header > h2, .card-header > h3 { font-size: var(--text-lg); }
.card > h2:first-child, .card > h3:first-child { margin-bottom: var(--space-2); padding-bottom: var(--space-1); font-size: var(--text-lg); }
table.cash-position td, table.cash-position th, table.cash-weeks td, table.cash-weeks th { font-size: var(--text-sm); }
table.cash-weeks td, table.cash-weeks th { padding: var(--space-1) var(--space-2); }
table.cash-position td { overflow-wrap: normal; }
table.cash-position td:nth-child(3) { white-space: nowrap; }
table.cash-position td:nth-child(3) .muted { display: block; white-space: nowrap; font-size: var(--text-xs); }
.cash-base-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-3); align-items: start; }
.cash-base-grid .cash-figure { margin: 0; }
.cash-base-grid .cash-chart { max-width: none; }
.cash-base-grid .table-scroll table { margin-bottom: 0; }
.cash-head { margin: 0 0 var(--space-2); }

@media (min-width: 1100px) {
  .cash-pair { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
}

/* Tabs: a count badge after the label (a number in a small pill; the number is also in the text of the link, so it is read by a screen reader), and compact segments. */
.tab .count { display: inline-block; min-width: 1.4em; margin-left: var(--space-1); padding: 0 var(--space-1); border-radius: var(--radius-pill); background: var(--color-surface-alt); color: var(--color-text); font-size: var(--text-sm); font-weight: var(--weight-bold); text-align: center; line-height: 1.5; }
.tab-on .count { background: var(--color-brand-soft); }
.tab .count-warn { background: var(--color-warning); color: var(--color-warning-contrast); }
.tab-intro { margin: 0 0 var(--space-2); color: var(--color-muted); font-size: var(--text-sm); }

/* Run notices (Inkaso tab "Upozornění z běhu"): one row per notice, a severity word with a symbol, the sentence "what happened", then "why it matters" and "what to do" in small
   text. A slim left rule carries the colour; the WORD carries the meaning. No box around the list. */
ul.notices { list-style: none; margin: 0 0 var(--space-3); padding: 0; background: var(--color-surface); border: 1px solid var(--color-line); border-radius: var(--radius); }
ul.notices > li { display: grid; grid-template-columns: 8rem minmax(0, 1fr); gap: var(--space-1) var(--space-3); padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--color-line); border-left: 4px solid var(--color-border); }
ul.notices > li:last-child { border-bottom: 0; }
ul.notices > li.notice-high { border-left-color: var(--color-danger); }
ul.notices > li.notice-warn { border-left-color: var(--color-warning); }
ul.notices > li.notice-info { border-left-color: var(--color-info); }
.notice-sev { font-weight: var(--weight-bold); white-space: nowrap; }
.notice-sev::before { margin-right: var(--space-1); }
.notice-high .notice-sev { color: var(--color-danger-text); }
.notice-high .notice-sev::before { content: "\2715"; }
.notice-warn .notice-sev::before { content: "\25B2"; color: var(--color-accent); }
.notice-info .notice-sev::before { content: "\2139"; color: var(--color-info); }
.notice-what { font-weight: var(--weight-medium); }
.notice-more { display: block; color: var(--color-muted); font-size: var(--text-sm); font-weight: var(--weight-normal); }
.notice-more strong { color: var(--color-text); }
.notice-raw { display: block; color: var(--color-muted); font-size: var(--text-sm); }

/* Compact lists and explanation lines of the Inkaso tabs. */
.explain { margin: 0 0 var(--space-2); color: var(--color-muted); font-size: var(--text-sm); }
table.exceptions td:first-child, table.ignored td:first-child { white-space: nowrap; }
table.ranking { font-size: var(--text-sm); }
table.ranking .shadow { font-size: var(--text-xs); padding: 0 var(--space-1); font-weight: var(--weight-medium); }

/* Accordion of the guided entry (step 3, one block per line): the summary names the line and its figures; the first line is open. */
details.bc-acc { margin: 0 0 var(--space-2); border: 1px solid var(--color-border); border-radius: var(--radius); background: var(--color-surface); }
details.bc-acc > summary { cursor: pointer; padding: var(--space-2) var(--space-3); font-weight: var(--weight-medium); min-height: var(--hit-min); }
details.bc-acc > summary:focus-visible { outline: 3px solid var(--color-focus); outline-offset: -3px; }
details.bc-acc[open] > summary { border-bottom: 1px solid var(--color-line); background: var(--color-surface-alt); }
details.bc-acc > .bc-acc-body { padding: var(--space-2) var(--space-3); }
details.bc-acc > .bc-acc-body > fieldset { margin-top: 0; }
.bc-acc-sum { color: var(--color-muted); font-weight: var(--weight-normal); font-size: var(--text-sm); }

/* Plain reason sentence under a choice (upload page) and the one-sentence explanation of a button. */
.reason { margin: 0 0 var(--space-2); color: var(--color-muted); font-size: var(--text-sm); }
.btn-explain { display: block; margin: var(--space-1) 0 var(--space-2); color: var(--color-muted); font-size: var(--text-sm); }

/* Inside an accordion item the fieldset loses its own frame and its legend (the summary names the line; the legend stays for screen readers). */
details.bc-acc > .bc-acc-body > fieldset.bc-line { border: 0; padding: 0; margin: 0; }
details.bc-acc > .bc-acc-body > fieldset.bc-line > legend { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Administration (W11): the short sections sit in pairs on a wide screen (users next to delegations, rules next to the mode switch); a narrow screen stacks them. */
.admin-pair { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 var(--space-4); align-items: start; }
.admin-sec { min-width: 0; }
.admin-sec h2 { margin-top: var(--space-3); }
.admin-sec form.inline p { gap: var(--space-2); }
@media (min-width: 1100px) { .admin-pair { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
/* Empty state: a slim dashed line, not a tall box. */
.empty { padding: var(--space-3) var(--space-3); }

/* Process view (U2): the lane is the column heading, so a step does not repeat it (the pair stays in the HTML for screen readers); the other pairs sit in two columns (label left, text right). */
.step dl { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: 0 var(--space-2); }
.step dl > dt:first-of-type, .step dl > dt:first-of-type + dd { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.step dt { font-size: var(--text-sm); }
.step dd { margin: 0 0 var(--space-1); }
.step { position: relative; }

/* Narrow screens: the severity word of a notice stands above its text instead of in a column of its own. */
@media (max-width: 600px) {
  ul.notices > li { grid-template-columns: minmax(0, 1fr); }
}

/* Forecast (MVP-2 F1): categories that expand inside a table cell, the definition lists of a week and of a ledger row, the colour-coded type badges of the variance ledger and the week
   window. The window needs no script: it is hidden until the address ends with its id (:target); the close link goes back to the weekly table. Tokens only. */
.fc-expand > summary { cursor: pointer; display: inline; }
.fc-weeks td.num .fc-expand, .fc-ledger th .fc-expand { text-align: left; }
.fc-weeks td.num .fc-expand > summary { text-align: right; }
.fc-split { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 var(--space-3); margin: var(--space-1) 0 0; font-size: var(--text-sm); }
.fc-split dt { color: var(--color-muted); }
.fc-split dt.fc-sub { padding-left: var(--space-3); }
.fc-split dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.fc-ledger .fc-split { grid-template-columns: 8rem minmax(0, 1fr); font-weight: var(--weight-normal); }
.fc-ledger .fc-split dd { text-align: left; }
.fc-week-link { font-weight: var(--weight-bold); }
/* Week cell of the weekly table: the number and the date range are two blocks (two lines) with a stable minimum width, so the label and the dates never run together. The range keeps
   each date in one piece (no-break spaces) and may break only at the word between the two dates. */
.fc-weeks th.fc-week { min-width: 9.5rem; white-space: normal; overflow-wrap: normal; }
.fc-weeks .fc-week-no { display: block; line-height: var(--leading, 1.4); }
.fc-weeks .fc-week-range { display: block; font-size: var(--text-sm); font-weight: var(--weight-normal); line-height: 1.4; }
/* Expanded categories (details inside a figure cell): a summary on its own line, the categories below it as a two-column grid whose columns size to their content, so a long category
   name can never run under its amount; every row has its own line height, no absolute positioning. The week window uses the same list (a full-width grid there). */
.fc-weeks td.num details.fc-expand { display: block; }
.fc-weeks td.num details.fc-expand > summary { display: block; line-height: 1.4; }
.fc-weeks .fc-split { grid-template-columns: max-content max-content; justify-content: end; column-gap: var(--space-3); row-gap: 0; line-height: 1.5; margin-top: var(--space-1); }
.fc-weeks .fc-split dt { white-space: nowrap; text-align: left; min-height: 1.5em; }
.fc-weeks .fc-split dd { white-space: nowrap; min-height: 1.5em; }
.fc-weeks .fc-split dt.fc-sub { padding-left: 0; }
.modal-box .fc-split { line-height: 1.5; row-gap: var(--space-1); margin-bottom: var(--space-3); }
.modal-box .fc-split dt, .modal-box .fc-split dd { min-height: 1.5em; overflow-wrap: anywhere; }
.fc-weeks td .fc-nosplit { display: block; white-space: normal; }

.fc-filter fieldset { border: 0; margin: 0; padding: 0; }
.fc-sort { color: inherit; text-decoration: none; white-space: nowrap; }
.fc-sort:hover { text-decoration: underline; }
.badge-fc-info { background: var(--color-info); color: var(--color-info-contrast); border-color: var(--color-info); }
.badge-fc-warn { background: var(--color-warning); color: var(--color-warning-contrast); border-color: var(--color-warning); }
.badge-fc-ok { background: var(--color-success); color: var(--color-success-contrast); border-color: var(--color-success); }
.badge-fc-primary { background: var(--color-primary); color: var(--color-primary-contrast); border-color: var(--color-primary); }
.badge-fc-bad { background: var(--color-danger); color: var(--color-danger-contrast); border-color: var(--color-danger); }
.badge-fc-grey { background: var(--color-surface-alt); color: var(--color-text); border-color: var(--color-border); }
.modal { display: none; }
.modal:target { display: flex; position: fixed; inset: 0; z-index: 40; align-items: flex-start; justify-content: center; padding: var(--space-5) var(--space-3); overflow-y: auto; }
.modal-backdrop { position: fixed; inset: 0; background: var(--color-text); opacity: 0.45; }
.modal-box { position: relative; width: min(46rem, 100%); background: var(--color-surface); border: 1px solid var(--color-line); border-radius: var(--radius-lg); box-shadow: var(--shadow-2); padding: var(--space-3) var(--space-4); }


/* Break-even section of the business case card (A23, wireframe w13c3b). Colours come from the tokens; the realism flag always carries a word as well as a colour. */
.be-form fieldset { border: 1px solid var(--color-line); padding: var(--space-2) var(--space-3); margin: 0 0 var(--space-2); }
.be-goal-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: 0 0 var(--space-1); }
table.bc-breakeven-table td.num, table.bc-variants td.num { white-space: nowrap; text-align: right; }
table.bc-breakeven-table tr.be-na th, table.bc-breakeven-table tr.be-na td { color: var(--color-muted); background: var(--color-surface-alt); font-style: italic; }
table.be-disabled { opacity: 0.6; }
.be-flag-green { background: var(--color-success); color: var(--color-success-contrast); border-color: var(--color-success); }
.be-flag-amber { background: var(--color-warning); color: var(--color-warning-contrast); border-color: var(--color-warning); }
.be-flag-red { background: var(--color-danger); color: var(--color-danger-contrast); border-color: var(--color-danger); }
.be-card { margin: var(--space-3) 0; padding: var(--space-3); border-left: 3px solid var(--color-success); background: var(--color-success-soft); color: var(--color-text); }
.be-card-red { border-left-color: var(--color-danger); background: var(--color-danger-soft); }
.be-met { border-left-color: var(--color-success); background: var(--color-success-soft); }
.be-adjust { margin: 0 0 var(--space-2); padding-left: var(--space-4); }
.be-measure { margin: var(--space-2) 0; padding: var(--space-2) var(--space-3); border-left: 3px solid var(--color-warning); background: var(--color-warning-soft); color: var(--color-text); }
.be-measure h5 { margin: 0 0 var(--space-1); }
.be-ai-badge { background: var(--color-brand-soft); color: var(--color-text); border: 1px solid var(--color-accent); }
details.be-variant-form { margin: var(--space-2) 0; }
@media (max-width: 600px) { .be-card, .be-measure { padding: var(--space-2); } }

/* Runs and calendar (TL-48, BR-M2-24). Colours come from the tokens; every status carries a word and (except planned) a symbol as well as a colour. */
.runs-top { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.runs-layout { display: block; }
.runs-layout.has-panel { display: grid; grid-template-columns: minmax(0, 3fr) minmax(18rem, 2fr); gap: var(--space-3); align-items: start; }
.run-panel { position: sticky; top: var(--space-3); }
.run-list { margin: 0 0 var(--space-2); padding-left: var(--space-4); }
.run-facts dt { font-weight: var(--weight-medium); }
.run-facts dd { margin: 0 0 var(--space-1); }
.run-planned { color: var(--color-muted); }
.run-row-notimpl th, .run-row-notimpl td { color: var(--color-muted); background: var(--color-zebra); }
.run-row-notimpl .run-name, .run-row-notimpl .run-routine { font-weight: var(--weight-normal); }
.run-row-notimpl .run-def-btn { color: var(--color-muted); }      /* subdued but readable: muted text (AA on the zebra tint), the link stays underlined */
.runs-impl-count, .runs-legend { margin: var(--space-2) 0; }
.runs-legend { padding: var(--space-2) var(--space-3); background: var(--color-surface); border: 1px solid var(--color-line); border-radius: var(--radius); }
.run-notimpl-note { margin: var(--space-2) 0; padding: var(--space-2) var(--space-3); background: var(--color-notimpl-soft); border-left: 4px solid var(--color-notimpl); border-radius: var(--radius-sm); }
.run-row-degraded .run-name, .run-row-degraded .run-routine { color: var(--color-accent); }
.run-row-blocked .run-name, .run-row-failed .run-name { color: var(--color-danger-text); }
.run-row-running .run-name { color: var(--color-info); }
.run-row-skipped .run-name { color: var(--color-muted); }
.run-row-selected th, .run-row-selected td { background: var(--color-brand-soft); }
.run-running::before { content: "\21BB"; color: var(--color-info); }
.run-skipped::before { content: "\2013"; }
.run-manual { background: var(--color-brand-soft); color: var(--color-text); border: 1px solid var(--color-accent); }
.run-spinner { display: inline-block; width: 0.9em; height: 0.9em; border: 2px solid var(--color-accent); border-right-color: transparent; border-radius: 50%; vertical-align: -0.1em; animation: run-spin 1s linear infinite; }
@keyframes run-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .run-spinner { animation: none; } }
@media (max-width: 900px) { .runs-layout.has-panel { display: block; } .run-panel { position: static; margin-top: var(--space-3); } }

/* Routine definition popup of the Runs and calendar screen: a details element like the information bubble (i). The summary is the routine id and name (looks like a link). The body is
   a fixed, centred panel so that the scrolling box of a table cannot clip it; while it is open a dimmed layer made by the summary itself covers the page, and a click on the layer
   (that is on the summary) closes it again, no script needed. */
details.run-def { display: inline-block; vertical-align: baseline; }
summary.run-def-btn { cursor: pointer; list-style: none; display: inline; color: var(--color-link, var(--color-accent)); text-decoration: underline; text-underline-offset: 2px; }
summary.run-def-btn::-webkit-details-marker { display: none; }
summary.run-def-btn:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 2px; }
summary.run-def-btn .run-routine { font-weight: var(--weight-bold); }
details.run-def[open] > summary.run-def-btn::before { content: ""; position: fixed; inset: 0; z-index: 40; background: var(--color-text); opacity: 0.35; cursor: default; }
.run-def-body { position: fixed; z-index: 41; top: 10vh; right: auto; left: 50%; transform: translateX(-50%); width: min(36rem, calc(100vw - 2rem)); max-width: none; max-height: 80vh; overflow-y: auto; }
.run-def-body h3 { margin: var(--space-2) 0 var(--space-1); font-size: var(--text-sm); }
.run-def-body h3.run-def-title { margin-top: 0; font-size: var(--text-base, 1rem); }
.run-def-body .run-list { font-size: var(--text-sm); }
table.runs-table[data-week] td:nth-child(4) { white-space: nowrap; }

/* Conversation tab of the BC card (A19.3, w13c7): thread, message bubbles, proposal cards, the form. Same tokens as the rest of the card. */
.badge-src-conv { background: var(--color-brand); color: var(--color-brand-contrast); border-color: var(--color-brand); }
.bc-conv-thread { list-style: none; margin: 0 0 var(--space-3); padding: 0; }
.bc-conv-msg { margin: 0 0 var(--space-2); padding: .5rem .75rem; border: 1px solid var(--color-border); border-radius: 4px; max-width: 48rem; }
.bc-conv-user { margin-left: auto; background: var(--color-surface-alt); }
.bc-conv-head { font-size: var(--text-sm); margin-bottom: .25rem; }
.bc-conv-text { overflow-wrap: anywhere; }
.bc-conv-sources { margin: .25rem 0 0; }
.bc-conv-proposal { margin-top: .5rem; }
.bc-conv-actions form.inline { display: inline; }
.bc-conv-form textarea { width: 100%; max-width: 48rem; }
.bc-conv-draft { margin: 0; padding: .5rem .75rem; border-left: 3px solid var(--color-border); }

/* The common AI mark (TL-51, BR-M2-59 Part 3): one look wherever a screen shows AI output. Badge "AI <model>" on the information colour (white on --color-info), a panel
   with a left border of the same colour on the information tint, and the note "Proposal, not a decision". Computed facts and human input never get this frame. */
.ai-mark-badge { background: var(--color-info); color: var(--color-info-contrast); border-color: var(--color-info); font-weight: var(--weight-bold); }
.ai-mark-note { font-size: var(--text-sm); color: var(--color-muted); font-style: italic; }
.ai-frame { background: var(--color-info-soft); color: var(--color-text); border: 1px solid var(--color-line); border-left: 3px solid var(--color-info); border-radius: var(--radius); padding: var(--space-2) var(--space-3); margin: 0 0 var(--space-3); }
.ai-frame .ai-mark-head { margin: 0 0 var(--space-2); }
.ai-frame h3, .ai-frame h4 { margin: var(--space-2) 0 var(--space-1); font-size: var(--text-sm); }
.ai-frame ul { margin: 0 0 var(--space-2); padding-left: var(--space-4, 1.25rem); }
.ai-mark-inline { display: inline; }
.ai-rec-line { margin: var(--space-1) 0 0; font-size: var(--text-sm); }
.ai-rec-line .ai-mark-badge { margin-right: var(--space-1); }
.rec-actions { white-space: nowrap; }
.rec-actions form { display: inline-block; margin: 0 var(--space-1) 0 0; }
.rec-actions input { width: 9rem; }
.rec-confirm button { background: var(--color-info); color: var(--color-info-contrast); border-color: var(--color-info); }
.ai-res-pass { color: var(--color-success); font-weight: var(--weight-bold); }
.ai-res-fail { color: var(--color-danger-text); font-weight: var(--weight-bold); }
.ai-res-unknown { color: var(--color-muted); font-weight: var(--weight-bold); }

/* R2b movable card (cards.js): moved by its header, resized from its corner; without the script the card stays in its place. */
.anom-card { position: relative; resize: both; overflow: auto; min-width: 16rem; max-width: 100%; }
.anom-card .anom-handle { cursor: move; touch-action: none; user-select: none; }
.anom-card .anom-handle:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.anom-card .anom-reasons { margin: 0.25rem 0 0.75rem; padding-left: 1.25rem; }

/* Governance decisions (change of a routine mode): a section above the inbox list and a header chip; they are not mixed with payments. */
.urgent { border: 2px solid var(--color-warning, currentColor); border-radius: 6px; padding: 0.75rem 1rem; margin: 0 0 1rem; }
.urgent h2 { margin-top: 0; }
.urgent-list { list-style: none; padding: 0; margin: 0; }
.urgent-list li { margin: 0.5rem 0; }
.urgent-chip { display: inline-flex; gap: 0.35rem; align-items: center; border: 2px solid var(--color-warning, currentColor); border-radius: 999px; padding: 0.15rem 0.6rem; margin-right: 0.5rem; color: inherit; text-decoration: none; }

/* W5 accept checkbox: sized to the text line, in its own narrow column. */
table.ranking input.pick { width: 1rem; height: 1rem; margin: 0; vertical-align: middle; }

/* MES screen (Produkce, wireframes/mes-screen-render.html): status pills and negative figures, in the design tokens */
.pill { font-size: 12px; border-radius: var(--radius-pill); padding: 1px 8px; background: var(--color-surface-alt); }
.pill-prov { background: var(--color-warning-soft); color: var(--color-warning); }
.neg { color: var(--color-danger-text); }

/* MES screen: no line breaks inside figures and status cells */
.nowrap { white-space: nowrap; }

/* Produkce, planned orders (BR-MES-P table D2): the colour of the row follows the state; the state text is always shown too */
tr.plan-orange > td { background: var(--color-orange-soft); }
tr.plan-red > td { background: var(--color-danger-soft); }
tr.plan-green > td { background: var(--color-success-soft); }
.plan-badge { font-weight: 600; }
.plan-badge.plan-orange { background: var(--color-orange); border-color: var(--color-orange-line); color: var(--color-orange-text); }
.plan-badge.plan-red { background: var(--color-danger); border-color: var(--color-danger); color: var(--color-danger-contrast); }
.plan-badge.plan-green { background: var(--color-success); border-color: var(--color-success); color: var(--color-success-contrast); }

/* Finanční přehledy: compact tables that fit the width, row names on one line, the head always visible (sticky), period selectors side by side (CFO feedback 2026-10-30) */
.fin-wrap { overflow: visible; }
/* Monthly control: 12 months, 4 quarters, YTD and LTM do not fit a phone or a narrow window; scroll sideways inside the card instead of overflowing the page */
.r15-wrap { overflow-x: auto; max-width: 100%; }
.r15-table .fin-row { white-space: normal; min-width: 13rem; }
.fin-table { font-size: var(--text-sm); width: 100%; table-layout: auto; }
.fin-table th, .fin-table td { padding: 2px 5px; }
.fin-table .fin-row { white-space: nowrap; text-align: left; }
.fin-table thead th { position: sticky; top: 0; z-index: 2; background: var(--color-surface-alt); }
.fin-table td.num { white-space: nowrap; }
.fin-table .fin-q { border-left: 2px solid var(--color-line); }
.fin-table td.prov { font-style: italic; }
.fin-selector { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-3); }
.fin-selector label { display: inline-flex; gap: var(--space-2); align-items: center; }
.fin-cols { display: inline-flex; gap: var(--space-3); border: 1px solid var(--color-line); padding: 0 var(--space-2); }
.fin-table .info { display: inline-block; vertical-align: middle; }
.fin-table summary.info-btn { width: 1.35rem; height: 1.35rem; font-size: var(--text-xs); }
.fin-table th.fin-quarter { background: var(--color-info-soft); }
.fin-table td.fin-quarter { background: var(--color-info-soft); font-weight: 600; }
/* Plan monitoring (Sledování plánu): a line between the rows P1 to P7, a strong style for a negative difference */
.fin-table tr.group-start > * { border-top: 2px solid var(--color-border); }
.fin-table td.diff-neg { color: var(--color-danger-text); font-weight: 700; background: var(--color-danger-soft); }
.fin-table tr.diff > th { font-weight: 600; }

/* Cash cockpit, tab Přehled (CFO layout 2026-10-30): the figures in one grid so that the cards of a row have the same top edge, width and height. Left: Hotovost dnes and under it
   Rezerva covenantu; middle: Nejnižší týden and under it Přesnost odpovědi; right: the working-capital days across both rows. The column wrappers (cash-kpi-col) take no box of their own. */
.cash-kpi-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-3); align-items: stretch; margin: 0 0 var(--space-3); }
.cash-kpi-col { display: contents; }
.cash-kpi-layout > .cash-kpi-col > .kpi, .cash-kpi-layout > .cash-kpi-col > .card { margin: 0; }
@media (min-width: 900px) {
  .cash-kpi-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.3fr); grid-template-areas: "cash low wc" "cov acc wc"; }
  #kpi-cash { grid-area: cash; } #kpi-low { grid-area: low; } #kpi-cov { grid-area: cov; } #kpi-acc { grid-area: acc; } #cash-wc { grid-area: wc; }
}

/* Produkce, feedback MES-UX of 2026-10-31. */
/* MES-UX-1, 7: the year and the month (or the year alone) on one row, side by side, across the full width of the content area. */
.mes-period-row { display: flex; flex-flow: row nowrap; align-items: flex-end; gap: var(--space-3); width: 100%; }
.mes-period-row label { display: inline-flex; flex-direction: row; align-items: center; gap: var(--space-2); }
/* MES-UX-5: one colour for the summary columns and the summary rows of the tables of views A, B1, B2; it is not the orange, red or green of the states. */
table.mes-sumtable th.mes-sum, table.mes-sumtable td.mes-sum, table.mes-sumtable tr.total > *, table.mes-sumtable tr.overhead > *, table.mes-sumtable tr.sub > * { background: var(--mes-sum-bg); }
table.mes-sumtable th.mes-measure { white-space: nowrap; font-weight: normal; }
/* MES-UX-3: the centre code with its name under it. */
.mes-code { display: block; font-weight: var(--weight-bold); }
.mes-name { display: block; font-weight: normal; font-size: var(--text-sm); }
/* MES-UX-4, 11: compact tables that fit the page without a sideways scroll bar (the info bubbles are not clipped); the footer rows stay on one line. */
.mes-fit { width: 100%; overflow: visible; }
.mes-fit table { width: 100%; font-size: var(--text-sm); }
.mes-fit th, .mes-fit td { padding: var(--space-1) var(--space-2); }
.mes-fit td.num { white-space: nowrap; }
.mes-fit tr.total > th, .mes-fit tr.overhead > th, .mes-fit tr.sub > th { white-space: nowrap; }
.mes-fit tr.total > td, .mes-fit tr.overhead > td, .mes-fit tr.sub > td { white-space: nowrap; }
.mes-fit td.state { white-space: normal; }
.mes-oneline { white-space: nowrap; }
@media (max-width: 899px) { .mes-fit { overflow-x: auto; } }
/* MES-UX-2, 4, 14: the info bubble of a column or a row; opens on hover and on keyboard focus, no script. */
.mes-tip { position: relative; display: inline-block; vertical-align: middle; font-weight: normal; height: calc(1em * var(--line-height)); line-height: 1; }
.mes-tip-btn { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; width: calc(1em * var(--line-height)); height: calc(1em * var(--line-height)); border: 1px solid var(--color-border); border-radius: 50%; background: var(--color-surface); color: var(--color-text); font-size: 0.625rem; line-height: 1; font-weight: var(--weight-bold); cursor: help; }
.mes-tip-btn:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 2px; }
.mes-tip-body { display: none; position: absolute; z-index: 20; top: calc(100% + 4px); left: 50%; transform: translateX(-50%); width: 18rem; max-width: 80vw; padding: var(--space-2) var(--space-3); border: 1px solid var(--color-border); border-radius: var(--radius-sm, 4px); background: var(--color-surface); color: var(--color-text); font-size: var(--text-sm); font-weight: normal; text-align: left; white-space: normal; box-shadow: var(--shadow-1); }
.mes-tip-l .mes-tip-body { left: 0; transform: none; }
.mes-tip-r .mes-tip-body { left: auto; right: 0; transform: none; }
.mes-tip:hover .mes-tip-body, .mes-tip:focus-within .mes-tip-body { display: block; }
/* MES-UX-9, 13: legends under the tables. */
.mes-legend h4 { margin: var(--space-3) 0 var(--space-1); }
/* MES-UX-15, 18: stacked column chart and pie chart. */
.mes-chart-block { margin-top: var(--space-4); }
.mes-stacked { max-width: 720px; }
.mes-seg-1 { fill: var(--mes-seg-1); background: var(--mes-seg-1); }
.mes-seg-2 { fill: var(--mes-seg-2); background: var(--mes-seg-2); }
.mes-seg-3 { fill: var(--mes-seg-3); background: var(--mes-seg-3); }
.mes-seg-4 { fill: var(--mes-seg-4); background: var(--mes-seg-4); }
.mes-chart-legend { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); margin: var(--space-2) 0; padding: 0; list-style: none; }
.mes-swatch { display: inline-block; width: 0.9rem; height: 0.9rem; margin-right: var(--space-2); vertical-align: middle; border-radius: 2px; }
.mes-pie-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4); }
.mes-pie-row .mes-chart-legend { flex-direction: column; }
/* MES-UX-19: red marker of the tab Pracoviště, detail (open point F2). */
.mes-revise { color: var(--color-danger); font-weight: var(--weight-bold); }

/* Overdue pie chart of the collections: slices and legend swatches take the palette tokens; the legend gives the band and the amount. */
.overdue-body { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.overdue-pie { flex: 0 0 180px; }
.overdue-pie .slice { stroke: var(--color-surface); stroke-width: 1; }
.slice-1 { fill: var(--color-brand); }
.slice-2 { fill: var(--color-primary); }
.slice-3 { fill: var(--color-accent); }
.slice-4 { fill: var(--color-warning); }
.slice-5 { fill: var(--color-danger); }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.swatch.slice-1 { background: var(--color-brand); }
.swatch.slice-2 { background: var(--color-primary); }
.swatch.slice-3 { background: var(--color-accent); }
.swatch.slice-4 { background: var(--color-warning); }
.swatch.slice-5 { background: var(--color-danger); }
.pie-legend { list-style: none; padding: 0; margin: 0; }
.pie-legend li { margin: 4px 0; }
.overdue-bars { flex: 0 0 260px; }
.overdue-bars .axis { stroke: var(--color-border); }
.overdue-bars text.label { font-size: 11px; fill: var(--color-text); }
.bar-undisputed { fill: var(--color-brand); }
.bar-disputed { fill: var(--color-danger); }

/* Debug view of an extraction: the tree folds, each level is indented, long texts wrap */
.bc-debug-level { margin: .35rem 0 .35rem .9rem; }
.bc-debug-level > summary { cursor: pointer; font-weight: 600; }
.bc-debug-rows { display: grid; grid-template-columns: max-content 1fr; gap: .15rem .75rem; margin: .4rem 0; }
.bc-debug-rows dt { font-weight: 600; }
.bc-debug-rows dd { margin: 0; word-break: break-word; }
.bc-debug { white-space: pre-wrap; word-break: break-word; max-height: 28rem; overflow: auto; font-size: .85rem; }

/* a field that blocks the review: red edge and the short reason under the label */
.bc-field-block.bc-need { border-left: 4px solid var(--color-danger); padding-left: var(--space-1); }
.bc-need-text { color: var(--color-danger); margin: 0 0 var(--space-1); font-size: .9em; }

/* the source of a value on the data page is a small muted word, not a large coloured label (the passage opens on click) */
details.bc-src > summary.badge-src-doc { background: none; border: none; color: var(--color-muted); font-size: var(--text-xs); padding: 0; }

/* the key-value grid of the inputs tab: the labels keep a fixed share, the values wrap (a long value on the right no longer squeezes the value on the left) */
.bc-kv th { width: 14%; vertical-align: top; }
.bc-kv td { width: 36%; overflow-wrap: anywhere; vertical-align: top; }
.bc-kv td:nth-child(n+3) { white-space: normal; overflow-wrap: anywhere; }

/* the inputs of the plan impact form sit in one row (wrapping on a narrow screen), not one under another */
form.bc-impact-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-2) var(--space-3); margin-bottom: var(--space-2); }
form.bc-impact-form label { display: flex; flex-direction: column; gap: var(--space-1); }

/* AI assessment tables (tab AI Vyhodnocení): every column is left aligned and the cells start at the top, so the text of long findings lines up. */
table.bc-assess { width: 100%; border-collapse: collapse; margin: 6px 0 14px; }
table.bc-assess th, table.bc-assess td { text-align: left; vertical-align: top; padding: 6px 8px; border-bottom: 1px solid var(--line, #e2e2e2); }
table.bc-assess th[scope="col"] { font-weight: 600; white-space: nowrap; }
table.bc-assess th[scope="row"] { white-space: nowrap; font-weight: 600; }
table.bc-assess ul { margin: 0; padding-left: 1.1em; }

/* Odepisovaný majetek: the filter (date, switch of the inactive cards, button) stands at the LEFT edge in ONE row; it wraps only when the window is too narrow. */
.dep-header { margin-bottom: var(--space-3); text-align: left; }
.dep-filter { display: flex; flex-flow: row wrap; align-items: flex-end; justify-content: flex-start; gap: var(--space-2) var(--space-4); margin: 0 0 var(--space-2); }
.dep-filter label { display: flex; flex-direction: column; gap: var(--space-1); margin: 0; }
.dep-filter label.dep-inactive-switch { flex-direction: row; align-items: center; gap: var(--space-2); min-height: var(--hit-min); }
.dep-filter input { width: auto; max-width: none; }
.dep-filter input[type="checkbox"] { display: inline-block; }
.dep-header > p { margin: 0; }

/* AI evaluation and depreciation tables: fixed column widths, wrapping text, numbers on the right, zebra rows, horizontal scroll inside the card on a narrow window. */
.table-scroll { overflow-x: auto; max-width: 100%; }
table.av-table, table.dep-list { table-layout: fixed; width: 100%; border-collapse: collapse; }
table.ranking.av-table th, table.dep-list th { font-weight: var(--weight-bold); text-align: left; border-bottom: 2px solid var(--color-border); vertical-align: bottom; }
/* header cells of the depreciation list wrap inside their own column (the fixed layout gives each column a set width; long Czech words break instead of overlapping the neighbour) */
table.dep-list th { white-space: normal; overflow-wrap: anywhere; word-break: normal; hyphens: auto; }
/* the figure columns (class num) carry nowrap for their values; their header words must wrap too, otherwise "Pořizovací cena / Zůstatková cena k datu" runs over the next column */
table.dep-list th.num { white-space: normal; }
table.ranking.av-table td:nth-child(n), table.dep-list td { vertical-align: top; overflow-wrap: anywhere; white-space: normal; padding-right: var(--space-3); }
table.av-table tbody tr:nth-child(even), table.dep-list tbody tr:nth-child(even) { background: var(--color-surface-alt); }
table.av-table .num, table.dep-list .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.av-candidates .av-c-rank { width: 3rem; }
table.av-candidates .av-c-id { width: 14%; }
table.av-candidates .av-c-category, table.av-candidates .av-c-band { width: 8%; }
table.av-candidates .av-c-value { width: 16%; }
table.av-candidates .av-c-missing { width: 26%; }
table.av-candidates .av-c-owner { width: 10%; padding-right: var(--space-4); }
table.av-candidates .av-c-due { width: 8rem; white-space: nowrap; }
ul.av-reasons { list-style: none; margin: 0; padding: 0; }
ul.av-reasons li { padding-left: 1em; text-indent: -1em; }
ul.av-reasons li::before { content: "- "; }
table.dep-list .dep-c-name { width: 24%; max-width: 22rem; overflow-wrap: anywhere; }
table.dep-list .dep-c-status { width: 11%; }
table.dep-list .dep-c-cost, table.dep-list .dep-c-accumulated { width: 15%; }
table.dep-list .dep-c-booking { width: 18%; }
table.dep-list .dep-c-findings { width: 17%; }
table.dep-list .dep-more { font-size: var(--text-sm); }
table.dep-list .dep-booking-text, table.dep-list .dep-booking-counts { display: block; }
table.dep-list td.num { white-space: normal; overflow-wrap: normal; text-align: right; }
table.dep-list td.num .muted { display: block; }
table.dep-months td.num { white-space: nowrap; }
.badge-sev-blocking { background: var(--color-danger); color: var(--color-danger-contrast); border-color: var(--color-danger); }
.badge-sev-warning { background: var(--color-warning); color: var(--color-warning-contrast); border-color: var(--color-warning); }
.badge-sev-ok { background: var(--color-success); color: var(--color-success-contrast); border-color: var(--color-success); }
.badge-sev-info { background: var(--color-surface-alt); color: var(--color-muted); }
table.dep-list tr[data-severity="blocking"] { box-shadow: inset 4px 0 0 var(--color-danger); }
table.dep-list tr[data-severity="warning"] { box-shadow: inset 4px 0 0 var(--color-warning); }
table.dep-list tr[data-severity="ok"] { box-shadow: inset 4px 0 0 var(--color-success); }
table.dep-list tr[data-severity="info"] { box-shadow: inset 4px 0 0 var(--color-muted); }

/* Criteria table of the AI evaluation: wraps inside the card, no fixed minimum width. */
table.av-criteria { table-layout: auto; }
table.av-criteria td, table.av-criteria th { overflow-wrap: anywhere; }

/* Lease card: action bar above, two columns (left form, right contract terms and inputs of the AI vyhodnoceni). */
.ls-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: flex-end; margin-bottom: var(--space-3); }
.ls-actions > h3 { flex: 1 0 100%; margin: 0; }
.ls-actions > p { flex: 1 0 100%; margin: 0; }
.ls-actions .ls-action { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: flex-end; margin: 0; }
.ls-card-layout { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 30rem), 1fr)); gap: var(--space-3); align-items: start; }
.ls-card-layout > .ls-manual { margin-bottom: var(--space-3); }
.ls-mn-row { margin: 0 0 var(--space-2); }
.ls-mn-stored { display: block; }
