/* CCTV Map Point — Field Ops Console (dark)
   Thesis: dark field-ops workspace; map leads; dense quiet tool rail; live status. */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=IBM+Plex+Sans+Thai:wght@400;500;600;700&family=IBM+Plex+Sans:wght@400;500;600;700&display=swap');

:root {
    --canvas: #161a22;
    --surface: #1e2430;
    --surface-2: #262d3b;
    --surface-3: #303849;
    --border: #3d4758;
    --border-strong: #505c70;
    --text: #eef2f8;
    --text-muted: #9aa5b8;
    --text-dim: #6d788c;
    --accent: #3db8e8;
    --accent-hover: #2aa0ce;
    --accent-muted: rgba(61, 184, 232, 0.14);
    --success: #3dba7a;
    --success-muted: rgba(61, 186, 122, 0.16);
    --warning: #e0a84a;
    --warning-muted: rgba(224, 168, 74, 0.16);
    --danger: #e25555;
    --danger-muted: rgba(226, 85, 85, 0.16);
    --info: #4a9fd8;
    --focus-ring: 0 0 0 2px var(--canvas), 0 0 0 4px var(--accent);
    --radius: 3px;
    --radius-sm: 2px;
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --font: 'IBM Plex Sans Thai', 'IBM Plex Sans', sans-serif;
    --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
    --shadow-panel: 0 1px 0 rgba(255, 255, 255, 0.03) inset;
    --motion: 140ms ease;
    --sidebar-width: 340px;
}

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

body {
    font-family: var(--font);
    overflow: hidden;
    background: var(--canvas);
    color: var(--text);
    font-size: 14px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}

code {
    font-family: var(--font-mono);
    font-size: 0.92em;
    background: var(--surface-3);
    padding: 1px 5px;
    border-radius: var(--radius-sm);
    color: var(--accent);
}

.container {
    display: flex;
    height: 100vh;
    background: var(--canvas);
}

/* ——— Sidebar ——— */
.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: var(--space-4);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    box-shadow: var(--shadow-panel);
}

.sidebar-header h1 {
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--text);
    margin-bottom: var(--space-3);
    line-height: 1.25;
}

.sidebar-eyebrow {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    font-family: var(--font-mono);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-eyebrow::before {
    content: '';
    width: 7px;
    height: 7px;
    background: var(--accent);
    flex-shrink: 0;
}

.sidebar-header h1::after {
    content: '';
    display: block;
    width: 28px;
    height: 2px;
    background: var(--accent);
    margin-top: var(--space-2);
}

.btn-compact {
    margin-bottom: var(--space-2);
}

.field-label {
    display: block;
    margin-bottom: 5px;
    font-size: 12px;
    color: var(--text-muted);
}

.inline-row {
    display: flex;
    gap: 6px;
    align-items: center;
}

.color-input-sm {
    width: 60px;
    height: 35px;
    margin-bottom: 0;
}

.btn-grow {
    flex: 1;
}

.action-group {
    margin-bottom: var(--space-3);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--border);
}

.action-group:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.action-group-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: var(--space-2);
    font-family: var(--font-mono);
}

.action-group .btn {
    margin-bottom: 6px;
}

.action-group .btn:last-child {
    margin-bottom: 0;
}

.btn-quiet {
    background: transparent;
    color: var(--text-muted);
    border-color: var(--border);
    font-size: 12px;
    padding: 7px 10px;
}

.btn-quiet:hover:not(:disabled) {
    background: var(--surface-3);
    color: var(--text);
    border-color: var(--border-strong);
}

.btn-quiet:disabled {
    opacity: 0.45;
}

.save-status-indicator {
    font-size: 11px;
    font-family: var(--font-mono);
    padding: 5px 8px;
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-1);
    text-align: left;
    min-height: 24px;
    display: flex;
    align-items: center;
    border: 1px solid transparent;
}

.save-status-indicator.saving {
    background: var(--warning-muted);
    color: var(--warning);
    border-color: rgba(224, 168, 74, 0.35);
}

.save-status-indicator.saved {
    background: var(--success-muted);
    color: var(--success);
    border-color: rgba(61, 186, 122, 0.35);
}

.save-status-indicator.error {
    background: var(--danger-muted);
    color: var(--danger);
    border-color: rgba(226, 85, 85, 0.35);
}

.firebase-status {
    font-size: 11px;
    font-family: var(--font-mono);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-2);
    min-height: 20px;
    border: 1px solid transparent;
}

.firebase-status.connected {
    background: var(--success-muted);
    color: var(--success);
    border-color: rgba(61, 186, 122, 0.35);
}

.firebase-status.disconnected {
    background: var(--surface-3);
    color: var(--text-muted);
    border-color: var(--border);
}

.project-section,
.group-section,
.info-section,
.fiber-optic-section,
.action-section {
    background: var(--surface-2);
    padding: var(--space-3);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: none;
}

.fiber-optic-section h3,
.project-section h3,
.group-section h3,
.info-section h3,
.action-section h3 {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: var(--space-3);
    border-bottom: 1px solid var(--border);
    padding-bottom: var(--space-2);
}

.fiber-optic-row {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.fiber-optic-row .text-input {
    flex: 1;
    min-width: 80px;
}

.fiber-optic-unit {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    font-family: var(--font-mono);
}

.fiber-optic-view-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.fiber-optic-view-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    font-family: var(--font-mono);
}

/* ——— Buttons ——— */
.btn {
    padding: 9px 12px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    font-family: var(--font);
    transition: background var(--motion), border-color var(--motion), color var(--motion);
    width: 100%;
    margin-bottom: var(--space-2);
    line-height: 1.3;
}

.btn:hover {
    transform: none;
    box-shadow: none;
}

.btn:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

.btn-primary {
    background: var(--accent);
    color: #061018;
    border-color: var(--accent);
}

.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.btn-secondary {
    background: var(--surface-3);
    color: var(--text);
    border-color: var(--border-strong);
}

.btn-secondary:hover {
    background: #3a4556;
    border-color: var(--border-strong);
}

.btn-info {
    background: transparent;
    color: var(--info);
    border-color: rgba(74, 159, 216, 0.45);
}

.btn-info:hover {
    background: rgba(74, 159, 216, 0.12);
    color: var(--info);
}

.btn-warning {
    background: var(--warning-muted);
    color: var(--warning);
    border-color: rgba(224, 168, 74, 0.4);
}

.btn-warning:hover {
    background: rgba(224, 168, 74, 0.25);
    color: var(--warning);
}

.btn-success {
    background: transparent;
    color: var(--success);
    border-color: rgba(61, 186, 122, 0.45);
}

.btn-success:hover {
    background: var(--success-muted);
}

.btn-danger {
    background: transparent;
    color: var(--danger);
    border-color: rgba(226, 85, 85, 0.4);
}

.btn-danger:hover {
    background: var(--danger-muted);
}

.btn-small {
    padding: 6px 10px;
    font-size: 12px;
    margin-top: 4px;
}

.btn:disabled {
    background: var(--surface-3);
    color: var(--text-dim);
    border-color: var(--border);
    cursor: not-allowed;
    opacity: 0.65;
}

.select-input,
.text-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    font-family: var(--font);
    margin-bottom: var(--space-2);
    background: var(--canvas);
    color: var(--text);
    transition: border-color var(--motion);
}

.select-input:hover,
.text-input:hover {
    border-color: var(--border-strong);
}

.select-input:focus,
.text-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent-muted);
}

.select-input option {
    background: var(--surface);
    color: var(--text);
}

.color-input {
    width: 100%;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    margin-bottom: var(--space-2);
    background: var(--canvas);
    padding: 2px;
}

.group-controls {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
}

.group-controls .text-input {
    width: 100%;
    margin-bottom: 0;
    min-width: 0;
}

.group-controls-row {
    display: flex;
    gap: 6px;
}

.group-controls .color-input {
    width: 72px;
    min-width: 72px;
    margin-bottom: 0;
    flex-shrink: 0;
}

.group-controls .btn-small {
    margin-bottom: 0;
    margin-top: 0;
    white-space: nowrap;
    flex-shrink: 0;
    width: auto;
    padding: 8px 12px;
    flex: 0 0 auto;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--space-2);
    padding: 7px 0;
    border-bottom: 1px solid var(--border);
}

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

.info-item span:first-child {
    font-weight: 500;
    font-size: 12px;
    color: var(--text-muted);
}

.info-item span:last-child {
    color: var(--text);
    font-weight: 600;
    font-family: var(--font-mono);
    font-size: 13px;
}

.group-name-view-row {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-end;
    flex-wrap: wrap;
    max-width: 65%;
    text-align: right;
}

.group-name-view-row #currentGroup {
    color: var(--text);
    font-weight: 600;
    word-break: break-word;
    font-family: var(--font);
}

.group-name-edit-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: -4px 0 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.group-name-edit-row .text-input {
    flex: 1;
    min-width: 0;
    width: 100%;
}

.instructions {
    font-size: 12px;
    background: transparent;
    padding: var(--space-2) 0 0;
    border: none;
    border-top: 1px solid var(--border);
    border-radius: 0;
}

.instructions summary {
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    list-style: none;
    padding: var(--space-2) 0;
}

.instructions summary::-webkit-details-marker {
    display: none;
}

.instructions summary::before {
    content: '+ ';
    font-family: var(--font-mono);
    color: var(--accent);
}

.instructions[open] summary::before {
    content: '− ';
}

.instructions ol,
.instructions ul {
    margin: 8px 0 0 18px;
    line-height: 1.65;
    color: var(--text-muted);
}

.instructions h4 {
    margin: 14px 0 6px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.instructions strong {
    color: var(--text);
}

/* ——— Map ——— */
.map-container {
    flex: 1;
    position: relative;
    min-width: 0;
    background: #1a1f28;
}

#map {
    width: 100%;
    height: 100%;
}

.restore-sidebar-btn {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 1000;
    padding: 8px 14px;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    font-family: var(--font);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
    transition: background var(--motion), border-color var(--motion);
}

.restore-sidebar-btn:hover {
    background: var(--surface-3);
    border-color: var(--accent);
    transform: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
}

.map-controls {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 1000;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.map-container .leaflet-top.leaflet-left {
    top: 54px;
}

.map-container .leaflet-control {
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4) !important;
}

.map-container .leaflet-bar a {
    background: var(--surface) !important;
    color: var(--text) !important;
    border-bottom-color: var(--border) !important;
}

.map-container .leaflet-bar a:hover {
    background: var(--surface-3) !important;
}

.search-box {
    display: flex;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

.search-input {
    flex: 1;
    padding: 9px 12px;
    border: none;
    outline: none;
    font-size: 13px;
    font-family: var(--font);
    min-width: 280px;
    background: transparent;
    color: var(--text);
}

.search-input::placeholder {
    color: var(--text-dim);
}

.search-btn {
    background: var(--surface-3);
    color: var(--text);
    border: none;
    border-left: 1px solid var(--border);
    padding: 9px 12px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font);
    transition: background var(--motion), color var(--motion);
}

.search-btn:hover {
    background: var(--accent);
    color: #061018;
}

.map-layer-control {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

.layer-select {
    padding: 9px 12px;
    border: none;
    outline: none;
    font-size: 12px;
    color: var(--text);
    font-weight: 500;
    font-family: var(--font);
    background: var(--surface);
    cursor: pointer;
    width: 100%;
}

.layer-select:hover {
    background: var(--surface-3);
}

.layer-select option {
    background: var(--surface);
    color: var(--text);
}

.poi-toggle-control,
.coordinate-labels-toggle-control {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

.toggle-poi-btn {
    padding: 0 8px;
    border: none;
    outline: none;
    background: var(--surface);
    cursor: pointer;
    min-width: 40px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--motion);
    border-radius: var(--radius);
    color: var(--text);
}

.toggle-poi-btn:hover {
    background: var(--surface-3);
}

.toggle-poi-btn span {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    font-family: var(--font-mono);
    line-height: 1;
    color: var(--text-muted);
}

.toggle-poi-btn.is-active span {
    color: var(--accent);
}

.coordinate-label-tooltip {
    font-size: 13px !important;
    font-family: var(--font-mono) !important;
    padding: 4px 10px !important;
    background: rgba(30, 36, 48, 0.95) !important;
    border: 1px solid var(--accent) !important;
    border-radius: var(--radius) !important;
    color: var(--text) !important;
    white-space: normal !important;
    line-height: 1.35 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4) !important;
    pointer-events: none !important;
}

.pegman {
    position: absolute;
    bottom: 14px;
    right: 14px;
    z-index: 1000;
    width: 40px;
    height: 40px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    user-select: none;
    transition: border-color var(--motion), box-shadow var(--motion);
}

.pegman:active {
    cursor: grabbing;
}

.pegman:hover {
    border-color: var(--accent);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.5);
}

.pegman-icon {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    font-family: var(--font-mono);
    color: var(--text-muted);
    line-height: 1;
    pointer-events: none;
}

.mode-indicator {
    background: var(--surface);
    padding: 8px 12px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    max-width: 280px;
}

/* ——— Dialogs ——— */
.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(12, 14, 20, 0.62);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(2px);
}

.dialog {
    background: var(--surface);
    padding: var(--space-5);
    border-radius: var(--radius);
    border: 1px solid var(--border-strong);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
    min-width: 300px;
    max-width: 90%;
}

.dialog h3 {
    margin-bottom: var(--space-3);
    color: var(--text);
    font-size: 1.05rem;
    font-weight: 600;
}

.dialog p {
    margin-bottom: var(--space-3);
    color: var(--text-muted);
}

.dialog-buttons {
    display: flex;
    gap: 8px;
    margin-top: var(--space-4);
}

.dialog-buttons .btn {
    flex: 1;
    margin-bottom: 0;
}

.point-images-dialog {
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
}

.point-images-dialog .dialog-camera-count {
    font-size: 13px;
    color: var(--accent);
    font-weight: 600;
    font-family: var(--font-mono);
    margin: 0 0 8px 0;
}

.point-images-dialog .point-images-firebase-status {
    font-size: 12px;
    margin: 0 0 10px 0;
    line-height: 1.45;
    padding: 8px 10px;
    border-radius: var(--radius);
    background: var(--accent-muted);
    color: var(--accent);
    border: 1px solid rgba(61, 184, 232, 0.3);
}

.point-images-dialog .dialog-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.point-images-section {
    margin-bottom: 16px;
}

.point-images-section h4 {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.camera-view-upload-row {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.camera-view-upload-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0 0 8px 0;
    line-height: 1.4;
}

.camera-view-upload-progress-wrap {
    display: none;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    width: 100%;
    box-sizing: border-box;
}

.camera-view-upload-progress-track {
    flex: 1;
    min-width: 0;
    height: 4px;
    background: var(--surface-3);
    border-radius: 1px;
    overflow: hidden;
}

.camera-view-upload-progress-fill {
    height: 100%;
    width: 0%;
    background: var(--accent);
    border-radius: 1px;
}

.camera-view-upload-progress-text {
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    min-width: 38px;
    text-align: right;
}

.image-slots {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.image-slot {
    width: 100px;
    height: 80px;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--canvas);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.image-slot.has-image {
    border-style: solid;
    border-color: var(--accent);
}

.image-slot img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
}

.image-slot .slot-placeholder {
    font-size: 11px;
    color: var(--text-dim);
    text-align: center;
    padding: 4px;
}

.image-slot .slot-actions {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    gap: 2px;
    padding: 2px;
    background: rgba(0, 0, 0, 0.65);
}

.image-slot .slot-actions button {
    flex: 1;
    padding: 2px 4px;
    font-size: 10px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: var(--accent);
    color: #061018;
}

.image-slot .slot-actions button.remove-btn {
    background: var(--danger);
    color: #fff;
}

.image-slot input[type="file"] {
    display: none;
}

.image-slot.paste-target {
    border-color: var(--success);
    border-width: 2px;
    box-shadow: 0 0 0 2px var(--success-muted);
}

.image-slot.paste-target .slot-placeholder {
    color: var(--success);
}

.image-slot:focus {
    outline: none;
}

.image-slot:focus.paste-target {
    box-shadow: 0 0 0 3px var(--success-muted);
}

.point-images-dialog:focus {
    outline: none;
}

.export-pptx-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(12, 14, 20, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
}

.export-pptx-overlay-box {
    background: var(--surface);
    padding: 24px 32px;
    border-radius: var(--radius);
    border: 1px solid var(--border-strong);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
    min-width: 280px;
}

.export-pptx-overlay-box h3 {
    margin: 0 0 14px 0;
    font-size: 16px;
    color: var(--text);
}

.export-pptx-progress-bar {
    height: 4px;
    background: var(--surface-3);
    border-radius: 1px;
    overflow: hidden;
    margin-bottom: 10px;
}

.export-pptx-progress-fill {
    height: 100%;
    width: 0%;
    background: var(--success);
    border-radius: 1px;
    transition: width 0.2s ease;
}

.export-pptx-progress-text {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    font-family: var(--font-mono);
    color: var(--success);
    text-align: center;
}

.point-images-paste-input {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.leaflet-marker-icon.ppt-export-red-arrow {
    background: none !important;
    border: none !important;
}

.custom-marker {
    background: var(--surface);
    border: 2px solid;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--text);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

.marker-color-picker-panel {
    position: absolute;
    z-index: 2100;
    width: 190px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.marker-color-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    cursor: move;
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
}

.marker-color-picker-close {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    line-height: 1;
    padding: 2px 4px;
    border-radius: var(--radius-sm);
}

.marker-color-picker-close:hover {
    background: var(--surface-3);
    color: var(--text);
}

.marker-color-picker-body {
    padding: 10px;
}

.marker-color-picker-input {
    width: 100%;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    margin-bottom: 8px;
    background: var(--canvas);
}

.marker-color-hue-slider {
    width: 100%;
    margin-bottom: 10px;
    appearance: none;
    height: 10px;
    border-radius: 2px;
    border: 1px solid var(--border);
    background: linear-gradient(
        90deg,
        #ff0000 0%,
        #ffff00 17%,
        #00ff00 33%,
        #00ffff 50%,
        #0000ff 67%,
        #ff00ff 83%,
        #ff0000 100%
    );
    cursor: pointer;
}

.marker-color-hue-slider::-webkit-slider-thumb {
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid var(--text);
    background: var(--canvas);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
}

.marker-color-hue-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid var(--text);
    background: var(--canvas);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
}

.marker-color-picker-actions .btn {
    margin-bottom: 0;
}

.marker-color-picker-actions {
    display: flex;
    gap: 6px;
}

.marker-color-picker-actions .btn {
    flex: 1;
}

.marker-color-preview-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 12px;
    color: var(--text-muted);
}

.marker-color-preview-chip {
    width: 26px;
    height: 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
}

/* Leaflet popup — match Field Ops */
.map-container .leaflet-popup-content-wrapper {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    font-family: var(--font);
}

.map-container .leaflet-popup-tip {
    background: var(--surface);
    border: none;
}

.map-container .leaflet-popup-content {
    margin: 10px 12px;
    font-size: 12px;
    line-height: 1.45;
    color: var(--text);
}

.map-container .leaflet-popup-content strong {
    font-size: 13px;
    color: var(--text);
}

.map-container .leaflet-container a.leaflet-popup-close-button {
    color: var(--text-muted);
}

.map-popup-meta {
    color: var(--text-muted);
    font-size: 11px;
    margin: 4px 0 2px;
}

.map-popup-coords {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
}

.map-popup-note {
    color: var(--accent);
    font-size: 11px;
    display: block;
    margin: 4px 0;
}

.map-popup-actions {
    margin-top: 8px;
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.map-popup-btn {
    flex: 1;
    min-width: 64px;
    padding: 5px 8px;
    background: var(--surface-3);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 11px;
    font-family: var(--font);
    font-weight: 500;
}

.map-popup-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.map-popup-btn.is-danger {
    color: var(--danger);
    border-color: rgba(226, 85, 85, 0.35);
}

.map-popup-btn.is-danger:hover {
    background: var(--danger-muted);
}

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

.sidebar::-webkit-scrollbar-track {
    background: var(--surface);
}

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

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--text-dim);
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        max-height: 42vh;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .search-input {
        min-width: 160px;
    }

    .mode-indicator {
        max-width: 100%;
    }
}
