:root {
    --neon-orange: #FF6B35;
    --neon-aqua: #00F5FF;
    --neon-blue: #45B7D1;
    --neon-green: #96CEB4;
    --cyber-purple: #8A2BE2;
    --dark-space: #0A0A0F;
    --deep-space: #1A1A2E;
    --void: #000000;
    --matrix: #00FF41;
    --hologram: rgba(255, 255, 255, 0.1);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 107, 53, 0.3);
    --text-muted: rgba(255, 255, 255, 0.65);
}

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

body {
    font-family: 'Exo 2', sans-serif;
    background: var(--dark-space);
    color: #fff;
    min-height: 100vh;
    background-image:
        radial-gradient(circle at 20% 80%, rgba(255, 107, 53, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(0, 245, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(138, 43, 226, 0.05) 0%, transparent 50%);
}

h1, h2, h3, .heading-font { font-family: 'Orbitron', sans-serif; }

.gradient-text {
    background: linear-gradient(135deg, var(--neon-orange), var(--neon-aqua), var(--neon-blue));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

a { color: var(--neon-aqua); }

.cyber-nav {
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--neon-orange);
    padding: 14px 24px;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #fff;
}

.nav-brand img {
    height: 36px;
    filter: drop-shadow(0 0 8px var(--neon-orange));
}

.nav-brand span {
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    font-weight: 700;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.nav-links a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.nav-links a:hover {
    color: var(--neon-aqua);
    border-color: rgba(0, 245, 255, 0.3);
    background: rgba(0, 245, 255, 0.08);
}

.nav-links a.active {
    color: var(--neon-orange);
    border-color: rgba(255, 107, 53, 0.4);
    background: rgba(255, 107, 53, 0.1);
}

.nav-links button.logout,
.nav-links a.logout {
    border-color: rgba(255, 107, 53, 0.5);
    color: var(--neon-orange);
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    padding: 8px 14px;
    border-radius: 8px;
}

.nav-user {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-right: 8px;
}

.page-wrapper {
    max-width: 1100px;
    margin: 24px auto;
    padding: 0 20px 40px;
}

.page-wrapper.centered {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 80px);
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.glass-card-inner { padding: 28px; }

.cyber-button {
    display: inline-block;
    padding: 0.65rem 1.5rem;
    border: 2px solid var(--neon-orange);
    background: transparent;
    color: white;
    font-weight: 600;
    font-family: 'Exo 2', sans-serif;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-size: 0.95rem;
    text-align: center;
}

.cyber-button.primary {
    background: linear-gradient(45deg, var(--neon-orange), rgba(255, 107, 53, 0.4));
}

.cyber-button:hover:not(:disabled) {
    box-shadow: 0 0 20px rgba(255, 107, 53, 0.5);
    transform: translateY(-2px);
}

.cyber-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.cyber-button.secondary {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.05);
}

.cyber-button.block { width: 100%; display: block; }
.cyber-button.sm { padding: 0.4rem 0.9rem; font-size: 0.85rem; }

/* Custom file picker (hides native OS control) */
.file-input-wrap {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    max-width: 100%;
}

.file-input-wrap input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.file-input-wrap .file-input-btn {
    margin: 0;
}

.file-input-wrap .file-input-name {
    color: var(--text-muted, rgba(255, 255, 255, 0.65));
    font-size: 0.85rem;
    font-family: 'Exo 2', sans-serif;
    max-width: min(280px, 60vw);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-input-wrap .file-input-name.has-file {
    color: var(--neon-aqua, #00f5ff);
}

.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    margin-bottom: 6px;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 107, 53, 0.3);
    border-radius: 8px;
    color: white;
    padding: 12px 14px;
    font-size: 15px;
    font-family: 'Exo 2', sans-serif;
}

.form-control:focus {
    outline: none;
    border-color: var(--neon-orange);
    box-shadow: 0 0 0 0.2rem rgba(255, 107, 53, 0.25);
}

.form-control::placeholder { color: rgba(255, 255, 255, 0.45); }

select.form-control option {
    background: var(--deep-space);
    color: #fff;
}

/* Cyber-styled range sliders (full travel 0→100%) */
.range-control {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 28px;
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    cursor: pointer;
    display: block;
}
.range-control:focus {
    outline: none;
    box-shadow: none;
}
.range-control::-webkit-slider-runnable-track {
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(255, 107, 53, 0.35), rgba(0, 245, 255, 0.45));
    border: 1px solid rgba(255, 107, 53, 0.45);
    box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.35);
}
.range-control::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    margin-top: -6px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--neon-orange), var(--neon-aqua));
    border: 2px solid rgba(255, 255, 255, 0.85);
    box-shadow: 0 0 10px rgba(255, 107, 53, 0.55);
    cursor: pointer;
}
.range-control:focus::-webkit-slider-thumb {
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.35), 0 0 12px rgba(0, 245, 255, 0.45);
}
.range-control::-moz-range-track {
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(255, 107, 53, 0.35), rgba(0, 245, 255, 0.45));
    border: 1px solid rgba(255, 107, 53, 0.45);
}
.range-control::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--neon-orange), var(--neon-aqua));
    border: 2px solid rgba(255, 255, 255, 0.85);
    box-shadow: 0 0 10px rgba(255, 107, 53, 0.55);
    cursor: pointer;
}
.range-control::-moz-range-progress {
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--neon-orange), var(--neon-aqua));
}

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

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 0.9rem;
}

.alert-error {
    background: rgba(231, 76, 60, 0.15);
    border: 1px solid rgba(231, 76, 60, 0.4);
    color: #ff8a80;
}

.alert-success {
    background: rgba(150, 206, 180, 0.15);
    border: 1px solid rgba(150, 206, 180, 0.4);
    color: var(--neon-green);
}

.alert-info {
    background: rgba(0, 245, 255, 0.08);
    border: 1px solid rgba(0, 245, 255, 0.3);
    color: var(--neon-aqua);
}

.auth-card { width: 100%; max-width: 420px; }
.auth-header { text-align: center; margin-bottom: 28px; }
.auth-header h1 { font-size: 1.6rem; margin-bottom: 8px; }
.auth-header p { color: var(--text-muted); font-size: 0.95rem; }

.table-wrap { overflow-x: auto; }
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table th,
.data-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.data-table th {
    color: var(--neon-orange);
    font-family: 'Orbitron', sans-serif;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.status-pill {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.status-pill.done { border-color: var(--neon-green); color: var(--neon-green); }
.status-pill.running, .status-pill.pending { border-color: var(--neon-aqua); color: var(--neon-aqua); }
.status-pill.failed, .status-pill.needs_credentials { border-color: #e74c3c; color: #ff8a80; }

.field-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
}

.field-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 20px;
    transition: transform 0.25s, box-shadow 0.25s;
}

.field-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(255, 107, 53, 0.15);
}

.field-card h3 { margin-bottom: 8px; font-size: 1.05rem; }
.field-card p { color: var(--text-muted); font-size: 0.88rem; margin-bottom: 6px; }
.field-card .meta { font-size: 0.8rem; color: rgba(255,255,255,0.45); margin-top: 12px; }

/* Map layout */
body.map-page {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

body.map-page .cyber-nav { flex-shrink: 0; }

.map-shell {
    flex: 1;
    display: grid;
    grid-template-columns: 440px 1fr;
    min-height: 0;
}

.map-panel {
    background: rgba(10, 10, 15, 0.92);
    border-right: 1px solid var(--glass-border);
    overflow-x: hidden;
    overflow-y: auto;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 107, 53, 0.65) rgba(255, 255, 255, 0.06);
}

.map-panel::-webkit-scrollbar {
    width: 8px;
}

.map-panel::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    margin: 6px 0;
}

.map-panel::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--neon-orange), rgba(255, 107, 53, 0.45));
    border-radius: 8px;
    border: 1px solid rgba(0, 245, 255, 0.2);
}

.map-panel::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #ff8655, var(--neon-orange));
    box-shadow: 0 0 10px rgba(255, 107, 53, 0.45);
}

.map-panel > * {
    min-width: 0;
    max-width: 100%;
}

.map-panel h2 {
    font-size: 1.05rem;
    margin-bottom: 4px;
}

.map-panel .panel-hint {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.45;
}

#map {
    width: 100%;
    height: 100%;
    min-height: 0;
    background: #111;
}

/* Leaflet + Draw controls — match cyber / glass theme */
#map .leaflet-bar,
#map .leaflet-draw-toolbar {
    border: 1px solid var(--glass-border) !important;
    border-radius: 10px !important;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(0, 245, 255, 0.08);
    background: rgba(10, 10, 15, 0.88) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

#map .leaflet-control-zoom a {
    background-color: transparent !important;
    background-image: none !important;
    color: #fff !important;
    border-bottom: 1px solid rgba(255, 107, 53, 0.22) !important;
    width: 34px;
    height: 34px;
    line-height: 34px;
    font-family: 'Exo 2', sans-serif;
    font-weight: 600;
    font-size: 1.15rem;
    transition: background 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

#map .leaflet-control-zoom a:last-child {
    border-bottom: none !important;
}

#map .leaflet-control-zoom a:hover {
    background: rgba(255, 107, 53, 0.22) !important;
    color: var(--neon-aqua) !important;
    box-shadow: inset 0 0 16px rgba(255, 107, 53, 0.25);
}

#map .leaflet-control-zoom a.leaflet-disabled {
    opacity: 0.35;
    cursor: not-allowed;
    color: rgba(255, 255, 255, 0.45) !important;
    box-shadow: none;
}

#map .leaflet-control-zoom a.leaflet-disabled:hover {
    background: transparent !important;
    color: rgba(255, 255, 255, 0.45) !important;
    box-shadow: none;
}

/* Draw icons are dark sprites — invert to white and keep 30×30 for sprite alignment */
#map .leaflet-draw-toolbar a {
    background-color: transparent !important;
    border-bottom: 1px solid rgba(255, 107, 53, 0.22) !important;
    width: 30px !important;
    height: 30px !important;
    line-height: 30px !important;
    background-size: 300px 30px !important;
    filter: brightness(0) invert(1) !important;
    transition: background-color 0.2s ease, filter 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

#map .leaflet-draw-toolbar a:last-child {
    border-bottom: none !important;
}

#map .leaflet-draw-toolbar a:hover {
    background-color: rgba(255, 107, 53, 0.28) !important;
    box-shadow: inset 0 0 16px rgba(255, 107, 53, 0.25);
    filter: brightness(0) invert(1) drop-shadow(0 0 2px rgba(0, 245, 255, 0.85)) !important;
}

/*
 * Disabled edit/remove use light-gray sprites (#bbb). Inverting those makes them
 * black on our dark bar — keep the enabled sprite frames and dim with opacity.
 */
#map .leaflet-draw-toolbar .leaflet-draw-edit-edit.leaflet-disabled {
    background-position: -152px -2px !important;
}

#map .leaflet-draw-toolbar .leaflet-draw-edit-remove.leaflet-disabled {
    background-position: -182px -2px !important;
}

#map .leaflet-touch .leaflet-draw-toolbar .leaflet-draw-edit-edit.leaflet-disabled {
    background-position: -150px -1px !important;
}

#map .leaflet-touch .leaflet-draw-toolbar .leaflet-draw-edit-remove.leaflet-disabled {
    background-position: -180px -1px !important;
}

#map .leaflet-draw-toolbar a.leaflet-disabled,
#map .leaflet-draw-toolbar a.leaflet-disabled:hover {
    opacity: 0.45;
    cursor: not-allowed;
    filter: brightness(0) invert(1) !important;
    background-color: transparent !important;
    box-shadow: none;
}

#map .leaflet-draw-actions {
    left: 34px !important;
}

#map .leaflet-draw-actions a {
    background: rgba(10, 10, 15, 0.92) !important;
    color: #fff !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: 8px !important;
    font-family: 'Exo 2', sans-serif;
    font-weight: 600;
    font-size: 0.8rem;
    padding: 0 10px;
    height: 30px;
    line-height: 30px;
    margin-left: 4px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    transition: background 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

#map .leaflet-draw-actions a:hover {
    background: rgba(255, 107, 53, 0.28) !important;
    color: var(--neon-aqua) !important;
    box-shadow: 0 0 14px rgba(255, 107, 53, 0.4);
}

#map .leaflet-control-attribution {
    background: rgba(10, 10, 15, 0.75) !important;
    color: rgba(255, 255, 255, 0.55) !important;
    border: 1px solid rgba(255, 107, 53, 0.2);
    border-radius: 8px 0 0 0;
    font-family: 'Exo 2', sans-serif;
    font-size: 0.7rem;
    padding: 3px 8px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

#map .leaflet-control-attribution a {
    color: var(--neon-aqua) !important;
}

.job-progress-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: -4px;
}

.job-progress-track {
    height: 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 107, 53, 0.28);
    overflow: hidden;
}

.job-progress-fill {
    height: 100%;
    width: 0%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--neon-orange), var(--neon-aqua));
    box-shadow: 0 0 12px rgba(0, 245, 255, 0.35);
    transition: width 0.45s ease;
}

.job-progress-meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.job-progress-meta #jobProgressPct {
    color: var(--neon-aqua);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    min-width: 3.2em;
}

.job-progress-mini {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 140px;
}

.job-progress-mini .job-progress-track {
    height: 8px;
}

.job-progress-mini [data-role="progress-text"] {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.3;
}

/* Leaflet popups — match cyber / glass theme (soil sampling, etc.) */
#map .leaflet-popup-content-wrapper {
    background: rgba(10, 10, 15, 0.94);
    color: #fff;
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(0, 245, 255, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

#map .leaflet-popup-content {
    margin: 12px 14px;
    font-family: 'Exo 2', sans-serif;
    font-size: 0.88rem;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.92);
}

#map .leaflet-popup-content strong {
    color: var(--neon-aqua);
    font-weight: 600;
}

#map .leaflet-popup-content small {
    color: var(--text-muted);
}

#map .leaflet-popup-tip {
    background: rgba(10, 10, 15, 0.94);
    border: 1px solid var(--glass-border);
    box-shadow: none;
}

#map .leaflet-container a.leaflet-popup-close-button {
    color: rgba(255, 255, 255, 0.75);
    font-size: 18px;
    padding: 6px 8px 0 0;
}

#map .leaflet-container a.leaflet-popup-close-button:hover {
    color: var(--neon-orange);
}

#map .leaflet-popup-content .soil-sample-btn,
#map .leaflet-popup-content .cyber-button {
    margin-top: 10px;
    width: 100%;
    border: 2px solid var(--neon-orange);
    background: linear-gradient(45deg, var(--neon-orange), rgba(255, 107, 53, 0.45));
    color: #fff;
    font-family: 'Exo 2', sans-serif;
    font-weight: 600;
}

#map .leaflet-popup-content .soil-sample-btn:hover,
#map .leaflet-popup-content .cyber-button:hover {
    box-shadow: 0 0 16px rgba(255, 107, 53, 0.55);
    color: #fff;
}

.map-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.points-list {
    list-style: none;
    max-height: 140px;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 245, 255, 0.45) rgba(255, 255, 255, 0.04);
}

.points-list::-webkit-scrollbar {
    width: 6px;
}

.points-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 6px;
}

.points-list::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(0, 245, 255, 0.7), rgba(69, 183, 209, 0.45));
    border-radius: 6px;
}

.points-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    margin-bottom: 6px;
    font-size: 0.85rem;
}

.points-list li button {
    background: transparent;
    border: none;
    color: #ff8a80;
    cursor: pointer;
    font-size: 0.85rem;
}

.chart-box {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(0, 245, 255, 0.2);
    border-radius: 12px;
    padding: 12px;
    min-height: 180px;
    margin-bottom: 4px;
}

.chart-box canvas { max-height: 200px; }

.chart-box .ndvi-scale-labels {
    margin-bottom: 4px;
}

.ndvi-scale {
    display: flex;
    height: 10px;
    border-radius: 6px;
    overflow: hidden;
    margin-top: 8px;
}

.ndvi-scale span { flex: 1; }
.ndvi-scale .s1 { background: #8B4513; }
.ndvi-scale .s2 { background: #DAA520; }
.ndvi-scale .s3 { background: #9ACD32; }
.ndvi-scale .s4 { background: #228B22; }
.ndvi-scale .s5 { background: #006400; }

.heatmap-controls {
    margin-top: 1.5rem;
    padding: 14px 12px 12px;
    border-top: 1px solid rgba(0, 245, 255, 0.18);
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(255, 107, 53, 0.25);
}
.heatmap-controls > label:first-child {
    margin-top: 0;
}
.heatmap-controls label {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 0.35rem;
}
.heatmap-meta {
    display: block;
    margin-top: 0.35rem;
    margin-bottom: 0.15rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.35;
    min-height: 1.25em;
}
.heatmap-meta #heatmapDateLabel {
    color: var(--text);
}

.ndvi-scale-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.mode-toggle {
    display: flex;
    gap: 6px;
}

.mode-toggle button.active {
    border-color: var(--neon-aqua);
    color: var(--neon-aqua);
    box-shadow: 0 0 12px rgba(0, 245, 255, 0.25);
}

@media (max-width: 900px) {
    .map-shell {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }
    .map-panel {
        max-height: 45vh;
        border-right: none;
        border-bottom: 1px solid var(--glass-border);
        overflow-x: hidden;
    }
    .form-row { grid-template-columns: 1fr; }
    .nav-brand span { display: none; }
    .guia-layout {
        grid-template-columns: 1fr;
    }
    .guia-toc {
        position: static;
    }
}

/* Guía / enseñanza */
.guia-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
    max-width: 1100px;
}

.guia-toc {
    position: sticky;
    top: 84px;
}

.guia-toc .glass-card-inner {
    padding: 18px;
}

.guia-toc-title {
    font-size: 0.95rem;
    margin-bottom: 12px;
    color: var(--neon-aqua);
}

.guia-toc-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.guia-toc-nav a {
    color: rgba(255, 255, 255, 0.78);
    text-decoration: none;
    font-size: 0.86rem;
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid transparent;
    transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.guia-toc-nav a:hover {
    color: #fff;
    border-color: rgba(255, 107, 53, 0.4);
    background: rgba(255, 107, 53, 0.08);
}

.guia-main {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.guia-section .glass-card-inner,
.guia-main > .glass-card .glass-card-inner {
    padding: 22px 24px;
}

.guia-intro,
.guia-lead {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.55;
    max-width: 72ch;
}

.guia-steps {
    margin: 12px 0 0 1.2rem;
    color: rgba(255, 255, 255, 0.88);
    line-height: 1.65;
}

.guia-steps li {
    margin-bottom: 8px;
}

.guia-section h2 {
    font-size: 1.25rem;
    margin-bottom: 12px;
}

.guia-section ul {
    margin: 10px 0 0 1.15rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.55;
}

.guia-section ul li {
    margin-bottom: 6px;
}

.guia-details {
    border: 1px solid rgba(255, 107, 53, 0.25);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    margin-top: 10px;
    overflow: hidden;
}

.guia-details summary {
    cursor: pointer;
    list-style: none;
    padding: 12px 14px;
    font-weight: 600;
    font-size: 0.95rem;
    color: #fff;
    user-select: none;
}

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

.guia-details summary::before {
    content: "+";
    display: inline-block;
    width: 1.2em;
    color: var(--neon-orange);
    font-weight: 700;
}

.guia-details[open] summary::before {
    content: "−";
}

.guia-details-body {
    padding: 12px 14px 14px;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.55;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.guia-details-body p {
    margin-bottom: 8px;
}

.guia-table {
    font-size: 0.86rem;
}

.guia-table th,
.guia-table td {
    vertical-align: top;
}

.guia-cta {
    text-align: left;
}

html {
    scroll-behavior: smooth;
}

.guia-page .guia-section {
    scroll-margin-top: 90px;
}
