/*
 * Aufbau von styles.css (Abschnitte mit [CSS-XX] suchen):
 * [CSS-01] Grundlagen und Layout
 * [CSS-02] Navigation und Bedienelemente
 * [CSS-03] Mobile Ansichten und Installation
 * [CSS-04] Seitenleiste und Reiseplanung
 * [CSS-05] Formulare und Reiseelemente
 * [CSS-06] Karte, Modale und Marker
 * [CSS-07] Statistiken und Accounts
 * [CSS-08] Drucken
 * [CSS-09] Startseite, Speichern und Laden
 * [CSS-10] KI-Assistent und Chat
 * [CSS-11] Reisecode und Speicherstatus
 * [CSS-12] Tagebuch und Wetter
 * [CSS-13] Transfers und Karteneinstellungen
 * [CSS-14] Bilder und Filter
 * [CSS-15] Suche und Darkmode
 * [CSS-16] Animationen
 *
 * Die Reihenfolge der Stilregeln ist Teil der Kaskade. Responsive Regeln
 * und spaetere Ueberschreibungen bleiben an ihrer wirksamen Position.
 */

/* ==================== [CSS-01] Grundlagen und Layout ==================== */

/* Reset und Basis-Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

:root {
    --header-height: 70px;
    --bottom-nav-height: 60px;
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --success-color: #4CAF50;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --border-radius: 8px;
    /* --touch-target-size: 44px; */
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.container {
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* Header */
header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 0.35rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    /* height: var(--header-height); */
    flex-shrink: 0;
    z-index: 10000;
    position: relative;
}

/* .header-left {
    flex: 0 0 auto;
} */

/* .header-left h1 {
    font-size: 1.4rem;
    font-weight: 600;
    margin: 0;
} */

/* .header-right {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 1rem;
} */

.trip-info-header {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 0 1rem;
    min-width: 0;
}

.trip-info-display {
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    backdrop-filter: blur(10px);
    position: relative;
    transition: all 0.2s ease;
}

.trip-info-display.clickable {
    cursor: pointer;
}

.trip-info-display.clickable:hover:where(.hover-enabled *) {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.edit-hint {
    display: block;
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 0.25rem;
    transition: opacity 0.2s ease;
}

.trip-info-display:hover:where(.hover-enabled *) .edit-hint {
    opacity: 1;
}

#tripNameDisplay {
    display: block;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.trip-dates {
    display: block;
    font-size: 0.9rem;
    opacity: 0.9;
    font-weight: 400;
}

header h1 {
    font-size: 1.8rem;
    font-weight: 600;
    line-height: 1.2;
}

.header-controls {
    display: flex;
    gap: 0.5rem;
}

/* ==================== [CSS-02] Navigation und Bedienelemente ==================== */

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background-color: #4CAF50;
    color: white;
}

.btn-primary:hover:where(.hover-enabled *) {
    background-color: #45a049;
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover:where(.hover-enabled *) {
    background-color: #5a6268;
}

.btn-outline {
    background-color: transparent;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-outline-center {
    background-color: transparent;
    color: #667eea;
    border: 2px solid #667eea;
    position: relative;
    width: 60%;
    left: 20%;
    margin-top: 5px;
}

.btn-outline-center2 {
    background-color: transparent;
    color: #667eea;
    border: 2px solid #667eea;
    position: relative;
    left: 30%;
    margin-top: 5px;
}

.btn-outline:hover:where(.hover-enabled *) {
    background-color: #667eea;
    color: white;
}

.btn-small {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
}

.btn-addCost {
    padding: 0.3rem 0.1rem !important;
    width: 1.5rem !important;
    height: 1.5rem !important;
    line-height: 0px !important;
}

.fixWidthBtn118 {
    width: 118px;
}

.fixWidthBtn102 {
    width: 102px;
}

.header-divider {
    margin: 0rem 1rem;
}

.icon {     /* Skaliert mit der font-size */
  height: 1.8em;
  width: auto; 
  vertical-align: middle;
}

header .header-left h1 {
    display: flex;
    align-items: center;
}

header .header-left .icon {
    height: 2.35em;
    margin-block: -0.275em;
    flex-shrink: 0;
}

.addMargin {
    margin-bottom: 1.5rem
}

.addMargin1 {
    margin-bottom: 1rem
}

.addMargin5 {
    margin-bottom: 0.5rem !important
}

/* Main Content */
.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    /* height: calc(100vh - var(--header-height)); */
}

/* Bottom Navigation */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e0e0e0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    height: var(--bottom-nav-height);
    padding: 0;
}

/* .bottom-nav {
    display: flex;
    justify-content: space-around;
    align-items: center;
} */

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    padding: 0.5rem 0.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: var(--touch-target-size);
    min-width: var(--touch-target-size);
    flex: 1;
    color: #666;
    text-decoration: none;
}

.bottom-nav-item:hover:where(.hover-enabled *),
.bottom-nav-item.active {
    color: var(--primary-color);
    background-color: rgba(102, 126, 234, 0.1);
}

.bottom-nav-item:disabled {
    color: #ccc;
    cursor: not-allowed;
}

.bottom-nav-item:disabled:hover:where(.hover-enabled *) {
    background-color: transparent;
}

.bottom-nav-icon {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

.bottom-nav-label {
    font-size: 0.7rem;
    font-weight: 500;
    text-align: center;
    line-height: 1;
}

/* Mobile Menu */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    backdrop-filter: blur(4px);
}

.mobile-menu-overlay.show {
    display: flex;
    align-items: flex-start;
}

.mobile-menu {
    background: white;
    /* width: 100%; */
    max-height: 90vh;
    max-height: 90dvh;
    border-radius: 0 0 16px 16px;
    overflow: hidden;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    right: 0;
    position: fixed;
}

.mobile-menu-overlay.show .mobile-menu {
    transform: translateY(0);
}

.hiddenDesktop {
    display: none !important;
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0rem 1rem;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.mobile-menu-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: #333;
}

.mobile-menu-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    color: #666;
    min-height: var(--touch-target-size);
    min-width: var(--touch-target-size);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-menu-content {
    max-height: calc(90vh - 41px);
    max-height: calc(90dvh - 41px);
    overflow-y: auto;
}

.mobile-menu-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.5rem 1rem;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s ease;
    min-height: var(--touch-target-size);
    font-size: 1rem;
    color: #333;
    height: 2.4rem;
}

.mobile-menu-item:hover:where(.hover-enabled *) {
    background-color: #f8f9fa;
}

.mobile-menu-item:disabled {
    color: #ccc;
    cursor: not-allowed;
}

.mobile-menu-innerItem {
    justify-content: space-between;
}

.mobile-menu-subsection{
    margin-left: 33%;
}

/* Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
    margin-left: 1rem;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.25);
    transition: 0.2s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.2s;
    border-radius: 50%;
}

.switch input:checked + .slider {
    background-color: #667eea;
}

.switch input:checked + .slider:before {
    transform: translateX(20px);
}

.mobile-menu-icon {
    font-size: 1.2rem;
    margin-right: 1rem;
    width: 1.5rem;
    text-align: center;
}

.mobile-menu-divider {
    height: 1px;
    background: #e0e0e0;
    margin: 0rem 1rem;
}

.menu-legal-footer {
    padding: 0 1rem 2px;
    text-align: center;
    line-height: 1;
}

.app-lock-message p.app-privacy-link {
    margin: .5rem 0 0;
    font-size: .8125rem;
}

.menu-legal-footer .privacy-text-link,
.app-privacy-link a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 .75rem;
    font-size: .8125rem;
    font-weight: 400;
    color: #595966;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: .2em;
}

.menu-legal-footer .privacy-text-link {
    min-height: 24px;
    font-size: .75rem;
    line-height: 1.25;
    text-decoration: none;
}

.menu-legal-footer .privacy-text-link:hover:where(.hover-enabled *) {
    text-decoration: underline;
}

.privacy-text-link:focus-visible,
.app-privacy-link a:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
    border-radius: 4px;
}

html[data-theme="dark"] .privacy-text-link,
html[data-theme="dark"] .app-privacy-link a {
    color: #c2c2cf;
}

.map-controls-tab {
    display: none;
}

/*
 * Die per JavaScript gewählte Handyansicht ist maßgeblich. Die Regeln stehen
 * bewusst außerhalb des Media-Queries, weil die angepasste Viewportbreite auf
 * manchen Mobilgeräten kurzzeitig von der CSS-Breite abweichen kann.
 */
#appContainer.mobile-view-sidebar .containerMap,
#appContainer.mobile-view-diary .containerMap {
    display: none !important;
}

#appContainer.mobile-view-map .sidebar {
    display: none !important;
}

#appContainer.mobile-view-travel .sidebar {
    display: none !important;
}

.travel-mode-view,
.bottom-nav-travel {
    display: none;
}

#appContainer.mobile-view-travel .travel-mode-view {
    position: relative;
    display: flex !important;
    flex-direction: column;
    flex: 0 0 auto;
    width: 425px;
    height: 100%;
    min-width: 300px;
    max-width: 1000px;
    overflow: visible;
    padding: 1.5rem;
    padding-right: 0.5rem;
    --sidebar-scrollbar-gap: 0.5rem;
    border-right: 1px solid #e0e0e0;
    background: #fff;
}

.travel-mode-resize-handle,
.planner-sidebar-resize-handle {
    z-index: 1001;
    cursor: col-resize;
    touch-action: none;
}

.travel-mode-resize-handle {
    position: absolute;
    top: 0;
    right: -5px;
    bottom: 0;
    width: 10px;
}

.planner-sidebar-resize-handle {
    position: relative;
    flex: 0 0 10px;
    width: 10px;
    margin-right: -5px;
    margin-left: -5px;
}

#appContainer.mobile-view-travel .planner-sidebar-resize-handle {
    display: none;
}

.travel-mode-resize-handle::after,
.planner-sidebar-resize-handle::after {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: transparent;
    content: '';
    transition: background-color 0.15s ease;
}

.travel-mode-resize-handle::after {
    right: 4px;
}

.planner-sidebar-resize-handle::after {
    left: 4px;
}

.travel-mode-resize-handle:hover:where(.hover-enabled *)::after,
.travel-mode-resize-handle:focus-visible::after,
.planner-sidebar-resize-handle:hover:where(.hover-enabled *)::after,
.planner-sidebar-resize-handle:focus-visible::after,
body.sidebar-resizing :is(.travel-mode-resize-handle, .planner-sidebar-resize-handle)::after {
    background: var(--primary-color);
}

body.sidebar-resizing {
    cursor: col-resize;
}

/* ==================== [CSS-03] Mobile Ansichten und Installation ==================== */

/* Mobile View Management */
@media (max-width: 740px) {
    /* Default: Hide both views */
    .sidebar {
        display: none;
    }
    
    .map-container {
        display: none;
    }

    .mobile-menu-overlay.show {
        display: flex;
        align-items: flex-end;
    }

    .mobile-menu {
        border-radius: 16px 16px 0 0;
    }

    .hiddenDesktop {
        display: flex !important;
    }
    
    /* Sidebar View */
    .mobile-view-sidebar .sidebar {
        display: flex !important;
        padding: 1rem !important;
        padding-right: 0.25rem !important;
        padding-top: 0 !important;
        width: 100% !important;
        height: auto !important;
        min-height: 0;
        flex: 1 1 auto;
    }

    .mobile-view-sidebar .map-container {
        display: none !important;
    }

    .mobile-view-sidebar .containerMap {
        height: 0 !important;
    }

    /* Map View */
    .mobile-view-map .sidebar {
        display: none !important;
    }

    .mobile-view-map .containerMap {
        display: flex !important;
        width: 100%;
        height: 100%;
        flex-direction: column;
    }

    .mobile-view-map .map-container{
        display: flex;
        height: auto;
        width: 100%;
    }
    
    /* Diary View */
    .mobile-view-diary .sidebar {
        display: none !important;
    }

    .mobile-view-diary .map-container {
        display: none !important;
    }
    .mobile-view-diary .containerMap {
        height: 0 !important;
    }
    

    .mobile-view-diary .diary-container {
        display: flex !important;
        width: 100%;
        height: 100%;
        flex-direction: column;
    }

    #appContainer.mobile-view-travel .containerMap {
        display: none !important;
    }

    #appContainer.mobile-view-travel .travel-mode-view {
        flex: 1 1 auto;
        width: 100% !important;
        min-width: 0;
        max-width: none;
        overflow: hidden;
        padding: 1rem;
        padding-right: 0.25rem;
        padding-top: 0;
        --sidebar-scrollbar-gap: 0.5rem;
        border-right: 0;
    }

    .travel-mode-resize-handle,
    .planner-sidebar-resize-handle {
        display: none;
    }

    .travel-mode-enabled #bottomNavTravel {
        display: flex;
    }

    .travel-mode-enabled #bottomNavSidebar,
    .travel-mode-enabled #bottomNavUndo,
    .travel-mode-enabled #bottomNavRedo {
        display: none;
    }
    
    .mobile-days-list {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        border: 1px solid #e0e0e0;
        border-top: none;
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
        z-index: 200;
        max-height: 200px;
        overflow-y: auto;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
        gap: 0.5rem;
        padding: 1rem;
    }
    
    .mobile-days-list .day-btn {
        padding: 0.75rem 0.5rem;
        border: 1px solid #ddd;
        background: white;
        border-radius: 6px;
        cursor: pointer;
        text-align: center;
        font-size: 0.9rem;
        transition: all 0.2s ease;
    }
    
    .mobile-days-list .day-btn.active {
        background: var(--primary-color);
        color: white;
        border-color: var(--primary-color);
    }
    
    .mobile-days-list .day-btn:hover:where(.hover-enabled *) {
        background: #f0f0f0;
    }
    
    .mobile-days-list .day-btn.active:hover:where(.hover-enabled *) {
        background: var(--primary-color);
    }
}

/* Touch Optimizations */
.btn {
    /*! min-height: var(--touch-target-size); */
    /*! min-width: var(--touch-target-size); */
    /*! touch-action: manipulation; */
}

input, textarea, select {
    min-height: var(--touch-target-size);
    touch-action: manipulation;
}

/* PWA Specific Styles */
#mobileInstallBtn[hidden], #installAppAction[hidden], #installAppSteps[hidden] {
    display: none !important;
}

.install-app-intro {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 22px 0;
}

.install-app-intro img { flex-shrink: 0; }
.install-app-intro p { margin-top: 5px; line-height: 1.5; }
.install-app-steps { padding-left: 26px; margin: 18px 0 24px; }
.install-app-steps li { padding-left: 6px; margin: 12px 0; line-height: 1.6; }
.install-app-steps li::marker { color: var(--primary-color); font-weight: 600; }

@media (display-mode: standalone) {
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    .bottom-nav {
        padding-bottom: env(safe-area-inset-bottom);
    }

    #mobileInstallBtn {
        display: none;
    }
}

@media (min-width: 1411px) and (max-width: 1540px) {
    .fixWidthBtn102 {
        width: auto !important;
    }
    .header-divider {
        display: none !important;
    }
}

@media screen and (min-width: 741px) and (max-width: 1410px) {
    /* Styles nur bei Breite > 740px */

    header {
        padding: 0.35rem 1rem;
    }

    .header-left h1 {
        font-size: 1.6rem;
    }

    .trip-info-header {
        margin: 0 0.5rem;
    }

    .trip-info-display {
        padding: 0.3rem 0.5rem;
    }

    .hiddenMobil {
        display: none;
    }

    .hiddenDesktop {
        display: flex !important;
    }
    
    #tripNameDisplay {
        font-size: 1rem;
    }
    .trip-dates {
        font-size: 0.8rem;
    }
    .sidebar {
        padding-top: 0.5rem !important;
    }

    #appContainer.mobile-view-travel .travel-mode-view {
        padding-top: 0.5rem !important;
    }
}

/* Responsive Design */
@media (max-width: 740px) {
    .example-buttons-grid {
        grid-template-columns: repeat(1, 1fr) !important;
    }
    
    .bottom-nav {
        display: flex;
    }
    
    /* .header-left h1 {
        font-size: 1.2rem;
    } */
    
    .trip-info-header {
        margin: 0 0.5rem;
    }
    
    #tripNameDisplay {
        font-size: 1rem;
    }
    
    .trip-dates {
        font-size: 0.8rem;
    }

    .hiddenMobil {
        display: none;
    }
    
    .sidebar {
        max-width: none !important;
        min-width: auto !important;
        resize: none !important;
        overflow: hidden !important;
        flex-direction: column !important;
    }
    
    .sidebar .day-content {
        flex: 1;
        overflow-y: auto;
        overflow-x: hidden;
        padding-right: var(--sidebar-scrollbar-gap);
    }
    
    .containerMap {
        width: 100%;
    }
    
    .map-container {
        width: 100%;
    }
    
    /* Touch-friendly buttons */
    .btn {
        padding: 0.3rem 0.6rem;
        font-size: 0.9rem;
    }
    
    .btn-small {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
    
    /* Larger touch targets for form elements */
    input[type="text"], 
    input[type="email"], 
    input[type="tel"], 
    input[type="date"], 
    input[type="number"],
    textarea, 
    select {
        padding: 0.75rem;
        /* font-size: 1rem; */
        border-radius: var(--border-radius);
    }

    .mobile-date-inputs input{
        padding: 0.4rem 0.2rem;
    }
    
    /* Modal adjustments */
    .modal-content {
        margin: 1rem;
        max-height: calc(100vh - 2rem);
        max-height: calc(100dvh - 2rem);
        overflow: hidden;
    }
    
    /* Stats modal mobile optimization */
    .stats-tabs {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    /* Floating controls mobile */
    .floating-controls {
        bottom: calc(var(--bottom-nav-height) + 1rem);
        right: 1rem;
    }

    .diary-controls {
        display: none !important;
    }

    .diary-header {
        display: none !important;
    }
    
    /* Ensure map controls are visible in mobile map view */
 /*    .mobile-view-map .map-controls {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
        position: absolute;
        bottom: 1rem;
        left: 1rem;
        right: 1rem;
        z-index: 50;
        background: rgba(255, 255, 255, 0.9);
        padding: 0.5rem;
        border-radius: 8px;
        backdrop-filter: blur(4px);
    }
    
    .mobile-view-map .map-controls .btn {
        font-size: 0.8rem;
        padding: 0.5rem 0.75rem;
        flex: 0 0 auto;
    } */
    
    /* Hide map2 container in mobile map view */
    /* .mobile-view-map .map-container2 {
        display: none;
    } */
    
    /* Ensure main map container takes full space */
    .mobile-view-map .map-container {
        flex: 1;
        position: relative;
    }
    
    /* Show map controls in mobile map view */
    /* .mobile-view-map .map-controls {
        display: block !important;
        position: absolute;
        bottom: 1rem;
        left: 1rem;
        right: 1rem;
        z-index: 50;
        background: rgba(255, 255, 255, 0.9);
        padding: 0.5rem;
        border-radius: 8px;
        text-align: center;
    }
    
    .mobile-view-map .map-controls .btn {
        display: inline-block !important;
        font-size: 0.8rem !important;
        padding: 0.5rem 0.75rem !important;
        margin: 0.25rem !important;
    } */
    
    .floating-btn {
        width: 48px;
        height: 48px;
        font-size: 1.2rem;
    }
    
    /* Hide desktop-only elements on mobile */
    .header-controls {
        display: none;
    }
    
    /* Fixed positioning for header and bottom nav */
    header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        padding: 0.35rem 0.5rem;
    }
    
    .bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1000;
    }
    
    /* Adjust main content for fixed header/nav */
    .main-content {
        margin-top: var(--header-height);
        margin-bottom: var(--bottom-nav-height);
        max-height: calc(100vh - var(--header-height) - var(--bottom-nav-height));
        max-height: calc(100dvh - var(--header-height) - var(--bottom-nav-height)); /* Fallback */
        position: relative;
    }
    
    /* Ensure proper sizing for mobile views */
    .mobile-view-sidebar .sidebar,
    .mobile-view-map .containerMap {
        /* position: absolute; */
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
    }
    
    /* Diary view shows modal overlay */
    .mobile-view-diary .modal {
        position: fixed !important;
        top: var(--header-height) !important;
        bottom: var(--bottom-nav-height) !important;
        left: 0 !important;
        right: 0 !important;
        margin: 0 !important;
        border-radius: 0 !important;
        height: auto !important;
        max-height: none !important;
    }
    
    .mobile-view-diary .modal-content {
        height: 100% !important;
        max-height: none !important;
        margin: 0 !important;
        border-radius: 0 !important;
        display: flex !important;
        flex-direction: column !important;
    }
    
    .mobile-view-diary .modal-body {
        flex: 1 !important;
        overflow-y: auto !important;
    }
    
    /* App lock overlay mobile */
    .app-lock-message {
        margin: 1rem;
        padding: 2rem 1.5rem;
    }
    
    .app-lock-actions {
        flex-direction: column;
        gap: 1rem;
    }
    
    .app-lock-actions .btn {
        width: 100%;
        font-size: 1.1rem;
    }
}

@media (max-width: 365px) {
    .header-left h1 {
        font-size: 1.0rem !important;
    }
}

@media (max-width: 500px) {
    .header-left h1 {
        font-size: 1.3rem;
    }

    .trip-info-display {
        padding: 0.3rem 0.5rem;
    }
    
    #tripNameDisplay {
        font-size: 0.9rem;
    }
    
    .trip-dates {
        font-size: 0.75rem;
    }
    
    .bottom-nav-label {
        font-size: 0.65rem;
    }
    
    .sidebar {
        padding: 0.75rem;
    }
    
    .modal-content {
        margin: 0.5rem;
        max-height: calc(100vh - 1rem);
        max-height: calc(100dvh - 1rem); /* Fallback */
    }
    
    .transport-mode-selection {
        grid-template-columns: 1fr;
    }
}

/* ==================== [CSS-04] Seitenleiste und Reiseplanung ==================== */

/* Sidebar */
.sidebar {
    flex: 0 0 auto;
    width: 425px;
    min-width: 350px;
    max-width: 1000px;
    background: white;
    border-right: 1px solid #e0e0e0;
    overflow: hidden;
    padding: 1.5rem;
    padding-right: 0.5rem;
    --sidebar-scrollbar-gap: 0.5rem;
    resize: none;
    display: flex;
    flex-direction: column;
}

.trip-info h2 {
    margin-bottom: 1rem;
    color: #333;
    font-size: 1.3rem;
}

.date-inputs {
    margin: 0.3rem;
}

.day-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: var(--sidebar-scrollbar-gap);
    scrollbar-gutter: stable;
}

/* Reisemodus: kompakte mobile Unterwegs-Ansicht */
.travel-mode-scroll {
    flex: 1;
    min-width: 0;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding-right: var(--sidebar-scrollbar-gap);
    scrollbar-gutter: stable;
}

/* Kein Pull-to-refresh oder Scroll-Durchreichen in eigenständigen Bereichen. */
.day-content,
.travel-mode-scroll,
.diary-content,
.mobile-menu-content,
.form-inner,
.modal-body,
.ai-chat-history {
    overscroll-behavior-y: contain;
}

.shared-day-nav {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    flex-shrink: 0;
    margin-bottom: 0.85rem;
}

#sidebar > #sharedDayNav,
#travelModeView > #sharedDayNav {
    margin-right: 1rem;
}

@media (max-width: 740px) {
    .main-content > #sharedDayNav {
        z-index: 2;
        width: 100%;
        margin: 0;
        padding: 0.65rem 1rem 0.75rem;
        box-sizing: border-box;
        background: #fff;
    }
}

.shared-day-nav > .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;
    border-radius: 50%;
    font-size: 0.8rem;
    padding: 0;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.shared-day-heading {
    min-width: 0;
    text-align: center;
}

.shared-day-heading h3 {
    margin: 0;
    color: #28303d;
    font-size: 1.2rem;
    line-height: 1.25;
}

.shared-day-title {
    min-width: 0;
    max-width: 100%;
    overflow: visible;
    border: 0;
    border-radius: 6px;
    color: inherit;
    background: transparent;
    font: inherit;
    cursor: pointer;
    line-height: 1.2;
    text-overflow: clip;
    white-space: normal;
}

.shared-day-title::after {
    content: ' ▾';
    font-size: 0.85em;
}

.shared-day-title[aria-expanded="true"]::after {
    content: ' ▴';
}

.shared-day-title:hover:where(.hover-enabled *),
.shared-day-title:focus-visible {
    background: rgba(102, 126, 234, 0.1);
    outline: none;
}

.shared-days-list {
    grid-column: 1 / -1;
    width: 100%;
    resize: none;
}

.shared-days-list .day-tab {
    font-family: inherit;
}

.shared-day-places {
    min-height: 1rem;
    margin-top: 0.15rem;
    overflow: hidden;
    color: #69717e;
    font-size: 0.78rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.travel-focus-card,
.travel-timeline-section,
.travel-day-todos,
.travel-day-notes {
    border: 1px solid #e0e4ec;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 3px 14px rgba(42, 50, 65, 0.07);
}

.travel-focus-card {
    padding: 0.9rem;
    border-color: rgba(102, 126, 234, 0.35);
    background: linear-gradient(145deg, #fff 55%, #f1f3ff);
}

.travel-focus-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    min-height: 1.6rem;
    margin-bottom: 0.45rem;
}

.travel-focus-label {
    color: var(--primary-color);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.travel-focus-automatic {
    padding: 0.22rem 0.5rem;
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 999px;
    color: var(--primary-color);
    background: rgba(102, 126, 234, 0.08);
    cursor: pointer;
    font: inherit;
    font-size: 0.7rem;
}

.travel-focus-main {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
}

.travel-focus-icon {
    display: grid;
    flex: 0 0 2.65rem;
    width: 2.65rem;
    height: 2.65rem;
    place-items: center;
    border-radius: 12px;
    background: rgba(102, 126, 234, 0.13);
    font-size: 1.35rem;
}

.travel-focus-copy {
    min-width: 0;
}

.travel-focus-copy h3 {
    margin: 0 0 0.2rem;
    overflow-wrap: anywhere;
    color: #29313e;
    font-size: 1.05rem;
}

.travel-focus-details {
    margin-top: 0.8rem;
    padding-top: 0.8rem;
    border-top: 1px solid #e0e4ec;
    font-size: 0.84rem;
}

.travel-focus-details .item-text {
    min-width: 0;
    overflow-wrap: anywhere;
}

.travel-timeline-section,
.travel-day-todos,
.travel-day-notes {
    margin-top: 0.8rem;
    padding: 0.85rem;
}

.travel-timeline-section > h3,
.travel-day-todos > h3,
.travel-day-notes > h3 {
    margin: 0 0 0.7rem;
    color: #343c49;
    font-size: 0.92rem;
}

.travel-timeline {
    position: relative;
}

.travel-timeline-empty {
    padding: 1.2rem 0.5rem;
    color: #7b8390;
    text-align: center;
}

.travel-timeline-item {
    position: relative;
    display: grid;
    grid-template-columns: 2.7rem 2.2rem minmax(0, 1fr);
    align-items: start;
    gap: 0.45rem;
    min-width: 0;
    padding: 0.55rem 0;
    cursor: pointer;
}

.travel-timeline-item:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.travel-timeline-item:not(:last-child)::after {
    position: absolute;
    top: 2.65rem;
    bottom: -0.55rem;
    left: 3.78rem;
    width: 2px;
    background: #e1e5ed;
    content: '';
}

.travel-timeline-item.is-focus {
    margin: 0 -0.35rem;
    padding-right: 0.35rem;
    padding-left: 0.35rem;
    border-radius: 10px;
    background: rgba(102, 126, 234, 0.08);
}

.travel-timeline-time {
    padding-top: 0.45rem;
    color: #606978;
    font-size: 0.72rem;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.travel-timeline-icon {
    position: relative;
    z-index: 1;
    display: grid;
    width: 2.2rem;
    height: 2.2rem;
    place-items: center;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #eef0f7;
    font-size: 1rem;
}

.travel-timeline-copy {
    min-width: 0;
    padding-top: 0.15rem;
}

.travel-timeline-title,
.travel-timeline-location {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.travel-timeline-title {
    color: #303845;
    font-size: 0.88rem;
    font-weight: 650;
}

.travel-timeline-location {
    margin-top: 0.12rem;
    color: #78818e;
    font-size: 0.73rem;
}

.travel-day-notes p {
    margin: 0;
    overflow-wrap: anywhere;
    color: #626b79;
    font-size: 0.82rem;
    line-height: 1.5;
    white-space: pre-wrap;
}

body.travel-mode-enabled .map-context-menu,
body.travel-mode-enabled .popup-btn-edit,
body.travel-mode-enabled .popup-btn-delete {
    display: none !important;
}

body.travel-mode-enabled #tripInfoDisplay {
    pointer-events: none;
}

body.travel-mode-enabled :where(#mobileNewTripBtn, #mobileSaveTripBtn) {
    display: none !important;
}

@media (max-width: 380px) {
    .travel-timeline-item {
        grid-template-columns: 2.4rem 2rem minmax(0, 1fr);
        gap: 0.35rem;
    }

    .travel-timeline-item:not(:last-child)::after {
        left: 3.38rem;
    }
}

.day-content h3 {
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
    margin: 0 0 1rem 0;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e9ecef;
}

/* Einheitliche Scrollbar für Planer- und Reisemodus */
.day-content::-webkit-scrollbar,
.travel-mode-scroll::-webkit-scrollbar {
    width: 6px;
}

.day-content::-webkit-scrollbar-track,
.travel-mode-scroll::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.day-content::-webkit-scrollbar-thumb,
.travel-mode-scroll::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.day-content::-webkit-scrollbar-thumb:hover:where(.hover-enabled *),
.travel-mode-scroll::-webkit-scrollbar-thumb:hover:where(.hover-enabled *) {
    background: #a8a8a8;
}

/* Firefox scrollbar */
.day-content {
    scrollbar-width: thin;
    min-height: 200px;
}

@media (max-width: 740px) {
    .sidebar {
        padding-right: 0.75rem;
        --sidebar-scrollbar-gap: 0.5rem;
    }

    .mobile-view-sidebar .day-content {
        min-height: 0;
    }
}

.days-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(50px, 0.5fr));
    flex-wrap: wrap;
    gap: 0.5rem;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: thin;
    resize: vertical;
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
    margin-top: 1rem;
}

.days-list::-webkit-scrollbar {
    width: 6px;
}

.days-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.days-list::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 3px;
}

.days-list::-webkit-scrollbar-thumb:hover:where(.hover-enabled *) {
    background: #5a6fd8;
}

.days-list.collapsed {
    max-height: 0;
    margin-bottom: 0;
    opacity: 0;
    margin-top: 0;
    overflow: hidden;
}

.day-tab {
    padding: 0.3rem 0rem;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
    user-select: none;
    white-space: nowrap;
    flex: 0 0 auto;
    text-align: center;
}

.days-list.can-reorder .day-tab {
    cursor: grab;
}

.days-list.can-reorder .day-tab:active {
    cursor: grabbing;
}

.day-tab.dragging {
    opacity: 0.5;
    transform: rotate(2deg) scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.day-tab.multi-day-group {
    border: 2px solid #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.day-tab.active {
    background-color: #667eea;
    color: white;
    border-color: #667eea;
}

.day-tab:hover:where(.hover-enabled *) {
    background-color: #e9ecef;
}

.day-tab.active:hover:where(.hover-enabled *) {
    background-color: #5a6fd8;
}

.day-content h3 {
    color: #333;
    font-size: 1.2rem;
}

.section {
    margin-bottom: 2rem;
}

.section h4 {
    margin-bottom: 1rem;
    color: #555;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#day-content-id > .section > h4 {
    position: sticky;
    top: 0;
    z-index: 6;
    min-height: 1.8rem;
    padding: 0 2.4rem 0 0.25rem;
    line-height: 1.2;
    background: #fff;
    /* Freiraum für das Kommentarsymbol bei unverändertem Gesamtabstand. */
    margin-bottom: 5px;
}

/* Auch den seitlich überstehenden Kommentarindikator beim Scrollen abdecken. */
#day-content-id > .section > h4::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 100%;
    width: 8px;
    background: inherit;
}

#day-content-id > .section {
    margin-bottom: 0;
    padding-bottom: 2rem;
}

.sidebar-sticky-expand-control {
    position: sticky;
    top: 0;
    z-index: 7;
    display: flex;
    justify-content: flex-end;
    height: 0;
    padding-right: 0.25rem;
    pointer-events: none;
}

.sidebar-sticky-expand-control .sidebar-expand-all-btn {
    margin: 0;
    pointer-events: auto;
}

/* ==================== [CSS-05] Formulare und Reiseelemente ==================== */

/* Form Elements */
.cost-input-group {
    min-width: 0;
}

.cost-value-row {
    position: relative;
}

.cost-value-row .cost-expression-input {
    width: 100%;
    min-width: 0;
    padding-right: 3.7rem;
}

.cost-value-row .currency-select {
    position: absolute;
    top: 50%;
    right: 0.35rem;
    transform: translateY(-50%);
    width: 3rem;
    height: calc(100% - 0.7rem);
    padding: 0 0.2rem;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: #596575;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.cost-value-row .currency-select:hover,
.cost-value-row .currency-select:focus-visible {
    background: rgba(79, 70, 229, 0.09);
    color: #4338ca;
    outline: none;
}

html[data-theme="dark"] .cost-value-row .currency-select {
    color: #cbd5e1;
}

html[data-theme="dark"] .cost-value-row .currency-select:hover,
html[data-theme="dark"] .cost-value-row .currency-select:focus-visible {
    background: rgba(129, 140, 248, 0.16);
    color: #c7d2fe;
}

.trip-currency-content {
    display: grid;
    gap: 0.65rem;
}

#tripBaseCurrency {
    width: 100%;
    max-width: 100%;
}

.exchange-rate-heading {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.exchange-rate-explanation,
.exchange-rate-status {
    color: #6b7280;
    font-size: 0.72rem;
}

.exchange-rate-explanation {
    margin-top: -0.45rem;
}

.exchange-rate-status {
    min-height: 1em;
}

.exchange-rate-status-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
}

.exchange-rate-status-row .exchange-rate-status {
    flex: 1 1 auto;
    min-width: 0;
}

.exchange-rate-status-row .exchange-rate-refresh {
    flex: 0 0 auto;
}

.exchange-rate-status[data-state="error"] {
    color: #b42318;
}

.exchange-rate-status[data-state="success"] {
    color: #27834a;
}

.exchange-rate-refresh {
    padding: 0;
    border: 0;
    background: transparent;
    color: #596575;
    font: inherit;
    font-size: 0.76rem;
    cursor: pointer;
}

.exchange-rate-refresh:hover,
.exchange-rate-refresh:focus-visible {
    color: #4338ca;
    text-decoration: underline;
    outline: none;
}

.exchange-rate-refresh:disabled {
    opacity: 0.55;
    cursor: wait;
}

.exchange-rates-list {
    display: grid;
    gap: 0.45rem;
}

.exchange-rate-row {
    display: grid;
    grid-template-columns: auto 5.3rem auto minmax(5rem, 1fr) auto 2rem;
    align-items: center;
    gap: 0.45rem;
}

.exchange-rate-row .form-input {
    min-width: 0;
    padding: 0.4rem 0.45rem;
}

.exchange-rate-row.is-loading .exchange-rate-value {
    opacity: 0.6;
}

.exchange-rate-remove {
    width: 2rem;
    height: 2rem;
    padding: 0;
}

.currency-rate-warning {
    margin-top: 0.75rem;
    padding: 0.65rem 0.75rem;
    border-radius: 8px;
    background: rgba(245, 158, 11, 0.12);
    color: #92400e;
    font-size: 0.86rem;
    line-height: 1.4;
}

html[data-theme="dark"] .currency-rate-warning {
    background: rgba(245, 158, 11, 0.16);
    color: #fcd38d;
}

html[data-theme="dark"] .exchange-rate-explanation,
html[data-theme="dark"] .exchange-rate-status,
html[data-theme="dark"] .exchange-rate-refresh {
    color: #aeb8c8;
}

html[data-theme="dark"] .exchange-rate-status[data-state="error"] {
    color: #f2a4a4;
}

html[data-theme="dark"] .exchange-rate-status[data-state="success"] {
    color: #81d69d;
}

html[data-theme="dark"] .exchange-rate-refresh:hover,
html[data-theme="dark"] .exchange-rate-refresh:focus-visible {
    color: #c7d2fe;
}

@media (max-width: 480px) {
    .exchange-rate-row {
        grid-template-columns: auto 4.7rem auto minmax(4.5rem, 1fr) auto 2rem;
        gap: 0.3rem;
    }
}

.cost-input-heading {
    position: relative;
    display: block;
    margin-bottom: 0.5rem;
}

.cost-input-heading label {
    flex-shrink: 0;
    margin-bottom: 0;
}

.cost-input-heading .cost-mode-select {
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    width: auto;
    min-width: 0;
    max-width: 70%;
    padding: 0.15rem 0.2rem;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    color: #626d7b;
    font: inherit;
    font-size: 0.78rem;
    cursor: pointer;
}

.cost-input-heading .cost-mode-select:hover,
.cost-input-heading .cost-mode-select:focus-visible {
    border-color: #b5bed0;
    background: #f4f5f8;
}

html[data-theme="dark"] .cost-input-heading .cost-mode-select {
    color: var(--theme-muted) !important;
    background: transparent !important;
    border-color: transparent !important;
    color-scheme: dark;
}

html[data-theme="dark"] .cost-input-heading .cost-mode-select:hover,
html[data-theme="dark"] .cost-input-heading .cost-mode-select:focus-visible {
    border-color: var(--theme-border) !important;
    background: var(--theme-surface-soft) !important;
}

.form-input, .form-textarea {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: border-color 0.2s ease;
}

.form-input {
    padding: 0.5rem;
}

.form-input-image {
    width: auto;
    padding: 0;
}

.form-input:focus, .form-textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.form-input::placeholder, .form-textarea::placeholder {
    color: #adb5bd;
    font-style: italic;
}

.form-textarea {
    padding: 0.75rem;
    min-height: 50px;
    resize: vertical;
}

.coordinates {
    display: flex;
    gap: 0.5rem;
}

.coordinates input {
    flex: 1;
}

/* Location Input mit Suggestions */
.location-input {
    position: relative;
}

.suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.suggestion-item {
    padding: 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.suggestion-item:hover:where(.hover-enabled *) {
    background-color: #f8f9fa;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-icon {
    font-size: 1.2rem;
    min-width: 25px;
    text-align: center;
}

.suggestion-text {
    flex: 1;
    font-size: 0.9rem;
    line-height: 1.3;
}

.suggestion-type {
    font-size: 0.8rem;
    color: #666;
    background-color: #e9ecef;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-weight: 500;
}

/* Stops Container */

.stop-item, .hotel-item, .transfer-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 1rem;
    padding-left: 0.8rem;
    margin-bottom: 0.5rem;
    cursor: move;
    transition: all 0.2s ease;
}

.stop-item.disabled, .transfer-item.disabled {
    opacity: 0.5;
    background: #f1f1f1;
    border-color: #d6d6d6;
    color: #888;
}

.stop-item.disabled:hover:where(.hover-enabled *), .transfer-item.disabled:hover:where(.hover-enabled *) {
    background: #f1f1f1;
    border-color: #d6d6d6;
    transform: none;
    box-shadow: none;
}

.stop-item.disabled .stop-name {
    text-decoration: line-through;
    color: #999;
}

.stop-item.disabled .stop-details {
    color: #aaa;
}

.stop-item:hover:where(.hover-enabled *), .hotel-item:hover:where(.hover-enabled *), .transfer-item:hover:where(.hover-enabled *) {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    background: #eef0f23d;
}

#day-content-id .sidebar-context-active {
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

html[data-theme="dark"] #day-content-id .sidebar-context-active {
    border-color: #667eea !important;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2) !important;
}

.stop-item.sortable-ghost, .hotel-item.sortable-ghost {
    opacity: 0.5;
}

.item-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.item-title {
    font-weight: 600;
    color: #333;
    flex: 1;
    min-width: 0;
}

.item-title-with-icon {
    display: grid;
    grid-template-columns: 1.7em minmax(0, 1fr);
    align-items: start;
}

.item-title-icon {
    text-align: left;
}

.item-title-text {
    min-width: 0;
    overflow-wrap: anywhere;
}

.item-actions {
    display: flex;
    gap: 0.3rem;
}

.sidebar-item-menu-btn {
    position: absolute;
    top: 10px;
    right: 16px;
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 30px;
    height: 26px;
    padding: 0;
    font-size: 14px;
    line-height: 14px;
}

.sidebar-item-header-with-menu {
    padding-right: 35px;
}

.hotel-item > .sidebar-item-header-with-menu,
.stop-item > .sidebar-item-header-with-menu,
.transfer-item > .sidebar-item-header-with-menu {
    min-height: 26px;
}

@media (max-width: 740px) {
    .sidebar-item-menu-btn {
        width: 36px;
        height: 34px;
    }

    .sidebar-item-header-with-menu {
        padding-right: 41px;
    }

    .hotel-item > .sidebar-item-header-with-menu,
    .stop-item > .sidebar-item-header-with-menu,
    .transfer-item > .sidebar-item-header-with-menu {
        min-height: 34px;
    }
}

.stop-item.is-collapsed,
.hotel-item.is-collapsed,
.transfer-item.is-collapsed,
.stop-item.is-expanded,
.hotel-item.is-expanded,
.transfer-item.is-expanded {
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
}

.start-dest-item {
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
}

.start-dest-item > .item-header {
    margin-bottom: 0;
}

.is-collapsed > .item-header {
    margin-bottom: 0;
}

.compact-symbols {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    margin-left: 0.25rem;
    vertical-align: middle;
}

.compact-symbol {
    font-size: 0.9em;
    white-space: nowrap;
}

.compact-stars {
    letter-spacing: normal;
}

.is-expanded > .item-header .compact-symbols {
    display: none;
}

.sidebar-expand-all-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 1.8rem;
    height: 1.8rem;
    padding: 0;
    margin: 0;
    border: 1px solid #dfe3e8;
    border-radius: 50%;
    color: #5f6b7a;
    background: #fff;
    font-size: 0;
    line-height: 0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.sidebar-expand-all-btn::before {
    content: '';
    width: 0.48rem;
    height: 0.48rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-0.12rem) rotate(45deg);
}

.sidebar-expand-all-btn[aria-expanded="true"]::before {
    transform: translateY(0.12rem) rotate(225deg);
}

.linked-trips-btn {
    position: relative;
    flex: 0 0 auto;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border-radius: 6px;
    background-color: transparent;
    color: #fff;
    font-size: 1.2rem;
    box-shadow: none;
}

.linked-trips-btn:hover:where(.hover-enabled *) {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.linked-trips-btn:focus-visible {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 1px;
}

.linked-trips-btn[hidden] {
    display: none;
}

.linked-trips-empty[hidden] {
    display: none;
}

.linked-trips-modal-content {
    max-width: 560px;
}

.linked-trips-intro {
    margin-top: 0;
    padding-bottom: 0.75rem;
    color: #6c757d;
}

.day-city-row {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    box-sizing: border-box;
    min-width: 0;
    padding-left: 0.15rem;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.day-city-icon {
    flex: 0 0 auto;
    color: #8a94a3;
    font-size: 0.82rem;
    opacity: 0.75;
}

.day-cities-display {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.1rem 0.3rem;
    padding: 0.1rem 0;
    color: #5f6874;
    font-size: 0.82rem;
    font-weight: 500;
    overflow-wrap: anywhere;
}

.day-cities-placeholder {
    color: #8a94a3;
    font-weight: 400;
}

.day-city-separator {
    color: #9aa3af;
}

.day-city-edit {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    min-height: 1.55rem;
    padding: 0.15rem 0.3rem;
    color: #7a8492;
    background: transparent;
    border: 0;
    border-radius: 5px;
    font-size: 0.72rem;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.day-city-edit:hover:where(.hover-enabled *) {
    color: #667eea;
    background: rgba(102, 126, 234, 0.08);
}

.travel-day-todos-list {
    display: grid;
    gap: 0.35rem;
}

.travel-day-todo-row {
    display: grid;
    grid-template-columns: 1rem minmax(0, 1fr);
    align-items: start;
    gap: 0.55rem;
    color: #394251;
    font-size: 0.84rem;
    line-height: 1.4;
    cursor: default;
}

.travel-day-todo-row span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.day-todos-section {
    margin: 0;
}

.day-todos-section.has-content {
    padding: 0.5rem;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 10px;
}

.day-todos-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
    padding-left: 0.15rem;
}

.day-todos-section.is-empty .day-todos-header {
    margin-bottom: 0;
}

.day-todos-title {
    color: #596372;
    font-size: 0.8rem;
    font-weight: 650;
}

.day-todos-list {
    display: grid;
    gap: 0.3rem;
}

.day-todo-row {
    display: grid;
    grid-template-columns: 1.1rem minmax(0, 1fr) auto;
    align-items: start;
    gap: 0.5rem;
    min-width: 0;
    padding: 0.42rem 0.4rem;
    background: #fff;
    border: 1px solid #edf0f4;
    border-radius: 7px;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.day-todo-row:hover:where(.hover-enabled *),
.day-todo-row:focus-within {
    background: #fff;
    border-color: rgba(102, 126, 234, 0.3);
    box-shadow: 0 2px 7px rgba(42, 50, 65, 0.06);
}

.day-todo-checkbox,
.travel-day-todo-row input {
    width: 1rem;
    height: 1rem;
    min-height: 1rem;
    margin: 0.12rem 0 0;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.day-todo-text {
    min-width: 0;
    overflow-wrap: anywhere;
    color: #394251;
    font-size: 0.84rem;
    line-height: 1.35;
}

.day-todo-copy,
.travel-day-todo-copy {
    display: grid;
    min-width: 0;
}

.day-todo-due {
    width: max-content;
    max-width: 100%;
    margin-top: 0.12rem;
    color: #7b8491;
    font-size: 0.7rem;
    line-height: 1.25;
}

.day-todo-due.is-overdue,
.travel-day-todo-due.is-overdue {
    color: #c23b48;
    font-weight: 650;
}

.day-todo-related,
.travel-day-todo-related {
    display: grid;
    grid-template-columns: 1.35em minmax(0, 1fr);
    align-items: start;
    justify-self: start;
    width: auto;
    min-width: 0;
    max-width: 100%;
    min-height: 0;
    margin-top: 0.15rem;
    padding: 0;
    overflow-wrap: anywhere;
    color: var(--primary-color);
    background: transparent;
    border: 0;
    font: inherit;
    font-size: 0.72rem;
    line-height: 1.3;
    text-align: left;
    white-space: normal;
    cursor: pointer;
    box-sizing: border-box;
}

.day-todo-related:hover:where(.hover-enabled *),
.travel-day-todo-related:hover:where(.hover-enabled *) {
    text-decoration: none;
}

.day-todo-related:hover:where(.hover-enabled *) .day-todo-related-name,
.travel-day-todo-related:hover:where(.hover-enabled *) .day-todo-related-name {
    text-decoration: underline;
}

.day-todo-related-icon {
    grid-column: 1;
}

.day-todo-related-name {
    grid-column: 2;
    min-width: 0;
    overflow-wrap: anywhere;
}

.day-todo-related.is-missing,
.travel-day-todo-related.is-missing {
    color: #a16a21;
    cursor: default;
    text-decoration: none;
}

.day-todo-row.is-completed .day-todo-text {
    color: #89919d;
    text-decoration: line-through;
}

.day-todo-row.is-completed {
    background: rgba(255, 255, 255, 0.55);
}

.day-todo-actions {
    display: flex;
    gap: 0.1rem;
}

.day-todo-action {
    display: inline-grid;
    width: 1.65rem;
    height: 1.65rem;
    min-height: 0;
    padding: 0;
    place-items: center;
    color: #747e8c;
    background: transparent;
    border: 0;
    border-radius: 6px;
    font: inherit;
    cursor: pointer;
}

.day-todo-action:hover:where(.hover-enabled *) {
    color: var(--primary-color);
    background: rgba(102, 126, 234, 0.12);
}

.day-todo-delete:hover:where(.hover-enabled *) {
    color: #dc3545;
    background: rgba(220, 53, 69, 0.1);
}

.day-todo-add {
    font-size: 1.15rem;
    background: rgba(102, 126, 234, 0.08);
}

@media (hover: hover) {
    .day-todo-row .day-todo-actions {
        opacity: 0;
        transition: opacity 0.15s ease;
    }

    .day-todo-row:hover:where(.hover-enabled *) .day-todo-actions,
    .day-todo-row:focus-within .day-todo-actions {
        opacity: 1;
    }
}

.day-todo-editor {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.45rem;
    align-items: center;
    padding: 0.45rem;
    background: #fff;
    border: 1px solid rgba(102, 126, 234, 0.25);
    border-radius: 7px;
    box-shadow: 0 2px 7px rgba(42, 50, 65, 0.05);
}

.day-todo-editor input {
    width: 100%;
    min-width: 0;
    min-height: 2rem;
    padding: 0.35rem 0.5rem;
    border: 1px solid #cfd5df;
    border-radius: 5px;
    font: inherit;
    font-size: 0.84rem;
    box-sizing: border-box;
}

.day-todo-due-editor {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    width: max-content;
    max-width: 100%;
    color: #747e8c;
    font-size: 0.75rem;
}

.day-todo-due-editor input {
    width: auto;
    min-height: 1.9rem;
    padding: 0.25rem 0.4rem;
    font-size: 0.78rem;
}

.day-todo-related-editor,
.day-todo-assignee-editor {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
    color: #747e8c;
    font-size: 0.75rem;
}

.day-todo-related-editor select,
.day-todo-assignee-editor select,
.day-todo-assignee-editor input {
    width: 100%;
    min-width: 0;
    min-height: 1.9rem;
    padding: 0.25rem 0.4rem;
    border: 1px solid #cfd5df;
    border-radius: 5px;
    font: inherit;
    font-size: 0.78rem;
}

.day-todo-editor-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.4rem;
    margin-top: 0.1rem;
}

.day-todo-editor-actions .btn {
    min-width: 0;
    min-height: 0;
    padding: 0.25rem 0.55rem;
    font-size: 0.75rem;
    line-height: 1.2;
}

.travel-day-todo-due {
    margin-top: 0.12rem;
    color: #78818e;
    font-size: 0.7rem;
}

.day-cities-modal-content {
    max-width: 560px;
}

.day-cities-intro {
    margin: 0 0 1rem;
    color: #6c757d;
}

.day-cities-inputs {
    display: grid;
    gap: 0.6rem;
}

.day-city-input-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.day-city-modal-input {
    flex: 1;
    min-width: 0;
}

.day-city-remove {
    flex: 0 0 auto;
    width: 2.35rem;
    height: 2.35rem;
    padding: 0;
    color: #dc3545;
    background: rgba(220, 53, 69, 0.07);
    border: 1px solid rgba(220, 53, 69, 0.18);
    border-radius: 8px;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
}

.day-city-remove:hover:where(.hover-enabled *) {
    color: #fff;
    background: #dc3545;
}

.day-cities-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 0.85rem;
}

.day-cities-generation-info {
    margin-top: 0.75rem;
    padding: 0.65rem 0.75rem;
    color: #4f5d75;
    background: rgba(102, 126, 234, 0.08);
    border-radius: 7px;
    font-size: 0.88rem;
}

.day-cities-generation-info[hidden] {
    display: none;
}

@media (max-width: 500px) {
    .day-cities-toolbar {
        display: grid;
        grid-template-columns: 1fr;
    }

    .day-cities-toolbar .btn {
        width: 100%;
    }
}

.linked-trip-input-row {
    display: flex;
    gap: 0.5rem;
}

.linked-trip-input-row .form-input {
    flex: 1;
}

.linked-trips-list {
    display: grid;
    gap: 0.5rem;
}

.linked-trip-item {
    display: flex;
    align-items: stretch;
    overflow: hidden;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.linked-trip-item:hover:where(.hover-enabled *) {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.12);
}

.linked-trip-open {
    display: flex;
    flex: 1;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    padding: 0.75rem;
    color: inherit;
    background: transparent;
    border: 0;
    text-align: left;
}

.linked-trip-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 0.35rem;
    padding-right: 0.6rem;
}

.linked-trip-action-btn {
    white-space: nowrap;
}

#tripHistoryBtn[hidden],
#compareLinkedTripsBtn[hidden],
#compareTripVersionsBtn[hidden] {
    display: none;
}

.compare-linked-trip-button {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.8rem;
    color: inherit;
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.compare-linked-trip-button:hover:where(.hover-enabled *):not(:disabled) {
    background: #f8f9ff;
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.12);
}

.compare-linked-trip-button:disabled {
    cursor: wait;
    opacity: 0.7;
}

.compare-linked-trip-action {
    flex: 0 0 auto;
    color: #667eea;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

.linked-trip-icon {
    font-size: 1.35rem;
}

.linked-trip-info {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
}

.linked-trip-info strong,
.linked-trip-info small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.linked-trip-info small {
    margin-top: 0.15rem;
    color: #6c757d;
}

.linked-trip-arrow {
    color: #667eea;
    font-size: 1.6rem;
}

.linked-trip-remove {
    color: #dc3545;
    white-space: nowrap;
}

.mobile-linked-trips-menu-item {
    display: none;
}

.trip-edit-linked-option {
    margin-top: 1rem;
}

.day-todo-assignee-controls {
    display: grid;
    gap: 0.35rem;
    min-width: 0;
}

.day-todo-assignee-editor select {
    padding-right: 1.7rem;
}

.day-todo-related-editor select {
    padding-right: 1.7rem;
}

.day-todo-assignee,
.travel-day-todo-assignee {
    width: max-content;
    max-width: 100%;
    margin-top: 0.12rem;
    padding: 0.08rem 0.38rem;
    color: #53606e;
    background: rgba(102, 126, 234, 0.09);
    border-radius: 999px;
    font-size: 0.7rem;
    line-height: 1.35;
}

.trip-participants-option {
    margin: 0.55rem 0 0.65rem;
}

.trip-participants-option summary {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 30px;
    padding: 0.25rem 0.15rem;
    color: #59636f;
    font-size: 1rem;
    cursor: pointer;
    list-style: none;
    border-radius: 6px;
}

.trip-participants-option summary::-webkit-details-marker { display: none; }
.trip-participants-option summary::marker { content: ''; }
.trip-participants-option summary:hover:where(.hover-enabled *) {
    color: var(--primary-color);
    background: rgba(102, 126, 234, 0.06);
}
.trip-participants-icon {
    display: inline-flex;
    flex: 0 0 1rem;
    width: 1rem;
    align-items: center;
    justify-content: center;
    line-height: 1;
    opacity: 0.72;
}
.trip-participants-summary {
    display: flex;
    flex: 1;
    min-width: 0;
    align-items: baseline;
    gap: 0.45rem;
}
.trip-participants-summary strong { flex-shrink: 0; font-size: 1rem; font-weight: 600; }
.trip-participants-summary small {
    color: #6c757d;
    font-size: 0.8rem;
    font-weight: 400;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.trip-participants-arrow { font-size: 1.1rem; line-height: 1; transition: transform 0.16s ease; }
.trip-participants-option[open] .trip-participants-arrow { transform: rotate(90deg); }
.trip-participants-content {
    margin-top: 0.25rem;
    padding: 0.55rem 0.65rem;
    border: 1px solid #e4e7ec;
    border-radius: 7px;
    background: #fafbfc;
}
.trip-traveler-count-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.55rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e4e7ec;
}
.trip-traveler-count-label {
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
    margin: 0;
    color: #59636f;
    font-size: 0.88rem;
    line-height: 1.25;
}
.trip-traveler-count-label > span { font-weight: 600; }
.trip-traveler-count-label small {
    color: #8a929d;
    font-size: 0.72rem;
    font-weight: 400;
}
.trip-traveler-count-input {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    overflow: hidden;
    min-height: 32px;
    color: #747d88;
    background: #fff;
    border: 1px solid #d9dee7;
    border-radius: 7px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.trip-traveler-count-input:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.12);
}
.trip-traveler-count-input .form-input {
    width: 58px;
    min-height: 30px;
    padding: 0.25rem 0.2rem 0.25rem 0.45rem;
    text-align: center;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}
.trip-traveler-count-input .form-input:focus { box-shadow: none; }
.trip-traveler-count-input > span {
    padding: 0 0.45rem 0 0.25rem;
    font-size: 0.72rem;
    white-space: nowrap;
}
.trip-participants-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.55rem;
}
.trip-participants-list[hidden] { display: none; }
.trip-participant-chip {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    min-height: 28px;
    padding: 0.18rem 0.25rem 0.18rem 0.55rem;
    color: #46505c;
    background: #edf0f5;
    border: 1px solid #d9dee7;
    border-radius: 999px;
    font-size: 0.86rem;
}
.trip-participant-chip > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.trip-participant-remove {
    width: 24px;
    height: 24px;
    margin-left: 0.2rem;
    padding: 0;
    color: #6c757d;
    background: transparent;
    border: 0;
    border-radius: 50%;
    font: inherit;
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
}
.trip-participant-remove:hover:where(.hover-enabled *) {
    color: #8f1f2a;
    background: rgba(220, 53, 69, 0.12);
}
.trip-participant-input-row {
    display: flex;
    gap: 0.45rem;
}
.trip-participant-input-row .form-input { flex: 1; min-width: 0; }
.trip-participant-input-row .btn { flex-shrink: 0; padding: 0.55rem 0.7rem; }

@media (max-width: 420px) {
    .trip-participant-input-row .btn { font-size: 0; }
    .trip-participant-input-row .btn::before { content: '+'; font-size: 1.25rem; line-height: 1; }
}

.trip-edit-linked-option[hidden] {
    display: none;
}

.trip-edit-linked-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem;
    text-align: left;
}

.trip-edit-linked-icon {
    font-size: 1.35rem;
}

.trip-edit-linked-text {
    display: flex;
    flex: 1;
    flex-direction: column;
}

.trip-edit-linked-text small {
    margin-top: 0.15rem;
    color: lightgray;
    font-weight: 400;
}

.trip-edit-linked-arrow {
    font-size: 1.6rem;
}

.linked-trips-empty {
    padding: 1.25rem;
    color: #6c757d;
    border: 1px dashed #ced4da;
    border-radius: 8px;
    text-align: center;
}

@media (max-width: 740px) {
    .linked-trip-input-row {
        flex-direction: column;
    }

    #compareLinkedTripsView,
    #compareLinkedTripsList,
    #compareTripVersionsView,
    #compareTripVersionsList {
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    .compare-linked-trip-button {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    .compare-linked-trip-action {
        grid-column: 2;
        justify-self: start;
        white-space: normal;
    }

    .linked-trip-item {
        align-items: stretch;
        flex-direction: column;
    }

    .linked-trip-actions {
        justify-content: flex-end;
        padding: 0 0.6rem 0.6rem;
    }

    .linked-trip-item.is-manage .linked-trip-actions,
    .linked-trip-item.is-manage .linked-trip-remove {
        width: 100%;
    }

    .linked-trip-item.is-manage .linked-trip-actions {
        box-sizing: border-box;
    }

    .linked-trips-btn {
        display: none !important;
    }

    .mobile-linked-trips-menu-item:not([hidden]) {
        display: flex;
    }
}

.sidebar-expand-all-btn[hidden] {
    display: none;
}

.context-expand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 0.8;
    vertical-align: middle;
}

.sidebar-expand-all-btn:hover:where(.hover-enabled *) {
    color: #667eea;
    border-color: #667eea;
    background: #f5f7ff;
    transform: translateY(-1px);
}

.item-details {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.3;
    padding-left: 0.2rem;
}

.item-location {
    color: #667eea;
    font-weight: 500;
}

.item-price {
    color: #28a745;
    font-weight: 600;
}

.containerMap {
    flex: 1;
    height: 100%;
    width: 100%;
    position: relative;
}

/* ==================== [CSS-06] Karte, Modale und Marker ==================== */

/* Map Container */
.map-container {
    z-index: 200;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
  height: 100%;
}

.map-container2 {
    z-index: -999;
    position: absolute;
    top: 0;
    left: 0;
    width: 800px;
    height: 600px;
}

#map {
    z-index: 200;
    width: 100%;
  height: 100%;
}

#map2 {
    z-index: -999;
    width: 100%;
  height: 100%;
}

/* Die unsichtbare Druckkarte darf nie in einer skalierten Zoom-Zwischenstufe
   aufgenommen werden. */
#map2 .leaflet-zoom-animated,
#map2.leaflet-fade-anim .leaflet-tile {
    transition: none !important;
}

.map-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 1000;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.2s ease;
}


.modal-content {
    display: flex;
    flex-direction: column;
    background-color: white;
    margin: 5% auto;
    padding-top: 1.5rem;
    padding-left: 2rem;
    padding-bottom: 1rem;
    padding-right: 0.7rem;
    border-radius: 8px;
    width: 90%;
    max-width: 550px;
    max-height: 80vh;
    max-height: 80dvh;
    position: relative;
    animation: slideIn 0.3s ease;
    overflow: hidden;
}

.marginBottom {
    margin-bottom: 0.5rem !important;
}

.form-outer {
    overflow: hidden;
    flex-direction: column;
    display: flex;
    flex: 1;
    min-height: 0;
}

.form-inner,
.modal-body {
    overflow-x: hidden;
    overflow-y: auto;
    flex: 1;
    padding-right: max(0px, calc(1.3rem - var(--form-scrollbar-width, 0px)));
    scrollbar-width: thin;
    min-height: 100px;
}

.form-inner::-webkit-scrollbar,
.modal-body::-webkit-scrollbar {
    width: 8px;
}

.stats-modal {
    max-width: 1200px;
    max-height: 80vh;
    max-height: 80dvh;
}


.close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
    transition: color 0.2s ease;
}

.close:hover:where(.hover-enabled *) {
    color: #333;
}

.modal-content h3 {
    margin-bottom: 1.5rem;
    color: #333;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #555;
}

.hotel-cancellation-deadline {
    margin-top: -0.35rem;
    margin-left: 1.65rem;
    padding: 0.75rem;
    background: #f5faf7;
    border-left: 3px solid #28a745;
    border-radius: 0 6px 6px 0;
}

.hotel-cancellation-deadline[hidden] {
    display: none;
}

.optional-label,
.form-hint {
    color: #6c757d;
    font-weight: 400;
}

.form-hint {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.8rem;
}

.hotel-search-panel {
    margin: 0.15rem 0 1rem;
    border: 1px solid #e4e7ec;
    border-radius: 8px;
    background: #fafbfc;
}

.hotel-search-panel summary {
    padding: 0.7rem 0.8rem;
    color: #4f5967;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
}

.hotel-search-content {
    padding: 0 0.8rem 0.8rem;
    border-top: 1px solid #edf0f3;
}

.hotel-search-content .form-group {
    margin-top: 0.75rem;
    margin-bottom: 0.55rem;
}

.hotel-search-dates {
    margin-bottom: 0.7rem;
    color: #6c757d;
    font-size: 0.82rem;
}

.hotel-portal-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}

.hotel-search-people-group {
    flex: 0 0 7rem !important;
}

.hotel-portal-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 2.2rem;
    padding: 0.4rem 0.55rem;
    color: #4f5f91;
    background: #fff;
    border: 1px solid #dfe3eb;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.hotel-portal-link:hover:where(.hover-enabled *) {
    color: #667eea;
    background: #f5f7ff;
    border-color: #aeb9ee;
}

.hotel-portal-link[aria-disabled="true"] {
    color: #9aa3af;
    background: #f4f5f6;
    pointer-events: none;
}

@media (max-width: 500px) {
    .hotel-search-people-group {
        flex-basis: auto !important;
    }

    .hotel-portal-links {
        grid-template-columns: 1fr;
    }
}

.stop-websites-section > .btn { margin-top: 0.5rem; }
.stop-website-row { display: flex; gap: 0.5rem; align-items: center; margin-bottom: 0.5rem; }
.stop-website-row .stop-website-input { flex: 1; }
.stop-website-remove { flex-shrink: 0; padding: 0.5rem 0.6rem !important;}

@media (max-width: 600px) {
    .stop-website-row { align-items: stretch; flex-direction: column; }
}

.form-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 0.5rem;
    padding-top: 1rem;
    margin-right: 1.3rem;
    border-top: 1px solid #e0e0e0;
}

@media (max-width: 600px) {
    .form-actions {
        flex-wrap: wrap;
    }
}

/* KAI-Assistent direkt in Hotel-, Stopp- und Transferformularen */
.kai-form-assistant {
    margin-top: 0.9rem;
    border: 1px solid rgba(74, 126, 215, 0.25);
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(48, 214, 229, 0.07), rgba(112, 72, 219, 0.07));
    overflow: hidden;
}

.kai-form-toggle {
    display: inline-flex;
    width: auto;
    margin-right: auto;
    padding: 0.3rem 0.55rem;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(74, 126, 215, 0.35);
    color: #263b68;
    background: linear-gradient(135deg, rgba(48, 214, 229, 0.14), rgba(112, 72, 219, 0.14));
    font-weight: 650;
}

.kai-form-toggle img {
    height: 20px;
    object-fit: contain;
}

.kai-form-toggle:hover:where(.hover-enabled *) {
    border-color: rgba(74, 126, 215, 0.6);
    background: linear-gradient(135deg, rgba(48, 214, 229, 0.22), rgba(112, 72, 219, 0.22));
}

.kai-form-toggle[aria-expanded="true"] {
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.16);
}

.kai-form-panel {
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.72);
}

.kai-form-panel[hidden] {
    display: none;
}

.kai-form-header {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.55rem;
    color: #455a78;
    font-size: 0.82rem;
    font-weight: 650;
}

.kai-form-header img {
    height: 25px;
    object-fit: contain;
    object-position: left center;
}

.kai-form-hint {
    margin: 0 0 0.65rem;
    color: #52606d;
    font-size: 0.85rem;
    line-height: 1.4;
}

.kai-form-prompt {
    min-height: 78px;
}

.kai-form-controls {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.6rem;
}

.kai-form-apply {
    color: white;
    background: linear-gradient(135deg, #16b8cf, #6750c7);
    border: 0;
}

.kai-form-apply:hover:where(.hover-enabled *):not(:disabled) {
    filter: brightness(1.05);
    transform: translateY(-1px);
}

.kai-form-apply:disabled {
    opacity: 0.65;
    cursor: wait;
}

.kai-form-status {
    min-height: 1.25rem;
    margin-top: 0.55rem;
    font-size: 0.82rem;
    line-height: 1.4;
}

.kai-form-status-loading { color: #455a78; }
.kai-form-status-success { color: #237a3b; }
.kai-form-status-error { color: #b02a37; }

@media (max-width: 600px) {
    .kai-form-controls,
    .kai-form-apply {
        width: 100%;
    }

}

@media (max-width: 740px) {

    .kai-form-toggle img {
        height: 17px;
    }

    .kai-form-toggle {
    padding: 0.2rem 0.55rem;
}
}

/* Karten-Kontextmenü */
.map-context-menu {
    position: fixed;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    min-width: 180px;
    max-width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-y: auto;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.context-menu-item {
    font-size: 14px;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
    white-space: normal;
}

.context-menu-item:last-child {
    border-bottom: none !important;
}

.context-menu-item:hover:where(.hover-enabled *) {
    background-color: #f8f9fa;
    color: #667eea;
}

.context-menu-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

/* Stop-Marker Styling */
.custom-stop-marker {
    background: transparent !important;
    border: none !important;
}

.stop-marker-container {
    position: relative;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stop-number {
    position: absolute;
    top: -1px;
    left: -1px;
    background: #667eea;
    color: white;
    border-radius: 50%;
    width: 15px;
    height: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 10px;
    border: 1px solid white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    z-index: 2;
}

.stop-category-icon {
    background: white;
    border: 2px solid #667eea;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.start-category-combined {
    background: green;
    border: 2px solid green;
    border-radius: 30%;
    width: 28px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
    position: relative;
}

.end-category-combined {
    background: red;
    border: 2px solid red;
    border-radius: 30%;
    width: 28px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
    position: relative;
}

.stop-category-combined {
    background: white;
    border-radius: 50%;
    width: 27px;
    height: 27px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
    position: relative;
}

.counter-combined {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #ff6b6b;
    color: white;
    border-radius: 50%;
    width: 13px;
    height: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
}

/* Popup-Styling */
.popup-category {
    color: #667eea;
    font-weight: 500;
    font-size: 13px;
}

.popup-buttons {
    margin-top: 8px;
    display: flex;
    gap: 5px;
    justify-content: center;
}

.popup-btn {
    padding: 4px 8px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    transition: all 0.2s ease;
    min-width: 70px;
}

.popup-btn-edit {
    background-color: #3498db;
    color: white;
}

.popup-btn-edit:hover:where(.hover-enabled *) {
    background-color: #2980b9;
    transform: translateY(-1px);
}

.popup-btn-delete {
    background-color: #e74c3c;
    color: white;
}

.popup-btn-delete:hover:where(.hover-enabled *) {
    background-color: #c0392b;
    transform: translateY(-1px);
}

/* Sterne-Bewertung */
.star-rating {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-top: 5px;
}

.star {
    cursor: pointer;
    font-size: 20px;
    transition: all 0.2s ease;
    opacity: 0.3;
}

.star:hover:where(.hover-enabled *),
.star.active {
    opacity: 1;
    transform: scale(1.1);
}

.star.active {
    filter: drop-shadow(0 0 3px #ffd700);
}

.star-text {
    margin-left: 10px;
    font-size: 14px;
    color: #666;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 740px) {
    .main-content {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: 50vh;
        height: 50dvh;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
    }
    
    .map-container {
        height: 50vh;
        height: 50dvh;
    }

    /* .map-container2 {
        height: 50vh;
    } */
    
    .header-controls {
        flex-direction: column;
        gap: 0.3rem;
    }
    
    .coordinates {
        flex-direction: column;
    }

    .prompt-examples {
        display: none;
    }
}

/* Drag and Drop Styles */
.sortable-chosen {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.sortable-drag {
    opacity: 0.8;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}


/* Multi-Day Hotel Styling */
.hotel-item.multi-day {
    border-left: 4px solid #667eea;
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.1) 0%, rgba(248, 249, 250, 1) 10%);
}

.hotel-item.multi-day-continuation {
    border-left: 4px solid #95a5ea;
    background: linear-gradient(90deg, rgba(149, 165, 234, 0.1) 0%, rgba(248, 249, 250, 1) 10%);
}

/* Edit Button Styling */
.btn-edit {
    background-color: #17a2b8;
    color: white;
    border: none;
}

.btn-edit:hover:where(.hover-enabled *) {
    background-color: #138496;
}

.hotel-marker {
    font-size: 20px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.hotel-range-marker-container {
    background: transparent;
    border: 0;
}

.hotel-range-marker {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 0 2px;
    border: 2px solid #000;
    border-radius: 4px;
    background: var(--hotel-marker-color);
    color: #fff;
    font-size: 9px;
    font-weight: bold;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
}

/* Richtungspfeile */
.direction-arrow {
    pointer-events: none;
    z-index: 1000;
}

.direction-arrow div {
    text-shadow: 1px 1px 2px rgba(255,255,255,0.8);
    filter: drop-shadow(0 0 2px rgba(0,0,0,0.5));
}

/* Vortags-Hotel Marker */
.previous-hotel-marker {
    z-index: 999;
}

/* Start-/End-Marker */
.start-marker, .end-marker {
    z-index: 1001;
}

.start-marker-full, .end-marker-full {
    z-index: 1002;
}

.start-marker-full div, .end-marker-full div {
    box-shadow: 0 2px 8px rgba(0,0,0,0.4) !important;
}

/* Route Info Styles */
.leaflet-popup-content {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.4;
}

.leaflet-popup-content b {
    color: #333;
    font-size: 1.1em;
}

/* Map Controls Enhancement */
.map-controls {
    background: rgba(255, 255, 255, 0.9);
    padding: 0.5rem;
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.map-controls .btn {
    margin-bottom: 0.3rem;
    width: 100%;
    font-size: 0.8rem;
}

.map-controls .btn:last-child {
    margin-bottom: 0;
}

/* Custom Scrollbar */
.sidebar::-webkit-scrollbar {
    width: 0px;
}

.sidebar::-webkit-scrollbar-track {
    background: white;
}

.sidebar::-webkit-scrollbar-thumb {
    background: white;
    border-radius: 0px;
}

.sidebar::-webkit-scrollbar-thumb:hover:where(.hover-enabled *) {
    background: white;
}

.form-outer::-webkit-scrollbar {
    width: 0px;
}

.form-outer::-webkit-scrollbar-track {
    background: white;
}

.form-outer::-webkit-scrollbar-thumb {
    background: white;
    border-radius: 0px;
}

.form-outer::-webkit-scrollbar-thumb:hover:where(.hover-enabled *) {
    background: white;
}

/* ==================== [CSS-07] Statistiken und Accounts ==================== */

/* Statistiken Styles */
.stats-tabs {
    display: flex;
    flex-wrap: wrap;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 1.5rem;
    margin-right: 1.3rem;
}

.stats-tab {
    padding: 0.75rem 1.5rem;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
}

.stats-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background-color: rgba(102, 126, 234, 0.1);
}

.stats-tab:hover:where(.hover-enabled *) {
    background-color: #f8f9fa;
}

.stats-tab-content {
    display: none;
}

.stats-tab-content.active {
    display: block;
}

#openTripItemsFilter { width: auto; max-width: 100%; }
.booking-panel { margin: 0 0 1rem; }
.booking-panel[open] { padding: .7rem; border: 1px solid #dce2eb; border-radius: 8px; background: #f8f9fc; }
.booking-panel[open] > summary { padding-bottom: .6rem; border-bottom: 1px solid #e3e7ef; }
html[data-theme="dark"] .booking-panel[open] { border-color: #3c4557; background: #202633; }
html[data-theme="dark"] .booking-panel[open] > summary { border-bottom-color: #353e50; }
.booking-attachments { margin-top: .85rem; }
.booking-attachments .form-hint { display: block; margin-top: .4rem; }
.attachment-list { display: grid; gap: .4rem; }
.attachment-row { display: flex; align-items: center; gap: .2rem; border: 1px solid #e3e7ed; border-radius: 7px; background: #f7f8fa; padding: .15rem; min-width: 0; }
.attachment-file-button { display: flex; align-items: center; gap: .65rem; flex: 1; min-width: 0; border: 0; border-radius: 5px; padding: .5rem; background: transparent; color: inherit; text-align: left; cursor: pointer; font: inherit; }
.attachment-file-button:hover { background: #e9edf5; }
.attachment-type { display: flex; align-items: center; justify-content: center; flex: 0 0 2.1rem; height: 2.35rem; border: 1px solid #dbe1ea; border-radius: 5px; color: #64748b; background: #fff; font-size: .6rem; font-weight: 700; letter-spacing: .025em; }
.attachment-file-text { display: grid; gap: .15rem; min-width: 0; flex: 1; }
.attachment-name { font-size: .85rem; line-height: 1.4; overflow-wrap: anywhere; }
.attachment-meta { color: #6b7280; font-size: .73rem; line-height: 1.4; overflow-wrap: anywhere; }
.attachment-picker { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-top: .5rem; }
.attachment-picker button { font: inherit; font-size: .8rem; cursor: pointer; border-radius: 5px; }
.attachment-add { display: inline-flex; align-items: center; gap: .35rem; padding: .45rem .65rem; background: transparent; border: 1px dashed #bcc5d2; color: #475569; }
.attachment-add:hover { background: #eef1f7; border-color: #8193b4; }
.attachment-overview { margin-left: auto; padding: .45rem .1rem; color: #64748b; background: none; border: 0; }
.attachment-overview:hover { color: #3456a8; text-decoration: underline; }
.attachment-usage { margin: .3rem 0 1rem; }
.attachment-usage > div { display: flex; justify-content: space-between; gap: .5rem; color: #6b7280; font-size: .8rem; }
.attachment-usage progress { display: block; width: 100%; height: 5px; margin-top: .5rem; border: 0; border-radius: 8px; overflow: hidden; appearance: none; background: #e5e9ef; }
.attachment-usage progress::-webkit-progress-bar { background: #e5e9ef; }
.attachment-usage progress::-webkit-progress-value { background: #7b86cf; border-radius: 8px; }
.attachment-usage progress::-moz-progress-bar { background: #7b86cf; }
.attachment-file-button:focus-visible, .attachment-picker button:focus-visible, .attachment-remove:focus-visible, .attachment-offline-save:focus-visible { outline: 2px solid #7b86cf; outline-offset: 2px; }
.attachment-file-link { background: none; border: 0; padding: 0; color: #3456a8; text-align: left; font: inherit; cursor: pointer; overflow-wrap: anywhere; min-width: 0; }
.attachment-file-link:hover { text-decoration: underline; }
.attachment-remove { margin: 0 .2rem 0 auto; flex-shrink: 0; border: 0; border-radius: 4px; background: transparent; color: #a12a38; cursor: pointer; width: 2rem; height: 2rem; font-size: 1.2rem; }
.attachment-remove:hover { background: #fce5e8; }
.attachment-offline-save { margin: 0 .2rem 0 auto; flex-shrink: 0; border: 0; border-radius: 4px; background: transparent; cursor: pointer; width: 2rem; height: 2rem; font-size: 1rem; }
.attachment-offline-save:hover:where(.hover-enabled *) { background: #e9edf5; }
.attachment-offline-save:disabled { opacity: .5; cursor: default; }
#tripAttachmentsModal { z-index: 2200; }
.offline-overview-modal-content { max-width: 560px; }
.offline-storage-summary { margin: 0 0 .8rem; color: var(--theme-muted, #667085); font-size: .85rem; }
.offline-content-section { padding: .9rem 0; border-top: 1px solid var(--theme-border, #e0e4ea); }
.offline-content-section:first-of-type { border-top: 0; padding-top: .25rem; }
.offline-content-heading { display: flex; align-items: center; gap: .7rem; min-width: 0; }
.offline-content-heading > div { display: grid; gap: .15rem; min-width: 0; }
.offline-content-heading small { color: var(--theme-muted, #667085); line-height: 1.35; }
.offline-content-icon { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 2rem; width: 2rem; height: 2rem; border-radius: 50%; background: var(--theme-surface-soft, #f1f3f7); }
.offline-map-detail-level { display: flex; align-items: center; gap: .5rem; margin: .65rem 0 0 2.7rem; color: var(--theme-muted, #667085); font-size: .78rem; }
.offline-map-detail-level select { min-width: 0; max-width: 13rem; padding: .28rem 1.7rem .28rem .45rem; border: 1px solid var(--theme-border, #d8dde6); border-radius: 5px; background: var(--theme-surface, #fff); color: var(--theme-text, #333); font: inherit; }
.offline-map-detail-level select:focus-visible { outline: 2px solid #7b86cf; outline-offset: 1px; }
.offline-content-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin: .75rem 0 0 2.7rem; }
.offline-content-actions .btn { padding: .48rem .7rem; font-size: .82rem; }
.offline-content-actions .btn.offline-remove-btn { flex: 0 0 2.25rem; width: 2.25rem; padding: .48rem 0; border-color: transparent; background: transparent; color: var(--danger-color, #a12a38); }
.offline-content-actions .btn.offline-remove-btn:hover:where(.hover-enabled *):not(:disabled) { border-color: transparent; background: #fce5e8; }
.offline-content-actions .btn.offline-remove-btn:focus-visible { border-color: transparent; background: #fce5e8; outline: 2px solid var(--danger-color, #a12a38); outline-offset: 1px; }
.offline-content-actions .btn:disabled { opacity: .5; cursor: default; }
.offline-file-list { margin: .7rem 0 0 2.7rem; max-height: min(230px, 30dvh); overflow-y: auto; }
html[data-theme="dark"] .offline-content-icon { background: #293142; }
html[data-theme="dark"] .offline-content-actions .btn.offline-remove-btn:hover:where(.hover-enabled *):not(:disabled),
html[data-theme="dark"] .offline-content-actions .btn.offline-remove-btn:focus-visible { background: #542d37; }
@media (max-width: 600px) {
    .offline-content-actions, .offline-file-list, .offline-map-detail-level { margin-left: 0; }
    .offline-content-actions .btn { flex: 1 1 auto; }
}
html[data-theme="dark"] .attachment-file-link { color: #a9c2ff; }
html[data-theme="dark"] .attachment-remove { color: #e9a0aa; }
html[data-theme="dark"] .attachment-remove:hover { background: #542d37; }
html[data-theme="dark"] .attachment-offline-save:hover:where(.hover-enabled *) { background: #30394b; }
html[data-theme="dark"] .attachment-row { background: #232936; border-color: #384152; }
html[data-theme="dark"] .attachment-file-button:hover { background: #30394b; }
html[data-theme="dark"] .attachment-type { background: #1c2230; border-color: #424c61; color: #bdc7d9; }
html[data-theme="dark"] .attachment-meta,
html[data-theme="dark"] .attachment-overview,
html[data-theme="dark"] .attachment-usage > div { color: #abb5c7; }
html[data-theme="dark"] .attachment-add { color: #c5cede; border-color: #58647a; }
html[data-theme="dark"] .attachment-add:hover { background: #30394b; border-color: #8d9fc0; }
html[data-theme="dark"] .attachment-overview:hover { color: #d6dfff; }
html[data-theme="dark"] .attachment-usage progress,
html[data-theme="dark"] .attachment-usage progress::-webkit-progress-bar { background: #384152; }
.booking-panel > summary { cursor: pointer; padding: 0; font-size: .9rem; }
.booking-panel > summary small { margin-left: .5rem; color: #6b7280; font-weight: normal; overflow-wrap: anywhere; }
.booking-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem .75rem; padding: .6rem 0 0; }
.booking-fields .form-group { margin: 0; min-width: 0; }
.booking-fields .form-group label { font-size: .8rem; margin-bottom: .25rem; }
.booking-fields .form-input { width: 100%; min-width: 0; padding: .45rem .5rem; font-size: .85rem; }
.booking-fields .booking-reference { grid-column: 1 / -1; }
html[data-theme="dark"] .booking-panel > summary small { color: #abb5c7; }
#exportStatsBtn[hidden] { display: none; }
#openTripItemsList h4 { margin: 1rem 0 .4rem; }
.open-trip-item {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    width: 100%;
    padding: .75rem .5rem;
    text-align: left;
    border: 0;
    border-bottom: 1px solid rgba(128,128,128,.25);
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
    border-radius: 4px;
    overflow-wrap: anywhere;
}
.open-trip-item-icon { flex: 0 0 1.4em; text-align: center; }
.open-trip-item-content { flex: 1; min-width: 0; }
.open-trip-item small { display: block; margin-top: .25rem; color: #616b7c; }
.open-trip-item:hover:where(.hover-enabled *), .open-trip-item:focus-visible { background: rgba(102,126,234,.1); }
.open-trip-item:focus-visible { outline: 2px solid #667eea; outline-offset: -2px; }
.open-trip-item small.open-trip-item-overdue { color: #ad3434; }
html[data-theme="dark"] .open-trip-item small { color: #abb5c7; }
html[data-theme="dark"] .open-trip-item small.open-trip-item-overdue { color: #ffaaaa; }

.stats-controls {
    margin-bottom: 1rem;
    padding: 0.5rem 1rem;
    background-color: #f8f9fa;
    border-radius: 6px;
    display: flex;
    gap: 2rem;
}

.stats-controls label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    cursor: pointer;
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.stats-table th,
.stats-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.account-modal-content {
    max-width: 550px;
}

#loginBtnOverlay .account-label-signed-in,
#mobileAccountLabel .account-label-signed-in {
    display: none !important;
}

html[data-account-signed-in="true"] #loginBtnOverlay .account-label-login,
html[data-account-signed-in="true"] #mobileAccountLabel .account-label-login {
    display: none !important;
}

html[data-account-signed-in="true"] #loginBtnOverlay .account-label-signed-in,
html[data-account-signed-in="true"] #mobileAccountLabel .account-label-signed-in {
    display: inline !important;
}

.account-modal-panel {
    display: contents;
}

.account-modal-content button.close {
    background: none;
    border: 0;
    padding: 0;
}

.account-modal-content p {
    margin: 0.75rem 0;
}

.account-modal-content [hidden],
#saveOptionsModal [hidden] {
    display: none !important;
}

.account-modal-content form {
    margin: 1rem 0;
}

.account-modal-content .form-input:invalid:not(:user-invalid) {
    border-color: var(--theme-border, #ddd);
}

.account-modal-content .form-input:focus:not(:user-invalid) {
    border-color: var(--primary-color);
}

.account-password-input {
    position: relative;
}

.account-password-input .form-input {
    padding-right: 3rem;
}

.password-visibility-toggle {
    position: absolute;
    top: 50%;
    right: 0.35rem;
    display: grid;
    width: 2.25rem;
    height: 2.25rem;
    place-items: center;
    transform: translateY(-50%);
    color: var(--theme-muted, #666);
    background: transparent;
    border: 0;
    border-radius: 6px;
    font: inherit;
    cursor: pointer;
}

.password-visibility-toggle:hover:where(.hover-enabled *),
.password-visibility-toggle:focus-visible {
    color: var(--primary-color);
    background: color-mix(in srgb, var(--primary-color) 12%, transparent);
    outline: none;
}

.account-text-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin: 1rem 0;
}

.account-text-actions button,
.account-delete {
    background: none;
    border: 0;
    padding: 0.25rem 0;
    color: var(--theme-muted, #666);
    font: inherit;
    font-size: 0.85rem;
    cursor: pointer;
}

.account-text-actions button:hover:where(.hover-enabled *),
.account-delete:hover:where(.hover-enabled *) {
    text-decoration: underline;
    color: var(--primary-color);
}

.account-delete {
    color: var(--danger-color);
}

.account-text-actions .account-delete {
    color: var(--danger-color);
}

.account-danger-zone {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--theme-border, #e0e0e0);
}

.account-danger-zone small {
    color: var(--theme-muted, #666);
    font-size: 0.78rem;
}

.account-confirm-btn {
    color: #fff;
    background: #a91f2d;
    border-color: #a91f2d;
}

.account-confirm-btn:hover:where(.hover-enabled *),
.account-confirm-btn:focus-visible {
    color: #fff;
    background: #8f1824;
    border-color: #8f1824;
    box-shadow: 0 3px 10px rgba(169, 31, 45, 0.3);
}

.account-publication-status {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0.75rem 0 0.25rem !important;
    padding: 0.32rem 0.58rem;
    border: 1px solid var(--theme-border, #dfe2e6);
    border-radius: 999px;
    color: var(--theme-muted, #5f6670);
    background: var(--theme-surface-soft, #f5f6f8);
    font-size: 0.8rem;
    font-weight: 600;
}

.account-publication-status::before {
    content: "";
    width: 0.48rem;
    height: 0.48rem;
    border-radius: 50%;
    background: #7a818b;
}

.account-publication-status[data-access="read"] {
    color: #3e5485;
    background: #f0f3ff;
    border-color: #cbd4f5;
}

.account-publication-status[data-access="read"]::before {
    background: #667eea;
}

.account-publication-status[data-access="write"] {
    color: #24623b;
    background: #eef9f1;
    border-color: #b9dec4;
}

.account-publication-status[data-access="write"]::before {
    background: #358b53;
}

html[data-theme="dark"] .account-publication-status[data-access="read"] {
    color: #c2ccff;
    background: rgba(102, 126, 234, 0.14);
    border-color: rgba(151, 166, 238, 0.38);
}

html[data-theme="dark"] .account-publication-status[data-access="write"] {
    color: #a7dfb8;
    background: rgba(53, 139, 83, 0.16);
    border-color: rgba(102, 190, 130, 0.38);
}

html[data-theme="dark"] .account-publication-status:not([data-access="read"]):not([data-access="write"]) {
    color: #c7cbd1;
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.16);
}

.account-publication {
    border-top: 1px solid var(--theme-border, #e0e0e0);
    margin-top: 1.25rem;
    padding-top: 0.5rem;
    overflow-wrap: anywhere;
}

.publish-protection {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin-bottom: 1rem;
    cursor: pointer;
}

.publish-protection input[type="checkbox"] {
    flex: 0 0 auto;
    width: auto;
    margin-top: 0.25rem;
}

.publish-protection small {
    display: block;
    margin-top: 0.3rem;
    color: var(--theme-muted, #666);
    font-weight: normal;
    line-height: 1.4;
}

.account-status:not(:empty) {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin: 0.85rem 0;
    padding: 0.7rem 0.8rem;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 0.88rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
    animation: account-status-in 0.16s ease-out;
}

.account-status[hidden] {
    display: none !important;
}

.account-status:not(:empty)::before {
    content: "i";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 1.2rem;
    width: 1.2rem;
    height: 1.2rem;
    margin-top: 0.05rem;
    border-radius: 50%;
    background: currentColor;
    color: inherit;
    font-size: 0;
}

.account-status[data-status="info"] {
    color: #3e5485;
    background: #f0f3ff;
    border-color: #cbd4f5;
}

.account-status[data-status="info"]::before {
    content: "ⓘ";
    background: none;
    font-size: 1.05rem;
}

.account-status[data-status="error"] {
    color: #8d2631;
    background: #fff1f2;
    border-color: #efb7bd;
}

.account-status[data-status="error"]::before {
    content: "!";
    background: #b62e3c;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
}

.account-status[data-status="success"] {
    color: #24623b;
    background: #eef9f1;
    border-color: #b9dec4;
}

.account-status[data-status="success"]::before {
    content: "✓";
    background: #358b53;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
}

.account-status[data-status="warning"] {
    color: #76520b;
    background: #fff8e7;
    border-color: #ecd49b;
}

.account-status[data-status="warning"]::before {
    content: "!";
    background: #b47b12;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
}

.account-status[data-status="loading"] {
    color: var(--theme-muted, #5f6670);
    background: var(--theme-surface-soft, #f5f6f8);
    border-color: var(--theme-border, #dfe2e6);
}

.account-status[data-status="loading"]::before {
    content: "";
    box-sizing: border-box;
    background: none;
    border: 2px solid rgba(102, 126, 234, 0.25);
    border-top-color: #667eea;
    animation: account-status-spin 0.75s linear infinite;
}

html[data-theme="dark"] .account-status[data-status="info"] {
    color: #c2ccff;
    background: rgba(102, 126, 234, 0.14);
    border-color: rgba(151, 166, 238, 0.38);
}

html[data-theme="dark"] .account-status[data-status="error"] {
    color: #ffb7be;
    background: rgba(220, 53, 69, 0.14);
    border-color: rgba(255, 124, 137, 0.4);
}

html[data-theme="dark"] .account-status[data-status="success"] {
    color: #a7dfb8;
    background: rgba(53, 139, 83, 0.16);
    border-color: rgba(102, 190, 130, 0.38);
}

html[data-theme="dark"] .account-status[data-status="warning"] {
    color: #f2d28d;
    background: rgba(180, 123, 18, 0.16);
    border-color: rgba(226, 177, 80, 0.4);
}

html[data-theme="dark"] .account-toast[data-status="success"] {
    color: #e8f8ed;
    background: #173b25;
    border-color: #4d9d67;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

html[data-theme="dark"] .account-toast[data-status="error"] {
    color: #ffe8ea;
    background: #4a1d24;
    border-color: #c65763;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

html[data-theme="dark"] .account-toast[data-status="info"],
html[data-theme="dark"] .account-toast[data-status="warning"] {
    color: #fff3d3;
    background: #453718;
    border-color: #a98536;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.account-toast {
    position: fixed;
    left: 50%;
    bottom: 1.25rem;
    z-index: 10004;
    width: min(420px, calc(100vw - 2rem));
    margin: 0 !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 10px);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.account-toast:not(:empty) {
    animation: none;
}

.account-toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

@media (max-width: 740px) {
    .account-toast {
        bottom: calc(var(--bottom-nav-height) + 0.75rem);
    }
}

.app-confirm-modal {
    z-index: 10003 !important;
}

.app-confirm-modal-content {
    width: 90%;
    max-width: 460px;
}

.app-confirm-message {
    white-space: pre-line;
}

.app-confirm-modal-content .modal-body {
    min-height: 0;
    padding-right: 1.3rem;
}

.app-confirm-modal-content .app-confirm-message:not(:empty) {
    margin: 0 0 0.6rem;
    padding: 0;
    color: var(--theme-text, #333);
    background: transparent;
    border: 0;
    border-radius: 0;
    font-size: 0.95rem;
}

.app-confirm-modal-content .app-confirm-message[data-status="warning"]::before {
    margin-top: 0.08rem;
    color: #fff;
    background: #b47b12;
}

.app-confirm-modal-content .form-actions {
    margin-top: 0.35rem;
}

html[data-theme="dark"] .app-confirm-modal-content .app-confirm-message[data-status="warning"] {
    color: var(--theme-text) !important;
    background: transparent !important;
    border-color: transparent !important;
}


#saveToAccountBtn,
#copyToAccountBtn {
    order: 1;
}

.account-trip-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--theme-border, #e0e0e0);
    overflow-wrap: anywhere;
    cursor: pointer;
    border-radius: var(--border-radius);
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.account-trip-row:hover:where(.hover-enabled *),
.account-trip-row:focus-visible {
    background: rgba(102, 126, 234, 0.08);
}

.account-trip-row:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.25);
}

.account-trip-row[aria-busy="true"] {
    opacity: 0.65;
    cursor: progress;
}

.account-trip-row small {
    display: block;
    margin-top: 0.3rem;
}

.account-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.account-actions .btn {
    position: relative;
    z-index: 1;
}

.account-actions .account-remove-btn {
    color: #8f1f2a;
    background: #f9e1e3;
    border-color: #d98c94;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.account-actions .account-remove-btn:hover:where(.hover-enabled *),
.account-actions .account-remove-btn:focus-visible {
    color: #fff;
    background: #a91f2d;
    border-color: #a91f2d;
    box-shadow: 0 3px 9px rgba(169, 31, 45, 0.28);
    transform: translateY(-1px);
}

html[data-theme="dark"] .account-actions .account-remove-btn {
    color: #ff9ca5;
    background: rgba(220, 53, 69, 0.13);
    border-color: rgba(255, 156, 165, 0.45);
}

html[data-theme="dark"] .account-actions .account-remove-btn:hover:where(.hover-enabled *),
html[data-theme="dark"] .account-actions .account-remove-btn:focus-visible {
    color: #fff;
    background: #b72d3b;
    border-color: #ed6571;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.42);
    transform: translateY(-1px);
}

#accountRecoveryCode {
    display: block;
    overflow-wrap: anywhere;
    user-select: all;
    margin: 1rem 0;
}

.cost-name {
    display: flex;
    align-items: baseline;
    gap: 0.35em;
}

.cost-name-icon {
    flex: 0 0 auto;
}

.cost-name-text {
    min-width: 0;
    overflow-wrap: anywhere;
}

.stats-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.stats-table tr:hover:where(.hover-enabled *) {
    background-color: #f8f9fa;
}

.stats-table .number {
    text-align: right;
    font-family: 'Courier New', monospace;
}

.stats-table .total-row {
    background-color: #667eea;
    color: white;
    font-weight: 600;
}

.stats-table .total-row:hover:where(.hover-enabled *) {
    background-color: #5a6fd8;
}

.stats-table .per-person-cost-row td {
    color: #5f6875;
    background: rgba(102, 126, 234, 0.06);
}

.per-person-cost-label {
    display: block;
    font-weight: 600;
}

.per-person-cost-row small {
    display: block;
    margin-top: 0.12rem;
    color: #7a8492;
    font-size: 0.72rem;
}

.costs-section {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e0e0e0;
}

.costs-section:last-child {
    border-bottom: none;
}

.costs-section h4 {
    margin-bottom: 1rem;
    color: #333;
}

.cost-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.cost-item:last-child {
    border-bottom: none;
}

.cost-description {
    flex: 1;
}

.cost-amount {
    font-weight: 600;
    color: #e74c3c;
}

.cost-category {
    font-size: 0.8rem;
    color: #666;
    margin-left: 0.5rem;
}

.stats-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
}

.day-color-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 0.5rem;
}

.route-segment {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Responsive Statistiken */
@media (max-width: 740px) {
    .stats-modal {
        max-height: 95vh;
        max-height: 95dvh;
        width: 95%;
        max-width: none;
        padding-left: 1rem;
        padding-right: 0.5rem;
    }

    .stats-modal .form-inner {
        padding-right: 0.5rem;
    }
    
    .stats-tabs {
        margin-bottom: 0.5rem;
        margin-right: 0;
        flex-wrap: nowrap;
        gap: 0;
    }
    
    .stats-tab {
        text-align: center;
        flex: 1 0 auto;
        white-space: nowrap;
        padding: 0.5rem 0.1rem;
        font-size: 0.75rem;
    }
    
    .stats-table {
        font-size: 0.8rem;
    }

    #routeStatsTable, #hotelCostsTable, #stopCostsTable, #transferCostsTable, #additionalCostsTable, #totalCostsTable, #overviewStatsTable {
        overflow-x: auto;
        overflow-y: hidden;
    }
    
    .stats-table th,
    .stats-table td {
        padding: 0.5rem 0.25rem;
    }

    .stats-controls label {
        font-size: 0.7rem;
    }

    .addMargin {
        margin-bottom: 0.5rem !important;
    }
}

/* Route Point Display Styling */
.route-point-display {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.route-point-display:hover:where(.hover-enabled *) {
    background: #e9ecef;
    border-color: #667eea;
}

.route-point-info {
    flex: 1;
}

.route-point-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
}

.route-point-coords {
    font-size: 0.85rem;
    color: #6c757d;
    font-family: 'Courier New', monospace;
}

.route-point-display .edit-btn {
    margin-left: 1rem;
    flex-shrink: 0;
}

.empty-state {
    text-align: center;
    padding: 1rem 0;
}

.empty-state .btn {
    margin-bottom: 0.5rem;
}

/* ==================== [CSS-08] Drucken ==================== */

/* Print Modal Styling */
 .print-map-option-outer {
    padding-top: 10px;
}

.print-map-option {
    padding-top: 5px;
    padding-left: 5px;
}

/* Print Processing Overlay */
.print-processing-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.print-processing-content {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
}

.print-spinner {
    margin-bottom: 1.5rem;
}

.map-size-header {
    margin-top: 5px;
    margin-left: 5px;
}

.map-size-radio {
    margin-left: 5px;
    white-space: nowrap;
}

.map-size-selection {
    margin-top: 3px;
    margin-left: 10px;
    text-indent: -5px;
}


.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}


#printProcessingTitle {
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

#printProcessingMessage {
    color: #666;
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

.print-progress {
    margin-bottom: 1rem;
}

.print-progress-bar {
    width: 100%;
    height: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.print-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
}

.print-progress-text {
    font-size: 0.9rem;
    color: #667eea;
    font-weight: 600;
}

.print-processing-details {
    margin-top: 1rem;
}

#printProcessingDetails {
    color: #888;
    font-size: 0.85rem;
    font-style: italic;
}

.item-container {
    display: grid;
    grid-template-columns: 2em 1fr;  /* Feste Breite statt auto */
    align-items: flex-start;
    margin-bottom: 0.2em;
}

.item-icon {
    grid-column: 1;
    text-align: center;              /* Zentriert alle Icons/Buchstaben */
    line-height: 1.2;
    min-width: 1.5em;               /* Mindestbreite für Konsistenz */
}

.item-text {
    grid-column: 2;
    word-wrap: break-word;
}


/* Print Styles */
@media print {
    body * {
        visibility: hidden;
    }
    
    .print-content, .print-content * {
        visibility: visible;
    }
    
    .print-content {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        background: white;
        color: black;
        font-family: Arial, sans-serif;
        font-size: 12pt;
        line-height: 1.4;
    }
    
    .print-header {
        border-bottom: 2px solid #333;
        padding-bottom: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .print-title {
        font-size: 18pt;
        font-weight: bold;
        margin-bottom: 0.5rem;
    }
    
    .print-subtitle {
        font-size: 14pt;
        color: #666;
    }

    .print-participants {
        margin-top: 0.35rem;
        color: #555;
        font-size: 10.5pt;
    }
    
    .print-section {
        margin-bottom: 1.5rem;
        page-break-inside: avoid;
    }
    
    .print-section-title {
        font-size: 14pt;
        font-weight: bold;
        margin-bottom: 0.5rem;
        border-bottom: 1px solid #ccc;
        padding-bottom: 0.25rem;
    }
    
    .print-day {
        margin-bottom: 2rem;
        page-break-inside: auto;
        break-inside: auto;
    }

    .print-stops-section {
        page-break-inside: auto;
        break-inside: auto;
    }

    .print-stops-section .print-item {
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .print-section-title {
        page-break-after: avoid;
        break-after: avoid;
    }
    
    .print-day-title {
        font-size: 16pt;
        font-weight: bold;
        margin-bottom: 1rem;
        background: #f0f0f0;
        padding: 0.5rem;
    }
    
    .print-item {
        margin-bottom: 0.75rem;
        padding-left: 1rem;
    }
    
    .print-item-title {
        font-weight: bold;
        margin-bottom: 0.25rem;
    }
    
    .print-item-details {
        margin-left: 1rem;
        font-size: 11pt;
        color: #555;
    }

    .print-item-title2 {
        font-weight: bold;
        margin-bottom: 0.25rem;
        margin-left: 1rem;
    }
    
    .print-item-details2 {
        margin-left: 2rem;
        font-size: 11pt;
        color: #555;
    }
    
    .print-coordinates {
        font-family: monospace;
        font-size: 10pt;
        color: #666;
    }
    
    .print-cost {
        font-weight: bold;
        color: #2c5530;
    }
    
    .print-time {
        font-style: italic;
        color: #666;
    }
    
    .print-page-break {
        page-break-before: always;
    }
    
    .print-map-container {
        margin: 1rem 0;
        text-align: center;
        page-break-inside: avoid;
    }
    
    .print-map-image {
        max-width: 100%;
        height: auto;
        border: 1px solid #ccc;
        border-radius: 4px;
    }
    
    .print-marker {
        z-index: 1000;
    }
}

/* ==================== [CSS-09] Startseite, Speichern und Laden ==================== */

/* Tag ohne Hotel Styling */
.day-item.no-hotel,
.day-tab.no-hotel {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: white;
}

.day-item.no-hotel:hover:where(.hover-enabled *),
.day-tab.no-hotel:hover:where(.hover-enabled *) {
    background: linear-gradient(135deg, #ff5252 0%, #e53935 100%);
}

.day-tab.is-today,
.day-tab.is-today:hover:where(.hover-enabled *) {
    color: white;
    background: #2f9e5b;
    border-color: #27874d;
}

/* Kompakte Planungshinweise in der Sidebar */
.sidebar-planning-warning.account-status:not(:empty) {
    box-sizing: border-box;
    margin: 0 0 0.5rem;
    padding: 0.58rem 0.7rem;
    font-size: 0.82rem;
    line-height: 1.35;
}

/* App-Sperrung für nicht initialisierte Reisen */
.app-locked {
    position: relative;
}

.app-locked .main-content {
    opacity: 0.3;
    pointer-events: none;
    filter: grayscale(100%);
    transition: all 0.3s ease;
}

.app-locked .trip-info-display {
    opacity: 0.5;
    pointer-events: none;
}

.app-locked .header-controls .btn:not(.btn-allowed) {
    opacity: 0.3;
    pointer-events: none;
    cursor: not-allowed;
}

.app-locked .header-controls .btn.btn-allowed {
    opacity: 1;
    pointer-events: auto;
    cursor: pointer;
}

.app-lock-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(2px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    transition: opacity 0.3s ease;
}

.app-lock-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.app-lock-message {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    text-align: center;
    max-width: 550px;
    margin: 0 1rem;
}

.trip-link-loading {
    display: none;
}

html[data-trip-link-loading="true"] .app-lock-overlay > .app-lock-message:not(.trip-link-loading) {
    display: none;
}

html[data-trip-link-loading="true"] .trip-link-loading {
    display: block;
}

.trip-link-spinner {
    width: 34px;
    height: 34px;
    margin: 0 auto 1rem;
    border: 3px solid rgba(102, 126, 234, 0.2);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: trip-link-spin 0.75s linear infinite;
}


.app-lock-message h2 {
    color: #667eea;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.app-lock-message p {
    color: #666;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.app-lock-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.app-lock-actions .btn {
    min-width: 120px;
    height: 2.5rem;
}

.app-lock-actions .aiBtn {
    min-width: 0;
}


/* Modals sollen nicht von der App-Sperrung betroffen sein */
.modal {
    z-index: 10002 !important;
    opacity: 1 !important;
    filter: none !important;
    pointer-events: auto !important;
}

.modal .modal-content {
    opacity: 1 !important;
    filter: none !important;
    pointer-events: auto !important;
}

/* Speichern/Laden Optionen */
.save-options, .load-options, .print-option-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.save-option-btn, .load-option-btn, .print-option-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem;
    text-align: left;
    min-height: 80px;
    justify-content: center;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.save-option-btn:hover:where(.hover-enabled *), .load-option-btn:hover:where(.hover-enabled *), .print-option-btn:hover:where(.hover-enabled *) {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.save-option-btn small, .load-option-btn small, .print-option-btn small {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    opacity: 0.8;
    font-weight: normal;
}

/* Erfolgs- und Fehlermeldungen */
.error-message {
    background-color: #fee;
    color: #c33;
    padding: 0.75rem;
    border-radius: 4px;
    border: 1px solid #fcc;
    margin-top: 0.5rem;
}

.success-message {
    background-color: #efe;
    color: #363;
    padding: 0.75rem;
    border-radius: 4px;
    border: 1px solid #cfc;
    margin-top: 0.5rem;
}

/* Konflikt-Details */
.conflict-details {
    color: var(--theme-muted, #5f6670);
    background: var(--theme-surface-soft, #f5f6f8);
    border: 1px solid var(--theme-border, #dfe2e6);
    border-radius: 8px;
    padding: 0.85rem;
    margin-top: 1rem;
    font-size: 0.9rem;
}

.published-trip-update-content {
    max-width: 620px;
}

.trip-history-content {
    max-width: 720px;
}

.trip-history-intro {
    margin-top: 0;
    color: var(--theme-muted, #5f6670);
}

.trip-history-list {
    display: grid;
    gap: 0.65rem;
    margin-top: 0.75rem;
}

.trip-history-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.8rem;
    background: var(--theme-surface-soft, #f7f8fa);
    border: 1px solid var(--theme-border, #dfe2e6);
    border-radius: 8px;
}

.trip-history-entry.is-current {
    border-color: #667eea;
}

.trip-history-info {
    display: grid;
    min-width: 0;
    gap: 0.25rem;
}

.trip-history-info span {
    color: var(--theme-muted, #5f6670);
    font-size: 0.82rem;
}

.trip-history-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 0.4rem;
}

@media (max-width: 600px) {
    .trip-history-entry {
        align-items: stretch;
        flex-direction: column;
    }

    .trip-history-actions .btn {
        flex: 1;
    }
}


.published-trip-update-actions {
    flex-wrap: wrap;
}

@media (max-width: 600px) {
    .published-trip-update-actions {
        flex-direction: column;
    }

    .published-trip-update-actions .btn {
        width: 100%;
    }
}

/* Danger Button */
.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover:where(.hover-enabled *) {
    background-color: #c82333;
    transform: translateY(-1px);
}

/* Success Button */
.btn-success {
    background-color: #28a745;
    color: white;
}

.btn-success:hover:where(.hover-enabled *) {
    background-color: #218838;
    transform: translateY(-1px);
}

/* Form Validierung */
input:invalid {
    border-color: #dc3545;
}

input:valid {
    border-color: #28a745;
}

/* Loading State */
.btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
    position: relative;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    margin: auto;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
}


/* Image Source Selection Styles */

.source-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.source-tab {
    flex: 1;
    padding: 0.25rem 0.25rem;
    border: 1px solid #ddd;
    background: #f8f9fa;
    color: #495057;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    text-align: center;
}

.source-tab:hover:where(.hover-enabled *) {
    background: #e9ecef;
    border-color: #6e64c6;
}

.source-tab.active {
    background: #6e64c6;
    color: white;
    border-color: #6e64c6;
}

.source-tab.active:hover:where(.hover-enabled *) {
    background: #5a52b8;
}

.iconOnly {
    font-size: 1.3rem;
    padding: 0rem 1rem;
}


/* ==================== [CSS-10] KI-Assistent und Chat ==================== */

/* AI Assistant Styles */

.btn-ai-assistant {
    background: #6c757d;
    border: 1px solid transparent;
    background-clip: padding-box;
    position: relative;
    font-weight: 600;
    transition: all 0.3s ease;
    color: #00ff88;
    text-shadow: 0 0 1px #0f8;
    padding: 0.2rem 0.5rem;
    padding-bottom: 0;
    width: 4.5rem;
}

.btn-ai-assistant::before {
    content: '';
  position: absolute;
  inset: 0;
  padding: 1px;              /* Randstärke */
  border-radius: inherit;
  background:
    linear-gradient(45deg,
      #9400d3, #f00, #ff7f00, #ff0, #0f0, #00f, #4b0082, #9400d3,
      #f00, #ff7f00, #ff0, #0f0, #00f, #4b0082, #9400d3);
  background-size: 400% 400%;
  animation: rgbBorderRotate 10s linear infinite;
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
}


.btn-ai-assistant:hover:where(.hover-enabled *) {
    /* transform: translateY(-2px); */
    /* box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2); */
    background-color: #5a6268;
}

/* AI Button Notification Badge */
.ai-notification-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    background: #ff4444;
    color: white;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: flex;
    /* align-items: center; */
    justify-content: center;
    font-size: 8px;
    font-weight: bold;
    animation: pulse-notification 1.5s ease-in-out infinite;
    box-shadow: 0 1px 4px rgba(255, 68, 68, 0.4);
    z-index: 10;
}


/* Ensure AI buttons have relative positioning for badge */
[id^="aiAssistantBtn"], 
.btn-ai-assistant {
    position: relative;
}

.ai-assistant-modal {
    max-width: 1200px;
    max-height: 80vh;
    max-height: 80dvh;
    width: 90%;
    margin: 2rem auto;
}

/* Kompakte AI-Settings */
.ai-settings-header {
    margin-bottom: 1rem;
}

.settings-toggle-btn {
    width: 100%;
    padding: 0.75rem 1rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.settings-toggle-btn:hover:where(.hover-enabled *) {
    background: #e9ecef;
    border-color: #6e64c6;
}

.settings-icon {
    font-size: 1rem;
}

.settings-text {
    flex: 1;
    text-align: left;
    margin-left: 0.5rem;
    font-weight: 500;
    color: #495057;
}

.settings-arrow {
    font-size: 0.8rem;
    color: #6c757d;
    transition: transform 0.3s ease;
}

.settings-arrow.open {
    transform: rotate(180deg);
}

.ai-settings {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid #dee2e6;
}

.ai-setting-compact {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.ai-setting-compact label {
    font-weight: 500;
    color: #495057;
    margin: 0;
    min-width: 60px;
    font-size: 0.85rem;
}

.form-input-small {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 0.85rem;
    background: white;
}

/* Toggle Gruppe mit Header */
.ai-toggle-group {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: white;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.ai-toggle-group:last-child {
    margin-bottom: 0;
}

.ai-toggle-group-header {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ai-toggles-row {
    display: flex;
    gap: 1.5rem;
    justify-content: space-around;
    margin-bottom: 0.5rem;
}

.ai-toggles-row:last-child {
    margin-bottom: 0;
}

.paddingB {
    padding-bottom: 0.3rem;
    justify-content: space-between;
}

.ai-toggle-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ai-toggle-item label {
    font-weight: 500;
    color: #495057;
    margin: 0;
    font-size: 0.8rem;
    white-space: nowrap;
}

/* Kleine Toggle Switches */
.toggle-switch-small {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
}

.toggle-switch-small input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-label-small {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 20px;
}

.toggle-label-small:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

.toggle-switch-small input:checked + .toggle-label-small {
    background-color: #6e64c6;
}

.toggle-switch-small input:checked + .toggle-label-small:before {
    transform: translateX(16px);
}

/* Disabled Toggle Switch */
.toggle-switch-small input:disabled + .toggle-label-small {
    background-color: #e0e0e0;
    cursor: not-allowed;
    opacity: 0.6;
}

.toggle-switch-small input:disabled:checked + .toggle-label-small {
    background-color: #b0b0b0;
}

.ai-toggle-item.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.ai-setting-row {
    display: flex;
    gap: 2rem;
    align-items: center;
    flex-wrap: wrap;
}

.ai-setting-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ai-setting-group label {
    font-weight: 500;
    color: #495057;
    margin: 0;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-label {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 24px;
}

.toggle-label:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-label {
    background-color: #667eea;
}

.toggle-switch input:checked + .toggle-label:before {
    transform: translateX(26px);
}

/* Inline Prompt Examples (im Chat) */
.prompt-examples-initial {
    margin: 1.5rem 0 1rem 0.5rem;
    padding: 1rem;
    background: rgba(110, 100, 198, 0.05);
    border-radius: 12px;
    border: 1px dashed rgba(110, 100, 198, 0.2);
}

.prompt-examples-initial h4 {
    margin: 0 0 0.75rem 0;
    color: #6e64c6;
    font-size: 0.9rem;
    font-weight: 600;
}

.example-buttons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.5rem;
    grid-template-columns: repeat(2, 1fr);
}

.example-btn-inline {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    background: white;
    color: #495057;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.example-btn-inline:hover:where(.hover-enabled *) {
    background: #6e64c6;
    color: white;
    border-color: #6e64c6;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(110, 100, 198, 0.2);
}

/* Chat Interface */
.ai-chat-container {
    display: flex;
    flex-direction: column;
    min-height: 400px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
}

.ai-chat-history {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    padding-left: 0.5rem;
    background: white;
}

.ai-model {
    padding-left: 0.5rem;
}

.ai-message {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.ai-message.ai-user {
    flex-direction: row-reverse;
}

.ai-message.ai-user .message-content {
    background: #667eea;
    color: white;
    margin-right: 0;
    margin-left: 0;
    overflow: auto;
}

.ai-message.ai-model .message-content {
    background: #f8f9fa;
    margin-right: 2rem;
    margin-left: 0;
    overflow: auto;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.ai-user .message-avatar {
    background: #667eea;
    color: white;
}

.message-content {
    flex: 1;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    line-height: 1.4;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    cursor: text;
}

.retry-btn {
    font-size: 2rem !important;
    line-height: 1rem;
    margin: auto;
    display: block;
    padding-bottom: 0.5rem !important;
}

/* AI Message Action Buttons */
.ai-message-actions {
    display: flex;
    align-items: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    flex-direction: column;
    margin: auto;
}

.ai-message:hover:where(.hover-enabled *) .ai-message-actions {
    opacity: 1;
}

.ai-action-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    color: #6c757d;
}

.ai-action-btn:hover:where(.hover-enabled *) {
    background: rgba(0, 0, 0, 0.05);
    transform: scale(1.1);
}

.ai-action-btn:active {
    transform: scale(0.95);
}

/* Mobile Anpassungen für Action Buttons */
@media (max-width: 740px) {
    /* .ai-message-actions {
        opacity: 1;
    } */

    .ai-action-btn {
        padding: 0.1rem 0rem;
    }

    .ai-message.ai-model .message-content {
        margin-right: 0;
    }
    
}

.message-content p {
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
}

.message-content ul {
    margin: 0.5rem 0;
    padding-left: 1.2rem;
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
}

.message-content li {
    margin-bottom: 0.25rem;
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
}

/* JSON Response Styling */
.json-response {
    background: #f1f3f4;
    color: #303846;
    border: 1px solid #dadce0;
    border-radius: 8px;
    padding: 1rem;
    margin: 0.5rem 0;
    position: relative;
}

.json-response-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #225cb5;
}

.json-size {
    flex-shrink: 0;
    white-space: nowrap;
    font-size: 0.8rem;
    font-weight: 400;
    color: #536174;
}

html[data-theme="dark"] .json-response {
    background: var(--theme-surface);
    color: var(--theme-text);
    border-color: var(--theme-border);
}

html[data-theme="dark"] .json-response-header { color: #a9b9ff; }
html[data-theme="dark"] .json-size { color: var(--theme-muted); }

.ai-change-summary {
    margin: 0.5rem 0;
    font-size: 0.9rem;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.json-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

/* Input Area */
.ai-input-area {
    border-top: 1px solid #dee2e6;
    background: #f8f9fa;
    padding: 1rem;
}

.ai-prompt-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ai-prompt-input {
    width: 100%;
    min-height: 60px;
    padding: 0.75rem;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
    transition: border-color 0.2s ease;
}

.ai-prompt-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.ai-input-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.ai-close-btn {
    display: block;
    margin-right: auto;
}

/* Loading State */
.ai-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    border-top: 1px solid #dee2e6;
}

.ai-loading p {
    margin-top: 1rem;
    color: #6c757d;
    font-style: italic;
}

/* Markdown Styling in Chat Messages */
.message-content h1, .message-content h2, .message-content h3 {
    margin: 1rem 0 0.5rem 0;
    color: #2c3e50;
    font-weight: 600;
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
}

.message-content h1 { font-size: 1.3rem; }
.message-content h2 { font-size: 1.2rem; }
.message-content h3 { font-size: 1.1rem; }

.message-content strong {
    font-weight: 600;
    color: #2c3e50;
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
}

.message-content em {
    font-style: italic;
    color: #495057;
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
}

.message-content code {
    background: #f1f3f4;
    color: #e83e8c;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.85rem;
    border: 1px solid #dee2e6;
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
}

.message-content pre {
    background: #2d3748;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    overflow-x: auto;
    border-left: 4px solid #667eea;
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
}

.message-content pre code {
    background: transparent;
    color: inherit;
    border: none;
    padding: 0;
    font-size: 0.9rem;
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
}

.message-content ul, .message-content ol {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.message-content li {
    margin: 0.25rem 0;
    line-height: 1.4;
}

.message-content a {
    color: #667eea;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
}

.message-content a:hover:where(.hover-enabled *) {
    border-bottom-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    padding: 2px 4px;
    border-radius: 3px;
    margin: -2px -4px;
}

.message-content p {
    margin: 0.5rem 0;
    line-height: 1.5;
}

.message-content p:first-child {
    margin-top: 0;
}

.message-content p:last-child {
    margin-bottom: 0;
}

/* Streaming Animations */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
}

.typing-indicator span {
    height: 8px;
    width: 8px;
    background: #6c757d;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }
.typing-indicator span:nth-child(3) { animation-delay: 0; }


.typing-cursor {
    color: #667eea;
    font-weight: bold;
    animation: blink 1s infinite;
}


.streaming-content {
    position: relative;
}

.streaming-content p {
    margin: 0;
    line-height: 1.5;
    word-wrap: break-word;
}

/* Error Message Styling */

.message-content.error-message {
    background: #f8d7da !important;
    color: #721c24 !important;
    border-left: 4px solid #dc3545;
}

/* Improved Animation Performance */
.ai-message {
    animation: slideIn 0.3s ease-out;
}


/* Streaming and restored actions must not move between pointerdown and click. */
.ai-chat-history {
    scroll-behavior: auto;
}

/* Loading State Improvements */
.ai-loading {
    background: rgba(248, 249, 250, 0.95);
    backdrop-filter: blur(2px);
}

.ai-loading .loading-spinner .spinner {
    border-color: #667eea;
    border-top-color: transparent;
}

/* Responsive Design */
@media (max-width: 740px) {
    .ai-assistant-modal {
        width: calc(100% - 1rem);
        max-height: 90vh;
        max-height: 90dvh;
        padding-left: 1.3rem;
        padding-right: 0rem;
    }
    
    .ai-setting-row {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .ai-setting-group {
        justify-content: space-between;
    }
    
    .example-buttons {
        flex-direction: column;
    }
    
    .ai-chat-container {
        min-height: 300px;
    }
    
    .typing-indicator {
        padding: 6px 10px;
    }
    
    .typing-indicator span {
        height: 6px;
        width: 6px;
    }
    
    /* Mobile Anpassungen für Toggle-Gruppen */
    .ai-toggle-group {
        padding: 0.5rem;
    }
    
    .ai-toggle-group-header {
        font-size: 0.8rem;
        margin-bottom: 0.5rem;
        padding-bottom: 0.4rem;
    }
    
    .ai-toggles-row {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }
    
    .ai-toggle-item {
        justify-content: space-between;
        padding: 0.25rem 0;
    }
    
    .ai-toggle-item label {
        font-size: 0.85rem;
    }
}

.gradient-spinner {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: conic-gradient(
        from 0deg,
        transparent 0deg,
        transparent 270deg,
        #3498db 360deg
    );
    animation: rotate 1.2s linear infinite;
    position: relative;
}

.gradient-spinner::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 25px;
    height: 25px;
    background: white;
    border-radius: 50%;
}


.ai-thinking {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.orbit-spinner {
    width: 50px;
    height: 50px;
    position: relative;
}

.orbit-spinner::before,
.orbit-spinner::after {
    content: '';
    position: absolute;
    border-radius: 50%;
}

.orbit-spinner::before {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(52, 152, 219, 0.2);
}

.orbit-spinner::after {
    width: 10px;
    height: 10px;
    background: #3498db;
    top: 0;
    left: 20px;
    animation: orbit 1s linear infinite;
}


.ai-text {
    color: #555;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    animation: fade 2.5s ease-in-out infinite;
}


/* ==================== [CSS-11] Reisecode und Speicherstatus ==================== */

/* Moderne Code-Eingabe */
.code-input-section {
    padding: 1rem 0;
}

.input-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.input-header h3 {
    color: #667eea;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.input-description {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.4;
    margin: 0;
}

.modern-input-group {
    margin-bottom: 1.25rem;
}

.modern-label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.modern-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: all 0.3s ease;
    background: #fafbfc;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.modern-input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1), 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.modern-input::placeholder {
    color: #9ca3af;
    font-style: italic;
}

.modern-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.modern-actions .btn {
    min-width: 140px;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.modern-actions .btn:hover:where(.hover-enabled *) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

/* Ansichten-Wechsel Animation */
/* #loadOptionsView, #loadCodeView {
    transition: all 0.3s ease;
} */
/* 
#loadCodeView.show {
    animation: slideInFromRight 0.3s ease;
}

#loadOptionsView.hide {
    animation: slideOutToLeft 0.3s ease;
} */

/* @keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutToLeft {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-20px);
    }
}
 */
/* Responsive Design für Code-Eingabe */
@media (max-width: 740px) {
    .modern-input {
        font-size: 1rem;
        padding: 0.875rem 1rem;
    }
    
    .input-header h3 {
        font-size: 1.25rem;
    }
    
    .modern-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .modern-actions .btn {
        min-width: auto;
        width: 100%;
    }
}


.pulse-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.pulse-container::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  transform: translate(-50%, -50%);
  background: rgba(255, 0, 0, 0.3);
  border-radius: 50%;
  animation: inner-pulse 2s ease-in-out infinite;
  z-index: -1; /* Hinter dem Marker */
}

.pulse-container::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 150%;
  height: 150%;
  transform: translate(-50%, -50%);
  border: 3px solid rgba(255, 0, 0, 0.8);
  border-radius: 50%;
  animation: outer-pulse 2s ease-in-out infinite;
  z-index: -2; /* Hinter dem Marker */
}


/* Ungespeicherte Änderungen Indikator */
.unsaved-indicator {
    display: inline-block;
    color: #ff6b6b;
    font-size: 1.2rem;
    animation: pulse-glow 2s ease-in-out infinite;
    text-shadow: 0 0 4px rgba(255, 107, 107, 0.5);
    vertical-align: middle;
}


/* Tooltip für ungespeicherte Änderungen */
.unsaved-indicator::after {
    content: 'Ungespeicherte Änderungen';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
    margin-bottom: 0.5rem;
}

.unsaved-indicator::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
    margin-bottom: 0.1rem;
}

#saveTripBtn:hover:where(.hover-enabled *) .unsaved-indicator::after,
#saveTripBtn:hover:where(.hover-enabled *) .unsaved-indicator::before {
    opacity: 1;
}

/* Speichern-Button mit ungespeicherten Änderungen */
#saveTripBtn.has-unsaved-changes {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
}

#saveTripBtn.has-unsaved-changes:hover:where(.hover-enabled *) {
    background: linear-gradient(135deg, #ff5252 0%, #e53e3e 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
}

/* ==================== [CSS-12] Tagebuch und Wetter ==================== */

/* Tagebuch-Ansicht */
.diary-container {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
    height: 100%;
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 10px solid rgba(100,0,0,0.7);
}

.diary-header {
    background: rgba(100,0,0,0.7);
    color: white;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.diary-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.diary-controls {
    display: flex;
    gap: 0.5rem;
}

/* Wetter-Sektion */
.diary-weather-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    margin: 1rem auto;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
    transition: all 0.3s ease;
    width: fit-content;
}

/* Kompakte Wetter-Anzeige */
.weather-display {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.25rem 0;
    transition: all 0.3s ease;
}

.weather-display:hover:where(.hover-enabled *) {
    opacity: 0.9;
}

.weather-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.weather-text {
    color: white;
    font-size: 1rem;
    font-weight: 500;
    flex: 1;
}

.weather-edit-icon {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.weather-display:hover:where(.hover-enabled *) .weather-edit-icon {
    color: white;
    transform: scale(1.1);
}

/* Wetter-Controls (eingeklappt versteckt) */
.weather-controls {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.4s ease;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.diary-weather-section.collapsed .weather-display {
    display: flex;
}

.diary-weather-section.collapsed .weather-controls {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
}

.diary-weather-section.expanded .weather-display {
    margin-bottom: 1rem;
}

.diary-weather-section.expanded .weather-controls {
    max-height: 500px;
    opacity: 1;
    margin-top: 0.5rem;
}

.weather-control-group {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.weather-control-group label {
    color: white;
    font-weight: 500;
    font-size: 0.9rem;
}

.weather-select {
    padding: 0.65rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    font-size: 0.95rem;
    background: white;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
}

.weather-select:hover:where(.hover-enabled *) {
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.weather-select:focus {
    outline: none;
    border-color: white;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

.weather-select option {
    padding: 0.5rem;
}

.diary-controls .btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
}

.diary-controls .btn:hover:where(.hover-enabled *) {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.diary-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

.diary-section {
    margin-bottom: 2rem;
}

.diary-section h3 {
    color: #333;
    font-size: 1.2rem;
    margin-bottom: 1rem;
    font-weight: 600;
    border-bottom: 2px solid #667eea;
    padding-bottom: 0.5rem;
}

.bigger-textarea {
    min-height: 80px;
}

.diary-stops-section {
    margin-top: 2rem;
}

.diary-stops-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.diary-stop-entry {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.3s ease;
}

.diary-stop-entry:hover:where(.hover-enabled *) {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.diary-stop-entry.collapsed {
    padding: 0.75rem 1rem;
    cursor: pointer;
}

.diary-stop-entry.expanded {
    padding: 1.5rem;
    cursor: default;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
    border-color: #667eea;
}

.diary-stop-header {
    display: flex;
    flex-direction: column;
}

.diary-stop-entry.collapsed .diary-stop-header {
    margin-bottom: 0;
}

.diary-stop-entry.expanded .diary-stop-header {
    margin-bottom: 1rem;
}

/* Erste Zeile: Icon + Name + Edit-Button */
.diary-stop-title-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
}

.diary-stop-title-row .diary-stop-name {
    flex: 1;
    min-width: 0;
}

.diary-stop-title-row .diary-edit-btn {
    margin-left: auto;
    flex-shrink: 0;
}

.diary-stop-icon {
    font-size: 1.5rem;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.diary-stop-name {
    font-weight: 600;
    color: #333;
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* Preview-Bereich */
.diary-preview {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    width: 100%;
}

.diary-stop-entry.expanded .diary-preview,
.diary-transfer-entry.expanded .diary-preview {
    display: none;
}

.preview-text {
    width: 100%;
    font-size: 0.95rem;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    word-wrap: break-word;
    overflow-wrap: break-word;
    padding-top: 0.75rem;
}

.preview-images-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.preview-images-btn:hover:where(.hover-enabled *) {
    background: #5568d3;
    transform: scale(1.05);
}

/* Edit-Button */
.diary-edit-btn {
    background: none;
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.diary-edit-btn:hover:where(.hover-enabled *) {
    background: lightgray;
    transform: scale(1.05);
}

/* Content-Bereich (eingeklappt versteckt) */
.diary-stop-content,
.diary-transfer-content {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.3s ease;
}

.diary-stop-entry.expanded .diary-stop-content,
.diary-transfer-entry.expanded .diary-transfer-content {
    max-height: 1000px;
    opacity: 1;
    margin-top: 1rem;
}

/* Transfer-Einträge im Tagebuch */
.diary-transfer-entry {
    background: #f0f8ff;
    border: 1px solid #b0d4f1;
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.3s ease;
}

.diary-transfer-entry:hover:where(.hover-enabled *) {
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.15);
    transform: translateY(-1px);
}

.diary-transfer-entry.collapsed {
    padding: 0.75rem 1rem;
    cursor: pointer;
}

.diary-transfer-entry.expanded {
    padding: 1.5rem;
    cursor: default;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
    border-color: #3498db;
}

.diary-transfer-header {
    display: flex;
    flex-direction: column;
}

.diary-transfer-entry.collapsed .diary-transfer-header {
    margin-bottom: 0;
}

.diary-transfer-entry.expanded .diary-transfer-header {
    margin-bottom: 1rem;
}

/* Erste Zeile: Icon + Route + Edit-Button */
.diary-transfer-title-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
}

.diary-transfer-title-row .diary-transfer-name {
    flex: 1;
    min-width: 0;
}

.diary-transfer-title-row .diary-edit-btn {
    margin-left: auto;
    flex-shrink: 0;
}

.diary-transfer-icon {
    font-size: 1.5rem;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.diary-transfer-name {
    color: #3498db;
    font-weight: bold;
    font-size: 1.1rem;
}

.transfer-from,
.transfer-to {
    padding: 4px 10px;
    background: white;
    border-radius: 4px;
    font-size: 0.9rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Transfer-Bilder-Button */
.diary-image-btn {
    background: white;
    border: 2px solid #3498db;
    color: #3498db;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    margin-left: auto;
    font-family: inherit;
}

.diary-image-btn:hover:where(.hover-enabled *) {
    background: #3498db;
    color: white;
    transform: scale(1.05);
}

.diary-image-btn.has-images {
    background: #3498db;
    color: white;
    border-color: #2980b9;
}

.diary-image-btn.has-images:hover:where(.hover-enabled *) {
    background: #2980b9;
    transform: scale(1.05);
}

/* Responsive Design für Tagebuch */
@media (max-width: 740px) {
    .diary-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .diary-controls {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .diary-content {
        padding: 1rem;
    }
    
    .diary-stop-entry {
        padding: 1rem;
    }
    
    .diary-stop-header {
        flex-direction: column;
        text-align: center;
    }

    .diary-transfer-header {
        flex-direction: column;
        text-align: center;
    }

    .diary-stop-name {
        font-weight: bold;
        font-size: 1rem;
    }

    .diary-transfer-name {
        font-weight: bold;
        font-size: 1rem;
    }
}

/* Drag&Drop Aktionen Modal */
.drag-drop-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.drag-action-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem;
    text-align: left;
    min-height: 70px;
    justify-content: center;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.drag-action-btn:hover:where(.hover-enabled *) {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.drag-action-btn small {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    opacity: 0.8;
    font-weight: normal;
}

/* Drag&Drop Zustände */
.draggable-item {
    cursor: grab;
    transition: all 0.3s ease;
}

.draggable-item:hover:where(.hover-enabled *) {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.draggable-item.dragging {
    opacity: 0.5;
    cursor: grabbing;
    transform: rotate(5deg);
}

.day-tab.drag-over {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.day-tab.drag-invalid {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: white;
    cursor: not-allowed;
}

.drop-indicator {
    position: absolute;
    top: -2px;
    left: 0;
    right: 0;
    height: 4px;
    background: #667eea;
    border-radius: 2px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.day-tab.drag-over .drop-indicator {
    opacity: 1;
}

/* Hotel/Stop Items draggable */
.hotel-item, .stop-item, .transfer-item {
    position: relative;
}

.hotel-item.draggable-item, .stop-item.draggable-item {
    border: 1px dashed transparent;
}

.hotel-item.draggable-item:hover:where(.hover-enabled *), .stop-item.draggable-item:hover:where(.hover-enabled *) {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

/* Element verschieben/kopieren Modal */
.available-days-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
    max-height: 300px;
    overflow-y: auto;
}

.day-selection-btn {
    padding: 0.5rem;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    font-weight: 500;
    position: relative;
}

.day-now {
    border-color: #e63e14;
}

.day-selection-btn:hover:where(.hover-enabled *) {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.day-selection-btn.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.day-selection-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f8f9fa;
    border-color: #dee2e6;
}

.day-selection-btn.disabled:hover:where(.hover-enabled *) {
    transform: none;
    box-shadow: none;
}

.day-btn-number {
    display: block;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.day-btn-date {
    display: block;
    font-size: 0.8rem;
    opacity: 0.8;
}

.day-btn-info {
    display: block;
    font-size: 0.7rem;
    margin-top: 0.25rem;
    opacity: 0.7;
}

.move-copy-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem;
    text-align: left;
    min-height: 70px;
    justify-content: center;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.action-btn:hover:where(.hover-enabled *) {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.action-btn small {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    opacity: 0.8;
    font-weight: normal;
}

/* Multi-day Hotel Indicator */
.day-selection-btn .multi-day-indicator {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff6b6b;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.day-selection-btn.multi-day-valid .multi-day-indicator {
    background: #28a745;
}

/* Responsive Design */
@media (max-width: 740px) {
    .available-days-list {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 0.5rem;
    }
    
    .day-selection-btn {
        padding: 0.75rem 0.5rem;
    }
    
    .move-copy-actions {
        gap: 0.75rem;
    }
    
    .action-btn {
        padding: 0.75rem;
        min-height: 60px;
    }

    .json-actions {
        flex-direction: column;
    }
}

/* ==================== [CSS-13] Transfers und Karteneinstellungen ==================== */

/* Transfer-Sektion */

/* .transfer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.transfer-icon {
    font-size: 1.2rem;
    margin-right: 0.5rem;
}

.transfer-name {
    font-weight: 600;
    color: #333;
    flex: 1;
}

.transfer-actions {
    display: flex;
    gap: 0.25rem;
}

.transfer-details {
    font-size: 0.85rem;
    color: #666;
    line-height: 1.4;
}

.transfer-route {
    margin: 0.25rem 0;
}

.transfer-duration {
    font-weight: 500;
    color: #495057;
}

.transfer-multiday-indicator {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #17a2b8;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
} */

/* Transfer-Modal */
.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .form-group {
    flex: 1;
}

/* Gestrichelte Linien auf der Karte */
.transfer-route-line {
    stroke-dasharray: 10, 5;
    stroke-width: 3;
    opacity: 0.8;
}

.transfer-marker {
    border: 2px dashed #666;
    background: rgba(255, 255, 255, 0.9);
}

.transfer-popup {
    min-width: 200px;
}

.transfer-popup h4 {
    margin: 0 0 0.5rem 0;
    color: #333;
}

.transfer-popup p {
    margin: 0.25rem 0;
    font-size: 0.9rem;
}

@media (max-width: 740px) {
    .form-row {
        flex-direction: column;
        gap: 0.5rem;
    }

    .fullscreen-body {
        padding-right: 0.5rem !important;
    }
}

/* Transport Mode Selection */
.transport-mode-selection {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.transport-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
    position: relative;
}

.transport-option:hover:where(.hover-enabled *) {
    border-color: #667eea;
    background-color: #f8f9ff;
    transform: translateY(-1px);
}

.transport-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.transport-option input[type="radio"]:checked + .transport-icon {
    transform: scale(1.2);
}

.transport-option:has(input[type="radio"]:checked) {
    border-color: #667eea;
    background-color: #f0f2ff;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.transport-option:has(input[type="radio"]:checked) .transport-label {
    color: #667eea;
    font-weight: 600;
}

.transport-icon {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
    transition: transform 0.2s ease;
}

.transport-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: #333;
    transition: all 0.2s ease;
    text-align: center;
}

/* Fallback für Browser ohne :has() Support */
.transport-option.selected {
    border-color: #667eea;
    background-color: #f0f2ff;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.transport-option.selected .transport-icon {
    transform: scale(1.2);
}

.transport-option.selected .transport-label {
    color: #667eea;
    font-weight: 600;
}

/* Responsive Transport Selection */
@media (max-width: 740px) {
    .transport-mode-selection {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .transport-option {
        padding: 0.5rem 0.25rem;
    }
    
    .transport-icon {
        font-size: 1.25rem;
    }
    
    .transport-label {
        font-size: 0.8rem;
    }
}

/* Marker Visibility Controls */
.marker-visibility-controls {
    position: relative;
    display: flex;
    overflow: auto;
    flex-direction: column;
}

.marker-toggle-btn {
    background-color: #6c757d;
    color: white;
    border: none;
    position: relative;
}

.marker-toggle-btn:hover:where(.hover-enabled *) {
    background-color: #5a6268;
}

.marker-toggle-btn.active {
    background-color: #667eea;
}

.marker-options-panel {
    /*position: absolute;*/
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 0.5rem;
    z-index: 1000;
    margin-top: 0.25rem;
}

.marker-option {
    margin-bottom: 0.5rem;
}

.marker-option:last-child {
    margin-bottom: 0;
}

.marker-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
}

.marker-checkbox:hover:where(.hover-enabled *) {
    background-color: #f8f9ff;
}

.marker-checkbox input[type="checkbox"] {
    margin-right: 0.5rem;
    cursor: pointer;
}

.marker-label {
    font-size: 0.85rem;
    color: #333;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.marker-checkbox input[type="checkbox"]:checked + .marker-label {
    color: #667eea;
    font-weight: 500;
}

/* Spezielle Styling für "Alle Marker" Option */
.marker-checkbox:has(#showAllMarkers) {
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
}

.marker-checkbox:has(#showAllMarkers) .marker-label {
    font-weight: 600;
}

/* Kategorie-Überschriften im Anzeige-Panel (z.B. "Marker", "Routen") */
.marker-panel-subheading {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--theme-muted, #8a8f98);
    padding: 0.15rem 0.5rem 0.35rem;
}

.marker-panel-subheading-divider {
    border-top: 1px solid #e0e0e0;
    margin-top: 0.5rem;
    padding-top: 0.6rem;
}

/* Animation für Panel */
.marker-options-panel {
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    pointer-events: none;
}

.marker-options-panel.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
    overflow-y: auto;
}

/* Map Loading Overlay */
.map-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(2px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-loading-content {
    text-align: center;
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    max-width: 300px;
}

.map-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: mapSpin 1s linear infinite;
    margin: 0 auto 1rem auto;
}


.map-loading-text h4 {
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.map-loading-text p {
    color: #666;
    margin: 0;
    font-size: 0.9rem;
}

/* Stats Loading Overlay */
.stats-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(3px);
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.stats-loading-content {
    text-align: center;
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    max-width: 300px;
}

.stats-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: statsSpin 1s linear infinite;
    margin: 0 auto 1rem auto;
}


.stats-loading-text h4 {
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.stats-loading-text p {
    color: #666;
    margin: 0;
    font-size: 0.9rem;
}

/* Map Notifications */
.map-notification {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: start;
    column-gap: 0.5rem;
    position: absolute;
    top: 10px;
    right: 150px;
    max-width: 300px;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    z-index: 500;
    font-size: 0.85rem;
    line-height: 1.4;
    animation: slideInFromRight 0.3s ease-out;
}

.map-notification.warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

.map-notification.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.map-notification.info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

.map-notification-icon {
    font-weight: bold;
}

.map-notification-text {
    min-width: 0;
    overflow-wrap: anywhere;
}

.map-notification-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
    margin: 0;
    padding: 0;
    line-height: 1;
}

.map-notification-close:hover:where(.hover-enabled *) {
    opacity: 1;
}


/* GPS Location Button Styles */
.gps-location-btn {
    background-color: #4285f4 !important;
    color: white !important;
    border: none !important;
    transition: all 0.3s ease;
}

.gps-location-btn:hover:where(.hover-enabled *) {
    background-color: #3367d6 !important;
    transform: translateY(-1px);
}

.gps-location-btn:disabled {
    background-color: #9aa0a6 !important;
    cursor: not-allowed;
    transform: none;
}

.gps-location-btn.gps-loading {
    background-color: #ff9800 !important;
    animation: gpsLoadingPulse 1.5s ease-in-out infinite;
}


/* Location Marker Option Styles */
#locationMarkerOption {
    border-top: 1px solid #e0e0e0;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
}

#locationMarkerOption .marker-label {
    color: #4285f4;
    font-weight: 500;
}

/* User Location Marker Styles */
.user-location-marker {
    background: transparent !important;
    border: none !important;
}

.user-location-dot {
    width: 20px;
    height: 20px;
    background-color: #4285f4;
    border: 3px solid white;
    border-radius: 50%;
    position: relative;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    animation: userLocationPulse 2s infinite;
}

.user-location-pulse {
    position: absolute;
    top: -8px;
    left: -8px;
    width: 32px;
    height: 32px;
    border: 2px solid #4285f4;
    border-radius: 50%;
    opacity: 0;
    animation: userLocationRipple 2s infinite;
}


/* User Location Popup Styles */
.user-location-popup {
    text-align: center;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.user-location-popup strong {
    color: #4285f4;
    font-size: 1.1rem;
}

.user-location-popup small {
    color: #666;
    line-height: 1.4;
}
/* Mobile Map Controls Collapse System */


@media (max-width: 1410px) {
    .map-controls {
        position: absolute;
        top: 10px;
        right: 10px;
        z-index: 1000;
        transition: transform 0.3s ease;
        max-height: 95%;
    }
    
    /* Toggle Tab */
    .map-controls-tab {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        background: rgba(102, 126, 234, 0.9);
        color: white;
        width: 23px;
        height: 50px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.8rem;
        cursor: pointer;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
        backdrop-filter: blur(10px);
        border: 1px solid rgba(102, 126, 234, 0.2);
        z-index: 1001;
        transition: all 0.3s ease;
        user-select: none;
        right: -25px;
        border-radius: 0 6px 6px 0;
        border-left: none;
    }
    
    .map-controls-tab:hover:where(.hover-enabled *) {
        background: rgba(102, 126, 234, 1);
        width: 28px;
    }
    
    /* Eingeklappter Zustand - nur blauer Tab sichtbar */
    .map-controls.collapsed {
        transform: translateX(calc(100% + 10px)) !important;
    }
    
    .map-controls.collapsed .map-controls-content {
        opacity: 0 !important;
        pointer-events: none !important;
        visibility: hidden !important;
    }
    
    .map-controls.collapsed .map-controls-tab {
        left: -23px !important;
        right: auto !important;
        border-radius: 6px 0 0 6px !important;
        border-right: none !important;
        border-left: 1px solid rgba(102, 126, 234, 0.2) !important;
        box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1) !important;
    }
    
    /* Ausgeklappter Zustand - normales Panel ohne Tab */
    .map-controls:not(.collapsed) .map-controls-tab {
        display: none !important;
    }
    
    .map-controls:not(.collapsed) .map-controls-content {
        opacity: 1 !important;
        pointer-events: all !important;
        visibility: visible !important;
    }
    
    /* Tab Arrow Styling */
    .tab-arrow {
        display: block;
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .tab-arrow::before {
        font-size: 0.8rem;
        color: white;
    }
    
    /* Content-Bereich */
    .map-controls-content {
        background: rgba(255, 255, 255, 0.95);
        border-radius: 8px;
        padding: 10px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.2);
        display: flex;
        flex-direction: column;
        gap: 8px;
        min-width: 140px;
        transition: opacity 0.3s ease;
    }
    
    .marker-checkbox input[type="checkbox"] {
        width: 16px;
        height: 16px;
    }
}

/* Landscape Mobile Optimizations */
/* @media screen and (orientation: landscape) and (max-height: 500px) {
    .map-controls {
        top: 5px;
        right: 5px;
    }
    
    .map-controls.collapsed::before,
    .map-controls:not(.collapsed)::before {
        height: 50px;
        width: 22px;
        font-size: 0.7rem;
    }
    
    .map-controls.collapsed::before:hover:where(.hover-enabled *),
    .map-controls:not(.collapsed)::before:hover:where(.hover-enabled *) {
        width: 25px;
    }
    
    .map-controls-content {
        padding: 8px;
        gap: 6px;
        min-width: 120px;
    }
    
    .map-controls .btn {
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
        min-height: 28px;
    }
    
    .marker-options-panel {
        max-height: 120px;
    }
    
    .marker-checkbox {
        min-height: 24px;
    }
} */

/* ==================== [CSS-14] Bilder und Filter ==================== */

/* Pcloud Images Modal Styles */
.large-modal {
    max-width: 80vw;
    max-height: 80vh;
    max-height: 80dvh;
    overflow: hidden;
}

.fullscreen-body {
    display: flex;
    justify-content: center;
}

.fullscreen-body img {
    max-width: 100%;
    max-height: 70vh;
    max-height: 70dvh;
    object-fit: contain;
    border-radius: 8px;
}

.pcloud-input-container {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
    padding-bottom: 1rem;
}

.pcloud-input-container input {
    flex: 1;
    padding: 0.5rem
}

.pcloud-loading {
    text-align: center;
    padding: 2rem;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}


.pcloud-controls {
    border-bottom: 1px solid #e0e0e0;
    padding-right: 1.3rem;
}

.image-padding {
    padding-right: 1.3rem;
}
.view-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.view-toggle {
    display: flex;
    gap: 0.25rem;
}

.view-btn {
    padding: 0.2rem;
    border: 2px solid #ddd;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Control Sections */
.control-section {
    margin-bottom: 0.75rem;
}

.control-heading {
    font-size: 0.75rem;
    font-weight: 600;
    color: #666;
    margin: 0 0 0.25rem 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1;
}

.control-heading-inline {
    font-size: 0.7rem;
    font-weight: 600;
    color: #666;
    margin: 0 0 0.15rem 0;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1;
    text-align: left;
}

.sort-filter-controls {
    display: flex;
    gap: 0.5rem;
}


.filter-controls {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

/* Filter Groups */
.date-filter-group,
.type-filter-group,
.exclude-filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sort-controls {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    align-items: flex-start;
}

/* Custom Date Range */
.custom-date-range {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    box-sizing: border-box;
}

.date-inputs {
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.date-input {
    padding: 0.2rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.85rem;
}

.date-separator {
    color: #666;
    font-weight: 500;
    white-space: nowrap;
}


.selection-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.selection-buttons {
    display: flex;
    gap: 0.25rem;
}

.selection-buttons .btn {
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
}

#selectRangeBtn.active {
    background-color: #ff9800 !important;
    color: white !important;
}

/* Range Selection Hint */
.range-selection-hint {
    background: rgba(255, 152, 0, 0.1);
    border: 2px solid #ff9800;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    text-align: center;
    animation: pulse 2s infinite;
}

.hint-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.hint-icon {
    font-size: 1.2rem;
}

.hint-text {
    font-weight: 600;
    color: #ff9800;
}


/* Range Start Marking */
.range-start {
    border: 3px solid #ff9800 !important;
    box-shadow: 0 0 10px rgba(255, 152, 0, 0.5) !important;
}

/* Mobile Filter Button */
.mobile-filter-button {
    display: none;
}

.mobile-filter-button .btn {
    width: 100%;
    text-align: center;
}

/* Mobile Filter Modal */
.mobile-filter-content {
    padding: 0;
    padding-right: 0.65rem;
    overflow-y: auto;
}

.mobile-filter-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e0e0e0;
}

.mobile-filter-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.mobile-sort-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.mobile-date-filter {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mobile-custom-date-range {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 0.75rem;
    margin-top: 0.5rem;
}

.mobile-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 6px;
    cursor: pointer;
}

/* Mobile Responsive Updates */
@media (max-width: 740px) {
    /* Hide desktop filter controls on mobile */
    .desktop-filter-controls {
        display: none !important;
    }
    
    /* Show mobile filter button */
    .mobile-filter-button {
        display: block !important;
    }

    .mobile-date-filter {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .control-section {
        margin-bottom: 1rem;
    }
    
    .control-heading {
        font-size: 0.7rem;
        margin-bottom: 0.4rem;
    }
    
    .control-heading-inline {
        font-size: 0.65rem;
        margin-bottom: 0.2rem;
    }
    
    .sort-filter-controls {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .filter-controls {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .date-filter-group {
        gap: 0.4rem;
    }
    
    .date-inputs {
        flex-direction: column;
        align-items: stretch;
    }
    
    .date-separator {
        text-align: center;
        margin: 0.25rem 0;
    }
    
    .date-input {
        min-width: auto;
    }
    
    .selection-controls {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .form-select {
        font-size: 0.8rem;
        padding: 0.4rem;
    }

    .map-controls .btn {
        margin-bottom: 0.1rem;
        padding: 0.3rem 0.6rem;
    }
}

.form-select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    font-size: 0.9rem;
}

.selection-info {
    font-weight: 600;
    color: var(--primary-color);
}

/* Images Grid View */
.images-grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    padding: 1rem 0;
}

.image-grid-item {
    position: relative;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #f8f9fa;
}

.image-grid-item:hover:where(.hover-enabled *) {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.image-grid-item.selected {
    border-color: var(--primary-color);
    background: rgba(102, 126, 234, 0.1);
}

.image-thumbnail {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
}

.image-placeholder {
    width: 100%;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    color: #666;
    font-size: 2rem;
}

.image-info {
    padding: 0.5rem;
    background: white;
}

.image-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
    word-break: break-word;
}

.image-meta {
    font-size: 0.7rem;
    color: #666;
}

.image-checkbox {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 20px;
    height: 20px;
    z-index: 10;
}

.image-menu {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
}

.image-menu-btn {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 120px;
    z-index: 20;
    display: none;
}

.image-menu-dropdown.show {
    display: block;
}

.image-menu-item {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.image-menu-item:hover:where(.hover-enabled *) {
    background: #f8f9fa;
}

.image-menu-item:last-child {
    border-bottom: none;
}

/* Images List View */
.images-list-view {
    padding: 1rem 0;
}

.image-list-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
    overflow: hidden;
}

.image-list-item:hover:where(.hover-enabled *) {
    border-color: var(--primary-color);
    background: rgba(102, 126, 234, 0.05);
}

.image-list-item.selected {
    border-color: var(--primary-color);
    background: rgba(102, 126, 234, 0.1);
}

.image-list-checkbox {
    margin-right: 1rem;
}

.image-list-icon {
    width: 40px;
    height: 40px;
    background: #f0f0f0;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    font-size: 1.2rem;
    color: #666;
}

.image-list-details {
    flex: 1;
}

.image-list-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
}

.image-list-meta {
    font-size: 0.8rem;
    color: #666;
}

.no-images-message {
    text-align: center;
    padding: 3rem 1rem;
    color: #666;
}

.no-images-message p {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

/* Add Images Button in Diary */
.diary-images-btn {
    margin-top: 0.5rem;
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    border: 2px dashed #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    color: #666;
    font-size: 0.9rem;
}

.diary-images-btn:hover:where(.hover-enabled *) {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(102, 126, 234, 0.05);
}

.diary-images-btn.has-images {
    background: rgba(102, 126, 234, 0.1);
    border-color: var(--primary-color);
    color: var(--primary-color);
    border-style: solid;
}

/* Mobile Responsive */
@media (max-width: 740px) {
    .large-modal {
        width: 95vw;
        max-width: 95vw;
        height: 95%;
        max-height: 95%;
        padding-left: 1rem;
        padding-top: 1rem;
        padding-right: 0.35rem;
    }

    .small-modal {
        padding-left: 1rem;
        padding-top: 1rem;
        padding-right: 0.35rem;
        margin-top: 10%;
    }
    
    .images-grid-view {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.75rem;
    }
    
    .image-thumbnail, .image-placeholder {
        height: 100px;
    }
    
    .pcloud-input-container input {
        margin-bottom: 0.5rem;
        padding: 0.3rem;
    }

    .image-padding {
        padding-right: 0.65rem;
    }
}

/* ==================== [CSS-15] Suche und Darkmode ==================== */

/* Stop Context Menu */
.stop-context-menu {
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 0.25rem 0;
    min-width: 140px;
    font-size: 0.9rem;
}

.context-menu-item {
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.context-menu-item:hover:where(.hover-enabled *) {
    background: #f8f9fa;
}

.context-menu-item.danger {
    color: #dc3545;
}

.context-menu-item.danger:hover:where(.hover-enabled *) {
    background: #f8d7da;
}

/* Google Maps Integration */
.google-maps-link {
    cursor: pointer;
    text-decoration: underline;
    color: #667eea !important;
    transition: color 0.2s ease;
}

.google-maps-link:hover:where(.hover-enabled *) {
    color: #5a67d8 !important;
    text-decoration: underline;
}

.google-maps-route-btn {
    background: #4285f4;
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.google-maps-route-btn:hover:where(.hover-enabled *) {
    background: #3367d6;
}

/* Expandable Location Elements */
.expandable-location {
    display: inline;
}

.location-dots {
    cursor: pointer;
    color: #667eea;
    font-weight: bold;
    padding: 0 2px;
    transition: color 0.2s ease;
}

.location-dots:hover:where(.hover-enabled *) {
    color: #5a67d8;
    text-decoration: underline;
}

.location-remaining {
    display: none;
}

.location-truncated {
    display: inline;
}

/* Optionaler Darkmode */
.theme-menu-item {
    cursor: default;
}

.theme-menu-item .theme-switch {
    margin-left: auto;
}

.travel-mode-menu-item {
    cursor: default;
}

/* Globale Reisesuche */
.global-search-modal-content {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    min-height: 0;
}

.global-search-modal-body {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.global-search-input-wrap {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-height: 3rem;
    padding: 0.2rem 0.75rem;
    border: 1px solid #d8dce5;
    border-radius: 10px;
    background: #f8f9fc;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.global-search-input-wrap:focus-within {
    border-color: var(--primary-color);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.14);
}

#globalSearchInput {
    flex: 1;
    min-width: 0;
    padding: 0.6rem 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: #2f3440;
    font: inherit;
    user-select: text;
}

#globalSearchInput::-webkit-search-cancel-button {
    display: none;
}

.global-search-clear {
    display: inline-flex;
    flex: 0 0 2.5rem;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #6c7380;
    font: 1.5rem/1 sans-serif;
    cursor: pointer;
}

.global-search-clear[hidden] {
    display: none;
}

.global-search-clear:hover:where(.hover-enabled *),
.global-search-clear:focus-visible {
    background: rgba(102, 126, 234, 0.14);
    color: var(--primary-color);
    outline: none;
}

.global-search-status {
    min-height: 1.15rem;
    margin: 0.45rem 0;
    color: #7b8390;
    font-size: 0.78rem;
}

.global-search-results {
    flex: 1;
    min-height: 220px;
    max-width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    margin-right: -0.2rem;
    padding-right: 0.2rem;
    scrollbar-width: thin;
}

.global-search-result {
    display: grid;
    grid-template-columns: 2.25rem minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.7rem;
    width: 100%;
    padding: 0.72rem 0.65rem;
    border: 0;
    border-bottom: 1px solid #eceef3;
    border-radius: 8px;
    background: transparent;
    color: #2f3440;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 0.16s ease, transform 0.16s ease;
}

.global-search-result:hover:where(.hover-enabled *),
.global-search-result:focus-visible,
.global-search-result.is-selected {
    outline: 0;
    background: rgba(102, 126, 234, 0.1);
}

.global-search-result:active {
    transform: scale(0.992);
}

.global-search-result-icon {
    display: grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 9px;
    background: rgba(102, 126, 234, 0.12);
    font-size: 1.15rem;
}

.global-search-result-content {
    min-width: 0;
}

.global-search-result-title,
.global-search-result-preview {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.global-search-result-title {
    margin-bottom: 0.18rem;
    font-weight: 600;
}

.global-search-result-preview {
    color: #737b88;
    font-size: 0.8rem;
}

.global-search-result-day {
    padding: 0.22rem 0.48rem;
    border-radius: 999px;
    background: #eef0f6;
    color: #656d7a;
    font-size: 0.72rem;
    white-space: nowrap;
}

.global-search-empty {
    display: grid;
    place-items: center;
    align-content: center;
    min-height: 220px;
    padding: 2rem;
    color: #8b929e;
    text-align: center;
}

.global-search-empty > span {
    margin-bottom: 0.5rem;
    font-size: 2rem;
    opacity: 0.55;
}

.global-search-target-pulse {
    animation: globalSearchTargetPulse 1.6s ease;
}


@media (max-width: 740px) {
    .global-search-modal-content {
        max-height: 95dvh;
        margin: 2.5dvh auto;
    }

    .global-search-results {
        min-height: 0;
    }

    .global-search-empty {
        min-height: min(180px, 30dvh);
    }

    .global-search-result {
        grid-template-columns: 2.1rem minmax(0, 1fr);
        gap: 0.6rem;
        padding: 0.72rem 0.45rem;
    }

    .global-search-result-day {
        grid-column: 2;
        justify-self: start;
        margin-top: -0.2rem;
    }
}

html[data-theme="dark"] {
    color-scheme: dark;
    --light-color: #262c3a;
    --dark-color: #eef1f7;
    --theme-page: #11141c;
    --theme-surface: #1b202c;
    --theme-surface-raised: #222938;
    --theme-surface-soft: #272f40;
    --theme-border: #3a4355;
    --theme-text: #eef1f7;
    --theme-muted: #aeb7c7;
}

html[data-theme="dark"] body {
    background-color: var(--theme-page);
    color: var(--theme-text);
}

html[data-theme="dark"] :where(
    .sidebar,
    .bottom-nav,
    .mobile-menu,
    .modal-content,
    .diary-container,
    .app-lock-message,
    .print-processing-content,
    .map-loading-content,
    .stats-loading-content,
    .marker-options-panel,
    .image-menu-dropdown,
    .stop-context-menu,
    .map-context-menu
) {
    color: var(--theme-text);
    background: var(--theme-surface);
    border-color: var(--theme-border);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.38);
}

html[data-theme="dark"] .trip-participants-content {
    border-color: var(--theme-border);
}

html[data-theme="dark"] .trip-traveler-count-row {
    border-bottom-color: var(--theme-border);
}

html[data-theme="dark"] .trip-traveler-count-label { color: var(--theme-text); }
html[data-theme="dark"] .trip-traveler-count-label small,
html[data-theme="dark"] .trip-traveler-count-input { color: var(--theme-muted); }
html[data-theme="dark"] .trip-traveler-count-input {
    background: #171c27;
    border-color: var(--theme-border);
}
html[data-theme="dark"] .trip-traveler-count-input .form-input {
    background: transparent !important;
    border: 0 !important;
}

html[data-theme="dark"] .trip-participants-option summary {
    color: var(--theme-text);
}

html[data-theme="dark"] .trip-participant-chip {
    color: var(--theme-text);
    background: #262d3a;
    border-color: var(--theme-border);
}

html[data-theme="dark"] .trip-participant-remove { color: #aeb7c6; }

html[data-theme="dark"] :where(
    .mobile-menu-header,
    .mobile-days-list,
    .day-content h3,
    .day-tab,
    .suggestions,
    .stop-item,
    .hotel-item,
    .transfer-item,
    .day-city-row,
    .linked-trip-item,
    .compare-linked-trip-button,
    .hotel-portal-link,
    .stats-controls,
    .stats-table th,
    .route-point-display,
    .source-tab,
    .settings-toggle-btn,
    .ai-settings,
    .ai-toggle-group,
    .ai-chat-history,
    .ai-message.ai-model .message-content,
    .ai-input-area,
    .diary-stop-entry,
    .diary-transfer-entry,
    .day-selection-btn,
    .transport-option,
    .view-btn,
    .custom-date-range,
    .mobile-custom-date-range,
    .image-info,
    .image-list-item,
    .diary-images-btn,
    .kai-form-panel,
    .hotel-cancellation-deadline
) {
    color: var(--theme-text);
    background: var(--theme-surface-raised);
    border-color: var(--theme-border);
}

html[data-theme="dark"] :where(
    .stop-item.disabled,
    .transfer-item.disabled,
    .day-selection-btn.disabled,
    .suggestion-type,
    .message-avatar
) {
    background: var(--theme-surface-soft);
}

html[data-theme="dark"] :where(
    .mobile-menu-item:hover:where(.hover-enabled *),
    .suggestion-item:hover:where(.hover-enabled *),
    .context-menu-item:hover:where(.hover-enabled *),
    .stats-tab:hover:where(.hover-enabled *),
    .stats-table tr:hover:where(.hover-enabled *),
    .route-point-display:hover:where(.hover-enabled *),
    .source-tab:hover:where(.hover-enabled *),
    .settings-toggle-btn:hover:where(.hover-enabled *),
    .image-menu-item:hover:where(.hover-enabled *)
) {
    background-color: var(--theme-surface-soft);
}

html[data-theme="dark"] :where(
    h1, h2, h3, h4, h5, h6,
    .trip-info h2,
    .day-navigation h3,
    .modal-content h3,
    .mobile-menu-header h3,
    .mobile-menu-item,
    .mobile-menu-close,
    .form-group label,
    .section h4,
    .linked-trip-info strong,
    .stop-name,
    .hotel-name,
    .transfer-name,
    .route-point-name,
    .diary-stop-name,
    .diary-transfer-name
) {
    color: var(--theme-text);
}

html[data-theme="dark"] :where(
    .optional-label,
    .form-hint,
    .trip-participants-summary small,
    .linked-trip-info small,
    .stop-details,
    .hotel-details,
    .transfer-details,
    .route-point-coords,
    .bottom-nav-item,
    .kai-form-hint,
    .kai-form-header
) {
    color: var(--theme-muted);
}

html[data-theme="dark"] :where(input, textarea, select, .form-input, .form-textarea, .form-select, .modern-input) {
    color: var(--theme-text);
    background-color: #171c27;
    border-color: var(--theme-border);
}

html[data-theme="dark"] :where(.form-input-small, .weather-select, .modern-input) {
    color: var(--theme-text);
    background: #171c27;
    border-color: var(--theme-border);
}

html[data-theme="dark"] :where(input, textarea, select, .form-input, .form-textarea, .form-select, .modern-input):focus {
    color: var(--theme-text);
    background-color: #171c27;
    border-color: #8798ff;
}

html[data-theme="dark"] #globalSearchInput,
html[data-theme="dark"] .global-search-result {
    color: var(--theme-text);
}

html[data-theme="dark"] .global-search-status,
html[data-theme="dark"] .global-search-result-preview,
html[data-theme="dark"] .global-search-empty {
    color: var(--theme-muted);
}

html[data-theme="dark"] .global-search-input-wrap {
    background: #171c27;
    border-color: var(--theme-border);
}

html[data-theme="dark"] .global-search-input-wrap:focus-within {
    background: #171c27;
    border-color: #8798ff;
    box-shadow: 0 0 0 3px rgba(135, 152, 255, 0.17);
}

html[data-theme="dark"] .global-search-result-day {
    color: var(--theme-muted);
    background: var(--theme-surface-soft);
    border-color: var(--theme-border);
}

html[data-theme="dark"] .global-search-result {
    border-color: var(--theme-border);
}

html[data-theme="dark"] .global-search-result:hover:where(.hover-enabled *),
html[data-theme="dark"] .global-search-result:focus-visible,
html[data-theme="dark"] .global-search-result.is-selected,
html[data-theme="dark"] .global-search-result-icon {
    background: rgba(135, 152, 255, 0.16);
}

html[data-theme="dark"] .modern-input:focus {
    color: var(--theme-text);
    background: #171c27;
}

html[data-theme="dark"] :where(.mobile-menu-header, .bottom-nav, .sidebar, .day-content h3, .modal-content, .linked-trip-item) {
    border-color: var(--theme-border);
}

html[data-theme="dark"] :where(.day-content, .travel-mode-scroll, .days-list, .sidebar, .form-outer, .form-inner, .mobile-menu-content) {
    scrollbar-color: #59647a var(--theme-surface);
}

html[data-theme="dark"] :where(.day-content, .travel-mode-scroll, .days-list, .sidebar, .form-outer)::-webkit-scrollbar-track {
    background: var(--theme-surface);
}

html[data-theme="dark"] :where(.day-content, .travel-mode-scroll, .days-list, .sidebar, .form-outer)::-webkit-scrollbar-thumb {
    background: #59647a;
}

html[data-theme="dark"] .kai-form-assistant {
    border-color: rgba(115, 147, 255, 0.42);
    background: linear-gradient(135deg, rgba(48, 214, 229, 0.11), rgba(112, 72, 219, 0.16));
}

html[data-theme="dark"] .kai-form-toggle {
    color: #dce5ff;
    border-color: rgba(135, 152, 255, 0.55);
    background: linear-gradient(135deg, rgba(48, 214, 229, 0.18), rgba(112, 72, 219, 0.25));
}

html[data-theme="dark"] img[src$="assets/kaiDunkel.png"] {
    content: url("../assets/kaiHell.png");
}

html[data-theme="dark"] :where(.leaflet-control-zoom a, .leaflet-control-layers, .leaflet-popup-content-wrapper, .leaflet-popup-tip) {
    color: var(--theme-text);
    background: var(--theme-surface-raised);
    border-color: var(--theme-border);
}

html[data-theme="dark"] .leaflet-popup-content-wrapper {
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.48);
}

html[data-theme="dark"] .leaflet-popup-content,
html[data-theme="dark"] .leaflet-popup-content :where(b, strong) {
    color: var(--theme-text);
}

html[data-theme="dark"] .leaflet-popup-content :where(a, .item-location) {
    color: #aeb8ff;
}

html[data-theme="dark"] .leaflet-popup-content hr {
    height: 0;
    border: 0;
    border-top: 1px solid var(--theme-border);
}

html[data-theme="dark"] .leaflet-container a.leaflet-popup-close-button {
    color: var(--theme-muted);
    background: transparent;
}

html[data-theme="dark"] .leaflet-container a.leaflet-popup-close-button:hover:where(.hover-enabled *),
html[data-theme="dark"] .leaflet-container a.leaflet-popup-close-button:focus-visible {
    color: var(--theme-text);
    background: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .user-location-popup strong {
    color: #8fb2ff;
}

html[data-theme="dark"] .leaflet-control-attribution {
    color: var(--theme-muted);
    background: rgba(27, 32, 44, 0.88);
}

html[data-theme="dark"] .leaflet-control-attribution a {
    color: #9eabff;
}

@media print {
    html[data-theme="dark"] {
        color-scheme: light;
    }

    html[data-theme="dark"] body {
        color: #222;
        background: white;
    }
}

/* Verbindliche Darkmode-Farben. Diese Ebene fängt auch dynamisch erzeugte Inhalte ab. */
html[data-theme="dark"] body,
html[data-theme="dark"] .container {
    color: var(--theme-text) !important;
    background: var(--theme-page) !important;
}

html[data-theme="dark"] :where(
    .sidebar,
    .bottom-nav,
    .modal-content,
    .diary-container,
    .app-lock-message,
    .print-processing-content,
    .map-loading-content,
    .stats-loading-content,
    .image-menu-dropdown,
    .ai-chat-history,
    .day-navigation,
    .transfer-from,
    .transfer-marker
) {
    color: var(--theme-text) !important;
    background: var(--theme-surface) !important;
    border-color: var(--theme-border) !important;
}

html[data-theme="dark"] .diary-container {
    border-color: rgba(50,0,0,0.7) !important;
}

html[data-theme="dark"] .diary-header {
    background: rgba(50,0,0,0.7) !important;
}

html[data-theme="dark"] :where(
    .mobile-menu-header,
    .mobile-days-list,
    .mobile-days-list .day-btn,
    .day-content h3,
    .suggestions,
    .stop-item,
    .hotel-item,
    .transfer-item,
    .day-city-row,
    .linked-trip-item,
    .compare-linked-trip-button,
    .hotel-search-panel,
    .trip-participants-content,
    .hotel-portal-link,
    .stats-controls,
    .stats-table th,
    .route-point-display,
    .source-tab,
    .settings-toggle-btn,
    .ai-settings,
    .ai-toggle-group,
    .ai-message.ai-model .message-content,
    .ai-input-area,
    .diary-stop-entry,
    .diary-transfer-entry,
    .day-selection-btn,
    .transport-option,
    .view-btn,
    .custom-date-range,
    .mobile-custom-date-range,
    .mobile-checkbox-label,
    .image-grid-item,
    .image-info,
    .image-list-item,
    .diary-images-btn,
    .kai-form-panel,
    .hotel-cancellation-deadline,
    .example-btn-inline,
    .map-controls,
    .map-controls-content
) {
    color: var(--theme-text) !important;
    background: var(--theme-surface-raised) !important;
    border-color: var(--theme-border) !important;
}

html[data-theme="dark"] :where(
    .sidebar-expand-all-btn,
    .stop-category-icon,
    .stop-category-combined,
    .diary-stop-icon,
    .diary-transfer-icon,
    .transfer-to,
    .diary-image-btn,
    .image-placeholder,
    .image-list-icon,
    .message-avatar,
    .suggestion-type,
    .mobile-menu,
    .marker-options-panel,
    .map-context-menu,
    .stop-context-menu
) {
    color: var(--theme-text) !important;
    background: var(--theme-surface-soft) !important;
    border-color: var(--theme-border) !important;
}


html[data-theme="dark"] :where(
    .mobile-menu-item:hover:where(.hover-enabled *),
    .context-menu-item:hover:where(.hover-enabled *),
    .marker-checkbox:hover:where(.hover-enabled *),
) {
    background: var(--theme-border) !important;
}

html[data-theme="dark"] :where(
    .mobile-days-list .day-btn:hover:where(.hover-enabled *),
    .suggestion-item:hover:where(.hover-enabled *),
    .day-tab:hover:where(.hover-enabled *),
    .stats-tab:hover:where(.hover-enabled *),
    .stats-table tr:hover:where(.hover-enabled *),
    .route-point-display:hover:where(.hover-enabled *),
    .source-tab:hover:where(.hover-enabled *),
    .settings-toggle-btn:hover:where(.hover-enabled *),
    .hotel-portal-link:hover:where(.hover-enabled *),
    .sidebar-expand-all-btn:hover:where(.hover-enabled *),
    .image-menu-item:hover:where(.hover-enabled *)
) {
    background: var(--theme-surface-soft) !important;
}

html[data-theme="dark"] :where(
    h1, h2, h3, h4, h5, h6,
    .trip-info h2,
    .day-navigation h3,
    .day-content h3,
    .section h4,
    .modal-content h3,
    .mobile-menu-header h3,
    .mobile-menu-item,
    .mobile-menu-close,
    .item-title,
    .item-details,
    .form-group label,
    .modern-label,
    .settings-text,
    .settings-arrow,
    .ai-toggle-group-header,
    .ai-toggle-item label,
    .ai-setting-group label,
    .ai-setting-compact label,
    .message-content h1,
    .message-content h2,
    .message-content h3,
    .message-content strong,
    .message-content em,
    .context-menu-item,
    .stats-table th,
    .costs-section h4,
    .route-point-name,
    .diary-section h3,
    .diary-stop-name,
    .diary-transfer-name,
    .transfer-name,
    .transfer-popup h4,
    .transport-label,
    .marker-label,
    .image-name,
    .image-list-name,
    .map-loading-text h4,
    .stats-loading-text h4,
    #printProcessingTitle
) {
    color: var(--theme-text) !important;
}

html[data-theme="dark"] :where(
    .bottom-nav-item,
    .optional-label,
    .form-hint,
    .linked-trips-intro,
    .linked-trip-info small,
    .linked-trips-empty,
    .day-cities-intro,
    .hotel-search-dates,
    .star-text,
    .stats-tab,
    .cost-category,
    .route-point-coords,
    .input-description,
    .ai-text,
    .ai-action-btn,
    .ai-loading p,
    .kai-form-hint,
    .kai-form-header,
    .transfer-details,
    .transfer-duration,
    .control-heading,
    .control-heading-inline,
    .date-separator,
    .image-meta,
    .image-list-meta,
    .no-images-message,
    .diary-images-btn,
    .map-loading-text p,
    .stats-loading-text p,
    .app-lock-message p,
    .user-location-popup small,
    #printProcessingMessage
) {
    color: var(--theme-muted) !important;
}

html[data-theme="dark"] .context-menu-item {
    border-bottom: 1px solid gray;
}

html[data-theme="dark"] :where(input, textarea, select, .form-input, .form-textarea, .form-input-small, .form-select, .modern-input, .weather-select) {
    color: var(--theme-text) !important;
    background: #151a24 !important;
    border-color: var(--theme-border) !important;
    box-shadow: none;
}

html[data-theme="dark"] :is(#bottomNavUndo, #bottomNavRedo):not(:disabled) {
    color: #aeb9ff !important;
}

html[data-theme="dark"] :is(#bottomNavUndo, #bottomNavRedo):disabled {
    color: #5f6878 !important;
}

html[data-theme="dark"] :where(input, textarea, select, .form-input, .form-textarea, .form-input-small, .form-select, .modern-input, .weather-select):focus {
    color: var(--theme-text) !important;
    background: #151a24 !important;
    border-color: #8d9cff !important;
    box-shadow: 0 0 0 3px rgba(141, 156, 255, 0.18) !important;
}

html[data-theme="dark"] #globalSearchInput,
html[data-theme="dark"] #globalSearchInput:focus {
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
}

html[data-theme="dark"] :where(input, textarea)::placeholder {
    color: #929caf !important;
    opacity: 1;
}

html[data-theme="dark"] input:-webkit-autofill,
html[data-theme="dark"] input:-webkit-autofill:hover:where(.hover-enabled *),
html[data-theme="dark"] input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--theme-text) !important;
    box-shadow: 0 0 0 1000px #151a24 inset !important;
}

html[data-theme="dark"] .map-notification.warning {
    color: #ffe7a0 !important;
    background: #4a3b16 !important;
    border-color: #7b641f !important;
}

html[data-theme="dark"] .map-notification.error,
html[data-theme="dark"] .message-content.error-message {
    color: #ffc6cc !important;
    background: #4a2026 !important;
    border-color: #8e3844 !important;
}

html[data-theme="dark"] .map-notification.info {
    color: #c3eff7 !important;
    background: #173d46 !important;
    border-color: #2b7180 !important;
}

html[data-theme="dark"] :where(.transport-option.selected, .transport-option:has(input[type="radio"]:checked)) {
    color: var(--theme-text) !important;
    background: #2c3150 !important;
}

html[data-theme="dark"] [style*="#9e5809"] {
    color: #ffbd69 !important;
}

html[data-theme="dark"] .suggestion-item[style*="color: #666"],
html[data-theme="dark"] .suggestion-item[style*="color: #999"] {
    color: var(--theme-muted) !important;
}

html[data-theme="dark"] .gradient-spinner::before {
    background: var(--theme-surface) !important;
}

html[data-theme="dark"] :where(.app-lock-overlay, .map-loading-overlay, .stats-loading-overlay) {
    background: rgba(10, 13, 19, 0.82) !important;
}

html[data-theme="dark"] :where(.stop-item.disabled, .transfer-item.disabled) {
    color: var(--theme-muted) !important;
    background: #202634 !important;
    border-color: var(--theme-border) !important;
    opacity: 0.72;
}

html[data-theme="dark"] :where(.stop-item.disabled .stop-name, .stop-item.disabled .stop-details, .transfer-item.disabled .transfer-name, .transfer-item.disabled .transfer-details) {
    color: var(--theme-muted) !important;
}

html[data-theme="dark"] :where(.day-item.no-hotel, .day-tab.no-hotel) {
    color: #ffd2d5 !important;
    background: #75343b !important;
    border-color: #a94a55 !important;
}

html[data-theme="dark"] :where(.day-item.no-hotel, .day-tab.no-hotel):hover:where(.hover-enabled *) {
    background: #843b44 !important;
}

html[data-theme="dark"] .day-tab.is-today,
html[data-theme="dark"] .day-tab.is-today:hover:where(.hover-enabled *) {
    color: #fff !important;
    background: #287f4b !important;
    border-color: #43b675 !important;
}

html[data-theme="dark"] #map.dark-map-tiles .leaflet-tile-pane {
    filter: brightness(0.62) invert(1) contrast(2.15) hue-rotate(195deg) saturate(0.45) brightness(0.78);
}

html[data-theme="dark"] #map .leaflet-tile-pane {
    transition: filter 0.2s ease;
}

html[data-theme="dark"] #appContainer.mobile-view-travel .travel-mode-view {
    color: var(--theme-text);
    background: var(--theme-surface);
}

html[data-theme="dark"] #appContainer.mobile-view-travel .travel-mode-scroll {
    color: var(--theme-text);
    background: transparent;
}

html[data-theme="dark"] .main-content > #sharedDayNav {
    background: var(--theme-surface);
}

html[data-theme="dark"] #day-content-id > .section > h4 {
    background: var(--theme-surface);
}


html[data-theme="dark"] #appContainer.mobile-view-travel .travel-mode-view {
    border-color: var(--theme-border);
}

html[data-theme="dark"] :where(.travel-focus-card, .travel-timeline-section, .travel-day-todos, .travel-day-notes) {
    color: var(--theme-text);
    background: var(--theme-surface);
    border-color: var(--theme-border);
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.26);
}

html[data-theme="dark"] .travel-focus-card {
    background: linear-gradient(145deg, var(--theme-surface) 55%, #242943);
    border-color: rgba(135, 152, 255, 0.45);
}

html[data-theme="dark"] :where(
    .shared-day-heading h3,
    .travel-focus-copy h3,
    .travel-timeline-section > h3,
    .travel-day-todos > h3,
    .travel-day-notes > h3,
    .travel-timeline-title
) {
    color: var(--theme-text);
}

html[data-theme="dark"] .day-todos-section.has-content {
    background: var(--theme-surface-raised);
    border-color: var(--theme-border);
}

html[data-theme="dark"] :where(.day-todo-row, .day-todo-editor) {
    background: var(--theme-surface);
    border-color: var(--theme-border);
}

html[data-theme="dark"] .day-todo-row:hover:where(.hover-enabled *),
html[data-theme="dark"] .day-todo-row:focus-within {
    background: var(--theme-surface-soft);
    border-color: rgba(141, 156, 255, 0.45);
    box-shadow: 0 2px 7px rgba(0, 0, 0, 0.2);
}

html[data-theme="dark"] .day-todo-row.is-completed {
    background: rgba(255, 255, 255, 0.025);
}

html[data-theme="dark"] .day-todo-row.is-completed:hover:where(.hover-enabled *),
html[data-theme="dark"] .day-todo-row.is-completed:focus-within {
    background: var(--theme-surface-soft);
}

html[data-theme="dark"] :where(.day-todos-title, .day-todo-text, .travel-day-todo-row) {
    color: var(--theme-text);
}

html[data-theme="dark"] .day-todo-row.is-completed .day-todo-text {
    color: var(--theme-muted);
}

html[data-theme="dark"] :where(.day-todo-due, .day-todo-due-editor, .travel-day-todo-due) {
    color: var(--theme-muted);
}

html[data-theme="dark"] :where(.day-todo-related-editor, .day-todo-assignee-editor) {
    color: var(--theme-muted);
}

html[data-theme="dark"] :where(.day-todo-assignee, .travel-day-todo-assignee) {
    color: var(--theme-text);
    background: rgba(125, 147, 255, 0.14);
}

html[data-theme="dark"] .stats-table .per-person-cost-row td {
    color: var(--theme-text);
    background: rgba(125, 147, 255, 0.1);
}

html[data-theme="dark"] .per-person-cost-row small {
    color: var(--theme-muted);
}

html[data-theme="dark"] :where(.day-todo-related.is-missing, .travel-day-todo-related.is-missing) {
    color: #e2b86f;
}

html[data-theme="dark"] :where(.day-todo-due.is-overdue, .travel-day-todo-due.is-overdue) {
    color: #ff8d98;
}

html[data-theme="dark"] .day-todo-action {
    color: var(--theme-muted);
    border-color: var(--theme-border);
}

html[data-theme="dark"] :where(
    .shared-day-places,
    .travel-timeline-time,
    .travel-timeline-location,
    .travel-timeline-empty,
    .travel-day-notes p
) {
    color: var(--theme-muted);
}

html[data-theme="dark"] .travel-focus-icon,
html[data-theme="dark"] .travel-timeline-item.is-focus,
html[data-theme="dark"] .travel-focus-automatic {
    background: rgba(135, 152, 255, 0.16);
}

html[data-theme="dark"] .travel-focus-details {
    border-color: var(--theme-border);
}

html[data-theme="dark"] .travel-focus-automatic {
    color: #aeb9ff;
    border-color: rgba(135, 152, 255, 0.45);
}

html[data-theme="dark"] .travel-timeline-icon {
    background: var(--theme-surface-soft);
    border-color: var(--theme-surface);
}

html[data-theme="dark"] .travel-timeline-item:not(:last-child)::after {
    background: var(--theme-border);
}

/* ==================== [CSS-16] Animationen ==================== */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes account-status-in {
    from { opacity: 0; transform: translateY(-3px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes account-status-spin {
    to { transform: rotate(360deg); }
}

@keyframes trip-link-spin {
    to { transform: rotate(360deg); }
}

@keyframes rgbBorderRotate {
    0% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes pulse-notification {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 6px rgba(255, 68, 68, 0.4);
    }
    50% {
        transform: scale(1.2);
        box-shadow: 0 4px 12px rgba(255, 68, 68, 0.6);
    }
}

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes orbit {
    0% { transform: rotate(0deg) translateX(20px); }
    100% { transform: rotate(360deg) translateX(20px); }
}

@keyframes fade {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

@keyframes inner-pulse {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.8;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.1);
    opacity: 1;
  }
}

@keyframes outer-pulse {
  0% {
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(1.5);
    opacity: 0;
  }
}

@keyframes pulse-glow {
    0%, 100% {
        opacity: 0.7;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
    }
}

@keyframes mapSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes statsSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes slideInFromRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes gpsLoadingPulse {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.05);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes userLocationPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes userLocationRipple {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }
    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

@keyframes globalSearchTargetPulse {
    0%, 100% { box-shadow: inherit; }
    25%, 70% { box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.28); }
}
