[hidden] { display: none !important; }

        :root {
            --bg-primary: #ffffff;
            --bg-secondary: #f8fafc;
            --bg-card: #ffffff;
            --text-primary: #1e293b;
            --text-secondary: #64748b;
            --text-muted: #94a3b8;
            --accent-water: #0ea5e9;
            --accent-water-light: #38bdf8;
            --accent-water-dark: #0369a1;
            --accent-land: #22c55e;
            --border: #e2e8f0;
            --border-dark: #cbd5e1;
            --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.05);
            --shadow-lg: 0 4px 24px rgba(0,0,0,0.12);
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        html, body {
            height: 100%;
            overflow: hidden;
        }

        body {
            font-family: 'DM Sans', sans-serif;
            background: var(--bg-secondary);
            color: var(--text-primary);
            display: flex;
            flex-direction: column;
        }

        header {
            background: var(--bg-card);
            border-bottom: 1px solid var(--border);
            padding: 0.875rem 1.5rem;
            display: flex;
            align-items: center;
            justify-content: space-between;
            box-shadow: var(--shadow);
            z-index: 100;
        }

        .logo {
            display: flex;
            align-items: center;
            gap: 0.625rem;
        }

        .logo-icon {
            width: 32px;
            height: 32px;
            background: linear-gradient(135deg, var(--accent-water) 0%, var(--accent-water-dark) 100%);
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .logo-img {
            height: 32px;
            width: auto;
            display: block;
        }
        .logo-icon svg {
            width: 18px;
            height: 18px;
            fill: white;
        }

        h1 {
            font-size: 1.125rem;
            font-weight: 600;
            letter-spacing: -0.02em;
            color: var(--text-primary);
        }

        .location-badge {
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .location-name {
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.8rem;
            color: var(--text-secondary);
            background: var(--bg-secondary);
            padding: 0.375rem 0.75rem;
            border-radius: 6px;
            border: 1px solid var(--border);
        }

        .km-badge {
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.75rem;
            color: var(--accent-water-dark);
            background: rgba(14, 165, 233, 0.1);
            padding: 0.375rem 0.625rem;
            border-radius: 6px;
            font-weight: 500;
        }

        .km-badge-select {
            border: 1px solid rgba(14, 165, 233, 0.22);
            outline: none;
            cursor: pointer;
            min-width: 7.4rem;
        }

        .km-badge-select:hover,
        .km-badge-select:focus-visible {
            border-color: rgba(3, 105, 161, 0.55);
            box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.12);
        }

        .pdf-export-modal-backdrop {
            position: fixed;
            inset: 0;
            z-index: 100000;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 0.55rem;
            background: rgba(15, 23, 42, 0.58);
            backdrop-filter: blur(4px);
            -webkit-backdrop-filter: blur(4px);
        }

        .pdf-export-modal {
            position: relative;
            width: min(99vw, 2100px);
            height: min(98vh, 1400px);
            background: #edf2f4;
            border: 1px solid rgba(255,255,255,0.7);
            border-radius: 14px;
            overflow: hidden;
            box-shadow: 0 24px 80px rgba(15,23,42,0.34);
        }

        .pdf-export-modal-frame {
            display: block;
            width: 100%;
            height: 100%;
            border: 0;
            background: #edf2f4;
        }

        .pdf-export-modal-close {
            position: absolute;
            top: 10px;
            right: 10px;
            z-index: 3;
            width: 36px;
            height: 36px;
            border-radius: 999px;
            border: 1px solid rgba(15,23,42,0.15);
            background: rgba(255,255,255,0.96);
            color: #334155;
            font-size: 22px;
            line-height: 1;
            cursor: pointer;
            box-shadow: 0 4px 16px rgba(15,23,42,0.16);
        }

        .pdf-export-modal-close:hover,
        .pdf-export-modal-close:focus-visible {
            color: #0f172a;
            border-color: rgba(15,23,42,0.3);
        }

        body.pdf-export-modal-open {
            overflow: hidden;
        }

        main {
            flex: 1;
            display: grid;
            grid-template-columns: 1fr 300px;
            grid-template-rows: 1fr;
            gap: 1rem;
            padding: 1rem;
            min-height: 0;
            height: 100%;
        }

        .map-container {
            background: var(--bg-card);
            border-radius: 12px;
            border: 1px solid var(--border);
            box-shadow: var(--shadow);
            overflow: hidden;
            position: relative;
            min-height: 0;
        }

.map-tool-rail,
.map-utility-rail {
    position: absolute;
    z-index: 450;
    display: flex;
    gap: 0.5rem;
}

.map-tool-rail {
    top: 3.5rem;
    left: 0.875rem;
    flex-direction: column;
}

.map-utility-rail {
    top: 0.875rem;
    right: 0.875rem;
    flex-direction: column;
}

.map-tool-btn,
.map-utility-btn {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: rgba(255, 255, 255, 0.94);
    color: #475569;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.14);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.map-tool-btn:hover,
.map-utility-btn:hover {
    transform: translateY(-1px);
    color: #0f172a;
    border-color: rgba(15, 23, 42, 0.22);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
}

.map-tool-btn svg,
.map-utility-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.map-tool-rail > *,
.map-utility-rail > * {
    pointer-events: auto;
}

.map-tool-btn[data-mode="culvert"].active {
    color: #ffffff;
    border-color: #f97316;
    background: #f97316;
}
.map-tool-btn[data-mode="dike"].active {
    color: #ffffff;
    border-color: #7c3aed;
    background: #7c3aed;
}
.map-tool-btn[data-mode="excavation"].active {
    color: #ffffff;
    border-color: #0284c7;
    background: #0284c7;
}
.map-tool-btn[data-mode="hydrology"].active {
    color: #ffffff;
    border-color: #16a34a;
    background: #16a34a;
}

.map-utility-btn.primary {
    color: #2563eb;
}

.map-utility-btn#btnMeasureDistance.active {
    color: #ffffff;
    border-color: #0f172a;
    background: #0f172a;
}

.map-utility-btn#btnClearMeasurement[hidden] {
    display: none;
}

/* Compacte actierail: zelfstandige Statistieken-knop + gegroepeerde exports. */
.atelier-export-group {
    position: relative;
    pointer-events: auto;
}
.atelier-export-menu-toggle[aria-expanded="true"] {
    color: #ffffff;
    border-color: #2563eb;
    background: #2563eb;
}
.atelier-export-menu-panel {
    position: absolute;
    top: 0;
    right: calc(100% + 10px);
    z-index: 470;
    width: 210px;
    display: grid;
    gap: 0.35rem;
    padding: 0.5rem;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 12px;
    background: rgba(255,255,255,0.97);
    box-shadow: 0 14px 32px rgba(15,23,42,0.18);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.atelier-export-menu-panel[hidden] {
    display: none !important;
}
.atelier-export-menu-row {
    min-width: 0;
    display: grid;
    grid-template-columns: 38px minmax(0,1fr);
    align-items: center;
    gap: 0.55rem;
    padding: 0.25rem 0.4rem 0.25rem 0.25rem;
    border-radius: 8px;
}
.atelier-export-menu-row:hover {
    background: var(--bg-secondary);
}
.atelier-export-menu-row .map-utility-btn {
    width: 38px;
    height: 38px;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}
.atelier-export-menu-row .map-utility-btn::after {
    display: none !important;
}
.atelier-export-menu-label {
    min-width: 0;
    color: var(--text-primary);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1.2;
}

/* Afvoerreferenties gebruiken dezelfde visuele taal als andere Atelier-inputs. */
.hydraulic-reference-row {
    margin-top: 0.8rem;
}
.hydraulic-reference-row .input-group {
    width: 100%;
}
.hydraulic-reference-row label {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--text-muted);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.035em;
    text-transform: uppercase;
}
.hydraulic-reference-select {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 0.52rem 2rem 0.52rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--bg-card);
    color: var(--text-primary);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.78rem;
    cursor: pointer;
}
.hydraulic-reference-select:hover {
    border-color: var(--border-dark);
}
.hydraulic-reference-select:focus-visible {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}
#hydraulicReferenceStatus {
    display: block;
    margin-top: 0.35rem;
    color: var(--text-muted);
    font-size: 0.68rem;
    line-height: 1.35;
}

.measure-distance-tooltip {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(15, 23, 42, 0.16);
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.16);
    color: #0f172a;
    padding: 0;
}

.measure-distance-tooltip::before {
    border-top-color: rgba(255, 255, 255, 0.96);
}

.measure-distance-label {
    display: block;
    padding: 0.4rem 0.55rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.74rem;
    white-space: nowrap;
}

.measure-distance-label strong {
    font-weight: 700;
}

.map-tool-btn::after,
.map-utility-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(15, 23, 42, 0.92);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 500;
    line-height: 1;
    padding: 0.45rem 0.55rem;
    border-radius: 7px;
    pointer-events: none;
    opacity: 0;
    white-space: nowrap;
    transition: opacity 0.12s ease, transform 0.12s ease;
}

.map-tool-btn::after {
    left: calc(100% + 10px);
    transform: translateY(-50%) translateX(-2px);
}

.map-utility-btn::after {
    right: calc(100% + 10px);
    transform: translateY(-50%) translateX(2px);
}

.map-tool-btn:hover::after,
.map-tool-btn:focus-visible::after,
.map-utility-btn:hover::after,
.map-utility-btn:focus-visible::after {
    opacity: 1;
}

.map-tool-btn:hover::after,
.map-tool-btn:focus-visible::after {
    transform: translateY(-50%) translateX(0);
}

.map-utility-btn:hover::after,
.map-utility-btn:focus-visible::after {
    transform: translateY(-50%) translateX(0);
}

.map-context-panel {
    position: absolute;
    left: 4.125rem;
    top: 0.875rem;
    bottom: auto;
    z-index: 430;
    width: min(360px, calc(100% - 6rem));
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 12px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
    padding: 0.75rem;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.map-context-panel .mode-description {
    margin: 0;
    text-align: left;
    background: rgba(248, 250, 252, 0.95);
}

.map-context-panel .mode-actions .btn {
    margin-top: 0;
}


        #map {
            width: 100%;
            height: 100%;
            background: #e8e8e8;
        }

        .leaflet-container {
            font-family: 'DM Sans', sans-serif;
        }

        .controls-panel {
            display: flex;
            flex-direction: column;
            gap: 0.75rem;
            overflow-y: auto;
            overflow-x: hidden;
            min-height: 0;
        }

        .control-card {
            background: var(--bg-card);
            border-radius: 10px;
            border: 1px solid var(--border);
            box-shadow: var(--shadow);
            overflow: hidden;
            flex: 0 0 auto;
        }

        .control-card.sticky-water-card {
            position: sticky;
            top: 0;
            z-index: 30;
            box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
        }

        .control-card-header {
            padding: 0.75rem 1rem;
            border-bottom: 1px solid var(--border);
            display: flex;
            align-items: center;
            gap: 0.625rem;
            background: var(--bg-secondary);
        }

        .control-card-icon {
            width: 28px;
            height: 28px;
            border-radius: 6px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .control-card-icon.water {
            background: rgba(14, 165, 233, 0.12);
            color: var(--accent-water);
        }

        .control-card-icon.point {
            background: rgba(239, 68, 68, 0.12);
            color: #ef4444;
        }

        .control-card-icon.culvert {
            background: rgba(249, 115, 22, 0.12);
            color: #f97316;
        }

        .control-card-icon.dike {
            background: rgba(124, 58, 237, 0.12);
            color: #7c3aed;
        }

        .control-card-icon.info {
            background: rgba(34, 197, 94, 0.12);
            color: var(--accent-land);
        }

        .control-card-icon.save {
            background: rgba(59, 130, 246, 0.12);
            color: #3b82f6;
        }

        .control-card-icon svg {
            width: 16px;
            height: 16px;
        }

        .control-card-title {
            font-size: 0.8rem;
            font-weight: 600;
            color: var(--text-primary);
        }

        .control-card-body {
            padding: 1rem;
        }


        .edit-overlay-toggle-control {
            background: rgba(255,255,255,0.96);
            border-radius: 8px;
            box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
            overflow: hidden;
        }

        .edit-overlay-toggle-btn {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.55rem 0.7rem;
            background: transparent;
            border: 0;
            cursor: pointer;
            color: var(--text-primary);
            font-family: 'DM Sans', sans-serif;
            font-size: 0.78rem;
            font-weight: 600;
            min-width: 122px;
        }

        .edit-overlay-toggle-btn:hover {
            background: rgba(248, 250, 252, 0.96);
        }

        .edit-overlay-toggle-dot {
            width: 10px;
            height: 10px;
            border-radius: 999px;
            background: #22c55e;
            box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.14);
            flex: 0 0 auto;
        }

        .edit-overlay-toggle-btn.is-off .edit-overlay-toggle-dot {
            background: #94a3b8;
            box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.16);
        }

        .edit-overlay-toggle-text {
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            line-height: 1.15;
        }

        .edit-overlay-toggle-label {
            font-size: 0.78rem;
            font-weight: 600;
        }

        .edit-overlay-toggle-state {
            font-size: 0.68rem;
            color: var(--text-secondary);
            font-weight: 500;
        }

        .water-level-display {
            margin-bottom: 1.25rem;
        }

        .water-level-main {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.75rem;
        }

        .water-level-readout {
            text-align: center;
            min-width: 0;
        }

        .water-level-value {
            font-family: 'JetBrains Mono', monospace;
            font-size: 2.5rem;
            font-weight: 700;
            background: linear-gradient(135deg, var(--accent-water) 0%, var(--accent-water-dark) 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            line-height: 1;
        }

        .water-level-unit {
            font-size: 0.875rem;
            color: var(--text-secondary);
            margin-top: 0.125rem;
        }

        .water-stepper {
            display: flex;
            flex-direction: column;
            gap: 0.375rem;
            flex: 0 0 auto;
        }

        .step-btn {
            width: 2rem;
            height: 1.6rem;
            border: 1px solid var(--border);
            border-radius: 0.5rem;
            background: var(--bg-secondary);
            color: var(--text-secondary);
            display: inline-flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
        }

        .step-btn:hover {
            background: #eaf7fd;
            border-color: rgba(14, 165, 233, 0.35);
            color: var(--accent-water-dark);
        }

        .step-btn svg {
            width: 16px;
            height: 16px;
        }

        .hidden-primary-input {
            display: none;
        }

        .slider-container {
            margin-bottom: 1.25rem;
        }

        .slider-labels {
            display: flex;
            justify-content: space-between;
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.7rem;
            color: var(--text-muted);
            margin-bottom: 0.375rem;
        }

        input[type="range"] {
            width: 100%;
            height: 6px;
            border-radius: 3px;
            background: var(--border);
            outline: none;
            -webkit-appearance: none;
            appearance: none;
        }

        input[type="range"]::-webkit-slider-thumb {
            -webkit-appearance: none;
            width: 18px;
            height: 18px;
            border-radius: 50%;
            background: linear-gradient(135deg, var(--accent-water-light) 0%, var(--accent-water) 100%);
            cursor: pointer;
            border: 2px solid white;
            box-shadow: 0 2px 6px rgba(14, 165, 233, 0.4);
            transition: transform 0.15s ease;
        }

        input[type="range"]::-webkit-slider-thumb:hover {
            transform: scale(1.1);
        }

        .input-group {
            margin-top: 0.75rem;
        }

        .input-group label {
            display: block;
            font-size: 0.7rem;
            color: var(--text-muted);
            margin-bottom: 0.25rem;
            text-transform: uppercase;
            letter-spacing: 0.04em;
            font-weight: 500;
        }

        .input-group input {
            width: 100%;
            padding: 0.5rem 0.75rem;
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.875rem;
            background: var(--bg-secondary);
            border: 1px solid var(--border);
            border-radius: 6px;
            color: var(--text-primary);
            outline: none;
            transition: border-color 0.15s ease, box-shadow 0.15s ease;
        }

        .input-group input:focus {
            border-color: var(--accent-water);
            box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
        }

        /* River data section styling */
        .river-data-section {
            margin-top: 1rem;
        }

        .river-data-toggle {
            width: 100%;
            background: transparent;
            border: 0;
            padding: 0;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 0.75rem;
            cursor: pointer;
            text-align: left;
        }

        .river-data-chevron {
            width: 1.25rem;
            height: 1.25rem;
            color: var(--text-muted);
            display: inline-flex;
            align-items: center;
            justify-content: center;
            transition: transform 0.15s ease;
            flex: 0 0 auto;
        }

        .river-data-toggle svg {
            width: 16px;
            height: 16px;
        }

        .river-data-toggle.collapsed .river-data-chevron {
            transform: rotate(-90deg);
        }

        .river-data-body {
            margin-top: 0.75rem;
        }

        .river-data-body.collapsed {
            display: none;
        }

        .river-data-divider {
            height: 1px;
            background: var(--border);
            margin-bottom: 0.875rem;
        }

        .river-data-header {
            display: flex;
            flex-direction: column;
            gap: 0.125rem;
            margin-bottom: 0.75rem;
        }

        .river-data-title {
            font-size: 0.7rem;
            font-weight: 600;
            color: var(--text-secondary);
            text-transform: uppercase;
            letter-spacing: 0.04em;
        }

        .river-data-subtitle {
            font-size: 0.65rem;
            color: var(--text-muted);
            font-family: 'JetBrains Mono', monospace;
        }

        .input-row {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 0.5rem;
        }

        .input-group.compact {
            margin-top: 0;
        }

        .input-group.compact label {
            font-size: 0.65rem;
            margin-bottom: 0.1875rem;
        }

        .input-group.compact input {
            padding: 0.375rem 0.5rem;
            font-size: 0.8rem;
        }

        .points-list {
            display: flex;
            flex-direction: column;
            gap: 0.375rem;
            max-height: 150px;
            overflow-y: auto;
        }

        .point-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0.5rem 0.625rem;
            background: var(--bg-secondary);
            border-radius: 6px;
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.75rem;
            gap: 0.5rem;
        }

        .point-marker {
            width: 10px;
            height: 10px;
            border-radius: 50%;
            background: #ef4444;
            flex-shrink: 0;
            box-shadow: 0 0 6px rgba(239, 68, 68, 0.4);
        }

        .point-input-group {
            flex: 1;
            display: flex;
            align-items: center;
            gap: 0.25rem;
            min-width: 0;
        }

        .point-label {
            color: var(--text-secondary);
            white-space: nowrap;
        }

        .point-height-input {
            width: 65px;
            padding: 0.25rem 0.375rem;
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.75rem;
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: 4px;
            color: var(--text-primary);
            text-align: right;
        }

        .point-height-input:focus {
            outline: none;
            border-color: #ef4444;
            box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.1);
        }

        .point-unit {
            color: var(--text-muted);
            font-size: 0.7rem;
        }

        .manual-badge {
            font-size: 0.6rem;
            background: rgba(239, 68, 68, 0.15);
            color: #ef4444;
            padding: 2px 4px;
            border-radius: 3px;
            white-space: nowrap;
        }

        .manual-badge.culvert {
            background: rgba(168, 85, 247, 0.15);
            color: #a855f7;
        }

        .point-coords {
            flex: 1;
            color: var(--text-secondary);
        }

        .point-remove {
            width: 20px;
            height: 20px;
            border: none;
            background: rgba(239, 68, 68, 0.1);
            color: #ef4444;
            border-radius: 4px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: background 0.15s ease;
            flex-shrink: 0;
        }

        .point-remove:hover {
            background: rgba(239, 68, 68, 0.2);
        }

        /* Mode toggle buttons */
        .mode-toggle {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 0.5rem;
            margin-bottom: 0.75rem;
        }

        .mode-btn {
            min-width: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.375rem;
            padding: 0.5rem 0.5rem;
            border: 1px solid var(--border);
            border-radius: 6px;
            background: var(--bg-secondary);
            color: var(--text-secondary);
            font-family: 'DM Sans', sans-serif;
            font-size: 0.72rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.15s ease;
            white-space: nowrap;
        }

        .mode-btn svg {
            width: 14px;
            height: 14px;
            fill: currentColor;
        }

        .mode-btn:hover {
            border-color: var(--border-dark);
            color: var(--text-primary);
        }

        .mode-btn.active[data-mode="inflow"] {
            background: rgba(239, 68, 68, 0.1);
            border-color: #ef4444;
            color: #ef4444;
        }

        .mode-btn.active[data-mode="culvert"] {
            background: rgba(168, 85, 247, 0.1);
            border-color: #a855f7;
            color: #a855f7;
        }

        .mode-description {
            font-size: 0.75rem;
            color: var(--text-muted);
            text-align: center;
            padding: 0.5rem;
            background: var(--bg-secondary);
            border-radius: 4px;
        }

        /* Culvert marker styling */
        .culvert-marker {
            width: 10px;
            height: 10px;
            border-radius: 50%;
            background: #a855f7;
            flex-shrink: 0;
            box-shadow: 0 0 6px rgba(168, 85, 247, 0.4);
        }

        .culvert-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0.5rem 0.625rem;
            background: var(--bg-secondary);
            border-radius: 6px;
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.75rem;
            gap: 0.5rem;
        }

        .culvert-input-group {
            flex: 1;
            display: flex;
            align-items: center;
            gap: 0.25rem;
            min-width: 0;
        }

        .culvert-label {
            color: var(--text-secondary);
            white-space: nowrap;
        }

        .culvert-height-input {
            width: 65px;
            padding: 0.25rem 0.375rem;
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.75rem;
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: 4px;
            color: var(--text-primary);
            text-align: right;
        }

        .culvert-height-input:focus {
            outline: none;
            border-color: #a855f7;
            box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.1);
        }

        .culvert-unit {
            color: var(--text-muted);
            font-size: 0.7rem;
        }

        .culvert-info {
            flex: 1;
            color: var(--text-secondary);
        }

        .culvert-remove {
            width: 20px;
            height: 20px;
            border: none;
            background: rgba(168, 85, 247, 0.1);
            color: #a855f7;
            border-radius: 4px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: background 0.15s ease;
            flex-shrink: 0;
        }

        .culvert-remove:hover {
            background: rgba(168, 85, 247, 0.2);
        }

        .empty-state {
            text-align: center;
            padding: 1rem;
            color: var(--text-muted);
            font-size: 0.8rem;
            line-height: 1.4;
        }

        .btn {
            width: 100%;
            padding: 0.625rem 0.875rem;
            border: none;
            border-radius: 6px;
            font-family: 'DM Sans', sans-serif;
            font-size: 0.8rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.15s ease;
            margin-top: 0.75rem;
        }

        .btn-secondary {
            background: var(--bg-secondary);
            color: var(--text-secondary);
            border: 1px solid var(--border);
        }

        .btn-secondary:hover {
            background: var(--border);
            color: var(--text-primary);
        }

        /* Situatie opslaan/laden */
        .situation-buttons {
            display: flex;
            gap: 0.5rem;
        }

        .situation-buttons .btn {
            flex: 1;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.375rem;
            margin-top: 0;
        }

        .situation-buttons .btn svg {
            width: 14px;
            height: 14px;
            fill: currentColor;
        }

        .btn-primary {
            background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
            color: white;
            border: none;
        }

        .btn-primary:hover {
            background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
        }

        .export-btn-bar {
            margin-top: 0;
            border-radius: 8px;
            padding: 0.85rem 1rem;
            font-size: 0.85rem;
            font-weight: 600;
            letter-spacing: 0.01em;
        }

        .situation-info {
            margin-top: 0.75rem;
            font-size: 0.75rem;
            color: var(--text-muted);
            text-align: center;
            min-height: 1.5em;
        }

        .situation-info.success {
            color: var(--accent-land);
        }

        .situation-info.error {
            color: #ef4444;
        }

        .export-info {
            margin-top: 0.75rem;
            font-size: 0.75rem;
            color: var(--text-muted);
            text-align: center;
            min-height: 1.5em;
        }

        .export-info.success {
            color: var(--accent-land);
        }

        .export-info.error {
            color: #ef4444;
        }

        .export-stage {
            position: fixed;
            left: -10000px;
            top: 0;
            width: 1600px;
            background: #ffffff;
            padding: 28px;
            z-index: -1;
        }

        .export-card {
            background: #ffffff;
            border: 1px solid var(--border);
            border-radius: 16px;
            overflow: hidden;
            box-shadow: 0 8px 32px rgba(15, 23, 42, 0.08);
        }

        .export-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 1rem;
            padding: 1rem 1.25rem;
            border-bottom: 1px solid var(--border);
            background: #ffffff;
        }

        .export-logo-wrap {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            min-width: 0;
        }

        .export-logo-wrap img {
            height: 34px;
            width: auto;
            display: block;
            flex-shrink: 0;
        }

        .export-logo-fallback {
            display: none;
            font-size: 0.95rem;
            font-weight: 700;
            color: var(--text-primary);
            white-space: nowrap;
        }

        .export-title-block {
            min-width: 0;
        }

        .export-title {
            font-size: 1.2rem;
            font-weight: 700;
            color: var(--text-primary);
            line-height: 1.2;
        }

        .export-subtitle {
            margin-top: 0.2rem;
            font-size: 0.82rem;
            color: var(--text-secondary);
        }

        .export-meta {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            flex-wrap: wrap;
            justify-content: flex-end;
        }

        .export-chip {
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.75rem;
            padding: 0.42rem 0.68rem;
            border-radius: 999px;
            border: 1px solid var(--border);
            background: var(--bg-secondary);
            color: var(--text-secondary);
            white-space: nowrap;
        }

        .export-chip.primary {
            color: var(--accent-water-dark);
            background: rgba(14, 165, 233, 0.1);
            border-color: rgba(14, 165, 233, 0.18);
            font-weight: 600;
        }

        .export-map-shell {
            position: relative;
            background: #ffffff;
        }

        .export-map-shell .map-container {
            border: none;
            border-radius: 0;
            box-shadow: none;
            height: 900px;
            min-height: 900px;
        }

        .export-map-shell #exportMapClone {
            width: 100%;
            height: 900px;
        }

        .export-map-shell #exportMapImage {
            width: 100%;
            height: auto;
            display: block;
        }

        .exporting .leaflet-control-container,
        .exporting .leaflet-control-attribution,
        .exporting .leaflet-control-minimap,
        .exporting .leaflet-tooltip,
        .exporting .leaflet-popup {
            display: none !important;
        }

        .exporting .leaflet-pane,
        .exporting canvas,
        .exporting img {
            image-rendering: auto;
        }

        body.export-capture-mode .map-container .leaflet-control-container,
        body.export-capture-mode .map-container .leaflet-control-attribution,
        body.export-capture-mode .map-container .leaflet-control-minimap,
        body.export-capture-mode .map-container .leaflet-tooltip,
        body.export-capture-mode .map-container .leaflet-popup {
            display: none !important;
        }

        .btn[disabled] {
            opacity: 0.65;
            cursor: wait;
        }

        .stats-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 0.5rem;
        }

        .stat-item {
            background: var(--bg-secondary);
            border-radius: 6px;
            padding: 0.625rem;
        }

        .stat-label {
            font-size: 0.65rem;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.04em;
            margin-bottom: 0.125rem;
        }

        .stat-value {
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.9rem;
            font-weight: 600;
            color: var(--text-primary);
        }

        .stat-value.water {
            color: var(--accent-water);
        }

        .stat-value.land {
            color: var(--accent-land);
        }

        /* Color legend */
        .color-legend {
            margin-top: 0.75rem;
            padding-top: 0.75rem;
            border-top: 1px solid var(--border);
        }

        .color-legend-title {
            font-size: 0.7rem;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.04em;
            margin-bottom: 0.5rem;
        }

        .color-bar {
            height: 12px;
            border-radius: 3px;
            background: linear-gradient(to right, #dbeafe 0%, #0ea5e9 100%);
            margin-bottom: 0.25rem;
        }

        .color-bar-labels {
            display: flex;
            justify-content: space-between;
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.65rem;
            color: var(--text-muted);
        }

        /* Draggable marker styling */
        .marker-dot {
            width: 16px;
            height: 16px;
            border-radius: 50%;
            border: 2px solid white;
            box-shadow: 0 2px 6px rgba(0,0,0,0.3);
            cursor: grab;
        }

        .marker-dot:active {
            cursor: grabbing;
        }

        .marker-dot.inflow {
            background: #ef4444;
            box-shadow: 0 2px 6px rgba(239, 68, 68, 0.5);
        }

        .marker-dot.culvert {
            width: 14px;
            height: 14px;
            background: rgba(249, 115, 22, 0.75);
            border: 2px solid rgba(255,255,255,0.95);
            box-shadow: 0 1px 4px rgba(249, 115, 22, 0.25);
        }

        .marker-dot.dike {
            width: 10px;
            height: 10px;
            background: rgba(124, 58, 237, 0.72);
            box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.1);
        }

        .inflow-marker-icon,
        .culvert-marker-icon,
        .dike-vertex-icon {
            background: transparent !important;
            border: none !important;
        }

        .inflow-ws-label {
            background: rgba(255,255,255,0.92);
            border: 1px solid var(--border);
            border-radius: 4px;
            box-shadow: var(--shadow);
            color: #1d4ed8;
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.68rem;
            font-weight: 600;
            padding: 2px 6px;
        }

        .loading-overlay {
            position: fixed;
            inset: 0;
            background: var(--bg-primary);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            z-index: 1000;
            transition: opacity 0.3s ease;
        }

        .loading-overlay.hidden {
            opacity: 0;
            pointer-events: none;
        }

        .loader {
            width: 40px;
            height: 40px;
            border: 3px solid var(--border);
            border-top-color: var(--accent-water);
            border-radius: 50%;
            animation: spin 1s linear infinite;
        }

        .loading-text {
            margin-top: 0.875rem;
            color: var(--text-secondary);
            font-size: 0.9rem;
        }

        @keyframes spin {
            to { transform: rotate(360deg); }
        }

        /* Map controls styling */
        .leaflet-control-zoom {
            border: 1px solid var(--border) !important;
            box-shadow: var(--shadow) !important;
        }

        .leaflet-control-zoom a {
            background: var(--bg-card) !important;
            color: var(--text-primary) !important;
            border-color: var(--border) !important;
        }

        .leaflet-control-zoom a:hover {
            background: var(--bg-secondary) !important;
        }

        /* Custom attribution */
        .leaflet-control-attribution {
            background: rgba(255,255,255,0.85) !important;
            font-size: 0.65rem !important;
        }

        /* Minimap styling */
        .leaflet-control-minimap {
            border: 2px solid var(--border-dark) !important;
            border-radius: 8px !important;
            box-shadow: var(--shadow-lg) !important;
            overflow: hidden !important;
        }

        .leaflet-control-minimap-toggle-display {
            background-color: var(--bg-card) !important;
            border-color: var(--border) !important;
        }

        /* Reset extent button */
        .reset-extent-btn {
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: 6px;
            box-shadow: var(--shadow);
            padding: 0;
            width: 34px;
            height: 34px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.15s ease;
        }

        .reset-extent-btn:hover {
            background: var(--bg-secondary);
            border-color: var(--border-dark);
        }

        .reset-extent-btn svg {
            width: 18px;
            height: 18px;
            fill: var(--text-secondary);
        }

        .reset-extent-btn:hover svg {
            fill: var(--text-primary);
        }

        /* Layer control styling */
        .leaflet-control-layers {
            border: 1px solid var(--border) !important;
            border-radius: 8px !important;
            box-shadow: var(--shadow) !important;
            background: var(--bg-card) !important;
        }

        .leaflet-control-layers-expanded {
            padding: 8px 12px !important;
        }

        .leaflet-control-layers-base,
        .leaflet-control-layers-overlays {
            padding: 4px 0;
        }

        .leaflet-control-layers-separator {
            border-top: 1px solid var(--border) !important;
            margin: 6px 0 !important;
        }

        .leaflet-control-layers label {
            font-family: 'DM Sans', sans-serif !important;
            font-size: 0.8rem !important;
            color: var(--text-primary) !important;
            margin-bottom: 4px !important;
        }

        .leaflet-control-layers-selector {
            margin-right: 6px !important;
        }


.control-card-icon.excavation { background: rgba(14, 165, 233, 0.12); color: #0369a1; }
.excavation-row { align-items: end; }
.micro-label {
    display: block;
    font-size: 0.62rem;
    margin-bottom: 0.1875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 500;
}
.excavation-mode-select {
    min-width: 4.5rem;
}
.excavation-input-group {
    flex-wrap: wrap;
    align-items: center;
}
.excavation-vertex-icon, .dike-vertex-icon {
    background: transparent;
    border: 0;
}
.marker-dot.excavation {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(14, 165, 233, 0.72);
    border: 2px solid rgba(255,255,255,0.95);
    box-shadow: 0 1px 4px rgba(2, 132, 199, 0.22);
}

.excavation-actions select, .excavation-actions input { width: 100%; }
.excavation-item .culvert-marker { background: linear-gradient(135deg, #0ea5e9, #0284c7); }
.excavation-item .manual-badge { background: rgba(14,165,233,0.14); color:#0369a1; }
.excavation-polygon { pointer-events: none; }


.mode-btn.active[data-mode="dike"] {
    background: rgba(124, 58, 237, 0.1);
    border-color: #7c3aed;
    color: #7c3aed;
}
.mode-btn.active[data-mode="excavation"] {
    background: rgba(14, 165, 233, 0.1);
    border-color: #0284c7;
    color: #0284c7;
}
.mode-btn.active[data-mode="hydrology"] {
    background: rgba(22, 163, 74, 0.1);
    border-color: #16a34a;
    color: #16a34a;
}
.control-card-icon.hydrology { background: rgba(34, 197, 94, 0.12); color: #15803d; }
.hydrology-item .culvert-marker { background: linear-gradient(135deg, #22c55e, #16a34a); box-shadow: 0 0 6px rgba(34, 197, 94, 0.35); }
.hydrology-item .manual-badge { background: rgba(34,197,94,0.14); color:#166534; }
.hydrology-badge { text-transform: none; }
.hydrology-vertex-icon { background: transparent; border: 0; }
.marker-dot.hydrology {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(34, 197, 94, 0.72);
    border: 2px solid rgba(255,255,255,0.95);
    box-shadow: 0 1px 4px rgba(22, 163, 74, 0.25);
}


.polygon-edit-handle {
    background: transparent;
    border: 0;
}
.polygon-edit-btn {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.18);
    background: rgba(255,255,255,0.96);
    color: #0f172a;
    display: grid;
    place-items: center;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    line-height: 1;
    font-weight: 700;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.16);
    cursor: pointer;
    padding: 0;
}
.polygon-edit-btn:hover {
    transform: scale(1.06);
}
.polygon-edit-handle.excavation .polygon-edit-btn {
    color: #0369a1;
    border-color: rgba(2, 132, 199, 0.28);
}
.polygon-edit-handle.hydrology .polygon-edit-btn {
    color: #166534;
    border-color: rgba(22, 163, 74, 0.28);
}
.polygon-edit-handle.dike .polygon-edit-btn {
    color: #6d28d9;
    border-color: rgba(124, 58, 237, 0.28);
}
.polygon-edit-handle.remove .polygon-edit-btn {
    font-size: 1rem;
}
.polygon-edit-handle.add .polygon-edit-btn {
    font-size: 1.02rem;
}

@media (max-width: 380px) {
    .mode-btn { font-size: 0.68rem; padding: 0.5rem 0.4rem; }
    .mode-btn svg { width: 13px; height: 13px; }
}


@media (max-width: 900px) {
    main {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(420px, 58vh) auto;
    }

    .controls-panel {
        max-height: none;
        overflow: visible;
    }
}

@media (max-width: 640px) {
    .map-tool-btn,
    .map-utility-btn {
        width: 40px;
        height: 40px;
    }

    .atelier-export-menu-panel {
        width: min(205px, calc(100vw - 5.5rem));
    }

    .map-context-panel {
        width: calc(100% - 1.75rem);
    }
}


@media (max-width: 1100px) {
    .map-tool-rail {
        left: 0.875rem;
        top: 4.25rem;
    }

    .map-context-panel {
        left: 5.1rem;
        top: 1rem;
        width: min(340px, calc(100% - 6rem));
    }
}


/* layout fix v2 */
main {
    grid-template-columns: minmax(0, 1fr) 320px;
    align-items: stretch;
}

.map-container {
    min-width: 0;
    height: 100%;
}

.controls-panel {
    width: 320px;
    max-width: 320px;
    min-width: 320px;
    height: 100%;
}

.map-tool-rail {
    top: 7.85rem;
    left: 0.875rem;
    pointer-events: none;
}

.map-context-panel {
    left: 5.1rem;
    top: 1rem;
    width: min(360px, calc(100% - 7.1rem));
    pointer-events: auto;
}

.map-utility-rail {
    top: auto;
    right: 0.875rem;
    bottom: 3.75rem;
    pointer-events: none;
}

.map-tool-btn[data-mode="culvert"].active {
    color: #f97316;
    border-color: #f97316;
    background: rgba(249, 115, 22, 0.1);
}

.control-card-icon.excavation {
    background: rgba(14, 165, 233, 0.12);
    color: #0284c7;
}

.control-card-icon.hydrology {
    background: rgba(34, 197, 94, 0.12);
    color: #16a34a;
}

@media (max-width: 1100px) {
    main {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(420px, 58vh) auto;
    }
    .controls-panel {
        width: auto;
        max-width: none;
        min-width: 0;
    }
    .map-tool-rail {
        top: 6.9rem;
        left: 0.875rem;
        pointer-events: none;
    }
    .map-context-panel {
        left: 0.875rem;
        top: 8.75rem;
        width: min(340px, calc(100% - 1.75rem));
    }
}


.map-feedback-stack {
    position: absolute;
    top: 0.875rem;
    right: 4.25rem;
    z-index: 445;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    max-width: min(320px, calc(100% - 6.5rem));
    pointer-events: none;
}

.map-feedback-stack .export-info,
.map-feedback-stack .situation-info {
    margin-top: 0;
    min-height: auto;
    text-align: left;
    padding: 0.55rem 0.75rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(15, 23, 42, 0.1);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
    color: #475569;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.map-feedback-stack .situation-info:empty {
    display: none;
}

.map-feedback-stack .export-info.success,
.map-feedback-stack .situation-info.success {
    color: #166534;
}

.map-feedback-stack .export-info.error,
.map-feedback-stack .situation-info.error {
    color: #b91c1c;
}

.info-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(15, 23, 42, 0.52);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.info-modal {
    width: min(860px, 100%);
    max-height: min(86vh, 900px);
    overflow: hidden;
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 24px 80px rgba(15, 23, 42, 0.34);
    border: 1px solid rgba(15, 23, 42, 0.08);
    display: flex;
    flex-direction: column;
}

.info-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.4rem 1rem;
    border-bottom: 1px solid var(--border);
}

.info-modal-header h2 {
    margin: 0.15rem 0 0;
    font-size: 1.35rem;
}

.info-modal-kicker {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
}

.info-modal-close {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: #f8fafc;
    color: #475569;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.info-modal-close:hover {
    background: #eef2f7;
    color: #0f172a;
}

.info-modal-close svg {
    width: 18px;
    height: 18px;
}

.info-modal-body {
    overflow: auto;
    padding: 1.15rem 1.4rem 1.4rem;
    display: grid;
    gap: 1rem;
}

.info-modal-body section {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 14px;
    padding: 1rem 1.05rem;
    background: #fbfdff;
}

.info-modal-body h3 {
    margin: 0 0 0.45rem;
    font-size: 1rem;
}

.info-modal-body p,
.info-modal-body li {
    font-size: 0.94rem;
    line-height: 1.55;
    color: #334155;
}

.info-modal-body ul {
    margin: 0.45rem 0 0;
    padding-left: 1.2rem;
}

.info-disclaimer-box {
    background: #fff8e8 !important;
    border-color: rgba(217, 119, 6, 0.22) !important;
}

.leaflet-control-layers-extra-divider {
    height: 1px;
    background: var(--border);
    margin: 8px 0 6px;
}

.leaflet-control-layers-extra-title {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #64748b;
    margin: 0 0 6px;
}

body.modal-open {
    overflow: hidden;
}

@media (max-width: 900px) {
    .map-feedback-stack {
        right: 0.875rem;
        left: 0.875rem;
        top: auto;
        bottom: 0.875rem;
        max-width: none;
    }

    .info-modal-backdrop {
        padding: 0.75rem;
    }

    .info-modal {
        width: 100%;
        max-height: 92vh;
    }
}


.export-info.hidden {
    display: none;
}


.culvert-toggle {
    min-width: 34px;
    height: 20px;
    border: none;
    background: rgba(15, 23, 42, 0.08);
    color: #334155;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.68rem;
    padding: 0 0.4rem;
    flex-shrink: 0;
}
.culvert-item.is-disabled { opacity: 0.72; }
.manual-badge.inactive { background: rgba(148,163,184,0.18); color: #64748b; }
.feature-index-pill {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font: 700 12px/1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    border: 2px solid rgba(255,255,255,0.95);
    box-shadow: 0 1px 5px rgba(15,23,42,0.18);
}
.feature-index-pill.is-inactive { background: #94a3b8 !important; }
.marker-dot.culvert.inactive { background: rgba(148,163,184,0.72); box-shadow: 0 0 6px rgba(148,163,184,0.25); }

/* Culvert lijn-markers (instroom/uitstroom) */
.culvert-vertex-icon { background: transparent; border: 0; }
.marker-dot.culvert.inflow-side {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fed7aa;
    border: 3px solid #f97316;
    box-shadow: 0 1px 6px rgba(249, 115, 22, 0.4);
}
.marker-dot.culvert.outflow-side {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ffffff;
    border: 3px solid #f97316;
    box-shadow: 0 1px 5px rgba(249, 115, 22, 0.35);
}
.culvert-arrow-icon { background: transparent; border: 0; }


.basin-label-marker {
    background: transparent;
    border: 0;
}
.basin-label-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 150px;
    max-width: 190px;
    padding: 6px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(15, 23, 42, 0.12);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.14);
    backdrop-filter: blur(3px);
}
.basin-label-title {
    color: #0f172a;
    font: 700 12px/1.15 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    margin-bottom: 2px;
}
.basin-label-meta {
    color: #334155;
    font: 600 11px/1.15 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    white-space: nowrap;
}

.control-card-icon.design-channel { background: rgba(20, 184, 166, 0.12); color: #0f766e; }
.design-channel-item .culvert-marker { background: linear-gradient(135deg, #14b8a6, #0f766e); box-shadow: 0 0 6px rgba(20, 184, 166, 0.35); }
.design-channel-item .manual-badge { background: rgba(20,184,166,0.14); color:#0f766e; }

/* Atelier Uiterwaard UI herordening: objectbeheer links naast de toolrail */
.tool-context-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.55rem;
}

.tool-context-kicker {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
}

.tool-context-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
    text-align: right;
}

.tool-context-section {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-top: 0.75rem;
}

.tool-context-section .points-list {
    max-height: min(38vh, 360px);
    overflow: auto;
    padding-right: 0.15rem;
}

.tool-add-btn {
    width: 100%;
    justify-content: center;
}

.map-context-panel .btn {
    width: 100%;
}

.map-context-panel .mode-actions .btn {
    width: auto;
    flex: 1 1 0;
}

.map-context-panel .culvert-item,
.map-context-panel .point-item {
    background: rgba(248, 250, 252, 0.92);
}

/* Atelier Uiterwaard UI herordening: objectbeheer links naast de toolrail */
.tool-context-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.55rem;
}

.tool-context-kicker {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
}

.tool-context-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
    text-align: right;
}

.tool-context-section {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-top: 0.75rem;
}

.tool-context-section .points-list {
    max-height: min(38vh, 360px);
    overflow: auto;
    padding-right: 0.15rem;
}

.tool-add-btn {
    width: 100%;
    justify-content: center;
}

.map-context-panel .btn {
    width: 100%;
}

.map-context-panel .mode-actions .btn {
    width: auto;
    flex: 1 1 0;
}

.map-context-panel .culvert-item,
.map-context-panel .point-item {
    background: rgba(248, 250, 252, 0.92);
}

/* Centrale viewer-update: sliderstand, bekkenlabels, DEM-kleuren en graafvolume */
.primary-mode-switch {
    display: flex;
    gap: 0.35rem;
    justify-content: center;
    margin: -0.35rem 0 0.85rem;
}
.primary-mode-switch button {
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border-radius: 999px;
    padding: 0.25rem 0.7rem;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.primary-mode-switch button.active {
    background: rgba(14, 165, 233, 0.12);
    border-color: rgba(14, 165, 233, 0.45);
    color: var(--accent-water-dark);
}
.primary-mode-switch button:hover {
    border-color: rgba(14, 165, 233, 0.45);
}

.terrain-color-control {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.55rem;
}
.terrain-color-control label {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.terrain-color-control select {
    min-width: 105px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-primary);
    border-radius: 0.45rem;
    font-size: 0.72rem;
    padding: 0.25rem 0.4rem;
}

.basin-label-box {
    position: relative;
    pointer-events: auto;
    cursor: pointer;
}
.basin-label-dot {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(15, 23, 42, 0.20);
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.18);
    color: #0369a1;
    font: 800 18px/1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    cursor: pointer;
    pointer-events: auto;
    user-select: none;
}
.basin-label-dot:hover {
    background: rgba(240, 249, 255, 0.98);
    border-color: rgba(14, 165, 233, 0.55);
}
.basin-label-collapse {
    position: absolute;
    top: 3px;
    right: 4px;
    width: 17px;
    height: 17px;
    border: 0;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.08);
    color: #334155;
    font: 700 13px/1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    cursor: pointer;
    padding: 0;
}
.basin-label-collapse:hover {
    background: rgba(14, 165, 233, 0.18);
    color: #0369a1;
}
.manual-badge.excavation-volume {
    background: rgba(14, 165, 233, 0.14);
    color: #0369a1;
}


/* Grondverzet */
.groundwork-hint { justify-content: flex-end; }
.groundwork-hint-text {
    min-height: 2rem;
    display: flex;
    align-items: center;
    padding: 0.35rem 0.5rem;
    border-radius: 4px;
    background: var(--bg-secondary);
    color: var(--text-muted);
    font-size: 0.68rem;
}
.groundwork-item {
    align-items: flex-start;
    padding: 0.55rem 0.5rem;
}
.groundwork-item-body {
    flex: 1;
    min-width: 0;
}
.groundwork-item-title {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}
.groundwork-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.35rem;
}
.groundwork-controls label {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}
.groundwork-controls label > span {
    color: var(--text-muted);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.58rem;
    text-transform: uppercase;
    letter-spacing: 0.035em;
}
.groundwork-controls .culvert-height-input {
    width: 100%;
    min-width: 0;
    text-align: left;
}
.groundwork-edge-select { min-width: 0 !important; }
.groundwork-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.28rem;
    margin-top: 0.42rem;
}
.groundwork-metrics span {
    border-radius: 999px;
    padding: 0.16rem 0.38rem;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.62rem;
    background: rgba(14,165,233,0.1);
    color: #0369a1;
}
.groundwork-metrics .groundwork-cut { background: rgba(180,83,9,0.10); color: #92400e; }
.groundwork-metrics .groundwork-fill { background: rgba(22,163,74,0.10); color: #166534; }
.groundwork-summary {
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
    margin-top: 0.6rem;
    padding: 0.55rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-secondary);
}
.groundwork-summary > div {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
}
.groundwork-summary span {
    font-size: 0.58rem;
    text-transform: uppercase;
    letter-spacing: 0.035em;
    color: var(--text-muted);
}
.groundwork-summary strong {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    color: var(--text-primary);
}
.groundwork-summary-net {
    grid-column: 1 / -1;
    padding-top: 0.35rem;
    border-top: 1px solid var(--border);
}

/* Lijnprofielen 2026-08-12: intuïtieve Dijk + Geul, gedeelde profielengine */
.map-tool-btn[data-mode="channel"].active {
    color: #ffffff;
    border-color: #0f766e;
    background: #0f766e;
}

.marker-dot.channel {
    width: 10px;
    height: 10px;
    background: rgba(15, 118, 110, 0.76);
    box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.10);
}

.channel-vertex-icon {
    background: transparent !important;
    border: none !important;
}

.culvert-marker.channel-marker {
    background: #0f766e;
}

.line-profile-item {
    display: block !important;
    padding: 0.6rem 0.55rem !important;
}

.line-profile-item-header {
    display: grid;
    grid-template-columns: auto 1fr auto auto auto;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.5rem;
}

.line-profile-item-header strong {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.74rem;
    color: var(--text-primary);
}

.line-profile-item-header .culvert-toggle,
.line-profile-item-header .culvert-remove {
    margin-left: 0;
}

.line-profile-controls {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.35rem;
}

.line-profile-controls label {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.15rem 0.2rem;
    align-items: center;
    min-width: 0;
    color: var(--text-muted);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.56rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.line-profile-controls label > span {
    grid-column: 1 / -1;
}

.line-profile-controls input {
    grid-column: 1;
    width: 100%;
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.28rem 0.32rem;
    background: #fff;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.68rem;
}

.line-profile-controls small {
    grid-column: 2;
    font-size: 0.58rem;
    text-transform: none;
}

.line-profile-steps-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.55rem;
    padding-top: 0.45rem;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.line-profile-steps-head button,
.line-profile-legacy-box button {
    border: 1px solid var(--border);
    border-radius: 4px;
    background: #fff;
    color: #334155;
    padding: 0.22rem 0.38rem;
    font: inherit;
    cursor: pointer;
    text-transform: none;
    letter-spacing: 0;
}

.line-profile-steps {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-top: 0.35rem;
}

.line-profile-step-empty {
    color: var(--text-muted);
    font-size: 0.61rem;
    line-height: 1.35;
}

.line-profile-step-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1.35fr) minmax(0, 0.8fr) minmax(0, 0.9fr) auto;
    gap: 0.25rem;
    align-items: end;
    padding: 0.35rem;
    border-radius: 5px;
    background: rgba(241, 245, 249, 0.82);
}

.line-profile-step-number {
    align-self: center;
    width: 1.15rem;
    height: 1.15rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e2e8f0;
    color: #475569;
    font-size: 0.58rem;
    font-weight: 700;
}

.line-profile-step-row label {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
    min-width: 0;
    color: var(--text-muted);
    font-size: 0.54rem;
}

.line-profile-step-row input {
    width: 100%;
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.24rem 0.28rem;
    background: #fff;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.64rem;
}

.line-profile-step-remove {
    width: 1.35rem;
    height: 1.35rem;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    font-size: 1rem;
}

.line-profile-step-remove:hover {
    background: rgba(239, 68, 68, 0.08);
    color: #dc2626;
}


.line-profile-preview {
    margin-top: 0.45rem;
    padding: 0.28rem 0.2rem 0.1rem;
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
}

.line-profile-preview svg {
    display: block;
    width: 100%;
    height: 3.7rem;
    overflow: visible;
}

.line-profile-preview polyline {
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.line-profile-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.28rem;
    margin-top: 0.5rem;
}

.line-profile-metrics span {
    border-radius: 999px;
    padding: 0.16rem 0.36rem;
    background: rgba(15, 118, 110, 0.08);
    color: #0f766e;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.59rem;
}

.line-profile-legacy-box {
    padding: 0.45rem;
    border-radius: 5px;
    background: rgba(124, 58, 237, 0.07);
    color: #5b21b6;
    font-size: 0.61rem;
    line-height: 1.35;
}

.line-profile-legacy-box button {
    display: block;
    margin-top: 0.35rem;
    color: #5b21b6;
}

.line-profile-legacy {
    background: rgba(124, 58, 237, 0.08) !important;
    color: #6d28d9 !important;
}
.polygon-edit-handle.channel .polygon-edit-btn {
    color: #0f766e;
    border-color: rgba(15, 118, 110, 0.28);
}

/* Duikerrichting: presentatie en ontwerpbediening, uitsluitend Viewer-core. */
.culvert-direction-control {
    grid-column: 1 / -1;
    width: 100%;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 6px 2px 2px;
    font-size: 12px;
    color: #334155;
}
.culvert-oneway-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}
.culvert-reverse-button {
    background: #fff;
    border: 1px solid #f97316;
    color: #c2410c;
    border-radius: 6px;
    padding: 4px 8px;
    cursor: pointer;
}
.culvert-reverse-button:hover { background: #fff7ed; }

#culvertsList > .culvert-item:not(.atelier-object-selected) .culvert-direction-control { display: none; }
