/* ════════════════════════════════════════════════════════════════
   gantt_cost.css — Kosten-UI (Editor-Modal, Popup, Side-Sheet, Button)
   Mobile/Tablet/Desktop optimiert. Orientierung an calendar.css Sheet-
   Patterns + gantt.css Editor-Patterns.
   ════════════════════════════════════════════════════════════════ */

/* ─── Editor-Modal: Kosten-Zeile ───────────────────────────────── */
.editor-cost-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.editor-cost-input-wrap {
    display: flex;
    gap: 8px;
    align-items: stretch;
}
.editor-cost-amount {
    flex: 1 1 auto;
    min-width: 0;
    /* Kein Spinner-Pfeil — sieht im Modal sauberer aus */
    -moz-appearance: textfield;
}
.editor-cost-amount::-webkit-outer-spin-button,
.editor-cost-amount::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.editor-cost-currency {
    flex: 0 0 auto;
    max-width: 110px;
    padding-right: 10px !important;
    cursor: pointer;
    background-color: rgba(255, 255, 255, 0.5);
}

/* ─── Toolbar-Button "Kostenüberblick" ───────────────────────────
   Optisch konsistent zu .gantt-zoom-export-btn / -fit-btn / -today-btn:
   gleicher Tint + Border + Radius + Padding + Typo. So fügt sich der
   Button in die Button-Gruppe ein statt visuell rauszuspringen. */
.gantt-zoom-cost-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    background: rgba(79, 103, 115, 0.1);
    border: 1px solid rgba(79, 103, 115, 0.18);
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    font-family: inherit;
    color: rgb(56 71 79);
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s;
    touch-action: manipulation;
    white-space: nowrap;
}
.gantt-zoom-cost-btn:hover  { background: rgba(79, 103, 115, 0.2); }
.gantt-zoom-cost-btn:active { background: rgba(79, 103, 115, 0.32); }
.gantt-zoom-cost-btn svg {
    width: 13px;
    height: 13px;
    fill: rgb(56 71 79);
    pointer-events: none;
}
@media (max-width: 480px) {
    .gantt-zoom-cost-btn span { display: none; }
    .gantt-zoom-cost-btn { padding: 5px 7px; }
}

/* Theme-Overrides — Textfarbe folgt der Nachbargruppe, SVG-Fill via Currentcolor */
[data-theme="white"] .gantt-zoom-cost-btn      { color: rgba(26,26,46,0.70) !important; }
[data-theme="white"] .gantt-zoom-cost-btn svg  { fill: currentColor; }
[data-theme="dark"]  .gantt-zoom-cost-btn      {
    color: rgba(205,213,224,0.70) !important;
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.08);
}
[data-theme="dark"]  .gantt-zoom-cost-btn:hover  { background: rgba(255,255,255,0.12); }
[data-theme="dark"]  .gantt-zoom-cost-btn:active { background: rgba(255,255,255,0.18); }
[data-theme="dark"]  .gantt-zoom-cost-btn svg   { fill: currentColor; }

/* ─── Popup: Kosten-Inline-Edit ────────────────────────────────── */
.tip-row-cost {
    align-items: center;
}
.tip-cost-wrap {
    display: flex;
    align-items: stretch;
    gap: 0;
    flex: 1;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 7px;
    overflow: hidden;
    transition: border-color 0.15s, background 0.15s;
}
.tip-cost-wrap:focus-within {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.35);
}
.tip-cost-input {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: 0;
    outline: 0;
    color: white;
    font: inherit;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    text-align: right;
    -moz-appearance: textfield;
}
.tip-cost-input::-webkit-outer-spin-button,
.tip-cost-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.tip-cost-input::placeholder { color: rgba(255, 255, 255, 0.35); }
.tip-cost-cur {
    padding: 4px 8px 4px 6px;
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.55);
    background: rgba(255, 255, 255, 0.06);
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    align-self: stretch;
    display: flex;
    align-items: center;
    user-select: none;
}

/* ── Popup-Kosten-Zeile im White-Mode ───────────────────────────
   Das Popup hat im White-Mode einen hellen Hintergrund (rgba(255,255,255,0.97)).
   Default-Styles oben sind für den dunklen Glass-Look gedacht (weißer Text auf
   weißer Box → unsichtbar). Hier dunkle Inverse-Variante. */
[data-theme="white"] .tip-cost-wrap {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.10);
}
[data-theme="white"] .tip-cost-wrap:focus-within {
    background: rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 122, 255, 0.45);
}
[data-theme="white"] .tip-cost-input {
    color: #1A1A2E;
}
[data-theme="white"] .tip-cost-input::placeholder {
    color: rgba(26, 26, 46, 0.35);
}
[data-theme="white"] .tip-cost-cur {
    color: rgba(26, 26, 46, 0.60);
    background: rgba(0, 0, 0, 0.04);
    border-left-color: rgba(0, 0, 0, 0.07);
}

/* ════════════════════════════════════════════════════════════════
   Side-Sheet "Kostenüberblick"
   ──────────────────────────────────────────────────────────────── */
.cost-sheet-overlay {
    position: fixed;
    inset: 0;
    z-index: 3100;
    display: none;
    align-items: stretch;
    justify-content: flex-end;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 20px;
}
.cost-sheet-overlay.open {
    display: flex;
    animation: costOverlayIn 0.2s ease-out;
}
@keyframes costOverlayIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
/* Backdrop fadet beim Schließen aus — gilt für zentriertes Modal (Desktop-
   Fallback ohne as-sheet) und für den Mobile-Bottom-Sheet. Im as-sheet-Modus
   ist das Overlay transparent, dort gilt stattdessen costSheetOut oben. */
.cost-sheet-overlay.closing:not(.as-sheet) {
    animation: costOverlayOut 0.28s ease-out forwards;
}
@keyframes costOverlayOut {
    from { opacity: 1; }
    to   { opacity: 0; }
}

.cost-sheet {
    position: relative;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    border-radius: 20px;
    width: 100%;
    max-width: 460px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: costSheetCenterIn 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
    color: #1a1a2e;
}
@keyframes costSheetCenterIn {
    from { opacity: 0; transform: scale(0.94) translateY(12px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ─── Side-Sheet-Modus (Desktop + Tablet Landscape ≥ 900px) ────── */
.cost-sheet-overlay.as-sheet {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    pointer-events: none;
    inset: var(--cost-sheet-top, 80px) 16px var(--cost-sheet-bottom, 16px) auto;
    width: 440px;
    padding: 0;
    align-items: stretch;
    justify-content: flex-end;
}
.cost-sheet-overlay.as-sheet.open {
    animation: costSheetIn 0.28s cubic-bezier(0.32, 0.72, 0.0, 1);
}
@keyframes costSheetIn {
    from { transform: translateX(100%); opacity: 0.7; }
    to   { transform: translateX(0);    opacity: 1;   }
}
/* Schließen spiegelt das Öffnen: das ganze Sheet wischt nach rechts raus.
   Wichtig: .open bleibt während der Schließen-Animation gesetzt, damit
   display:flex erhalten bleibt — sonst würde das Element direkt verschwinden. */
.cost-sheet-overlay.as-sheet.closing {
    animation: costSheetOut 0.28s cubic-bezier(0.32, 0.72, 0.0, 1) forwards;
}
@keyframes costSheetOut {
    from { transform: translateX(0);    opacity: 1;   }
    to   { transform: translateX(100%); opacity: 0;   }
}
.cost-sheet-overlay.as-sheet .cost-sheet {
    pointer-events: auto;
    width: 100%;
    max-width: 100%;
    height: 100%;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow: 0 4px 24px rgba(30, 60, 120, 0.10), 0 1px 0 rgba(255, 255, 255, 0.7) inset;
    animation: none;
}

/* ─── Header ───────────────────────────────────────────────────── */
.cost-sheet-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 18px 14px;
    border-bottom: 1px solid rgba(79, 103, 115, 0.10);
    flex-shrink: 0;
}
.cost-sheet-titlewrap {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.cost-sheet-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--accent-blue);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.cost-sheet-title {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.3px;
    margin: 0;
    color: #1a1a2e;
}
.cost-sheet-sub {
    font-size: 11.5px;
    color: rgba(26, 26, 46, 0.55);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 280px;
}
.cost-sheet-close {
    width: 32px;
    height: 32px;
    border: 0;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 50%;
    color: rgba(26, 26, 46, 0.6);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}
.cost-sheet-close:hover { background: rgba(0, 0, 0, 0.1); color: #1a1a2e; }

/* ─── Totals (Karten je Währung) ───────────────────────────────── */
.cost-sheet-totals {
    display: flex;
    gap: 10px;
    padding: 14px 18px 4px;
    overflow-x: auto;
    flex-shrink: 0;
    scrollbar-width: none;
}
.cost-sheet-totals::-webkit-scrollbar { display: none; }
.cost-total-card {
    flex: 1 0 auto;
    min-width: 140px;
    background: #e0dde65e;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 12px;
    padding: 12px 14px;
}
.cost-total-card.cost-total-empty {
    background: rgba(0, 0, 0, 0.04);
    border-style: dashed;
}
.cost-total-label {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: rgba(26, 26, 46, 0.55);
    margin-bottom: 4px;
}
.cost-total-value {
    font-size: 22px;
    font-weight: 900;
    color: #1a1a2e;
    letter-spacing: -0.5px;
    line-height: 1.1;
}
.cost-total-meta {
    font-size: 11px;
    color: rgba(26, 26, 46, 0.5);
    margin-top: 3px;
}

/* ─── Stats (Anteil mit/ohne + Durchschnitt) ──────────────────── */
.cost-sheet-stats {
    padding: 8px 18px 10px;
    flex-shrink: 0;
}
.cost-sheet-stats:empty { display: none; }
.cost-stat-bar {
    height: 6px;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}
.cost-stat-bar-fill {
    height: 100%;
    background: var(--accent-blue);
    border-radius: 4px;
    transition: width 0.35s ease;
}
.cost-stat-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.cost-stat-chip {
    font-size: 11px;
    font-weight: 600;
    color: rgba(26, 26, 46, 0.7);
    background: rgba(0, 0, 0, 0.04);
    border-radius: 999px;
    padding: 4px 10px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}
.cost-stat-chip .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.cost-stat-chip .dot-with    { background: var(--accent-blue); }
.cost-stat-chip .dot-without { background: rgba(0, 0, 0, 0.18); }

/* ─── Liste ────────────────────────────────────────────────────── */
.cost-sheet-listhead {
    display: grid;
    grid-template-columns: 1fr 90px 100px;
    align-items: center;
    gap: 10px;
    padding: 10px 18px 6px;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: rgba(26, 26, 46, 0.4);
    border-top: 1px solid rgba(79, 103, 115, 0.08);
}
.cost-sheet-listhead > :nth-child(2) { text-align: right; }
.cost-sheet-listhead > :nth-child(3) { text-align: right; }

.cost-sheet-list {
    list-style: none;
    margin: 0;
    padding: 0 8px 18px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}
.cost-row {
    display: grid;
    grid-template-columns: 4px 1fr 90px 100px;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.12s;
}
/* Zebra-Striping — jede zweite Zeile bekommt einen leichten Grauton, damit
   sich Betrag und Aufgabe optisch zuordnen lassen, auch wenn die Liste lang
   wird. Hover/Focus überschreibt das Striping deutlich genug. */
.cost-row:nth-child(odd) {
    background: rgba(0, 0, 0, 0.035);
}
.cost-row:hover,
.cost-row:focus-visible {
    background: rgba(0, 0, 0, 0.08);
    outline: 0;
}
.cost-row-color {
    width: 4px;
    height: 36px;
    border-radius: 2px;
}
.cost-row-main { min-width: 0; }
.cost-row-title {
    font-size: 13px;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cost-row-group {
    font-size: 9.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(26, 26, 46, 0.4);
    background: rgba(0, 0, 0, 0.06);
    border-radius: 4px;
    padding: 1px 6px;
    margin-left: 6px;
    vertical-align: middle;
}
.cost-row-sub {
    font-size: 11px;
    color: rgba(26, 26, 46, 0.55);
    margin-top: 2px;
}
.cost-row-pct {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}
.cost-row-pct-bar {
    width: 80px;
    height: 4px;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 3px;
    overflow: hidden;
}
.cost-row-pct-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.35s ease;
}
.cost-row-pct-num {
    font-size: 10.5px;
    font-weight: 700;
    color: rgba(26, 26, 46, 0.6);
}
/* Der Betrag ist ein Button — ein Klick macht ihn direkt änderbar,
   ohne den Umweg über das Bearbeiten-Fenster der Aufgabe. */
.cost-row-amount {
    font-size: 14px;
    font-weight: 800;
    color: #1a1a2e;
    text-align: right;
    letter-spacing: -0.2px;
    white-space: nowrap;
    font-family: inherit;
    background: none;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 4px 8px;
    margin: -4px -8px;
    cursor: text;
    transition: background 0.13s, border-color 0.13s;
}
.cost-row-amount:hover {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.12);
}
.cost-row-amount:focus-visible {
    outline: 2px solid var(--accent-blue, #007aff);
    outline-offset: 1px;
}

/* Zustand während der Eingabe (eigene Klasse, damit Selektoren
   Anzeige und Eingabe sauber auseinanderhalten) */
.cost-row-amount-editing {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
    white-space: nowrap;
    border-radius: 8px;
    padding: 4px 8px;
    margin: -4px -8px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 122, 255, 0.55);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.14);
    cursor: auto;
}
.cost-row-amount-input {
    width: 84px;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    font-family: inherit;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: -0.2px;
    color: #1a1a2e;
    text-align: right;
    padding: 0;
    /* Spinner ausblenden — der Betrag wird getippt, nicht geklickt */
    -moz-appearance: textfield;
}
.cost-row-amount-input::-webkit-outer-spin-button,
.cost-row-amount-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cost-row-amount-input.is-invalid { color: #c0362c; }
.cost-row-amount-cur {
    font-size: 12px;
    font-weight: 700;
    opacity: 0.55;
    flex-shrink: 0;
}

@media (prefers-reduced-motion: reduce) {
    .cost-row-amount { transition: none; }
}

/* ─── Empty-State ──────────────────────────────────────────────── */
/* Der freie Platz gehört der Meldung, nicht der leeren Liste.
   ────────────────────────────────────────────────────────────────
   .cost-sheet-list trägt flex: 1 und streckte sich auch ohne einen
   einzigen Eintrag über die volle Höhe — die Meldung darunter klebte
   dadurch am unteren Rand. Ohne Inhalt gibt die Liste den Platz jetzt
   ab, und die Meldung nimmt ihn und zentriert sich darin.

   :empty greift genau dann, wenn die Liste wirklich keinen Knoten
   enthält. Das passt zum Verhalten der Anzeige: Im leeren Fall wird
   listEl.innerHTML auf '' gesetzt (gantt_cost_overview.js). */
/* Die leere Liste gibt auch ihren unteren Innenabstand ab — sonst
   säße die Meldung um dessen Höhe zu tief. */
.cost-sheet-list:empty { flex: 0 0 auto; padding-bottom: 0; }

.cost-sheet-empty {
    text-align: center;
    padding: 28px 24px 32px;
    color: rgba(26, 26, 46, 0.55);
}
.cost-sheet-empty:not([hidden]) {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* Gleich oben wie unten: Bei ungleicher Polsterung wäre der Block
       zwar mittig im Kasten, der sichtbare Text aber nicht. */
    padding: 24px;
}
.cost-sheet-empty-icon { font-size: 38px; margin-bottom: 10px; }
.cost-sheet-empty-title {
    font-size: 14px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 4px;
}
.cost-sheet-empty-text { font-size: 12px; line-height: 1.5; }

/* ─── Skeleton (Loading) ───────────────────────────────────────── */
.cost-skeleton-total {
    height: 78px;
    margin: 4px 0;
    border-radius: 12px;
    background: linear-gradient(90deg, rgba(0,0,0,0.04) 0%, rgba(0,0,0,0.08) 50%, rgba(0,0,0,0.04) 100%);
    background-size: 200% 100%;
    animation: costSkel 1.2s linear infinite;
    flex: 1;
}
.cost-skeleton-row {
    list-style: none;
    height: 52px;
    margin: 6px 0;
    border-radius: 10px;
    background: linear-gradient(90deg, rgba(0,0,0,0.04) 0%, rgba(0,0,0,0.08) 50%, rgba(0,0,0,0.04) 100%);
    background-size: 200% 100%;
    animation: costSkel 1.2s linear infinite;
}
@keyframes costSkel {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ════════════════════════════════════════════════════════════════
   Mobile / Tablet < 900px → Bottom-Sheet von unten
   ──────────────────────────────────────────────────────────────── */
@media (max-width: 899px) {
    .cost-sheet-overlay {
        align-items: flex-end;
        justify-content: center;
        padding: 0;
    }
    .cost-sheet-overlay.as-sheet {
        background: rgba(0, 0, 0, 0.4);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        pointer-events: auto;
        inset: 0;
        width: auto;
        padding: 0;
        align-items: flex-end;
        justify-content: center;
    }
    .cost-sheet {
        max-width: 100%;
        width: 100%;
        height: 88vh;
        max-height: 88vh;
        border-radius: 22px 22px 0 0;
        animation: costSheetUp 0.3s cubic-bezier(0.32, 0.72, 0.0, 1);
    }
    .cost-sheet-overlay.as-sheet .cost-sheet {
        max-width: 100%;
        width: 100%;
        height: 88vh;
        max-height: 88vh;
        border-radius: 22px 22px 0 0;
        border: 0;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.25);
        animation: costSheetUp 0.3s cubic-bezier(0.32, 0.72, 0.0, 1);
    }
    @keyframes costSheetUp {
        from { transform: translateY(100%); }
        to   { transform: translateY(0);    }
    }
    /* Mobile-Close: innerer Sheet wischt nach unten raus, Backdrop fadet
       parallel (costOverlayOut oben). Im as-sheet-Modus auf Mobile übernimmt
       der Backdrop wieder Klicks (siehe .as-sheet-Override), also sicher
       beides animieren. */
    .cost-sheet-overlay.closing .cost-sheet,
    .cost-sheet-overlay.as-sheet.closing .cost-sheet {
        animation: costSheetDown 0.3s cubic-bezier(0.32, 0.72, 0.0, 1) forwards;
    }
    @keyframes costSheetDown {
        from { transform: translateY(0);    }
        to   { transform: translateY(100%); }
    }
    /* Auf Mobile soll auch im as-sheet-Modus der Backdrop ausfaden, nicht der
       slide-right-Effekt vom Desktop greifen. */
    .cost-sheet-overlay.as-sheet.closing {
        animation: costOverlayOut 0.3s ease-out forwards;
    }
    /* Grip-Handle als Pseudoelement (kein zusätzliches HTML nötig) */
    .cost-sheet::before {
        content: '';
        display: block;
        width: 44px;
        height: 4px;
        border-radius: 3px;
        background: rgba(0, 0, 0, 0.18);
        margin: 8px auto 0;
        flex-shrink: 0;
    }
    .cost-sheet-header { padding-top: 8px; }
    .cost-sheet-totals { padding: 12px 14px 4px; }
    .cost-sheet-stats  { padding: 8px 14px 10px; }
    .cost-sheet-listhead { padding: 10px 14px 6px; }
    .cost-sheet-list { padding: 0 6px 22px; }
    .cost-total-card { min-width: 130px; }
    .cost-total-value { font-size: 19px; }
    .cost-row { grid-template-columns: 4px 1fr auto; gap: 10px; }
    .cost-row-pct { display: none; }   /* Spalte schmaler — Anteil rückt unter den Titel */
    .cost-row-title { white-space: normal; }
    /* Toolbar-Button Mobile: Label ausblenden, nur Icon */
    .gantt-zoom-cost-btn span { display: none; }
    .gantt-zoom-cost-btn { padding: 6px 8px; }
}

/* Tablet Portrait spezifisch: Anteil-Spalte zeigen, aber kompakter */
@media (min-width: 600px) and (max-width: 899px) {
    .cost-row { grid-template-columns: 4px 1fr 70px auto; }
    .cost-row-pct { display: flex; }
    .cost-row-pct-bar { width: 60px; }
}

/* Touch-Devices: Inputs ≥ 16px, sonst zoomed iOS rein */
@media (pointer: coarse) {
    .editor-cost-amount,
    .editor-cost-currency,
    .tip-cost-input { font-size: 16px; }
    .tip-cost-input { padding: 6px 10px; }
}

/* Dark-Theme-Anpassung (folgt der App-Konvention via [data-theme="dark"]) */
[data-theme="dark"] .cost-sheet {
    background: rgb(28 30 42);
    color: #e8eaf0;
	box-shadow: none !important;
}

/* White-Theme-Anpassung (folgt der App-Konvention via [data-theme="dark"]) */
[data-theme="white"] .cost-sheet {
    background: rgb(255 255 255);

}

[data-theme="dark"] .cost-total-label {
    color: rgb(255 255 255 / 0.7);
}

[data-theme="dark"] .cost-sheet-title,
[data-theme="dark"] .cost-row-title,
[data-theme="dark"] .cost-row-amount,
[data-theme="dark"] .cost-row-amount-input,
[data-theme="dark"] .cost-total-value,
[data-theme="dark"] .cost-sheet-empty-title { color: #f3f5fa; }

/* Betrag-Bearbeitung im dunklen Theme */
[data-theme="dark"] .cost-row-amount:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.18);
}
[data-theme="dark"] .cost-row-amount-editing {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(90, 160, 255, 0.65);
    box-shadow: 0 0 0 3px rgba(90, 160, 255, 0.18);
}
[data-theme="dark"] .cost-row-amount-input.is-invalid { color: #f0897c; }
[data-theme="dark"] .cost-sheet-sub,
[data-theme="dark"] .cost-row-sub,
[data-theme="dark"] .cost-stat-chip,
[data-theme="dark"] .cost-row-pct-num,
[data-theme="dark"] .cost-total-meta,
[data-theme="dark"] .cost-sheet-empty-text { color: rgba(243, 245, 250, 0.6); }
[data-theme="dark"] .cost-sheet-listhead { color: rgba(243, 245, 250, 0.45); border-top-color: rgba(255,255,255,0.08); }
[data-theme="dark"] .cost-sheet-header { border-bottom-color: rgba(255,255,255,0.08); }
[data-theme="dark"] .cost-row:nth-child(odd) { background: rgba(255,255,255,0.035); }
[data-theme="dark"] .cost-row:hover,
[data-theme="dark"] .cost-row:focus-visible { background: rgba(255,255,255,0.09); }
[data-theme="dark"] .cost-stat-bar,
[data-theme="dark"] .cost-row-pct-bar { background: rgba(255,255,255,0.08); }
[data-theme="dark"] .cost-total-card { border-color: rgba(255,255,255,0.12); }
[data-theme="dark"] .cost-stat-chip { background: rgba(255,255,255,0.06); }
[data-theme="dark"] .cost-sheet-close { background: rgba(255,255,255,0.08); color: rgba(243,245,250,0.7); }
[data-theme="dark"] .cost-sheet-close:hover { background: rgba(255,255,255,0.14); color: #fff; }

/* ════════════════════════════════════════════════════════════════
   Mobile-View (ganttMobileView) — Kostenüberblick-Button + Detail-Sheet
   ──────────────────────────────────────────────────────────────── */

/* Toolbar-Button in der Meta-Row, optisch identisch zum Export-Button */
.gmv-cost-btn {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border: 0;
    background: rgba(0, 0, 0, 0.10);
    color: #1A1A2E;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.1s, background 0.15s;
    -webkit-tap-highlight-color: transparent;
    padding: 0;
}
.gmv-cost-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
    pointer-events: none;
}
.gmv-cost-btn:active { transform: scale(0.92); background: rgba(0, 0, 0, 0.24); }

[data-theme="white"] .gmv-cost-btn { background: rgba(0, 0, 0, 0.06); color: #1A1A2E; }
[data-theme="white"] .gmv-cost-btn:active { background: rgba(0, 0, 0, 0.12); }
[data-theme="dark"] .gmv-cost-btn { background: rgba(255, 255, 255, 0.08); color: #E8EAF0; }
[data-theme="dark"] .gmv-cost-btn:active { background: rgba(255, 255, 255, 0.14); }

/* Detail-Sheet: Kosten-Zeile (nur Anzeige — Bearbeiten via Edit-Modal) */
.gmv-detail-cost-value {
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.1px;
}
.gmv-detail-cost-empty {
    color: rgba(26, 26, 46, 0.35);
    font-weight: 500;
}
[data-theme="dark"] .gmv-detail-cost-empty { color: rgba(232, 234, 240, 0.35); }
