:root { --rail-w: 56px; --panel-w: var(--detail-w); }
[hidden] { display: none !important; }
#root { display: contents; }
body { font-size: var(--t-body); }
button,input,textarea,select { font-family: var(--font); font-size: var(--t-body); font-weight: var(--peso-regular); }
strong,b { font-weight: var(--peso-forte); }
button,a { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button:focus-visible,a:focus-visible { outline: none; box-shadow: var(--focus-ring); }
h1,h2,h3,p { margin: 0; }
button svg { flex-shrink: 0; }
.app-shell { height: 100svh; display: grid; grid-template-columns: var(--rail-w) minmax(0,1fr); grid-template-rows: minmax(0,1fr); gap: 0 var(--s-2); padding: var(--s-2); }
.rail { grid-row: 1 / -1; width: var(--rail-w); align-self: stretch; background: var(--ink); color: var(--on-ink); border-radius: var(--r-md); corner-shape: var(--canto); display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 8px 12px; }
#navigation { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; flex: 1; width: 100%; min-height: 0; }
.nav-button { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; padding: 0; border-radius: var(--r-sm); corner-shape: var(--canto); color: var(--recuo-sobre-tinta); }
.nav-button span { display: none; }
.nav-button[aria-current=page] { background: var(--surface); color: var(--ink); }
.rail button:focus-visible { box-shadow: var(--focus-ring-tinta); }
.scope-trigger { position: fixed; z-index: 8; top: 24px; right: 152px; display: flex; align-items: center; gap: var(--s-3); text-align: left; background: var(--surface); box-shadow: var(--shadow); border-radius: var(--r-md); corner-shape: var(--canto); padding: 8px 12px; min-height: 48px; min-width: 0; max-width: calc(100vw - 96px); touch-action: none; user-select: none; cursor: grab; }
.scope-trigger { background: var(--ink); color: var(--on-ink); border-radius: var(--r-pill); corner-shape: round; }
.scope-trigger.is-dragging { cursor: grabbing; }
.scope-label { min-width: 0; }
.scope-grip { margin-left: auto; display: inline-flex; align-items: center; align-self: stretch; flex-shrink: 0; color: var(--recuo-sobre-tinta); order: 1; }
.scope-trigger.is-dragging .scope-grip { color: var(--on-ink); }
.scope-trigger:focus-visible { box-shadow: var(--focus-ring-tinta); }
#scope-icon { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
#scope-icon.scope-avatar { position: relative; overflow: hidden; background: var(--linha-sobre-tinta); }
.scope-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scope-trigger strong,.scope-trigger small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scope-trigger strong { display: block; font-size: var(--t-item); font-weight: var(--peso-medio); }
.scope-trigger small { display: block; font-size: var(--t-meta); color: var(--recuo-sobre-tinta); margin-top: 4px; }
.scope-trigger small:empty { display: none; }
.identity { display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--ink); }
.avatar { width: 32px; height: 32px; background: var(--paper); border-radius: var(--r-pill); display: inline-flex; align-items: center; justify-content: center; font-size: var(--t-tiny); font-weight: var(--peso-forte); flex-shrink: 0; }
main { min-width: 0; min-height: 0; outline: none; }
.workspace { display: grid; grid-template-columns: var(--panel-w) minmax(0,1fr); gap: var(--s-2); height: 100%; }
.work-panel { min-height: 0; display: flex; flex-direction: column; padding: var(--s-4) 0 0; }
.sidebar-brand { display: flex; align-items: center; padding: 0 var(--s-2) var(--s-4); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; padding: 0 var(--s-2) var(--s-4); }
.panel-heading-main { display:flex; align-items:center; gap:var(--s-3); min-width:0; }
.heading-symbol { display:none; place-items:center; width:40px; height:40px; flex-shrink:0; }
.heading-symbol>svg { width:28px; height:28px; }
.panel-heading h1 { font-size:var(--t-h2); }
.nav-button>svg { width:18px; height:18px; }
.record-row:active .point-symbol,.record-row:active .record-symbol { transform:scale(.94); }
.record-symbol>svg { width:20px; height:20px; }
.empty-symbol { display:inline-flex; padding:var(--s-3); background:var(--paper); border-radius:var(--r-sm); margin-bottom:var(--s-4); }
.empty-symbol svg { width:28px; height:28px; }
.points-empty button { margin-top:var(--s-4); min-height:48px; }
@media(prefers-reduced-motion:reduce) { .record-row:active .point-symbol,.record-row:active .record-symbol { transform:none; } }
.eyebrow { font-size: var(--t-meta); font-weight: var(--peso-forte); letter-spacing: var(--letra-caixa-alta); color: var(--muted); }
h1 { font-size: var(--t-h1); font-weight: var(--peso-forte); margin-top: 0; }
.search-box { width: 100%; min-width: 0; }
.search-box input { width: 100%; min-width: 0; }
#period-host { margin: var(--s-3) 0; }
.panel-content { overflow-y: auto; min-height: 0; flex: 1; padding: 0 var(--s-2); }
.panel-intro { font-size: var(--t-body); line-height: 1.6; color: var(--muted); margin: var(--s-2) 0 var(--s-5); }
.record-section { margin-bottom: var(--s-3); }
.section-title { padding: var(--s-2) 0; }
.section-title h2 { font-size: var(--t-meta); font-weight: var(--peso-forte); }
.record-row { display: flex; text-align: left; align-items: center; width: 100%; gap: var(--s-3); padding: var(--s-2); border-radius: var(--r-sm); corner-shape: var(--canto); margin: 2px 0; }
.record-symbol { width: 28px; align-self: flex-start; padding-top: 2px; color: var(--muted); flex-shrink: 0; }
.record-main { min-width: 0; flex: 1; }
.record-main strong { display: block; font-size: var(--t-item); font-weight: var(--peso-medio); line-height: 1.4; }
.record-main small,.record-description { display: block; font-size: var(--t-meta); color: var(--muted); line-height: 1.6; margin-top: 3px; }
.record-row>svg { width: 14px; color: var(--muted); }
.empty-inline { padding: var(--s-3) 0; font-size: var(--t-body); color: var(--muted); }
.map-area { position: relative; min-width: 0; background: var(--paper); border-radius: var(--r-lg); corner-shape: var(--canto); overflow: hidden; }
#map { position: absolute; inset: 0; }
.map-top { position: absolute; z-index: 3; top: var(--s-4); left: var(--s-4); width: min(360px,calc(100% - 176px)); pointer-events: none; }
.map-search { position: relative; width: 100%; min-width: 0; pointer-events: auto; }
.map-search .search-box { min-height: 48px; gap: var(--s-2); padding: 4px 6px 4px 14px; background: var(--surface); border: 1px solid var(--linha); border-radius: var(--r-md); box-shadow: var(--shadow); color: var(--ink); }
.map-search .search-box:has(#place-search:placeholder-shown) { color: var(--muted); }
.map-search .search-box:focus-within { background: var(--hover); border-color: var(--linha); box-shadow: var(--shadow); }
#place-search-icon { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 20px; color: var(--muted); }
#place-search-icon svg { display: block; width: 18px; height: 18px; }
#place-search { height: 38px; color: var(--ink); }
#place-search::-webkit-search-cancel-button { display: none; -webkit-appearance: none; }
#place-search::-ms-clear { display: none; }
.place-search-clear { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 36px; width: 36px; height: 36px; padding: 0; border-radius: var(--r-sm); color: var(--muted); }
.place-search-clear svg { display: block; width: 16px; height: 16px; }
.place-search-clear:active { background: var(--paper); color: var(--ink); }
.map-navigation { --map-ctrl: 40px; --map-pad: 4px; position: absolute; z-index: 3; top: var(--s-4); right: var(--s-4); display: flex; align-items: flex-start; gap: var(--s-2); pointer-events: none; }
.map-position { display: flex; align-items: center; gap: 2px; padding: var(--map-pad); background: var(--surface); border-radius: var(--r-md); corner-shape: var(--canto); box-shadow: var(--shadow); pointer-events: auto; }
.map-create { position: absolute; z-index: 3; right: var(--s-4); bottom: var(--s-4); display: flex; align-items: center; gap: var(--s-2); pointer-events: auto; }
.map-draw-button { display: inline-flex; align-items: center; gap: var(--s-2); min-height: 48px; padding-inline: var(--s-4); border-radius: var(--r-md); corner-shape: var(--canto); box-shadow: var(--shadow); }
.route-desktop-tools { position: absolute; z-index: 4; top: 72px; left: 50%; display: flex; align-items: center; gap: 2px; padding: 4px; background: var(--surface); border-radius: var(--r-md); corner-shape: var(--canto); box-shadow: var(--shadow); transform: translateX(-50%); }
.route-history-tools { display: flex; gap: 2px; }
.route-tool-icon,.route-tool-button { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; border-radius: var(--r-sm); corner-shape: var(--canto); color: var(--ink); }
.route-tool-icon { width: 40px; padding: 0; }
.route-tool-button { flex: none; gap: var(--s-2); padding: 0 var(--s-3); font-size: var(--t-body); font-weight: var(--peso-forte); white-space: nowrap; }
.route-tool-button[aria-pressed=true] { background: var(--work-color); color: var(--on-ink); }
.route-tool-divider { width: 1px; height: 24px; margin: 0 4px; background: var(--linha); }
.place-results { position: absolute; z-index: 4; left: 0; right: 0; top: calc(100% + var(--s-2)); margin: 0; padding: var(--s-1); list-style: none; background: var(--surface); border: 1px solid var(--linha); border-radius: var(--r-md); box-shadow: var(--shadow); max-height: 240px; overflow-y: auto; }
.place-results button { display: grid; gap: 2px; width: 100%; text-align: left; padding: 10px 12px; border-radius: var(--r-sm); }
.place-results strong { font-size: var(--t-item); font-weight: var(--peso-medio); }
.place-results small,.place-empty { font-size: var(--t-meta); font-weight: var(--peso-medio); color: var(--muted); }
.place-empty { padding: 10px 12px; }
.place-pin { width: 14px; height: 14px; border-radius: var(--r-pill); background: var(--ink); border: 2px solid #fff; box-shadow: 0 1px 4px #23262b40; }
#locate-me { display: inline-flex; align-items: center; justify-content: center; }
#locate-me[aria-pressed=true] { background: var(--ink); color: var(--on-ink); }
#locate-me[aria-busy=true] { opacity: 0.72; }
#north-up { width: calc(var(--map-ctrl) + (var(--map-pad) * 2)); height: calc(var(--map-ctrl) + (var(--map-pad) * 2)); background: var(--surface); border-radius: var(--r-md); box-shadow: var(--shadow); pointer-events: auto; animation: map-compass-in var(--dur) ease-out; }
#north-up.is-out { animation: map-compass-out var(--dur) ease-out forwards; pointer-events: none; }
#north-up svg { transform-origin: 50% 50%; }
#north-up[hidden] { display: none; }
@keyframes map-compass-in { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: scale(1); } }
@keyframes map-compass-out { from { opacity: 1; transform: scale(1); } to { opacity: 0; transform: scale(.92); } }
@media (prefers-reduced-motion: reduce) { #north-up, #north-up.is-out { animation: none; } }
.maplibregl-ctrl-bottom-right .maplibregl-ctrl-group:has(.maplibregl-ctrl-geolocate) { display: none; }
.map-button { display: inline-flex; align-items: center; justify-content: center; width: var(--map-ctrl); height: var(--map-ctrl); padding: 0; pointer-events: auto; color: var(--ink); background: transparent; border-radius: var(--r-sm); corner-shape: var(--canto); }
.map-button svg { display: block; width: 18px; height: 18px; }
.map-layer-menu { position: absolute; z-index: 3; bottom: var(--s-4); left: var(--s-4); }
.map-layer-menu[open] { z-index: 9; }
.density-detail { padding: var(--s-3); color: var(--ink); font-family: var(--font); }
.density-detail h2 { font-size: var(--t-item); font-weight: var(--peso-forte); padding-right: var(--s-6); }
.density-detail p { font-size: var(--t-meta); font-weight: var(--peso-medio); color: var(--muted); margin-top: var(--s-2); }
.maplibregl-popup:has(.density-detail) .maplibregl-popup-content { padding: 0; border-radius: var(--r-md); box-shadow: var(--shadow); }
.maplibregl-popup:has(.density-detail) .maplibregl-popup-close-button { width: 48px; height: 48px; font-size: var(--t-item); color: var(--ink); }
.map-layer-menu summary { display: inline-flex; align-items: center; gap: var(--s-2); min-height: 44px; padding: 0 var(--s-3); cursor: pointer; list-style: none; background: var(--surface); border-radius: var(--r-md); corner-shape: var(--canto); box-shadow: var(--shadow); font-size: var(--t-body); font-weight: var(--peso-forte); }
.map-layer-menu summary::-webkit-details-marker { display: none; }
.map-layer-menu[open] summary { background: var(--ink); color: var(--on-ink); }
.map-layer-popover { position: fixed; z-index: var(--z-pop); width: 264px; overflow: hidden; background: var(--surface); border-radius: var(--r-md); corner-shape: var(--canto); box-shadow: var(--shadow); }
.map-layer-scroll { max-height: inherit; padding: var(--s-3); overflow-y: auto; overscroll-behavior: contain; }
.map-layer-popover section > p { padding: var(--s-1) var(--s-2) var(--s-2); color: var(--muted); font-size: var(--t-meta); font-weight: var(--peso-forte); }
.map-styles { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: var(--s-2); padding: 0 var(--s-2) var(--s-3); }
.map-styles > button { display: grid; gap: 0; min-width: 0; padding: 4px; border-radius: var(--r-sm); corner-shape: var(--canto); color: var(--muted); font-size: var(--t-body); font-weight: var(--peso-forte); text-align: left; }
.map-styles > button[aria-checked=true] { background: var(--ink); color: var(--on-ink); }
.map-style-preview { display: block; width: 100%; height: 56px; overflow: hidden; border-radius: var(--r-sm); corner-shape: var(--canto); background-position: center; background-size: cover; }
.map-style-preview.is-light { background-image: url('./assets/map-style-map.svg'); }
.map-style-preview.is-satellite { background-image: url('./assets/map-style-satellite.svg'); }
.map-styles > button > span:last-child { display: flex; align-items: center; justify-content: space-between; min-height: 28px; padding: 0 var(--s-1); }
.map-styles > button > span:last-child svg { width: 16px; height: 16px; flex-shrink: 0; visibility: hidden; }
.map-styles > button[aria-checked=true] > span:last-child svg { visibility: visible; }
.map-styles > button:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.map-overlay-section { padding-top: var(--s-2); border-top: 1px solid var(--linha); }
.map-layers { display: grid; gap: var(--s-1); padding: 0 var(--s-2); }
.map-layers .sw-linha { min-height: 40px; }
.map-point-layers { display: grid; }
.map-layer-subtoggle { position: relative; padding-left: var(--s-6); }
.map-layer-subtoggle::before { content: ''; position: absolute; left: var(--s-2); top: calc(-1 * var(--s-2)); bottom: calc(50% - 1px); width: var(--s-2); border-left: 2px solid var(--muted); border-bottom: 2px solid var(--muted); border-bottom-left-radius: var(--s-1); pointer-events: none; }
.map-legend { display: grid; gap: var(--s-2); margin-top: var(--s-2); padding: var(--s-3) var(--s-2) var(--s-1); border-top: 1px solid var(--linha); color: var(--muted); font-size: var(--t-meta); font-weight: var(--peso-medio); }
.map-legend > span { display: flex; align-items: center; gap: var(--s-2); }
.map-layer-scroll > .map-credits { min-height: calc(4.5em + var(--s-4)); padding: var(--s-3) var(--s-2) var(--s-1); color: var(--muted); font-size: var(--t-meta); font-weight: var(--peso-medio); line-height: 1.5; }
.map-credits a { color: inherit; text-decoration: underline; text-decoration-color: var(--linha); text-underline-offset: 2px; }
.legend-line { display: block; flex-shrink: 0; width: 20px; height: 8px; fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round; }
.census-bar { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 4px 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--linha); font-size: var(--t-body); }
.census-bar span:first-child { min-width: 0; }
.census-track { grid-column: 1 / -1; height: 6px; background: var(--paper); border-radius: var(--r-pill); overflow: hidden; }
.census-track i { display: block; height: 100%; background: var(--ink); }
.imob-yoy { margin-left: 8px; font-size: var(--t-meta); font-weight: var(--peso-medio); color: var(--muted); }
.imob-spark { display: block; width: 100%; height: 32px; margin: var(--s-2) 0 var(--s-3); }
.imob-spark path { fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.imob-spark path.is-peer { stroke: var(--ink); stroke-opacity: 0.35; }
.imob-chart { display: block; width: 100%; height: auto; margin: var(--s-3) 0; }
.imob-chart path { fill: none; stroke: var(--ink); stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.imob-chart path.is-peer { stroke: var(--ink); stroke-opacity: 0.4; }
.imob-chart text { fill: var(--muted); font-size: var(--t-meta); font-weight: var(--peso-medio); }
.imob-series-list { max-height: 240px; overflow-y: auto; margin: var(--s-2) 0; }
.imob-series-row { display: grid; grid-template-columns: minmax(0,1.1fr) minmax(0,1fr) minmax(0,1fr); gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--linha); font-size: var(--t-meta); font-weight: var(--peso-medio); }
.imob-series-row.is-head { color: var(--muted); font-weight: var(--peso-forte); }
.imob-series-row strong { font-weight: var(--peso-medio); text-align: right; }
.imob-peers { display: flex; gap: 4px; margin: var(--s-3) 0; }
.imob-peers button { padding: 8px 12px; min-height: 36px; border-radius: var(--r-sm); font-size: var(--t-body); font-weight: var(--peso-forte); color: var(--muted); }
.imob-peers button[aria-pressed=true] { background: var(--ink); color: var(--on-ink); }
.imob-cmp-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 4px 8px; width: 100%; margin: 0; padding: 10px 0; border: 0; border-bottom: 1px solid var(--linha); background: none; text-align: left; font: inherit; color: inherit; cursor: pointer; font-size: var(--t-body); font-weight: var(--peso-forte); }
.imob-cmp-row small { color: var(--muted); font-size: var(--t-meta); font-weight: var(--peso-medio); }
.imob-cmp-row strong { font-size: var(--t-meta); font-weight: var(--peso-medio); }
.imob-cmp-row[aria-pressed=true] { background: var(--hover); }
.legend-line.planned { stroke-dasharray: 3 6; }
.map-status { position: absolute; top: 128px; left: var(--s-4); right: var(--s-4); padding: var(--s-4); background: var(--surface); font-size: var(--t-body); border-radius: var(--r-sm); box-shadow: var(--shadow); }
.planning-map-progress { position: absolute; left: var(--s-4); bottom: calc(var(--h-accao) + var(--s-4) + var(--s-2)); max-width: calc(100% - var(--s-8)); margin: 0; padding: var(--s-2) var(--s-3); background: var(--surface); color: var(--muted); font-size: var(--t-meta); font-weight: var(--peso-regular); border-radius: var(--r-md); corner-shape: var(--canto); box-shadow: var(--shadow); pointer-events: none; }
.analysis { min-width: 0; min-height: 0; background: var(--paper); border-radius: var(--r-lg); corner-shape: var(--canto); overflow: hidden; }
.analysis-inner { height: 100%; overflow-y: auto; padding: var(--s-6); }
.consultant-summary { display: none; }
.analysis-head h2 { font-size: var(--t-h1); font-weight: var(--peso-forte); margin: var(--s-3) 0; }
.analysis-head>p:last-child { color: var(--muted); font-size: var(--t-body); }
.stats { display: grid; grid-template-columns: repeat(5,1fr); gap: var(--s-4); padding: var(--s-6) 0; }
.stats>div { display: flex; flex-direction: column; gap: var(--s-2); }
.stats span { font-size: var(--t-meta); color: var(--muted); }
.stats strong { font-size: var(--t-h2); font-weight: var(--peso-forte); }
.rank-initials { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 28px; margin-right: 8px; border-radius: var(--r-pill); background: var(--paper); font-size: var(--t-meta); font-weight: var(--peso-forte); }
.analysis-lead { font-size: var(--t-body); line-height: 1.5; }
.work-chart { width: 100%; height: auto; display: block; }
.work-chart polyline { fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.work-chart text { font-size: var(--t-meta); font-weight: var(--peso-medio); fill: var(--muted); }
.team-analysis { background: var(--surface); border-radius: var(--r-lg); corner-shape: var(--canto); padding: var(--s-5); overflow: hidden; }
.team-analysis h3,.analysis-guide h2 { font-size: var(--t-body); font-weight: var(--peso-forte); margin-bottom: var(--s-3); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th { text-align: left; font-size: var(--t-meta); color: var(--muted); font-weight: var(--peso-forte); padding: 12px 8px; }
td { padding: 14px 8px; border-top: 1px solid var(--linha); font-size: var(--t-body); }
td button { font-size: var(--t-item); font-weight: var(--peso-medio); text-align: left; }
.analysis-note { font-size: var(--t-meta); color: var(--muted); line-height: 1.6; margin-top: var(--s-4); }
.funnel { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-3); }
.funnel>div { display: flex; flex-direction: column; gap: var(--s-2); }
.funnel span { font-size: var(--t-meta); color: var(--muted); }
.funnel strong { font-size: var(--t-h2); font-weight: var(--peso-forte); }
.team-analysis + .team-analysis { margin-top: var(--s-4); }
.analysis-guide p { font-size: var(--t-body); color: var(--muted); line-height: 1.6; margin-bottom: var(--s-6); }
.detail-content { padding: var(--s-3) 0; }
.detail-symbol { display: none; }
.detail-content h2 { font-size: var(--t-h2); font-weight: var(--peso-forte); line-height: 1.4; }
.detail-meta { color: var(--muted); font-size: var(--t-meta); margin-top: var(--s-2); }
.detail-facts { margin: var(--s-6) 0; }
.detail-facts>div { display: flex; justify-content: space-between; gap: var(--s-3); padding: 12px 0; border-bottom: 1px solid var(--linha); }
dt { color: var(--muted); font-size: var(--t-meta); } dd { font-size: var(--t-item); font-weight: var(--peso-medio); margin: 0; text-align: right; }
.detail-note { line-height: 1.6; margin: var(--s-3) 0 var(--s-6); }
.route-summary .route-facts { display:grid; gap:var(--s-3); margin:var(--s-5) 0; }
.route-summary .route-facts>div { border:0; padding:0; align-items:center; }
.route-facts dt { display:flex; align-items:center; gap:var(--s-2); }
.route-facts dt svg,.route-result-values dt svg { width:20px; height:20px; flex-shrink:0; }
.route-facts dd { max-width:60%; overflow-wrap:anywhere; }
.route-results { padding:var(--s-4); background:var(--paper); border-radius:var(--r-md); corner-shape:var(--canto); }
.route-result-values { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:var(--s-4); margin:var(--s-3) 0 0; }
.route-result-values dt { display:flex; align-items:center; gap:var(--s-2); }
.route-result-values dd { text-align:left; font-size:var(--t-h2); font-weight:var(--peso-forte); margin-top:var(--s-2); }
.route-context { margin-top:var(--s-5); }
.route-results { margin-top:var(--s-5); }
.route-weather-reading { display:flex; align-items:center; gap:var(--s-3); margin-top:var(--s-3); }
.route-weather-reading>svg { flex-shrink:0; }
.route-weather-reading>span { display:grid; gap:var(--s-1); }
.route-weather-reading strong { font-size:var(--t-item); font-weight:var(--peso-medio); }
.route-weather-reading small { color:var(--muted); font-size:var(--t-meta); }
.route-context .detail-meta a { color:inherit; text-underline-offset:3px; }
.route-street-list { list-style:none; padding:0; margin:var(--s-3) 0 0; display:grid; gap:var(--s-3); }
.route-street-list li { display:flex; align-items:center; gap:var(--s-2); font-size:var(--t-item); }
.route-street-list svg { flex-shrink:0; color:var(--muted); }
.route-linked-point { display:flex; align-items:center; gap:var(--s-3); margin-top:var(--s-3); }
.route-linked-point>span:last-child { display:grid; gap:var(--s-1); }
.route-linked-point strong { font-size:var(--t-item); font-weight:var(--peso-medio); }
.route-linked-point small { font-size:var(--t-meta); color:var(--muted); }
.route-summary .record-actions { margin-top:var(--s-5); }
.point-filter-tools { display: grid; gap: var(--s-2); margin: 0 var(--s-2) var(--s-4); }
#list-tools { margin-inline:var(--s-2); }
.point-symbol { position: relative; flex: 0 0 28px; width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; color: var(--ink); }
.point-spark { position:absolute; left:50%; top:50%; width:7px; height:2px; margin:-1px 0 0 -3.5px; background:var(--ink); border-radius:2px; pointer-events:none; }
@media(prefers-reduced-motion:reduce) { .point-spark { display:none; } }
.point-row { gap: var(--s-3); }
.point-row .point-symbol { align-self: flex-start; padding-top: 2px; }
.record-main small.point-due { color: var(--ink); font-weight: var(--peso-medio); }
.point-heading { display: flex; align-items: center; gap: var(--s-3); }
.point-state { font-size: var(--t-meta); font-weight: var(--peso-forte); color: var(--muted); }
.point-panel { height: 100%; min-height: 0; display: flex; flex-direction: column; gap: var(--s-4); padding: var(--s-2) 0 var(--s-5); }
.point-panel-heading { align-items: flex-start; }
.point-panel-identity { display: flex; align-items: center; gap: var(--s-3); min-width: 0; flex: 1; }
.point-panel-identity > .point-symbol { flex-basis: 40px; width: 40px; height: 40px; border-radius: var(--r-pill); color: var(--on-ink); background: var(--ink); }
.point-panel-copy { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.point-panel-kicker { display: flex; align-items: center; gap: var(--s-2); min-height: 16px; margin-top: 2px; }
.point-panel-kicker .detail-tipo { margin-bottom: 0; text-transform: none; letter-spacing: normal; }
.point-panel-close { width: 32px; height: 32px; }
.point-panel-close svg { width: 16px; height: 16px; }
.point-panel .detail-nome-wrap { width: 100%; }
.point-panel .detail-nome { width: 100%; }
.point-save-status { margin: 0; color: var(--muted); font-size: var(--t-meta); font-weight: var(--peso-medio); text-align: right; white-space: nowrap; }
.point-action-bar { display: grid; grid-template-columns: minmax(0,1fr) auto auto; align-items: center; gap: var(--s-2); }
.point-action-bar .point-action { width: auto; min-width: 0; max-width: none; white-space: nowrap; }
.point-action-primary { padding-inline: var(--s-4); }
.point-action-primary svg,.point-action-wait svg { width: 16px; height: 16px; }
.point-action-wait { padding-inline: var(--s-3); }
.point-action-wait.is-on { color: var(--on-ink); background: var(--ink); }
.point-action-lost { padding-inline: var(--s-2); }
.point-action:only-child { grid-column: 1 / -1; }
.point-followup { padding-top: var(--s-2); }
.point-origin-row { display: flex; align-items: center; gap: var(--s-2); }
.point-origin-row .campo-caixa { flex: 1; min-width: 0; }
.point-origin-row .icon-btn { flex-shrink: 0; }
.point-origin-links { display: grid; gap: var(--s-1); margin-top: var(--s-2); }
.point-origin-links:empty { display: none; }
.point-origin-link { display: flex; align-items: center; gap: var(--s-1); width: fit-content; max-width: 100%; }
.point-origin-link > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.point-origin-link .lixo svg { overflow: visible; }
.point-panel-heading,.point-workflow,.point-origin-block,.point-remove-actions { flex: 0 0 auto; }
.point-history-section { flex: 1; min-height: 0; }
.point-note-feed { flex: 1; min-height: 0; gap: 0; margin-inline: calc(-1 * var(--s-2)); padding-inline: var(--s-2); overflow-y: scroll; scrollbar-gutter: stable; }
.point-history-group { position: relative; display: block; padding-bottom: var(--s-3); }
.point-history-group:last-child { padding-bottom: 0; }
.point-history-group:not(:last-child)::before { content: ''; position: absolute; left: 6px; top: 11px; bottom: -5px; border-left: 1px dashed var(--placeholder); }
.point-history-entry { display: grid; grid-template-columns: 14px minmax(0,1fr); gap: var(--s-2); position: relative; }
.point-history-rail { position: relative; }
.point-history-rail i { position: absolute; left: 3px; top: 5px; width: 7px; height: 7px; border-radius: var(--r-pill); background: var(--ink); box-shadow: 0 0 0 2px var(--surface); }
.point-history-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.point-history-title { color: var(--ink); font-size: var(--t-body); font-weight: var(--peso-forte); line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.point-history-group.is-secondary .point-history-rail i { left: 4px; top: 6px; width: 5px; height: 5px; background: var(--placeholder); }
.point-history-group.is-secondary .point-history-title { font-weight: var(--peso-regular); }
.point-remove-actions { margin-top: auto; padding-top: var(--s-4); }
.point-hint { font-size: var(--t-body); color: var(--muted); line-height: 1.6; margin: var(--s-4) 0; }
.point-section { margin-top: var(--s-5); }
.point-section h3,.point-next h3 { font-size: var(--t-body); font-weight: var(--peso-forte); margin-bottom: var(--s-2); }
.point-section p,.point-next p { font-size: var(--t-body); line-height: 1.6; overflow-wrap: anywhere; }
.point-empty { color: var(--muted); }
.point-next { background: var(--paper); border-radius: var(--r-sm); padding: var(--s-4); margin: var(--s-4) 0; }
.point-next p:first-of-type { font-size: var(--t-meta); font-weight: var(--peso-medio); margin-bottom: var(--s-2); }

.points-empty { padding: var(--s-5) 0; }
.points-empty h2 { font-size: var(--t-h2); font-weight: var(--peso-forte); }
.points-empty p { font-size: var(--t-body); color: var(--muted); line-height: 1.6; margin-top: var(--s-3); }
.scope-options { overflow-y: auto; min-height: 0; }
.scope-option { width: 100%; padding: 10px; display: flex; align-items: center; gap: 12px; text-align: left; border-radius: var(--r-sm); corner-shape: var(--canto); }
.scope-option>span:nth-child(2) { flex: 1; }
.scope-option strong { display: block; font-size: var(--t-item); font-weight: var(--peso-medio); }
.scope-option small { display: block; font-size: var(--t-meta); font-weight: var(--peso-medio); color: var(--muted); margin-top: 4px; }
.scope-option[aria-pressed=true] { background: var(--paper); }
.scope-group { border-top: 1px solid var(--linha); padding: var(--s-2) 0; margin-top: var(--s-2); }
.scope-group h3 { padding: 10px; font-size: var(--t-meta); }
.sr-only,.skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link:focus { position: fixed; top: 8px; left: 8px; background: var(--surface); padding: 12px; z-index: var(--z-pop); }
@media (hover:hover) { .record-row:hover,.scope-option:hover,.place-results button:hover,.imob-peers button:hover,.imob-cmp-row:hover,.map-button:hover,.route-tool-icon:not(:disabled):hover,.route-tool-button:not([aria-pressed=true]):not(:disabled):hover { background: var(--hover); } .quick-types button:not(.is-pending):hover { background: var(--surface); } .imob-peers button[aria-pressed=true]:hover { background: var(--ink); color: var(--on-ink); } .nav-button:not([aria-current=page]):hover { color: var(--on-ink); background: var(--linha-sobre-tinta); } .nav-button[aria-current=page]:hover { background: var(--surface); color: var(--ink); } td button:hover { text-decoration: underline; } }
@media (hover:hover) { .place-search-clear:hover { background: var(--paper); color: var(--ink); } }
@media (max-width: 1199px) { :root { --panel-w: 304px; } .stats { grid-template-columns: repeat(3,1fr); } }
@media (max-width: 899px) {
  .app-shell { display: flex; flex-direction: column; height: 100svh; padding: 0; gap: 0; }
  .scope-trigger { top: 76px; left: 20px; right: auto; max-width: calc(100vw - 152px); }
  main { flex: 1; min-height: 0; padding: 0 var(--s-2); }
  .workspace { display: flex; flex-direction: column; gap: 0; }
  .work-panel { flex: 1; min-height: 0; padding: var(--s-3) var(--s-2) 0; }
  .map-area { flex: 1; min-height: 0; }
  body[data-page=map] .work-panel { display: none; }
  body[data-page=map]:has(#back-detail:not([hidden])) .work-panel { display: flex; }
  body:not([data-page=map]):not([data-page=dados]) .map-area { display: none; }
  body[data-page=dados] .map-area { display: block; order: 0; flex: 1 1 42%; min-height: 180px; }
  body[data-page=dados] .work-panel { order: 1; flex: 1 1 58%; min-height: 200px; }
  .rail { order: 4; flex-direction: row; border-radius: 0; background: var(--surface); padding: var(--s-2) var(--s-3) calc(var(--s-2) + env(safe-area-inset-bottom)); width: auto; }
  #navigation { flex-direction: row; justify-content: space-around; gap: 0; }
  .nav-button { width: auto; min-width: 48px; height: auto; min-height: 48px; flex-direction: column; gap: 2px; padding: 4px 6px; color: var(--muted); font-size: var(--t-meta); font-weight: var(--peso-forte); }
  .nav-button span { display: block; }
  .nav-button[aria-current=page] { background: var(--ink); color: var(--on-ink); }
  .rail-out { margin-top: 0; margin-left: auto; }
  .map-button,.imob-peers button,.imob-cmp-row { min-height: 48px; }
  .record-row { min-height: 64px; }
  .point-filter-tools .dt-trigger,.point-locate { min-height: 48px; }
  .map-layers .sw-linha { min-height: 48px; }
  .map-layers { gap: 0; }
  .map-point-layers { gap: 0; }
  .map-layer-subtoggle::before { top: calc(-1 * var(--s-3)); }
  .place-results button { min-height: 48px; }
  .maplibregl-ctrl-group button { width: 48px; height: 48px; }
  .analysis { border-radius: var(--r-lg); flex: 1; }
  .analysis-inner { padding: var(--s-4); }
  body[data-page=analysis] .work-panel { flex: 0 0 auto; padding-top: 0; }
  .team-analysis .table-wrap { display: none; }
  .consultant-summary { display: grid; gap: var(--s-3); }
  .consultant-summary button { display: grid; gap: var(--s-2); text-align: left; padding: var(--s-3) 0; min-height: 48px; }
  .consultant-summary strong { font-size: var(--t-item); font-weight: var(--peso-medio); }
  .consultant-summary span { font-size: var(--t-body); color: var(--muted); }
  body[data-page=analysis] .panel-content,body[data-page=analysis] .panel-heading { display: none; }
  body[data-page=analysis] .search-box { display: none; }
  .analysis-head h2 { font-size: var(--t-h2); }
  .stats { grid-template-columns: repeat(3,1fr); }
  .funnel { grid-template-columns: repeat(2, 1fr); }
  .team-analysis { padding: var(--s-4); }
  .scope-option { min-height: 56px; margin-bottom: var(--s-2); }
}

/* Point creation: the draft stays mounted while choosing a location. */

.point-editor { display: grid; gap: var(--s-4); padding: var(--s-2) 0 var(--s-5); }
.editor-demo,.editor-optional,#editor-location-label { color: var(--muted); font-size: var(--t-meta); font-weight: var(--peso-medio); }
.point-editor fieldset { border: 0; padding: 0; min-width: 0; }
.point-editor legend { font-weight: var(--peso-forte); margin-bottom: 12px; }
.point-type-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.point-type-options label { position: relative; display: flex; gap: 8px; align-items: center; padding: 12px 8px; border: 1px solid var(--linha); border-radius: var(--r-sm); cursor: pointer; }
.point-type-options label:has(:checked) { background: var(--paper); border-color: var(--ink); }
.point-type-options input { position: absolute; opacity: 0; width: 1px; }
.point-type-options label:has(:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }
.editor-field { display: grid; gap: var(--s-2); font-weight: var(--peso-medio); }
.editor-field textarea { resize: vertical; }
.detail-field .escolha,
.detail-field .dt-ancora,
.point-filter-tools .escolha,
#quick-point .escolha {
  width: 100%;
  min-width: 0;
}

#editor-error:empty { display: none; }
#editor-error { font-size: var(--t-body); font-weight: var(--peso-regular); color: var(--ink); }
.pick-help { position: absolute; z-index: 3; top: 16px; left: 16px; right: 16px; background: var(--surface); border-radius: var(--r-md); padding: 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; box-shadow: 0 4px 20px #0002; }
.pick-help[hidden] { display: none; }
body[data-picking=true] .map-top { visibility: hidden; }
button:disabled { opacity: .45; cursor: default; }
@media(max-width:899px) {
  .scope-trigger { min-width: 0; }
  body[data-editor=true] .work-panel { display: flex; }
  body[data-picking=true] .work-panel { display: none; }
  body[data-picking=true] .map-area { display: block; }
  .pick-help { flex-direction: column; align-items: stretch; }
}
.point-editor { grid-template-columns: minmax(0,1fr); }
.point-editor > * { min-width: 0; }

.point-type-options { grid-template-columns: repeat(2,minmax(0,1fr)); }
.point-editor > label:has(> input[type=checkbox]) { display: flex; gap: 8px; align-items: center; min-height: 48px; font-size: var(--t-body); }

.point-remove-button { margin: var(--s-4) 0 0; min-height: 48px; width: 100%; }
#confirm-dialog { border: 0; border-radius: var(--r-md); padding: 20px; width: min(320px,calc(100vw - 32px)); margin: auto; background: var(--surface); color: var(--ink); }
#confirm-dialog::backdrop { background: var(--marca); }
#confirm-dialog h2 { font-size: var(--t-h2); font-weight: var(--peso-forte); margin-bottom: var(--s-3); }
#confirm-dialog p { font-size: var(--t-body); line-height: 1.6; }
#confirm-dialog .accoes { margin-top: var(--s-4); }

#route-results { display: grid; gap: var(--s-2); }
.route-points { display: grid; gap: 2px; }
.route-point { display: grid; grid-template-columns: 28px minmax(0,1fr) auto; align-items: center; column-gap: var(--s-3); width: 100%; min-height: 48px; padding: 6px 8px; border-radius: var(--r-sm); corner-shape: var(--canto); text-align: left; color: var(--muted); }
.route-point.is-on { color: var(--ink); }
.route-point .point-symbol { color: inherit; }
.route-point-copy { display: grid; min-width: 0; }
.route-point-copy strong { font-size: var(--t-item); font-weight: var(--peso-medio); line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.route-point-copy small,.route-point time { font-size: var(--t-meta); font-weight: var(--peso-medio); color: var(--muted); line-height: 1.3; }
.route-point time { font-variant-numeric: tabular-nums; }
.route-point.is-on time { color: var(--work-color); }
@media (hover:hover) { .route-point:hover { background: var(--hover); } }
.point-editor .point-heading h2 { font-size: var(--t-h2); }
#quick-point { position: fixed; z-index: var(--z-pop); border: 0; border-radius: var(--r-md); corner-shape: var(--canto); padding: var(--s-4); width: min(288px,calc(100vw - 32px)); margin: auto; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
#quick-point::backdrop { background: var(--marca); }
.quick-point-head { display: grid; gap: var(--s-1); margin-bottom: var(--s-3); }
#quick-point h2 { font-size: var(--t-h2); font-weight: var(--peso-forte); }
.quick-point-head p { color: var(--muted); font-size: var(--t-body); font-weight: var(--peso-regular); line-height: 1.4; }
.quick-owner { margin-bottom: var(--s-3); }
.quick-owner .detail-label { display: block; margin-bottom: var(--s-2); }
.quick-types { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; padding: 4px; background: var(--paper); border-radius: var(--r-md); corner-shape: var(--canto); }
.quick-types button { display: flex; align-items: center; gap: var(--s-2); min-height: 48px; padding: 0 10px; border-radius: var(--r-sm); corner-shape: var(--canto); font-weight: var(--peso-medio); text-align: left; }
.quick-types button.is-pending { background: var(--ink); color: var(--on-ink); }
.quick-types button:disabled { opacity: .45; }
#quick-error { margin-top: var(--s-2); color: var(--ink); font-size: var(--t-body); font-weight: var(--peso-regular); line-height: 1.4; }
#quick-error:empty { display: none; }
#quick-close { display: flex; margin: var(--s-2) auto 0; min-height: var(--h-btn); }
#quick-notice { position: fixed; bottom: 108px; left: 50%; transform: translateX(-50%); padding: 12px 16px; background: var(--ink); color: var(--on-ink); border-radius: var(--r-sm); z-index: 20; display: flex; align-items: center; gap: 12px; max-width: calc(100% - 24px); }
#quick-notice[hidden] { display:none; }
#undo-point { color: var(--on-ink); font-size: var(--t-body); font-weight: var(--peso-forte); text-decoration: underline; min-height:48px; }

/* The map and record share the viewport, including during automatic editing. */
.drawer-toggle { display: none; }
@media(max-width:899px) {
  .point-panel-close { display: none; }
  .point-panel { height: 100%; min-height: 0; }
  body[data-detail=true] .workspace { display: flex; flex-direction: column; }
  body[data-detail=true] .workspace .map-area { display: block; order: 0; flex: 1 1 0; min-height: 120px; }
  body[data-detail=true] .workspace .work-panel { display: flex; order: 1; flex: 0 0 36%; min-height: 200px; max-height: 64%; border-top: 1px solid var(--linha); padding-top: 0; }
  body[data-detail=true][data-expanded=true] .workspace .work-panel { flex-basis: 64%; }
  body[data-detail=true] .drawer-toggle { display: block; flex-shrink: 0; min-height: 48px; font-size: var(--t-body); font-weight: var(--peso-forte); color: var(--muted); touch-action: manipulation; }
  body[data-detail=true] .panel-heading { padding-top: 0; padding-bottom: 8px; }
  body[data-detail=true] .map-legend { display: none; }
  body[data-detail=true] .map-layers { bottom: 12px; }
  body[data-detail=true] .detail-content { padding-top: 0; }
}
@media(min-width:900px) {
  body[data-detail-kind=point] .panel-heading { display: none; }
  body[data-detail-kind=point] #panel-content { padding-top: var(--s-2); }
  #panel-content:has(> .point-panel) { overflow: hidden; }
}
.drawer-toggle { touch-action: none; }
@media(max-width:899px) {
 #panel-content:has(> .point-panel) { overflow: hidden; }
 body[data-detail=true]:not([data-editor=true]) .panel-heading { display: none; }
 body[data-detail=true]:not([data-editor=true]) .drawer-toggle { position: relative; }
 body[data-detail=true][data-editor=true] .drawer-toggle { position: relative; z-index: 1; }
 body[data-detail=true][data-editor=true] #panel-content { position: relative; z-index: 2; }
}
.drawer-close { display: none; }
@media(max-width:899px) {
 body[data-detail=true] .work-panel { position: relative; }
 body[data-detail=true] .drawer-toggle { padding-right: 100px; }
 body[data-detail=true] .drawer-close { display: block; position: absolute; right: 8px; top: 0; min-height: 48px; font-size: var(--t-body); font-weight: var(--peso-forte); z-index: 1; }
}
.route-draw-bar,
.route-photo-edit { display: none; }
.route-draw-bar {
  position: absolute; z-index: 4; left: 8px; right: 8px; bottom: 8px;
  flex-direction: column; gap: var(--s-3); padding: var(--s-3);
  background: var(--surface); border-radius: var(--r-md); box-shadow: var(--shadow);
  pointer-events: auto;
}
.route-map-heading { display: flex; align-items: end; justify-content: space-between; gap: var(--s-3); }
.route-map-heading > div { display: grid; gap: 2px; }
.route-map-heading strong { font-size: var(--t-body); font-weight: var(--peso-forte); }
.route-draw-status { margin: 0 0 2px; color: var(--muted); font-size: var(--t-meta); font-weight: var(--peso-medio); white-space: nowrap; }
.route-draw-status:empty { display: none; }
.route-draw-owner { display: grid; gap: 8px; }
.route-draw-tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); }
.route-draw-tools .btn-ghost.is-linha { min-height: var(--h-mini); }
.route-map-tools { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 4px; padding: 4px; background: var(--paper); border-radius: var(--r-md); }
.route-mobile-tool { display: grid; place-items: center; align-content: center; gap: 4px; min-width: 0; min-height: 56px; padding: 4px; border-radius: var(--r-sm); color: var(--ink); touch-action: manipulation; }
.route-mobile-tool svg { display: block; width: 19px; height: 19px; overflow: visible; }
.route-mobile-tool span { max-width: 100%; overflow: hidden; font-size: var(--t-body); font-weight: var(--peso-forte); line-height: 1.1; text-overflow: ellipsis; white-space: nowrap; }
.route-mobile-tool[aria-pressed=true] { background: var(--work-color); color: var(--on-ink); }
.route-mobile-tool:disabled { color: var(--muted); opacity: .42; }
.route-draw-actions { margin-top: 0; }
.route-photo-edit {
  position: absolute; z-index: 4; top: 8px; right: 8px;
  width: 48px; height: 48px; align-items: center; justify-content: center;
  pointer-events: auto; background: var(--surface); color: var(--ink);
  border-radius: var(--r-md); box-shadow: var(--shadow);
}
@media(max-width:899px) {
  .map-create { right: 8px; bottom: 8px; }
  .map-layer-menu { left: 8px; bottom: 8px; }
  body[data-route-stage=draw] .route-draw-bar { display: contents; }
  body[data-route-stage=sheet] .route-photo-edit { display: inline-flex; }
  body[data-route-stage=draw] .workspace .work-panel { display: none; }
  body[data-route-stage=draw] .workspace .map-area { display: block; flex: 1 1 auto; min-height: 0; }
  body[data-route-stage=draw] .map-create,
  body[data-route-stage=draw] .map-layer-menu,
  body[data-route-stage=draw] .map-legend,
  body[data-route-stage=draw] .maplibregl-ctrl-bottom-right { display: none; }
  body[data-route-stage=sheet] .workspace .map-area {
    display: block; order: 0; flex: 0 0 148px; height: 148px;
    min-height: 148px; max-height: 148px; cursor: pointer;
  }
  body[data-route-stage=sheet] #map,
  body[data-route-stage=sheet] .maplibregl-control-container { pointer-events: none; }
  body[data-route-stage=sheet] .workspace .work-panel {
    display: flex; order: 1; flex: 1 1 auto; max-height: none; min-height: 0;
  }
  body[data-route-stage=sheet] .drawer-toggle,
  body[data-route-stage=sheet] .drawer-close,
  body[data-route-stage=sheet] .map-top,
  body[data-route-stage=sheet] .map-layer-menu,
  body[data-route-stage=sheet] .map-legend,
  body[data-route-stage=sheet] .maplibregl-ctrl-bottom-right,
  body[data-route-stage] #route-draw,
  body[data-route-stage] #route-draw-cancel,
  body[data-route-stage] #route-draw-tools,
  body[data-route-stage] #route-manual-label { display: none; }
}

/* Desktop keeps path and details together; mobile separates drawing from data. */
.route-editor { gap: 0; padding-top: 0; }
.route-draw-step,
.route-details { display: grid; gap: var(--s-4); }
.route-step-meta {
  margin: 0; font-size: var(--t-meta); font-weight: var(--peso-medio); color: var(--muted);
}
.route-step-lead { margin: 0; color: var(--ink); font-size: var(--t-body); line-height: 1.5; }
.route-path-status { margin: 0; color: var(--muted); font-size: var(--t-meta); font-weight: var(--peso-medio); }
.route-path-summary {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  min-height: var(--h-ctrl); padding-bottom: var(--s-4); border-bottom: 1px solid var(--linha);
}
.route-path-summary p { margin: 0; font-size: var(--t-body); font-weight: var(--peso-regular); }
.route-details { padding-top: var(--s-4); }
.route-section-title,
.route-coverage { display: flex; align-items: center; gap: var(--s-1); }
.route-section-title h3 { margin: 0; font-size: var(--t-body); font-weight: var(--peso-forte); }
.route-details > .accoes { margin-top: var(--s-2); }
body[data-route-stage=sheet] .route-draw-live { display: none; }
body[data-route-stage=sheet] .route-path-summary { display: flex; }
.route-details > .route-step-meta { display: none; }

@media(min-width:900px) {
  body[data-route-stage=draw] .map-create { display: none; }
  .route-editor #route-draw-tools,
  .route-editor #route-manual-toggle { display: none; }
}

@media(min-width:900px) and (max-width:1099px) {
  .route-desktop-tools .route-tool-button { width: 40px; padding: 0; }
  .route-desktop-tools .route-tool-button span { display: none; }
}

@media(max-width:899px) {
  .route-desktop-tools { display: none !important; }
  .route-map-tools {
    position: absolute; z-index: 4; right: 8px; top: 50%;
    display: grid; grid-template-columns: 48px; gap: 2px; padding: 4px;
    background: var(--surface); border-radius: var(--r-md); box-shadow: var(--shadow);
    overflow: hidden; transform: translateY(-50%);
  }
  .route-mobile-tool { display: flex; align-items: center; justify-content: center; width: 48px; min-height: 48px; padding: 0; }
  .route-mobile-tool span { display: none; }
  .route-draw-cancel {
    position: absolute; z-index: 4; top: 68px; left: var(--s-3);
    display: inline-flex; align-items: center; justify-content: center;
    width: 48px; height: 48px; padding: 0; color: var(--ink); background: var(--surface);
    border-radius: var(--r-md); box-shadow: var(--shadow);
  }
  .route-draw-actions { display: contents; }
  #route-map-done {
    position: absolute; z-index: 4; bottom: 8px; left: 50%;
    min-width: 168px; min-height: 48px; padding-inline: var(--s-5);
    border-radius: var(--r-md); box-shadow: var(--shadow); transform: translateX(-50%);
  }
  .route-editor .route-draw-step { display: none; }
  .route-details { padding-top: 0; }
  .route-details > .route-step-meta { display: block; }
  body[data-route-stage=draw] .route-details { display: none; }
}
/* A single 10px route node, centred inside an invisible hit target. */
.draft-node-handle { width: 36px; height: 36px; padding: 0; border: 0; background: transparent; display: grid; place-items: center; cursor: grab; }
.draft-node-handle::after { content: ''; width: 10px; height: 10px; background: var(--work-color); border-radius: var(--r-pill); box-shadow: 0 1px 3px #23262b40; pointer-events: none; }
.draft-node-handle.is-dragging { cursor: grabbing; }
.draft-node-handle.is-dragging::after { box-shadow: 0 0 0 3px #ffffffcc, 0 1px 4px #23262b40; }
@media(pointer:coarse) { .draft-node-handle { width: 48px; height: 48px; pointer-events: none; } }
html.toque.teclado-aberto .rail { display: none; }
html.toque.teclado-aberto .work-panel { transform: translateY(calc(var(--teclado, 0px) * -1)); }
.login-gate {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: var(--s-6);
}
.login-box {
  width: min(100%, 360px);
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}
.login-error { min-height: 1.4em; }
.login-retry { font-size: var(--t-meta); font-weight: var(--peso-medio); }
.identity button { margin-left: var(--s-2); }

/* App layout. Buttons, action groups and writing fields use brand components. */
.work-panel { overflow: hidden; }
.panel-heading .eyebrow { display: none; }
.panel-heading h1 { margin: 0; }
.section-title { padding-inline: var(--s-2); }
.record-main small,.record-description,.detail-meta,
.record-main strong { overflow-wrap: anywhere; }
.record-row > svg { opacity: 0; }
.record-row:focus-visible > svg { opacity: 1; }
.detail-content { padding: var(--s-2) var(--s-2) var(--s-5); }
.detail-facts { margin: var(--s-5) 0; }
.detail-facts > div { align-items: baseline; padding: var(--s-3) 0; }
.detail-facts dt { font-weight: var(--peso-medio); }
.record-actions,.point-actions { margin-block: var(--s-5); }
.detail-content > #detail-map { display: flex; margin: var(--s-3) auto 0; }
.point-remove-button { display: flex; margin-inline: auto; }
.point-editor .point-heading h2 { font-weight: var(--peso-forte); }
.editor-field { gap: var(--s-2); font-size: var(--t-meta); font-weight: var(--peso-forte); color: var(--muted); }
.time-ruler { display: flex; flex-direction: column; align-items: center; gap: var(--s-1); max-width: 100%; min-width: 0; user-select: none; }
.time-dial-wrap { position: relative; width: min(100%,320px); aspect-ratio: 320/184; touch-action: pan-y; }
.time-dial-track { position: absolute; inset: 0; cursor: crosshair; touch-action: pan-y; }
.time-dial-track:focus-visible { outline: 2px solid var(--work-color); outline-offset: 2px; border-radius: var(--r-lg); corner-shape: var(--canto); }
.time-dial-face { display: block; width: 100%; height: 100%; overflow: visible; }
.time-dial-base,.time-dial-fill,.time-dial-block { fill: none; stroke-linecap: round; }
.time-dial-base { stroke: var(--field); stroke-width: 18; }
.time-dial-fill { stroke: var(--work-color); stroke-width: 18; }
.time-dial-drag { fill: none; stroke: transparent; stroke-width: 38; stroke-linecap: round; pointer-events: stroke; cursor: grab; }
.time-dial-block { stroke: var(--work-color); stroke-width: 18; opacity: .1; }
.time-dial-block.is-locked { opacity: .08; }
.time-dial-block.is-over { opacity: .22; }
.time-dial-scale { pointer-events: none; }
.time-dial-hour line { stroke: var(--linha); stroke-width: 1.5; stroke-linecap: round; transition: stroke .16s ease,stroke-width .16s ease; }
.time-dial-hour text { fill: var(--muted); font-size: var(--t-meta); font-weight: var(--peso-medio); text-anchor: middle; dominant-baseline: middle; font-variant-numeric: tabular-nums; transition: fill .16s ease; }
.time-dial-hour.is-in line { stroke: var(--work-color); stroke-width: 2; }
.time-dial-hour.is-in text { fill: var(--work-color); }
.time-dial-mark { opacity: .3; fill: var(--muted); }
.time-dial-mark.is-in { opacity: 1; }
.time-dial-mark[data-type=contacto] { fill: var(--work-color); }
.time-dial-mark[data-type=indicacao] { fill: var(--work-color); }
.time-dial-mark[data-type=informador] { fill: var(--surface); stroke: var(--work-color); stroke-width: 1.5; }
.time-dial-reading { position: absolute; z-index: 1; left: 50%; top: 72%; width: 184px; transform: translate(-50%,-50%); display: grid; gap: var(--s-1); text-align: center; pointer-events: none; }
.time-dial-reading strong { display: flex; align-items: baseline; justify-content: center; gap: 5px; color: var(--work-color); font-size: var(--t-h2); font-weight: var(--peso-forte); line-height: 1; letter-spacing: var(--letra-titulo); font-variant-numeric: tabular-nums; }
.time-dial-value { min-width: 52px; min-height: 40px; padding: 2px; border-radius: 0; color: inherit; font: inherit; letter-spacing: inherit; pointer-events: auto; touch-action: none; cursor: ns-resize; border-bottom: 2px solid transparent; transition: color .12s ease,transform .12s ease; }
.time-dial-value.is-selected { color: var(--work-color); border-bottom-color: transparent; }
.time-dial-value.is-adjusting { color: var(--work-color); transform: scale(1.06); }
.time-dial-value:focus-visible { outline: none; box-shadow: none; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; }
.time-dial-joiner { font-size: var(--t-meta); font-weight: var(--peso-medio); color: var(--muted); }
.time-dial-reading > .time-dial-duration { color: var(--muted); font-size: var(--t-meta); font-weight: var(--peso-medio); line-height: 1.2; font-variant-numeric: tabular-nums; }
.time-dial-handle { position: absolute; z-index: 2; width: 48px; height: 48px; padding: 0; transform: translate(-50%,-50%); border: 0; background: transparent; border-radius: var(--r-pill); corner-shape: round; cursor: grab; touch-action: none; }
.time-dial-handle::before { content: ''; position: absolute; inset: 19px; border: 2px solid var(--surface); border-radius: var(--r-pill); corner-shape: round; background: var(--surface); box-shadow: 0 0 0 1px var(--work-color); }
.time-dial-handle::before { transition: transform .12s ease,box-shadow .12s ease; }
.time-dial-handle.is-selected::before,.time-dial-wrap[data-dragging] .time-dial-handle.is-selected::before { background: var(--work-color); }
.time-dial-wrap[data-dragging] .time-dial-handle.is-selected::before { transform: scale(1.35); box-shadow: 0 0 0 3px var(--surface),0 0 0 5px color-mix(in srgb,var(--work-color) 28%,transparent); }
.time-dial-handle:active { cursor: grabbing; }
.time-dial-handle:focus-visible { outline: none; box-shadow: none; }
.time-dial-handle:focus-visible::before { box-shadow: 0 0 0 2px var(--surface),0 0 0 4px color-mix(in srgb,var(--work-color) 42%,transparent); }
.time-ruler-help { margin: calc(var(--s-1) * -1) 0 0; min-height: 16px; color: var(--muted); font-size: var(--t-meta); font-weight: var(--peso-medio); line-height: 1.4; text-align: center; }
.editor-field textarea { min-height: 96px; resize: vertical; line-height: 1.6; }
.point-editor > p { line-height: 1.6; }
#route-help { color: var(--muted); }
#route-status { font-size: var(--t-meta); font-weight: var(--peso-medio); }
#route-error:empty,#route-results:empty { display: none; }
.quick-types button { font-size: var(--t-body); font-weight: var(--peso-forte); }
.scope-option[aria-pressed=true] { background: var(--ink); color: var(--on-ink); }
.scope-option[aria-pressed=true] small { color: var(--muted-sobre-tinta); }
.scope-option[aria-pressed=true] .avatar { background: var(--linha-sobre-tinta); }
.scope-group h3 { font-weight: var(--peso-forte); }
.analysis-inner { padding: var(--s-6); }
.analysis-head h2 { font-size: var(--t-h2); }
.stats { padding: var(--s-5) 0; border-bottom: 1px solid var(--linha); }
.stats span,.funnel span,.analysis-note { font-weight: var(--peso-medio); }
.team-analysis { background: transparent; padding: var(--s-5) 0; border-radius: 0; border-bottom: 1px solid var(--linha); }
.team-analysis + .team-analysis { margin-top: 0; }
.analysis-origin summary { cursor: pointer; font-size: var(--t-body); font-weight: var(--peso-forte); }
.analysis-origin[open] summary { margin-bottom: var(--s-3); }
.analysis-inner > .analysis-note { margin-bottom: var(--s-4); }
.rank-initials { background: var(--surface); font-size: var(--t-tiny); }
.consultant-summary button { border-radius: var(--r-sm); corner-shape: var(--canto); }
.consultant-summary button[aria-pressed=true] { background: var(--surface); }
@media (hover:hover) {
  .record-row:hover > svg { opacity: 1; }
  .scope-option[aria-pressed=true]:hover { background: var(--ink); }
}
@media (min-width:900px) {
  body[data-page=analysis] .workspace { grid-template-columns: minmax(0,1fr); grid-template-rows: auto minmax(0,1fr); gap: var(--s-3); }
  body[data-page=analysis] .work-panel { flex-direction: row; align-items: center; padding: 0 var(--s-2); gap: var(--s-6); }
  body[data-page=analysis] .panel-heading { padding: 0; }
  body[data-page=analysis] #list-tools { margin-left: auto; }
  body[data-page=analysis] .work-panel .search-box,
  body[data-page=analysis] .panel-content,
  body[data-page=analysis] #period-host { margin: 0; }
}
@media (max-width:899px) {
  .map-top { top: var(--s-3); left: var(--s-3); right: var(--s-3); width: auto; }
  .map-navigation { --map-ctrl: 48px; top: 68px; right: var(--s-3); }
  .map-create { right: 8px; bottom: 8px; }
  .map-layer-menu { left: 8px; bottom: 8px; }
  .map-layer-menu summary { min-height: var(--h-toque); display: flex; align-items: center; }
  .map-layer-popover { width: min(264px,calc(100vw - 40px)); }

  .analysis-inner { padding: var(--s-4); }
  .team-analysis { padding: var(--s-5) 0; }
  .consultant-summary button { padding: var(--s-3); }
  .point-editor .accoes { margin-top: var(--s-2); }
  .work-panel .panel-heading { padding-bottom: var(--s-3); }
  .record-row { margin-block: var(--s-2); }
  body[data-detail=true] .map-create { display: none; }
  body[data-detail=true] .map-layer-menu { display: none; }
  #quick-point[open] { inset: auto var(--s-2) calc(72px + env(safe-area-inset-bottom)) var(--s-2); width: auto; max-width: none; margin: 0; }
  .quick-types button { min-height: 56px; }
}

.map-layer-links { display: grid; border-top: 1px solid var(--linha); margin-top: var(--s-2); }
.map-layer-links button,.map-layer-back { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); min-height: 40px; padding: 0 var(--s-2); font-size: var(--t-body); font-weight: var(--peso-medio); }
.map-layer-links svg,.map-layer-back svg { width: 16px; height: 16px; }
.map-layer-back { justify-content: flex-start; color: var(--muted); }
.map-layer-title { padding: var(--s-3) var(--s-2) var(--s-2); font-size: var(--t-item); font-weight: var(--peso-forte); }
.map-point-legend { display: grid; gap: var(--s-2); padding: var(--s-3) var(--s-2); }
.map-point-legend span { display: flex; align-items: center; gap: var(--s-2); font-size: var(--t-body); }
.map-point-legend svg { width: 20px; height: 20px; }
@media (pointer:coarse) { .map-layer-links button,.map-layer-back { min-height: 48px; } }

@media (max-width: 899px), (pointer: coarse) { .map-layer-scroll > .map-credits { min-height: calc(4.5em + var(--s-3)); padding-top: var(--s-2); } }

.scope-picker { position:fixed; z-index:8; top:24px; right:152px; max-width:calc(100vw - 32px); background:var(--ink); color:var(--on-ink); border-radius:24px; box-shadow:var(--shadow); overflow:hidden; }
.scope-picker .scope-trigger { position:relative; inset:auto; max-width:100%; width:100%; box-shadow:none; }
.scope-expansion { display:grid; grid-template-rows:0fr; visibility:hidden; transition:grid-template-rows 200ms ease,visibility 200ms; background:var(--ink); color:var(--on-ink); }
.scope-picker.is-open .scope-expansion { grid-template-rows:1fr; visibility:visible; }
.scope-clip { min-height:0; overflow:hidden; }
.scope-picker .scope-options { width:280px; max-width:calc(100vw - 32px); max-height:min(440px,calc(100svh - 180px)); padding:0 var(--s-2); }
.scope-picker.is-open .scope-options { padding:var(--s-2); }
.scope-picker .scope-option { min-height:56px; margin-bottom:var(--s-1); gap:var(--s-3); }
.scope-picker .scope-option:last-child { margin-bottom:0; }
.scope-option .avatar { position:relative; overflow:hidden; flex-shrink:0; }
.scope-option .avatar img { width:100%; height:100%; object-fit:cover; position:absolute; inset:0; }
.scope-picker .scope-group { margin-top:var(--s-1); padding:var(--s-1) 0; }
@media(max-width:899px) { .scope-picker { top:76px; left:20px; right:auto; } }
@media(prefers-reduced-motion:reduce) { .scope-expansion { transition:none; } }

.scope-expansion { width:0; transition:grid-template-rows 200ms ease,width 200ms ease,visibility 200ms; }
.scope-picker.is-open .scope-expansion { width:280px; }
.scope-picker .scope-option[aria-pressed=true] { background:var(--linha-sobre-tinta); color:var(--on-ink); }
.scope-picker .scope-option small { color:var(--recuo-sobre-tinta); }
.scope-picker .scope-option .avatar { background:var(--linha-sobre-tinta); color:var(--on-ink); }
.scope-picker .scope-group { border-color:var(--linha-sobre-tinta); }
.scope-picker .scope-option:focus-visible { box-shadow:var(--focus-ring-tinta); }
.scope-picker .scope-option[data-scope=consultant] small { display:none; }
@media(hover:hover) { .scope-picker .scope-option:not([aria-pressed=true]):hover { background:color-mix(in srgb,var(--linha-sobre-tinta) 50%,var(--ink)); } }
@media(prefers-reduced-motion:reduce) { .scope-expansion { transition:none; } }

.scope-picker .scope-option small:empty { display:none; }

.scope-chevron { display:inline-flex; margin-left:auto; transition:transform 180ms ease; }
.scope-option[aria-expanded=true] .scope-chevron { transform:rotate(90deg); }
.scope-picker .scope-members { display:grid; grid-template-rows:0fr; visibility:hidden; padding-left:var(--s-4); transition:grid-template-rows 180ms ease,visibility 180ms; }
.scope-picker .scope-members.is-open { grid-template-rows:1fr; visibility:visible; }
.scope-members-clip { min-height:0; overflow:hidden; }
@media(prefers-reduced-motion:reduce) { .scope-picker .scope-members { transition:none; } }
@media(prefers-reduced-motion:reduce) { .scope-chevron { transition:none; } }

.scope-team-symbol { display:inline-flex; align-items:center; justify-content:center; width:32px; height:32px; flex-shrink:0; }
.scope-picker .scope-option[aria-pressed=true] { box-shadow:inset 0 0 0 1px var(--placeholder-sobre-tinta); }
.period-row { display:grid; gap:var(--s-2); margin:var(--s-3) 0; }
#period-date { min-width:0; }

.route-drawing-check { display: grid; gap: var(--s-3); }
@media(max-width:899px) {
  .map-area > .route-drawing-check {
    position: absolute; z-index: 5; bottom: calc(72px + env(safe-area-inset-bottom));
    left: var(--s-3); right: var(--s-3); padding: var(--s-3);
    background: var(--surface); border-radius: var(--r-md); box-shadow: var(--shadow);
  }
  .route-drawing-check > button { min-height: 48px; }
}
.route-drawing-check[hidden] { display: none; }

.territory-note { min-height: 3em; padding: var(--s-2); font-size: var(--t-meta); font-weight: var(--peso-medio); color: var(--muted); }
.territory-detail { padding: var(--s-3); color: var(--ink); font-family: var(--font); }
.territory-detail h2 { font-size: var(--t-item); font-weight: var(--peso-medio); padding-right: var(--s-6); }
.territory-detail p { font-size: var(--t-meta); font-weight: var(--peso-medio); color: var(--muted); margin-top: var(--s-2); }
.maplibregl-popup:has(.territory-detail) .maplibregl-popup-content { padding: 0; border-radius: var(--r-md); box-shadow: var(--shadow); }
.maplibregl-popup:has(.territory-detail) .maplibregl-popup-close-button { width: 48px; height: 48px; font-size: var(--t-item); color: var(--ink); }

.territory-view { width: calc(100% - var(--s-4)); margin: 0 var(--s-2); min-height: 48px; border: 0; background: transparent; color: var(--ink); font-size: var(--t-item); font-weight: var(--peso-medio); }

.census-group summary { min-height: 48px; display: flex; align-items: center; cursor: pointer; font-size: var(--t-item); font-weight: var(--peso-forte); }
.census-group dd { margin: 0; text-align: right; }
.census-actions { margin-bottom: var(--s-2); }
.data-topics { display: flex; gap: var(--s-3); padding: 0 var(--s-4); }
.data-topics button { min-height: 48px; color: var(--muted); font-size: var(--t-body); font-weight: var(--peso-forte); touch-action: manipulation; }
.data-topics button[aria-pressed=true] { color: var(--ink); }
.planning-label,.planning-panel h3,.planning-panel summary { font-size: var(--t-body); font-weight: var(--peso-forte); color: var(--ink); }
.planning-label { display: block; }
.planning-select { width: 100%; min-width: 0; min-height: 48px; border: 0; padding: 0 var(--s-2); background: var(--field); color: var(--ink); font-size: var(--t-item); font-weight: var(--peso-medio); }
.parcel-search { margin-top: var(--s-3); }
.parcel-search > div { display: flex; gap: var(--s-2); align-items: center; }
.parcel-search button { flex-shrink: 0; min-height: 48px; }
.planning-help,.planning-status { font-size: var(--t-body); font-weight: var(--peso-regular); color: var(--muted); margin: var(--s-2) 0; }
.planning-status { min-height: 2lh; }
.planning-panel summary { min-height: 48px; display: flex; align-items: center; cursor: pointer; touch-action: manipulation; }
.planning-chevron { display: inline-flex; margin-left: auto; }
.planning-panel details[open] > summary > .planning-chevron { transform: rotate(180deg); }
.planning-panel a { display: block; padding: var(--s-2) 0; font-size: var(--t-body); font-weight: var(--peso-forte); color: var(--ink); overflow-wrap: anywhere; }
.planning-panel img { display: block; width: 100%; height: auto; }
.planning-panel dl { margin: 0; font-size: var(--t-meta); font-weight: var(--peso-medio); }
.planning-panel dt { color: var(--muted); margin-top: var(--s-2); }
.planning-panel dd { margin: 0; overflow-wrap: anywhere; color: var(--ink); }
@media (pointer: coarse) { .planning-panel a { min-height: 48px; } }
.census-comparison { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: var(--t-body); white-space: normal; }
.census-comparison th,.census-comparison td { padding: 4px 0 4px var(--s-2); text-align: right; vertical-align: top; overflow-wrap: anywhere; }
.census-comparison th:first-child { width: 50%; padding-left: 0; text-align: left; }
.census-comparison thead th { font-weight: var(--peso-forte); }
.census-comparison tbody th { font-weight: var(--peso-regular); }
.imob-period { display: flex; align-items: center; gap: var(--s-2); }
.imob-period select { min-width: 0; max-width: 100%; min-height: var(--h-btn); border: 0; border-radius: var(--r-sm); corner-shape: var(--canto); padding: 0 var(--s-3); background: var(--field); color: var(--ink); }
@media (pointer: coarse) { .imob-period select { min-height: 48px; } }
