        /* ─────────────────────────────────────────────────────────────
           DESIGN TOKENS — Seanos CI v2
        ───────────────────────────────────────────────────────────── */
        :root {
            /* ── Brand ── */
            --color-ink:          #2A1548;
            --color-mark:         #4A2B7C;
            --color-accent:       #7C5FB4;
            --color-paper:        #FFFFFF;
            --color-cream:        #FAF8F5;

            /* ── Neutral scale (replaces warm paper-soft) ── */
            --color-grey-50:      #F5F5F5;
            --color-grey-100:     #E7E7E7;
            --color-grey-300:     #C6C6C6;
            --color-grey-500:     #8A8A8A;
            --color-grey-700:     #5A5A5A;

            /* ── Borders ── */
            --color-line:         rgba(42, 21, 72, 0.10);
            --color-line-strong:  rgba(42, 21, 72, 0.18);

            /* ── Functional ── */
            --color-success:  #2F7A4D;
            --color-warning:  #C88319;
            --color-danger:   #B53A2E;

            /* ── Legacy aliases — keeps existing selectors working ── */
            --bg:          var(--color-paper);
            --surface:     var(--color-paper);
            --surface-2:   var(--color-grey-50);
            --border:      var(--color-line-strong);
            --border-2:    var(--color-ink);
            --shadow-panel: 0 2px 8px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
            --shadow-card:  0 1px 2px rgba(0,0,0,0.06);
            --shadow-float: 0 2px 12px rgba(0,0,0,0.10), 0 0 0 0.5px rgba(0,0,0,0.04);
            --shadow-badge: 0 1px 4px rgba(0,0,0,0.12);
            --text:         var(--color-ink);
            --text-dim:     var(--color-ink);
            --text-muted:   var(--color-grey-500);
            --accent:       var(--color-mark);

            /* ── Type scale (left-panel CI standard; base = the Analyze toggle) ── */
            --fs-lg:       14px;   /* one emphasis line: store name, pane title   */
            --fs-base:     12px;   /* body + interactive controls (= the toggle)  */
            --fs-sm:       11px;   /* secondary text: takes, summaries            */
            --fs-meta:     10px;   /* meta, captions, KPI labels                  */
            --fs-eyebrow:   9px;   /* uppercase data eyebrows / status            */

            /* Layout */
            --sidebar-w: 272px;

            /* Radius */
            --r:    8px;
            --r-lg: 12px;

            /* Fonts */
            --f-ui:   'Inter Tight', 'Inter', system-ui, sans-serif;
            --f-data: 'JetBrains Mono', 'IBM Plex Mono', ui-monospace, monospace;
        }

        /* ─────────────────────────────────────────────────────────────
           UTILITY CLASSES
        ───────────────────────────────────────────────────────────── */
        .hidden { display: none !important; }
        .flex-1 { flex: 1; }

        /* ─────────────────────────────────────────────────────────────
           RESET & BASE
        ───────────────────────────────────────────────────────────── */
        *,
        *::before,
        *::after {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }

        html,
        body {
            height: 100%;
            overflow: hidden;
            font-family: var(--f-ui);
            background: var(--color-paper);
            color: var(--color-ink);
        }

        /* ─────────────────────────────────────────────────────────────
           APP SHELL
        ───────────────────────────────────────────────────────────── */
        #app-shell {
            display: flex;
            flex-direction: row;
            height: 100vh;
            overflow: hidden;
            background: var(--color-paper);
        }

        /* Left column: nav sidebar + panel (flex row) */
        #app-left {
            display: flex;
            flex-direction: row;
            flex-shrink: 0;
            width: var(--nav-w, 208px);
            z-index: 10;
            transition: width 220ms ease;
        }

        #app-main {
            flex: 1;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            min-height: 0;
        }

        #app-body {
            flex: 1;
            display: flex;
            flex-direction: row;
            overflow: hidden;
            min-height: 0;
        }

        /* ── Nav sidebar ── */
        #app-nav-strip {
            width: var(--nav-w, 208px);
            flex-shrink: 0;
            background: var(--color-cream);
            border-right: 1px solid var(--color-line);
            display: flex;
            flex-direction: column;
            align-items: stretch;
            padding: 16px 12px 12px;
            gap: 2px;
            overflow: hidden;
            transition: width 220ms ease;
        }

        /* Brand header */
        #nav-brand {
            display: flex;
            align-items: center;
            gap: 9px;
            padding: 4px 8px 14px;
            flex-shrink: 0;
            overflow: hidden;
        }

        #nav-brand-mark {
            flex-shrink: 0;
            display: flex;
            align-items: center;
        }

        #nav-brand-label {
            font-family: var(--f-ui);
            font-size: 16px;
            font-weight: 600;
            color: var(--color-mark);
            letter-spacing: -0.03em;
            white-space: nowrap;
            overflow: hidden;
            padding-right: 3px;   /* room so the last glyph isn't clipped by overflow:hidden */
            transition: opacity 150ms ease, width 220ms ease;
        }

        /* Nav items */
        .nav-item {
            display: flex;
            align-items: center;
            gap: 10px;
            width: 100%;
            height: 38px;
            padding: 0 10px;
            border: none;
            border-radius: 8px;
            background: transparent;
            color: var(--color-grey-500);
            cursor: pointer;
            font-family: var(--f-ui);
            font-size: 13px;
            font-weight: 500;
            text-align: left;
            white-space: nowrap;
            overflow: hidden;
            flex-shrink: 0;
            transition: background 120ms ease, color 120ms ease;
        }

        .nav-item svg { flex-shrink: 0; }

        .nav-label {
            flex: 1;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            color: var(--color-ink);
            font-size: 13px;
            font-weight: 500;
            transition: opacity 150ms ease;
        }

        .nav-item:hover:not(.active) {
            background: rgba(74, 43, 124, 0.07);
            color: var(--color-mark);
        }

        .nav-item.active {
            background: var(--color-paper);
            color: var(--color-mark);
            box-shadow: 0 1px 3px rgba(42, 21, 72, 0.10), 0 0 0 0.5px rgba(42, 21, 72, 0.06);
        }

        .nav-item.active .nav-label {
            color: var(--color-mark);
            font-weight: 600;
        }

        .nav-item:disabled {
            color: var(--color-grey-300);
            cursor: default;
            background: transparent;
        }

        .nav-item-collapse {
            color: var(--color-grey-500);
        }

        .nav-collapse-icon {
            transition: transform 220ms ease;
            flex-shrink: 0;
        }

        .nav-separator {
            width: 100%;
            height: 1px;
            background: var(--color-grey-100);
            margin: 6px 0;
            flex-shrink: 0;
        }

        .nav-spacer { flex: 1; }

        /* legacy alias — keeps any remaining .nav-icon refs working */
        .nav-icon { display: flex; align-items: center; justify-content: center; }

        #app-side-panel {
            position: relative;
            width: var(--sidebar-w, 272px);
            flex-shrink: 0;
            background: var(--color-cream);
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }

        .panel-pane {
            display: none;
            flex-direction: column;
            height: 100%;
            overflow: hidden;
        }

        .panel-pane.active {
            display: flex;
        }

        .panel-pane>.sidebar-content {
            flex: 1;
            overflow-y: auto;
            padding: 8px 8px 34px;   /* bottom space for the slim Collapse bar */
        }

        .panel-pane-header {
            font-family: var(--f-ui);
            font-size: 11px;
            font-weight: 600;
            color: var(--color-ink);
            text-transform: uppercase;
            letter-spacing: 0.08em;
            padding: 12px 12px 8px;
            border-bottom: 1px solid var(--color-line);
            flex-shrink: 0;
        }

        #app-content {
            flex: 1;
            display: flex;
            flex-direction: column;
            position: relative;
            overflow: hidden;
            min-height: 0;
        }

        /* ── Scorecard floating panel (opens programmatically on store/POI click) ── */
        #stats-float {
            position: absolute;
            top: 10px;
            right: 260px;
            z-index: 11;
            pointer-events: none;
        }

        #stats-toggle {
            display: none;
            height: 34px;
            padding: 0 12px;
            border: 1px solid var(--color-line-strong);
            border-radius: 8px;
            background: var(--color-paper);
            color: rgba(42, 21, 72, 0.55);
            font-family: var(--f-ui);
            font-size: 11px;
            font-weight: 500;
            cursor: pointer;
            white-space: nowrap;
            box-shadow: var(--shadow-sm, 0 1px 2px rgba(42, 21, 72, 0.06));
            display: flex;
            align-items: center;
            gap: 6px;
        }

        #stats-toggle:hover {
            border: 2px solid var(--color-mark);
            color: var(--color-mark);
        }

        #stats-toggle.open {
            border: 2px solid var(--color-mark);
            background: var(--color-mark);
            color: var(--color-paper);
        }

        #stats-panel {
            display: none;
            flex-direction: column;
            width: 240px;
            max-height: calc(100vh - 20px);
            overflow-y: auto;
            background: var(--color-paper);
            border: 1px solid var(--color-line);
            border-radius: var(--r-lg);
            box-shadow: var(--shadow-md, 0 2px 8px rgba(42, 21, 72, 0.08));
            pointer-events: auto;
        }

        #stats-panel.open {
            display: flex;
        }

        #stats-store-header .float-section { padding-bottom: 10px; }

        #sc-eval-body {
            padding: 0 14px;
        }

        #sc-footer {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            padding: 12px 14px;
            border-top: 1px solid var(--color-line);
            flex-shrink: 0;
            background: #FAFAFA;
            position: sticky;
            bottom: 0;
        }

        .stats-kv {
            display: flex;
            justify-content: space-between;
            align-items: baseline;
            padding: 2px 0;
        }

        .stats-k {
            font-family: var(--f-ui);
            font-size: 11px;
            color: var(--color-grey-500);
        }

        .stats-v {
            font-family: var(--f-ui);
            font-size: 11px;
            font-weight: 700;
            color: var(--color-ink);
        }

        /* ── Map controls floating panel ── */
        #map-controls-float {
            display: flex;
            flex-direction: column;
            align-items: flex-end;
        }

        #map-controls-toggle {
            height: 34px;
            padding: 0 12px;
            border: 1px solid var(--color-line-strong);
            border-radius: 8px;
            background: var(--color-paper);
            color: rgba(42, 21, 72, 0.55);
            cursor: pointer;
            font-family: var(--f-ui);
            font-size: 11px;
            font-weight: 500;
            display: flex;
            align-items: center;
            gap: 6px;
            white-space: nowrap;
            box-shadow: var(--shadow-sm, 0 1px 2px rgba(42, 21, 72, 0.06));
        }

        #map-controls-toggle:hover {
            border: 2px solid var(--color-mark);
            color: var(--color-mark);
        }

        #map-controls-toggle.open {
            border: 2px solid var(--color-mark);
            background: var(--color-mark);
            color: var(--color-paper);
        }

        #map-controls-panel {
            display: none;
            flex-direction: column;
            width: 200px;
            background: var(--color-grey-50);
            border: none;
            border-radius: 12px;
            box-shadow: var(--shadow-panel);
            margin-top: 4px;
            overflow-y: auto;
            max-height: calc(100vh - 148px);
            padding: 8px 8px 0;
            gap: 6px;
        }

        #map-controls-panel.open {
            display: flex;
        }

        #map-controls-panel::after {
            content: '';
            display: block;
            height: 8px;
            flex-shrink: 0;
        }

        /* Draw-tools bar — card, same as ctrl-section */
        #map-controls-panel > .float-section {
            background: var(--color-paper);
            border-radius: 10px;
            box-shadow: var(--shadow-card);
            border-bottom: none;
            padding: 8px;
        }

        .float-section {
            padding: 8px;
            border-bottom: 1px solid var(--color-grey-100);
        }

        .float-section:last-child {
            border-bottom: none;
        }

        /* Each collapsible is a white card */
        .float-collapsible {
            background: var(--color-paper);
            border-radius: var(--r-lg);
            box-shadow: var(--shadow-card);
            border: 1px solid var(--color-line);
            overflow: hidden;
        }

        /* Header gets a divider below it when the section is open */
        .float-collapsible-header {
            border-bottom: 1px solid var(--color-grey-100);
        }

        .float-collapsible.collapsed .float-collapsible-header {
            border-bottom: none;
        }

        .float-collapsible-header {
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 8px 8px 6px;
            font-family: var(--f-ui);
            font-size: 10px;
            font-weight: 500;
            letter-spacing: 0.08em;
            text-transform: uppercase;
            color: var(--color-grey-500);
            cursor: pointer;
            user-select: none;
        }

        .float-collapsible-header:hover {
            color: var(--accent);
        }

        .float-collapsible-header:hover .float-collapsible-arrow {
            color: var(--accent);
        }

        .float-collapsible-arrow {
            font-size: 9px;
            color: #C8C8C8;
            flex-shrink: 0;
            transition: transform 0.2s;
        }

        .float-collapsible.collapsed .float-collapsible-arrow {
            transform: rotate(-90deg);
        }

        .float-collapsible.collapsed .float-collapsible-body {
            display: none;
        }

        .float-collapsible-body .float-section:last-child {
            border-bottom: none;
            border-radius: 0 0 10px 10px;
        }

        .float-section-label {
            font-family: var(--f-ui);
            font-size: 9px;
            font-weight: 600;
            color: var(--color-grey-500);
            text-transform: uppercase;
            letter-spacing: 0.08em;
            margin-bottom: 5px;
        }

        .micro-adjust-toggle {
            cursor: pointer;
            user-select: none;
        }

        .micro-adjust-toggle:hover {
            color: var(--accent);
        }

        .float-btn {
            display: block;
            width: 100%;
            padding: 6px 8px;
            margin-bottom: 2px;
            font-size: 11px;
            font-family: var(--f-ui);
            font-weight: 500;
            border: 1px solid var(--color-line-strong);
            border-radius: var(--r, 8px);
            background: var(--color-paper);
            color: rgba(42, 21, 72, 0.55);
            cursor: pointer;
            text-align: left;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            letter-spacing: 0.02em;
        }

        .float-btn:last-child {
            margin-bottom: 0;
        }

        .float-btn:hover {
            color: var(--accent);
        }

        .float-btn.active {
            background: var(--color-paper);
            color: var(--color-ink);
            border: 1px solid var(--color-line-strong);
            border-left: 3px solid var(--color-grey-700);
        }

        .float-btn:disabled {
            border: 1px solid #D0D0D0;
            color: #D0D0D0;
            cursor: default;
            background: var(--color-paper);
        }


        .toolbar-btn {
            height: 26px;
            padding: 0 9px;
            font-size: 11px;
            font-family: var(--f-ui);
            font-weight: 500;
            border: 1px solid var(--color-ink);
            border-radius: 6px;
            background: var(--color-paper);
            color: var(--color-ink);
            cursor: pointer;
            white-space: nowrap;
            display: flex;
            align-items: center;
            gap: 4px;
        }

        .toolbar-btn:hover {
            border: 2px solid var(--accent);
            color: var(--accent);
        }

        .toolbar-btn.active {
            border: 3px solid var(--accent);
            background: var(--accent);
            color: var(--color-paper);
        }

        .toolbar-btn:disabled {
            border: 1px solid var(--color-grey-300);
            color: var(--color-grey-500);
            cursor: default;
        }

        .view-pane {
            display: none;
            flex-direction: column;
            overflow: hidden;
            position: absolute;
            inset: 0;
        }

        .view-pane.active {
            display: flex;
        }

        #view-map {
            flex: 1;
            min-height: 0;
            position: relative;
            overflow: hidden;
        }

        #view-map.active {
            display: flex;
            flex-direction: column;
        }

        /* ── Network header bar ── */
        /* ── Generic collapsible header body ── */
        .cv-hd-body {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            padding: 20px 40px 16px;
            overflow: hidden;
            max-height: 160px;
            transition: max-height 0.22s ease, padding-top 0.22s ease, padding-bottom 0.22s ease;
        }
        .cv-hd-collapsed .cv-hd-body {
            max-height: 0;
            padding-top: 0;
            padding-bottom: 0;
        }

        /* Collapse / expand toggle button */
        .cv-hd-toggle {
            display: flex;
            align-items: center;
            gap: 4px;
            background: transparent;
            border: none;
            cursor: pointer;
            color: var(--color-grey-500);
            font-size: 11px;
            font-family: var(--f-ui);
            font-weight: 500;
            border-radius: 4px;
            padding: 3px 7px;
            flex-shrink: 0;
            margin-top: 2px;
            white-space: nowrap;
        }
        .cv-hd-toggle:hover { background: var(--color-grey-100); color: var(--color-ink); }
        .cv-hd-toggle .ms { font-size: 16px; }

        /* Thin strip shown only when collapsed */
        .cv-hd-strip {
            display: none;
            height: 26px;
            align-items: center;
            justify-content: space-between;
            padding: 0 40px;
            cursor: pointer;
            user-select: none;
        }
        .cv-hd-collapsed .cv-hd-strip { display: flex; }
        .cv-hd-strip-label {
            font-family: var(--f-data);
            font-size: 9px;
            font-weight: 600;
            letter-spacing: 0.1em;
            text-transform: uppercase;
            color: var(--color-grey-500);
        }
        .cv-hd-strip-expand {
            display: flex;
            align-items: center;
            gap: 3px;
            font-family: var(--f-ui);
            font-size: 11px;
            font-weight: 500;
            color: var(--color-grey-500);
        }
        .cv-hd-strip-expand .ms { font-size: 16px; }
        .cv-hd-strip:hover .cv-hd-strip-label,
        .cv-hd-strip:hover .cv-hd-strip-expand { color: var(--color-mark); }

        #map {
            flex: 1;
            min-height: 0;
            width: 100%;
        }

        #view-locations {
            background: var(--color-grey-50);
        }

        #locations-toolbar {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 8px 12px;
            background: var(--color-paper);
            border-bottom: 1px solid var(--color-line);
            flex-shrink: 0;
        }

        #locations-search {
            flex: 1;
            height: 28px;
            padding: 0 8px;
            border: 1px solid #D0D0D0;
            border-radius: 6px;
            font-family: var(--f-ui);
            font-size: 11px;
            background: var(--color-paper);
            color: var(--color-ink);
            outline: none;
        }

        #locations-search:focus {
            border: 2px solid var(--accent);
        }

        #locations-table-wrap {
            flex: 1;
            overflow-y: auto;
            padding: 8px;
        }

        #locations-table {
            width: 100%;
            border-collapse: collapse;
            font-family: var(--f-ui);
            font-size: 11px;
            background: var(--color-paper);
            border-radius: 8px;
            overflow: hidden;
            box-shadow: var(--shadow-card);
        }

        #locations-table th {
            background: var(--color-grey-50);
            font-size: 10px;
            font-weight: 600;
            color: var(--color-grey-500);
            letter-spacing: 0.06em;
            text-transform: uppercase;
            padding: 8px 10px;
            text-align: left;
            cursor: pointer;
            border-bottom: 1px solid var(--color-line);
            user-select: none;
            white-space: nowrap;
        }

        #locations-table th:hover {
            color: var(--accent);
        }

        #locations-table td {
            padding: 7px 10px;
            border-bottom: 1px solid var(--color-line);
            color: var(--color-ink);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            max-width: 200px;
        }

        #locations-table tr:hover td {
            background: var(--color-grey-50);
            cursor: pointer;
        }

        #locations-table tr.selected td {
            border-left: 3px solid var(--accent);
        }

        .locations-empty {
            padding: 32px;
            text-align: center;
            color: var(--color-grey-500);
            font-size: 12px;
        }

        #view-analytics {
            background: var(--color-grey-50);
            align-items: center;
            justify-content: center;
        }

        #view-analytics.active {
            display: flex;
        }

        .analytics-placeholder {
            text-align: center;
            color: var(--color-grey-500);
        }

        .analytics-placeholder-title {
            font-size: 16px;
            font-weight: 600;
            color: var(--color-ink);
            margin-bottom: 8px;
            font-family: var(--f-ui);
        }

        .analytics-placeholder-sub {
            font-size: 12px;
            color: var(--color-grey-500);
            font-family: var(--f-ui);
        }

        #content-plans,
        #content-team {
            padding-bottom: 28px;
        }

        /* Footer status bar retired — the legend moved into the Analyze panel.
           Kept in the DOM (hidden) so its count/coord nodes still exist for JS. */
        #app-status-bar { display: none !important; }

        /* Hexagon colour legend, relocated to the bottom of the Analyze panel */
        #network-legend-foot {
            flex-shrink: 0;
            border-top: 1px solid var(--color-line);
            margin: 8px -8px 0;
            padding: 8px 8px 2px;
        }
        #network-legend-foot #legend-section {
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            gap: 5px;
        }
        #network-legend-foot #legend-hex-title {
            font-family: var(--f-ui);
            font-size: 9px;
            font-weight: 600;
            letter-spacing: 0.08em;
            text-transform: uppercase;
            color: var(--color-grey-500);
            white-space: nowrap;
        }
        #network-legend-foot .status-legend { display: flex; flex-wrap: wrap; gap: 4px 8px; }
        #network-legend-foot .status-attribution { display: block; margin-top: 8px; font-size: 8.5px; opacity: 0.65; }

        .status-section {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .status-item {
            font-family: var(--f-ui);
            font-size: 10px;
            color: var(--color-grey-500);
            white-space: nowrap;
        }

        .status-item strong {
            color: var(--accent);
            font-weight: 600;
        }

        #status-mode,
        #status-coords,
        #status-zoom {
            font-family: var(--f-ui);
            font-size: 10px;
            color: var(--color-grey-500);
            white-space: nowrap;
        }
        .status-attribution {
            font-family: var(--f-ui);
            font-size: 9px;
            color: var(--color-grey-500);
            white-space: nowrap;
            opacity: 0.7;
        }
        .status-attribution a { color: inherit; text-decoration: none; }
        .status-attribution a:hover { color: var(--accent); opacity: 1; }

        .status-legend {
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .legend-entry {
            display: flex;
            align-items: center;
            gap: 3px;
        }

        .legend-pill {
            width: 10px;
            height: 7px;
            border-radius: 2px;
            display: inline-block;
            flex-shrink: 0;
        }

        .legend-lbl {
            font-size: 9px;
            color: var(--color-grey-500);
            white-space: nowrap;
        }

        .controls-panel {
            display: none !important;
        }

        .info-panel {
            display: none !important;
        }

        #loading-indicator {
            top: 16px !important;
            left: calc(var(--nav-w, 208px) + var(--sidebar-w, 272px) + 16px) !important;
            right: auto !important;
            transform: none !important;
        }

        #sidebar-resize-handle {
            position: absolute;
            right: -4px;
            top: 0;
            height: 100%;
            width: 8px;
            cursor: col-resize;
            z-index: 20;
        }

        #sidebar-resize-handle::after {
            content: '';
            display: block;
            width: 3px;
            height: 40px;
            border-radius: 2px;
            background: #D0D0D0;
            transition: background 0.15s, height 0.15s;
            margin: auto;
            margin-top: calc(50% - 20px);
        }

        #sidebar-resize-handle:hover::after,
        #sidebar-resize-handle.dragging::after {
            background: var(--accent);
            height: 56px;
        }

        /* Collapsed nav sidebar */
        #app-left.sidebar-collapsed {
            width: 72px;
        }
        #app-left.sidebar-collapsed #app-nav-strip {
            width: 72px;
            align-items: stretch;
            padding-left: 10px;
            padding-right: 10px;
        }
        #app-left.sidebar-collapsed #nav-brand-label,
        #app-left.sidebar-collapsed .nav-label {
            opacity: 0;
            pointer-events: none;
            width: 0;
            overflow: hidden;
        }
        #app-left.sidebar-collapsed .nav-item {
            justify-content: center;
            padding: 0;
            gap: 0;
        }
        #app-left.sidebar-collapsed #nav-brand {
            justify-content: center;
            padding-left: 0;
            padding-right: 0;
        }
        #app-left.sidebar-collapsed .nav-collapse-icon {
            transform: scaleX(-1);
        }

        /* Panel collapse button */
        /* Slim collapse bar pinned to the panel bottom — nav-style (icon + label),
           white background. */
        #btn-collapse-panel {
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            z-index: 30;
            display: flex;
            align-items: center;
            gap: 10px;
            height: 26px;
            padding: 0 14px;
            border: none;
            border-top: 1px solid var(--color-line);
            border-radius: 0;
            background: #fff;
            color: var(--color-grey-500);
            cursor: pointer;
            font-family: var(--f-ui);
            font-weight: 500;
            transition: background 120ms ease, color 120ms ease;
        }
        #btn-collapse-panel:hover { background: var(--color-grey-50); color: var(--color-mark); }
        #btn-collapse-panel .panel-collapse-icon {
            font-size: 17px;
            line-height: 1;
            flex-shrink: 0;
            transition: transform 220ms ease;
        }
        #btn-collapse-panel .panel-collapse-label { font-size: var(--fs-base); }

        /* Collapsed panel state */
        #app-body.panel-collapsed #app-side-panel {
            flex: none;
            width: 40px;
            min-width: 40px;
        }
        #app-body.panel-collapsed .panel-pane { display: none !important; }
        #app-body.panel-collapsed #sidebar-resize-handle { display: none; }
        /* Collapsed (40px strip): keep it at the bottom, icon only, flipped. */
        #app-body.panel-collapsed #btn-collapse-panel {
            justify-content: center;
            padding: 0;
            gap: 0;
            border-top: none;
            background: transparent;
        }
        #app-body.panel-collapsed #btn-collapse-panel .panel-collapse-label { display: none; }
        #app-body.panel-collapsed #btn-collapse-panel .panel-collapse-icon {
            transform: scaleX(-1);
        }

        /* search-widget styling now defined in the floating overlay block above */
        @keyframes fadeIn {
            from {
                opacity: 0;
            }

            to {
                opacity: 1;
            }
        }

        /* ─────────────────────────────────────────────────────────────
           STORE PIN POPUP
        ───────────────────────────────────────────────────────────── */
        .store-pin-popup .maplibregl-popup-content {
            padding: 12px 14px;
            border-radius: 8px;
            box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.06);
            font-family: var(--f-ui);
            min-width: 200px;
        }

        .store-pin-popup .maplibregl-popup-close-button {
            font-size: 16px;
            line-height: 1;
            padding: 4px 6px;
            color: var(--color-grey-500);
            top: 4px;
            right: 4px;
        }

        .store-pin-popup .maplibregl-popup-close-button:hover {
            color: var(--color-ink);
            background: none;
        }

        /* ─────────────────────────────────────────────────────────────
           LOADING TOAST
        ───────────────────────────────────────────────────────────── */
        #loading-indicator {
            position: fixed;
            top: 60px;
            /* overridden above to 54px in app context */
            background: var(--color-paper);
            color: rgba(42, 21, 72, 0.55);
            padding: 8px 22px;
            border-radius: 20px;
            border: none;
            box-shadow: var(--shadow-float);
            z-index: 1000;
            display: none;
            font-size: 11.5px;
            letter-spacing: 0.05em;
        }

        /* ─────────────────────────────────────────────────────────────
           PAGE-LOAD ANIMATIONS
        ───────────────────────────────────────────────────────────── */
        @keyframes slideLeft {
            from {
                opacity: 0;
                transform: translateX(-16px);
            }

            to {
                opacity: 1;
                transform: translateX(0);
            }
        }

        @keyframes fadeUp {
            from {
                opacity: 0;
                transform: translateY(12px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        /* ─────────────────────────────────────────────────────────────
           CONTROLS PANEL (Left Sidebar) — hidden, replaced by app-shell
        ───────────────────────────────────────────────────────────── */
        .controls-panel {
            display: none !important;
        }

        /* ── Scrollable Content ── */
        .sidebar-content {
            flex: 1;
            overflow-y: auto;
            padding: 8px 8px 20px;
            display: flex;
            flex-direction: column;
            gap: 0;
            background: var(--color-grey-50);
            scrollbar-width: thin;
            scrollbar-color: var(--color-grey-300) transparent;
        }

        .sidebar-content::-webkit-scrollbar {
            width: 4px;
        }

        .sidebar-content::-webkit-scrollbar-track {
            background: transparent;
        }

        .sidebar-content::-webkit-scrollbar-thumb {
            background: var(--border);
            border-radius: 2px;
        }

        /* ── Section — flat, no card chrome ── */
        .ctrl-section {
            background: transparent;
            border: none;
            border-radius: 0;
            box-shadow: none;
            padding: 10px 4px 4px;
            margin-bottom: 0;
        }

        .ctrl-section:last-child {
            margin-bottom: 0;
        }

        #network-store-section {
            padding: 10px 4px 4px;
        }

        /* Old .control-section for compat */
        .control-section {
            padding: 8px 0;
            border-bottom: none;
            display: flex;
            flex-direction: column;
            gap: 4px;
        }

        /* Section titles — small mono labels */
        .ctrl-section-header,
        .section-title,
        .controls-panel h3 {
            font-family: var(--f-data);
            font-size: 10px;
            font-weight: 500;
            color: rgba(42, 21, 72, 0.55);
            letter-spacing: 0.10em;
            text-transform: uppercase;
            margin-bottom: 8px;
            padding-top: 0;
        }

        /* ── Buttons ── */
        .btn-primary,
        .btn-danger,
        .btn-small,
        .btn-toggle,
        .btn-secondary {
            font-family: var(--f-ui);
            font-size: 11px;
            font-weight: 500;
            letter-spacing: 0.02em;
            border-radius: var(--r);
            cursor: pointer;
            transition: color 0.14s, border-color 0.14s, background-color 0.14s, box-shadow 0.14s;
            outline: none;
            min-height: 28px;
        }

        .btn-primary {
            width: 100%;
            padding: 8px 10px;
            background: var(--color-mark);
            color: var(--color-paper);
            border: none;
            margin: 2px 0;
        }

        .btn-primary:hover {
            background: color-mix(in oklch, var(--color-mark), white 8%);
            color: var(--color-paper);
            box-shadow: none;
        }

        .btn-primary:active {
            background: color-mix(in oklch, var(--color-mark), black 8%);
            color: var(--color-paper);
        }

        .btn-primary.active {
            background: var(--color-mark);
            color: var(--color-paper);
            border: none;
            box-shadow: none;
        }

        .btn-primary.active:hover {
            background: color-mix(in oklch, var(--color-mark), white 8%);
            border: none;
            box-shadow: none;
            color: var(--color-paper);
        }

        .btn-primary:disabled {
            background: var(--color-line-strong);
            color: rgba(42, 21, 72, 0.35);
            cursor: default;
            border: none;
        }

        .btn-danger {
            width: 100%;
            padding: 7px 10px;
            background: var(--color-paper);
            color: var(--color-ink);
            border: 1px solid var(--color-grey-300);
            margin: 2px 0;
        }

        .btn-danger:hover {
            border-color: var(--color-ink);
            color: var(--color-ink);
        }

        /* Icon-only clear button used beside main action buttons */
        .sim-clear-btn {
            width: 30px !important;
            text-align: center;
            line-height: 1;
        }

        /* ── Visibility Controls — flat, no box ── */
        .visibility-controls {
            background: transparent;
            border: none;
            padding: 0;
            border-radius: 0;
        }

        .visibility-label {
            font-size: 10px;
            font-weight: 500;
            color: var(--color-grey-500);
            letter-spacing: 0.08em;
            text-transform: uppercase;
            margin-bottom: 8px;
        }

        .toggle-buttons {
            display: flex;
            gap: 3px;
        }

        .btn-toggle {
            flex: 1;
            padding: 6px 4px;
            background: var(--color-paper);
            color: var(--color-ink);
            border: 1px solid #C8C8C8;
            border-radius: var(--r);
            font-size: 10px;
        }

        .btn-toggle:hover {
            border-color: var(--accent);
            box-shadow: 0 0 0 1px var(--accent);
            color: var(--accent);
        }

        .btn-toggle.active {
            background: var(--color-grey-700);
            color: var(--color-paper);
            border-color: var(--color-grey-700);
            box-shadow: none;
        }

        .btn-toggle.active:hover {
            background: var(--color-ink);
            border-color: var(--color-ink);
            box-shadow: none;
            color: var(--color-paper);
        }

        /* ── Radio Group ── */
        .radio-group {
            display: flex;
            flex-direction: column;
            gap: 3px;
        }

        .radio-label {
            display: flex;
            align-items: center;
            padding: 7px 8px;
            background: var(--color-paper);
            border: 1px solid var(--color-grey-300);
            border-radius: var(--r);
            cursor: pointer;
            font-size: 11px;
            color: var(--color-grey-500);
            transition: color 0.14s;
            min-height: 28px;
        }

        .radio-label:hover {
            color: var(--accent);
        }

        .radio-label input[type="radio"] {
            margin: 0 7px 0 0;
            accent-color: var(--accent);
        }

        .radio-label:has(input[type="radio"]:checked) {
            background: var(--color-paper);
            color: var(--accent);
            border: 1px solid var(--color-grey-300);
            border-left: 3px solid var(--accent);
        }

        /* ── Select Dropdowns ── */
        .control-group {
            margin: 4px 0;
        }

        .control-group label {
            display: block;
            font-size: 10px;
            color: var(--text-muted);
            letter-spacing: 0.09em;
            text-transform: uppercase;
            margin-bottom: 4px;
        }

        .control-group select {
            width: 100%;
            padding: 6px 28px 6px 8px;
            background: var(--surface);
            color: var(--text);
            border: 1px solid var(--border-2);
            border-radius: var(--r);
            font-family: var(--f-ui);
            font-size: 11px;
            cursor: pointer;
            appearance: none;
            -webkit-appearance: none;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='5' viewBox='0 0 9 5'%3E%3Cpath d='M0 0l4.5 5L9 0z' fill='%239C9790'/%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: right 9px center;
            transition: border-color 0.14s;
        }

        .control-group select:focus {
            outline: none;
            border-color: var(--accent);
        }

        .control-group select:disabled {
            border-color: var(--color-grey-500);
            color: var(--color-grey-500);
            cursor: not-allowed;
        }

        .resolution-hint {
            font-size: 10px;
            color: var(--text-muted);
            font-style: italic;
            margin-top: 3px;
        }

        /* ── Toggle Switch ── */
        .toggle-switch {
            position: relative;
            display: inline-block;
            width: 32px;
            height: 18px;
            flex-shrink: 0;
        }

        .toggle-switch input {
            opacity: 0;
            width: 0;
            height: 0;
        }

        .toggle-slider {
            position: absolute;
            inset: 0;
            background: var(--color-paper);
            border: 1px solid var(--color-grey-300);
            border-radius: 18px;
            cursor: pointer;
            transition: background 0.2s, border-color 0.2s, border-width 0.2s;
        }

        .toggle-slider::before {
            content: '';
            position: absolute;
            width: 12px;
            height: 12px;
            left: 2px;
            top: 2px;
            background: var(--color-grey-300);
            border-radius: 50%;
            transition: transform 0.2s, background 0.2s;
        }

        .toggle-switch input:checked+.toggle-slider {
            background: var(--color-paper);
            border: 1px solid var(--accent);
        }

        .toggle-switch input:checked+.toggle-slider::before {
            background: var(--accent);
            transform: translateX(14px);
        }

        /* ── Legend Items (sidebar) ── */
        .legend-item {
            display: flex;
            align-items: center;
            font-size: 11px;
            color: var(--text-dim);
            border-radius: var(--r);
            padding: 3px 0;
        }

        .legend-item:has(input[type="checkbox"]) {
            padding: 4px 6px;
            cursor: pointer;
            border: 1px solid transparent;
            transition: border-color 0.13s, border-width 0.13s;
        }

        .legend-item:has(input[type="checkbox"]:checked) {
            background: var(--color-paper);
            border: 1px solid var(--color-grey-300);
            border-left: 3px solid var(--accent);
            color: var(--accent);
        }

        .legend-color {
            width: 9px;
            height: 9px;
            margin-right: 7px;
            flex-shrink: 0;
            border-radius: 2px;
        }

        .legend-item input[type="checkbox"] {
            margin-right: 6px;
            cursor: pointer;
            accent-color: var(--accent);
        }

        .legend-item label {
            cursor: pointer;
            user-select: none;
            color: var(--text-dim);
        }

        .category-filters {
            display: flex;
            flex-direction: column;
            gap: 2px;
        }

        .legend-controls {
            display: flex;
            gap: 4px;
            margin-top: 7px;
        }

        .btn-small {
            flex: 1;
            padding: 4px 5px;
            background: var(--color-paper);
            color: var(--color-grey-500);
            border: 1px solid var(--color-grey-300);
            border-radius: var(--r);
            font-size: 10px;
        }

        .btn-small:hover {
            color: var(--accent);
        }

        /* ── Section label (grey area divider) ── */
        .section-label {
            font-size: 10px;
            font-weight: 500;
            color: var(--color-grey-500);
            letter-spacing: 0.08em;
            text-transform: uppercase;
            padding: 6px 4px 2px;
        }

        /* ── Button group sub-label ── */
        .btn-group-label {
            font-size: 10px;
            font-weight: 500;
            color: var(--color-grey-500);
            letter-spacing: 0.06em;
            text-transform: uppercase;
            margin-bottom: 5px;
            margin-top: 2px;
        }

        /* ── Category button (with color dot) ── */
        .category-btn {
            display: flex;
            align-items: center;
            justify-content: flex-start;
            gap: 8px;
        }

        .cat-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            flex-shrink: 0;
            display: inline-block;
            transition: box-shadow 0.14s;
        }

        .btn-primary.active .cat-dot {
            box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.7);
        }

        /* ── Resolution buttons ── */
        .res-buttons .btn-toggle {
            padding: 6px 2px;
            font-size: 11px;
            font-weight: 500;
        }

        .btn-toggle:disabled {
            color: #C8C8C8;
            border-color: #E8E8E8;
            cursor: not-allowed;
        }

        .btn-toggle.active:disabled {
            background: #E8E8E8;
            color: #C8C8C8;
            border-color: #E8E8E8;
            box-shadow: none;
        }

        /* ── Material Symbols — inline icon helper ── */
        .ms {
            font-family: 'Material Symbols Outlined';
            font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 20;
            font-style: normal;
            font-weight: normal;
            line-height: 1;
            font-size: 15px;
            vertical-align: -3px;
            display: inline-block;
            flex-shrink: 0;
            letter-spacing: 0;
            text-transform: none;
            pointer-events: none;
            user-select: none;
        }

        .nav-icon .ms {
            font-size: 20px;
            vertical-align: 0;
        }

        /* ── Sidebar spacer — pushes map style to bottom ── */
        .sidebar-spacer {
            flex: 1;
            min-height: 16px;
        }

        .section-divider {
            height: 1px;
            background: var(--border);
            margin: 6px 0;
        }

        /* ── Brand Mode ── */
        #brand-search {
            width: 100%;
            padding: 6px 9px;
            background: var(--surface);
            color: var(--text);
            border: 1px solid var(--border-2);
            border-radius: var(--r);
            font-family: var(--f-ui);
            font-size: 11px;
        }

        #brand-search:focus {
            outline: none;
            border-color: var(--accent);
        }

        #brand-search::placeholder {
            color: var(--text-muted);
        }

        .brand-item {
            display: flex;
            align-items: center;
            padding: 5px 7px;
            background: var(--color-paper);
            border: 1px solid var(--color-grey-300);
            border-radius: var(--r);
            font-size: 11px;
            transition: color 0.12s;
        }

        .brand-item:hover label {
            color: var(--accent);
        }

        .brand-item input[type="checkbox"] {
            margin: 0 7px 0 0;
            accent-color: var(--accent);
            cursor: pointer;
        }

        .brand-item label {
            display: flex;
            align-items: center;
            gap: 6px;
            cursor: pointer;
            flex: 1;
            user-select: none;
            color: var(--color-grey-500);
        }

        .brand-item:has(input[type="checkbox"]:checked) {
            background: var(--color-paper);
            border: 1px solid var(--color-grey-300);
            border-left: 3px solid var(--accent);
        }

        .brand-item:has(input[type="checkbox"]:checked) label {
            color: var(--accent);
        }

        .brand-name {
            flex: 1;
        }

        .brand-tier {
            font-family: var(--f-data);
            font-size: 8px;
            padding: 2px 5px;
            border-radius: 3px;
            text-transform: uppercase;
            font-weight: 500;
            letter-spacing: 0.4px;
        }

        .brand-tier.tier-ultra-luxury {
            color: var(--accent);
        }

        .brand-tier.tier-luxury {
            color: var(--accent);
        }

        .brand-tier.tier-premium {
            color: var(--color-grey-500);
        }

        .brand-count {
            font-family: var(--f-data);
            color: var(--accent);
            font-size: 10px;
        }

        .tier-filter-btn {
            flex: 1;
            font-size: 10px;
            padding: 4px;
            background: var(--color-paper);
            color: var(--color-grey-500);
            border: 1px solid var(--color-grey-300);
            border-radius: var(--r);
            cursor: pointer;
            font-family: var(--f-ui);
            transition: color 0.12s;
        }

        .tier-filter-btn:hover {
            color: var(--accent);
        }

        .tier-filter-btn.active {
            background: var(--color-paper);
            color: var(--color-ink);
            border: 1px solid var(--color-grey-300);
            border-left: 3px solid var(--color-grey-700);
        }

        /* ─────────────────────────────────────────────────────────────
           INFO PANEL (Right — hidden in new layout)
        ───────────────────────────────────────────────────────────── */
        .info-panel {
            display: none !important;
        }

        /* ─────────────────────────────────────────────────────────────
           CONFIRMATION POPUP
        ───────────────────────────────────────────────────────────── */
        .confirmation-popup {
            position: fixed;
            inset: 0;
            z-index: 2000;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .confirmation-backdrop {
            position: absolute;
            inset: 0;
            background: rgba(30, 30, 30, 0.45);
            backdrop-filter: blur(6px);
        }

        .confirmation-dialog {
            position: relative;
            background: var(--color-paper);
            padding: 28px 30px;
            border-radius: 16px;
            border: none;
            box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18), 0 0 0 0.5px rgba(0, 0, 0, 0.06);
            max-width: 430px;
            width: 90%;
            z-index: 2001;
        }

        .confirmation-dialog h3 {
            font-family: var(--f-disp);
            font-size: 22px;
            font-weight: 600;
            color: var(--text);
            margin-bottom: 20px;
        }

        .selection-info {
            background: var(--surface-2);
            border: 1px solid var(--border);
            border-radius: var(--r);
            overflow: hidden;
            margin-bottom: 20px;
        }

        .info-row {
            display: flex;
            justify-content: space-between;
            align-items: baseline;
            padding: 9px 12px;
            font-size: 13px;
            border-bottom: 1px solid var(--border);
        }

        .info-row:last-child {
            border-bottom: none;
        }

        .info-row-full {
            flex-direction: column;
            gap: 5px;
        }

        .info-row .label {
            color: var(--text-muted);
            font-size: 11px;
            letter-spacing: 0.03em;
        }

        .info-row .value {
            font-family: var(--f-data);
            font-size: 11px;
            color: var(--text);
        }

        .button-group {
            display: flex;
            gap: 10px;
        }

        .btn-secondary {
            flex: 1;
            padding: 10px 16px;
            background: var(--color-paper);
            color: var(--color-ink);
            border: 1px solid var(--color-grey-300);
            border-radius: var(--r);
            cursor: pointer;
            font-size: 13px;
            transition: border-color 0.14s, color 0.14s;
        }

        .btn-secondary:hover {
            color: var(--accent);
            border-color: var(--accent);
            background: var(--color-paper);
        }

        .button-group .btn-primary {
            flex: 1;
            margin: 0;
            padding: 10px 16px;
            font-size: 13px;
        }

        /* ─────────────────────────────────────────────────────────────
           LIMIT WARNING TOAST
        ───────────────────────────────────────────────────────────── */
        .limit-warning {
            position: fixed;
            top: 72px;
            left: 50%;
            transform: translateX(-50%);
            background: var(--color-paper);
            color: var(--color-ink);
            border: none;
            border-left: 3px solid var(--accent);
            box-shadow: var(--shadow-float);
            padding: 12px 22px;
            border-radius: 10px;
            z-index: 3000;
            max-width: 390px;
            text-align: center;
            font-size: 12px;
            line-height: 1.6;
            transition: opacity 0.3s ease;
        }

        .limit-warning strong {
            display: block;
            font-size: 13px;
            color: var(--accent);
            margin-bottom: 4px;
        }

        .limit-warning small {
            display: block;
            margin-top: 4px;
            font-size: 11px;
            color: var(--text-muted);
        }


        /* ─────────────────────────────────────────────────────────────
           MAPLIBRE GL OVERRIDES
        ───────────────────────────────────────────────────────────── */
        .maplibregl-popup-content {
            border-radius: 12px !important;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12), 0 0 0 0.5px rgba(0, 0, 0, 0.04) !important;
            border: none !important;
            font-family: var(--f-ui) !important;
            padding: 0 !important;
        }

        .maplibregl-popup-close-button {
            font-size: 18px !important;
            padding: 4px 8px !important;
        }

        /* ─────────────────────────────────────────────────────────────
           COLLAPSIBLE SECTIONS
        ───────────────────────────────────────────────────────────── */
        .collapsible-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            cursor: pointer;
            padding: 2px 0 6px;
            user-select: none;
        }

        .collapsible-header:hover .ctrl-section-header {
            color: var(--text);
        }

        .collapsible-arrow {
            font-size: 9px;
            color: #C8C8C8;
            transition: transform 0.2s;
            flex-shrink: 0;
        }

        .collapsible-section.collapsed .collapsible-arrow {
            transform: rotate(-90deg);
        }

        .collapsible-section.collapsed .collapsible-body {
            display: none;
        }

        .brand-badge {
            font-family: var(--f-data);
            font-size: 9px;
            padding: 1px 6px;
            background: var(--color-paper);
            color: var(--accent);
            border-radius: 8px;
            font-weight: 600;
            display: none;
            box-shadow: var(--shadow-badge);
        }

        .brand-badge.visible {
            display: inline-block;
        }

        /* ─────────────────────────────────────────────────────────────
           MISC
        ───────────────────────────────────────────────────────────── */
        #brands-list {
            scrollbar-width: thin;
            scrollbar-color: var(--border) transparent;
        }

        #brands-list::-webkit-scrollbar {
            width: 4px;
        }

        #brands-list::-webkit-scrollbar-thumb {
            background: var(--border);
            border-radius: 2px;
        }

        .info-text {
            font-size: 10px;
            color: var(--text-muted);
            line-height: 1.5;
            padding: 6px 8px;
            background: var(--surface-2);
            border-radius: var(--r);
            border: 1px solid var(--border);
        }

        .ai-spinner {
            width: 14px;
            height: 14px;
            border: 2px solid var(--color-grey-300);
            border-top-color: var(--accent);
            border-radius: 50%;
            animation: ai-spin 0.8s linear infinite;
            flex-shrink: 0;
        }

        @keyframes ai-spin {
            to {
                transform: rotate(360deg);
            }
        }

        .toolbar-icon-btn.tab-active {
            background: var(--accent);
            color: var(--color-paper);
            box-shadow: none;
        }

        /* ── Catchment controls ── */
        #catchment-controls select {
            width: 100%;
            padding: 7px 9px;
            font-family: var(--f-ui);
            font-size: 12px;
            border: 1px solid var(--color-grey-300);
            border-radius: 4px;
            background: var(--color-paper);
            color: var(--color-ink);
            cursor: pointer;
            margin-bottom: 6px;
        }

        #catchment-controls select:focus {
            outline: none;
            border: 2px solid var(--accent);
        }

        .catchment-mode-toggle {
            display: flex;
            gap: 6px;
            margin-bottom: 0;
        }

        .catchment-mode-toggle button {
            flex: 1;
            padding: 6px 0;
            font-family: var(--f-ui);
            font-size: 11px;
            font-weight: 600;
            border: 1px solid var(--color-ink);
            border-radius: 4px;
            background: var(--color-paper);
            color: var(--color-ink);
            cursor: pointer;
        }

        .catchment-mode-toggle button:hover {
            border: 2px solid var(--accent);
        }

        .catchment-mode-toggle button.active {
            border: 3px solid var(--accent);
            background: var(--accent);
            color: var(--color-paper);
        }

        .catchment-threshold-row {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-bottom: 8px;
        }

        .catchment-threshold-row label {
            font-size: 11px;
            color: var(--color-ink);
            white-space: nowrap;
            min-width: 70px;
        }

        .catchment-threshold-row input[type=number] {
            width: 64px;
            padding: 5px 7px;
            font-family: var(--f-ui);
            font-size: 12px;
            border: 1px solid var(--color-grey-300);
            border-radius: 4px;
            background: var(--color-paper);
        }

        .catchment-threshold-row input[type=number]:focus {
            outline: none;
            border: 2px solid var(--accent);
        }

        .catchment-zone-card {
            border: 1px solid var(--color-grey-300);
            border-radius: 6px;
            padding: 10px;
            margin-bottom: 8px;
            background: var(--color-paper);
        }

        .catchment-zone-label {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 12px;
            font-weight: 600;
            margin-bottom: 8px;
        }

        .catchment-zone-dot {
            width: 10px;
            height: 10px;
            border-radius: 50%;
            flex-shrink: 0;
        }

        .catchment-stats-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 4px 10px;
        }

        .catchment-stat {
            font-size: 11px;
            color: var(--color-ink);
        }

        .catchment-stat span {
            font-weight: 600;
        }

        .catchment-loading {
            display: none;
            align-items: center;
            gap: 8px;
            font-size: 12px;
            color: var(--accent);
            margin-top: 8px;
        }

        .catchment-error {
            display: none;
            font-size: 11px;
            color: #9A2E32;
            margin-top: 6px;
            padding: 6px 8px;
            background: #fff0f0;
            border-radius: 4px;
            border: 1px solid #9A2E32;
        }

        /* ── Network Matrix ── */
        #network-matrix-table th {
            background: #F8F8F8;
            font-weight: 600;
            user-select: none;
        }

        #network-matrix-table td {
            padding: 4px 6px;
            border-bottom: 1px solid #E8E8E8;
            vertical-align: middle;
        }

        #network-matrix-table tr:hover td {
            background: #F5F0FA;
            cursor: pointer;
        }

        #network-matrix-table tr.matrix-row-selected td {
            background: #EDE0F5;
        }

        #network-matrix-table tfoot td {
            font-weight: 600;
            border-top: 2px solid var(--color-ink);
            border-bottom: none;
        }

        .mini-bar-wrap {
            width: 60px;
            height: 6px;
            background: #E8E8E8;
            border-radius: 3px;
            overflow: hidden;
            margin-bottom: 2px;
        }

        .mini-bar {
            height: 100%;
            background: var(--accent);
            border-radius: 3px;
        }

        .mini-bar-wrap.secondary .mini-bar {
            background: var(--color-grey-300);
        }

        .overlap-cell {
            color: #9A2E32;
            font-size: 10px;
        }

        /* ── Retailers controls — select styling now applied inline ── */

        .retailers-store-count {
            font-size: 11px;
            color: var(--text-muted);
            margin-top: 6px;
            min-height: 16px;
        }

        .retailers-store-count span {
            font-weight: 600;
            color: var(--accent);
        }

        /* ─────────────────────────────────────────────────────────────
           SCORECARD PANEL
        ───────────────────────────────────────────────────────────── */
        /* (scorecard-panel removed — eval lives inside #stats-panel) */

        #sc-poi-name {
            font-family: var(--f-disp);
            font-size: 16px;
            font-weight: 600;
            color: var(--text);
            line-height: 1.2;
            margin-bottom: 3px;
        }

        #sc-poi-meta {
            font-size: 10px;
            color: var(--text-muted);
            line-height: 1.4;
        }

        #sc-close-btn {
            background: none;
            border: none;
            cursor: pointer;
            font-size: 16px;
            color: var(--text-muted);
            padding: 2px 4px;
            border-radius: var(--r);
            flex-shrink: 0;
            line-height: 1;
            transition: color 0.12s;
        }

        #sc-close-btn:hover {
            color: var(--text);
        }

        #scorecard-body-unused {
            flex: 1;
            overflow-y: auto;
            padding: 0 14px;
        }

        .sc-category {
            padding: 14px 0 10px;
            border-bottom: none;
        }

        .sc-cat-header {
            font-family: var(--f-ui);
            font-size: 10px;
            font-weight: 500;
            color: var(--color-grey-500);
            text-transform: uppercase;
            letter-spacing: .08em;
            margin-bottom: 4px;
        }

        .sc-cat-desc {
            font-size: 10px;
            color: var(--text-muted);
            line-height: 1.5;
            margin-bottom: 8px;
        }

        .sc-metric-chips {
            display: flex;
            flex-wrap: wrap;
            gap: 4px;
            margin-bottom: 8px;
        }

        .sc-metric-chip {
            font-family: var(--f-data);
            font-size: 9px;
            padding: 2px 6px;
            background: var(--surface-2);
            border: 1px solid var(--border);
            border-radius: 3px;
            color: var(--text-muted);
        }

        .sc-auto-score {
            font-size: 10px;
            color: var(--text-muted);
            margin-bottom: 6px;
        }

        .sc-auto-score span {
            font-family: var(--f-data);
            color: var(--accent);
            font-size: 11px;
        }

        .sc-score-row {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-bottom: 6px;
        }

        .sc-score-row label {
            font-size: 10px;
            color: var(--text-muted);
            width: 34px;
            flex-shrink: 0;
        }

        .sc-score-row input[type="number"] {
            width: 46px;
            padding: 4px 6px;
            font-family: var(--f-data);
            font-size: 13px;
            text-align: center;
            border: 1px solid var(--border-2);
            border-radius: var(--r);
            background: var(--surface);
            color: var(--text);
            outline: none;
        }

        .sc-score-row input[type="number"]:focus {
            border-color: var(--accent);
        }

        .sc-score-bar {
            flex: 1;
            height: 6px;
            background: var(--color-grey-300);
            border-radius: 3px;
            overflow: hidden;
        }

        .sc-score-fill {
            height: 100%;
            width: 0;
            border-radius: 3px;
            transition: width 0.3s ease, background-color 0.3s ease;
        }

        .sc-notes {
            width: 100%;
            font-family: var(--f-ui);
            font-size: 11px;
            color: var(--color-ink);
            border: 1px solid var(--color-grey-300);
            border-radius: var(--r);
            padding: 6px 8px;
            background: var(--color-paper);
            resize: vertical;
            outline: none;
            line-height: 1.5;
        }

        .sc-notes:focus {
            border-color: var(--accent);
        }

        #sc-updated-at {
            font-size: 10px;
            color: var(--text-muted);
            font-family: var(--f-data);
        }

        #sc-save-btn {
            padding: 7px 14px;
            font-size: 11px;
        }

        /* ── Network Analysis Panel ── */
        /* Store card wrapper */
        .network-store-card {
            border-bottom: 1px solid var(--color-grey-100);
            background: transparent;
        }
        .network-store-card:last-child { border-bottom: none; }
        .network-store-row {
            display: flex;
            align-items: center;
            gap: 8px;
            width: 100%;
            padding: 9px 12px;
            border: none;
            border-left: 3px solid transparent;
            background: transparent;
            cursor: pointer;
            text-align: left;
            font-family: var(--f-ui);
        }
        .network-store-analyze-btns {
            display: none;
            padding: 5px 12px 7px 15px;
            border-bottom: 1px solid var(--color-grey-100);
        }
        .network-store-analyze-btns-inner {
            display: flex;
            gap: 5px;
        }
        .network-store-analyze-btn {
            flex: none;
            padding: 4px 14px;
            font-size: 11px;
            font-weight: 500;
            font-family: var(--f-ui);
            border: 1px solid var(--color-grey-100);
            background: var(--color-grey-50);
            color: var(--color-grey-700);
            cursor: pointer;
            text-align: center;
            letter-spacing: 0.02em;
            border-radius: var(--r);
            transition: background 0.1s, border-color 0.1s;
            position: relative;
            overflow: hidden;
        }
        .network-store-analyze-btn span {
            position: relative;
            z-index: 1;
            pointer-events: none;
        }
        /* Loading sweep — subtle dark overlay */
        .network-store-analyze-btn::before {
            content: '';
            position: absolute;
            inset: 0;
            background: rgba(0, 0, 0, 0.06);
            transform: scaleX(0);
            transform-origin: left center;
            z-index: 0;
            pointer-events: none;
        }
        @keyframes btnLoadFill {
            from { transform: scaleX(0); }
            to   { transform: scaleX(0.88); }
        }
        @keyframes btnLoadComplete {
            from { transform: scaleX(0.88); }
            to   { transform: scaleX(1); }
        }
        .network-store-analyze-btn.loading::before {
            animation: btnLoadFill 9s cubic-bezier(0.04, 0.82, 0.08, 1) forwards;
        }
        .network-store-analyze-btn.load-complete::before {
            animation: btnLoadComplete 0.25s ease-in forwards;
        }
        .network-store-analyze-btn:hover {
            background: var(--color-grey-100);
            border-color: var(--color-grey-300);
            color: var(--color-ink);
        }
        .network-store-analyze-btn.active {
            background: var(--color-grey-100);
            border-color: var(--color-grey-300);
            color: var(--color-ink);
        }

        .network-store-card:has(.network-store-row.active) .network-store-analyze-btns {
            display: block;
        }
        .network-store-row:hover { background: var(--color-grey-50); }

        /* Street density toggle — micro analysis */
        .street-toggle {
            font-size: 10px;
            font-family: var(--f-ui);
            padding: 3px 10px;
            border: 1px solid var(--color-ink);
            background: var(--color-paper);
            cursor: pointer;
            border-radius: 2px;
            letter-spacing: 0.03em;
        }
        .street-toggle:hover { border-color: var(--accent); border-width: 2px; }
        .street-toggle.active { border: 2px solid var(--accent); background: var(--accent); color: var(--color-paper); }
        .network-store-row.active {
            background: rgba(74,43,124,0.05);
            border-left-color: var(--color-mark);
        }
        .network-store-info {
            flex: 1;
            display: flex;
            flex-direction: column;
            gap: 1px;
            min-width: 0;
        }
        .network-store-city {
            font-size: 13px;
            font-weight: 600;
            color: var(--color-ink);
            letter-spacing: -0.005em;
        }
        .network-store-row.active .network-store-city { color: var(--color-ink); }
        .network-store-name {
            font-size: 11px;
            color: var(--text-muted);
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .network-store-row.active .network-store-name { color: var(--color-grey-700); }
        .network-store-analyze-hint {
            font-size: 10px;
            color: var(--color-grey-500);
            flex-shrink: 0;
            white-space: nowrap;
        }
        .network-store-row.active .network-store-analyze-hint { color: var(--color-grey-500); }
        .network-store-metric {
            font-family: var(--f-data);
            font-size: 12px;
            font-weight: 600;
            color: var(--color-mark);
            flex-shrink: 0;
            text-align: right;
            white-space: nowrap;
        }
        .network-store-metric-sub {
            display: block;
            font-size: 9px;
            font-weight: 400;
            color: var(--color-grey-500);
            text-align: right;
        }

        /* Store stats (populated after analysis) */
        .network-store-stats {
            border-top: 1px solid var(--color-grey-100);
            padding-left: 15px;
        }
        .nsc-catchment-wrap {
            padding: 7px 10px 7px 0;
            display: flex;
            flex-direction: column;
            gap: 5px;
        }
        .nsc-catchment-wrap:empty { padding: 0; }
        .nsc-zone {
            display: flex;
            align-items: flex-start;
            gap: 7px;
        }
        .nsc-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            flex-shrink: 0;
            margin-top: 3px;
        }
        .nsc-zone-body { flex: 1; }
        .nsc-zone-label {
            font-size: 10px;
            color: var(--color-grey-500);
            margin-bottom: 2px;
        }
        .nsc-zone-stats {
            font-size: 11px;
            color: var(--color-ink);
            display: flex;
            align-items: center;
            gap: 4px;
            flex-wrap: wrap;
        }
        .nsc-sep { color: var(--color-grey-500); }

        /* ── Evaluation Panel ── */
        .eval-card {
            padding: 10px 12px;
        }
        .eval-score-row {
            display: flex;
            align-items: center;
            gap: 6px;
            margin-bottom: 4px;
        }
        .eval-score-bar {
            flex: 1;
            height: 4px;
            background: var(--color-grey-50);
            border-radius: 2px;
            overflow: hidden;
        }
        .eval-score-fill {
            height: 100%;
            background: var(--accent);
            border-radius: 2px;
            transition: width 0.3s ease;
        }
        .eval-note {
            width: 100%;
            margin-top: 8px;
            font-family: var(--f-ui);
            font-size: 11px;
            color: var(--color-ink);
            border: 1px solid var(--color-grey-300);
            border-radius: var(--r);
            padding: 5px 8px;
            background: var(--color-paper);
            resize: none;
            outline: none;
            line-height: 1.5;
            box-sizing: border-box;
        }
        .eval-note:focus { border-color: var(--accent); }
        .eval-status-select:focus { outline: none; border-color: var(--accent); }

        /* ── Eval card redesign ── */
        .eval-card-header {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            margin-bottom: 8px;
        }
        .eval-card-title { flex: 1; min-width: 0; }
        .eval-overall-chip {
            font-size: 13px;
            font-weight: 700;
            color: var(--accent);
            padding: 2px 7px;
            border: 1px solid var(--accent);
            border-radius: 4px;
            flex-shrink: 0;
            margin-left: 8px;
        }
        .eval-row-label {
            font-size: 10px;
            color: var(--color-grey-500);
            width: 60px;
            flex-shrink: 0;
        }
        .eval-row-val {
            font-size: 11px;
            font-weight: 600;
            color: var(--accent);
            width: 18px;
            text-align: right;
            flex-shrink: 0;
        }
        .eval-edit-btn {
            margin-top: 10px;
            width: 100%;
            padding: 6px 0;
            font-size: 11px;
            font-weight: 600;
            font-family: var(--f-ui);
            background: #fff;
            color: var(--color-ink);
            border: 1px solid var(--color-grey-300);
            border-radius: var(--r);
            cursor: pointer;
            text-align: center;
            transition: border-color 0.1s, color 0.1s;
        }
        .eval-edit-btn:hover { border-color: var(--accent); border-width: 2px; color: var(--accent); }

        /* ── Network store eval dot (status indicator in row header) ── */
        .nsc-eval-dot {
            width: 7px;
            height: 7px;
            border-radius: 50%;
            flex-shrink: 0;
            margin-left: 6px;
            transition: background 0.2s;
        }

        /* ── Eval section inside stats container ── */
        .nsc-eval-section {
            padding: 7px 10px 8px;
            cursor: pointer;
            transition: background 0.1s;
            border-top: 1px solid var(--color-grey-100);
        }
        .nsc-catchment-wrap:empty + .nsc-eval-section { border-top: none; }
        .nsc-eval-section:hover { background: #F7F3FB; }
        .nsc-eval-hd {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 5px;
        }
        .nsc-eval-title {
            font-size: 9px;
            font-weight: 600;
            color: var(--color-grey-500);
            text-transform: uppercase;
            letter-spacing: 0.06em;
        }
        .nsc-eval-overall {
            font-size: 11px;
            font-weight: 700;
            color: var(--accent);
            padding: 1px 5px;
            border: 1px solid var(--accent);
            border-radius: 3px;
        }

        /* ── Store button (alongside Macro/Micro in store card) ── */
        .network-store-analyze-btn.eval-btn {
            background: #fff;
            color: var(--color-ink);
            border-left: 1px solid var(--color-grey-100);
            flex: 0 0 46px;
        }
        .network-store-analyze-btn.eval-btn::before { display: none; }
        .network-store-analyze-btn.eval-btn:hover {
            background: #F7F3FB;
            color: var(--accent);
        }

        /* ── Team Evaluation Panel (new conversation-based system) ── */
        .eval-unified-card .network-store-row { pointer-events: none; }
        .eval-card-convo { padding: 0 12px 12px; border-top: 1px solid var(--color-grey-100); }
        .eval-store-stats {
            padding: 8px 12px 10px;
            border-top: 1px solid var(--color-grey-100);
            display: flex; flex-direction: column; gap: 10px;
        }
        .eval-kpi-section { display: flex; flex-direction: column; gap: 4px; }
        .eval-kpi-header {
            font-size: 9px; font-weight: 700; letter-spacing: .1em;
            text-transform: uppercase; color: var(--color-grey-500); margin-bottom: 2px;
        }
        .eval-kpi-row {
            display: flex; align-items: center; gap: 6px; font-size: 11px;
        }
        .eval-kpi-dot {
            width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
        }
        .eval-kpi-label { color: var(--color-grey-500); width: 44px; flex-shrink: 0; font-size: 10px; }
        .eval-kpi-val   { color: var(--color-ink); flex: 1; }
        .eval-rank-badge {
            font-size: 10px; font-weight: 700; border-radius: 4px;
            padding: 1px 6px; flex-shrink: 0;
        }
        .eval-rank-top { background: #EDE0F5; color: var(--color-mark); }
        .eval-rank-mid { background: var(--color-grey-50); color: #666; }
        .eval-rank-low { background: #F5F5F5; color: var(--color-grey-500); }
        .eval-cat-tabs {
            display: flex; gap: 3px; margin: 14px 0 8px;
            border-top: 1px solid var(--color-grey-100); padding-top: 12px;
        }
        .eval-cat-tab {
            flex: 1; padding: 4px 6px; font-size: 10px; font-weight: 600;
            letter-spacing: .05em; text-transform: uppercase;
            border: 1px solid #D4D4D4; background: #fff; border-radius: 4px;
            cursor: pointer; color: var(--color-grey-500);
        }
        .eval-cat-tab.active {
            border-color: var(--color-mark); background: var(--color-mark); color: #fff;
        }
        .eval-thread {
            min-height: 40px; margin-bottom: 8px;
        }
        .eval-note-row {
            display: flex; gap: 8px; margin-bottom: 8px; align-items: flex-start;
        }
        .eval-note-avatar {
            width: 24px; height: 24px; border-radius: 50%;
            background: var(--color-mark); color: #fff;
            font-size: 9px; font-weight: 700;
            display: flex; align-items: center; justify-content: center;
            flex-shrink: 0; margin-top: 1px;
        }
        .eval-note-body { flex: 1; min-width: 0; }
        .eval-note-meta {
            display: flex; align-items: center; gap: 5px; margin-bottom: 2px;
        }
        .eval-note-author { font-size: 10px; font-weight: 600; color: var(--color-ink); }
        .eval-note-date   { font-size: 10px; color: var(--color-grey-500); }
        .eval-note-delete {
            margin-left: auto; background: none; border: none; cursor: pointer;
            font-size: 10px; color: #D4D4D4; padding: 0 2px; line-height: 1;
        }
        .eval-note-delete:hover { color: var(--color-ink); }
        .eval-note-content { font-size: 11px; color: #333; line-height: 1.45; }
        .eval-input-row {
            display: flex; gap: 6px; align-items: flex-end; margin-bottom: 10px;
        }
        .eval-textarea {
            flex: 1; font-size: 11px; padding: 5px 7px;
            border: 1px solid #D4D4D4; border-radius: 4px; resize: none;
            font-family: var(--f-ui);
        }
        .eval-textarea:focus { outline: none; border-color: var(--color-mark); }
        .eval-post-btn {
            padding: 5px 10px; font-size: 11px; font-weight: 600;
            background: var(--color-mark); color: #fff; border: none; border-radius: 4px;
            cursor: pointer; white-space: nowrap;
        }
        .eval-post-btn:hover { background: color-mix(in oklch, var(--color-mark), black 10%); }
        .eval-summary-section {
            padding-top: 0;
        }
        .eval-summary-header {
            display: flex; align-items: center; justify-content: space-between;
            margin-bottom: 6px;
        }
        .eval-summary-label {
            font-size: 9px; font-weight: 700; letter-spacing: .1em;
            text-transform: uppercase; color: var(--color-grey-500);
        }
        .eval-generate-btn {
            font-size: 10px; padding: 2px 8px; background: transparent;
            border: 1px solid var(--color-line); color: var(--color-mark); border-radius: 4px;
            cursor: pointer; font-weight: 600;
        }
        .eval-generate-btn:hover { background: rgba(74,43,124,0.07); border-color: var(--color-mark); }
        .eval-generate-btn:disabled { opacity: .5; cursor: not-allowed; }
        .eval-sum-bullet {
            font-size: 12px; color: #333; line-height: 1.55; margin-bottom: 4px;
        }
        .eval-sum-label {
            font-size: 10px; font-weight: 700; text-transform: uppercase;
            color: var(--color-mark); margin-right: 4px;
        }

        /* ── Network store note badge ── */
        .nsc-note-badge {
            min-width: 18px; height: 18px; border-radius: 9px;
            background: var(--color-mark); color: #fff;
            font-size: 10px; font-weight: 700;
            align-items: center; justify-content: center;
            padding: 0 5px; flex-shrink: 0;
        }

        /* ── Network store summary strip ── */
        .nsc-summary-strip {
            padding: 5px 10px 6px;
            border-top: 1px solid var(--color-grey-100);
        }
        .nsc-summary-strip:empty { display: none; }
        .nsc-sum-bullet {
            font-size: 10px; color: #555; line-height: 1.45; margin-bottom: 2px;
        }
        .nsc-no-summary {
            font-size: 10px; color: #C0C0C0; font-style: italic;
        }

        /* ── Plan Badges ── */
        .plan-badge {
            display: inline-block;
            font-size: 9px;
            font-weight: 700;
            letter-spacing: 0.05em;
            padding: 1px 5px;
            border-radius: 3px;
            text-transform: uppercase;
            flex-shrink: 0;
        }
        .plan-badge-prospect {
            color: var(--color-mark);
            border: 1px solid var(--color-mark);
            background: transparent;
        }
        .plan-badge-closing {
            color: #c00;
            border: 1px solid #c00;
            background: transparent;
        }

        /* ── Plan store list card ── */
        .plan-loc-card {
            background: #fff;
            border: 1px solid #E8E8E8;
            border-radius: 6px;
            padding: 9px 10px;
        }
        .plan-loc-header {
            display: flex;
            align-items: center;
            gap: 6px;
            margin-bottom: 6px;
        }
        .plan-loc-city {
            font-size: 12px;
            font-weight: 600;
            color: var(--color-ink);
            flex: 1;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .plan-loc-actions {
            display: flex;
            gap: 5px;
            margin-top: 4px;
        }
        .plan-loc-btn {
            font-size: 10px;
            padding: 3px 8px;
            border: 1px solid var(--color-grey-300);
            background: #fff;
            border-radius: 3px;
            cursor: pointer;
            font-family: var(--f-ui);
        }
        .plan-loc-btn:hover { border-color: var(--color-mark); color: var(--color-mark); }
        .plan-loc-btn-danger { border-color: #c00 !important; color: #c00 !important; }
        .plan-loc-btn-danger:hover { background: #c00 !important; color: #fff !important; }

        /* ── Store Ranking Float Panel ── */
        #ranking-groups {
            overflow-y: auto;
        }
        #scatter-container {
            display: none;
            padding: 4px 0;
            overflow: hidden;
        }
        #ranking-panel-header {
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 8px 10px 6px;
            border-bottom: 1px solid var(--color-grey-100);
            flex-shrink: 0;
        }
        #ranking-panel-title {
            font-size: 9px;
            font-weight: 600;
            letter-spacing: 0.08em;
            text-transform: uppercase;
            color: var(--color-grey-500);
            flex: 1;
        }
        .ranking-zone-btn {
            font-size: 10px;
            font-weight: 500;
            padding: 2px 7px;
            border: 1px solid var(--color-grey-300);
            border-radius: 3px;
            background: var(--color-paper);
            color: var(--color-grey-500);
            cursor: pointer;
        }
        .ranking-zone-btn.active { border: 2px solid var(--accent); color: var(--accent); background: var(--color-paper); }
        .ranking-zone-btn .ms { font-size: 13px; vertical-align: -2px; }

        /* ── Scatter chart ── */
        .scatter-loading {
            padding: 16px 12px;
            font-size: 11px;
            color: var(--color-grey-500);
        }
        #scatter-tooltip {
            display: none;
            position: fixed;
            background: var(--color-paper);
            border: 1px solid var(--color-line);
            border-radius: 6px;
            padding: 7px 10px;
            font-size: 10px;
            line-height: 1.6;
            pointer-events: none;
            box-shadow: 0 2px 10px rgba(0,0,0,0.10);
            z-index: 9999;
        }
        .ranking-group {
            border-bottom: 1px solid var(--color-grey-100);
            padding: 6px 10px;
        }
        .ranking-group:last-child { border-bottom: none; }
        .ranking-group-label {
            font-size: 9px;
            font-weight: 600;
            color: var(--color-grey-500);
            letter-spacing: 0.05em;
            margin-bottom: 4px;
        }
        .ranking-store-chip {
            display: inline-flex;
            flex-direction: column;
            align-items: flex-start;
            font-size: 10px;
            font-weight: 500;
            padding: 3px 7px;
            margin: 2px 2px 2px 0;
            border: 1px solid var(--color-grey-300);
            border-radius: 6px;
            color: var(--color-ink);
            background: var(--color-paper);
            cursor: pointer;
            white-space: nowrap;
            line-height: 1.3;
        }
        .ranking-store-chip .chip-name {
            font-size: 9px;
            color: var(--color-grey-500);
            font-weight: 400;
        }
        .ranking-store-chip:hover { border-color: var(--accent); color: var(--accent); }
        .ranking-store-chip:hover .chip-name { color: var(--accent); }
        .ranking-store-chip.selected { border: 2px solid var(--accent); color: var(--accent); font-weight: 600; }
        .ranking-store-chip.selected .chip-name { color: var(--accent); }

/* ── Accent colour swatches ─────────────────────────────────── */
.accent-swatch {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    flex-shrink: 0;
    outline: none;
    padding: 0;
    transition: transform 0.12s;
}
.accent-swatch:hover { transform: scale(1.18); }
.accent-swatch.active { border-color: var(--color-ink); }

/* ── Plans panel ── */
.plans-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 12px 8px;
    border-bottom: 1px solid var(--color-grey-100);
    flex-shrink: 0;
}
.plans-empty-state {
    padding: 40px 20px;
    text-align: center;
}
.plans-empty-title {
    font-family: var(--f-ui);
    font-size: 14px;
    font-weight: 500;
    color: var(--color-ink);
    margin-bottom: 8px;
}
.plans-empty-body {
    font-family: var(--f-ui);
    font-size: 12px;
    color: var(--color-grey-500);
    line-height: 1.55;
}
.plan-list-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--color-grey-100);
    cursor: pointer;
    transition: background 100ms ease;
}
.plan-list-card:hover { background: rgba(74,43,124,0.04); }
.plan-list-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.plan-list-name {
    font-family: var(--f-ui);
    font-size: 13px;
    font-weight: 500;
    color: var(--color-ink);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.plan-list-meta {
    font-family: var(--f-data);
    font-size: 10px;
    color: var(--color-grey-500);
    letter-spacing: 0.04em;
}
.plan-status-tag {
    font-family: var(--f-data);
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 3px;
    flex-shrink: 0;
}
.plan-status-active  { background: rgba(47,122,77,0.1); color: #2F7A4D; }
.plan-status-draft   { background: var(--color-grey-100); color: var(--color-grey-700); }
.plan-status-shared  { background: rgba(74,43,124,0.1); color: var(--color-mark); }
.plan-status-archived{ background: var(--color-grey-100); color: var(--color-grey-500); opacity: 0.6; }

/* Canvas header */
.plans-canvas-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--color-grey-100);
    flex-shrink: 0;
    background: var(--color-cream);
}
.plans-back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid var(--color-grey-100);
    border-radius: 6px;
    background: var(--color-paper);
    cursor: pointer;
    color: var(--color-grey-700);
    flex-shrink: 0;
    transition: background 120ms ease;
}
.plans-back-btn:hover { background: var(--color-grey-50); }
.plans-canvas-name {
    font-family: var(--f-ui);
    font-size: 13px;
    font-weight: 500;
    color: var(--color-ink);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.plans-autosave {
    font-family: var(--f-data);
    font-size: 10px;
    color: var(--color-grey-500);
    letter-spacing: 0.04em;
    flex-shrink: 0;
    white-space: nowrap;
}

/* ── Coming-soon nav section ── */
.nav-group-divider,
.nav-coming-divider {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 20px 10px 4px;
    flex-shrink: 0;
    overflow: hidden;
}
.nav-group-label,
.nav-coming-label {
    font-family: var(--f-data);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-grey-500);
    white-space: nowrap;
}
.nav-group-line,
.nav-coming-line {
    flex: 1;
    height: 1px;
    background: var(--color-grey-100);
}
/* Plain hairline divider — mirrors the Home operating-model stages without labels.
   Stays visible (short line) when the sidebar is collapsed. */
.nav-divider {
    height: 1px;
    background: var(--color-grey-100);
    margin: 9px 12px;
    flex-shrink: 0;
}
#app-left.sidebar-collapsed .nav-divider { margin: 9px 14px; }
.nav-soon-tag {
    font-family: var(--f-data);
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-grey-500);
    background: var(--color-grey-100);
    border-radius: 3px;
    padding: 2px 5px;
    flex-shrink: 0;
}
.nav-item-coming {
    opacity: 0.55;
    cursor: default !important;
}
.nav-item-coming:hover { background: transparent !important; color: var(--color-grey-500) !important; }
#app-left.sidebar-collapsed .nav-coming-divider,
#app-left.sidebar-collapsed .nav-group-divider { display: none; }
#app-left.sidebar-collapsed .nav-soon-tag { display: none; }

/* ── Unread badge on Team nav item ── */
.nav-badge {
    font-family: var(--f-data);
    font-size: 9px;
    font-weight: 600;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: var(--color-mark);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    flex-shrink: 0;
}
#app-left.sidebar-collapsed .nav-badge { display: none !important; }

/* ── Map Controls Right Panel (Brands / Map Layers / Store tabs) ── */
/* Layer controls — fill the Analyze panel below the store context card. */
#network-layer-controls {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: #fff;
}
/* Unified active state for the layer controls — solid dark-purple fill with
   white text (the Portfolio selection treatment). Category checkboxes keep
   their own style so their colour dots stay visible. */
#network-layer-controls .float-btn.active:not(.category-btn) {
    border-color: var(--color-mark);
    background: var(--color-mark);
    color: #fff;
}
/* Advanced disclosure */
.nlc-advanced-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 8px 4px 6px;
    margin-top: 4px;
    background: none;
    border: none;
    border-top: 1px solid var(--color-line);
    cursor: pointer;
    font-family: var(--f-ui);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-grey-500);
}
.nlc-advanced-toggle:hover { color: var(--color-mark); }
.nlc-advanced-toggle .ms { font-size: 16px; transition: transform .15s ease; }
.nlc-advanced-toggle.open .ms { transform: rotate(180deg); }
/* Analyze panel: white background to match the Portfolio design. */
#panel-network > .sidebar-content { background: #fff; }

/* ── Store context card (the one active store) ─────────────────────────────── */
#store-context-card {
    flex-shrink: 0;
    margin-bottom: 10px;
    transition: opacity .15s ease;
}
#store-context-card.loading { opacity: 0.6; }

.scc-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.scc-dot-active   { background: #2F7A4D; }
.scc-dot-pipeline { background: #C88319; }
.scc-dot-closed   { background: #B53A2E; }
.scc-kpis {
    display: flex;
    gap: 13px;
    margin-top: 11px;
    padding-top: 11px;
    border-top: 1px solid var(--color-line);
}
/* KPIs now live in the Analyze pane as a balanced stats bar — four equal
   columns spread across the panel, centered, in a quiet card. */
#store-stats-block .scc-kpis {
    margin: 2px 0 14px;
    padding: 11px 8px;
    border-top: none;
    gap: 8px;
    background: #fff;
    border: 1px solid var(--color-line);
    border-radius: 8px;
}
#store-stats-block .scc-kpi { flex: 1; align-items: center; text-align: center; gap: 3px; }
#store-stats-block .scc-kpi-lbl { font-size: var(--fs-meta); }
#store-stats-block .scc-kpi-val { font-size: var(--fs-lg); }

/* ── Market picker (primary Analyze selection) ─────────────────────────────── */
#market-header { flex-shrink: 0; margin-bottom: 8px; }
.mkt-pick {
    display: flex; align-items: center; gap: 8px; width: 100%;
    padding: 9px 12px; background: #fff;
    border: 1px solid var(--color-line); border-radius: 8px;
    cursor: pointer; font-family: var(--f-ui); text-align: left;
    transition: border-color .15s ease, background .15s ease;
}
.mkt-pick:hover { border-color: var(--color-mark); }
.mkt-pick-name { flex: 1; min-width: 0; font-size: var(--fs-lg); font-weight: 600; color: var(--color-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mkt-pick-label { flex: 1; font-size: var(--fs-base); font-weight: 500; color: var(--color-grey-700); }
.mkt-pick-tier { flex-shrink: 0; font-family: var(--f-data); font-size: var(--fs-eyebrow); font-weight: 700; color: var(--color-mark); background: #EFE7F8; padding: 1px 6px; border-radius: 10px; }
.mkt-pick-count { flex-shrink: 0; font-family: var(--f-data); font-size: var(--fs-eyebrow); color: var(--color-grey-500); background: var(--color-grey-100); padding: 1px 6px; border-radius: 10px; }
.mkt-pick-caret { flex-shrink: 0; font-size: 18px; color: var(--color-grey-500); margin-left: 2px; }

/* The market's stores, as a clickable strip below the picker. */
.mkt-stores { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.mkt-store-chip {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 5px 10px; background: #fff;
    border: 1px solid var(--color-line); border-radius: 20px;
    cursor: pointer; font-family: var(--f-ui); font-size: var(--fs-sm); color: var(--color-ink);
    transition: border-color .12s, background .12s, color .12s;
}
.mkt-store-chip:hover { border-color: var(--color-mark); }
.mkt-store-chip.selected { background: var(--color-mark); color: #fff; border-color: var(--color-mark); }
.mkt-store-chip.selected .scc-dot { box-shadow: 0 0 0 1.5px #fff; }
.mkt-store-chip-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 130px; }
/* "Inspect a new location" chip — dashed to read as "add", filled when armed. */
.mkt-chip-inspect { border-style: dashed; color: var(--color-mark); }
.mkt-chip-inspect:hover { background: #fff; }
.mkt-chip-inspect.active { background: var(--color-mark); color: #fff; border-style: solid; border-color: var(--color-mark); }
.mkt-nostore { font-family: var(--f-ui); font-size: var(--fs-sm); color: var(--color-grey-500); padding: 2px 2px 8px; }

/* ── Inspect-a-location probe ──────────────────────────────────────────────── */
#probe-card {
    margin-top: 8px; padding: 10px;
    border: 1px solid var(--color-line); border-radius: 8px;
    background: var(--color-grey-50);
}
.probe-card-hd { display: flex; align-items: flex-start; gap: 7px; }
.probe-card-titles { flex: 1; min-width: 0; }
.probe-card-title { font-family: var(--f-ui); font-size: var(--fs-base); font-weight: 600; color: var(--color-ink); }
.probe-card-coords { font-family: var(--f-data); font-size: var(--fs-meta); color: var(--color-grey-500); margin-top: 1px; }
.probe-card-x { background: none; border: none; cursor: pointer; font-size: 16px; line-height: 1; color: var(--color-grey-500); padding: 0 2px; flex-shrink: 0; }
.probe-card-x:hover { color: var(--color-mark); }
.probe-load-btn {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    width: 100%; margin-top: 10px; padding: 7px 10px;
    border: none; border-radius: 7px; background: var(--color-mark); color: #fff;
    font-family: var(--f-ui); font-size: var(--fs-base); font-weight: 600; cursor: pointer;
    transition: background .12s;
}
.probe-load-btn:hover { background: var(--color-ink); }
.probe-load-btn[disabled] { opacity: 0.7; cursor: default; }
.probe-loaded { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-family: var(--f-ui); font-size: var(--fs-sm); color: var(--color-grey-700); }
.probe-spin { animation: news-spin 1s linear infinite; }
.probe-marker {
    width: 16px; height: 16px; border-radius: 50%;
    background: #fff; border: 4px solid var(--color-mark);
    box-shadow: 0 2px 8px rgba(0,0,0,0.25); cursor: pointer;
}
.scc-kpi { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.scc-kpi-lbl {
    font-family: var(--f-data);
    font-size: var(--fs-eyebrow);
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--color-grey-500);
}
.scc-kpi-val { font-family: var(--f-data); font-size: var(--fs-sm); font-weight: 500; color: var(--color-ink); white-space: nowrap; }
.scc-kpi-of  { color: var(--color-grey-500); font-weight: 400; }

/* ── Store picker overlay (left-anchored drawer over the map) ───────────────── */
/* display toggled inline (none ↔ flex) by open/closeStoreOverlay */
#store-overlay { position: absolute; inset: 0; z-index: 40; }
/* Market picker pop-up: a left-anchored drawer over the whole screen. */
#market-overlay { position: fixed; inset: 0; z-index: 1000; }
.store-overlay-backdrop {
    position: absolute; inset: 0;
    background: rgba(42, 21, 72, 0.18);
    backdrop-filter: blur(1px);
}
.store-overlay-drawer {
    position: relative;
    width: 460px;
    max-width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--color-paper, #fff);
    border-right: 1px solid var(--color-line);
    box-shadow: 0 0 48px rgba(42, 21, 72, 0.2);
    animation: storeDrawerIn 180ms ease;
}
@keyframes storeDrawerIn {
    from { transform: translateX(-12px); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { .store-overlay-drawer { animation: none; } }
.store-overlay-header { padding: 20px 22px 16px; border-bottom: 1px solid var(--color-line); }
.store-overlay-eyebrow {
    font-family: var(--f-data);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--color-grey-500);
}
.store-overlay-titlerow { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.store-overlay-title { font-family: var(--f-ui); font-size: 20px; font-weight: 600; color: var(--color-ink); }
.store-overlay-count { font-family: var(--f-data); font-weight: 500; color: var(--color-grey-500); }
.store-overlay-close {
    width: 34px; height: 34px; flex-shrink: 0;
    border: 1px solid var(--color-line);
    border-radius: 8px;
    background: var(--color-paper, #fff);
    color: var(--color-grey-500);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.store-overlay-close:hover { border-color: var(--color-mark); color: var(--color-mark); }
.store-overlay-search {
    display: flex; align-items: center; gap: 8px;
    height: 38px; margin-top: 14px; padding: 0 10px;
    border: 1px solid var(--color-line-strong, rgba(42,21,72,0.18));
    border-radius: 7px;
}
.store-overlay-search .ms { font-size: 17px; color: var(--color-grey-500); }
.store-overlay-search input {
    flex: 1; border: none; outline: none; background: transparent;
    font-family: var(--f-ui); font-size: 13px; color: var(--color-ink);
}
.store-overlay-list { flex: 1; overflow-y: auto; padding: 10px 14px 14px; }
.store-row {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 8px 12px; border: none; border-radius: 7px;
    background: transparent; cursor: pointer; text-align: left;
    font-family: var(--f-ui);
}
.store-row:hover { background: var(--color-grey-50); }
.store-row-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.store-row-dot-active   { background: #2F7A4D; }
.store-row-dot-pipeline { background: #C88319; }
.store-row-dot-closed   { background: #B53A2E; }
.store-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.store-row-name { font-size: 13.5px; font-weight: 500; color: var(--color-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.store-row-sub  { font-family: var(--f-data); font-size: 10px; color: var(--color-grey-500); }
.store-row-metric { font-family: var(--f-data); font-size: 11.5px; color: var(--color-grey-500); flex-shrink: 0; }
.store-row.selected { background: var(--color-mark); }
.store-row.selected .store-row-name,
.store-row.selected .store-row-metric { color: var(--color-paper, #fff); }
.store-row.selected .store-row-sub { color: rgba(255,255,255,0.65); }
.store-row-empty { font-family: var(--f-ui); font-size: 13px; color: var(--color-grey-500); padding: 16px 12px; }
/* Store list scroll area above the pinned controls. */
.network-scroll-region {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* Tight, name-only Analyze store rows (Portfolio-style). Overrides the older
   heavier .network-store-row layout. */
.network-store-row {
    display: block;
    width: 100%;
    padding: 7px 8px;
    border: none;
    border-bottom: 1px solid var(--color-line);
    border-radius: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
    font-family: var(--f-ui);
}
.network-store-row:hover  { background: rgba(74, 43, 124, 0.04); }
.network-store-row.active { background: rgba(74, 43, 124, 0.08); }
.network-store-row.loading { opacity: 0.55; }
.network-store-row .network-store-name {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--color-ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mcp-section-label {
    font-family: var(--f-ui);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-grey-500);
    padding: 7px 4px 2px;
    flex-shrink: 0;
    border-top: 1px solid var(--color-grey-100);
    margin-top: 3px;
}
.mcp-section-label:first-child {
    border-top: none;
    margin-top: 0;
    padding-top: 2px;
}
/* Tab header row */
.mcp-tabs {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid var(--color-line);
    flex-shrink: 0;
    background: #fff;
}
.mcp-tab {
    flex: 1;
    padding: 0 6px;
    height: 34px;
    border: none;
    background: transparent;
    font-family: var(--f-data);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-grey-500);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color 120ms ease, border-color 120ms ease;
    white-space: nowrap;
}
.mcp-tab:hover { color: var(--color-mark); }
.mcp-tab.active {
    color: var(--color-ink);
    font-weight: 600;
    border-bottom-color: var(--color-mark);
}

/* Tab panes */
.mcp-pane {
    display: none;
    flex-direction: column;
    flex: 1;
    overflow-y: auto;
    padding: 6px 8px;
    gap: 3px;
    min-height: 0;
}
.mcp-pane.active { display: flex; }

/* Store tab empty state */
.mcp-store-empty {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--f-ui);
    font-size: 13px;
    color: var(--color-grey-500);
    text-align: center;
    padding: 32px 24px;
    line-height: 1.5;
}

/* ── Map right panel inner layout ───────────────────────────────────────────── */

/* Collapsible cards inside the panel: remove card chrome, use plain sections */
.mcp-pane .float-collapsible {
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    border: none;
    border-bottom: 1px solid var(--color-grey-100);
}
.mcp-pane .float-collapsible:last-child { border-bottom: none; }
.mcp-pane .float-collapsible-header {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--color-grey-500);
    padding: 6px 0 4px;
    border-bottom: none;
}
.mcp-pane .float-collapsible-header:hover { color: var(--color-ink); }
.mcp-pane .float-section {
    padding: 0 0 4px;
    border-bottom: none;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}
/* Pill-style mode buttons (wrap to fit) */
.mcp-pane .float-section .float-btn {
    width: auto;
    flex: none;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 500;
    border: 1.5px solid var(--color-grey-300);
    background: transparent;
    color: var(--color-ink);
    text-align: left;
    justify-content: flex-start;
}
.mcp-pane .float-section .float-btn:hover {
    border-color: var(--color-mark);
    color: var(--color-mark);
    background: transparent;
}
.mcp-pane .float-section .float-btn.active {
    border-color: var(--color-grey-700);
    background: var(--color-grey-700);
    color: var(--color-paper);
}
/* Resolution buttons stay equal-width in a row */
.mcp-pane .float-section .btn-res {
    flex: 1;
    border-radius: var(--r);
    text-align: center;
    padding: 5px 4px;
    min-width: 0;
}
/* Category checkbox rows */
.mcp-pane .float-section .category-btn {
    width: 100%;
    border-radius: 4px;
    border-color: transparent;
    background: transparent;
    padding: 3px 2px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 400;
    color: var(--color-ink);
}
.mcp-pane .float-section .category-btn:hover { background: var(--color-grey-50); border-color: transparent; }
.mcp-pane .float-section .category-btn.active { background: transparent; border-color: transparent; color: var(--color-ink); }
/* Resolution row: label left, buttons right on same line */
.mcp-res-section {
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
}
.mcp-res-label {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-grey-500);
    white-space: nowrap;
    flex-shrink: 0;
    margin-right: 6px;
}
.mcp-res-btns {
    display: flex;
    gap: 3px;
    flex: 1;
}
.mcp-res-btns .float-btn {
    flex: 1;
    border-radius: var(--r) !important;
    text-align: center;
    padding: 4px 0 !important;
    min-width: 0;
}
/* POI visibility toggles row */
.mcp-visibility-row { flex-wrap: nowrap; }
/* Category list: full-width rows, no pill styling */
.mcp-categories {
    flex-direction: column;
    gap: 1px !important;
}
.mcp-categories .float-section-label {
    font-size: 9px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.08em; color: var(--color-grey-500);
    margin-bottom: 3px;
    width: 100%;
}
/* Checkbox square */
.cat-check {
    width: 15px;
    height: 15px;
    border-radius: 3px;
    border: 1.5px solid var(--c, #ccc);
    background: transparent;
    flex-shrink: 0;
    position: relative;
    display: inline-block;
    transition: background 0.1s, border-color 0.1s;
}
.category-btn.active .cat-check {
    background: var(--c, #ccc);
    border-color: var(--c, #ccc);
}
.category-btn.active .cat-check::after {
    content: '';
    position: absolute;
    left: 3px; top: 1px;
    width: 5px; height: 8px;
    border-right: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(45deg);
}

/* ── Team workspace ───────────────────────────────────────────────────────── */

.team-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px 8px;
    flex-shrink: 0;
    border-bottom: 1px solid var(--color-line);
}
.team-topbar-label {
    font-family: var(--f-data);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.12em;
    color: var(--color-mark);
}
.team-invite-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-family: var(--f-ui);
    font-size: 11px;
    font-weight: 500;
    color: var(--color-mark);
    background: transparent;
    border: 1.5px solid var(--color-mark);
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.12s;
}
.team-invite-btn:hover { background: rgba(74,43,124,0.06); }

.team-tab-row {
    display: flex;
    border-bottom: 1px solid var(--color-line);
    flex-shrink: 0;
}
.team-tab {
    flex: 1;
    padding: 8px 0;
    font-family: var(--f-ui);
    font-size: 12px;
    font-weight: 500;
    color: var(--color-grey-500);
    background: transparent;
    border: none;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.12s, border-color 0.12s;
}
.team-tab.active {
    color: var(--color-mark);
    border-bottom-color: var(--color-mark);
}

.team-filter-row {
    display: flex;
    gap: 4px;
    padding: 8px 12px;
    flex-shrink: 0;
    border-bottom: 1px solid var(--color-line);
    flex-wrap: wrap;
}
.team-pill {
    padding: 3px 10px;
    font-family: var(--f-ui);
    font-size: 11px;
    background: transparent;
    border: 1.5px solid var(--color-grey-100);
    border-radius: 20px;
    cursor: pointer;
    color: var(--color-grey-700);
    transition: background 0.1s, border-color 0.1s;
}
.team-pill.active {
    background: var(--color-grey-700);
    border-color: var(--color-grey-700);
    color: var(--color-paper);
}

.team-compose {
    padding: 10px 12px;
    border-bottom: 1px solid var(--color-line);
    flex-shrink: 0;
}
.team-compose-select {
    padding: 5px 7px;
    font-family: var(--f-ui);
    font-size: 11px;
    border: 1.5px solid var(--color-grey-100);
    border-radius: 5px;
    background: #fff;
    color: var(--color-ink);
    cursor: pointer;
}
.team-compose-textarea {
    width: 100%;
    padding: 7px 9px;
    font-family: var(--f-ui);
    font-size: 12px;
    line-height: 1.5;
    border: 1.5px solid var(--color-grey-100);
    border-radius: 5px;
    resize: vertical;
    box-sizing: border-box;
    color: var(--color-ink);
    transition: border-color 0.12s;
}
.team-compose-textarea:focus {
    outline: none;
    border-color: var(--color-mark);
}
.team-compose-date {
    padding: 5px 7px;
    font-family: var(--f-ui);
    font-size: 11px;
    border: 1.5px solid var(--color-grey-100);
    border-radius: 5px;
    background: #fff;
    color: var(--color-ink);
}

/* Feed items */
.team-feed-loading,
.team-feed-empty {
    font-family: var(--f-ui);
    font-size: 12px;
    color: var(--color-grey-500);
    padding: 16px 0;
    text-align: center;
}
.team-item {
    display: flex;
    gap: 9px;
    padding: 10px 0;
    border-bottom: 1px solid var(--color-line);
}
.team-item:last-child { border-bottom: none; }
.team-item.team-item-resolved { opacity: 0.5; }

.team-item-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--color-grey-100);
    color: var(--color-grey-700);
    font-family: var(--f-data);
    font-size: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}
.team-item-body { flex: 1; min-width: 0; }
.team-item-header {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 3px;
    flex-wrap: wrap;
}
.team-item-author {
    font-family: var(--f-ui);
    font-size: 11px;
    font-weight: 600;
    color: var(--color-ink);
}
.team-item-ago {
    font-family: var(--f-data);
    font-size: 10px;
    color: var(--color-grey-500);
    margin-left: auto;
    white-space: nowrap;
}
.team-kind-tag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 1px 6px;
    border-radius: 3px;
    font-family: var(--f-data);
    font-size: 10px;
    font-weight: 500;
}
.kind-opinion { background: #EEE8F9; color: var(--color-mark); }
.kind-action  { background: #FFF3E0; color: #C88319; }
.kind-summary { background: #E8F5E9; color: #2F7A4D; }

.team-item-store {
    font-family: var(--f-data);
    font-size: 10px;
    color: var(--color-grey-500);
    margin-bottom: 3px;
}
.team-item-store-link { color: var(--color-mark); cursor: pointer; }
.team-item-text {
    font-family: var(--f-ui);
    font-size: 12px;
    color: var(--color-grey-700);
    line-height: 1.5;
    word-break: break-word;
}
.team-item-action-meta {
    font-family: var(--f-data);
    font-size: 10px;
    color: var(--color-grey-500);
    margin-top: 4px;
}
.team-item-action-meta.overdue { color: #B53A2E; }
.team-item-resolve-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    margin-right: 4px;
}

/* My Actions */
.my-action-card {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px;
    background: var(--color-grey-50);
    border-radius: 6px;
    border-left: 3px solid var(--color-grey-300);
    margin-bottom: 6px;
}
.my-action-card.overdue { border-left-color: #B53A2E; background: #FFF5F5; }
.my-action-body {
    font-family: var(--f-ui);
    font-size: 12px;
    color: var(--color-ink);
    line-height: 1.45;
}
.my-action-meta {
    font-family: var(--f-data);
    font-size: 10px;
    color: var(--color-grey-500);
    margin-top: 2px;
}
.my-action-due {
    font-family: var(--f-data);
    font-size: 10px;
    color: var(--color-grey-500);
    margin-top: 2px;
}
.my-action-due.overdue { color: #B53A2E; font-weight: 600; }

/* ── Content-mode layout (Plans / Team full-screen views) ─────────────────── */

/* Content-mode: hide the map side panel */
#app-main.content-mode #app-side-panel {
    display: none !important;
}

/* Content view pane — fixed to viewport right of nav, never clipped by flex */
#view-content {
    position: fixed !important;
    top: 0;
    bottom: 0;
    right: 0;
    left: var(--nav-w, 208px);
    flex-direction: column;
    overflow: hidden;
    z-index: 5;
}
#app-shell:has(#app-left.sidebar-collapsed) #view-content {
    left: 72px;
}

/* ── Shared content-view header ────────────────────────────────────────────── */
.cv-header {
    border-bottom: 1px solid var(--color-line);
    background: var(--color-cream);
    flex-shrink: 0;
}
.cv-eyebrow {
    font-family: var(--f-data);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.12em;
    color: var(--color-mark);
    text-transform: uppercase;
    margin-bottom: 4px;
}
.cv-title {
    font-family: var(--f-ui);
    font-size: 22px;
    font-weight: 600;
    color: var(--color-ink);
    margin: 0 0 4px 0;
    letter-spacing: -0.02em;
    line-height: 1.2;
}
.cv-subtitle {
    font-family: var(--f-ui);
    font-size: 12px;
    color: var(--color-grey-500);
    margin: 0;
    line-height: 1.5;
}
.cv-cta {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
    margin-top: 4px;
}
.cv-select {
    padding: 5px 8px;
    font-size: 12px;
    font-family: var(--f-ui);
    border: 1px solid var(--color-grey-300);
    border-radius: var(--r);
    background: var(--color-paper);
    color: var(--color-ink);
    cursor: pointer;
}
.cv-body {
    flex: 1;
    overflow-y: auto;
    padding: 28px 40px;
}
.cv-info-block {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-top: 20px;
    padding: 16px;
    background: var(--color-grey-50);
    border: 1px solid var(--color-line);
    border-radius: 8px;
    font-family: var(--f-ui);
    font-size: 12px;
    color: var(--color-grey-700);
    line-height: 1.55;
}
.cv-info-block strong { color: var(--color-ink); }

/* ── Plans table ───────────────────────────────────────────────────────────── */
.plans-tbl {
    background: #fff;
    border-radius: 10px;
    border: 1px solid var(--color-line);
    overflow: hidden;
}
.plans-tbl-head,
.plans-tbl-row {
    display: grid;
    grid-template-columns: 1fr 110px 110px 1fr 100px 44px;
    align-items: center;
    padding: 0 16px;
    gap: 12px;
}
.plans-tbl-head {
    padding-top: 10px;
    padding-bottom: 10px;
    background: var(--color-grey-50);
    border-bottom: 1px solid var(--color-line);
}
.plans-tbl-head > div {
    font-family: var(--f-data);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--color-grey-500);
    text-transform: uppercase;
}
.plans-tbl-row {
    padding-top: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--color-line);
    cursor: pointer;
    transition: background 0.1s;
}
.plans-tbl-row:last-child { border-bottom: none; }
.plans-tbl-row:hover { background: var(--color-grey-50); }

.plans-tbl-empty {
    padding: 48px 24px;
    text-align: center;
}
.plans-tbl-loading,
.plans-tbl-error {
    padding: 24px;
    text-align: center;
    font-family: var(--f-ui);
    font-size: 12px;
    color: var(--color-grey-500);
}
.plans-tbl-error { color: #B53A2E; }

.pt-name-text {
    font-family: var(--f-ui);
    font-size: 13px;
    font-weight: 500;
    color: var(--color-ink);
}
.pt-editing-tag {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 6px;
    font-family: var(--f-data);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.08em;
    background: rgba(74,43,124,0.08);
    color: var(--color-mark);
    border-radius: 3px;
    vertical-align: middle;
}
.ptc-composition {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 3px;
}
.pt-comp-item { white-space: nowrap; }
.pt-comp-num {
    font-family: var(--f-data);
    font-size: 13px;
    font-weight: 600;
    color: var(--color-ink);
}
.pt-comp-label {
    font-family: var(--f-ui);
    font-size: 11px;
    color: var(--color-grey-500);
}
.pt-comp-sep {
    margin: 0 2px;
    color: var(--color-grey-300);
    font-size: 11px;
}
.ptc-updated {
    font-family: var(--f-data);
    font-size: 11px;
    color: var(--color-grey-500);
}
.pt-menu-btn {
    background: none;
    border: none;
    padding: 4px 6px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    color: var(--color-grey-500);
    border-radius: 4px;
    line-height: 1;
    letter-spacing: 1px;
}
.pt-menu-btn:hover { background: var(--color-grey-100); color: var(--color-ink); }
.ctx-item {
    padding: 10px 14px;
    cursor: pointer;
    font-family: var(--f-ui);
    font-size: 12px;
    color: var(--color-ink);
}
.ctx-item:hover { background: var(--color-grey-50); }
.ctx-item.ctx-danger { color: #B53A2E; }

/* ── Team content-view layout ──────────────────────────────────────────────── */
.team-cv-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}
.team-cv-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 24px 32px 0;
    border-right: 1px solid var(--color-line);
    background: #fff;
}
.team-cv-rail {
    width: 300px;
    flex-shrink: 0;
    padding: 24px 20px;
    overflow-y: auto;
    background: var(--color-cream);
}
.team-rail-hd {
    font-family: var(--f-data);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.12em;
    color: var(--color-grey-500);
    text-transform: uppercase;
    margin-bottom: 12px;
}
.team-cv-compose {
    padding: 14px 0;
    border-bottom: 1px solid var(--color-line);
    flex-shrink: 0;
}
.team-cv-feed {
    flex: 1;
    overflow-y: auto;
    padding-top: 4px;
}
.team-manage-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    font-family: var(--f-ui);
    font-size: 12px;
    font-weight: 500;
    color: var(--color-grey-700);
    background: transparent;
    border: 1.5px solid var(--color-grey-100);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.1s;
}
.team-manage-btn:hover { background: var(--color-grey-50); }

/* Team presence */
.presence-member {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--color-line);
}
.presence-member:last-child { border-bottom: none; }

/* ─────────────────────────────────────────────────────────────
   STORES PROFILE VIEW
───────────────────────────────────────────────────────────── */

.stores-cv-body {
    display: flex;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

/* ── Left list ── */
.stores-cv-list {
    width: 220px;
    flex-shrink: 0;
    overflow-y: auto;
    border-right: 1px solid var(--color-line);
    background: var(--color-paper);
    padding: 8px 0;
}

.stores-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 14px;
    cursor: pointer;
    border-left: 3px solid transparent;
    gap: 8px;
}

.stores-list-item:hover { background: var(--color-grey-50); }
.stores-list-item.active {
    background: var(--color-grey-50);
    border-left-color: var(--color-mark);
}

.stores-list-item-main {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.stores-list-city {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stores-list-name {
    font-size: 10px;
    color: var(--color-grey-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stores-list-status {
    font-size: 9px;
    font-family: var(--f-data);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 2px 5px;
    border-radius: 3px;
    white-space: nowrap;
    flex-shrink: 0;
}

.stores-status-active  { background: rgba(47,122,77,0.10); color: var(--color-success); }
.stores-status-closed  { background: rgba(181,58,46,0.10);  color: var(--color-danger); }
.stores-status-other   { background: var(--color-grey-50); color: var(--color-grey-500); }

.stores-list-empty {
    padding: 24px 14px;
    font-size: 11px;
    color: var(--color-grey-500);
}

/* ── Right detail ── */
.stores-cv-detail {
    flex: 1;
    overflow-y: auto;
    background: var(--color-grey-50);
}

.stores-detail-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 12px;
    font-size: 12px;
    color: var(--color-grey-500);
}

.stores-detail-inner {
    max-width: 860px;
    margin: 0 auto;
    padding: 28px 32px 48px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* ── Detail header ── */
.stores-detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.stores-detail-eyebrow {
    font-family: var(--f-data);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-grey-500);
    margin-bottom: 4px;
}

.stores-detail-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--color-ink);
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.stores-detail-address {
    font-size: 12px;
    color: var(--color-grey-500);
    margin-top: 5px;
}

.stores-detail-status-badge {
    font-size: 11px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(47,122,77,0.10);
    color: var(--color-success);
    white-space: nowrap;
    margin-top: 4px;
    display: inline-block;
}

/* ── Photos & rating ── */
.stores-places-section {
    margin-bottom: 24px;
}

.stores-photos-loading,
.stores-no-google {
    font-size: 11px;
    color: var(--color-grey-500);
    padding: 8px 0;
}

.stores-photos-strip {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    height: 180px;
    border-radius: var(--r);
    overflow: hidden;
}

.stores-photo {
    flex: 1;
    overflow: hidden;
    border-radius: 4px;
    background: var(--color-grey-100);
    min-width: 0;
}

.stores-photo-main {
    flex: 2.4;
}

.stores-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.2s;
}

.stores-rating-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stores-stars {
    font-size: 16px;
    color: #F5A623;
    letter-spacing: 1px;
    line-height: 1;
}

.stores-rating-num {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-ink);
    font-family: var(--f-data);
}

.stores-rating-count {
    font-size: 12px;
    color: var(--color-grey-500);
}

/* ── Notes section ── */
.stores-notes-section {
    margin-top: 14px;
    border-top: 1px solid var(--color-line);
    padding-top: 14px;
}

.stores-notes-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.stores-notes-label {
    font-family: var(--f-data);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(42,21,72,0.55);
}

/* ── Catchment section ── */
.stores-catchment-section {
    margin-bottom: 10px;
}

.stores-catchment-loading {
    font-size: 11px;
    color: var(--color-grey-500);
    padding: 4px 0;
}

/* Flat rows — no card chrome */
.stores-catchment-flat {
    display: flex;
    flex-direction: column;
    gap: 0;
    border-top: 1px solid var(--color-line);
    padding-top: 14px;
}

.stores-catchment-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 0;
}

.stores-catchment-row-label {
    font-family: var(--f-data);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    color: rgba(42,21,72,0.45);
    flex-shrink: 0;
    width: 70px;
}

.stores-catchment-row-values {
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex: 1;
    flex-wrap: wrap;
}

.stores-catchment-row-val {
    font-family: var(--f-data);
    font-size: 19px;
    font-weight: 700;
    color: var(--color-ink);
    white-space: nowrap;
}

.stores-catchment-row-val-dim {
    font-size: 15px;
    font-weight: 500;
    color: var(--color-grey-700);
}

.stores-catchment-row-val-sec {
    font-size: 13px;
    font-weight: 400;
    color: var(--color-grey-500);
}

.stores-catchment-row-sub {
    font-size: 10px;
    font-weight: 400;
    color: var(--color-grey-500);
    font-family: var(--f-ui);
}

/* Rank badge */
.stores-rank-badge {
    font-family: var(--f-data);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 10px;
    flex-shrink: 0;
    white-space: nowrap;
}
.stores-rank-badge .stores-rank-of {
    font-weight: 400;
    opacity: 0.7;
}
.rank-top { background: rgba(74,43,124,0.10); color: var(--color-mark); }
.rank-mid { background: var(--color-grey-50);  color: var(--color-grey-700); }
.rank-low { background: var(--color-grey-50);  color: var(--color-grey-500); }

/* Micro POI inline row */
.stores-catchment-row-micro {
    align-items: flex-start;
    padding-top: 9px;
}

.stores-poi-inline {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 10px;
    flex: 1;
}

.stores-poi-luxury-inline {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 15px;
    font-weight: 700;
    color: var(--color-mark);
    white-space: nowrap;
}

.stores-poi-luxury-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-mark);
    flex-shrink: 0;
}

.stores-poi-row {
    display: flex;
    align-items: center;
    gap: 5px;
}

.stores-poi-label {
    font-size: 11px;
    color: var(--color-grey-500);
    white-space: nowrap;
}

.stores-poi-bar-wrap {
    width: 44px;
    height: 4px;
    background: var(--color-grey-100);
    border-radius: 2px;
    overflow: hidden;
    flex-shrink: 0;
}

.stores-poi-bar {
    height: 100%;
    border-radius: 2px;
}

.stores-poi-count {
    font-family: var(--f-data);
    font-size: 13px;
    font-weight: 600;
    color: var(--color-grey-700);
    width: 22px;
    text-align: right;
    flex-shrink: 0;
}

/* ─────────────────────────────────────────────────────────────
   SETTINGS CONTENT VIEW
───────────────────────────────────────────────────────────── */

.settings-cv-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 20px;
    max-width: 960px;
}

.settings-cv-left {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.settings-card {
    background: var(--color-paper);
    border: 1px solid var(--color-line);
    border-radius: var(--r-lg);
    padding: 18px 20px;
}

.settings-card-title {
    font-family: var(--f-data);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-grey-500);
    margin-bottom: 10px;
}

.settings-card-desc {
    font-size: 11px;
    color: var(--color-grey-500);
    line-height: 1.55;
    margin-bottom: 12px;
}

.settings-field-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.settings-field {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.settings-field label {
    font-size: 10px;
    color: var(--color-grey-500);
}

.settings-field input {
    padding: 5px 7px;
    font-size: 12px;
    font-family: var(--f-ui);
    border: 1px solid var(--color-grey-300);
    border-radius: var(--r);
    background: var(--color-paper);
    color: var(--color-ink);
    width: 100%;
    box-sizing: border-box;
}

.settings-tier-city-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    border-radius: 5px;
    background: var(--color-grey-50);
    border-left: 3px solid var(--color-grey-300);
}

/* ─────────────────────────────────────────────────────────────
   PROFILE CONTENT VIEW
───────────────────────────────────────────────────────────── */

.profile-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--color-paper);
    border: 1px solid var(--color-line);
    border-radius: var(--r-lg);
    padding: 20px 24px;
    max-width: 480px;
    margin-bottom: 20px;
}

.profile-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--color-mark);
    color: var(--color-paper);
    font-family: var(--f-ui);
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--color-ink);
    margin-bottom: 3px;
}

.profile-email {
    font-size: 12px;
    color: var(--color-grey-500);
}

.profile-section-title {
    font-family: var(--f-data);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-grey-500);
    margin-bottom: 10px;
}

/* ─────────────────────────────────────────────────────────────
   HOME CONTENT VIEW
───────────────────────────────────────────────────────────── */

.home-snap-link {
    color: var(--color-grey-700);
    cursor: pointer;
    text-decoration: none;
}
.home-snap-link:hover {
    color: var(--color-mark);
    text-decoration: underline;
}

/* ── Home layout: operating-model map + What's-moving rail (brief 14) ── */
.home-layout {
    display: flex;
    gap: 40px;
    align-items: stretch;
    max-width: 1320px;
}
.home-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
/* Tagline lives in the top collapsible header (between greeting and snapshot). */
.home-hero-lede { font-family: var(--f-ui); font-size: 14px; font-weight: 500; color: var(--color-grey-700); margin: 0 0 6px; line-height: 1.45; max-width: none; }
.home-map {
    position: relative;
    flex: 1;
    min-width: 0;
    min-height: 632px;
}
/* SENSE stage container — groups the four sense nodes so the flow needs only
   trunk lines, not per-node fans. Sits behind the edges and nodes. */
.home-sense-group {
    position: absolute; left: 25%; top: 5%; width: 22%; height: 85%;
    border: 1px solid var(--color-line); border-radius: 16px;
    background: rgba(74, 43, 124, 0.025);
    z-index: 0; pointer-events: none;
}
.home-rail {
    width: 300px;
    flex-shrink: 0;
    border-left: 1px solid var(--color-line);
    padding-left: 28px;
}
@media (max-width: 980px) {
    .home-layout { flex-direction: column; }
    .home-rail { width: auto; border-left: none; border-top: 1px solid var(--color-line); padding-left: 0; padding-top: 20px; }
}

/* SVG edge layer shares the map box; stretched to it (curves may skew slightly). */
.home-edges { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 1; }
.home-edge { fill: none; stroke: rgba(42, 21, 72, 0.26); stroke-width: 1.6; }
.home-edge-feedback { stroke: rgba(42, 21, 72, 0.16); stroke-width: 1.4; stroke-dasharray: 5 5; }

.home-group-label {
    position: absolute; transform: translateX(-50%);
    font-family: var(--f-data); font-size: 11px; font-weight: 700;
    letter-spacing: 0.12em; text-transform: uppercase; color: var(--color-grey-500);
    white-space: nowrap; z-index: 2; pointer-events: none;
}
.home-map-caption {
    position: absolute; transform: translateX(-50%);
    font-family: var(--f-ui); font-size: 13px; font-style: italic;
    color: var(--color-grey-500); white-space: nowrap; z-index: 2; pointer-events: none;
}

.home-node {
    position: absolute; transform: translate(-50%, -50%);
    width: 188px; height: 116px; box-sizing: border-box;
    padding: 14px 16px; z-index: 3;
    display: flex; flex-direction: column; justify-content: center;
    background: var(--color-paper); border: 1px solid var(--color-line);
    border-radius: var(--r-lg); cursor: pointer;
    box-shadow: 0 1px 4px rgba(42, 21, 72, 0.07);
    transition: border-color 0.12s, box-shadow 0.12s, transform 0.12s;
}
.home-node:hover { border-color: var(--color-mark); box-shadow: 0 6px 18px rgba(42, 21, 72, 0.13); transform: translate(-50%, -50%) translateY(-2px); }
.home-node-emphasis { border-color: var(--color-mark); box-shadow: 0 2px 10px rgba(74, 43, 124, 0.16); }
.home-node-future { height: 93px; background: var(--color-grey-50); border: 1.5px dashed var(--color-grey-300); box-shadow: none; }
.home-node-future:hover { border-color: var(--color-grey-500); box-shadow: 0 4px 14px rgba(42, 21, 72, 0.10); }
.home-node-future .home-node-title { color: var(--color-grey-500); }
.home-seanos-mark { flex-shrink: 0; display: block; }
.home-node-head { display: flex; align-items: center; gap: 8px; }
.home-node-icon { font-size: 20px; color: var(--color-mark); flex-shrink: 0; }
.home-node-title { font-family: var(--f-ui); font-size: 16px; font-weight: 600; color: var(--color-ink); }
.home-node-q { font-size: 13px; line-height: 1.4; color: var(--color-grey-500); margin-top: 6px; }

/* ── Function card (node → what-it-does explainer) ── */
.home-fcard-overlay {
    position: fixed; inset: 0; z-index: 4000;
    background: rgba(20, 10, 40, 0.34);
    display: flex; align-items: center; justify-content: center;
    padding: 24px; opacity: 0; transition: opacity 0.14s ease;
}
.home-fcard-overlay.show { opacity: 1; }
.home-fcard {
    position: relative; width: 470px; max-width: 100%;
    max-height: calc(100vh - 64px); overflow-y: auto;
    background: var(--color-paper);
    border-radius: 16px; box-shadow: 0 24px 64px rgba(20, 10, 40, 0.32);
    padding: 30px 32px 28px;
    transform: translateY(10px) scale(0.99); transition: transform 0.16s ease;
}
.home-fcard-overlay.show .home-fcard { transform: translateY(0) scale(1); }
.home-fcard-close {
    position: absolute; top: 16px; right: 16px;
    width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
    border: none; border-radius: 50%; background: var(--color-grey-50);
    color: var(--color-grey-500); cursor: pointer;
}
.home-fcard-close:hover { background: var(--color-grey-100); color: var(--color-ink); }
.home-fcard-close .ms { font-size: 18px; }
.home-fcard-eyebrow {
    font-family: var(--f-data); font-size: 10px; font-weight: 700;
    letter-spacing: 0.12em; text-transform: uppercase; color: var(--color-grey-500);
}
.home-fcard-brand { display: flex; align-items: center; gap: 7px; font-family: var(--f-ui); font-size: 15px; font-weight: 600; color: var(--color-grey-700); }
.home-fcard-head { display: flex; align-items: center; gap: 11px; margin-top: 7px; }
.home-fcard-icon { font-size: 27px; color: var(--color-mark); }
.home-fcard-title { font-family: var(--f-ui); font-size: 23px; font-weight: 600; color: var(--color-ink); }
.home-fcard-q { font-size: 14px; font-style: italic; color: var(--color-grey-700); line-height: 1.45; margin-top: 9px; }
.home-fcard-sec-title {
    font-family: var(--f-data); font-size: 10px; font-weight: 700;
    letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-mark);
    margin-top: 22px; margin-bottom: 9px;
}
.home-fcard-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 7px; }
.home-fcard-list li { font-size: 13.5px; line-height: 1.5; color: var(--color-grey-700); }
.home-fcard-benefit { font-size: 13.5px; line-height: 1.55; color: var(--color-ink); }
.home-fcard-open {
    margin-top: 26px; width: 100%;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 13px; border: none; border-radius: 10px;
    background: var(--color-mark); color: #fff;
    font-family: var(--f-ui); font-size: 14px; font-weight: 600; cursor: pointer;
    transition: filter 0.12s ease;
}
.home-fcard-open:hover { filter: brightness(1.12); }
.home-fcard-open .ms { font-size: 18px; }
.home-fcard-note {
    display: flex; align-items: flex-start; gap: 8px;
    margin-top: 24px; padding: 13px 14px;
    border: 1.5px dashed var(--color-grey-300); border-radius: 10px;
    background: var(--color-grey-50);
    font-size: 13px; line-height: 1.5; color: var(--color-grey-700);
}
.home-fcard-note .ms { font-size: 17px; color: var(--color-grey-500); flex-shrink: 0; margin-top: 1px; }

.home-section-title {
    font-family: var(--f-data);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-grey-500);
    margin-bottom: 12px;
}

/* ── What's moving ── */
.home-feed-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--r);
    cursor: pointer;
}
.home-feed-item:hover { background: rgba(74, 43, 124, 0.05); }
.home-feed-item + .home-feed-item { border-top: 1px solid var(--color-line); }

.home-feed-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--color-mark);
    color: var(--color-paper);
    font-size: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.home-feed-text {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    color: var(--color-grey-700);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.home-feed-subject { font-weight: 600; color: var(--color-ink); }
.home-feed-verb { color: var(--color-grey-500); }
.home-feed-ago {
    font-size: 11px;
    color: var(--color-grey-500);
    flex-shrink: 0;
    font-family: var(--f-data);
}
.home-feed-empty, .home-feed-loading {
    font-size: 13px;
    color: var(--color-grey-500);
    padding: 16px 4px;
    line-height: 1.5;
}

/* ── Getting started ── */
.home-onboarding-box {
    max-width: 1100px;
    background: rgba(74, 43, 124, 0.04);
    border: 1px solid var(--color-line);
    border-radius: var(--r-lg);
    padding: 14px 18px;
    margin-bottom: 24px;
}
.home-onboarding-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.home-onboarding-title {
    font-family: var(--f-data);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-mark);
}
.home-onboarding-dismiss {
    font-size: 11px;
    color: var(--color-grey-500);
    cursor: pointer;
}
.home-onboarding-dismiss:hover { color: var(--color-grey-700); text-decoration: underline; }
.home-onboarding-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;
}
.home-onboarding-step {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    color: var(--color-grey-700);
}
.home-onboarding-step .ms { font-size: 16px; color: var(--color-grey-300); }
.home-onboarding-step.done { color: var(--color-grey-500); text-decoration: line-through; }
.home-onboarding-step.done .ms { color: var(--color-success); }

/* ─────────────────────────────────────────────────────────────
   STRATEGY CONTENT VIEW (scenarios + cornerstones)
───────────────────────────────────────────────────────────── */

.strategy-grid {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    gap: 36px;
    max-width: 1280px;
}
@media (max-width: 1100px) {
    .strategy-grid { grid-template-columns: 1fr; }
}

.strategy-section-title {
    font-family: var(--f-data);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-grey-500);
}

/* ── Scenario cards ── */
.scenario-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.scenario-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px 18px;
    background: var(--color-paper);
    border: 1px solid var(--color-line);
    border-radius: var(--r-lg);
    cursor: pointer;
    transition: border-color 0.12s, box-shadow 0.12s;
}
.scenario-card:hover {
    border-color: var(--color-accent);
    box-shadow: var(--shadow-panel);
}

.scenario-card-baseline {
    border-style: dashed;
    border-color: var(--color-grey-300);
    background: transparent;
    opacity: 0.75;
    cursor: default;
}
.scenario-card-baseline:hover { border-color: var(--color-grey-300); box-shadow: none; }
.scenario-card-baseline .scenario-card-name { font-weight: 500; color: var(--color-grey-700); }

.scenario-card-archived { opacity: 0.6; }

.scenario-card-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-ink);
    letter-spacing: -0.01em;
    line-height: 1.3;
}

.scenario-card-thesis {
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--color-grey-700);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.scenario-card-thesis-empty { font-style: italic; color: var(--color-grey-500); }

.scenario-card-delta {
    display: flex;
    gap: 12px;
    font-family: var(--f-data);
    font-size: 11px;
    font-weight: 500;
}
.sc-delta-net {
    margin-left: auto;
    font-weight: 700;
    color: var(--color-ink);
}

.scenario-card-meta {
    font-size: 11px;
    color: var(--color-grey-500);
    font-family: var(--f-data);
    letter-spacing: 0.04em;
}

.scenario-archived-divider {
    grid-column: 1 / -1;
    font-family: var(--f-data);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-grey-500);
    margin-top: 8px;
}

/* ── Cornerstones rail — paper-like, sticky-note evoking ── */
.cornerstone-composer {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}
.cornerstone-composer textarea {
    width: 100%;
    padding: 10px 12px;
    font-size: 13px;
    font-family: var(--f-ui);
    border: 1px solid var(--color-grey-300);
    border-radius: var(--r);
    box-sizing: border-box;
    resize: vertical;
    background: #FFFDF7;
}

#cornerstone-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cornerstone-card {
    padding: 14px 16px;
    background: #FFFDF7;
    border: 1px solid #EBE4D3;
    border-radius: var(--r);
}
.cornerstone-important {
    background: #FDF6E7;
    border-color: #EDDCB4;
}
.cornerstone-retired {
    background: var(--color-grey-50);
    border-color: var(--color-line);
    opacity: 0.65;
}
.cornerstone-retired .cornerstone-body { text-decoration: line-through; color: var(--color-grey-500); }

.cornerstone-body {
    font-size: 13px;
    line-height: 1.55;
    color: var(--color-ink);
    letter-spacing: -0.003em;
}

.cornerstone-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    font-size: 11px;
    color: var(--color-grey-500);
    font-family: var(--f-data);
    letter-spacing: 0.04em;
}

.cornerstone-actions { display: flex; gap: 2px; }
.cornerstone-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px;
    color: var(--color-grey-300);
    line-height: 1;
}
.cornerstone-btn:hover { color: var(--color-grey-700); }
.cornerstone-btn .ms { font-size: 15px; }
.cornerstone-btn-starred { color: var(--color-warning); }
.cornerstone-btn-starred:hover { color: var(--color-warning); }

.cornerstone-empty {
    font-size: 12.5px;
    color: var(--color-grey-500);
    line-height: 1.5;
    padding: 12px 4px;
}

/* ─────────────────────────────────────────────────────────────
   PORTFOLIO — preloaded map strip
───────────────────────────────────────────────────────────── */

/* Coverage dashboard — split: Germany map (left) + stats (right) */
#portfolio-coverage {
    display: flex;
    flex: 1;
    min-height: 0;
    background: #FFFFFF;
}

#portfolio-map-wrap {
    flex: 1 1 44%;
    min-width: 0;
    position: relative;
    background: #FFFFFF;
}

#portfolio-map {
    position: absolute;
    inset: 0;
}

#coverage-map-legend {
    position: absolute;
    left: 10px;
    bottom: 10px;
    z-index: 2;
    background: rgba(255,255,255,0.92);
    border: 1px solid var(--color-line);
    border-radius: 6px;
    padding: 7px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 10.5px;
    color: var(--color-grey-700);
}
#coverage-map-legend span { display: flex; align-items: center; gap: 6px; }
.cov-swatch { width: 12px; height: 12px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.cov-swatch-covered   { background: rgba(74,43,124,0.16); border: 2px solid #4A2B7C; }
.cov-swatch-uncovered { background: transparent; border: 1.6px solid #A8A29A; }
.cov-swatch-store     { width: 8px; height: 8px; background: #4A2B7C; border: 1.5px solid #FFFFFF; }

/* Stats rail */
#coverage-stats {
    flex: 1 1 56%;
    min-width: 320px;
    max-width: 680px;
    overflow-y: auto;
    padding: 20px 24px;
    background: #FFFFFF;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.coverage-stats-loading, .coverage-stats-empty {
    font-size: 12.5px;
    color: var(--color-grey-500);
    line-height: 1.5;
}
.coverage-hd, .cov-sub-hd {
    font-family: var(--f-data);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-grey-500);
}
/* Card stack — light, separate containers (no table lines) */
.cov-cards { display: flex; flex-direction: column; gap: 12px; }
.cov-card {
    background: #FFFFFF;
    border: 1px solid rgba(0,0,0,0.07);
    border-radius: 12px;
    padding: 16px 18px;
}

/* Leading card — total locations */
.cov-lead { display: flex; flex-direction: column; gap: 2px; }
.cov-lead-num { font-size: 40px; font-weight: 700; color: var(--color-ink); letter-spacing: -0.02em; line-height: 1; }
.cov-lead-lbl { font-size: 12px; color: var(--color-grey-500); }

/* Tier card */
.cov-tier-card { display: flex; flex-direction: column; gap: 10px; }
.cov-card-hd { display: flex; align-items: baseline; justify-content: space-between; }
.cov-tier-name { font-size: 13px; font-weight: 700; color: var(--color-ink); letter-spacing: 0.01em; }
.cov-tier-cities { font-size: 11px; color: var(--color-grey-500); }
.cov-tier-cov { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.cov-tier-big { font-size: 24px; font-weight: 700; color: var(--color-mark); letter-spacing: -0.02em; line-height: 1; }
.cov-tier-covlbl { font-size: 10px; color: var(--color-grey-700); }
.cov-bar { height: 7px; background: var(--color-grey-100); border-radius: 4px; overflow: hidden; }
.cov-bar-fill { height: 100%; background: var(--color-mark); border-radius: 4px; }

.cov-tier-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; padding-top: 2px; }
.cov-tier-stats > div { display: flex; flex-direction: column; gap: 1px; }
.cov-s-num { font-family: var(--f-data); font-size: 14px; font-weight: 700; color: var(--color-ink); }
.cov-s-lbl { font-size: 10px; color: var(--color-grey-500); }

/* Header card — total locations */
.cov-headcard { display: flex; align-items: baseline; gap: 10px; }
.cov-headcard-num { font-size: 34px; font-weight: 700; color: var(--color-ink); letter-spacing: -0.02em; line-height: 1; }
.cov-headcard-lbl { font-size: 12.5px; color: var(--color-grey-500); }

/* Macro / Micro cards */
.cov-mm { display: flex; flex-direction: column; gap: 12px; }
.cov-mm-hd { font-size: 13px; font-weight: 700; color: var(--color-ink); }
.cov-mm-sub { font-size: 10.5px; font-weight: 500; color: var(--color-grey-500); letter-spacing: 0; }
.cov-mm-figs { display: flex; gap: 22px; flex-wrap: wrap; }
.cov-mm-fig { display: flex; flex-direction: column; gap: 2px; }
.cov-mm-num { font-family: var(--f-data); font-size: 22px; font-weight: 700; color: var(--color-ink); letter-spacing: -0.01em; line-height: 1.05; }
.cov-mm-lbl { font-size: 11px; color: var(--color-grey-700); display: inline-flex; align-items: center; gap: 3px; }

/* Small grey "k" suffix hugging population/catchment figures */
.fig-k { font-size: 0.68em; font-weight: 600; color: var(--color-grey-500); margin-left: 1.5px; }

/* Inline info tooltip (CSS-only, hover/focus) */
.cov-info { position: relative; display: inline-flex; cursor: help; color: var(--color-grey-300); outline: none; }
.cov-info .ms { font-size: 13px; }
.cov-info:hover, .cov-info:focus { color: var(--color-mark); }
.cov-info-pop {
    position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
    width: 220px; padding: 9px 11px; z-index: 5;
    background: var(--color-ink); color: #fff; border-radius: 8px;
    font-size: 11px; font-weight: 400; line-height: 1.45; letter-spacing: 0;
    box-shadow: 0 4px 16px rgba(0,0,0,0.22);
    opacity: 0; visibility: hidden; transition: opacity 0.12s;
}
.cov-info:hover .cov-info-pop, .cov-info:focus .cov-info-pop { opacity: 1; visibility: visible; }

/* Tier cards in a left-to-right row */
.cov-tier-row { display: flex; gap: 12px; align-items: stretch; }
.cov-tier-row .cov-tier-card { flex: 1 1 0; min-width: 0; }

/* Hover popups on the silhouette map. The !important values override the global
   .maplibregl-popup-content rule (which forces padding:0) — without them these
   popups collapse to zero padding and read as cramped. */
.pf-pop .maplibregl-popup-content {
    padding: 12px 15px !important;
    border-radius: 10px !important;
    box-shadow: 0 4px 18px rgba(42,21,72,0.18), 0 0 0 0.5px rgba(42,21,72,0.06) !important;
    background: #fff !important;
    font-family: var(--f-ui) !important;
    min-width: 132px;
    max-width: 240px;
}
.pf-pop .maplibregl-popup-tip { display: none; }
.pf-pop-city {
    font-size: 14px;
    font-weight: 700;
    color: var(--color-ink);
    line-height: 1.25;
    display: flex;
    align-items: center;
    gap: 7px;
}
.pf-pop-city::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-mark);
    flex-shrink: 0;
}
/* City (area) popup — stat-led so coverage reads at a glance */
.pf-pop-area-city {
    font-size: 13px;
    font-weight: 700;
    color: var(--color-ink);
    line-height: 1.2;
}
.pf-pop-area-cov {
    display: flex;
    align-items: baseline;
    gap: 7px;
    margin-top: 6px;
}
.pf-pop-area-pct {
    font-family: var(--f-data);
    font-size: 28px;
    font-weight: 800;
    color: var(--color-mark);
    line-height: 1;
}
.pf-pop-area-covlbl {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-grey-500);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.pf-pop-area-foot {
    font-size: 12px;
    color: var(--color-grey-700);
    margin-top: 8px;
}
.pf-pop-area-foot strong { color: var(--color-ink); font-weight: 700; }

.cov-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 8px; }
.cov-foot-link { background: none; border: none; cursor: pointer; font-family: var(--f-ui); font-size: 11px; color: var(--color-mark); padding: 2px 0; }
.cov-foot-link:hover { text-decoration: underline; }

/* ── Rail toggle: Network | Stores ── */
#portfolio-rail-tabs { display: flex; gap: 3px; background: var(--color-grey-100); border-radius: 8px; padding: 3px; align-self: flex-start; }
.prail-tab { border: none; background: transparent; cursor: pointer; font-family: var(--f-ui); font-size: 12px; font-weight: 600; color: var(--color-grey-500); padding: 5px 16px; border-radius: 6px; transition: background 120ms, color 120ms; }
.prail-tab.active { background: #fff; color: var(--color-mark); box-shadow: 0 1px 2px rgba(0,0,0,0.08); }
.prail-tab:hover:not(.active) { color: var(--color-ink); }

.cov-pane { display: flex; flex-direction: column; gap: 12px; flex: 1 1 auto; min-height: 0; }

/* ── Per-store signal list ── */
.pf-stores-intro { font-size: 11px; color: var(--color-grey-500); line-height: 1.6; }
.pf-leg { display: inline-flex; align-items: flex-end; gap: 1.5px; height: 7px; vertical-align: -1px; }
.pf-leg i { width: 2.5px; border-radius: 1px; }
.pf-leg i:nth-child(1) { height: 3px; }
.pf-leg i:nth-child(2) { height: 4.5px; }
.pf-leg i:nth-child(3) { height: 6px; }
.pf-leg.sig-above i { background: #4A2B7C; }
.pf-leg.sig-below { flex-direction: row-reverse; align-items: flex-start; }
.pf-leg.sig-below i { background: #E08A1E; }

.pf-store-colhd { display: grid; grid-template-columns: minmax(0,1fr) 100px 100px 0.2fr; gap: 30px; padding: 0 2px 6px; border-bottom: 1px solid var(--color-line);
    font-family: var(--f-data); font-size: 9px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-grey-500); }
.pf-store-colhd span:nth-child(2), .pf-store-colhd span:nth-child(3) { text-align: left; }
.pf-sort { cursor: pointer; transition: color 120ms; }
.pf-sort:hover { color: var(--color-ink); }
.pf-sort.active { color: var(--color-mark); }
.pf-sort-arr { font-size: 8px; margin-left: 2px; }

.pf-store-list { display: flex; flex-direction: column; }
.pf-store-row { display: grid; grid-template-columns: minmax(0,1fr) 100px 100px 0.2fr; gap: 30px; align-items: center; padding: 8px 2px; border-bottom: 1px solid var(--color-line); cursor: pointer; }
.pf-store-row:hover { background: rgba(74, 43, 124, 0.04); }
.pf-store-row.selected { background: rgba(74, 43, 124, 0.08); }

/* Open-card button: only on the selected (clicked) row. Filled pill + hexagon
   line-icon so it reads as a present, primary action in the nav-icon family. */
.pf-store-open { justify-self: end; display: none; align-items: center; justify-content: center; background: var(--color-mark); border: none; cursor: pointer; color: #fff; padding: 5px; line-height: 1; border-radius: 6px; box-shadow: 0 1px 3px rgba(74, 43, 124, 0.28); transition: background .15s, transform .15s; }
.pf-store-open svg { width: 18px; height: 18px; display: block; }
.pf-store-open:hover { background: var(--color-ink); transform: translateY(-1px); }
.pf-store-row.selected .pf-store-open { display: inline-flex; }
.pf-store-main { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.pf-store-name { font-size: 12.5px; font-weight: 600; color: var(--color-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-store-city { font-size: 10px; color: var(--color-grey-500); }
.pf-store-sig { display: flex; flex-direction: row; align-items: center; justify-content: flex-start; gap: 8px; }
.pf-sig-val { display: none; font-family: var(--f-data); font-size: 14px; font-weight: 600; color: var(--color-ink); line-height: 1; white-space: nowrap; }
.pf-store-row.selected .pf-sig-val { display: inline-block; }

/* ── Markets pane: tiered cities as market-area rows ─────────────────────── */
.pf-markets-sub { font-weight: 500; color: var(--color-grey-500); font-size: 10px; letter-spacing: 0; text-transform: none; margin-left: 4px; }
.pf-market-list { display: flex; flex-direction: column; }
.pf-market-colhd { display: grid; grid-template-columns: minmax(0,1fr) 40px 48px 124px 16px; gap: 14px; padding: 0 2px 6px; border-bottom: 1px solid var(--color-line); font-family: var(--f-ui); font-size: 10px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--color-grey-500); }
.pf-market-row { display: grid; grid-template-columns: minmax(0,1fr) 40px 48px 124px 16px; gap: 14px; align-items: center; padding: 10px 2px; border-bottom: 1px solid var(--color-line); cursor: pointer; }
.pf-market-row:hover { background: rgba(74, 43, 124, 0.04); }
.pf-market-main { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.pf-market-tier, .pf-market-stores { font-family: var(--f-data); font-size: 14px; font-weight: 600; color: var(--color-ink); line-height: 1; }
.pf-market-cov { min-width: 0; }

/* Advanced → Infrastructure: zoom-in hint */
.nlc-infra-hint { font-family: var(--f-ui); font-size: 10.5px; color: var(--color-grey-500); font-style: italic; padding: 2px 2px 0; }

/* ── Analyze workspace pane (always shown; toggle retired) ──────────────── */
.analyze-mode-pane { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }

/* Floating items panel — same card look as the Analyze items drawer, used
   (docked, not sliding) by News / Opportunity / Performance. */
.items-panel {
    width: 340px; flex-shrink: 0;
    margin: 14px 14px 14px 0;
    background: var(--color-grey-50);
    border: 1px solid var(--color-line);
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(42, 21, 72, 0.07);
    display: flex; flex-direction: column; overflow: hidden;
}
.items-panel-picker { padding: 14px 16px 12px; border-bottom: 1px solid var(--color-line); flex-shrink: 0; }
.items-panel-body { flex: 1; overflow-y: auto; padding: 16px 18px; }
/* In-panel market dropdown: fills the freed space below the picker */
.mkt-pick.open .mkt-pick-caret { transform: rotate(180deg); }
.mkt-inline { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.mkt-inline-search {
    display: flex; align-items: center; gap: 8px; flex-shrink: 0;
    height: 38px; margin: 12px 14px 4px; padding: 0 10px;
    border: 1px solid var(--color-line-strong, rgba(42,21,72,0.18)); border-radius: 7px;
}
.mkt-inline-search .ms { font-size: 17px; color: var(--color-grey-500); }
.mkt-inline-input {
    flex: 1; border: none; outline: none; background: transparent;
    font-family: var(--f-ui); font-size: 13px; color: var(--color-ink);
}
.mkt-inline-list { flex: 1; overflow-y: auto; padding: 6px 10px 12px; }
/* Analyze header variant: a white panel anchored below the picker that fills the
   rest of the left side panel (top/left/width/bottom set in JS), visually
   connected to the button on top. */
#market-header.mkt-open .mkt-pick { border-bottom-color: transparent; border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.mkt-inline-header {
    position: absolute; z-index: 100; flex: none;
    background: #fff; border: 1px solid var(--color-line); border-top: none;
    border-radius: 0 0 8px 8px; box-shadow: 0 8px 20px rgba(42, 21, 72, 0.12);
}

/* Analyze items drawer — collapsible right-edge panel over the map. */
.aitems-drawer {
    position: absolute; top: 12px; right: 12px; bottom: 12px; width: 340px;
    background: var(--color-grey-50); border: 1px solid var(--color-line);
    border-radius: 12px; box-shadow: 0 1px 6px rgba(42, 21, 72, 0.10);
    display: flex; flex-direction: column; overflow: hidden; z-index: 6;
    transform: translateX(calc(100% + 16px)); transition: transform 220ms ease;
}
.aitems-drawer.open { transform: translateX(0); }
.aitems-hd { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--color-line); flex-shrink: 0; }
.aitems-title { font-family: var(--f-ui); font-size: var(--fs-lg); font-weight: 700; color: var(--color-ink); }
.aitems-close { border: none; background: transparent; cursor: pointer; color: var(--color-grey-500); display: flex; padding: 2px; border-radius: 6px; }
.aitems-close:hover { color: var(--color-ink); background: rgba(0,0,0,0.04); }
.aitems-body { flex: 1; overflow-y: auto; padding: 14px; }
/* Collapsed handle — a tab pinned to the map's right edge. */
.aitems-handle {
    position: absolute; top: 16px; right: 0; z-index: 6;
    display: flex; align-items: center; gap: 3px;
    background: #fff; border: 1px solid var(--color-line); border-right: none;
    border-radius: 8px 0 0 8px; padding: 8px 10px 8px 9px; cursor: pointer;
    font-family: var(--f-ui); font-size: var(--fs-sm); font-weight: 600; color: var(--color-mark);
    box-shadow: 0 2px 10px rgba(42, 21, 72, 0.10);
}
.aitems-handle:hover { background: var(--color-grey-50); }
.aitems-handle .ms { font-size: 16px; }

/* Reusable segmented toggle (same look as the Analyze Display/Pipeline tabs).
   .seg-sm = compact variant (e.g. the Extent Macro/Micro toggle). */
.seg-toggle { display: flex; gap: 4px; background: var(--color-grey-50); border: 1px solid var(--color-line); border-radius: 8px; padding: 3px; flex-shrink: 0; }
.seg-tab { flex: 1; border: none; background: transparent; cursor: pointer; font-family: var(--f-ui); font-size: var(--fs-base); font-weight: 600; color: var(--color-grey-500); padding: 6px 8px; border-radius: 6px; transition: background 120ms, color 120ms; }
.seg-tab.active { background: #fff; color: var(--color-mark); box-shadow: 0 1px 2px rgba(0,0,0,0.08); }
.seg-tab:hover:not(.active) { color: var(--color-ink); }
.seg-toggle.seg-sm { gap: 2px; padding: 2px; border-radius: 7px; }
.seg-sm .seg-tab { font-size: var(--fs-sm); padding: 3px 6px; border-radius: 5px; }

/* ── News pane ───────────────────────────────────────────────────────────── */
.news-pane { display: flex; flex-direction: column; gap: 10px; }
.news-loading, .news-empty { font-family: var(--f-ui); font-size: var(--fs-base); color: var(--color-grey-500); padding: 14px 2px; }
.news-empty { font-style: italic; }
.news-hd { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.news-hd-market { font-family: var(--f-ui); font-size: var(--fs-lg); font-weight: 700; color: var(--color-ink); }
.news-hd-asof { font-size: var(--fs-meta); color: var(--color-grey-500); margin-top: 1px; }
.news-hd-asof a { color: var(--color-mark); text-decoration: none; }
.news-hd-actions { display: flex; gap: 6px; flex-shrink: 0; }
.news-btn { display: inline-flex; align-items: center; gap: 4px; padding: 5px 9px; background: #fff; border: 1px solid var(--color-grey-100); border-radius: 6px; font-family: var(--f-ui); font-size: var(--fs-base); font-weight: 600; color: var(--color-ink); cursor: pointer; }
.news-btn:hover { border-color: var(--color-mark); color: var(--color-mark); }
.news-btn .ms { font-size: 14px; }
.news-btn[disabled] { opacity: 0.5; cursor: default; }
.news-btn-deep { color: var(--color-mark); }
.news-spin { animation: news-spin 1s linear infinite; }
@keyframes news-spin { to { transform: rotate(360deg); } }
.news-disclaimer { font-size: var(--fs-meta); color: var(--color-grey-500); font-style: italic; }
.news-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: stretch; }
@media (max-width: 1180px) { .news-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 820px)  { .news-list { grid-template-columns: 1fr; } }
.news-item { display: flex; flex-direction: column; border: 1px solid var(--color-line); border-radius: 8px; padding: 14px 15px; background: #fff; }
.news-item-top { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.news-item-top .news-date { margin-left: auto; }
.news-market-chip { display: inline-flex; align-items: center; gap: 3px; font-family: var(--f-ui); font-size: var(--fs-meta); font-weight: 600; color: var(--color-mark); background: var(--color-grey-50); border: 1px solid var(--color-line); border-radius: 20px; padding: 2px 8px 2px 6px; cursor: pointer; line-height: 1.4; }
.news-market-chip:hover { background: #F3E8F8; border-color: var(--color-mark); }
.news-market-chip .ms { font-size: 13px; }
.news-cat { font-family: var(--f-ui); font-size: var(--fs-eyebrow); font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; padding: 2px 7px; border-radius: 20px; background: var(--color-grey-50); color: var(--color-grey-500); }
.news-cat-retail { background: #F3E8F8; color: var(--color-mark); }
.news-cat-real_estate { background: #E8F0FB; color: #2c5fa8; }
.news-cat-urban_development { background: #FBF0E5; color: #B5731A; }
.news-cat-economy { background: #E9F5EC; color: #1f7a3d; }
.news-cat-demographics { background: #FCEAEC; color: #9A2E32; }
.news-date { font-size: var(--fs-meta); color: var(--color-grey-500); }
.news-item-title { font-family: var(--f-ui); font-size: var(--fs-lg); font-weight: 600; color: var(--color-ink); line-height: 1.35; }
.news-item-summary { font-size: var(--fs-base); color: var(--color-grey-700); line-height: 1.5; margin-top: 5px; }
.news-item-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 10px; }
.news-src { font-size: var(--fs-meta); color: var(--color-mark); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60%; }
.news-src:hover { text-decoration: underline; }
.news-raise { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; background: transparent; border: 1px solid var(--color-grey-100); border-radius: 20px; font-family: var(--f-ui); font-size: var(--fs-meta); font-weight: 600; color: var(--color-grey-500); cursor: pointer; flex-shrink: 0; }
.news-raise:hover { border-color: var(--color-mark); color: var(--color-mark); }
.news-raise .ms { font-size: 12px; }
.news-picker { padding: 6px 0; }
.news-picker-why { font-size: var(--fs-base); color: var(--color-grey-500); margin-bottom: 10px; line-height: 1.4; }
.news-picker-lbl { display: block; font-size: var(--fs-meta); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-grey-500); margin-bottom: 4px; }
.news-select { width: 100%; padding: 7px 9px; border: 1px solid var(--color-grey-100); border-radius: 6px; font-family: var(--f-ui); font-size: var(--fs-base); color: var(--color-ink); background: #fff; }

/* ── Analyze → Pipeline pane ─────────────────────────────────────────────── */
.apipe-list { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.apipe-item { border: 1px solid var(--color-line); border-radius: 8px; padding: 9px 11px; background: #fff; cursor: pointer; }
.apipe-item:hover { border-color: var(--color-mark); }
.apipe-title { font-family: var(--f-ui); font-size: var(--fs-base); font-weight: 600; color: var(--color-ink); line-height: 1.3; }
.apipe-meta { font-size: var(--fs-meta); color: var(--color-grey-500); margin-top: 2px; text-transform: capitalize; }
.pf-market-cov-lbl { font-size: 10px; color: var(--color-grey-500); white-space: nowrap; }
.pf-market-cov-lbl strong { color: var(--color-mark); font-family: var(--f-data); }
.pf-market-chev { color: var(--color-grey-300); font-size: 18px; justify-self: end; }
.pf-market-row:hover .pf-market-chev { color: var(--color-mark); }

/* ── Market card overlay ─────────────────────────────────────────────────── */
.market-members-hd, .market-info-hd { font-family: var(--f-ui); font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-grey-500); margin: 18px 0 10px; }
.market-info-hd { margin-top: 24px; }
.market-members-row { display: flex; flex-wrap: wrap; gap: 12px; }
.market-members-empty { font-size: 12px; color: var(--color-grey-500); font-style: italic; }
.market-member-card { width: 150px; border: 1px solid var(--color-grey-100); background: #fff; border-radius: 10px; padding: 0 0 8px; cursor: pointer; text-align: left; overflow: hidden; transition: box-shadow .15s, transform .15s; display: flex; flex-direction: column; }
.market-member-card:hover { box-shadow: 0 4px 16px rgba(42,21,72,0.14); transform: translateY(-2px); }
.market-member-photo { width: 100%; height: 96px; background: var(--color-grey-50); overflow: hidden; }
.market-member-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.market-member-photo.noimg { background: linear-gradient(135deg, var(--color-grey-50), var(--color-grey-100)); }
.market-member-name { font-size: 12px; font-weight: 600; color: var(--color-ink); padding: 8px 10px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.market-member-rating { font-size: 11px; color: var(--color-grey-500); padding: 2px 10px 0; }

/* ── Card Actions section (market card + store card) ─────────────────────── */
.market-actions-section { margin-top: 8px; }
.card-action-raise { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; background: #fff; border: 1px solid var(--color-grey-100); border-radius: 20px; font-family: var(--f-ui); font-size: 11px; font-weight: 600; color: var(--color-mark); cursor: pointer; }
.card-action-raise:hover { border-color: var(--color-mark); }
.card-action-list { display: flex; flex-direction: column; gap: 6px; }
.card-action-row { display: grid; grid-template-columns: auto minmax(0,1fr) 16px; align-items: center; gap: 10px; padding: 9px 12px; background: #fff; border: 1px solid var(--color-line); border-radius: 8px; cursor: pointer; }
.card-action-row:hover { border-color: var(--color-mark); }
.card-action-kind { font-family: var(--f-data); font-size: 9.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--color-grey-500); background: var(--color-grey-50); border: 1px solid var(--color-line); padding: 3px 8px; border-radius: 20px; white-space: nowrap; }
.card-action-main { min-width: 0; }
.card-action-text { font-size: 12.5px; color: var(--color-ink); line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-action-meta { font-size: 10px; color: var(--color-grey-500); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-action-chev { color: var(--color-grey-300); font-size: 16px; }
.card-action-empty { font-size: 12px; color: var(--color-grey-500); font-style: italic; padding: 4px 2px; }

/* ── Pipeline item tags / private / area chips ───────────────────────────── */
.pl-tag { display: inline-flex; align-items: center; gap: 3px; font-family: var(--f-ui); font-size: 10px; font-weight: 600; color: var(--color-mark); background: #F3E8F8; border: 1px solid #E2D2EE; padding: 2px 8px; border-radius: 20px; }
.pl-tag-area { color: #1E4F8B; background: #E1ECF7; border-color: #C5D9EF; }
.pl-private { display: inline-flex; align-items: center; gap: 3px; font-family: var(--f-ui); font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-grey-500); background: var(--color-grey-50); border: 1px solid var(--color-line); padding: 2px 8px; border-radius: 20px; }

/* ── Mark-an-area floating toolbars (Analyze map) ────────────────────────── */
#area-select-bar, #area-saved-bar { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 9500; display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--color-line); border-radius: 10px; padding: 8px 10px 8px 12px; box-shadow: 0 6px 24px rgba(42,21,72,0.18); font-family: var(--f-ui); font-size: 13px; color: var(--color-ink); }
#area-select-bar .asb-text, #area-saved-bar .asb-text { color: var(--color-grey-700); }
#area-select-bar button, #area-saved-bar button { font-family: var(--f-ui); font-size: 12px; font-weight: 600; border-radius: 6px; padding: 6px 11px; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
#area-select-bar .asb-save { background: var(--color-mark); color: #fff; border: none; }
#area-select-bar .asb-save[disabled] { opacity: 0.5; cursor: default; }
.asb-cancel { background: #fff; color: var(--color-grey-700); border: 1px solid var(--color-grey-100); }
.asb-immo { display: inline-flex; align-items: center; gap: 5px; padding: 6px 11px; background: #1f7a3d; color: #fff; border-radius: 6px; font-family: var(--f-ui); font-size: 12px; font-weight: 600; text-decoration: none; }
.asb-immo:hover { background: #1a6633; }

/* ── Strategy what-if simulator ──────────────────────────────────────────── */
.strategy-sim { display: flex; height: 100%; min-height: 0; }
.strategy-sim-map-wrap { flex: 1 1 auto; position: relative; min-width: 0; }
#strategy-map { position: absolute; inset: 0; }
.strategy-sim-toolbar { position: absolute; top: 12px; left: 12px; z-index: 2; display: flex; gap: 6px; }
.strategy-sim-toolbar button { display: inline-flex; align-items: center; gap: 5px; padding: 6px 11px; background: #fff; border: 1px solid var(--color-grey-100); border-radius: 6px; font-family: var(--f-ui); font-size: 12px; font-weight: 600; color: var(--color-ink); cursor: pointer; box-shadow: 0 1px 4px rgba(42,21,72,0.1); }
.strategy-sim-toolbar button:hover { border-color: var(--color-mark); color: var(--color-mark); }
.strategy-sim-toolbar button.active { background: var(--color-mark); color: #fff; border-color: var(--color-mark); }
.strat-num-good { color: #1f7a3d; }
.strat-scenario-bar { display: flex; gap: 6px; align-items: center; margin-bottom: 14px; }
.strat-scenario-bar select { flex: 1; min-width: 0; padding: 6px 8px; font-family: var(--f-ui); font-size: 12px; border: 1px solid var(--color-grey-100); border-radius: 6px; background: #fff; color: var(--color-ink); }
.strat-scenario-bar button { display: inline-flex; align-items: center; justify-content: center; padding: 6px 8px; background: #fff; border: 1px solid var(--color-grey-100); border-radius: 6px; cursor: pointer; color: var(--color-mark); }
.strat-scenario-bar button:hover { border-color: var(--color-mark); }
.strat-assumptions { margin-top: 18px; }
.strat-assumptions label { display: block; font-family: var(--f-data); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--color-grey-500); margin-bottom: 6px; }
.strat-assumptions textarea { width: 100%; padding: 9px 11px; font-size: 12.5px; line-height: 1.5; border: 1px solid var(--color-grey-100); border-radius: 6px; font-family: var(--f-ui); box-sizing: border-box; resize: vertical; color: var(--color-ink); }
.strategy-sim-legend { position: absolute; bottom: 12px; left: 12px; z-index: 2; display: flex; gap: 14px; background: rgba(255,255,255,0.92); border: 1px solid var(--color-line); border-radius: 8px; padding: 7px 12px; font-family: var(--f-ui); font-size: 11px; color: var(--color-grey-500); }
.strategy-sim-legend span { display: inline-flex; align-items: center; gap: 5px; }
.strategy-sim-panel { width: 344px; flex-shrink: 0; background: #fff; border-left: 1px solid var(--color-line); padding: 18px 18px 28px; overflow-y: auto; }
.strat-scenario-row { display: flex; gap: 12px; margin: 6px 0 14px; }
.strat-scenario-row > div { flex: 1; background: var(--color-grey-50); border: 1px solid var(--color-line); border-radius: 8px; padding: 10px 12px; }
.strat-num { display: block; font-family: var(--f-data); font-size: 22px; font-weight: 600; color: var(--color-ink); line-height: 1; }
.strat-num-warn { color: #C0392B; }
.strat-lbl { display: block; font-size: 10px; color: var(--color-grey-500); margin-top: 3px; text-transform: uppercase; letter-spacing: 0.04em; }
.strat-headline { display: flex; align-items: baseline; gap: 8px; }
.strat-headline-pct { font-family: var(--f-data); font-size: 30px; font-weight: 700; color: var(--color-mark); line-height: 1; }
.strat-headline-lbl { font-size: 11px; color: var(--color-grey-500); line-height: 1.3; }
.strat-headline-foot { display: flex; justify-content: space-between; font-size: 11px; color: var(--color-grey-500); font-family: var(--f-data); }
.strat-tier-row { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; }
.strat-tier-hd { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; font-weight: 600; color: var(--color-ink); margin-bottom: 4px; }
.strat-tier-pct { font-family: var(--f-data); }
.strat-tier-was { font-size: 9.5px; color: var(--color-grey-300); font-weight: 400; }
.strat-tier-foot { font-size: 10px; color: var(--color-grey-500); margin-top: 3px; font-family: var(--f-data); }
.strat-mini-row { display: flex; gap: 12px; margin-top: 14px; }
.strat-mini-row > div { flex: 1; }
.strat-mini-num { display: block; font-family: var(--f-data); font-size: 16px; font-weight: 600; color: var(--color-ink); }
.strat-delta { font-family: var(--f-data); font-size: 11px; font-weight: 700; }
.strat-delta-up { color: #1f7a3d; }
.strat-delta-down { color: #C0392B; }
.strat-delta-zero { color: var(--color-grey-300); }

@media (max-width: 900px) {
    .strategy-sim { flex-direction: column; }
    .strategy-sim-map-wrap { height: 320px; flex: none; }
    .strategy-sim-panel { width: auto; border-left: none; border-top: 1px solid var(--color-line); }
}

/* Phone-signal bars, each block centered in its cell: above rises UP (purple,
   bars share a bottom edge), below hangs DOWN (orange, mirrored, share a top
   edge, longest on the left). */
.sig { display: inline-flex; align-items: flex-end; gap: 2.76px; height: 18.4px; }
.sig-below { flex-direction: row-reverse; align-items: flex-start; }
.sig-bar { width: 4.83px; height: var(--h); background: var(--color-grey-100); border-radius: 1px; }
.sig-above .sig-bar.lit { background: #4A2B7C; }
.sig-below .sig-bar.lit { background: #E08A1E; }

@media (max-width: 900px) {
    #portfolio-coverage { flex-direction: column; height: auto; }
    #portfolio-map-wrap { height: 240px; flex-basis: auto; }
    #coverage-stats { max-width: none; }
    .cov-tier-row { flex-wrap: wrap; }
    .cov-tier-row .cov-tier-card { flex-basis: 100%; }
}

/* Position row on the store profile */
.stores-position-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: var(--color-grey-50);
    border: 1px solid var(--color-line);
    border-radius: var(--r-lg);
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.pos-hd {
    font-family: var(--f-data);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-grey-500);
}
.pos-cells { display: flex; gap: 22px; flex-wrap: wrap; }
.pos-cell { display: flex; flex-direction: column; gap: 1px; }
.pos-num { font-family: var(--f-data); font-size: 17px; font-weight: 700; color: var(--color-ink); line-height: 1; }
.pos-of { font-size: 11px; font-weight: 500; color: var(--color-grey-500); }
.pos-lbl { font-size: 10px; color: var(--color-grey-500); }

/* Store information — org-defined custom fields on the store card */
.stores-fields-section {
    padding: 14px 16px;
    background: var(--color-grey-50);
    border: 1px solid var(--color-line);
    border-radius: var(--r-lg);
    margin-bottom: 18px;
}
.stores-fields-section .pos-hd { display: block; margin-bottom: 10px; }
.sf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px 18px;
}
.sf-row { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sf-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--color-grey-500);
}
.sf-input {
    width: 100%;
    padding: 6px 8px;
    font-size: 12px;
    font-family: var(--f-ui);
    color: var(--color-ink);
    background: var(--color-paper);
    border: 1px solid var(--color-grey-300);
    border-radius: var(--r);
    box-sizing: border-box;
}
.sf-input:focus { outline: none; border-color: var(--color-mark); }
.sf-foot { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.sf-save { width: auto; margin: 0; padding: 4px 11px; font-size: 11px; gap: 4px; align-self: flex-start; }
.sf-save .ms { font-size: 14px; }
.sf-msg { font-size: 11px; font-weight: 500; }

/* ── Performance section ─────────────────────────────────────────────────────── */
.perf-empty, .perf-error { font-family: var(--f-ui); font-size: 13px; color: var(--color-grey-700); line-height: 1.6; max-width: 560px; }
.perf-error { color: #C0392B; }
.perf-empty code { font-family: var(--f-data); font-size: 11px; background: var(--color-grey-50); padding: 1px 5px; border-radius: 4px; }

.perf-strip {
    display: flex; align-items: center; gap: 28px; flex-wrap: wrap;
    padding: 14px 18px; background: #fff; border: 1px solid var(--color-line);
    border-radius: 10px; margin-bottom: 18px;
}
.perf-period {
    font-family: var(--f-ui); font-size: 13px; font-weight: 600; color: var(--color-ink);
    border: 1px solid var(--color-line-strong, rgba(42,21,72,0.18)); border-radius: 7px;
    padding: 7px 10px; background: #fff; cursor: pointer;
}
.perf-stat { display: flex; flex-direction: column; gap: 2px; }
.perf-stat-lbl { font-family: var(--f-data); font-size: 8.5px; font-weight: 600; letter-spacing: 0.1em; color: var(--color-grey-500); }
.perf-stat-val { font-family: var(--f-data); font-size: 18px; font-weight: 600; color: var(--color-ink); }

.perf-grid { display: grid; grid-template-columns: 1fr; gap: 18px; align-items: start; }
.perf-card { background: #fff; border: 1px solid var(--color-line); border-radius: 10px; padding: 16px 18px; }
.perf-card-hd { font-family: var(--f-ui); font-size: 12px; font-weight: 600; color: var(--color-ink); margin-bottom: 12px; }

.perf-table { width: 100%; border-collapse: collapse; font-family: var(--f-ui); }
.perf-table th {
    font-family: var(--f-data); font-size: 9px; font-weight: 600; letter-spacing: 0.06em;
    text-transform: uppercase; color: var(--color-grey-500); text-align: left;
    padding: 0 10px 8px 0; cursor: pointer; white-space: nowrap; user-select: none;
}
.perf-table th.perf-th-num { text-align: right; }
.perf-table th:hover { color: var(--color-mark); }
.perf-arr { color: var(--color-mark); margin-left: 2px; }
.perf-table td { padding: 7px 10px 7px 0; border-top: 1px solid var(--color-line); font-size: 12.5px; color: var(--color-ink); }
.perf-table td.perf-num { font-family: var(--f-data); text-align: right; white-space: nowrap; }
.perf-table tbody tr:hover { background: rgba(74, 43, 124, 0.04); }

#perf-scatter { min-height: 280px; }
#perf-scatter-tip {
    display: none; position: fixed; z-index: 9999; pointer-events: none;
    background: var(--color-paper); border: 1px solid var(--color-line);
    border-radius: 8px; padding: 10px 13px; max-width: 260px;
    box-shadow: 0 4px 18px rgba(42, 21, 72, 0.16);
    font-family: var(--f-ui);
}
#perf-scatter-tip .pst-name { font-size: var(--fs-base); font-weight: 700; color: var(--color-ink); line-height: 1.3; }
#perf-scatter-tip .pst-sub  { font-size: var(--fs-sm); color: var(--color-grey-500); font-family: var(--f-data); margin-top: 3px; }
.perf-scatter-note { font-family: var(--f-ui); font-size: 10.5px; color: var(--color-grey-500); line-height: 1.5; margin-top: 10px; }
.perf-scatter-thin { font-family: var(--f-ui); font-size: 12px; color: var(--color-grey-500); line-height: 1.55; padding: 24px 4px; }
.perf-demo-banner {
    display: flex; align-items: center; gap: 8px;
    font-family: var(--f-ui); font-size: 12px; color: var(--color-mark);
    background: rgba(74, 43, 124, 0.06); border: 1px solid rgba(74, 43, 124, 0.18);
    border-radius: 8px; padding: 9px 13px; margin-bottom: 14px;
}
.perf-demo-banner .ms { font-size: 16px; }
