/* Private Bank re-skin: pb-find screens (#map-tab "Look up an address", #score-tab "Score an area").
   Scoped per tab id. Layout rules live in min-width:901px so the mobile wizard / bottom-sheet
   layouts in styles.css and mobile-wizard.css are untouched on phones. */

/* New presentational markup is desktop-only. */
#map-tab .pb-find-head, #map-tab .pb-find-modes,
#score-tab .pb-find-head, #score-tab .pb-score-legend { display: none; }

@media (min-width: 901px) {
  /* ---------- shared screen frame ---------- */
  #map-tab, #score-tab {
    flex-direction: column; overflow-y: auto; overflow-x: hidden;
    padding: 40px 48px 32px; background: var(--pb-bg-app, #f7f4ec);
    font-family: var(--pb-body);
  }
  #map-tab > *, #score-tab > * { flex-shrink: 0; }
  #map-tab .pb-find-head, #score-tab .pb-find-head { display: block; margin-bottom: 24px; background: none; border: 0; padding: 0; }
  #map-tab .pb-find-head .pb-h1, #score-tab .pb-find-head .pb-h1 { font: 700 40px/1.1 var(--pb-display); letter-spacing: -.025em; color: var(--pb-ink); margin: 0; max-width: 24ch; }
  #map-tab .pb-find-head .pb-sub, #score-tab .pb-find-head .pb-sub { font: 400 18px/1.5 var(--pb-body); color: var(--pb-ink-3); margin: 12px 0 0; }
  #map-tab .pb-find-head .pb-eyebrow, #score-tab .pb-find-head .pb-eyebrow { font: 500 13px/1.3 var(--pb-mono); margin: 0 0 10px; }

  #map-tab .container, #score-tab .score-container { height: auto; width: 100%; }

  /* shared card + form look */
  #map-tab .search-section, #map-tab .whos-here-section, #map-tab .upload-section,
  #score-tab .score-sidebar, #score-tab .score-results {
    background: var(--pb-surface); border: 1px solid var(--pb-line); border-radius: 14px;
  }
  #map-tab input[type="text"], #score-tab select, #score-tab .ms-trigger, #map-tab .file-label {
    min-height: 48px; font: 400 16px/1.3 var(--pb-body); color: var(--pb-ink);
    background: var(--pb-surface-2); border: 1px solid var(--pb-line-strong); border-radius: 12px;
    padding: 10px 14px; box-shadow: none;
  }
  #map-tab input[type="text"]:focus, #score-tab select:focus, #score-tab .ms-trigger:focus-visible {
    outline: none; border-color: var(--pb-brand); box-shadow: var(--pb-focus);
  }
  #map-tab button, #score-tab button { min-height: 44px; }
  #map-tab button:focus-visible, #score-tab button:focus-visible { outline: none; box-shadow: var(--pb-focus); }

  /* ================= LOOK UP AN ADDRESS ================= */
  /* mode switcher */
  #map-tab .pb-find-modes {
    display: inline-flex; align-self: flex-start; gap: 4px; padding: 5px; margin-bottom: 20px;
    background: var(--pb-surface-2); border: 1px solid var(--pb-line); border-radius: 13px;
  }
  #map-tab .pb-seg-btn {
    font: 600 16px/1 var(--pb-display); min-height: 44px; padding: 0 20px; border: 0; border-radius: 9px;
    background: transparent; color: var(--pb-ink-3); cursor: pointer; white-space: nowrap; box-shadow: none;
    transition: background .15s ease, color .15s ease;
  }
  #map-tab .pb-seg-btn:hover { color: var(--pb-ink); }
  #map-tab .pb-seg-btn.active { background: var(--pb-brand); color: #fffdf8; }

  /* grid: lookup controls on top, map left, results right */
  #map-tab .container {
    display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); column-gap: 20px; row-gap: 0;
    align-items: start; position: relative; grid-template-rows: auto auto auto auto auto 1fr auto;
  }
  #map-tab .sidebar { display: contents; }
  #map-tab .sheet-grab, #map-tab .section-divider { display: none; }
  #map-tab .search-section, #map-tab .whos-here-section, #map-tab .upload-section {
    grid-column: 1 / -1; grid-row: 1; margin: 0 0 20px; padding: 22px 24px; display: none;
  }
  #map-tab[data-mode="one"] .search-section,
  #map-tab[data-mode="pin"] .whos-here-section,
  #map-tab[data-mode="list"] .upload-section { display: block; }
  #map-tab .search-section h2, #map-tab .whos-here-section h2, #map-tab .upload-section h2 {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
  #map-tab .search-section { background: var(--pb-surface); }
  #map-tab .search-bar { margin: 0; gap: 12px; }
  #map-tab .search-bar input { min-height: 56px; font-size: 18px; border-radius: 12px; }
  #map-tab .search-bar button {
    min-height: 56px; padding: 0 28px; font: 600 17px/1 var(--pb-display); border: 0; border-radius: 11px;
    background: var(--pb-brand); color: #fffdf8; box-shadow: 0 10px 26px -6px rgba(140,47,57,.5); cursor: pointer;
  }
  #map-tab .search-bar button:hover { background: var(--pb-brand-hover); }
  #map-tab .use-location-btn {
    margin-top: 14px; min-height: 44px; padding: 0 16px; font: 600 15px/1 var(--pb-body); color: var(--pb-ink-2);
    background: var(--pb-surface-2); border: 1px solid var(--pb-line); border-radius: 11px; display: inline-flex; align-items: center; gap: 8px;
  }
  #map-tab .use-location-btn:hover { background: var(--pb-surface-3); border-color: var(--pb-line-strong); }
  #map-tab .search-hint, #map-tab .whos-here-hint, #map-tab .csv-format-hint {
    font: 400 16px/1.5 var(--pb-body); color: var(--pb-ink-4); margin: 12px 0 0;
  }
  #map-tab .addr-suggest { border-radius: 12px; border: 1px solid var(--pb-line-strong); background: var(--pb-surface); font-size: 16px; }

  /* pin + radius */
  #map-tab .wh-locate-btn, #map-tab .wh-go-btn, #map-tab .run-btn {
    min-height: 48px; padding: 0 22px; font: 600 16px/1 var(--pb-display); border-radius: 11px; border: 1px solid transparent; cursor: pointer;
  }
  #map-tab .wh-locate-btn { background: var(--pb-surface-2); color: var(--pb-ink); border-color: var(--pb-line-strong); margin-top: 12px; width: auto; box-shadow: none; }
  #map-tab .wh-locate-btn:hover { background: var(--pb-surface-3); }
  #map-tab .wh-go-btn, #map-tab .run-btn {
    background: var(--pb-brand); color: #fffdf8; box-shadow: 0 10px 26px -6px rgba(140,47,57,.5); margin-top: 14px;
  }
  #map-tab .wh-go-btn:hover:not(:disabled), #map-tab .run-btn:hover { background: var(--pb-brand-hover); }
  #map-tab .wh-go-btn { width: auto; }
  #map-tab .wh-go-btn:disabled { opacity: .55; box-shadow: none; cursor: not-allowed; }
  #map-tab .whos-here-coords { font: 500 13px var(--pb-mono); color: var(--pb-ink-4); margin-top: 10px; }
  #map-tab .wh-radius-row { gap: 14px; margin-top: 14px; max-width: 520px; }
  #map-tab .wh-radius-row label { font: 500 13px var(--pb-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--pb-ink-4); margin: 0; }
  #map-tab .wh-radius-row input[type="range"] { accent-color: var(--pb-brand); min-height: 44px; background: transparent; border: 0; padding: 0; box-shadow: none; flex: 0 0 320px; width: 320px; -webkit-appearance: auto; appearance: auto; height: 44px; }
  #map-tab .wh-radius-val { font: 600 16px var(--pb-display); color: var(--pb-brand); min-width: 54px; }

  /* upload */
  #map-tab .upload-section { border-style: dashed; border-color: var(--pb-line-strong); }
  #map-tab .file-label {
    display: inline-flex; align-items: center; cursor: pointer; font-weight: 600; color: var(--pb-ink); margin: 0;
  }
  #map-tab .file-label:hover { border-color: var(--pb-brand); color: var(--pb-brand); }
  #map-tab .csv-format-hint code { font-family: var(--pb-mono); font-size: 14px; }

  /* map frame */
  #map-tab #map {
    grid-column: 1; grid-row: 2 / span 5; width: 100%; height: 600px; min-height: 0; flex: none;
    border: 1px solid var(--pb-line); border-radius: 14px; overflow: hidden; background: #ebe5d7;
    box-shadow: 0 24px 60px -34px rgba(20,33,61,.3);
  }
  #map-tab .map-spotlight { display: none; }
  #map-tab .map-scan-chip { font: 500 12px var(--pb-mono); letter-spacing: .05em; color: var(--pb-ink-4); border-radius: 10px; }
  #map-tab .map-scan-chip .scan-dot { background: var(--pb-good); box-shadow: 0 0 8px rgba(31,107,74,.5); }
  #map-tab .map-empty-card { background: var(--pb-surface); border: 1px solid var(--pb-line); border-radius: 14px; }
  #map-tab .map-empty-title { font: 700 24px var(--pb-display); color: var(--pb-ink); }
  #map-tab .map-empty-sub { font: 400 16px/1.55 var(--pb-body); color: var(--pb-ink-3); max-width: 380px; }
  #map-tab .map-empty-card { padding: 22px 26px; }
  #map-tab .map-empty-icon { display: none; }
  #map-tab .map-empty-icon-unused { background: rgba(140,47,57,.1); color: var(--pb-brand); }
  #map-tab .map-empty-row button, #map-tab .map-error-edit-btn {
    min-height: 48px; padding: 0 20px; font: 600 16px var(--pb-display); background: var(--pb-brand); color: #fffdf8; border: 0; border-radius: 11px; cursor: pointer;
  }
  #map-tab .map-empty-row input { min-height: 48px; }
  #map-tab .map-empty-chip {
    min-height: 44px; padding: 0 16px; font: 500 15px var(--pb-body); border-radius: 20px;
    background: var(--pb-surface-2); color: var(--pb-ink-2); border: 1px solid var(--pb-line);
  }
  /* dashed radius ring drawn by app.js (stroke #8c2f39, fill-opacity .05): navy dashed, as in the mock */
  #map-tab .leaflet-overlay-pane path[stroke="#8c2f39"][fill-opacity="0.05"] {
    stroke: var(--pb-ink); stroke-dasharray: 6 6; stroke-width: 1.5px; fill: var(--pb-brand); fill-opacity: .05;
  }
  #map-tab .leaflet-container { font-family: var(--pb-body); background: #ebe5d7; }

  /* right column: status, results */
  #map-tab .status, #map-tab .error-message, #map-tab .summary-bar, #map-tab .customer-list { grid-column: 2; margin: 0 0 14px; }
  #map-tab .status { grid-row: 2; font: 500 16px/1.4 var(--pb-body); color: var(--pb-good); background: rgba(31,107,74,.08); border: 1px solid rgba(31,107,74,.22); border-radius: 12px; padding: 12px 16px; }
  #map-tab .error-message { grid-row: 3; font: 500 16px/1.4 var(--pb-body); color: var(--pb-brand); background: rgba(140,47,57,.08); border: 1px solid rgba(140,47,57,.25); border-radius: 12px; padding: 12px 16px; }
  #map-tab .summary-bar { grid-row: 4; gap: 10px; background: transparent; border: 0; padding: 0; }
  #map-tab .summary-stat {
    background: var(--pb-surface-3); border: 1px solid var(--pb-line); border-radius: 12px; padding: 14px 16px;
    font: 400 14px var(--pb-body); color: var(--pb-ink-4);
  }
  #map-tab .summary-stat .num { font: 700 26px var(--pb-display); color: var(--pb-ink); }
  #map-tab .customer-list {
    grid-row: 5; background: var(--pb-surface); border: 1px solid var(--pb-line); border-radius: 14px; padding: 22px 24px;
  }
  #map-tab .customer-list h2 { font: 500 13px var(--pb-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--pb-ink-4); margin: 0 0 14px; }
  #map-tab .results-empty { padding: 24px 8px; color: var(--pb-ink-3); }
  #map-tab .results-empty-icon { background: rgba(140,47,57,.1); color: var(--pb-brand); }
  #map-tab .results-empty p { font-size: 17px; line-height: 1.5; }
  #map-tab .customer-item {
    background: var(--pb-surface-3); border: 1px solid var(--pb-line); border-left-width: 5px; border-radius: 12px;
    padding: 12px 16px; margin-bottom: 10px; cursor: pointer;
  }
  #map-tab .customer-item:hover { border-color: var(--pb-line-strong); transform: none; }
  #map-tab .customer-name { font: 600 17px var(--pb-display); color: var(--pb-ink); }
  #map-tab .customer-address { font-size: 15px; color: var(--pb-ink-3); }
  #map-tab .customer-persona { font-size: 15px; font-weight: 600; color: var(--pb-brand); }

  /* Who's Here results (persona card + "everyone within N miles" list) */
  #map-tab .wh-results { margin-top: 20px; }
  #map-tab .wh-here-card {
    background: var(--pb-surface-3); border: 1px solid var(--pb-line); border-radius: 14px; padding: 18px 22px; margin-bottom: 16px;
  }
  #map-tab .wh-here-label, #map-tab .wh-area-head {
    font: 500 13px var(--pb-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--pb-brand); margin: 0 0 6px;
  }
  #map-tab .wh-area-head { color: var(--pb-ink-4); margin-top: 6px; }
  #map-tab .wh-here-name { font: 700 26px/1.2 var(--pb-display); color: var(--pb-ink); letter-spacing: -.01em; }
  #map-tab .wh-here-badges { font-size: 16px; color: var(--pb-ink-3); }
  #map-tab .wh-summary-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  #map-tab .wh-summary-wide { grid-column: auto; }
  #map-tab .wh-summary-card { background: var(--pb-surface-3); border: 1px solid var(--pb-line); border-radius: 12px; padding: 14px 16px; }
  #map-tab .wh-summary-card .value { font: 700 26px var(--pb-display); color: var(--pb-ink); }
  #map-tab .wh-summary-card .value.wh-value-sm { font-size: 17px; line-height: 1.3; }
  #map-tab .wh-summary-card .label { font: 400 14px var(--pb-body); text-transform: none; letter-spacing: 0; color: var(--pb-ink-4); }
  #map-tab .wh-persona-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin-top: 14px; }
  #map-tab .wh-persona-item {
    background: var(--pb-surface); border: 1px solid var(--pb-line); border-radius: 12px; padding: 12px 14px; cursor: pointer; margin: 0;
  }
  #map-tab .wh-persona-item.is-here { border-color: var(--pb-brand); box-shadow: 0 0 0 3px rgba(140,47,57,.12); }
  #map-tab .wh-persona-dot { width: 12px; height: 12px; }
  #map-tab .wh-persona-name { font: 600 16px/1.3 var(--pb-display); color: var(--pb-ink); }
  #map-tab .wh-persona-count { font-size: 14px; color: var(--pb-ink-4); }
  #map-tab .wh-profile-btn {
    min-height: 44px; padding: 0 16px; font: 600 15px var(--pb-display); color: var(--pb-brand);
    background: var(--pb-surface-2); border: 1px solid var(--pb-line-strong); border-radius: 10px; cursor: pointer;
  }
  #map-tab .wh-profile-btn:hover { background: var(--pb-surface-3); color: var(--pb-brand-hover); }

  /* persona legend (after a bulk upload): a card under the map, not a floating glass chip */
  #map-tab .legend {
    position: static; grid-column: 1 / -1; grid-row: 7; max-width: none; max-height: none; margin-top: 20px;
    background: var(--pb-surface); border: 1px solid var(--pb-line); border-radius: 14px; box-shadow: none;
    -webkit-backdrop-filter: none; backdrop-filter: none; padding: 20px 24px; font-size: 16px;
  }
  #map-tab .legend h3 { font: 500 13px var(--pb-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--pb-ink-4); margin: 0 0 10px; }
  #map-tab .legend #legendContent { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 4px 20px; }
  #map-tab .legend-item { color: var(--pb-ink-2); min-height: 32px; }

  /* ================= SCORE AN AREA ================= */
  #score-tab .score-container {
    display: grid; grid-template-columns: 340px minmax(0, 1fr); grid-template-rows: auto 1fr; column-gap: 20px; row-gap: 20px; align-items: start;
  }
  #score-tab .score-sheet { display: contents; }
  #score-tab .sheet-grab { display: none; }
  #score-tab .score-sidebar {
    grid-column: 1; grid-row: 1 / span 2; width: auto; max-width: none; order: 0; overflow: visible; padding: 24px;
    border-right: 1px solid var(--pb-line);
  }
  #score-tab .score-sidebar::after { display: none; }
  #score-tab .score-sidebar > h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  #score-tab .score-sidebar > p { font: 400 16px/1.5 var(--pb-body) !important; color: var(--pb-ink-3) !important; margin: 0 0 16px !important; }
  #score-tab .score-sidebar label {
    font: 500 12px/1.3 var(--pb-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--pb-ink-4); margin: 18px 0 8px;
  }
  #score-tab .score-sidebar label span { font: 500 12px var(--pb-mono) !important; text-transform: none; letter-spacing: 0; color: var(--pb-ink-5, #7d7668) !important; }
  #score-tab .pb-score-form > label:first-child { margin-top: 0; }
  #score-tab .score-sidebar p[style] { font-size: 14px !important; color: var(--pb-ink-4) !important; line-height: 1.45; }
  #score-tab select { width: 100%; }
  #score-tab .ms-trigger { width: 100%; gap: 8px; cursor: pointer; }
  #score-tab .ms-chip {
    font: 500 15px var(--pb-body); padding: 6px 12px; border-radius: 20px; background: rgba(140,47,57,.1);
    color: var(--pb-brand); border: 1px solid rgba(140,47,57,.28);
  }
  #score-tab .ms-trigger::after { font: 500 13px var(--pb-mono); color: var(--pb-ink-3); border-color: var(--pb-line-strong); }
  #score-tab .ms-trigger .ms-ph { color: var(--pb-ink-4) !important; }

  /* business type: segmented control, active = oxblood */
  #score-tab .business-model-seg {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 0; background: transparent; border: 0;
  }
  #score-tab .bm-btn {
    min-height: 44px; font: 600 15px var(--pb-display); color: var(--pb-ink-2); background: var(--pb-surface-2);
    border: 1px solid var(--pb-line); border-radius: 10px; box-shadow: none; cursor: pointer;
  }
  #score-tab .bm-btn:hover { background: var(--pb-surface-3); }
  #score-tab .bm-btn.active { background: var(--pb-brand); color: #fffdf8; border-color: var(--pb-brand); }

  #score-tab #leadScoreBtn {
    min-height: 52px; font: 600 17px var(--pb-display); background: var(--pb-brand); color: #fffdf8; border: 0; border-radius: 11px;
    box-shadow: 0 10px 26px -6px rgba(140,47,57,.5); cursor: pointer; margin-top: 20px !important;
  }
  #score-tab #leadScoreBtn:hover:not(:disabled) { background: var(--pb-brand-hover); }
  #score-tab #leadScoreBtn:disabled { opacity: .55; box-shadow: none; cursor: not-allowed; }
  #score-tab #leadScoreHelper { font-size: 14px !important; color: var(--pb-ink-4) !important; }
  #score-tab .btn-secondary { min-height: 44px; font: 600 15px var(--pb-display); border-radius: 11px; }

  #score-tab #lead-score-summary .score-empty h3 { font: 600 20px var(--pb-display); color: var(--pb-ink); }
  #score-tab #lead-score-summary .score-empty p { font-size: 16px; color: var(--pb-ink-3); line-height: 1.5; }
  #score-tab .score-empty-bars span:nth-child(1) { background: var(--pb-brand); }
  #score-tab .score-empty-bars span:nth-child(2) { background: var(--pb-warn); }
  #score-tab .score-empty-bars span:nth-child(3) { background: var(--pb-good); }
  #score-tab .score-empty-bars span:nth-child(4) { background: #3d5a80; }
  #score-tab .score-empty-bars span:nth-child(5) { background: #6b5b95; }
  #score-tab .lead-score-summary-card {
    background: var(--pb-surface-3); border: 1px solid var(--pb-line); border-radius: 12px; padding: 14px 16px;
    font: 400 15px/1.45 var(--pb-body); color: var(--pb-ink-3); margin-top: 18px;
  }
  #score-tab .lead-score-summary-card .big { font: 700 28px var(--pb-display); color: var(--pb-ink); }
  #score-tab .lcb-label { font-size: 14px; color: var(--pb-ink-3); }
  #score-tab .lcb-track { background: var(--pb-surface-2); }
  #score-tab .lcb-fill { background: var(--pb-brand); }

  /* map */
  #score-tab .score-map {
    grid-column: 2; grid-row: 1; width: 100%; height: 440px; min-height: 0; flex: none; order: 0;
    border: 1px solid var(--pb-line); border-radius: 14px; overflow: hidden; background: #ebe5d7;
    box-shadow: 0 24px 60px -34px rgba(20,33,61,.3);
  }
  #score-tab .score-map-chip { font: 500 13px var(--pb-mono); color: var(--pb-ink-3); border-radius: 10px; }
  #score-tab .pb-score-legend {
    display: flex; gap: 14px; position: absolute; bottom: 30px; left: 14px; z-index: 680;
    background: rgba(255,253,248,.94); border: 1px solid var(--pb-line); border-radius: 10px; padding: 8px 14px;
    font: 500 14px var(--pb-body); color: var(--pb-ink-2);
  }
  #score-tab .pb-score-legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
  #score-tab .pb-score-legend .g::before { background: var(--pb-good); }
  #score-tab .pb-score-legend .b::before { background: var(--pb-warn); }
  #score-tab .pb-score-legend .r::before { background: var(--pb-brand); }
  /* tract dots drawn by app.js with leadScoreColor(): remap to the Private Bank bands */
  #score-tab .leaflet-overlay-pane path[fill="#b6ff3a"] { fill: #1f6b4a; }
  #score-tab .leaflet-overlay-pane path[fill="#ffb020"] { fill: #a87a26; }
  #score-tab .leaflet-overlay-pane path[fill="#8c2f39"] { fill: #8c2f39; }
  #score-tab .leaflet-container { font-family: var(--pb-body); background: #ebe5d7; }

  /* ranked tract list */
  #score-tab .score-results {
    grid-column: 2; grid-row: 2; width: auto; margin: 0; padding: 22px 24px; overflow: visible; max-height: none; order: 0;
  }
  #score-tab .score-results-h { font: 500 13px var(--pb-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--pb-ink-4); margin: 0 0 8px; }
  #score-tab .score-results-empty { font-size: 17px; color: var(--pb-ink-3); line-height: 1.5; padding: 12px 0; }
  #score-tab #lead-score-top { counter-reset: tract; }
  #score-tab .lead-tract-row {
    counter-increment: tract; display: grid; grid-template-columns: 34px minmax(0, 1fr) minmax(90px, 36%) 56px; align-items: center;
    column-gap: 16px; padding: 14px 0; margin: 0; background: transparent; border: 0; border-bottom: 1px solid var(--pb-line);
    border-radius: 0; cursor: pointer;
  }
  #score-tab .lead-tract-row:last-child { border-bottom: 0; }
  #score-tab .lead-tract-row:hover { background: rgba(20,33,61,.03); }
  #score-tab .lead-tract-row::before {
    content: counter(tract, decimal-leading-zero); grid-column: 1; grid-row: 1; font: 500 13px var(--pb-mono); color: var(--pb-ink-4);
  }
  #score-tab .lead-tract-top { display: contents; }
  #score-tab .lead-tract-nm {
    grid-column: 2; grid-row: 1; font: 600 17px/1.3 var(--pb-display); color: var(--pb-ink);
    white-space: normal; overflow: visible; text-overflow: clip;
  }
  #score-tab .lead-score-bar-track { grid-column: 3; grid-row: 1; height: 10px; background: var(--pb-surface-3); border-radius: 6px; }
  #score-tab .lead-score-bar-fill { border-radius: 6px; }
  #score-tab .lead-tract-score { grid-column: 4; grid-row: 1; text-align: right; font: 700 24px var(--pb-display); }
  /* band colors: >=top green, >=60 brass, else oxblood (app.js picks the inline color; remapped here) */
  #score-tab .lead-tract-score[style*="#b6ff3a"] { color: #1f6b4a !important; }
  #score-tab .lead-tract-score[style*="#ffb020"] { color: #a87a26 !important; }
  #score-tab .lead-tract-score[style*="#8c2f39"] { color: #8c2f39 !important; }
  #score-tab .lead-score-bar-fill[style*="#b6ff3a"] { background: #1f6b4a !important; }
  #score-tab .lead-score-bar-fill[style*="#ffb020"] { background: #a87a26 !important; }
  #score-tab .lead-score-bar-fill[style*="#8c2f39"] { background: #8c2f39 !important; }
  #score-tab .score-export-btn {
    width: auto; min-height: 44px; padding: 0 20px; margin-top: 16px; font: 600 16px var(--pb-display);
    color: var(--pb-ink); background: var(--pb-surface-2); border: 1px solid var(--pb-line-strong); border-radius: 11px;
  }
  #score-tab .score-export-btn:hover { background: var(--pb-surface-3); }
}

/* ================= PERSONA PROFILE SLIDE-IN (#profilePanel) =================
   Opened after an address lookup. Mirrors the mock's persona card plus the
   "How to reach them" card (screenshots/03-lookup.png). Not media-gated: the
   panel is a slide-in on phones too. */
#profilePanel {
  background: var(--pb-bg-app, #f7f4ec); border-left: 1px solid var(--pb-line);
  box-shadow: -24px 0 60px -20px rgba(20,33,61,.28); width: 520px; font-family: var(--pb-body); color: var(--pb-ink);
}
.profile-overlay { background: rgba(20,33,61,.38); }
#profilePanel .profile-panel-header {
  background: var(--pb-surface); border: 1px solid var(--pb-line); border-radius: 14px 14px 0 0; border-bottom: 0;
  margin: 16px 16px 0; padding: 22px 24px 4px;
}
#profilePanel .profile-eyebrow { font: 500 13px/1.3 var(--pb-mono); letter-spacing: .06em; color: var(--pb-brand); margin: 0 0 10px; }
#profilePanel .profile-eyebrow .dot { display: none; }
#profilePanel .profile-panel-header h2 {
  font: 700 30px/1.12 var(--pb-display); letter-spacing: -.02em; color: var(--pb-ink); padding-right: 44px; margin: 0;
}
#profilePanel .group-badges { margin-top: 12px; gap: 8px; }
#profilePanel .group-badge, #profilePanel #profile-lifemode-badge, #profilePanel #profile-urbanization-badge {
  font: 500 13px/1.2 var(--pb-mono); letter-spacing: .03em; padding: 6px 11px; border-radius: 20px;
  background: var(--pb-surface-2); border: 1px solid var(--pb-line); color: var(--pb-ink-4);
}
#profilePanel .group-badge:empty { display: none; }
#profilePanel .close-btn {
  top: 16px; right: 16px; width: 44px; height: 44px; background: var(--pb-surface-2); color: var(--pb-ink);
  border: 1px solid var(--pb-line); border-radius: 12px; box-shadow: none; font-size: 24px;
}
#profilePanel .close-btn:hover { background: var(--pb-surface-3); }
#profilePanel .close-btn:focus-visible { outline: none; box-shadow: var(--pb-focus); }

#profilePanel .profile-hero-extra {
  background: var(--pb-surface); border: 1px solid var(--pb-line); border-top: 0; border-radius: 0 0 14px 14px;
  margin: 0 16px 14px; padding: 4px 24px 22px;
}
#profilePanel .profile-hero-extra:empty { display: none; }
#profilePanel .profile-portrait { font: 400 16px/1.55 var(--pb-body); color: var(--pb-ink-3); margin: 8px 0 16px; }
#profilePanel .profile-stats-grid { gap: 10px; margin-bottom: 18px; }
#profilePanel .persona-stat { background: var(--pb-surface-3); border: 0; border-radius: 10px; padding: 12px 14px; }
#profilePanel .persona-stat-value { font: 700 22px/1.1 var(--pb-display); color: var(--pb-ink); }
#profilePanel .persona-stat-label { font: 400 14px/1.3 var(--pb-body); color: var(--pb-ink-4); margin-top: 3px; }
#profilePanel .profile-cta-primary {
  min-height: 48px; border-radius: 12px; background: var(--pb-brand); color: #fffdf8; border: 0;
  font: 600 16px/1.2 var(--pb-display); box-shadow: 0 10px 26px -6px rgba(140,47,57,.5);
}
#profilePanel .profile-cta-primary:hover { background: var(--pb-brand-hover); }
#profilePanel .profile-cta-secondary {
  min-height: 46px; margin: 0; border-radius: 12px; background: var(--pb-surface-2); color: var(--pb-ink);
  border: 1px solid var(--pb-line-strong); font: 600 15px/1.2 var(--pb-display);
}
#profilePanel .profile-cta-secondary:hover { background: var(--pb-surface-3); color: var(--pb-brand-hover); border-color: var(--pb-line-strong); }

#profilePanel .profile-panel-body { padding: 0 16px 24px; }
#profilePanel .profile-section {
  background: var(--pb-surface); border: 1px solid var(--pb-line); border-radius: 14px; padding: 20px 24px; margin: 0 0 14px;
}
#profilePanel .profile-section h3 {
  font: 500 12.5px/1.3 var(--pb-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--pb-ink-4); margin: 0 0 12px;
}
/* the "how to read this" note: app.js writes inline amber-on-dark colours */
#profilePanel .profile-section[style*="rgba(255,176,32"] {
  background: rgba(168,122,38,.10) !important; border: 1px solid rgba(168,122,38,.35) !important; border-radius: 12px !important;
  color: #6b4d12 !important; font: 400 14px/1.5 var(--pb-body) !important; padding: 14px 18px !important;
}
#profilePanel .profile-section ul { list-style: none; margin: 0; padding: 0; }
#profilePanel .profile-section ul:has(> .channel-item) { display: flex; flex-wrap: wrap; gap: 8px; }
#profilePanel .channel-item {
  display: inline-block; margin: 0; padding: 8px 14px; border-radius: 20px; background: var(--pb-surface-2);
  border: 1px solid var(--pb-line-strong); font: 500 15px/1.2 var(--pb-body); color: var(--pb-ink);
}
#profilePanel .profile-section strong[style], #profilePanel .profile-section div[style*="font-size:0.8rem"] {
  color: var(--pb-ink-3) !important; font: 500 14px/1.3 var(--pb-body) !important;
}
#profilePanel .tag-cloud { gap: 8px; }
#profilePanel .tag { font: 500 15px/1.2 var(--pb-body); padding: 7px 12px; border-radius: 7px; }
#profilePanel .tag-good { background: rgba(31,107,74,.1); color: #1f6b4a; border: 0; }
#profilePanel .tag-bad { background: rgba(140,47,57,.1); color: var(--pb-brand); border: 0; }
#profilePanel .headline-item, #profilePanel .do-item, #profilePanel .dont-item {
  font: 400 16px/1.5 var(--pb-body); color: var(--pb-ink-2); padding: 9px 0; margin: 0; border-radius: 0;
  background: none; border-bottom: 1px solid var(--pb-line);
}
#profilePanel li:last-child.headline-item, #profilePanel li:last-child.do-item, #profilePanel li:last-child.dont-item { border-bottom: 0; }
#profilePanel .do-item::before { color: var(--pb-good); }
#profilePanel .dont-item::before { color: var(--pb-brand); }
#profilePanel .collapsible-toggle {
  min-height: 46px; padding: 10px 14px; background: var(--pb-surface-2); color: var(--pb-ink);
  border: 1px solid var(--pb-line); border-radius: 10px; font: 600 16px/1.3 var(--pb-display); box-shadow: none;
}
#profilePanel .collapsible-content { font: 400 16px/1.6 var(--pb-body); color: var(--pb-ink-3); }
#profilePanel .collapsible-content p { margin: 0; }

/* Find Similar Areas (inline-styled markup from app.js) */
#profilePanel .find-similar-section { background: var(--pb-surface); border: 1px solid var(--pb-line); border-radius: 14px; padding: 16px 24px; margin: 0 0 14px; }
#profilePanel .find-similar-btn {
  min-height: 46px; margin: 0; background: var(--pb-surface-2); color: var(--pb-ink); border: 1px solid var(--pb-line-strong);
  border-radius: 12px; font: 600 16px/1.2 var(--pb-display); box-shadow: none;
}
#profilePanel .find-similar-btn:hover { background: var(--pb-surface-3); }
#profilePanel .find-similar-section label { font: 500 14px/1.3 var(--pb-body) !important; color: var(--pb-ink-4) !important; }
#profilePanel .find-similar-section input, #profilePanel .find-similar-section select {
  min-height: 44px; font: 400 16px var(--pb-body) !important; background: var(--pb-surface-2) !important; color: var(--pb-ink);
  border: 1px solid var(--pb-line-strong) !important; border-radius: 10px !important;
}
#profilePanel .find-similar-section button[onclick*="runFindSimilar"] {
  min-height: 44px; background: var(--pb-brand) !important; color: #fffdf8 !important; border-radius: 10px !important; font: 600 15px var(--pb-display) !important;
}
#profilePanel #similar-results-info { font-size: 14px !important; color: var(--pb-ink-3) !important; }
#profilePanel #similar-clear-link { font-size: 14px !important; color: var(--pb-brand) !important; }
/* spending table */
#profilePanel #spending-profile-section table { font-size: 15px !important; }
#profilePanel #spending-profile-section td { border-bottom: 1px solid var(--pb-line) !important; color: var(--pb-ink-2); }
#profilePanel #spending-profile-section td div[style*="#eee"] { background: var(--pb-surface-3) !important; }
#profilePanel #spending-profile-section td div[style*="#8c2f39"] { background: var(--pb-brand) !important; }
@media (max-width: 560px) {
  #profilePanel { width: 100vw; }
  #profilePanel .profile-panel-header, #profilePanel .profile-hero-extra { margin-left: 10px; margin-right: 10px; padding-left: 18px; padding-right: 18px; }
  #profilePanel .profile-panel-body { padding: 0 10px 24px; }
  #profilePanel .profile-section, #profilePanel .find-similar-section { padding: 18px; }
}
#profilePanel:not(.open):not(.visible) { box-shadow: none; }

/* Phones: Score an area's sheet text must stay at 14px or larger (styles.css sets 11.9-13.9px here). */
@media (max-width: 900px) {
  #score-tab :is(p, label, h3, .bm-btn, .ms-field-hint, .score-results-empty) { font-size: 14px !important; }
  #score-tab :is(label, p) :is(span, strong) { font-size: 14px !important; }
  #score-tab #lead-score-summary :is(p, strong, h3), #leadScoreHelper p { font-size: 14px !important; }
}
