/* Ticketwerk – Bausteine. Siehe /verwaltung/design/ für alle Bausteine in Aktion. */

/* ---------- Icons ---------- */
.icon { width: 1.35rem; height: 1.35rem; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.icon--sm { width: 1.1rem; height: 1.1rem; }
.icon--lg { width: 1.8rem; height: 1.8rem; }
.icon--xl { width: 2.6rem; height: 2.6rem; stroke-width: 1.6; }

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  --btn-bg: var(--surface); --btn-fg: var(--text); --btn-bd: var(--border-strong); --btn-hover: var(--surface-hover);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: var(--hit); min-width: var(--hit); padding: 0 var(--sp-4); border-radius: var(--r-md);
  border: 1px solid var(--btn-bd); background: var(--btn-bg); color: var(--btn-fg);
  font: inherit; font-weight: 600; line-height: 1.2; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.btn:hover { background: var(--btn-hover); color: var(--btn-fg); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn--primary { --btn-bg: var(--primary); --btn-fg: var(--on-primary); --btn-bd: var(--primary); --btn-hover: var(--primary-hover); }
.btn--primary:active { background: var(--primary-active); }
.btn--secondary { --btn-bg: var(--surface); }
.btn--subtle { --btn-bg: transparent; --btn-bd: transparent; --btn-hover: var(--surface-hover); }
.btn--danger { --btn-bg: var(--danger); --btn-fg: var(--on-danger); --btn-bd: var(--danger); --btn-hover: var(--danger-hover); }
.btn--danger-outline { --btn-bg: transparent; --btn-fg: var(--danger); --btn-bd: var(--danger); --btn-hover: var(--danger-soft); }
.btn--sm { min-height: var(--hit); padding: 0 var(--sp-3); font-size: var(--fs-sm); }   /* Trefferfläche bleibt 44 px */
.btn--lg { min-height: 3.25rem; padding: 0 var(--sp-5); font-size: var(--fs-md); }
.btn--icon { padding: 0; width: var(--hit); }
.btn--block { width: 100%; }
.btn-group { display: inline-flex; flex-wrap: wrap; gap: var(--sp-2); }
.htmx-request.btn { opacity: 0.7; pointer-events: none; }

/* ---------- Formulare ---------- */
.form { display: flex; flex-direction: column; gap: var(--sp-4); max-width: 40rem; }
.form--wide { max-width: none; }
.field { display: flex; flex-direction: column; gap: var(--sp-1); min-width: 0; }
.field__label { font-weight: 600; }
.field__required { color: var(--danger); margin-left: 0.15em; }
.field__help { font-size: var(--fs-sm); color: var(--text-muted); }
.field__list { margin: var(--space-1, 4px) 0 0; padding-left: 1.25em; }
.field__error { font-size: var(--fs-sm); color: var(--danger); font-weight: 600; display: flex; gap: var(--sp-1); align-items: flex-start; }
.input, .select, .textarea {
  width: 100%; min-height: var(--hit); padding: var(--sp-2) var(--sp-3); font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-md);
}
.textarea { min-height: 7rem; resize: vertical; line-height: var(--lh-base); }
.select { appearance: none; padding-right: 2.5rem; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23788396' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.75rem center; background-size: 1.1rem; }
.input::placeholder, .textarea::placeholder { color: var(--text-subtle); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--text-muted); }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--focus); }
.input[disabled], .select[disabled], .textarea[disabled] { background: var(--surface-2); color: var(--text-muted); cursor: not-allowed; }
.field--error .input, .field--error .select, .field--error .textarea, .input[aria-invalid="true"] { border-color: var(--danger); border-width: 2px; }
.check { display: flex; align-items: center; gap: var(--sp-3); min-height: var(--hit); cursor: pointer; }
.check input { width: 1.4rem; height: 1.4rem; accent-color: var(--primary); flex: none; margin: 0; cursor: pointer; }
.fieldset { border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--sp-3) var(--sp-4); margin: 0; }
.fieldset legend { padding: 0 var(--sp-2); font-weight: 650; }
.form-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; padding-top: var(--sp-2); }
.form-errors { background: var(--danger-soft); color: var(--on-danger-soft); border: 1px solid var(--danger); border-radius: var(--r-md); padding: var(--sp-3) var(--sp-4); }
.form-errors ul { margin: var(--sp-1) 0 0; padding-left: var(--sp-5); }
.form-errors + .form-errors, .form-errors strong + ul + strong { display: block; margin-top: var(--sp-2); }
.form-errors a { color: inherit; font-weight: 600; text-decoration: underline; display: inline-block; padding: var(--sp-1) 0; }
.form-errors:focus-visible { outline: 3px solid var(--focus, var(--primary)); outline-offset: 2px; }
.search-input { position: relative; }
.search-input .icon { position: absolute; left: var(--sp-3); top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.search-input .input { padding-left: 2.6rem; }
.checklist { max-height: 18rem; overflow: auto; border: 1px solid var(--border-strong); border-radius: var(--r-md); padding: var(--sp-1) var(--sp-3); background: var(--surface); }
.checklist ul { list-style: none; margin: 0; padding: 0; }

/* ---------- Karten ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-1); min-width: 0; }
.card__header { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--border); }
.card__title { margin: 0; font-size: var(--fs-md); }
.card__body { padding: var(--sp-4); }
.card__footer { padding: var(--sp-3) var(--sp-4); border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.card--flush .card__body { padding: 0; }
a.card, .card--link { display: block; color: inherit; text-decoration: none; transition: box-shadow var(--dur), border-color var(--dur); }
a.card:hover { box-shadow: var(--shadow-2); border-color: var(--border-strong); color: inherit; }
.tile { display: flex; gap: var(--sp-3); align-items: flex-start; padding: var(--sp-4); }
.tile__icon { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: var(--r-md); background: var(--primary-soft); color: var(--on-primary-soft); flex: none; }
.tile__title { font-weight: 650; margin: 0; }
.tile__text { color: var(--text-muted); font-size: var(--fs-sm); margin: var(--sp-1) 0 0; }
.stat { font-size: var(--fs-2xl); font-weight: 700; line-height: 1.1; }

/* ---------- Status-Lozenges, Ticketart, Priorität ---------- */
.lozenge {
  display: inline-flex; align-items: center; gap: var(--sp-1); max-width: 100%; padding: 0.12rem 0.6rem; border-radius: var(--r-sm);
  font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; line-height: 1.5;
  background: var(--st-todo-bg); color: var(--st-todo-fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lozenge--todo { background: var(--st-todo-bg); color: var(--st-todo-fg); }
.lozenge--inprogress { background: var(--st-prog-bg); color: var(--st-prog-fg); }
.lozenge--done { background: var(--st-done-bg); color: var(--st-done-fg); }
.type-icon { display: inline-grid; place-items: center; width: 1.45rem; height: 1.45rem; border-radius: 5px; background: var(--type-task); color: var(--on-accent); flex: none; vertical-align: middle; }
.type-icon .icon { width: 1rem; height: 1rem; stroke-width: 2.4; }
.type-bug { background: var(--type-bug); } .type-task { background: var(--type-task); } .type-story { background: var(--type-story); }
.type-epic { background: var(--type-epic); } .type-subtask { background: var(--type-subtask); }
.prio-icon { display: inline-flex; align-items: center; flex: none; vertical-align: middle; color: var(--prio-medium); }
.prio-icon .icon { stroke-width: 2.6; }
.prio-highest { color: var(--prio-highest); } .prio-high { color: var(--prio-high); } .prio-medium { color: var(--prio-medium); }
.prio-low { color: var(--prio-low); } .prio-lowest { color: var(--prio-lowest); }

/* ---------- Avatare ---------- */
.avatar {
  display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; flex: none;
  background: var(--av-0); color: var(--on-accent); font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.02em; user-select: none;
  vertical-align: middle; text-transform: uppercase;
}
.avatar--sm { width: 1.75rem; height: 1.75rem; font-size: var(--fs-xs); letter-spacing: 0; }
.avatar--lg { width: 3rem; height: 3rem; font-size: 1.05rem; }
.avatar--xl { width: 5rem; height: 5rem; font-size: 1.8rem; }
.av-0 { background: var(--av-0); } .av-1 { background: var(--av-1); } .av-2 { background: var(--av-2); } .av-3 { background: var(--av-3); }
.av-4 { background: var(--av-4); } .av-5 { background: var(--av-5); } .av-6 { background: var(--av-6); } .av-7 { background: var(--av-7); }
.av-8 { background: var(--av-8); } .av-9 { background: var(--av-9); } .av-10 { background: var(--av-10); } .av-11 { background: var(--av-11); }
.avatar--none { background: var(--surface-hover); color: var(--text-muted); }
.user-chip { display: inline-flex; align-items: center; gap: var(--sp-2); min-width: 0; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 1.5rem; padding: 0 0.45rem; border-radius: var(--r-pill); background: var(--surface-hover); color: var(--text); font-size: var(--fs-xs); font-weight: 700; line-height: 1.55; }
.badge--primary { background: var(--primary); color: var(--on-primary); }
.badge--danger { background: var(--danger); color: var(--on-danger); }
.badge--success { background: var(--success-soft); color: var(--on-success-soft); }
.badge--warning { background: var(--warning-soft); color: var(--on-warning-soft); }
.label-chip { display: inline-flex; align-items: center; padding: 0 0.6rem; border-radius: var(--r-pill); background: var(--surface-hover); color: var(--text); font-size: var(--fs-sm); border: 1px solid var(--border); }

/* ---------- Tabellen ---------- */
.table-wrap { position: relative; overflow: auto; max-width: 100%; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fs-base); }
.table th, .table td { padding: var(--sp-3) var(--sp-4); text-align: left; vertical-align: middle; border-bottom: 1px solid var(--border); }
.table thead th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); font-size: var(--fs-sm); font-weight: 650; color: var(--text-muted); white-space: nowrap; border-bottom: 1px solid var(--border-strong); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table .col-num { text-align: right; font-variant-numeric: tabular-nums; }
.table .col-actions { text-align: right; white-space: nowrap; width: 1%; }
.table .col-narrow { width: 1%; white-space: nowrap; }
.table--clickable tbody tr { cursor: pointer; }
.table-wrap--sticky { max-height: calc(100dvh - 14rem); }
@media (max-width: 40rem) {
  .table--stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  .table--stack, .table--stack tbody, .table--stack tr, .table--stack td { display: block; width: 100%; }
  .table--stack tr { padding: var(--sp-2) 0; border-bottom: 1px solid var(--border); }
  .table--stack td { border: 0; padding: var(--sp-1) var(--sp-4); display: flex; gap: var(--sp-3); justify-content: space-between; text-align: right; }
  .table--stack td::before { content: attr(data-label); font-weight: 600; color: var(--text-muted); text-align: left; }
  .table--stack td.col-actions { justify-content: flex-end; }
}

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: var(--sp-1); overflow-x: auto; border-bottom: 1px solid var(--border); margin-bottom: var(--sp-5); scrollbar-width: thin; }
.tab { display: inline-flex; align-items: center; gap: var(--sp-2); min-height: var(--hit); padding: 0 var(--sp-4); color: var(--text-muted); text-decoration: none; font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--text); background: var(--surface-hover); border-radius: var(--r-md) var(--r-md) 0 0; }
.tab[aria-current="page"], .tab[aria-selected="true"] { color: var(--primary); border-bottom-color: var(--primary); }

/* ---------- Dropdown (details/summary, ohne JS bedienbar) ---------- */
.dropdown { position: relative; }
.dropdown > summary { list-style: none; cursor: pointer; }
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown__menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 80; min-width: 15rem; max-width: min(22rem, 92vw);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-2); padding: var(--sp-2);
}
.dropdown--left .dropdown__menu { left: 0; right: auto; }
.menu-item { display: flex; align-items: center; gap: var(--sp-3); width: 100%; min-height: var(--hit); padding: 0 var(--sp-3); border: 0; border-radius: var(--r-sm); background: none; color: var(--text); font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.menu-item:hover { background: var(--surface-hover); color: var(--text); }
.menu-item[aria-current="true"], .menu-item[aria-checked="true"] { background: var(--primary-soft); color: var(--on-primary-soft); font-weight: 650; }
.menu-item--danger { color: var(--danger); }
.menu-item--danger:hover { color: var(--danger-hover); }   /* Dunkelmodus: hellere Schrift auf dem Hover-Grund (Kontrast ≥ 4,5:1) */
.menu-sep { height: 1px; background: var(--border); margin: var(--sp-2) 0; border: 0; }
.menu-label { padding: var(--sp-2) var(--sp-3) 0; font-size: var(--fs-xs); font-weight: 650; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.menu-form { margin: 0; }

/* ---------- Dialog (natives <dialog>) ---------- */
.dialog { border: 1px solid var(--border); border-radius: var(--r-lg); padding: 0; background: var(--surface); color: var(--text); box-shadow: var(--shadow-3); width: min(34rem, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); }
.dialog--wide { width: min(60rem, calc(100vw - 2rem)); }
.dialog::backdrop { background: var(--scrim); }
.dialog__header { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-4) var(--sp-4) var(--sp-3); }
.dialog__title { margin: 0; font-size: var(--fs-lg); }
.dialog__body { padding: 0 var(--sp-4) var(--sp-4); overflow: auto; }
.dialog__footer { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--sp-2); padding: var(--sp-3) var(--sp-4) var(--sp-4); }
.shortcut-list { display: grid; grid-template-columns: auto 1fr; gap: var(--sp-2) var(--sp-4); align-items: center; margin: 0; }
.shortcut-list dt { text-align: right; white-space: nowrap; }
.shortcut-list dd { margin: 0; }

/* ---------- Toasts & Hinweise ---------- */
.toasts { position: fixed; z-index: 200; right: var(--sp-4); bottom: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-2); width: min(26rem, calc(100vw - 2rem)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: var(--sp-3); align-items: flex-start; padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md); background: var(--text); color: var(--bg); box-shadow: var(--shadow-3); border-left: 6px solid var(--primary); animation: toast-in var(--dur) var(--ease); }
.toast--success { border-left-color: var(--success); }
.toast--warning { border-left-color: var(--warning); }
.toast--error { border-left-color: var(--danger); }
.toast__text { flex: 1; }
.toast__close { background: none; border: 0; color: inherit; cursor: pointer; min-width: var(--hit); min-height: var(--hit); margin: calc(var(--sp-3) * -1) calc(var(--sp-4) * -1) calc(var(--sp-3) * -1) 0; display: grid; place-items: center; border-radius: var(--r-sm); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.alert { display: flex; gap: var(--sp-3); align-items: flex-start; padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md); border: 1px solid var(--primary); background: var(--primary-soft); color: var(--on-primary-soft); }
.alert--success { background: var(--success-soft); color: var(--on-success-soft); border-color: var(--success); }
.alert--warning { background: var(--warning-soft); color: var(--on-warning-soft); border-color: var(--warning-border); }
.alert--danger { background: var(--danger-soft); color: var(--on-danger-soft); border-color: var(--danger); }
.alert .icon { margin-top: 0.15rem; }
.secret-box { font-family: var(--font-mono); font-size: var(--fs-lg); padding: var(--sp-3) var(--sp-4); background: var(--surface-sunken); border: 1px dashed var(--border-strong); border-radius: var(--r-md); user-select: all; word-break: break-all; }

/* ---------- Leerzustand, Laden, Fortschritt ---------- */
.empty { text-align: center; padding: var(--sp-7) var(--sp-4); color: var(--text-muted); display: flex; flex-direction: column; align-items: center; gap: var(--sp-2); }
.empty .icon { width: 2.8rem; height: 2.8rem; stroke-width: 1.5; color: var(--text-subtle); }
.empty__title { font-size: var(--fs-md); font-weight: 650; color: var(--text); margin: 0; }
.empty__text { margin: 0; max-width: 30rem; }
.spinner { display: inline-block; width: 1.4rem; height: 1.4rem; border: 3px solid var(--border-strong); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { display: inline-block; }
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-hover) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: var(--r-sm); min-height: 1rem; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.progress { height: 0.6rem; background: var(--surface-hover); border-radius: var(--r-pill); overflow: hidden; }
.progress > span { display: block; height: 100%; width: 0; background: var(--primary); border-radius: var(--r-pill); }

/* ---------- Paginierung ---------- */
.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-top: var(--sp-4); }
.pagination__pages { display: flex; flex-wrap: wrap; gap: var(--sp-1); list-style: none; margin: 0; padding: 0; }
.pagination__link { display: inline-flex; align-items: center; justify-content: center; min-width: var(--hit); min-height: var(--hit); padding: 0 var(--sp-3); border-radius: var(--r-md); text-decoration: none; color: var(--text); border: 1px solid var(--border); background: var(--surface); font-weight: 600; }
.pagination__link:hover { background: var(--surface-hover); color: var(--text); }
.pagination__link[aria-current="page"] { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.pagination__link[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }

/* ---------- Tooltips (CSS) ---------- */
[data-tooltip] { position: relative; }
[data-tooltip]::after {
  content: attr(data-tooltip); position: absolute; z-index: 90; left: 50%; top: calc(100% + 6px); transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 0.3rem 0.65rem; border-radius: var(--r-sm); font-size: var(--fs-sm); font-weight: 500;
  white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity var(--dur) var(--ease) 300ms;
}
[data-tooltip]:hover::after, [data-tooltip]:focus-visible::after { opacity: 1; }

/* ---------- Listen / Meta ---------- */
.list-plain { list-style: none; margin: 0; padding: 0; }
.list-divided > li { padding: var(--sp-3) 0; border-bottom: 1px solid var(--border); }
.list-divided > li:last-child { border-bottom: 0; }
.dl { display: grid; grid-template-columns: minmax(8rem, max-content) 1fr; gap: var(--sp-2) var(--sp-4); margin: 0; }
.dl dt { color: var(--text-muted); font-weight: 600; }
.dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 40rem) { .dl { grid-template-columns: 1fr; gap: 0; } .dl dd { margin-bottom: var(--sp-3); } }
.prose { max-width: 70ch; overflow-wrap: anywhere; }
.prose > :last-child { margin-bottom: 0; }
.prose table { border-collapse: collapse; } .prose th, .prose td { border: 1px solid var(--border); padding: var(--sp-1) var(--sp-3); }
.prose blockquote { margin: var(--sp-3) 0; padding-left: var(--sp-4); border-left: 4px solid var(--border-strong); color: var(--text-muted); }
.prose img { height: auto; }
.swatch { width: 100%; height: 3.2rem; border-radius: var(--r-md); border: 1px solid var(--border); }
.demo-box { border: 1px dashed var(--border-strong); border-radius: var(--r-md); padding: var(--sp-4); }

/* ---------- Anmeldeseite ---------- */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: var(--sp-4); background: var(--bg); }
.auth__card { width: min(26rem, 100%); }
.auth__brand { display: flex; align-items: center; justify-content: center; gap: var(--sp-3); margin-bottom: var(--sp-5); font-size: var(--fs-xl); font-weight: 750; }
.auth__brand .icon { width: 2.4rem; height: 2.4rem; color: var(--primary); stroke-width: 1.8; }

/* ---------- Platzhalter / Fehlerseiten ---------- */
.error-page { text-align: center; padding: var(--sp-8) var(--sp-4); }
.error-page__code { font-size: 5rem; font-weight: 800; color: var(--text-subtle); line-height: 1; margin: 0; }

.btn .badge--float { position: absolute; top: 2px; right: 0; min-width: 1.5rem; padding: 0 0.3rem; font-size: var(--fs-xs); line-height: 1.3; }

/* ---------- Windows-Kontrastmodus und „Mehr Kontrast“ ---------- */
@media (forced-colors: active) {
  .nav__link[aria-current="page"], .pagination__link[aria-current="page"], .chip-link.is-active, .epic-chip.is-active,
  .menu-item[aria-current="true"], .menu-item[aria-checked="true"] {
    outline: 2px solid Highlight; outline-offset: -2px; font-weight: 700;
  }
  .progress, .meter, .progress-multi { border: 1px solid CanvasText; forced-color-adjust: none; background: Canvas; }
  .progress > span, .meter > span, .progress-multi > span { forced-color-adjust: none; background: Highlight; }
  .progress-multi__done { background: LinkText; }
  .viz-fill { forced-color-adjust: none; fill: Highlight; }
  .badge { border: 1px solid CanvasText; }
}
@media (prefers-contrast: more) {
  :root:not([data-theme="dark"]) { --text-muted: #2c3548; --border: #6b7488; }
  .btn, .field__input, input, select, textarea { border-width: 2px; }
}
@media (prefers-contrast: more) and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --text-muted: #d5dce8; --border: #8b97ad; }
}

/* ---------- Aufgabenlisten in Markdown ---------- */
.prose li.task { list-style: none; margin-left: -1.4rem; display: flex; align-items: flex-start; gap: var(--sp-2); }
.task__box { flex: none; display: inline-grid; place-items: center; width: 1.4rem; height: 1.4rem; margin-top: 0.15rem; border: 2px solid var(--text-muted); border-radius: 4px; background: var(--surface); color: var(--on-primary); padding: 0; font: inherit; line-height: 1; }
.task__box[aria-checked="true"], .task__box[data-state="true"] { background: var(--primary); border-color: var(--primary); }
.task__box[aria-checked="true"]::after, .task__box[data-state="true"]::after { content: "\2713"; font-weight: 800; }
button.task__box { cursor: pointer; position: relative; }
button.task__box::before { content: ""; position: absolute; inset: -0.6rem; }   /* Trefferfläche ≥ 44 px */
button.task__box:disabled { opacity: 0.6; cursor: progress; }
li.task.is-done { color: var(--text-muted); }
@media (forced-colors: active) { .task__box { border-color: CanvasText; } .task__box[aria-checked="true"], .task__box[data-state="true"] { background: Highlight; color: HighlightText; forced-color-adjust: none; } }

.user-link { color: inherit; text-decoration: none; display: inline-flex; min-height: var(--hit); align-items: center; }
.user-link:hover .truncate { text-decoration: underline; }

/* Handy: lange Knopfbeschriftungen umbrechen statt die Seite zu verbreitern */
@media (max-width: 40rem) {
  .btn { white-space: normal; max-width: 100%; text-align: center; padding-top: var(--sp-1); padding-bottom: var(--sp-1); }
}
