/* === DARK THEME REDESIGN === */

/* === Color Variables === */
:root {
    --bg-primary: #0f0f23;
    --bg-secondary: #0087a266;
    --bg-tertiary: #16213e;
    --bg-card: rgba(26, 32, 46, 1);
    --bg-card-hover: rgba(36, 42, 56, 0.95);
    
    --accent-primary: #443648;
    --accent-secondary: #7c3aed;
    --accent-success: #10b981;
    --accent-warning: #f59e0b;
    --accent-danger: #ef4444;
    
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-tertiary: #64748b;
    --text-opposite: #32323f;
    
    --border-color: rgba(93, 233, 248, 0.382);
    --border-hover: #00d5ff66;
    
    --color-crux-label: #decb33;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 20px rgba(0, 212, 255, 0.3);

    --climbed-bg-start: rgba(0, 212, 255, 0.15);
    --climbed-bg-end: rgba(124, 58, 237, 0.15);

    --bottombar-bg-start: rgba(0, 0, 0, 0.5);
    --bottombar-bg-end: rgba(0, 0, 0, 0.9);
    --bottombar-shadow: 0 -4px 20px rgba(0, 0, 0, 0.8);
}

/* === Light Theme === */
[data-theme="light"] {
    --bg-primary: #eef2f7;
    --bg-secondary: rgba(228, 223, 232, 0.72);
    --bg-tertiary: #adb0b3;
    --bg-card: rgba(179, 173, 179, 0.96);
    --bg-card-hover: rgba(240, 248, 255, 0.98);

    --accent-primary: #5d3a6e;
    --accent-secondary: #7c3aed;
    --accent-success: #059669;
    --accent-warning: #d97706;
    --accent-danger: #dc2626;

    --text-primary: #1e293b;
    --text-secondary: #170517;
    --text-tertiary: #3f2250;
    --text-opposite: #f0e9f5;

    --border-color: rgba(71, 107, 140, 0.692);
    --border-hover: rgba(0, 135, 162, 0.5);

    --color-crux-label: #92400e;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.16);
    --shadow-glow: 0 0 20px rgba(0, 135, 162, 0.2);

    --climbed-bg-start: rgba(0, 135, 162, 0.08);
    --climbed-bg-end: rgba(124, 58, 237, 0.08);

    --bottombar-bg-start: rgba(230, 238, 248, 0.85);
    --bottombar-bg-end: rgba(215, 228, 242, 0.97);
    --bottombar-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
}



/* === 1. Ortungs-Button === */
.locate-btn {
    position: absolute;
    bottom: 20px;
    right: 10px;
    width: 30px;
    aspect-ratio: 1 / 1;
    background: linear-gradient(135deg, var(--bg-primary) 100%, var(--bg-secondary) 10%);
    border: 2px solid var(--border-color);
    border-radius: 6px;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
    backdrop-filter: blur(10px);
}

/* Shift locate button above the bottom bar when map is fullscreen */
#top-container.map-fullscreen .locate-btn {
    bottom: calc(10vh + 20px);
    transition: bottom 0.4s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s, border-color 0.3s, box-shadow 0.3s, transform 0.3s;
}

.locate-btn:hover {
    background: linear-gradient(135deg, var(--bg-primary) 90%, var(--bg-tertiary) 10%);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.locate-btn:active {
    transform: translateY(0) scale(0.95);
}

.locate-btn.locating {
    animation: pulse 1s infinite;
}

.locate-btn.located {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(5, 150, 105, 0.2) 100%);
    border-color: var(--accent-success);
}

.locate-btn.located svg circle,
.locate-btn.located svg path {
    fill: var(--accent-success);
    stroke: var(--accent-success);
}

.locate-btn.tracking-active {
    background: linear-gradient(135deg, rgba(239, 71, 87, 0.3) 0%, rgba(220, 38, 38, 0.3) 100%);
    border-color: #ff4757;
    animation: pulse-tracking 2s infinite;
}

.locate-btn.tracking-active svg circle,
.locate-btn.tracking-active svg path {
    fill: #ff4757;
    stroke: #1d0b0c;
}

@keyframes pulse-tracking {
    0%, 100% { 
        opacity: 1; 
        box-shadow: 0 0 0 0 rgba(239, 71, 87, 0.7);
    }
    50% { 
        opacity: 0.9; 
        box-shadow: 0 0 0 10px rgba(239, 71, 87, 0);
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; box-shadow: var(--shadow-md); }
    50% { opacity: 0.7; box-shadow: var(--shadow-glow); }
}

/* === 2. Grading & Modal Buttons === */
.grading-btn {
    display: block; 
    opacity: 0.9;
    min-width: 30px; 
    padding: 4px 6px; 
    height: 30px; 
    border-radius: 8px;
    border: 1px solid var(--border-color);
    color: var(--text-opposite);
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    z-index: 10;
}

.grading-btn[data-bgcolor] {
    background: var(--bg-tertiary) !important;
    color: #222 !important;
}

.grading-btn:hover {
    opacity: 1;
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
}

.grading-btn:not(.is-interactive) {
    cursor: default;
}

.grading-btn:not(.is-interactive):hover {
    opacity: 0.9;
    border-color: var(--border-color);
    box-shadow: var(--shadow-sm);
    transform: none;
}

.grading-btn:active {
    transform: translateY(0);
}

.closeModal {
    position: fixed;
    top: 15px;
    right: 15px;
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}
.closeModal:hover {
    transform: translateY(-2px);
}

/* === 3. Title Elements === */
#addRouteTitle.area-name {
    width: 80%;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.15) 0%, rgba(124, 58, 237, 0.15) 100%);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 10px 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    color: var(--text-primary);
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 10px;
    backdrop-filter: blur(8px);
}

#addRouteTitle.area-name:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.25) 0%, rgba(124, 58, 237, 0.25) 100%);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
}

.routeNameTitle.area-name {
    width: 80%;
    font-size: 14px;
    font-weight: 500;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 6px 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    margin-bottom: 4px;
    backdrop-filter: blur(8px);
}

.routeNameTitle.area-name:hover {
    transform: translateY(-1px);
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-card-hover);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-sm);
}


/* === 4. Globales Reset & Grundlayout === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', sans-serif;
    overflow: hidden;
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height for mobile browsers */
    background: var(--bg-primary);
    color: var(--text-primary);
    touch-action: manipulation !important;
    -webkit-tap-highlight-color: transparent !important;
    overscroll-behavior: none !important;
    position: fixed;
    width: 100%;
}

#main-container {
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height for mobile browsers */
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    position: relative;
    touch-action: pan-x pan-y !important;
    z-index: 1 !important;
    overflow: hidden;
}

#top-container {
    height: 100%;
    transition: height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    position: relative;
    z-index: 2 !important;
}

#map {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2 !important;
    filter: brightness(0.85) contrast(1.1);
}

/* Wrapper für alle Content-Container (wird von containerup bewegt) */
#content-container {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 0%;
    display: flex;
    flex-direction: column;
    transition: height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 3 !important;
}

/* Individuelle Content-Container (Kinder des Wrappers) */
.content-container {
    height: 100%;
    width: 100%;
    left: 0;
    top: 0;
    transform: translateX(0);
    touch-action: auto !important;
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    overflow: auto;
    position: absolute;
    flex-shrink: 0;
    border-top: 2px solid var(--border-color);
    display: none;
    flex-direction: column;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 -4px 32px rgba(0, 0, 0, 0.5);
}

/* Drag-Indikator für Content-Container */
.content-container::before {
    content: '';
    position: sticky;
    top: 5px;
    display: block;
    width: 20%;
    height: 4px;
    background: rgba(148, 163, 184, 0.5);
    border-radius: 2px;
    z-index: 10;
    pointer-events: none;
    margin: 5px auto 0;
}

.content-container.active {
    display: flex;
}

#mapcontent-container {
    /* Inherits all styles from .content-container */
    overflow-y: auto;
    overflow-x: hidden;
}

.content {
    width: 100%;
    padding: 15px;
    font-size: 15px;
    line-height: 1.6;
    overflow-y: auto;
    overflow-x: hidden;
    height: 100%;
}

.contentForm {
    width: 100%;
    margin: 15px 0 0;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-tertiary) 100%);
    backdrop-filter: blur(16px);
    padding: 10px 5px;
    border: none;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    overflow-y: visible;
    overflow-x: clip;
    position: absolute;
    transition: transform 0.4s cubic-bezier(0.4,0,0.2,1);
    will-change: transform;
    -webkit-overflow-scrolling: touch;
}

/* Fix overflow chain so position:sticky works inside routeForm relative to #main-content-panel.
   overflow:hidden/auto on intermediate elements would create spurious scroll containers. */
#main-content-panel > .content {
    overflow-y: visible;
    overflow-x: clip;
}

#areaForm,
#sectorForm,
#multipitchForm,
#routeForm {
    overflow-x: clip;
    border-top: none;
    border-radius: 0 0 10px 10px;
    margin: 0;
}

#routeForm {
    padding: 5px 0;
}

/* Alle contentForms transparent – Optik liegt auf *FormBody */
#areaForm,
#sectorForm,
#multipitchForm,
#routeForm,
#parkingForm,
#newForm,
#areasList,
#startSessionForm,
#currentSessionForm,
#historyForm,
#profileForm {
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
}

#startSessionForm,
#currentSessionForm,
#historyForm {
    margin: 0;
}

#historyFilterContainer {
    margin: 5px;
}


#currentSessionFormStickyHeader {
    width: 100%;
}

#historyContent {
    margin: 5px !important;
}

/* routeFormBody darf über den transparenten routeForm-Container hinausragen */
#routeForm {
    overflow-x: visible !important;
}

#routeFormBody {
    margin-top: 0;
}


#areaFormBody,
#sectorFormBody,
#multipitchFormBody,
#routeFormBody,
#parkingFormBody,
#newFormBody,
#areasListBody,
#startSessionFormBody,
#currentSessionFormBody,
#historyFormBody {
    top: 0;
    bottom: 0;
    height: auto;
    margin: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    padding: 0 5px;
}

#profMenuForm {
    top: 0;
    bottom: 0;
    height: auto;
    margin: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}

#profMenuForm .form-spacer {
    display: none;
}

#profMenuBody {
    width: 100%;
}

#profMenuBody .content {
    padding: 16px;
    display: flex;
    justify-content: center;
}

#profileFormBody,
#themeFormBody {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-tertiary) 100%);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 0 5px;
    border-bottom: 1px solid var(--border-color);
    border-radius: 0 0 10px 10px;
    box-shadow: var(--shadow-lg);
    overflow-x: clip;
}

#routeFormStickyHeader {
    margin-left: -5px;
    width: calc(100% + 10px);
}

.form-sticky-header {
    position: sticky;
    top: 0;
    z-index: 5;
    background: var(--bg-tertiary);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    width: 100%;
    padding: 0 0 10px;
    border-radius: 0;
    border-bottom: 1px solid var(--border-color);
}

.form-sticky-header::after {
    content: '';
    position: absolute;
    bottom: -18px;
    left: 0;
    right: 0;
    height: 18px;
    background: linear-gradient(to bottom, var(--bg-card) 0%, transparent 100%);
    pointer-events: none;
}

.form-cap {
    height: 14px;
    margin: 0 0 10px;
    border-radius: 10px 10px 0 0;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.form-cap::before {
    content: '';
    display: block;
    width: 20%;
    height: 4px;
    background: rgba(148, 163, 184, 0.5);
    border-radius: 2px;
}

/* Panel-Drag-Indikator ausblenden wenn ein contentForm aktiv — form-cap::before übernimmt */
#main-content-panel:has(.contentForm[style*="block"])::before {
    display: none;
}

/* routeForm: Höhe und Transition werden per JS gesetzt (containerup) */

.form-spacer {
    display: none;
    flex-shrink: 0;
    pointer-events: none;
}

#main-content-panel:has(#routeForm[style*="block"]:not([data-state="closing"])) .form-spacer {
    display: block;
    height: 20vh;
    flex-shrink: 0;
}

#main-content-panel:has(#routeForm[style*="block"]:not([data-state="closing"])) {
    background: linear-gradient(180deg, transparent 20vh, var(--bg-secondary) 20vh, var(--bg-primary) 100%);
    pointer-events: none;
    border-top: none;
    box-shadow: none;
}

#content-container:has(#routeForm[style*="block"]:not([data-state="closing"])) {
    pointer-events: none;
}

#main-content-panel:has(#routeForm[style*="block"]:not([data-state="closing"])) #routeFormBody {
    pointer-events: auto;
}

#sectorDropdownRow {
    border: 0;
    border-radius: 10px 10px 0 0;
    background: var(--bg-card);
    margin: 0 -5px;
    padding: 6px 5px;
}

#routesContainerMultipitch {
    padding: 5px;
}

/* Full-panel forms: history & profile tabs fill the whole content area */

.headline1 {
    outline: none;
    color: var(--text-primary);
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 20px;
    margin-left: 10px;
}

.headline2 {
    outline: none;
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    margin-top: 20px;
    margin-left: 10px;
}


.content-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    margin-top: -5px;
    padding-left: 5px;
}

.content-name {
    width: calc(100% - 90px);
    border-radius: 7px;
    padding: 0px 0px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 18px;
    transition: all 0.3s ease;
    margin-top: -5px;
    margin-left: 5px;
}

.multipitch-toggle-container {
    margin-top: 10px;
    margin-left: 5px;
}

.title-marker-circle {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 1px 4px rgba(0,0,0,0.35);
    transform: translate(-50%, -50%);
    z-index: 20;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 11px;
}

.area-title-marker-circle {
    background-color: #ff4757;
}

.sector-title-marker-circle {
    background-color: #ff9800;
}

.parking-title-marker-circle {
    background-color: #4a9eff;
}


.content-desc {
    width: 100%;
    max-height: 160px;
    overflow-y: auto;
    background: var(--bg-tertiary);
    opacity: 0.9;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 16px;
    white-space: pre-wrap;
    word-break: break-word;
    display: inline-block;
    color: var(--text-primary);
    min-height: 48px;
    line-height: 1.5;
    font-size: 13px;
}

.content-empty {
    color: var(--text-tertiary);
    font-style: italic;
}

/* Markierte Route im Edit-Modus (orange) */
.route-marked-for-edit {
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.3) 0%, rgba(251, 140, 0, 0.3) 100%) !important;
    border: 2px solid #ff9800 !important;
    box-shadow: 0 0 15px rgba(255, 152, 0, 0.5) !important;
    transform: scale(1.02);
    transition: all 0.3s ease;
}

/* Route markiert für Löschung (rot + halbtransparent) */
.route-marked-for-deletion {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.4) 0%, rgba(185, 28, 28, 0.4) 100%) !important;
    border: 2px solid #dc3545 !important;
    box-shadow: 0 0 20px rgba(220, 53, 69, 0.6) !important;
    opacity: 0.6;
    transform: scale(1.02);
    transition: all 0.3s ease;
}

.editor-click {
    transition: all 0.3s ease;
}

/* Editor-Click nur im Edit-Mode aktiv */
.contentForm[data-edit-mode="true"] .editor-click {
    cursor: pointer !important;
    touch-action: manipulation !important;
    z-index: 200 !important;
}

.contentForm[data-edit-mode="true"] .editor-click:hover {
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--accent-primary) 15%, transparent) 0%,
        color-mix(in srgb, var(--accent-secondary) 15%, transparent) 100%);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
}

#multipitchForm #multipitchTitle {
    display: none;
}

#multipitchForm[data-edit-mode="true"] #multipitchTitle {
    display: block;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0px 10px;
    outline: none;
    margin-top: 4px;
}

#routeForm[data-edit-mode="true"] #routeTitle {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0px 10px;
    outline: none;
    margin-top: 4px;
}

#routeForm[data-edit-mode="true"] #routeSelfPreview,
#routeForm[data-edit-mode="true"] #climbSelfPreview,
#multipitchForm[data-edit-mode="true"] #multipitchSelfPreview {
    display: none;
}

#routeForm[data-mode="climbed"] #routeSelfPreview,
#routeForm:not([data-mode="climbed"]) #climbSelfPreview {
    display: none;
}

#routeForm:not([data-edit-mode="true"]) #routeTitle,
#routeForm:not([data-mode="climbed"]):not([data-edit-mode="true"]) #routeFormStickyHeader .recording-category-items {
    display: none;
}

#routeForm[data-mode="climbed"] .recording-category-items {
    display: none;
}
#routeForm[data-mode="climbed"] #yourClimbsCategory .recording-category-items,
#routeForm[data-mode="climbed"] #yourClimbsSummaryCategory .recording-category-items {
    display: flex;
}

.coords-info {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
    font-size: 13px;
    color: var(--text-secondary);
    backdrop-filter: blur(8px);
}

.parking-nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.nav-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(74, 158, 255, 0.12);
    border: 1px solid rgba(74, 158, 255, 0.3);
    border-radius: 20px;
    color: var(--accent-blue, #4a9eff);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    white-space: nowrap;
}

.nav-link-btn:hover,
.nav-link-btn:focus {
    background: rgba(74, 158, 255, 0.25);
    border-color: rgba(74, 158, 255, 0.6);
    outline: none;
}

.sun-info {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
    font-size: 13px;
    color: var(--text-secondary);
    backdrop-filter: blur(8px);
}

.sun-info h4 {
    margin: 0 0 10px 0;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
}

.sun-season {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 3px;
    padding: 8px;
    background: rgba(15, 15, 35, 0.4);
    border-radius: 8px;
}

.sun-season-label {
    color: var(--text-secondary);
    font-weight: 500;
    min-width: 65px;
}

.sun-season-times {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-opposite);
}

.sun-season-times input[type="time"] {
    background: rgba(26, 32, 46, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-opposite);
    padding: 4px 8px;
    font-size: 13px;
    min-width: 65px;
    transition: all 0.3s ease;
}

.sun-season-times input[type="time"]:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
}

/* Nur im Edit-Mode bearbeitbar */
.contentForm[data-edit-mode="false"] .sun-season-times input[type="time"] {
    pointer-events: none;
    background: transparent;
    border: none;
    padding: 0;
}

.button-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* Nur im Edit-Mode sichtbar */
.contentForm[data-edit-mode="false"] .edit-only {
    display: none !important;
}

.section-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-right: 10px;
}

.section-header-row .headline2 {
    margin-bottom: 0;
    margin-right: 0;
}

.btn-add {
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 400;
    width: 30px;
    height: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
    line-height: 1;
}

.btn {
    flex: 1;
    padding: 12px 18px;
    margin: 2px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    box-shadow: var(--shadow-sm);
}
.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary) 0%, #0ea5e9 100%);
    color: var(--bg-primary);
    border-color: var(--accent-primary);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0ea5e9 0%, var(--accent-primary) 100%);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.btn-secondary {
    margin-top: 5px;
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.btn-danger {
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
    color: white;
    border-color: var(--accent-danger);
}

.btn-danger:hover {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(135deg, var(--accent-success) 0%, #059669 100%);
    color: white;
    border: none;
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
    transform: translateY(-2px);
}

.btn_closeForm {
    display: none !important;
}

/* ===== Floating Form Action Panel ============================= */
#formActionPanel {
    position: fixed;
    right: 16px;
    bottom: calc(10vh + 8px);
    z-index: 9998;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: all;
}

#formActionPanel button {
    position: static !important;
    width: 48px !important;
    height: 48px !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, #1a7a7a 0%, #0f5252 100%);
    border: 2px solid #23a0a0 !important;
    color: #e0f4f4;
    box-shadow: 0 2px 12px rgba(26,122,122,0.5);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s, box-shadow 0.2s;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    aspect-ratio: 1 / 1;
}

/* Scroll/close button is always visible when panel is open */
#btn_panelclose {
    display: flex;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
    /* initial rotation set by JS (rotate(0deg) = ↓, 180deg = ↑, 90deg = ←) */
}

#formActionPanel button:hover {
    background: linear-gradient(135deg, #23a0a0 0%, #1a7a7a 100%);
    box-shadow: 0 4px 20px rgba(26,122,122,0.7);
}

/* Save button: edit-active = checkmark / green */
#formActionPanel #btn_panelsave.edit-active {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    border-color: rgba(16, 185, 129, 0.5) !important;
}

/* Save button: unsaved changes = orange pulse */
#formActionPanel #btn_panelsave.save-btn-changed {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    border-color: rgba(245, 158, 11, 0.5) !important;
    animation: pulse-warning 2s infinite !important;
}

/* Recording button pulse is applied via JS only when actively recording (red state) */

/* Override .save-btn absolute positioning when the button is NOT inside a form */
#btn_panelsave {
    /* will be controlled via formActionPanel button rules */
}

.save-btn {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: #fff;
    right: 52px;
    top: 4px;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    border: 1px solid rgba(107, 114, 128, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
    white-space: nowrap;
    box-shadow: var(--shadow-sm);
}

.save-btn:hover {
    background: linear-gradient(135deg, #4b5563 0%, #374151 100%);
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 0 20px rgba(107, 114, 128, 0.5);
}

/* Save-Button im Edit-Mode (grün mit Häkchen) */
.contentForm[data-edit-mode="true"] .save-btn {
    background: linear-gradient(135deg, var(--accent-success) 0%, #059669 100%);
    border-color: rgba(16, 185, 129, 0.5);
}

.contentForm[data-edit-mode="true"] .save-btn:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
}

/* Änderungen vorhanden - Orange Highlight */
.save-btn-changed,
.contentForm[data-edit-mode="true"] .save-btn-changed {
    background: linear-gradient(135deg, var(--accent-warning) 0%, #d97706 100%) !important;
    border-color: rgba(245, 158, 11, 0.5) !important;
    animation: pulse-warning 2s infinite;
}

.save-btn-changed:hover,
.contentForm[data-edit-mode="true"] .save-btn-changed:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%) !important;
    box-shadow: 0 0 25px rgba(245, 158, 11, 0.6) !important;
}

@keyframes pulse-warning {
    0%, 100% { box-shadow: 0 0 20px rgba(245, 158, 11, 0.4); }
    50% { box-shadow: 0 0 30px rgba(245, 158, 11, 0.6); }
}

.recording-btn {
    position: absolute;
    top: 55px;
    right: 20px;
    width: 55px;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    background-color: #dc3545;
    border: 2px solid rgba(220, 53, 69, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    box-shadow: 0 0 20px rgba(220, 53, 69, 0.5);
    animation: pulse-recording 2s infinite;
}

@keyframes pulse-recording {
    0%, 100% { 
        box-shadow: 0 0 20px rgba(220, 53, 69, 0.5);
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 0 30px rgba(220, 53, 69, 0.8);
        transform: scale(1.05);
    }
}

/* === Stopwatch & Digital Font === */
.digital-text {
    font-family: 'Courier New', Courier, monospace;
    font-weight: bold;
    letter-spacing: 2px;
    color: var(--text-primary);
    box-shadow: 5px 5px 20px rgba(220, 53, 69, 0.5);
}

#stopwatchDisplay {
    position: absolute;
    top: 30px;
    right: 10px;
    width: 75px;
    text-align: center;
    font-size: 16px;
    pointer-events: none;
    display: none;
    z-index: 100;
    color: #dc3545;
    text-shadow: 0 0 8px rgba(220, 53, 69, 0.7);
}

.climb-time-badge {
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(220, 53, 69, 0.12);
    color: var(--text-primary);
    margin-right: 6px;
    white-space: nowrap;
}

/* === 5. Bottom Editor === */
.bottom-editor {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    transform: translateY(110%);
    transition: transform 350ms cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9999;
    display: flex;
    justify-content: center;
    pointer-events: none;
}

.bottom-editor.open {
    top: 0;
    transform: translateY(0);
    pointer-events: auto;
    align-items: flex-end;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.bottom-editor-inner {
    position: relative;
    width: 100%;
    max-width: 900px;
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-tertiary) 100%);
    backdrop-filter: blur(20px);
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    border-bottom: none;
    padding: 20px;
    display: flex;
    gap: 14px;
    align-items: center;
}

.bottom-editor-inner textarea {
    flex: 1;
    padding: 14px 16px;
    background: color-mix(in srgb, var(--bg-primary) 60%, transparent);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    font-size: 15px;
    color: var(--text-primary);
    resize: none;
    min-height: 52px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.bottom-editor-inner textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
    background: color-mix(in srgb, var(--bg-primary) 80%, transparent);
}

.bottom-editor-inner textarea::placeholder {
    color: var(--text-tertiary);
}

.bottom-editor-inner textarea.single-line {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    height: 52px;
}

.bottom-editor.open.desc-mode {
    align-items: stretch;
}

.bottom-editor.open.route-mode {
    align-items: stretch;
}

.bottom-editor.open.desc-mode .bottom-editor-inner {
    height: 100%;
    max-height: none;
    border-radius: 0;
    flex-direction: column;
    align-items: stretch;
    overflow: hidden;
}

.bottom-editor.open.route-mode .bottom-editor-inner {
    height: 100%;
    max-height: none;
    border-radius: 0;
    flex-direction: column;
    align-items: stretch;
    overflow: hidden;
}

.bottom-editor.open.desc-mode .bottom-editor-inner textarea {
    flex: 1;
    min-height: 80px;
    overflow-y: auto;
    resize: none;
    white-space: pre-wrap;
}

.bottom-editor.open.route-mode .bottom-editor-inner textarea {
    flex: 1;
    min-height: 80px;
    overflow-y: auto;
    resize: none;
    white-space: pre-wrap;
}

.bottom-editor-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.editor-close-btn {
    display: none;
    position: fixed;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: color-mix(in srgb, var(--bg-card) 90%, transparent);
    color: var(--text-primary);
    font-size: 16px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    z-index: 1;
    flex-shrink: 0;
}

.bottom-editor.open.desc-mode .editor-close-btn {
    display: flex;
}

.bottom-editor.open.route-mode .editor-close-btn {
    display: flex;
}

.editor-format-btns {
    display: none;
    gap: 6px;
}

.bottom-editor.open.desc-mode .bottom-editor-actions {
    justify-content: space-between;
    align-items: center;
}

.bottom-editor.open.route-mode .bottom-editor-actions {
    justify-content: space-between;
    align-items: center;
}

.bottom-editor.open.desc-mode .editor-format-btns {
    display: flex;
}

.editor-route-legend {
    display: none;
    flex-direction: row;
    gap: 6px;
    padding: 0 0 8px;
    flex-shrink: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.editor-route-legend::-webkit-scrollbar { display: none; }

.bottom-editor.open.route-mode .editor-route-legend {
    display: flex;
}

.erl-chip {
    font-size: 13px;
    font-family: monospace;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: color-mix(in srgb, var(--accent-primary) 12%, transparent);
    color: var(--accent-primary);
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}

.erl-chip:active {
    background: color-mix(in srgb, var(--accent-primary) 25%, transparent);
}

.editor-ocr-prompt-btn {
    display: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: color-mix(in srgb, var(--bg-primary) 60%, transparent);
    color: var(--text-secondary);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.bottom-editor.open.route-mode .editor-ocr-prompt-btn {
    display: flex;
}

.editor-ocr-prompt-btn.copied {
    color: var(--accent-primary);
    border-color: var(--accent-primary);
}

.editor-add-route-btn {
    display: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: #28a745;
    color: white;
    font-size: 24px;
    font-weight: 400;
    line-height: 1;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-left: auto;
    margin-right: 6px;
}

.bottom-editor.open.route-mode .editor-add-route-btn {
    display: flex;
}

.fmt-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: rgba(22, 33, 62, 0.8);
    color: var(--text-opposite);
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.fmt-btn:hover, .fmt-btn:active {
    border-color: var(--accent-primary);
    background: rgba(68, 54, 72, 0.6);
    box-shadow: var(--shadow-glow);
}

/* === 6. Routen & Sektoren === */
#contentRoutes {
    margin-top: 8px;
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 700;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border-color);
}

#routesContainer {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.area_routeslist {
    width: 100%;
    min-height: 36px;
    font-size: 15px;
    font-weight: 600;
    background: linear-gradient(135deg, color-mix(in srgb, var(--bg-card) 65%, transparent) 0%, color-mix(in srgb, var(--bg-tertiary) 65%, transparent) 100%);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 8px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: flex;
    align-items: center;
    color: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 6px 0;
    cursor: pointer;
}

.area_routeslist:hover {
    transform: translateX(4px);
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.15) 0%, rgba(124, 58, 237, 0.15) 100%);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
}

/* Route Grade, Length and Style Divs */
.area_routeslist .grade-div,
.area_routeslist .length-div,
.area_sectorlist .grade-div,
.area_sectorlist .length-div,
#routesContainerSector .grade-div {
    position: relative;
    min-width: 38px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    font-weight: bold;
    font-size: 13px;
    display: inline-block;
    color: var(--text-opposite);
    border-radius: 4px;
}

.area_routeslist .style-div {
    min-width: 24px;
    height: 30px;
    line-height: 30px;
    padding: 0 6px;
    text-align: center;
    font-weight: bold;
    font-size: 12px;
    display: inline-block;
    color: var(--text-opposite);
    border-radius: 4px 0 0 4px;
    margin-left: 4px;
    flex-shrink: 0;
}

.area_routeslist .climbed-div {
    min-width: 24px;
    height: 30px;
    line-height: 30px;
    padding: 0 6px;
    text-align: center;
    font-weight: bold;
    font-size: 12px;
    display: inline-block;
    color: var(--text-opposite);
    border-radius: 0 4px 4px 0;
    flex-shrink: 0;
}

.area_routeslist .count-div {
    height: 30px;
    line-height: 30px;
    padding: 0 6px;
    text-align: center;
    font-weight: bold;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    color: var(--text-primary);
    border-radius: 4px;
    flex-shrink: 0;
}

.area_sectorlist {
    width: 100%;
    font-size: 15px;
    font-weight: 600;
    background: linear-gradient(135deg, color-mix(in srgb, var(--bg-card) 65%, transparent) 0%, color-mix(in srgb, var(--bg-tertiary) 65%, transparent) 100%);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 12px 16px;
    padding-top: 12px;
    margin-bottom: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    color: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-md);
    cursor: pointer;
}

.area_sectorlist:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.2) 0%, rgba(124, 58, 237, 0.2) 100%);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
}

.climbs_routelist {
    width: 100%;
    min-height: 36px;
    font-size: 15px;
    font-weight: 600;
    background: linear-gradient(135deg, color-mix(in srgb, var(--bg-card) 65%, transparent) 0%, color-mix(in srgb, var(--bg-tertiary) 65%, transparent) 100%);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 8px 0px 8px 0;
    white-space: normal;
    color: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 6px 0;
    cursor: pointer;
}

.climbs_routelist:hover {
    transform: translateX(4px);
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.15) 0%, rgba(124, 58, 237, 0.15) 100%);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
}

.climbs_routelist .grade-div,
.climbs_routelist .length-div {
    position: relative;
    min-width: 38px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    font-weight: bold;
    font-size: 13px;
    display: inline-block;
    color: var(--text-opposite);
    border-radius: 4px;
}

.climbs_routelist .style-div {
    min-width: 24px;
    height: 30px;
    line-height: 30px;
    padding: 0 6px;
    text-align: center;
    font-weight: bold;
    font-size: 12px;
    display: inline-block;
    color: var(--text-opposite);
    border-radius: 4px 0 0 4px;
    margin-left: 4px;
    flex-shrink: 0;
}

.climbs_routelist .climbed-div {
    min-width: 24px;
    height: 30px;
    line-height: 30px;
    padding: 0 6px;
    text-align: center;
    font-weight: bold;
    font-size: 12px;
    display: inline-block;
    color: var(--text-opposite);
    border-radius: 0 4px 4px 0;
    flex-shrink: 0;
}

/* Recording Category Cards */
.recording-category {
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 12px 0px 30px;
    backdrop-filter: blur(8px);
        border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
    transition: padding 0.35s ease;
}

.recording-category--climbed.recording-category--collapsed {
    padding-bottom: 12px;
}
.recording-category--climbed:not(.recording-category--collapsed) {
    background: linear-gradient(135deg, var(--climbed-bg-start) 0%, var(--climbed-bg-end) 100%);
    padding-bottom: 30px;
}

.recording-category-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    padding: 0px 10px;
    margin: 0 0 0px 0;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 5px;

}

.recording-category-title::after {
    content: '▼';
    font-size: 15px;
    display: inline-block;
    transition: transform 0.25s ease;
    transform: rotate(0deg);
    opacity: 0.7;
}


.recording-category--collapsed .recording-category-title {
    margin-bottom: 0;
    opacity: 0.8;
}

.recording-category--collapsed .recording-category-title::after {
    transform: rotate(-90deg);
}

.recording-category--collapsed > .recording-category-community-stats {
    display: none;
}

.recording-category-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    padding: 5px;
    overflow: hidden;
    max-height: none;
    opacity: 1;
    transition: opacity 0.25s ease, padding 0.25s ease;
}

.recording-category--climbed .recording-category-items {
    max-height: 800px;
    transition: max-height 0.35s ease, opacity 0.25s ease, padding 0.25s ease;
}

.recording-category--collapsed .recording-category-items,
.recording-category--collapsed .recording-tag-container,
.recording-category--collapsed .crux-cards-container {
    max-height: 0 !important;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
    pointer-events: none;
}

#climbCategory .recording-category-title::after {
    display: none;
}

.recording-category-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 6px 14px;
    height: 38px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    user-select: none;
}

.recording-category-toggle:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
}

.recording-category-toggle:active {
    transform: translateY(0);
}

/* History Category (history tab) */
.history-category {
    background: transparent;
    border: none;
    border-left: 3px solid var(--bg-secondary);
    border-radius: 0;
    padding: 6px 0px 6px 10px;
    margin-bottom: 10px;
}

.history-category-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    padding: 0px 10px 0px 0px;
    margin: 0;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 5px;
}

.history-category-title::after {
    content: '▼';
    font-size: 15px;
    display: inline-block;
    transition: transform 0.25s ease;
    transform: rotate(0deg);
    opacity: 0.7;
}

.history-category--collapsed .history-category-title {
    margin-bottom: 0;
    opacity: 0.8;
}

.history-category--collapsed .history-category-title::after {
    transform: rotate(-90deg);
}

.history-category-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    padding: 5px 5px 5px 0px;
    overflow: hidden;
    max-height: 800px;
    opacity: 1;
    transition: max-height 0.3s ease, opacity 0.25s ease, padding 0.25s ease;
}

.history-category--collapsed .history-category-items {
    max-height: 0 !important;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
    pointer-events: none;
}

/* Button reset when a <button> is used as .dropdown-selected inside .recording-dropdown */
.recording-dropdown > button.dropdown-selected,
.recording-pill-btn {
    -webkit-appearance: none;
    appearance: none;
    outline: none;
    font-family: inherit;
}

/* Recording Dropdown – grading-btn style */
.recording-dropdown {
    position: relative;
    display: inline-flex;
    width: auto;
    max-width: none;
    user-select: none;
}

.recording-dropdown .dropdown-selected {
    width: auto;
    padding: 6px 10px;
    height: auto;
    border-radius: 7px;
    border: 1px solid #fff;
    background: transparent;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    overflow: hidden;
    white-space: nowrap;
}

/* Shared style for the route-property pill buttons in routeMetaRow
   (style/grad/length/bolts) — previously four byte-identical copies of the
   same rules duplicated per-ID. */
.recording-pill-btn {
    width: fit-content;
    min-width: 38px;
    height: 30px;
    line-height: 30px;
    padding: 0 8px;
    border-radius: 4px;
    border: 1.5px solid var(--border-color);
    background: transparent;
    font-size: 13px;
    font-weight: bold;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    white-space: nowrap;
}

.recording-dropdown .dropdown-selected[data-has-value="true"],
.dropdown-selected[data-has-value="true"] {
    color: #222 !important;
    border-color: #000 !important;
}

.recording-pill-btn[data-has-value="true"] {
    border-color: transparent;
    color: var(--text-opposite);
}

.recording-pill-btn:not(.is-interactive) {
    cursor: default;
}

.recording-pill-btn:not(.is-interactive):hover {
    border-color: var(--border-color);
    box-shadow: var(--shadow-sm);
}

.recording-dropdown .dropdown-selected::after,
.recording-pill-btn::after {
    display: none;
}

.recording-dropdown .dropdown-selected:hover,
.recording-pill-btn:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
}

.recording-dropdown .dropdown-selected:active,
.recording-pill-btn:active {
    transform: translateY(0);
}

.recording-dropdown.not-interactive .dropdown-selected {
    cursor: default;
    pointer-events: none;
    opacity: 0.9;
}

.recording-dropdown.not-interactive .dropdown-selected::after {
    display: none;
}

.recording-dropdown-reset {
    color: var(--text-secondary) !important;
    font-style: italic;
    border-left: 4px solid #666 !important;
}

.recording-dropdown--bucket {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-evenly;
    width: 120px;
    height: 90px;
    box-sizing: border-box;
    padding: 6px 8px;
    border-radius: 7px;
    border: 1px solid var(--border-color);
    cursor: pointer;
}
.recording-dropdown--bucket .dropdown-selected {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-evenly;
    width: 100%;
    height: 100%;
    background: transparent !important;
    backdrop-filter: none !important;
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0;
    color: inherit;
    gap: 2px;
}
.recording-dropdown--bucket .dropdown-selected::after {
    display: none;
}
.recording-dropdown--bucket .rdd-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--text-secondary);
    line-height: 1;
    white-space: nowrap;
}
.recording-dropdown--bucket .rdd-bar {
    width: 85%;
    height: 8px;
    border-radius: 4px;
    background: var(--border-color);
    opacity: 0.3;
    transition: background 0.2s, opacity 0.2s;
    flex-shrink: 0;
}
.recording-dropdown--bucket .dropdown-selected[data-has-value="true"] .rdd-bar {
    opacity: 1;
}
.recording-dropdown--bucket .dropdown-selected[data-has-value="true"] {
    background: transparent !important;
    color: inherit !important;
    border-color: transparent !important;
}

/* Time buttons (Uhrzeit / Stopwatch) in Climb category */
.recording-time-btn {
    -webkit-appearance: none;
    appearance: none;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 0;
    flex-shrink: 0;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 6px 14px;
    height: 38px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    user-select: none;
    white-space: nowrap;
    outline: none;
}

.recording-time-btn[data-has-value="true"] {
    color: var(--text-primary);
    border-color: var(--accent-primary);
}

.recording-time-btn:hover:not(.not-interactive) {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
}

.recording-time-btn:active:not(.not-interactive) {
    transform: translateY(0);
}

.recording-time-btn.not-interactive {
    cursor: default;
    pointer-events: none;
    opacity: 0.9;
}

#climbbuttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    padding: 4px 0;
}

#climbbuttons .custom-dropdown {
    width: auto;
    max-width: none;
}

#climbbuttons .dropdown-selected,
#climbbuttons .recording-time-btn {
    padding: 6px 12px;
    height: auto;
    white-space: nowrap;
}

.recording-time-btn--bucket {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-evenly;
    width: 120px;
    height: 90px;
    box-sizing: border-box;
    padding: 6px 8px;
    border-radius: 7px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: inherit;
    gap: 2px;
}

.recording-time-btn--bucket[data-has-value="true"] {
    border-color: var(--border-color);
    color: inherit;
}

.recording-time-btn--bucket:hover:not(.not-interactive) {
    box-shadow: none;
    transform: none;
    opacity: 0.8;
}

.recording-time-btn--bucket .rdd-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--text-secondary);
    line-height: 1;
    white-space: nowrap;
}

.recording-time-btn--bucket .rdd-bar {
    width: 85%;
    height: 8px;
    border-radius: 4px;
    background: var(--border-color);
    opacity: 0.3;
    transition: background 0.2s, opacity 0.2s;
    flex-shrink: 0;
}

/* Tag Container */
.recording-tag-container {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    align-items: center;
    padding: 5px;
}
.recording-tag-container .recording-dropdown {
    flex-shrink: 0;
}

.recording-tag-group-sep {
    flex-basis: 100%;
    height: 0;
}

.recording-tag-btn {
    -webkit-appearance: none;
    appearance: none;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 5px 13px;
    height: 32px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
    user-select: none;
    white-space: nowrap;
    outline: none;
}

.recording-tag-btn:hover:not(.not-interactive) {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
}

.recording-tag-btn:active:not(.not-interactive) {
    transform: translateY(0);
}

.recording-tag-btn.active {
    color: #222 !important;
}

.recording-tag-btn.not-interactive {
    cursor: default;
    pointer-events: none;
}

/* ── Crux Cards ─────────────────────────────────────────────────────────── */
.crux-cards-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 4px 2px;
}

.crux-card {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 7px;
    padding: 10px;
    width: 100%;
    margin: 0;
}

.crux-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.crux-card-label {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-crux-label);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.crux-remove-btn {
    -webkit-appearance: none;
    appearance: none;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 2px 8px;
    font-size: 11px;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: inherit;
    margin-left: auto;
}

.crux-remove-btn:hover {
    border-color: #e05050;
    color: #e05050;
}

.crux-card-row {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    align-items: center;
    margin-bottom: 6px;
}

.crux-card-row:last-child {
    margin-bottom: 0;
}

.crux-field-label {
    font-size: 11px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.crux-bolt-input {
    -webkit-appearance: none;
    appearance: none;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 5px 10px;
    font-size: 13px;
    font-family: inherit;
    color: var(--text-primary);
    outline: none;
    width: 90px;
}

.crux-beta-input {
    -webkit-appearance: none;
    appearance: none;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 13px;
    font-family: inherit;
    color: var(--text-primary);
    outline: none;
    width: 100%;
    min-height: 52px;
    resize: vertical;
    box-sizing: border-box;
}

.crux-bolt-input:focus,
.crux-beta-input:focus {
    border-color: var(--accent-primary);
}

.crux-bolt-input[readonly],
.crux-beta-input[readonly] {
    cursor: default;
    pointer-events: none;
}

.crux-community-stats {
    margin-bottom: 8px;
}

.multipitch-pitch-count {
    font-size: 11px;
    font-weight: 600;
    color: var(--border-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 1px 5px;
    margin-right: 5px;
    align-self: center;
    white-space: nowrap;
}

.community-stats-buckets {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: flex-start;
    max-width: 100%;
    margin-top: 10px;
}

.community-stats-bucket-item {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-evenly;
    gap: 4px;
    white-space: nowrap;
    flex: 0 0 auto;
    width: 120px;
    height: 90px;
    box-sizing: border-box;
    padding: 6px 8px;
    border-radius: 7px;
    border: 1px solid var(--border-color);
}

.community-stats-bucket-icon-row,
.community-stats-bucket-label-row,
.community-stats-bucket-dots-row {
    display: flex;
    align-items: center;
    justify-content: center;
}

.recording-category--climbed .community-stats-bucket-item {
    cursor: pointer;
}

.recording-category--climbed .community-stats-bucket-item:active {
    opacity: 0.75;
}

.prof-menu-tile:active {
    opacity: 0.65;
}

#setupTopCategoryStats .community-stats-section-label,
#setupBoltsCategoryStats .community-stats-section-label,
#setupBelayCategoryStats .community-stats-section-label {
    width: 55px;
    min-width: 55px;
    max-width: 55px;
}


/* Custom Dropdown Styles */
.custom-dropdown {
    position: relative;
    width: 80%;
    max-width: 350px;
    user-select: none;
}

.dropdown-selected {
    width: 100%;
    padding: 5px 6px;
    border: 1px solid #fff;
    border-radius: 7px;
    background: rgba(22, 33, 62, 0.8);
    backdrop-filter: blur(8px);
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dropdown-selected::after {
    content: '▼';
    font-size: 10px;
    transition: transform 0.3s ease;
}

.dropdown-selected:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
}

#sectorDropdown .sector-label,
#sectorDropdown .dropdown-selected {
    font-weight: 600;
    font-size: 18px;
}

#sectorDropdownRow .dropdown-selected {
    padding-top: 0px;
    padding-bottom: 0px;
    margin-bottom: 5px;
}

/* Spezielles Dropdown für routeForm - fest positioniert */
#routeFormDropdownOptions {
    position: fixed;
    top: 10px;
    left: 5px;
    right: 5px;
    bottom: auto;
    margin: 0;
    width: auto;
    max-width: calc(100% - 10px);
}

.dropdown-options {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: rgba(22, 33, 62, 0.95);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(12px);
    max-height: 260px;
    overflow-y: auto;
    display: none;
    z-index: 2000;
}

.dropdown-options.dropdown-options--content-top {
    border-radius: 18px;
}
.dropdown-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:rgba(0,0,0,0.4);
    backdrop-filter:blur(4px);
    -webkit-backdrop-filter:blur(4px);
    z-index:2000;
    display: none;
    pointer-events: none;
}

.dropdown-backdrop.active {
    display: block;
    pointer-events: auto;
}

/* Inline overlay host (inside forms — partnerUser, sessionUsers, etc.) */
.dropdown-overlay-host {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 10px;
    z-index: 3500;
    pointer-events: none;
}

.dropdown-overlay-host.active {
    display: block;
}

.dropdown-overlay-host > .dropdown-options {
    position: relative;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-height: 65vh;
    pointer-events: auto;
}

/* Top-level global dropdown backdrop (sibling of #bottom-editor in #main-container) */
#dropdownOverlayHost {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3500;
    display: none;
    pointer-events: none;
    background: transparent;
    transition: background 250ms ease, backdrop-filter 250ms ease;
}

#dropdownOverlayHost.active {
    display: block;
    pointer-events: auto;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

#dropdownOverlayHost > .dropdown-options {
    position: absolute;
    top: 20%;
    left: 10px;
    right: 10px;
    width: auto;
    max-height: 70vh;
    pointer-events: auto;
    overflow-y: auto;
}

/* When the table-modal is docked into the global overlay host, only its own
   position needs to adapt to the host (which already fills the viewport);
   its own background/backdrop-filter keeps providing the blur (the host's
   blur is neutralized via inline style while docked — see closeTableModal /
   OpenSelectionTable — to avoid stacking two nested backdrop-filters, which
   blurs the host's own flat overlay color instead of the page behind it). */
#dropdownOverlayHost > .table-modal {
    position: absolute;
    inset: 0;
    width: auto;
    height: auto;
}

.dropdown-option {
    padding: 1px 6px 1px 1px;
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.2s ease;
    border-bottom: 1px solid rgba(100, 116, 139, 0.1);
}

.dropdown-option:last-child {
    border-bottom: none;
}

.dropdown-option[data-has-value="true"] {
    background: rgba(68, 54, 72, 0.35);
}

.dropdown-option:hover {
    background: rgba(68, 54, 72, 0.5);
}

.dropdown-option:active {
    background: rgba(68, 54, 72, 0.8);
}

@media (max-width: 768px) {
    .custom-dropdown {
        width: 95%;
    }
    
    .dropdown-selected {
        font-size: 13px;
        padding: 10px 14px;
    }
    
    .dropdown-option {
        font-size: 13px;
        padding: 10px 14px;
    }
}

.route-delete {
    background: transparent;
    border: none;
    color: var(--accent-danger);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.route-delete:hover { 
    color: #dc2626;
    transform: scale(1.1);
}

/* === 7. Gebiete-Liste === */
#areasList {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Platzhalter für BottomBar */
.bottom-bar-spacer {
    height: 80px;
    flex-shrink: 0;
}

.list-header {
    flex-shrink: 0;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--accent-primary);
    margin-bottom: 10px;
}

#areasList h3 {
    margin: 20px 0 15px 0;
    color: var(--text-primary);
    font-size: 22px;
    font-weight: 700;
}

.file-actions {
    display: flex;
    gap: 10px;
}

.btn-icon {
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.areas-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.area-item {
    background: linear-gradient(135deg, rgba(26, 32, 46, 0.7) 0%, rgba(22, 33, 62, 0.7) 100%);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 18px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
}

.area-item:hover {
    border-color: var(--accent-primary);
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.15) 0%, rgba(124, 58, 237, 0.15) 100%);
    box-shadow: var(--shadow-glow);
    transform: translateY(-3px);
}

.area-item:active {
    transform: translateY(-1px);
}

.area-name {
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 17px;
}

.area-coords {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.area-coords small {
    color: var(--text-tertiary);
}

.empty-message {
    text-align: center;
    color: var(--text-tertiary);
    padding: 30px 20px;
    font-style: italic;
    font-size: 14px;
}

.area-description {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 8px 0;
    line-height: 1.5;
    max-height: 42px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* === 8. Popups & Marker === */
.custom-marker {
    background: none !important;
    border: none !important;
}

.leaflet-div-icon {
    background: none !important;
    border: none !important;
}

.leaflet-popup-content-wrapper {
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(22, 33, 62, 0.95) 100%) !important;
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
}

.leaflet-popup-content {
    min-width: 200px;
    color: var(--text-primary);
    margin: 16px;
}

.leaflet-popup-tip {
    background: var(--bg-card) !important;
}

.leaflet-popup-content .area-description-popup {
    margin: 10px 0;
    padding: 10px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-secondary);
}

/* === 9. Scrollbar Styling === */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(15, 15, 35, 0.3);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    border-radius: 10px;
    transition: all 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--accent-secondary) 0%, var(--accent-primary) 100%);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

/* === 10. Responsive & Sonstiges === */
@media (max-width: 768px) {
    .area-desc textarea {
        min-height: 60px;
        padding: 10px;
    }
    .area-description {
        font-size: 12px;
        -webkit-line-clamp: 1;
    }
    .contentForm {
        padding: 16px 5px;
    }
}

/* === 11. Stars Rating Container === */
.stars-rating-container {
    display: inline-flex;
    gap: 2px;
    margin-right: 1px;
    align-items: center;
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 2px 4px;
}

.star-rating {
    font-size: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #ccc;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.star-rating:hover {
    transform: scale(1.1);
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.8));
}

/* === 12. Table Selection Modals === */
#btn_panelsave.table-modal-hide-save {
    display: none !important;
}

.table-modal {
    display: none;
    position: fixed;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 15, 35, 0.9);
    backdrop-filter: blur(12px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.table-modal > div {
    background: var(--bg-secondary);
    backdrop-filter: blur(20px);
    padding: 28px 10px;
    padding-top: 0px;
    border-radius: 7px;
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    max-height: 85vh;
    overflow-y: auto;
    min-width: 320px;
    max-width: 500px;
}


.selection-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 4px;
    /* Own stacking context so the sticky header's z-index is compared only
       against this table's rows, not bled through by ancestor contexts
       (table-modal's backdrop-filter etc.) — avoids body rows painting over
       the sticky header while scrolling on some browsers. */
    isolation: isolate;
}

.selection-table td,
.selection-table th {
    padding: 12px 16px !important;
    color: var(--text-opposite);
    font-size: 14px;
}

.selection-table tr:first-child {
    position: sticky;
    top: 0;
    z-index: 100;
    opacity: 1;
}


.selection-table th {
    background: var(--bg-tertiary) 0%;
    color: var(--text-primary);
    font-weight: 700;
    text-align: left;
    border-bottom: 2px solid var(--accent-primary);
    position: sticky;
    top: 0;
    z-index: 100;
    /* border-spacing leaves a transparent gap below the sticky header through
       which scrolling rows are visible underneath; mask exactly that gap. */
    box-shadow: 0 4px 0 0 var(--bg-tertiary);
}

.selection-table tr {
    position: relative;
    z-index: 1;
    transition: all 0.2s ease;
    border-radius: 8px;
    opacity: 0.6;
}

.selection-table tr:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-sm);
    opacity: 0.8;
}

.selection-table-reset-row td {
    text-align: center;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    border-style: dashed;
}

.selection-table-reset-row:hover td {
    color: #f44336;
    border-color: #f44336;
}

.selection-table td {
    background: inherit;
    border: 1px solid var(--border-color);
}

.selection-table td:first-child {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

.selection-table td:last-child {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

/* === 13. NoScript Warning === */
.noscript-warning {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, var(--accent-danger) 0%, #dc2626 100%);
    color: white;
    padding: 30px 40px;
    border-radius: 20px;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    box-shadow: var(--shadow-lg);
    z-index: 99999;
}

/* === 14. Multi-pitch Toggle === */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
    cursor: pointer;
}

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: transparent;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 10px;
    width: 10px;
    left: 3px;
    top: 50%;
    transform: translateY(-50%);
    background-color: var(--text-secondary);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.toggle-switch input:checked + .toggle-slider {
    border-color: var(--bg-secondary);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translate(14px, -50%);
    background-color: var(--bg-secondary);
}

.version-container {
    margin: 20px auto 20%;
    padding: 10px 16px;
    text-align: center;
    font-size: 12px;
    color: var(--text-secondary);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    max-width: 500px;
}

.version-container span {
    letter-spacing: 0.02em;
}
/* ==========================================
   Touch-optimierter Timepicker
   ========================================== */

.timepicker-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.timepicker-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(2px);
}

.timepicker-container {
    position: relative;
    background-color: var(--bg-primary);
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

.timepicker-header {
    padding: 16px 20px;
    background-color: var(--bg-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.timepicker-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.timepicker-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.timepicker-close:hover {
    color: var(--text-primary);
}

.timepicker-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.timepicker-display {
    text-align: center;
    font-size: 48px;
    font-weight: 300;
    color: var(--text-primary);
    margin-bottom: 20px;
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
}

.timepicker-separator {
    margin: 0 4px;
}

.timepicker-selector {
    margin-top: 20px;
}

.timepicker-options {
    display: grid;
    gap: 8px;
    max-height: 320px;
    overflow-y: auto;
    padding: 4px;
}

/* Stunden-Grid: 6 Spalten für 24 Stunden */
#timepickerHours {
    grid-template-columns: repeat(6, 1fr);
}

/* Minuten-Grid: 2 Spalten für 4 Optionen (15min Takt) */
#timepickerMinutes {
    grid-template-columns: repeat(2, 1fr);
    max-height: none;
}

#timepickerMinutes .timepicker-option {
    font-size: 24px;
    min-height: 80px;
}

.timepicker-option {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-secondary);
    border: 2px solid transparent;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.timepicker-option:hover {
    background-color: var(--bg-hover);
}

.timepicker-option.selected {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
}

.timepicker-option:active {
    transform: scale(0.95);
}

.timepicker-footer {
    padding: 16px 20px;
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.timepicker-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.timepicker-btn-clear {
    background-color: transparent;
    color: var(--text-secondary);
    margin-right: auto;
}

.timepicker-btn-clear:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.timepicker-btn-cancel {
    background-color: transparent;
    color: var(--text-secondary);
}

.timepicker-btn-cancel:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.timepicker-btn:active {
    transform: scale(0.97);
}

/* Scrollbar für Timepicker-Optionen */
.timepicker-options::-webkit-scrollbar {
    width: 6px;
}

.timepicker-options::-webkit-scrollbar-track {
    background: var(--bg-primary);
    border-radius: 3px;
}

.timepicker-options::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.timepicker-options::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* === Bottom Bar === */
.bottom-bar {
    width: 100%;
    height: 10%;
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-bottom: 2px solid var(--border-color);
    box-shadow: var(--shadow-md);
    z-index: 100;
    --active-tab: 0;
}

/* Gleitender Tab-Indikator */
.bottom-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 25%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 0;
    transform: translateX(calc(var(--active-tab) * 100%));
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
    pointer-events: none;
}

#bottomBarBG {
    position: absolute;
    background: linear-gradient(180deg, var(--bottombar-bg-start) 0%, var(--bottombar-bg-end) 100%);
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    box-shadow: var(--bottombar-shadow);
}

.bottom-bar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 10px;
    gap: 8px;
    color: var(--text-secondary);
    position: relative;
    z-index: 2;
}

.bottom-bar-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.bottom-bar-item.active {
    color: var(--text-primary);
}

.bottom-bar-icon {
    width: 28px;
    height: 28px;
    color: inherit;
}

.bottom-bar-label {
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    color: inherit;
}

/* === Recording-category level-based title sizes === */

/* Level 1: top-level recording-category title */
.recording-category > .recording-category-title {
    font-size: 20px;
}

/* Level 2: nested inside recording-category-items */
.recording-category-items > .recording-category > .recording-category-title {
    font-size: 11px;
}

/* History category level-based title sizes */
.history-category > .history-category-title {
    font-size: 28px;
}

.history-category-items > .history-category > .history-category-title {
    font-size: 17px;
}

/* sectorsCategory / routesCategory / routesCategorySector: flat list style */
#sectorsCategory,
#routesCategory,
#routesCategorySector {
    cursor: pointer;
    padding-left: 0;
    padding-right: 0;
    padding-top: 5px;
    padding-bottom: 0;
    margin-bottom: 15px;
    border: none;
}

#sectorsCategory > .recording-category-title,
#routesCategory > .recording-category-title,
#routesCategorySector > .recording-category-title {
    padding-left: 15px;
}
