:root { color-scheme: dark; font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: #020617; color: #e5e7eb; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at top, #1e3a8a33, transparent 32rem), #020617; }
.access-gate { min-height: 100vh; display: grid; place-items: center; padding: 20px 14px; }
.access-card { width: min(520px, 100%); display: grid; gap: 14px; }
.access-error { margin: 0; color: #fca5a5; font-weight: 800; }
.app-shell { width: min(980px, 100%); margin: 0 auto; padding: 20px 14px 40px; }
.hero { padding: 18px 4px; }
.eyebrow { color: #38bdf8; text-transform: uppercase; font-weight: 800; letter-spacing: .08em; font-size: 1.52rem; }
h1 { margin: 6px 0 8px; font-size: clamp(1.8rem, 8vw, 3.2rem); line-height: 1; }
p { color: #cbd5e1; }
.card { background: rgba(15,23,42,.92); border: 1px solid rgba(148,163,184,.18); border-radius: 22px; padding: 18px; box-shadow: 0 20px 60px #0008; }
.form-card { display: grid; gap: 14px; }
label { display: grid; gap: 7px; color: #bfdbfe; font-weight: 700; }
input, select { width: 100%; border: 1px solid #334155; border-radius: 14px; background: #020617; color: #f8fafc; padding: 14px; font-size: 1rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
button { border: 0; border-radius: 16px; padding: 15px 18px; background: linear-gradient(135deg, #22c55e, #14b8a6); color: #022c22; font-size: 1.05rem; font-weight: 900; cursor: pointer; }
button:disabled { opacity: .65; cursor: wait; }
.status { margin: 16px 0; padding: 14px; border-radius: 16px; background: #1e293b; color: #e2e8f0; border: 1px solid #334155; }
.status.error { background: #450a0a; border-color: #dc2626; }
.results { display: grid; gap: 16px; margin-top: 16px; }
.confidence-card { display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.label { color: #94a3b8; display: block; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }
#confidence-text { font-size: 1.8rem; text-transform: uppercase; }
.confidence-alta { border-color: #22c55e; }
.confidence-media { border-color: #f59e0b; }
.confidence-baja { border-color: #ef4444; }
.confidence-baja #confidence-warning, .confidence-media #confidence-warning { color: #fca5a5; font-weight: 800; }
.map-shell { display: grid; gap: 10px; }
.map-toolbar { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; }
.map-legend { display: flex; flex-wrap: wrap; gap: 10px; color: #cbd5e1; font-size: .88rem; }
.legend-line { display: inline-block; width: 26px; height: 5px; border-radius: 999px; margin-right: 5px; vertical-align: middle; }
.legend-line.original { background: #2563eb; }
.legend-line.alternative { background: #22c55e; }
.legend-line.restriction-high { background: #ef4444; }
.legend-line.restriction-low { background: #f59e0b; }
.legend-line.selected-segment { background: #facc15; }
.map-controls-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 8px 0 2px; }
.map-action-button, .map-zoom-button { min-height: 56px; border-radius: 18px; box-shadow: 0 16px 38px rgba(2, 6, 23, .42); border: 1px solid rgba(255, 255, 255, .22); }
.map-action-button { min-width: min(220px, 48%); padding: 15px 22px; background: linear-gradient(135deg, #0f766e, #16a34a); color: #ecfdf5; }
.map-zoom-actions { display: flex; justify-content: flex-end; gap: 14px; }
.map-zoom-button { width: 64px; min-width: 64px; padding: 0; background: #0f3b5f; color: #ffffff; font-size: 2rem; line-height: 1; text-shadow: 0 1px 1px rgba(0,0,0,.45); }
.map-action-button:hover, .map-zoom-button:hover { filter: brightness(1.12); }
.map { display: block; width: 100%; height: clamp(420px, 58vh, 680px); min-height: 420px; max-height: 680px; border-radius: 22px; overflow: hidden; border: 1px solid #334155; touch-action: pinch-zoom; }
.leaflet-container { width: 100%; height: 100%; overflow: hidden; background: #0f172a; outline-offset: 1px; }
.leaflet-pane, .leaflet-tile, .leaflet-marker-icon, .leaflet-marker-shadow, .leaflet-tile-container, .leaflet-overlay-pane svg, .leaflet-overlay-pane canvas { position: absolute; left: 0; top: 0; }
.leaflet-tile { width: 256px; height: 256px; user-select: none; -webkit-user-drag: none; }
.leaflet-tile-pane { z-index: 200; }
.leaflet-overlay-pane { z-index: 400; }
.leaflet-marker-pane { z-index: 600; }
.leaflet-popup-pane { z-index: 700; }
.leaflet-control { position: relative; z-index: 800; pointer-events: auto; }
.restriction-list { display: grid; gap: 12px; }
.restriction-item { border: 1px solid #334155; background: #020617; border-radius: 16px; padding: 14px; }
.restriction-head { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.road { font-size: 1.25rem; font-weight: 900; color: #93c5fd; }
.badge { border-radius: 999px; padding: 5px 9px; background: #334155; color: #e2e8f0; font-size: .8rem; font-weight: 800; }
.meta { margin-top: 7px; color: #cbd5e1; font-size: .92rem; }
.meta-label { color: #ef4444; font-weight: 400; }
.meta-value { color: #f8fafc; font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: #172554; color: #bfdbfe; border: 1px solid #1d4ed8; border-radius: 999px; padding: 8px 11px; font-weight: 800; }
.empty { color: #fca5a5; font-weight: 800; }
@media (max-width: 640px) { .grid-2, .confidence-card { grid-template-columns: 1fr; display: grid; } .app-shell { padding-inline: 10px; } .card { padding: 15px; border-radius: 18px; } }

.inline-warning, .eta-warning { color: #fbbf24; font-weight: 800; margin: 0; }
.route-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.metric { background: #020617; border: 1px solid #334155; border-radius: 14px; padding: 12px; }
.metric strong { display: block; color: #f8fafc; font-size: 1.25rem; }
.map-detail { background: #020617; border: 1px solid #334155; border-radius: 16px; padding: 12px; color: #e2e8f0; }
@media (max-width: 640px) { .map { height: 62vh; min-height: 360px; } .sticky-cta { position: sticky; bottom: 10px; z-index: 900; } .map-toolbar { align-items: stretch; } .map-controls-row { gap: 12px; } .map-action-button { min-width: 0; flex: 1; } .map-zoom-actions { gap: 10px; } .map-zoom-button { width: 58px; min-width: 58px; } }

.roads-panel { display: grid; grid-template-columns: 1fr; gap: 18px; }
.road-group { border: 1px solid #1e293b; background: #020617; border-radius: 16px; padding: 12px; }
.road-group h3 { margin: 0 0 10px; font-size: .95rem; color: #e2e8f0; }
.road-segment-list { display: grid; gap: 8px; }
.road-segment { width: 100%; text-align: left; border: 1px solid #1d4ed8; border-radius: 14px; background: #0f172a; color: #bfdbfe; padding: 9px 10px; display: grid; gap: 3px; cursor: pointer; }
.road-segment:disabled { cursor: default; opacity: .65; }
.road-segment:not(:disabled):hover { border-color: #facc15; box-shadow: 0 0 0 2px rgba(250, 204, 21, .18); }
.road-segment-restricted { border-color: #ef4444; color: #fecaca; }
.road-segment-restricted-card { background: #ffffff; border-color: #dc2626; color: #b91c1c; box-shadow: 0 0 0 2px rgba(220, 38, 38, .16); }
.road-segment-restricted-card .road-segment-meta { color: #7f1d1d; }
.road-segment-restricted-card .road-segment-alert { color: #dc2626; font-weight: 900; }
.road-segment-name { font-weight: 800; font-size: .86rem; line-height: 1.1; }
.road-segment-meta, .road-segment-alert { font-size: .74rem; color: #94a3b8; }
.road-segment-alert { color: #fca5a5; }

.road-segment { padding: 6px 8px; gap: 5px; margin-bottom: 4px; }
.road-segment-name { font-size: .72rem; }
.road-segment-meta, .road-segment-alert { font-size: .64rem; }
.road-type-blue { background: linear-gradient(135deg, #1d4ed8, #0f172a); border-color: #60a5fa; }
.road-type-red { background: linear-gradient(135deg, #991b1b, #0f172a); border-color: #f87171; }
.road-type-orange { background: linear-gradient(135deg, #c2410c, #0f172a); border-color: #fb923c; }
.road-type-green { background: linear-gradient(135deg, #166534, #0f172a); border-color: #4ade80; }
.road-type-gray { background: linear-gradient(135deg, #475569, #0f172a); border-color: #94a3b8; }
.restriction-active { color: #ef4444; font-weight: 900; text-transform: uppercase; }
.geometry-warning { border: 1px solid #f59e0b; background: rgba(245, 158, 11, .12); border-radius: 12px; padding: 10px; color: #fde68a; }
.geometry-warning .meta-label, .geometry-warning .meta-value { color: #fde68a; font-weight: 800; }
