/* Peargament – modern theme (light + dark).
   Layout/geometry (grids, widths, margins) is unchanged from the 1:1 Avalonia port;
   only colours, borders, radii, shadows and transitions differ. */

/* ---------- Font: Arial from the operating system ----------
   No font file is shipped (Arial may not be redistributed). Windows and macOS have Arial installed;
   Linux falls back to the metric-compatible "Liberation Sans" / "Arimo", then Helvetica, then the default sans-serif. */

/* ---------- Text size (Klein / Mittel / Groß) ----------
   js/theme.js sets data-text-size="s|m|l" on <html> before the first paint (stored per browser in localStorage).
   Every font size and every text-dependent size (control heights, label columns, input widths) is
   calc(<size at Klein> * var(--font-scale)), so the whole UI grows with the chosen size.
   Klein = the former size (14px), Mittel = default (16px), Groß = 18px (whole-pixel base sizes render crisper).
   The factors are relative to the base size and work the same with Arial. */
:root { --font-scale: calc(16 / 14); }                      /* Mittel (default, also without JS) ~1.14 */
:root[data-text-size="s"] { --font-scale: 1; }
:root[data-text-size="l"] { --font-scale: calc(18 / 14); }  /* ~1.29 */

/* ---------- Design tokens: light ---------- */
:root {
    color-scheme: light;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-soft: #e8f0fe;
    --accent-ring: rgba(37, 99, 235, .28);
    --on-accent: #ffffff;

    --text: #111827;
    --text-muted: #6b7280;
    --text-disabled: #9ca3af;

    --bg: #eef0f3;
    --surface: #ffffff;
    --surface-2: #f9fafb;
    --panel: #e6eaf0;            /* replaces the Avalonia LightGray (#d3d3d3) panels */
    --panel-border: #d9dee6;
    --border: #e5e7eb;
    --border-strong: #d1d5db;

    --control-bg: #ffffff;
    --control-bg-disabled: #f3f4f6;
    --control-border: #d1d5db;
    --control-border-hover: #9ca3af;

    --button-bg: #ffffff;
    --button-bg-hover: #f3f4f6;
    --button-bg-active: #e5e7eb;
    --button-border: #d1d5db;

    --row-hover: #f3f4f6;
    --row-selected: #dbeafe;
    --group-row: #eef1f5;
    --group-row-2: #f6f7f9;
    --menu-bg: #ffffff;

    --save-bg: #cdeef3;          /* modern PowderBlue */
    --save-bg-hover: #b6e4ec;
    --save-text: #0e4f5c;

    --green: #16a34a;
    --orange: #f59e0b;
    --red: #dc2626;
    --yellow: #fde047;
    --yellow-text: #422006;

    --danger-text: #b91c1c;
    --danger-bg: #fef2f2;
    --info-bg: #eff6ff;

    --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
    --shadow-md: 0 4px 12px rgba(16, 24, 40, .08), 0 1px 3px rgba(16, 24, 40, .06);
    --shadow-lg: 0 20px 40px rgba(16, 24, 40, .18), 0 4px 12px rgba(16, 24, 40, .08);
    --backdrop: rgba(17, 24, 39, .45);

    --radius-sm: 6px;
    --radius: 8px;
    --radius-lg: 12px;
    --ease: 120ms ease;
}

/* ---------- Spacing tokens (same in light/dark and for every text size) ----------
   One small set of distances for the whole app; margins stay fixed px like before, only text-dependent sizes scale.
   --space-1  5px  margin around a single control (.m5), button/label distance inside a row
   --space-2 10px  panel padding (effective, incl. the children's .m5), gap between panels/blocks, tab bar -> content
   --space-3 15px  space above the button row of a form/dialog
   --space-4 20px  dialog/modal padding, gap between two text columns
   --gap-buttons   gap between buttons standing side by side (dialog buttons)
   --label-gap     label above its control (stacked fields)
   --field-gap     between two stacked fields (label+control blocks) */
:root {
    --space-1: 5px;
    --space-2: 10px;
    --space-3: 15px;
    --space-4: 20px;
    --gap-buttons: 8px;
    --label-gap: 3px;
    --field-gap: 8px;
}

/* ---------- Design tokens: dark ---------- */
:root[data-theme="dark"] {
    color-scheme: dark;
    --accent: #60a5fa;
    --accent-hover: #93c5fd;
    --accent-soft: #172554;
    --accent-ring: rgba(96, 165, 250, .35);
    --on-accent: #0b1220;

    --text: #e5e7eb;
    --text-muted: #9ca3af;
    --text-disabled: #6b7280;

    --bg: #0f1115;
    --surface: #171a21;
    --surface-2: #1c2029;
    --panel: #1e232c;
    --panel-border: #2a303b;
    --border: #2a303b;
    --border-strong: #3a4250;

    --control-bg: #12151b;
    --control-bg-disabled: #1a1e26;
    --control-border: #3a4250;
    --control-border-hover: #556070;

    --button-bg: #232833;
    --button-bg-hover: #2c3340;
    --button-bg-active: #353d4c;
    --button-border: #3a4250;

    --row-hover: #222833;
    --row-selected: #1e3a8a;
    --group-row: #232934;
    --group-row-2: #1c2129;
    --menu-bg: #1c2029;

    --save-bg: #134e5a;
    --save-bg-hover: #186575;
    --save-text: #d5f5fa;

    --green: #22c55e;
    --orange: #fbbf24;
    --red: #ef4444;
    --yellow: #ca8a04;
    --yellow-text: #fffbeb;

    --danger-text: #fca5a5;
    --danger-bg: #2a1215;
    --info-bg: #0f1d3a;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-md: 0 4px 14px rgba(0, 0, 0, .45);
    --shadow-lg: 0 24px 48px rgba(0, 0, 0, .6);
    --backdrop: rgba(0, 0, 0, .6);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    font-family: Arial, "Liberation Sans", Arimo, "Helvetica Neue", Helvetica, sans-serif; /* system Arial, nothing downloaded */
    font-size: calc(14px * var(--font-scale));
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}
body { transition: background-color 200ms ease, color 200ms ease; }

a { color: inherit; }
::selection { background: var(--accent-ring); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Thin themed scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

.bold { font-weight: 600; }
.m5 { margin: var(--space-1); }
.w200 { width: calc(200px * var(--font-scale)); }
.center { text-align: center; }
.hstack { display: flex; flex-direction: row; align-items: center; gap: 0; flex-wrap: wrap; }
.vstack { display: flex; flex-direction: column; }
.text-danger, .text-unsaved { color: var(--danger-text); }
.text-unsaved { font-weight: 500; }

/* ---------- Controls ---------- */
.btn {
    font: inherit;
    font-weight: 500;
    background: var(--button-bg);
    border: 1px solid var(--button-border);
    border-radius: var(--radius-sm);
    padding: 5px 11px 6px 11px;
    min-height: calc(32px * var(--font-scale));
    cursor: pointer;
    color: var(--text);
    box-shadow: var(--shadow-sm);
    transition: background-color var(--ease), border-color var(--ease), box-shadow var(--ease), color var(--ease);
}
.btn:hover:not(:disabled) { background: var(--button-bg-hover); border-color: var(--control-border-hover); }
.btn:active:not(:disabled) { background: var(--button-bg-active); box-shadow: none; }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-ring); }
.btn:disabled { color: var(--text-disabled); cursor: default; box-shadow: none; opacity: .7; }
.btn-accent { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-accent:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }

.tb, select.tb, textarea.tb {
    font: inherit;
    min-height: calc(32px * var(--font-scale));
    padding: 5px 10px 6px 10px;
    border: 1px solid var(--control-border);
    border-radius: var(--radius-sm);
    background: var(--control-bg);
    color: var(--text);
    transition: border-color var(--ease), box-shadow var(--ease), background-color var(--ease);
}
.tb:hover:not(:disabled):not([readonly]) { border-color: var(--control-border-hover); }
.tb:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.tb:disabled, .tb[readonly] { background: var(--control-bg-disabled); color: var(--text-muted); }
.tb::placeholder { color: var(--text-disabled); }
textarea.tb { resize: vertical; }

.checkbox { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.checkbox input { width: calc(18px * var(--font-scale)); height: calc(18px * var(--font-scale)); margin: 0; accent-color: var(--accent); }

.hstack > span { margin-right: 4px; }

.error-box {
    margin: 8px 0;
    padding: 8px 12px;
    border-left: 4px solid var(--red);
    border-radius: var(--radius-sm);
    background: var(--danger-bg);
}
.error-text { color: var(--danger-text); margin-top: 6px; }
.info-box { margin: 8px 0; padding: 8px 12px; border-left: 4px solid var(--accent); border-radius: var(--radius-sm); background: var(--info-bg); }

/* ---------- Main window ---------- */
.main-window { display: grid; grid-template-rows: auto auto 1fr; min-height: 100vh; }

.menubar {
    display: flex; align-items: center; min-height: calc(32px * var(--font-scale)); padding: 0 4px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.menubar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.menubar-user { color: var(--text-muted); }
.menubar form { margin: 0; }
.menu-item { position: relative; outline: none; }
.menu-button {
    font: inherit; background: transparent; border: none; padding: 6px 10px;
    border-radius: var(--radius-sm); cursor: pointer; color: var(--text);
    transition: background-color var(--ease);
}
.menu-button:hover, .menu-item.open > .menu-button { background: var(--row-hover); }
.menu-popup {
    position: absolute; top: 100%; left: 0; z-index: 100; min-width: calc(260px * var(--font-scale)); margin-top: 4px;
    background: var(--menu-bg); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-md); padding: 4px;
    animation: pop-in 120ms ease-out;
}
.menu-popup a { display: block; padding: 7px 12px; border-radius: var(--radius-sm); text-decoration: none; }
.menu-popup a:hover { background: var(--row-hover); }

/* Theme toggle (menubar) */
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; width: calc(32px * var(--font-scale)); height: calc(32px * var(--font-scale)); padding: 0; }
.theme-toggle svg { width: calc(18px * var(--font-scale)); height: calc(18px * var(--font-scale)); fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* Text size switch (menubar, next to the theme toggle): three "A" of growing size; js/theme.js stores the choice */
.text-size { display: inline-flex; align-items: center; gap: 2px; padding: 2px; border: 1px solid var(--border); border-radius: var(--radius); }
.text-size .menu-button {
    display: inline-flex; align-items: flex-end; justify-content: center; padding: 0 0 5px 0; line-height: 1;
    width: calc(28px * var(--font-scale)); height: calc(28px * var(--font-scale)); font-weight: 600; color: var(--text-muted);
}
.text-size .text-size-s { font-size: calc(11px * var(--font-scale)); }
.text-size .text-size-m { font-size: calc(14px * var(--font-scale)); }
.text-size .text-size-l { font-size: calc(18px * var(--font-scale)); }
.text-size .menu-button:hover { color: var(--text); }
.text-size .menu-button:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-ring); }
/* current size: pure CSS (the buttons are re-rendered by Blazor), aria-pressed is kept in sync by theme.js */
:root[data-text-size="s"] .text-size .text-size-s,
:root:not([data-text-size="s"]):not([data-text-size="l"]) .text-size .text-size-m,
:root[data-text-size="l"] .text-size .text-size-l { background: var(--accent-soft); color: var(--accent); }

.main-header {
    display: grid; grid-template-columns: 1fr auto; align-items: start;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.main-title { margin: 10px 10px 10px 20px; font-weight: 700; font-size: 30px; text-decoration: none; letter-spacing: -.02em; } /* 20px from the left edge, same as the logo on the right */
.main-title:hover { color: var(--accent); }
.main-logo { width: 210px; margin: 10px 20px 10px 10px; border-radius: var(--radius); }
:root[data-theme="dark"] .main-logo { background: #fff; box-shadow: var(--shadow-sm); }
.main-content { margin: 10px; min-width: 0; }

/* ---------- Tabs ---------- */
.tabcontrol { display: flex; flex-direction: column; min-width: 0; }
.tab-headers { display: flex; flex-wrap: wrap; border-bottom: 1px solid var(--border); }
.tab-header {
    font: inherit; font-size: calc(20px * var(--font-scale)); font-weight: 500; background: none; border: none; cursor: pointer;
    padding: 6px 12px 10px 12px; color: var(--text-muted); position: relative;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    transition: color var(--ease), background-color var(--ease);
}
.tab-header:hover:not(:disabled) { color: var(--text); background: var(--row-hover); }
.tab-header.active { color: var(--text); }
.tab-header.active::after {
    content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 3px;
    border-radius: 3px 3px 0 0; background: var(--accent);
}
.tab-header:disabled { color: var(--text-disabled); cursor: default; }
.tab-content { padding-top: var(--space-2); min-width: 0; }

/* ---------- Overview (Aufzüge / Kunden) ---------- */
.overview-header { display: grid; grid-template-columns: auto 1fr; align-items: center; }

/* ---------- DataGrid ---------- */
.datagrid {
    overflow: auto; max-height: calc(100vh - 260px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.datagrid table { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; }
.datagrid th {
    position: sticky; top: 0; background: var(--surface-2); z-index: 1;
    text-align: left; font-weight: 600; font-size: calc(13px * var(--font-scale)); color: var(--text-muted);
    padding: 8px 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    border-bottom: 1px solid var(--border); user-select: none;
}
.datagrid th.sortable { cursor: pointer; transition: color var(--ease), background-color var(--ease); }
.datagrid th.sortable:hover { background: var(--row-hover); color: var(--text); }
.sort-indicator { font-size: calc(10px * var(--font-scale)); margin-left: 4px; color: var(--accent); }
.datagrid td { padding: 6px 12px; height: calc(32px * var(--font-scale)); white-space: nowrap; font-variant-numeric: tabular-nums; border-bottom: 1px solid var(--border); }
.datagrid tbody tr:last-child td { border-bottom: none; }
.datagrid tbody tr { cursor: default; transition: background-color 80ms ease; }
.datagrid tbody tr:hover { background: var(--row-hover); }
.datagrid tbody tr.selected { background: var(--row-selected); }
.datagrid tbody tr.selected td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.datagrid td.center, .datagrid th.center { text-align: center; }
/* grids with multi-line cells (e.g. Komponenten in Aufzug Ereignisse): all cells start at the top */
.datagrid-top td { vertical-align: top; }
.datagrid .cell-line { line-height: calc(20px * var(--font-scale)); white-space: nowrap; }
.datagrid td input.tb, .datagrid td select.tb { min-height: calc(28px * var(--font-scale)); padding: 2px 6px; }
/* buttons in table cells: same height as the inputs/selects in the cells (28 px at Klein), so all rows are equally high */
.datagrid td .btn { min-height: calc(28px * var(--font-scale)); padding: 2px 10px; }
/* cells holding a control get less vertical padding: rows with and without controls are equally high and the text of a
   control sits on the same line as the plain text of the row (also in top-aligned grids) */
.datagrid td { line-height: calc(20px * var(--font-scale)); }
.datagrid td:has(> .btn, > .tb, > .hstack, > .cb) { padding-top: 2px; padding-bottom: 2px; }
.datagrid-boxed { height: 200px; }

.status-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: middle; }
/* main page: hover area around the Anlagen status dot + Ereignisse pop-up */
.status-hover { display: inline-flex; padding: 4px; margin: -4px; cursor: help; }
.ereignis-popup {
    position: fixed; z-index: 1000; min-width: calc(360px * var(--font-scale)); max-width: min(1200px, calc(100vw - 16px));
    background: var(--surface); color: var(--text); border: 1px solid var(--border-strong);
    border-radius: var(--radius); box-shadow: var(--shadow-md); font-size: calc(14px * var(--font-scale)); /* same as the main table */
}
.ereignis-popup-title { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; font-weight: 700; border-bottom: 1px solid var(--border); background: var(--panel); border-radius: var(--radius) var(--radius) 0 0; }
.ereignis-popup-status { font-weight: 400; color: var(--text-muted); }
.ereignis-popup-scroll { max-height: 360px; overflow: auto; }
.ereignis-popup table { width: 100%; border-collapse: collapse; }
.ereignis-popup th { text-align: left; font-weight: 600; font-size: calc(13px * var(--font-scale)); color: var(--text-muted); padding: 6px 10px; white-space: nowrap; position: sticky; top: 0; background: var(--surface); }
.ereignis-popup td { padding: 6px 10px; line-height: calc(20px * var(--font-scale)); font-variant-numeric: tabular-nums; border-top: 1px solid var(--border); white-space: nowrap; vertical-align: top; }
.ereignis-popup td.ereignis-popup-fehler { white-space: normal; min-width: calc(180px * var(--font-scale)); }
.ereignis-popup td.ereignis-popup-text { white-space: pre-line; min-width: calc(200px * var(--font-scale)); max-width: calc(320px * var(--font-scale)); overflow-wrap: anywhere; }
.ereignis-popup tbody tr { cursor: pointer; }
.ereignis-popup .cell-line { white-space: nowrap; }
.ereignis-popup tbody tr:hover { background: var(--row-hover); }
.ereignis-popup-hint { padding: 5px 10px; color: var(--text-muted); font-size: 0.9em; border-top: 1px solid var(--border); }
.status-1 { background: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 22%, transparent); }
.status-2 { background: var(--orange); box-shadow: 0 0 0 3px color-mix(in srgb, var(--orange) 22%, transparent); }
.status-3 { background: var(--red); box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 22%, transparent); }
.cell-yellow { background: var(--yellow); color: var(--yellow-text); }
.cell-red { background: var(--red); color: #fff; }

/* ---------- "Windows" (detail pages, dialogs) ---------- */
.window-titlebar {
    display: flex; align-items: center; gap: 8px; padding: 6px 10px; font-size: calc(12px * var(--font-scale)); font-weight: 500;
    color: var(--text-muted); border-bottom: 1px solid var(--border);
    background: var(--surface-2);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.window-titlebar img { width: 16px; height: 16px; }
/* Ereignis: Kopfzeile mit Adresse groesser, Ruecksprung zum Aufzug als deutlicher Link-Button */
.ereignis-titlebar { font-size: calc(18px * var(--font-scale)); padding: 10px 14px; gap: 12px; color: var(--text); flex-wrap: wrap; }
.ereignis-titlebar .back-link {
    color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent-ring);
    border-radius: var(--radius-sm); padding: 6px 14px; font-weight: 600; text-decoration: none; white-space: nowrap;
    transition: background-color var(--ease), border-color var(--ease);
}
.ereignis-titlebar .back-link:hover { border-color: var(--accent); text-decoration: underline; }
.ereignis-titlebar .back-link:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-ring); }
.page-toolbar { display: flex; align-items: center; gap: 0; margin-bottom: 6px; }

/* Form grid like Avalonia Grid with label column + control column */
.form-grid { display: grid; grid-template-columns: max-content minmax(calc(150px * var(--font-scale)), 1fr); gap: 4px 10px; align-items: center; }
.form-grid > label { white-space: nowrap; }
.form-cols { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(300px, 1fr); gap: 20px; align-items: start; }
.groupbox { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; margin: 5px; background: var(--surface); }
.groupbox > .groupbox-header { font-weight: 600; margin-bottom: 8px; }

/* Modal dialog (replaces separate Avalonia windows / MessageBox) */
.modal-backdrop {
    position: fixed; inset: 0; background: var(--backdrop); z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(3px);
    animation: fade-in 150ms ease-out;
}
.modal-window {
    background: var(--surface); color: var(--text);
    border: 1px solid var(--border); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    min-width: 320px; max-width: 95vw; max-height: 92vh; overflow: auto;
    animation: pop-in 160ms ease-out;
}
.modal-body { padding: var(--space-4); }
.modal-buttons { display: flex; justify-content: flex-end; gap: var(--gap-buttons); padding: 0 var(--space-4) var(--space-4) var(--space-4); }
/* button row at the end of a form (dialogs, Aufzug erstellen/korrigieren, Erinnerung erstellen ...): right-aligned, equal gaps */
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: var(--gap-buttons); margin-top: var(--space-3); }
/* stacked form in dialogs: label, control, label, control ... (Aufzug erstellen/korrigieren, Benutzer, Erinnerung) */
.form-stack { display: flex; flex-direction: column; }
.form-stack > .tb, .form-stack > .form-row { margin: var(--space-1) 0; }
.form-row { display: flex; flex-wrap: nowrap; align-items: center; gap: var(--space-1); }
.form-two-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--space-2); }
.form-two-cols > .vstack > .tb { margin: var(--space-1) 0; width: 100%; min-width: 0; }
.dialog-body { padding: var(--space-4); }
.window-titlebar .modal-close { margin-left: auto; }
/* texts/checkboxes in a modal body sit on the same left/right edge as the dialog buttons */
.modal-body.vstack > .m5 { margin-left: 0; margin-right: 0; }
/* page-like windows with a table (Benutzerverwaltung) */
.dialog-content { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2); padding: var(--space-2); }
.dialog-content > .datagrid, .dialog-content > .error-box { width: 100%; margin: 0; }

/* ---------- Login window (400x200) ---------- */
.login-window {
    width: calc(400px * var(--font-scale)); max-width: calc(100% - 32px); margin: 10vh auto 0 auto;
    border: 1px solid var(--border); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg); background: var(--surface);
}
.login-panel { display: flex; flex-direction: column; margin: 20px; }
.login-panel > label { color: var(--text-muted); font-size: calc(13px * var(--font-scale)); font-weight: 500; }
.login-title { font-weight: 700; font-size: calc(20px * var(--font-scale)); margin-bottom: 20px; letter-spacing: -.01em; }
.login-panel .btn { align-self: flex-start; margin-top: 4px; }
.login-panel .btn[type=submit] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.login-panel .btn[type=submit]:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

/* ---------- Blazor ---------- */
#blazor-error-ui {
    background: var(--danger-bg); color: var(--text); border-top: 1px solid var(--red);
    bottom: 0; box-shadow: var(--shadow-md); display: none; left: 0;
    padding: .6rem 1.25rem .7rem 1.25rem; position: fixed; width: 100%; z-index: 2000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }

@media (max-width: 700px) {
    .main-logo { width: 98px; }
    .main-title { font-size: 22px; }
    .login-window { width: auto; margin: 16px; }
}

/* ListBox (multi select) */
.listbox { min-width: calc(190px * var(--font-scale)); overflow-y: auto; border: 1px solid var(--control-border); border-radius: var(--radius-sm); background: var(--control-bg); }
.listbox-item { padding: 5px 10px; cursor: pointer; user-select: none; transition: background-color 80ms ease; }
.listbox-item:hover { background: var(--row-hover); }
.listbox-item.selected { background: var(--row-selected); }

/* Detail window header (AufzugDetailWindow top grid) */
.detail-header { display: flex; flex-wrap: wrap; align-items: flex-end; }
.detail-field { display: flex; flex-direction: column; }
.detail-field > span { margin: 5px; }
.detail-field > .tb, .detail-field > .btn, .detail-field > .hstack { margin: 5px; }
.btn-save { background: var(--save-bg); border-color: transparent; color: var(--save-text); }
/* Grosse Buttons (Speichern, Neues Ereignis): 1,5-fach (Hoehe 32 -> 48 px, Schrift 14 -> 21 px, Innenabstand mitskaliert -> Breite ~1,5-fach) */
.btn.btn-save, .btn.btn-lg { font-size: calc(21px * var(--font-scale)); padding: 8px 17px 9px 17px; min-height: calc(48px * var(--font-scale)); }
.btn-save:hover:not(:disabled) { background: var(--save-bg-hover) !important; border-color: transparent; }
.detail-field.push-right { margin-left: auto; }
.nowrap { flex-wrap: nowrap; }
.button-pair { display: flex; flex-wrap: nowrap; align-items: center; gap: var(--space-1); }
/* unit after an input ("€") */
.unit { margin-left: var(--space-1); }

/* Drop zone (DragDrop border) */
/* All file drop zones (FileDropZone): one design – 10 % gap left/right, centered bold text, strong dashed border */
.dropzone {
    position: relative; display: flex; align-items: center; justify-content: center; text-align: center;
    margin-left: 10%; margin-right: 10%; min-height: 76px; padding: 8px 12px; cursor: pointer;
    font-weight: 700; color: #333333;      /* 80 % grey */
    border: 2px dashed #000000; border-radius: var(--radius-sm);
    background: var(--surface-2);
    transition: background-color var(--ease), border-color var(--ease);
}
.dropzone:hover { border-color: #000000; }
:root[data-theme="dark"] .dropzone { color: #cccccc; border-color: var(--text); }
:root[data-theme="dark"] .dropzone:hover { border-color: var(--text); }
.dropzone.over, :root[data-theme="dark"] .dropzone.over { background: var(--accent-soft); border-color: var(--accent); }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dialog-page { border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); background: var(--surface); max-width: 100%; }

/* Grey panels from the desktop app (LightGray StackPanels) -> soft surface panels */
.anlagen-panel, .grey-panel, .vertrag-box, .kontakt-box, .ereignis-box, .copy-top {
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius);
}
/* one inner distance for all panels: --space-2 from the border to the content.
   Panels whose children carry the .m5 / grid margin (--space-1) get the other half as padding. */
.grey-panel { padding: var(--space-1); }
/* Anlagendaten: padding on the grid, not on the panel (the panel is the size container of the column breakpoint) */
.anlagen-grid { padding: var(--space-1); }
.vertrag-box, .kontakt-box, .ereignis-box { padding: var(--space-2); }

/* AufzugAnlagenDaten (grey StackPanels with fixed column grid) */
.w190 { width: calc(190px * var(--font-scale)); max-width: calc(190px * var(--font-scale)); }
.anlagen-panel { margin-top: var(--space-2); container-type: inline-size; }
.anlagen-panel:first-child { margin-top: 0; }
.anlagen-grid {
    display: grid; align-items: center;
    grid-template-columns: calc(120px * var(--font-scale)) calc(250px * var(--font-scale)) calc(120px * var(--font-scale)) calc(250px * var(--font-scale))
                           calc(180px * var(--font-scale)) calc(250px * var(--font-scale)) calc(150px * var(--font-scale)) calc(250px * var(--font-scale));
}
/* 8 columns need 1650px at Klein (= 117.9em of the 14px base, em scales with the text size):
   if the panel is narrower (e.g. 1366px screens, or Mittel/Groß on 1920px), wrap to 4 columns (2 label/field pairs per row)
   instead of overflowing to the right. */
@container (max-width: 118em) {
    .anlagen-grid { grid-template-columns: calc(180px * var(--font-scale)) calc(250px * var(--font-scale)) calc(180px * var(--font-scale)) calc(250px * var(--font-scale)); }
}
.anlagen-grid > * { margin: 5px; }
/* Sonstiges + Datensatz angelegt/geändert: same gap to the panels above and between each other;
   no size containment here, otherwise the auto column collapses and the metadata panel overflows to the right */
.anlagen-bottom { display: grid; grid-template-columns: 1fr auto; align-items: start; gap: var(--space-2); margin-top: var(--space-2); }
.anlagen-bottom > .anlagen-panel { margin: 0; padding: var(--space-1); container-type: normal; display: grid; grid-template-columns: auto 1fr; align-items: start; }
.anlagen-bottom > .anlagen-panel > label { padding-top: 6px; }   /* first text line of the textarea */
.anlagen-bottom textarea.tb { height: 100px; }

/* AufzugTermine */
.termine-top { display: grid; grid-template-columns: auto 1fr; align-items: start; column-gap: var(--space-2); }
.termine-top + .grey-panel { margin-top: var(--space-2); }
.termine-grid2 > .bold { grid-column: span 2; }
/* checkbox groups inside the grid start at the label line, not 5 px further in */
.termine-grid3 > .hstack { gap: var(--space-2); }
.termine-grid3 > .hstack > .checkbox.m5 { margin: 0; }
.termine-grid3 > .hstack.span-2 { grid-column: span 2; }
.termine-top > .grey-panel:last-child { justify-self: start; }
.termine-grid3 { display: grid; grid-template-columns: auto auto auto; align-items: center; }
.termine-grid2 { display: grid; grid-template-columns: auto auto; align-items: center; }
.termine-grid4 { display: grid; grid-template-columns: auto auto auto auto; align-items: center; justify-content: start; }
.termine-grid3 > *, .termine-grid2 > *, .termine-grid4 > * { margin: 5px; }

/* AufzugVertragsdaten (UniformGrid Columns=4) */
.vertrag-grid { display: grid; grid-template-columns: repeat(4, minmax(260px, 1fr)); }
.vertrag-box { padding: 10px; margin: 10px; display: flex; flex-direction: column; }

/* AufzugKontaktdaten (UniformGrid Columns=5) */
.kontakt-grid { display: grid; grid-template-columns: repeat(5, minmax(220px, 1fr)); gap: var(--space-2); }
.kontakt-box { display: flex; flex-direction: column; }
.kontakt-box > .tb { width: 100%; }
/* card titles reserve two lines, so the fields below start on the same line in every card */
.kontakt-title { line-height: 1.25; min-block-size: 2.5em; }
.kontakt-label { padding: var(--field-gap) 0 var(--label-gap) 0; color: var(--text-muted); font-size: calc(13px * var(--font-scale)); }
/* Funktion (select + "+") as wide as the other inputs of the box */
.kontakt-box .lookup-combo select.tb { flex: 1 1 auto; width: auto !important; max-width: none !important; min-width: 0; }
.kontakt-box textarea.tb { height: 360px; }
.cb { width: calc(18px * var(--font-scale)); height: calc(18px * var(--font-scale)); accent-color: var(--accent); }
.group-row td { background: var(--group-row); font-weight: 600; }
.group-row-2 td { background: var(--group-row-2); padding-left: 28px; font-weight: 500; }
a.btn { text-decoration: none; display: inline-flex; align-items: center; }

/* EreignisWindow */
/* boxes flush with the title bar (main content edge), --space-2 apart */
.ereignis-box, .ereignis-grid3 { margin-top: var(--space-2); }
.ereignis-grid3 > .ereignis-box { margin-top: 0; }
.ereignis-top { display: grid; grid-template-columns: repeat(4, 1fr); align-items: center; padding: var(--space-1); }
.anlage-ok { padding: 5px; }
.anlage-steht {
    background: var(--red); color: #fff; padding: 5px; justify-self: start;
    border-radius: var(--radius-sm); font-weight: 600;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 25%, transparent);
}
/* three boxes side by side; the right box (Nr./Datum pairs) never gets narrower than its fields need, the other two share the rest */
.ereignis-grid3 {
    display: grid; gap: var(--space-2);
    grid-template-columns: minmax(260px, 1fr) minmax(260px, 1fr) minmax(calc(425px * var(--font-scale)), 1fr);
}
.ereignis-grid3 > .ereignis-box { min-width: 0; }
.ereignis-box > .button-row { display: flex; flex-wrap: wrap; gap: var(--gap-buttons); margin-bottom: var(--space-2); }
/* Preis Netto / Final / Brutto: label + field like the form rows above (no extra 5 px indent) */
.ereignis-box > .two-cols.price-cols { row-gap: var(--field-gap); margin-top: var(--field-gap); }
.price-cols > .vstack { gap: var(--label-gap); }
.price-cols > .vstack > .m5 { margin: 0; }
/* Beschreibung/Ursache/Maßnahmen | Notizen: real gap between the two columns, labels on the first text line */
.ereignis-box.two-cols { column-gap: var(--space-4); }
.form-grid.form-grid-top { align-items: start; }
.form-grid.form-grid-top > span { padding-top: calc(var(--space-1) + 6px); }
.ereignis-texts textarea.tb { height: 100px; }
/* Notizen fills its grid row: bottom edge flush with the last textarea on the left */
.ereignis-notes textarea.tb { height: auto; min-height: 317px; align-self: stretch; }
.ereignis-form { gap: 0 10px; }
.ereignis-form > * { margin: 5px 0; }
.two-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 5px; }
.two-cols > * { min-width: 0; }
.two-cols .tb, .ereignis-form .tb, .ereignis-form .lookup-combo select { width: 100%; min-width: 0; }
.ereignis-form { grid-template-columns: max-content minmax(0, 1fr); }
.ereignis-grid3 .hstack > .tb { flex: 1 1 auto; min-width: 0; }
/* Angebots/Rechnungs Nr. + Datum: minimum widths so number and date (incl. year and calendar icon) stay readable */
.ereignis-form > .two-cols.nr-date {
    grid-template-columns: minmax(calc(100px * var(--font-scale)), 1fr) minmax(calc(122px * var(--font-scale)), 1fr);
}

/* ---------- Motion ---------- */
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(4px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* inputs inside 2-column form rows must not overflow their grid cell */
.dialog-page .tb, .modal-window .tb { min-width: 0; }

/* "Daten von Anlage übernehmen" */
/* "Import aus" bar above all boxes: same panel as the boxes, text starts where the text of the first box starts */
.copy-top { margin: 10px 10px 0 10px; padding: 10px; }
.copy-top-vertrag { padding-left: 15px; } /* Vertragsdaten box content has an extra 5px (m5) */
.copy-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.copy-label { white-space: nowrap; }
.copy-input { flex: 1 1 140px; min-width: 120px; max-width: 260px; }
.kontakt-box .copy-bar { margin: 4px 0 0 0; }
/* "Import aus" row of a box: always at the bottom of the box (boxes of one row have the same height) */
.copy-bottom { margin-top: auto; padding-top: 6px; }
.modal-window .datagrid table { width: 100%; min-width: 0; }
.modal-window .datagrid td { white-space: normal; }

/* Main page filter row: grouped checkboxes + gap, deactivated rows */
.check-chip { background: var(--panel); border: 1px solid var(--panel-border); border-radius: 6px; padding: 4px 10px; margin: 5px; min-height: calc(32px * var(--font-scale)); }
.datagrid tbody tr.row-deactivated td { color: var(--text-muted); font-style: italic; opacity: .65; }

/* Filter rows (main page, Kunden): every label+input / label+checkbox pair in its own grey box, 10px apart */
/* same filter row on the main page, Aufzug Ereignisse and every Ablage; the table follows --space-2 below */
.filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: var(--space-1) 0 var(--space-2) 0; }
.filter-row .check-chip, .field-chip { margin: 0; }
.field-chip { display: inline-flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--panel-border); border-radius: 6px; padding: 4px 10px; min-height: calc(32px * var(--font-scale)); }
.field-chip .tb { min-height: calc(28px * var(--font-scale)); padding-top: 3px; padding-bottom: 3px; }

/* E-mail viewer */
.mail-view { display: flex; flex-direction: column; gap: var(--space-2); margin: var(--space-2) 0 0 0; }
.mail-view > .m5 { margin: 0; }
.mail-header { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; padding: var(--space-2); }
.mail-attachments { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1); padding: var(--space-2); }
.mail-attachment.risky { color: var(--danger-text); border-color: var(--red); background: var(--danger-bg); }
.mail-size { color: var(--text-muted); font-weight: 400; margin-left: 4px; }
.mail-body { width: 100%; height: 65vh; min-height: 300px; border: 1px solid var(--panel-border); border-radius: var(--radius-sm); background: #fff; }
.btn.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.btn-danger:hover:not(:disabled) { background: var(--danger-text); border-color: var(--danger-text); }
.text-danger { color: var(--danger-text); }
.dropzone-hint { color: var(--danger-text); font-size: 0.92em; margin: 4px 10%; }

/* Upload area (Aufzug Ereignisse: Import, every Ablage: Hochladen) and the Ablage view itself:
   one column, --space-2 between the parts, everything flush with the table below */
.ablage-view, .upload-stack { display: flex; flex-direction: column; gap: var(--space-2); }
.upload-stack { margin-top: var(--space-2); }
.ablage-view > .m5, .upload-stack > .m5, .ablage-view > .vstack > .m5 { margin: 0; }
.ablage-view > .vstack { gap: var(--label-gap); }
.ablage-view > .vstack > select.tb { max-width: calc(300px * var(--font-scale)); }
.ablage-view > .filter-row { margin: 0; }
.ablage-view > .dropzone-hint, .upload-stack > .dropzone-hint { margin-top: calc(-1 * var(--space-2) + 4px); }
.ablage-view > .datagrid { min-height: 400px; }
/* Ablage table: fixed column budgets, Betreff takes the remaining width, long texts end in an ellipsis (full text in title);
   below the minimum width only the table container scrolls horizontally */
.ablage-grid > table.ablage-table { table-layout: fixed; width: 100%; min-width: calc(1130px * var(--font-scale)); }
.ablage-grid > table.ablage-kunde { min-width: calc(930px * var(--font-scale)); }
.ablage-table .col-open   { width: calc(80px * var(--font-scale)); }
.ablage-table .col-file   { width: calc(190px * var(--font-scale)); }
.ablage-table .col-type   { width: calc(120px * var(--font-scale)); }
.ablage-table .col-sender { width: calc(160px * var(--font-scale)); }
.ablage-table .col-date   { width: calc(145px * var(--font-scale)); }
.ablage-table .col-status { width: calc(135px * var(--font-scale)); }
.ablage-table .col-event  { width: calc(85px * var(--font-scale)); }
.ablage-table .col-delete { width: calc(90px * var(--font-scale)); }
.ablage-table .cell-ellipsis { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ablage-table td .file-name-input, .ablage-table td select.tb { width: 100%; min-width: 0; }

/* Sanierung: panels and table --space-2 apart, flush left/right */
.grey-panel + .grey-panel, .sanierung-grid { margin-top: var(--space-2); }
.termine-top > .grey-panel { margin-top: 0; }

/* Administration: Speichern / Neu above the table */
.admin-actions { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-1); margin-bottom: var(--space-2); }
.admin-actions + .error-box { margin-top: 0; }
.datagrid.admin-grid-limited { max-height: 400px; }

/* LookUpComboBox / LookUpListBox: label above the control like every other stacked field */
.lookup-combo { gap: var(--label-gap); }
.lookup-add { margin-left: var(--space-1); }
.lookup-list { gap: var(--label-gap); }
.lookup-list > .hstack { flex-wrap: nowrap; align-items: flex-start; gap: var(--space-1); }
.lookup-list .listbox { height: 100px; }
.dropzone-hint:empty { display: none; }

/* Read-only users (role "User"): form areas are wrapped in a disabled fieldset; display:contents keeps the layout unchanged */
fieldset.ro-lock { display: contents; border: 0; margin: 0; padding: 0; min-width: 0; }
.listbox-item.readonly { cursor: default; }

/* Saving overlay (BusyService / MainLayout): blocks input at once, becomes visible after 150 ms (no flicker on fast saves) */
.busy-overlay {
    position: fixed; inset: 0; z-index: 3000; background: var(--backdrop);
    display: flex; align-items: center; justify-content: center; cursor: wait;
    animation: busy-in 150ms ease-out 150ms both;
}
@keyframes busy-in { from { opacity: 0; } to { opacity: 1; } }
.busy-box {
    display: flex; align-items: center; gap: 12px; padding: 16px 24px;
    background: var(--surface); color: var(--text); border: 1px solid var(--border);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); font-weight: 600;
}
.busy-spinner {
    width: 22px; height: 22px; border-radius: 50%;
    border: 3px solid var(--border-strong); border-top-color: var(--accent);
    animation: busy-spin 800ms linear infinite;
}
@keyframes busy-spin { to { transform: rotate(360deg); } }
html.is-busy, html.is-busy * { cursor: wait !important; }
@media (prefers-reduced-motion: reduce) { .busy-spinner { animation-duration: 2s; } }

/* ---------- Connection lost (Components/Shared/ReconnectModal.razor, js/reconnect.js) ----------
   Blazor sets components-reconnect-show / -hide / -failed / -rejected on the dialog; reconnect.js adds the rc-is-* states.
   Above everything else, including the saving overlay (3000). */
#components-reconnect-modal {
    display: none; position: fixed; inset: 0; z-index: 5000;
    align-items: center; justify-content: center; padding: 16px;
    background: var(--backdrop); backdrop-filter: blur(3px);
    animation: fade-in 200ms ease-out;
}
#components-reconnect-modal.components-reconnect-show,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected { display: flex; }
/* short drops (a few seconds) should not flash a dialog: "reconnecting" fades in after 1 s, clicks are blocked at once */
#components-reconnect-modal.components-reconnect-show { animation: fade-in 200ms ease-out 1s both; }

.reconnect-card {
    display: flex; gap: 18px; align-items: flex-start;
    width: min(calc(600px * var(--font-scale)), 100%); padding: 24px 26px;
    background: var(--surface); color: var(--text);
    border: 1px solid var(--border); border-top: 4px solid var(--accent); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg); font-size: calc(16px * var(--font-scale)); line-height: 1.5;
    animation: pop-in 160ms ease-out;
}
.reconnect-card:focus { outline: none; }
.components-reconnect-failed .reconnect-card, .components-reconnect-rejected .reconnect-card { border-top-color: var(--orange); }
.reconnect-icon { flex: none; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; }
.reconnect-spinner {
    width: 36px; height: 36px; border-radius: 50%;
    border: 4px solid var(--border-strong); border-top-color: var(--accent);
    animation: busy-spin 800ms linear infinite;
}
.reconnect-warn { display: none; width: 40px; height: 40px; fill: none; stroke: var(--orange); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.components-reconnect-failed .reconnect-spinner, .components-reconnect-rejected .reconnect-spinner { display: none; }
.components-reconnect-failed .reconnect-warn, .components-reconnect-rejected .reconnect-warn { display: block; }
.components-reconnect-failed.rc-is-busy .reconnect-spinner, .components-reconnect-rejected.rc-is-reloading .reconnect-spinner { display: block; }
.components-reconnect-failed.rc-is-busy .reconnect-warn, .components-reconnect-rejected.rc-is-reloading .reconnect-warn { display: none; }

.reconnect-content { flex: 1; min-width: 0; }
.reconnect-title { margin: 2px 0 8px 0; font-size: calc(21px * var(--font-scale)); font-weight: 700; line-height: 1.3; letter-spacing: -.01em; }
.reconnect-text p { margin: 0 0 8px 0; }
.reconnect-attempt { color: var(--text-muted); white-space: nowrap; }
.reconnect-buttons { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.reconnect-buttons .btn { min-height: calc(38px * var(--font-scale)); padding: 7px 16px; font-size: calc(15px * var(--font-scale)); }
.components-reconnect-show .reconnect-buttons { display: none; }
.reconnect-text p:last-of-type { margin-bottom: 0; }

/* which text / button belongs to which state */
.reconnect-modal .rc-show, .reconnect-modal .rc-failed, .reconnect-modal .rc-rejected, .reconnect-buttons .btn { display: none; }
.components-reconnect-show .rc-show,
.components-reconnect-failed .rc-failed,
.components-reconnect-rejected .rc-rejected { display: revert; }
.reconnect-modal:not(.rc-is-busy) .rc-busy, .reconnect-modal.rc-is-busy .rc-idle,
.reconnect-modal:not(.rc-is-reloading) .rc-reloading, .reconnect-modal.rc-is-reloading .rc-manual,
.reconnect-modal.rc-is-reloading .rc-unsaved, .reconnect-modal.rc-is-unsaved .rc-manual,
.reconnect-modal:not(.rc-is-unsaved) .rc-unsaved { display: none; }
.components-reconnect-failed .rc-retry,
.components-reconnect-failed .rc-reload,
.components-reconnect-rejected:not(.rc-is-reloading) .rc-reload,
.components-reconnect-failed:not(.rc-is-minimized) .rc-minimize,
.components-reconnect-rejected.rc-is-unsaved:not(.rc-is-minimized) .rc-minimize,
.rc-is-minimized .rc-expand { display: inline-block; }

/* "Seite ansehen": dialog becomes a bar at the top, the page stays readable (to copy unsaved input) */
#components-reconnect-modal.rc-is-minimized {
    align-items: flex-start; background: none; backdrop-filter: none; pointer-events: none; animation: none;
}
.rc-is-minimized .reconnect-card {
    pointer-events: auto; width: auto; max-width: 100%; align-items: center; padding: 10px 14px; gap: 12px; font-size: calc(15px * var(--font-scale));
}
.rc-is-minimized .reconnect-icon { width: 24px; height: 24px; }
.rc-is-minimized .reconnect-warn { width: 24px; height: 24px; }
.rc-is-minimized .reconnect-text { display: none; }
.rc-is-minimized .reconnect-content { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; }
.rc-is-minimized .reconnect-title { margin: 0; font-size: calc(16px * var(--font-scale)); }
.rc-is-minimized .reconnect-buttons { margin: 0; }
.rc-is-minimized .reconnect-buttons .btn { min-height: calc(32px * var(--font-scale)); padding: 4px 12px; font-size: calc(14px * var(--font-scale)); }

@media (max-width: 520px) {
    .reconnect-card { flex-direction: column; padding: 20px; }
    .reconnect-buttons { justify-content: stretch; }
    .reconnect-buttons .btn { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) { .reconnect-spinner { animation-duration: 2s; } }

/* secondary hint text (e.g. "Beim Speichern zugeteilt" for a new Ereignis) */
.text-muted { color: var(--text-muted); font-style: italic; }
