/* Lease Production - dark theme, matches PHP/Dash layout */

:root {
    --bg-body: #111111;
    --bg-sidebar: #121212;
    --bg-input: #0f0f0f;
    --bg-lease: #151515;
    --bg-lease-hover: #222222;
    --bg-lease-active: #0b5a2a;
    /* Selected lease / well in sidebar lists and related chrome (high-contrast vs dark bg) */
    --bg-selection: #0d2840;
    --bg-selection-hover: #123a5a;
    --border-selection: #42a5f5;
    --border: #333333;
    --border-btn: #2b2b2b;
    --border-active: #1f6b3f;
    --text: #eeeeee;
    --text-muted: #dddddd;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background: var(--bg-body);
    color: var(--text);
    height: 100vh;
    overflow: hidden;
}

.layout {
    display: flex;
    height: 100vh;
    width: 100%;
}

.resize-handle {
    flex-shrink: 0;
    width: 6px;
    cursor: col-resize;
    background: var(--border);
    transition: background 0.15s;
}

.resize-handle:hover {
    background: var(--border-active);
}

.resize-handle.dragging {
    background: var(--border-active);
}

/* Sidebar */
.sidebar {
    flex: 0 0 360px;
    min-width: 36px;
    max-width: 520px;
    border-right: 1px solid var(--border);
    background: var(--bg-sidebar);
    display: flex;
    flex-direction: row;
    overflow: hidden;
    transition: flex 0.2s ease, min-width 0.2s ease;
    position: relative;
}

.sidebar.resizing {
    transition: none;
}

.sidebar.collapsed {
    flex: 0 0 36px;
    min-width: 36px;
}

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

.layout:has(.sidebar.collapsed) .resize-handle {
    display: none;
}

.sidebar:not(.collapsed) .sidebar-pin {
    top: 10px;
    right: 10px;
}

.sidebar.collapsed .sidebar-pin {
    top: 8px;
    right: auto;
    left: 50%;
    transform: translateX(-50%);
}

.sidebar-content {
    flex: 1;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-content.resizing {
    transition: none;
}

.sidebar-panel-filter {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.filter-panel-header {
    flex-shrink: 0;
    padding: 8px 10px 4px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

.sidebar-pin {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-input);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: top 0.2s, right 0.2s, left 0.2s, transform 0.2s;
}

.sidebar-pin:hover {
    background: var(--bg-lease-hover);
    color: var(--text);
}

.sidebar-pin.pinned {
    background: var(--bg-input);
    color: var(--text-muted);
}

.sidebar-panel-filter > .sidebar-header {
    flex: 1 1 0;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
}

.sidebar-header {
    padding: 10px 48px 10px 10px;
    border-bottom: 1px solid var(--border);
}

.region-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 10px;
}

.region-btn {
    padding: 9px 10px;
    border-radius: 10px;
    border: 1px solid var(--border-btn);
    background: var(--bg-input);
    color: var(--text-muted);
    cursor: pointer;
    font-weight: 700;
}

.region-btn.active {
    border-color: var(--border-active);
    background: var(--bg-lease-active);
    color: #fff;
}

.region-toggle-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.filter-input.is-disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* Data in flight — blue so it reads on dark UI (static; no animation). */
.filter-input.is-fetching {
    border-color: var(--border-selection);
    box-shadow: 0 0 0 2px rgba(66, 165, 245, 0.55);
    background: rgba(13, 55, 90, 0.45);
}

.accordion-filter .accordion-block {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 6px;
}

.accordion-section {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-input);
    overflow: hidden;
}

.accordion-section + .accordion-section {
    margin-top: 4px;
}

.accordion-section-head {
    display: flex;
    align-items: stretch;
    gap: 2px;
    background: var(--bg-lease);
    border-bottom: 1px solid var(--border);
}

.accordion-section-head .accordion-trigger {
    flex: 1;
    min-width: 0;
    border-radius: 0;
    border-bottom: none;
}

.filter-input-mode {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 2px;
    padding: 4px 6px 4px 2px;
}

.filter-input-mode-btn {
    width: 26px;
    height: 26px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-input);
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.filter-input-mode-btn:hover {
    color: var(--text);
    border-color: var(--border-active);
}

.filter-input-mode-btn.is-active {
    background: rgba(31, 107, 63, 0.35);
    border-color: var(--border-active);
    color: var(--text);
}

.geo-subdivision-root {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-sublabel {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    opacity: 0.9;
    margin: 4px 0 2px;
}

.accordion-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 10px;
    border: none;
    background: var(--bg-lease);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}

.accordion-trigger:hover {
    background: var(--bg-lease-hover);
    color: var(--text);
}

.accordion-chevron {
    display: inline-block;
    width: 1em;
    font-size: 10px;
    opacity: 0.85;
    transition: transform 0.15s;
}

.accordion-section.is-open .accordion-chevron {
    transform: rotate(90deg);
}

.accordion-section:not(.is-open) .accordion-chevron {
    transform: rotate(0deg);
}

.accordion-hint {
    font-weight: 400;
    opacity: 0.75;
    font-size: 11px;
}

.accordion-panel {
    padding: 8px 10px 10px;
    border-top: 1px solid var(--border);
}

.accordion-panel--tight {
    padding: 4px 8px 8px;
}

.accordion-panel[hidden] {
    display: none !important;
}

/* Single-select option rows (native radios; compact “pick one” list, no dropdowns) */
.accordion-choice-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.accordion-choice-list--dense {
    gap: 0;
    margin-top: 6px;
}

.operator-wrap + .accordion-choice-list--dense {
    margin-top: 0;
}

.accordion-choice-list--scroll {
    max-height: 200px;
    overflow-y: auto;
    padding-right: 2px;
}

.accordion-choice {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 5px 6px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    line-height: 1.25;
    color: var(--text);
}

.accordion-choice:hover {
    background: rgba(255, 255, 255, 0.04);
}

.accordion-choice input {
    flex-shrink: 0;
    margin: 0;
    accent-color: var(--border-active, #6b9bd6);
}

.accordion-choice-list.is-disabled {
    pointer-events: none;
    opacity: 0.45;
}

.accordion-extra-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.accordion-help--tight {
    margin: 4px 0 0;
}

.filter-label {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.filter-select-block {
    font-size: 13px;
}

.accordion-help {
    margin: 6px 0 0;
    font-size: 11px;
    opacity: 0.75;
    line-height: 1.35;
}

.filters-legacy-spacer {
    display: none;
}

.filter-input-with-clear {
    display: flex;
    align-items: stretch;
    gap: 6px;
    width: 100%;
}

.filter-input-with-clear .filter-input {
    flex: 1;
    min-width: 0;
    width: auto;
}

.btn-clear-filters {
    flex-shrink: 0;
    align-self: stretch;
    padding: 0 8px;
    min-width: 36px;
    border-radius: 8px;
    border: 1px solid var(--border-btn);
    background: var(--bg-input);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    font-weight: 600;
}

.btn-clear-filters:hover {
    border-color: var(--border-active);
    color: var(--text);
}

.sidebar-title {
    margin: 6px 0 10px;
    font-size: 14px;
    color: var(--text-muted);
}

.filters {
    display: grid;
    gap: 8px;
}

.filter-input,
.filter-select {
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text);
    width: 100%;
}

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

.operator-wrap {
    position: relative;
}

.operator-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.operator-input-row .filter-input {
    flex: 1;
    min-width: 0;
}

.filter-loading-indicator {
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 700;
    color: #8ec5ff;
    white-space: nowrap;
}

/* Suggestions flow inline below the operator input so the enclosing
   accordion section (overflow:hidden) doesn't clip them. */
.suggestions {
    margin-top: 4px;
    max-height: 220px;
    overflow-y: auto;
    background: var(--bg-lease);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.suggestions:empty {
    display: none;
}

.suggestions button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 6px 10px;
    border: none;
    border-bottom: 1px solid var(--border);
    background: var(--bg-lease);
    color: var(--text);
    cursor: pointer;
    font-size: 11px;
}

.suggestions button:last-child {
    border-bottom: none;
}

.suggestions button:hover {
    background: var(--bg-lease-hover);
}

/* Selected lease(s) — checkbox to keep or clear from map selection */
.lease-selected-filter {
    margin-bottom: 8px;
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-lease);
}

/* Cap lease list at ~10 rows; scrollbar for the rest (operator strip uses same class, no cap). */
#lease-selected-filter {
    height: min(46vh, 420px);
    min-height: 220px;
    max-height: min(46vh, 420px);
    display: grid;
    grid-template-rows: minmax(72px, 1fr) 1px minmax(120px, 1fr);
    row-gap: 8px;
    overflow-y: hidden;
    overflow-x: hidden;
    box-sizing: border-box;
}

.lease-selected-filter[hidden] {
    display: none !important;
}

.well-selected-filter {
    margin-bottom: 8px;
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-lease);
}

#well-selected-filter {
    height: min(40vh, 360px);
    min-height: 180px;
    max-height: min(40vh, 360px);
    display: grid;
    grid-template-rows: minmax(72px, 1fr) 1px minmax(96px, 1fr);
    row-gap: 8px;
    overflow-y: hidden;
    overflow-x: hidden;
    box-sizing: border-box;
}

.well-selected-filter[hidden] {
    display: none !important;
}

.well-selected-section {
    display: block;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.well-selected-empty {
    font-size: 12px;
    color: var(--text-muted);
    padding: 3px 2px;
}

.lease-selected-controls {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

.lease-selected-toggle-all {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    user-select: none;
}

.lease-selected-toggle-all input[type="checkbox"] {
    cursor: pointer;
}

.lease-selected-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    margin: 2px 0;
    font-size: 12px;
    user-select: none;
    min-height: 1.35em;
}

.lease-selected-row input[type="checkbox"] {
    flex-shrink: 0;
    cursor: pointer;
}

.lease-selected-label {
    flex: 1;
    min-width: 0;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.lease-selected-label:hover {
    text-decoration: underline;
}

.lease-zoom-wells-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 4px;
    margin: 0;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    opacity: 0.8;
}

.lease-zoom-wells-btn:hover {
    opacity: 1;
    color: var(--text);
    background: var(--bg-lease-hover);
}

.lease-selected-row--prod-focus .lease-zoom-wells-btn {
    color: rgba(255, 255, 255, 0.88);
}

.lease-selected-row--prod-focus .lease-zoom-wells-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

.lease-selected-remove {
    flex-shrink: 0;
    align-self: center;
    padding: 0 4px;
    border: none;
    background: transparent;
    color: #ffffff;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.2;
    opacity: 0.9;
}

.lease-selected-remove:hover {
    opacity: 1;
    color: #ffffff;
}

/* Scrollable lease / well result lists inside filter accordions */
.filter-results-list {
    margin-top: 8px;
    max-height: min(38vh, 280px);
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    padding: 4px 0 2px;
}

.lease-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    min-height: 0;
}

.lease-item {
    display: block;
    width: 100%;
    padding: 4px 10px;
    margin-bottom: 2px;
    cursor: pointer;
    border-radius: 8px;
    text-align: left;
    border: none;
    background: var(--bg-lease);
    color: var(--text);
}

.lease-item:hover {
    background: var(--bg-lease-hover);
}

.lease-item.active {
    background: var(--bg-selection);
    color: #fff;
    box-shadow: none;
}

.lease-item.active:hover {
    background: var(--bg-selection-hover);
}

.lease-item.prod-focus {
    background: var(--bg-selection);
    color: #fff;
    box-shadow: none;
}

.lease-selected-row--selected {
    background: transparent;
    border-radius: 6px;
    margin-left: -4px;
    margin-right: -4px;
    padding-left: 4px;
    padding-right: 4px;
}

.lease-selected-row--prod-focus {
    background: var(--bg-selection);
    color: #fff;
    box-shadow: none;
}

.lease-selected-section {
    display: block;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.lease-selected-section--top,
.lease-selected-section--bottom {
    max-height: none;
    min-height: 0;
}

.lease-selected-section-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.lease-selected-separator {
    height: 1px;
    margin: 0;
    background: var(--border);
}

.lease-selected-empty {
    font-size: 12px;
    color: var(--text-muted);
    padding: 3px 2px;
}

.lease-prod-focus-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid var(--border);
}

.lease-prod-focus-all {
    background: none;
    border: none;
    color: #8bc34a;
    cursor: pointer;
    padding: 0;
    font-size: inherit;
    text-decoration: underline;
}

.lease-prod-focus-all:hover {
    color: #aed581;
}

/* Marker wrap is content-sized (no fixed hit box). Nothing to clip; keep default overflow. */
.lease-marker--no-dot {
    pointer-events: auto;
}

/* Lease name on map, rendered inside #lease-label-overlay (pure HTML overlay
   whose transform is set by JS every map 'move'/'zoom' event). One line only;
   the label's bottom-center lands at its projected lng/lat − LEASE_LABEL_OFFSET_PX. */
#lease-label-overlay {
    /* Spans the map container; only individual labels receive pointer events. */
    pointer-events: none;
}

.lease-label-text {
    white-space: nowrap;
    text-align: center;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    text-shadow: 0 0 2px #000, 0 0 4px #000, 1px 1px 2px #000;
    padding: 2px 4px;
    border-radius: 3px;
    cursor: pointer;
    user-select: none;
}

.lease-label-text:hover {
    background: rgba(0, 0, 0, 0.35);
}

/* Lease whose production is chart-focused (matches sidebar “Chart: …” drill) */
.lease-label-text--chart-focus {
    color: #ffe082;
    font-size: 12px;
    font-weight: 700;
    text-shadow: 0 0 3px #000, 0 0 8px #e65100, 1px 1px 2px #000;
}

.well-item {
    display: block;
    width: 100%;
    padding: 4px 10px;
    margin-bottom: 2px;
    cursor: pointer;
    border-radius: 8px;
    text-align: left;
    border: none;
    background: var(--bg-lease);
    color: var(--text);
}

.well-item:hover {
    background: var(--bg-lease-hover);
}

.well-item.active {
    background: var(--bg-selection);
    color: #fff;
    box-shadow: inset 0 0 0 1px var(--border-selection);
}

.well-item.active:hover {
    background: var(--bg-selection-hover);
}

/* Lease wells unchecked in sidebar filter — still on map but de-emphasized until rechecked */
.well-marker--pane-excluded {
    opacity: 0.42;
    filter: grayscale(0.92);
    pointer-events: auto;
}

.lease-item-line {
    font-size: 12px;
    font-weight: 500;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.status-bar {
    font-size: 12px;
    opacity: 0.85;
    padding: 8px 10px;
    border-top: 1px solid var(--border);
    background: var(--bg-sidebar);
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

#well-tile-zoom {
    opacity: 0.9;
    white-space: nowrap;
}

.sidebar-map-settings {
    padding: 6px 10px 8px 10px;
    border-top: 1px solid var(--border);
    background: var(--bg-sidebar);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.sidebar-toggle {
    cursor: pointer;
    user-select: none;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.sidebar-toggle input[type="checkbox"] {
    margin: 0;
}

.sidebar-toggle.disabled-hint {
    opacity: 0.75;
}

/* Main */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--bg-body);
    padding: 14px;
    overflow: auto;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.operators-box {
    flex: 1;
    min-width: 320px;
    height: 52px;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.operators-box .lease-info {
    width: 100%;
    text-align: left;
    background: var(--bg-lease);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.operators-box .lease-info button {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text);
    padding: 10px 12px;
    cursor: pointer;
}

.operators-box .lease-info .lease-title {
    font-size: 13px;
    font-weight: 700;
}

.operators-box .lease-info .operators-desc {
    font-size: 12px;
    opacity: 0.85;
}

.controls {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-left: auto;
}

.btn-clear {
    padding: 8px 10px;
    border: 1px solid #444;
    background: #1a1a1a;
    color: var(--text);
    border-radius: 8px;
    cursor: pointer;
}

.selected-count {
    font-size: 13px;
}

.content-row {
    flex: 1;
    display: flex;
    flex-direction: row;
    min-height: 400px;
    overflow: hidden;
}

.map-wrap {
    flex: 0 0 55%;
    min-width: 300px;
    padding: 6px;
    position: relative;
}

.map-wrap.resizing {
    transition: none;
}

.map-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 5000;
    display: flex;
    gap: 6px;
}

/* Keep MapLibre controls/legend above all map markers. */
.maplibregl-ctrl-top-left,
.maplibregl-ctrl-top-right,
.maplibregl-ctrl-bottom-left,
.maplibregl-ctrl-bottom-right {
    z-index: 5000;
}

.map-control-btn {
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: #000;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
}

.map-control-btn.map-base-btn {
    font-size: 12px;
    font-weight: 600;
    padding: 6px 8px;
    white-space: nowrap;
}

#btn-drag {
    font-size: 18px;
    line-height: 1;
}

#btn-drag.active {
    color: #fff;
}

.map-control-btn:hover {
    color: var(--text);
}

.map-control-btn.active {
    border-color: var(--border-active);
    color: var(--text);
}

#map {
    height: 100%;
    min-height: 400px;
    width: 100%;
    background: #000;
    border-radius: 8px;
}

.well-label {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: #fff !important;
    font-weight: 600;
    padding: 0 2px;
    margin-top: 0 !important;
    text-shadow: 0 0 2px #000, 0 1px 3px rgba(0,0,0,0.8);
}

.well-label::before {
    display: none;
}

.chart-wrap {
    flex: 1;
    min-width: 280px;
    padding: 6px;
    display: flex;
    flex-direction: column;
}

.lease-plotting-caption {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
    line-height: 1.35;
    min-height: 1.35em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lease-plotting-caption[hidden] {
    display: none !important;
}

.chart-controls {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 12px;
    min-height: 32px;
}

.well-nav-wrap {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.nav-well-btn {
    min-width: 32px;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
}

.nav-well-btn:hover:not(:disabled) {
    border-color: var(--border-active);
    color: var(--text);
}

.nav-well-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.log-scale-label {
    cursor: pointer;
    user-select: none;
    font-size: 13px;
    color: var(--text);
}

.chart-row {
    display: flex;
    flex: 1 1 0;
    min-height: 400px;
    align-items: stretch;
    overflow: hidden;
}

.y-axis-label-wrap {
    flex: 0 0 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
}

.y-axis-label {
    transform: rotate(-90deg);
    white-space: nowrap;
    font-size: 12px;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    pointer-events: none;
}

.y-axis-label span {
    margin-right: 0.4em;
}

.chart-container {
    flex: 1;
    min-height: 400px;
    position: relative;
}

#prod-chart {
    width: 100% !important;
    height: 100% !important;
}

.chart-cursor-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #FFC107;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 10;
}

.chart-container.has-data {
    cursor: col-resize;
}

.chart-container.has-data .chart-cursor-line {
    pointer-events: auto;
}

.chart-container.has-data:hover .chart-cursor-line,
.chart-container.has-data.dragging .chart-cursor-line {
    opacity: 1;
}

.chart-month-rates {
    flex: 0 0 90px;
    height: 90px;
    margin-top: 8px;
    padding: 6px 10px;
    background: var(--bg-lease);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 11px;
    overflow-y: auto;
}

.chart-month-rates .rates-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px 16px;
}

.chart-month-rates .rates-title {
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.chart-month-rates .rate-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.chart-month-rates .rate-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.chart-month-rates .rate-value {
    font-variant-numeric: tabular-nums;
}

/* Well status legend on map */
.well-legend {
    padding: 8px 10px;
    background: var(--bg-lease);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 11px;
    color: var(--text);
}

.well-legend-title {
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.well-legend-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
}

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

/* Well status icons (from WELL_STATUS_MASTER) */
.well-status-marker {
    background: none !important;
    border: none !important;
}

.well-status-marker .well-status-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.well-status-marker .well-status-circle {
    position: relative;
    border-radius: 50%;
}

.well-status-marker .well-status-arrow-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.well-status-marker .well-status-arrow-wrap svg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* MapLibre popup overrides for dark theme */
.maplibregl-popup-content {
    background: var(--bg-lease);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 12px;
}

.maplibregl-popup-tip {
    border-top-color: var(--bg-lease) !important;
    border-bottom-color: var(--bg-lease) !important;
    border-left-color: var(--bg-lease) !important;
    border-right-color: var(--bg-lease) !important;
}

.maplibregl-popup-close-button {
    color: var(--text-muted);
    font-size: 16px;
    padding: 2px 6px;
}

/* Permanent HTML label child of a DOM well marker (replaces Leaflet tooltips) */
.well-label-text {
    position: absolute;
    left: 50%;
    transform: translate(-50%, calc(-100% - 4px));
    top: 0;
    white-space: nowrap;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    text-shadow: 0 0 2px #000, 0 0 4px #000, 1px 1px 2px #000;
    pointer-events: none;
    user-select: none;
}

/* Box-select rectangle (drawn as a MapLibre GeoJSON fill+line layer, but keep the
   cursor hint on the container during drag) */
.map-wrap.box-select-dragging {
    cursor: crosshair;
}
