/* ── Base ─────────────────────────────────────────────────────────────────── */
body { background: #f4f6fb; }
.wrapper { min-height: 100vh; }

/* ── Browser surfaces: selection, focus, scrollbars ──────────────────────── */
::selection { background: rgba(13,110,253,.25); color: inherit; }

:focus-visible {
    outline: 2px solid var(--bs-primary, #0d6efd);
    outline-offset: 2px;
    border-radius: 4px;
}
.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible { outline-offset: 3px; }

html { scrollbar-width: thin; scrollbar-color: #c3c9d6 transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c3c9d6; border-radius: 99px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #a7afc0; background-clip: padding-box; }
[data-bs-theme="dark"] html { scrollbar-color: #3a4054 transparent; }
[data-bs-theme="dark"] ::-webkit-scrollbar-thumb { background: #3a4054; background-clip: padding-box; }
[data-bs-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: #4a5169; background-clip: padding-box; }

/* Generic hover surface used on list rows without their own hover treatment */
.hover-bg { transition: background-color .15s ease; }
.hover-bg:hover { background: rgba(13,110,253,.07); }
[data-bs-theme="dark"] .hover-bg:hover { background: rgba(13,110,253,.14); }

/* ── Motion: entrance for grids of cards/rows ────────────────────────────── */
/* The one authored moment, reused everywhere a list of items appears: a soft
   rise-and-fade, staggered per item so the grid reads as populating rather
   than snapping in. Capped stagger so long lists don't crawl in. */
@keyframes rise-in {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
.rise-in {
    animation: rise-in .45s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@media (prefers-reduced-motion: reduce) {
    .rise-in { animation: none; }
}

/* Stagger steps for .rise-in siblings – capped at 8 so a long grid doesn't
   visibly crawl in; items beyond that share the last delay. */
.rise-in:nth-child(1) { animation-delay: 0ms; }
.rise-in:nth-child(2) { animation-delay: 40ms; }
.rise-in:nth-child(3) { animation-delay: 80ms; }
.rise-in:nth-child(4) { animation-delay: 120ms; }
.rise-in:nth-child(5) { animation-delay: 160ms; }
.rise-in:nth-child(6) { animation-delay: 200ms; }
.rise-in:nth-child(7) { animation-delay: 240ms; }
.rise-in:nth-child(n+8) { animation-delay: 280ms; }

/* ── Button feedback ──────────────────────────────────────────────────────── */
.btn { transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s, transform .08s; }
.btn:active { transform: scale(.97); }

/* ── Dropdowns / menus: soft pop instead of an instant snap ──────────────── */
@keyframes menu-pop {
    from { opacity: 0; transform: translateY(-4px) scale(.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.dropdown-menu.show { animation: menu-pop .14s cubic-bezier(0.16, 1, 0.3, 1) both; }
@media (prefers-reduced-motion: reduce) {
    .dropdown-menu.show { animation: none; }
}

/* ── Ajax loading state (Tasks/Index search + filters) ───────────────────── */
#taskGrid.is-loading { opacity: .5; pointer-events: none; transition: opacity .15s; }

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.sidebar {
    width: 240px;
    min-height: 100vh;
    background: #1a1d2e;
    color: #c8ccd8;
    transition: transform .25s ease;
    flex-shrink: 0;
    z-index: 1040;
}
.sidebar-header { border-bottom: 1px solid rgba(255,255,255,.08); }

.sidebar-link {
    color: #c8ccd8 !important;
    border-radius: 8px;
    padding: .45rem .85rem;
    margin-bottom: 2px;
    font-size: .9rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: background .15s;
}
.sidebar-link:hover  { background: rgba(255,255,255,.08); color: #fff !important; }
.sidebar-link.active { background: #0d6efd;               color: #fff !important; }

.avatar-sm { width: 32px; height: 32px; font-size: .85rem; }

/* ── Topbar ───────────────────────────────────────────────────────────────── */
.topbar { min-height: 56px; box-shadow: 0 1px 0 #e9ecef; }

/* ── Breadcrumb ───────────────────────────────────────────────────────────── */
.breadcrumb-item a {
    color: #6c757d;
    text-decoration: none;
}
.breadcrumb-item a:hover { color: #495057; text-decoration: none; }

/* ── Main Content ─────────────────────────────────────────────────────────── */
.main-content { min-width: 0; background: #f4f6fb; overflow-x: hidden; }

/* ── Stat Cards ───────────────────────────────────────────────────────────── */
.stat-card {
    border: none;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
}

/* ── Task Cards ───────────────────────────────────────────────────────────── */
.task-card {
    border-left: 4px solid transparent;
    border-radius: 12px;
    box-shadow: 0 1px 6px rgba(0,0,0,.07);
    transition: box-shadow .15s, transform .15s;
    background: #fff;
    position: relative; /* needed so z-index works without transform stacking context issues */
}
.task-card:hover       { box-shadow: 0 4px 18px rgba(0,0,0,.11); transform: translateY(-1px); }
.task-card:has(.dropdown-menu.show) { z-index: 10; transform: none; }
.task-card.priority-critical { border-left-color: #dc3545; }
.task-card.priority-high     { border-left-color: #fd7e14; }
.task-card.priority-medium   { border-left-color: #ffc107; }
.task-card.priority-low      { border-left-color: #0dcaf0; }
.task-card.priority-none     { border-left-color: #6c757d; }
.task-card.priority-unclear  { border-left-color: #6f42c1; }
.task-card.status-done       { opacity: .65; }
/* Ensure grid cells containing an open dropdown are above neighbours */
.task-card-grid { overflow: visible !important; }

/* Strip HTML tags from task description preview on card */
.task-desc-preview { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Priority Badges ──────────────────────────────────────────────────────── */
.badge-priority-critical { background: #dc3545; }
.badge-priority-high     { background: #fd7e14; }
.badge-priority-medium   { background: #ffc107; color: #212529 !important; }
.badge-priority-low      { background: #0dcaf0; color: #212529 !important; }
.badge-priority-none     { background: #6c757d; }
.badge-priority-unclear  { background: #6f42c1; }

/* ── Task Description (Rich Text) ────────────────────────────────────────── */
.task-description {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    border-left: 3px solid #dee2e6;
    font-size: .95rem;
    line-height: 1.65;
    color: #495057;
    overflow-wrap: break-word;
    word-break: break-word;
}
.task-description h1, .task-description h2, .task-description h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-top: .75rem;
    margin-bottom: .35rem;
    color: #212529;
}
.task-description h1 { font-size: 1.2rem; }
.task-description h2 { font-size: 1.1rem; }
.task-description h3 { font-size: 1rem; }
.task-description p { margin-bottom: .5rem; }
.task-description ul, .task-description ol {
    padding-left: 1.4rem;
    margin-bottom: .5rem;
}
.task-description li { margin-bottom: .2rem; }
.task-description strong { font-weight: 700; color: #212529; }
.task-description em { font-style: italic; }
.task-description s { opacity: .7; }
.task-description blockquote {
    border-left: 3px solid #0d6efd;
    padding-left: .75rem;
    margin: .5rem 0;
    color: #6c757d;
    font-style: italic;
}
.task-description code {
    background: #e9ecef;
    padding: .1rem .35rem;
    border-radius: 4px;
    font-size: .85em;
    color: #c7254e;
}
.task-description pre {
    background: #212529;
    color: #f8f9fa;
    padding: .75rem 1rem;
    border-radius: 6px;
    font-size: .85rem;
    overflow-x: auto;
    margin: .5rem 0;
}
/* Bilder nie über die Karte hinauslaufen lassen. !important ist nötig, weil
   Quill beim Größenziehen im Editor inline width + max-width:none schreibt. */
.task-description img {
    max-width: 100% !important;
    height: auto !important;
}

/* ── Auth ─────────────────────────────────────────────────────────────────── */
.auth-wrapper {
    flex: 1;                  /* fills available height in the layout flex column */
    background: linear-gradient(135deg, #1a1d2e 0%, #0d6efd 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

/* ── Quill checklist items outside the editor ────────────────────────────── */
/* Quill 1.3.7 stores checklists as <ul data-checked="true/false"><li>…</li></ul> */
/* JS (site.js) injects inline SVG icons – CSS prepares the layout.           */
.task-description ul[data-checked] {
    padding-left: 0;       /* override general ul indent – icon handles spacing */
    margin-bottom: 0.1rem; /* collapse gap between adjacent single-item uls     */
}
.task-description ul[data-checked] > li {
    list-style: none !important;
    padding-left: 1.6em;
    position: relative;
}
/* Also handle Quill 2.x format (li[data-list]) as fallback */
.task-description li[data-list="checked"],
.task-description li[data-list="unchecked"] {
    list-style: none !important;
    padding-left: 1.6em;
    position: relative;
}
/* Injected SVG icon span */
.task-description .ql-checkbox-icon {
    position: absolute;
    left: 0;
    top: 0.18em;
    width: 0.9em;
    height: 0.9em;
    display: inline-block;
}

/* ── Auth footer links ────────────────────────────────────────────────────── */
.auth-footer {
    text-align: center;
    padding: 10px 0 14px;
    font-size: 11px;
    flex-shrink: 0;
    letter-spacing: .02em;
}
.auth-footer-link {
    color: rgba(255, 255, 255, .55);
    text-decoration: none;
    transition: color .2s;
}
.auth-footer-link:hover {
    color: #fff;
    text-decoration: none;
}
.auth-footer-sep {
    color: rgba(255, 255, 255, .25);
    margin: 0 .6rem;
}
.auth-card {
    width: 100%;
    max-width: 420px;
    border: none;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
}

/* ── Progress ─────────────────────────────────────────────────────────────── */
.progress { height: 6px; border-radius: 99px; }

/* ── Mobile Sidebar ───────────────────────────────────────────────────────── */
.sidebar-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 1039;
}
@media (max-width: 991.98px) {
    .sidebar {
        position: fixed;
        top: 0; left: 0; bottom: 0;
        transform: translateX(-100%);
    }
    .sidebar.show { transform: translateX(0); }
}

/* ── Mobile Layout Fixes ──────────────────────────────────────────────────── */
@media (max-width: 767.98px) {
    /* Stat cards: full width on very small screens */
    .stat-card .fs-3 { font-size: 1.4rem !important; }

    /* Task cards: no horizontal overflow */
    .task-card .card-body { padding: .75rem !important; }

    /* Filter bar: stack cleanly */
    .filter-form .row { gap: .5rem; }

    /* Topbar: smaller padding */
    .topbar { padding-left: .75rem !important; padding-right: .75rem !important; }

    /* Detail page: sidebar stacks below */
    .col-lg-8, .col-lg-4 { width: 100%; }

    /* Buttons wrap properly */
    .d-flex.gap-2 { flex-wrap: wrap; }

    /* Badge list wraps cleanly */
    .d-flex.flex-wrap.gap-1 { row-gap: .25rem; }

    /* Quill editor responsive */
    .ql-editor { min-height: 120px; }

    /* Main padding */
    main.flex-grow-1 { padding: .75rem !important; }

    /* Stat cards row: 2 per row on mobile */
    .col-6.col-lg-3 { width: 50%; }
}

@media (max-width: 575.98px) {
    /* On xs: filter inputs full width */
    .col-6.col-md-2, .col-6.col-md-4 { width: 100%; }

    /* Breadcrumb trimming */
    .breadcrumb { font-size: .78rem; }
    .breadcrumb-item { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

    /* Teams + task header stacks */
    .d-flex.justify-content-between { flex-direction: column; gap: .5rem; align-items: flex-start !important; }

    /* Task card status buttons stack */
    .btn-group-status { flex-direction: column; }

    /* Task description padding */
    .task-description { padding: .75rem; }
}

/* ── Alert close button ───────────────────────────────────────────────────── */
/* Bootstrap setzt auf .alert-dismissible das X auf position:absolute,
   was es aus dem Flex-Flow nimmt. Wir überschreiben das für d-flex Alerts. */
.alert.d-flex .btn-close,
.alert.d-flex.alert-dismissible .btn-close {
    position: static;    /* kein absolute mehr – wird echtes Flex-Item */
    padding: 0;
    align-self: center;
    flex-shrink: 0;
}
/* Damit kein extra rechts-Padding durch alert-dismissible */
.alert.d-flex.alert-dismissible { padding-right: 1rem; }

/* ── Misc ─────────────────────────────────────────────────────────────────── */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: .5; }
}
.overdue-badge { animation: pulse 2s infinite; }

/* ── Footer ───────────────────────────────────────────────────────────────── */
.app-footer {
    font-size: 11px;
    color: #adb5bd;
    background: #fff;
}

/* ══════════════════════════════════════════════════════════════════════════
   DARK MODE
   Rein farbliche Überschreibungen – es werden bewusst keine Abstände,
   Größen oder Positionen verändert, damit sich beim Umschalten nichts
   im Layout verschiebt.
   ══════════════════════════════════════════════════════════════════════════ */
[data-bs-theme="dark"] {
    /* Eigene Flächenfarben */
    --app-bg:      #101320;
    --app-surface: #1b1f2e;

    /* Bootstrap-Variablen auf die Projektpalette ziehen */
    --bs-body-bg:         #1b1f2e;
    --bs-body-color:      #d5dae5;
    --bs-emphasis-color:  #f5f7fa;
    --bs-heading-color:   #eef1f6;
    --bs-border-color:    #2f3548;
    --bs-secondary-bg:    #232838;
    --bs-tertiary-bg:     #1f2433;
}

/* Grundflächen – Abstufung: Hintergrund < Sidebar < Karten/Topbar */
[data-bs-theme="dark"] body,
[data-bs-theme="dark"] .main-content { background: var(--app-bg); }
[data-bs-theme="dark"] .sidebar      { background: #161a27; }

/* Bootstrap-Utilities, die auf feste helle Farben zeigen */
[data-bs-theme="dark"] .bg-white { background-color: var(--bs-body-bg) !important; }
[data-bs-theme="dark"] .bg-light { background-color: rgba(255,255,255,.07) !important; }

/* .text-dark nur umkehren, wenn es NICHT auf einem farbigen Badge sitzt
   (bg-warning/bg-info brauchen weiterhin dunkle Schrift für den Kontrast). */
[data-bs-theme="dark"] .text-dark:not([class*="bg-"]),
[data-bs-theme="dark"] .bg-light.text-dark { color: var(--bs-body-color) !important; }

/* Topbar / Breadcrumb / Footer */
[data-bs-theme="dark"] .topbar { box-shadow: 0 1px 0 var(--bs-border-color); }
[data-bs-theme="dark"] .breadcrumb-item a       { color: #98a2b6; }
[data-bs-theme="dark"] .breadcrumb-item a:hover { color: #ccd3e0; }
[data-bs-theme="dark"] .app-footer { background: var(--bs-body-bg); color: #6b7488; }

/* Karten – nur Farbe und Schattenintensität, keine Geometrie */
[data-bs-theme="dark"] .task-card        { background: var(--bs-body-bg); box-shadow: 0 1px 6px rgba(0,0,0,.45); }
[data-bs-theme="dark"] .task-card:hover  { box-shadow: 0 4px 18px rgba(0,0,0,.6); }
[data-bs-theme="dark"] .stat-card        { box-shadow: 0 2px 12px rgba(0,0,0,.4); }

/* Aufgaben-Beschreibung (Rich Text) */
[data-bs-theme="dark"] .task-description {
    background: rgba(255,255,255,.04);
    border-left-color: var(--bs-border-color);
    color: #c4cbd9;
}
[data-bs-theme="dark"] .task-description h1,
[data-bs-theme="dark"] .task-description h2,
[data-bs-theme="dark"] .task-description h3,
[data-bs-theme="dark"] .task-description strong { color: #eef1f6; }
[data-bs-theme="dark"] .task-description blockquote { color: #98a2b6; }
[data-bs-theme="dark"] .task-description code {
    background: rgba(255,255,255,.1);
    color: #ff8fa3;
}

/* Checklisten-Icon: unmarkierte Box heller zeichnen */
[data-bs-theme="dark"] .task-description .ql-checkbox-icon rect[stroke] { stroke: #6b7488; }

/* ══════════════════════════════════════════════════════════════════════════
   RICH-TEXT-EDITOR (Quill) – gemeinsam für Aufgabenbeschreibung und Notizen
   Gehört zu wwwroot/js/quill-editor.js
   ══════════════════════════════════════════════════════════════════════════ */
.quill-editor-container { background: #fff; }

.ql-toolbar.ql-snow {
    border-radius: .375rem .375rem 0 0;
    border-color: #dee2e6;
}

.ql-container.ql-snow {
    border-radius: 0 0 .375rem .375rem;
    border-color: #dee2e6;
    font-size: .95rem;
}

.ql-editor {
    min-height: 160px;
    overflow-x: auto;
}

    .ql-editor.ql-blank::before {
        color: #adb5bd;
        font-style: normal;
    }

    .ql-editor img {
        height: auto;
        border-radius: .25rem;
        cursor: pointer;
    }

        .ql-editor img.ql-img-selected {
            outline: 2px solid #0d6efd;
            outline-offset: 2px;
        }

/* Overlays für Bildauswahl – liegen an <body>, daher als Klasse (mehrere Editoren möglich) */
.ql-img-remove {
    display: none;
    position: fixed;
    z-index: 10000;
    width: 22px;
    height: 22px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(0,0,0,.65);
    color: #fff;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

.ql-img-resize {
    display: none;
    position: fixed;
    z-index: 9999;
    width: 12px;
    height: 12px;
    background: #0d6efd;
    border: 2px solid #fff;
    border-radius: 2px;
    cursor: se-resize;
}

/* ── Farbwähler im Word-Stil: 2 Reihen à 10 Farben ────────────────────────── */
/* Breite so gewählt, dass genau 10 Farbfelder je Reihe passen:
   Feld = 16px + 2×2px Margin = 20px (border-box), 10 × 20 = 200px
   Innenbreite = 222 − 2×5px Padding − 2×1px Rahmen = 210px                   */
.ql-snow .ql-color-picker .ql-picker-options {
    width: 222px !important;
    flex-wrap: wrap;
    padding: 5px !important;
}

/* display nur im aufgeklappten Zustand setzen – sonst würde die Palette
   Quills "display:none" überschreiben und dauerhaft offen stehen. */
.ql-snow .ql-picker.ql-expanded.ql-color-picker .ql-picker-options {
    display: flex;
}

.ql-snow .ql-color-picker .ql-picker-item {
    float: none !important;
    border-color: rgba(0,0,0,.2) !important;
}

    .ql-snow .ql-color-picker .ql-picker-item:hover,
    .ql-snow .ql-color-picker .ql-picker-item.ql-selected {
        border-color: #000 !important;
    }

/* "Automatisch" – volle Breite als eigene Zeile über den Farbfeldern */
.ql-snow .ql-color-picker .ql-picker-item:not([data-value]) {
    flex: 0 0 100%;
    width: auto !important;
    height: auto !important;
    margin: 0 0 5px !important;
    padding: 3px 0 !important;
    border-radius: 3px;
    background: transparent !important;
    font-size: 11px;
    line-height: 1.5;
    text-align: center;
    color: #444;
}

    .ql-snow .ql-color-picker .ql-picker-item:not([data-value])::before {
        content: "Automatisch";
    }

/* ── Schnellzugriff unten: zuletzt verwendete + Grundfarben ───────────────── */
.ql-snow .ql-color-picker .ql-quick-colors {
    flex: 0 0 100%;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid #e0e0e0;
}

.ql-snow .ql-color-picker .ql-quick-colors-title {
    font-size: 10px;
    line-height: 1.4;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 2px;
}

.ql-snow .ql-color-picker .ql-quick-colors-row {
    display: flex;
    flex-wrap: wrap;
}

.ql-snow .ql-color-picker .ql-quick-color {
    width: 16px;
    height: 16px;
    margin: 2px;
    padding: 0;
    border: 1px solid rgba(0,0,0,.2);
    border-radius: 2px;
    cursor: pointer;
}

    .ql-snow .ql-color-picker .ql-quick-color:hover { border-color: #000; }

/* Eigene Farbe: nativer Color-Picker als Toolbar-Button getarnt */
.ql-toolbar label.ql-custom-color {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 24px;
    cursor: pointer;
    vertical-align: middle;
}

    .ql-toolbar label.ql-custom-color input[type="color"] {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        opacity: 0;
        padding: 0;
        border: none;
        cursor: pointer;
    }

/* Mikro-Button: Spracheingabe in die Beschreibung diktieren */
.ql-toolbar button.ql-mic {
    width: 28px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

    .ql-toolbar button.ql-mic.ql-mic-recording {
        color: #dc3545;
        animation: ql-mic-pulse 1.2s ease-in-out infinite;
    }

@keyframes ql-mic-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: .35; }
}

/* ── Editor im Dark Mode (nur Farben) ─────────────────────────────────────── */
[data-bs-theme="dark"] .quill-editor-container { background: var(--bs-body-bg); }

[data-bs-theme="dark"] .ql-toolbar.ql-snow,
[data-bs-theme="dark"] .ql-container.ql-snow { border-color: var(--bs-border-color); }

[data-bs-theme="dark"] .ql-editor { color: var(--bs-body-color); }
[data-bs-theme="dark"] .ql-editor.ql-blank::before { color: #6b7488; }

[data-bs-theme="dark"] .ql-snow .ql-stroke { stroke: #c2c9d8; }
[data-bs-theme="dark"] .ql-snow .ql-fill   { fill: #c2c9d8; }
[data-bs-theme="dark"] .ql-snow .ql-picker { color: #c2c9d8; }

[data-bs-theme="dark"] .ql-snow .ql-picker-options {
    background: var(--bs-body-bg);
    border-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .ql-snow.ql-toolbar button:hover .ql-stroke,
[data-bs-theme="dark"] .ql-snow.ql-toolbar button.ql-active .ql-stroke { stroke: #fff; }
[data-bs-theme="dark"] .ql-snow.ql-toolbar button:hover .ql-fill,
[data-bs-theme="dark"] .ql-snow.ql-toolbar button.ql-active .ql-fill   { fill: #fff; }

[data-bs-theme="dark"] .ql-snow .ql-color-picker .ql-picker-item {
    border-color: rgba(255,255,255,.25) !important;
}

[data-bs-theme="dark"] .ql-snow .ql-color-picker .ql-picker-item:hover,
[data-bs-theme="dark"] .ql-snow .ql-color-picker .ql-picker-item.ql-selected {
    border-color: #fff !important;
}

[data-bs-theme="dark"] .ql-snow .ql-color-picker .ql-picker-item:not([data-value]) {
    color: var(--bs-body-color);
}

[data-bs-theme="dark"] .ql-snow .ql-color-picker .ql-quick-colors {
    border-top-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .ql-snow .ql-color-picker .ql-quick-color {
    border-color: rgba(255,255,255,.25);
}

    [data-bs-theme="dark"] .ql-snow .ql-color-picker .ql-quick-color:hover { border-color: #fff; }

/* ══════════════════════════════════════════════════════════════════════════
   ANHÄNGE – DRAG & DROP
   ══════════════════════════════════════════════════════════════════════════ */
.attachment-dropzone {
    border: 2px dashed var(--bs-border-color);
    border-radius: 10px;
    background: var(--bs-tertiary-bg);
    padding: 1rem;
    cursor: pointer;
    transition: border-color .15s, background-color .15s;
}
.attachment-dropzone:hover { border-color: var(--bs-primary); }

.attachment-dropzone.is-dragover {
    border-color: var(--bs-primary);
    background: rgba(13,110,253,.08);
}

.attachment-dropzone.is-over-quota { border-color: var(--bs-danger); }

.attachment-dropzone-prompt {
    text-align: center;
    color: var(--bs-secondary-color);
    font-size: .875rem;
    pointer-events: none;
}
.attachment-dropzone-prompt .fa-cloud-arrow-up { font-size: 1.5rem; display: block; margin-bottom: .35rem; }

.attachment-dropzone-list { list-style: none; margin: 0; padding: 0; }
.attachment-dropzone-list:not(:empty) { margin-top: .75rem; }

.attachment-item {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .3rem .5rem;
    border-radius: 6px;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    font-size: .8rem;
}
.attachment-item + .attachment-item { margin-top: .25rem; }
.attachment-item-name   { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-item-size   { flex: 0 0 auto; color: var(--bs-secondary-color); font-variant-numeric: tabular-nums; }
.attachment-item-remove {
    flex: 0 0 auto;
    border: none;
    background: none;
    color: var(--bs-danger);
    line-height: 1;
    padding: .1rem .25rem;
    cursor: pointer;
}

.attachment-dropzone-meter { font-variant-numeric: tabular-nums; }

/* ══════════════════════════════════════════════════════════════════════════
   NOTIZEN – zweispaltiges Layout (Liste links, Editor rechts)
   ══════════════════════════════════════════════════════════════════════════ */
.notes-shell {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

/* ── Linke Spalte ─────────────────────────────────────────────────────────── */
.notes-sidebar {
    flex: 0 0 320px;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 14px;
    box-shadow: 0 1px 6px rgba(0,0,0,.06);
    overflow: hidden;
}

.notes-sidebar-head {
    padding: .75rem;
    border-bottom: 1px solid var(--bs-border-color);
}

.notes-search { position: relative; }

.notes-search input {
    padding-left: 2rem;
    padding-right: 2rem;
    border-radius: 8px;
}

.notes-search-icon {
    position: absolute;
    left: .65rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: var(--bs-secondary-color);
    pointer-events: none;
}

/* KI-Knopf im Suchfeld – nur sichtbar, wenn die KI-Funktion für diesen Benutzer
   freigeschaltet ist (siehe Model.HasAiAccess in Notes/Index.cshtml). */
.notes-search-ai-btn {
    position: absolute;
    right: .3rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.6rem;
    height: 1.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #6366f1;
    font-size: .8rem;
    cursor: pointer;
    transition: background-color .15s;
}

    .notes-search-ai-btn:hover { background: rgba(99,102,241,.12); }

.notes-sidebar-body {
    overflow-y: auto;
    max-height: calc(100vh - 260px);
    padding: .5rem;
}

.notes-group-title {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--bs-secondary-color);
    padding: .5rem .5rem .25rem;
}

.notes-item {
    display: block;
    padding: .55rem .65rem;
    margin-bottom: .25rem;
    border-radius: 10px;
    border-left: 3px solid transparent;
    text-decoration: none;
    color: inherit;
    transition: background-color .12s, border-color .12s;
}

    .notes-item:hover { background: var(--bs-tertiary-bg); }

    .notes-item.active {
        background: rgba(13,110,253,.09);
        border-left-color: var(--bs-primary);
    }

.notes-item-title {
    display: flex;
    align-items: center;
    gap: .35rem;
    font-size: .875rem;
    font-weight: 600;
    min-width: 0;
}

.notes-item-pin {
    font-size: 10px;
    color: var(--bs-warning);
    flex-shrink: 0;
}

.notes-item-snippet {
    font-size: 11px;
    color: var(--bs-secondary-color);
    margin-top: .15rem;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.notes-item-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .35rem;
    margin-top: .3rem;
    font-size: 10px;
    color: var(--bs-secondary-color);
}

.notes-chip {
    display: inline-flex;
    align-items: center;
    gap: .2rem;
    padding: .05rem .35rem;
    border-radius: 99px;
    background: var(--bs-tertiary-bg);
    border: 1px solid var(--bs-border-color);
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notes-empty-list {
    text-align: center;
    padding: 2rem .75rem;
    font-size: .8rem;
    color: var(--bs-secondary-color);
}

    .notes-empty-list i { font-size: 1.6rem; opacity: .35; }

/* ── Rechte Spalte ────────────────────────────────────────────────────────── */
.notes-editor {
    flex: 1 1 auto;
    min-width: 0;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 14px;
    box-shadow: 0 1px 6px rgba(0,0,0,.06);
    padding: 1.25rem;
}

.notes-editor-head {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: .5rem;
}

/* Titel wirkt wie eine Überschrift, wird erst beim Fokus als Feld erkennbar */
.notes-title-input {
    flex: 1 1 auto;
    min-width: 0;
    border: 1px solid transparent;
    background: transparent;
    color: inherit;
    font-size: 1.25rem;
    font-weight: 700;
    padding: .25rem .5rem;
    border-radius: 8px;
}

    .notes-title-input:hover:not([readonly]) { border-color: var(--bs-border-color); }

    .notes-title-input:focus {
        outline: none;
        border-color: var(--bs-primary);
        background: var(--bs-body-bg);
    }

    .notes-title-input[readonly] { cursor: default; }

.notes-actions {
    display: flex;
    gap: .4rem;
    flex-shrink: 0;
}

.notes-share-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    padding: .5rem .75rem;
    margin-bottom: .75rem;
    border-radius: 10px;
    background: var(--bs-tertiary-bg);
    border: 1px solid var(--bs-border-color);
}

.notes-share-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--bs-secondary-color);
}

.notes-share-select { width: auto; min-width: 170px; }

.notes-readonly { min-height: 340px; }

.notes-footer-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: .75rem;
    margin-top: .75rem;
    font-size: 11px;
    color: var(--bs-secondary-color);
}

.notes-warning {
    flex: 1 1 340px;
    max-width: 520px;
    text-align: right;
    color: var(--bs-warning-text-emphasis, #997404);
}

.notes-empty-state {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--bs-secondary-color);
}

    .notes-empty-state i { font-size: 2.5rem; opacity: .3; }

/* ── Dark Mode ────────────────────────────────────────────────────────────── */
[data-bs-theme="dark"] .notes-sidebar,
[data-bs-theme="dark"] .notes-editor { box-shadow: 0 1px 6px rgba(0,0,0,.45); }

[data-bs-theme="dark"] .notes-item.active { background: rgba(13,110,253,.18); }

[data-bs-theme="dark"] .notes-warning { color: #e0b64d; }

/* ── Mobil: Spalten untereinander ─────────────────────────────────────────── */
@media (max-width: 991.98px) {
    .notes-shell { flex-direction: column; }

    .notes-sidebar {
        flex: 1 1 auto;
        max-width: 100%;
        width: 100%;
    }

    .notes-sidebar-body { max-height: 320px; }

    .notes-editor { width: 100%; }
}

/* ══════════════════════════════════════════════════════════════════════════
   STRG+K-SCHNELLSUCHE (Design nach Vorbild "Memora") – Pages/Shared/_Layout.cshtml
   + wwwroot/js/command-palette.js. Eigene Indigo-Akzentfarbe wie im Original,
   Flächen/Rahmen/Text über Bootstrap-Variablen, damit Darkmode automatisch passt.
   ══════════════════════════════════════════════════════════════════════════ */
.cmd-palette-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 15, 30, .5);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 10vh;
    z-index: 1090;
}

.cmd-palette-panel {
    width: min(600px, 92vw);
    max-height: 70vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0,0,0,.35);
}

.cmd-palette-panel kbd,
.cmd-palette-kbd-hint {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.3rem;
    padding: .1rem .4rem;
    border-radius: 5px;
    background: var(--bs-tertiary-bg);
    border: 1px solid var(--bs-border-color);
    box-shadow: 0 1px 0 var(--bs-border-color);
    font-size: .72rem;
    color: var(--bs-secondary-color);
}

.cmd-palette-input-row {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .2rem 1.1rem;
    border-bottom: 1px solid var(--bs-border-color);
}

.cmd-palette-input-icon { color: var(--bs-secondary-color); flex-shrink: 0; }

.cmd-palette-input {
    flex: 1 1 auto;
    padding: .95rem 0;
    font-size: 1.1rem;
    border: none;
    outline: none;
    background: none;
    color: var(--bs-body-color);
}

.cmd-palette-esc {
    cursor: pointer;
    flex-shrink: 0;
}

.cmd-palette-results {
    overflow-y: auto;
    padding: .5rem;
    min-height: 8rem;
}

.cmd-palette-result {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    padding: .55rem .75rem;
    border-radius: 8px;
    border-left: 3px solid transparent;
    text-decoration: none;
    color: inherit;
}

    .cmd-palette-result:hover,
    .cmd-palette-result.active {
        background: rgba(99,102,241,.09);
        border-left-color: #6366f1;
    }

.cmd-palette-result-icon {
    margin-top: .2rem;
    color: #6366f1;
    flex-shrink: 0;
    width: 1rem;
    text-align: center;
}

.cmd-palette-result-body { min-width: 0; flex: 1 1 auto; }

.cmd-palette-result-title {
    font-weight: 600;
    font-size: .92rem;
    display: flex;
    align-items: center;
    gap: .4rem;
}

.cmd-palette-pin { font-size: 11px; color: var(--bs-warning); }

.cmd-palette-badge {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: .1rem .4rem;
    border-radius: 999px;
    background: var(--bs-tertiary-bg);
    color: var(--bs-secondary-color);
}

.cmd-palette-result-snippet {
    font-size: .8rem;
    color: var(--bs-secondary-color);
    margin-top: .15rem;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

    .cmd-palette-result-snippet mark {
        background: rgba(99,102,241,.25);
        color: inherit;
        border-radius: 3px;
    }

.cmd-palette-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: .85rem;
    padding: 2.25rem 1.5rem;
    color: var(--bs-secondary-color);
}

.cmd-palette-empty-icon { font-size: 1.8rem; color: #6366f1; opacity: .55; }
.cmd-palette-empty p { margin: 0; font-size: .9rem; }

.cmd-palette-tips { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; }

.cmd-palette-tip {
    font-size: .78rem;
    color: var(--bs-secondary-color);
    background: var(--bs-tertiary-bg);
    border-radius: 999px;
    padding: .25rem .7rem;
}

.cmd-palette-footer {
    display: flex;
    gap: 1.25rem;
    padding: .6rem 1.1rem;
    border-top: 1px solid var(--bs-border-color);
    color: var(--bs-secondary-color);
    font-size: .78rem;
}

    .cmd-palette-footer span { display: inline-flex; align-items: center; gap: .4rem; }

.cmd-palette-kbd-hint {
    font-size: .68rem;
    padding: .05rem .35rem;
    opacity: .75;
}

[data-bs-theme="dark"] .cmd-palette-panel { box-shadow: 0 20px 60px rgba(0,0,0,.6); }

/* ══════════════════════════════════════════════════════════════════════════
   KI-WISSENSSUCHE – jetzt Teil von /Notes statt einer eigenen Seite: der
   Strg+K-Schnellsuche optisch nachempfundenes Overlay (siehe notes-ai-panel-
   Block unten) + der Nachrichtenverlauf (.ai-msg-*), verdrahtet über
   wwwroot/js/notes-ai-search.js.
   ══════════════════════════════════════════════════════════════════════════ */
.ai-chat-messages {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.notes-ai-messages { min-height: 8rem; }

.ai-chat-empty {
    margin: auto;
    text-align: center;
    color: var(--bs-secondary-color);
    max-width: 420px;
}

    .ai-chat-empty i { font-size: 2rem; opacity: .35; margin-bottom: .5rem; }

.ai-chat-tips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .5rem;
    margin-top: .75rem;
}

.ai-chat-tip {
    font-size: .78rem;
    padding: .3rem .7rem;
    border-radius: 999px;
    background: var(--bs-tertiary-bg);
    border: 1px solid var(--bs-border-color);
    color: var(--bs-secondary-color);
    cursor: pointer;
    transition: background-color .15s, color .15s, border-color .15s;
}

.ai-chat-tip:hover,
.ai-chat-tip:focus-visible {
    background: var(--bs-primary);
    border-color: var(--bs-primary);
    color: #fff;
}

.ai-msg-user {
    align-self: flex-end;
    max-width: 80%;
    background: var(--bs-primary);
    color: #fff;
    padding: .55rem .9rem;
    border-radius: 14px 14px 4px 14px;
    font-size: .92rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.ai-msg-assistant {
    align-self: flex-start;
    max-width: 85%;
    display: flex;
    flex-direction: column;
    gap: .4rem;
}

.ai-msg-bubble {
    background: var(--bs-tertiary-bg);
    border: 1px solid var(--bs-border-color);
    padding: .6rem .9rem;
    border-radius: 14px 14px 14px 4px;
    font-size: .92rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.ai-msg-error .ai-msg-bubble {
    color: var(--bs-danger);
    border-color: rgba(220,53,69,.35);
    background: rgba(220,53,69,.07);
}

.ai-msg-typing { display: inline-flex; gap: 4px; align-items: center; }

.ai-msg-typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--bs-secondary-color);
    animation: ai-typing-bounce 1.1s infinite ease-in-out;
}

    .ai-msg-typing span:nth-child(2) { animation-delay: .15s; }
    .ai-msg-typing span:nth-child(3) { animation-delay: .3s; }

@keyframes ai-typing-bounce {
    0%, 80%, 100% { transform: translateY(0); opacity: .4; }
    40% { transform: translateY(-4px); opacity: 1; }
}

.ai-msg-timer {
    font-size: .76rem;
    color: var(--bs-secondary-color);
    padding-left: .2rem;
}

    .ai-msg-timer:empty { display: none; }

.ai-msg-sources-wrap {
    border-top: 1px solid var(--bs-border-color);
    padding-top: .5rem;
    margin-top: .2rem;
}

.ai-msg-sources-label {
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--bs-secondary-color);
    margin-bottom: .3rem;
}

.ai-msg-sources-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ai-msg-sources-list li {
    border-bottom: 1px solid var(--bs-border-color);
}

    .ai-msg-sources-list li:last-child { border-bottom: none; }

.ai-msg-sources-list a {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .4rem 0;
    font-size: .85rem;
    color: var(--bs-body-color);
    text-decoration: none;
}

    .ai-msg-sources-list a:hover { color: var(--bs-primary); }

    .ai-msg-sources-list a i {
        color: var(--bs-secondary-color);
        width: 1em;
        text-align: center;
        flex-shrink: 0;
    }

/* ══════════════════════════════════════════════════════════════════════════
   BILD-LIGHTBOX mit Zoom & Verschieben
   Gehört zu wwwroot/js/image-lightbox.js + Pages/Shared/_ImageLightbox.cshtml
   ══════════════════════════════════════════════════════════════════════════ */
.lightbox-stage {
    position: relative;   /* Bezugspunkt für offsetLeft/offsetTop des Bildes */
    overflow: hidden;     /* gezoomtes Bild wird beschnitten statt zu überlaufen */
    height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: .5rem;
    background: rgba(0,0,0,.35);
    touch-action: none;
}

.lightbox-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transform-origin: 0 0;  /* macht die Zoom-Mathematik am Cursor eindeutig */
    cursor: zoom-in;
    user-select: none;
    -webkit-user-drag: none;
    will-change: transform;
}

    .lightbox-img.is-zoomed  { cursor: grab; }
    .lightbox-img.is-panning { cursor: grabbing; }

.lightbox-hint {
    text-align: center;
    margin-top: .5rem;
    font-size: 11px;
    color: rgba(255,255,255,.75);
    text-shadow: 0 1px 2px rgba(0,0,0,.6);
}

/* Bilder in gerenderten Beschreibungen/Notizen sind anklickbar */
.task-description img { cursor: zoom-in; }

/* Lupe im Bild-Overlay des Editors – gleiche Optik wie der Löschen-Button */
.ql-img-zoom {
    display: none;
    position: fixed;
    z-index: 10000;
    width: 22px;
    height: 22px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(0,0,0,.65);
    color: #fff;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

/* Status des automatischen Speicherns in der Notiz-Kopfzeile */
.notes-autosave {
    font-size: 11px;
    white-space: nowrap;
    align-self: center;
    color: var(--bs-secondary-color);
}

    .notes-autosave[data-state="pending"] { color: var(--bs-warning-text-emphasis, #997404); }
    .notes-autosave[data-state="error"]   { color: var(--bs-danger); font-weight: 600; }

[data-bs-theme="dark"] .notes-autosave[data-state="pending"] { color: #e0b64d; }

/* Rot hervorgehobener Kasten im einmaligen Datenschutzhinweis */
.privacy-notice-highlight {
    border: 1px solid var(--bs-danger);
    border-left-width: 4px;
    border-radius: 8px;
    padding: .65rem .85rem;
    background: rgba(220, 53, 69, .06);
    font-size: .9rem;
    line-height: 1.5;
}

[data-bs-theme="dark"] .privacy-notice-highlight { background: rgba(220, 53, 69, .12); }

/* Grün hervorgehobener Kasten im Hinweisdialog (Gegenstück zum roten) */
.privacy-notice-ok {
    border: 1px solid var(--bs-success);
    border-left-width: 4px;
    border-radius: 8px;
    padding: .65rem .85rem;
    background: rgba(25, 135, 84, .06);
    font-size: .9rem;
    line-height: 1.5;
}

[data-bs-theme="dark"] .privacy-notice-ok { background: rgba(25, 135, 84, .14); }

/* Hinweis in der Notiz-Fußzeile */
.notes-encrypted {
    flex: 1 1 340px;
    max-width: 520px;
    text-align: right;
    color: var(--bs-success-text-emphasis, #0f5132);
}

[data-bs-theme="dark"] .notes-encrypted { color: #75c68f; }

/* ══════════════════════════════════════════════════════════════════════════
   RECHTLICHE SEITEN (Impressum, Datenschutz)
   Eigene Fläche statt der dunklen Login-Optik: Diese Seiten haben Überschriften
   außerhalb von Karten, die sonst je nach Theme unlesbar auf dem Hintergrund
   stünden.
   ══════════════════════════════════════════════════════════════════════════ */
.auth-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #1a1d2e;
}

.plain-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #f4f6fb;
    color: var(--bs-body-color);
}

[data-bs-theme="dark"] .plain-shell { background: var(--app-bg); }

/* Footer auf den rechtlichen Seiten – gleiche Anordnung wie im Login-Footer,
   aber mit themefähigen Farben statt der hellen Schrift auf Dunkelblau. */
.plain-footer {
    text-align: center;
    padding: 10px 0 14px;
    font-size: 11px;
    flex-shrink: 0;
    letter-spacing: .02em;
}

    .plain-footer a { text-decoration: none; }
    .plain-footer a:hover { text-decoration: underline; }
    .plain-footer .text-muted + .text-muted { margin: 0 .6rem; }

/* ── Sprachumschalter ───────────────────────────────────────────────────── */
.lang-toggle {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    line-height: 1;
}

.lang-toggle .lang-code {
    font-weight: 600;
    letter-spacing: .03em;
}

/* Der Standardpfeil von Bootstrap sitzt sonst zu weit weg vom Kürzel */
.lang-toggle.dropdown-toggle::after {
    margin-left: 0;
}

.lang-menu {
    min-width: 11rem;
    padding: .35rem;
}

.lang-item {
    display: flex;
    align-items: center;
    gap: .6rem;
    border-radius: .375rem;
    padding: .45rem .6rem;
}

/* Die weißen Streifen der US-Flagge verschwinden sonst auf hellem Grund */
.lang-flag {
    flex-shrink: 0;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .25);
}

.lang-inline-link {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}

/* ── Ablegen auf dem Startbildschirm ────────────────────────────────────── */

/* Streifen unten (Android). Standardmäßig aus dem Bild geschoben, damit er
   nicht kurz aufblitzt, bevor das Skript entschieden hat. */
.pwa-banner {
    position: fixed;
    left: .75rem;
    right: .75rem;
    bottom: calc(.75rem + env(safe-area-inset-bottom));
    z-index: 1085;
    display: none;
    align-items: center;
    gap: .75rem;
    padding: .75rem;
    border-radius: .75rem;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    box-shadow: 0 .5rem 1.5rem rgba(0, 0, 0, .18);
}

.pwa-banner.is-visible {
    display: flex;
    animation: pwa-slide-up .25s ease-out;
}

@keyframes pwa-slide-up {
    from { transform: translateY(1rem); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.pwa-banner-icon {
    border-radius: .5rem;
    flex-shrink: 0;
}

.pwa-banner-text {
    flex: 1 1 auto;
    min-width: 0;
    line-height: 1.25;
}

/* Overlay (iPhone) */
.pwa-sheet {
    position: fixed;
    inset: 0;
    z-index: 1090;
    display: none;
    align-items: flex-end;
    justify-content: center;
    padding: 1rem;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom));
    background: rgba(0, 0, 0, .5);
}

.pwa-sheet.is-visible {
    display: flex;
    animation: pwa-fade-in .2s ease-out;
}

@keyframes pwa-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.pwa-sheet-card {
    position: relative;
    width: 100%;
    max-width: 26rem;
    padding: 1.5rem 1.25rem 1.25rem;
    border-radius: 1rem;
    background: var(--bs-body-bg);
    text-align: center;
    animation: pwa-slide-up .25s ease-out;
}

.pwa-sheet-close {
    position: absolute;
    top: .75rem;
    right: .75rem;
    font-size: .8rem;
}

.pwa-sheet-icon {
    border-radius: .75rem;
    margin-bottom: .75rem;
}

.pwa-steps {
    margin: 0;
    padding-left: 1.25rem;
    text-align: left;
    font-size: .9rem;
    line-height: 1.9;
}

/* Das Teilen-Symbol im Fließtext soll wie eine Taste wirken */
.pwa-share {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.6rem;
    height: 1.6rem;
    margin: 0 .15rem;
    border-radius: .35rem;
    background: var(--bs-primary);
    color: #fff;
    font-size: .8rem;
    vertical-align: -.35rem;
}

/* ── Reduced motion: safety net over every keyframe animation in this file ─── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
}
