/* CibluToDo U1 – kompakte Business-Oberfläche (Token aus docs/03 §8). */

:root {
  color-scheme: light;
  --canvas: #f4f6f8;
  --surface: #ffffff;
  --surface-alt: #eef2f6;
  --surface-strong: #e4ebf1;
  --text: #17212b;
  --muted: #5d6874;
  --primary: #1769aa;
  --primary-strong: #0d548e;
  --primary-soft: #e5f2fb;
  --success: #17784a;
  --success-soft: #e1f4e9;
  --warning: #8a5200;
  --warning-soft: #fff1d3;
  --danger: #b3261e;
  --danger-soft: #fde9e7;
  --border: #d5dce3;
  --field-border: #7d8794;
  --shadow: 0 8px 28px rgb(30 48 64 / 9%);
  --focus: #006ec7;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --sidebar: 242px;
  --topbar: 64px;
  font: 14px/1.45 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #10151c;
  --surface: #18212b;
  --surface-alt: #222e3a;
  --surface-strong: #2a3946;
  --text: #eef4f8;
  --muted: #a9b6c2;
  --primary: #69b9ef;
  --primary-strong: #8bcbf5;
  --primary-soft: #173a53;
  --success: #66d49b;
  --success-soft: #173e2c;
  --warning: #f4ba61;
  --warning-soft: #49351b;
  --danger: #ff8b83;
  --danger-soft: #4d2626;
  --border: #344453;
  --field-border: #6f8192;
  --shadow: 0 8px 28px rgb(0 0 0 / 28%);
  --focus: #8dceff;
}

* { box-sizing: border-box; }
/* WCAG 2.4.11: Beim Einscrollen eines fokussierten Elements Platz fuer die sticky Kopfzeile und die
   im Mobilband feste untere Leiste lassen. Die Werte misst js/scroll-padding.js zur Laufzeit --
   feste Zahlen waeren falsch, weil --topbar eine min-height ist und die untere Leiste
   env(safe-area-inset-bottom) einrechnet. Ohne Skript gelten die Rueckfallwerte 0px, also das
   bisherige Verhalten. */
html { min-width: 320px; background: var(--canvas); scroll-padding-top: var(--scroll-padding-top, 0px); scroll-padding-bottom: max(var(--scroll-padding-bottom, 0px), var(--scroll-padding-error, 0px)); }
body { margin: 0; min-height: 100vh; color: var(--text); background: var(--canvas); }
button, input, select, textarea { font: inherit; color: var(--text); }
a { color: var(--primary); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }

.skip-link { position: fixed; left: 12px; top: 8px; z-index: 1000; transform: translateY(-150%); padding: 10px 14px; border-radius: var(--radius-sm); color: #fff; background: #111; }
.skip-link:focus { transform: translateY(0); }

.loading-progress { display: block; position: relative; width: 8rem; height: 8rem; margin: 20vh auto 1rem; }
.loading-progress circle { fill: none; stroke: var(--border); stroke-width: 0.6rem; transform-origin: 50% 50%; transform: rotate(-90deg); }
.loading-progress circle:last-child { stroke: var(--primary); stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%; transition: stroke-dasharray 0.05s ease-in-out; }
.loading-progress-text { position: absolute; inset: calc(20vh + 3.25rem) 0 auto 0; text-align: center; color: var(--muted); font-weight: 600; }
.loading-progress-text::after { content: var(--blazor-load-percentage-text, "Wird geladen"); }

#blazor-error-ui { position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000; display: none; padding: 12px 16px; background: var(--danger-soft); color: var(--text); box-shadow: var(--shadow); }
#blazor-error-ui .dismiss { cursor: pointer; float: right; }

.app-shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; padding: 12px 10px; border-right: 1px solid var(--border); background: var(--surface); overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 14px; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: #fff; background: linear-gradient(145deg, #1682c4, #174d86); font-weight: 900; }
.brand strong { display: block; }
.brand small { display: block; color: var(--muted); font-size: 12px; }
.nav-heading { margin: 14px 10px 4px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.nav-item { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--muted); text-decoration: none; }
.nav-item:hover { background: var(--surface-alt); color: var(--text); }
.nav-item.is-active { color: var(--primary-strong); background: var(--primary-soft); font-weight: 700; }
.sidebar-footer { min-width: 0; width: 100%; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); }
.sidebar-footer .label { overflow-wrap: anywhere; }

.main-shell { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: var(--topbar); padding: 10px 20px; border-bottom: 1px solid var(--border); background: var(--surface); }
.topbar h1 { margin: 0; font-size: 20px; }
.topbar .eyebrow { margin: 0; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.top-actions { display: flex; align-items: center; gap: 8px; }
/* Eine explizite Spur verhindert, dass die min-content-Breite der Kinder (z. B. breite Tabellen) die
   implizite auto-Spur aufweitet und die Seite auf schmalen Viewports überläuft. */
.content { flex: 1; padding: 20px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-content: start; }

.bottom-nav { display: none; }

.panel { padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.panel h2 { margin: 0 0 6px; font-size: 17px; }
.panel h3 { margin: 14px 0 6px; font-size: 15px; }
.panel p { margin: 0 0 10px; }
.grid-two { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }
/* Grid-Items dürfen schrumpfen: sonst weitet die min-content-Breite (z. B. breite Tabellen) die Spur
   und die Seite läuft auf schmalen Viewports über. Die Tabelle selbst bleibt im lokalen Scroller. */
.grid-two > * { min-width: 0; }
.content { min-width: 0; }
/* Direkte Kinder des Content-Grids dürfen schrumpfen; breite Tabellen scrollen in .table-scroll lokal. */
.content > * { min-width: 0; }
.table-scroll { overflow-x: auto; max-width: 100%; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.row > * { min-width: 0; }
.stack { display: grid; gap: 10px; }
.spacer { flex: 1; }

label { display: block; font-weight: 600; margin-bottom: 4px; }
input:not([type]), input[type="text"], input[type="email"], input[type="password"], input[type="number"], select, textarea { width: 100%; min-height: 44px; padding: 8px 10px; border: 1px solid var(--field-border); border-radius: var(--radius-sm); background: var(--surface); }
textarea { min-height: 80px; }
/* Platzhaltertext ist Text und faellt unter WCAG 1.4.3. Ohne eigene Regel gilt der
   Browserstandard, der je Schema anders ausfaellt und nicht nachweisbar ist. */
::placeholder { color: var(--muted); opacity: 1; }

/* Ohne Variantenklasse bleibt die Schaltflaeche bewusst rahmen- und flaechenlos: Sie wird allein
   durch ihren Text erkannt, und Text faellt unter 1.4.3 (hier 16,29 : 1), nicht unter 1.4.11.
   Wo ein Rahmen die Begrenzung uebernimmt, steht --field-border und erreicht mindestens 3 : 1. */
button, .button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 10px 14px; border: 1px solid transparent; border-radius: var(--radius-sm); font-weight: 700; text-decoration: none; cursor: pointer; }
.primary-button { color: #fff; background: var(--primary); }
.primary-button:hover { background: var(--primary-strong); }
.secondary-button { color: var(--text); background: var(--surface-alt); border-color: var(--field-border); }
.ghost-button { color: var(--primary); background: transparent; border-color: var(--field-border); }
.danger-button { color: #fff; background: var(--danger); }
button:disabled { opacity: .58; cursor: not-allowed; }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background: var(--surface-strong); color: var(--text); font-size: 12px; font-weight: 700; }
.badge.success { background: var(--success-soft); color: var(--success); }
.badge.warning { background: var(--warning-soft); color: var(--warning); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.info { background: var(--primary-soft); color: var(--primary-strong); }

.notice { padding: 10px 12px; border: 1px solid var(--border); border-left: 4px solid var(--primary); border-radius: var(--radius-sm); background: var(--surface-alt); }
.notice.error { border-left-color: var(--danger); background: var(--danger-soft); }
.notice.success { border-left-color: var(--success); background: var(--success-soft); }
.notice.warning { border-left-color: var(--warning); background: var(--warning-soft); }

.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.list li { padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.list .title { font-weight: 700; }
.list .meta { color: var(--muted); font-size: 12px; }

.login-shell { display: grid; place-items: center; min-height: 100vh; padding: 20px; }
.login-card { width: min(460px, 100%); padding: 22px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); }
.login-card h1 { margin: 0 0 6px; font-size: 22px; }

@media (max-width: 1199px) {
  .app-shell { grid-template-columns: 76px minmax(0, 1fr); }
  .sidebar { padding: 10px 6px; align-items: center; }
  .sidebar .label, .brand span, .nav-heading { display: none; }
  /* Zielbreite: Im Band 768-1199px ist die Seitenleiste eine Symbolleiste. align-items:center nimmt den
     Eintraegen die Dehnung, sie schrumpfen sonst auf Inhalt plus Polsterung (ca. 32px). 768x1024 ist ein
     Tablet in Hochkant und damit ein Touchgeraet; A23 nennt 44px als Touchziel. */
  .nav-item { justify-content: center; min-width: 44px; min-height: 44px; }
  .sidebar-footer { text-align: center; }
}

@media (max-width: 767px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .content { padding: 14px 12px 84px; }
  .bottom-nav { position: fixed; inset: auto 0 0 0; z-index: 50; display: flex; justify-content: space-around; gap: 4px; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); background: var(--surface); }
  .bottom-nav a { flex: 1; display: grid; place-items: center; gap: 2px; min-height: 48px; border-radius: var(--radius-sm); color: var(--muted); text-decoration: none; font-size: 12px; }
  .bottom-nav a.is-active { color: var(--primary-strong); background: var(--primary-soft); }
  table { display: block; overflow-x: auto; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
/*
  Dunkelmodus: explizite Regeln mit höherer Spezifität für die eigenen Flächen und Texte. Die
  DevExpress-Basisdatei (modes/light.min.css) setzt body-/Textfarben; ohne diese Regeln bliebe der
  Text im dunklen Schema dunkel auf dunkel. app.css lädt zusätzlich nach den DevExpress-Styles.
*/
:root[data-theme="dark"] body {
  background: var(--canvas);
  color: var(--text);
}

:root[data-theme="dark"] .topbar,
:root[data-theme="dark"] .sidebar,
:root[data-theme="dark"] .panel,
:root[data-theme="dark"] .login-card,
:root[data-theme="dark"] .content,
:root[data-theme="dark"] .list li,
:root[data-theme="dark"] .notice {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

:root[data-theme="dark"] h1,
:root[data-theme="dark"] h2,
:root[data-theme="dark"] h3,
:root[data-theme="dark"] strong,
:root[data-theme="dark"] table th,
:root[data-theme="dark"] table td {
  color: var(--text);
}

:root[data-theme="dark"] label,
:root[data-theme="dark"] .muted,
:root[data-theme="dark"] .small,
:root[data-theme="dark"] .list .meta {
  color: var(--muted);
}

:root[data-theme="dark"] input,
:root[data-theme="dark"] select,
:root[data-theme="dark"] textarea {
  background: var(--surface-alt);
  color: var(--text);
  border-color: var(--field-border);
}

:root[data-theme="dark"] table th,
:root[data-theme="dark"] table td {
  border-color: var(--border);
}

/*
  Kontrast: im Dunkelmodus sind die Akzentfarben hell, weißer Text darauf wäre unlesbar. Deshalb dunkler
  Text auf den Akzentflächen; im Hellmodus bleiben weiße Beschriftungen (dort ausreichend Kontrast).
*/
:root[data-theme="dark"] .primary-button,
:root[data-theme="dark"] .danger-button {
  color: #0b1116;
}

:root[data-theme="dark"] .primary-button:hover {
  background: var(--primary-strong);
}

/* Touchziele: auch Kästchen-Beschriftungen (z. B. „Angemeldet bleiben“) erhalten eine 44-px-Fläche. */
input[type="checkbox"] {
  width: 20px;
  height: 20px;
}

label:has(> input[type="checkbox"]) {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
}

/* U2: dieselben Farb-/Abstandsregeln für Inhalte, Formulare und den Wochenrückblick. */
.content-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 12px; }
.content-fields { display: grid; gap: 16px; min-width: 0; margin: 0; padding: 0; border: 0; }
.content-form-grid > *, .content-editor, .content-dates { min-width: 0; }
.content-dates { margin: 0; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.content-dates legend { font-size: 1rem; font-weight: 700; }
.content-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.content-actions > * { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.content-title, .content-body, .content-card, .content-revision { overflow-wrap: anywhere; }
.content-body { max-width: 100%; overflow-x: auto; }
.content-body img { max-width: 100%; height: auto; }
.content-body table { max-width: 100%; }
.content-body pre { white-space: pre-wrap; }
.content-editor { max-width: 100%; }
.content-editor > * { max-width: 100%; }
/* Adaptive Toolbarmenüs liegen außerhalb des Editor-Wrappers. */
.content-editor button, .dxbl-toolbar-dropdown button { min-width: 44px; min-height: 44px; }
.content-editor .dxbl-toolbar-combobox, .dxbl-toolbar-dropdown .dxbl-toolbar-combobox { min-height: 44px; }
/* Ober- oder unterhalb des 44-px-Ankers muss Platz für das lokal scrollbar bleibende Menü sein. */
.dxbl-toolbar-dropdown { max-height: calc(50dvh - 32px); overflow-y: auto; }
.content-card { display: grid; gap: 8px; }
.content-card > a.content-title { display: flex; align-items: center; min-height: 44px; }
.content-card .row { align-items: center; }
.content-filters { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); }
.content-filters label, .content-form-grid label { overflow-wrap: anywhere; }
.content-summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 700; }
.content-conflict { border: 2px solid var(--warning); padding: 12px; border-radius: var(--radius-sm); background: var(--warning-soft); }
.content-conflict pre { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 20rem; overflow-y: auto; }
.content-checklist { display: grid; gap: 8px; list-style: none; padding: 0; }
.content-checklist li { padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.content-checklist label { display: flex; gap: 10px; align-items: center; min-height: 44px; }
.content-checklist input { flex: 0 0 20px; }
.content-attachment { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.content-attachment > :first-child { flex: 1 1 200px; overflow-wrap: anywhere; }
.content-empty { padding: 16px 0; color: var(--muted); }
.content-nav { display: flex; flex-wrap: wrap; gap: 8px; }
.content-nav a { min-height: 44px; padding: 10px; border: 1px solid var(--field-border); border-radius: var(--radius-sm); text-decoration: none; }
input[type="date"], input[type="time"], input[type="datetime-local"], input[type="search"], input[type="file"] { width: 100%; min-width: 0; min-height: 44px; padding: 8px; border: 1px solid var(--field-border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); }
@media (max-width: 767px) {
  .content-form-grid, .content-filters { grid-template-columns: minmax(0, 1fr); }
  .content-actions > button { flex: 1 1 auto; }
  .content-title { font-size: 1.15rem; }
}

/* ------------------------------------------------------------------------------------------------
   CT-30 – Design Richtung A (Fokus-Liste): Liste zuerst, Erfassen in der Kopfzeile, eingeklappte
   Filter, aufgeräumtes Aufgabendetail. Alle Farben aus den Tokens oben, damit Hell/Dunkel mitgehen.
   ------------------------------------------------------------------------------------------------ */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.icon { flex-shrink: 0; }

/* Kopfzeile: Titel, Schnellerfassung, Aktionen */
.topbar { justify-content: flex-start; gap: 20px; }
.topbar h1 { flex: 0 0 auto; min-width: 120px; }
.top-actions { margin-left: auto; }
.icon-button { width: 44px; height: 44px; padding: 0; border: 1px solid var(--field-border); border-radius: var(--radius); background: var(--surface); color: var(--text); }
.icon-button:hover { background: var(--surface-alt); }

.quick-capture-wrap { flex: 1 1 auto; max-width: 640px; min-width: 0; position: relative; }
.quick-capture { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 4px 0 12px; border: 1px solid var(--field-border); border-radius: var(--radius); background: var(--surface); color: var(--primary); }
.quick-capture:focus-within { outline: 3px solid var(--focus); outline-offset: 1px; }
.quick-capture input { flex: 1 1 auto; min-width: 0; min-height: 40px; padding: 0; border: 0; outline: none; background: transparent; color: var(--text); }
.quick-capture .quick-capture-space { flex: 0 1 150px; width: auto; min-height: 36px; padding: 4px 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; background: var(--surface); }
.quick-capture-submit { width: 36px; min-width: 36px; height: 36px; min-height: 36px; padding: 0; border-radius: var(--radius-sm); }
.quick-capture-status { position: absolute; left: 0; top: calc(100% + 4px); margin: 0; padding: 6px 10px; border-radius: var(--radius-sm); background: var(--success-soft); color: var(--text); box-shadow: var(--shadow); z-index: 45; }
.quick-capture-status.error { background: var(--danger-soft); }
/* Die allgemeine Dunkelregel für Eingabefelder würde dem Feld in der Erfassungszeile eine eigene Fläche geben. */
:root[data-theme="dark"] .quick-capture input { background: transparent; }

/* Heute / Eingang: Ansicht, Filter, Liste */
.task-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.segmented { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: var(--radius); background: var(--surface-alt); }
.segmented button { min-height: 40px; padding: 6px 14px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--muted); font-weight: 600; }
.segmented button.is-selected { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgb(23 33 43 / 16%); }
.filter-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.filter-inline select { width: auto; min-width: 150px; max-width: 240px; min-height: 40px; border-radius: 999px; padding: 6px 12px; }
.more-filters { flex-basis: 100%; }
.more-filters > summary, .more-actions > summary, .disclosure > summary, .create-disclosure > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 700; }
.more-filters > summary::-webkit-details-marker, .more-actions > summary::-webkit-details-marker, .disclosure > summary::-webkit-details-marker, .create-disclosure > summary::-webkit-details-marker { display: none; }
.more-filters > summary { display: inline-flex; padding: 6px 14px; border: 1px dashed var(--field-border); border-radius: 999px; color: var(--text); font-weight: 600; }
.more-filters[open] > summary { margin-bottom: 12px; border-style: solid; }
.more-filters[open] { padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.more-filters .ghost-button { margin-top: 12px; }

.empty-state { display: grid; justify-items: start; gap: 8px; padding: 20px; border: 1px dashed var(--field-border); border-radius: var(--radius); background: var(--surface); }
.empty-state strong { font-size: 16px; }

.task-group { display: grid; gap: 6px; }
.group-heading { margin: 4px 0 0; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.task-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.task-row { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 14px; border-bottom: 1px solid var(--border); }
.task-row:last-child { border-bottom: 0; }
.task-check { position: relative; flex: 0 0 auto; display: grid; place-items: center; width: 44px; height: 44px; min-height: 44px; margin: -6px -8px -6px -10px; padding: 0; border: 0; background: transparent; color: transparent; }
.task-check::before { content: ""; position: absolute; width: 22px; height: 22px; border: 2px solid var(--field-border); border-radius: 50%; box-sizing: border-box; }
.task-check .icon { position: relative; }
.task-check:hover:not(:disabled) { color: var(--primary); }
.task-check:hover:not(:disabled)::before { border-color: var(--primary); }
.task-check.is-done { color: #fff; }
.task-check.is-done::before { border-color: var(--success); background: var(--success); }
.task-check.is-static { width: 22px; height: 22px; min-height: 22px; margin: 0 1px; }
.task-main { flex: 1 1 auto; min-width: 0; display: grid; gap: 2px; }
.task-title { font-weight: 700; color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
.task-title:hover { color: var(--primary); text-decoration: underline; }
.task-meta { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.task-meta:empty { display: none; }
.task-badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }

/* Aufgabendetail */
.back-nav { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.back-nav a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; text-decoration: none; }
.task-head p { margin: 0 0 4px; }
.task-head-title { margin: 0 0 8px; font-size: 22px; }
.more-actions { position: relative; }
.more-actions > summary { padding: 8px 14px; border: 1px solid var(--field-border); border-radius: var(--radius-sm); color: var(--text); font-weight: 600; }
.more-actions-menu { position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; min-width: 220px; padding: 8px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.danger-outline-button { width: 100%; justify-content: flex-start; color: var(--danger); background: transparent; border-color: var(--danger); }
.disclosure { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.disclosure > summary { padding: 6px 16px; }
.disclosure > summary::after, .create-disclosure > summary::after { content: "›"; margin-left: auto; font-size: 20px; color: var(--muted); transition: transform .15s; }
.disclosure[open] > summary::after, .create-disclosure[open] > summary::after { transform: rotate(90deg); }
.disclosure > summary .small { font-weight: 400; }
.disclosure > .panel { border: 0; border-top: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius); box-shadow: none; }
/* Die Überschrift der eingebetteten Komponente übernimmt die Zusammenfassung; für Hilfstechnik bleibt sie. */
.disclosure > .panel > h2:first-child { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.create-disclosure > summary { color: var(--primary); }
.create-disclosure[open] > summary { margin-bottom: 10px; }

/* Mobil: Liste zuerst, Erfassen über der unteren Navigation (Daumenreichweite) */
@media (max-width: 767px) {
  .topbar { gap: 10px; }
  .topbar h1 { min-width: 0; flex: 1 1 auto; }
  .quick-capture-wrap { position: fixed; left: 10px; right: 10px; bottom: calc(66px + env(safe-area-inset-bottom)); z-index: 49; max-width: none; }
  .quick-capture { min-height: 50px; box-shadow: var(--shadow); }
  .quick-capture .quick-capture-space { flex-basis: 110px; }
  .quick-capture-status { top: auto; bottom: calc(100% + 6px); }
  .content { padding-bottom: 150px; }
  .bottom-nav a { grid-template-rows: auto auto; align-content: center; font-size: 11px; }
  .segmented { width: 100%; flex-wrap: nowrap; overflow-x: auto; }
  .segmented button { flex: 0 0 auto; }
  .filter-inline select { flex: 1 1 140px; max-width: none; }
  .task-row { align-items: flex-start; flex-wrap: wrap; }
  .task-badges { flex-basis: 100%; justify-content: flex-start; padding-left: 36px; }
  .task-badges:empty { display: none; }
  .task-head-title { font-size: 20px; }
}

/* CT-31: Liste und Detail nebeneinander, gemeinsame Speicherleiste */
.tasks-split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.tasks-list-pane, .tasks-detail-pane, .task-detail { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-content: start; }
.task-row.is-selected { background: var(--surface-alt); box-shadow: inset 3px 0 0 var(--primary); }
.detail-nav { justify-content: space-between; }
.save-bar { position: sticky; bottom: 12px; z-index: 30; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 10px 14px; border: 1px solid var(--field-border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.save-bar-text { flex: 1 1 12em; font-weight: 700; }
@media (min-width: 1100px) {
  .tasks-split.has-detail { grid-template-columns: minmax(300px, 2fr) minmax(0, 3fr); }
  /* Das Detail scrollt für sich; die Liste bleibt stehen. */
  .tasks-detail-pane { position: sticky; top: calc(var(--topbar) + 16px); max-height: calc(100vh - var(--topbar) - 32px); overflow-y: auto; overscroll-behavior: contain; padding: 0 4px 0 0; }
  .tasks-split.has-detail .task-row { flex-wrap: wrap; }
  .tasks-split.has-detail .task-badges { flex-basis: 100%; justify-content: flex-start; padding-left: 36px; }
  .tasks-split.has-detail .task-badges:empty { display: none; }
  .tasks-detail-pane .save-bar { bottom: 0; }
}
@media (max-width: 1099px) {
  .tasks-split.has-detail .tasks-list-pane { display: none; }
  /* Schmal füllt das Detail ohnehin die Breite; „Als eigene Seite öffnen“ brächte nichts. */
  .detail-nav a + a { display: none; }
}
@media (max-width: 767px) {
  /* Über Schnellerfassung und unterer Navigation, zweizeilig statt dreizeilig */
  .save-bar { bottom: calc(124px + env(safe-area-inset-bottom)); gap: 6px 8px; padding: 8px 10px; }
  .save-bar-text { flex-basis: 100%; font-size: 13px; }
  .save-bar button { flex: 1 1 0; }
}
