    --bg-color: #0d1117;
    --glass-bg: #0d1117;
    /* Solid dark background fallback */
    --glass-border: rgba(255, 255, 255, 0.2);
    --text-primary: #ffffff;
    --text-hint: #a0a0a0;
    --accent-orange: #ff7b00;
    --accent-blue: #00a2ff;
    --accent-green: #3fb950;
    --font-main: system-ui,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
    --font-mono: 'JetBrains Mono',
    monospace;
    --card-shadow: 0 4px 24px rgba(0, 0, 0, 0.6);
    }

    body.light-theme {
        --bg-color: #f6f8fa;
        --glass-bg: rgba(255, 255, 255, 0.9);
        --glass-border: rgba(0, 0, 0, 0.1);
        --text-primary: #1f2328;
        --text-hint: #636c76;
        --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }

    * {
        box-sizing: border-box;
        margin: 0;
        padding: 0;
    }

    /* CRITICAL LAYOUT OVERRIDE - FORCE DESKTOP WIDTH */
    @media (min-width: 768px) {
        .overlay {
            width: 360px !important;
            max-width: 360px !important;
            left: 15px !important;
            right: auto !important;
        }
    }

    /* Utility Classes */
    .hidden {
        display: none !important;
    }

    /* TEMI Badge - consistent styling across all locations */
    .temi-badge {
        font-size: 9px;
        font-weight: 600;
        background: rgba(249, 115, 22, 0.2);
        color: #f97316;
        padding: 2px 6px;
        border-radius: 4px;
        margin-left: 6px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    body {
        background-color: var(--bg-color);
        color: var(--text-primary);
        font-family: var(--font-main);
        overflow: hidden;
        height: 100vh;
    }

    #map {
        position: absolute;
        top: 0;
        bottom: 0;
        width: 100%;
    }

    .overlay {
        position: absolute;
        top: 15px;
        left: 15px;
        width: 340px;
        /* Widened to fit Header content */
        /* Increased from 310px */
        z-index: 100;
        display: flex;
        flex-direction: column;
        gap: 12px;
        pointer-events: none;
        max-height: calc(100vh - 30px);
        overflow-y: auto;
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .overlay.collapsed {
        transform: translateX(calc(-100% - 30px));
    }

    .overlay::-webkit-scrollbar {
        width: 4px;
    }

    .overlay::-webkit-scrollbar-thumb {
        background: var(--glass-border);
        border-radius: 2px;
    }

    .overlay>* {
        pointer-events: auto;
    }

    /* Glassmorphism */
    /* Glassmorphism */
    /* Glassmorphism */
    .glass {
        background: var(--glass-bg) !important;
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border: 1px solid rgba(255, 255, 255, 0.15);
        border-radius: 12px;
        padding: 12px;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    }

    /* Typography & Layout */
    header {
        margin-bottom: 0;
        display: flex;
        justify-content: center;
        /* Center content (Notebook button) */
        align-items: center;
        position: relative;
        /* For absolute positioning of close button if needed */
        height: 60px;
    }

    .logo {
        display: none;
        /* Hide logo container completely */
    }

    .header-actions {
        display: flex;
        align-items: center;
        gap: 12px;
        width: 100%;
        justify-content: center;
        /* Center the Notebook button */
    }

    .sidebar-toggle-btn {
        background: var(--glass-bg);
        border: 1px solid var(--glass-border);
        border-radius: 8px;
        width: 32px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--text-primary);
        cursor: pointer;

        /* Position absolutely to the right */
        position: absolute;
        right: 16px;
        /* 16px from right edge */
        top: 50%;
        transform: translateY(-50%);
    }

    /* Floating version when collapsed - stays fixed on screen */
    .overlay.collapsed .sidebar-toggle-btn {
        position: fixed;
        left: 15px;
        top: 15px;
        z-index: 200;
    }

    /* Fixed expand button (outside overlay, visible when collapsed) */
    .sidebar-expand-btn {
        position: fixed;
        left: 15px;
        top: 15px;
        z-index: 200;
        background: var(--glass-bg);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        border: 1px solid var(--glass-border);
        border-radius: 8px;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--text-primary);
        cursor: pointer;
        transition: all 0.2s;
    }

    .sidebar-expand-btn:hover {
        background: rgba(255, 255, 255, 0.15);
        transform: scale(1.1);
    }

    .sidebar-expand-btn svg {
        width: 20px;
        height: 20px;
    }

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

    /* Sidebar controls group (expand + toolbox) */
    .sidebar-controls-group {
        position: fixed;
        left: 15px;
        top: 15px;
        z-index: 200;
        display: none;
        flex-direction: row;
        gap: 8px;
    }

    .sidebar-controls-group.visible {
        display: flex;
    }

    .sidebar-controls-group .sidebar-expand-btn,
    .sidebar-controls-group .toolbox-toggle {
        position: static;
    }

    /* Close button for modals */
    .close-btn {
        background: rgba(255, 100, 100, 0.15);
        border: 1px solid rgba(255, 100, 100, 0.3);
        border-radius: 6px;
        color: #ff6b6b;
        font-size: 1.2rem;
        width: 32px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.2s;
    }

    .close-btn:hover {
        background: rgba(255, 100, 100, 0.3);
        transform: scale(1.05);
    }

    .sidebar-toggle-btn:hover {
        background: rgba(255, 255, 255, 0.1);
        transform: scale(1.05);
    }

    .sidebar-toggle-btn svg {
        width: 18px;
        height: 18px;
    }

    .logo-text {
        font-size: 1.6rem;
        font-weight: 600;
        letter-spacing: 2px;
        color: var(--text-primary);
    }

    .logo-subtext {
        display: block;
        font-size: 0.7rem;
        color: var(--accent-orange);
        text-transform: uppercase;
        letter-spacing: 3px;
        margin-top: -3px;
    }

    .stats-grid {
        display: flex;
        gap: 8px;
    }

    .stat-card {
        flex: 1;
        display: flex;
        flex-direction: column;
        padding: 10px !important;
    }

    .stat-card label {
        font-size: 0.6rem;
        color: var(--text-hint);
        text-transform: uppercase;
        letter-spacing: 1px;
    }

    .stat-card span {
        font-size: 1rem;
        font-weight: 600;
        font-family: var(--font-mono);
    }

    /* Filter Section */
    .filter-section {
        padding: 12px !important;
    }

    .filter-section h3 {
        font-size: 0.75rem;
        text-transform: uppercase;
        margin-bottom: 10px;
        color: var(--text-hint);
        letter-spacing: 1px;
    }

    /* Accordion Headers */
    .accordion-header {
        cursor: pointer;
        display: flex;
        justify-content: space-between;
        align-items: center;
        user-select: none;
        transition: color 0.2s;
    }

    .accordion-header:hover {
        color: var(--text-primary);
    }

    .accordion-chevron {
        transition: transform 0.2s ease;
        flex-shrink: 0;
    }

    .accordion-header.collapsed .accordion-chevron {
        transform: rotate(-90deg);
    }

    .accordion-content {
        transition: max-height 0.3s ease, opacity 0.2s ease;
        overflow: visible;
        padding-top: 4px;
    }

    .accordion-content.collapsed {
        display: none;
    }

    .filter-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }

    .filter-item {
        display: flex;
        align-items: center;
        gap: 6px;
        font-size: 0.75rem;
        cursor: pointer;
        padding: 4px 6px;
        border-radius: 4px;
        transition: background 0.2s;
    }

    .filter-item:hover {
        background: rgba(255, 255, 255, 0.05);
    }

    .filter-item input[type="checkbox"] {
        width: 14px;
        height: 14px;
        accent-color: var(--accent-orange);
        cursor: pointer;
    }

    /* Swatches */
    .swatch {
        width: 16px;
        height: 4px;
        border-radius: 2px;
        flex-shrink: 0;
    }

    .status-dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        flex-shrink: 0;
    }

    .status-dot.active {
        background: #3fb950;
    }

    .status-dot.abandoned {
        background: #6e7681;
    }

    .status-dot.discontinued {
        background: #f85149;
    }

    .status-dot.permitted {
        background: #a371f7;
    }

    /* Selection Card */
    .selection-card {
        transition: all 0.3s ease;
    }

    .hidden {
        opacity: 0;
        transform: translateY(10px);
        pointer-events: none;
    }

    .detail-row {
        margin-top: 8px;
        display: flex;
        justify-content: space-between;
        font-size: 0.8rem;
    }

    .detail-row label {
        color: var(--text-hint);
        font-size: 0.7rem;
    }

    .detail-row span {
        font-family: var(--font-mono);
        font-size: 0.75rem;
        text-align: right;
        max-width: 150px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Map Overrides */
    .maplibregl-ctrl-attrib {
        background-color: transparent !important;
        color: var(--text-hint) !important;
        font-size: 10px !important;
    }

    .maplibregl-ctrl-attrib-inner {
        color: var(--text-hint) !important;
    }

    /* Scrollbar for filter grids */
    .filter-grid {
        overflow-y: auto;
    }

    /* Theme Buttons */
    .theme-btn {
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid var(--glass-border);
        color: var(--text-primary);
        padding: 6px 10px;
        border-radius: 6px;
        font-size: 0.7rem;
        cursor: pointer;
        transition: all 0.2s;
        font-family: var(--font-main);
        text-align: center;
    }

    .theme-btn:hover {
        background: rgba(255, 255, 255, 0.1);
    }

    .theme-btn.active {
        background: var(--accent-orange);
        color: white !important;
        border-color: var(--accent-orange);
    }

    body.light-theme .theme-btn {
        background: rgba(0, 0, 0, 0.05);
    }

    body.light-theme .theme-btn:hover {
        background: rgba(0, 0, 0, 0.1);
    }

    /* ============== LASSO TOOL CONTROLS ============== */
    .lasso-controls {
        display: flex;
        gap: 8px;
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px solid var(--glass-border);
    }

    .lasso-btn {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        background: rgba(255, 123, 0, 0.1);
        border: 2px solid rgba(255, 123, 0, 0.3);
        color: var(--text-primary);
        padding: 10px 14px;
        border-radius: 8px;
        cursor: pointer;
        transition: all 0.2s ease;
        font-family: var(--font-main);
    }

    .lasso-btn:hover {
        background: rgba(255, 123, 0, 0.2);
        border-color: var(--accent-orange);
    }

    .lasso-btn.active {
        background: var(--accent-orange);
        border-color: var(--accent-orange);
        color: white;
        box-shadow: 0 0 20px rgba(255, 123, 0, 0.4);
        animation: pulse-glow 1.5s ease-in-out infinite;
    }

    @keyframes pulse-glow {

        0%,
        100% {
            box-shadow: 0 0 15px rgba(255, 123, 0, 0.4);
        }

        50% {
            box-shadow: 0 0 25px rgba(255, 123, 0, 0.6);
        }
    }

    .lasso-icon {
        width: 18px;
        height: 18px;
    }

    .lasso-label {
        font-size: 0.75rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .lasso-clear-btn {
        background: rgba(248, 81, 73, 0.1);
        border: 2px solid rgba(248, 81, 73, 0.3);
        color: #f85149;
        padding: 10px 12px;
        border-radius: 8px;
        cursor: pointer;
        transition: all 0.2s ease;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .lasso-clear-btn svg {
        width: 16px;
        height: 16px;
    }

    .lasso-clear-btn:hover {
        background: rgba(248, 81, 73, 0.2);
        border-color: #f85149;
    }

    .lasso-clear-btn.hidden {
        display: none;
    }

    /* ============== RIGHT SIDE DETAILS PANEL ============== */
    .details-panel {
        position: fixed;
        top: 50%;
        right: 20px;
        transform: translateY(-50%);
        width: 320px;
        max-height: 80vh;
        overflow-y: auto;
        z-index: 100;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        border: 1px solid rgba(88, 166, 255, 0.3);
        padding: 20px;
    }

    /* Change Log Styles */
    .change-log-container {
        display: flex;
        flex-direction: column;
        gap: 8px;
        margin-top: 10px;
        max-height: 250px;
        overflow-y: auto;
        padding-right: 4px;
    }

    .change-log-item {
        display: flex;
        gap: 12px;
        padding: 10px;
        background: rgba(255, 255, 255, 0.03);
        border-radius: 8px;
        border-left: 3px solid var(--glass-border);
        transition: background 0.2s;
    }

    .change-log-item:hover {
        background: rgba(255, 255, 255, 0.06);
    }

    .change-log-item.cl-new {
        border-left-color: #3fb950;
    }

    .change-log-item.cl-status {
        border-left-color: #a371f7;
    }

    .change-log-item.cl-prod-up {
        border-left-color: #3fb950;
    }

    .change-log-item.cl-prod-down {
        border-left-color: #f85149;
    }

    .cl-icon {
        font-size: 1.2rem;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 24px;
        flex-shrink: 0;
    }

    .cl-content {
        flex: 1;
    }

    .cl-desc {
        font-size: 0.9rem;
        color: var(--text-primary);
        line-height: 1.4;
    }

    .cl-date {
        font-size: 0.75rem;
        color: var(--text-hint);
        margin-top: 4px;
    }

    .details-panel.hidden {
        opacity: 0;
        transform: translateY(-50%) translateX(40px);
        pointer-events: none;
    }

    .details-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 12px;
        padding-bottom: 10px;
        border-bottom: 1px solid var(--glass-border);
    }

    .details-header h3 {
        margin: 0;
        font-size: 0.9rem;
        font-weight: 600;
        color: var(--accent-blue);
    }

    .details-close-btn {
        background: transparent;
        border: none;
        color: var(--text-hint);
        font-size: 1rem;
        cursor: pointer;
        padding: 0;
        line-height: 1;
    }

    .details-close-btn:hover {
        color: #f85149;
    }

    /* ============== RIGHT SIDE RESULTS PANEL ============== */
    .results-panel.hidden {
        opacity: 0;
        transform: translateX(20px);
        pointer-events: none;
    }

    .results-panel {
        position: fixed;
        top: 70px;
        right: 20px;
        width: 380px;
        /* Increased from 320px */
        height: calc(100vh - 90px);
        z-index: 100;
        transition: all 0.3s ease;
        border: 1px solid rgba(255, 123, 0, 0.3);
        display: flex;
        flex-direction: column;
    }

    .results-scroll-area {
        flex: 1;
        overflow-y: auto;
        padding: 16px;
        /* Custom scrollbar for better look */
    }

    .results-scroll-area::-webkit-scrollbar {
        width: 4px;
    }

    .results-scroll-area::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.1);
        border-radius: 2px;
    }

    .results-section {
        margin-top: 20px;
    }

    .results-header {
        flex-shrink: 0;
        /* Header stays fixed */
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 16px;
        border-bottom: 1px solid var(--glass-border);
    }

    .production-stats-grid {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        gap: 8px;
        margin-top: 10px;
    }

    .prod-stat-card {
        background: rgba(255, 255, 255, 0.05);
        padding: 8px;
        border-radius: 6px;
        text-align: center;
    }

    .prod-stat-card label {
        display: block;
        font-size: 0.6rem;
        color: var(--text-hint);
        text-transform: uppercase;
        margin-bottom: 4px;
    }

    .prod-stat-card span {
        font-family: var(--font-mono);
        font-size: 0.8rem;
        font-weight: 600;
    }

    .stat-oil {
        color: #3fb950;
    }

    .stat-gas {
        color: #ff7b00;
    }

    .stat-water {
        color: #58a6ff;
    }


    .results-header h2 {
        font-size: 1rem;
        font-weight: 600;
        color: var(--text-primary);
        margin: 0;
    }

    .results-close-btn {
        background: rgba(255, 255, 255, 0.1);
        border: none;
        color: var(--text-hint);
        width: 28px;
        height: 28px;
        border-radius: 6px;
        cursor: pointer;
        font-size: 1rem;
        transition: all 0.2s;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .results-close-btn:hover {
        background: rgba(248, 81, 73, 0.2);
        color: #f85149;
    }

    .results-stat-big {
        text-align: center;
        padding: 10px;
        background: linear-gradient(135deg, rgba(255, 123, 0, 0.1), rgba(0, 162, 255, 0.1));
        border-radius: 10px;
        margin-bottom: 16px;
        height: 120px;
        /* Fixed height for uniformity */
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }

    .results-stat-big span {
        display: block;
        font-size: 2.5rem;
        font-weight: 700;
        font-family: var(--font-mono);
        color: var(--accent-orange);
        line-height: 1;
    }

    .results-stat-big label {
        display: block;
        font-size: 0.75rem;
        color: var(--text-hint);
        text-transform: uppercase;
        letter-spacing: 1px;
        margin-top: 6px;
    }

    .results-breakdown {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    .results-breakdown .section-label {
        font-size: 0.7rem;
        color: var(--text-hint);
        text-transform: uppercase;
        letter-spacing: 0.5px;
        margin-top: 12px;
        margin-bottom: 6px;
        padding-top: 12px;
        border-top: 1px solid var(--glass-border);
    }

    .results-breakdown .breakdown-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 10px;
        background: rgba(255, 255, 255, 0.03);
        border-radius: 6px;
        transition: background 0.2s;
    }

    .results-breakdown .breakdown-row:hover {
        background: rgba(255, 255, 255, 0.06);
    }

    .results-breakdown .breakdown-label {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 0.8rem;
        color: var(--text-primary);
    }

    .results-breakdown .breakdown-dot {
        width: 10px;
        height: 10px;
        border-radius: 50%;
        flex-shrink: 0;
    }

    .results-breakdown .breakdown-value {
        font-family: var(--font-mono);
        font-size: 0.85rem;
        font-weight: 600;
        color: var(--accent-blue);
    }

    /* Keep old classes for backwards compatibility */
    .agg-breakdown-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 10px;
        background: rgba(255, 255, 255, 0.03);
        border-radius: 6px;
        font-size: 0.8rem;
    }

    .agg-breakdown-item .fluid-label {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .agg-breakdown-item .fluid-dot {
        width: 10px;
        height: 10px;
        border-radius: 50%;
    }

    .agg-breakdown-item span:last-child {
        font-family: var(--font-mono);
        font-weight: 600;
        color: var(--accent-blue);
    }

    /* ============== AI SEARCH BAR ============== */
    .ai-search-container {
        position: fixed;
        top: 20px;
        left: 50%;
        transform: translateX(-50%);
        width: 625px;
        /* Increased by 25% from 500px */
        max-width: calc(100vw - 340px);
        z-index: 100;
        padding: 8px 12px;
        border: 1px solid rgba(0, 162, 255, 0.3);
        transition: border-color 0.3s ease, box-shadow 0.3s ease;
    }

    .ai-search-container.reply-mode {
        border-color: rgba(16, 185, 129, 0.6);
    }

    .ai-reply-label {
        font-size: 0.7rem;
        color: #10b981;
        font-weight: 500;
        padding: 3px 10px;
        background: rgba(16, 185, 129, 0.2);
        border-radius: 12px;
        display: inline-flex;
        align-items: center;
        gap: 4px;
        margin-left: 8px;
        white-space: nowrap;
        max-width: 200px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .ai-reply-label.hidden {
        display: none;
    }

    .ai-search-input-wrapper {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .ai-search-icon {
        width: 20px;
        height: 20px;
        color: var(--text-hint);
        flex-shrink: 0;
    }

    #ai-search-input {
        flex: 1;
        background: transparent;
        border: none;
        color: var(--text-primary);
        font-family: var(--font-main);
        font-size: 0.95rem;
        outline: none;
    }

    #ai-search-input::placeholder {
        color: var(--text-hint);
    }

    .ai-scope-toggle {
        width: 28px;
        height: 28px;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.15);
        border-radius: 6px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s;
        flex-shrink: 0;
    }

    .ai-scope-toggle svg {
        width: 14px;
        height: 14px;
        color: var(--text-hint);
    }

    .ai-scope-toggle:hover {
        background: rgba(255, 255, 255, 0.1);
        border-color: rgba(255, 255, 255, 0.25);
    }

    .ai-scope-toggle.active {
        background: rgba(255, 123, 0, 0.2);
        border-color: rgba(255, 123, 0, 0.5);
    }

    .ai-scope-toggle.active svg {
        color: #ff7b00;
    }

    .ai-search-indicators {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-top: 6px;
        flex-wrap: wrap;
    }

    .ai-scope-indicator {
        font-size: 0.7rem;
        color: var(--text-hint);
        padding: 3px 10px;
        background: rgba(0, 0, 0, 0.2);
        border-radius: 12px;
        display: inline-block;
    }

    .ai-scope-indicator span {
        color: #ff7b00;
        font-weight: 500;
    }

    .ai-context-indicator {
        width: 32px;
        height: 32px;
        background: linear-gradient(135deg, #10b981, #059669);
        border: none;
        border-radius: 8px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: transform 0.2s, opacity 0.2s;
    }

    .ai-context-indicator svg {
        width: 16px;
        height: 16px;
        color: white;
    }

    .ai-context-indicator:hover {
        transform: scale(1.05);
        background: linear-gradient(135deg, #059669, #047857);
    }

    .ai-context-indicator.hidden {
        display: none;
    }

    .ai-search-submit {
        width: 32px;
        height: 32px;
        background: linear-gradient(135deg, var(--accent-blue), var(--accent-orange));
        border: none;
        border-radius: 8px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: transform 0.2s, opacity 0.2s;
    }

    .ai-search-submit svg {
        width: 16px;
        height: 16px;
        color: white;
    }

    .ai-search-submit:hover {
        transform: scale(1.05);
    }

    .ai-search-submit:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

    .ai-search-status {
        margin-top: 8px;
        font-size: 0.8rem;
        color: var(--text-hint);
    }

    .ai-search-status.loading {
        color: var(--accent-blue);
    }

    .ai-search-status.error {
        color: #ff6b6b;
    }

    /* AI Response Panel */
    .ai-response-panel {
        position: fixed;
        top: 100px;
        left: 50%;
        transform: translateX(-50%);
        width: 550px;
        max-width: calc(100vw - 340px);
        max-height: 60vh;
        overflow-y: auto;
        z-index: 99;
        padding: 16px;
        border: 1px solid rgba(0, 162, 255, 0.3);
        transition: all 0.3s ease;
    }

    .ai-response-panel.hidden {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
        pointer-events: none;
    }

    .ai-response-header,
    .toolbox-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 12px;
        padding-bottom: 8px;
        border-bottom: 1px solid var(--glass-border);
    }

    .ai-response-header span {
        font-weight: 600;
        font-size: 0.95rem;
    }

    .ai-response-content {
        font-size: 0.9rem;
        line-height: 1.6;
        white-space: pre-wrap;
    }

    .ai-query-spec {
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid var(--glass-border);
    }

    .ai-query-spec summary {
        font-size: 0.8rem;
        color: var(--text-hint);
        cursor: pointer;
    }

    .ai-query-spec pre {
        margin-top: 8px;
        padding: 10px;
        background: rgba(0, 0, 0, 0.3);
        border-radius: 6px;
        font-size: 0.75rem;
        overflow-x: auto;
        font-family: var(--font-mono);
    }

    /* ============== EXPORT BUTTONS ============== */
    .export-btn {
        display: flex;
        align-items: center;
        gap: 4px;
        padding: 6px 12px;
        background: linear-gradient(135deg, #3fb950, #238636);
        border: none;
        border-radius: 6px;
        color: white;
        font-size: 0.75rem;
        font-family: var(--font-main);
        cursor: pointer;
        transition: transform 0.2s, opacity 0.2s;
    }

    .export-btn svg {
        width: 14px;
        height: 14px;
    }

    .export-btn:hover {
        transform: scale(1.03);
    }

    .export-btn:active {
        transform: scale(0.98);
    }

    .export-btn.clear-btn {
        background: linear-gradient(135deg, #f97316, #ea580c);
    }

    .ai-response-actions,
    .results-actions {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .ai-response-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    /* ============== MODE SELECTOR ============== */
    .mode-selector {
        display: flex;
        gap: 8px;
        margin-bottom: 12px;
    }

    .mode-btn {
        flex: 1;
        padding: 8px 12px;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid var(--glass-border);
        border-radius: 8px;
        color: var(--text-hint);
        font-family: var(--font-main);
        font-size: 0.75rem;
        cursor: pointer;
        transition: all 0.2s;
    }

    .mode-btn:hover {
        background: rgba(255, 255, 255, 0.1);
        color: var(--text-primary);
    }

    .mode-btn.active {
        background: linear-gradient(135deg, rgba(0, 162, 255, 0.2), rgba(255, 123, 0, 0.2));
        border-color: var(--accent-blue);
        color: var(--text-primary);
    }

    /* ============== TOOLBOX ============== */

    /* Header Actions */
    .header-actions {
        display: flex;
        align-items: center;
        gap: 12px;
        flex: 1;
        /* Take remaining space */
        justify-content: center;
        /* Center notebook button relative to space */
        padding-right: 40px;
        /* Compensate for close button */
    }

    .primary-header-btn {
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid var(--glass-border);
        padding: 8px 24px;
        /* Larger padding */
        border-radius: 8px;
        color: var(--text-primary);
        font-weight: 500;
        display: flex;
        align-items: center;
        gap: 8px;
        transition: all 0.2s;
        height: 40px;
        /* Explicit taller height */
    }

    .primary-header-btn:hover {
        background: rgba(255, 255, 255, 0.1);
        transform: translateY(-1px);
    }

    /* Remove old toolbox styles */
    .toolbox-toggle {
        display: none !important;
    }

    .toolbox-toggle svg {
        width: 20px;
        height: 20px;
    }

    .toolbox-panel {
        position: fixed;
        top: 70px;
        left: 340px;
        width: 320px;
        max-height: calc(100vh - 100px);
        overflow-y: auto;
        background: var(--glass-bg);
        backdrop-filter: blur(24px);
        border: 1px solid rgba(0, 162, 255, 0.2);
        border-radius: 16px;
        z-index: 1100;
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7);
        display: flex;
        flex-direction: column;
        padding: 16px;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .toolbox-panel.hidden {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
        pointer-events: none;
    }

    .toolbox-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0 0 12px 0;
        margin-bottom: 8px;
        border-bottom: 1px solid var(--glass-border);
        background: transparent;
    }

    .toolbox-header h3 {
        margin: 0;
        font-size: 0.9rem;
        font-weight: 600;
        color: var(--text-primary);
    }

    .toolbox-close-btn {
        background: none;
        border: none;
        cursor: pointer;
        padding: 4px;
        color: var(--text-secondary);
        transition: color 0.2s;
    }

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

    .toolbox-close-btn svg {
        width: 18px;
        height: 18px;
    }

    /* Toolbox toggle button - moved to left when sidebar collapsed */
    .toolbox-toggle.sidebar-collapsed {
        position: fixed;
        left: 62px;
        /* Next to expand button (15px + 40px + 7px gap) */
        top: 15px;
        right: auto;
        bottom: auto;
    }

    /* Toolbox panel - moved to left when sidebar is collapsed */
    .toolbox-panel.sidebar-collapsed {
        left: 15px;
    }

    /* Tool Sections */
    .tool-section {
        border-bottom: 1px solid var(--glass-border);
    }

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

    .tool-section-header {
        padding: 10px 16px;
        background: rgba(255, 255, 255, 0.02);
        font-size: 0.75rem;
        font-weight: 600;
        color: var(--text-secondary);
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .tool-section-body {
        padding: 12px 16px;
    }

    /* File input styling */
    .file-input {
        width: 100%;
        padding: 8px;
        font-size: 0.7rem;
        cursor: pointer;
    }

    .file-input::file-selector-button {
        padding: 4px 10px;
        margin-right: 10px;
        background: linear-gradient(135deg, var(--accent-blue), var(--accent-orange));
        border: none;
        border-radius: 4px;
        color: white;
        font-size: 0.7rem;
        cursor: pointer;
    }

    /* WKT textarea styling */
    .wkt-textarea {
        width: 100%;
        min-height: 60px;
        resize: vertical;
        font-family: var(--font-mono);
        font-size: 0.7rem;
        line-height: 1.4;
    }

    /* Tool Options */
    .tool-option {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 10px;
        font-size: 0.8rem;
        color: var(--text-secondary);
    }

    .tool-option select,
    .tool-input {
        width: 140px;
        padding: 6px 10px;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid var(--glass-border);
        border-radius: 6px;
        color: var(--text-primary);
        font-family: var(--font-main);
        font-size: 0.75rem;
    }

    .tool-option select option {
        background: #1c2128;
        color: white;
    }


    .tool-input::placeholder {
        color: var(--text-hint);
    }

    .tool-input:focus {
        outline: none;
        border-color: var(--accent-blue);
    }

    /* Tool Actions */
    .tool-actions {
        display: flex;
        gap: 8px;
        margin-top: 12px;
    }

    .tool-btn {
        flex: 1;
        padding: 8px 12px;
        border: 1px solid var(--glass-border);
        border-radius: 6px;
        font-family: var(--font-main);
        font-size: 0.75rem;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        transition: all 0.2s;
    }

    .tool-btn.primary {
        background: linear-gradient(135deg, var(--accent-blue), var(--accent-orange));
        border: none;
        color: white;
    }

    .tool-btn.primary:hover {
        filter: brightness(1.1);
    }

    .tool-btn.secondary {
        background: rgba(255, 255, 255, 0.05);
        color: var(--text-secondary);
    }

    .tool-btn.secondary:hover {
        background: rgba(255, 255, 255, 0.1);
        color: var(--text-primary);
    }

    .tool-btn.small {
        padding: 6px 10px;
        font-size: 0.7rem;
    }

    .tool-btn.mini {
        flex: 0 0 auto !important;
        height: auto !important;
        padding: 3px 8px !important;
        font-size: 0.6rem !important;
        font-weight: 500 !important;
        text-transform: uppercase;
        letter-spacing: 0.3px;
    }

    .tool-btn svg {
        width: 14px;
        height: 14px;
    }

    /* Distance Result */
    .distance-result {
        margin-top: 8px;
        padding: 8px 10px;
        background: rgba(0, 162, 255, 0.1);
        border: 1px solid var(--accent-blue);
        border-radius: 6px;
        text-align: center;
    }

    .result-value {
        font-size: 1.2rem;
        font-weight: 700;
        color: var(--accent-blue);
        margin-bottom: 8px;
    }

    .result-secondary {
        font-size: 0.8rem;
        font-weight: 400;
        color: var(--text-secondary);
    }

    /* Toolbox Toggle Button */
    .toolbox-toggle {
        position: fixed;
        bottom: 20px;
        left: 340px;
        /* Moved from 320px to clear sidebar */
        width: 44px;
        height: 44px;
        background: var(--glass-bg);
        backdrop-filter: blur(16px);
        border: 1px solid var(--glass-border);
        border-radius: 8px;
        cursor: pointer;
        z-index: 1000;
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--text-secondary);
        transition: all 0.2s;
    }

    .toolbox-toggle:hover {
        background: rgba(255, 255, 255, 0.1);
        color: var(--text-primary);
        border-color: var(--accent-blue);
    }

    .toolbox-toggle svg {
        width: 20px;
        height: 20px;
    }

    .toolbox-toggle.active {
        background: var(--accent-blue);
        color: white;
        border-color: var(--accent-blue);
    }

    .results-stat-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        margin-bottom: 20px;
    }

    .tool-option-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .small-input {
        width: 100% !important;
    }

    .toolbox-home {
        padding: 10px 0;
    }

    .tool-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .tool-select-btn {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 12px;
        padding: 24px 12px;
        background: rgba(255, 255, 255, 0.03);
        border: none;
        border-radius: 12px;
        box-shadow: inset 0 0 0 1px var(--glass-border);
        color: var(--text-main);
        cursor: pointer;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .tool-select-btn:hover {
        background: rgba(255, 255, 255, 0.08);
        box-shadow: inset 0 0 0 1px var(--accent-blue);
        transform: translateY(-4px);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), inset 0 0 0 1px var(--accent-blue);
    }

    .tool-icon {
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(0, 162, 255, 0.15);
        border-radius: 10px;
        color: var(--accent-blue);
        pointer-events: none;
    }

    .tool-icon svg {
        width: 24px;
        height: 24px;
    }

    .tool-select-btn span {
        font-size: 0.8rem;
        font-weight: 600;
        color: var(--text-secondary);
        pointer-events: none;
    }

    .tool-select-btn:hover span {
        color: var(--text-primary);
    }

    .toolbox-back-btn {
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid var(--glass-border);
        color: var(--text-hint);
        cursor: pointer;
        padding: 4px;
        margin-right: 12px;
        border-radius: 6px;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s;
    }

    .toolbox-back-btn:hover {
        color: var(--text-main);
        background: rgba(255, 255, 255, 0.1);
    }

    .toolbox-back-btn svg {
        width: 18px;
        height: 18px;
    }

    .tool-view {
        flex: 1;
        display: flex;
        flex-direction: column;
        padding-top: 10px;
        gap: 16px;
    }

    .tool-view .tool-section-body {
        background: transparent;
        padding: 0;
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    /* Custom Scrollbar for Toolbox */
    .toolbox-panel::-webkit-scrollbar {
        width: 6px;
    }

    .toolbox-panel::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.02);
        border-radius: 10px;
    }

    .toolbox-panel::-webkit-scrollbar-thumb {
        background: rgba(0, 162, 255, 0.3);
        border-radius: 10px;
    }

    .toolbox-panel::-webkit-scrollbar-thumb:hover {
        background: rgba(0, 162, 255, 0.5);
    }

    /* Form Card Styling for Tool Options */
    .tool-option {
        display: flex;
        flex-direction: column;
        gap: 8px;
        padding: 14px;
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid rgba(255, 255, 255, 0.06);
        border-radius: 12px;
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .tool-option:focus-within {
        background: rgba(0, 162, 255, 0.05);
        border-color: rgba(0, 162, 255, 0.3);
        transform: scale(1.01);
    }

    .tool-option span {
        font-size: 0.7rem;
        text-transform: uppercase;
        letter-spacing: 0.8px;
        color: var(--text-hint);
        font-weight: 700;
    }

    .tool-input {
        background: rgba(0, 0, 0, 0.25) !important;
        border: 1px solid rgba(255, 255, 255, 0.12) !important;
        padding: 10px 12px !important;
        font-size: 0.9rem !important;
        border-radius: 10px !important;
        color: var(--text-primary) !important;
        width: 100%;
    }

    .tool-input:focus {
        border-color: var(--accent-blue) !important;
        box-shadow: 0 0 0 3px rgba(0, 162, 255, 0.15);
        outline: none;
    }

    .tool-actions {
        margin-top: auto;
        padding-top: 24px;
        display: flex;
        gap: 12px;
    }

    .tool-btn {
        flex: 1;
        height: 44px;
        font-weight: 700;
        font-size: 0.9rem;
        border-radius: 10px;
        transition: all 0.2s;
    }

    .tool-btn.primary {
        background: linear-gradient(135deg, var(--accent-blue), #0077ff);
        box-shadow: 0 4px 15px rgba(0, 162, 255, 0.3);
    }

    .tool-btn.primary:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(0, 162, 255, 0.4);
    }

    .tool-btn.secondary {
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid var(--glass-border);
    }

    .tool-btn.secondary:hover {
        background: rgba(255, 255, 255, 0.1);
        border-color: var(--text-hint);
    }

    /* Accordion Layout */
    .toolbox-content {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .tool-accordion-item {
        border: 1px solid var(--glass-border);
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.02);
        overflow: hidden;
    }

    .tool-accordion-item.expanded {
        background: rgba(255, 255, 255, 0.04);
        border-color: rgba(0, 162, 255, 0.3);
    }

    .tool-accordion-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 14px;
        cursor: pointer;
        user-select: none;
    }

    .tool-accordion-header:hover {
        background: rgba(255, 255, 255, 0.03);
    }

    .tool-header-left {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .tool-mini-icon {
        width: 28px;
        height: 28px;
        min-width: 28px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(0, 162, 255, 0.1);
        border-radius: 6px;
        color: var(--accent-blue);
    }

    .tool-mini-icon svg {
        width: 16px;
        height: 16px;
    }

    .tool-accordion-header>span,
    .tool-header-left>span {
        font-size: 0.85rem;
        font-weight: 600;
        color: var(--text-secondary);
    }

    .tool-accordion-item.expanded .tool-accordion-header span {
        color: var(--text-primary);
    }

    .accordion-arrow {
        width: 16px;
        height: 16px;
        min-width: 16px;
        color: var(--text-hint);
        transition: transform 0.2s;
    }

    .tool-accordion-item.expanded .accordion-arrow {
        transform: rotate(180deg);
    }

    .tool-accordion-body {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.25s ease-out;
        padding: 0 14px;
    }

    .tool-accordion-item.expanded .tool-accordion-body {
        max-height: 1200px;
        padding: 0 14px 16px 14px;
    }

    .tool-accordion-body .tool-section-body {
        background: transparent;
        padding: 8px 0;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    /* ============== MODALS & OVERLAYS ============== */
    .modal {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.8) !important;
        backdrop-filter: blur(8px) !important;
        -webkit-backdrop-filter: blur(8px) !important;
        z-index: 99999 !important;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 20px;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .accordion-header {
        margin-top: 2px !important;
        margin-bottom: 6px !important;
    }

    .modal.hidden {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }

    .modal-content {
        background: var(--glass-bg);
        backdrop-filter: blur(24px);
        -webkit-backdrop-filter: blur(24px);
        border: 1px solid var(--glass-border);
        border-radius: 16px;
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
        width: 100%;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        animation: modal-enter 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    @keyframes modal-enter {
        from {
            opacity: 0;
            transform: scale(0.9) translateY(20px);
        }

        to {
            opacity: 1;
            transform: scale(1) translateY(0);
        }
    }

    .modal-header {
        padding: 16px 20px;
        border-bottom: 1px solid var(--glass-border);
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .modal-header h3 {
        margin: 0;
        font-size: 1.1rem;
        color: var(--accent-orange);
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .modal-close {
        background: none;
        border: none;
        color: var(--text-hint);
        font-size: 1.8rem;
        cursor: pointer;
        line-height: 1;
        transition: color 0.2s;
    }

    .modal-close:hover {
        color: #f87171;
    }

    .modal-body {
        flex: 1;
        overflow-y: auto;
    }

    /* ============== WELL BRIEFING MODAL ============== */
    .briefing-modal-content {
        max-width: 700px;
        max-height: 85vh;
    }

    .briefing-body {
        padding: 20px;
        overflow-y: auto;
        max-height: 70vh;
    }

    .briefing-loading {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 40px;
        gap: 16px;
        color: var(--text-hint);
        min-height: 300px;
    }

    .briefing-loading .spinner {
        width: 50px;
        height: 50px;
        border: 4px solid rgba(255, 255, 255, 0.1);
        border-top-color: var(--accent-blue);
        border-radius: 50%;
        animation: spin 1s linear infinite;
    }

    .briefing-progress {
        width: 100%;
        max-width: 320px;
        display: flex;
        flex-direction: column;
        gap: 12px;
        margin-top: 10px;
        text-align: left;
    }

    .progress-step {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px 14px;
        background: rgba(255, 255, 255, 0.03);
        border-radius: 8px;
        font-size: 0.85rem;
        color: var(--text-hint);
        border: 1px solid transparent;
        transition: all 0.3s;
    }

    .progress-step .step-icon {
        font-size: 1rem;
        width: 20px;
        text-align: center;
    }

    .progress-step.active {
        color: var(--accent-blue);
        background: rgba(0, 162, 255, 0.1);
        border-color: rgba(0, 162, 255, 0.3);
    }

    .progress-step.complete {
        color: var(--accent-green);
        background: rgba(63, 185, 80, 0.1);
        border-color: rgba(63, 185, 80, 0.3);
    }

    .progress-step.complete .step-icon {
        color: var(--accent-green);
    }

    .progress-step.error {
        color: #f87171;
        background: rgba(248, 113, 113, 0.1);
        border-color: rgba(248, 113, 113, 0.3);
    }

    @keyframes spin {
        to {
            transform: rotate(360deg);
        }
    }

    .briefing-section {
        margin-bottom: 20px;
        padding-bottom: 16px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

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

    .briefing-section-title {
        font-size: 0.75rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        color: var(--accent-blue);
        margin-bottom: 10px;
    }

    .briefing-snapshot {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .briefing-field {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .briefing-field-label {
        font-size: 0.7rem;
        color: var(--text-hint);
        text-transform: uppercase;
    }

    .briefing-field-value {
        font-size: 0.9rem;
        color: var(--text-primary);
        font-weight: 500;
    }

    .briefing-summary {
        font-size: 0.9rem;
        line-height: 1.6;
        color: var(--text-secondary);
        white-space: pre-wrap;
    }

    .briefing-summary strong {
        color: var(--text-primary);
    }

    .briefing-trend {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 8px 12px;
        background: rgba(0, 0, 0, 0.2);
        border-radius: 8px;
        margin-top: 8px;
    }

    .briefing-trend.increasing {
        border-left: 3px solid #4ade80;
    }

    .briefing-trend.declining {
        border-left: 3px solid #f87171;
    }

    .briefing-trend.stable {
        border-left: 3px solid #60a5fa;
    }

    .briefing-gaps {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    .briefing-gap-item {
        font-size: 0.8rem;
        color: var(--text-hint);
        padding-left: 12px;
        position: relative;
    }

    .briefing-gap-item::before {
        content: "•";
        position: absolute;
        left: 0;
        color: var(--accent-orange);
    }

    .briefing-sources {
        font-size: 0.75rem;
        color: var(--text-hint);
        font-style: italic;
    }

    .explain-well-btn {
        background: linear-gradient(135deg, #8b5cf6, #6366f1);
        color: white;
        border: none;
        padding: 8px 14px;
        border-radius: 8px;
        cursor: pointer;
        font-size: 0.8rem;
        font-weight: 600;
        display: flex;
        align-items: center;
        gap: 6px;
        transition: all 0.2s;
    }

    .explain-well-btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
    }

    .explain-well-btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
        transform: none;
    }

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

    .causal-verdict-badge {
        font-size: 0.65rem;
        font-weight: 700;
        text-transform: uppercase;
        padding: 4px 8px;
        border-radius: 4px;
        letter-spacing: 0.5px;
    }

    .verdict-good {
        background: rgba(63, 185, 80, 0.15);
        color: #3fb950;
        border: 1px solid rgba(63, 185, 80, 0.3);
    }

    .verdict-warn {
        background: rgba(255, 123, 0, 0.15);
        color: #ff7b00;
        border: 1px solid rgba(255, 123, 0, 0.3);
    }

    .verdict-none {
        background: rgba(139, 148, 158, 0.15);
        color: #8b949e;
        border: 1px solid rgba(139, 148, 158, 0.3);
    }

    /* Web Sources Section */
    .briefing-web-sources {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .web-source-item {
        padding: 12px;
        background: rgba(0, 162, 255, 0.05);
        border: 1px solid rgba(0, 162, 255, 0.15);
        border-radius: 8px;
        transition: all 0.2s;
    }

    .web-source-meta {
        display: flex;
        justify-content: space-between;
        margin-bottom: 6px;
    }

    .web-source-category {
        font-size: 0.6rem;
        font-weight: 700;
        text-transform: uppercase;
        color: var(--accent-orange);
        letter-spacing: 0.5px;
    }

    .web-source-score {
        font-size: 0.6rem;
        color: var(--text-hint);
        font-family: var(--font-mono);
    }

    .web-source-item:hover {
        background: rgba(0, 162, 255, 0.1);
        border-color: rgba(0, 162, 255, 0.3);
    }

    .web-source-title {
        color: var(--accent-blue);
        font-weight: 600;
        font-size: 0.85rem;
        text-decoration: none;
        display: block;
        margin-bottom: 6px;
    }

    .web-source-title:hover {
        text-decoration: underline;
    }

    .web-source-snippet {
        font-size: 0.8rem;
        color: var(--text-secondary);
        line-height: 1.4;
        margin: 0;
    }

    .web-source-item.signal-low-priority {
        opacity: 0.8;
    }

    .signal-scope-badge {
        font-size: 0.65rem;
        padding: 2px 6px;
        border-radius: 4px;
        text-transform: uppercase;
        font-weight: 600;
        letter-spacing: 0.5px;
        background: rgba(255, 255, 255, 0.1);
        color: var(--text-secondary);
    }

    .scope-asset {
        background: rgba(239, 68, 68, 0.15);
        color: #f87171;
        border: 1px solid rgba(239, 68, 68, 0.3);
    }

    .scope-local {
        background: rgba(245, 158, 11, 0.15);
        color: #fbbf24;
        border: 1px solid rgba(245, 158, 11, 0.3);
    }

    .scope-operator {
        background: rgba(59, 130, 246, 0.15);
        color: #60a5fa;
        border: 1px solid rgba(59, 130, 246, 0.3);
    }

    .scope-network {
        background: rgba(16, 185, 129, 0.15);
        color: #34d399;
        border: 1px solid rgba(16, 185, 129, 0.3);
    }

    /* ============== INTELLIGENCE LAYER v2 ============== */

    .spatial-tiers-container {
        margin-top: 10px;
        background: rgba(255, 255, 255, 0.03);
        border-radius: 8px;
        padding: 10px;
        border: 1px solid rgba(255, 255, 255, 0.05);
    }

    .spatial-tiers-table {
        width: 100%;
        border-collapse: collapse;
        font-size: 0.85rem;
    }

    .spatial-tiers-table th {
        text-align: left;
        padding-bottom: 8px;
        color: var(--text-hint);
        font-weight: 500;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .spatial-tiers-table td {
        padding: 6px 0;
        color: var(--text-secondary);
    }

    .text-highlight {
        color: var(--accent-color) !important;
        font-weight: 600;
    }

    /* Stat Colors */
    .stat-good {
        color: #3fb950 !important;
    }

    .stat-bad {
        color: #f87171 !important;
    }

    /* Spatial Signals (Layer 2) */
    .spatial-signals {
        margin-top: 12px;
        padding: 10px;
        background: rgba(255, 255, 255, 0.03);
        border-radius: 6px;
        border: 1px dashed rgba(255, 255, 255, 0.1);
    }

    .spatial-signal-header {
        font-size: 0.75rem;
        color: var(--text-hint);
        text-transform: uppercase;
        letter-spacing: 0.5px;
        margin-bottom: 8px;
        font-weight: 600;
    }

    .spatial-signal-item {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 6px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

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

    .signal-tag {
        font-size: 0.65rem;
        padding: 2px 6px;
        border-radius: 4px;
        text-transform: uppercase;
        font-weight: bold;
        min-width: 100px;
        text-align: center;
    }

    .tag-facility-addition {
        background: rgba(59, 130, 246, 0.2);
        color: #60a5fa;
    }

    .tag-well-activation {
        background: rgba(16, 185, 129, 0.2);
        color: #34d399;
    }

    .tag-well-suspension {
        background: rgba(245, 158, 11, 0.2);
        color: #fbbf24;
    }

    .tag-pipeline-project {
        background: rgba(139, 92, 246, 0.2);
        color: #a78bfa;
    }

    .signal-desc {
        flex-grow: 1;
        font-size: 0.85rem;
        color: var(--text-secondary);
    }

    .signal-meta {
        font-size: 0.75rem;
        color: var(--text-hint);
    }

    /* Inference Badge */
    .inference-badge {
        font-size: 0.6rem;
        background: rgba(139, 92, 246, 0.2);
        color: #a78bfa;
        padding: 2px 6px;
        border-radius: 4px;
        margin-left: 8px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    /* Analytical Insights */
    .analytical-insights {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .insight-card {
        padding: 12px;
        background: rgba(139, 92, 246, 0.08);
        border: 1px solid rgba(139, 92, 246, 0.2);
        border-radius: 8px;
        border-left: 3px solid #a78bfa;
    }

    .insight-observation {
        font-size: 0.9rem;
        color: var(--text-primary);
        margin-bottom: 6px;
    }

    .insight-hypothesis {
        font-size: 0.85rem;
        color: var(--text-secondary);
        margin-bottom: 8px;
    }

    .insight-meta {
        display: flex;
        gap: 12px;
        font-size: 0.75rem;
    }

    .insight-confidence {
        padding: 2px 8px;
        border-radius: 4px;
        text-transform: capitalize;
    }

    .confidence-high {
        background: rgba(63, 185, 80, 0.15);
        color: #3fb950;
    }

    .confidence-medium {
        background: rgba(255, 123, 0, 0.15);
        color: #ff7b00;
    }

    .confidence-low {
        background: rgba(139, 148, 158, 0.15);
        color: #8b949e;
    }

    .insight-implication {
        color: var(--accent-blue);
        font-style: italic;
    }

    /* ============== WORKSPACE MANAGEMENT ============== */

    .header-actions {
        display: flex;
        gap: 12px;
        align-items: center;
    }

    .header-btn {
        display: flex;
        align-items: center;
        gap: 8px;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.1);
        color: var(--text-primary);
        padding: 6px 14px;
        border-radius: 20px;
        cursor: pointer;
        font-family: var(--font-outfit);
        font-size: 0.85rem;
        transition: all 0.2s;
    }

    .header-btn:hover {
        background: rgba(255, 255, 255, 0.1);
        border-color: var(--accent-color);
    }

    .header-btn svg {
        width: 16px;
        height: 16px;
        color: var(--accent-color);
    }

    .workspace-modal-content {
        max-width: 500px !important;
    }

    .workspace-save-section {
        padding-bottom: 20px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        margin-bottom: 20px;
    }

    .workspace-save-section h4,
    .workspace-list-section h4 {
        margin: 0 0 12px 0;
        color: var(--text-hint);
        font-size: 0.8rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .workspace-input-group {
        display: flex;
        gap: 10px;
    }

    .glass-input {
        flex: 1;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.1);
        color: #fff;
        padding: 10px 14px;
        border-radius: 8px;
        font-family: inherit;
    }

    .btn-primary {
        background: var(--accent-color);
        color: #000;
        border: none;
        padding: 10px 20px;
        border-radius: 8px;
        font-weight: 600;
        cursor: pointer;
    }

    .workspace-list {
        display: flex;
        flex-direction: column;
        gap: 10px;
        max-height: 400px;
        overflow-y: auto;
    }

    .workspace-item {
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid rgba(255, 255, 255, 0.05);
        border-radius: 8px;
        padding: 12px 16px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        transition: background 0.2s;
    }

    .workspace-item:hover {
        background: rgba(255, 255, 255, 0.06);
    }

    .workspace-info {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .workspace-name {
        font-weight: 600;
        color: var(--text-primary);
    }

    .workspace-date {
        font-size: 0.7rem;
        color: var(--text-hint);
    }

    .workspace-actions {
        display: flex;
        gap: 8px;
    }

    .ws-action-btn {
        background: none;
        border: none;
        color: var(--text-hint);
        cursor: pointer;
        padding: 4px;
        transition: color 0.2s;
    }

    .ws-action-btn:hover {
        color: var(--text-primary);
    }

    .ws-action-btn.delete:hover {
        color: #f87171;
    }

    /* Briefing Comparative Panel */
    .production-table,
    .comparative-table {
        width: 100%;
        border-collapse: collapse;
        font-size: 0.85rem;
        margin-top: 8px;
    }

    .production-table th,
    .comparative-table th {
        text-align: left;
        color: var(--text-hint);
        font-weight: 400;
        padding: 6px 8px;
        border-bottom: 1px solid var(--glass-border);
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .production-table td,
    .comparative-table td {
        padding: 8px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .production-table tr:last-child td,
    .comparative-table tr:last-child td {
        border-bottom: none;
    }

    .production-table td:first-child,
    .comparative-table td:first-child {
        color: var(--text-secondary);
    }

    .production-table td:nth-child(2),
    .comparative-table td:not(:first-child) {
        font-family: var(--font-mono);
        color: var(--text-primary);
    }

    .stat-good {
        color: var(--accent-green);
    }

    .stat-bad {
        color: #f85149;
    }

    .panel-container {
        background: rgba(255, 255, 255, 0.03);
        border-radius: 8px;
        padding: 12px;
        margin-bottom: 12px;
    }

    .panel-header {
        font-size: 0.8rem;
        color: var(--accent-blue);
        margin-bottom: 8px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .panels-row {
        display: flex;
        gap: 12px;
    }

    .half-width {
        flex: 1;
    }

    .percentile-bar-container {
        display: flex;
        align-items: center;
        gap: 8px;
        width: 100px;
    }

    .percentile-bar {
        height: 4px;
        background: var(--accent-blue);
        border-radius: 2px;
    }

    .percentile-text {
        font-size: 0.75rem;
        color: var(--text-hint);
        min-width: 30px;
        text-align: right;
    }

    .stat-row {
        display: flex;
        justify-content: space-between;
        margin-bottom: 6px;
        font-size: 0.85rem;
    }

    .stat-label {
        color: var(--text-secondary);
    }

    .stat-value {
        font-family: var(--font-mono);
    }

    /* Workspace Management Modal */
    .workspace-modal-content {
        max-width: 500px !important;
        width: 90%;
        margin: auto;
        overflow: hidden;
        max-height: 80vh;
        display: flex;
        flex-direction: column;
    }

    .workspace-input-group {
        display: flex;
        gap: 10px;
        margin-top: 15px;
        margin-bottom: 25px;
    }

    .glass-input {
        flex: 1;
        background: rgba(0, 0, 0, 0.3);
        border: 1px solid rgba(255, 255, 255, 0.1);
        /* glass-border */
        padding: 10px 12px;
        border-radius: 8px;
        color: var(--text-primary);
        font-family: var(--font-main);
    }

    .glass-input:focus {
        outline: none;
        border-color: var(--accent-orange);
        background: rgba(0, 0, 0, 0.4);
    }

    .btn-primary {
        background: var(--accent-orange);
        border: none;
        color: white;
        padding: 0 20px;
        border-radius: 8px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s;
        white-space: nowrap;
    }

    .btn-primary:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(255, 123, 0, 0.3);
    }

    .workspace-list-section h4,
    .workspace-save-section h4 {
        font-size: 0.8rem;
        text-transform: uppercase;
        color: var(--text-hint);
        margin-bottom: 10px;
        letter-spacing: 0.5px;
    }

    .workspace-list {
        flex: 1;
        overflow-y: auto;
        background: rgba(0, 0, 0, 0.2);
        border-radius: 8px;
        padding: 10px;
        border: 1px solid rgba(255, 255, 255, 0.05);
        min-height: 200px;
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .workspace-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        background: rgba(255, 255, 255, 0.03);
        padding: 12px;
        border-radius: 6px;
        border: 1px solid transparent;
        transition: background 0.2s;
    }

    .workspace-item:hover {
        background: rgba(255, 255, 255, 0.08);
        border-color: rgba(255, 255, 255, 0.1);
    }

    .workspace-info {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    .workspace-name {
        font-weight: 500;
        font-size: 0.9rem;
        color: var(--text-primary);
    }

    .workspace-date {
        font-size: 0.7rem;
        color: var(--text-hint);
    }

    .workspace-actions {
        display: flex;
        gap: 6px;
    }

    .ws-action-btn {
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.1);
        color: var(--text-hint);
        width: 30px;
        height: 30px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 6px;
        cursor: pointer;
        transition: all 0.2s;
    }

    .ws-action-btn:hover {
        background: rgba(255, 255, 255, 0.1);
        color: var(--text-primary);
    }

    .ws-action-btn.delete:hover {
        color: #f87171;
        background: rgba(248, 113, 113, 0.1);
        border-color: rgba(248, 113, 113, 0.3);
    }

    /* ============== NOTEBOOK SIDEBAR ============== */
    .notebook-sidebar {
        position: fixed;
        top: 0;
        right: 0;
        width: 320px;
        height: 100vh;
        background: rgba(0, 0, 0, 0.85);
        backdrop-filter: blur(12px);
        border-left: 1px solid var(--glass-border);
        z-index: 5000;
        display: flex;
        flex-direction: column;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        transform: translateX(0);
    }

    .notebook-sidebar.hidden {
        transform: translateX(100%);
        display: flex !important;
        /* Override generic hidden which uses display:none */
    }

    .notebook-header {
        padding: 16px;
        border-bottom: 1px solid var(--glass-border);
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .notebook-header h3 {
        margin: 0;
        font-size: 1.1rem;
        color: var(--accent-orange);
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .notebook-close {
        background: none;
        border: none;
        color: var(--text-hint);
        font-size: 1.5rem;
        cursor: pointer;
    }

    .notebook-controls {
        padding: 12px;
        display: flex;
        flex-direction: column;
        gap: 10px;
        border-bottom: 1px solid var(--glass-border);
    }

    .notebook-filters {
        display: flex;
        gap: 6px;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .filter-btn {
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid var(--glass-border);
        color: var(--text-secondary);
        padding: 4px 10px;
        border-radius: 12px;
        font-size: 0.75rem;
        cursor: pointer;
        white-space: nowrap;
        transition: all 0.2s;
    }

    .filter-btn:hover {
        background: rgba(255, 255, 255, 0.1);
    }

    .filter-btn.active {
        background: rgba(255, 123, 0, 0.2);
        color: var(--accent-orange);
        border-color: rgba(255, 123, 0, 0.4);
    }

    .notebook-list {
        flex: 1;
        overflow-y: auto;
        padding: 12px;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .nb-item {
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid transparent;
        border-radius: 8px;
        padding: 10px;
        display: flex;
        gap: 10px;
        cursor: pointer;
        transition: all 0.2s;
    }

    .nb-item:hover {
        background: rgba(255, 255, 255, 0.08);
        border-color: rgba(255, 255, 255, 0.1);
        transform: translateX(-2px);
    }

    .nb-item-icon {
        font-size: 1.2rem;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        background: rgba(0, 0, 0, 0.2);
        border-radius: 6px;
    }

    .nb-item-content {
        flex: 1;
        overflow: hidden;
    }

    .nb-item-title {
        font-size: 0.9rem;
        font-weight: 500;
        color: var(--text-primary);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        margin-bottom: 2px;
    }

    .nb-item-meta {
        font-size: 0.7rem;
        color: var(--text-hint);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .nb-item-actions {
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 4px;
    }

    .nb-action-btn {
        background: none;
        border: none;
        font-size: 0.9rem;
        cursor: pointer;
        opacity: 0.5;
        transition: opacity 0.2s;
    }

    .nb-action-btn:hover {
        opacity: 1;
    }

    .nb-empty,
    .nb-loading,
    .nb-error {
        text-align: center;
        color: var(--text-hint);
        font-style: italic;
        font-size: 0.85rem;
        padding: 20px;
    }

    /* ============== DISTANCE CALCULATOR ============== */
    .distance-marker {
        width: 28px;
        height: 28px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 700;
        font-size: 0.85rem;
        color: #fff;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
        border: 2px solid #fff;
    }

    .distance-marker.marker-a {
        background: linear-gradient(135deg, #00d68f 0%, #00a86b 100%);
    }

    .distance-marker.marker-b {
        background: linear-gradient(135deg, #ff8800 0%, #ff5500 100%);
    }

    .tool-hint {
        display: flex;
        align-items: center;
        gap: 6px;
        padding: 6px 10px;
        background: rgba(74, 144, 217, 0.15);
        border: 1px solid rgba(74, 144, 217, 0.3);
        border-radius: 6px;
        margin-bottom: 8px;
        font-size: 0.8rem;
        color: #4a90d9;
        animation: pulse-hint 2s ease-in-out infinite;
    }

    @keyframes pulse-hint {

        0%,
        100% {
            opacity: 1;
        }

        50% {
            opacity: 0.7;
        }
    }

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

    .result-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 3px 0;
    }

    .result-label {
        color: var(--text-hint);
        font-size: 0.82rem;
    }

    .driving-result {
        font-weight: 600;
        color: var(--accent-blue);
    }

    .result-error {
        font-size: 0.8rem;
        color: #ff6b6b;
        padding: 8px;
        background: rgba(255, 107, 107, 0.1);
        border-radius: 6px;
        margin-top: 8px;
    }

    .tool-btn.active {
        background: var(--accent-blue);
        border-color: var(--accent-blue);
    }

    /* ============== STAT BOXES ============== */
    .stat-box {
        flex: 1;
        text-align: center;
        padding: 8px 4px;
        background: rgba(255, 255, 255, 0.03);
        border-radius: 6px;
        border: 1px solid rgba(255, 255, 255, 0.05);
    }

    .stat-box .stat-value {
        display: block;
        font-size: 1.2rem;
        font-weight: 700;
        color: #ff7b00;
        line-height: 1.2;
    }

    .stat-box .stat-label {
        display: block;
        font-size: 0.65rem;
        color: var(--text-hint);
        text-transform: uppercase;
        letter-spacing: 0.5px;
        margin-top: 2px;
    }

    /* ============== LOGIN MODAL ============== */
    .login-modal {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.85);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 10000;
        transition: opacity 0.3s;
    }

    .login-modal.hidden {
        opacity: 0;
        pointer-events: none;
    }

    .login-modal-content {
        width: 100%;
        max-width: 380px;
        padding: 48px 40px 40px;
        text-align: center;
        border-radius: 16px;
    }

    .login-header {
        margin-bottom: 32px;
    }

    .login-logo {
        margin-bottom: 16px;
    }

    .login-logo svg {
        filter: drop-shadow(0 0 12px rgba(96, 165, 250, 0.3));
    }

    .login-title {
        font-size: 2rem;
        font-weight: 700;
        margin-bottom: 6px;
        background: linear-gradient(135deg, #60a5fa, #a78bfa);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        letter-spacing: -0.5px;
    }

    .login-subtitle {
        font-size: 0.9rem;
        color: var(--text-secondary);
        margin: 0;
    }

    .login-form {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    .login-form .form-group {
        text-align: left;
    }

    .login-form label {
        display: block;
        font-size: 0.75rem;
        color: var(--text-hint);
        text-transform: uppercase;
        letter-spacing: 0.5px;
        margin-bottom: 6px;
    }

    .login-form input {
        width: 100%;
        padding: 12px 14px;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid var(--glass-border);
        border-radius: 8px;
        color: var(--text-primary);
        font-family: var(--font-main);
        font-size: 0.95rem;
        transition: all 0.2s;
    }

    .login-form input:focus {
        outline: none;
        border-color: #60a5fa;
        background: rgba(255, 255, 255, 0.08);
        box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.15);
    }

    .login-form input::placeholder {
        color: var(--text-hint);
    }

    .login-error {
        background: rgba(248, 81, 73, 0.15);
        border: 1px solid rgba(248, 81, 73, 0.3);
        color: #f85149;
        padding: 10px;
        border-radius: 6px;
        font-size: 0.85rem;
    }

    .login-submit-btn {
        width: 100%;
        padding: 14px;
        background: #60a5fa;
        border: none;
        border-radius: 10px;
        color: white;
        font-family: var(--font-main);
        font-size: 1rem;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s;
        margin-top: 12px;
    }

    .login-submit-btn:hover:not(:disabled) {
        transform: translateY(-1px);
        box-shadow: 0 4px 24px rgba(96, 165, 250, 0.4);
    }

    .login-submit-btn:disabled {
        opacity: 0.7;
        cursor: wait;
    }

    .login-toggle {
        margin-top: 20px;
        font-size: 0.85rem;
        color: var(--text-hint);
    }

    .login-toggle-btn {
        background: none;
        border: none;
        color: var(--accent-blue);
        font-family: var(--font-main);
        font-size: 0.85rem;
        cursor: pointer;
        text-decoration: underline;
    }

    .login-toggle-btn:hover {
        color: var(--accent-orange);
    }


    /* User Menu (top-right, grouped with notebook) */
    .user-menu {
        position: fixed;
        top: 15px;
        right: 140px;
        /* Space for notebook and zoom controls */
        z-index: 1100;
    }

    .user-menu-btn {
        display: flex;
        align-items: center;
        gap: 8px;
        background: var(--glass-bg);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        border: 1px solid var(--glass-border);
        border-radius: 20px;
        padding: 8px 14px;
        color: var(--text-primary);
        font-family: var(--font-main);
        font-size: 0.85rem;
        cursor: pointer;
        transition: all 0.2s;
    }

    .user-menu-btn:hover {
        background: rgba(255, 255, 255, 0.1);
    }

    .user-email {
        max-width: 150px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .user-tier-badge {
        padding: 2px 8px;
        border-radius: 10px;
        font-size: 0.65rem;
        text-transform: uppercase;
        font-weight: 600;
    }

    .user-tier-badge.free {
        background: rgba(139, 148, 158, 0.2);
        color: var(--text-hint);
    }

    .user-tier-badge.pro {
        background: rgba(255, 123, 0, 0.2);
        color: var(--accent-orange);
    }

    .user-dropdown {
        position: absolute;
        top: 100%;
        right: 0;
        margin-top: 8px;
        background: var(--glass-bg);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border: 1px solid var(--glass-border);
        border-radius: 8px;
        padding: 8px;
        min-width: 120px;
    }

    .logout-btn {
        width: 100%;
        background: rgba(248, 81, 73, 0.1);
        border: 1px solid rgba(248, 81, 73, 0.2);
        color: #f85149;
        padding: 8px 12px;
        border-radius: 6px;
        font-family: var(--font-main);
        font-size: 0.8rem;
        cursor: pointer;
        transition: all 0.2s;
    }

    .logout-btn:hover {
        background: rgba(248, 81, 73, 0.2);
    }

    /* Auth Blocking State */
    body.auth-blocking #map,
    body.auth-blocking .overlay,
    body.auth-blocking .ai-search-container {
        filter: blur(4px);
        pointer-events: none;
    }

    .user-dropdown {
        position: absolute;
        top: calc(100% + 8px);
        right: 0;
        min-width: 140px;
        background: var(--glass-bg);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border: 1px solid var(--glass-border);
        border-radius: 12px;
        padding: 8px;
        box-shadow: var(--shadow-lg);
        display: flex;
        flex-direction: column;
        gap: 4px;
        animation: fadeIn 0.2s ease-out;
    }

    .logout-btn {
        background: transparent;
        border: none;
        color: #ff4d4d;
        padding: 8px 12px;
        text-align: left;
        font-size: 0.85rem;
        cursor: pointer;
        border-radius: 8px;
        transition: background 0.2s;
    }

    .logout-btn:hover {
        background: rgba(255, 77, 77, 0.1);
    }

    @keyframes fadeIn {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    /* ============== FILTER CHIPS (Multi-select checkboxes) ============== */
    .filter-chip {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        padding: 3px 8px;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid var(--glass-border);
        border-radius: 12px;
        font-size: 0.72rem;
        color: var(--text-hint);
        cursor: pointer;
        transition: all 0.2s;
        user-select: none;
    }

    .filter-chip:hover {
        background: rgba(255, 255, 255, 0.1);
        color: var(--text-primary);
    }

    .filter-chip:has(input:checked) {
        background: rgba(255, 123, 0, 0.2);
        border-color: rgba(255, 123, 0, 0.5);
        color: var(--accent-orange);
    }

    .filter-chip input[type="checkbox"] {
        width: 10px;
        height: 10px;
        margin: 0;
        accent-color: var(--accent-orange);
    }

    /* ============== COLLAPSIBLE FILTER DROPDOWNS ============== */
    .filter-dropdown {
        margin-top: 10px;
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid var(--glass-border);
        border-radius: 8px;
        overflow: hidden;
    }

    .filter-dropdown-header {
        display: flex;
        align-items: center;
        gap: 6px;
        padding: 8px 12px;
        font-size: 0.8rem;
        font-weight: 500;
        color: var(--text-primary);
        cursor: pointer;
        background: rgba(255, 255, 255, 0.02);
        list-style: none;
    }

    .filter-dropdown-header::-webkit-details-marker {
        display: none;
    }

    .filter-dropdown-header::after {
        content: '▶';
        font-size: 0.6rem;
        margin-left: auto;
        transition: transform 0.2s;
        color: var(--text-hint);
    }

    .filter-dropdown[open] .filter-dropdown-header::after {
        transform: rotate(90deg);
    }

    .filter-dropdown-content {
        padding: 10px 12px;
        border-top: 1px solid var(--glass-border);
    }

    /* Dark popup for well details when company overview is open */
    .well-popup-dark .maplibregl-popup-content {
        background: rgba(13, 17, 23, 0.95);
        border: 1px solid rgba(0, 162, 255, 0.3);
        border-radius: 8px;
        padding: 12px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    }

    .well-popup-dark .maplibregl-popup-close-button {
        color: #8b949e;
        font-size: 18px;
        padding: 4px 8px;
    }

    .well-popup-dark .maplibregl-popup-close-button:hover {
        color: #fff;
        background: transparent;
    }

    .well-popup-dark .maplibregl-popup-tip {
        border-top-color: rgba(13, 17, 23, 0.95);
    }

    /* Dark popup for facility hover */
    .facility-popup .maplibregl-popup-content {
        background: rgba(13, 17, 23, 0.95);
        border: 1px solid rgba(16, 185, 129, 0.4);
        border-radius: 8px;
        padding: 10px 12px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
        color: #e6edf3;
        font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    }

    .facility-popup .maplibregl-popup-tip {
        border-top-color: rgba(13, 17, 23, 0.95);
    }

    .facility-popup .fac-name {
        font-weight: 600;
        font-size: 13px;
        color: #fff;
        margin-bottom: 4px;
    }

    .facility-popup .fac-lsd {
        font-size: 11px;
        color: #8b949e;
        font-family: monospace;
        margin-bottom: 6px;
    }

    .facility-popup .fac-tariff {
        font-size: 11px;
        padding-top: 6px;
        border-top: 1px solid rgba(255,255,255,0.1);
    }

    .facility-popup .fac-tariff-value {
        color: #e6edf3;
        font-weight: 500;
    }

    .facility-popup .fac-tariff-details {
        color: #8b949e;
        font-size: 10px;
        margin-top: 2px;
    }

    /* Position details panel on left side when operator modal is open on right */
    .details-panel.position-left {
        right: auto;
        left: 50%;
        transform: translate(-100%, -50%);
        /* Position to left of center */
        margin-left: -100px;
        /* Shift left a bit more */
        top: 55%;
        /* Slightly lower to avoid AI search bar */
    }

    /* ============== NOTEBOOK SIDEBAR ============== */
    /* Added to match Toolbox styling */
    .notebook-sidebar {
        position: fixed;
        top: 70px;
        right: 20px;
        width: 340px;
        max-height: calc(100vh - 100px);
        display: flex;
        flex-direction: column;
        background: var(--glass-bg);
        backdrop-filter: blur(24px);
        -webkit-backdrop-filter: blur(24px);
        border: 1px solid rgba(255, 123, 0, 0.2);
        /* Slight orange tint for notebook to match icon */
        border-radius: 16px;
        z-index: 1100;
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7);
        padding: 0;
        overflow: hidden;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .notebook-sidebar.hidden {
        opacity: 0;
        transform: translateX(20px) scale(0.95);
        pointer-events: none;
    }

    .notebook-header {
        padding: 16px;
        border-bottom: 1px solid var(--glass-border);
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .notebook-header h3 {
        margin: 0;
        font-size: 0.95rem;
        font-weight: 600;
        color: var(--text-primary);
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .notebook-header .icon {
        color: var(--accent-orange);
        display: flex;
        align-items: center;
    }

    .notebook-close {
        background: none;
        border: none;
        color: var(--text-secondary);
        font-size: 1.5rem;
        cursor: pointer;
        line-height: 1;
        padding: 4px;
        transition: color 0.2s;
    }

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

    .notebook-controls {
        padding: 12px 16px;
        border-bottom: 1px solid var(--glass-border);
        background: rgba(0, 0, 0, 0.1);
    }

    .glass-input {
        width: 100%;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid var(--glass-border);
        border-radius: 6px;
        padding: 8px 12px;
        color: var(--text-primary);
        font-family: var(--font-main);
        font-size: 0.8rem;
        outline: none;
        margin-bottom: 10px;
    }

    .glass-input:focus {
        border-color: var(--accent-orange);
    }

    .notebook-filters {
        display: flex;
        gap: 6px;
        overflow-x: auto;
        padding-bottom: 2px;
    }

    .filter-btn {
        background: transparent;
        border: 1px solid var(--glass-border);
        border-radius: 20px;
        padding: 4px 10px;
        color: var(--text-hint);
        font-size: 0.7rem;
        cursor: pointer;
        white-space: nowrap;
        transition: all 0.2s;
    }

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

    .filter-btn.active {
        background: rgba(255, 123, 0, 0.15);
        border-color: var(--accent-orange);
        color: var(--accent-orange);
    }

    .notebook-list {
        flex: 1;
        overflow-y: auto;
        padding: 8px;
    }

    .nb-item {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 10px;
        border-radius: 8px;
        cursor: pointer;
        transition: background 0.2s;
        margin-bottom: 4px;
    }

    .nb-item:hover {
        background: rgba(255, 255, 255, 0.05);
    }

    .nb-item-icon {
        width: 32px;
        height: 32px;
        border-radius: 6px;
        background: rgba(255, 255, 255, 0.03);
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--text-secondary);
        flex-shrink: 0;
    }

    .nb-item:hover .nb-item-icon {
        background: rgba(255, 255, 255, 0.08);
        color: var(--text-primary);
    }

    .nb-item-content {
        flex: 1;
        overflow: hidden;
    }

    .nb-item-title {
        font-size: 0.85rem;
        font-weight: 500;
        color: var(--text-primary);
        margin-bottom: 2px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .nb-item-meta {
        font-size: 0.7rem;
        color: var(--text-hint);
    }

    .nb-item-actions {
        display: flex;
        gap: 4px;
        opacity: 0;
        transition: opacity 0.2s;
    }

    .nb-item:hover .nb-item-actions {
        opacity: 1;
    }

    .nb-action-btn {
        width: 24px;
        height: 24px;
        border-radius: 4px;
        border: none;
        background: transparent;
        color: var(--text-hint);
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .nb-action-btn:hover {
        background: rgba(255, 255, 255, 0.1);
        color: var(--text-primary);
    }

    .nb-action-btn.delete:hover {
        background: rgba(248, 81, 73, 0.2);
        color: #f85149;
    }

    .nb-error {
        text-align: center;
        padding: 20px;
        color: var(--text-hint);
        font-size: 0.8rem;
        font-style: italic;
    }

    .notebook-sidebar.hidden {
        opacity: 0;
        transform: translateX(20px) scale(0.95);
        pointer-events: none;
    }

    .notebook-header {
        padding: 16px;
        border-bottom: 1px solid var(--glass-border);
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .notebook-header h3 {
        margin: 0;
        font-size: 0.95rem;
        font-weight: 600;
        color: var(--text-primary);
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .notebook-header .icon {
        color: var(--accent-orange);
        display: flex;
        align-items: center;
    }

    .notebook-close {
        background: none;
        border: none;
        color: var(--text-secondary);
        font-size: 1.5rem;
        cursor: pointer;
        line-height: 1;
        padding: 4px;
        transition: color 0.2s;
    }

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

    .notebook-controls {
        padding: 12px 16px;
        border-bottom: 1px solid var(--glass-border);
        background: rgba(0, 0, 0, 0.1);
    }

    .glass-input {
        width: 100%;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid var(--glass-border);
        border-radius: 6px;
        padding: 8px 12px;
        color: var(--text-primary);
        font-family: var(--font-main);
        font-size: 0.8rem;
        outline: none;
        margin-bottom: 10px;
    }

    .glass-input:focus {
        border-color: var(--accent-orange);
    }

    .notebook-filters {
        display: flex;
        gap: 6px;
        overflow-x: auto;
        padding-bottom: 2px;
    }

    .filter-btn {
        background: transparent;
        border: 1px solid var(--glass-border);
        border-radius: 20px;
        padding: 4px 10px;
        color: var(--text-hint);
        font-size: 0.7rem;
        cursor: pointer;
        white-space: nowrap;
        transition: all 0.2s;
    }

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

    .filter-btn.active {
        background: rgba(255, 123, 0, 0.15);
        border-color: var(--accent-orange);
        color: var(--accent-orange);
    }

    .notebook-list {
        flex: 1;
        overflow-y: auto;
        padding: 8px;
    }

    .nb-item {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 10px;
        border-radius: 8px;
        cursor: pointer;
        transition: background 0.2s;
        margin-bottom: 4px;
    }

    .nb-item:hover {
        background: rgba(255, 255, 255, 0.05);
    }

    .nb-item-icon {
        width: 32px;
        height: 32px;
        border-radius: 6px;
        background: rgba(255, 255, 255, 0.03);
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--text-secondary);
        flex-shrink: 0;
    }

    .nb-item:hover .nb-item-icon {
        background: rgba(255, 255, 255, 0.08);
        color: var(--text-primary);
    }

    .nb-item-content {
        flex: 1;
        overflow: hidden;
    }

    .nb-item-title {
        font-size: 0.85rem;
        font-weight: 500;
        color: var(--text-primary);
        margin-bottom: 2px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .nb-item-meta {
        font-size: 0.7rem;
        color: var(--text-hint);
    }

    .nb-item-actions {
        display: flex;
        gap: 4px;
        opacity: 0;
        transition: opacity 0.2s;
    }

    .nb-item:hover .nb-item-actions {
        opacity: 1;
    }

    .nb-action-btn {
        width: 24px;
        height: 24px;
        border-radius: 4px;
        border: none;
        background: transparent;
        color: var(--text-hint);
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .nb-action-btn:hover {
        background: rgba(255, 255, 255, 0.1);
        color: var(--text-primary);
    }

    .nb-action-btn.delete:hover {
        background: rgba(248, 81, 73, 0.2);
        color: #f85149;
    }

    .nb-loading,
    .nb-empty,
    .nb-error {
        text-align: center;
        padding: 20px;
        color: var(--text-hint);
        font-size: 0.8rem;
        font-style: italic;
    }

    .filter-section {
        overflow: visible !important;
        /* Allow chips to pop out */
        padding: 16px !important;
        /* More breathing room */
        margin-bottom: 24px !important;
    }

    /* =========================================
   NEW FILTER CHIP GRID SYSTEM
   ========================================= */

    .filter-chip-item {
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        /* Reduced from 6px */
        background: transparent;
        border: 1px solid rgba(255, 255, 255, 0.15);
        border-radius: 6px;
        padding: 4px 2px;
        /* Reduced padding */
        cursor: pointer;
        transition: all 0.2s ease;
        user-select: none;
        min-height: 38px;
        /* Reduced from 48px */
        color: var(--text-primary) !important;
    }

    /* Hide the actual checkbox */
    .filter-chip-item input[type="checkbox"] {
        position: absolute;
        opacity: 0;
        pointer-events: none;
    }

    /* Hover State */
    .filter-chip-item:hover {
        background: rgba(255, 255, 255, 0.05);
        border-color: rgba(255, 255, 255, 0.4);
    }

    /* Active State (When Checkbox is Checked) */
    .filter-chip-item:has(input:checked) {
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid currentColor;
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
        transform: translateY(-1px);
    }

    /* Force label text to be white even when active */
    .filter-chip-item:has(input:checked) .filter-chip-label {
        color: var(--text-primary) !important;
        font-weight: 500;
    }

    /* Typography */
    .filter-chip-label {
        font-size: 0.70rem;
        /* Keep small */
        color: var(--text-secondary);
        font-weight: 500;
        text-align: center;
        line-height: 1.1;
        white-space: nowrap;
        /* Prevent wrapping if possible */
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }

    border: 1px solid rgba(255, 255, 255, 0.15);
    /* Sharper border */
    border-radius: 6px;
    padding: 6px 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    min-height: 48px;
    color: var(--text-primary) !important;
    /* Force White Text */
    }

    /* Hide the actual checkbox */
    .filter-chip-item input[type="checkbox"] {
        position: absolute;
        opacity: 0;
        pointer-events: none;
    }

    /* Hover State */
    .filter-chip-item:hover {
        background: rgba(255, 255, 255, 0.05);
        border-color: rgba(255, 255, 255, 0.4);
    }

    /* Active State (When Checkbox is Checked) */
    .filter-chip-item:has(input:checked) {
        background: rgba(255, 255, 255, 0.08);
        /* Light glass fill */
        border: 1px solid currentColor;
        /* Colored Border */
        /* Uses the color defined inline or via class */
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
        transform: translateY(-1px);
    }

    /* Force label text to be white even when active */
    .filter-chip-item:has(input:checked) .filter-chip-label {
        color: var(--text-primary) !important;
        font-weight: 500;
    }


    /* Typography */
    .filter-chip-label {
        font-size: 0.7rem;
        color: var(--text-secondary);
        font-weight: 500;
        text-align: center;
        line-height: 1.1;
    }

    .filter-chip-item:has(input:checked) .filter-chip-label {
        color: var(--text-primary);
    }

    /* Geometric Icons (Pure CSS) */
    .geo-icon {
        width: 14px;
        height: 14px;
        display: inline-block;
    }

    /* SHAPES */
    .geo-triangle {
        background-color: currentColor;
        clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
    }

    .geo-square {
        background-color: currentColor;
    }

    .geo-circle {
        background-color: currentColor;
        border-radius: 50%;
    }

    .geo-diamond {
        background-color: currentColor;
        transform: rotate(45deg);
    }

    .geo-inv-triangle {
        background-color: currentColor;
        clip-path: polygon(0 0, 100% 0, 50% 100%);
    }

    .geo-donut {
        border: 2px solid currentColor;
        border-radius: 50%;
    }

    /* SPECIFIC COLORS (Applied to the icon) */
    .icon-battery {
        color: #ffd700;
    }

    /* Gold Triangle */
    .icon-meter {
        color: #00ffff;
    }

    /* Cyan Circle */
    .icon-plant {
        color: #ff00ff;
    }

    /* Magenta Square */
    .icon-comp {
        color: #bd93f9;
    }

    /* Purple Diamond */
    .icon-inject {
        color: #50fa7b;
    }

    /* Green Inv Triangle */
    .icon-term {
        color: #ff7b00;
    }

    /* Orange Donut */
    /* =========================================
   STANDARDIZED MAP DOT ICONS
   ========================================= */

    /* All icons are now simple dots to match the map */
    .geo-dot {
        width: 12px;
        height: 12px;
        border-radius: 50%;
        display: inline-block;
        background-color: currentColor;
        box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
        /* Slight shadow to pop against dark bg */
        border: 1px solid rgba(255, 255, 255, 0.2);
    }

    /* Specific Facility Colors (Matching app.js FACILITY_COLORS) */
    /* Battery: #ffff00 */
    .color-battery {
        color: #ffff00;
    }

    /* Plant: #ff00ff */
    .color-plant {
        color: #ff00ff;
    }

    /* Meter (Gathering/Meter): #00ffff */
    .color-meter {
        color: #00ffff;
    }

    /* Terminal (Storage/Terminal): #ffaa00 */
    .color-terminal {
        color: #ffaa00;
    }

    /* Injection (Injection/Disposal): #3fb950 */
    .color-injection {
        color: #3fb950;
    }

    /* Compressor: #bd93f9 (Custom distinct color, as it falls under 'Other' or specific logic) */
    .color-compressor {
        color: #bd93f9;
    }

    /* Specific Well Fluid Colors (Matching app.js FLUID_COLORS) */
    /* GAS: #ff7b00 */
    .color-fluid-gas {
        color: #ff7b00;
    }

    /* CR-OIL: #00a2ff */
    .color-fluid-oil {
        color: #00a2ff;
    }

    /* CR-BIT: #8b4513 */
    .color-fluid-bitty {
        color: #8b4513;
    }

    /* 'Bitumen' */

    /* WATER: #3fb950 */
    .color-fluid-water {
        color: #3fb950;
    }

    /* N/A: #8b949e */
    .color-fluid-na {
        color: #8b949e;
    }

    /* Pipeline Line Icons */
    .geo-line {
        width: 20px;
        height: 4px;
        border-radius: 2px;
        display: inline-block;
        background-color: currentColor;
        box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
    }

    /* Pipeline Substance Colors */
    .color-sub-gas {
        color: #ff7b00;
    }

    .color-sub-effluent {
        color: #00a2ff;
    }

    .color-sub-crude {
        color: #0066cc;
    }

    .color-sub-sour {
        color: #ff4500;
    }

    .color-sub-salt {
        color: #3fb950;
    }

    .color-sub-fuel {
        color: #ffaa00;
    }

    .color-sub-hvp {
        color: #ff66b2;
    }

    /* HVP/LVP */
    .color-sub-condensate {
        color: #9966ff;
    }

    /* =========================================
   HIGH-END UI OVERRIDES
   ========================================= */

    /* AI Search Container - Glass + Outline */
    .ai-search-container {
        background: rgba(13, 17, 23, 0.6) !important;
        backdrop-filter: blur(12px) !important;
        border: 1px solid rgba(255, 255, 255, 0.15) !important;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2) !important;
        border-radius: 12px !important;
    }

    .ai-search-input-wrapper {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
    }

    .ai-search-input {
        background: transparent !important;
        color: #ffffff !important;
        /* Force Pure White */
        font-family: var(--font-main) !important;
        font-weight: 500 !important;
        font-size: 1rem !important;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    }

    .ai-search-input::placeholder {
        color: var(--text-hint) !important;
    }

    /* Lasso Button - Outline Style */
    #btn-lasso {
        background: transparent !important;
        border: 1px solid var(--accent-orange) !important;
        color: var(--accent-orange) !important;
        font-weight: 500 !important;
        box-shadow: none !important;
        transition: all 0.2s ease !important;
    }

    #btn-lasso:hover {
        background: rgba(255, 123, 0, 0.1) !important;
        box-shadow: 0 0 10px rgba(255, 123, 0, 0.2) !important;
        transform: translateY(-1px);
    }

    #btn-lasso.active {
        background: rgba(255, 123, 0, 0.2) !important;
        box-shadow: inset 0 0 8px rgba(255, 123, 0, 0.3) !important;
    }

    /* ==========================================================================
   PREMIUM DARK UI OVERRIDES (User Specified Design System)
   ========================================================================== */

    :root {
        --bg-color: #0d1117;
        --glass-bg: #1E1E1E;
        /* Dark background as requested */
        --glass-border: #444444;
        /* Specific border color */
        --text-primary: #FFFFFF;
        /* Pure White */
        --text-hint: #CCCCCC;
        /* Light Gray */
        --accent-orange: #ff7b00;
        --btn-bg-default: #333333;
        --btn-bg-hover: #444444;
    }

    /* 1. TYPOGRAPHY */
    body {
        font-family: 'Inter', Roboto, sans-serif !important;
    }

    .accordion-header,
    h1,
    h2,
    h3,
    h4,
    .filter-section-title {
        font-weight: 600 !important;
        text-transform: uppercase !important;
        letter-spacing: 0.5px !important;
        color: var(--text-hint) !important;
    }

    .filter-chip-label,
    button {
        font-weight: 400 !important;
    }

    /* 2. COLOR PALETTE & CONTRAST */
    .glass,
    .overlay,
    .sidebar,
    .filter-section {
        background-color: var(--glass-bg) !important;
        backdrop-filter: blur(12px) !important;
        /* Keep glass effect but dark */
        border: 1px solid var(--glass-border) !important;
        color: var(--text-primary) !important;
    }

    /* Search Bar Specifics */
    .ai-search-container {
        background-color: var(--glass-bg) !important;
        border: 1px solid var(--glass-border) !important;
    }

    .ai-search-input {
        color: #FFFFFF !important;
    }

    .ai-search-input::placeholder {
        color: #AAAAAA !important;
        /* Specific placeholder gray */
    }

    /* 3. BUTTONS & BORDERS (Filter Chips) */
    .filter-chip-item {
        background-color: var(--btn-bg-default) !important;
        border: 1px solid #444444 !important;
        border-radius: 6px !important;
        min-height: 48px !important;
        transition: all 0.2s ease !important;
    }

    .filter-chip-item:hover {
        background-color: var(--btn-bg-hover) !important;
        border-color: #666666 !important;
    }

    /* Active State */
    .filter-chip-item:has(input:checked) {
        background-color: var(--btn-bg-hover) !important;
        border: 1px solid currentColor !important;
        /* Accent border */
        box-shadow: 0 0 8px rgba(0, 0, 0, 0.4) !important;
    }

    .filter-chip-item:has(input:checked) .filter-chip-label {
        color: #FFFFFF !important;
        font-weight: 500 !important;
    }

    /* 4. SPECIAL ELEMENT STYLING */

    /* Lasso Button */
    #btn-lasso {
        width: 100% !important;
        background-color: rgba(255, 123, 0, 0.1) !important;
        border: 2px solid var(--accent-orange) !important;
        color: var(--accent-orange) !important;
        font-weight: 600 !important;
        text-transform: uppercase !important;
        letter-spacing: 1px !important;
        border-radius: 6px !important;
        padding: 12px !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
    }

    #btn-lasso:hover {
        background-color: var(--accent-orange) !important;
        color: #000000 !important;
    }

    /* Focus Toggles (Segmented Control Style) */
    /* Assuming they are in a container, we style the buttons to look joined */
    .focus-group {
        display: flex;
        gap: 0;
        margin-bottom: 15px;
    }

    .focus-btn {
        flex: 1;
        background: var(--btn-bg-default);
        border: 1px solid #444444;
        color: var(--text-hint);
        padding: 10px;
        font-size: 0.8rem;
        cursor: pointer;
        transition: all 0.2s;
    }

    .focus-btn:first-child {
        border-top-left-radius: 6px;
        border-bottom-left-radius: 6px;
        border-right: none;
    }

    .focus-btn:last-child {
        border-top-right-radius: 6px;
        border-bottom-right-radius: 6px;
        border-left: 1px solid #444444;
        /* Restore border */
    }

    .focus-btn.active {
        background: var(--accent-blue);
        color: white;
        font-weight: 600;
    }

    /* Production Data (Segmented Control) */
    /* Apply similar logic if possible or just cleaner buttons */
    #well-has-production,
    #well-no-production {
        /* These are checkboxes in chip grid, usually. 
       If user wants toggle, we might need HTML change.
       For now, we stick to the Premium Chip style which handles binary choice well visually 
       as two distinct buttons. */
    }

    /* SAFETY CLOSURES FOR SYNTAX ERRORS */
    }
    }
    }
    }

    /* FORCE DESKTOP SIDEBAR WIDTH */
    @media (min-width: 768px) {
        .overlay {
            width: 360px !important;
            left: 15px !important;
            right: auto !important;
            max-width: 360px !important;
        }
    }

/* =========================================
   FINAL LAYOUT REFINEMENTS (Toolbox & Grid)
   ========================================= */

.toolbox-toggle-fixed {
    position: fixed;
    top: 15px;
    left: 376px; /* 360px sidebar + 16px gap */
    z-index: 1000;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.toolbox-toggle-fixed:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

.toolbox-toggle-fixed svg {
    width: 20px;
    height: 20px;
}

/* Force 2-Column Grid for Filter Chips */
.filter-chip-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
    width: 100% !important;
    margin-left: 0 !important;
    padding: 2px !important;
}

/* Header Alignment Fix */
.overlay header {
    padding: 12px 16px !important;
    align-items: center !important;
    min-height: 60px;
}

.header-actions {
    padding-right: 32px !important; /* Space for close button */
    width: 100%;
    justify-content: center !important;
}


.toolbox-panel { left: 400px !important; }


/* Fix Toolbox when Sidebar is Collapsed */
.toolbox-panel.sidebar-collapsed, body.sidebar-collapsed .toolbox-panel { left: 70px !important; }
.toolbox-toggle-fixed.sidebar-collapsed, body.sidebar-collapsed .toolbox-toggle-fixed { left: 80px !important; }

/* =============================================
   COMPACT DARK GLASS SIDEBAR - v2.1
   Unified colors, proper header, glass search
   ============================================= */

/* Dark Glass Overlay Background */
.overlay {
    background: rgba(10, 12, 16, 0.62) !important;
    backdrop-filter: blur(28px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(28px) saturate(180%) !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5) !important;
}

/* Glass Sections - Subtle border only, no different bg */
.overlay .filter-section.glass {
    background: transparent !important;
    backdrop-filter: none !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 10px !important;
    padding: 12px 12px !important;
    margin-bottom: 6px !important;
    overflow: visible !important;  /* Prevent chip cutoff */
}

/* ===== BRAND HEADER ===== */
.overlay .brand-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 14px 16px 12px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
}

.overlay .brand-logo {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
}

.overlay .brand-logo svg {
    flex-shrink: 0 !important;
}

.overlay .brand-name {
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    color: rgba(255, 255, 255, 0.95) !important;
    letter-spacing: -0.3px !important;
}

.overlay .brand-accent {
    color: #ff7b00 !important;
    font-weight: 700 !important;
}

.overlay .sidebar-collapse-btn {
    width: 28px !important;
    height: 28px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 6px !important;
    color: rgba(255, 255, 255, 0.5) !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
}

.overlay .sidebar-collapse-btn:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    color: rgba(255, 255, 255, 0.8) !important;
}

.overlay .sidebar-collapse-btn svg {
    width: 14px !important;
    height: 14px !important;
}

/* ===== NAV TABS ===== */
.overlay .sidebar-nav {
    display: flex !important;
    gap: 6px !important;
    padding: 10px 14px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
    margin-bottom: 8px !important;
}

.overlay .nav-tab {
    flex: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    padding: 10px 14px !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    color: rgba(255, 255, 255, 0.6) !important;
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
}

.overlay .nav-tab:hover {
    background: rgba(255, 255, 255, 0.06) !important;
    color: rgba(255, 255, 255, 0.8) !important;
}

.overlay .nav-tab.active {
    background: rgba(255, 123, 0, 0.12) !important;
    border-color: rgba(255, 123, 0, 0.25) !important;
    color: #ff7b00 !important;
}

.overlay .nav-tab svg {
    opacity: 0.7 !important;
}

.overlay .nav-tab.active svg {
    opacity: 1 !important;
}

/* Hide old header elements */
.overlay header,
.overlay .overlay-top-spacer,
.overlay .header-actions,
.overlay .header-btn {
    display: none !important;
}

.overlay .header-actions {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    width: 100% !important;
    padding: 0 !important;
}

/* Notebook Button - Pill style */
.overlay .header-btn,
.overlay #btn-notebook-header {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 6px 14px !important;
    font-size: 0.72rem !important;
    border-radius: 20px !important;
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: var(--text-primary) !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
}

.overlay .header-btn:hover,
.overlay #btn-notebook-header:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

.overlay .header-btn svg,
.overlay #btn-notebook-header svg {
    width: 14px !important;
    height: 14px !important;
}

/* Collapse Toggle Button */
.overlay .sidebar-toggle-btn,
.overlay #sidebar-toggle-btn {
    width: 28px !important;
    height: 28px !important;
    padding: 4px !important;
    border-radius: 8px !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.overlay .sidebar-toggle-btn svg {
    width: 16px !important;
    height: 16px !important;
}

/* ===== LAYERS ROW - Flexible Grid ===== */
.overlay .layers-row {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    margin-bottom: 10px !important;
}

.basemap-btn.active {
    background: var(--accent-orange) !important;
    color: #000 !important;
    font-weight: 600;
    border-color: var(--accent-orange) !important;
}

.overlay .layer-toggle {
    flex: 1 1 calc(50% - 4px) !important;
    min-width: 70px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    padding: 8px 6px !important;
    font-size: 0.7rem !important;
    font-weight: 500 !important;
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
}

.overlay .layer-toggle:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

.overlay .layer-toggle:has(input:checked) {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.25) !important;
}

.overlay .layer-toggle input[type="checkbox"] {
    width: 12px !important;
    height: 12px !important;
    margin: 0 !important;
    accent-color: var(--accent-orange) !important;
}

.overlay .layer-toggle span {
    white-space: nowrap !important;
}

/* Legacy filter-grid/filter-item (for other sections) */
.overlay .filter-grid {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    margin-bottom: 10px !important;
}

.overlay .filter-item {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 7px 12px !important;
    font-size: 0.72rem !important;
    font-weight: 500 !important;
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 20px !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
}

/* Section Headers - More Prominent */
.overlay .filter-section h3,
.overlay .filter-section .accordion-header {
    font-size: 0.7rem !important;
    font-weight: 600 !important;
    margin-bottom: 10px !important;
    padding-bottom: 6px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.8px !important;
    color: rgba(255, 255, 255, 0.5) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
}

.overlay .filter-section h4 {
    font-size: 0.65rem !important;
    font-weight: 500 !important;
    margin-top: 12px !important;
    margin-bottom: 8px !important;
    padding-top: 8px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    color: rgba(255, 255, 255, 0.4) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.04) !important;
}

/* Filter Chip Grid */
.overlay .filter-chip-grid {
    gap: 6px !important;
    padding: 4px 2px !important;  /* Prevent top chips from being cut off */
}

/* ===== HORIZONTAL CHIP LAYOUT ===== */
/* Icon LEFT of text, not stacked */
.overlay .filter-chip-item {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    padding: 8px 12px !important;
    min-height: 36px !important;
    border-radius: 18px !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    background: rgba(255, 255, 255, 0.03) !important;
    transition: all 0.15s ease !important;
}

.overlay .filter-chip-item:hover {
    background: rgba(255, 255, 255, 0.06) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

.overlay .filter-chip-item:has(input:checked) {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: currentColor !important;
    box-shadow: inset 0 0 12px rgba(255, 255, 255, 0.03) !important;
}

/* Chip Labels - Larger & Beside Icon */
.overlay .filter-chip-label {
    font-size: 0.72rem !important;
    font-weight: 500 !important;
    margin-top: 0 !important;
    white-space: nowrap !important;
}

/* Geo Dots - Inline */
.overlay .geo-dot {
    width: 10px !important;
    height: 10px !important;
    flex-shrink: 0 !important;
    border-radius: 50% !important;
}

/* Geo Lines - Inline */
.overlay .geo-line {
    width: 18px !important;
    height: 4px !important;
    flex-shrink: 0 !important;
    border-radius: 2px !important;
}

/* Focus Group (Crude/Gas Toggle) - Segmented Control */
.overlay .focus-group {
    display: flex !important;
    gap: 0 !important;
    margin-bottom: 12px !important;
    background: rgba(255, 255, 255, 0.04) !important;
    border-radius: 10px !important;
    padding: 3px !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.overlay .focus-btn {
    flex: 1 !important;
    padding: 8px 12px !important;
    font-size: 0.72rem !important;
    font-weight: 500 !important;
    border-radius: 8px !important;
    background: transparent !important;
    border: none !important;
    color: rgba(255, 255, 255, 0.6) !important;
    transition: all 0.15s ease !important;
}

.overlay .focus-btn:hover {
    color: rgba(255, 255, 255, 0.9) !important;
}

.overlay .focus-btn.active {
    background: rgba(255, 255, 255, 0.12) !important;
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
}

/* Filter Header Row with Reset Button */
.filter-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.filter-header-row h3 {
    margin-bottom: 0 !important;
}

.reset-btn {
    padding: 4px 10px;
    font-size: 0.65rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.reset-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
}

/* Compact Lasso Button */
.overlay .lasso-btn {
    padding: 8px 16px !important;
    font-size: 0.7rem !important;
    border-radius: 10px !important;
}

.overlay .lasso-controls {
    margin-top: 8px !important;
    gap: 6px !important;
}

/* Accordion Chevron */
.overlay .accordion-chevron {
    width: 12px !important;
    height: 12px !important;
}

/* Scrollbar - Thinner */
.overlay::-webkit-scrollbar {
    width: 3px !important;
}

/* ===== SEARCH BAR - Dark Glass Effect ===== */
.ai-search-container {
    background: rgba(10, 12, 16, 0.58) !important;
    backdrop-filter: blur(28px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(28px) saturate(180%) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3) !important;
}

/* ===== SIDEBAR VIEW SWITCHING ===== */
.sidebar-view {
    display: block;
}

.sidebar-view.hidden {
    display: none !important;
}

/* Tools & Notebook View Padding */
#tools-view,
#notebook-view {
    padding: 0 14px !important;
}

/* Tools View Header */
.overlay .tools-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0 14px;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.overlay .tools-header h3 {
    font-size: 0.85rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    margin: 0;
    letter-spacing: 0.3px;
}

.overlay .back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.overlay .back-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.overlay .back-btn svg {
    opacity: 0.7;
}

/* ============================================
   NOTEBOOK SIDEBAR VIEW
   ============================================ */

/* Notebook Controls */
#notebook-view .notebook-controls {
    padding: 0 0 12px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
    margin-bottom: 12px !important;
}

#notebook-view .nb-search-input {
    width: 100% !important;
    padding: 10px 14px !important;
    font-size: 0.8rem !important;
    color: rgba(255, 255, 255, 0.9) !important;
    background: rgba(0, 0, 0, 0.25) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 10px !important;
    outline: none !important;
    margin-bottom: 10px !important;
}

#notebook-view .nb-search-input:focus {
    border-color: rgba(255, 123, 0, 0.4) !important;
    box-shadow: 0 0 0 3px rgba(255, 123, 0, 0.1) !important;
}

#notebook-view .nb-search-input::placeholder {
    color: rgba(255, 255, 255, 0.35) !important;
}

/* Filter Pills */
#notebook-view .nb-filter-pills {
    display: flex !important;
    gap: 6px !important;
}

#notebook-view .nb-pill {
    flex: 1 !important;
    padding: 8px 10px !important;
    font-size: 0.7rem !important;
    font-weight: 600 !important;
    color: rgba(255, 255, 255, 0.6) !important;
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
}

#notebook-view .nb-pill:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    color: rgba(255, 255, 255, 0.8) !important;
}

#notebook-view .nb-pill.active {
    background: rgba(255, 123, 0, 0.15) !important;
    border-color: rgba(255, 123, 0, 0.3) !important;
    color: #ff7b00 !important;
}

/* Items List */
#notebook-view .nb-sidebar-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    overflow-y: auto !important;
    max-height: calc(100vh - 280px) !important;
}

#notebook-view .nb-loading,
#notebook-view .nb-empty {
    padding: 30px 20px !important;
    text-align: center !important;
    font-size: 0.8rem !important;
    color: rgba(255, 255, 255, 0.4) !important;
}

/* Individual Item */
#notebook-view .nb-sidebar-item {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 12px 14px !important;
    background: rgba(255, 255, 255, 0.025) !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    border-radius: 10px !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
}

#notebook-view .nb-sidebar-item:hover {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

#notebook-view .nb-sidebar-icon {
    width: 36px !important;
    height: 36px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(0, 162, 255, 0.12) !important;
    border-radius: 8px !important;
    color: #00a2ff !important;
    flex-shrink: 0 !important;
}

#notebook-view .nb-sidebar-icon svg {
    width: 16px !important;
    height: 16px !important;
}

#notebook-view .nb-sidebar-info {
    flex: 1 !important;
    min-width: 0 !important;
}

#notebook-view .nb-sidebar-title {
    font-size: 0.82rem !important;
    font-weight: 600 !important;
    color: rgba(255, 255, 255, 0.9) !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

#notebook-view .nb-sidebar-meta {
    font-size: 0.7rem !important;
    color: rgba(255, 255, 255, 0.4) !important;
    margin-top: 2px !important;
}

#notebook-view .nb-sidebar-delete {
    width: 24px !important;
    height: 24px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1rem !important;
    color: rgba(255, 255, 255, 0.3) !important;
    background: transparent !important;
    border: none !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    opacity: 0 !important;
    transition: all 0.15s ease !important;
}

#notebook-view .nb-sidebar-item:hover .nb-sidebar-delete {
    opacity: 1 !important;
}

#notebook-view .nb-sidebar-delete:hover {
    color: #ff5555 !important;
    background: rgba(255, 85, 85, 0.1) !important;
}

/* Hide the old floating notebook sidebar */
.notebook-sidebar {
    display: none !important;
}

.overlay .tool-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.12);
}

.overlay .tool-result {
    margin-top: 10px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    font-size: 0.7rem;
}

.overlay .tool-result .result-label {
    color: var(--text-hint);
}

.overlay .tool-result .result-value {
    color: var(--text-primary);
    font-weight: 600;
    margin-left: 6px;
}

/* Hide old external toolbox toggle and panel */
#toolbox-toggle-fixed {
    display: none !important;
}

#toolbox-panel {
    display: none !important;
}

/* ============================================
   TOOLBOX REDESIGN - Clean Modern Style
   ============================================ */

#tools-view-content .toolbox-content {
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
}

/* Tool Accordion Item - Card Style */
#tools-view-content .tool-accordion-item {
    background: rgba(255, 255, 255, 0.025) !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    transition: all 0.2s ease !important;
}

#tools-view-content .tool-accordion-item:hover {
    border-color: rgba(255, 255, 255, 0.1) !important;
    background: rgba(255, 255, 255, 0.035) !important;
}

/* Tool Header - Clean & Clickable */
#tools-view-content .tool-accordion-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 12px 14px !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
    background: transparent !important;
}

#tools-view-content .tool-accordion-header:hover {
    background: rgba(255, 255, 255, 0.03) !important;
}

#tools-view-content .tool-header-left {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
}

/* Tool Icon - Glowing Orange Accent */
#tools-view-content .tool-mini-icon {
    width: 32px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(255, 123, 0, 0.12) !important;
    border-radius: 8px !important;
    color: #ff7b00 !important;
}

#tools-view-content .tool-mini-icon svg {
    width: 16px !important;
    height: 16px !important;
}

/* Tool Title */
#tools-view-content .tool-header-left span {
    font-size: 0.82rem !important;
    font-weight: 600 !important;
    color: rgba(255, 255, 255, 0.9) !important;
    letter-spacing: 0.2px !important;
}

/* Chevron Arrow */
#tools-view-content .accordion-arrow {
    width: 16px !important;
    height: 16px !important;
    color: rgba(255, 255, 255, 0.4) !important;
    transition: transform 0.2s ease !important;
}

#tools-view-content .tool-accordion-item.collapsed .accordion-arrow {
    transform: rotate(-90deg) !important;
}

/* Tool Body - Form Container */
#tools-view-content .tool-accordion-body {
    max-height: 0;
    overflow: hidden;
    padding: 0 14px !important;
    border-top: none !important;
}

#tools-view-content .tool-accordion-item.expanded .tool-accordion-body {
    max-height: 1200px;
    padding: 0 14px 14px !important;
    border-top: 1px solid rgba(255, 255, 255, 0.04) !important;
}

#tools-view-content .tool-section-body {
    padding: 12px 0 0 !important;
}

/* Form Labels */
#tools-view-content .tool-option {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    margin-bottom: 12px !important;
}

#tools-view-content .tool-option > span:first-child {
    font-size: 0.7rem !important;
    font-weight: 500 !important;
    color: rgba(255, 255, 255, 0.5) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

/* Modern Inputs & Selects */
#tools-view-content .tool-input,
#tools-view-content select,
#tools-view-content input[type="text"],
#tools-view-content input[type="number"],
#tools-view-content textarea {
    width: 100% !important;
    padding: 10px 12px !important;
    font-size: 0.8rem !important;
    font-weight: 500 !important;
    color: rgba(255, 255, 255, 0.9) !important;
    background: rgba(0, 0, 0, 0.25) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 8px !important;
    outline: none !important;
    transition: all 0.15s ease !important;
}

#tools-view-content .tool-input:focus,
#tools-view-content select:focus,
#tools-view-content input:focus,
#tools-view-content textarea:focus {
    border-color: rgba(255, 123, 0, 0.5) !important;
    box-shadow: 0 0 0 3px rgba(255, 123, 0, 0.1) !important;
}

#tools-view-content select {
    cursor: pointer !important;
    appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.5)' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    padding-right: 36px !important;
}

/* Small Inputs Grid */
#tools-view-content .tool-option-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
    margin-bottom: 12px !important;
}

#tools-view-content .small-input {
    width: 100% !important;
}

/* Action Buttons */
#tools-view-content .tool-actions {
    display: flex !important;
    gap: 8px !important;
    margin-top: 4px !important;
}

#tools-view-content .tool-btn {
    flex: 1 !important;
    padding: 10px 14px !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    border: none !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
    text-transform: uppercase !important;
    letter-spacing: 0.3px !important;
}

#tools-view-content .tool-btn.primary {
    background: linear-gradient(135deg, #ff7b00, #ff9500) !important;
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(255, 123, 0, 0.3) !important;
}

#tools-view-content .tool-btn.primary:hover {
    background: linear-gradient(135deg, #ff8c1a, #ffa31a) !important;
    box-shadow: 0 4px 12px rgba(255, 123, 0, 0.4) !important;
    transform: translateY(-1px) !important;
}

#tools-view-content .tool-btn.secondary {
    background: rgba(255, 255, 255, 0.06) !important;
    color: rgba(255, 255, 255, 0.8) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

#tools-view-content .tool-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
}

#tools-view-content .tool-btn.mini {
    flex: 0 0 auto !important;
    height: auto !important;
    padding: 3px 8px !important;
    font-size: 0.6rem !important;
    font-weight: 500 !important;
}

/* Result Cards */
#tools-view-content .distance-result,
#tools-view-content .tool-result {
    margin-top: 12px !important;
    padding: 12px !important;
    background: rgba(255, 123, 0, 0.08) !important;
    border: 1px solid rgba(255, 123, 0, 0.2) !important;
    border-radius: 8px !important;
}

#tools-view-content .result-row {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 4px 0 !important;
}

#tools-view-content .result-label {
    font-size: 0.72rem !important;
    color: rgba(255, 255, 255, 0.5) !important;
}

#tools-view-content .result-value {
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    color: #ff7b00 !important;
}

/* Hint Text */
#tools-view-content .tool-hint {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 10px 12px !important;
    background: rgba(0, 162, 255, 0.08) !important;
    border: 1px solid rgba(0, 162, 255, 0.2) !important;
    border-radius: 8px !important;
    font-size: 0.75rem !important;
    color: rgba(255, 255, 255, 0.8) !important;
    margin-bottom: 12px !important;
}

/* Filter Chips inside Tools */
#tools-view-content .filter-chip {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    padding: 5px 10px !important;
    font-size: 0.68rem !important;
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
}

#tools-view-content .filter-chip:has(input:checked) {
    background: rgba(255, 123, 0, 0.15) !important;
    border-color: rgba(255, 123, 0, 0.3) !important;
    color: #ff7b00 !important;
}

#tools-view-content .filter-chip input {
    width: 12px !important;
    height: 12px !important;
    accent-color: #ff7b00 !important;
}

/* Collapsible Details (Operator Filter) */
#tools-view-content .filter-dropdown {
    margin-bottom: 12px !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    border-radius: 8px !important;
    overflow: hidden !important;
}

#tools-view-content .filter-dropdown-header {
    display: block !important;
    padding: 10px 12px !important;
    font-size: 0.72rem !important;
    font-weight: 600 !important;
    color: rgba(255, 255, 255, 0.7) !important;
    background: rgba(255, 255, 255, 0.02) !important;
    cursor: pointer !important;
    list-style: none !important;
}

#tools-view-content .filter-dropdown-header::-webkit-details-marker {
    display: none !important;
}

#tools-view-content .filter-dropdown-content {
    padding: 12px !important;
    background: rgba(0, 0, 0, 0.15) !important;
}

/* Range Slider */
#tools-view-content input[type="range"] {
    -webkit-appearance: none !important;
    height: 6px !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border-radius: 3px !important;
    cursor: pointer !important;
}

#tools-view-content input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none !important;
    width: 16px !important;
    height: 16px !important;
    background: #ff7b00 !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    box-shadow: 0 2px 6px rgba(255, 123, 0, 0.4) !important;
}

/* File Input Styling */
#tools-view-content input[type="file"] {
    padding: 8px !important;
    font-size: 0.72rem !important;
}

/* WKT Textarea */
#tools-view-content .wkt-textarea {
    font-family: 'Monaco', 'Consolas', monospace !important;
    font-size: 0.72rem !important;
    resize: vertical !important;
    min-height: 60px !important;
}

/* LSD Location Marker */
.lsd-marker {
    animation: lsd-drop 0.4s ease-out;
}

@keyframes lsd-drop {
    0% {
        transform: translateY(-20px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.lsd-marker:hover {
    transform: scale(1.1);
    transition: transform 0.15s ease;
}

/* ============================================
   NETBACK RESULTS DRAWER (like netback4.py)
   ============================================ */
.netback-drawer {
    position: fixed;
    bottom: 0;
    left: 380px;
    right: 0;
    background: #0b1220; /* SOLID - no transparency */
    border: 1px solid #334155;
    border-bottom: none;
    border-radius: 10px 10px 0 0;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    max-height: 44px;
    overflow: hidden;
    transition: max-height 0.25s ease;
}

.netback-drawer.open {
    max-height: 35vh;
}

.netback-drawer.hidden {
    display: none !important;
}

.netback-drawer-grip {
    height: 4px;
    background: #475569;
    border-radius: 10px 10px 0 0;
    cursor: ns-resize;
}

.netback-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    background: #0f172a; /* SOLID */
    cursor: pointer;
    border-bottom: 1px solid #1e293b;
}

.netback-drawer-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #f8fafc;
}

.netback-drawer-header h3 span {
    font-weight: 400;
    color: #64748b;
    margin-left: 6px;
    font-size: 12px;
}

.netback-drawer-meta {
    display: flex;
    gap: 12px;
    font-size: 11px;
    color: #64748b;
}

.netback-drawer-content {
    padding: 8px 12px;
    overflow-y: auto;
    max-height: calc(50vh - 44px);
    background: #0b1220; /* SOLID for scroll */
}

.netback-drawer-summary {
    background: #0d1f17; /* SOLID dark green */
    border: 1px solid #166534;
    border-radius: 6px;
    padding: 10px 12px;
    margin-bottom: 0; /* Remove gap */
}

.netback-drawer-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    background: #0b1220; /* Fill any gaps */
}

.netback-drawer-table th {
    text-align: left;
    padding: 6px 8px;
    background: #1e293b; /* SOLID */
    color: #94a3b8;
    font-weight: 600;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    position: sticky;
    top: 0;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    z-index: 1;
}

.netback-drawer-table th:hover {
    background: #334155;
    color: #f8fafc;
}

.netback-drawer-table th.sort-asc::after {
    content: ' ▲';
    font-size: 8px;
    color: #10b981;
}

.netback-drawer-table th.sort-desc::after {
    content: ' ▼';
    font-size: 8px;
    color: #10b981;
}

.netback-drawer-table td {
    padding: 7px 8px;
    border-bottom: 1px solid #1e293b;
    color: #e2e8f0;
    background: #0b1220; /* SOLID */
}

.netback-drawer-table tbody tr:hover td {
    background: #1e293b;
}

.netback-drawer-table tr.best-row td {
    background: #0d1f17;
    color: #10b981;
    font-weight: 600;
}

.netback-drawer-table .netback-positive {
    color: #10b981;
    font-weight: 600;
}

.netback-drawer-table .netback-negative {
    color: #ef4444;
}

/* Mobile: drawer takes full width */
@media (max-width: 768px) {
    .netback-drawer {
        left: 0;
    }
}

