/* ==========================================================================
   S3.DocCenter - Theme & Base Styles
   Based on S3.NorthDataAutoExporter design system
   ========================================================================== */

/* ---------- CSS Custom Properties ---------- */

:root {
    --font-size: 16px;
    --background: #fafafa;
    --foreground: #1f1f1f;
    --card: #ffffff;
    --card-foreground: #1f1f1f;
    --popover: #ffffff;
    --popover-foreground: #1f1f1f;
    --primary: #0C5DA6;
    --primary-foreground: #ffffff;
    --secondary: #f5f5f5;
    --secondary-foreground: #1f1f1f;
    --muted: #f0f0f0;
    --muted-foreground: #6b6b6b;
    --accent: #e6f7ff;
    --accent-foreground: #0C5DA6;
    /* #c62828 statt des frueheren #ff4444: Weiss auf #ff4444 ergibt 3,41:1 und
       verfehlt WCAG AA (4,5:1). Das Icon in .action-btn-danger:hover lag mit
       2,79:1 sogar unter der 3:1-Grenze für Bedienelemente. #c62828 erreicht
       5,62:1 bzw. 4,60:1. Siehe STANDARDS.md, Abschnitt Farben. */
    --destructive: #c62828;
    --destructive-foreground: #ffffff;
    --border: #e8e8e8;
    --input: transparent;
    --input-background: #ffffff;
    --font-weight-medium: 500;
    --font-weight-normal: 400;
    --ring: #0C5DA6;
    --radius: 0;
    --sidebar: #333333;
    --sidebar-foreground: #e8e8e8;
    --sidebar-primary: #0C5DA6;
    --sidebar-primary-foreground: #ffffff;
    --sidebar-accent: #3a3a3a;
    --sidebar-accent-foreground: #ffffff;
    --sidebar-border: #444444;
    --sidebar-ring: #0C5DA6;
    --sidebar-submenu: #2b2b2b;
}

/* ---------- Base styles ---------- */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100vh;
}

/* PDF.js erstellt versteckte Off-Screen-Canvases als Body-Children.
   Diese Canvases haben height:0 aber position im Dokument, was scrollHeight erhöht. */
body > canvas {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
}

html {
    font-size: var(--font-size);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 1rem;
    font-weight: var(--font-weight-normal);
    line-height: 1.5;
    color: var(--foreground);
    background-color: var(--background);
}

h1 {
    font-size: 1.5rem;
    font-weight: var(--font-weight-medium);
    line-height: 1.5;
    border: none;
    outline: none;
}

h2 {
    font-size: 1.25rem;
    font-weight: var(--font-weight-medium);
    line-height: 1.5;
}

h3 {
    font-size: 1.125rem;
    font-weight: var(--font-weight-medium);
    line-height: 1.5;
}

h4 {
    font-size: 1rem;
    font-weight: var(--font-weight-medium);
    line-height: 1.5;
}

label {
    font-size: 1rem;
    font-weight: var(--font-weight-medium);
    line-height: 1.5;
}

/* Bedienelemente erben die Schrift (Web-UI/UX-Runde 3 zu RC 3): sonst laufen <button>, <select> und Felder in der
   Browser-Vorgabe (Arial) neben Links und Text in der Systemschrift. .wert-mono behält ihre eigene Schrift. */
button, input, select, textarea {
    font-family: inherit;
}

button {
    font-size: 1rem;
    font-weight: var(--font-weight-medium);
    line-height: 1.5;
    cursor: pointer;
}

input {
    font-size: 1rem;
    font-weight: var(--font-weight-normal);
    line-height: 1.5;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ---------- Shadow utilities ---------- */

.shadow-header {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.shadow-sidebar {
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.12);
}

.shadow-actionbar {
    box-shadow: 0 -1px 4px rgba(0, 0, 0, 0.06);
}

.shadow-card {
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.10);
}

.shadow-button {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.shadow-dropdown {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

/* ---------- Layout ---------- */

.layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.sidebar {
    background-color: var(--sidebar);
    color: var(--sidebar-foreground);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-animating {
    transition: width 0.2s ease;
}

.sidebar-collapsed {
    width: 64px;
}

.header {
    height: 68px;
    background-color: var(--card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 1rem;
}

.action-bar {
    background-color: var(--card);
    padding: 0.5rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    flex-shrink: 0;
    min-height: 48px;
    margin-top: 1rem;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.10), 0 2px 10px rgba(0, 0, 0, 0.10);
    position: relative;
}

.action-bar-loader {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background-color: color-mix(in srgb, var(--primary) 15%, transparent);
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.action-bar-loader.active {
    opacity: 1;
}

.action-bar-loader::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 40%;
    background-color: var(--primary);
    animation: actionbar-loading 1.2s ease-in-out infinite;
}

@keyframes actionbar-loading {
    0%   { left: -40%; }
    100% { left: 100%; }
}

.content-area {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    width: 100%;
}

/* ---------- Content-Container (max-width + zentriert) ---------- */

/* Container-Varianten - die jeweilige Page wraps ihren Top-Level-Inhalt
   mit einer dieser Klassen. Breite steht statisch im Markup, kein
   Runtime-State, kein Page-Wechsel-Flicker. */
.container-narrow,
.container-standard,
.container-wide,
.container-full {
    width: 100%;
    margin: 0 auto;
}

.container-narrow   { max-width: 720px;  }
.container-standard { max-width: var(--fh-breite-schmal, 1040px); }
.container-wide     { max-width: var(--fh-breite-breit, 1584px); }
.container-full     { max-width: none;   }

/* ---------- Status badges ---------- */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    font-size: 0.75rem;
    font-weight: var(--font-weight-medium);
    border-radius: 9999px;
    white-space: nowrap;
}

.badge-success {
    background-color: #dcfce7;
    color: #166534;
}

.badge-warning {
    background-color: #fef9c3;
    color: #854d0e;
}

.badge-error {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge-primary {
    background-color: color-mix(in srgb, var(--primary) 12%, transparent);
    color: var(--primary);
}

.badge-muted {
    background-color: var(--muted);
    color: var(--muted-foreground);
}

/* ---------- Tables ---------- */

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.data-table th {
    text-align: left;
    padding: 0.625rem 0.75rem;
    font-weight: var(--font-weight-medium);
    color: var(--muted-foreground);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
    /* Label oben verankern, damit Spalten ohne Filter dasselbe Label-Y
       haben wie Spalten mit Filter (sonst zentriert die default
       vertical-align: middle das Label in der Zelle). */
    vertical-align: top;
}

.data-table td {
    padding: 0.625rem 0.75rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.data-table tbody tr:nth-child(odd) {
    background-color: var(--background);
}

.data-table tbody tr:nth-child(even) {
    background-color: var(--card);
}

.data-table tbody tr:hover {
    background-color: var(--muted);
}

/* Klickbare Zeile - Cursor-Pointer als visuelle Affordance für
   Row-Click-Navigation. Action-Buttons in der Zelle haben
   `@onclick:stopPropagation`, damit sie nicht doppelt navigieren. */
.data-table tbody tr.clickable {
    cursor: pointer;
}

/* Fixed Layout - Spaltenbreiten werden aus <col>-Elementen übernommen,
   erlaubt sticky Header ohne Spalten-Verschiebung, schneidet lange
   Inhalte per `text-overflow: ellipsis` in Zellen mit `overflow: hidden`. */
.data-table.data-table-fixed {
    table-layout: fixed;
}

/* Header-Zelle: 2-zeilig - oben Label+Sort, unten Filter-Input/Select */
.data-table .th-label {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.125rem 0;
    user-select: none;
}

.data-table .th-label.sortable {
    cursor: pointer;
}

.data-table .th-label.sortable:hover {
    color: var(--foreground);
}

.data-table .sort-icon {
    opacity: 0.45;
    flex-shrink: 0;
}

.data-table .sort-icon.sort-active {
    opacity: 1;
    color: var(--primary);
}

/* Robustes Safety-Net: greift auch dann, wenn ein Projekt das Sort-Icon ohne
   `sort-icon`-Klasse rendert (nur `icon-sm`) - passierte unabhängig in VDZ +
   HYTORC. Stylt direkt das svg im sortierbaren Header: inaktiv dezenter Grauton,
   aktiv hervorgehoben (egal ob `sort-active` am DIV oder am Icon hängt). */
.data-table .th-label.sortable svg {
    color: var(--muted-foreground);
    opacity: 0.4;
}

.data-table .th-label.sortable.sort-active svg,
.data-table .th-label.sortable svg.sort-active {
    color: var(--primary);
    opacity: 1;
}

.data-table .th-filter-input,
.data-table .th-filter-select {
    width: 100%;
    margin-top: 0.375rem;
    padding: 0.375rem 0.5rem;
    height: 34px;
    box-sizing: border-box;
    font-size: 0.8125rem;
    font-weight: var(--font-weight-normal);
    border: 1px solid var(--border);
    background-color: var(--card);
    color: var(--foreground);
    border-radius: var(--radius);
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.data-table .th-filter-input:focus,
.data-table .th-filter-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 15%, transparent);
}

.data-table .th-filter-input.is-active,
.data-table .th-filter-select.is-active {
    border-color: var(--primary);
    background-color: color-mix(in srgb, var(--primary) 4%, var(--card));
}

.data-table .th-filter-select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
    background-repeat: no-repeat;
    background-position: right 0.375rem center;
    background-size: 14px;
    padding-right: 1.5rem;
}

/* Select wirkt wie Placeholder solange "Alle" gewählt ist (kein .is-active).
   Optionen im Dropdown bleiben in der normalen Schriftfarbe. */
.data-table .th-filter-select:not(.is-active) {
    color: var(--muted-foreground);
}

.data-table .th-filter-select option {
    color: var(--foreground);
}

/* ----- Filter-Input mit ×-Clear-Button -----
   Wrap übernimmt margin-top vom Input, damit der absolut positionierte
   Clear-Button vertikal mittig im Input sitzt (sonst rutscht er um halben
   Margin nach unten). */
.th-filter-wrap {
    position: relative;
    display: flex;
    align-items: center;
    margin-top: 0.375rem;
}

.th-filter-wrap .th-filter-input {
    flex: 1;
    margin-top: 0;
    padding-right: 1.75rem;
}

.th-filter-clear {
    position: absolute;
    right: 0.375rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: var(--muted);
    border: none;
    border-radius: 50%;
    color: var(--muted-foreground);
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    padding: 0;
    transition: background-color 0.15s, color 0.15s;
}

.th-filter-clear:hover {
    background: var(--destructive);
    color: #fff;
}

/* ===== Datum-Filter (Popover am Spalten-Header) =====
   Trigger ist ein <div> in der th-Zelle, Popover öffnet via JS-Interop
   (popover-position.js) als position:fixed. Pflicht: font-weight: 400 am
   Trigger, sonst erbt er die 500 von ".data-table th" und der "Zeitraum …"-
   Placeholder wirkt fetter als die Text-Filter-Placeholder daneben. */
.th-date-col {
    position: relative;
    overflow: visible;
}

.th-date-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.25rem;
    width: 100%;
    margin-top: 0.375rem;
    padding: 0.375rem 0.5rem;
    height: 34px;
    box-sizing: border-box;
    font-size: 0.8125rem;
    font-weight: 400;
    border: 1px solid var(--border);
    background-color: var(--card);
    border-radius: var(--radius);
    color: var(--muted-foreground);
    cursor: pointer;
    transition: border-color 0.15s ease;
}

.th-date-trigger:hover {
    border-color: var(--primary);
}

.th-date-trigger.has-value {
    color: var(--foreground);
}

.th-date-trigger.is-active {
    border-color: var(--primary);
    background-color: color-mix(in srgb, var(--primary) 4%, var(--card));
}

.th-date-display {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.date-chevron {
    margin-left: auto;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    color: #999;
}

.date-popover-overlay {
    position: fixed;
    inset: 0;
    z-index: 49;
}

.date-popover-container {
    display: grid;
    grid-template-columns: auto auto;
    background: var(--card);
    border: 1px solid var(--border);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14);
}

.date-popover-presets {
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    min-width: 170px;
    border-right: 1px solid var(--border);
    flex-shrink: 0;
}

.date-presets-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--muted-foreground);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.25rem 0.5rem 0.375rem;
}

.date-preset-btn {
    font-size: 0.8125rem;
    padding: 0.4rem 0.625rem;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    color: var(--foreground);
    white-space: nowrap;
}

.date-preset-btn:hover {
    background: var(--muted);
}

.date-preset-btn.active {
    background: color-mix(in srgb, var(--primary) 10%, transparent);
    color: var(--primary);
    font-weight: 500;
}

.date-popover {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 220px;
}

.date-popover-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.date-popover-row label {
    font-size: 0.75rem;
    color: var(--muted-foreground);
    width: 28px;
    flex-shrink: 0;
}

.date-popover-row .date-input {
    flex: 1;
    min-width: 0;
    margin-top: 0;
}

.date-popover-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.25rem;
    border-top: 1px solid var(--border);
    padding-top: 0.5rem;
}

.date-popover-apply {
    flex: 1;
    font-size: 0.75rem;
    padding: 0.4rem 0.75rem;
    background: var(--primary);
    color: var(--primary-foreground);
    border: 1px solid var(--primary);
    border-radius: var(--radius);
    cursor: pointer;
    text-align: center;
}

.date-popover-apply:hover {
    opacity: 0.9;
}

.date-popover-clear {
    font-size: 0.75rem;
    color: var(--muted-foreground);
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    padding: 0.4rem 0.75rem;
}

.date-popover-clear:hover {
    color: var(--foreground);
    border-color: var(--foreground);
}

/* Optionale Selected-Row-Markierung - 3px Primary-Border links + leichter
   Primary-Tint. Wird auf `<tr class="selected">` angewendet. */
.data-table tbody tr.selected {
    background-color: color-mix(in srgb, var(--primary) 8%, var(--card)) !important;
    box-shadow: inset 3px 0 0 var(--primary);
}

/* Empty-State-Zeile innerhalb der Tabelle */
.data-table .empty-state-row td {
    padding: 2.5rem 0.75rem;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: var(--muted-foreground);
    text-align: center;
}

/* Zelle mit Ellipsis - funktioniert nur in data-table-fixed (table-layout: fixed). */
.data-table .cell-ellipsis {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Action-Spalte (icon-only Buttons rechts in der Zeile). Header-Label und
   Body-Buttons rechtsbündig. Gap entsteht durch margin-left an Buttons,
   damit der `<td>` als table-cell-Layout intakt bleibt. */
.data-table .cell-actions {
    text-align: right;
    white-space: nowrap;
}

.data-table td.cell-actions .action-btn + .action-btn {
    margin-left: 0.25rem;
}

/* ---------- Cards ---------- */

.card {
    background-color: var(--card);
    color: var(--card-foreground);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.10);
    width: 100%;
}

.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    font-weight: var(--font-weight-medium);
}

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: var(--font-weight-medium);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background-color: var(--card);
    color: var(--foreground);
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
    text-decoration: none;
}

.btn:hover {
    background-color: var(--muted);
}

.btn:disabled,
.btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--primary-foreground);
    border-color: var(--primary);
}

.btn-primary:hover {
    background-color: color-mix(in srgb, var(--primary) 85%, #000);
    border-color: color-mix(in srgb, var(--primary) 85%, #000);
}

.btn-secondary {
    background-color: var(--card);
    color: var(--foreground);
    border-color: var(--border);
}

.btn-secondary:hover {
    background-color: var(--muted);
}

.btn-danger {
    background-color: var(--destructive);
    color: var(--destructive-foreground);
    border-color: var(--destructive);
}

.btn-danger:hover {
    background-color: #a52121;
    border-color: #a52121;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.8125rem;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: var(--radius);
    background: transparent;
    color: var(--foreground);
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.action-btn:hover {
    background-color: var(--muted);
}

.action-btn-danger:hover {
    background-color: #fee2e2;
    color: var(--destructive);
}

.action-bar-title {
    font-size: 1.125rem;
    font-weight: var(--font-weight-medium);
    line-height: 1.5;
    white-space: nowrap;
    border: none;
    outline: none;
    margin: 0;
    padding: 0;
}

.action-bar-title-with-back {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

/* ---------- Forms ---------- */

.form-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-family: inherit;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background-color: var(--input-background);
    color: var(--foreground);
    outline: none;
    transition: border-color 0.15s ease;
}

.form-input:focus {
    border-color: var(--ring);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--ring) 15%, transparent);
}

.form-input[readonly],
.form-input:read-only {
    background-color: var(--background);
    color: var(--muted-foreground);
    cursor: default;
    border-color: var(--border);
}

.form-input[readonly]:focus,
.form-input:read-only:focus {
    border-color: var(--border);
    box-shadow: none;
}

.form-select {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background-color: var(--input-background);
    color: var(--foreground);
    outline: none;
    cursor: pointer;
}

.form-select:focus {
    border-color: var(--ring);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--ring) 15%, transparent);
}

.form-label {
    display: block;
    margin-bottom: 0.375rem;
    font-size: 0.875rem;
    font-weight: var(--font-weight-medium);
    color: var(--foreground);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--foreground);
}

.form-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 0.5rem;
}

.alert-success {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background-color: #dcfce7;
    color: #166534;
    font-size: 0.875rem;
    border-radius: var(--radius);
}

.filter-label {
    font-size: 0.875rem;
    font-weight: var(--font-weight-medium);
    color: var(--muted-foreground);
    white-space: nowrap;
}

/* ---------- Pagination ---------- */

.pagination {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.5rem;
    font-size: 0.875rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background-color: var(--card);
    color: var(--foreground);
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.pagination-btn:hover {
    background-color: var(--muted);
}

.pagination-btn-active {
    background-color: var(--primary);
    color: var(--primary-foreground);
    border-color: var(--primary);
}

.pagination-btn-active:hover {
    background-color: color-mix(in srgb, var(--primary) 85%, #000);
}

.pagination-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.pagination-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: var(--muted-foreground);
}

.pagination-left,
.pagination-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--muted-foreground);
}

.pagination-range {
    font-variant-numeric: tabular-nums;
}

.pagination-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    color: var(--muted-foreground);
    user-select: none;
}

/* Page-Size-Select in der Pagination-Card - eigenständig (nicht von
   .th-filter-select abgeleitet, sonst sind Höhe/Padding/Width vermischt). */
.page-size-select {
    height: 34px;
    box-sizing: border-box;
    padding: 0 1.75rem 0 0.625rem;
    font-size: 0.875rem;
    line-height: 1;
    border: 1px solid var(--border);
    background-color: var(--card);
    color: var(--foreground);
    border-radius: var(--radius);
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 14px;
    cursor: pointer;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.page-size-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 15%, transparent);
}

/* Vertikaler Abstand zwischen Tabellen-Card und Pagination-Card. */
.list-page {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ---------- Detail-Page ---------- */

.detail-card {
    padding: 1.5rem 2rem;
}

.detail-grid {
    display: grid;
    grid-template-columns: max-content 1fr;
    column-gap: 2rem;
    row-gap: 0.625rem;
    margin: 0;
    font-size: 0.875rem;
}

.detail-grid dt {
    color: var(--muted-foreground);
    font-weight: var(--font-weight-medium);
    margin: 0;
}

.detail-grid dd {
    margin: 0;
    color: var(--foreground);
}

/* ---------- Navigation ---------- */

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 1rem;
    height: 40px;
    font-size: 0.875rem;
    color: var(--sidebar-foreground);
    text-decoration: none;
    border-radius: var(--radius);
    transition: background-color 0.15s ease;
}

.nav-link:hover {
    background-color: var(--sidebar-accent);
    color: var(--sidebar-accent-foreground);
    text-decoration: none;
}

.nav-link-active,
.nav-link.active {
    background-color: var(--sidebar-accent);
    color: var(--sidebar-accent-foreground);
    box-shadow: inset 4px 0 0 var(--sidebar-primary);
}

.nav-link-active:hover,
.nav-link.active:hover {
    background-color: var(--sidebar-accent);
    color: var(--sidebar-accent-foreground);
}

/* ---------- Tree / Nav-Row ---------- */
/* Flat + Tree-Items teilen sich die gleiche nav-link-Struktur.
   Active-Indicator (4px box-shadow) sitzt am Sidebar-Rand.
   Folder-Expand-Chevron ist rechts, damit das Icon direkt
   neben dem Indicator steht. */

.tree-link-folder {
    cursor: pointer;
}

.tree-chevron-right {
    margin-left: auto;
    opacity: 0.6;
    transition: transform 0.15s ease;
}

.tree-chevron-open {
    transform: rotate(90deg);
}

.tree-children {
    position: relative;
    margin-left: 16px;
}

.tree-children::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 2px;
    bottom: 2px;
    width: 1px;
    background-color: var(--sidebar-border);
}

/* Collapsed Sidebar: Baumkinder werden komplett ausgeblendet - nur
   Level-0-Folder bleiben als Icons sichtbar. Dadurch fluchtet jedes
   sichtbare Icon mit den flachen NavLinks. */
.tree-children.sidebar-collapsed {
    display: none;
}

/* Collapsed Sidebar: Chevron am Folder-Header raus, sonst wuerde
   `margin-left: auto` das Folder-Icon aus der zentrierten Spur druecken. */
.nav-collapsed .tree-chevron-right {
    display: none;
}

/* ---------- Icon sizes ---------- */

.icon-sm {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.icon-md {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* ---------- Blazor ReconnectModal ---------- */

.components-reconnect-first-attempt-visible,
.components-reconnect-repeated-attempt-visible,
.components-reconnect-failed-visible,
.components-pause-visible,
.components-resume-failed-visible,
.components-rejoining-animation {
    display: none;
}

#components-reconnect-modal.components-reconnect-show .components-reconnect-first-attempt-visible,
#components-reconnect-modal.components-reconnect-show .components-rejoining-animation,
#components-reconnect-modal.components-reconnect-paused .components-pause-visible,
#components-reconnect-modal.components-reconnect-resume-failed .components-resume-failed-visible,
#components-reconnect-modal.components-reconnect-retrying .components-reconnect-repeated-attempt-visible,
#components-reconnect-modal.components-reconnect-retrying .components-rejoining-animation,
#components-reconnect-modal.components-reconnect-failed .components-reconnect-failed-visible {
    display: block;
}

#components-reconnect-modal:not([open]) {
    display: none;
}

#components-reconnect-modal {
    background-color: white;
    width: 20rem;
    margin: 20vh auto;
    padding: 2rem;
    border: 0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    color: var(--foreground);
    font-size: 0.875rem;
}

#components-reconnect-modal::backdrop {
    background-color: rgba(0, 0, 0, 0.4);
}

.components-reconnect-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

#components-reconnect-modal p {
    margin: 0;
    text-align: center;
}

#components-reconnect-modal button {
    border: 0;
    background-color: var(--primary);
    color: var(--primary-foreground);
    padding: 0.5rem 1.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: var(--font-weight-medium);
}

#components-reconnect-modal button:hover {
    background-color: color-mix(in srgb, var(--primary) 85%, #000);
}

.components-rejoining-animation {
    position: relative;
    width: 60px;
    height: 60px;
}

.components-rejoining-animation div {
    position: absolute;
    border: 3px solid var(--primary);
    opacity: 1;
    border-radius: 50%;
    animation: components-rejoining-animation 1.5s cubic-bezier(0, 0.2, 0.8, 1) infinite;
}

.components-rejoining-animation div:nth-child(2) {
    animation-delay: -0.5s;
}

@keyframes components-rejoining-animation {
    0%, 4.9% {
        top: 30px; left: 30px; width: 0; height: 0; opacity: 0;
    }
    5% {
        top: 30px; left: 30px; width: 0; height: 0; opacity: 1;
    }
    100% {
        top: 0; left: 0; width: 60px; height: 60px; opacity: 0;
    }
}

/* ---------- Formular-spezifisch (kompakte Inputs/Labels) ---------- */

.formular .form-input {
    font-size: 0.8125rem;
    padding: 0.25rem 0.5rem;
    height: 1.75rem;
    min-height: 1.75rem;
    max-height: 1.75rem;
    box-sizing: border-box;
    line-height: 1.2;
}

.formular .form-label {
    font-size: 0.6875rem;
    margin-bottom: 0.125rem;
    padding: 0 2px;
    color: var(--muted-foreground);
    font-weight: var(--font-weight-normal);
    display: block;
}

.formular input[type="date"].form-input {
    padding: 0 0.5rem;
    line-height: 1.75rem;
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
}

.formular input[type="date"].form-input::-webkit-datetime-edit {
    padding: 0;
    line-height: 1.75rem;
}

.formular input[type="date"].form-input::-webkit-calendar-picker-indicator {
    padding: 0;
    margin: 0;
}

/* ---------- Text Picker (PDF → Input) ---------- */
/* Cursor im PDF bleibt unverändert (Text-Selektion bleibt natürlich) */

/* ---------- Animations ---------- */

/* Lade-Spinner: neutraler rotierender Ring. Ersetzt im Ladezustand ein Icon -
   Icons selbst drehen NIE (STANDARDS.md § Icons). Erbt die Farbe via currentColor. */
.spinner {
    display: inline-block;
    flex: none;
    border-radius: 50%;
    border: 2px solid currentColor;
    border-top-color: transparent;
    animation: spin 0.7s linear infinite;
    vertical-align: middle;
}

.spinner-sm { width: 16px; height: 16px; }
.spinner-md { width: 20px; height: 20px; }

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Rotation des Kreispfeil-Symbols im Ladezustand (STANDARDS.md §1 Icons,
   §3.15). Die Klasse wurde in der Showcase an sechs Stellen verwendet, war
   aber nirgends definiert - es drehte sich also nichts, obwohl der Standard
   es vorschreibt. DEVEX.CRM hatte die Regel deshalb selbst nachgebaut.

   Sie gilt ausschliesslich für neutrale Ladesymbole. Ein bedeutungstragendes
   Icon wird im Ladezustand ersetzt, nicht gedreht - dafuer gibt es
   Spinner.razor. */
.spin {
    animation: spin 0.8s linear infinite;
}

/* ---------- Login page ---------- */

.login-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background-color: var(--sidebar);
    padding: 1.5rem;
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
}

.login-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.login-logo-img {
    height: 88px;
    width: auto;
}

.login-title {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--foreground);
}

.login-field {
    margin-bottom: 1rem;
}

.login-btn {
    width: 100%;
    margin-top: 0.5rem;
}

.login-error {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    margin-bottom: 1rem;
    background-color: #fee2e2;
    color: #991b1b;
    font-size: 0.875rem;
    border-radius: var(--radius);
}

.login-footer {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.6875rem;
    color: var(--sidebar-foreground);
    /* 0.8 statt 0.5: rund 7:1 auf #333 statt etwa 3,6:1 (WCAG 1.4.3, Web-UI/UX-Runde 1, RC 3) */
    opacity: 0.8;
    line-height: 1.6;
}

.login-version {
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.01em;
}

.login-fieldset {
    border: 0;
    padding: 0;
    margin: 0;
    min-width: 0;
}

/* ---------- Blazor-specific ---------- */

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuOTI5IDUxLjMwNCAyNjYuOTQgNTEuOTE0TDI4OS45MDcgNjUuNzA0QzI5MS4xMTkgNjYuMzE0IDI5Mi4xMjkgNjcuMjI4IDI5Mi43MzcgNjguMzY5TDMwNC4yMDIgODcuNjE0QzMwNS4wMzQgODkuNDMxIDMwNS4wMzQgOTEuNTUxIDMwNC4yMDIgOTMuMzY5TDI4OS4yNDYgOTMuMzY5QzI5MC4wNzggOTEuNTUxIDI5MC4wNzggODkuNDMxIDI4OS4yNDYgODcuNjE0TDI3Ny43ODEgNjguMzY5QzI3Ny4xNzMgNjcuMjI4IDI3Ni4xNjMgNjYuMzE0IDI3NC45NTEgNjUuNzA0TDI1MS45ODQgNTEuOTE0QzI1Mi45OTUgNTEuMzA0IDI1NC4yMDYgNTEgMjU1LjQxOCA1MUwyNjMuNTA2IDUxWiIgZmlsbD0iI0ZGNDQzMyIgZmlsbC1ydWxlPSJldmVub2RkIi8+PC9nPjwvc3ZnPg==) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid var(--destructive);
}

/* ---------- Save-Button-Feedback (STANDARDS.md 3.19) ---------- */

.btn--saved,
.btn-primary.btn--saved,
.btn-primary.btn--saved:hover {
    background-color: #0a7d2c;
    border-color: #0a7d2c;
    color: #fff;
}

.btn--saved:disabled,
.btn--saved[disabled] {
    opacity: 1;
    cursor: default;
}

.btn--saved .icon-sm {
    animation: btn-saved-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes btn-saved-pop {
    0%   { transform: scale(0.4) rotate(-20deg); opacity: 0; }
    60%  { transform: scale(1.2) rotate(5deg);   opacity: 1; }
    100% { transform: scale(1) rotate(0);        opacity: 1; }
}

/* Bewusst dunkler als --destructive: sonst sieht der Button aus wie ein
   Loeschen-Button und weisse Schrift wird schlecht lesbar. */
.btn--failed,
.btn-primary.btn--failed,
.btn-primary.btn--failed:hover,
.btn-primary.btn--failed:disabled {
    background-color: #b91c1c;
    border-color: #b91c1c;
    color: #fff;
    opacity: 1;
}

/* ---------- Inline-Rueckmeldung unter Listen und Karten ---------- */

.hinweis-erfolg,
.hinweis-warnung,
.hinweis-fehler {
    margin: 0.75rem 0 0;
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
}

.hinweis-erfolg {
    background-color: #dcfce7;
    color: #166534;
}

.hinweis-warnung {
    background-color: #fef9c3;
    color: #854d0e;
}

.hinweis-fehler {
    background-color: #fee2e2;
    color: #991b1b;
}

/* ---------- Info-Karte: Erklärtext unter dem eigentlichen Inhalt ---------- */

.hinweis-karte {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    margin-top: 1.5rem;
    padding: 0.875rem 1.25rem;
    color: var(--muted-foreground);
    font-size: 0.8125rem;
    line-height: 1.5;
}

.hinweis-karte svg {
    flex-shrink: 0;
    margin-top: 0.15rem;
}

.hinweis-karte p {
    margin: 0;
    max-width: 95ch;
}

/* ---------- Ergänzungen DS.FitnessHub ---------- */

/* Seiten-Zwischenüberschrift zwischen Karten (in STANDARDS.md 1 genannt, in der Showcase nicht definiert) */
.fc-section-title {
    font-size: 1.125rem;
    font-weight: var(--font-weight-medium);
    margin: 0 0 0.75rem;
}

/* iOS Safari zoomt beim Fokus in Felder unter 16px Schriftgröße - auf dem Handy daher 16px */
@media (max-width: 768px) {
    .form-input,
    .form-select {
        font-size: 16px;
    }
}

/* Anmeldeknopf: Ladesymbol erst nach dem Absenden (form-submit-spinner.js, Regeln aus HYTORC.LizenzService) */
.login-btn-spinner {
    display: none;
}

.login-btn.is-loading {
    pointer-events: none;
    opacity: 0.85;
}

.login-btn.is-loading .login-btn-spinner {
    display: inline-block;
}

/* ===== DS.FitnessHub: Bausteine, die mehrere Seiten nutzen ===== */

/* Seite = Karten untereinander */
.seite {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.seite > .fc-section-title {
    margin: 0.75rem 0 -0.25rem;
}

.seite > .hinweis-erfolg,
.seite > .hinweis-fehler,
.seite > .hinweis-warnung {
    margin: 0;
}

/* Kartenkopf: Icon + Titel links, Status rechts */
.karten-kopf {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.karten-kopf-titel {
    flex: 1;
    min-width: 0;
}

.karten-inhalt {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.karten-inhalt > .hinweis-erfolg,
.karten-inhalt > .hinweis-fehler,
.karten-inhalt > .hinweis-warnung {
    margin: 0;
}

.karten-abschnitt {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.karten-abschnitt-titel {
    font-size: 1rem;
    font-weight: var(--font-weight-medium);
}

.text-klein {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    max-width: 95ch;
}

.knopf-zeile {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    max-width: 640px;
}

/* Eingabefeld mit Knöpfen rechts daneben (anzeigen, kopieren) */
.feld-mit-knopf {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
}

.feld-mit-knopf .form-input {
    flex: 1;
    min-width: 0;
}

.feld-mit-knopf .btn {
    flex-shrink: 0;
}

/* Schlüssel, Token, Adressen: gleichbreite Schrift, darf überall umbrechen */
.wert-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.8125rem;
    overflow-wrap: anywhere;
}

/* Tabellen bleiben auf schmalen Bildschirmen lesbar: waagerecht wischen statt quetschen */
.tabelle-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tabelle-scroll .data-table {
    min-width: 640px;
}

.data-table .zelle-zahl {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.data-table .zelle-zeit {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.detail-grid dd {
    overflow-wrap: anywhere;
}

@media (max-width: 768px) {
    .karten-inhalt {
        padding: 1rem;
    }

    .detail-grid {
        column-gap: 1rem;
    }

    /* Auf dem Handy untereinander: Feld volle Breite, Knöpfe darunter */
    .feld-mit-knopf {
        flex-wrap: wrap;
    }

    .feld-mit-knopf .form-input {
        flex-basis: 100%;
    }
}
/* Hervorhebung ohne Fettschrift: der Standard kennt nur 400 und 500 (STANDARDS.md 1) */
strong {
    font-weight: var(--font-weight-medium);
}

/* ===== DS.FitnessHub: Dashboard und Charts ===== */

/* Chart-Farben. Abgeleitet aus dem Primary-Blau; mit dem Prüfskript der Dataviz-Methode gegen die weiße
   Kartenfläche geprüft (Helligkeitsband, Farbsättigung, Abstand bei Rot-Grün-Schwäche, Kontrast >= 3:1).
   Reihenfolge f1..f4 ist fest - eine Reihe behält ihre Farbe auf allen Seiten. */
:root {
    --chart-1: #0C5DA6;        /* Messwert / Hauptreihe (= Primary), Tiefschlaf */
    --chart-2: #eb6834;        /* zweite Reihe, Wachzeit */
    --chart-3: #159a6b;        /* dritte Reihe, Kernschlaf */
    --chart-4: #4a3aa7;        /* vierte Reihe, REM */
    --chart-neutral: #7a8fa6;  /* Tagesbalken im Zielbereich */
    --chart-ueber: #c2571a;    /* klar über dem Ziel (warm) */
    --chart-unter: #0C5DA6;    /* klar unter dem Ziel (kalt) */
    --chart-tinte: #1f1f1f;    /* Ziel- und Planlinien */
    --chart-text: #6b6b6b;     /* Achsentexte */
    --chart-raster: #ededed;
    --chart-achse: #bdbdbd;
    --chart-flaeche: var(--card);
    --chart-band: color-mix(in srgb, var(--chart-1) 13%, transparent);
    --chart-phase: rgba(31, 31, 31, 0.055);
    --chart-phase-kappe: #9a9a9a;
}

.ch-f1 { --f: var(--chart-1); }
.ch-f2 { --f: var(--chart-2); }
.ch-f3 { --f: var(--chart-3); }
.ch-f4 { --f: var(--chart-4); }
.ch-fn { --f: var(--chart-neutral); }
.ch-fu { --f: var(--chart-ueber); }
.ch-fd { --f: var(--chart-unter); }
.ch-fi { --f: var(--chart-tinte); }

/* ----- Rahmen: Titel, Legende, Erklärung, Tabelle ----- */

.ch-rahmen {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 0;
    margin: 0;
}

.ch-kopf {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: 0.625rem;
}

.ch-titel {
    font-size: 1rem;
    font-weight: var(--font-weight-medium);
}

.ch-untertitel {
    font-size: 0.8125rem;
    color: var(--muted-foreground);
}

.ch-legende {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
    list-style: none;
    font-size: 0.8125rem;
    color: var(--foreground);
}

.ch-legende li {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.ch-leg {
    width: 18px;
    height: 10px;
    flex-shrink: 0;
    fill: var(--f);
    stroke: none;
}

.ch-leg-linie, .ch-leg-ziel, .ch-leg-plan {
    fill: none;
    stroke: var(--f);
    stroke-width: 2;
    stroke-linecap: round;
}

.ch-leg-ziel { stroke-width: 1.5; }
.ch-leg-plan { stroke-width: 1.5; stroke-dasharray: 4 3; stroke-linecap: butt; }
.ch-leg-ring, .ch-leg-marke { fill: var(--chart-flaeche); stroke: var(--f); stroke-width: 2; }
.ch-leg-band { fill: var(--chart-band); }
.ch-leg-phase { fill: var(--chart-phase); stroke: var(--chart-phase-kappe); stroke-width: 0.5; }
.ch-leg-offen { opacity: 0.4; }
.ch-leg-balken, .ch-leg-offen { width: 10px; }

.ch-erklaerung, .ch-hinweis {
    font-size: 0.8125rem;
    line-height: 1.45;
    color: var(--muted-foreground);
    max-width: 85ch;
}

.ch-leer {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 6rem;
    padding: 1rem;
    background-color: var(--background);
    border: 1px dashed var(--border);
    color: var(--muted-foreground);
    font-size: 0.875rem;
    text-align: center;
}

.ch-tabelle {
    font-size: 0.8125rem;
}

.ch-tabelle summary {
    cursor: pointer;
    color: var(--primary);
    width: fit-content;
    padding: 0.125rem 0;
}

.ch-tabelle .tabelle-scroll {
    margin-top: 0.5rem;
    max-height: 22rem;
    overflow-y: auto;
    border: 1px solid var(--border);
}

.ch-tabelle .data-table {
    min-width: 0;
    font-size: 0.8125rem;
}

.ch-tabelle .data-table th,
.ch-tabelle .data-table td {
    padding: 0.3125rem 0.625rem;
}

/* ----- Chart: Achsen (HTML) um eine dehnbare Zeichenfläche (SVG) ----- */

.ch {
    --ch-yb: 2.75rem;
    position: relative;
    display: grid;
    grid-template-columns: var(--ch-yb) minmax(0, 1fr);
    padding: 1.125rem 0.5rem 0 0;
    font-size: 0.75rem;
    line-height: 1;
    color: var(--chart-text);
    font-variant-numeric: tabular-nums;
}

.ch-einheit {
    position: absolute;
    top: 0;
    left: 0;
    width: var(--ch-yb);
    padding-right: 0.5rem;
    text-align: right;
    white-space: nowrap;
}

.ch-y {
    position: relative;
    height: var(--ch-h);
}

.ch-y span {
    position: absolute;
    right: 0.5rem;
    transform: translateY(-50%);
    white-space: nowrap;
}

.ch-plot {
    position: relative;
    height: var(--ch-h);
    min-width: 0;
    container-type: inline-size;
}

.ch-svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.ch-svg path, .ch-svg rect {
    vector-effect: non-scaling-stroke;
}

.ch-raster { fill: none; stroke: var(--chart-raster); stroke-width: 1px; }
.ch-grundlinie { stroke: var(--chart-achse); }

/* Linien 2 px, runde Enden */
.ch-l {
    fill: none;
    stroke: var(--f);
    stroke-width: 2px;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.ch-l.ch-duenn { stroke-width: 1.5px; }
.ch-l.ch-plan { stroke-width: 1.5px; stroke-dasharray: 5 4; stroke-linecap: butt; }

/* Punkte sind Striche der Länge null: mit runder Kappe ein Kreis, mit gerader ein Quadrat -
   so bleiben sie beim waagerechten Dehnen der Fläche rund. Darunter ein Ring in Flächenfarbe. */
.ch-p, .ch-pr, .ch-pi, .ch-hp {
    fill: none;
    stroke-linecap: round;
    pointer-events: none;
}

.ch-p { stroke: var(--f); stroke-width: 8px; }
.ch-pr { stroke: var(--chart-flaeche); stroke-width: 12px; }
.ch-pi { stroke: var(--chart-flaeche); stroke-width: 4px; }
.ch-p.ch-klein { stroke-width: 6px; }
.ch-pr.ch-klein { stroke-width: 8px; }
.ch-pi.ch-klein { stroke-width: 2.5px; }
.ch-form-quadrat { stroke-linecap: square; }
.ch-p.ch-form-quadrat { stroke-width: 6.5px; }
.ch-pr.ch-form-quadrat { stroke-width: 10px; }
.ch-p.ch-form-quadrat.ch-klein { stroke-width: 5px; }
.ch-pr.ch-form-quadrat.ch-klein { stroke-width: 7px; }

.ch-band { fill: var(--chart-band); stroke: none; }
.ch-ziel { fill: none; stroke: var(--chart-tinte); stroke-width: 1.5px; }
.ch-ziel.ch-stufe { stroke-width: 2px; stroke-linejoin: miter; }
.ch-heute { fill: none; stroke: var(--chart-achse); stroke-width: 1px; }
.ch-ereignis-linie { fill: none; stroke: var(--chart-achse); stroke-width: 1px; }
.ch-phase { fill: var(--chart-phase); stroke: none; }
.ch-phase.ch-phase-laufend { fill: color-mix(in srgb, var(--chart-1) 9%, transparent); }

/* Balken sind senkrechte Striche: Breite aus der Fachbreite, höchstens 24 px, Enden gerade (Square-First) */
.ch-b {
    fill: none;
    stroke: var(--f);
    stroke-linecap: butt;
    stroke-width: clamp(2px, calc(100cqw / var(--ch-n, 30) * 0.68), 24px);
}

.ch-offen { opacity: 0.4; }

/* Zeigen und Tippen: Spalte bzw. Fach nimmt den Zeiger auf, der Faden zeigt den Tag */
.ch-treffer { fill: transparent; stroke: none; cursor: crosshair; }
.ch-fach:hover, .ch-fach.ch-aktiv { fill: rgba(31, 31, 31, 0.06); }
.ch-faden { fill: none; stroke: var(--chart-tinte); stroke-width: 1px; opacity: 0; pointer-events: none; }
.ch-hp { stroke: var(--chart-tinte); stroke-width: 5px; opacity: 0; }
.ch-spalte:hover .ch-faden, .ch-spalte:hover .ch-hp { opacity: 1; }

/* Ebene über der Fläche: Beschriftungen und Marken als HTML (bleiben beim Dehnen unverzerrt) */
.ch-ebene {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.ch-ebene > * { position: absolute; }
.ch-ebene .ch-t { pointer-events: auto; cursor: help; }

.ch-etikett {
    padding: 0 0.25rem;
    font-size: 0.75rem;
    line-height: 1.25;
    color: var(--foreground);
    white-space: nowrap;
    background-color: color-mix(in srgb, var(--chart-flaeche) 82%, transparent);
}

.ch-etikett-rechts { right: 0; }
.ch-endwert { transform: translateX(-50%); font-weight: var(--font-weight-medium); }
.ch-endwert.ch-nach-links { transform: translateX(-100%); }

.ch-heute-text {
    padding-left: 0.25rem;
    font-size: 0.6875rem;
    color: var(--chart-text);
}

.ch-heute-text.ch-nach-links { transform: translateX(-100%); padding: 0 0.25rem 0 0; }

.ch-phase-kappe {
    top: 0;
    height: 5px;
    min-width: 4px;
    background-color: var(--chart-phase-kappe);
}

.ch-phase-kappe.ch-phase-laufend { background-color: var(--chart-1); }

/* größere Trefferfläche als die sichtbare Kappe bzw. Raute */
.ch-phase-kappe::after, .ch-ereignis::after {
    content: "";
    position: absolute;
    inset: -8px -6px;
}

/* Phasentitel: senkrecht, von unten nach oben zu lesen, im Streifen über der Fläche */
.ch-phase-titel {
    writing-mode: vertical-rl;
    transform: translateX(-50%) rotate(180deg);
    max-height: 156px;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.6875rem;
    line-height: 1.1;
    color: var(--foreground);
    white-space: nowrap;
}

.ch-phase-titel-eng { display: none; }

.ch-ereignis {
    width: 9px;
    height: 9px;
    margin-left: -4.5px;
    background-color: var(--chart-tinte);
    box-shadow: 0 0 0 2px var(--chart-flaeche);
    transform: rotate(45deg);
}

.ch-ereignis.ch-zukunft {
    background-color: var(--chart-flaeche);
    box-shadow: inset 0 0 0 2px var(--chart-tinte), 0 0 0 2px var(--chart-flaeche);
}

.ch-ereignis-zahl {
    position: absolute;
    left: 12px;
    top: -9px;
    transform: rotate(-45deg);
    font-size: 0.6875rem;
    color: var(--chart-text);
}

.ch-marke {
    width: 8px;
    height: 8px;
    margin-left: -4px;
    border: 2px solid var(--chart-tinte);
    border-radius: 50%;
    background-color: var(--chart-flaeche);
}

.ch-klammer {
    top: 0;
    height: 22px;
    border-bottom: 2px solid var(--chart-achse);
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    overflow: visible;
    background-clip: content-box;
    border-left: 2px solid transparent;
    border-right: 2px solid transparent;
}

.ch-klammer-ueber { border-bottom-color: var(--chart-ueber); }

.ch-klammer-text {
    font-size: 0.75rem;
    line-height: 1.4;
    color: var(--foreground);
    white-space: nowrap;
}

.ch-t:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }

/* Zeitachse: drei Dichten, sichtbar je nach Breite des Charts */
.ch-x {
    grid-column: 2;
    position: relative;
    height: 1.375rem;
    container-type: inline-size;
}

.ch-x-stufe { display: none; position: absolute; inset: 0; }
.ch-x-1 { display: block; }

.ch-xt {
    position: absolute;
    top: 0.4375rem;
    transform: translateX(-50%);
    white-space: nowrap;
}

.ch-xt-links { transform: none; }
.ch-xt-rechts { transform: translateX(-100%); }

@container (min-width: 480px) {
    .ch-x-1 { display: none; }
    .ch-x-2 { display: block; }
    .ch-phase-titel-eng { display: block; }
}

@container (min-width: 860px) {
    .ch-x-2 { display: none; }
    .ch-x-3 { display: block; }
}

.ch-ohne-x { padding-bottom: 0.25rem; }

/* Tooltip (chart-tooltip.js): ein Element für alle Charts, folgt dem Zeiger, bleibt im Fenster */
.ch-tip {
    position: fixed;
    z-index: 60;
    top: 0;
    left: 0;
    max-width: min(20rem, calc(100vw - 16px));
    padding: 0.5rem 0.625rem;
    background-color: var(--popover);
    color: var(--popover-foreground);
    border: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    font-size: 0.8125rem;
    line-height: 1.4;
    pointer-events: none;
    visibility: hidden;
}

.ch-tip.ch-tip-sichtbar { visibility: visible; }
.ch-tip-kopf { font-weight: var(--font-weight-medium); margin-bottom: 0.125rem; }
.ch-tip-zeile { display: flex; justify-content: space-between; gap: 1rem; }
.ch-tip-name { color: var(--muted-foreground); }
.ch-tip-wert { font-weight: var(--font-weight-medium); font-variant-numeric: tabular-nums; text-align: right; }
.ch-tip-text { color: var(--muted-foreground); margin-top: 0.125rem; }

/* ----- Dashboard-Seiten ----- */

/* Kennzahlen: eine Karte, Kacheln durch Haarlinien getrennt (kein Kartenteppich) */
.kz-rahmen { container-type: inline-size; }

.kz-leiste {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: hidden;
    border: 1px solid var(--border);
}

@container (min-width: 620px) {
    .kz-leiste { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.kz {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.875rem 1rem 1rem;
    min-width: 0;
    /* Haarlinien nach rechts und unten; die äußeren schneidet der Rahmen ab */
    box-shadow: 1px 0 0 var(--border), 0 1px 0 var(--border);
}

.kz-titel { font-size: 0.8125rem; color: var(--muted-foreground); }
.kz-wert { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 0.375rem; }
.kz-zahl { font-size: 1.625rem; font-weight: var(--font-weight-medium); line-height: 1.2; }
.kz-einheit { font-size: 0.875rem; color: var(--muted-foreground); }
.kz-vergleich { font-size: 0.8125rem; line-height: 1.4; }
.kz-fussnote { font-size: 0.75rem; line-height: 1.4; color: var(--muted-foreground); }
.kz .badge { white-space: normal; }
/* Übersicht: wenige Kacheln, dafür große Zahlen */
.kz-gross .kz-zahl { font-size: 2.25rem; }
.kz-gross .kz-titel, .kz-gross .kz-vergleich { font-size: 0.9375rem; }

/* Gruppe: Charts links, Einschätzung rechts daneben - auf schmalen Geräten darunter */
.db-rahmen { container-type: inline-size; }

.db-gruppe {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
    padding: 1.25rem;
}

.db-charts {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    min-width: 0;
}

.db-seite {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    min-width: 0;
}

@container (min-width: 940px) {
    .db-gruppe { grid-template-columns: minmax(0, 1fr) minmax(16rem, 21rem); gap: 2rem; }
    .db-gruppe.db-gruppe-allein { grid-template-columns: minmax(0, 1fr); }
    .db-seite { padding-left: 2rem; border-left: 1px solid var(--border); }
}

@media (max-width: 768px) {
    .db-gruppe { padding: 1rem 0.75rem; }
}

/* Kleine Vielfache: gleiche Zeitachse, gleiche Bauart, nebeneinander */
.db-vielfach {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
    gap: 1.5rem 1.25rem;
    align-items: end;
}

/* Einschätzung: Fließtext, kurze Zeilen */
.es { display: flex; flex-direction: column; gap: 0.5rem; }
.es-titel { font-size: 1rem; }
.es p { font-size: 0.875rem; line-height: 1.55; max-width: 70ch; white-space: pre-line; }
.es-stand { font-size: 0.75rem; color: var(--muted-foreground); }

.db-kopf-block { display: flex; flex-direction: column; gap: 0.25rem; }
.db-kopf-titel { font-size: 1.25rem; font-weight: var(--font-weight-medium); line-height: 1.3; }
.db-kopf-text { font-size: 0.875rem; line-height: 1.55; max-width: 85ch; margin-top: 0.25rem; }

/* Zweiter Chart im selben Rahmen (teilt die Zeitachse mit dem darüber) */
.ch-zwischentitel {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: 0.625rem;
    margin-top: 0.75rem;
}

.db-badge-abstand { margin-left: 0.5rem; }
.data-table .db-zelle-text { color: var(--muted-foreground); min-width: 16rem; }

/* Ereignisse und Phasen als Liste */
.db-liste { list-style: none; display: flex; flex-direction: column; }

.db-liste li {
    display: grid;
    grid-template-columns: 11.5rem minmax(0, 1fr);
    gap: 0.125rem 1rem;
    padding: 0.625rem 1.25rem;
    border-top: 1px solid var(--border);
    font-size: 0.875rem;
}

.db-liste li:first-child { border-top: none; }
.db-liste-tag { color: var(--muted-foreground); font-variant-numeric: tabular-nums; white-space: nowrap; }
.db-liste-titel { font-weight: var(--font-weight-medium); }
.db-liste-text { grid-column: 2; color: var(--muted-foreground); line-height: 1.5; max-width: 85ch; }
.db-liste .badge { margin-left: 0.5rem; }

@media (max-width: 768px) {
    .db-liste li { grid-template-columns: minmax(0, 1fr); padding: 0.625rem 1rem; }
    .db-liste-text { grid-column: 1; }
}

.db-stand { font-size: 0.75rem; color: var(--muted-foreground); }
/* ===== DS.FitnessHub: Tagebuch (docs/Gestaltung.md 4.2-4.5) ===== */

:root {
    /* Bedeutung (Gestaltung.md 2.3) */
    --fh-kcal: var(--primary);         /* #0C5DA6 */
    --fh-eiweiss: #16794C;
    --fh-ueber: #B0500F;               /* Text; Diagrammflächen weiter --chart-ueber */
    --fh-grenze: #B3261E;
    --fh-wasser: #0A6E8F;
    --fh-spur: #ececec;                /* leere Ringspur, Balkenhintergrund */

    /* Zahlen */
    --fh-zahl-xl: 3rem;                /* Ringmitte Tagebuch ab 768 px */
    --fh-zahl-l: 2.25rem;              /* Ringmitte 390 px, Hero-Kennzahl (= .kz-gross) */
    --fh-zahl-m: 1.5rem;               /* Kennzahl in Leisten */
    --fh-zahl-s: 1.125rem;             /* Summen in Köpfen */

    /* Abstände (4er-Raster, ergänzt das 0.75rem-Standard-Gap) */
    --fh-a1: 0.25rem; --fh-a2: 0.5rem; --fh-a3: 0.75rem; --fh-a4: 1rem; --fh-a6: 1.5rem; --fh-a8: 2rem;

    --fh-treffer: 44px;                /* Mindesthöhe Touch-Ziele */
    --fh-ring: 9rem;                   /* Ringdurchmesser 390 px; ab 768 px 11rem */
    --fh-ring-strich: 10;              /* SVG-Strichstärke in viewBox-Einheiten (viewBox 0 0 120 120) */
}

@media (min-width: 769px) {
    :root { --fh-ring: 11rem; }
}

.fh-zahl { font-variant-numeric: tabular-nums; font-weight: var(--font-weight-medium); line-height: 1.1; }
.fh-einheit { font-size: 0.875rem; color: var(--muted-foreground); }

.icon-xs { width: 12px; height: 12px; flex-shrink: 0; }
.icon-lg { width: 32px; height: 32px; flex-shrink: 0; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Reiter (STANDARDS 3.11, aus der Showcase; Höhe als Trefffläche) */
.tabs {
    display: flex;
    gap: 0.25rem;
    padding: 0 0.75rem;
    background-color: var(--card);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    scrollbar-width: thin;
}

.tab {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    flex-shrink: 0;
    min-height: var(--fh-treffer);
    padding: 0.75rem 1rem;
    border: none;
    background: none;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: var(--font-weight-medium);
    color: var(--foreground);
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}

.tab::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: transparent;
    transition: background-color 0.15s ease;
}

.tab:hover::after { background: var(--border); }
.tab.active { color: var(--primary); }
.tab.active::after { background: var(--primary); }
.tab:focus-visible { outline: 2px solid var(--ring); outline-offset: -2px; }
.tab-count { font-weight: var(--font-weight-normal); color: var(--muted-foreground); font-variant-numeric: tabular-nums; }

/* Filter-Bar (STANDARDS 3.8) */
.filter-bar { display: flex; flex-wrap: wrap; gap: 0.25rem; }

.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    min-height: 36px;
    padding: 0.375rem 0.875rem;
    font-family: inherit;
    font-size: 0.8125rem;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--foreground);
    cursor: pointer;
}

.filter-btn:hover { background: var(--muted); }
.filter-btn.active { background: var(--primary); border-color: var(--primary); color: var(--primary-foreground); }

/* ----- Seite und Datum ----- */

.tb-seite { gap: var(--fh-a6); }
.tb-seite > .db-stand { margin-top: calc(-1 * var(--fh-a3)); }

.tb-datum-nav { display: flex; align-items: center; gap: var(--fh-a2); min-width: 0; }
.tb-icon-knopf { width: var(--fh-treffer); height: var(--fh-treffer); padding: 0; flex-shrink: 0; }
.tb-datum { display: flex; flex-direction: column; align-items: center; min-width: 7.5rem; line-height: 1.2; }
.tb-datum-unter { font-size: 0.75rem; color: var(--muted-foreground); font-weight: var(--font-weight-normal); }
.tb-heute-knopf, .tb-erfassen-oben { min-height: var(--fh-treffer); }
.tb-knopf-gross { min-height: var(--fh-treffer); padding: 0.625rem 1.25rem; font-size: 0.9375rem; }
.tb-knopf-klein { min-height: var(--fh-treffer); }

.tb-karten-titel { font-size: 1.25rem; font-weight: var(--font-weight-medium); line-height: 1.3; margin: 0; }

.tb-leer { display: flex; flex-direction: column; align-items: center; gap: var(--fh-a3); padding: var(--fh-a8) var(--fh-a6); color: var(--muted-foreground); }
.tb-leer .btn { margin-top: var(--fh-a1); }
.tb-leer p { margin: 0; font-size: 1rem; color: var(--foreground); }

/* ----- Hero: zwei Ringe, daneben Tagesart, Alkohol, Fett/KH, Wasser ----- */

.tb-hero {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: var(--fh-a8);
    align-items: center;
    padding: var(--fh-a6);
}

.tb-ringe { display: flex; gap: var(--fh-a6); justify-content: center; }

.tb-ring { margin: 0; display: flex; flex-direction: column; align-items: center; gap: var(--fh-a2); }
.tb-ring-flaeche { position: relative; width: var(--fh-ring); aspect-ratio: 1; }
.tb-ring-flaeche > svg { display: block; width: 100%; height: 100%; }
.tb-ring-spur, .tb-ring-wert, .tb-ring-ueberlauf { fill: none; stroke-width: var(--fh-ring-strich); }
.tb-ring-spur { stroke: var(--fh-spur); }
.tb-ring-wert { stroke: var(--fh-kcal); stroke-linecap: butt; transition: stroke-dasharray 0.35s ease; }
.tb-ring-eiweiss .tb-ring-wert { stroke: var(--fh-eiweiss); }
.tb-ring-ueberlauf { stroke: var(--chart-ueber); stroke-linecap: butt; transition: stroke-dasharray 0.35s ease; }

.tb-ring-mitte {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.125rem;
    text-align: center;
}

.tb-ring-zahl { font-size: var(--fh-zahl-l); }
.tb-ring-zeile { font-size: 0.8125rem; color: var(--muted-foreground); line-height: 1.2; max-width: 7rem; }
.tb-ring-ueber .tb-ring-zahl, .tb-ring-ueber .tb-ring-zeile { color: var(--fh-ueber); }
.tb-ring-haken { width: 2.75rem; height: 2.75rem; color: var(--fh-eiweiss); stroke-width: 2.5; }
.tb-ring-erreicht .tb-ring-zeile { color: var(--fh-eiweiss); font-weight: var(--font-weight-medium); }
.tb-ring-unten { font-size: 0.875rem; color: var(--muted-foreground); }
.tb-ring-unten .fh-zahl { color: var(--foreground); }

@media (min-width: 769px) {
    .tb-ring-zahl { font-size: var(--fh-zahl-xl); }
    .tb-ring-zeile { font-size: 0.875rem; }
}

@media (prefers-reduced-motion: reduce) {
    .tb-ring-wert, .tb-ring-ueberlauf { transition: none; }
}

.tb-hero-seite { display: flex; flex-direction: column; gap: var(--fh-a4); min-width: 0; }

/* Tagesart: vier Knöpfe (Filter-Bar), aktiv in Primär, darunter klein das kcal-Ziel */
.tb-tagesart { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--border); }

.tb-tagesart-knopf {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.125rem;
    min-height: 60px;
    padding: 0.375rem 0.25rem;
    border: none;
    border-right: 1px solid var(--border);
    background: var(--card);
    color: var(--foreground);
    font-family: inherit;
    font-size: 0.8125rem;
    cursor: pointer;
}

.tb-tagesart-knopf:last-child { border-right: none; }
.tb-tagesart-knopf:hover { background: var(--muted); }
.tb-tagesart-knopf:disabled { cursor: default; }
.tb-tagesart-knopf.aktiv { background: var(--primary); color: var(--primary-foreground); }
.tb-tagesart-knopf .tb-tagesart-ziel { font-size: 0.75rem; color: var(--muted-foreground); font-weight: var(--font-weight-normal); }
.tb-tagesart-knopf.aktiv .tb-tagesart-ziel { color: var(--primary-foreground); opacity: 0.85; }
.tb-tagesart-knopf.tb-gespeichert { background: #0a7d2c; color: #fff; }
.tb-tagesart-knopf:focus-visible { outline: 2px solid var(--ring); outline-offset: -3px; }

/* Nicht festgelegt: Ruhe gilt - helle Füllung mit blauer Schrift statt Rahmen; Rahmen gibt es nur für den Fokus
   (Web-UI/UX-Runde 2 zu RC 3) */
.tb-tagesart-offen .tb-tagesart-knopf.aktiv {
    background: var(--fh-spur);
    color: var(--primary);
}

.tb-tagesart-offen .tb-tagesart-knopf.aktiv .tb-tagesart-ziel { color: var(--primary); }
.tb-tagesart-hinweis { margin-top: calc(-1 * var(--fh-a3)); font-size: 0.75rem; color: var(--muted-foreground); }

/* Dünne Balken (Fett, KH) und Alkohol der Woche */
.tb-balken-gruppe { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--fh-a4); }
.tb-balken-kopf, .tb-alkohol-kopf { display: flex; align-items: baseline; gap: var(--fh-a2); font-size: 0.875rem; }
.tb-balken-name, .tb-alkohol-name { flex: 1; min-width: 0; color: var(--muted-foreground); }
.tb-balken-wert, .tb-alkohol-wert { white-space: nowrap; }
.tb-balken-wert .fh-einheit, .tb-alkohol-wert .fh-einheit { font-size: 0.8125rem; }
.tb-balken-spur { position: relative; height: 8px; margin-top: 0.375rem; background: var(--fh-spur); }
.tb-balken-fuellung { height: 100%; background: var(--chart-neutral); }
.tb-balken-marke { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--chart-tinte); }
.tb-balken-wasser .tb-balken-fuellung { background: var(--fh-wasser); }

.tb-alkohol-kopf { align-items: center; }
.tb-alkohol-kopf svg { color: var(--muted-foreground); }
.tb-alkohol-nahe .tb-balken-fuellung { background: var(--chart-ueber); }
.tb-alkohol-nahe .tb-alkohol-wert, .tb-alkohol-nahe .tb-alkohol-wert .fh-einheit { color: var(--fh-ueber); }
.tb-alkohol-grenze .tb-balken-fuellung { background: var(--fh-grenze); }
.tb-alkohol-grenze .tb-alkohol-wert, .tb-alkohol-grenze .tb-alkohol-wert .fh-einheit, .tb-alkohol-tag { color: var(--fh-grenze); }
.tb-alkohol-tag { margin-top: var(--fh-a1); font-size: 0.75rem; }

/* Wasser: Zahl links, Knopf rechts */
.tb-wasser { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--fh-a3); padding-top: var(--fh-a3); border-top: 1px solid var(--border); }
.tb-wasser-wert { display: flex; align-items: center; gap: var(--fh-a2); }
.tb-wasser-wert svg { color: var(--fh-wasser); }
.tb-wasser-wert .fh-zahl { font-size: var(--fh-zahl-m); }
.tb-wasser-text { display: flex; flex-direction: column; min-width: 0; }
.tb-wasser-teile { font-size: 0.8125rem; color: var(--muted-foreground); }
.tb-wasser-aktionen { display: flex; gap: var(--fh-a2); }
.tb-wasser-knopf { min-height: var(--fh-treffer); min-width: 6rem; }

/* ----- Mahlzeiten und Einträge ----- */

.tb-tag { padding: var(--fh-a2) 0; }
.tb-mahlzeit + .tb-mahlzeit { border-top: 1px solid var(--border); }

.tb-mahlzeit-kopf {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--fh-a1) var(--fh-a4);
    padding: var(--fh-a4) var(--fh-a6) var(--fh-a1);
}

.tb-mahlzeit-name { margin: 0; font-size: 1.125rem; font-weight: var(--font-weight-medium); }
.tb-mahlzeit-summe { font-size: 0.875rem; color: var(--muted-foreground); white-space: nowrap; }
.tb-mahlzeit-summe .fh-zahl { color: var(--foreground); }

.tb-liste { list-style: none; margin: 0; padding: 0 0 var(--fh-a2); }

.tb-zeile {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 10rem 3.25rem 5.5rem 4.75rem var(--fh-treffer);
    align-items: center;
    column-gap: var(--fh-a3);
    min-height: 48px;
    padding: 0 var(--fh-a3) 0 var(--fh-a6);
}

.tb-zeile:hover { background: var(--background); }
.tb-zeile-name { display: flex; align-items: center; gap: 0.375rem; min-width: 0; }
.tb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-geschaetzt { display: inline-flex; color: var(--muted-foreground); }
.tb-zeile-meta { display: contents; }
.tb-zeile-menge, .tb-zeile-zeit { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.875rem; color: var(--muted-foreground); }
.tb-zeile-zeit { font-weight: var(--font-weight-normal); }
.tb-zeile-kcal, .tb-zeile-eiweiss { text-align: right; white-space: nowrap; }
.tb-zeile-kcal .fh-einheit, .tb-zeile-eiweiss .fh-einheit { font-size: 0.75rem; }

.tb-aktion {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--fh-treffer);
    height: var(--fh-treffer);
    padding: 0;
    border: none;
    background: transparent;
    color: var(--muted-foreground);
    cursor: pointer;
}

.tb-aktion:hover { background: var(--muted); color: var(--foreground); }
.tb-aktion:focus-visible, .tb-rueckgaengig:focus-visible { outline: 2px solid var(--ring); outline-offset: -2px; }

/* Gerade storniert: ausgegraut, „Rückgängig“ an Ort und Stelle (Gestaltung.md 4.5) */
.tb-zeile-storniert .tb-zeile-name, .tb-zeile-storniert .tb-zeile-menge, .tb-zeile-storniert .tb-zeile-zeit { opacity: 0.5; text-decoration: line-through; }
.tb-zeile-storniert .tb-zeile-kcal, .tb-zeile-storniert .tb-zeile-eiweiss { display: none; }
.tb-zeile-storniert .tb-zeile-aktion { grid-column: 4 / -1; justify-self: end; }

.tb-rueckgaengig {
    min-height: var(--fh-treffer);
    padding: 0 var(--fh-a3);
    border: none;
    background: none;
    color: var(--primary);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: var(--font-weight-medium);
    white-space: nowrap;
    cursor: pointer;
}

.tb-rueckgaengig-text { color: var(--muted-foreground); font-weight: var(--font-weight-normal); }

/* ----- Woche ----- */

.tb-woche { display: flex; flex-direction: column; gap: var(--fh-a4); padding: var(--fh-a6); }
.tb-woche-kopf { display: flex; align-items: baseline; gap: var(--fh-a3); }
.tb-woche-zeitraum { font-size: 0.875rem; color: var(--muted-foreground); font-variant-numeric: tabular-nums; }

.tb-woche-zahlen { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: hidden; border: 1px solid var(--border); }
.tb-kz { display: flex; flex-direction: column; gap: 0.125rem; min-width: 0; padding: var(--fh-a3) var(--fh-a4); box-shadow: 1px 0 0 var(--border); }
.tb-kz-titel { font-size: 0.8125rem; color: var(--muted-foreground); }
.tb-kz-wert { white-space: nowrap; }
.tb-kz-wert .fh-zahl { font-size: var(--fh-zahl-m); }
.tb-kz-vergleich { font-size: 0.75rem; color: var(--muted-foreground); line-height: 1.35; }
.tb-kz-alkohol-nahe .tb-kz-wert, .tb-kz-alkohol-nahe .tb-kz-wert .fh-einheit { color: var(--fh-ueber); }
.tb-kz-alkohol-grenze .tb-kz-wert, .tb-kz-alkohol-grenze .tb-kz-wert .fh-einheit { color: var(--fh-grenze); }

/* ----- Telefon: eine Spalte, Erfassen als Leiste im Daumenbereich ----- */

.tb-leiste-unten { display: none; }

@media (max-width: 768px) {
    .tb-hero { grid-template-columns: minmax(0, 1fr); gap: var(--fh-a6); padding: var(--fh-a4); }
    .tb-ringe { justify-content: space-around; gap: var(--fh-a3); }
    .tb-erfassen-oben, .tb-heute-knopf { display: none; }
    .tb-datum { min-width: 0; flex: 1; }
    .tb-datum-nav { flex: 1; justify-content: space-between; }

    .tb-leiste-unten {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 30;
        padding: var(--fh-a2) var(--fh-a4) calc(var(--fh-a2) + env(safe-area-inset-bottom));
        background: var(--card);
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.12);
    }

    .tb-leiste-unten .btn { flex: 1; }
    .tb-seite { padding-bottom: calc(4.5rem + env(safe-area-inset-bottom)); }

    .tb-mahlzeit-kopf { padding: var(--fh-a3) var(--fh-a4) var(--fh-a1); }

    .tb-zeile {
        grid-template-columns: minmax(0, 1fr) auto var(--fh-treffer);
        grid-template-areas: "name kcal aktion" "meta eiweiss aktion";
        column-gap: var(--fh-a2);
        padding: var(--fh-a2) var(--fh-a1) var(--fh-a2) var(--fh-a4);
    }

    .tb-zeile-name { grid-area: name; }
    .tb-zeile-meta { display: flex; gap: 0.375rem; min-width: 0; grid-area: meta; }
    .tb-zeile-menge { flex: 0 1 auto; }
    .tb-zeile-menge:not(:empty)::after { content: " ·"; }
    .tb-zeile-zeit { flex-shrink: 0; }
    .tb-zeile-kcal { grid-area: kcal; }
    .tb-zeile-eiweiss { grid-area: eiweiss; font-size: 0.8125rem; color: var(--muted-foreground); }
    .tb-zeile-aktion { grid-area: aktion; }
    .tb-zeile-storniert .tb-zeile-aktion { grid-area: 1 / 2 / 3 / 4; }

    .tb-woche { padding: var(--fh-a4); }
    .tb-kz { padding: var(--fh-a2) var(--fh-a3); }
    .tb-kz-wert .fh-zahl { font-size: var(--fh-zahl-s); }
    .tb-kz-wert .fh-einheit { font-size: 0.75rem; }
}

/* ----- Erfassen (W2): Liste links, Mengenformular rechts ab 1366 px, sonst darunter ----- */

.ef-raster { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--fh-a6); align-items: start; }

@media (min-width: 1366px) {
    .ef-raster { grid-template-columns: minmax(0, 1fr) minmax(24rem, 30rem); }
    .ef-formular { position: sticky; top: 0; }
}

@media (max-width: 1365px) {
    .ef-formular-leer { display: none; }
}

.ef-auswahl { display: flex; flex-direction: column; min-width: 0; }
.ef-suche { padding: var(--fh-a4) var(--fh-a6) var(--fh-a3); }
.ef-suchfeld { position: relative; display: flex; align-items: center; }
.ef-suchfeld svg { position: absolute; left: 0.75rem; color: var(--muted-foreground); pointer-events: none; }
.ef-suchfeld .form-input { width: 100%; min-height: var(--fh-treffer); padding-left: 2.25rem; font-size: 1rem; }
.ef-tabs { padding: 0 var(--fh-a3); }
.ef-innen { margin: var(--fh-a3) var(--fh-a6) 0; }

.ef-leer { display: flex; align-items: center; gap: var(--fh-a2); margin: 0; padding: var(--fh-a6); color: var(--muted-foreground); font-size: 0.9375rem; }

.ef-liste { list-style: none; margin: 0; padding: var(--fh-a2) 0; }
.ef-liste > li + li { border-top: 1px solid var(--border); }

.ef-zeile {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: var(--fh-a3);
    min-height: 56px;
    padding: var(--fh-a1) var(--fh-a4) var(--fh-a1) var(--fh-a6);
}

.ef-zeile.aktiv { background: var(--accent); box-shadow: inset 3px 0 0 var(--primary); }
.ef-zeile-text { display: flex; flex-direction: column; gap: 0.125rem; min-width: 0; text-align: left; }
.ef-zeile-knopf { min-height: 48px; justify-content: center; padding: 0; border: none; background: none; color: inherit; font: inherit; cursor: pointer; }
.ef-zeile-knopf:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.ef-zeile-knopf:hover .ef-zeile-name { color: var(--primary); }
.ef-zeile-name { display: inline-flex; align-items: center; gap: 0.375rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.9375rem; }
.ef-zeile-stern { color: #b45309; fill: currentColor; }
.ef-zeile-unter { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.8125rem; color: var(--muted-foreground); }
.ef-zeile-werte { font-size: 0.8125rem; color: var(--muted-foreground); white-space: nowrap; }
.ef-zeile-werte .fh-zahl { color: var(--foreground); }
.ef-zeile-quelle { justify-self: end; }
.ef-plus { width: var(--fh-treffer); height: var(--fh-treffer); padding: 0; }
.ef-zeile-rueckgaengig { display: inline-flex; align-items: center; gap: 0.25rem; padding: 0 0.25rem; }
.ef-ok { color: #0a7d2c; }

.ef-weiter { display: flex; flex-wrap: wrap; gap: var(--fh-a2); padding: var(--fh-a3) var(--fh-a6) var(--fh-a6); border-top: 1px solid var(--border); }
.ef-weiter .btn { min-height: var(--fh-treffer); max-width: 100%; }
.ef-weiter .btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Formulare (Schnelleintrag und Menge) */
.ef-schnell, .ef-menge-form { display: flex; flex-direction: column; gap: var(--fh-a4); padding: var(--fh-a4) var(--fh-a6) var(--fh-a6); }
.ef-schnell .form-group, .ef-menge-form .form-group { max-width: none; }
.ef-felder { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: var(--fh-a3); }
.ef-menge { display: flex; align-items: center; gap: var(--fh-a2); }
.ef-menge .form-input { flex: 1; min-width: 0; min-height: var(--fh-treffer); }
.ef-menge-einheit { min-width: 2rem; color: var(--muted-foreground); font-size: 0.9375rem; }
.ef-menge-feld { font-size: var(--fh-zahl-m); font-variant-numeric: tabular-nums; }
.form-input-num { text-align: right; font-variant-numeric: tabular-nums; }
.ef-portionen .filter-btn { min-height: var(--fh-treffer); }

.ef-wann { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--fh-a4); }
.ef-wann .filter-btn { min-height: var(--fh-treffer); }
.ef-uhrzeit .form-input { min-height: var(--fh-treffer); width: 7.5rem; }

.ef-buchen { display: flex; flex-wrap: wrap; gap: var(--fh-a2); }
.ef-buchen-knopf { flex: 1 1 12rem; }

/* Mengenformular */
.ef-kopf { display: flex; align-items: flex-start; gap: var(--fh-a1); padding: var(--fh-a4) var(--fh-a3) 0 var(--fh-a6); }
.ef-kopf-text { flex: 1; min-width: 0; }
.ef-kopf-text .tb-karten-titel { overflow-wrap: anywhere; }
.ef-kopf-unter { display: flex; flex-wrap: wrap; align-items: center; gap: var(--fh-a2); margin-top: var(--fh-a1); font-size: 0.875rem; color: var(--muted-foreground); }
.ef-stern.aktiv { color: #b45309; }
.ef-stern.aktiv svg { fill: currentColor; }
.ef-pruefen { margin: var(--fh-a3) var(--fh-a6) 0; }

.ef-vorschau {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--fh-a1) var(--fh-a4);
    padding: var(--fh-a3) var(--fh-a4);
    background: var(--background);
    border: 1px solid var(--border);
}

.ef-vorschau .fh-zahl { font-size: var(--fh-zahl-s); }
.ef-vorschau-haupt { flex-basis: 100%; }
.ef-vorschau-haupt .fh-zahl { font-size: var(--fh-zahl-l); }
.ef-quelle { margin: 0; padding: 0 var(--fh-a6) var(--fh-a4); font-size: 0.75rem; color: var(--muted-foreground); }

/* Ohne Auswahl: was am Tag noch offen ist */
.ef-offen { display: flex; flex-direction: column; gap: var(--fh-a4); padding: var(--fh-a6); }
.ef-offen-zahlen { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--border); }
.ef-offen-zahlen .tb-kz-wert .fh-zahl { font-size: var(--fh-zahl-l); }
.ef-ueber, .ef-ueber .fh-einheit { color: var(--fh-ueber); }
.ef-erreicht { display: inline-flex; align-items: center; color: var(--fh-eiweiss); font-size: 1.125rem; }
.ef-zum-tag { display: inline-flex; align-items: center; gap: 0.25rem; align-self: flex-start; min-height: var(--fh-treffer); }
.ef-tipp { margin: 0; font-size: 0.875rem; color: var(--muted-foreground); }
.ef-fuer { font-weight: var(--font-weight-normal); color: var(--muted-foreground); }

@media (max-width: 768px) {
    .ef-suche { padding: var(--fh-a3) var(--fh-a4); }
    .ef-zeile { padding: var(--fh-a1) var(--fh-a2) var(--fh-a1) var(--fh-a4); gap: var(--fh-a2); }
    .ef-zeile-quelle { display: none; }
    .ef-schnell, .ef-menge-form { padding: var(--fh-a3) var(--fh-a4) var(--fh-a4); }
    .ef-kopf { padding-left: var(--fh-a4); }
    .ef-pruefen { margin: var(--fh-a3) var(--fh-a4) 0; }
    .ef-weiter { padding: var(--fh-a3) var(--fh-a4) var(--fh-a4); }
    .ef-weiter .btn { flex: 1 1 100%; }
    .ef-felder { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ef-buchen-knopf { flex-basis: 100%; }
    .ef-offen { padding: var(--fh-a4); }
}

/* ----- Lebensmittel (W3) ----- */

.lm-filter { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--fh-a4) var(--fh-a6); padding: var(--fh-a4) var(--fh-a6); }
.lm-filter-suche { flex: 1 1 16rem; min-width: 0; }
.lm-filter .form-label { margin-bottom: 0.375rem; }
.lm-filter-gruppe { display: flex; flex-direction: column; }
.lm-filter .filter-btn { min-height: var(--fh-treffer); }
.lm-sortierung { min-height: var(--fh-treffer); }
.lm-zuruecksetzen { min-height: var(--fh-treffer); }

.lm-kopfzeile, .lm-zeile {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 5rem 4.5rem 4.5rem 4.5rem 4.5rem var(--fh-treffer);
    align-items: center;
    column-gap: var(--fh-a3);
    padding: 0 var(--fh-a3) 0 var(--fh-a6);
}

.lm-kopfzeile { min-height: 40px; font-size: 0.8125rem; color: var(--muted-foreground); border-bottom: 1px solid var(--border); }
.lm-r { text-align: right; }
.lm-liste { list-style: none; margin: 0; padding: 0; }
.lm-eintrag + .lm-eintrag { border-top: 1px solid var(--border); }
.lm-eintrag.offen { background: var(--background); }
.lm-zeile { min-height: 56px; }
.lm-zeile-knopf { display: flex; flex-direction: column; justify-content: center; gap: 0.125rem; min-height: 52px; min-width: 0; padding: 0; border: none; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.lm-zeile-knopf:hover .lm-name-text { color: var(--primary); }
.lm-zeile-knopf:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.lm-name { display: flex; align-items: center; gap: var(--fh-a2); min-width: 0; }
.lm-name-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lm-unter { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.8125rem; color: var(--muted-foreground); }
.lm-wert { text-align: right; white-space: nowrap; }
.lm-wert .fh-einheit { font-size: 0.75rem; }
.lm-mobil { display: none; }

.lm-detail { display: flex; flex-direction: column; gap: var(--fh-a3); padding: 0 var(--fh-a6) var(--fh-a4); }
.lm-werte { display: grid; grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr)); gap: var(--fh-a2) var(--fh-a4); margin: 0; }
.lm-werte dt { font-size: 0.75rem; color: var(--muted-foreground); }
.lm-werte dd { margin: 0; font-size: 1rem; }
.lm-werte dd .fh-zahl, .lm-werte dd.fh-zahl { font-size: var(--fh-zahl-s); }
.lm-je { margin: 0; font-size: 0.8125rem; color: var(--muted-foreground); }
.lm-portionen ul { margin: 0; padding-left: 1.125rem; font-size: 0.875rem; }
/* RC 10: Flüssigkeit eines Lebensmittels (zählt als Getränk, Wasser zum Anrühren) */
.lm-fluessigkeit { display: flex; flex-direction: column; gap: var(--fh-a2); }
.lm-fluessigkeit .filter-bar { flex-wrap: wrap; }
.lm-zubereitung { margin: 0; max-width: 22rem; }
.lm-anzahl { margin: 0; padding: var(--fh-a3) var(--fh-a6); font-size: 0.8125rem; color: var(--muted-foreground); border-top: 1px solid var(--border); }

@media (max-width: 1100px) {
    .lm-kopfzeile, .lm-zeile { grid-template-columns: minmax(0, 1fr) 4.5rem 4.5rem 4.5rem var(--fh-treffer); }
    .lm-breit { display: none; }
    .lm-kopfzeile span:nth-child(5), .lm-kopfzeile span:nth-child(6) { display: none; }
}

@media (max-width: 768px) {
    .lm-filter { padding: var(--fh-a3) var(--fh-a4); gap: var(--fh-a3); }
    .lm-filter-suche, .lm-filter-gruppe { flex-basis: 100%; }
    .lm-kopfzeile { display: none; }
    .lm-zeile {
        grid-template-columns: minmax(0, 1fr) auto var(--fh-treffer);
        grid-template-areas: "name kcal stern" "name eiweiss stern";
        column-gap: var(--fh-a2);
        padding: var(--fh-a1) var(--fh-a1) var(--fh-a1) var(--fh-a4);
    }
    .lm-zeile-knopf { grid-area: name; }
    .lm-quelle { display: none; }
    .lm-kcal { grid-area: kcal; }
    .lm-wert:not(.lm-kcal):not(.lm-breit) { grid-area: eiweiss; font-size: 0.8125rem; color: var(--muted-foreground); }
    .lm-mobil { display: inline; }
    .lm-zeile .ef-stern { grid-area: stern; }
    .lm-detail { padding: 0 var(--fh-a4) var(--fh-a4); }
    .lm-anzahl { padding: var(--fh-a3) var(--fh-a4); }
}

/* Geführte Neuanlage (STANDARDS 3.24) */
.neu-gefuehrt { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.neu-karten { display: flex; flex-direction: column; gap: 0.75rem; min-width: 0; }
.neu-einheit { min-height: var(--fh-treffer); }
.form-input.is-invalid { border-color: var(--destructive); }

@media (max-width: 900px) {
    .neu-gefuehrt { grid-template-columns: minmax(0, 1fr); }
}

/* ----- Geräte (W4) ----- */

.ge-kopfzeile, .ge-zeile {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 7rem 9rem 9rem 6rem 7.5rem;
    align-items: center;
    column-gap: var(--fh-a3);
    padding: 0 var(--fh-a4) 0 var(--fh-a6);
}

.ge-kopfzeile { min-height: 40px; font-size: 0.8125rem; color: var(--muted-foreground); border-bottom: 1px solid var(--border); }
.ge-liste { list-style: none; margin: 0; padding: 0; }
.ge-zeile { min-height: 56px; }
.ge-zeile + .ge-zeile { border-top: 1px solid var(--border); }
.ge-name { display: inline-flex; align-items: center; gap: var(--fh-a2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ge-name svg { color: var(--muted-foreground); }
.ge-zeit { font-size: 0.875rem; color: var(--muted-foreground); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ge-label { display: none; }
.ge-aktion { justify-self: end; }
.ge-widerrufen .ge-name, .ge-widerrufen .ge-praefix { color: var(--muted-foreground); }

@media (max-width: 900px) {
    .ge-kopfzeile { display: none; }
    .ge-zeile {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas: "name status" "praefix aktion" "angelegt aktion" "zuletzt aktion";
        row-gap: 0.125rem;
        padding: var(--fh-a3) var(--fh-a4);
    }
    .ge-name { grid-area: name; }
    .ge-praefix { grid-area: praefix; }
    .ge-zeit:nth-of-type(3) { grid-area: angelegt; }
    .ge-zeit:nth-of-type(4) { grid-area: zuletzt; }
    .ge-status { grid-area: status; justify-self: end; }
    .ge-aktion { grid-area: aktion; align-self: end; }
    .ge-label { display: inline; }
}

/* Runde 1: Feinschliff nach Durchsicht der Bilder (390/1366) */
.ef-offen-kurz { display: none; }
.lm-hinweis { margin: 0; padding: var(--fh-a3) var(--fh-a6) 0; font-size: 0.8125rem; color: var(--muted-foreground); }
.dk-felder .ef-menge .form-input { max-width: 12rem; }

@media (max-width: 1365px) {
    .ef-offen-kurz {
        display: flex;
        flex-wrap: wrap;
        align-items: baseline;
        gap: 0.25rem 0.375rem;
        min-height: var(--fh-treffer);
        padding: var(--fh-a3) var(--fh-a6);
        background: var(--accent);
        color: var(--foreground);
        font-size: 0.875rem;
        text-decoration: none;
        border-bottom: 1px solid var(--border);
    }
    .ef-offen-kurz .fh-zahl { font-size: var(--fh-zahl-s); }
    .ef-erreicht-kurz { color: var(--fh-eiweiss); font-weight: var(--font-weight-medium); }
}

@media (max-width: 768px) {
    .ef-offen-kurz { padding: var(--fh-a2) var(--fh-a4); }
    .ef-tabs { padding: 0; }
    .ef-tabs .tab { flex: 1 0 auto; padding: 0.75rem 0.625rem; }
    .ef-tabs .tab svg, .ef-tabs .tab-count { display: none; }
    .lm-filter-gruppe > .form-label { display: none; }
    .lm-filter-gruppe { flex-basis: auto; }
    .lm-filter-suche { flex-basis: 100%; }
    .lm-hinweis { padding: var(--fh-a3) var(--fh-a4) var(--fh-a1); }
}

/* ----- Tracking-Seiten (Gestaltung.md W5): ruhiger, klarere Hierarchie ----- */

:root { --chart-raster: #f1f1f1; }

.db-seiten { gap: var(--fh-a6); }
.db-seiten .card-header { font-size: 1.25rem; padding: var(--fh-a4) var(--fh-a6); }
.db-kopf-titel { font-size: 1.25rem; }

.kz-titel { font-size: 0.8125rem; }
.kz-zahl { font-variant-numeric: tabular-nums; }
.kz-gross .kz-zahl { font-size: var(--fh-zahl-l); }
.kz-gross .kz-titel { font-size: 0.875rem; }
.kz-gross .kz-vergleich { font-size: 0.875rem; }
.kz-vergleich { color: var(--muted-foreground); }
.kz-einordnung { display: inline-flex; align-items: center; gap: 0.25rem; font-size: 0.8125rem; color: var(--muted-foreground); }
.kz-gut { color: var(--fh-eiweiss); }

/* Übersicht: links heute offen (zwei Ringe), rechts die vier Zahlen */
.ue-hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--fh-a6); align-items: stretch; }
.ue-heute { display: flex; flex-direction: column; align-items: center; gap: var(--fh-a3); padding: var(--fh-a4); border: 1px solid var(--border); color: var(--foreground); text-decoration: none; }
.ue-heute:hover { background: var(--background); text-decoration: none; }
.ue-heute:focus-visible { outline: 2px solid var(--ring); outline-offset: -2px; }
.ue-heute-titel { display: inline-flex; align-items: center; gap: 0.25rem; align-self: flex-start; font-size: 0.875rem; color: var(--muted-foreground); }
.ue-heute-quelle { align-self: flex-end; font-size: 0.75rem; color: var(--muted-foreground); }
.ue-heute .tb-ringe { gap: var(--fh-a4); }

@container (min-width: 880px) {
    .ue-hero { grid-template-columns: auto minmax(0, 1fr); }
    .ue-hero-ohne { grid-template-columns: minmax(0, 1fr); }
    .ue-hero .kz-leiste { grid-template-columns: repeat(2, minmax(0, 1fr)); height: 100%; }
    .ue-hero .kz { justify-content: center; }
}

@container (min-width: 1400px) {
    .ue-hero .kz-leiste { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
    .db-seiten { gap: var(--fh-a4); }
    .db-seiten .card-header { padding: var(--fh-a3) var(--fh-a4); }
    .kz { padding: var(--fh-a3); }
    .kz-gross .kz-zahl { font-size: 1.875rem; }
    .kz-gross .kz-titel, .kz-gross .kz-vergleich { font-size: 0.8125rem; }
    .ue-heute { padding: var(--fh-a3) var(--fh-a2); }
    .ue-heute .tb-ringe { justify-content: space-around; width: 100%; gap: var(--fh-a2); }
}

/* ===== UI/UX-Runde 1 (Expertenbefunde 24.11.2026) ===== */

/* ----- Farbe bedeutet etwas (Gestaltung.md 2.3): kcal blau, Eiweiß grün, darunter nur heller ----- */
.ch-fk { --f: var(--fh-kcal); }
.ch-fe { --f: var(--fh-eiweiss); }
.ch-schwach { opacity: 0.45; }

/* Diagrammtexte nie unter 12 px */
.ch-heute-text, .ch-phase-titel, .ch-ereignis-zahl { font-size: 0.75rem; }

/* Kartentitel im h2-Stil, Untertitel als Satz darunter (W5.3/W5.4) */
.ch-gross .ch-kopf { flex-direction: column; align-items: flex-start; row-gap: 0.25rem; }
.ch-gross .ch-titel { font-size: 1.25rem; line-height: 1.3; }
.ch-gross .ch-untertitel { font-size: 0.875rem; }

/* Erklärtexte hinter „i“ */
.ch-info summary {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    min-height: 2rem;
    font-size: 0.8125rem;
    color: var(--muted-foreground);
    cursor: pointer;
    list-style: none;
}
.ch-info summary::-webkit-details-marker { display: none; }
.ch-info summary:hover { color: var(--foreground); }
.ch-info[open] summary { color: var(--foreground); }
.ch-info .ch-erklaerung, .ch-info .ch-hinweis { margin-top: 0.375rem; }

/* Alkohol-Wochensumme: nur wenn die Woche breit genug ist, sonst Tooltip auf Tippen */
.ch-klammer { container-type: inline-size; }
@container (max-width: 63px) {
    .ch-klammer-text { display: none; }
}

/* ----- Details: Sprungmarken und einklappbare Nebendiagramme ----- */
.db-sprung {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    background: var(--card);
    border: 1px solid var(--border);
}
.db-sprung a {
    flex: 1 1 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: var(--fh-treffer);
    padding: 0 var(--fh-a2);
    color: var(--foreground);
    font-size: 0.9375rem;
    text-decoration: none;
    white-space: nowrap;
}
.db-sprung a + a { border-left: 1px solid var(--border); }
.db-sprung a:hover { background: var(--background); color: var(--primary); text-decoration: none; }
.db-sprung a:focus-visible { outline: 2px solid var(--ring); outline-offset: -2px; }
.db-seiten > section[id] { scroll-margin-top: calc(var(--fh-treffer) + var(--fh-a4)); }

.db-mehr { border-top: 1px solid var(--border); }
.db-mehr > summary {
    display: flex;
    align-items: center;
    gap: var(--fh-a2);
    min-height: var(--fh-treffer);
    font-size: 1rem;
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    list-style: none;
}
.db-mehr > summary::-webkit-details-marker { display: none; }
.db-mehr > summary:hover { color: var(--primary); }
.db-mehr > summary:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.db-mehr-pfeil { flex-shrink: 0; transition: transform 0.15s ease; }
.db-mehr[open] .db-mehr-pfeil { transform: rotate(90deg); }
.db-mehr-zahl { margin-left: auto; font-size: 0.875rem; font-weight: var(--font-weight-normal); color: var(--muted-foreground); white-space: nowrap; }
.db-mehr-zahl .fh-zahl { font-size: var(--fh-zahl-s); color: var(--foreground); }
.db-mehr[open] > summary { margin-bottom: var(--fh-a3); }
.db-mehr .db-vielfach + .ch-hinweis { margin-top: var(--fh-a3); }

/* ----- Übersicht: ruhig, keine Kästen in der Karte; Breite = schmal (container-standard, Runde 2 RC 3) ----- */
.ue-karte { display: flex; flex-direction: column; gap: var(--fh-a4); padding: var(--fh-a6); }
.ue-titel { margin: 0; font-size: 1.25rem; font-weight: var(--font-weight-medium); line-height: 1.3; }
.ue-heute { border: none; padding: 0; }
.ue-heute:hover { background: none; }
.ue-heute:hover .ue-heute-titel { color: var(--primary); }
.ue-heute-quelle { align-self: center; }
.ue-zahlen .kz-leiste { border: none; }
.ue-zahlen .kz { box-shadow: none; padding: var(--fh-a3) var(--fh-a4) var(--fh-a3) 0; }
.ue-kurz { padding-top: var(--fh-a4); border-top: 1px solid var(--border); }
.ue-hero:not(.ue-hero-ohne) .ue-zahlen { padding-top: var(--fh-a4); border-top: 1px solid var(--border); }

@container (min-width: 1000px) {
    .ue-hero:not(.ue-hero-ohne) .ue-zahlen { padding: 0 0 0 var(--fh-a6); border-top: none; border-left: 1px solid var(--border); }
}

@media (max-width: 768px) {
    .ue-karte { padding: var(--fh-a4) var(--fh-a3); }
    .ue-heute { padding: 0; }
}

/* ----- Tabellen auf dem Telefon als Kartenliste (W5.5): Zeile 1 Hauptwert + Badge, darunter Nebenwerte ----- */
.leer-block { padding: var(--fh-a6) var(--fh-a4); }
.leer-block p { margin: 0; }
.protokoll-tabelle .zelle-bereich { max-width: 16rem; overflow: hidden; text-overflow: ellipsis; }
.protokoll-stufe { min-height: var(--fh-treffer); min-width: 10rem; }
.filter-zeile .form-input { min-height: var(--fh-treffer); }

@media (max-width: 767px) {
    .leer-block .btn { width: 100%; justify-content: center; min-height: var(--fh-treffer); }

    .tabelle-karten, .tabelle-scroll .tabelle-karten, .tabelle-karten tbody { display: block; width: 100%; min-width: 0; }
    .data-table.tabelle-karten td.db-zelle-text { min-width: 0; }
    .tabelle-karten thead { display: none; }
    .tabelle-karten tbody tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        column-gap: var(--fh-a3);
        row-gap: 0.125rem;
        padding: var(--fh-a3) var(--fh-a4);
        border-bottom: 1px solid var(--border);
    }
    .tabelle-karten tbody tr:nth-child(odd), .tabelle-karten tbody tr:nth-child(even) { background: var(--card); }
    .tabelle-karten td {
        display: block;
        grid-column: 1 / -1;
        padding: 0;
        border: none;
        min-width: 0;
        text-align: left;
        font-size: 0.8125rem;
        color: var(--muted-foreground);
        white-space: normal;
        overflow-wrap: anywhere;
    }
    .tabelle-karten td[data-label]::before { content: attr(data-label) ": "; }
    .tabelle-karten td.k-kopf { grid-column: 1; grid-row: 1; align-self: center; font-size: 0.9375rem; color: var(--foreground); font-weight: var(--font-weight-medium); }
    .tabelle-karten td.k-ende { grid-column: 2; grid-row: 1; align-self: center; text-align: right; color: var(--foreground); }
    .tabelle-karten td.k-text { font-size: 0.875rem; color: var(--foreground); }
    .tabelle-karten td.k-aktion { grid-column: 2; grid-row: 2 / span 3; align-self: end; justify-self: end; }
    .tabelle-karten .rollen-erklaerung { display: none; }
    .tabelle-karten .schluessel-wert code { min-width: 0; overflow-wrap: anywhere; }

    .protokoll-tabelle td.k-fuss { grid-row: 3; max-width: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .protokoll-tabelle td.k-text { grid-row: 2; }
    .protokoll-stufe { width: 100%; }
}

/* ----- Gesamtverlauf: kleine Vielfache, wenige Monate als Zahlen ----- */
.gw-abschnitte { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); gap: var(--fh-a6); }
.gw-aktuell { grid-column: 1 / -1; }
.gw-abschnitt { display: flex; flex-direction: column; gap: var(--fh-a1); min-width: 0; }
.gw-kopf { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: var(--fh-a2); }
.gw-titel { font-size: 1rem; font-weight: var(--font-weight-medium); }

.mt-zahlen { display: flex; flex-wrap: wrap; gap: var(--fh-a4) var(--fh-a8); padding: var(--fh-a3) 0; }
.mt-zahl { display: flex; flex-direction: column; gap: 0.125rem; }
.mt-zahl .fh-zahl { font-size: var(--fh-zahl-m); }
.mt-monat { font-size: 0.8125rem; color: var(--muted-foreground); }
.mt-leer { font-size: 0.875rem; color: var(--muted-foreground); }

/* ----- Tagebuch ----- */
.tb-datum { min-width: 8.5rem; white-space: nowrap; }
.tb-datum-oben { font-size: var(--fh-zahl-s); line-height: 1.2; }
.tb-datum-unter { font-size: 0.8125rem; }
.tb-wasser-wert .fh-einheit { font-size: 0.875rem; }

.tb-zeile-e, .tb-zeile-alkohol { display: block; }
.tb-zeile-alkohol { color: var(--foreground); }

.tb-kz-vergleich { font-size: 0.875rem; }

@media (max-width: 768px) {
    .tb-zeile-eiweiss { display: flex; justify-content: flex-end; gap: 0.25rem; }
    .tb-zeile-e, .tb-zeile-alkohol { display: inline; }
    .tb-zeile-alkohol::before { content: "· "; color: var(--muted-foreground); }
    .tb-kz-vergleich { font-size: 0.875rem; }
}

/* ----- Erfassen: Zahlen vor dem „+“, ruhige Zeilen ----- */
.ef-zeile-knopf:hover .ef-zeile-name { color: inherit; }
@media (hover: hover) {
    .ef-zeile:hover { background: var(--background); }
    .ef-zeile.aktiv:hover { background: var(--accent); }
}
.ef-zeile-zahlen {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.125rem;
    font-size: 0.9375rem;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.ef-zeile-zahlen > span + span { font-size: 0.8125rem; color: var(--muted-foreground); }
.ef-zeile-zahlen .fh-einheit { font-size: 0.75rem; }
.ef-gebucht { margin-right: 0.25rem; color: var(--foreground); font-weight: var(--font-weight-normal); }

@media (min-width: 1366px) {
    .ef-raster { grid-template-columns: minmax(0, 1fr) minmax(24rem, 30rem); }
}

@media (max-width: 768px) {
    .ef-gebucht { display: none; }
}

/* ----- Favoriten-Stern: Füllung ist der Unterschied, keine Warnfarbe (Gestaltung.md 2.3) ----- */
.ef-zeile-stern { color: var(--foreground); }
.ef-stern.aktiv { color: var(--foreground); }

/* ===== UI/UX-Runde 2 (Expertenbefunde 24.11.2026) ===== */

/* ----- Helle Varianten der Bedeutungsfarben für Diagrammflächen: Kontrast >= 3:1 auf Weiß (WCAG 1.4.11) -----
   #5A8FC8 3,4:1, #549A78 3,4:1 - nachgerechnet, nicht über Deckkraft (0,45 ergab nur 2,0-2,2:1) */
:root {
    --fh-kcal-hell: #5A8FC8;
    --fh-eiweiss-hell: #549A78;
}
.ch-fkh { --f: var(--fh-kcal-hell); }
.ch-feh { --f: var(--fh-eiweiss-hell); }
.ch-schwach { opacity: 1; }
.ch-fk.ch-schwach { --f: var(--fh-kcal-hell); }
.ch-fe.ch-schwach { --f: var(--fh-eiweiss-hell); }

/* 7-Tage-Mittel über Tagesbalken: kräftige Linie mit Hof in Flächenfarbe, damit sie über den Balken lesbar bleibt */
.ch-mittel-halo {
    fill: none;
    stroke: var(--chart-flaeche);
    stroke-width: 6px;
    stroke-linejoin: round;
    stroke-linecap: round;
    vector-effect: non-scaling-stroke;
}
.ch-l.ch-mittel { stroke-width: 3px; }

/* ----- Details: Zeitraum der Diagramme, Herleitung der Kacheln ----- */
.db-zeitraum { display: flex; align-items: center; flex-wrap: wrap; gap: var(--fh-a2) var(--fh-a3); }
.db-zeitraum-titel { font-size: 0.875rem; color: var(--muted-foreground); }
.db-zeitraum .filter-btn { min-height: var(--fh-treffer); padding: 0 var(--fh-a4); }

.kz-info { margin-top: var(--fh-a2); }
.kz-herleitung { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--fh-a2) var(--fh-a4); margin: var(--fh-a2) 0 0; font-size: 0.875rem; }
.kz-herleitung dt { color: var(--muted-foreground); }
.kz-herleitung dd { margin: 0; }
@media (max-width: 768px) {
    .kz-herleitung { grid-template-columns: minmax(0, 1fr); row-gap: 0; }
    .kz-herleitung dd { margin-bottom: var(--fh-a2); }
}

/* Kacheln: genau eine Statuszeile, sie bricht nicht in Zahlenbrocken um */
.kz-vergleich, .kz-einordnung { overflow-wrap: normal; }

/* ----- Tagebuch-Woche: Hinweis „heute läuft“ unter den drei Zahlen ----- */
.tb-woche-hinweis { margin: calc(-1 * var(--fh-a2)) 0 0; font-size: 0.8125rem; color: var(--muted-foreground); }

/* ===== UI/UX-Runde 3 (Expertenbefunde 24.11.2026) ===== */

/* ----- Neutrale Skala (Gestaltung.md 2.3): Reihen ohne Bedeutungsfarbe sind weder kcal-Blau noch Eiweiß-Grün.
   Gewicht, Puls, HRV, Schritte, Monatsmittel in Schiefer; Quellen unterscheidet die Form (Kreis, Quadrat, hohler
   Ring), nicht die Farbe. Schlafphasen als eine Indigo-Abstufung, dunkel = tief. Kontrast auf Weiß:
   Schiefer 8,7:1, Indigo 15,9 / 9,8 / 5,7 / 3,3:1 (alle >= 3:1, WCAG 1.4.11). ----- */
:root {
    --chart-schiefer: #3F4C5E;
    --chart-band: color-mix(in srgb, var(--chart-schiefer) 12%, transparent);
    --chart-schlaf-tief: #1E1B4E;
    --chart-schlaf-kern: #3B3694;
    --chart-schlaf-rem: #605BBA;
    --chart-schlaf-wach: #8985D2;
}
.ch-fs { --f: var(--chart-schiefer); }
.ch-sl1 { --f: var(--chart-schlaf-tief); }
.ch-sl2 { --f: var(--chart-schlaf-kern); }
.ch-sl3 { --f: var(--chart-schlaf-rem); }
.ch-sl4 { --f: var(--chart-schlaf-wach); }

/* ----- Tagebuch-Woche als Diagramm wie in der App (Gestaltung.md 6, Runde 3) -----
   Spalten sind gleich breit und ohne Abstand, damit die Stufenlinie (SVG, viewBox 700 breit) genau an den
   Spaltengrenzen springt. Balken 60 % der Spalte, höchstens 3rem. Die Säule ist die Trefffläche des Tages. */
.tb-wd { display: flex; flex-direction: column; gap: var(--fh-a2); min-width: 0; }
.tb-wd + .tb-wd { margin-top: var(--fh-a2); }
.tb-wd-kopf { display: flex; align-items: baseline; justify-content: space-between; gap: var(--fh-a3); }
.tb-wd-titel { margin: 0; font-size: 1rem; font-weight: var(--font-weight-medium); }
.tb-wd-legende { font-size: 0.8125rem; color: var(--muted-foreground); font-variant-numeric: tabular-nums; }

.tb-wd-flaeche {
    --tb-wd-yb: 2.75rem;
    --tb-wd-x: 2.75rem;            /* Höhe der Achsenbeschriftung unter der Fläche */
    display: grid;
    grid-template-columns: var(--tb-wd-yb) minmax(0, 1fr);
    padding-top: 0.5rem;
    font-variant-numeric: tabular-nums;
}
.tb-wd-y { position: relative; height: var(--tb-wd-h); }
.tb-wd-y span {
    position: absolute;
    right: 0.5rem;
    transform: translateY(50%);
    font-size: 0.75rem;
    line-height: 1;
    color: var(--chart-text);
    white-space: nowrap;
}
.tb-wd-plot { position: relative; min-width: 0; height: calc(var(--tb-wd-h) + var(--tb-wd-x)); }
.tb-wd-raster, .tb-wd-linie {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: var(--tb-wd-h);
    overflow: visible;
    pointer-events: none;
}
.tb-wd-raster path { fill: none; stroke: var(--chart-raster); stroke-width: 1px; vector-effect: non-scaling-stroke; }
.tb-wd-raster .tb-wd-grund { stroke: var(--chart-achse); }
.tb-wd-linie { z-index: 2; }
.tb-wd-linie path { fill: none; stroke: var(--chart-tinte); stroke-width: 1.5px; stroke-linejoin: miter; vector-effect: non-scaling-stroke; }

.tb-wd-spalten {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    height: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
}
.tb-wd-spalten > li { min-width: 0; }

.tb-wtag, .tb-wd-spalte {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    color: var(--foreground);
    text-decoration: none;
}
.tb-wtag:hover { text-decoration: none; }
@media (hover: hover) {
    .tb-wtag:hover .tb-wd-saeule { background: rgba(31, 31, 31, 0.04); }
}
.tb-wtag:focus-visible { outline: 2px solid var(--ring); outline-offset: -2px; }

.tb-wd-saeule { position: relative; width: 100%; height: var(--tb-wd-h); flex-shrink: 0; }
.tb-wd-ist, .tb-wd-rest, .tb-wtag-ueber {
    position: absolute;
    left: 50%;
    width: 60%;
    max-width: 3rem;
    transform: translateX(-50%);
}
.tb-wd-ist { bottom: 0; }
.tb-wd-k.tb-wd-ist { background: var(--fh-kcal); }
.tb-wtag-ueber { background: var(--chart-ueber); }
.tb-wd-e.tb-wd-ist { background: var(--fh-eiweiss-hell); }
.tb-wd-e.tb-wd-ist.erreicht { background: var(--fh-eiweiss); }
/* Laufender Tag: was bis zum Ziel noch offen ist, blass über dem Balken (wie die App) */
.tb-wd-k.tb-wd-rest { background: color-mix(in srgb, var(--fh-kcal) 16%, transparent); }
.tb-wd-e.tb-wd-rest { background: color-mix(in srgb, var(--fh-eiweiss) 16%, transparent); }
.tb-wd-haken {
    position: absolute;
    left: 50%;
    bottom: 100%;
    width: 14px;
    height: 14px;
    margin-bottom: 2px;
    transform: translateX(-50%);
    color: var(--fh-eiweiss);
    stroke-width: 3;
}

/* Achse: Wochentag, darunter der Wert. Heute kräftig, der gezeigte Tag mit Strich in Primär. */
.tb-wd-x {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    width: 100%;
    min-height: var(--tb-wd-x);
    padding-top: 0.375rem;
    font-size: 0.8125rem;
    line-height: 1.15;
}
.tb-wd-tag { color: var(--muted-foreground); }
.tb-wd-wert { font-size: 0.8125rem; color: var(--muted-foreground); font-weight: var(--font-weight-normal); }
.tb-wd-wert.erreicht { color: var(--fh-eiweiss); font-weight: var(--font-weight-medium); }
.heute .tb-wd-tag { color: var(--foreground); font-weight: var(--font-weight-medium); }
.heute .tb-wd-wert { color: var(--foreground); }
.aktiv .tb-wd-x::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0;
    width: min(60%, 3rem);
    height: 2px;
    transform: translateX(-50%);
    background: var(--primary);
}
.tb-wd-eiweiss .tb-wd-flaeche { --tb-wd-x: 2.5rem; }

@media (max-width: 479px) {
    .tb-wd-flaeche { --tb-wd-yb: 2.25rem; }
    .tb-wd-wert { font-size: 0.75rem; }
}

/* ----- Telefon: „Erfassen“ schwebt bündig mit den Karten (16 px Rand) über der Safe Area; der Inhalt
   bekommt unten genau so viel Luft, dass die letzte Zeile über der Leiste zu liegen kommt. ----- */
@media (max-width: 768px) {
    .tb-leiste-unten {
        left: var(--fh-a4);
        right: var(--fh-a4);
        bottom: calc(var(--fh-a2) + env(safe-area-inset-bottom));
        box-sizing: border-box;
        padding: 0;
        background: transparent;
        box-shadow: none;
    }
    .tb-leiste-unten .btn {
        min-height: 3rem;
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
    }
    .tb-seite { padding-bottom: calc(3rem + var(--fh-a2) + var(--fh-a6) + env(safe-area-inset-bottom)); }
}

/* ===== Web-UI/UX-Runde 1 zu RC 3 (Expertenbefunde 25.11.2026, Gestaltung.md 6) ===== */

/* ----- Leer- und Ladezustände mit eigenem Innenabstand: .card hat keinen, sonst klebt der Inhalt am Rand.
   .leer-block und .tb-leer setzen ihren eigenen Abstand (stehen weiter oben bzw. gleich spezifisch später). ----- */
.empty-state { padding: var(--fh-a8) var(--fh-a6); }
.empty-state.leer-block { padding: var(--fh-a6) var(--fh-a4); }
.karten-inhalt > .empty-state { padding: 0; }
.empty-state > p { margin: 0; }

/* ----- Seitenkante: Inhalt linksbündig unter dem Seitentitel statt zentriert; die rechten Knöpfe der Action-Bar
   enden an der rechten Kante des Inhalts (bisher bei 1920 px ganz rechts, Karten mittig). Gilt ab 1101 px, wo
   Action-Bar und Inhalt denselben Rand von 2rem haben. ----- */
.container-narrow,
.container-standard,
.container-wide,
.container-full {
    margin-left: 0;
    margin-right: auto;
}

@media (min-width: 1101px) {
    .main-content:has(.content-area > .container-narrow) > .action-bar { padding-right: max(2rem, calc(100% - 720px - 2rem)); }
    .main-content:has(.content-area > .container-standard) > .action-bar { padding-right: max(2rem, calc(100% - var(--fh-breite-schmal) - 2rem)); }
    .main-content:has(.content-area > .container-wide) > .action-bar { padding-right: max(2rem, calc(100% - var(--fh-breite-breit) - 2rem)); }
}

/* ----- Ein Innenabstand für alle Kartenteile (Kopf, Inhalt, Diagramme, erste und letzte Tabellenspalte):
   --fh-a6 ab 769 px, --fh-a4 darunter (W5.4). ----- */
:root { --fh-karte: var(--fh-a6); }
@media (max-width: 768px) { :root { --fh-karte: var(--fh-a4); } }

.card-header,
.db-seiten .card-header { padding: var(--fh-a4) var(--fh-karte); }
.karten-inhalt,
.db-gruppe { padding: var(--fh-karte); }
.db-liste li { padding-left: var(--fh-karte); padding-right: var(--fh-karte); }
.lm-anzahl { padding-left: var(--fh-karte); padding-right: var(--fh-karte); }

@media (min-width: 769px) {
    .card .data-table th:first-child,
    .card .data-table td:first-child { padding-left: var(--fh-karte); }
    .card .data-table th:last-child,
    .card .data-table td:last-child { padding-right: var(--fh-karte); }
}

@media (max-width: 768px) {
    .card-header,
    .db-seiten .card-header { padding: var(--fh-a3) var(--fh-karte); }
    .ue-karte { padding: var(--fh-karte); }
}

/* ----- Diagramme ----- */
/* Endwert der Linie („Ø 7 Tage 1.703 kcal“) über der Zeichenfläche rechts, in der Farbe der Linie */
.ch-endwerte {
    top: -1.125rem;
    right: 0;
    display: flex;
    gap: var(--fh-a3);
}
.ch-ebene > .ch-endwert-oben { top: -1.125rem; right: 0; }
.ch-endwert.ch-endwert-oben { position: static; transform: none; padding: 0; color: var(--f, var(--foreground)); background: none; }
.ch-ebene > .ch-endwert.ch-endwert-oben { position: absolute; }

/* Tagesziel über viele Tage: nur waagerechte Stücke, dünn und hell - Kappen und Mittel bleiben lesbar */
.ch-ziel.ch-stufe.ch-stufe-leicht { stroke: color-mix(in srgb, var(--chart-tinte) 45%, transparent); stroke-width: 1.5px; }

/* Marken am Balkenfuß („Uhr nicht getragen“) unter der Grundlinie statt auf der y-Skala */
.ch-marke.ch-marke-fuss { top: calc(100% + 1px); width: 7px; height: 7px; margin-left: -3.5px; border-width: 1.5px; }

/* Abnehmphase: eine Fläche in --chart-band ohne Kante, wie das Legendenkästchen - Blau ist kcal und Akzent (2.3) */
.ch-phase,
.ch-phase.ch-phase-laufend { fill: var(--chart-band); }
.ch-phase-kappe,
.ch-phase-kappe.ch-phase-laufend { background-color: transparent; }
.ch-phase-kappe:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; }
.ch-leg-phase { fill: var(--chart-band); stroke: none; }

/* ----- Tagebuch ----- */
/* Vergangener Tag ohne Einträge: Ring nur als Spur, Mitte „-“ und „nicht erfasst“ */
.tb-ring-leer .tb-ring-zahl { color: var(--muted-foreground); }

/* Wochenkacheln unter 480 px: Vergleich als Stichwort („Ziel 1.775“, „0/2 erreicht“) */
@media (max-width: 479px) {
    .tb-kz-lang { display: none; }
}

/* ----- Lebensmittel: „Sortierung“ bleibt auch auf dem Telefon beschriftet (Labels über dem Feld) ----- */
@media (max-width: 768px) {
    .lm-filter-gruppe > .form-label.lm-label-bleibt { display: block; }
}

/* ----- Erfassen: rechts derselbe Abstand wie links, Luft nach der letzten Zeile ----- */
.ef-zeile { padding-right: var(--fh-a6); }
.ef-liste { padding-bottom: var(--fh-a3); }
@media (max-width: 768px) {
    .ef-zeile { padding-right: var(--fh-a4); }
}

/* ----- Neues Lebensmittel: alle Felder 44 px hoch, Zahlenfelder füllen ihre halbe Spalte ----- */
.dk-felder .form-input,
.dk-felder .form-select { min-height: var(--fh-treffer); }
.dk-felder .ef-menge .form-input { max-width: none; }

/* Mit Marken am Fuß rückt die Zeitachse etwas tiefer, damit Marke und Datum nicht übereinander liegen */
.ch:has(.ch-marke-fuss) .ch-x { height: 1.75rem; }
.ch:has(.ch-marke-fuss) .ch-xt { top: 0.8125rem; }

/* ===== Web-UI/UX-Runde 2 zu RC 3 (Expertenbefunde 25.11.2026, Gestaltung.md 6) ===== */

/* ----- Zwei Inhaltsbreiten als Token: schmal (Formulare, Tagebuch, Erfassen, Übersicht) und breit (Diagramme, Listen).
   container-standard = schmal, container-wide = breit; die Action-Bar endet an derselben Kante. ----- */
:root {
    --fh-breite-schmal: 1040px;
    --fh-breite-breit: 1584px;
}

/* ----- Treffflächen auf dem Telefon: eine Regel für alle Knöpfe und Felder statt je Seite ----- */
@media (max-width: 768px) {
    .btn,
    .form-input,
    .form-select { min-height: var(--fh-treffer); }
}

/* ----- Ein Fokusring überall: 2 px Primärblau mit Abstand. Gefüllte Knöpfe (Primär, Gefahr) bekommen dazu einen
   weißen Innenring, damit der Ring nicht mit der Fläche verschmilzt. Bausteine mit eigener Regel behalten sie. ----- */
:focus-visible {
    outline: 2px solid var(--ring);
    outline-offset: 2px;
}
/* Programmatisch fokussierte Überschriften (Blazor setzt den Fokus nach dem Navigieren auf h1, tabindex -1) sind
   kein Bedienelement - dort kein Ring */
[tabindex="-1"]:focus,
[tabindex="-1"]:focus-visible { outline: none; }
.btn-primary:focus-visible,
.btn-danger:focus-visible {
    outline-offset: 2px;
    box-shadow: inset 0 0 0 2px var(--card);
}

/* ----- Endwert der Linie am Linienende: rechtsbündig zum letzten Punkt, nahe am linken Rand linksbündig ----- */
.ch-endwert.ch-endwert-ende { transform: translateX(-100%); padding: 0 0.25rem; color: var(--f, var(--foreground)); }
.ch-endwert.ch-endwert-ende.ch-endwert-links { transform: none; }

/* ----- Verbindungen: ein Baustein „Feld mit Kopieren rechts“ - auch auf dem Telefon in einer Zeile ----- */
@media (max-width: 768px) {
    .feld-mit-knopf.feld-kopieren { flex-wrap: nowrap; }
    .feld-mit-knopf.feld-kopieren .form-input { flex-basis: auto; }
}

/* Schlüssel-Wert-Listen mit fester Labelspalte, damit die Werte von Karte zu Karte nicht springen; schmal untereinander */
.detail-grid { grid-template-columns: minmax(0, 14rem) minmax(0, 1fr); }
@media (max-width: 479px) {
    .detail-grid { grid-template-columns: minmax(0, 1fr); row-gap: 0; }
    .detail-grid dd { margin-bottom: var(--fh-a3); }
    .detail-grid dd:last-child { margin-bottom: 0; }
}

/* ----- Action-Bar unter 480 px: zwei und mehr Knöpfe in eine eigene Zeile, gleich breite Spalten ----- */
@media (max-width: 479px) {
    .action-bar:has(> .btn ~ .btn) > .action-bar-spacer,
    .action-bar:has(> .knopf-zeile > .btn ~ .btn) > .action-bar-spacer { flex: 0 0 100%; height: 0; }
    .action-bar:has(> .btn ~ .btn) > .btn { flex: 1 1 0; min-width: 0; padding-inline: var(--fh-a2); white-space: nowrap; }
    .action-bar > .knopf-zeile:has(> .btn ~ .btn) { flex: 1 1 100%; }
    .action-bar > .knopf-zeile:has(> .btn ~ .btn) > .btn { flex: 1 1 0; min-width: 0; }
}

/* Knopf nur breit in der Action-Bar - auf dem Telefon steht er in der Leiste unten (Neues Lebensmittel: „Anlegen“) */
.nur-breit { display: contents; }
@media (max-width: 768px) {
    .nur-breit { display: none; }
    .mit-leiste-unten { padding-bottom: calc(3rem + var(--fh-a2) + var(--fh-a6) + env(safe-area-inset-bottom)); }
}

/* ----- Gesamtverlauf: Titelzeilen der kleinen Vielfachen auf einer Linie ----- */
.db-vielfach { align-items: start; }

/* ===== Web-UI/UX-Runde 3 zu RC 3 (Expertenbefunde 25.11.2026, Gestaltung.md 6) ===== */

/* ----- Eine Höhe je Rolle: Knöpfe (außer btn-sm in Tabellen) und Formularfelder auf allen Breiten 44 px,
   nicht mehr 38 px auf dem Desktop neben 44 px in Action-Bar und Erfassen ----- */
.btn:not(.btn-sm),
.form-input,
.form-select { min-height: var(--fh-treffer); }

/* ----- Erfassen: die Reiterleiste steht im Kartenraster (Unterstrich von „Zuletzt“ an der Kante des Suchfelds) und
   passt ohne verstecktes Scrollen; dafür ist die rechte Spalte ab 1366 px etwas schmaler ----- */
.ef-tabs { padding-inline: var(--fh-karte); gap: var(--fh-a1); }
.ef-tabs .tab { padding-inline: var(--fh-a3); }
@media (min-width: 1366px) {
    .ef-raster { grid-template-columns: minmax(0, 1fr) minmax(22rem, 26rem); }
}
@media (max-width: 768px) {
    .ef-tabs .tab { flex: 1 0 auto; padding-inline: var(--fh-a1); justify-content: center; }
}

/* ----- Klappköpfe „Erläuterung“ und „Werte als Tabelle“ auf dem Telefon mit 44 px Trefffläche ----- */
@media (max-width: 768px) {
    .ch-info summary { min-height: var(--fh-treffer); }
    .ch-tabelle summary { padding-block: calc((var(--fh-treffer) - 1.5em) / 2); }
}

/* ----- Schrittziel als kurze Striche: so breit wie der Balken + 2 px (gleiche Rechnung wie .ch-b) ----- */
.ch-ziel-stueck {
    width: calc(clamp(2px, calc(100cqw / var(--ch-n, 30) * 0.68), 24px) + 2px);
    height: 2px;
    margin-top: -1px;
    transform: translateX(-50%);
    background: var(--chart-tinte);
}
.ch-leg-stueck { fill: none; stroke: var(--chart-tinte); stroke-width: 2; }

/* ----- Kennzahl: eine Gestalt wie auf der Übersicht - ohne Kasten, Trennung über den Spaltenabstand ----- */
.kz-leiste,
.tb-woche-zahlen,
.ef-offen-zahlen { border: none; column-gap: var(--fh-a4); }
.kz,
.tb-kz { box-shadow: none; padding: var(--fh-a3) 0; }

/* ----- Tagebuch auf dem Telefon: „Heute“ rechts in der Action-Bar, wenn ein anderer Tag gezeigt wird ----- */
@media (max-width: 768px) {
    .tb-heute-knopf { display: inline-flex; flex-shrink: 0; }
}

/* ----- Gesamtverlauf: Monatswerte als Zahlen - vier Größen gleich, 2 × 2 auf dem Telefon ----- */
.db-vielfach.db-vielfach-vier { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 768px) {
    .db-vielfach.db-vielfach-vier { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.db-vielfach-vier .mt-zahlen { flex-direction: column; gap: var(--fh-a2); }

/* ===== RC 4: Bilanz der Phase (Gestaltung.md A13/W5) =====
   Eine große Zahl („-4,9 kg seit 01.10.“), darunter Fett und fettfrei in kg und ein Balken zum Ziel mit Marke am
   Zwischenziel. Schiefer statt Bedeutungsfarbe: Gewicht hat keine (2.3), weniger ist keine Belohnung. */
.pb { display: flex; flex-direction: column; gap: var(--fh-a2); }
.pb-kopf { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: var(--fh-a2); }
.pb-zahl { font-size: var(--fh-zahl-l); font-weight: var(--font-weight-medium); line-height: 1.1; font-variant-numeric: tabular-nums; }
.pb-einheit { font-size: 1rem; color: var(--muted-foreground); }
.pb-wochen { margin-left: auto; font-size: 0.875rem; color: var(--muted-foreground); }
.pb-teile { display: flex; flex-wrap: wrap; column-gap: var(--fh-a6); row-gap: var(--fh-a1); font-size: 0.9375rem; color: var(--muted-foreground); }
.pb-teile b, .pb-fuss b { color: var(--foreground); font-weight: var(--font-weight-medium); font-variant-numeric: tabular-nums; }
.pb-balken { position: relative; height: 0.625rem; margin-top: var(--fh-a1); background: var(--chart-band); }
.pb-fuellung { position: absolute; inset: 0 auto 0 0; background: var(--chart-schiefer); }
.pb-marke { position: absolute; top: -0.25rem; bottom: -0.25rem; width: 2px; margin-left: -1px; background: var(--foreground); }
.pb-fuss { display: flex; flex-wrap: wrap; justify-content: space-between; column-gap: var(--fh-a4); font-size: 0.875rem; color: var(--muted-foreground); font-variant-numeric: tabular-nums; }

/* ===== RC 4: Mahlzeit und Uhrzeit oben auf Erfassen, „+ hinzufügen“ je Mahlzeit im Tagebuch =====
   Die Wahl steht einmal über der Suche und gilt für jede Buchung (auch Zuletzt „+“ und Vorlagen); über dem
   Buchen-Knopf nur eine Zeile mit demselben Zustand. Treffflächen 44 px (--fh-treffer). */
.ef-wann-oben { padding: var(--fh-a4) var(--fh-a6); border-bottom: 1px solid var(--border); }
.ef-wann-oben .form-group { margin: 0; }
.ef-wann-hinweis { margin: 0; font-size: 0.875rem; color: var(--muted-foreground); }
.ef-wann-hinweis strong { color: var(--foreground); font-weight: var(--font-weight-medium); }
.tb-mahlzeit-plus { display: inline-flex; align-items: center; gap: 0.25rem; min-height: var(--fh-treffer); padding: 0 var(--fh-a2); margin: calc(-1 * var(--fh-a2)) calc(-1 * var(--fh-a2)) calc(-1 * var(--fh-a2)) 0; font-size: 0.875rem; color: var(--primary); text-decoration: none; }
.tb-mahlzeit-plus:hover { text-decoration: underline; }
.tb-mahlzeit-plus:focus-visible { outline: 2px solid var(--ring); outline-offset: -2px; }
.tb-mahlzeit-neu { display: flex; flex-wrap: wrap; gap: var(--fh-a2); padding: var(--fh-a4) var(--fh-a6); border-top: 1px solid var(--border); }
.tb-mahlzeit-neu-link { display: inline-flex; align-items: center; gap: 0.25rem; min-height: var(--fh-treffer); text-decoration: none; }
@media (max-width: 768px) {
    .tb-mahlzeit-neu { padding: var(--fh-a3) var(--fh-a4); }
    /* Telefon: nur das „+“ (44 px), sonst bricht es je nach Summe mal in die zweite Zeile, mal nicht */
    .tb-mahlzeit-plus { min-width: var(--fh-treffer); justify-content: center; }
    .tb-mahlzeit-kopf .tb-mahlzeit-summe { margin-left: auto; }
    .tb-mahlzeit-plus span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .tb-mahlzeit-kopf { flex-wrap: nowrap; align-items: center; }
    .ef-wann-oben { padding: var(--fh-a3) var(--fh-a4); gap: var(--fh-a3); }
    .ef-wann-oben .form-group:first-child { width: 100%; }
    .ef-wann-oben .ef-mahlzeiten { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ===== RC 5: Karte „Push (APNs)“ auf Verbindungen (Gestaltung.md W7) ===== */
.push-p8 { min-height: 7.5rem; resize: vertical; font-size: 0.8125rem; line-height: 1.4; }
/* Drei Felder in der Breite des .p8-Felds (640 px wie .form-group), Topic breiter */
.push-felder { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.6fr); gap: 0 var(--fh-a3); max-width: 640px; }
/* Wie die Knöpfe der übrigen Karten (Verbindungen.razor.css gilt nur für die Seite, nicht für diese Komponente) */
#push .btn-destruktiv-rahmen { background-color: var(--card); color: var(--destructive); border-color: var(--destructive); }
#push .btn-destruktiv-rahmen:hover:not(:disabled) { background-color: color-mix(in srgb, var(--destructive) 8%, var(--card)); }
@media (max-width: 768px) {
    .push-felder { grid-template-columns: minmax(0, 1fr); }
    #push .knopf-zeile .btn { flex: 1 1 100%; }
}

/* ===== RC 6: Fett kg/%, Körper, Zielbild (Gestaltung.md W8) ===== */
/* Umschalter rechts im Kopf eines Diagramms */
.ch-aktion { margin-left: auto; }
.ch-gross .ch-kopf { position: relative; }
.ch-gross .ch-aktion { position: absolute; top: 0; right: 0; }
.fe-wahl { flex-wrap: nowrap; }
.fe-wahl .filter-btn { min-width: 2.75rem; min-height: 2.25rem; justify-content: center; font-variant-numeric: tabular-nums; }
@media (pointer: coarse) { .fe-wahl .filter-btn { min-height: var(--fh-treffer); min-width: var(--fh-treffer); } }

/* Körper: drei Zahlen nebeneinander, ab schmal zwei */
@container (min-width: 620px) { .kp-zahlen, .zb-zahlen { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Weiter zum Körper (Übersicht, Gewicht) */
.ue-weiter { display: flex; flex-wrap: wrap; gap: 0 var(--fh-a6); border-top: 1px solid var(--border); margin-bottom: calc(-1 * var(--fh-a2)); }
.ue-weiter a { display: inline-flex; align-items: center; gap: 0.25rem; min-height: var(--fh-treffer); text-decoration: none; }
.ue-weiter a:hover span { text-decoration: underline; }

/* Verweis auf das Zielbild: eine Zeile, ganze Karte klickbar */
.zb-teaser { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--fh-a2) var(--fh-a4); padding: var(--fh-a4) var(--fh-a6); color: var(--foreground); text-decoration: none; }
.zb-teaser:hover { background: var(--background); text-decoration: none; }
.zb-teaser:focus-visible { outline: 2px solid var(--ring); outline-offset: -2px; }
.zb-teaser-kopf { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--fh-a3); }
.zb-teaser-titel { font-size: 1.25rem; font-weight: var(--font-weight-medium); }
.zb-teaser-ziel { font-size: 0.875rem; color: var(--muted-foreground); }
.zb-teaser-aussage { grid-column: 1; font-size: 1.125rem; font-variant-numeric: tabular-nums; }
.zb-teaser-pfeil { grid-column: 2; grid-row: 1 / span 2; color: var(--muted-foreground); }

/* Zielbild-Seite */
.zb-zurueck { display: inline-flex; align-items: center; gap: 0.25rem; min-height: var(--fh-treffer); align-self: flex-start; margin: calc(-1 * var(--fh-a3)) 0 calc(-1 * var(--fh-a3)); text-decoration: none; }
.zb-kopf { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--fh-a1) var(--fh-a4); }
.zb-vorgabe { font-size: 0.875rem; color: var(--muted-foreground); }
.zb-trend { margin: 0; font-size: 0.875rem; color: var(--muted-foreground); font-variant-numeric: tabular-nums; }
.zb-trend b { color: var(--foreground); font-weight: var(--font-weight-medium); }
.zb-hinweis { display: flex; align-items: flex-start; gap: 0.375rem; margin: 0; font-size: 0.8125rem; color: var(--muted-foreground); }
.zb-hinweis svg { flex-shrink: 0; margin-top: 0.125rem; }

/* Zielbild-Diagramm: Zone schraffiert, Untergrenze, Linien gleicher fettfreier Masse, Pfad und Fortschreibung */
.zb { padding-bottom: 0; }
.zb-zone { fill: url(#zb-schraffur); stroke: none; }
.zb-schraffur-strich { stroke: color-mix(in srgb, var(--chart-schiefer) 30%, transparent); stroke-width: 3px; }
.zb-zone-rand { fill: none; stroke: var(--chart-tinte); stroke-width: 1.5px; }
.zb-untergrenze { fill: none; stroke: var(--chart-tinte); stroke-width: 1.5px; stroke-dasharray: 2 3; }
.zb-iso { fill: none; stroke: var(--chart-achse); stroke-width: 1px; }
.zb-iso.zb-iso-ziel { stroke: var(--chart-text); stroke-dasharray: 6 3; }
.zb-iso-text { font-size: 0.6875rem; color: var(--chart-text); white-space: nowrap; padding-left: 0.25rem; }
.zb-iso-text-ziel { color: var(--foreground); }
.zb-zone-text { margin-left: 0.25rem; font-weight: var(--font-weight-medium); }
.zb-untergrenze-text { margin-left: 0.25rem; }
.zb-nach-links { transform: translateX(-100%); margin-left: -0.25rem; }
.zb-marken-text { transform: translateX(-50%); font-size: 0.6875rem; color: var(--chart-text); }
.zb-marken-text.zb-nach-links { transform: translateX(-100%); }
.zb-jetzt { stroke-width: 12px; }
.zb-jetzt-text { transform: translateX(-50%); font-weight: var(--font-weight-medium); }
.zb-jetzt-text.zb-nach-links { transform: translateX(-100%); }
.zb-marke { stroke: var(--chart-flaeche); stroke-width: 7px; }
.zb .ch-p.zb-marke { stroke: var(--chart-flaeche); }
.zb-treffer { width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; }
.zb-x { display: block; }
.zb-x-einheit { grid-column: 2; padding-top: 0.125rem; text-align: right; color: var(--chart-text); }
.ch-leg-zone { fill: url(#zb-schraffur); stroke: var(--chart-tinte); stroke-width: 1; }
.ch-leg-senkrecht { fill: none; stroke: var(--chart-tinte); stroke-width: 1.5; stroke-dasharray: 2 2; }
.ch-leg-iso { fill: none; stroke: var(--chart-text); stroke-width: 1; }
/* Drei Kacheln im 2er-Raster (Telefon): die dritte über die ganze Breite statt einer leeren Zelle (Selbstkritik RC 6) */
@media (max-width: 768px) { .kp-zahlen > .kz:nth-child(3), .zb-zahlen > .kz:nth-child(3) { grid-column: 1 / -1; } }

/* ----- Zielbild zum Anfassen (Gestaltung W8, 25.11.2026): Tooltips mit Hilfslinien, Isolinien und Zone zeigen
   einen Satz, Szenario-Regler als zweite Fortschreibung in Blau (gepunktet, der Trend bleibt Schiefer gestrichelt) ----- */
.zb-iso-treffer { fill: none; stroke: transparent; stroke-width: 14px; pointer-events: stroke; }
.zb-iso-treffer:focus { outline: none; }
/* Touch: Tippen trifft immer die Spalte (Auswahllinie), nie die schmale Isolinie */
@media (pointer: coarse) { .zb-iso-treffer { pointer-events: none; } }
.zb-iso-treffer:hover, .zb-iso-treffer:focus-visible { stroke: color-mix(in srgb, var(--chart-tinte) 12%, transparent); outline: none; }
.zb-zone.ch-t { cursor: help; }
/* Zeiger und Finger nehmen die Spalten (Auswahllinie wie überall); die Punkt-Marken sind nur für die Tastatur da */
.ch-ebene .ch-t.zb-treffer { pointer-events: none; }
.zb-treffer:focus-visible { box-shadow: inset 0 0 0 1.5px var(--chart-tinte); }
.zb-szen { stroke: var(--chart-1); stroke-width: 2.5px; stroke-dasharray: 0.5 5; stroke-linecap: round; }
.zb .ch-p.zb-szen-marke { stroke: var(--chart-1); stroke-width: 7px; }
.zb-szen-text { color: var(--chart-1); font-weight: var(--font-weight-medium); }
.ch-leg-szenario { fill: none; stroke: var(--chart-1); stroke-width: 2.5; stroke-dasharray: 0.5 4; stroke-linecap: round; }
.zb-szen-badge { align-self: center; }

.zb-szenario { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--fh-a2) var(--fh-a6); align-items: end; }
@media (min-width: 769px) { .zb-szenario { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; } }
.zb-regler { display: grid; min-width: 0; }
.zb-regler label { display: flex; justify-content: space-between; align-items: baseline; gap: var(--fh-a2); font-size: 0.875rem; color: var(--muted-foreground); }
.zb-regler-wert { color: var(--foreground); font-size: 1.125rem; font-weight: var(--font-weight-medium); font-variant-numeric: tabular-nums; }
.zb-regler input[type="range"] { width: 100%; min-width: 0; height: var(--fh-treffer); margin: 0; accent-color: var(--chart-1); cursor: pointer; }
.zb-regler-trend { margin-top: -0.375rem; font-size: 0.75rem; color: var(--muted-foreground); font-variant-numeric: tabular-nums; }
.zb-zurueck-trend { min-height: var(--fh-treffer); justify-content: center; margin-bottom: 1rem; }
@media (max-width: 768px) { .zb-zurueck-trend { width: 100%; margin-bottom: 0; } }
.zb-szen-ergebnis { margin: 0; font-size: 0.9375rem; font-variant-numeric: tabular-nums; }
.zb-szen-ergebnis b { font-weight: var(--font-weight-medium); color: var(--chart-1); }
.zb-szen-ergebnis span { color: var(--muted-foreground); font-size: 0.875rem; }

/* ===== RC 8: Gerichte (Gestaltung.md W2, W9, 4.3) ===== */
/* Ein Symbol für Zusammenstellungen überall (Lucide „layers“), etwas zurückgenommen neben dem Namen */
.tb-gericht-symbol, .ef-gericht-symbol, .gr-symbol { flex-shrink: 0; color: var(--muted-foreground); }
.ef-gericht-titel { display: flex; align-items: center; gap: 0.5rem; }
.ef-gericht-titel .ef-gericht-symbol { color: var(--primary); }

/* Tagebuch: Gericht als eine Zeile, der Name klappt die Bestandteile auf */
.tb-gruppe { list-style: none; }
.tb-gruppe-knopf { display: inline-flex; align-items: center; gap: 0.375rem; min-width: 0; min-height: var(--fh-treffer); margin: -0.375rem 0; padding: 0;
    border: none; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.tb-gruppe-knopf:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.tb-gruppe-knopf .tb-name { font-weight: var(--font-weight-medium); }
.tb-gruppe-pfeil { flex-shrink: 0; color: var(--muted-foreground); transition: transform 0.15s ease; }
.tb-gruppe.offen .tb-gruppe-pfeil { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) { .tb-gruppe-pfeil { transition: none; } }
.tb-teile { padding: 0 0 var(--fh-a1); border-left: 2px solid var(--border); margin-left: var(--fh-a6); }
.tb-teile .tb-zeile { padding-left: var(--fh-a4); min-height: 40px; }
.tb-teile .tb-name { color: var(--muted-foreground); font-size: 0.9375rem; }
@media (max-width: 768px) { .tb-teile { margin-left: var(--fh-a4); } .tb-teile .tb-zeile { padding-left: var(--fh-a3); } }
.tb-als-gericht { display: inline-flex; align-items: center; gap: 0.375rem; min-height: var(--fh-treffer); margin: 0 0 var(--fh-a2) var(--fh-a6);
    padding: 0 var(--fh-a2); font-size: 0.875rem; color: var(--primary); text-decoration: none; }
.tb-als-gericht:hover { text-decoration: underline; }
.tb-als-gericht:focus-visible { outline: 2px solid var(--ring); outline-offset: -2px; }
@media (max-width: 768px) { .tb-als-gericht { margin-left: var(--fh-a2); } }

/* Erfassen: „gebucht · Rückgängig“ unter der Zeile, das „+“ bleibt frei (nächste Buchung ohne Warten) */
.ef-zeile-band { display: flex; align-items: center; gap: 0.375rem; padding: 0 var(--fh-a4) var(--fh-a1) var(--fh-a6); font-size: 0.875rem; }
.ef-zeile-band .ef-band-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ef-zeile-band .ef-zeile-rueckgaengig { margin-left: auto; }
@media (max-width: 768px) { .ef-zeile-band { padding-left: var(--fh-a4); padding-right: var(--fh-a2); } }
.ef-gericht .ef-zeile-name { font-weight: var(--font-weight-medium); }

/* Erfassen: Gericht mit Anzahl */
.ef-anzahl { display: flex; flex-wrap: wrap; align-items: center; gap: var(--fh-a2); }
.ef-anzahl-knoepfe .filter-btn { min-width: 3.25rem; min-height: var(--fh-treffer); font-variant-numeric: tabular-nums; }
.ef-anzahl { flex-wrap: nowrap; }
.ef-anzahl-knoepfe { flex-wrap: nowrap; }
.ef-anzahl-feld { width: 6rem; flex-shrink: 0; }
.ef-anzahl-feld .ef-menge-einheit { font-size: 1rem; }
@media (max-width: 400px) { .ef-anzahl-knoepfe .filter-btn { min-width: 2.75rem; } .ef-anzahl-feld { width: 5rem; } }
.ef-gericht-teile { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border); }
.ef-gericht-teile li { display: grid; grid-template-columns: minmax(0, 1fr) auto 5.5rem; gap: var(--fh-a2); align-items: baseline;
    padding: 0.375rem 0; border-bottom: 1px solid var(--border); font-size: 0.875rem; }
.ef-gericht-teil-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ef-gericht-teil-menge { color: var(--muted-foreground); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ef-gericht-teil-kcal { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
/* RC 12: „26 g · 1.000 ml angerührt“ ist auf dem Telefon zu lang neben dem Namen - dort in eine zweite Zeile */
@media (max-width: 768px) {
    .ef-gericht-teile li.ef-gericht-teil-wasser { grid-template-columns: minmax(0, 1fr) 5.5rem; grid-template-areas: "name kcal" "menge menge"; row-gap: 0; }
    .ef-gericht-teil-wasser .ef-gericht-teil-name { grid-area: name; }
    .ef-gericht-teil-wasser .ef-gericht-teil-menge { grid-area: menge; }
    .ef-gericht-teil-wasser .ef-gericht-teil-kcal { grid-area: kcal; }
}

/* Seite Gerichte (W9) */
.gr-liste { list-style: none; margin: 0; padding: var(--fh-a2) 0; }
.gr-zeile { display: flex; align-items: center; gap: var(--fh-a2); padding: var(--fh-a1) var(--fh-a4) var(--fh-a1) 0; }
.gr-zeile + .gr-zeile { border-top: 1px solid var(--border); }
.gr-zeile-link { display: flex; flex: 1; align-items: center; gap: var(--fh-a3); min-width: 0; min-height: 56px; padding: var(--fh-a1) var(--fh-a2) var(--fh-a1) var(--fh-a6);
    color: inherit; text-decoration: none; }
.gr-zeile-link:focus-visible { outline: 2px solid var(--ring); outline-offset: -2px; }
@media (hover: hover) and (pointer: fine) { .gr-zeile-link:hover { background: var(--background); } }
.gr-text { display: flex; flex: 1; flex-direction: column; gap: 0.125rem; min-width: 0; }
.gr-name { font-size: 1rem; font-weight: var(--font-weight-medium); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gr-unter { font-size: 0.8125rem; color: var(--muted-foreground); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gr-pfeil { flex-shrink: 0; color: var(--muted-foreground); }
.gr-buchen { flex-shrink: 0; min-height: var(--fh-treffer); }
.gr-neu-oben { min-height: var(--fh-treffer); }
@media (max-width: 768px) {
    .gr-zeile-link { padding-left: var(--fh-a4); gap: var(--fh-a2); }
    .gr-teile-namen { display: none; }
    .gr-buchen span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .gr-buchen { width: var(--fh-treffer); padding: 0; justify-content: center; }
    .gr-pfeil { display: none; }
    .gr-neu-oben { display: none; }
}

/* Gericht bearbeiten (W9) */
.gr-seite { display: flex; flex-direction: column; gap: var(--fh-a4); }
.gr-form { display: flex; flex-direction: column; gap: var(--fh-a4); }
.gr-karte { display: flex; flex-direction: column; gap: var(--fh-a3); padding: var(--fh-a4) var(--fh-a6); }
.gr-karte .ef-liste { margin: 0 calc(-1 * var(--fh-a6)); }
.gr-karte .ef-leer { padding: var(--fh-a2) 0; }
.gr-hinweis { margin: 0; font-size: 0.9375rem; }
.gr-mahlzeiten .filter-btn { min-height: var(--fh-treffer); }
.gr-teile-kopf { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--fh-a1) var(--fh-a4); }
.gr-summe { font-size: 0.875rem; color: var(--muted-foreground); white-space: nowrap; }
.gr-summe .fh-zahl { color: var(--foreground); }
.gr-teile { list-style: none; margin: 0 calc(-1 * var(--fh-a6)); padding: 0; }
.gr-teil { display: grid; grid-template-columns: minmax(0, 1fr) 9rem 5.5rem auto; align-items: center; gap: var(--fh-a3);
    min-height: 56px; padding: var(--fh-a1) var(--fh-a3) var(--fh-a1) var(--fh-a6); border-top: 1px solid var(--border); }
.gr-teil.gr-mit-auswahl { grid-template-columns: auto minmax(0, 1fr) 9rem 5.5rem auto; }
.gr-teil-aus .gr-teil-text, .gr-teil-aus .gr-teil-werte, .gr-teil-aus .gr-teil-menge { opacity: 0.45; }
.gr-mit { display: inline-flex; align-items: center; justify-content: center; width: var(--fh-treffer); height: var(--fh-treffer); margin-left: calc(-1 * var(--fh-a3)); cursor: pointer; }
.gr-mit input { width: 1.25rem; height: 1.25rem; accent-color: var(--primary); cursor: pointer; }
.gr-teil-text { display: flex; flex-direction: column; gap: 0.125rem; min-width: 0; }
.gr-teil-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gr-teil-unter { font-size: 0.8125rem; color: var(--muted-foreground); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gr-teil-menge .form-input { min-height: var(--fh-treffer); }
.gr-teil-aktionen { display: flex; }
.gr-teil-aktionen .tb-aktion:disabled { opacity: 0.3; cursor: default; background: none; }
/* RC 12: Wasser zum Anrühren eines Schnell-Bestandteils - Tropfen in den Aktionen, Feld darunter über die ganze Breite */
.gr-teil-aktionen .gr-wasser-an { color: var(--primary); }
.gr-teil-wasser { grid-column: 1 / -1; display: grid; grid-template-columns: auto 9rem minmax(0, 1fr); justify-items: start;
    align-items: center; gap: var(--fh-a1) var(--fh-a3); max-width: none; margin: 0; padding-bottom: var(--fh-a2); text-align: left; }
.gr-teil.gr-mit-auswahl .gr-teil-wasser { grid-column: 2 / -1; }
.gr-teil-wasser .form-label { margin: 0; }
.gr-schnell { display: flex; flex-direction: column; gap: var(--fh-a3); padding-top: var(--fh-a2); border-top: 1px solid var(--border); }
.gr-schnell-auf { align-self: flex-start; min-height: var(--fh-treffer); }
.gr-knopfzeile, .gr-fuss { display: flex; flex-wrap: wrap; gap: var(--fh-a2); }
.gr-fuss .gr-loeschen { margin-left: auto; }
.btn-destruktiv-rahmen { background-color: var(--card); color: var(--destructive); border-color: var(--destructive); }
.btn-destruktiv-rahmen:hover:not(:disabled) { background-color: color-mix(in srgb, var(--destructive) 8%, var(--card)); }
@media (max-width: 768px) {
    .gr-karte { padding: var(--fh-a4); }
    .gr-karte .ef-liste, .gr-teile { margin: 0 calc(-1 * var(--fh-a4)); }
    /* RC 12: Aktionen über zwei Spalten, damit der vierte Knopf (Tropfen) den Namen nicht verkürzt */
    .gr-teil, .gr-teil.gr-mit-auswahl {
        grid-template-columns: auto minmax(0, 1fr) auto;
        grid-template-areas: "text text werte" "menge aktionen aktionen";
        padding: var(--fh-a2) var(--fh-a2) var(--fh-a2) var(--fh-a4);
        row-gap: var(--fh-a1);
    }
    .gr-teil.gr-mit-auswahl { grid-template-columns: auto auto minmax(0, 1fr) auto; grid-template-areas: "mit text text werte" "mit menge aktionen aktionen"; }
    .gr-teil-wasser { grid-template-columns: auto 8rem; }
    .gr-teil-wasser .lm-je { grid-column: 1 / -1; }
    .gr-mit { grid-area: mit; margin-left: calc(-1 * var(--fh-a2)); }
    .gr-teil-text { grid-area: text; }
    .gr-teil-werte { grid-area: werte; }
    .gr-teil-menge { grid-area: menge; max-width: 9rem; }
    .gr-teil-aktionen { grid-area: aktionen; justify-content: flex-end; }
    .gr-fuss { flex-direction: column; }
    .gr-fuss .btn { width: 100%; justify-content: center; }
    .gr-fuss .gr-loeschen { margin-left: 0; }
}

/* ===== RC 9: gebuchtes Gericht ändern (Gestaltung.md 4.3 GerichtZeile, 4.5) ===== */
/* Der Name öffnet das Bearbeiten, der Pfeil daneben klappt die Bestandteile auf - zwei Ziele, je 44 px */
.tb-gruppe-pfeil-knopf { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
    width: var(--fh-treffer); height: var(--fh-treffer); margin: -0.375rem 0 -0.375rem -0.375rem; padding: 0;
    border: none; background: none; color: inherit; cursor: pointer; }
.tb-gruppe-pfeil-knopf:hover { background: var(--muted); }
.tb-gruppe-pfeil-knopf:focus-visible { outline: 2px solid var(--ring); outline-offset: -2px; }
.tb-gruppe-knopf:disabled { cursor: default; }
@media (hover: hover) and (pointer: fine) { .tb-gruppe-knopf:not(:disabled):hover .tb-name { text-decoration: underline; } }
.tb-gruppe.bearbeiten > .tb-gruppe-zeile { background: var(--background); }
.tb-gruppe-bearbeiten { display: flex; flex-direction: column; gap: var(--fh-a3); margin: 0 var(--fh-a3) var(--fh-a3) var(--fh-a6);
    padding: var(--fh-a4); border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
.tb-gruppe-bearbeiten .form-group { margin: 0; }
.tb-gruppe-wann { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--fh-a4); }
.tb-gruppe-mahlzeiten .filter-btn { min-height: var(--fh-treffer); }
.tb-gruppe-uhrzeit .form-input { min-height: var(--fh-treffer); width: 7.5rem; }
.tb-gruppe-fuss { padding-top: var(--fh-a1); }
.tb-gruppe-band { padding-left: var(--fh-a6); }
/* RC 11: Wasser zum Anrühren eines Schnelleintrags unter der Zeile (wie das Bearbeiten eines Gerichts, nur ein Feld) */
.tb-eintrag { list-style: none; }
.tb-eintrag.bearbeiten > .tb-zeile { background: var(--background); }
.tb-eintrag .tb-gruppe-knopf .tb-name { font-weight: inherit; }
@media (hover: hover) and (pointer: fine) { .tb-eintrag .tb-gruppe-knopf:hover .tb-name { text-decoration: underline; } }
@media (max-width: 768px) {
    .tb-gruppe-bearbeiten { margin: 0 var(--fh-a2) var(--fh-a3); padding: var(--fh-a3); }
    .tb-gruppe-wann .form-group:first-child { width: 100%; }
    .tb-gruppe-mahlzeiten { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .tb-gruppe-band { padding-left: var(--fh-a4); }
}

/* ===== RC 9: Schnellauswahl über den Mahlzeiten (Gestaltung.md 4.3 SchnellauswahlLeiste) ===== */
.tb-schnell { display: flex; flex-direction: column; gap: var(--fh-a2); min-width: 0; }
.tb-schnell-titel { margin: 0; font-size: 0.875rem; font-weight: var(--font-weight-medium); color: var(--muted-foreground); }
.tb-schnell-liste { display: flex; gap: var(--fh-a2); margin: 0; padding: 0 0 var(--fh-a1); list-style: none; overflow-x: auto;
    scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.tb-schnell-chip { display: flex; flex-shrink: 0; align-items: stretch; scroll-snap-align: start; border: 1px solid var(--border);
    border-radius: var(--radius); background: var(--card); }
.tb-schnell-chip.angepinnt { border-color: var(--primary); }
.tb-schnell-buchen { display: inline-flex; align-items: center; gap: 0.375rem; min-height: var(--fh-treffer); padding: 0 var(--fh-a2) 0 var(--fh-a3);
    border: none; background: none; color: inherit; font: inherit; cursor: pointer; white-space: nowrap; }
.tb-schnell-buchen:hover:not(:disabled) { background: var(--background); }
.tb-schnell-buchen:focus-visible, .tb-schnell-pin:focus-visible { outline: 2px solid var(--ring); outline-offset: -2px; }
.tb-schnell-plus { color: var(--primary); }
.tb-schnell-name { font-weight: var(--font-weight-medium); }
.tb-schnell-detail { font-size: 0.8125rem; color: var(--muted-foreground); font-variant-numeric: tabular-nums; }
.tb-schnell-pin { display: inline-flex; align-items: center; justify-content: center; width: 2.25rem; border: none; border-left: 1px solid var(--border);
    background: none; color: var(--muted-foreground); cursor: pointer; }
.tb-schnell-pin:hover { background: var(--muted); color: var(--foreground); }
.tb-schnell-chip.angepinnt .tb-schnell-pin { color: var(--primary); }
.tb-schnell-chip.angepinnt .tb-schnell-pin svg { fill: currentColor; }
.tb-schnell-band { padding-left: 0; }
