/* Design system (docs/ui.md#system-wyglądu, D-101). Scale tokens are the same in both themes; colour roles follow below.
   Spacing: a 4 px grid. Type: game text 16 (option 18), UI 14, list 14, metadata 13, small 12, h1 24, section 20, dialog/card title 18,
   mono 13. Radii: 4 controls and chips, 6 inner boxes and fields of the editor, 8 cards, dialogs and menus. */
:root {
    --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px; --sp-7: 48px;
    --font-ui: "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: "Cascadia Mono", Consolas, monospace;
    --fs-xs: 12px; --fs-meta: 13px; --fs-sm: 14px; --fs-list: 14px; --fs-md: 16px; --fs-game: 16px;
    --fs-lg: 18px; --fs-xl: 20px; --fs-2xl: 24px; --fs-display: 32px; --fs-mono: 13px;
    --lh-tight: 1.25; --lh-ui: 1.43; --lh-text: 1.55;
    --r-xs: 2px; --r-sm: 4px; --r-md: 6px; --r-lg: 8px; --r-full: 999px;
    --focus-width: 2px; --focus-offset: 2px;
    --shadow-popover: 0 4px 12px rgb(0 0 0 / .35); --shadow-dialog: 0 12px 32px rgb(0 0 0 / .5);
    --target-min: 24px; --target-touch: 44px;
    --btn-h: 36px; --btn-h-dense: 32px; --btn-h-touch: 44px;
    /* Page widths (docs/ui.md#szerokości-stron): the page sets the limit, never a card. */
    --w-list: 1600px; --w-detail: 1440px; --w-form: 960px; --w-dash: 1600px; --w-measure: 72ch;
}
html[data-theme=light] { --shadow-popover: 0 4px 12px rgb(25 34 46 / .14); --shadow-dialog: 0 12px 32px rgb(25 34 46 / .2); }

/* Colour tokens (docs/ui.md#zasady "Bez ozdobników", BL-18/BL-29): neutral graphite and light surfaces, copper for the main action (D-398),
   green only for approval and success. Dark is the default; html[data-theme=light] switches to the light theme. MudBlazor components
   take the same colours from Client/Theme.cs. Text pairs keep at least 4.5:1, borders of fields 3:1 (BL-20). */
:root {
    color-scheme: dark;
    --c-accent: #E6A16A;
    --c-accent-fg: #F2C7A4;
    --c-accent-soft: #3D2E24;
    --c-attr-value: #A6E3B8;
    --c-bg: #171A1E;
    --c-chip: #2B333D;
    --c-code: #D2DCE8;
    --c-diff-del-bg: #FFB4A8;
    --c-diff-del-fg: #3D0B05;
    --c-diff-del-line: #B4473A;
    --c-diff-ins-bg: #98DDB0;
    --c-diff-ins-fg: #0A3319;
    --c-disabled-bg: #1C2025;
    --c-err: #EE7462;
    --c-err-bg: #4A2622;
    --c-err-fg: #FFD2CB;
    --c-err-line: #7A3B33;
    --c-err-tint: rgba(238,116,98,.25);
    --c-err-tint-soft: rgba(238,116,98,.18);
    --c-err-tint-strong: rgba(238,116,98,.35);
    --c-escape-bg: #3A2E1E;
    --c-escape-fg: #F0C987;
    --c-faint: #98A6B7;
    --c-game-bg: #241E16;
    --c-game-fg: #E9DFC9;
    --c-game-line: #4A3F2E;
    --c-heading: #EDF1F5;
    --c-hover: #2A323D;
    --c-info: #6FAEE6;
    --c-info-bg: #1B232B;
    --c-info-line: #3C5670;
    --c-info-tint: rgba(111,174,230,.14);
    --c-key-line: #2F2716;
    --c-line: #343E4B;
    --c-line-2: #465365;
    --c-line-input: #77889F;
    --c-line-soft: #2D3642;
    --c-link: #94C8F0;
    --c-muted: #ACBACB;
    --c-neutral: #B9C4D0;
    --c-ok: #5DBB7E;
    --c-ok-fg: #C3EFD3;
    --c-ok-line: #3E6B4D;
    --c-ok-tint: rgba(93,187,126,.18);
    --c-panel: #1C2025;
    --c-ph-bg: #1E3346;
    --c-ph-fg: #8FCBF5;
    --c-selected: #3A3029;
    --c-sunken: #121519;
    --c-surface: #22272E;
    --c-tag: #303A46;
    --c-tag-bg: #2E2540;
    --c-tag-fg: #CDB6FF;
    --c-text: #EDF1F5;
    --c-text-2: #B9C4D0;
    --c-text-3: #D9E1EB;
    --c-track: #3C4858;
    --c-translation: #B9D9C2;
    --c-vt-fg: #CDBB97;
    --c-vt-line: #6A5C44;
    --c-warn: #E2B04F;
    --c-warn-line: #6B5526;
    --c-ws-bg: #241C16;
    --c-ws-fg: #F7A094;
    --c-ws-line: #6B4430;
    --c-ws-title: #F0A07A;
    --c-surface-2: #2B333D;
    --c-focus: #E6A16A;
    --c-disabled-fg: #98A6B7;
    --c-disabled-line: #465365;
    --c-switch-track: #77889F;
}
html[data-theme=light] {
    color-scheme: light;
    --c-accent: #8D4C1D;
    --c-accent-fg: #83451A;
    --c-accent-soft: #F8EBDD;
    --c-attr-value: #2F6B3F;
    --c-bg: #F6F7F9;
    --c-chip: #EDF1F5;
    --c-code: #334458;
    --c-diff-del-bg: #9E1C14;
    --c-diff-del-fg: #FFFFFF;
    --c-diff-del-line: #E8877B;
    --c-diff-ins-bg: #17603A;
    --c-diff-ins-fg: #FFFFFF;
    --c-disabled-bg: #F1F3F6;
    --c-err: #B3261E;
    --c-err-bg: #FBE3E0;
    --c-err-fg: #8C1D18;
    --c-err-line: #E2A49C;
    --c-err-tint: rgba(179,38,30,.14);
    --c-err-tint-soft: rgba(179,38,30,.10);
    --c-err-tint-strong: rgba(179,38,30,.22);
    --c-escape-bg: #FBEFD8;
    --c-escape-fg: #7A4F00;
    --c-faint: #5C6C81;
    --c-game-bg: #FBF4E6;
    --c-game-fg: #2B231B;
    --c-game-line: #CDBE9F;
    --c-heading: #202A37;
    --c-hover: #F0F4F8;
    --c-info: #2A65A0;
    --c-info-bg: #EAF1F8;
    --c-info-line: #A9C3DD;
    --c-info-tint: rgba(42,101,160,.12);
    --c-key-line: #FBF1D6;
    --c-line: #DCE3EB;
    --c-line-2: #C8D2DE;
    --c-line-input: #7A8A9E;
    --c-line-soft: #E5EAF0;
    --c-link: #245E92;
    --c-muted: #596B80;
    --c-neutral: #596B80;
    --c-ok: #2A7349;
    --c-ok-fg: #1E5A35;
    --c-ok-line: #9CC7A8;
    --c-ok-tint: rgba(46,125,79,.14);
    --c-panel: #EDF0F4;
    --c-ph-bg: #E3EEF8;
    --c-ph-fg: #1D5C8E;
    --c-selected: #F5E9DD;
    --c-sunken: #FFFFFF;
    --c-surface: #FFFFFF;
    --c-tag: #E7EDF4;
    --c-tag-bg: #EEE6FB;
    --c-tag-fg: #5B3A9E;
    --c-text: #202A37;
    --c-text-2: #4D5D70;
    --c-text-3: #37485B;
    --c-track: #D9E1EB;
    --c-translation: #2F5D46;
    --c-vt-fg: #6B5530;
    --c-vt-line: #B8A27A;
    --c-warn: #8A5B00;
    --c-warn-line: #E2C98C;
    --c-ws-bg: #FCEFE8;
    --c-ws-fg: #B3261E;
    --c-ws-line: #E5B59C;
    --c-ws-title: #A03A12;
    --c-surface-2: #FFFFFF;
    --c-focus: #8D4C1D;
    --c-disabled-fg: #5C6C81;
    --c-disabled-line: #C8D2DE;
    --c-switch-track: #7A8A9E;
}

/* Global layout and shared styles. Component colors come from the MudBlazor theme (Theme.cs). */
html { scroll-padding-block-start: 64px; }
:target { scroll-margin-block-start: 64px; }
html:has(.save-bar.dirty) { scroll-padding-block-end: 12rem; }
body:has(.save-bar.dirty) :is(input, textarea, button, select, a[href], [tabindex]) { scroll-margin-block-end: 12rem; }
html, body { background: var(--c-bg); color: var(--c-text); margin: 0; }

#blazor-error-ui { display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 2000;
    padding: var(--sp-2) var(--sp-4); background: #5c1f1a; color: #fff; }
#blazor-error-ui .reload { color: #fff; margin-left: var(--sp-4); }

/* ---------- App shell (docs/ui.md#układ-aplikacji) ---------- */
.app-bar { border-bottom: 1px solid var(--c-line); }
.app-bar .mud-toolbar { gap: var(--sp-2); flex-wrap: nowrap; min-width: 0; }
.brand { display: flex; align-items: center; gap: var(--sp-2); color: inherit; text-decoration: none; margin: 0 var(--sp-2) 0 var(--sp-1); flex: none; } /* with the bar's 8 px: 16 px to the search (D-843) */
.skip-link { position: absolute; left: .5rem; top: -3rem; z-index: 1400; background: var(--c-surface); color: var(--c-text); border: 2px solid var(--c-accent);
    border-radius: var(--r-md); padding: var(--sp-2) var(--sp-3); text-decoration: none; }
.skip-link:focus { top: .5rem; }
#main-content:focus { outline: none; }

/* Scope selector */
.scope-picker { flex: 0 0.2 auto; min-width: 120px; max-width: 320px; display: flex; }
.scope-button { max-width: 100%; min-width: 0; overflow: hidden; height: 34px; border-color: var(--c-line-input) !important; color: var(--c-text) !important; }
.scope-button .mud-button-label { min-width: 0; overflow: hidden; }
.scope-button .mud-button-icon-start, .scope-button .mud-button-icon-end { flex: none; }
.scope-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
/* docs/ui.md#nagłówek: a version other than the working one is marked in the button, the context bar and the panel (the label shortens first). */
.scope-other { flex: none; margin-inline-start: var(--sp-2); }
.work-context .scope-other { margin-inline-start: 0; }
.scope-other-row, .arg-row, .language-form, .change-head, .candidates-row, .proposal-group-header, .proposal-keys li, .context-note-actions, .media-links li, .list-toolbar-row, .realization-head, .managed-invitations li, .discord-head, .page-head-actions { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-2); }
.scope-overlay { background: transparent !important; }
.scope-panel { padding: var(--sp-4) var(--sp-4) var(--sp-2); width: 320px; max-width: calc(100vw - 2rem); display: grid; gap: var(--sp-3); }
.scope-panel-title, .scope-inline-title { font-weight: 600; font-size: var(--fs-sm); }
.scope-panel-actions { display: flex; justify-content: flex-end; }
.scope-inline { display: grid; gap: var(--sp-2); padding: var(--sp-4) var(--sp-4) var(--sp-3); border-bottom: 1px solid var(--c-line); }
.scope-inline-title { color: var(--c-text-2); font-size: var(--fs-xs); }

/* Queue and account */
.queue-button { flex: none; white-space: nowrap; }
.queue-button .mud-button-label { gap: var(--sp-1); }
.queue-count { font-weight: 700; font-variant-numeric: tabular-nums; }
.account-button { flex: none; min-width: 0; }
.account-button .person-avatar { margin-right: var(--sp-2); }
.account-name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Left navigation: icons with labels (240 px) or icons only (56 px, labels in tooltips) */
/* Never a horizontal scrollbar in either mode (BL-59): the drawer and its content clip sideways; only the item list scrolls vertically. */
.app-nav.mud-drawer, .app-nav .mud-drawer-content { overflow-x: hidden; }
.app-nav .mud-drawer-content { display: flex; flex-direction: column; height: 100%; overflow-y: hidden; }
.nav-interaction, .nav-focus { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; }
.nav-scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; }
.nav-footer { border-top: 1px solid var(--c-line); padding: var(--sp-1) 0; }
.nav-tip { display: block; width: 100%; }
.nav-mode-toggle { justify-content: flex-start !important; padding-left: var(--sp-4) !important; color: var(--c-text-2) !important; white-space: nowrap; min-width: 0 !important; overflow: hidden; }
.layout-icons .nav-mode-label, .layout-icons .app-nav .mud-nav-link-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
.layout-icons .nav-group-collapsed { padding: 0; margin: var(--sp-2) var(--sp-4); border-top: 1px solid var(--c-track); }
.layout-icons .app-nav .mud-nav-link { white-space: nowrap; }

/* Phone: one column, compact header, navigation as a temporary panel (docs/ui.md#telefon-i-wąskie-ekrany) */
.layout-phone .mud-main-content { margin-inline: 0; }
.layout-phone .app-bar .mud-toolbar { padding: 0 var(--sp-1); gap: 2px; }
.layout-phone .brand { margin: 0 auto 0 0; min-width: var(--target-touch); min-height: var(--target-touch); justify-content: center; }
.layout-phone .brand-text, .layout-phone .queue-label, .layout-phone .account-name {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.layout-phone .global-search { display: none; }
.layout-phone .search-open .global-search { display: flex; position: absolute; inset: var(--sp-2) var(--sp-2); width: auto; z-index: 2; background: var(--c-surface); }
.layout-phone .queue-button { padding: 0 var(--sp-2); min-width: 0; }
.layout-phone .account-button { padding: 0 var(--sp-1); min-width: var(--target-touch); }
.layout-phone .account-button .person-avatar { margin-right: 0; }
.layout-phone .account-button .mud-button-icon-end { display: none; }
.layout-phone .page { padding: var(--sp-3); }
.layout-phone .menu-button { margin-left: 0; margin-right: 0; }
@media (max-width: 359.98px) { .layout-phone .app-bar .brand { display: none; } }
@media (max-width: 1199.98px) { .brand-subtitle { display: none; } .account-name { max-width: 110px; } }
/* F-241 (F-003): up to 1440 px the header gives the search room for its placeholder and a typed word: the brand without its subtitle, the account
   as its avatar (the name stays in its label) and the queue as its icon and count (the label stays in its title). The results are never narrower
   than a readable row. */
@media (max-width: 1439.98px) {
    .brand-subtitle { display: none; }
    .account-name, .queue-label { display: none; }
    .global-search { min-width: 220px; }
}
.search-results { min-width: min(680px, calc(100vw - 2 * var(--sp-4))); }
.brand-title { display: block; font-weight: 600; font-size: var(--fs-md); line-height: 1.15; }
.brand-subtitle { display: block; font-size: var(--fs-xs); color: var(--c-text-2); line-height: 1.1; }
.brand-large .brand-title { font-size: var(--fs-xl); }

/* Page widths (docs/ui.md#szerokości-stron, U-J): the page type sets the limit, cards never do. Lists, tables, the dashboard and the
   work screen fill the width; forms and long reading keep a readable measure; object pages stop at 1920 px. */
/* The page is the container of layouts that depend on the space beside the navigation, not on the window: with labels in the navigation (240 px)
   a window of 1100 px leaves the page as much room as an 860 px window with icons (D-522). */
.page { padding: var(--sp-5); container: page / inline-size; }
.page:has(> .page--detail) { max-width: calc(1920px + 2 * var(--sp-5)); margin-inline: auto; }
.page:has(> .page--form) { max-width: calc(var(--w-form) + 2 * var(--sp-5)); margin-inline: auto; }
.page:has(> .page--form-nav) { max-width: calc(var(--w-form) + 240px + 3 * var(--sp-5)); margin-inline: auto; }
.form-measure { max-width: var(--w-form); }
.page-title { font-size: var(--fs-2xl); line-height: 1.33; font-weight: 600; margin: 0 0 var(--sp-3); }

.public-page { min-height: 100vh; display: grid; place-items: center; padding: var(--sp-4); }
.auth-card { width: 100%; max-width: 400px; background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-lg); padding: var(--sp-6); }
.auth-heading { font-size: var(--fs-lg); font-weight: 600; margin: var(--sp-5) 0 var(--sp-4); }
.auth-note { color: var(--c-text-2); font-size: var(--fs-meta); margin: var(--sp-4) 0 0; }
/* Phase 16B: links under the login form, the QR code and recovery codes of the 2FA setup (docs/ui.md#konto-i-dostęp). */
.auth-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--sp-2) var(--sp-4); margin-top: var(--sp-4); font-size: var(--fs-meta); }
.auth-card-wide { max-width: 560px; }
/* HELP 4b (D-921): links of the guest pages look like links (the link colour, underlined on hover and focus); "Nie pamiętam hasła" under the password;
   one footer with the secondary links on the left and the interface language on the right. */
.auth-card a:not(.mud-button-root) { color: var(--c-link); text-decoration: none; text-underline-offset: 2px; }
.auth-card a:not(.mud-button-root):hover, .auth-card a:not(.mud-button-root):focus-visible { text-decoration: underline; }
/* D-932: the optional address of Discord under its button, then a line with "or" before the form of the address and the password. */
.login-discord-email { margin-top: var(--sp-2); }
.login-discord-email .mud-checkbox .mud-typography { font-size: var(--fs-meta); }
.login-discord-hint { color: var(--c-text-2); font-size: var(--fs-meta); margin: 0 0 0 var(--sp-6); }
.auth-or { display: flex; align-items: center; gap: var(--sp-3); margin: var(--sp-5) 0; color: var(--c-text-2); font-size: var(--fs-meta); }
.auth-or::before, .auth-or::after { content: ""; flex: 1; border-top: 1px solid var(--c-line); }
.auth-field-link { display: flex; justify-content: flex-end; margin-top: var(--sp-1); font-size: var(--fs-meta); }
.auth-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-3) var(--sp-4); margin-top: var(--sp-5);
    padding-top: var(--sp-4); border-top: 1px solid var(--c-line); font-size: var(--fs-meta); }
.auth-footer-links { display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-2); flex: 1 1 160px; }
.auth-footer > .mud-select { flex: 0 0 140px; }
/* D-565: the sign-in window over the page whose session expired; the page under it keeps its state and is inert. */
.session-expired-backdrop { position: fixed; inset: 0; z-index: 1500; display: grid; place-items: center; padding: var(--sp-4); background: var(--mud-palette-overlay-dark); }
.session-expired { box-shadow: var(--shadow-dialog); max-height: calc(100vh - 2 * var(--sp-4)); overflow-y: auto; }
.session-expired .auth-heading { margin-top: 0; }
/* F-243: after "Zaloguj się jako inna osoba" the question about unsaved changes (a dialog, 1400) opens over the window. */
.session-expired-backdrop.leaving { z-index: 1350; }
.totp-qr { display: block; width: 200px; height: 200px; image-rendering: pixelated; background: #fff; padding: var(--sp-2); border-radius: var(--r-sm); margin: var(--sp-2) 0; }
.totp-key { font-family: var(--font-mono, monospace); font-size: var(--fs-body); letter-spacing: 0.05em; word-break: break-all; user-select: all; }
.recovery-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-1) var(--sp-4); padding: 0; margin: var(--sp-3) 0; list-style: none; font-family: var(--font-mono, monospace); }
.smtp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--sp-3) var(--sp-4); }

h1:focus, h1:focus-visible { outline: none; } /* focused programmatically after navigation for screen readers */

/* Page structure */
.section-title { font-size: var(--fs-lg); font-weight: 600; margin: var(--sp-5) 0 var(--sp-2); color: var(--c-heading); }
.muted { color: var(--c-muted); }
.help { margin: calc(var(--sp-2) * -1) 0 0; font-size: var(--fs-sm); }
.panel { background: var(--c-surface); border: 1px solid var(--c-line-2); border-radius: var(--r-lg); padding: var(--sp-4); min-width: 0; }
@media (min-width: 1440px) { .panel { padding: var(--sp-5); } }
.empty-state { display: grid; justify-items: center; gap: var(--sp-2); background: var(--c-surface); border: 1px dashed var(--c-line-2); border-radius: var(--r-lg); padding: var(--sp-6) var(--sp-5); text-align: center; color: var(--c-text-2); }
.empty-state > .mud-icon-root { font-size: 32px; color: var(--c-faint); }
.empty-state-title { margin: 0; font-size: var(--fs-md); font-weight: 600; color: var(--c-text); }
.empty-state-text { margin: 0; max-width: var(--w-measure); }
.empty-state-action { margin-top: var(--sp-2); }
/* docs/ui.md#adresy-i-błąd-ekranu: an exception in a page, inside the content area. */
.error-state { max-width: 640px; margin: var(--sp-7) auto; padding: var(--sp-6); text-align: center; background: var(--c-surface); border: 1px solid var(--c-line-2); border-radius: var(--r-lg); }
.error-state .action-row { justify-content: center; }

/* Tables */
.data-table { background: var(--c-surface) !important; border: 1px solid var(--c-line-2); border-radius: var(--r-lg); }
/* A table that scrolls sideways contains its absolutely placed parts (the hidden name of the actions column), so they never widen the page (D-522). */
.mud-table-container { position: relative; }
.data-table .clickable { cursor: pointer; }
.row-link, .term-english { color: var(--c-link); text-decoration: none; font-weight: 600; }
.row-link:hover { text-decoration: underline; }
.group-header { background: var(--c-panel); color: var(--c-text-2); font-size: var(--fs-meta); text-transform: uppercase; letter-spacing: .04em; }
.text-cell { white-space: pre-wrap; word-break: break-word; max-width: 38ch; font-size: var(--fs-sm); }
.data-table code { color: var(--c-code); background: transparent; font-size: var(--fs-sm); }
/* A plain <table class="data-table"> (not MudTable) has the cells of the tables: 12 px padding, row lines, the head in the meta size (docs/ui.md#wiersz-tabeli, D-513).
   :where keeps it below the own rules of a table (.effects-table, .rule-matrix). */
:where(table.data-table) { border-collapse: separate; border-spacing: 0; }
:where(table.data-table) > :where(thead, tbody) > tr > :where(th, td) { padding: var(--sp-3) var(--sp-4); text-align: left; vertical-align: top; border-bottom: 1px solid var(--c-line); }
:where(table.data-table) > tbody > tr:last-child > :where(th, td) { border-bottom: 0; }
:where(table.data-table) > thead > tr > th, .data-table .mud-table-head th.mud-table-cell { font-size: var(--fs-meta); font-weight: 600; color: var(--c-text-2); }
.move-select { max-width: 360px; display: inline-flex; vertical-align: middle; }
.error-details { margin: var(--sp-1) 0 0 var(--sp-4); }
/* Files the game skips (D-516): one line under a version or an observation, the problem in the warning colour beside each path. */
.unreadable-files:not(.mud-alert), .text-compare { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-1) var(--sp-3); margin-top: var(--sp-1); color: var(--c-text-2); }
.unreadable-files-title { color: var(--c-warn); }
.unreadable-file code { overflow-wrap: anywhere; }
/* D-870: the return address of Discord is copied whole; on a phone it breaks anywhere instead of widening the page. */
.discord-login-redirect { overflow-wrap: anywhere; user-select: all; }
/* D-525: the line before and the line of the problem, as code; the problem line is marked, the numbers are not copied with the text. */
.unreadable-excerpt { margin: var(--sp-1) 0; padding: var(--sp-1) var(--sp-2); font-family: var(--font-mono); font-size: var(--fs-mono); white-space: pre; overflow-x: auto;
  background: var(--c-hover); border-radius: var(--r-sm); color: var(--c-text); }
.unreadable-excerpt-line { display: block; }
.unreadable-excerpt-problem { box-shadow: inset 3px 0 0 var(--c-err); }
.unreadable-excerpt-number { display: inline-block; min-width: 3ch; margin-right: var(--sp-2); text-align: right; color: var(--c-faint); user-select: none; }
.unreadable-next { margin: var(--sp-2) 0 0; }

/* Import summary */
.count-row { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); margin: var(--sp-3) 0 var(--sp-4); }
.count { color: var(--c-text-2); }
.count strong { color: var(--c-text); }
.change { font-size: var(--fs-meta); font-weight: 600; }
.change-new, .count-new strong { color: var(--c-ok); }
.change-changed, .count-changed strong { color: var(--c-warn); }
.change-returned, .count-returned strong { color: var(--c-info); }
.change-removed, .count-removed strong { color: var(--c-err); }

/* ---------- Translation workspace (docs/ui.md#ekran-tłumaczenia) ---------- */
.page:has(.workspace) { max-width: none; padding: 0; }
/* The work screen (D-103): the scope bar (U-H) over the list, the editor and the help column; the help column only with "with-help". */
.work-screen { --ctx-h: 37px; display: flex; flex-direction: column; height: calc(100vh - 48px); }
.workspace { display: grid; grid-template-columns: 340px minmax(0, 1fr); flex: 1 1 auto; min-height: 0; }
.workspace.with-help { grid-template-columns: 340px minmax(0, 1fr) 360px; }
.string-list { display: flex; flex-direction: column; border-right: 1px solid var(--c-line); background: var(--c-panel); min-height: 0; }
.workspace.list-hidden { grid-template-columns: minmax(0, 1fr); }
.workspace.list-hidden.with-help { grid-template-columns: minmax(0, 1fr) 360px; }
.workspace.list-hidden .string-list { display: none; }
.work-context { display: flex; align-items: center; gap: var(--sp-2); height: var(--ctx-h); box-sizing: border-box; padding: 0 var(--sp-4); flex: none; min-width: 0;
  border-bottom: 1px solid var(--c-line); background: var(--c-panel); font-size: var(--fs-sm); color: var(--c-text-2); }
.work-context-icon { color: var(--c-faint); flex: none; }
.work-context-label { flex: none; }
.work-context-value { color: var(--c-text); font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.work-context-change.mud-button-root { flex: none; min-height: 28px; }
.list-filters { padding: var(--sp-3) var(--sp-3) var(--sp-1); display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-2); }
/* Filter bar (BL-07): menus with tri-state items, active filters as removable chips. */
.sort-menu { margin-left: auto; }
.filter-chips, .group-actions, .context-media-nav, .queue-categories, .chip-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1); }
.filter-chip { display: inline-flex; align-items: center; gap: var(--sp-1); min-width: 0; max-width: 100%; font-size: var(--fs-xs); padding: 0 2px 0 var(--sp-2); border: 1px solid var(--c-line-2); border-radius: var(--r-sm); background: var(--c-hover); }
.filter-chip > span:nth-child(2) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filter-chip.include { border-color: var(--c-ok-line); }
.filter-chip.exclude { border-color: var(--c-err-line); }
.filter-chip.exclude > span:nth-child(2) { text-decoration: line-through; }
.chip-remove { background: none; border: 0; color: var(--c-text-2); cursor: pointer; font-size: var(--fs-md); line-height: 1; padding: 2px var(--sp-1); min-width: 24px; min-height: 24px; }
.chip-remove:hover { color: var(--c-text); }
.list-empty { padding: var(--sp-3) var(--sp-4); }
.list-empty p { margin: 0 0 var(--sp-2); }
/* "Pokazano N z M" over a list: secondary, apart from the toolbar above and the list below (U3-17). */
.list-status { margin: var(--sp-2) 0 var(--sp-3); font-size: var(--fs-meta); color: var(--c-text-2); }
.list-count { padding: 0 var(--sp-4) var(--sp-1); display: flex; align-items: center; justify-content: space-between; min-height: 1.9rem; }
.string-items { position: relative; list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.string-item { display: flex; gap: var(--sp-2); padding: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--c-line-soft); cursor: pointer; }
.string-item:hover { background: var(--c-hover); }
.string-item.selected { background: var(--c-selected); box-shadow: inset 3px 0 0 var(--c-accent); }
.item-body { min-width: 0; flex: 1; }
.item-key, .search-key { font-family: var(--font-mono); font-size: var(--fs-mono); color: var(--c-text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* "projekt · wersja" of a row in the scope "all projects" (docs/ui.md#lista-ciągów); a button narrows the scope. */
.key-domain { text-decoration: underline dotted; cursor: help; }
.item-source, .item-translation { font-size: var(--fs-list); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-translation { color: var(--c-translation); }
.item-flags, .memory-side { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.draft-mark { color: var(--c-warn); font-size: var(--fs-sm); line-height: 1; }
.string-item:focus-visible { outline-offset: -2px; }
.pager { display: flex; align-items: center; justify-content: center; gap: var(--sp-2); border-top: 1px solid var(--c-line); }
/* The editor takes all the width between the list and the help column (no max width, D-094). */
/* Each pane scrolls itself and is the containing block of what is absolutely positioned in it (visually hidden text, dots), so nothing escapes
   its clipping and makes the page taller than the window: the page itself never scrolls under the work screen. */
.editor-column { position: relative; overflow-y: auto; padding: var(--sp-4) var(--sp-5) var(--sp-6); min-width: 0; }
.help-column { position: relative; overflow-y: auto; border-left: 1px solid var(--c-line); padding: var(--sp-3); background: var(--c-panel); }
.help-column-head { display: flex; justify-content: flex-end; margin: calc(-1 * var(--sp-1)) 0 var(--sp-1); }
/* Help on demand (D-103): a side panel over the editor, not modal; full screen on the phone (above its bottom bar). */
.help-drawer { position: fixed; top: 48px; right: 0; bottom: 0; width: min(400px, 100vw); z-index: 1100; display: flex; flex-direction: column;
  background: var(--c-panel); border-left: 1px solid var(--c-line-2); box-shadow: var(--shadow-dialog); }
.help-drawer-head { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-2) var(--sp-2) var(--sp-2) var(--sp-4); border-bottom: 1px solid var(--c-line); }
.help-drawer-head h2 { flex: 1; margin: 0; font-size: var(--fs-md); font-weight: 600; }
.help-drawer-head h2:focus { outline: none; }
.help-drawer-head h2:focus-visible { outline: var(--focus-width) solid var(--c-focus); outline-offset: var(--focus-offset); }
.help-pin-note { margin: var(--sp-2) var(--sp-4) 0; }
.help-drawer-body { flex: 1; overflow-y: auto; padding: var(--sp-3); }
.help-empty { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-2); padding: var(--sp-2) var(--sp-3); font-size: var(--fs-sm); color: var(--c-text-2);
  background: var(--c-surface); border: 1px solid var(--c-line-2); border-radius: var(--r-lg); }
.help-empty > .mud-icon-root { color: var(--c-faint); }
.help-empty .help-add-context { margin-left: auto; }
/* No string open (D-103): the keys of the list and one next step, no large empty box. */
.editor-empty { display: grid; gap: var(--sp-4); justify-items: start; max-width: 560px; padding: var(--sp-5) 0; }
.editor-empty-title, .filter-panel-head h2, .side-panel-title { margin: 0; font-size: var(--fs-lg); font-weight: 600; }
.key-hints { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-2); font-size: var(--fs-sm); color: var(--c-text-2); }
.key-hints li > span:first-child { display: inline-block; min-width: 9rem; color: var(--c-text); }
.key-hints kbd { font-family: var(--font-mono); font-size: var(--fs-xs); border: 1px solid var(--c-line-input); border-radius: var(--r-sm); padding: 0 var(--sp-1); background: var(--c-surface); }

/* Status: colour plus shape (approved = filled, translated = ring, untranslated = dashed circle, never a square that reads as a check box, D-102). */
.status-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; margin-top: var(--sp-1); display: inline-block; }
.status-dot.status-untranslated { border: 2px dashed var(--c-faint); }
.status-dot.status-translated { border: 3px solid var(--c-warn); }
.status-dot.status-approved { background: var(--c-ok); }
.status-dot.needs-review { box-shadow: 0 0 0 2px var(--c-panel), 0 0 0 4px var(--c-info); }
.status { display: inline-flex; align-items: center; gap: var(--sp-1); padding: 2px var(--sp-2); border-radius: var(--r-full); border: 1px solid var(--c-line-2); font-size: var(--fs-meta); margin-right: var(--sp-2); }
.status .status-dot { margin-top: 0; }
.status-untranslated .status-dot { border: 2px dashed var(--c-faint); }
.status-translated .status-dot { border: 3px solid var(--c-warn); }
.status-approved .status-dot { background: var(--c-ok); }
.status-review .status-dot { background: var(--c-info); border-radius: var(--r-xs); transform: rotate(45deg); }
/* "w pełni sprawdzone" (U9): ✓✓ next to the approved status, the review counter "X/Y" as text. */
.status-full { color: var(--c-ok); border-color: var(--c-ok-line); }
.status-dot.status-full { background: var(--c-ok-fg); border: 2px solid var(--c-ok); }
.full-mark { color: var(--c-ok); font-size: var(--fs-xs); font-weight: 700; letter-spacing: -.1em; }
.review-counter { color: var(--c-text-2); }

/* Editor (docs/ui.md#ekran-tłumaczenia) */
.editor { min-width: 0; }
.editor-skeleton { display: grid; gap: var(--sp-2); }
/* String header (docs/ui.md#nagłówek-ciągu, D-103): row 1 key and navigation, "Szczegóły" with the path and tags, row 2 (sticky) status and actions.
   The wrapper does not box its rows, so the sticky row 2 sticks for the whole editor, not only while the header is in view. */
.string-head { display: contents; }
.head-row1 { display: flex; flex-wrap: nowrap; align-items: center; gap: var(--sp-1) var(--sp-2); min-width: 0; color: var(--c-text-2); font-size: var(--fs-sm); }
.string-details { display: grid; gap: var(--sp-2); margin: var(--sp-2) 0 0; padding: var(--sp-3); background: var(--c-surface); border: 1px solid var(--c-line-2);
  border-radius: var(--r-lg); font-size: var(--fs-sm); }
.details-list { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--sp-1) var(--sp-3); margin: 0; }
.details-list dt { color: var(--c-text-2); }
.details-list dd { margin: 0; overflow-wrap: anywhere; }
.details-list code { font-family: var(--font-mono); font-size: var(--fs-mono); }
.crumbs { min-width: 0; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; margin: 0; padding: 0; min-width: 0; }
.crumbs li { overflow-wrap: anywhere; }
.crumbs li + li::before { content: "›"; margin: 0 var(--sp-2); color: var(--c-faint); }
.crumbs a { color: var(--c-link); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs code { color: var(--c-text-3); font-size: var(--fs-meta); }
.editor-nav { display: flex; align-items: center; gap: 3px; flex: none; margin-left: auto; }
.details-toggle.mud-button-root, .help-toggle.mud-button-root { min-height: 28px; white-space: nowrap; }
.id-chip { background: none; border: 1px solid var(--c-line-2); border-radius: var(--r-sm); color: var(--c-text-2); font-family: var(--font-mono); font-size: var(--fs-mono); padding: 1px var(--sp-2); cursor: pointer; }
.id-chip:hover { border-color: var(--c-accent); color: var(--c-text); }
.position { font-variant-numeric: tabular-nums; margin: 0 var(--sp-1); }
.back-to-list { display: none !important; }
.string-key { font-family: var(--font-mono); font-size: var(--fs-md); font-weight: 600; color: var(--c-text); margin: 0; display: flex; align-items: center; gap: var(--sp-1);
  min-width: 0; flex: 0 1 auto; }
.string-key > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.head-row2 { position: sticky; top: -1rem; z-index: 5; background: var(--c-bg); display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-4);
  padding: var(--sp-2) 0; margin: 0 0 var(--sp-3); border-bottom: 1px solid var(--c-line); }
.status-row { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-1) var(--sp-2); flex: 1 1 18rem; min-width: 0; }
.head-tags, .working-meta, .composed-role { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1); }
.more-tags { font-size: var(--fs-xs); }
.small { font-size: var(--fs-meta); }

/* Action bar: one row at the top of the editor, sticky while scrolling (BL-04); the bottom bar on the phone. */
.action-bar { flex: 0 1 auto; margin-left: auto; min-width: 0; }
/* F-255 (D-793): the step label and its longest variant share one cell; the hidden one keeps the width of the button. */
.action-label-stable { display: inline-grid; }
.action-label-stable > span { grid-area: 1 / 1; }
.action-label-reserve { visibility: hidden; }
.action-buttons { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: nowrap; min-width: 0; }
.action-buttons .action { white-space: nowrap; flex: none; }
/* A disabled action says why right beside it, concisely (D-101, D-103); the full reason is its accessible description. */
.action-item { display: inline-flex; align-items: center; gap: var(--sp-1); flex: none; }
.action-reason { font-size: var(--fs-xs); line-height: 1.3; color: var(--c-text-2); max-width: 13rem; }
.read-only-note { max-width: 22rem; }
.menu-reason { display: block; font-size: var(--fs-xs); color: var(--c-muted); }
.info-bar { display: flex; align-items: center; gap: var(--sp-2); background: var(--c-info-bg); border: 1px solid var(--c-info-line); border-left: 3px solid var(--c-info); border-radius: var(--r-md);
    padding: 2px var(--sp-1) 2px var(--sp-3); margin-bottom: var(--sp-2); font-size: var(--fs-sm); }
.info-bar span { flex: 1; }
@media (min-width: 800px) { .phone-only { display: none !important; } }

.source-box, .translation-box, .conflict-box { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-lg); padding: var(--sp-2) var(--sp-4) var(--sp-3); margin-bottom: var(--sp-3); }
.conflict-box { border-color: var(--c-warn); }
.conflict-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-2); margin: var(--sp-2) 0; }
.conflict-grid pre { white-space: pre-wrap; background: var(--c-sunken); padding: var(--sp-2); border-radius: var(--r-md); margin: 3px 0 0; font-family: inherit; }
.label { font-size: var(--fs-xs); color: var(--c-muted); letter-spacing: .02em; }
.box-title { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: var(--sp-1) var(--sp-2); font-size: var(--fs-sm); color: var(--c-text-3); margin-bottom: var(--sp-1); font-weight: 600; }
.box-actions { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-1) var(--sp-2); font-weight: 400; }
.box-actions .mud-switch { margin: 0; }
.source-notes { display: flex; flex-wrap: wrap; gap: 3px var(--sp-3); background: var(--c-game-bg); border-left: 3px solid var(--c-warn); border-radius: var(--r-sm); padding: var(--sp-1) var(--sp-2); font-size: var(--fs-sm); margin-bottom: var(--sp-2); }
.source-notes code { color: var(--c-escape-fg); margin-left: var(--sp-1); }
.source-text { font-size: var(--fs-md); line-height: 1.55; }
/* U3-22 (D-825), U3-25 (D-833): the change of EN in the EN box, above the text, whole and in the flow of the column (never sticky, never folded). */
.source-changed-diff { margin-bottom: var(--sp-3); padding-bottom: var(--sp-2); border-bottom: 1px dashed var(--c-line-2); }
.source-change-title { margin-bottom: var(--sp-1); }
.source-change-body { font-size: var(--fs-sm); line-height: 1.55; overflow-wrap: anywhere; }
.unsaved { display: inline-flex; align-items: center; gap: var(--sp-1); color: var(--c-warn); font-size: var(--fs-meta); margin-right: auto; }
.unsaved-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c-warn); }
.field-tools { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: var(--sp-1) var(--sp-2); min-height: 31px; }
.field-options { display: flex; align-items: center; flex-wrap: wrap; gap: 0 var(--sp-1); }
.field-options .mud-checkbox { margin: 0; }
.field-split { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-1) var(--sp-3); }
.editor-wide .field-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
/* Beside the field the preview stays in view while a long text is edited: sticky under the sticky action bar of the editor column. */
.editor-wide .field-preview { position: sticky; top: calc(var(--head-h, 4.25rem) - 1rem + 8px); max-height: calc(100vh - 48px - var(--ctx-h, 0px) - var(--head-h, 4.25rem) - 1.5rem);
  overflow-y: auto; }
/* Synced preview (D-095): the segment of the caret has a subtle outline; a click on a segment puts the caret at its place. */
.preview-result [data-from] { cursor: text; }
.cm-host .cm-editor .cm-linked { background: var(--c-accent-soft); box-shadow: 0 1px 0 var(--c-accent); border-radius: var(--r-xs); }
.preview-result .pv-current, .source-text .pv-current { outline: 1px dashed var(--c-accent); outline-offset: 1px; border-radius: var(--r-xs); background: var(--c-accent-soft); }
.field-main.hidden { display: none; }
/* The field grows with its content from about six lines, without an inner scrollbar; the editor column scrolls instead and the
   action bar stays sticky (docs/ui.md#pole-tłumaczenia). The plain field grows by field-sizing or rsc.autoGrow. */
.translation-input { display: block; width: 100%; min-height: calc(6 * 1.55em + 1.2rem + 2px); field-sizing: content; resize: none; overflow: hidden; background: var(--c-sunken); color: var(--c-text);
    border: 1px solid var(--c-line-2); border-radius: var(--r-md); padding: var(--sp-2) var(--sp-3); font: inherit; font-size: var(--fs-md); line-height: 1.55; box-sizing: border-box; }
.translation-input:focus { outline: none; border-color: var(--c-accent); }
/* The CodeMirror field (D-049): the look of the textarea above; tokens and whitespace reuse the HighlightedText classes.
   Three classes deep so the rules win over CodeMirror's own injected base theme. */
.cm-host .cm-editor { background: var(--c-sunken); color: var(--c-text); border: 1px solid var(--c-line-2); border-radius: var(--r-md); font-size: var(--fs-md); }
.cm-host .cm-editor.cm-focused { outline: none; border-color: var(--c-accent); }
/* The six-line minimum is on the content itself, so a click anywhere in the field lands in the text (below a short text: at its end). */
.cm-host .cm-editor { cursor: text; }
.cm-host .cm-editor .cm-scroller { font-family: inherit; line-height: 1.55; overflow: visible; }
.cm-host .cm-editor .cm-content { padding: var(--sp-2) var(--sp-3); caret-color: var(--c-text); min-height: calc(6 * 1.55em + 1.2rem); }
.cm-host .cm-editor .cm-line { padding: 0; }
.cm-host .cm-editor .cm-cursor { border-left-color: var(--c-text); }
.cm-host .cm-editor .cm-placeholder { color: var(--c-muted); }
.translation-input:disabled, .cm-host .cm-editor.cm-disabled { background: var(--c-disabled-bg); color: var(--c-muted); border-style: dashed; cursor: not-allowed; }
.cm-host .cm-editor.cm-disabled .cm-content { cursor: not-allowed; }
.cm-host .cm-editor .tok { font: inherit; padding: 0; border-radius: var(--r-xs); }
.cm-host .cm-editor .tok-attr { color: var(--c-escape-fg); }
.cm-host .cm-editor .tok-attr-value { color: var(--c-attr-value); }
.cm-host .cm-editor .tok-error { background: var(--c-err-tint); color: var(--c-err-fg); }
/* QA marks in the field (D-093): the line style tells the level without colour (error solid, warning dashed, information dotted),
   an unknown word has the usual wave. The tooltip repeats the level in words. */
.cm-host .cm-editor .cm-diag { text-decoration-line: underline; text-underline-offset: 3px; text-decoration-thickness: 2px; text-decoration-skip-ink: none; }
.cm-host .cm-editor .cm-diag-error { text-decoration-style: solid; text-decoration-color: var(--c-err); background: var(--c-err-tint-soft); }
.cm-host .cm-editor .cm-diag-warning { text-decoration-style: dashed; text-decoration-color: var(--c-warn); }
.cm-host .cm-editor .cm-diag-info { text-decoration-style: dotted; text-decoration-color: var(--c-info); }
.cm-host .cm-editor .cm-diag-spelling { text-decoration-style: wavy; text-decoration-color: var(--c-err); text-decoration-thickness: 1.5px; }
.cm-host .cm-editor .cm-tooltip:has(> .rsc-diag-tooltip), .cm-host .cm-editor .cm-tooltip.rsc-diag-tooltip, .cm-tooltip.rsc-complete { background: var(--c-surface); color: var(--c-text); border: 1px solid var(--c-line-2); border-radius: var(--r-md); box-shadow: var(--shadow-popover); }
.rsc-diag-tooltip { max-width: min(28rem, 90vw); padding: var(--sp-2) var(--sp-2); font-size: var(--fs-sm); display: grid; gap: var(--sp-2); }
.rsc-diag-item { border-left: 3px solid var(--c-info); padding-left: var(--sp-2); }
.rsc-diag-item.rsc-diag-error { border-left-color: var(--c-err); }
.rsc-diag-item.rsc-diag-warning { border-left-color: var(--c-warn); border-left-style: dashed; }
.rsc-diag-item.rsc-diag-info { border-left-style: dotted; }
.rsc-diag-actions { display: flex; flex-wrap: wrap; gap: var(--sp-1); margin-top: var(--sp-1); }
.rsc-diag-action { background: transparent; color: var(--c-accent-fg); border: 1px solid var(--c-line-2); border-radius: var(--r-sm); padding: 2px var(--sp-2); font: inherit; font-size: var(--fs-meta); cursor: pointer; min-height: 24px; }
.rsc-diag-action:hover, .rsc-diag-fix:hover { border-color: var(--c-accent); }
.rsc-diag-tooltip button:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 1px; }
.field-under { display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--sp-1) var(--sp-3); font-size: var(--fs-meta); color: var(--c-muted); margin-top: var(--sp-1); }
.char-count { font-variant-numeric: tabular-nums; }
.mode-tabs { display: inline-flex; border: 1px solid var(--c-line-2); border-radius: var(--r-md); overflow: hidden; font-weight: 400; }
.mode-tabs button { background: transparent; color: var(--c-text-2); border: 0; padding: 3px var(--sp-3); font: inherit; font-size: var(--fs-meta); cursor: pointer; }
.mode-tabs button.active { background: var(--c-accent-soft); color: var(--c-text); }
.tok-chip { background: var(--c-chip); color: var(--c-code); border: 1px solid var(--c-line-2); border-radius: var(--r-sm); padding: 1px var(--sp-2); font-family: var(--font-mono); font-size: var(--fs-mono); cursor: pointer; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tok-chip:hover:not(:disabled) { border-color: var(--c-accent); }
.tok-chip:disabled { opacity: .5; cursor: default; }
/* Clickable elements of the EN text: insert themselves into the translation (title "Kliknij, aby wstawić"). */
button.tok-insert { cursor: pointer; box-shadow: inset 0 0 0 1px transparent; }
button.tok-insert:hover { box-shadow: inset 0 0 0 1px var(--c-accent); }
button.tok-insert:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 1px; }
/* Autocompletion list of the translation field (D-052); its frame takes the theme colours with the diagnostic tooltip, not CodeMirror's light default. */
.cm-tooltip.rsc-complete > ul { font-family: inherit; max-height: 18rem; min-width: 14rem; }
.cm-tooltip.rsc-complete > ul > li { padding: 3px var(--sp-2); line-height: 1.4; }
.cm-tooltip.rsc-complete > ul > li[aria-selected] { background: var(--c-accent-soft); color: var(--c-text); }
.cm-tooltip.rsc-complete > ul > completion-section { display: list-item; padding: var(--sp-1) var(--sp-2) 2px; font-size: var(--fs-xs); color: var(--c-muted); border-bottom: 1px solid var(--c-line); }
.cm-tooltip.rsc-complete .cm-completionLabel { font-family: var(--font-mono); font-size: var(--fs-mono); }
.cm-tooltip.rsc-complete .cm-completionDetail { margin-left: var(--sp-3); color: var(--c-text-2); font-style: normal; font-size: var(--fs-xs); }
.cm-tooltip.rsc-complete .cm-completionMatchedText { text-decoration: none; color: var(--c-accent-fg); font-weight: 700; }
/* Suspicious whitespace in the translation, listed under the field (BL-54) */
.ws-list { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-2); margin-top: var(--sp-1); font-size: var(--fs-meta); }
.ws-list-title { color: var(--c-ws-title); font-weight: 600; }
.ws-entry { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px var(--sp-2); max-width: 100%; background: var(--c-ws-bg); border: 1px solid var(--c-ws-line); border-radius: var(--r-sm);
    color: var(--c-text); font: inherit; font-size: var(--fs-meta); padding: 2px var(--sp-2); cursor: pointer; text-align: left; }
.ws-entry:hover { border-color: var(--c-err); }
.ws-entry-kind { font-weight: 600; }
.ws-snippet { font-family: var(--font-mono); white-space: pre; overflow: hidden; text-overflow: ellipsis; max-width: 100%; color: var(--c-text-3); }
.ws-snippet mark { background: var(--c-err-tint-strong); color: var(--c-err-fg); border-radius: var(--r-xs); padding: 0 1px; }

/* Proposals, comment summary and tabs (BL-46, BL-08) */
.section-heading { font-size: var(--fs-md); font-weight: 600; margin: 0 0 var(--sp-2); color: var(--c-heading); }
/* Counters are numbers, not chips (§2.3). */
.count, .count-plain { color: var(--c-text-2); font-weight: 500; font-variant-numeric: tabular-nums; }
.proposals { margin: var(--sp-4) 0 var(--sp-2); }
.proposals-empty { margin: var(--sp-1) 0 0; }
.proposals-more { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-2); margin-top: var(--sp-1); }
.comments-summary { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-1) var(--sp-3); padding: var(--sp-2) 0 var(--sp-2); border-top: 1px solid var(--c-line); margin-top: var(--sp-3); }
.comments-summary .section-heading { margin: 0; }
.latest-comment { flex: 1 1 220px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: var(--fs-sm); color: var(--c-text-3); }
.tab-list { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 1px solid var(--c-line); margin-bottom: var(--sp-3); }
.tab { background: none; border: 0; border-bottom: 2px solid transparent; color: var(--c-text-2); font: inherit; font-size: var(--fs-sm); padding: var(--sp-2) var(--sp-3); margin-bottom: -1px; cursor: pointer; }
.tab:hover { color: var(--c-text); }
.tab.active { color: var(--c-text); border-bottom-color: var(--c-accent); font-weight: 600; }
.tab .count { margin-left: var(--sp-1); }
.leave-list { margin: var(--sp-1) 0 0; padding-left: var(--sp-4); }
/* In-place explanations "?" (BL-43): a small panel with the explanation and "Więcej w przewodniku". */
.explain { display: inline-flex; }
.explain-popover { border: 1px solid var(--c-line-2); border-radius: var(--r-md); }
.explain-popover .explain-panel { padding: var(--sp-2) var(--sp-3); max-width: 340px; font-size: var(--fs-sm); display: grid; gap: var(--sp-2); background: var(--c-surface); color: var(--c-text); }
.explain-overlay { background: transparent !important; }
.guide-link { font-size: var(--fs-meta); white-space: nowrap; }
.legend-list { list-style: none; margin: 0; padding: var(--sp-1); display: grid; gap: var(--sp-2); text-align: left; max-width: 320px; }
.legend-list li { display: grid; gap: 2px; }
.legend-list .status { justify-self: start; }

/* Highlighted text */
.hl-text { white-space: pre-wrap; word-break: break-word; }
.tok { font-family: var(--font-mono); font-size: .9em; border-radius: var(--r-sm); padding: 0 2px; border: 0; font-weight: 600; }
button.tok { cursor: pointer; }
.tok-placeholder, .tok-plural { background: var(--c-ph-bg); color: var(--c-ph-fg); }
.tok-escaped { background: var(--c-escape-bg); color: var(--c-escape-fg); }
.tok-tag { background: var(--c-tag-bg); color: var(--c-tag-fg); }
.ws { position: relative; }
.ws-sus { background: var(--c-err-tint); border-radius: var(--r-xs); box-shadow: inset 0 -2px 0 var(--c-err); }
.ws-sus.ws-space::after, .show-ws .ws-space::after, .ws-sus.ws-nbsp::after, .show-ws .ws-nbsp::after, .ws-show.ws-space::after, .ws-show.ws-nbsp::after { position: absolute; left: 0; right: 0; text-align: center; }
.ws-sus.ws-space::after, .show-ws .ws-space::after { content: "·"; }
.ws-sus.ws-nbsp::after, .show-ws .ws-nbsp::after { content: "°"; }
.ws-sus.ws-nl::before, .show-ws .ws-nl::before { content: "↵"; }
.ws-sus.ws-tab::before, .show-ws .ws-tab::before { content: "→"; }
.ws-sus.ws-cr::before, .show-ws .ws-cr::before { content: "␍"; }
.ws-sus.ws-other::before, .show-ws .ws-other::before { content: "¤"; }
.show-ws .ws::before, .show-ws .ws::after { color: var(--c-info); }
.ws-show.ws-space::after { content: "·"; } .ws-show.ws-nbsp::after { content: "°"; }
.ws-show.ws-nl::before { content: "↵"; } .ws-show.ws-tab::before { content: "→"; } .ws-show.ws-cr::before { content: "␍"; } .ws-show.ws-other::before { content: "¤"; }
.show-ws .ws-space:not(.ws-sus), .show-ws .ws-nbsp:not(.ws-sus) { background: var(--c-info-tint); }
.ws-sus::before, .ws-sus::after { color: var(--c-ws-fg) !important; }

/* QA */
.qa-list { margin-top: var(--sp-2); display: grid; gap: var(--sp-1); min-height: 1.6rem; }
.qa-level { font-weight: 600; margin-right: 3px; }
.qa-source { border-left: 3px solid var(--c-neutral); } .qa-source .mud-icon-root { color: var(--c-neutral); }
.qa-ok { color: var(--c-ok); font-size: var(--fs-sm); display: flex; align-items: center; gap: var(--sp-1); }
.qa-pending { color: var(--c-text-2); font-size: var(--fs-sm); }
.qa-item { display: flex; align-items: flex-start; gap: var(--sp-2); font-size: var(--fs-sm); padding: var(--sp-1) var(--sp-2); border-radius: var(--r-md); background: var(--c-panel); }
.qa-item code { color: var(--c-code); margin-left: var(--sp-1); }
/* A finding with a place: a text button that selects it in the field. */
.qa-locate { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.qa-locate:hover { color: var(--c-accent-fg); }
.qa-locate:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 1px; }
.qa-error { border-left: 3px solid var(--c-err); } .qa-error .mud-icon-root { color: var(--c-err); }
.qa-warning { border-left: 3px solid var(--c-warn); } .qa-warning .mud-icon-root { color: var(--c-warn); }
.qa-info { border-left: 3px solid var(--c-info); } .qa-info .mud-icon-root { color: var(--c-info); }
.qa-ignored { opacity: .6; }
.qa-message { flex: 1; }
.qa-help { display: block; color: var(--c-muted); font-size: var(--fs-meta); margin-top: 2px; }
.qa-count { color: var(--c-muted); }
.loading-block, .loading-shape { display: grid; gap: var(--sp-2); }
/* U3-14 (D-817; Modern Web Guidance "spinner"): the busy state is the status text; the moving parts slow down or stop for reduced motion and stay
   visible in forced colors. */
@media (prefers-reduced-motion: reduce) {
  .loading-block .mud-progress-circular, .loading-block .mud-progress-circular svg { animation-duration: 6s; }
  .loading-block .mud-skeleton { animation: none; }
}
@media (forced-colors: active) {
  .loading-block .mud-progress-circular { forced-color-adjust: none; color: CanvasText; }
}
.loading-text { display: inline-flex; align-items: center; gap: var(--sp-2); color: var(--c-muted); }
.diff-rewrite-label { display: block; color: var(--c-muted); font-size: var(--fs-meta); }
/* F-327 (D-843): the rewritten text is a column of the label and the two blocks; the line breaks of the markup between them are not text (the
   text keeps pre-wrap inside each block), so no empty lines stand between them. */
.hl-text.hl-rewrite { display: grid; gap: var(--sp-1); white-space: normal; }
.hl-rewrite .diff-block { white-space: pre-wrap; justify-self: start; max-width: 100%; } /* the mark covers the text, not the empty rest of the cell */
.diff-block { display: block; }
.qa-group { list-style: none; margin: var(--sp-1) 0 0; padding: 0; display: grid; gap: 2px; }
.qa-group li { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-2); }
.qa-group code { margin-left: 0; }
.qa-group .qa-term-link { font-size: var(--fs-meta); }
/* U3-16 (D-819): the mute of one line of a group, a quiet text button after the line (the group's "Wycisz wszystkie" stays the main one). */
.qa-item-mute { font: inherit; font-size: var(--fs-meta); color: var(--mud-palette-primary); background: none; border: 0; padding: 0 var(--sp-1); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.qa-item-mute:hover { text-decoration-thickness: 2px; }
.qa-item-mute:focus-visible { outline: 2px solid var(--mud-palette-primary); outline-offset: 2px; border-radius: 2px; }
/* Muted checks (U14): folded under "Wyciszone (N)"; a check that cannot be muted says why. */
.qa-muted > summary { cursor: pointer; font-size: var(--fs-meta); color: var(--c-text-2); padding: 2px var(--sp-1); }
.qa-muted > .qa-item { margin-top: var(--sp-1); }
.qa-unmutable { font-style: italic; }

/* Preview */
.preview-panel { background: var(--c-sunken); border: 1px solid var(--c-line-2); border-radius: var(--r-md); padding: var(--sp-2) var(--sp-3); }
.preview-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); margin-bottom: var(--sp-2); }
.field-split > .preview-head { margin-bottom: 0; align-self: center; }
.preview-result { margin-bottom: var(--sp-2); }
/* Card "Przykłady podglądu" (BL-60): the whole example is one button that loads it into the preview. */
.example-row { display: grid; gap: var(--sp-1); width: 100%; text-align: left; background: transparent; color: inherit; border: 1px solid var(--c-line); border-radius: var(--r-md); padding: var(--sp-2) var(--sp-2); font: inherit; cursor: pointer; }
.example-row:hover { border-color: var(--c-accent); }
.example-args { display: flex; flex-wrap: wrap; gap: 2px var(--sp-3); font-size: var(--fs-meta); color: var(--c-text-2); }
.preview-args, .list-toolbar, .dispute-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); margin-bottom: var(--sp-2); }
.preview-args .arg { display: inline-flex; align-items: center; gap: var(--sp-1); font-family: var(--font-mono); font-size: var(--fs-mono); color: var(--c-ph-fg); }
.preview-args input { background: var(--c-surface); color: var(--c-text); border: 1px solid var(--c-line-2); border-radius: var(--r-sm); padding: 2px var(--sp-1); width: 9rem; font: inherit; font-family: inherit; }
.game-text { background: var(--c-game-bg); color: var(--c-game-fg); border: 1px solid var(--c-game-line); border-radius: var(--r-sm); padding: var(--sp-2) var(--sp-3); min-height: 2.5rem; white-space: pre-wrap; line-height: 1.5; font-size: var(--fs-md); }
.game-text kbd { background: var(--c-game-line); border: 1px solid var(--c-game-line); border-radius: var(--r-sm); padding: 0 var(--sp-1); font-family: inherit; font-size: .85em; }
.vt-link { color: var(--c-link); text-decoration: underline; }
.vt-icon, .vt-item { display: inline-block; border: 1px dashed var(--c-vt-line); border-radius: var(--r-sm); padding: 0 var(--sp-1); font-size: .78em; color: var(--c-vt-fg); }
.vt-hidden { color: var(--c-err); }
.preview-warning { color: var(--c-warn); font-size: var(--fs-meta); margin-bottom: var(--sp-2); }

/* Variants, comments, history */
.variant-list, .comment-list, .history-list, .term-cards, .memory-list, .recent-list, .change-list, .proposal-list, .rule-history, .links-terms, .construction-order-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-2); }
.variant { display: flex; gap: var(--sp-3); padding: var(--sp-2) var(--sp-2); border: 1px solid var(--c-line); border-radius: var(--r-lg); background: var(--c-surface); }
.variant.current { border-color: var(--c-ok-line); }
.variant.dismissed { opacity: .55; }
.vote { display: flex; flex-direction: column; align-items: center; min-width: 2rem; }
.vote button { background: none; border: 0; color: var(--c-faint); cursor: pointer; font-size: var(--fs-meta); line-height: 1; padding: 2px; }
.vote button.on { color: var(--c-accent); }
.vote button:disabled { cursor: default; opacity: .4; }
.vote-compact { flex-direction: row; gap: 2px; min-width: 0; font-size: var(--fs-meta); border: 1px solid var(--c-line-2); border-radius: var(--r-sm); padding: 0 3px; }
.vote-compact button { min-width: 24px; min-height: 24px; }
.proposals-head { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-1) var(--sp-4); }
.proposals-head .section-heading { margin: 0; }
/* Differences (BL-32, docs/ui.md#różnica-tekstów, D-519): an opaque fill that stands out from every surface (≥ 3:1), text on it ≥ 7:1, and never
   colour alone: a leading −/+ (hidden from screen readers, which read "usunięte:"/"dodane:"), a strike line drawn behind the glyphs (a line-through
   over them made the letters unreadable) and an underline. Markup and whitespace symbols inside a change take its colour (del./ins. outrank the
   muted markup of the version comparison), so a changed tag never looks like an unchanged one. */
.diff-del, .diff-ins { border-radius: var(--r-xs); padding: 1px 3px 2px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.diff-del { color: var(--c-diff-del-fg); text-decoration: none;
    background: linear-gradient(transparent calc(50% - 1px), var(--c-diff-del-line) 0 calc(50% + 1px), transparent 0) content-box,
        linear-gradient(var(--c-diff-del-bg), var(--c-diff-del-bg)); }
.diff-ins { color: var(--c-diff-ins-fg); background: var(--c-diff-ins-bg); text-decoration: underline 2px; text-underline-offset: 2px; }
.diff-del::before, .diff-ins::before { display: inline-block; font-weight: 700; padding-right: 3px; }
.diff-del::before { content: "−" / ""; background: var(--c-diff-del-bg); }
.diff-ins::before { content: "+" / ""; }
del.diff-del :is(.tok, .vtml-token), ins.diff-ins :is(.tok, .vtml-token) { background: none; color: inherit; border-color: currentColor; padding: 0; }
del.diff-del .ws::before, del.diff-del .ws::after, ins.diff-ins .ws::before, ins.diff-ins .ws::after { color: inherit; }
.diff-del + .diff-ins { margin-left: 2px; }
.diff-summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-1) var(--sp-3); margin-bottom: var(--sp-1); color: var(--c-text-2); font-size: var(--fs-meta); white-space: normal; }
.diff-summary .link-button { padding: 0; }
.diff-gap { display: block; width: 100%; margin: var(--sp-1) 0; padding: 0 var(--sp-2); min-height: 24px; border: 1px dashed var(--c-line-2); border-radius: var(--r-sm);
    background: var(--c-surface-2); color: var(--c-text-2); font: inherit; font-size: var(--fs-meta); text-align: center; cursor: pointer; }
.diff-gap:hover { border-color: var(--c-accent); color: var(--c-text); }
/* History graph (BL-52): one dot per event on a vertical line, grouped by day. */
.history-graph, .history-graph ol, .effective-list, .bell-queue, .bell-list, .notification-list, .public-progress, .public-actions, .discord-list { list-style: none; margin: 0; padding: 0; }
.history-day + .history-day { margin-top: var(--sp-2); }
.history-date { font-size: var(--fs-meta); font-weight: 600; color: var(--c-text-2); margin: 0 0 var(--sp-1); }
.history-event { position: relative; padding: 2px 0 var(--sp-3) var(--sp-5); }
.history-event::before { content: ""; position: absolute; left: .45rem; top: .2rem; bottom: 0; width: 2px; background: var(--c-line-2); }
.history-day:last-child .history-event:last-child::before { bottom: auto; height: .6rem; }
.history-dot { position: absolute; left: .17rem; top: .3rem; width: .7rem; height: .7rem; border-radius: 50%; background: var(--c-panel); border: 2px solid var(--c-faint); }
.event-approve .history-dot { border-color: var(--c-ok); background: var(--c-ok); }
.event-text .history-dot { border-color: var(--c-accent); background: var(--c-accent); }
.event-proposal .history-dot { border-color: var(--c-info); }
.event-remove .history-dot { border-color: var(--c-err); }
.history-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px var(--sp-2); }
.history-type { font-weight: 600; }
.variant-body { flex: 1; min-width: 0; }
.variant-actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 2px; }
.comment-list li, .history-list li { padding: var(--sp-2) var(--sp-2); border-left: 2px solid var(--c-line-2); }
.comment-text, .history-text { white-space: pre-wrap; margin-top: 2px; }
.comment-input { width: 100%; background: var(--c-sunken); color: var(--c-text); border: 1px solid var(--c-line-2); border-radius: var(--r-md); padding: var(--sp-2) var(--sp-2); font: inherit; margin: var(--sp-2) 0 var(--sp-1); }
.link-button { background: none; border: 0; color: var(--c-info); cursor: pointer; font-size: var(--fs-meta); padding: 0 var(--sp-1); }

/* Help column */
.help-card { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-lg); padding: var(--sp-3) var(--sp-3); margin-bottom: var(--sp-3); }
.help-card h3 { font-size: var(--fs-sm); font-weight: 600; margin: 0 0 var(--sp-2); display: flex; align-items: center; gap: var(--sp-1); }
.help-card-toggle { display: flex; align-items: center; gap: var(--sp-1); flex: 1; background: none; border: 0; color: inherit; font: inherit; padding: 0; cursor: pointer; text-align: left; min-height: 24px; }
.help-card-toggle:disabled { cursor: default; }
.help-card-chevron { margin-left: auto; color: var(--c-muted); }
.help-card-open { font-size: var(--fs-meta); font-weight: 500; color: var(--c-info); white-space: nowrap; }
.help-card-empty { padding: var(--sp-2) var(--sp-3); }
.help-card-empty h3 { margin: 0; }
.help-card-none { margin: 2px 0 0; }
.memory-row { display: flex; gap: var(--sp-2); }
.memory-texts { flex: 1; min-width: 0; display: grid; gap: 2px; }
.memory-source { color: var(--c-text-3); }
@media (hover: hover) { .memory-use { opacity: 0; } .memory-row:hover .memory-use, .memory-row:focus-within .memory-use { opacity: 1; } }
/* "Wstaw element" (BL-36) */
.palette-search { width: 100%; background: var(--c-sunken); color: var(--c-text); border: 1px solid var(--c-line-2); border-radius: var(--r-md); padding: var(--sp-2) var(--sp-3); font: inherit; }
.palette-search:focus { outline: 2px solid var(--c-info); outline-offset: 1px; }
.palette-list { list-style: none; margin: var(--sp-2) 0 0; padding: 0; max-height: 55vh; overflow-y: auto; }
.palette-group { font-size: var(--fs-xs); font-weight: 600; color: var(--c-text-2); padding: var(--sp-2) var(--sp-2) 3px; }
.palette-item { display: grid; grid-template-columns: minmax(9rem, auto) 1fr; gap: 0 var(--sp-3); padding: var(--sp-1) var(--sp-2); border-radius: var(--r-sm); cursor: pointer; }
.palette-item.active { background: var(--c-selected); box-shadow: inset 3px 0 0 var(--c-accent); }
.palette-code { font-family: var(--font-mono); font-size: var(--fs-mono); color: var(--c-tag-fg); overflow-wrap: anywhere; }
.palette-help { grid-column: 2; }
.palette-note { margin: var(--sp-2) 0 0; }
/* "Pokaż w pliku źródłowym" (BL-22) */
.source-file { list-style: none; margin: 0; padding: var(--sp-2) 0; background: var(--c-sunken); border: 1px solid var(--c-line-2); border-radius: var(--r-md); max-height: 60vh; overflow: auto; }
.source-file li { display: flex; gap: var(--sp-3); padding: 0 var(--sp-2); white-space: pre; }
.source-file .line-no { flex: none; width: 3.5rem; text-align: right; color: var(--c-faint); font-family: var(--font-mono); font-size: var(--fs-mono); user-select: none; }
.source-file code { font-size: var(--fs-meta); color: var(--c-code); }
.source-file .key-line { background: var(--c-key-line); box-shadow: inset 3px 0 0 var(--c-warn); }
.help-card ul, .term-other-languages, .term-spellings, .job-log, .form-set-list, .rule-list, .advanced-examples, .rule-shapes, .construction-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-1); }
.warning-card { border-color: var(--c-warn-line); }
.help-text { white-space: pre-wrap; }
/* Cards from the game data (plan 15R batch 4): family, placeholders, usage. */
.card-basis { white-space: nowrap; }
.inline-gap { margin-left: var(--sp-1); }
.code-knowledge { margin-top: 2px; overflow-wrap: anywhere; }
.family-card-head, .placeholder-role-head { display: flex; flex-wrap: wrap; gap: var(--sp-1); align-items: baseline; }
.family-card-head code, .placeholder-role-head code, .usage-list code { overflow-wrap: anywhere; }
.family-card-constructions, .family-siblings ul, .placeholder-roles, .usage-list { list-style: none; margin: var(--sp-1) 0; padding: 0; }
.family-card-constructions li.own { font-weight: 600; }
.family-suggestion { border-left: 3px solid var(--c-accent); padding: var(--sp-1) var(--sp-2); margin: var(--sp-2) 0; background: var(--c-surface-2, transparent); }
.family-suggestion-text { font-weight: 600; }
.family-gap, .family-card-deviates { margin: var(--sp-1) 0; }
.family-siblings li, .usage-list li { padding: 2px 0; border-top: 1px solid var(--c-line); }
.placeholder-roles > li { padding: var(--sp-1) 0; border-top: 1px solid var(--c-line); }
.placeholder-roles > li:first-child, .usage-list li:first-child { border-top: 0; }
.placeholder-values { display: flex; flex-wrap: wrap; gap: var(--sp-1); margin-top: 3px; }
.placeholder-examples { margin: 3px 0 var(--sp-1) var(--sp-4); padding: 0; }
.placeholder-examples-title, .usage-section { font-size: var(--fs-sm); font-weight: 600; margin: var(--sp-2) 0 2px; }

@media (max-width: 1199.98px) {
    .workspace { grid-template-columns: 320px minmax(0, 1fr); }
    .workspace.with-help { grid-template-columns: 320px minmax(0, 1fr) 360px; }
}
/* Phone: list and editor are separate views (has-selection shows the editor), the action bar fixed at the bottom. The editor reserves the
   bar's measured height (--bar-h, rsc.watchEditorBars) and scrolls the focused element above it (WCAG 2.4.11). */
@media (max-width: 799.98px) {
    .work-screen { height: calc(100dvh - 48px); }
    .work-context { padding: 0 var(--sp-2); font-size: var(--fs-meta); }
    .work-context-label { display: none; }
    /* F-256: on the phone the bar of a scope from a link keeps one line: the mark "tylko na tym ekranie" stays, its two ways out are in the panel
       behind Zmień (the same actions), so nothing spills over the header or the row "Lista". */
    .work-context .scope-link-keep, .work-context .scope-link-back { display: none; }
    .work-context .scope-link { flex-wrap: nowrap; flex: none; }
    .workspace, .workspace.list-hidden, .workspace.with-help { grid-template-columns: minmax(0, 1fr); }
    .workspace.list-hidden:not(.has-selection) .string-list { display: flex; }
    .list-toggle { display: none !important; }
    .workspace.has-selection .string-list, .workspace:not(.has-selection) .editor-column { display: none; }
    .editor-column { padding: var(--sp-2) var(--sp-3) calc(var(--bar-h, 96px) + var(--sp-5)); scroll-padding-bottom: calc(var(--bar-h, 96px) + var(--sp-2)); }
    .back-to-list { display: inline-flex !important; min-height: 44px; }
    .id-chip { display: none; }
    .head-row1 { flex-wrap: wrap; }
    .string-key { order: 10; flex-basis: 100%; }
    .head-row2 { position: static; padding: var(--sp-1) 0; border-bottom: 0; }
    .action-bar { display: flex; flex-direction: column; position: fixed; left: 0; right: 0; bottom: 0; top: auto; margin: 0; z-index: 1050; padding: var(--sp-1) var(--sp-2) calc(var(--sp-1) + env(safe-area-inset-bottom));
        border-top: 1px solid var(--c-track); background: var(--c-panel); }
    .action-item.phone-hidden { display: none; }
    .action-bar .action, .action-bar .action-menu .mud-icon-button { min-height: 44px; }
    .action-buttons { gap: var(--sp-2); align-items: flex-end; }
    .action-buttons .action-item { flex: 1 1 0; min-width: 0; flex-direction: column-reverse; align-items: stretch; gap: 2px; }
    .action-buttons .action { width: 100%; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
    .action-reason { max-width: none; text-align: center; }
    .read-only-note { flex: 1; }
    .help-drawer { width: 100vw; border-left: 0; }
    .help-toggle-text { display: none; } /* the icon and the count; the name stays in aria-label */
    .editor-nav { flex-wrap: wrap; }
    .conflict-grid { grid-template-columns: 1fr; }
    .arg-search { min-width: 0; width: 100%; }
    body:has(.action-bar) .mud-snackbar-location-bottom-right { bottom: calc(var(--bar-h, 96px) + 8px) !important; }
}

/* Glossary, translation memory, consistency */
.term-cards li, .memory-list li { border-top: 1px solid var(--c-line); padding-top: var(--sp-2); }
.term-cards li:first-child, .memory-list li:first-child { border-top: 0; padding-top: 0; }
.term-head { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-1); margin-bottom: var(--sp-1); }
.term-english:hover { text-decoration: underline; }
.rendering { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1); margin: 2px 0; }
.form-chip { background: var(--c-chip); color: var(--c-code); border: 1px solid var(--c-line-2); border-radius: var(--r-sm); padding: 0 var(--sp-2); font: inherit; font-size: var(--fs-meta); cursor: pointer; }
.form-chip.main { font-weight: 600; color: var(--c-translation); border-color: var(--c-ok-line); }
.form-chip:hover:not(:disabled) { border-color: var(--c-accent); }
.rendering-forbidden .form-chip { text-decoration: line-through; color: var(--c-err); border-color: var(--c-err-line); cursor: default; }
.rendering-allowed .form-chip.main { color: var(--c-code); border-color: var(--c-line-2); }
.rendering-inline { margin-right: var(--sp-2); }
.rendering-inline.rendering-forbidden { text-decoration: line-through; color: var(--c-err); }
.rendering-inline.rendering-preferred { color: var(--c-translation); font-weight: 600; }
.similarity { font-weight: 700; color: var(--c-accent); min-width: 2.6rem; }
.term-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-5); align-items: start; }
.term-layout .panel { max-width: none; }
.rendering-row { display: grid; grid-template-columns: 1.2fr 2fr 1fr 1.2fr auto; gap: var(--sp-2); align-items: center; margin-bottom: var(--sp-2); }

.string-link { margin-right: 3px; }
.arg-index { font-family: var(--font-mono); color: var(--c-ph-fg); }
.arg-search { min-width: 280px; }
.preview-args { flex-direction: column; align-items: stretch; }

/* Administration */
.grant-row { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; margin-bottom: var(--sp-2); padding-bottom: var(--sp-2); border-bottom: 1px solid var(--c-line); }
/* The permission has a line of its own; the scope fields are wide enough for "wszystkie języki" and "wszystkie projekty" (D-404). */
.grant-row > :is(.mud-input-control, .mud-select, .search-picker) { flex: 0 1 200px; min-width: 0; max-width: 100%; }
.grant-row > :is(.mud-input-control, .mud-select, .search-picker):first-child { flex: 1 1 100%; max-width: 600px; }
.grant-row > :is(.mud-input-control, .mud-select, .search-picker):nth-child(3) { flex-basis: 240px; }
.grant-row > :is(.mud-input-control, .mud-select, .search-picker):nth-child(4) { flex-basis: 160px; }
.invite-link { display: flex; align-items: center; gap: var(--sp-1); margin-top: var(--sp-1); word-break: break-all; }

/* App bar search */
.global-search { display: flex; align-items: center; gap: var(--sp-2); background: var(--c-surface); border: 1px solid var(--c-line-2); border-radius: var(--r-md); padding: 3px var(--sp-2); flex: 1 1 520px; max-width: 520px; min-width: 140px; margin-right: auto; color: var(--c-muted); }
.global-search input { min-width: 0; }
.global-search:focus-within { border-color: var(--c-accent); }
.global-search input { flex: 1; background: transparent; border: 0; color: var(--c-text); font: inherit; outline: none; }
.global-search kbd { font-size: var(--fs-xs); background: var(--c-line); border-radius: var(--r-sm); padding: 0 var(--sp-1); color: var(--c-text-2); }

/* Overview */
/* A grid of 2/3 + 1/3 that fills wide screens (U-J, D-104); project cards flow into columns on very wide screens. */
.overview-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr); gap: var(--sp-5); align-items: start; }
.overview-main { display: grid; gap: var(--sp-5); min-width: 0; }
.overview-main .section-title { margin-top: 0; }
/* F-240, U3-31 (D-832): the card of the next work takes the whole row at every width, so its label, key and button are not squeezed; the numbers below. */
/* F-328 (D-843): the number cards share the row under it — in a grid of auto-fit tracks the full-row card kept three tracks and two numbers left the third empty. */
.overview-next { display: flex; flex-wrap: wrap; gap: var(--sp-4); }
.overview-next > .next-card { flex: 1 1 200px; }
.overview-next > .next-continue { flex-basis: 100%; }
.next-card { display: flex; align-items: center; gap: var(--sp-4); min-width: 0; padding: var(--sp-4); background: var(--c-surface);
    border: 1px solid var(--c-line-2); border-radius: var(--r-lg); }
/* U3-31 (D-832): the card of the next work — what opens and the main action in one row, the last edited string as a secondary line below. */
.next-card.next-continue { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--sp-3) var(--sp-4); }
.next-continue > .mud-skeleton { grid-column: 1 / -1; }
.next-continue .continue-work { white-space: nowrap; }
.next-continue .continue-last { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--sp-1); min-width: 0;
    padding-top: var(--sp-3); border-top: 1px solid var(--c-line); }
.next-continue .continue-last span { white-space: nowrap; }
.next-continue .continue-last code { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.next-text, .progress-block, .construction-order-main { display: grid; gap: var(--sp-1); min-width: 0; }
.next-label { color: var(--c-text-2); font-size: var(--fs-sm); }
.next-key { font-family: var(--font-mono); font-size: var(--fs-mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
a.next-count { flex-direction: column; align-items: flex-start; justify-content: center; gap: 0; color: var(--c-text); text-decoration: none; }
a.next-count:hover, a.next-count:focus-visible { border-color: var(--c-accent); }
.next-number { font-size: var(--fs-display); font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.progress-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-1) var(--sp-3); margin-bottom: var(--sp-2); }
/* U3-30 (D-827): the recent changes of the overview are compact entries of a change under day headers. */
.overview-recent-days .activity-day { margin: var(--sp-3) 0 var(--sp-1); }
.overview-recent-days .activity-day:first-child { margin-top: 0; }
.overview-recent-list { gap: 0; }
.overview-recent-list .change-entry { padding-inline: 0; }
.overview-recent-all { display: inline-block; margin-top: var(--sp-2); font-size: var(--fs-sm); }
@media (max-width: 1000px) { .overview-grid { grid-template-columns: 1fr; } .global-search kbd { display: none; } }
@media (max-width: 700px) {
    .overview-next > .next-card:not(.next-continue) { flex-basis: calc(50% - var(--sp-2)); }
    .next-card.next-continue { grid-template-columns: minmax(0, 1fr); }
    .next-continue .continue-work { justify-self: start; max-width: 100%; white-space: normal; } /* the label wraps instead of widening the page (D-843) */
}

/* ---------- Placeholders of planned screens (docs/ui.md#stany-ekranu, "Planowane (makieta)") ---------- */
.nav-group-title { padding: var(--sp-4) var(--sp-4) var(--sp-1); font-size: var(--fs-xs); font-weight: 600; color: var(--c-muted); letter-spacing: .04em; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* ---------- Phase 9 batch C2: shared list parts, forms, screens ---------- */
/* Long texts in lists: two lines, the full text in the tooltip and for screen readers (BL-16). */
.clamp-2 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.item-source, .item-translation { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow-wrap: anywhere; }
.list-search { flex: 1 1 320px; max-width: 520px; }
.list-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--sp-1) var(--sp-2); padding: var(--sp-1) 0; font-size: var(--fs-sm); color: var(--c-text-2); }
.pager-range { font-variant-numeric: tabular-nums; }
.pager-jump, .link-button.save-view, .graph-legend-lines > span { display: inline-flex; align-items: center; gap: var(--sp-1); }
.pager-jump input { width: 4.5rem; min-height: 28px; background: var(--c-sunken); color: var(--c-text); border: 1px solid var(--c-line-input); border-radius: var(--r-sm); padding: 2px var(--sp-1); font: inherit; }
.updating { color: var(--c-info); margin-left: var(--sp-2); }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); margin-top: var(--sp-4); }
.form-status { min-height: 1.4rem; display: inline-flex; align-items: center; }

.row-menu, .row-actions { text-align: right; white-space: nowrap; }
.section-actions { margin-bottom: var(--sp-3); }
@media (max-width: 799.98px) { .row-actions { white-space: normal; text-align: left; } }
/* Tables with fixed column widths (D-104): the content column takes the rest; numbers right-aligned; the row menu 48 px. */
.fixed-table table { table-layout: fixed; width: 100%; }

.fixed-table .col-number { width: 96px; }
.fixed-table .col-kind { width: 140px; }

.fixed-table .col-compat { width: 240px; }
.fixed-table .col-menu { width: 56px; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
/* U-17 (K-020, D-774): the fixed widths of table columns as classes instead of style= in the markup. */
.col-w56 { width: 56px; }
.col-w72 { width: 72px; }
.col-w96 { width: 96px; }
.col-w120 { width: 120px; }
.col-w130 { width: 130px; }
.col-w140 { width: 140px; }
.col-w150 { width: 150px; }
.col-w160 { width: 160px; }
.col-w200 { width: 200px; }
.col-w220 { width: 220px; }
.col-w240 { width: 240px; }
.col-w260 { width: 260px; }
/* Long keys and paths break, words of labels and headers never break inside (D-104). */
.data-table td.mud-table-cell { overflow-wrap: break-word; }
.data-table th.mud-table-cell { overflow-wrap: normal; word-break: normal; hyphens: manual; }
.data-table td.mud-table-cell::before { overflow-wrap: normal; word-break: normal; flex: none; padding-right: var(--sp-3); }
/* Line group rows of the one versions table. */
.data-table .group-row .mud-table-cell, .data-table tr.group-row > th { background: var(--c-panel); font-weight: 600; font-size: var(--fs-sm);
    border-top: 1px solid var(--c-line-2); }
.release-name { font-weight: 600; margin-right: var(--sp-2); }
.releases-table .superseded .release-name { text-decoration: line-through; color: var(--c-text-2); }
.compat-summary { display: grid; gap: 2px; outline-offset: 2px; }
.files-table .file-path code { font-family: var(--font-mono); font-size: var(--fs-mono); }
@media (max-width: 959.98px) {
    .fixed-table table { table-layout: auto; }
    .releases-table .mud-table-cell { flex-wrap: wrap; gap: var(--sp-1) var(--sp-2); }
}

/* Term page (BL-05) */
/* Term page (D-104): a 720 px form and a 360 px side column from 1280 px; the tabs below span both. */
/* U3-38 (D-858): the text keeps a readable 720 px, the side column (tags, images) takes the rest of a wide screen. */
.term-page, .term-read { display: grid; grid-template-columns: minmax(0, 720px) minmax(360px, 1fr); gap: var(--sp-5); align-items: start; }
.term-main, .term-read-main { min-width: 0; }
/* U3-38 (D-303): a heading inside a section of the term (Inne zapisy EN under Znaczenie) starts a new group, further than the lines of one. */
.term-read-main .section-heading:not(:first-child) { margin-top: var(--sp-4); }
.term-side { display: grid; gap: var(--sp-4); min-width: 0; }
/* D-342: the read mode of a term — the lead line under the h1, the translations as text, not as fields. */
.page-lead { margin-top: var(--sp-1); }
.term-lead { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-2) var(--sp-3); font-size: var(--fs-game); }
.term-lead-text { font-weight: 600; }
.term-lead-forms { color: var(--c-text-2); font-size: var(--fs-sm); }
.term-editing-note { margin: 0; color: var(--c-text-2); }
.term-saved { margin: 0 0 var(--sp-3); color: var(--c-text-2); }
.term-pending { margin: 0; padding: var(--sp-3) var(--sp-4); border: 1px solid var(--c-info-line); background: var(--c-info-bg); border-radius: var(--r-md); }
.term-pending .link-button { margin-left: var(--sp-2); }
.term-translations, .scenario-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-4); }
.term-translation { display: grid; gap: var(--sp-2); padding-bottom: var(--sp-4); border-bottom: 1px solid var(--c-line); }
.term-translation:last-child { border-bottom: 0; padding-bottom: 0; }
.term-translation-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-2) var(--sp-3); }
.term-translation-note { margin: 0; color: var(--c-text-2); }
.term-translation-forms { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-2); align-items: baseline; }
.term-description { margin: 0; white-space: pre-line; }
.term-fields { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--sp-2) var(--sp-4); margin: var(--sp-3) 0 0; }
.term-fields dt { color: var(--c-text-2); }
.term-fields dd { margin: 0; display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: baseline; }
.term-forms-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: var(--sp-4); align-items: start; }
.term-forms-card .section-title, .lexicon-evidence-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-3); }
.forms-table { width: 100%; border-collapse: collapse; }
.forms-table th, .forms-table td { text-align: left; padding: var(--sp-2) var(--sp-3) var(--sp-2) 0; border-bottom: 1px solid var(--c-line); vertical-align: baseline; }
.forms-table tbody th { font-weight: 500; color: var(--c-text-2); width: 45%; }
.forms-table tbody th .small { display: block; font-weight: 400; }
.forms-table thead th { font-size: var(--fs-xs); color: var(--c-faint); font-weight: 600; }
.forms-unnamed { margin: 0 0 var(--sp-3); }
.term-lexicon-forms { margin-top: var(--sp-6); display: grid; gap: var(--sp-3); }
.term-lexicon-forms > .section-title, .term-lexicon-forms > p { margin-bottom: 0; }
.lexicon-evidence { display: grid; gap: var(--sp-2); }
.evidence-keys { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-3); }
.term-rules-tab { max-width: 720px; margin-bottom: var(--sp-5); }
.term-side .panel { margin: 0; }
.term-side .section-title { font-size: var(--fs-lg); margin-top: 0; }
.term-side .panel-head, .rule-members .section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-2); }
.term-rules .rule-list + p, .term-rules > p { margin-bottom: var(--sp-2); }
.term-section .mud-input-control { margin-top: 0; }
@media (max-width: 1279.98px) { .term-page, .term-read { grid-template-columns: minmax(0, 1fr); } .term-main, .term-read-main { max-width: 720px; } }
.term-tabs { margin-top: var(--sp-2); }
.term-tabs .tab .tab-lock { margin-left: var(--sp-1); color: var(--c-faint); vertical-align: -3px; }
.conflict-table { width: 100%; border-collapse: collapse; margin: var(--sp-2) 0; font-size: var(--fs-sm); }
.conflict-table th, .conflict-table td { text-align: left; vertical-align: top; padding: var(--sp-1) var(--sp-2); border-top: 1px solid var(--c-line); }
.conflict-table pre { white-space: pre-wrap; margin: 0; font-family: inherit; }
.rendering-row { border: 0; padding: 0; margin: 0 0 var(--sp-2); min-width: 0; }
.type-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) auto; gap: var(--sp-2); align-items: center; }
.type-uses { white-space: nowrap; color: var(--c-link); }
@media (max-width: 799.98px) {
    .term-layout { grid-template-columns: minmax(0, 1fr); }
    .rendering-row { grid-template-columns: minmax(0, 1fr); }
    .type-head { grid-template-columns: minmax(0, 1fr); }
}

/* Overview (BL-11) */

/* Consistency (BL-12) */
.consistency-head, .group-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--sp-3); flex-wrap: wrap; }
.consistency-keys { display: flex; flex-wrap: wrap; gap: 2px var(--sp-2); margin-top: 3px; }
.variant-text { font-weight: 600; }

/* Project page (BL-13) and import (BL-14) */
.release-select { max-width: 240px; }
.file-path { overflow-wrap: anywhere; }
.wizard-steps { list-style: none; display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); padding: 0; margin: 0 0 var(--sp-4); color: var(--c-text-2); }
.wizard-steps li { display: inline-flex; align-items: center; gap: var(--sp-2); }
.wizard-steps span { display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; border: 1px solid var(--c-line-input); font-weight: 600; }
.wizard-steps .current { color: var(--c-text); font-weight: 600; }
.wizard-steps .current span { background: var(--c-accent); color: var(--c-bg); border-color: var(--c-accent); }
.wizard-steps .done span { border-color: var(--c-ok); color: var(--c-ok); }

/* Administration (BL-15) */
/* The one local navigation (D-104): Administracja, Profil, Pomoc. */
.with-local-nav { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: var(--sp-5); align-items: start; }
/* Without the list (one item, e.g. a proofreader in Dane gry), the content takes the whole width instead of the 240 px column of the list. */
.with-local-nav.no-local-nav { grid-template-columns: minmax(0, 1fr); }
.local-nav { position: sticky; top: calc(48px + var(--sp-4)); display: grid; gap: var(--sp-2); min-width: 0; }
.local-nav-toggle { display: none; }
.local-nav-current { margin-left: auto; color: var(--c-text-2); font-weight: 400; }
.local-nav ul, .filter-options { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.local-nav a { display: flex; align-items: center; min-height: 36px; padding: var(--sp-1) var(--sp-3); border-radius: var(--r-md); color: var(--c-text); text-decoration: none; }
.local-nav a:hover { background: var(--c-hover); }
.local-nav a.active, .local-nav a.target-current { background: var(--c-selected); box-shadow: inset 3px 0 0 var(--c-accent); font-weight: 600; }
/* U3-12 (D-817): while scrolling the script marks the section in view at once; the state of the list follows when the scroll ends. */
.local-nav ul:has(a.target-current) a.active:not(.target-current) { background: none; box-shadow: none; font-weight: 400; }
@container page (max-width: 899.98px) {
    .with-local-nav { grid-template-columns: minmax(0, 1fr); gap: var(--sp-3); }
    .local-nav { position: static; }
    /* min-width 0 (D-843): the name of the current chapter is cut with an ellipsis instead of widening the page past the window (Pomoc at 375 px). */
    .local-nav-toggle { display: flex; align-items: center; gap: var(--sp-2); width: 100%; min-width: 0; min-height: var(--target-touch); padding: var(--sp-2) var(--sp-3);
        border: 1px solid var(--c-line-input); border-radius: var(--r-sm); background: var(--c-surface); color: var(--c-text); font: inherit; font-size: var(--fs-sm); text-align: left; cursor: pointer; }
    .local-nav-current { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .local-nav-toggle .mud-icon-root { flex: none; }
    .local-nav:not(.local-nav-open) > ul { display: none; }
    .local-nav > ul { display: grid; max-height: min(60vh, 480px); overflow-y: auto; border: 1px solid var(--c-line-2); border-radius: var(--r-md); padding: var(--sp-1); background: var(--c-surface); }
    .local-nav a { min-height: var(--target-touch); }
    .local-nav a.active { box-shadow: inset 3px 0 0 var(--c-accent); }
}
.language-form > .mud-input-control { flex: 1 1 160px; }

/* Profile */
.profile-sections { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-5); min-width: 0; }
.profile-sections .panel { max-width: none; }

/* Review categories */
.category { background: var(--c-surface); border: 1px solid var(--c-line-2); border-radius: var(--r-md); color: var(--c-text); font: inherit; font-size: var(--fs-meta); padding: 3px var(--sp-2); cursor: pointer; min-height: 28px; max-width: 100%; }

.category.include { border-color: var(--c-accent); }
.category.exclude { border-color: var(--c-err-line); }

/* Global search results (UI-2) */
.global-search { position: relative; }
.search-results { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 1300; background: var(--c-surface); border: 1px solid var(--c-line-2);
    border-radius: var(--r-lg); box-shadow: var(--shadow-popover); max-height: 70vh; overflow-y: auto; padding: var(--sp-1) 0; color: var(--c-text); }
.search-group + .search-group { border-top: 1px solid var(--c-line); margin-top: var(--sp-1); padding-top: var(--sp-1); }
.search-group-title { font-size: var(--fs-xs); font-weight: 600; color: var(--c-text-2); padding: var(--sp-1) var(--sp-3); }
.search-option { display: grid; gap: 1px; padding: var(--sp-1) var(--sp-3); color: var(--c-text); text-decoration: none; min-width: 0; }
.search-option.active, .search-option:hover { background: var(--c-selected); box-shadow: inset 3px 0 0 var(--c-accent); }
.search-text { font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* U3-21 (D-824): key, project, version and why it was found on one metadata line; the key keeps its ellipsis, the rest wraps under it. */
.meta-line.search-meta { min-width: 0; flex-wrap: nowrap; overflow: hidden; }
.search-meta > * { flex: none; }
.search-meta .search-key, .search-meta .search-found { min-width: 3rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* The key is what was looked for: "znaleziono…" gives way first. */
.search-meta .search-key { flex: 0 1 auto; }
.search-meta .search-found { flex: 0 8 auto; }
.search-found { font-style: italic; }
.search-translation { color: var(--c-translation); }
.search-translation-row { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; }
.search-translation-row .search-text { min-width: 0; }
.search-translation-row > :not(.search-text) { flex: none; }
.search-all { font-size: var(--fs-meta); color: var(--c-link); }
.search-empty { padding: 3px var(--sp-3); }
.search-hint { padding: var(--sp-1) var(--sp-3) 0; border-top: 1px solid var(--c-line); margin-top: var(--sp-1); }

/* Shortcuts overlay (BL-17) */
.shortcuts-table { width: 100%; border-collapse: collapse; margin-bottom: var(--sp-3); font-size: var(--fs-sm); }
.shortcuts-table th { text-align: left; font-weight: 400; white-space: nowrap; padding: var(--sp-1) var(--sp-3) var(--sp-1) 0; vertical-align: top; width: 40%; border-bottom: 1px solid var(--c-line); }
.shortcuts-table td { padding: var(--sp-1) 0; border-bottom: 1px solid var(--c-line); }
kbd { font-family: var(--font-mono); font-size: var(--fs-mono); background: var(--c-chip); border: 1px solid var(--c-line-2); border-bottom-width: 2px; border-radius: var(--r-sm); padding: 0 var(--sp-1); color: var(--c-text); }

/* Progress widget in the navigation (BL-23) */
.nav-progress { margin: var(--sp-3) var(--sp-3) var(--sp-2); padding: var(--sp-2) var(--sp-3); border: 1px solid var(--c-line); border-radius: var(--r-lg); font-size: var(--fs-meta); }
.nav-progress-title { font-weight: 600; margin-bottom: var(--sp-1); display: flex; justify-content: space-between; }
.nav-progress ul { list-style: none; margin: var(--sp-2) 0 0; padding: 0; display: grid; gap: 2px; }
.nav-progress a { display: flex; align-items: center; gap: var(--sp-2); color: var(--c-text-2); text-decoration: none; min-height: 24px; }
.nav-progress a strong { margin-left: auto; color: var(--c-text); font-variant-numeric: tabular-nums; }
.nav-progress a:hover { color: var(--c-text); }
.nav-progress .status-dot { margin-top: 0; }
.layout-phone .nav-progress { margin: var(--sp-2); }

/* Help: the guide in the application */
.help-content { line-height: 1.6; min-width: 0; overflow-wrap: anywhere; }
.help-content h1 { font-size: var(--fs-2xl); margin-top: 0; }
.help-content h2 { font-size: var(--fs-lg); margin-top: var(--sp-5); }
.help-content h3 { font-size: var(--fs-md); margin-top: var(--sp-4); }
.help-content a { color: var(--c-link); }
/* D-922: the pictures of the guide, in the theme of the page (the other one is hidden and, lazy, never downloaded). */
.help-content .guide-shot { display: block; width: fit-content; max-width: 100%; margin: var(--sp-3) 0; cursor: zoom-in; }
.help-content .guide-shot img { display: block; max-width: 100%; height: auto; border: 1px solid var(--c-line); border-radius: var(--r-md); }
html[data-theme="light"] .help-content .guide-shot-dark, html[data-theme="dark"] .help-content .guide-shot-light { display: none; }
.help-content code { font-family: var(--font-mono); font-size: .88em; background: var(--c-chip); border-radius: var(--r-sm); padding: 0 var(--sp-1); color: var(--c-code); }
.help-content pre { overflow-x: auto; background: var(--c-sunken); padding: var(--sp-2); border-radius: var(--r-md); }
.help-content table { border-collapse: collapse; width: 100%; margin: var(--sp-3) 0; font-size: var(--fs-sm); display: block; overflow-x: auto; }
.help-content th, .help-content td, .rule-matrix th, .rule-matrix td { border: 1px solid var(--c-line); padding: var(--sp-1) var(--sp-2); text-align: left; vertical-align: top; }
.help-search-results { list-style: none; padding: 0; margin: var(--sp-2) 0 0; display: grid; gap: var(--sp-1); font-size: var(--fs-sm); }
.help-search-results a { color: var(--c-link); }

/* Accessibility pass (BL-20): visible focus everywhere (the ring is in the design system section), targets of at least 24 px, no motion. */
.link-button { min-height: 24px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }
.mud-dialog a:not(.mud-button-root), .muted a, .small a:not(.mud-button-root):not(.legend-item) { color: var(--c-link); }
.shortcuts-table th .muted { margin: 0 3px; }
.help-content ul { list-style: disc; padding-left: var(--sp-5); } .help-content ol { list-style: decimal; padding-left: var(--sp-5); } .help-content li { margin: 2px 0; }

/* Administration → Zadania (docs/ui.md#zadania) */
.action-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin-top: var(--sp-2); }
/* D-843: in a stack spaced by its gap the stack sets the distance; a margin of its own would add to it (8 + 12 = 20 px, off the scale). */
:is(.form-stack, .step-body, .job-schedule-form, .dialog-body, .stack-2, .stack-3, .stack-4, .stack-5, .ai-grid, .git-grid, .d-flex.flex-column) > :is(.action-row, .save-bar, .construction-order) { margin-top: 0; }
/* The same in a row: the inline margin of a rendering or a language label is for running text, the row's gap already separates them. */
:is(.term-lead, .term-translation-head) > :is(.rendering-inline, .lang-label) { margin-right: 0; }
/* The label of a group of fields stays closer to its fields than to the field above: 8 px under it in a 16 px stack (D-843). */
.form-stack > .field-group-label { margin-bottom: calc(-1 * var(--sp-2)); }
.job-schedule { max-width: none; }
.job-schedule-form { display: grid; gap: var(--sp-2); }
.job-interval { display: grid; grid-template-columns: minmax(6rem, 9rem) minmax(8rem, 11rem) minmax(9rem, 13rem); gap: var(--sp-3); align-items: start; }
.job-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 3px var(--sp-4); margin: 0; }
.job-facts dt { color: var(--c-text-2); }
.job-facts dd { margin: 0; overflow-wrap: anywhere; }
.job-state { display: inline-flex; align-items: center; gap: var(--sp-1); white-space: nowrap; }
.job-state-succeeded { color: var(--c-ok); }
.job-state-failed { color: var(--c-err); }
.job-state-running, .job-state-waitingretry { color: var(--c-info); }
.job-state-awaitingdecision { color: var(--c-warn); }
.job-state-queued, .job-state-cancelled { color: var(--c-text-2); }
#jobs-panel-schedule > p.muted { margin-bottom: var(--sp-3); }
.jobs-table tr.selected, .knowledge-releases tr.selected { background: var(--c-selected); box-shadow: inset 3px 0 0 var(--c-accent); }
.job-error { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--c-sunken); border: 1px solid var(--c-err-line); border-radius: var(--r-md); padding: var(--sp-2); font-size: var(--fs-meta); margin: var(--sp-1) 0 var(--sp-2); max-height: 14rem; overflow: auto; }
.small-heading { font-size: var(--fs-sm); font-weight: 600; margin: var(--sp-3) 0 var(--sp-1); color: var(--c-heading); }
.field-error { color: var(--c-err); margin: 0; }
@media (max-width: 600px) {
    .job-interval { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .job-interval > :last-child { grid-column: 1 / -1; }
}

/* Phase 11A glossary term model (docs/ui.md#glosariusz, #termin, #zestawy-form, #kolumna-pomocy). */
.rendering-discouraged .form-chip.main { color: var(--c-muted); border-color: var(--c-line-2); font-weight: 500; }
.rendering-draft .form-chip.main { border-style: dashed; }
.rendering-obsolete .form-chip { color: var(--c-faint); text-decoration: line-through; cursor: default; }
.rendering-inline.rendering-discouraged, .rendering-inline.rendering-obsolete { color: var(--c-muted); }
.rendering-inline.rendering-obsolete { text-decoration: line-through; }
.rendering-inline.rendering-draft { font-style: italic; }
.rendering-note { margin: 2px 0 3px; }
.form-label { color: var(--c-muted); font-size: var(--fs-xs); margin-right: var(--sp-1); }
.origin-labels { display: inline-flex; flex-wrap: wrap; gap: 3px; vertical-align: middle; }
.term-unresolved { border: 1px solid var(--c-info-line); background: var(--c-info-bg); border-radius: var(--r-md); padding: var(--sp-2) var(--sp-2); margin-bottom: var(--sp-2); }
.term-unresolved ul, .context-history ol { margin: var(--sp-1) 0 0; padding-left: var(--sp-4); display: grid; gap: var(--sp-1); }
.term-inherited { border-left: 3px solid var(--c-info); padding-left: var(--sp-2); margin: 3px 0; }
.term-actions { display: flex; gap: var(--sp-3); flex-wrap: wrap; margin-top: 3px; }
.other-projects ul, .excluded-terms ul { margin: 3px 0; padding-left: var(--sp-4); }
.term-add { margin-top: var(--sp-2); }
.spelling-list, .scientific-field { border: 0; padding: 0; margin: 0; min-width: 0; }
.field-legend { font-size: var(--fs-sm); color: var(--c-muted); padding: 0; }
.spelling-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr) auto; gap: var(--sp-3); align-items: start; margin-bottom: var(--sp-3); }
.rendering-row.rendering-row-full { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; gap: var(--sp-3); border: 1px solid var(--c-line-2); border-radius: var(--r-md); padding: var(--sp-4); margin-bottom: var(--sp-3); }
/* The text takes its own row; status, gender and the bin share the next one, so no label is cut in 720 px. */
.named-forms summary, .rendering-scope summary { cursor: pointer; color: var(--c-text-2); font-size: var(--fs-sm); min-height: 24px; }
.rendering-scope[open] > :not(summary), .named-forms[open] > :not(summary) { margin-top: var(--sp-3); }
.rendering-scope[open] { display: grid; gap: var(--sp-3); }
.named-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: var(--sp-3); }
.assign-labels { display: flex; flex-wrap: wrap; gap: var(--sp-1); align-items: center; margin: 3px 0; }
.form-set-language { max-width: 260px; }
.form-set-row { display: grid; grid-template-columns: 2rem minmax(0, 1fr) minmax(0, 1fr) minmax(0, 2fr) auto; gap: var(--sp-2); align-items: center; }
.form-set-row.form-set-gender { grid-template-columns: 2rem minmax(0, 1fr) minmax(0, 1fr) auto; }
.form-set-buttons { white-space: nowrap; }
.term-history { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-3); }
.term-history > li { border-top: 1px solid var(--c-line); padding-top: var(--sp-2); }
.history-head, .proposal-texts, .rule-shapes > li { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: baseline; }
.history-changes { border-collapse: collapse; margin-top: var(--sp-1); font-size: var(--fs-sm); }
.history-changes th { text-align: left; font-weight: 500; color: var(--c-muted); padding-right: var(--sp-3); vertical-align: top; }
.history-changes td { vertical-align: top; padding-right: var(--sp-2); }
.history-changes pre { margin: 0; white-space: pre-wrap; font: inherit; overflow-wrap: anywhere; }
@media (max-width: 799.98px) {
    .spelling-row { grid-template-columns: minmax(0, 1fr); }
    .form-set-row, .form-set-row.form-set-gender { grid-template-columns: minmax(0, 1fr); }
    .form-set-order { display: none; }
    .history-changes, .history-changes tbody, .history-changes tr, .history-changes th, .history-changes td { display: block; }
    .history-changes td[aria-hidden="true"] { display: none; }
    .history-changes tr { margin-bottom: var(--sp-2); }
}
/* Phase 11B: rules, effects, changed strings, proposals, typos (docs/ui.md#termin, #propozycje-terminów) */
.panel-head { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: baseline; justify-content: space-between; }
.term-rules { margin-top: var(--sp-4); }
.rule-list > li { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; border-top: 1px solid var(--c-line); padding-top: var(--sp-1); }
.rule-list code { overflow-wrap: anywhere; }
.rule-actions { margin-left: auto; white-space: nowrap; }
.rule-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-4); align-items: start; }
.rule-form > p { margin: calc(-1 * var(--sp-3)) 0 0; }
.rule-examples { margin: var(--sp-1) 0; padding-left: var(--sp-4); display: grid; gap: var(--sp-1); max-height: 16rem; overflow: auto; }
.rule-examples mark, .change-diff mark { background: var(--c-accent-soft); color: inherit; }
.effects-list { max-height: 18rem; overflow: auto; border: 1px solid var(--c-line); border-radius: var(--r-md); }
.effects-table, .perm-matrix { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.effects-table th, .effects-table td, .perm-matrix th, .perm-matrix td { text-align: left; vertical-align: top; padding: var(--sp-1) var(--sp-2); border-bottom: 1px solid var(--c-line); }
.string-changes { border: 1px solid var(--c-warn-line); border-radius: var(--r-md); padding: var(--sp-2) var(--sp-3); margin-bottom: var(--sp-4); }
.change-list > li.checked { opacity: .75; }
.change-diff { margin-top: 3px; overflow-wrap: anywhere; }
.term-typo { border-left: 3px solid var(--c-warn); padding-left: var(--sp-2); margin: var(--sp-2) 0; display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: baseline; }
.term-typo .term-actions { margin-top: 0; }
.term-line-candidate { border-left: 3px solid var(--c-warn); padding-left: var(--sp-2); margin: 3px 0; }
.scientific-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: var(--sp-2); margin-top: var(--sp-1); }
.proposal-banner { border: 1px solid var(--c-info-line); background: var(--c-info-bg); border-radius: var(--r-md); padding: var(--sp-2) var(--sp-3); margin-bottom: var(--sp-3); display: grid; gap: 3px; }
.candidates-panel { margin-bottom: var(--sp-4); padding: var(--sp-2) var(--sp-3); }
.candidates-panel summary { cursor: pointer; }
.candidates-row .mud-select { min-width: 260px; max-width: 420px; }
.proposal { border: 1px solid var(--c-line); border-radius: var(--r-md); padding: var(--sp-2) var(--sp-3); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--sp-2) var(--sp-3); }
.proposal.open { border-color: var(--c-accent); }
.proposal-meta { display: flex; flex-wrap: wrap; gap: var(--sp-1); align-items: baseline; margin-top: 2px; }
.proposal-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: start; justify-content: flex-end; }
.proposal-details > p { margin: 0 0 var(--sp-2); }
.proposal-reason { color: var(--c-err-fg); }
.similar-list { margin: var(--sp-1) 0; padding-left: var(--sp-4); }
.comment-list { list-style: none; margin: var(--sp-1) 0; padding: 0; display: grid; gap: var(--sp-2); }
.comment-form { display: grid; gap: var(--sp-2); max-width: 48rem; }
.comment-form .mud-button-root { justify-self: start; }
@media (max-width: 799.98px) {
    .rule-form, .scientific-row { grid-template-columns: minmax(0, 1fr); }
    .proposal { grid-template-columns: minmax(0, 1fr); }
    .proposal-actions { justify-content: flex-start; }
    .effects-table thead { display: none; }
    .effects-table, .effects-table tbody, .effects-table tr, .effects-table td { display: block; }
}

/* Tags (docs/ui.md#tagi, D-069): the colour is a marker beside the path (dot and edge), the text keeps the theme colours (4.5:1). */
.tag-color-grey { --tag-c: #8C8378; }
.tag-color-red { --tag-c: #E0604E; }
.tag-color-orange { --tag-c: #E08A3C; }
.tag-color-yellow { --tag-c: #D6B43C; }
.tag-color-green { --tag-c: #5DAA62; }
.tag-color-teal { --tag-c: #3FA7A0; }
.tag-color-blue { --tag-c: #5B8FD9; }
.tag-color-purple { --tag-c: #A274D6; }
/* U-17 (K-020, D-773): the light theme has darker tag colours, so a dot and the edge of a chip keep at least 3:1 on its background (4.7–5.3:1). */
html[data-theme=light] .tag-color-grey { --tag-c: #6E665C; }
html[data-theme=light] .tag-color-red { --tag-c: #B83A2A; }
html[data-theme=light] .tag-color-orange { --tag-c: #A65A16; }
html[data-theme=light] .tag-color-yellow { --tag-c: #8A6A0C; }
html[data-theme=light] .tag-color-green { --tag-c: #2F7A36; }
html[data-theme=light] .tag-color-teal { --tag-c: #1F7A73; }
html[data-theme=light] .tag-color-blue { --tag-c: #2F6DB8; }
html[data-theme=light] .tag-color-purple { --tag-c: #7E4FB5; }
.tag-dot { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; background: var(--tag-c, var(--c-line-2)); flex: none; vertical-align: middle; }
.tag-chip { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; font-size: var(--fs-xs); border: 1px solid var(--c-line-2); border-left: 4px solid var(--tag-c, var(--c-line-2));
    border-radius: var(--r-sm); background: var(--c-hover); padding: 0 2px 0 var(--sp-2); line-height: 1.5; }
.tag-chip a, .tag-chip > span { color: var(--c-text); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag-chip a:hover, .tag-chip a:focus-visible { text-decoration: underline; }
.tag-chip.small { font-size: var(--fs-xs); line-height: 1.35; }
.item-tags, .string-tags { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1); margin-top: 2px; }
.string-tags { margin: 0 0 var(--sp-1); }
.string-tags .tag-picker { min-width: 14rem; max-width: 22rem; }
.add-tag { text-transform: none; }

.tag-query { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--sp-1); width: 100%; }
.tag-query .mud-input-control { flex: 1 1 16rem; }

.tag-node { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); width: 100%; }
.tag-node-name { font-weight: 600; }

.proposal-group { margin-bottom: var(--sp-3); }
.proposal-keys { list-style: none; margin: var(--sp-2) 0 0; padding: 0; display: grid; gap: var(--sp-1); }
.proposal-text { color: var(--c-text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40rem; }
.view-scope-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); font-size: var(--fs-meta); padding: var(--sp-1) var(--sp-2); border: 1px solid var(--c-line-2); border-radius: var(--r-sm); background: var(--c-hover); }

/* Where the search found a result (docs/glossary.md#wyszukiwanie). */

/* Spelling (docs/glossary.md#sprawdzanie-pisowni): unknown words with suggestions under the QA warning. */
.spelling-words { list-style: none; margin: -2px 0 var(--sp-1) var(--sp-6); padding: 0; display: grid; gap: 3px; }
.spelling-words li { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1); font-size: var(--fs-meta); }
.spelling-word { font-weight: 600; text-decoration: underline wavy var(--c-err); text-underline-offset: 3px; }
.spelling-add { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.spelling-add .mud-input-control { flex: 1 1 14rem; }

/* ---------- Phase 12: context notes and images (docs/ui.md#kolumna-pomocy, #obrazy, #obraz, #termin) ---------- */
.pre-wrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.context-note { display: grid; gap: var(--sp-1); padding: var(--sp-1) 0; border-bottom: 1px solid var(--c-line); }
.context-note:last-of-type { border-bottom: 0; }
.context-note-head, .bell-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); }
.context-note-label { font-size: var(--fs-xs); font-weight: 600; color: var(--c-muted); text-transform: none; }
.context-note-text { margin: 0; font-size: var(--fs-sm); }
.context-note-state { min-height: 1.2rem; display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.context-note-error { color: var(--c-err); }
.context-earlier { margin: 0; color: var(--c-warn); }
.context-conflict { border: 1px solid var(--c-warn); border-radius: var(--r-md); padding: var(--sp-2) var(--sp-2); display: grid; gap: var(--sp-1); }
.context-media { margin: var(--sp-2) 0 0; display: grid; gap: var(--sp-1); }
.context-media figcaption { color: var(--c-text-2); }
.context-media-group { color: var(--c-muted); }
.context-media-group a { color: var(--c-link); }
.context-edit { margin-left: auto; color: var(--c-link); }
.context-thumb { display: block; padding: 0; border: 1px solid var(--c-line-2); border-radius: var(--r-md); background: var(--c-sunken); cursor: zoom-in; max-width: 100%; overflow: hidden; }
.context-thumb:hover, .context-thumb:focus-visible { border-color: var(--c-accent); }
.context-thumb img { display: block; max-width: 100%; max-height: 240px; width: auto; height: auto; margin: 0 auto; object-fit: contain; }
.context-note .link-button { justify-self: start; }
.context-actions { margin-top: var(--sp-2); }
.context-empty { margin: var(--sp-1) 0 0; }
.context-history-before { color: var(--c-text-2); }
.media-viewer-content { display: grid; grid-template-rows: minmax(0, 1fr) auto; height: calc(100vh - 140px); }
.media-viewer-stage { overflow: auto; display: grid; place-items: center; background: var(--c-sunken); border-radius: var(--r-md); touch-action: pinch-zoom pan-x pan-y; min-height: 0; }
.media-viewer-stage:focus-visible { outline: 2px solid var(--c-accent); }
.media-viewer-stage.fit img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.media-viewer-stage.full { place-items: start; }
.media-viewer-stage.full img { max-width: none; max-height: none; }
.media-viewer-alt { margin: var(--sp-2) 0 0; }
.media-viewer-title, .construction-example { display: inline-flex; gap: var(--sp-2); align-items: baseline; }
.media-drop { position: relative; display: grid; place-items: center; gap: var(--sp-1); min-height: 140px; padding: var(--sp-3); border: 2px dashed var(--c-line-2); border-radius: var(--r-lg);
    background: var(--c-sunken); color: var(--c-text-2); text-align: center; cursor: pointer; margin-bottom: var(--sp-1); }
.media-drop.dragging, .media-drop:focus-within { border-color: var(--c-accent); }
.media-drop-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.media-drop-preview { max-width: 100%; max-height: 200px; border-radius: var(--r-sm); }
.media-upload-existing { display: flex; gap: var(--sp-3); align-items: flex-start; }
.media-upload-existing img { max-width: 160px; max-height: 120px; border-radius: var(--r-sm); border: 1px solid var(--c-line-2); }
.media-grid { list-style: none; margin: var(--sp-2) 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--sp-3); }
.media-tile { display: grid; gap: var(--sp-1); align-content: start; border: 1px solid var(--c-line); border-radius: var(--r-lg); padding: var(--sp-2); background: var(--c-surface); min-height: 160px; }
.media-tile a { display: grid; gap: var(--sp-1); color: var(--c-heading); text-decoration: none; }
.media-tile a:hover .media-tile-text, .media-tile a:focus-visible .media-tile-text { text-decoration: underline; }
.media-tile img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: contain; background: var(--c-sunken); border-radius: var(--r-sm); }
.media-tile-text { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: var(--fs-sm); }
/* The texts and links take at least 320 px beside the preview, otherwise they go under it (D-522: a fixed 260–420 px preview left them 108 px). */
.media-page, .field-row-auto { display: flex; flex-wrap: wrap; gap: var(--sp-4); align-items: flex-start; }
.media-page-preview { display: grid; gap: var(--sp-2); flex: 0 1 420px; min-width: min(100%, 260px); }
.media-page-main { flex: 1 1 320px; min-width: 0; }
.media-page-preview .context-thumb img { max-height: 360px; }
.media-meta { display: grid; grid-template-columns: max-content 1fr; gap: 3px var(--sp-3); margin: 0; }
.media-meta dt { color: var(--c-muted); }
.media-meta dd { margin: 0; }
.media-links { list-style: none; margin: var(--sp-1) 0 var(--sp-2); padding: 0; display: grid; gap: var(--sp-1); }
.media-links a { color: var(--c-link); }
.media-add-link { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: flex-start; }
.media-link-kind { max-width: 11rem; }
.media-link-search { flex: 1 1 18rem; }
/* U3-38 (D-858): the images of a thing — a grid of thumbnails that fills its column, the figure twice as wide, captions in two lines. */
.media-grid { list-style: none; margin: var(--sp-1) 0 var(--sp-2); padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: var(--sp-3); }
.media-grid li { display: grid; gap: var(--sp-1); align-content: start; min-width: 0; }
.media-grid .context-thumb { width: 100%; aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; }
.media-grid .context-thumb img { max-width: 100%; max-height: 100%; }
.media-grid .media-grid-figure { grid-column: span 2; }
.media-grid-caption { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
@media (max-width: 800px) {
    .media-page-preview { flex-basis: 100%; }
    .media-viewer-content { height: calc(100vh - 120px); }
}
/* Loading: skeletons in the shape of the content. */
.skeleton { background: var(--c-sunken); border-radius: var(--r-lg); min-height: 160px; }
/* Settings pages (docs/ui.md#ustawienia-projektu): read-only facts and a narrow number field. */
.facts { display: grid; grid-template-columns: fit-content(45%) minmax(0, 1fr); gap: var(--sp-1) var(--sp-4); margin: 0 0 var(--sp-3); }
.facts dt { color: var(--c-text-2); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 600px) {
    .facts { grid-template-columns: minmax(0, 1fr); }
    .facts dt:not(:first-child) { margin-top: var(--sp-2); }
}
.review-target { max-width: 280px; }
/* Disputes (docs/ui.md#spory, phase 13B): the flag next to the status, the banner of the editor, states with a shape and a text, the tab "Spór". */
.dispute-flag { display: inline-flex; align-items: center; gap: 3px; color: var(--c-err); font-weight: 600; font-size: var(--fs-meta); }
.dispute-bar { border-left-color: var(--c-err); }
.dispute-mark { color: var(--c-err); }
.dispute-state { display: inline-flex; align-items: center; gap: 3px; font-size: var(--fs-meta); font-weight: 600; }
.dispute-open, .dispute-confirmed { color: var(--c-err); }
.dispute-escalated { color: var(--c-warn); }
.dispute-rejected { color: var(--c-ok); }
.dispute-withdrawn { color: var(--c-text-2); }
.dispute-panel .facts dd { overflow-wrap: anywhere; }
.disputed-text { white-space: pre-wrap; overflow-wrap: anywhere; }
blockquote.disputed-text { margin: 0 0 var(--sp-3); padding: var(--sp-2) var(--sp-2); border-left: 3px solid var(--c-err-line); background: var(--c-sunken); border-radius: var(--r-sm); }
.dispute-votes, .dispute-reports, .reputation-events, .group-thresholds { margin: 0 0 var(--sp-2); padding-left: var(--sp-4); }
.dispute-reports li { margin-bottom: var(--sp-2); }
.report-verdict { margin-left: var(--sp-2); color: var(--c-text-2); }
.report-reason { white-space: pre-wrap; overflow-wrap: anywhere; }
.dispute-vote { flex-wrap: wrap; gap: var(--sp-2); margin: var(--sp-2) 0; }
.resolve-form { margin-top: var(--sp-2); padding: var(--sp-2) var(--sp-3); border: 1px solid var(--c-line); border-radius: var(--r-md); }
.policy-row, .slot-row, .selector-fields { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--sp-3); }
.policy-row > .mud-input-control { flex: 1 1 270px; max-width: 340px; } /* room for the whole label, no ellipsis (D-104) */
.awaits-vote { margin-left: var(--sp-1); }

/* ---------- Design system: shared component patterns (docs/ui.md#system-wyglądu, D-101) ---------- */
body { font-family: var(--font-ui); }
/* Focus: one ring for every control; fields show the accent border instead. MudBlazor's reset (button:focus, a:focus-visible) outranks a bare
   :focus-visible, so buttons and links name their element (D-403). Specific rules below may still move the ring or draw it otherwise. */
:focus-visible, button:focus-visible, a:focus-visible { outline: var(--focus-width) solid var(--c-focus); outline-offset: var(--focus-offset); }
/* Links (docs/ui.md#odnośniki, D-300): every text link in the content, a dialog or a panel has the link colour and is underlined on hover and focus,
   so a name in a table reads as clickable. Zero specificity (:where), so a pattern that makes a whole card or row a link (.next-card, .local-nav,
   .search-option, a tag) keeps its own colour; MudBlazor elements (buttons, menu items, breadcrumbs) keep theirs. Green never means a link. */
:where(.page, .mud-dialog, .mud-popover, .help-drawer) a:where(:not([class*="mud-"])) { color: var(--c-link); text-decoration: none; }
:where(.page, .mud-dialog, .mud-popover, .help-drawer) a:where(:not([class*="mud-"])):hover,
:where(.page, .mud-dialog, .mud-popover, .help-drawer) a:where(:not([class*="mud-"])):focus-visible { text-decoration: underline; text-underline-offset: 2px; }

/* Buttons: one filled primary per area, approval filled success, outlined secondary, text tertiary. Heights 36, 32 in bars and dense
   rows, 44 on the phone. A disabled button stays visible: transparent, a border and faint text, the cursor says not allowed. */
.mud-button-root.mud-button { min-height: var(--btn-h); }
.mud-button-root.mud-button-filled-size-small, .mud-button-root.mud-button-outlined-size-small, .mud-button-root.mud-button-text-size-small { min-height: var(--btn-h-dense); }
.mud-button-root.mud-button { font-size: var(--fs-sm); }
.mud-button-outlined:not(:disabled) { border-color: var(--c-line-input); }
.mud-button-outlined.mud-button-outlined-primary:not(:disabled) { border-color: var(--mud-palette-primary); }
.mud-button-outlined.mud-button-outlined-error:not(:disabled) { border-color: var(--mud-palette-error); }
.mud-button-outlined.mud-button-outlined-success:not(:disabled) { border-color: var(--mud-palette-success); }
.mud-button-filled { box-shadow: none !important; }
.mud-button-root:disabled { pointer-events: auto; cursor: not-allowed; color: var(--c-disabled-fg) !important; }
.mud-button-filled:disabled, .mud-button-filled:disabled:hover { background-color: transparent !important; border: 1px dashed var(--c-disabled-line); }
.mud-button-outlined:disabled { border: 1px dashed var(--c-disabled-line); }
.mud-button-root:disabled:hover { background-color: transparent !important; }
.mud-icon-button:disabled { pointer-events: auto; cursor: not-allowed; }
/* Targets: at least 24 px everywhere, 44 px on the phone. */
.mud-icon-button { min-width: var(--target-min); min-height: var(--target-min); }
.layout-phone .mud-button-root.mud-button, .layout-phone .page .mud-icon-button:not(.mud-switch-base) { min-height: var(--btn-h-touch); }
.layout-phone .page .mud-icon-button:not(.mud-switch-base) { min-width: var(--btn-h-touch); }

/* Fields: outlined and dense everywhere; helper text 12–13 px; a label above groups of radio buttons and check boxes. */
.mud-input-helper-text { font-size: var(--fs-xs); line-height: 1.35; }
.mud-input .mud-input-root::placeholder, .translation-input::placeholder, .global-search input::placeholder { color: var(--c-faint); opacity: 1; }
.mud-input-control > .mud-input-control-helper-container { padding-inline: var(--sp-1); }
/* D-843: a dense field keeps MudBlazor's 8 px above it, the room of its label on the border, but not the 4 px under it, which added to the gap of
   every stack (16 + 4 = 20 px, 24 + 4 = 28 px between fields). */
.mud-input-control.mud-input-control-margin-dense, .mud-input-control.mud-input-control-margin-dense.mud-input-outlined-with-label { margin-bottom: 0; }
.field-group { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: var(--sp-1); }
.field-group > legend, .field-group-label { padding: 0; margin-bottom: var(--sp-1); font-size: var(--fs-sm); font-weight: 600; color: var(--c-text-2); }
.form-stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-4); min-width: 0; }
.mud-switch-span .mud-switch-track { background-color: var(--c-switch-track); opacity: 1; }
.mud-switch-base.mud-checked + .mud-switch-track { background-color: var(--mud-palette-primary); opacity: .55; }

/* Save bar: one per form, sticky at the bottom of the viewport while the form has changes; it says "Niezapisane zmiany" or
   "Zapisano 12:04" and holds the only Zapisz (with Odrzuć zmiany). */
.save-bar { position: sticky; bottom: 0; z-index: 4; display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3);
    margin-top: var(--sp-5); padding: var(--sp-3) var(--sp-4); background: var(--c-surface-2); border: 1px solid var(--c-line-2); border-radius: var(--r-lg); }
.save-bar:not(.dirty) { position: static; }
.save-bar.dirty { border-color: var(--c-warn-line); box-shadow: var(--shadow-popover); }
.save-bar-state { margin-right: auto; display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); font-size: var(--fs-sm); color: var(--c-text-2); min-width: 0; }
.save-bar.dirty .save-bar-state { color: var(--c-warn); }
.save-bar-fields { color: var(--c-text-2); }
.save-bar-blocked, .save-bar-error { flex-basis: 100%; color: var(--c-err); }

/* The working version (D-526): its question "switch or stay" on the project page and in Decyzje źródeł, the version in the header, its history. */
.working-offer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-3) var(--sp-5); margin-bottom: var(--sp-4);
    padding: var(--sp-4) var(--sp-5); border: 1px solid var(--c-line-2); border-left: 4px solid var(--c-info); border-radius: var(--r-md); background: var(--c-surface); }
.working-offer-text { flex: 1 1 22rem; min-width: 0; }
.working-offer-project { display: inline-block; margin-bottom: var(--sp-1); font-size: var(--fs-sm); }
.working-offer-title { margin: 0 0 var(--sp-2); font-size: var(--fs-md); font-weight: 600; }
.working-offer-versions { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--sp-1) var(--sp-3); margin: 0; font-size: var(--fs-sm); }
.working-offer-versions dt { color: var(--c-text-2); }
.working-offer-versions dd { margin: 0; overflow-wrap: anywhere; }
.working-history summary { cursor: pointer; font-size: var(--fs-sm); }
.working-history-list { display: grid; gap: var(--sp-2); margin: var(--sp-2) 0 0; padding: 0; list-style: none; }
.working-history-list li { display: grid; }
.layout-phone .save-bar { margin-inline: calc(-1 * var(--sp-3)); border-radius: 0; }

/* Dialogs: S 444, M 600 (default), L 960; one column; title 18; content 24; footer [Anuluj][main]; full screen under 600 px. */
.mud-dialog { border: 1px solid var(--c-line-2); border-radius: var(--r-lg); box-shadow: var(--shadow-dialog); background-color: var(--c-surface); }
.mud-dialog .mud-dialog-title { font-size: var(--fs-lg); font-weight: 600; line-height: 1.44; padding: var(--sp-4) calc(var(--sp-5) + 40px) var(--sp-2) var(--sp-5); }
.mud-dialog .mud-dialog-title .mud-typography { font-size: inherit; font-weight: inherit; line-height: inherit; }
.mud-dialog .mud-dialog-content { padding: var(--sp-2) var(--sp-5) var(--sp-4); }
.mud-dialog .mud-dialog-actions { padding: var(--sp-3) var(--sp-5) var(--sp-4); gap: var(--sp-2); flex-wrap: wrap; }
.mud-dialog .mud-button-close { top: var(--sp-2); right: var(--sp-2); }
.dialog-body { display: grid; gap: var(--sp-4); min-width: 0; }
@media (max-width: 599.98px) {
    .mud-dialog-container .mud-dialog:not(.mud-dialog-fullscreen) { max-width: 100% !important; width: 100%; max-height: 100%; height: 100%; margin: 0; border-radius: 0; border: 0; }
    .mud-dialog .mud-dialog-content { flex: 1 1 auto; }
    .mud-dialog .mud-dialog-actions .mud-button-root { min-height: var(--btn-h-touch); }
}

/* Menus: verbs, "…" for dialog openers, groups with dividers, destructive last in red, a disabled item says why, the current choice ✓. */
.mud-popover .mud-list, .mud-popover.mud-paper { border-radius: var(--r-lg); }
.mud-popover-open.mud-paper:not(.mud-popover-fixed) { box-shadow: var(--shadow-popover); }
.mud-menu-list .mud-menu-item { min-height: 36px; font-size: var(--fs-sm); }
.mud-menu-list .mud-divider { margin: var(--sp-1) 0; }
.mud-menu-item.menu-danger, .mud-menu-item.menu-danger .mud-icon-root { color: var(--c-err); }
.mud-menu-item.mud-disabled { cursor: not-allowed; }
.menu-check { margin-left: auto; padding-left: var(--sp-4); color: var(--c-accent); font-weight: 700; }
/* U3-35 (D-855): the title of a group of a menu (Administracja in the account menu), in the size of the metadata, not an item. */
.menu-heading { padding: var(--sp-2) var(--sp-4) var(--sp-1); font-size: var(--fs-meta); color: var(--c-text-2); text-transform: none; }
.menu-item-body, .tags-tree .tag-node { display: flex; align-items: center; gap: var(--sp-2); width: 100%; }

/* Status badge (shape + colour + text, radius 4, 12 px, 22 high) and tag chip (colour dot). */
.status { border-radius: var(--r-sm); min-height: 22px; font-size: var(--fs-xs); padding: 0 var(--sp-2); }
.tag-chip { font-size: var(--fs-xs); }

.dialog-body > p, .dialog-body > blockquote, .dialog-body > ul { margin: 0; }
/* The game version tree (U-G, docs/ui.md#zgodność-z-grą, D-104): our tokens, not the look of ModDB. */
.gv-tree-wrap { display: grid; gap: var(--sp-2); }
.gv-summary { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-2); padding: var(--sp-2) var(--sp-3); background: var(--c-panel); border: 1px solid var(--c-line-2);
    border-radius: var(--r-md); font-size: var(--fs-sm); }
.gv-summary-label { color: var(--c-text-2); }
.gv-summary-value { font-weight: 600; font-variant-numeric: tabular-nums; }
.gv-tree { list-style: none; margin: 0; padding: var(--sp-1); max-height: min(52vh, 480px); overflow-y: auto; border: 1px solid var(--c-line-input); border-radius: var(--r-md); }
.gv-item { display: flex; align-items: center; gap: var(--sp-2); min-height: 32px; padding: 0 var(--sp-2) 0 calc(var(--sp-2) + (var(--gv-level) - 1) * 20px);
    border-radius: var(--r-sm); cursor: pointer; user-select: none; }
.gv-item:hover { background: var(--c-hover, rgb(255 255 255 / .04)); }
.gv-item:focus-visible { outline: var(--focus-width) solid var(--c-focus); outline-offset: -2px; }
.gv-branch > .gv-label { font-weight: 600; }
.gv-toggle { display: inline-grid; place-items: center; width: 24px; height: 24px; flex: none; color: var(--c-text-2); }
.gv-check { display: inline-grid; place-items: center; width: 18px; height: 18px; flex: none; border: 2px solid var(--c-line-input); border-radius: var(--r-sm);
    font-size: var(--fs-meta); font-weight: 700; line-height: 1; color: var(--mud-palette-primary-text); }
.gv-on > .gv-check { background: var(--c-accent); border-color: var(--c-accent); }
.gv-label { font-variant-numeric: tabular-nums; }
.gv-count { margin-left: auto; color: var(--c-faint); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
/* F-099 (D-740): a mod already in the workbench cannot be chosen, but the link to its project in that disabled row still takes the click. */
.moddb-results .mud-list-item-disabled a { pointer-events: auto; }
.compat-moddb { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1); color: var(--c-text-2); }
.compat-other { display: flex; align-items: flex-start; gap: var(--sp-2); }
.compat-other .mud-input-control { flex: 1 1 auto; }
.compat-other .mud-button-root { margin-top: var(--sp-2); }
/* A list of check boxes in a dialog (group picker) stays one compact group inside the 16 px rhythm. */
.dialog-body > .mud-input-control-boolean-input + .mud-input-control-boolean-input { margin-top: calc(-1 * var(--sp-4)); }
/* docs/ui.md#wybór-z-wyszukiwaniem (D-527): the searchable picker. A group header ("Gra", "Mody", "Linia 1.22") is an inert item that reads as a
   label, not as an unavailable choice; the second line is metadata; hints under the list say why it is empty or shortened. */
.search-picker, .construction-choice-main, .consistency-source { display: grid; gap: var(--sp-2); min-width: 0; }
.search-picker-popover .mud-list-item:has(.search-picker-group) { opacity: 1; cursor: default; min-height: 28px; padding-top: var(--sp-2);
    border-top: 1px solid var(--c-line); }
.search-picker-popover .mud-list-item:first-child:has(.search-picker-group) { border-top: 0; }
/* F-246: "no choice" ("Wszystkie projekty") stays at the top of the list, also when the list opens scrolled to the chosen project. */
.search-picker-popover .mud-list-item:has(.search-picker-none) { position: sticky; top: 0; z-index: 1; background: var(--c-surface); border-bottom: 1px solid var(--c-line); }
.search-picker-group { font-size: var(--fs-xs); font-weight: 600; color: var(--c-text-2); }
.search-picker-option, .row-title, .string-item .item-body { display: grid; gap: 2px; min-width: 0; }
.search-picker-main { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; min-width: 0; }
.search-picker-text { overflow-wrap: anywhere; }
.search-picker-secondary { font-size: var(--fs-meta); color: var(--c-text-2); overflow-wrap: anywhere; }
.search-picker-check { color: var(--c-accent); }
.search-picker-hint { padding: var(--sp-2) var(--sp-4); font-size: var(--fs-meta); color: var(--c-text-2); }
.search-picker-chosen { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.search-picker-chip { display: inline-flex; align-items: center; gap: var(--sp-1); padding-left: var(--sp-2); border: 1px solid var(--c-line-2);
    border-radius: var(--r-sm); font-size: var(--fs-sm); }

/* ---------- Lists and filters (docs/ui.md#pasek-listy-i-panel-filtry, D-102) ---------- */
/* Row 1: search, "Filtry (n)", "Sortuj: …"; row 2: chips, "Wyczyść wszystko", "Zapisz widok" and the count in a reserved place. */
.list-toolbar { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-2); margin-bottom: var(--sp-3); }
/* U3-41 (D-874): the one track of the bar is its column, never the width of its longest chip; a long chip ends in an ellipsis, the controls wrap. */
.list-toolbar-row > *, .list-toolbar-status > * { min-width: 0; max-width: 100%; }
.list-toolbar .sort-menu, .list-toolbar .sort-button { max-width: 100%; }
.sort-button .mud-button-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-toolbar-row > .list-search { flex: 1 1 260px; max-width: 560px; }
.list-toolbar--column { margin-bottom: 0; }
.list-toolbar--column .list-toolbar-row > .list-search { flex-basis: 100%; max-width: none; }
.filter-anchor { position: relative; display: inline-flex; }
.list-toolbar .sort-menu { margin-left: auto; }
.sort-button .sort-label { color: var(--c-text-2); font-weight: 400; }
.sort-button .sort-value { font-weight: 600; }
.list-toolbar-status { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-3); min-height: 28px; }
.list-toolbar-status .filter-chips { flex: 1 1 auto; min-width: 0; }
.list-toolbar-status .list-count { padding: 0; margin-left: auto; min-height: 24px; gap: var(--sp-2); justify-content: flex-end; color: var(--c-text-2); }
.filter-chip.include { border-color: var(--c-accent); }
.filter-chip.exclude { border-color: var(--c-err); }

/* The panel Filtry: a 360 px popover under the button, a full-screen sheet on the phone. */
.filter-panel-popover { width: 360px; max-width: calc(100vw - 16px); border: 1px solid var(--c-line-2); border-radius: var(--r-lg); background: var(--c-surface-2) !important; }
.filter-panel { display: flex; flex-direction: column; max-height: min(80vh, 760px); }
.filter-panel-head { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-3) var(--sp-3) var(--sp-2) var(--sp-4); border-bottom: 1px solid var(--c-line); }
.filter-panel-close { margin-left: auto; }
.filter-legend { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-2); margin: 0; padding: var(--sp-2) var(--sp-4); color: var(--c-text-2); border-bottom: 1px solid var(--c-line); }
.filter-panel-body { overflow-y: auto; padding: var(--sp-2) var(--sp-2) var(--sp-3); display: grid; gap: var(--sp-4); align-content: start; }
.filter-section h3 { margin: 0 var(--sp-2) var(--sp-1); font-size: var(--fs-sm); font-weight: 600; display: flex; align-items: center; gap: var(--sp-1); }
.filter-section-desc, .filter-section-reason { margin: 0 var(--sp-2) var(--sp-2); }
.filter-section-reason { color: var(--c-text-2); border-left: 3px solid var(--c-line-input); padding: var(--sp-1) var(--sp-2); }
.filter-section.disabled h3 { color: var(--c-disabled-fg); }
/* A section with more than 15 values has its own search (docs/ui.md#wybór-z-wyszukiwaniem, D-527). */
.filter-section-search { box-sizing: border-box; width: calc(100% - 2 * var(--sp-2)); margin: 0 var(--sp-2) var(--sp-2); padding: var(--sp-1) var(--sp-2);
    min-height: var(--target-min); font: inherit; font-size: var(--fs-sm); color: var(--c-text); background: var(--c-surface);
    border: 1px solid var(--c-line-input); border-radius: var(--r-sm); }
.filter-section-search:focus-visible { outline: var(--focus-width) solid var(--c-focus); outline-offset: 0; }
.filter-section-note { margin: var(--sp-1) var(--sp-2) 0; }
.filter-option { display: flex; align-items: stretch; gap: 2px; padding-left: calc(var(--depth, 0) * 14px); }
.filter-option-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--sp-2); background: none; border: 1px solid transparent; border-radius: var(--r-md);
  color: var(--c-text); font: inherit; font-size: var(--fs-sm); text-align: left; padding: var(--sp-2) var(--sp-2); cursor: pointer; min-height: 36px; }
.filter-option-main:hover { background: var(--c-hover); }
.filter-option.include .filter-option-main { border-color: var(--c-accent); background: var(--c-accent-soft); }
.filter-option.exclude .filter-option-main { border-color: var(--c-err); background: var(--c-err-tint-soft); }
.filter-option.exclude .filter-option-label { text-decoration: line-through; }
.filter-option-text { flex: 1; min-width: 0; display: grid; gap: 1px; }
.filter-option-label { overflow-wrap: anywhere; }
.filter-option-desc { font-size: var(--fs-xs); color: var(--c-text-2); line-height: 1.35; }
.filter-option .count, .queue-category .count { font-size: var(--fs-xs); color: var(--c-text-2); font-variant-numeric: tabular-nums; }
.tri-badge { display: inline-flex; align-items: center; gap: 3px; flex: none; font-size: var(--fs-xs); font-weight: 600; border: 1px solid; border-radius: var(--r-sm); padding: 0 var(--sp-2); min-height: 20px; white-space: nowrap; }
.tri-badge.include { color: var(--c-accent-fg); border-color: var(--c-accent); background: var(--c-accent-soft); }
.tri-badge.exclude { color: var(--c-err-fg); border-color: var(--c-err); background: var(--c-err-bg); }
.filter-panel-foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); padding: var(--sp-2) var(--sp-3); border-top: 1px solid var(--c-line); }
.filter-panel-foot .spacer { flex: 1; }
.filter-panel-overlay { background: transparent !important; }
.tag-query-field { display: grid; gap: var(--sp-1); padding: 0 var(--sp-2); }
@media (max-width: 599.98px) {
  .filter-panel-popover { position: fixed !important; inset: 0 !important; width: 100vw !important; max-width: none; height: 100dvh; border-radius: 0; transform: none !important; z-index: 1400 !important; }
  .filter-panel { max-height: none; height: 100%; }
  .filter-option-main { min-height: 44px; }
}

/* String list rows (docs/ui.md#lista-ciągów): EN first, the translation under it, the key and the project as smaller metadata. */
.string-item { gap: var(--sp-2); padding: var(--sp-2) var(--sp-3); }
.item-body { display: grid; gap: 2px; }
.item-source, .string-item .item-source { color: var(--c-text); font-size: var(--fs-list); line-height: 1.4; }
.item-translation { font-size: var(--fs-list); line-height: 1.4; }
.item-key { font-size: var(--fs-mono); line-height: 1.35; margin-top: 2px; }
.list-text .tok { font-size: var(--fs-xs); font-weight: 600; }
.vtml-token { display: inline-block; font-family: var(--font-mono); font-size: 11px; line-height: 1.3; color: var(--c-faint); border: 1px solid var(--c-line-2);
  border-radius: var(--r-xs); padding: 0 3px; margin: 0 1px; vertical-align: 1px; }
/* Status shape of a row: an image (role img), not a control; 12 px, aligned with the first line. */
.status-mark { flex: none; width: 12px; height: 12px; margin-top: var(--sp-1); border-radius: 50%; position: relative; box-sizing: border-box; }
.status-mark.status-untranslated { border: 2px dashed var(--c-faint); }
.status-mark.status-translated { border: 3px solid var(--c-warn); }
.status-mark.status-approved { background: var(--c-ok); }
.status-mark.status-approved::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 9px; font-weight: 700; color: var(--c-bg); line-height: 1; }
.status-mark.needs-review::before { content: ""; position: absolute; right: -5px; bottom: -4px; width: 6px; height: 6px; background: var(--c-info); transform: rotate(45deg);
  border: 1px solid var(--c-panel); }

/* Review queue categories (docs/ui.md#do-recenzji): named buttons with counters, the zero ones under "Pozostałe". */
.queue-category { display: inline-flex; align-items: center; gap: var(--sp-1); background: var(--c-surface); border: 1px solid var(--c-line-input); border-radius: var(--r-sm);
  color: var(--c-text); font: inherit; font-size: var(--fs-meta); padding: 2px var(--sp-2); min-height: 28px; cursor: pointer; text-align: left; }
.queue-category:hover { border-color: var(--c-text-2); }
.queue-category.include { border-color: var(--c-accent); background: var(--c-accent-soft); color: var(--c-accent-fg); font-weight: 600; }
.queue-category.exclude { border-color: var(--c-err); }
.queue-category.exclude .queue-category-label { text-decoration: line-through; }
.queue-rest-button.mud-button-root { min-height: 28px; }
@media (max-width: 799.98px) { .queue-category { min-height: 44px; } }

/* Advanced search (docs/ui.md#wyszukiwanie-zaawansowane): builder beside the text query; stacked under 800 px. */
.advanced-columns { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: var(--sp-5); align-items: start; }
@media (max-width: 799.98px) { .advanced-columns { grid-template-columns: 1fr; } }
.advanced-heading { margin: 0 0 var(--sp-2); font-size: var(--fs-sm); font-weight: 600; }
.advanced-subheading { margin: var(--sp-3) 0 var(--sp-1); font-size: var(--fs-sm); font-weight: 600; }
.advanced-stale { color: var(--c-warn); margin: 0 0 var(--sp-2); }
.query-group { border: 1px solid var(--c-line-2); border-radius: var(--r-md); padding: var(--sp-2) var(--sp-3) var(--sp-3); margin: 0; display: grid; gap: var(--sp-2); min-width: 0; }
.query-group.depth-2 { background: var(--c-panel); }
.query-group.depth-3 { background: var(--c-surface); }
.query-group-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); padding: 0 var(--sp-1); font-size: var(--fs-meta); color: var(--c-text-2); }
.query-row { display: grid; grid-template-columns: minmax(110px, 1fr) minmax(120px, 1fr) minmax(140px, 1.6fr) auto; gap: var(--sp-2); align-items: start; }
.query-row > .query-field, .query-row > .query-operator, .query-row > .query-value { min-width: 0; }
.query-row > div > .mud-select, .query-row > div > .mud-input-control, .query-row > div > .search-picker { width: 100%; }
@media (max-width: 599.98px) {
  .query-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; }
  .query-row .query-field { grid-column: 1; grid-row: 1; } .query-row .query-operator { grid-column: 2; grid-row: 1; }
  .query-row .query-remove { grid-column: 3; grid-row: 1; } .query-row .query-value { grid-column: 1 / 3; grid-row: 2; }
}
.query-remove { margin-top: var(--sp-2); }
/* AND and OR told apart by colour and text (D-104): AND copper, OR blue; a rail on the group, a pill on a rule between rows, the toggle tinted. */
.query-group { --q-c: var(--c-accent); border-left: 4px solid var(--q-c); }
.query-group.query-or { --q-c: var(--c-info); }
.query-group .query-group { margin-left: var(--sp-3); }
.query-joiner { display: flex; align-items: center; gap: var(--sp-2); margin: 0; }
.query-joiner::before, .query-joiner::after { content: ""; flex: 1 1 auto; border-top: 1px solid var(--q-c); opacity: .6; }
.joiner-pill { flex: none; padding: 1px var(--sp-2); border: 1px solid var(--q-c); border-radius: var(--r-full); color: var(--q-c); background: var(--c-surface-2);
    font-size: var(--fs-xs); font-weight: 700; letter-spacing: .06em; }
.query-combine.combine-and .mud-button-filled { background: var(--c-accent); color: var(--mud-palette-primary-text); }
.query-combine.combine-or .mud-button-filled { background: var(--c-info); color: var(--c-bg); }
.query-combine.combine-or .mud-button-outlined { border-color: var(--c-info); }
.query-combine.combine-and .mud-button-outlined { border-color: var(--c-accent); }
.query-row { position: relative; }
.query-row-not { padding-left: var(--sp-2); border-left: 3px solid var(--c-err); }
.query-row-invalid .mud-input-outlined-border { border-color: var(--c-err) !important; }
.query-row-error { grid-column: 1 / -1; margin: 0; color: var(--c-err); }
.query-group-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.query-group-empty { margin: 0; }
.advanced-query textarea, .advanced-query .mud-input-slot { font-family: var(--font-mono) !important; font-size: var(--fs-mono) !important; font-weight: 400 !important; line-height: 1.5; }
.advanced-error { display: grid; gap: var(--sp-1); color: var(--c-err-fg); font-size: var(--fs-meta); margin-top: var(--sp-1); }
.query-error-view { margin: 0; padding: var(--sp-1) var(--sp-2); background: var(--c-sunken); border: 1px solid var(--c-err-line); border-radius: var(--r-sm); font-family: var(--font-mono);
  font-size: var(--fs-mono); color: var(--c-text); white-space: pre-wrap; overflow-wrap: anywhere; }
.query-error-view mark { background: var(--c-err-tint-strong); color: var(--c-text); text-decoration: underline wavy var(--c-err); border-radius: var(--r-xs); }
.advanced-example { width: 100%; display: grid; justify-items: start; gap: 2px; text-align: left; background: var(--c-surface); border: 1px solid var(--c-line-2); border-radius: var(--r-md); color: var(--c-text);
  font: inherit; font-size: var(--fs-meta); padding: var(--sp-1) var(--sp-2); cursor: pointer; }
.advanced-example { grid-template-columns: minmax(0, 1fr); justify-content: stretch; }
.advanced-example:hover, .advanced-example:focus-visible { border-color: var(--c-accent); }
.advanced-example code { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--c-text-2); overflow-wrap: anywhere; }
.advanced-count { margin-right: auto; padding-left: var(--sp-2); }

/* ---------- Progress (U-F, docs/ui.md#postęp, D-104): Weblate style, one thin bar of consecutive segments, each string counted once ---------- */
:root { --c-pg-approved: #5DBB7E; --c-pg-translated: #E2B04F; --c-pg-review: #6FAEE6; --c-pg-qa: #EE7462; }
/* U-F in the status colours (D-300): approved green ●, translated amber ○, to check blue ◆, QA errors red; solid segments (hatching was rejected, D-104).
   The light values keep 3:1 against the track and the surface. */
html[data-theme=light] { --c-pg-approved: #2A7349; --c-pg-translated: #B07A12; --c-pg-review: #2A65A0; --c-pg-qa: #B3261E; }
.progress-labels { display: flex; flex-wrap: wrap; gap: 0 var(--sp-4); font-size: var(--fs-sm); color: var(--c-text-2); }
.progress-labels strong { color: var(--c-text); font-variant-numeric: tabular-nums; }
.progress-compact .progress-labels { font-size: var(--fs-xs); gap: 0 var(--sp-3); }
.progress-bar { min-width: 80px; }
/* F-021 (D-703): on a phone the bar of a project card takes the width of the card, not more. */
@media (max-width: 599px) {
    .overview-projects .progress-bar { min-width: 0; max-width: 100%; }
    .overview-projects .progress-cell { min-width: 0; overflow-wrap: anywhere; }
    /* F-267: a project card on the phone: the name with its bar across the card, the four shares two by two under it. */
    .projects-table .mud-table-body tr.mud-table-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--sp-3); }
    .projects-table .mud-table-body td.progress-cell { grid-column: 1 / -1; display: block; min-width: 0; overflow-wrap: anywhere; }
    .projects-table .mud-table-body td.progress-cell::before { display: none; }
    .projects-table .progress-bar { min-width: 0; max-width: 100%; }
    .projects-table .mud-table-body td.num { padding-block: var(--sp-1); flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 0;
        text-align: left; border-bottom: 0; }
    .projects-table .mud-table-body td.num::before { font-size: var(--fs-xs); padding-right: 0; }
}
.progress-track { display: flex; height: 8px; border-radius: var(--r-full); overflow: hidden; background: var(--c-track); box-shadow: inset 0 0 0 1px var(--c-line-2); }
.progress-compact .progress-track { height: 6px; }
/* A 1 px surface gap between segments, inside each width, so nothing goes beyond 100%. Solid colours only, no hatching. */
.progress-track .seg { flex: none; height: 100%; box-shadow: inset -1px 0 0 var(--c-surface); }
.progress-track .seg.approved { background: var(--c-pg-approved); }
.progress-track .seg.translated { background: var(--c-pg-translated); }
.progress-track .seg.review { background: var(--c-pg-review); }
.progress-track .seg.qa { background: var(--c-pg-qa); }
.progress-legend, .progress-key { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-4); margin: 0; }
.progress-key { margin-bottom: var(--sp-2); color: var(--c-text-2); }
.legend-item { color: var(--c-text-2); text-decoration: none; display: inline-flex; align-items: center; gap: var(--sp-1); min-height: 24px; }
.legend-item strong { color: var(--c-text); font-weight: 600; font-variant-numeric: tabular-nums; }
.legend-item .legend-share { color: var(--c-faint); font-variant-numeric: tabular-nums; }
a.legend-item:hover { color: var(--c-text); text-decoration: underline; }
.legend-swatch { flex: none; display: inline-block; width: 12px; height: 8px; border-radius: var(--r-xs); }
.legend-swatch.sw-approved { background: var(--c-pg-approved); }
.legend-swatch.sw-translated { background: var(--c-pg-translated); }
.legend-swatch.sw-review { background: var(--c-pg-review); }
.legend-swatch.sw-qa { background: var(--c-pg-qa); }
.legend-swatch.sw-untranslated { background: var(--c-track); box-shadow: inset 0 0 0 1px var(--c-line-input); }
.legend-item .status-dot, .nav-progress .status-dot { margin-top: 0; }
.status-dot.status-review { background: var(--c-info); border-radius: var(--r-xs); transform: rotate(45deg); width: 8px; height: 8px; }
.status-dot.qa-mark { background: var(--c-err); border-radius: var(--r-xs); }
.progress-cell { min-width: 180px; }
.progress-cell .progress-head { margin-bottom: var(--sp-1); }
.fixed-table .col-share { width: 140px; }
/* F-240: the numbers of the overview table are short percentages; the project with its kind, version and count keeps the rest of the column. */
.overview-projects .col-share { width: 96px; }
.progress-share span { color: var(--c-text-2); }
.progress-share { display: inline-grid; justify-items: end; color: var(--c-text); text-decoration: none; font-variant-numeric: tabular-nums; }
a.progress-share:hover strong, a.progress-share:focus-visible strong { text-decoration: underline; }
.progress-ring { display: block; overflow: visible; }
.progress-ring circle { fill: none; stroke-width: 5; }
.progress-ring .ring-track { stroke: var(--c-track); }
.progress-ring .ring-approved { stroke: var(--c-pg-approved); }
.progress-ring .ring-translated { stroke: var(--c-pg-translated); }
.progress-ring .ring-review { stroke: var(--c-pg-review); }
.progress-ring .ring-qa { stroke: var(--c-pg-qa); }
.progress-ring .ring-value { fill: var(--c-text); font-size: 11px; font-weight: 700; font-family: inherit; }
.nav-progress-ring { display: grid; place-items: center; width: 44px; height: 44px; margin: var(--sp-3) auto var(--sp-2); border-radius: 50%; text-decoration: none; }
@media (forced-colors: active) {
    .progress-track .seg, .legend-swatch { forced-color-adjust: none; }
}

/* ---------- Phase 14B: version comparison, key history, historical proposals, bulk operations (docs/ui.md) ---------- */
.compare-pickers { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); margin-bottom: var(--sp-4); }
.compare-pickers .release-select { width: 280px; max-width: 100%; }
.compare-tabs { margin-bottom: var(--sp-3); }
.fixed-table .col-key { width: 280px; }
.compare-table .compare-key code { font-family: var(--font-mono); font-size: var(--fs-mono); overflow-wrap: anywhere; }
.compare-table .compare-text { font-size: var(--fs-md); overflow-wrap: anywhere; }
/* A tall row (a long EN difference) keeps the key and the translations at its top, beside the start of the text (docs/ui.md#porównanie-wersji). */
.compare-table .mud-table-body td.mud-table-cell { vertical-align: top; }
.compare-sides { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--sp-1) var(--sp-2); align-items: baseline; }
.compare-side-label { white-space: nowrap; }
/* The key history is the history graph (D-052); the dot says what happened to the key in that version. */
.key-history .key-added .history-dot { border-color: var(--c-ok); background: var(--c-ok); }
.key-history .key-changed .history-dot { border-color: var(--c-accent); background: var(--c-accent); }
.key-history .key-returned .history-dot { border-color: var(--c-info); background: var(--c-info); }
.key-history .key-split .history-dot { border-color: var(--c-info); background: var(--c-surface); }
.key-history .key-removed .history-dot, .key-history .key-gone .history-dot { border-color: var(--c-err); background: var(--c-panel); }
.key-history .key-current .history-head strong { color: var(--c-accent); }
.key-links { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-top: var(--sp-1); }
.historical-proposals { margin-top: var(--sp-3); border-top: 1px solid var(--c-line); padding-top: var(--sp-2); }
.historical-proposals > summary { cursor: pointer; font-size: var(--fs-sm); color: var(--c-text-2); }
.historical-source { margin-top: var(--sp-1); }
.bulk-operation { margin-top: var(--sp-1); }
.bulk-operation > summary { cursor: pointer; color: var(--c-text-2); }
/* The version and file rows of a project carry their meta under the name; narrower share columns leave it room at 1366 px. */
.releases-table .col-share, .files-table .col-share { width: 112px; }
.releases-table .col-compat { width: 200px; }
.compare-pickers > .mud-input-control, .compare-pickers > .mud-select, .compare-pickers > .search-picker { flex: 0 1 280px; min-width: 200px; }
.compare-text .status-mark { display: inline-block; margin: 0 var(--sp-1) 0 0; vertical-align: -1px; }

/* Naming rules (docs/ui.md#dane-gry-reguły-nazw, #reguła, #wykrywanie-reguł; phase 15A). */
.rule-state { display: inline-flex; align-items: center; gap: 3px; font-size: var(--fs-meta); font-weight: 600; white-space: nowrap; }
.rule-active { color: var(--c-ok); }
.rule-candidate { color: var(--c-info); }
.rule-rejected { color: var(--c-err); }
.rule-withdrawn { color: var(--c-text-2); }
.rule-decision { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-5); }
.rule-decision .action-row { margin-top: 0; }
.rule-roles { width: 100%; margin-bottom: var(--sp-3); }
.rule-conditions { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--sp-1) var(--sp-4); margin: 0; }
.rule-conditions dt { color: var(--c-text-2); }
.rule-conditions dd { margin: 0; overflow-wrap: anywhere; }
.rule-report, .rule-members { margin-top: var(--sp-5); }
.rule-report details { margin-top: var(--sp-3); }
.rule-report summary { cursor: pointer; }
.realization { border-top: 1px solid var(--c-line); padding: var(--sp-3) 0; }
.realization:first-of-type { border-top: 0; padding-top: 0; }
.realization-withdrawn { opacity: .75; }
.realization-pattern { font-size: var(--fs-md); }
.realization-samples { margin: var(--sp-2) 0 0; padding-left: var(--sp-4); }
.realization-form { margin-top: var(--sp-4); display: grid; gap: var(--sp-2); }
.subsection-title { font-size: var(--fs-md); font-weight: 600; margin: var(--sp-5) 0 var(--sp-1); }
.rule-members .tab-list { margin-bottom: 0; border-bottom: 0; }
.rule-matrix-wrap { overflow-x: auto; margin: var(--sp-3) 0; }
.rule-matrix { border-collapse: collapse; }
.rule-matrix thead th, .rule-matrix tbody th { color: var(--c-text-2); font-weight: 600; white-space: nowrap; }
.matrix-cell { display: inline-flex; align-items: baseline; gap: var(--sp-1); color: var(--c-text); text-decoration: none; }
.matrix-cell:hover, .matrix-cell:focus-visible { text-decoration: underline; }
.matrix-cell .status-mark { flex: none; }
@media (max-width: 599px) { .rule-matrix-wrap { display: none; } }
.rule-history > li { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: baseline; border-top: 1px solid var(--c-line); padding-top: var(--sp-2); }
.rule-history > li > div { flex-basis: 100%; }
.discovery-form { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); }
.discovery-form > .mud-input-control, .discovery-form > .mud-select, .discovery-form > .search-picker { flex: 1 1 220px; max-width: 360px; }
.rule-card { display: grid; gap: var(--sp-1); }
.rule-card + .rule-card { border-top: 1px solid var(--c-line); padding-top: var(--sp-2); margin-top: var(--sp-2); }
.rule-value + .rule-value::before { content: " · "; color: var(--c-faint); }
.rule-text { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-2); font-size: var(--fs-game); color: var(--c-translation); }
.split-line { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--sp-3); }
.rule-section { margin-top: var(--sp-5); }
.rule-roles th { text-align: left; }
.rule-member-table .status-mark, .matrix-cell .status-mark { display: inline-block; margin-right: var(--sp-1); vertical-align: -1px; }

/* Composition templates, asset data, the relation graph and simulations (docs/ui.md#szablony-składania, #graf-powiązań, #symulacje; phase 15B). */
.slot-editor { border: 1px solid var(--c-line); border-radius: var(--r-lg); padding: var(--sp-3) var(--sp-4); margin: 0 0 var(--sp-3); min-width: 0; display: grid; gap: var(--sp-2); }
.slot-editor legend { padding: 0 var(--sp-1); font-weight: 600; }
.slot-editor .section-heading { margin: var(--sp-1) 0 0; }
.slot-row > *, .selector-fields > * { flex: 1 1 220px; min-width: 0; }
.combination-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); margin: var(--sp-2) 0; }
.combination-toolbar > .mud-input-control, .combination-toolbar > .mud-select, .combination-toolbar > .search-picker { flex: 1 1 220px; max-width: 360px; }
.combinations-table td, .pattern-objects td, .asset-candidates td { overflow-wrap: anywhere; }
.slot-label { margin-right: var(--sp-1); color: var(--c-ph-fg); }
.qa-error { color: var(--c-err); }
.qa-warning { color: var(--c-warn); }
.qa-info { color: var(--c-text-2); }
.matching-result { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--sp-2) var(--sp-4); margin: var(--sp-3) 0; }
.matching-result dt { color: var(--c-text-2); }
.matching-result dd { margin: 0; overflow-wrap: anywhere; }
.plain-list { list-style: none; margin: var(--sp-1) 0; padding: 0; display: grid; gap: var(--sp-1); }
/* D-885: a session in one line that wraps: device, the mark of this browser, the details and Zakończ, apart from each other. */
.session-row { display: flex; flex-wrap: wrap; align-items: center; column-gap: var(--sp-2); row-gap: var(--sp-1); }
.session-device { font-weight: 600; }
.history-plain > li { border-top: 1px solid var(--c-line); padding-top: var(--sp-1); }
.links-panel section + section { margin-top: var(--sp-4); }
.mockup-inputs { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--sp-3); margin-bottom: var(--sp-3); }
.mockup-name { flex: 1 1 220px; max-width: 320px; }
.simulation-result { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--sp-3); margin-top: var(--sp-3); }
.graph-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.graph-toolbar .tab-list { margin: 0; }
.graph-project { flex: 0 1 320px; max-width: 320px; }
.term-forms-card { display: grid; gap: var(--sp-3); }
.term-forms-card > * { margin: 0; }
.term-forms-card .section-heading { margin-top: var(--sp-2); }
.graph-canvas { border: 1px solid var(--c-line); border-radius: var(--r-lg); background: var(--c-sunken); }
.graph-canvas svg { display: block; }
.graph-edge { stroke: var(--c-line-input); stroke-width: 1.5; fill: none; }
.graph-edge.candidate { stroke-dasharray: 5 4; stroke: var(--c-faint); }
.graph-edge.edge-rule-value, .graph-edge.edge-rule-member { stroke: var(--c-accent); }
.graph-edge.edge-term-in-text { stroke: var(--c-text-2); }
.graph-edge.edge-pattern-segment { stroke: var(--c-warn); }
.graph-edge.edge-template, .graph-edge.edge-template-argument { stroke: var(--c-info); }
.graph-edge.edge-simulation-step { stroke: var(--c-link); }
.graph-edge.candidate { stroke-dasharray: 5 4; }
.graph-node rect { fill: var(--c-surface); stroke: var(--c-line-2); }
.graph-node.candidate rect { stroke-dasharray: 4 3; }
.graph-node.node-term rect { stroke: var(--c-accent); stroke-width: 2; }
.graph-node.node-rule rect { stroke: var(--c-accent); }
.graph-node.node-composition rect, .graph-node.node-simulation rect { stroke: var(--c-info); }
.graph-node:hover rect, .graph-node:focus-visible rect { fill: var(--c-hover); stroke-width: 2; }
.graph-node.expandable { cursor: pointer; }
.graph-node.open rect { stroke-width: 2; }
.graph-toggle { fill: var(--c-accent); font-size: 16px; font-weight: 700; }
.graph-open rect { fill: var(--c-surface-2); stroke: var(--c-line-input); }
.graph-open text { fill: var(--c-link); font-size: 12px; }
.graph-open:hover rect, .graph-open:focus-visible rect { stroke: var(--c-link); stroke-width: 2; }
.graph-open:focus-visible { outline: none; }
.graph-node:focus-visible { outline: none; }
.graph-node:focus-visible rect { stroke: var(--c-link); stroke-width: 3; }
.graph-kind { fill: var(--c-text-2); font-size: 10px; }
.graph-label { fill: var(--c-text); font-size: 12px; font-family: var(--font-mono, monospace); }
.graph-legend { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-3); color: var(--c-text-2); }
.graph-legend .graph-edge { stroke-width: 3; }
.graph-legend-title { color: var(--c-text-2); margin-right: var(--sp-1); }
.graph-kind-toggle { display: inline-flex; align-items: center; gap: var(--sp-2); min-height: 32px; padding: 0 var(--sp-3); border: 1px solid var(--c-line-input); border-radius: var(--r-sm);
    background: none; color: var(--c-faint); font: inherit; font-size: var(--fs-sm); cursor: pointer; text-decoration: line-through; }
.graph-kind-toggle.on { color: var(--c-text); text-decoration: none; background: var(--c-surface-2); }
.graph-kind-toggle:not(.on) svg { opacity: .35; }
.graph-legend-lines { display: inline-flex; flex-wrap: wrap; gap: var(--sp-3); margin-left: var(--sp-3); }
.graph-count { margin: 0 0 var(--sp-2); }
.graph-row-expand { margin-left: var(--sp-3); }
.graph-more { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-3); }

/* Phase 16A: permissions, groups, managers, access log (docs/ui.md#uprawnienia, #grupa, #moje-grupy, #dziennik-dostępu). */
.group-page, .managed-layout { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: var(--sp-5); align-items: start; padding-bottom: var(--sp-7); }
.member-list, .inherited-list { margin: 0; padding-left: var(--sp-4); overflow-wrap: anywhere; }
.member-list li { margin-bottom: var(--sp-1); }
/* Invitations of Moje grupy (F-343): an entry is its name with the badge and a line under it; entries are 12 px apart, more than the 4 px inside
   one, so the line of groups and the date belongs to its own invitation, not to the next one. */
.managed-invitations { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--sp-3); overflow-wrap: anywhere; }
.managed-invitations li { row-gap: var(--sp-1); }
.managed-invitation-meta { flex-basis: 100%; }
.effective-category + .effective-category { margin-top: var(--sp-4); }
.effective-category-title { margin: 0 0 var(--sp-1); color: var(--c-text-2); font-weight: 600; }
.effective-row { display: grid; grid-template-columns: 170px minmax(0, 1fr) minmax(0, 260px); gap: var(--sp-3); padding: var(--sp-2) 0; border-top: 1px solid var(--c-line); align-items: baseline; }
.effective-row.blocked .effective-name strong { text-decoration: line-through; }
.effective-name { display: flex; flex-direction: column; }
.effective-effect { font-size: var(--fs-sm); }
.effect-active { color: var(--c-text); }
.effect-limited { color: var(--c-warn); }
.effect-blocked, .effect-deny { color: var(--c-err); }
.effective-source { color: var(--c-text-2); }
.matrix-scope { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; margin-bottom: var(--sp-2); }
.matrix-scope .mud-input-control { max-width: 260px; }
.matrix-wrap { overflow-x: auto; border: 1px solid var(--c-line-2); border-radius: var(--r-lg); background: var(--c-surface); }
.perm-matrix thead th { position: sticky; top: 0; background: var(--c-panel); font-weight: 600; white-space: nowrap; }
.perm-matrix .matrix-permission { min-width: 220px; position: sticky; left: 0; background: var(--c-surface); z-index: 1; }
.perm-matrix thead .matrix-permission { background: var(--c-panel); z-index: 2; }
.perm-matrix .matrix-help { display: block; font-weight: 400; }
.perm-matrix .matrix-category th { background: var(--c-panel); color: var(--c-text-2); font-size: var(--fs-meta); }
.pm-cell { min-width: 140px; }
.matrix-button { all: unset; box-sizing: border-box; display: block; width: 100%; min-height: var(--target-min); padding: var(--sp-1); border-radius: var(--r-sm); cursor: pointer; }
.matrix-button:focus-visible { outline: var(--focus-width) solid var(--c-focus); outline-offset: 1px; }
.matrix-button:hover { background: var(--c-surface-2); }
.cell-full .matrix-button { cursor: default; color: var(--c-text-2); }
.cell-allow .matrix-button { color: var(--c-text); font-weight: 600; }
.cell-deny .matrix-button { color: var(--c-err); font-weight: 600; }
.cell-inherited .matrix-button { color: var(--c-text); }
.cell-none .matrix-button { color: var(--c-faint); }
.access-change .access-before { color: var(--c-text-2); }
.access-change .access-after { color: var(--c-text); }
.access-log-person { min-width: 220px; max-width: 320px; }
/* Long items without spaces (e-mail addresses, Ustawienie=wartość of 16B) wrap instead of widening the page. */
/* F-189 (D-684): words wrap whole ("Administrator", "konto włączone"); only the change column, with keys and host lines, breaks anywhere. */
.data-table.access-log td.mud-table-cell { overflow-wrap: break-word; }
.data-table.access-log td.access-change { overflow-wrap: anywhere; }
@media (max-width: 600px) {
    .group-page, .managed-layout { grid-template-columns: minmax(0, 1fr); }
    .effective-row { grid-template-columns: minmax(0, 1fr); gap: 0; }
}

/* Administration → Dane gry i modów: the kinds of findings of a mod set analysis (docs/ui.md#dane-gry-i-modów). */
.realization-chips, .chip-row { display: flex; flex-wrap: wrap; gap: var(--sp-1); }

/* Value dictionaries (docs/ui.md#wartości-z-gry). */
.status-line { min-height: 1.75rem; }
.status-line:empty { min-height: 0; }
/* The text of a followed job and the link to its run (D-597). */
.job-tracker { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--sp-2); }
.field-row { display: flex; flex-wrap: wrap; gap: var(--sp-3); }
.field-row > * { flex: 1 1 14rem; }

.lexicon-adjectives { display: grid; gap: 2px; }
.lexicon-evidence { padding: var(--sp-2) var(--sp-4) var(--sp-3); background: var(--c-surface); }
.lexicon-evidence ul ul { margin: 2px 0 var(--sp-2) var(--sp-4); }
.certainty { display: inline-block; width: 1em; text-align: center; }
.certainty-high { color: var(--c-ok); }
.certainty-medium { color: var(--c-warn); }
.certainty-low { color: var(--c-faint); }
.lexicon-accept-table { max-height: 55vh; overflow: auto; }
.lexicon-accept-table table { width: 100%; border-collapse: collapse; }
.lexicon-accept-table th, .lexicon-accept-table td { padding: 2px var(--sp-1); text-align: left; vertical-align: top; min-width: 8rem; }
.lexicon-accept-table thead th { position: sticky; top: 0; background: var(--c-surface); z-index: 1; font-size: var(--fs-meta); }
/* C9 (D-546): on a narrow screen every value of the accept dialog is a card with its fields one under another, nothing off the screen. */
@media (max-width: 599.98px) {
    .lexicon-accept-table thead { display: none; }
    .lexicon-accept-table table, .lexicon-accept-table tbody, .lexicon-accept-table tr, .lexicon-accept-table th, .lexicon-accept-table td { display: block; width: 100%; min-width: 0; }
    .lexicon-accept-table tr { padding: var(--sp-2) 0; border-bottom: 1px solid var(--c-line); }
    .lexicon-accept-table td::before { content: attr(data-label); display: block; font-size: var(--fs-meta); color: var(--c-text-2); }
}
/* C2 (D-546): the kinds of groups of "Różne tłumaczenia" are check boxes (several at once), not single-choice pills. */
.kind-checks { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--sp-2); border: 0; margin: 0; padding: 0; }
.kind-checks .count-plain { margin-inline-start: var(--sp-1); }
.scope-panel:focus { outline: none; }

/* Families of names (docs/ui.md#ujednolicanie-nazw): the variable part of a construction, the result of a decision, deviations. */
.construction-slot { display: inline-block; padding: 0 var(--sp-1); border: 1px dashed var(--c-accent-fg); border-radius: var(--r-sm); color: var(--c-accent-fg); font-size: var(--fs-meta); }
.family-proposal { font-weight: 600; }
.family-deviation { text-decoration: underline wavy var(--c-warn-line); text-underline-offset: 3px; }
.family-status-missing, .family-status-low { color: var(--c-text); font-weight: 600; }
.family-links { margin: 0; padding-left: var(--sp-4); }

/* Nazewnictwo (phase 15R batch 5, docs/ui.md#nazewnictwo): tabs that are addresses, the rows of "Składanie tekstów" and the marks of Niespójności. */
.link-tabs .tab { text-decoration: none; display: inline-flex; align-items: center; }
.warning-text { color: var(--c-warn); }
.consistency-keys > li { overflow-wrap: anywhere; }
.composed-row { padding: var(--sp-3) var(--sp-4); }


@media (max-width: 799.98px) {

}
/* Tables of the naming area as cards on the phone: a long key pattern, a construction or a file:line wraps instead of widening the page. */
.simulations-table .mono { overflow-wrap: anywhere; }
@media (max-width: 599.98px) {
    .family-list td.mud-table-cell, .simulations-table td.mud-table-cell { flex-wrap: wrap; gap: var(--sp-1) var(--sp-2); }
    .family-list td.mud-table-cell > *, .simulations-table td.mud-table-cell > * { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
    .simulations-table col { width: auto !important; }
}
/* F-276: the usages of a term as cards on the phone: key, project, English and translation wrap instead of being cut at the edge. */
@media (max-width: 599.98px) {
    .usage-table td.mud-table-cell { flex-wrap: wrap; gap: var(--sp-1) var(--sp-2); }
    .usage-table td.mud-table-cell > * { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
}
/* Składanie tekstów as a dense table (review of batch 5, finding 4): text, translation, result and what the game puts in on one row. */
.composed-table { width: 100%; border-collapse: collapse; margin-bottom: var(--sp-3); }
.composed-table th, .composed-table td { text-align: left; vertical-align: top; padding: var(--sp-1) var(--sp-2); border-bottom: 1px solid var(--c-line); overflow-wrap: anywhere; }
.composed-table th { font-size: var(--fs-meta); color: var(--c-muted); font-weight: 600; }
.composed-table .composed-role { display: flex; gap: var(--sp-1); }
/* Phone (review of batch 5, finding 15): the intro shows its first sentence, chips stay in one row that scrolls, the count stands above the list. */
@media (max-width: 599.98px) {

    /* The flex parents of a scrolling chip row keep min-width: auto and would grow to all chips (882 px at 390): limit them to the row. */
    .list-toolbar-status, .list-toolbar-status .list-count { min-width: 0; max-width: 100%; }
    /* The count keeps what explains it beside it (the status legend, a help): a row that wraps, not a column that put the button alone on a line (F-338). */
    .list-count { flex-wrap: wrap; }
    .composed-table thead { display: none; }
    .composed-table tr, .composed-table td { display: block; }
    .composed-table td { border-bottom: 0; padding: var(--sp-1) 0; }
    .composed-table td[data-label]::before { content: attr(data-label); display: block; font-size: var(--fs-meta); color: var(--c-muted); }
    .composed-table tr.composed-row { border-bottom: 1px solid var(--c-line); padding: var(--sp-2) 0; }
}

/* Phase 16B part 2: the bell (docs/ui.md#dzwonek), notifications, the public preview (docs/ui.md#publiczny-podgląd), Discord webhooks. */
.bell { position: relative; display: inline-flex; }
/* The count stays inside the 48 px bar: MudBadge's overlap offset put its top 8 px above the bar, where the window cut it off. Only the badge
   moves down; the bell keeps its place. */
.bell .bell-badge.mud-badge-root .mud-badge-wrapper > .mud-badge.mud-badge-top.right { top: 2px; bottom: auto; }
.bell-panel { width: min(420px, calc(100vw - 16px)); max-height: min(80vh, 640px); overflow-y: auto; }
.bell-content { padding: var(--sp-3) var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-2); }
.bell-title { font-size: var(--fs-lg); margin: 0; color: var(--c-heading); }
.bell-section { font-size: var(--fs-meta); text-transform: uppercase; letter-spacing: .04em; color: var(--c-faint); margin: var(--sp-2) 0 0; }
.bell-queue a { display: flex; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-1) 0; }
.bell-count { font-variant-numeric: tabular-nums; font-weight: 600; }
.bell-item a, .notification a { display: flex; flex-direction: column; gap: 2px; padding: var(--sp-2); border-radius: var(--r-md); color: inherit; text-decoration: none; }
.bell-item a:hover, .notification a:hover { background: var(--c-hover); }
.bell-unread a, .notification-unread a { border-left: 3px solid var(--c-accent); }
.bell-unread .bell-item-text, .notification-unread .notification-title { font-weight: 600; }
.bell-item-excerpt, .notification-excerpt { font-size: var(--fs-sm); overflow-wrap: anywhere; }
.bell-foot { display: flex; justify-content: space-between; gap: var(--sp-3); border-top: 1px solid var(--c-line); padding-top: var(--sp-2); }
.notification { display: flex; align-items: center; gap: var(--sp-2); border-bottom: 1px solid var(--c-line-soft); }
.notification a { flex: 1; min-width: 0; }
.notification-filter { flex-wrap: wrap; }
.notification-channels { display: grid; grid-template-columns: minmax(0, 1fr); margin-block: var(--sp-4); }
.notification-preference { display: grid; grid-template-columns: minmax(0, 1fr) minmax(14rem, 18rem); align-items: start; gap: var(--sp-3); padding-block: var(--sp-3); border-top: 1px solid var(--c-line); }
.notification-name { font-size: var(--fs-sm); font-weight: 600; }
.notification-description { min-width: 0; }
.notification-description p { margin: var(--sp-1) 0 0; }
.notification-options { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-3); }
.notification-options .mud-input-control-boolean-input { margin: 0; }
.discord-row { padding: var(--sp-2) 0; border-bottom: 1px solid var(--c-line-soft); display: flex; flex-direction: column; gap: 2px; }
.discord-form { margin-top: var(--sp-3); }
.discord-events { border: 1px solid var(--c-line); border-radius: var(--r-md); padding: var(--sp-2) var(--sp-3); margin: 0; }
.text-error { color: var(--c-err); }
.public-preview { min-height: 100vh; }
.public-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); padding: var(--sp-2) var(--sp-4); border-bottom: 1px solid var(--c-line); background: var(--c-surface); }
.public-bar .brand { display: inline-flex; align-items: center; gap: var(--sp-2); color: inherit; text-decoration: none; margin: 0; } /* the bar's 12 px gap only (D-843) */
.public-nav { display: flex; gap: var(--sp-3); }
.public-nav a.active { font-weight: 600; text-decoration: underline; }
.public-content { width: min(var(--w-list), 100%); margin: 0 auto; padding: var(--sp-4); }
.public-login-note { margin: 0 0 var(--sp-3); }
.public-about { margin: var(--sp-6) 0 0; text-align: center; } /* what the tool is, under every public page (D-864) */
.public-projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: var(--sp-4); }
.public-progress li { display: grid; grid-template-columns: minmax(8rem, 12rem) 1fr; gap: var(--sp-1) var(--sp-3); align-items: center; padding: var(--sp-1) 0; }
.public-progress li > .small { grid-column: 2; }
.public-actions li { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); padding: var(--sp-1) 0; }
.public-toolbar { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: flex-start; margin-bottom: var(--sp-2); }
.public-toolbar > * { flex: 0 1 16rem; }
.public-text { white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 600px) {
    .public-progress li { grid-template-columns: 1fr; }
    .public-progress li > .small { grid-column: 1; }
    .notification-preference { grid-template-columns: minmax(0, 1fr); gap: var(--sp-1); }
}.public-bar .mud-input-control { flex: 0 1 12rem; max-width: 12rem; }

/* AI of administrators (phase 17, docs/ui.md#ai-przebiegi): the label AI is text with an icon, never the colour alone. */
.ai-status, .git-status { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); margin: 0 0 var(--sp-3); }
.ai-grid, .git-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(320px, 2fr); gap: var(--sp-4); align-items: start; }
.ai-grid .panel { max-width: none; }
.ai-new-run { margin-bottom: var(--sp-3); }
.ai-estimate { margin: var(--sp-2) 0; }
/* F-190 (D-679): "anywhere" let an automatic table squeeze EN and the proposal to a few characters (a 14 000 px row). Words wrap whole (a word longer
   than the column still breaks), a long text scrolls inside its cell, and the widths of the columns are fixed above the phone cards. */
.ai-text { display: block; white-space: pre-wrap; overflow-wrap: break-word; max-height: 24rem; overflow-y: auto; }
/* "anywhere" let the table squeeze the key and QA columns to a few characters; with these widths a key breaks after its separators and inside a part
   only when the part alone is longer than the column (D-513). */
.ai-key { overflow-wrap: anywhere; }
.ai-items .ai-col-key { width: 16%; min-width: 9rem; }
.ai-items .ai-col-text { width: 25%; }
.ai-items .ai-col-qa { width: 18%; min-width: 11rem; }
@media (min-width: 600px) {
    .ai-items table { table-layout: fixed; }
    .ai-items .ai-col-key { width: 14%; }
    .ai-items .ai-col-text { width: 27%; }
    .ai-items .ai-col-qa { width: 12%; }
    .ai-items .ai-col-state { width: 9%; }
    .ai-items .ai-col-actions { width: 11%; }
}
.ai-issues { margin: 0; padding-left: var(--sp-4); }
.ai-run-head { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--sp-1) var(--sp-3); margin: 0 0 var(--sp-3); }
.ai-run-head dt { color: var(--c-muted); }
.ai-run-head dd { margin: 0; }
.ai-item-filters { display: flex; flex-wrap: wrap; gap: var(--sp-1); margin-bottom: var(--sp-2); }
.ai-suggestions { list-style: none; margin: var(--sp-2) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
.ai-suggestion { border-top: 1px solid var(--c-line-soft); padding-top: var(--sp-2); }
.ai-suggestion-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-2); }
.list-ai-link { display: inline-flex; align-items: center; gap: 2px; margin-left: var(--sp-2); }
/* Administracja → Git (docs/ui.md#git): the layout of the AI page; the public key wraps anywhere. */
.git-grid .panel { max-width: none; margin-bottom: var(--sp-3); }
.git-public-key { width: 100%; font-family: var(--font-mono, monospace); font-size: var(--fs-xs); overflow-wrap: anywhere; resize: vertical; }
.git-host-list { margin: var(--sp-1) 0; padding-left: var(--sp-4); overflow-wrap: anywhere; }
/* U3-34 (D-854): the projects of the repository and of the pack — a table with named columns, "all" in the header of each column. */
.git-projects-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-4); }
.git-projects { width: 100%; }
.git-projects-section { margin-top: var(--sp-5); }
.git-projects .git-project-name { width: 40%; overflow-wrap: anywhere; }
.git-projects th.col-check { white-space: nowrap; }
.git-col-head { display: inline-flex; align-items: center; gap: var(--sp-1); }
/* The state of the pack stands next to its checkbox, with "Także niekompletny" after it when it can matter (D-934); the cell wraps. Complete: the
   colour of success, forced in part: the warning colour, staying out: muted (the theme tokens, AA in both themes). */
.git-pack-cell { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1); }
.git-pack-ready { color: var(--c-ok); }
.git-pack-forced { color: var(--c-warn); }
@media (max-width: 600px) {
    /* On a phone a project is a block: its name, then each choice and the number with its column name; the header keeps the "all" of each column. */
    .git-projects, .git-projects tbody, .git-projects thead { display: block; }
    .git-projects thead tr { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-4); padding: 0 var(--sp-3); }
    .git-projects thead th { display: block; width: auto; border: 0; padding: var(--sp-1) 0; }
    .git-projects thead th.git-project-name { display: none; }
    .git-projects tbody tr { display: block; border-bottom: 1px solid var(--c-line); padding: var(--sp-2) var(--sp-3); }
    .git-projects tbody td { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); justify-content: flex-start; width: auto; border: 0; padding: var(--sp-1) 0; text-align: left; }
    .git-projects tbody td.git-project-name { display: block; width: auto; }
    .git-projects tbody td:not(.git-project-name)::before { content: attr(data-label); min-width: 8rem; text-align: left; font-size: var(--fs-meta); color: var(--c-muted); }
}
/* U3-10 (D-818): the contributors since a day, as the Markdown that is copied. */
.git-contributors { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.git-contributors-text { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 320px; overflow: auto; padding: var(--sp-2) var(--sp-3);
  background: var(--c-surface); border: 1px solid var(--c-line-2); border-radius: var(--r-md); font-size: var(--fs-meta); }
.git-runs code { white-space: nowrap; }
/* U3-36 (D-856): the saved views — a collapsible section of the left bar, "Widoki" of the lists and the pinned views of /views. */
.nav-views-head { padding: 0; }
.nav-views-toggle { display: flex; align-items: center; justify-content: flex-start; gap: var(--sp-1); width: 100%; padding: var(--sp-4) var(--sp-4) var(--sp-1);
  border: 0; background: none; color: inherit; font: inherit; letter-spacing: inherit; text-align: left; cursor: pointer; }
.nav-views-toggle:focus-visible { outline: 2px solid var(--c-accent); outline-offset: -2px; }
.views-panel { width: 360px; max-width: calc(100vw - 32px); padding: var(--sp-3); display: flex; flex-direction: column; gap: var(--sp-2); }
.views-group-title { margin: var(--sp-2) 0 0; font-size: var(--fs-meta); color: var(--c-text-2); }
.views-list { list-style: none; margin: 0; padding: 0; max-height: 240px; overflow-y: auto; }
.views-list li { display: flex; align-items: center; gap: var(--sp-2); min-height: 32px; }
.views-list li a { overflow-wrap: anywhere; }
.views-list .views-pin { margin-left: auto; }
.views-pinned { margin: 0 0 var(--sp-4); padding-left: var(--sp-6); }
.views-pinned li { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); min-height: 40px; }
.views-pinned-actions { margin-left: auto; display: inline-flex; align-items: center; gap: var(--sp-1); }
/* U3-33 (D-853): the contributors from outside the workshop: name, file and actions on one line, the entry as written below it. */
.git-outside { list-style: none; margin: 0 0 var(--sp-3); padding: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
.git-outside-item { padding: var(--sp-2) var(--sp-3); border: 1px solid var(--c-line-2); border-radius: var(--r-md); background: var(--c-surface); }
.git-outside-head { display: flex; flex-wrap: wrap; align-items: center; column-gap: var(--sp-3); row-gap: var(--sp-1); }
.git-outside-name { overflow-wrap: anywhere; }
.git-outside-actions { margin-left: auto; display: flex; gap: var(--sp-1); }
.git-outside-entry { margin: var(--sp-1) 0 0; white-space: pre; overflow-x: auto; font-size: var(--fs-meta); }
.git-source-changes code { overflow-wrap: anywhere; }
@media (max-width: 900px) {
    .ai-grid, .git-grid { grid-template-columns: 1fr; }
}

/* ---------- UX round 2, batch 1: the design system contract (docs/ui.md#system-wyglądu, D-300..D-305) ---------- */
/* Spacing (§2.1): 4 icon–label; 8 within a group, title–subtitle; 12 row padding, between groups on one line; 16 cell padding, between fields;
   24 card inside, between sections; 32/48 large parts. Another kind of information is at least 12 px away or on its own line. */
.stack-2 { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-2); } .stack-3 { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-3); }
.stack-4 { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-4); } .stack-5 { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-5); }
.cluster, .construction-choice-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); }

/* Typography (§2.2): game text 16 (14–15 in lists) with a small EN/PL label; keys mono 13 in the secondary colour, never bold, never in a title;
   metadata 12–13 faint joined with " · ", always under the content; markup and {0} muted in lists. */
.key-text { font-family: var(--font-mono); font-size: var(--fs-mono); font-weight: 400; color: var(--c-text-2); overflow-wrap: anywhere; }
.meta-line { display: flex; flex-wrap: wrap; align-items: center; row-gap: var(--sp-1); font-size: var(--fs-meta); line-height: 1.45; color: var(--c-faint); min-width: 0; }
/* Every part starts with its " · " in the 20 px before it; the line is shifted left by that much and the band is clipped, so a part that wraps to
   the start of a line never shows a dangling separator. Chips have no separator, only the distance. */
.meta-line { margin-left: -20px; clip-path: inset(-4px -4px -4px 20px); }
.meta-line > * { margin-left: var(--sp-5); position: relative; }
.meta-line > :not(.badge)::before { content: "·"; position: absolute; left: -13px; color: var(--c-faint); }
.meta-line > .badge + .badge { margin-left: var(--sp-1); }
.meta-line .key-text { color: var(--c-text-2); }
.lang-label { font-size: var(--fs-xs); font-weight: 600; letter-spacing: .04em; color: var(--c-faint); margin-right: var(--sp-2); }
.text-game { font-size: var(--fs-game); line-height: var(--lh-text); }
.list-text .tok { background: none; color: var(--c-faint); font-weight: 400; font-size: var(--fs-xs); padding: 0; }
.list-text .vtml-token { color: var(--c-faint); border-color: var(--c-line); }

/* Chips (§2.3): one component, four kinds. Status: glyph + text + tone on a 15% tint; Source: neutral background, no border; Certainty: dashed
   outline, italic, "?"; Kind: thin outline, no background. Text pairs keep at least 4.5:1 in both themes (D-301). */
:root { --b-ok: #8FD9A8; --b-warn: #EBC36F; --b-info: #9CCBF2; --b-err: #F59A8B; --b-accent: #F1C9A4; --b-neutral: var(--c-text-2); }
html[data-theme=light] { --b-ok: #1E5A35; --b-warn: #7A4F00; --b-info: #1F5C99; --b-err: #8C1D18; --b-accent: #7A3F12; --b-neutral: var(--c-text-2); }
.badge { display: inline-flex; align-items: center; gap: var(--sp-1); max-width: 100%; min-height: 20px; padding: 0 var(--sp-2); box-sizing: border-box;
  border: 1px solid transparent; border-radius: var(--r-sm); font-family: var(--font-ui); font-size: var(--fs-xs); font-weight: 500; font-style: normal;
  line-height: 18px; white-space: nowrap; vertical-align: middle; color: var(--c-text-2); text-decoration: none; }
.badge-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.badge-glyph { flex: none; font-size: 10px; line-height: 1; }
.badge .badge-icon.mud-icon-root { font-size: 14px; width: 14px; height: 14px; flex: none; }
.badge--status { --b-c: var(--b-neutral); min-height: 22px; font-weight: 600; color: var(--b-c); background: color-mix(in srgb, var(--b-c) 15%, transparent); }
.badge--status.badge--ok { --b-c: var(--b-ok); }
.badge--status.badge--warn { --b-c: var(--b-warn); }
.badge--status.badge--info { --b-c: var(--b-info); }
.badge--status.badge--err { --b-c: var(--b-err); }
.badge--status.badge--accent { --b-c: var(--b-accent); }
.badge--source { background: var(--c-chip); }
.badge--certainty { border: 1px dashed var(--c-line-input); font-style: italic; }
.badge--kind { border-color: var(--c-line-2); }
/* Inside a sentence or a cell a chip keeps its distance from the next one. */
:not(.meta-line) > .badge + .badge { margin-left: var(--sp-1); }
.badge.small { min-height: 18px; line-height: 16px; }
/* The status chip of a string (StatusBadge) is a status chip in the colour of its status. */
.status { --b-c: var(--b-neutral); border: 0; color: var(--b-c); background: color-mix(in srgb, var(--b-c) 15%, transparent); font-weight: 600; }
.status.status-translated { --b-c: var(--b-warn); }
.status.status-approved, .status.status-full { --b-c: var(--b-ok); }
.status.status-review { --b-c: var(--b-info); }
.status.status-full { border: 0; }
/* A construction slot is not a chip (§2.3) and not a link (D-545): the variable part in italics in the secondary colour, no underline, no pointer. */
.construction-slot { display: inline; padding: 0 2px; border: 0; border-radius: 0; color: var(--c-text-2); font-style: italic; font-size: inherit; cursor: default; }

/* Page header (§2.6): breadcrumbs → h1 24 with the actions at its right → the metadata line → one sentence of intro → the scope bar → tabs. */
.page-head { display: grid; gap: var(--sp-2); margin-bottom: var(--sp-5); min-width: 0; }
.page-head .page-crumbs.mud-breadcrumbs { padding: 0; margin-bottom: var(--sp-1); font-size: var(--fs-sm); flex-wrap: wrap; }
.page-head-row { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--sp-3) var(--sp-4); min-width: 0; }
.page-head-title { display: grid; gap: var(--sp-1); min-width: 0; flex: 1 1 24rem; }
.page-head .page-title { margin: 0; overflow-wrap: anywhere; }
.page-head-actions .mud-button-root { white-space: nowrap; }
.page-meta { font-size: var(--fs-meta); }
.page-intro { margin: 0; max-width: 110ch; color: var(--c-text-2); font-size: var(--fs-sm); line-height: var(--lh-ui); }
.page-intro-more.link-button { padding: 0 2px; font-size: var(--fs-sm); color: var(--c-link); text-decoration: underline; text-underline-offset: 2px; }
.page-intro-guide { white-space: nowrap; font-size: var(--fs-sm); }
.page-scope { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); margin-top: var(--sp-2); min-width: 0; }
.page-scope > .mud-input-control, .page-scope > .mud-select, .page-scope > .search-picker { flex: 0 1 240px; min-width: 180px; }
.page-head > .tab-list { margin: var(--sp-2) 0 0; } /* with the head's 8 px gap: 16 px under the title, intro or scope (D-843) */
@media (max-width: 599.98px) {
    .page-head { margin-bottom: var(--sp-4); }
    .page-head-actions { width: 100%; }
    .page-scope > .mud-input-control, .page-scope > .mud-select, .page-scope > .search-picker { flex: 1 1 100%; }
}

/* Tabs (§2.6): one look everywhere, normal case. */
.tab-list { gap: var(--sp-1); }
.layout-phone .tab-list .tab { min-height: var(--target-touch); }
.tab-list .tab { text-transform: none; letter-spacing: normal; color: var(--c-text-2); text-decoration: none; display: inline-flex; align-items: center; min-height: 36px; }
.tab-list .tab:hover { color: var(--c-text); text-decoration: none; }
.tab-list .tab.active { color: var(--c-text); }
.tab-list .tab:focus-visible { outline-offset: -2px; }
.tab-list .tab .count { color: var(--c-text-2); font-weight: 400; }
.tab-list .tab.tab-out { margin-left: auto; color: var(--c-link); }
.mud-tab { text-transform: none !important; }

/* Table row (§2.5): status | the name as the one link 14/600 · subtitle (EN/PL) · metadata 12 | numbers in their own right-aligned columns |
   one action or ⋮; at least 48 px, the whole row hovers. */
.data-table .mud-table-body td.mud-table-cell { padding-block: var(--sp-3); }
/* F-332 (D-844): when a table becomes cards (MudBlazor, below 960 px for Breakpoint.Sm) each cell is a line "label: value"; the row keeps 12 px
   above and below, the lines inside it 4 px, so a term or a dispute is a compact entry instead of five 40 px rows. */
@media (max-width: 959.98px) {
    .data-table.mud-sm-table:not(.phone-compact) .mud-table-body td.mud-table-cell { padding-block: var(--sp-1); }
    .data-table.mud-sm-table:not(.phone-compact) .mud-table-body td.mud-table-cell:first-child { padding-top: var(--sp-3); }
    .data-table.mud-sm-table:not(.phone-compact) .mud-table-body td.mud-table-cell:last-child { padding-bottom: var(--sp-3); }
}
/* A compact phone row (D-405): title, state and the action beside them; the rest is on the object's page or under "Szczegóły". */
@media (max-width: 799.98px) {
    .phone-detail, .data-table.phone-compact td.mud-table-cell.phone-detail { display: none !important; }
    .data-table.phone-compact .mud-table-body .mud-table-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--sp-2); align-items: center; padding-block: var(--sp-2); border-bottom: 1px solid var(--c-line); }
    .data-table.phone-compact .mud-table-body td.mud-table-cell { display: block; grid-column: 1; padding: var(--sp-1) var(--sp-3); border: 0; text-align: left; }
    .data-table.phone-compact .mud-table-body td.mud-table-cell::before { content: none; }
    .data-table.phone-compact .mud-table-body td.mud-table-cell * { white-space: normal; overflow-wrap: anywhere; }
    .data-table.phone-compact .mud-table-body td.mud-table-cell.row-menu { grid-column: 2; grid-row: 1 / span 3; padding-inline: 0 var(--sp-2); }
    .row-details summary { min-height: 24px; color: var(--c-link); cursor: pointer; font-size: var(--fs-meta); }
}
.data-table .mud-table-body .mud-table-row:hover { background: var(--c-hover); }
.row-title .row-link, .row-title .row-name { font-size: var(--fs-sm); font-weight: 600; overflow-wrap: anywhere; }
/* F-330 (D-844): a key as the name of a row breaks anywhere (overflow-wrap), so in a table laid out by its content the browser squeezed its
   column to the width of a few letters and the key ran down in five lines (Spory) while short columns stood empty. The name keeps room for a
   key of usual length; the table scrolls inside its frame when the window is narrower than its columns. */
@media (min-width: 600px) { .data-table .row-title:has(.key-text) { min-width: 240px; } }
.row-sub { font-size: var(--fs-sm); color: var(--c-text-2); overflow-wrap: anywhere; }
.row-title .row-meta { margin-top: 2px; }
.data-table td.cell-action { text-align: right; white-space: nowrap; }

/* Fields (§2.10): the width follows the content, never the whole line for a number; labels are never cut. */
.mud-input-control.w-version, .w-version { flex: 0 1 200px; width: 100%; max-width: 200px; }
.mud-input-control.w-short, .w-short { flex: 0 1 260px; width: 100%; max-width: 260px; }
.mud-input-control.w-medium, .w-medium { flex: 0 1 380px; width: 100%; max-width: 380px; }
.mud-input-control.w-long, .w-long { flex: 0 1 600px; width: 100%; max-width: 600px; }
/* MudStack renders its column as .flex-column (MudBlazor), where a width class must not grow the field's height. */
.flex-column > :is(.w-version, .w-short, .w-medium, .w-long) { flex: 0 0 auto; }
/* In a column (MudStack) the flex basis above would be a height. */

/* Ordered work steps: a quiet number and a heading; no decorative nested card hierarchy (D-398). */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-5); counter-reset: step; }
.step { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: var(--sp-1) var(--sp-3); counter-increment: step; }
.step::before { content: counter(step) "."; width: 28px; line-height: 28px; color: var(--c-faint); font-weight: 600; font-size: var(--fs-sm); grid-row: 1 / span 2; font-variant-numeric: tabular-nums; }
.step-title { margin: 0; font-size: var(--fs-md); font-weight: 600; color: var(--c-heading); line-height: 28px; }
.step-body { grid-column: 2; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-3); min-width: 0; }
@media (max-width: 599.98px) { .step-body { grid-column: 1 / -1; } }

/* The guide: readable tables; chapters share the LocalNav disclosure on narrow screens. */
.help-content table { overflow-wrap: normal; }
.help-content th:first-child, .help-content td:first-child { white-space: nowrap; min-width: 9rem; }
/* Przegląd → Do recenzji (D-305): the number links to the queue, the line under it to its imported part. */
.next-queue { flex-direction: column; align-items: flex-start; justify-content: center; gap: var(--sp-1); }
.next-queue .next-count-main { display: grid; color: var(--c-text); text-decoration: none; }
.next-queue .next-count-main:hover .next-number, .next-queue .next-count-main:focus-visible .next-number { text-decoration: underline; }
.next-queue .next-sub { font-size: var(--fs-meta); }
/* A Kind chip that is a button ("projekt · wersja" narrows the scope): the same look, a pointer and a hover border. */
button.badge { font: inherit; font-size: var(--fs-xs); background: transparent; cursor: pointer; }
button.badge:hover, button.badge:focus-visible { color: var(--c-text); border-color: var(--c-text-2); }
.search-hits { display: inline-flex; flex-wrap: wrap; gap: var(--sp-1); margin-left: var(--sp-2); vertical-align: middle; }
.head-project { flex: none; max-width: 16rem; }
.row-link .key-text { color: inherit; }
.meta-line:empty { display: none; }

/* ---------- UX round 2, batch 2: the work screen (docs/ui.md#ekran-tłumaczenia, D-306..D-308) ---------- */
/* String list row (§2.9): EN 14 px in two lines, the translation in the secondary colour, one faint 12 px metadata line (key mono without a box ·
   project as text · hits), each part cut with an ellipsis and the key whole when the row is focused or open. */
.string-item { gap: var(--sp-2); padding: var(--sp-3) var(--sp-3) var(--sp-3) var(--sp-2); }
.string-item .item-translation { color: var(--c-text-2); font-size: var(--fs-list); line-height: 1.4; }
.item-missing { color: var(--c-faint); font-size: var(--fs-meta); font-style: italic; line-height: 1.4; }
.item-meta.meta-line { flex-wrap: nowrap; font-size: var(--fs-xs); line-height: 1.5; margin-top: var(--sp-1); }
.item-meta > .item-key, .item-meta > .item-project { display: flex; min-width: 0; }
.item-meta > .item-key { flex: 0 1 auto; }
.item-meta > .item-project { flex: 0 1000 auto; min-width: 3.5rem; color: var(--c-faint); }
.item-meta .item-key .key-text { font-size: var(--fs-xs); color: var(--c-text-2); }
.item-meta .item-key .key-text, .item-meta .item-clip { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-hits .search-hits { margin: var(--sp-1) 0 0; }
.string-item:focus .item-meta, .string-item.selected .item-meta { flex-wrap: wrap; }
.string-item:focus .item-meta .item-key .key-text, .string-item.selected .item-meta .item-key .key-text { white-space: normal; overflow-wrap: anywhere; }
/* Markup collapsed to "⟨⟩" (§2.9): muted, never a box. */
.list-text .vtml-mark { color: var(--c-faint); font-size: .85em; margin: 0 var(--sp-1); white-space: nowrap; }
.list-text .vtml-mark:first-child { margin-left: 0; }
/* The opened row: selection background and the copper bar. The row the phone came back from: only a quiet neutral bar, no background. */
.string-item.returned { background: transparent; box-shadow: inset 3px 0 0 var(--c-line-input); }
.string-item.returned:hover { background: var(--c-hover); }
/* Status shapes readable at a glance (14 px, the dashed circle in the secondary colour). */
.string-item .status-mark { width: 14px; height: 14px; margin-top: 3px; }
.string-item .status-mark.status-untranslated { border: 2px dashed var(--c-text-2); }
.string-item .status-mark.status-approved::after { font-size: 10px; }

/* Empty list after a search (D-306). */
.search-explain { max-width: 40ch; color: var(--c-text-2); }

/* Do recenzji (§3): the categories of the queue as one vertical list, the count right-aligned. */
.queue-categories { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
.queue-category { display: flex; justify-content: space-between; width: 100%; min-height: 30px; padding: var(--sp-1) var(--sp-3); text-align: left; }
.queue-category .queue-category-label { min-width: 0; }
.queue-category .count { margin-left: auto; padding-left: var(--sp-3); font-size: var(--fs-meta); }
.queue-categories .queue-rest { justify-self: start; }

/* Editor header (§4.4): the key as KeyText that wraps, the project as metadata with "Tylko ten projekt", what the key's domain means. */
.head-row1 { align-items: flex-start; }
.head-key { display: grid; gap: var(--sp-1); min-width: 0; flex: 1 1 auto; }
.string-key { font-family: var(--font-ui); font-size: var(--fs-sm); font-weight: 400; flex-wrap: wrap; row-gap: 0; }
.string-key > .head-key-text { font-size: var(--fs-sm); color: var(--c-text); white-space: normal; overflow: visible; overflow-wrap: anywhere; }
.head-key .head-project.meta-line { max-width: none; flex: initial; }
.head-narrow.link-button { font-size: var(--fs-meta); padding: 0; color: var(--c-link); }
.key-domain-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-1) var(--sp-2); color: var(--c-text-2); }
.key-domain-line .key-text { color: var(--c-text); }
.key-domain-open { color: var(--c-link); }
/* A disabled action: the reason is the tooltip of a small ⓘ beside it (D-308), not text in the bar. */
.action-reason-icon { color: var(--c-text-2); cursor: help; font-size: 15px; line-height: 1; padding: 2px; border-radius: var(--r-sm); }
.action-reason-icon:hover, .action-reason-icon:focus-visible { color: var(--c-text); }
.action-reason-slot { visibility: hidden; }
@media (max-width: 799.98px) {
    .head-key { order: 10; flex-basis: 100%; }
    .head-key .string-key { order: 0; flex-basis: auto; } /* the key first, then the project and the domain */
    .action-reason-icon { display: none; } /* the bottom bar: the reason is the button's description and tooltip */
}

/* History, versions and comments (§2.8): a sentence header with the time and, on the right, the status and the action; the text in a framed box
   with its language label at the size of the game text; the comparison under the box. The timeline connector stays. */
.history-entries .history-event { padding-bottom: var(--sp-4); }
.history-entries .history-event--line { padding-bottom: var(--sp-3); }
.history-head, .links-terms li { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-1) var(--sp-3); }
.history-sentence { color: var(--c-text); }
.history-sentence strong { font-weight: 600; }
.history-time { color: var(--c-faint); font-size: var(--fs-meta); font-variant-numeric: tabular-nums; }
.history-detail { color: var(--c-text-2); font-size: var(--fs-meta); }
.history-side { margin-left: auto; display: inline-flex; align-items: center; gap: var(--sp-2); }
.history-use.mud-button-root { min-height: 28px; }
.text-box { display: grid; gap: var(--sp-1); margin-top: var(--sp-2); padding: var(--sp-2) var(--sp-3) var(--sp-3); background: var(--c-surface);
  border: 1px solid var(--c-line-2); border-radius: var(--r-md); }
.text-box .lang-label { margin: 0; }
.text-box-text { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--c-text); }
.compare-counts { font-variant-numeric: tabular-nums; }
.diff-added { color: var(--b-ok); font-weight: 600; }
.diff-removed { color: var(--b-err); font-weight: 600; }
.history-diff-toggle.link-button { padding: 0; color: var(--c-link); }
.diff-legend { display: inline-flex; gap: var(--sp-2); }
.key-history .text-box { margin-top: var(--sp-2); }
.comment-list .comment-meta { margin-bottom: var(--sp-1); }
.comment-list .comment-text { color: var(--c-text); }

/* Proposals: the disclosure buttons (D-308). */
.proposals-more { gap: var(--sp-2); margin-top: var(--sp-2); }

/* Help column (D-308): a card waiting for the help shows its own skeleton; the glossary card links each term's graph. */
.help-card-loading { display: grid; gap: var(--sp-2); padding: var(--sp-1) 0; }
.term-graph-link { color: var(--c-link); }
.placeholder-more.link-button { padding: 0; margin: 0 0 var(--sp-1); color: var(--c-link); }

/* "Powiązania" (D-308): glossary, family and composition as sections; an empty section is one sentence why. */
.links-section + .links-section { margin-top: var(--sp-5); }
.links-term-pl { color: var(--c-text-2); }
.links-graph { margin-left: auto; color: var(--c-link); }
.links-family { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-1) var(--sp-2); margin: 0; }
.links-empty { margin: 0; }
/* EN of the editor (D-308): VTML muted until "Pokaż znaczniki", placeholders stay highlighted; the elements stay clickable. */
.hl-muted-markup .tok-tag { background: none; color: var(--c-faint); font-weight: 400; }

/* ---------- UX round 2, batch 3: Nazewnictwo (docs/ui.md#nazewnictwo, D-320..D-328) ---------- */
/* The scope bar of the naming screens (U-H, D-320): the work-context bar of the work screens in a frame, the note of the version shown under it. */
.naming-scope { display: grid; gap: var(--sp-1); min-width: 0; max-width: 100%; }
.naming-scope .work-context { display: inline-flex; max-width: 100%; height: auto; min-height: 36px; padding: 0 var(--sp-1) 0 var(--sp-3); border: 1px solid var(--c-line-2);
  border-radius: var(--r-md); background: var(--c-surface); justify-self: start; }
.naming-scope-note { font-size: var(--fs-meta); color: var(--c-faint); }

/* One choice of a list (D-321): chips with their counts; on a phone one select instead of a row cut at the edge. */
.choice-chips { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-3); min-width: 0; }
.choice-chips-title { font-size: var(--fs-meta); font-weight: 600; color: var(--c-text-2); min-width: 4.5rem; }
/* U3-17 (D-820): the one look of a choice of what to show: a segmented box (a filter, not a second row of tabs — no underline, which is the mark of a
   tab). The chosen segment is the strongest one: accent frame, tinted fill, full text colour, bold and ✓; the others are plain text. */
.choice-chips-row { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 2px; min-width: 0; border: 1px solid var(--c-line-input);
  border-radius: var(--r-sm); background: var(--c-sunken); }
.choice-chips .choice-chip { margin: 0; min-height: var(--btn-h-dense); padding-inline: var(--sp-3); border: 1px solid transparent; border-radius: var(--r-sm); background: transparent; color: var(--c-text-2); font-size: var(--fs-sm); }
.choice-chips .choice-chip:hover { background: var(--c-hover); color: var(--c-text); }
.choice-chips .choice-chip.on { background: var(--c-accent-soft); color: var(--c-text); border-color: var(--c-accent); font-weight: 600; }
/* MudBlazor greys a filled chip under the mouse, which made the accent text of the chosen one hard to read. */
.choice-chips .mud-chip.choice-chip.on.mud-clickable:hover:not(.mud-disabled) { background: var(--c-accent-soft); }
.choice-count { margin-left: var(--sp-2); font-variant-numeric: tabular-nums; opacity: 1; }
.choice-select { display: none; width: 100%; min-height: var(--target-touch); padding: 0 var(--sp-3); background: var(--c-sunken); color: var(--c-text); border: 1px solid var(--c-line-input);
  border-radius: var(--r-sm); font: inherit; font-size: var(--fs-sm); }
@media (max-width: 799.98px) {
    .choice-chips { width: 100%; }
    .choice-chips-row { display: none; }
    .choice-select { display: block; }
}

/* The table of families (audit 2.5, D-321): numbers in their columns, two slot formulas, one status and one action. */
.family-list .col-constructions { width: 26%; }
.family-list .col-number { width: 88px; }
.family-list .col-decision { width: 190px; }
.family-list .col-family-action { width: 200px; }
.construction-list li { display: flex; flex-direction: column; align-items: flex-start; gap: 0; }
.construction-count { color: var(--c-text-2); font-size: var(--fs-meta); font-variant-numeric: tabular-nums; }
.construction-count::before { content: "×"; color: var(--c-faint); }
.construction-more { display: inline-block; margin-top: var(--sp-1); font-size: var(--fs-meta); color: var(--c-faint); }
/* D-545: a construction in the list is a real name with its count; the place and its form are a caption under it. */
.construction-caption { font-size: var(--fs-xs); color: var(--c-faint); }
.family-phone-constructions { margin-top: var(--sp-1); color: var(--c-text-2); overflow-wrap: anywhere; }
.family-list .cell-action .mud-button-root { white-space: nowrap; }
.run-facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--sp-1) var(--sp-3); margin: 0 0 var(--sp-2); }
.run-facts dt { color: var(--c-faint); }
.run-facts dd { margin: 0; }

/* A construction (audit 2.3, D-322): the slot is the value placeholder with a dashed underline and the form as a caption under it, set apart
   from the words around it; compact in lists (the form in the tooltip). */
.construction { overflow-wrap: anywhere; }
.construction-slot-box { display: inline-flex; flex-direction: column; align-items: center; vertical-align: baseline; margin: 0 var(--sp-1); line-height: 1.25; }
.construction-slot-caption { margin-top: 3px; font-size: var(--fs-xs); line-height: 1.2; color: var(--c-faint); white-space: nowrap; }
.construction--full .construction-slot { font-weight: 600; }
.construction--compact .construction-slot { margin: 0 2px; }
.construction-kind { font-size: var(--fs-meta); color: var(--c-text-2); }

/* The family page in three steps (audit §5, D-322). */
.family-steps { gap: var(--sp-6); }
.family-steps .step-title { font-size: var(--fs-lg); }
.composed-back { margin: var(--sp-3) 0 var(--sp-2); }
.step-help { margin: 0; font-size: var(--fs-sm); color: var(--c-text-2); max-width: 110ch; }
.step-help.composed-detail-help { margin-bottom: var(--sp-4); }
.family-decision { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); font-size: var(--fs-sm); color: var(--c-text-2); }
.family-decision-note { color: var(--c-text); }
.construction-choices { display: grid; gap: var(--sp-2); margin: 0; padding: 0; border: 0; min-width: 0; }
.construction-choice { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: var(--sp-3) var(--sp-4); align-items: start; padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--c-line-2); border-radius: var(--r-lg); background: var(--c-surface); cursor: pointer; }
.construction-choice:hover { background: var(--c-hover); }
.construction-choice.chosen { border-color: var(--c-accent); box-shadow: inset 3px 0 0 var(--c-accent); }
.construction-choice.blocked { cursor: default; background: transparent; border-style: dashed; }
.construction-choice.blocked .construction-choice-formula { color: var(--c-text-2); }
.construction-choice input[type=radio] { width: 18px; height: 18px; margin: var(--sp-1) 0 0; accent-color: var(--c-accent); }
.construction-choice:focus-within { outline: var(--focus-width) solid var(--c-focus); outline-offset: var(--focus-offset); }
.construction-choice input[type=radio]:focus-visible { outline: none; }
.construction-choice-formula { font-size: var(--fs-md); line-height: 1.45; }
.construction-choice-examples { font-size: var(--fs-sm); color: var(--c-text-2); }
.construction-choice-note { font-size: var(--fs-meta); color: var(--c-faint); }
.construction-choice-count { display: grid; justify-items: end; text-align: right; min-width: 64px; }
.construction-choice.fallback { box-shadow: inset 3px 0 0 var(--c-text-2); }
/* The order of constructions of a decision (D-360): numbered rows, the formula, its role, and up/down/remove; fallbacks to add below. */
.construction-order { display: grid; gap: var(--sp-3); min-width: 0; margin-top: var(--sp-4); padding-top: var(--sp-4); border-top: 1px solid var(--c-line); }
/* In the grid of the order its gap is the distance: no margin of its own on top of it (F-339, as F-329). */
.construction-order-best { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); }
.construction-order-title { margin: 0; font-size: var(--fs-md); font-weight: 600; }
.construction-order-item { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: var(--sp-3); align-items: center; padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-md); background: var(--c-surface); }
.construction-order-number { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--c-line-2);
  font-size: var(--fs-sm); font-weight: 600; font-variant-numeric: tabular-nums; }
.construction-order-item:first-child .construction-order-number { border-color: var(--c-accent); color: var(--c-accent); }
.construction-order-role { font-size: var(--fs-meta); color: var(--c-faint); }
.construction-order-actions { display: flex; gap: var(--sp-1); }

.agreement-order { color: var(--c-text-2); }
.order-counts { margin-bottom: var(--sp-2); }
.count-number { font-size: var(--fs-lg); font-weight: 600; font-variant-numeric: tabular-nums; color: var(--c-text); }
.count-unit { font-size: var(--fs-xs); color: var(--c-faint); }
.fixed-table .col-agreement { width: 300px; }
.decision-note, .agreement-reason { margin-top: var(--sp-1); font-size: var(--fs-meta); color: var(--c-faint); }
.agreement-next { display: inline-block; margin-top: var(--sp-1); font-size: var(--fs-meta); }
.family-names .mud-checkbox { margin-top: var(--sp-1); }
.preview-counts { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-5); margin: 0; }
.preview-count { display: grid; gap: 2px; }
.preview-count dt { font-size: var(--fs-meta); color: var(--c-faint); }
.preview-count dd { margin: 0; font-size: var(--fs-lg); font-weight: 600; font-variant-numeric: tabular-nums; }
.family-review-note { margin: 0; }
.family-links { list-style: none; padding: 0; display: grid; gap: var(--sp-3); }
@media (max-width: 599.98px) {
    .construction-choice { grid-template-columns: 20px minmax(0, 1fr); padding: var(--sp-3); }
    .construction-choice-count { grid-column: 2; display: flex; justify-content: flex-start; gap: var(--sp-1); align-items: baseline; text-align: left; }
    .construction-order { padding-top: var(--sp-3); }
    .construction-order-item { grid-template-columns: 24px minmax(0, 1fr); padding: var(--sp-2); }
    .construction-order-actions { grid-column: 2; }
}

/* Niespójności, the same English text (D-324): EN heads the group, the translations with numbers in columns, the keys folded. */
.consistency-source .source-text { overflow-wrap: anywhere; }
.variant-table { width: 100%; border-collapse: collapse; margin-top: var(--sp-3); }
.variant-table th { font-size: var(--fs-meta); font-weight: 600; color: var(--c-text-2); text-align: left; padding: 0 var(--sp-3) var(--sp-1); }
.variant-table td { padding: var(--sp-2) var(--sp-3); border-top: 1px solid var(--c-line); vertical-align: middle; }
.variant-table th.num { text-align: right; }
.variant-table .num { width: 96px; text-align: right; font-variant-numeric: tabular-nums; }
.variant-table .variant-text { overflow-wrap: anywhere; }
.variant-table .variant-keys td { border-top: 0; padding-top: 0; }
.variant-table .consistency-keys { display: grid; gap: var(--sp-2); margin: 0; padding: var(--sp-2) var(--sp-3); background: var(--c-sunken); border-radius: var(--r-md); }
.variant-table .consistency-keys .meta-line { margin-top: 2px; }
.variant-table .consistency-keys .keys-toggle { padding: 0; }
@media (max-width: 599.98px) {
    .variant-table thead { display: none; }
    .variant-table tr, .variant-table td { display: block; }
    .variant-table td { border-top: 0; padding: var(--sp-1) 0; }
    .variant-table tr.variant-row { border-top: 1px solid var(--c-line); padding-top: var(--sp-2); }
    .variant-table .num { width: auto; text-align: left; }
    .variant-table td.num::before { content: attr(data-label) ": "; color: var(--c-faint); font-size: var(--fs-meta); }
}

/* Składanie tekstów (D-326): two groups of filters, certainty in its own column, a dense row. */
.composed-filters { display: grid; gap: var(--sp-2); justify-items: start; }
.composed-table { table-layout: fixed; }
.composed-table .col-result { width: 18%; }
.composed-table .col-inserts { width: 17%; }
.composed-table .col-certainty { width: 200px; }
.composed-table .col-composed-action { width: 150px; }
.composed-table td { padding: var(--sp-2) var(--sp-3); }
.composed-table .composed-en { font-weight: 500; }
.composed-result-text { font-weight: 600; }
.composed-table .composed-role { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px var(--sp-2); }
.composed-table .cell-action { text-align: right; }
@media (max-width: 799.98px) { .composed-table { table-layout: auto; } }

/* A side panel for the details of a row (D-325). */
.side-panel-backdrop { position: fixed; inset: 0; z-index: 1300; background: rgb(0 0 0 / .45); }
.side-panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 1301; width: min(480px, 100vw); display: flex; flex-direction: column; background: var(--c-surface-2);
  border-left: 1px solid var(--c-line-2); box-shadow: var(--shadow-dialog); }
.side-panel-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--c-line); }
.side-panel-body { padding: var(--sp-4) var(--sp-5) var(--sp-5); overflow-y: auto; }
/* D-840 (docs/ui.md#okna-dialogowe-wzorzec): a modal surface of the application keeps the scrolling to itself, as the MudBlazor dialogs do — the wheel
   or a touch over the dimmed backdrop and past the end of the surface's own content does not move the page under it. A surface that does not scroll
   is still a scroll container (overflow: hidden), so overscroll-behavior applies to it too (guide prevent-page-scroll-under-modal-dialog). */
.side-panel-backdrop, .side-panel, .session-expired-backdrop { overflow: hidden; overscroll-behavior: contain; }
.side-panel-body, .session-expired, .graph-stage-full, .filter-panel-popover, .filter-panel-body { overscroll-behavior: contain; }
.scenario-item { display: grid; gap: var(--sp-1); padding-top: var(--sp-3); border-top: 1px solid var(--c-line); }
.scenario-example { font-size: var(--fs-sm); overflow-wrap: anywhere; }

/* The template page (D-327): the slots read first, "Edytuj" opens the fields. */
.section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.section-head .section-title { margin-bottom: 0; }
.fact-list { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--sp-1) var(--sp-4); align-items: baseline; margin: var(--sp-3) 0; }
.fact-list dt { font-size: var(--fs-meta); color: var(--c-faint); }
.fact-list dd { margin: 0; }
.slot-table { margin-bottom: var(--sp-5); }

/* Słowniki wartości (D-328): the sources of the values as a list. */
.lexicon-sources { list-style: none; margin: 0 0 var(--sp-3); padding: 0; display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-5); font-size: var(--fs-sm); }
.lexicon-sources li { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-2); }
.arg-index.nowrap { white-space: nowrap; }

/* ---------- Master-detail (docs/ui.md#szczegóły-obiektu, D-329): previous/next of a detail page ---------- */
.prev-next { display: flex; align-items: center; gap: var(--sp-1); }
.prev-next-position { white-space: nowrap; }

/* D-340: the glossary list — the preferred translation with its forms under it, the other translations smaller. */
.glossary-preferred { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-2); font-weight: 600; }
.glossary-forms { color: var(--c-text-2); font-size: var(--fs-sm); margin-top: var(--sp-1); }
.glossary-others { margin-top: var(--sp-1); color: var(--c-text-2); }
.glossary-table .row-sub { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.glossary-manage .menu-reason, .mud-menu-item .menu-reason { white-space: normal; }

/* D-344: the tags screen — the tree on the left, the chosen tag on the right; under 900 px the details go under the tree. */
.tags-layout { display: grid; grid-template-columns: minmax(260px, 420px) minmax(0, 1fr); gap: var(--sp-5); align-items: start; }
.tags-tree .tag-node-name { font-weight: 500; flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.tag-node-count { color: var(--c-text-2); font-size: var(--fs-meta); font-variant-numeric: tabular-nums; margin-left: var(--sp-1); } /* with the node's 8 px gap: 12 px (D-303, D-843) */
.tag-details { display: grid; gap: var(--sp-2); }
.tag-details > p { margin: 0; }
.tag-details .section-heading { margin: var(--sp-4) 0 0; }
.tag-details-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-3); }
.tag-details-head .section-title { display: flex; align-items: center; gap: var(--sp-2); overflow-wrap: anywhere; margin-bottom: 0; }
.tag-projects { max-width: 480px; }
.tag-terms, .tag-rules { margin: 0; padding-left: var(--sp-5); display: grid; gap: var(--sp-2); }
.tag-rules code { margin: 0 var(--sp-1); }
@media (max-width: 899.98px) { .tags-layout { grid-template-columns: minmax(0, 1fr); } }
.forms-table .num { text-align: right; }
.term-forms-card > .mud-button-root { justify-self: start; }
.forms-table td .badge { margin-left: var(--sp-2); }
#term-panel-forms > p:first-child { margin-bottom: var(--sp-4); }
/* D-346: what a type does, and the type field without types. */
.type-explain { margin-bottom: var(--sp-5); }
.type-does { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--sp-3) var(--sp-5); margin: 0; }
.type-does dt { font-weight: 600; }
.type-does dd { margin: 0; color: var(--c-text-2); }
.type-does dd a { margin-left: var(--sp-1); }
@media (max-width: 599.98px) { .type-does { grid-template-columns: minmax(0, 1fr); row-gap: var(--sp-1); } .type-does dd { margin-bottom: var(--sp-3); } } /* 4 px to its own text, 16 px to the next (D-843) */
.type-empty { display: grid; gap: var(--sp-1); justify-items: start; }

/* The concept form and each translation retain one editable layer (D-380). */
.tl-row { border: 1px solid var(--c-line); border-radius: var(--r-md); padding: var(--sp-3); margin-block: var(--sp-3); min-width: 0; }
.tl-main { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-3); align-items: start; }
.tl-text { grid-column: 1 / -1; }
.tl-pos { display: flex; align-items: center; min-width: 0; gap: var(--sp-1); }
.tl-pos > .mud-input-control { flex: 1; min-width: 0; }
.tl-toggle { grid-column: -2 / -1; justify-self: end; align-self: center; }
.tl-details { display: grid; gap: var(--sp-3); margin-top: var(--sp-3); }
.tl-meta, .tl-suggestion, .evidence-line, .term-concept-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-2); overflow-wrap: anywhere; }
.term-english-evidence { display: grid; gap: var(--sp-1); }
.tl-none { align-self: center; }
.forms-case-table { width: 100%; table-layout: fixed; border-collapse: collapse; }
.forms-case-table th, .forms-case-table td { padding: var(--sp-1); text-align: start; vertical-align: top; overflow-wrap: anywhere; }
.forms-case-table th:first-child { width: 25%; }
.forms-case-table .mud-input-control { min-width: 0; }
@media (max-width: 599.98px) { .tl-main { grid-template-columns: minmax(0, 1fr); } .tl-text { grid-column: auto; } }

@media (max-width: 450px) {
    .forms-case-table th:first-child { width: 35%; overflow-wrap: normal; word-break: normal; }
}

.construction-custom { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-2); padding: var(--sp-3); border: 1px solid var(--c-line-2); border-radius: var(--r-md); }

.help-sections { padding: var(--sp-3); margin-bottom: var(--sp-4); border: 1px solid var(--c-line-2); border-radius: var(--r-md); }
.help-sections summary { cursor: pointer; }
.help-subsection { margin-inline-start: var(--sp-4); }
.help-search-results li { margin-bottom: var(--sp-4); overflow-wrap: anywhere; }
/* The guide (D-451): a task, its example from the game and its collapsed details. */
.help-content h1, .help-content h2, .help-content h3 { scroll-margin-top: var(--sp-6); }
.help-content h2:not(:first-of-type) { padding-top: var(--sp-5); border-top: 1px solid var(--c-line); }
.help-content > p, .help-content > ul, .help-content > ol, .help-content > details, .help-content > blockquote { max-width: 80ch; }
.help-content blockquote { margin: var(--sp-3) 0; padding: var(--sp-2) var(--sp-3); border-left: 3px solid var(--c-line-2); background: var(--c-sunken); border-radius: var(--r-sm); }
.help-content p, .help-content ol, .help-content ul { margin-block: var(--sp-2); }
.help-content blockquote p { margin: 0; }
.help-content details:not(.help-sections) { margin: var(--sp-3) 0; }
.help-content details:not(.help-sections) > summary { cursor: pointer; color: var(--c-link); width: fit-content; }
.help-content details:not(.help-sections)[open] { padding-left: var(--sp-3); border-left: 3px solid var(--c-line-2); }
.help-content details:not(.help-sections)[open] > summary { margin-left: calc(var(--sp-3) * -1 - 3px); margin-bottom: var(--sp-2); }

.composed-values { table-layout: fixed; }
.composed-values td { vertical-align: top; overflow-wrap: anywhere; }
.composed-full-result { white-space: pre-wrap; overflow-wrap: anywhere; }

/* The height of the window less the header and the controls (D-465); a phone keeps a strip of the page to scroll by, because the canvas takes every touch. */
.graph-canvas { overflow: hidden; height: calc(100dvh - 180px); min-height: 420px; touch-action: none; cursor: grab; }
.graph-stage-full { position: fixed; inset: 0; z-index: 1390; display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-3); background: var(--c-bg); overflow: auto; }
.graph-stage-full .graph-canvas { flex: 1 1 auto; height: auto; min-height: 240px; }
@media (max-width: 599.98px) { .graph-stage:not(.graph-stage-full) .graph-canvas { height: 70dvh; min-height: 320px; } }
.graph-canvas > svg { width: 100%; height: 100%; }
.graph-canvas:focus-visible { outline: 2px solid var(--c-link); outline-offset: 2px; }
.graph-dimmed { opacity: .2; }
.graph-connected .graph-node rect { stroke-width: 3; }
.graph-edge.graph-connected { stroke-width: 3; }
.graph-node.node-group rect { stroke: var(--c-link); }
.graph-controls { flex-wrap: wrap; }

@media (max-width: 599.98px) {
    .composed-values .mud-table-cell { display: block; text-align: left; }
    .composed-values .mud-table-cell::before { display: block; float: none; width: auto; text-align: left; margin-bottom: var(--sp-2); }
    .composed-values .mud-table-cell > * { min-width: 0; max-width: 100%; text-align: left; }
    .composed-values .badge { white-space: normal; overflow-wrap: anywhere; }
}

/* D-380, D-415: the read-only EN row of the language table and the figure of a concept. */
.tl-source { margin-top: var(--sp-2); display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-2); padding: var(--sp-2) var(--sp-3); border: 1px dashed var(--c-line); border-radius: var(--r-md); overflow-wrap: anywhere; }

/* D-425: filters of composed texts in rows of their own, custom construction with fields of a working width, compact phone rows. */
.composed-filters { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--sp-2) var(--sp-5); justify-items: start; margin-bottom: var(--sp-2); }
.composed-filters .choice-chips { min-width: 0; }
.construction-custom { justify-items: start; }
.construction-custom .mud-input-control { width: 100%; }
/* A field of a long form name (D-304 width) shrinks with a narrow screen instead of widening the page: a grid item is at least its content otherwise. */
.construction-custom > * { min-width: 0; max-width: 100%; }
@media (max-width: 799.98px) {
    .composed-table td.phone-rest, .family-list td.phone-rest { display: none; }
    .composed-table .row-meta, .family-list .meta-line { display: none; }
    .composed-table tr.composed-row { padding: var(--sp-1) 0; }
    .composed-table .cell-action { text-align: left; }
    .family-list tr.mud-table-row td.mud-table-cell { padding-block: 2px; }
}

/* F-003 (D-657): the sign of a version other than the working one in the header button; the bar holds the words and the way back. */
.scope-other-sign { color: var(--b-warn); margin-left: var(--sp-1); font-size: 0.75em; }
/* P-4 (D-780): the project of a link on this screen only, with its two ways out. */
.scope-link-sign { color: var(--b-info); margin-left: var(--sp-1); font-size: 0.75em; }
.scope-link { display: inline-flex; align-items: center; gap: var(--sp-1); flex-wrap: wrap; }

/* F-222 (D-671): a public string card fits the phone: the key and the texts wrap anywhere instead of widening the table. */
.public-strings code.key { white-space: normal; overflow-wrap: anywhere; }
.public-strings .public-key-cell { display: block; min-width: 0; flex: 1 1 auto; }
.public-strings .mud-table-cell { overflow-wrap: anywhere; min-width: 0; }
.public-strings .public-open-string { display: inline-block; margin-top: var(--sp-1); }

/* U3-13 (D-812): one repeated key is one framed card; the choice, the line, the text and "as in the previous version" stay in their columns. */
.duplicate-key { border: 1px solid var(--c-line); border-radius: var(--r-md); padding: var(--sp-2) var(--sp-3); margin: 0 0 var(--sp-2); }
.duplicate-row { display: grid; grid-template-columns: 40px 90px minmax(0, 1fr) 140px; align-items: start; gap: var(--sp-2); padding: 2px 0; }
.duplicate-row + .duplicate-row { border-top: 1px dashed var(--c-line); }
.duplicate-rows { width: 100%; }
.duplicate-keys[inert] { opacity: .6; }
.duplicate-key .mud-radio-group, .duplicate-key .mud-input-control { width: 100%; }
.duplicate-text { min-width: 0; overflow-wrap: anywhere; }
.duplicate-invisible { display: block; color: var(--c-warn-fg); }
.duplicate-same { color: var(--c-muted); margin: 0 0 var(--sp-1); }
.duplicates-summary { font-weight: 600; margin: 0 0 var(--sp-1); }
@media (max-width: 600px) {
    .duplicate-row { grid-template-columns: 40px minmax(0, 1fr); }
    .duplicate-row > :nth-child(3), .duplicate-row > :nth-child(4) { grid-column: 2; }
}
.decision-counts { list-style: none; display: flex; flex-wrap: wrap; gap: var(--sp-2); padding: 0; margin: 0 0 var(--sp-3); }
.decision-counts li { border: 1px solid var(--c-line); border-radius: var(--r-md); padding: 2px var(--sp-2); }
.decision-actions { position: sticky; bottom: 0; background: var(--c-panel); padding: var(--sp-2) 0; z-index: 2;
  container-type: scroll-state; container-name: decision-actions; }
/* U3-13 (D-817; Modern Web Guidance "state-aware-sticky-headers"): the pinned actions get a border and a shadow only while they are stuck over the
   list; a field that takes the focus scrolls above them and above the save bar, not under them (WCAG 2.4.11). */
@container decision-actions scroll-state(stuck: bottom) {
  .decision-actions-bar { border-top: 1px solid var(--c-line); box-shadow: var(--shadow-popover); }
}
html:has(.decision-actions) { scroll-padding-block-end: 8rem; }
.feed-check { display: inline-flex; flex-direction: column; gap: 2px; align-items: flex-start; }
.feed-check-result { color: var(--c-muted); max-width: 360px; }
/* U3-17 (D-820): the star to follow by the name; a followed project in "Wszystkie" is the whole row set apart (tint + line), the star is the sign
   that does not rely on colour. */
.project-name-row { display: flex; align-items: flex-start; gap: var(--sp-1); }
.project-name-row .row-title { flex: 1 1 auto; min-width: 0; }
.project-follow { color: var(--c-muted); }
/* The icon button by the name in the table pulls back to the edge of the cell; the text button in the page head stays inside its actions (D-874). */
.project-name-row > .project-follow { margin-left: calc(-1 * var(--sp-2)); }
.project-follow.on { color: var(--c-accent); }
.projects-table tr.row-mine { background: color-mix(in srgb, var(--c-accent-soft) 60%, transparent); box-shadow: inset 3px 0 0 var(--c-accent); }
.my-projects-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.my-projects-list li { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); }
.my-projects-name { min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; column-gap: var(--sp-2); }
.my-projects-list li > .mud-button-root { flex: none; }

/* U3-09 (D-815): the page of a person and "Moja praca". */
/* U3-18 (D-821): a person's page is a profile — a card with the avatar, the name, about, link, dates, roles and the numbers of the work. */
.person-profile { display: flex; align-items: flex-start; gap: var(--sp-4); padding: var(--sp-4); margin-bottom: var(--sp-4); background: var(--c-surface);
  border: 1px solid var(--c-line-2); border-radius: var(--r-lg); }
.person-profile-body { flex: 1 1 auto; min-width: 0; display: grid; gap: var(--sp-3); }
.person-profile .page-head { margin: 0; }
.person-profile .page-title { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.person-about-text { white-space: pre-line; max-width: var(--w-measure); margin: var(--sp-1) 0 0; }
.person-groups { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1); margin: 0; }
.person-stats { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-6); margin: 0; padding-top: var(--sp-3); border-top: 1px solid var(--c-line-soft); }
.person-stat { display: flex; flex-direction: column-reverse; min-width: 0; }
.person-stat dt { color: var(--c-muted); font-size: var(--fs-meta); }
.person-stat dd { margin: 0; font-size: var(--fs-xl); font-weight: 600; font-variant-numeric: tabular-nums; }
/* U3-26 (D-826, docs/ui.md#awatar): one avatar — the own picture, or letters on a colour fixed by the id, or the icon of the system. The palette
   keeps white letters at 4.5:1 or more in both themes; the letters, not the colour, carry who it is. */
.person-avatar { display: inline-flex; flex: none; align-items: center; justify-content: center; border-radius: 50%; color: #FFFFFF; font-weight: 600;
  line-height: 1; letter-spacing: .02em; user-select: none; overflow: hidden; vertical-align: middle; }
.person-avatar--small { width: 1.5rem; height: 1.5rem; font-size: 10px; }
.person-avatar--medium { width: 2rem; height: 2rem; font-size: var(--fs-xs); }
.person-avatar--large { width: 4.5rem; height: 4.5rem; font-size: var(--fs-2xl); }
.person-avatar--picture { object-fit: cover; background: var(--c-surface-2); }
.avatar-settings { display: flex; align-items: flex-start; gap: var(--sp-4); }
.avatar-settings-body { min-width: 0; }
.avatar-settings-title { font-weight: 600; }
.avatar-settings-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.avatar-choose { cursor: pointer; }
.avatar-choose:focus-within { outline: 2px solid var(--mud-palette-primary); outline-offset: 2px; }
/* The avatar before a name that says who did it (history, comments, proposals, disputes). */
.person-link--avatar { display: inline-flex; align-items: center; gap: var(--sp-1); vertical-align: middle; }
.notification-who { float: left; margin: 2px var(--sp-2) 0 0; }
.person-avatar--system { background: var(--c-surface-2); color: var(--c-text-2); border: 1px solid var(--c-line-2); }
.avatar-c1 { background: #2E5E8C; } .avatar-c2 { background: #6B4C9A; } .avatar-c3 { background: #2F6E52; } .avatar-c4 { background: #9A4A2C; }
.avatar-c5 { background: #7A5414; } .avatar-c6 { background: #8C3A5A; } .avatar-c7 { background: #2D6873; } .avatar-c8 { background: #545C6B; }
.person-filters { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.person-filters > * { flex: 0 1 260px; min-width: 0; }
.person-project-star { color: var(--c-accent); vertical-align: -3px; margin-right: var(--sp-1); }
/* Compact rows of changes: one meta line, EN beside the text; rows divided by a line, not a card each. */
@media (max-width: 799.98px) {
    .person-profile { flex-direction: column; padding: var(--sp-3); }
    .person-avatar--large { width: 3.5rem; height: 3.5rem; font-size: var(--fs-xl); }
}
/* U3-19 (D-822): the state choice of "Moja praca" stands apart from the tabs above and the table below. */
.my-work-choice { margin: var(--sp-3) 0; }
.data-table td.nowrap { white-space: nowrap; }
.person-link { color: inherit; text-decoration: underline; text-decoration-color: var(--c-line-2); text-underline-offset: 2px; }
.person-link:hover { color: var(--c-link); text-decoration-color: currentColor; }

/* U3-11 (D-816), U3-20 (D-823): the activity — rows like a feed, not a card each: the avatar, the name (once for the following rows of the same
   person), what was done in the text colour, the objects as links, the time at the right; days as a divider with their name. */
/* U3-27, U3-30 (D-827, docs/ui.md#wpis-zmiany): the entry of a change — who and the kind (a badge with an icon) on the first line with the time at
   the right, where on the second, then the texts; rows divided by a line, not a card each. */
.change-list { list-style: none; padding: 0; margin: 0; }
.change-entry { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-3); padding: var(--sp-2) var(--sp-2); border-bottom: 1px solid var(--c-line-soft); }
.change-entry--avatar { grid-template-columns: 2rem minmax(0, 1fr); }
.change-entry:hover { background: var(--c-hover); }
.change-avatar { padding-top: 2px; }
.change-main { min-width: 0; display: grid; gap: var(--sp-1); }
.change-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-2); min-width: 0; }
.change-head .change-time { margin-left: auto; color: var(--c-muted); font-size: var(--fs-meta); font-variant-numeric: tabular-nums; white-space: nowrap; }
.change-system { font-weight: 600; }
.change-kind { font-weight: 600; }
.change-count { font-weight: 400; }
.change-texts { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--sp-1) var(--sp-4); }
.change-texts > div { min-width: 0; overflow-wrap: anywhere; }
.change-before { color: var(--c-text-2); }
.change-entry .text-label { display: inline-block; min-width: 2.5rem; color: var(--c-muted); font-size: var(--fs-meta); }
.change-entry--compact .change-texts { grid-template-columns: minmax(0, 1fr); gap: 0; }
.change-plain { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--c-text-2); }
.change-entry--compact .change-texts .text-label { display: none; }
@media (max-width: 799.98px) {
    .change-texts { grid-template-columns: minmax(0, 1fr); }
}
/* U3-23 (D-828): the list of people. */
.team-person { display: flex; align-items: flex-start; gap: var(--sp-2); min-width: 0; }
.team-person .row-title { min-width: 0; }
.team-projects { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-2); font-size: var(--fs-sm); }
.team-more { color: var(--c-text-2); }
.project-team-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--sp-2) var(--sp-4); margin-bottom: var(--sp-2); }
.project-team-links { display: inline-flex; gap: var(--sp-3); font-size: var(--fs-sm); }
.activity-filters { display: grid; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.activity-who-filters { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--sp-2) var(--sp-4); }
.activity-people { flex: 0 1 360px; min-width: 0; }
.activity-person-strings { align-self: center; font-size: var(--fs-sm); }
.activity-fields { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--sp-2); }
.activity-fields > * { flex: 0 1 220px; min-width: 0; }
.activity-day { display: flex; align-items: center; gap: var(--sp-3); margin: var(--sp-5) 0 var(--sp-2); font-size: var(--fs-meta); font-weight: 600; color: var(--c-text-2); }
.activity-day::after { content: ""; flex: 1 1 auto; border-top: 1px solid var(--c-line-soft); }
.activity-day-items, .activity-items { list-style: none; padding: 0; margin: 0; }
.activity-detail { font-size: var(--fs-meta); }
.activity-entry { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-2); margin-top: var(--sp-1); min-width: 0; }
.activity-more summary { cursor: pointer; margin-top: var(--sp-1); font-size: var(--fs-meta); color: var(--c-link); }
.activity-items li + li { margin-top: var(--sp-1); }
.activity-load-more { margin-top: var(--sp-3); }

/* U3-37 (D-857, docs/ui.md#formularze): a row of fields and buttons lines up the boxes of its controls — the frame of a field, a button — not the items
   with what stands under them. Two things under or over a control used to move it: the 8 px room of a dense field for its label (a button beside it sat
   4 px higher) and a hint, a counter or an error under a field (the field rose by half of it). So in every such row the other items take the same 8 px
   room, and the line under a field leaves the flow while the row keeps the room for it below. One rule for every row of controls; the check "align"
   of eng/browser/look.mjs finds a row that still moves a control. */
:is(.action-row, .filter-row, .list-toolbar-row, .language-form, .policy-row, .slot-row, .selector-fields, .discovery-form, .combination-toolbar, .spelling-add) { align-items: center; }
/* A field is a dense MudBlazor field, a SearchPicker or a MudSelect (each a dense field inside); :has() cannot stand inside :has(), so they are named. */
:is(.action-row, .filter-row, .list-toolbar-row, .language-form, .policy-row, .slot-row, .selector-fields, .discovery-form, .combination-toolbar, .spelling-add):has(> :is(.mud-input-control-margin-dense, .search-picker, .mud-select))
    > :not(.mud-input-control-margin-dense, .search-picker, .mud-select) { margin-top: var(--sp-2); }
:is(.action-row, .filter-row, .list-toolbar-row, .language-form, .policy-row, .slot-row, .selector-fields, .discovery-form, .combination-toolbar, .spelling-add) .mud-input-control:has(> .mud-input-control-helper-container) { position: relative; }
:is(.action-row, .filter-row, .list-toolbar-row, .language-form, .policy-row, .slot-row, .selector-fields, .discovery-form, .combination-toolbar, .spelling-add) .mud-input-control > .mud-input-control-helper-container { position: absolute; top: 100%; left: 0; right: 0; }
:is(.action-row, .filter-row, .list-toolbar-row, .language-form, .policy-row, .slot-row, .selector-fields, .discovery-form, .combination-toolbar, .spelling-add):has(.mud-input-helper-text) { padding-bottom: var(--sp-5); }
/* The actions of a page header: buttons of one height (36 px) side by side, so they line up at the top, and a result under one of them (Sprawdź nowe
   wersje) grows down instead of lifting it. The ⋮ beside them (48 px) rises by 4 px, so its centre is within 2 px of theirs. */
.page-head-actions { align-items: flex-start; }
.page-head-actions .mud-button-root:not(.mud-icon-button) { min-height: 36px; }
.page-head-actions > :is(.mud-icon-button, .mud-menu:has(.mud-icon-button)) { align-self: flex-start; margin-top: calc(-1 * var(--sp-1)); }

/* docs/ui.md#historia-zmian (D-911): the history of changes; the versions new since the last visit have the accent line. */
.changelog-current { margin: 0 0 var(--sp-5); }
.changelog { display: flex; flex-direction: column; gap: var(--sp-5); line-height: 1.6; }
.changelog-version { border-left: 3px solid transparent; padding-left: var(--sp-3); scroll-margin-top: var(--sp-7); }
.changelog-version-new { border-left-color: var(--mud-palette-primary); }
.changelog-title { font-size: var(--fs-lg); margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.changelog-title a { color: inherit; text-decoration: none; }
.changelog-title a:hover, .changelog-title a:focus-visible { text-decoration: underline; }
.changelog-date { font-weight: normal; }
.changelog-kind { font-size: var(--fs-md); margin: var(--sp-3) 0 var(--sp-1); }
.changelog ul { margin: 0; padding-left: var(--sp-5); }
.menu-version { color: var(--mud-palette-text-secondary); }

/* docs/ui.md#informacja-o-danych (D-914): the information about personal data, a readable document also without the navigation. */
.privacy { line-height: 1.6; max-width: 960px; margin: 0 auto; padding: var(--sp-5) var(--sp-4); }
.privacy h2 { font-size: var(--fs-lg); margin: var(--sp-5) 0 var(--sp-2); }
.privacy ul { padding-left: var(--sp-5); }
