/* @docs popovers.css - shared ISTP insight breakdown popup (.istp-insight-popup + .ip-* internals: dates, equity rows, bidder funnel, chips, bid rows), active-filter chip row (.istp-active-filter-chip), expanded .db-row + .db-row-detail panel + .db-detail-* group structure (head, dl trigger, group heading, grid, prose, sources), .db-row.is-flash highlight on chart-click scroll. */

        .db-row.is-flash { background: rgba(196, 90, 58, 0.12) !important; transition: background 600ms ease; }
        .db-row.is-flash > td { background: #fef3c7 !important; transition: background 800ms; }
        /* Active-filter chip row above the database table */
        .istp-active-filters { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.6rem 0; }
        .istp-active-filter-chip { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.25rem 0.55rem 0.25rem 0.75rem; background: #1a1a1a; color: #fff; border-radius: 999px; font-size: 12px; }
        .istp-active-filter-chip button { background: transparent; border: 0; color: #fff; cursor: pointer; padding: 0; line-height: 1; font-size: 14px; }
        /* Map filter chips - country / capacity / year selectors above the ISTP map */
        .istp-mf-chip { display: inline-block; padding: 0.22rem 0.65rem; background: #fff; color: var(--text-dark-secondary); border: 1px solid var(--border-soft); border-radius: 999px; font: inherit; font-size: 11.5px; cursor: pointer; transition: background 0.12s, color 0.12s, border-color 0.12s; }
        .istp-mf-chip:hover { background: #fbf6ef; border-color: #c4a572; color: var(--text-dark); }
        .istp-mf-chip.is-active { background: var(--bg-warm-dark, #c4a572); color: #fff; border-color: var(--bg-warm-dark, #c4a572); font-weight: 600; }
        /* Shared breakdown popup for the four insight charts */
        .istp-insight-popup {
            position: fixed;
            display: none;
            z-index: 100;
            background: #fff;
            border: 1px solid var(--border-soft);
            border-radius: 8px;
            box-shadow: 0 8px 28px rgba(0,0,0,0.14);
            padding: 0.85rem 1rem 0.9rem;
            min-width: 260px;
            max-width: 360px;
            font-size: 12.5px;
        }
        .istp-insight-popup .ip-title { font-size: 13.5px; font-weight: 600; color: var(--text-dark); margin-bottom: 0.15rem; }
        .istp-insight-popup .ip-sub   { font-size: 11.5px; color: var(--text-dark-tertiary); margin-bottom: 0.55rem; }
        .istp-insight-popup .ip-list  { display: flex; flex-direction: column; gap: 0.05rem; max-height: 320px; overflow-y: auto; }
        .istp-insight-popup .ip-link  {
            display: flex;
            justify-content: space-between;
            gap: 0.7rem;
            padding: 0.35rem 0.3rem;
            border-radius: 4px;
            text-decoration: none;
            color: var(--text-dark);
            font-size: 12.5px;
            border-bottom: 1px dashed var(--border-soft);
        }
        .istp-insight-popup .ip-link:last-child { border-bottom: none; }
        .istp-insight-popup .ip-link:hover { background: var(--bg-sidebar); color: var(--bg-warm-dark); }
        .istp-insight-popup .ip-val   { color: var(--text-dark-secondary); white-space: nowrap; font-feature-settings: "tnum"; }
        .istp-insight-popup .ip-foot  { font-size: 11px; color: var(--text-dark-tertiary); margin-top: 0.5rem; padding-top: 0.45rem; border-top: 1px solid var(--border-soft); }
        .istp-insight-popup .ip-link-l { display: flex; flex-direction: column; gap: 0.05rem; min-width: 0; flex: 1; }
        .istp-insight-popup .ip-link-name { font-size: 12.5px; color: var(--text-dark); }
        .istp-insight-popup .ip-yrs    { font-size: 10.5px; color: var(--text-dark-tertiary); font-feature-settings: "tnum"; }
        /* Dates popup (chart 5) */
        .istp-insight-popup .ip-dates { margin: 0.4rem 0 0.45rem; }
        .istp-insight-popup .ip-dates > div {
            display: flex; justify-content: space-between; gap: 0.7rem;
            padding: 0.32rem 0;
            border-bottom: 1px dashed var(--border-soft);
        }
        .istp-insight-popup .ip-dates > div:last-child { border-bottom: none; }
        .istp-insight-popup .ip-date-k { font-size: 10.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-dark-tertiary); }
        .istp-insight-popup .ip-date-v { font-size: 12.5px; color: var(--text-dark); font-feature-settings: "tnum"; }
        /* Equity popup rows + bidder-funnel popup sections */
        .istp-insight-popup .ip-rows { gap: 0.1rem; }
        .istp-insight-popup .ip-row {
            display: flex; justify-content: space-between; align-items: center; gap: 0.7rem;
            padding: 0.32rem 0.3rem;
            border-bottom: 1px dashed var(--border-soft);
        }
        .istp-insight-popup .ip-row:last-child { border-bottom: none; }
        .istp-insight-popup .ip-row-l { display: inline-flex; align-items: center; min-width: 0; flex: 1; }
        .istp-insight-popup .ip-row-name { font-size: 12.5px; color: var(--text-dark); }
        .istp-insight-popup .ip-extras { margin-top: 0.5rem; padding-top: 0.45rem; border-top: 1px dashed var(--border-soft); display: flex; flex-direction: column; gap: 0.25rem; }
        .istp-insight-popup .ip-meta { display: flex; justify-content: space-between; gap: 0.7rem; font-size: 11.5px; }
        .istp-insight-popup .ip-meta-k { color: var(--text-dark-tertiary); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; font-size: 10.5px; }
        .istp-insight-popup .ip-meta-v { color: var(--text-dark); text-align: right; }
        .istp-insight-popup .ip-foot .ip-link {
            display: inline-flex; justify-content: flex-start; padding: 0; border: none;
            color: var(--bg-warm-dark); font-weight: 600;
        }
        .istp-insight-popup .ip-foot .ip-link:hover { background: transparent; text-decoration: underline; }
        .istp-insight-popup .ip-sec { margin-top: 0.55rem; }
        .istp-insight-popup .ip-sec-h {
            font-size: 10.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
            color: var(--text-dark-tertiary); margin-bottom: 0.3rem;
        }
        .istp-insight-popup .ip-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.3rem; }
        .istp-insight-popup .ip-chip {
            display: inline-block; padding: 0.18rem 0.5rem; border-radius: 999px;
            background: var(--bg-sidebar); color: var(--text-dark); font-size: 11.5px;
        }
        .istp-insight-popup .ip-chip-na { background: transparent; color: var(--text-dark-tertiary); font-style: italic; padding-left: 0; }
        .istp-insight-popup .ip-bids { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.1rem; }
        .istp-insight-popup .ip-bid {
            display: flex; align-items: baseline; gap: 0.4rem;
            padding: 0.26rem 0.3rem; font-size: 12px;
            border-bottom: 1px dashed var(--border-soft);
        }
        .istp-insight-popup .ip-bid:last-child { border-bottom: none; }
        .istp-insight-popup .ip-bid-win { background: rgba(46, 180, 143, 0.08); border-radius: 4px; }
        .istp-insight-popup .ip-bid-tick { color: #2EB48F; font-weight: 700; font-size: 12.5px; }
        .istp-insight-popup .ip-bid-dot { color: var(--text-dark-tertiary); font-weight: 600; }
        .istp-insight-popup .ip-bid-name { color: var(--text-dark); flex: 1; min-width: 0; }
        .istp-insight-popup .ip-bid-win .ip-bid-name { font-weight: 600; }
        .istp-insight-popup .ip-bid-tariff { color: var(--text-dark-secondary); font-feature-settings: "tnum"; white-space: nowrap; font-size: 11.5px; }
        .istp-insight-popup .ip-bid-note { color: var(--text-dark-tertiary); font-style: italic; font-size: 11px; }
        /* Hover state on the clickable equity rows + bidder-funnel groups */
        svg .istp-equity-row:hover .istp-equity-hit { fill: rgba(26,26,26,0.04); }
        svg .istp-funnel-group:hover .istp-funnel-hit { fill: rgba(26,26,26,0.04); }
        /* Row click affordance + expand chevron */
        .db-row { cursor: pointer; }
        .db-col-chevron { padding-right: 0 !important; padding-left: 0.75rem !important; vertical-align: middle !important; }
        .db-chevron {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 22px; height: 22px;
            background: none;
            border: none;
            color: var(--text-dark-tertiary);
            cursor: pointer;
            padding: 0;
            transition: transform 180ms ease, color 180ms ease;
        }
        .db-chevron:hover { color: var(--text-dark); }
        .db-row.is-expanded .db-chevron { transform: rotate(90deg); color: var(--text-dark); }
        .db-row.is-expanded { background: var(--bg-sidebar); }
        .db-row.is-expanded td { border-bottom-color: transparent; }

        /* Expanded detail row */
        .db-row-detail td { padding: 0 !important; background: #fcfbf7; border-bottom: 1px solid var(--border-soft); }
        .db-detail-panel { padding: 1.1rem 1.4rem 1.3rem; }
        .db-detail-head {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 0.75rem;
            margin-bottom: 0.9rem;
            padding-bottom: 0.55rem;
            border-bottom: 1px dashed var(--border-soft);
            font-size: 11px;
            font-weight: 600;
            letter-spacing: 0.12em;
            text-transform: uppercase;
            color: var(--text-dark-tertiary);
        }
        .db-detail-dl {
            display: inline-flex;
            align-items: center;
            gap: 0.4rem;
            padding: 0.4rem 0.8rem;
            background: #fff;
            border: 1px solid var(--border-soft);
            border-radius: 5px;
            font-family: inherit;
            font-size: 11.5px;
            font-weight: 500;
            color: var(--text-dark);
            cursor: pointer;
            text-transform: none;
            letter-spacing: 0;
        }
        .db-detail-dl:hover { background: var(--bg-sidebar); }

        .db-detail-group { margin-bottom: 1.1rem; }
        .db-detail-group:last-child { margin-bottom: 0; }
        .db-detail-group-heading {
            font-size: 10.5px;
            font-weight: 600;
            letter-spacing: 0.12em;
            text-transform: uppercase;
            color: var(--text-dark-tertiary);
            margin-bottom: 0.45rem;
        }
        .db-detail-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
            gap: 0.55rem 1.5rem;
            margin: 0;
        }
        .db-detail-cell { margin: 0; }
        .db-detail-cell.is-full { grid-column: 1 / -1; }
        .db-detail-cell dt {
            font-size: 10px;
            font-weight: 600;
            letter-spacing: 0.08em;
            text-transform: uppercase;
            color: var(--text-dark-tertiary);
            margin-bottom: 0.12rem;
        }
        .db-detail-cell dd {
            margin: 0;
            font-size: 13px;
            color: var(--text-dark);
            line-height: 1.45;
        }
        .db-detail-prose {
            font-size: 13px;
            color: var(--text-dark);
            line-height: 1.55;
            white-space: pre-wrap;
        }
        .db-detail-source {
            display: block;
            font-size: 12px;
            color: var(--text-dark);
            text-decoration: none;
            padding: 0.2rem 0;
            border-bottom: 1px dashed var(--border-soft);
        }
        .db-detail-source:hover { color: var(--bg-warm-dark); }
        .db-detail-source:last-child { border-bottom: none; }
        .db-detail-sources { background: #fff; border: 1px solid var(--border-soft); border-radius: 6px; padding: 0.45rem 0.75rem; }
        .db-detail-verified { font-size: 11px; color: var(--text-dark-tertiary); margin-top: 0.45rem; font-style: italic; }
