:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #eaf3f6;
  background: #06131d;
  --bg-deep: #04101a;
  --bg-shell: #06131d;
  --bg-map: #092333;
  --bg-panel: rgba(9, 30, 42, .9);
  --bg-float: rgba(7, 25, 36, .9);
  --bg-input: #071925;
  --bg-panel-foot: rgba(7, 25, 36, .82);
  --bg-read: #0f2a3a;
  --ink-hi: #fff;
  --ink: #eaf3f6;
  --ink-mid: #c3d6df;
  --ink-dim: #a8bdc6;
  --ink-mute: #8ca5b1;
  --ink-faint: #6f8995;
  --border: rgba(166, 205, 220, .28);
  --border-soft: rgba(166, 205, 220, .16);
  --border-hair: rgba(166, 205, 220, .1);
  --accent: #f6c64f;
  --accent-hover: #ffd977;
  --accent-ink: #17220f;
  --teal: #47d7c0;
  --teal-soft: #9defdf;
  --warn: #ff8c61;
  --shadow: 0 20px 50px rgba(0, 0, 0, .34);
}
* { box-sizing: border-box; }
html { width: 100%; height: 100%; background: var(--bg-shell); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { position: fixed; inset: 0; min-width: 320px; width: 100%; height: 100%; margin: 0; overflow: hidden; overscroll-behavior: none; background: var(--bg-shell); }
button, input, select { font: inherit; }
button, a, summary { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
[hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }
.topbar {
  position: fixed; z-index: 40; inset: 0 0 auto; height: 64px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px; background: rgba(6,19,29,.92); border-bottom: 1px solid rgba(166,205,220,.14); backdrop-filter: blur(12px);
}
.brand { display: inline-flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; }
.brand-copy { display: grid; gap: 1px; }
.brand strong { color: var(--ink-hi); font-size: 15px; line-height: 1.15; letter-spacing: -.02em; }
.brand small { color: var(--ink-mute); font-size: 10px; font-weight: 800; letter-spacing: .17em; }
.brand-mark { position: relative; display: inline-block; width: 30px; height: 30px; }
.brand-mark i { position: absolute; border: 1px solid var(--teal); border-radius: 50%; }
.brand-mark i:nth-child(1) { inset: 1px; opacity: .35; }
.brand-mark i:nth-child(2) { inset: 7px; opacity: .7; }
.brand-mark i:nth-child(3) { top: 13px; left: 13px; width: 5px; height: 5px; background: var(--accent); border-color: var(--accent); box-shadow: 0 0 10px var(--accent); }
.brand-mark::after { content: ""; position: absolute; left: 15px; bottom: 15px; width: 13px; height: 1px; background: var(--accent); transform: rotate(-38deg); transform-origin: left; }
.topbar nav { display: flex; align-items: center; gap: 28px; }
.topbar nav a { color: var(--ink-mute); font-size: 14px; text-decoration: none; }
.topbar nav a.active { color: var(--accent); font-weight: 600; }
.app-shell { position: fixed; inset: 64px 0 0; width: 100%; height: calc(100dvh - 64px); min-height: 0; overflow: hidden; }
.eyebrow { margin: 0 0 6px; color: var(--teal); font-size: 12px; font-weight: 800; line-height: 1.3; letter-spacing: .15em; text-transform: uppercase; }
.eyebrow.neutral { color: var(--ink-mute); letter-spacing: .1em; }
.helper { margin: 7px 0 0; color: var(--ink-mute); font-size: 13px; line-height: 1.5; }
.notice { padding: 14px 16px; background: #3a2a16; border: 1px solid #8d6930; border-radius: 8px; color: #ffe6b2; font-size: 14px; line-height: 1.5; box-shadow: var(--shadow); }
.notice strong, .notice span { display: block; }
.stale-notice { position: fixed; z-index: 60; top: 76px; left: 18px; right: 18px; }
.floating-status { position: fixed; z-index: 70; left: 18px; bottom: 18px; max-width: 440px; }
.fixture-banner { padding: 10px 12px; background: rgba(106,45,24,.95); border: 1px solid var(--warn); border-radius: 7px; color: #fff; font-size: 13px; }

/* Entry */
.entry-screen { height: 100%; overflow: auto; background: var(--bg-shell); }
.entry-content { width: min(760px, calc(100% - 40px)); min-height: 100%; margin: 0 auto; padding: 64px 0 48px; display: flex; flex-direction: column; justify-content: center; }
.entry-content h1 { margin: 0; color: var(--ink-hi); font-size: clamp(44px, 5vw, 60px); font-weight: 400; line-height: .98; letter-spacing: -.055em; text-wrap: pretty; }
.entry-lede { max-width: 620px; margin: 18px 0 0; color: var(--ink-mid); font-size: 19px; line-height: 1.5; text-wrap: pretty; }
.entry-search { position: relative; margin-top: 32px; }
.entry-search > label, .filter-block > label { display: block; margin-bottom: 9px; color: #cad9df; font-size: 14px; font-weight: 600; }
.search-wrap { position: relative; display: flex; align-items: center; min-width: 0; }
.search-wrap > span { position: absolute; left: 16px; z-index: 1; color: var(--teal); font-size: 20px; pointer-events: none; }
.search-wrap input, input[type="search"], input[type="text"], select { width: 100%; min-height: 44px; padding: 0 14px; color: var(--ink); background: var(--bg-input); border: 1px solid var(--border); border-radius: 6px; }
.search-wrap input { padding-left: 44px; }
input::placeholder { color: var(--ink-faint); opacity: 1; }
input:focus, select:focus { border-color: var(--teal); box-shadow: 0 0 0 4px rgba(71,215,192,.1); outline: 0; }
.entry-search-wrap input { min-height: 60px; padding-left: 48px; border-radius: 8px; font-size: 16px; }
.entry-search-wrap > span { left: 18px; }
.picker { position: relative; z-index: 20; padding: 0; margin: 8px 0 0; list-style: none; background: rgba(7,25,36,.98); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 18px 44px rgba(0,0,0,.5); overflow: hidden; }
.picker:empty { display: none; }
.picker li + li { border-top: 1px solid var(--border-hair); }
.picker button { width: 100%; min-height: 52px; padding: 9px 12px; color: var(--ink); background: transparent; border: 0; text-align: left; cursor: pointer; }
.picker button:hover { background: rgba(71,215,192,.08); }
.picker .count { float: right; margin-left: 12px; color: var(--teal); font-weight: 700; font-variant-numeric: tabular-nums; }
.picker .code { display: block; margin-bottom: 3px; color: var(--ink-mute); font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 12px; }
.entry-picker { position: absolute; left: 0; right: 0; }
.entry-suggestions { margin-top: 26px; }
.suggestion-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.suggestion-grid button { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 56px; padding: 10px 14px; color: var(--ink); background: rgba(9,30,42,.7); border: 1px solid var(--border-soft); border-radius: 8px; text-align: left; cursor: pointer; }
.suggestion-grid button:hover { border-color: var(--accent); }
.suggestion-grid button:disabled { cursor: wait; opacity: .72; }
.suggestion-grid span { font-size: 15px; }
.suggestion-grid strong { flex: none; color: var(--teal); font-size: 15px; font-variant-numeric: tabular-nums; }
.entry-geography { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 26px; color: var(--ink-dim); font-size: 14px; }
.entry-geography > div { display: flex; flex-wrap: wrap; gap: 8px; }
.entry-geography button { min-height: 38px; padding: 0 15px; color: var(--ink-mid); background: transparent; border: 1px solid var(--border); border-radius: 999px; cursor: pointer; }
.entry-geography button:hover { color: var(--accent); border-color: var(--accent); }
.trust-line { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 9px; color: var(--ink-dim); font-size: 13px; line-height: 1.45; }
.trust-line a { font-weight: 600; }
.trust-dot { width: 7px; height: 7px; flex: none; background: var(--teal); border-radius: 50%; box-shadow: 0 0 8px rgba(71,215,192,.5); }
.entry-trust { margin-top: 38px; padding-top: 18px; border-top: 1px solid var(--border-soft); }

/* Workspace */
.layout { position: relative; width: 100%; height: 100%; background: var(--bg-map); }
.workspace { position: absolute; inset: 0 392px 0 0; min-width: 0; background: var(--bg-map); }
.map-stage, .list-surface { position: absolute; inset: 0; overflow: hidden; background: var(--bg-map); }
#map { position: absolute; inset: 0; background: var(--bg-map); }
.surface-tabs, .map-level-control { position: absolute; z-index: 12; top: 20px; display: flex; padding: 3px; background: var(--bg-float); border: 1px solid var(--border-soft); border-radius: 8px; backdrop-filter: blur(12px); }
.surface-tabs { left: 24px; }
.map-level-control { left: 222px; }
.view-toggle button { min-height: 40px; padding: 0 20px; color: #9eb3bc; background: transparent; border: 0; border-radius: 5px; font-size: 14px; font-weight: 600; cursor: pointer; }
.surface-tabs button[aria-selected="true"], .export-toggle button[aria-pressed="true"] { color: var(--accent-ink); background: var(--accent); }
.map-level-control button[aria-pressed="true"] { color: var(--teal-soft); background: rgba(71,215,192,.16); }
.map-lens { position: absolute; z-index: 8; top: 80px; left: 24px; width: min(520px, calc(100% - 140px)); padding: 14px 52px 14px 16px; color: var(--ink); background: var(--bg-float); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,.3); backdrop-filter: blur(14px); transition: width .18s ease, padding .18s ease; }
.map-lens p { margin: 0; color: var(--ink-dim); font-size: 13px; line-height: 1.45; }
.map-lens .map-lens-context > span:first-child { color: var(--ink-mute); font-size: 12px; font-weight: 800; letter-spacing: .1em; }
.map-lens .map-lens-context strong { color: var(--ink); font-weight: 600; }
.map-lens .map-lens-total { margin-top: 4px; }
.map-lens .map-lens-total > strong { color: var(--accent); font-size: 34px; line-height: 1.1; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.map-lens-toggle { position: absolute; top: 8px; right: 8px; display: grid; place-items: center; width: 36px; min-height: 36px; padding: 0; color: var(--ink-mid); background: transparent; border: 1px solid var(--border-soft); border-radius: 7px; cursor: pointer; }
.map-lens-toggle:hover { color: var(--accent); border-color: var(--accent); }
.map-lens-toggle-icon { position: relative; display: block; width: 14px; height: 14px; }
.map-lens-toggle-icon::before, .map-lens-toggle-icon::after { content: ""; position: absolute; top: 50%; left: 50%; width: 14px; height: 2px; background: currentColor; border-radius: 999px; transform: translate(-50%, -50%); }
.map-lens-toggle-icon::after { transform: translate(-50%, -50%) rotate(90deg); opacity: 0; }
.map-lens-toggle[aria-expanded="false"] .map-lens-toggle-icon::after { opacity: 1; }
.map-lens.is-collapsed { width: auto; max-width: calc(100% - 140px); padding: 8px 48px 8px 12px; }
.map-lens.is-collapsed .map-lens-context, .map-lens.is-collapsed #map-lens-municipalities { display: none; }
.map-lens.is-collapsed .map-lens-total { margin: 0; white-space: nowrap; }
.map-count-marker { pointer-events: none; transform: translateY(-1px); }
.map-count-marker span { display: block; min-width: 52px; padding: 7px 10px; color: #f3fbfd; background: var(--bg-float); border: 1px solid rgba(71,215,192,.58); border-radius: 999px; box-shadow: 0 4px 14px rgba(0,0,0,.28); font-size: 13px; font-weight: 800; line-height: 1; text-align: center; white-space: nowrap; font-variant-numeric: tabular-nums; backdrop-filter: blur(8px); }
.map-count-marker.is-selected span { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.map-scale { position: absolute; z-index: 9; left: 24px; bottom: 20px; display: flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 11px; background: var(--bg-float); border: 1px solid var(--border-soft); border-radius: 10px; backdrop-filter: blur(12px); }
.map-scale span { color: var(--ink-mute); font-size: 12px; }
.map-scale i { width: 30px; height: 12px; border: 1px solid #667d86; }
.map-scale i:nth-of-type(1) { background: #123a44; }.map-scale i:nth-of-type(2) { background: #1c6a6a; }.map-scale i:nth-of-type(3) { background: #2ba393; }.map-scale i:nth-of-type(4) { background: #47d7c0; }
.map-scale b { width: 1px; height: 18px; margin: 0 3px; background: var(--border); }
.map-scale button { min-height: 36px; padding: 0; color: var(--accent); background: transparent; border: 0; font-size: 13px; font-weight: 600; cursor: pointer; }
.camera-dock { position: absolute; z-index: 11; right: 24px; bottom: 20px; display: flex; flex-direction: column; align-items: flex-end; gap: 14px; }
.camera-cluster { display: grid; padding: 4px; background: var(--bg-float); border: 1px solid var(--border-soft); border-radius: 10px; backdrop-filter: blur(12px); }
.camera-cluster .camera-button + .camera-button { border-top: 1px solid var(--border-soft); }
.camera-button { width: 44px; height: 44px; min-height: 44px; padding: 0; color: var(--ink); background: transparent; border: 0; border-radius: 6px; font-weight: 700; cursor: pointer; }
.camera-button.signal { color: var(--teal); }
.camera-button:disabled { color: var(--ink-faint); cursor: not-allowed; }
.chrome-button, .restore-chrome { min-height: 44px; padding: 0 14px; color: var(--ink); background: var(--bg-float); border: 1px solid var(--border-soft); border-radius: 10px; font-size: 13px; font-weight: 600; cursor: pointer; backdrop-filter: blur(12px); }
.panel-toggle { display: none; background: var(--bg-float); border: 1px solid var(--border-soft); border-radius: 10px; }
.restore-chrome { position: absolute; z-index: 30; right: 24px; top: 20px; color: var(--accent); }
.map-focus .topbar, .map-focus .control-deck, .map-focus .surface-tabs, .map-focus .map-level-control, .map-focus .map-lens, .map-focus .map-scale, .map-focus .camera-dock { opacity: 0; visibility: hidden; pointer-events: none; }
.map-focus .restore-chrome { display: block !important; }
.map-popover { position: absolute; z-index: 15; width: 274px; padding: 15px; background: var(--bg-panel); border: 1px solid rgba(71,215,192,.5); border-radius: 10px; box-shadow: 0 18px 44px rgba(0,0,0,.5); backdrop-filter: blur(16px); }
.map-popover > strong { display: block; padding-right: 34px; color: #fff; font-size: 16px; }
.popover-close { position: absolute; top: 8px; right: 8px; width: 36px; min-height: 36px; padding: 0; color: var(--ink-mid); background: transparent; border: 0; border-radius: 7px; font-size: 24px; line-height: 1; cursor: pointer; }
.popover-close:hover { color: var(--accent); background: rgba(246,198,79,.1); }
.map-popover p { margin: 9px 0 3px; color: var(--ink-dim); font-size: 13px; }
.map-popover p b { color: var(--teal); font-size: 26px; font-variant-numeric: tabular-nums; }
.map-popover small { display: block; color: var(--ink-mute); font-size: 12px; line-height: 1.45; }
.map-popover > div { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 13px; }
#preview-box { position: absolute; z-index: 20; left: 24px; bottom: 76px; max-width: 420px; padding: 14px; background: var(--bg-panel); border: 1px solid var(--accent); border-radius: 10px; box-shadow: var(--shadow); }
#preview-box p { margin: 0 0 8px; }

/* List */
.list-surface { padding: 78px 24px 24px; overflow: auto; }
.list-heading { margin-bottom: 20px; }
.list-heading > p { margin: 0; color: var(--ink-dim); font-size: 15px; }
.list-heading > p:first-child strong { color: var(--accent); font-size: 30px; line-height: 1.1; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.list-heading .trust-line { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border-soft); }
.list-toolbar { display: grid; grid-template-columns: minmax(220px,1fr) auto auto; gap: 10px; margin-bottom: 12px; }
.check-control, .sort-control { display: flex; align-items: center; min-height: 44px; padding: 0 12px; color: var(--ink-mid); background: var(--bg-float); border: 1px solid var(--border); border-radius: 6px; font-size: 14px; }
.check-control input { width: 16px; height: 16px; margin: 0 8px 0 0; accent-color: var(--teal); }
.sort-control select { width: auto; min-height: 38px; padding: 0 5px; border: 0; background: transparent; box-shadow: none; }
.list-table-scroll { overflow: auto; border: 1px solid var(--border-soft); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; }
.municipality-table { min-width: 760px; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--border-hair); color: var(--ink); font-size: 14px; text-align: left; }
th { color: #d9e7ec; background: rgba(7,25,36,.85); font-size: 13px; font-weight: 700; }
.municipality-table th:first-child, .municipality-table td:first-child { width: 44px; padding-left: 14px; }
.municipality-table td:nth-child(3) { color: var(--ink-dim); }.municipality-table td:nth-child(4) { color: var(--ink-mute); font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 12px; }.municipality-table td:last-child { width: 130px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.municipality-table input { width: 18px; height: 18px; accent-color: var(--accent); }
.state-label { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-mid); white-space: nowrap; }
.state-label::before { content: ""; width: 8px; height: 8px; background: var(--teal); border-radius: 2px; }.state-zero::before { background: #5d7684; }.state-not_imported::before { background: var(--accent); }.state-no_boundary::before, .state-unmapped::before { background: var(--warn); }.state-outside_selection::before { background: #536873; }
.list-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; color: var(--ink-dim); font-size: 13px; }
.list-footer button { min-height: 44px; color: var(--accent); background: transparent; border: 0; font-weight: 600; cursor: pointer; }

/* Panel */
.control-deck { position: absolute; z-index: 18; top: 4px; right: 24px; bottom: 12px; width: 344px; display: flex; flex-direction: column; overflow: hidden; background: var(--bg-panel); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); backdrop-filter: blur(18px); transition: transform .2s ease, opacity .2s ease; }
.panel-heading { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 18px 8px; }
.panel-heading h2 { margin: 0; color: #fff; font-size: 20px; font-weight: 400; letter-spacing: -.03em; }
.clear-button { min-height: 32px; padding: 0 10px; color: var(--ink-dim); background: transparent; border: 1px solid var(--border); border-radius: 6px; font-size: 12px; cursor: pointer; }
.control-body { flex: 1 1 auto; min-height: 0; padding: 0 18px 14px; overflow: auto; }
.filter-block { padding: 11px 0; border-bottom: 1px solid var(--border-soft); }
.filter-block select { font-size: 14px; }
.chip { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; margin: 0 6px 7px 0; padding: 0 6px 0 11px; color: var(--teal-soft); background: rgba(71,215,192,.12); border: 1px solid rgba(71,215,192,.42); border-radius: 999px; font-size: 12px; font-family: "JetBrains Mono", ui-monospace, monospace; }
.chip button { width: 22px; height: 22px; padding: 0; color: var(--teal-soft); background: rgba(71,215,192,.2); border: 0; border-radius: 50%; cursor: pointer; }
.export-toggle { display: grid; grid-template-columns: 1fr 1fr; padding: 3px; background: rgba(7,25,36,.72); border: 1px solid var(--border); border-radius: 6px; }
.export-toggle button { min-height: 36px; padding: 0 8px; border-radius: 4px; }
.export-preflight { margin: 8px 0; padding: 10px 12px; background: rgba(7,25,36,.6); border: 1px solid var(--border-soft); border-radius: 6px; }
.export-preflight p { margin: 0; color: var(--ink-dim); font-size: 13px; line-height: 1.45; }
.export-preflight small { display: block; margin-top: 4px; color: var(--ink-mute); font-size: 12px; line-height: 1.5; }
.primary-action, .secondary-action, #cnpj-search-button, #compare-save, #preview-box button { min-height: 44px; padding: 0 14px; border-radius: 6px; font-size: 14px; font-weight: 700; cursor: pointer; }
.primary-action { color: var(--accent-ink); background: var(--accent); border: 1px solid var(--accent); }
.primary-action:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.secondary-action { color: var(--accent); background: transparent; border: 1px solid var(--border); }
.export-block > .primary-action, .export-block > .secondary-action { width: 100%; margin-top: 8px; }
.primary-action:disabled { opacity: .55; cursor: not-allowed; }
.control-section { padding: 9px 0; border-bottom: 1px solid var(--border-soft); }
.control-section summary { min-height: 30px; color: #d9e7ec; font-size: 14px; font-weight: 600; cursor: pointer; list-style: none; }
.control-section summary::before { content: "▸"; display: inline-block; margin-right: 8px; color: var(--ink-mute); transition: transform .15s ease; }.control-section[open] summary::before { transform: rotate(90deg); }
.legend { display: grid; gap: 7px; padding: 7px 0 0; margin: 0; list-style: none; }.legend li { display: flex; align-items: center; gap: 8px; color: var(--ink-dim); font-size: 12px; line-height: 1.4; }.swatch { width: 22px; height: 14px; flex: none; border: 1px solid #667d86; }.swatch-value-5 { background: var(--teal); }.swatch-zero { background: #123a44; }.swatch-unmapped, .swatch-no_boundary { background: var(--warn); }.swatch-not_imported { background: var(--accent); }.swatch-outside { background: #536873; }
.selection-hud { padding: 10px 0; color: var(--ink-dim); font-size: 12px; }.selection-hud strong, .selection-hud span { display: block; margin-bottom: 4px; }.selection-hud button { min-height: 32px; padding: 0; color: var(--accent); background: transparent; border: 0; font-weight: 600; cursor: pointer; }
.record-search { padding: 12px 0 14px; background: transparent; border-bottom: 1px solid var(--border-soft); }.record-search .eyebrow { color: var(--ink-mute); }.cnpj-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }.cnpj-row input { min-width: 0; font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 13px; }.cnpj-row button { color: var(--accent); background: transparent; border: 1px solid var(--border); }
.record-search dl { max-height: 180px; margin: 8px 0 0; overflow: auto; }.record-search dl div { padding: 5px 0; border-top: 1px solid var(--border-hair); }.record-search dt { color: var(--ink-mute); font-size: 11px; }.record-search dd { margin: 2px 0 0; color: var(--ink); font-size: 12px; }
.sheet-grabber { display: none; }
.radar-notice { position: static; margin: 4px 0 8px; box-shadow: none; }

/* Analysis */
.data-deck { position: fixed; z-index: 50; inset: 80px 32px 24px; padding: 24px; overflow: auto; color: var(--ink); background: rgba(9,30,42,.98); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 28px 70px rgba(0,0,0,.58); backdrop-filter: blur(18px); }
.deck-heading, .module-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }.deck-heading h2 { margin: 0; font-size: 28px; font-weight: 400; }.icon-button { width: 44px; height: 44px; color: var(--ink); background: transparent; border: 1px solid var(--border); border-radius: 8px; font-size: 22px; cursor: pointer; }
.deck-module { margin-top: 22px; padding: 18px; background: rgba(7,25,36,.55); border: 1px solid var(--border-soft); border-radius: 10px; }.deck-module h3 { margin: 0 0 12px; font-size: 18px; }.scroll { overflow: auto; }.save-selection { display: flex; gap: 8px; }.save-selection input { min-width: 220px; }.save-selection button { color: var(--accent-ink); background: var(--accent); border: 0; }.data-deck footer { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--border-soft); color: var(--ink-dim); font-size: 13px; line-height: 1.5; }

@media (pointer: coarse) { button, summary, input, select { min-height: 44px; } }
@media (max-width: 960px) {
  .workspace { inset-right: 0; inset: 0; }
  .control-deck { top: auto; left: 12px; right: 12px; bottom: max(10px, env(safe-area-inset-bottom)); width: auto; max-height: 520px; }
  .control-deck.is-collapsed { transform: translateY(calc(100% + 24px)); opacity: 0; pointer-events: none; }
  .panel-toggle { display: block; }
  .camera-dock { right: 14px; bottom: 14px; }
  .map-scale { bottom: 14px; }
  .list-surface { padding-bottom: 210px; }
}
@media (max-width: 700px), (max-height: 540px) and (max-width: 960px) {
  .topbar { height: 58px; padding: 0 14px; }.topbar nav { gap: 16px; }.topbar nav a { font-size: 13px; }.brand-copy small { display: none; }
  .app-shell { inset: 58px 0 0; height: calc(100dvh - 58px); }
  .explorer-open .topbar { display: none; }.explorer-open .app-shell { inset: 0; height: 100dvh; }
  .entry-content { justify-content: flex-start; width: calc(100% - 28px); padding: 48px 0 32px; }.entry-content h1 { font-size: 44px; }.entry-lede { font-size: 17px; }.suggestion-grid { grid-template-columns: 1fr; }.entry-trust a { width: 100%; margin-left: 16px; }
  .surface-tabs { top: 8px; left: 8px; right: auto; width: 112px; display: grid; grid-template-columns: 1fr 1fr; }.surface-tabs button { min-height: 44px; padding: 0 8px; font-size: 13px; }
  .map-level-control { top: 8px; left: 128px; right: 8px; display: grid; grid-template-columns: 1fr 1fr; }.map-level-control button { min-height: 44px; padding: 0 8px; font-size: 13px; }
  .map-lens { top: 62px; left: 8px; width: calc(100% - 16px); min-height: 0; padding: 9px 52px 9px 11px; }.map-lens .map-lens-context { display: flex; min-width: 0; gap: 5px; white-space: nowrap; }.map-lens .map-lens-context > span:first-child { display: none; }.map-lens .map-lens-context strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; }.map-lens .map-lens-total { margin-top: 2px; }.map-lens .map-lens-total > strong { font-size: 24px; }.map-lens-toggle { top: 5px; right: 5px; width: 44px; min-height: 44px; }.map-lens.is-collapsed { max-width: calc(100% - 64px); padding: 7px 52px 7px 11px; }
  .map-scale { display: none; }.camera-dock { right: 8px; bottom: calc(var(--sheet-obstruction, 112px) + 10px); gap: 8px; transition: bottom .2s ease; }.camera-cluster:first-child { display: none; }.chrome-button { display: none; }
  .control-deck { left: 0; right: 0; bottom: 0; max-height: none; height: min(48dvh, 430px); border-radius: 18px 18px 0 0; transform: translateY(0); box-shadow: 0 -14px 40px rgba(0,0,0,.4); transition: height .22s ease, transform .2s ease, opacity .2s ease; }.control-deck.sheet-collapsed { height: calc(124px + env(safe-area-inset-bottom)); }.control-deck.sheet-full { height: calc(100% - 8px); }.control-deck.sheet-dragging { transition: none; }
  .sheet-grabber { display: block; width: 100%; height: 44px; min-height: 44px; padding: 0; touch-action: none; cursor: ns-resize; background: transparent; border: 0; }.sheet-grabber span { display: block; width: 42px; height: 5px; margin: auto; background: #718b97; border-radius: 999px; }
  .panel-heading { order: 1; padding: 0 14px 6px; }.panel-heading h2 { display: block; font-size: 17px; }.panel-heading .eyebrow { display: none; }.clear-button { display: block; min-height: 36px; }
  .sheet-grabber { order: 0; }.control-body { order: 2; padding: 0 14px 16px; overscroll-behavior: contain; }.record-search { padding: 0 0 14px; }.record-search .eyebrow { margin-bottom: 5px; }
  .sheet-collapsed .panel-heading { display: none; }.sheet-collapsed .control-body { padding-bottom: max(10px, env(safe-area-inset-bottom)); overflow: hidden; }.sheet-collapsed .control-body > :not(.record-search) { display: none; }.sheet-collapsed .record-search { padding-bottom: 0; border-bottom: 0; }.sheet-collapsed .record-search #cnpj-status, .sheet-collapsed .record-search #cnpj-result { display: none; }
  .activity-search-open .control-deck { top: 0; height: 100%; border-radius: 0; }.activity-search-open .control-body { padding-top: 64px; }.activity-search-open .filter-block:not(.activity-filter), .activity-search-open .panel-heading, .activity-search-open .record-search, .activity-search-open .control-section, .activity-search-open .selection-hud { display: none; }.activity-search-open .activity-filter { position: absolute; inset: 0; padding: 16px 14px; background: var(--bg-shell); }.activity-search-open .activity-filter::before { content: "←  Buscar atividade"; display: block; margin-bottom: 14px; color: var(--ink); font-size: 15px; font-weight: 600; }
  .list-surface { padding: 72px 12px calc(var(--sheet-obstruction, 112px) + 24px); }.list-toolbar { grid-template-columns: 1fr; }.list-table-scroll { border-radius: 6px; }.list-footer { align-items: flex-start; }
  .data-deck { inset: 66px 8px 8px; padding: 16px 12px; }.deck-heading, .module-heading { align-items: flex-start; }.save-selection { flex-direction: column; }.save-selection input { min-width: 0; }
}
@media (max-width: 400px) {
  .topbar nav a:first-child { display: none; }.entry-content h1 { font-size: 40px; }.entry-lede { font-size: 16px; }.entry-geography { align-items: flex-start; }.surface-tabs { width: 104px; }.map-level-control { left: 120px; }.map-level-control button { padding: 0 5px; font-size: 12px; }.list-heading > p:first-child strong { font-size: 26px; }
}
@media (max-height: 540px) and (max-width: 960px) {
  .control-deck.sheet-collapsed { height: calc(120px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; } }
