/* The cartography workbench is scoped to /map; operational consoles keep their styling. */
body[data-map-mode="configure"] { --map-green:#16a34a; --map-blue:#2563eb; --map-yellow:#facc15; --map-red:#dc2626; }
.map-shell { grid-template-columns:340px minmax(0,1fr); gap:16px; padding:16px; background:var(--bg,#080c12); }
.map-sidebar { border-radius:16px; background:var(--panel,#111827); }
.map-panel { border-radius:16px; isolation:isolate; background:#101923; }
.map-workspace-title { padding:20px 16px 8px; border:0; }
.map-workspace-title h2 { margin-top:7px; font-size:20px; letter-spacing:-.4px; }
.map-eyebrow { color:var(--muted); letter-spacing:1.3px; font-size:9px; font-weight:750; }
.map-sidebar .panel-head { padding:15px 16px 10px; align-items:center; }
.map-sidebar .panel-head h2 { font-size:13px; }
.map-editor-mode-tabs { margin:4px 14px 14px; padding:4px; border:1px solid var(--line); border-radius:10px; grid-template-columns:repeat(4,minmax(0,1fr)); gap:3px; }
.map-editor-mode-tabs .btn { border:0; background:transparent; min-height:42px; padding:5px; font-size:11px; white-space:normal; box-shadow:none; }
.map-editor-mode-tabs .btn.active { background:rgba(56,189,248,.13); color:#7dd3fc; }
.map-editor-summary { padding:0 16px 12px; }
.map-editor-summary-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:5px; }
.map-editor-summary-grid span { background:transparent; font-weight:400; font-size:11px; }
.map-editor-summary-row { gap:8px; align-items:flex-start; }
.map-editor-summary-row strong { min-width:0; white-space:normal; overflow-wrap:anywhere; font-size:12px; line-height:1.5; }
.map-editor-summary-row>span { flex:none; }
.map-profile-safety { margin:0 16px 8px; font-size:11px; line-height:1.6; color:var(--muted); }
.map-profile-safety:empty { display:none; }
.map-profile-safety .btn { margin-top:8px; width:100%; }
.map-note { padding:0 16px 14px; }
.map-small-note { font-size:11px; color:var(--muted); line-height:1.6; margin:2px 0 0; }
.map-basemap-settings { display:grid; gap:10px; }
.map-basemap-settings .muted { font-size:11px; margin:0; }
.map-required-label,.map-auto-label { font-size:8px; letter-spacing:.8px; color:var(--muted); font-weight:700; }
.map-zone-tools { display:grid; gap:6px; padding:0 16px 6px; }
.zone-green { --zone-color:var(--map-green); }
.zone-blue { --zone-color:var(--map-blue); }
.zone-yellow { --zone-color:var(--map-yellow); }
.zone-red { --zone-color:var(--map-red); }
.map-zone-tool { display:flex; gap:12px; align-items:center; width:100%; padding:12px; border:1px solid var(--line); background:transparent; color:var(--text); border-radius:9px; text-align:left; font:inherit; }
button.map-zone-tool { cursor:pointer; }
button.map-zone-tool:hover,button.map-zone-tool:focus-visible { border-color:var(--zone-color); background:color-mix(in srgb,var(--zone-color) 9%,transparent); outline:none; }
.map-zone-dot { width:12px; height:12px; border-radius:4px; background:var(--zone-color); flex:none; box-shadow:0 0 0 4px color-mix(in srgb,var(--zone-color) 10%,transparent); }
.map-zone-tool>span:nth-child(2) { display:grid; gap:3px; flex:1; }
.map-zone-tool strong { font-size:12px; font-weight:650; }
.map-zone-tool small { font-size:10px; color:var(--muted); }
.map-boundary-tools .btn { font-size:11px; min-height:40px; font-weight:500; }
.map-wide-button { grid-column:1/-1; }
.map-editor-quick-actions { padding:0 16px 14px; gap:6px; }
.map-editor-quick-actions .btn { min-height:40px; font-size:11px; }
.map-editor-toolbar { inset:14px 14px auto; gap:8px; flex-wrap:wrap; justify-content:flex-start; }
.map-drawing-tools { display:flex; flex-wrap:wrap; gap:4px; padding:5px; background:color-mix(in srgb,var(--panel,#111827) 95%,transparent); border:1px solid var(--line); border-radius:11px; box-shadow:0 6px 24px #0003; pointer-events:auto; }
.map-drawing-tools .btn { min-height:36px; font-size:11px; padding:6px 10px; border-radius:7px; box-shadow:none; }
.map-shape-select { display:flex; align-items:center; gap:6px; padding-left:8px; color:var(--muted); font-size:10px; }
.map-shape-select select { min-height:34px; width:125px; border:0; font-size:11px; background:transparent; color:var(--text); }
.map-editor-toolbar #mapEditorModeHint { font-size:11px; padding:9px 12px; background:color-mix(in srgb,var(--panel,#111827) 95%,transparent); max-width:100%; white-space:normal; font-weight:500; }
.map-canvas-topline { position:absolute; inset:78px 18px auto; display:flex; justify-content:space-between; pointer-events:none; color:#fff; text-shadow:0 1px 4px #000; font-size:11px; font-weight:650; }
.map-north { padding:7px; background:#111827d9; border:1px solid #64748b66; border-radius:8px; text-shadow:none; }
.map-canvas-footer { position:absolute; bottom:0; left:0; right:0; pointer-events:none; padding:26px 16px 12px; background:linear-gradient(transparent,#0b1423e8); display:grid; gap:13px; }
.map-zone-legend { display:flex; gap:16px; flex-wrap:wrap; color:#e2e8f0; font-size:10px; }
.map-zone-legend span { display:inline-flex; align-items:center; gap:6px; }
.map-zone-legend span::before { content:""; width:8px; height:8px; background:var(--zone-color); border-radius:2px; }
.map-canvas-meta { display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; color:#cbd5e1; font-size:9px; }
#mapBasemapAttribution { pointer-events:auto; padding:3px 6px; background:#0f172acc; border-radius:4px; }
#mapBasemapAttribution a { color:#e2e8f0; text-decoration:underline; }
#mapScaleLabel { font-variant-numeric:tabular-nums; }
.map-required-checklist { display:grid; gap:5px; margin:0 16px 14px; }
.map-requirement { display:flex; align-items:center; gap:9px; border:1px solid var(--line); padding:9px 10px; border-radius:7px; font-size:11px; color:var(--muted); }
.map-requirement>span:first-child { width:18px; height:18px; display:grid; place-items:center; border:1px solid var(--line); border-radius:50%; flex:none; font-size:10px; }
.map-requirement.complete>span:first-child { background:#16a34a18; color:#4ade80; border-color:#16a34a55; }
.map-requirement.complete { color:var(--text); }
.map-requirement button { margin-left:auto; min-height:28px; padding:3px 7px; font-size:10px; }
.map-validation-intro { padding:0 16px; font-size:12px; color:var(--muted); line-height:1.6; }
.map-validation-actions { padding:0 16px 16px; }
.map-profile-card { border-radius:9px; padding:10px; }
.map-profile-card small { font-size:10px; line-height:1.5; }
.map-profile-actions .btn { min-height:30px; padding:4px 8px; font-size:10px; }
.map-profile-object-line { vector-effect:non-scaling-stroke; filter:none; }
.map-profile-object.zone_track .map-profile-object-line { fill:#16a34a35; stroke:#16a34a; stroke-width:2; }
.map-profile-object.zone_pitlane .map-profile-object-line { fill:#2563eb45; stroke:#2563eb; stroke-width:2; }
.map-profile-object.zone_paddock .map-profile-object-line { fill:#facc1540; stroke:#facc15; stroke-width:2; }
.map-profile-object.track_inner .map-profile-object-line { fill:none; stroke:#dcfce7; stroke-width:2; stroke-dasharray:5 4; }
.map-profile-object.track_outer .map-profile-object-line { fill:none; stroke:#86efac; stroke-width:2; }
.map-profile-object.site_boundary .map-profile-object-line { fill:none; stroke:#f8fafc; stroke-width:2; stroke-dasharray:10 5; }
.map-profile-object.sector .map-profile-object-line { fill:#a78bfa10; stroke:#c4b5fd; stroke-width:2; stroke-dasharray:4 3; }
.map-profile-object.pit_entry,.map-profile-object.pit_exit { --gate-color:#60a5fa; }
.map-profile-object.site_exit { --gate-color:#fb7185; }
.map-profile-object.pit_entry .map-profile-object-point,.map-profile-object.pit_exit .map-profile-object-point,.map-profile-object.site_exit .map-profile-object-point { fill:var(--gate-color); stroke:#fff; stroke-width:2; }
.map-profile-object.pit_entry .map-profile-object-line,.map-profile-object.pit_exit .map-profile-object-line,.map-profile-object.site_exit .map-profile-object-line { stroke:var(--gate-color); stroke-width:4; }
.map-profile-object.selected .map-profile-object-line { filter:drop-shadow(0 0 3px #fff7); stroke-width:3; }
.map-profile-object text { font-family:inherit; font-size:11px; font-weight:600; stroke-width:3.5; stroke:#0f172ade; }
.map-profile-object.track_inner:not(.selected) text,.map-profile-object.track_outer:not(.selected) text,.map-profile-object.site_boundary:not(.selected) text { display:none; }
.map-vertex-hit-target { pointer-events:all; cursor:grab; }
.map-line-metadata { font-size:11px; color:var(--muted); margin-bottom:10px; }
.map-line-metadata summary { cursor:pointer; padding:8px 0; }
.map-profile-object-handle { fill:#f8fafc; stroke:#0f172a; stroke-width:2; vector-effect:non-scaling-stroke; }
.map-profile-object-draft { pointer-events:none; }
.map-profile-object-draft polygon { fill:#7dd3fc22; stroke:#7dd3fc; vector-effect:non-scaling-stroke; }
body.map-is-drawing .rtm-map-svg { cursor:crosshair; }
body.map-is-drawing .map-profile-object,body.map-is-drawing .map-panel-marker,body.map-is-drawing .map-track-line { pointer-events:none; }
.map-sidebar .field input,.map-sidebar .field select { min-height:38px; border-radius:7px; }
.map-sidebar .btn:disabled,.map-drawing-tools .btn:disabled { opacity:.4; cursor:not-allowed; }
.map-editor-summary-row .error { color:#fbbf24; }
.map-editor-summary-row span { font-size:10px; padding:4px 6px; border:1px solid var(--line); border-radius:5px; }
@media (max-width:1100px) {
  .map-shell { grid-template-columns:300px minmax(0,1fr); padding:10px; gap:10px; }
  .map-drawing-tools .btn { padding-inline:7px; }
  .map-canvas-topline { top:112px; }
}
@media (max-width:760px) {
  .map-shell { display:flex; flex-direction:column-reverse; height:auto; min-height:calc(100dvh - var(--topbar-height)); overflow:visible; }
  .map-panel { height:62dvh; min-height:390px; flex:none; }
  .map-sidebar { max-height:none; overflow:visible; }
  .map-canvas-topline { top:146px; }
  #mapCanvasProfile { max-width:calc(100% - 45px); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .map-editor-toolbar { inset:8px 8px auto; }
  .map-drawing-tools { gap:3px; }
  .map-drawing-tools .btn { min-height:40px; }
  .map-shape-select select { width:100px; }
  .map-zone-tools { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .map-zone-tool { padding:10px; gap:8px; }
  .map-zone-tool small { font-size:9px; }
}
