/* ── Body & topbar ──────────────────────────────────────────────────────────── */

.dash-body {
    overflow: auto;
    height: auto;
    min-height: 100vh;
    background: var(--bg);
    /* Same thin, light-gray scrollbar convention used app-wide — this is
       the main page scroll for every dashboard that shares this shell. */
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}
.dash-body::-webkit-scrollbar { width: 8px; }
.dash-body::-webkit-scrollbar-track { background: transparent; }
.dash-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
.dash-body::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

.dash-topbar {
    position: sticky;
    top: 0;
    z-index: 50;
}

/* ── Nav tabs — switches between the analytics suite's screens. Only Overview
   Analytics exists today; the other 4 are disabled placeholders (opacity +
   no pointer) until those pages ship. Reuses the same pill/segmented-control
   visual language as .date-pill/.gran-btn on purpose, instead of inventing a
   new nav-specific style. ────────────────────────────────────────────────── */

.dash-nav-tabs {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 24px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 52px;
    z-index: 45;
}

.nav-tab {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}

.nav-tab:not(.nav-tab-soon):hover {
    background: var(--surface-2);
    color: var(--text);
    cursor: pointer;
}

.nav-tab.active {
    background: var(--accent);
    color: var(--accent-text);
}

.nav-tab-soon {
    opacity: 0.4;
    cursor: default;
}

/* ── Filter bar ─────────────────────────────────────────────────────────────── */

/* One thin, single-line row: Period, Market, Filters button (+ its chips),
   Reset, Last Update — 5 blocks, each separated by a "|" (.filter-sep) with a
   fixed, equal margin on both sides (2026-07-26). The bar only grows taller
   if it truly runs out of horizontal room (flex-wrap), e.g. many chips
   active on a narrow window. */
.dash-filterbar {
    padding: 10px 24px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 97px;
    z-index: 40;
}

/* Centered as a group within the bar. Spacing between the 5 blocks is NOT
   handled here anymore (no gap/space-between) — it comes entirely from the
   fixed margin on .filter-sep below. justify-content:space-between was
   unreliable: it only guarantees equal gaps while all 9 items (5 blocks + 4
   separators) fit on one line; the moment flex-wrap broke them across two
   lines (which it did once total content width exceeded the container),
   each line's leftover space got distributed independently, so a block could
   end up with different-sized gaps on its left vs. right — the bug reported
   (Reset not centered between its two pipes). A fixed margin on every
   separator is symmetric by construction, regardless of viewport or wrapping. */
.dash-filterbar-inner {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

/* Each of the 5 top-level sections (Period / Market / Filters / Reset /
   Last Update) — keeps its own contents (label, pills, dropdown...) tight
   together; the spacing BETWEEN blocks comes from .filter-sep's margin,
   not from anything here. */
.dash-filter-block {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* Still used inside .filters-panel for the 8 secondary filters (label above
   field there) — not used by Period anymore, which is inline in the bar. */
.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dash-filter-label {
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
}

/* Period/From/To labels sitting inline next to controls in the thin bar —
   distinct from .dash-filter-label, which is sized for stacking above a
   field inside the panel, not for sitting beside a button. */
.dash-filter-label-inline {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

.filter-sep {
    width: 1px;
    height: 20px;
    background: var(--border);
    /* Fixed, equal on both sides — this (not the parent's gap/justify-content)
       is what guarantees every block sits centered between its two pipes. */
    margin: 0 16px;
    flex-shrink: 0;
}

.dash-last-update {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
}

/* ── Date pills ─────────────────────────────────────────────────────────────── */

.date-pills {
    display: flex;
    gap: 4px;
}

.date-pill {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0 12px;
    border-radius: 20px;
    /* Standardized with every other filter-bar control — .filters-btn,
       .dash-reset-btn, .ms-trigger, .ms-bulk-btn — all 10.5px/weight 600
       now (client feedback, 2026-07-31: "garantir que tudo esteja usando a
       mesma tipografia"). Was 12px/500. */
    font-size: 10.5px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    height: 28px;
    transition: all 0.15s;
    white-space: nowrap;
}

.date-pill:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.date-pill.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    font-weight: 700;
}

/* ── Custom date inputs ─────────────────────────────────────────────────────── */

.dash-filter-input {
    /* Without this, native <input type="date"> renders its calendar icon/popup
       in dark mode when the OS is set to dark, regardless of the page's own
       (light) theme — the visible symptom is a black box that doesn't match
       the rest of the (light) filter bar. */
    color-scheme: light;
    background: var(--bg);
    border: 1px solid var(--border);
    /* var(--text-soft), not var(--text) (2026-08-08, client's call:
       "as fontes dos filtros estejam sempre no mesmo tom de cor, que hoje
       é um cinza") — the labels ABOVE filter fields (.dash-filter-label/
       -inline) were already consistently var(--text-muted) gray, but the
       actual typed/selected text INSIDE a filter control (this class, plus
       .ms-search below) stayed at var(--text) (near-black), breaking that
       consistency. --text-soft matches .ms-item's already client-approved
       gray (see that rule's own comment) rather than introducing a 3rd
       gray tone. */
    color: var(--text-soft);
    padding: 0 10px;
    /* Same 28px height as .date-pill (the 7d/30d/90d/... row it sits next to),
       but that pill uses a fully-rounded 20px radius — this box's old 7px read
       as a mismatched, slightly-utilitarian rectangle dropped next to a row of
       pills. 14px (height/2) gets the same rounded-capsule family without
       literally becoming a pill, which would cramp the day/month/year text. */
    border-radius: 14px;
    font-size: 12.5px;
    font-family: var(--font);
    cursor: pointer;
    height: 28px;
    min-width: 130px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.dash-filter-input:hover { border-color: var(--text-muted); }

.dash-filter-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

/* Custom date inputs, smaller (2026-08-13, client's call: "o campo de data
   de custom que abre pode ser menor, mais reduzida") — scoped to
   .custom-date-wrap specifically, not the shared .dash-filter-input class
   itself, so this doesn't shrink the unrelated fields that also use that
   class elsewhere (e.g. IC Data Quality's search box, the Guanxi Meeting
   Minutes Form's own override 2 rules down in guanxi_meeting_minutes_form.css). */
.custom-date-wrap .dash-filter-input {
    height: 24px;
    min-width: 108px;
    font-size: 11px;
    padding: 0 8px;
    border-radius: 12px;
}

/* The calendar-icon button inside the input: browsers draw it as a plain,
   unstyled dark glyph by default, which stood out against every other icon
   in the filter bar (all custom SVGs matching the theme's muted-gray/accent
   palette). Chromium exposes just enough pseudo-elements to recolor it (via
   invert+opacity, since browsers refuse plain `color` on this control) and
   round its own hover state to match the input's capsule shape — the
   day-grid popup itself is native OS/browser UI with no CSS hook at all, so
   that part can't be restyled short of replacing this with a custom JS
   date-picker widget. */
.dash-filter-input::-webkit-calendar-picker-indicator {
    filter: invert(48%) sepia(1%) saturate(0%) hue-rotate(0deg) opacity(0.55);
    border-radius: 5px;
    padding: 3px;
    margin-right: -2px;
    cursor: pointer;
    transition: filter 0.15s, background 0.15s;
}

.dash-filter-input::-webkit-calendar-picker-indicator:hover {
    filter: invert(46%) sepia(89%) saturate(1053%) hue-rotate(342deg) brightness(101%) contrast(101%);
    background: var(--accent-dim);
}

.custom-date-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ── Filters button + active chips + collapsible panel ───────────────────────
   All 8 secondary filters (Market through Top Tier) live inside .filters-panel
   now, collapsed behind one button — the sticky bar only ever shows a chip
   per filter that's actually active, so it stays short no matter how many
   filter categories exist. Period stays outside, inline, since it's the one
   changed constantly and doesn't deserve the extra click. ──────────────────── */

.filters-wrap {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.filters-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0 12px;
    border-radius: 7px;
    font-size: 10.5px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    height: 28px;
    transition: all 0.15s;
}

.filters-btn:hover,
.filters-wrap.active .filters-btn {
    border-color: var(--accent);
    color: var(--accent);
}

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* When no filter is active, updateFilterChips() leaves this div with no
   children — but its parent (.dash-filter-block) still applies its own
   gap:10px between .filters-wrap and this div even with nothing visible
   inside it, silently pushing the "Filters" block's right edge (and the
   pipe right after it) further out than it should be. display:none removes
   it from the flex layout entirely so that extra gap disappears too. */
.filter-chips:empty {
    display: none;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--accent-dim);
    border: 1px solid var(--accent-border);
    color: var(--accent);
    padding: 4px 6px 4px 10px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    /* A selected value with a long name (a Press Cycle headline, easily
       100+ characters) used to stretch the chip — and the whole filter bar
       row along with it — to match; capped width + ellipsis on the text
       below keeps every chip the same size regardless of what's selected,
       full value still available via title on hover (client feedback,
       2026-07-31). */
    max-width: 240px;
}

.filter-chip-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.filter-chip button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 15px;
    height: 15px;
    border: none;
    background: transparent;
    color: inherit;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    border-radius: 50%;
    opacity: 0.75;
    flex-shrink: 0;
}

.filter-chip button:hover { opacity: 1; background: rgba(255, 95, 20, 0.18); }

/* Centered horizontally as a fixed overlay on the viewport, decoupled from
   #filters-wrap's own size/position (2026-07-31 — the first attempt
   anchored the panel to the RIGHT edge of #filters-wrap, but that box
   grows/wraps to a new line as chips accumulate inside it, dragging an
   anchor-relative panel along with it and eventually off the left edge of
   the viewport). Vertically, `top` is set inline by JS (toggleFiltersPanel)
   to sit just below the filter bar itself, not viewport-centered — client
   feedback, 2026-07-31: centered made it float far from the row of filters
   it belongs to; the value below is only a same-flash fallback for the
   instant before that JS runs. Still a DOM child of #filters-wrap —
   unaffected by `position:fixed`, and the existing click-outside-to-close
   check (`e.target.closest('.filters-wrap')`) still matches clicks inside.

   No max-height/overflow here on purpose (removed same day it was added) —
   a nested .ms-dropdown opening from one of the filter boxes inside is a
   DOM descendant of .filters-panel, and an ancestor with overflow:auto
   clips ITS descendants to that box regardless of their own position value
   (position:absolute doesn't escape an ancestor's overflow clip, only its
   normal-flow layout) — with overflow-y:auto here, an open dropdown that
   extended past the panel's own height was getting cut off mid-list,
   exactly the "list ficou cortada" the client reported. */
.filters-panel {
    display: none;
    position: fixed;
    top: 110px;
    left: 50%;
    transform: translateX(-50%);
    width: min(420px, calc(100vw - 32px));
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.45);
    padding: 16px;
    z-index: 200;
    /* 2 columns instead of 4 (client feedback, 2026-07-31: "muito
       horizontal... vamos deixar mais vertical") — same 8 filters now stack
       4 rows tall instead of 2 rows wide. */
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

/* Panel is `display:grid` while open, so this sits as its own grid item —
   `grid-column: 1 / -1` spans the full width instead of sharing a column
   with the first filter box. Client feedback, 2026-07-31: closing only via
   click-outside wasn't discoverable. */
.filters-panel-close {
    grid-column: 1 / -1;
    justify-self: end;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    line-height: 1;
    padding: 0 0 4px;
    margin-top: -8px;
    cursor: pointer;
    transition: color 0.15s;
}
.filters-panel-close:hover { color: var(--accent); }

.filters-panel.open { display: grid; }

/* Force every filter box to the same size regardless of its selected label's
   length ("All Detail Business" vs "All" are very different lengths) — grid
   already makes the columns equal-width, but a <button> can still grow past
   that under some UAs unless width is forced explicitly; the label itself
   truncates instead of stretching the box. */
.filters-panel .filter-group,
.filters-panel .ms-wrap { width: 100%; }

.filters-panel .ms-trigger {
    width: 100%;
    box-sizing: border-box;
}

.filters-panel .ms-trigger span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

@media (max-width: 480px) {
    .filters-panel { grid-template-columns: 1fr; }
}

/* ── Multi-select dropdowns ─────────────────────────────────────────────────── */

.ms-wrap {
    position: relative;
}

.ms-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0 10px;
    border-radius: 7px;
    /* Standardized to match .ms-bulk-btn's "Select all"/"Clear" size (client
       feedback, 2026-07-31: "padronizar tudo igual ao tamanho desses dois
       textos") — was 12.5px, noticeably bigger than every other filter text. */
    font-size: 10.5px;
    font-family: var(--font);
    cursor: pointer;
    height: 28px;
    min-width: 130px;
    transition: all 0.15s;
    white-space: nowrap;
    justify-content: space-between;
}

.ms-trigger:hover,
.ms-wrap.active .ms-trigger {
    border-color: var(--accent);
    color: var(--text);
}

.ms-wrap.has-selection .ms-trigger {
    border-color: var(--accent);
    color: var(--accent);
    font-weight: 600;
}

.ms-dropdown {
    display: none;
    flex-direction: column;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 190px;
    max-height: 280px;
    /* Fallback scroll for dropdowns whose items are inserted directly here
       instead of inside a nested .ms-items (e.g. #brand-trend-dd) — without
       this, a long list simply overflows past max-height and spills below
       the box unclipped instead of scrolling inside it. */
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.35);
    z-index: 100;
    padding: 4px;
    /* Same thin, subtle scrollbar as .press-cycles-list — was left on the OS
       default here, standing out against every other scrollable list in the
       app (client feedback, 2026-07-31). */
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}
.ms-dropdown::-webkit-scrollbar { width: 6px; }
.ms-dropdown::-webkit-scrollbar-track { background: transparent; }
.ms-dropdown::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
.ms-dropdown::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

.ms-dropdown.open { display: flex; }

/* "Select all"/"Clear" apply to whatever's currently rendered in .ms-items
   below — i.e. the search-filtered subset when a query is active, or every
   option when it isn't (msSelectAllVisible/msClearVisible read the live
   checkbox DOM, never a separately-tracked list, so they can't drift out of
   sync with what the search box is showing). Kept deliberately plain-text,
   same visual weight as .dash-card-link, so two buttons don't add visual
   noise to an already-small dropdown. */
.ms-bulk-row {
    display: flex;
    gap: 12px;
    padding: 2px 8px 6px;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.ms-bulk-btn {
    background: none;
    border: none;
    padding: 0;
    font-family: var(--font);
    font-size: 10.5px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.15s;
}
.ms-bulk-btn:hover { color: var(--accent); }

/* Search box stays fixed at the top of the dropdown; only .ms-items scrolls
   below it — otherwise typing would scroll the input itself out of view. */
.ms-search {
    width: 100%;
    box-sizing: border-box;
    flex-shrink: 0;
    margin-bottom: 4px;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 5px;
    font-size: 10.5px;
    background: var(--surface);
    /* var(--text-soft), not var(--text) — same standardization pass as
       .dash-filter-input above (2026-08-08, "as fontes dos filtros
       estejam sempre no mesmo tom de cor"), matching .ms-item's own
       already-approved gray for the SAME reason: this box is used both as
       a dropdown-filter search AND, on several screens, as the primary
       stakeholder/name search field (e.g. #gx-search-input), so its typed
       text should read the same as every other filter's typed text. */
    color: var(--text-soft);
}

.ms-search:focus { outline: none; border-color: var(--accent); }

/* Explicit, not left to the browser's UA-stylesheet default — placeholder
   text doesn't automatically inherit the input's own `color`, so without
   this "Search..." was rendering in whatever gray the browser picks on its
   own instead of matching the rest of the filter typography (client
   feedback, 2026-07-31: "o texto Search... parece diferente"). */
.ms-search::placeholder {
    color: var(--text-muted);
    font-family: var(--font);
    font-size: 10.5px;
}

/* ── Generic "×" clear button for a free-text search/filter field
   (2026-08-08, client's call: "vamos adicionar um x para excluir o nome do
   stakeholder... podemos adicionar isso em todos os campos dentro do
   sistema") — a light-theme sibling of guanxi_relationship_map.css's own
   .rm-search-clear, which stays as-is since it's deliberately styled
   white-on-orange for that page's sidebar. Every OTHER search/filter field
   in the app sits on a light surface, so this one shared component covers
   all of them instead of a bespoke copy per screen. Sits inside whatever
   already-`position:relative` wrapper the input has (.ms-wrap already is,
   see above) — a field with no such wrapper needs one added (a plain
   `position:relative` div is enough, no dedicated class required). The
   input itself needs its own `padding-right` bumped so typed text never
   sits underneath the button — that's scoped per-field via
   .dash-search-clearable rather than changed on .ms-search/.dash-filter-
   input globally, since most .ms-search boxes (the ones that just filter
   an already-open dropdown's own option list) don't get a clear button at
   all — only the persistent name/query search fields do. */
.dash-search-clearable { padding-right: 26px !important; }

/* Wrapper for a bare .dash-filter-input search box that has no .ms-wrap of
   its own to anchor the "×" button against (e.g. #ges-search, #dq-search —
   neither is part of a dropdown, just a standalone text field). */
.dash-search-wrap { position: relative; }

.dash-search-clear-btn {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    border-radius: 50%;
    padding: 0;
}
.dash-search-clear-btn:hover { color: var(--text); background: var(--surface-2); }

.ms-items {
    overflow-y: auto;
    max-height: 240px;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}
.ms-items::-webkit-scrollbar { width: 6px; }
.ms-items::-webkit-scrollbar-track { background: transparent; }
.ms-items::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
.ms-items::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

.ms-empty {
    padding: 10px;
    font-size: 10.5px;
    color: var(--text-muted);
    text-align: center;
}

.ms-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 10.5px;
    /* var(--text) (#111111) reads noticeably darker/heavier than every other
       filter/table text on the app's white cards (--surface: #ffffff) — a
       2026-07-31 attempt at "brighter is more readable" got the direction
       backwards for a light theme. var(--text-soft) (#666666) is the actual
       established standard here, matching .dash-table cell text — reverted
       same day after client feedback ("letras mais escuras que o padrão"). */
    color: var(--text-soft);
    transition: background 0.1s;
    user-select: none;
}

.ms-item:hover { background: var(--accent-dim); }

.ms-item input[type=checkbox] {
    accent-color: var(--accent);
    width: 13px;
    height: 13px;
    cursor: pointer;
    flex-shrink: 0;
}

/* ── Action buttons ─────────────────────────────────────────────────────────── */

.dash-reset-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0 12px;
    border-radius: 7px;
    font-size: 10.5px;
    font-weight: 600;
    cursor: pointer;
    height: 28px;
    font-family: var(--font);
    transition: all 0.15s;
}

.dash-reset-btn:hover {
    border-color: var(--text-muted);
    color: var(--text-soft);
}

.dash-cache-info {
    font-size: 11px;
    color: var(--text-muted);
    height: 28px;
    display: flex;
    align-items: center;
    padding-left: 2px;
}

/* ── Content wrapper ────────────────────────────────────────────────────────── */

.dash-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px 24px 64px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ── Loading ────────────────────────────────────────────────────────────────── */

.dash-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 80px 24px;
}

.dash-loading-text {
    font-size: 13px;
    color: var(--text-muted);
}

/* "Drawing itself in" DiDi logo spinner for the page-load state (2026-09-16,
   client: "vamos adicionar aquela ideia do loading data com o icone laranja
   ... também nas telas dos projetos de comms") — same technique already used
   across all 8 Guanxi screens (each with its own duplicated copy of this,
   since those pages share no CSS module between them, see e.g.
   guanxi_meeting_minutes_form.css's own comment for the "why" of the
   mechanism). Ported here ONCE instead, since every comms_* screen already
   shares this one file — 2 stacked copies of the same logo (a faint
   always-visible one underneath, a full-color one on top revealed by a
   conic-gradient sweep) replace the classic 3-dot .loading-dots (style.css)
   markup inside each screen's own #dash-loading div; .loading-dots itself is
   untouched, still used elsewhere (AI Analysis "Generating..." indicators,
   the chat "thinking" state, PDF export progress) — this is only about the
   page's own top-level "Loading data..." state. Scoped via a class
   (.dash-loading-brandmark) added alongside .dash-loading rather than
   changed in place there, since .dash-loading/#dash-loading were also used
   as-is by admin_usage.html/ic_overview.html at the time (same shared file,
   but outside the Comms project this request was scoped to that day).

   Reforço — closed that gap, every remaining classic spinner replaced
   (2026-10-02, client's ask: "vamos verificar todas as telas... que o
   loading data ainda não é aquele padrão... e vamos adicionar"). Audited
   every one of the app's 36 HTML templates: admin_usage.html/ic_overview.html
   were the ONLY two still on the classic 3-dot spinner for a genuine
   top-level page-load gate — both now use .dash-loading-brandmark too, same
   markup as every other comms_* / guanxi_* screen. The other ~12 tool-style
   screens (admin_users, comms_ai_writing_wizard, comms_media_elite_form,
   comms_news_extractor, comms_report_builder, ic_calendar, ic_data_quality,
   ic_dchat, ic_dhub, ic_efforts, ic_events) were checked too and found to
   have NO top-level loading gate at all — they render their shell
   immediately and show small inline "Loading..." text in individual table
   rows/sub-labels while data streams in, a deliberately lighter pattern
   (consistent with their established "editing tool, not dashboard" design,
   see e.g. D-Chat/D-Hub Matching's own CLAUDE.md history) — left untouched
   on purpose, that's a different, bigger redesign than "swap the spinner"
   if ever wanted. */
.dash-loading-brandmark { gap: 6px; }

@property --dash-loading-sweep {
    syntax: '<angle>';
    inherits: false;
    initial-value: 0deg;
}
.dash-loading-spinner-wrap {
    position: relative;
    width: 96px;
    height: 96px;
}
.dash-loading-spinner-bg,
.dash-loading-spinner-fg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.dash-loading-spinner-bg { opacity: 0.16; }
.dash-loading-spinner-fg {
    -webkit-mask-image: conic-gradient(from 0deg, #000 var(--dash-loading-sweep), transparent var(--dash-loading-sweep));
            mask-image: conic-gradient(from 0deg, #000 var(--dash-loading-sweep), transparent var(--dash-loading-sweep));
    animation: dash-loading-sweep 1.3s linear infinite;
}
@keyframes dash-loading-sweep {
    to { --dash-loading-sweep: 360deg; }
}

/* Click-to-filter affordance (2026-08-14) — shared by every chart result/list
   row wired to applyChartFilter() (Sentiment by Brand Type's DiDi row,
   Sentiment Brands, Stories by Business legend, Top Press Cycles). No
   background/padding tweak (would need per-element adjustment across very
   differently-shaped rows) — just cursor + a subtle dim on hover, cheap to
   apply uniformly regardless of the element's own box model. Chart.js canvas
   elements (Share of Voice/Leadership/Topics/Stories by Business/the world
   map) get their own cursor via onHover in the JS instead, since this class
   can't target something inside a <canvas>. */
.chart-filterable { cursor: pointer; }
.chart-filterable:hover { opacity: 0.82; }

/* ── KPI cards ──────────────────────────────────────────────────────────────── */

.dash-kpis {
    display: grid;
    /* 6 columns (was 5) since 2026-08-13's redesign added "Total Mentions" —
       see .dash-comp-row/.dash-brand-trend-row below for the matching
       6-column alignment update (.dash-trendiness-row, added 2026-08-20,
       deliberately doesn't align to these — see its own comment). */
    grid-template-columns: repeat(6, 1fr);
    gap: 14px;
}

@media (max-width: 1300px) {
    .dash-kpis { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
    .dash-kpis { grid-template-columns: repeat(2, 1fr); }
}

.kpi-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 22px 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
    overflow: hidden;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--border);
    border-radius: 99px 99px 0 0;
}

.kpi-accent::before { background: var(--accent); }
.kpi-green::before  { background: var(--green); }
.kpi-gray::before   { background: #9ca3af; }

.kpi-label {
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-top: 4px;
    line-height: 1.4;
    /* Fixed height regardless of 1 vs. 2 lines: some KPI labels are short
       plain text ("Total Meetings") while others are longer and/or carry an
       info-icon ("Registered Stakeholders with High Influence ?") and wrap
       onto a 2nd line at the same card width — without this, the card whose
       label wraps pushes its .kpi-value-row (the big number) down further
       than the cards next to it, so the numbers never line up across the
       row (confirmed on Guanxi Analytics: the "High Influence" card's value
       sat 14px lower than its 4 neighbors). Same fix pattern already used
       elsewhere for mismatched card headers (e.g. .dash-comp-row
       .dash-card-header). */
    min-height: 30px;
}

.kpi-value-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.kpi-value {
    font-size: 34px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.04em;
    line-height: 1.1;
}

.kpi-accent .kpi-value { color: var(--accent); }
.kpi-green  .kpi-value { color: var(--green); }
.kpi-gray   .kpi-value { color: #9ca3af; }

/* cursor:pointer (2026-09-24) - the badge itself carries its own explainer
   `title` now, no more separate .info-icon next to it (client's ask:
   "vamos remover esses ? que estão sendo mostrados ao lado desses números
   menores... mostrar sempre que o mouse for passado em cima desse número
   menor") - a hand cursor is the only affordance left hinting there's more
   info on hover/click, now that the "?" circle itself is gone. Shared by
   every comms_* page that imports this stylesheet as its shell (Score,
   Digital Measurement, Media Elite), not just Comms Analytics - see
   varBadge()'s own comment in each of those .js files. */
.var-badge {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.01em;
    line-height: 1.4;
    cursor: pointer;
}

.var-badge.up   { background: rgba(52,143,112,0.18); color: #4aca9a; }
.var-badge.down { background: rgba(239,68,68,0.14);  color: #f87171; }

/* Small help icon — used next to variation badges ("vs. previous period")
   and next to the Leadership label (formula explanation). Shows a JS-driven
   popover on hover AND on click/tap (see .help-popover + initHelpPopovers()
   in comms_analytics.js) — native `title` alone only ever fired on hover. A
   bordered circle reads more clearly as "interact with me" than a bare glyph. */
.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    margin-left: 4px;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    border: 1.5px solid var(--text-muted);
    border-radius: 50%;
    cursor: pointer;
}

/* Always-visible caveat marker (2026-08-20, client's ask: "algo mais visual
   além do '?' quando passa o mouse") - unlike .info-icon (a static,
   always-relevant explainer, only readable on hover/click), this only
   renders at all (`display:none` by default, toggled by JS) when something
   about the CURRENT filter selection makes the number next to it
   incomplete/partial - today only the 2 Media Score cards (the KPI + its
   Trendiness trend chart), whenever one of the 7 filters that endpoint
   can't honor is active. Visible without hovering by design; still shares
   .info-icon's click/hover popover (see the SELECTOR in initHelpPopovers()
   below) so the exact list of ignored filters is one click away. */
.warn-icon {
    display: inline-flex;
    align-items: center;
    margin-left: 4px;
    font-size: 13px;
    color: #ffbc00;
    cursor: pointer;
    line-height: 1;
}

/* "Showing X of Y brands" marker under a Brand Battle card's title (2026-11-04,
   client's ask: the icon was too cramped inside the title row, next to the ?
   and the card's controls). Sits right below the header: the negative top
   margin cancels most of the card's 16px flex gap so it reads as part of the
   title block instead of floating above the chart. Hidden (display:none, set
   by JS) unless fewer brands are selected than exist in the data. */
.bb-subset-note {
    align-self: flex-start;
    margin: -10px 0 0 0;
    font-size: 11px;
    font-weight: 500;
}

/* SoV Over Time / Leadership Over Time (.dash-brand-trend-row): their headers have
   a FIXED 64px height (so the two charts line up, see above), so a note placed
   below the header would float ~40px under the title. Here the note lives INSIDE
   the header, stacked right under the title, and drops the negative margin that
   only makes sense below a natural-height header. */
.bb-title-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    min-width: 0;
}
.bb-title-stack .bb-subset-note {
    margin: 0;
}

/* Force the "vs. previous period" badge onto its own line, deterministically,
   for every KPI card in Main Indicators (2026-09-24, client's ask: "ajustar
   a posição dos dados de didi media score" - side by side with DiDi
   Incidents, whose badge wraps below the value, Media Score's badge sat
   INLINE right next to it instead - only because "37.22" happens to be
   short enough to fit on the same line inside .kpi-value-row's flex-wrap,
   while "12.95%" doesn't. Checking the rest of the row while fixing this
   turned up the SAME thing on "DiDi SoV" ("22.81%" + "3.01pp" also still
   fit on one line) - every card here only looked consistent by accident of
   how many digits its own value has, and would flip in/out of sync with its
   neighbors the moment any of the numbers' length changed with the filters.
   flex-basis:100% on the badge (always the 2nd/last child of
   .kpi-value-row) forces it to always start a new line - scoped to
   #dash-kpis (Main Indicators' own 6-card row) rather than every
   .kpi-value-row in the app, since that class is shared much more broadly
   and this fix was never reviewed against every other place it's used. */
#dash-kpis .kpi-value-row > span:last-child { flex-basis: 100%; }

.kpi-sub {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 2px;
}

.sentiment-bar {
    display: flex;
    height: 6px;
    border-radius: 99px;
    overflow: hidden;
    margin-top: 10px;
}

.sentiment-bar .s-pos { background: #348f70; }
.sentiment-bar .s-neu { background: #ffbc00; }
.sentiment-bar .s-neg { background: #ef4444; }
.sentiment-bar .s-unc { background: #3a3a3a; }

/* Divider gap between segments, but NEVER before the tail (2026-09-16,
   client screenshot: "porque o fim dessas barras estão assim?" — a small
   light/rounded notch right at the bar's rounded tip). Root cause: the old
   flex `gap:2px` on .sentiment-bar sat between EVERY pair of segments,
   .s-neg/.s-unc included — s-unc (the "not classified" remainder) is
   real data, but very often a sliver of a percent wide, sometimes visually
   near-invisible on its own. With the container's overflow:hidden clipping
   to its own border-radius:99px pill shape, a 2px gap landing right at that
   rounded tip (in front of a segment too thin to visually register) reads
   as a bright, distinctly circular notch cut out of the rounded end — not
   noticeable in the flat middle of the bar, where the same 2px gap is just
   a subtle straight divider line between 2 substantial color blocks.
   margin-right (not the container's own gap) on pos/neu ONLY keeps that
   subtle divider between the 3 real sentiment colors, while neg -> unc (or
   neg -> the bar's own true edge, when unc doesn't render at all) never
   gets one — eliminating the notch regardless of how thin the tail segment
   is. */
.sentiment-bar .s-pos,
.sentiment-bar .s-neu {
    margin-right: 2px;
}

/* Sentiment card tooltip (2026-08-27, client's ask: "mesmo padrão que o
   gráfico Leadership") — Leadership is a real Chart.js bar, so its tooltip
   is Chart.js's own default canvas-drawn one (dark box, bold title line,
   one row per value with a small colored square swatch) for free. The
   Sentiment card's mini bars (.mb-hover-tip / .mini-sentiment-bar) aren't a
   canvas at all — plain HTML/CSS divs with a native `title=` tooltip — so
   matching Leadership's LOOK here means recreating it by hand: same dark
   background/rounded corners, same title line, same swatch-per-row layout,
   applied via initMiniBarTooltips() in comms_analytics.js instead of the
   native title attribute. Reuses .help-popover's position:fixed/z-index
   convention, but its own dark palette (Chart.js's own tooltip defaults —
   rgba(0,0,0,0.8) background, white text — not this app's light .help-popover). */
.mb-tooltip {
    position: fixed;
    z-index: 10000;
    display: none;
    /* Explicit shrink-to-fit width — without this, a `position:fixed` block
       box with no `left`/`top` assigned YET (true on this element's very
       first-ever show(), before position() has run once) falls back to
       being sized like its static in-flow position — full viewport width,
       for a bare <div> appended straight to <body> — instead of hugging its
       own content. Confirmed live: without this line the tooltip rendered
       at 1280px wide (this page's own viewport width) on first hover. */
    width: max-content;
    background: rgba(0, 0, 0, 0.82);
    color: #fff;
    border-radius: 6px;
    padding: 6px 9px;
    font-size: 12px;
    line-height: 1.5;
    pointer-events: none;
    white-space: nowrap;
}

.mb-tooltip-title {
    font-weight: 700;
    margin-bottom: 2px;
}

.mb-tooltip-text {
    max-width: 250px;
    white-space: normal;
    line-height: 1.4;
}

.mb-tooltip-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.mb-tooltip-swatch {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 2px;
    flex-shrink: 0;
}

/* ── Sentiment by Brand Type — 4 mini bars beside SoV/Leadership ─────────── */

.mini-sentiment-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 4px 2px;
}

.mini-sentiment-item { display: flex; flex-direction: column; }

/* "Sentiment Brands" (Brand Battle) can now hold as many brands as are
   checked in the shared SoV/Leadership Over Time selector (2026-08-13 —
   used to be a fixed top 4), so its list can grow past its 2 chart
   neighbors' height. Cap it at 240px (same as .dash-chart-wrap, its
   siblings' canvas height) with a thin, discreet scroll instead of growing
   the whole card/row taller — same scrollbar treatment already used by
   .press-cycles-list/.ms-items elsewhere in the app. Scoped to this card's
   own list id, not the shared .mini-sentiment-list (also used by "Sentiment
   by Brand Type", which only ever has 4 fixed categories and never needs
   this). */
#brand-sentiment-top-list {
    max-height: 240px;
    overflow-y: auto;
    padding-right: 8px;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}
#brand-sentiment-top-list::-webkit-scrollbar { width: 6px; }
#brand-sentiment-top-list::-webkit-scrollbar-track { background: transparent; }
#brand-sentiment-top-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
#brand-sentiment-top-list::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

.mini-sentiment-label {
    display: flex;
    align-items: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-soft);
    margin-bottom: 6px;
}

/* Color swatch on "Sentiment Brands" labels only (renderBrandSentimentTop) —
   ties each brand's mini-bar back to the same color used in the competitor
   charts, for quicker identification. */
.mini-sentiment-swatch {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    margin-right: 6px;
    flex-shrink: 0;
}

.mini-sentiment-bar { height: 9px; margin-top: 0; }

.mini-sentiment-pct {
    font-size: 10.5px;
    color: var(--text-muted);
    margin-top: 5px;
}

/* ── Cards ──────────────────────────────────────────────────────────────────── */

.dash-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
}

.dash-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-shrink: 0;
}

.dash-card-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* "SoV Over Time" header (Brand Battle section, 2026-08-13 feedback) — title
   + the brand dropdown + the Weekly/Monthly/Quarterly toggle all crammed
   into one of 3 equal-width columns was squeezing the title. Let the
   controls wrap onto their own line below the title instead of shrinking
   anything — title always stays on line 1 so it lines up with "Leadership
   Over Time"/"Sentiment Brands" next to it (those never wrap since their
   headers stay short); margin-left:auto keeps the controls right-aligned
   whether they end up sharing the line with the title or wrap to their own.
   Scoped by id (not the shared .dash-card-header/.dash-card-controls
   classes) so no other card anywhere in the app is affected. */
#sov-trend-card-header {
    flex-wrap: wrap;
}
#sov-trend-card-header .dash-card-controls {
    margin-left: auto;
}

/* SoV Over Time / Leadership Over Time / Sentiment Brands (Brand Battle
   section) — even with the wrap fix above, SoV's header can end up taller
   than its 2 siblings' single-line headers (title + brand dropdown +
   Weekly/Monthly/Quarterly wrapped to a 2nd line vs. just a title) — since
   each .dash-card is a flex column with the chart-wrap right after the
   header, a taller header alone pushes SoV's canvas down further than
   Leadership Over Time's, so the two charts stop lining up (client's call,
   2026-08-13: "acaba deslocando e nao fica alinhado"). Forcing all 3 headers
   in this row to the SAME fixed height (not just a floor) fixes it — 64px
   covers the worst case (title line ~18px + row-gap 10px + gran-toggle/
   ms-trigger row ~28px) with a little headroom.
   `align-items: flex-start` is the one that actually pins each header's
   own content to the TOP of that 64px box — align-content alone (kept
   below too, it still matters for SoV's 2 wrapped lines) has no effect on
   a single-line flex container, so without align-items the 2 single-line
   siblings kept vertically CENTERING their title inside the taller box
   while SoV's (wrapped, multi-line) header hugged the top — same fixed
   header height, but the titles themselves still sat at different y
   positions (bug found right after shipping the height fix, 2026-08-13). */
.dash-brand-trend-row .dash-card-header {
    height: 64px;
    align-items: flex-start;
    align-content: flex-start;
}

/* Share of Voice / Leadership / Sentiment (.dash-comp-row, Brand Battle) —
   same root cause as the fix right above, smaller scale: the 3 headers
   never wrap here (each fits on one line), but they still don't sit at the
   same natural height, because their right-side control varies: Share of
   Voice has a 3-pill All/Dedicated/Mentioned toggle (~26px tall) NEXT TO a
   20px chart-type icon button; Leadership has ONLY the 20px icon button;
   Sentiment has its own 2-pill By Type/By Brand toggle (~26px). With
   `align-items: center` (the shared .dash-card-header default), each
   title/button centers inside ITS OWN header's natural height — so Share
   of Voice's and Sentiment's headers land ~26px tall while Leadership's
   lands ~20px, and every title (plus the Share of Voice/Leadership icon
   buttons specifically, called out by the client) ends up sitting a few px
   off from its neighbors (client's ask, 2026-08-20: "os titulos... nao
   estao alinhados... os botoes... tambem nao estao alinhados entre si").
   Fixed height (28px, a couple px above the tallest of the 3 controls -
   the pill toggles - as headroom) + align-items: flex-start pins every
   title AND every control to the exact same top edge in all 3 cards,
   regardless of which control is taller. */
.dash-comp-row .dash-card-header {
    height: 28px;
    align-items: flex-start;
}

/* Share of Voice is the only one of the 3 that wraps its chart-type icon
   button together with another control (the All/Dedicated/Mentioned
   toggle) inside a shared .dash-card-controls group — that group's own
   `align-items: center` (the shared default) would center the shorter
   20px icon button against the taller 26px toggle INSIDE the group, i.e.
   ~3px down from the group's own top edge. Leadership's icon button has no
   such wrapper (sits directly in the header, flush with the fixed
   flex-start above) - flex-start here too keeps Share of Voice's icon
   button at that same y=0, so the 2 icon buttons land on the exact same
   row as each other, not just "close". */
.dash-comp-row .dash-card-controls {
    align-items: flex-start;
}

.dash-card-title {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
}

/* Highlights the word "DiDi" in orange wherever it appears inside a KPI
   label or chart title in the "Main Indicators" section (2026-08-13, client's
   call) — visually ties every DiDi-only number/chart back to the brand,
   consistent with those same cards/KPIs already being colored orange
   (.kpi-accent). Inherits size/weight from whatever it's nested in (KPI
   label or card title), only the color changes. */
.title-didi {
    color: var(--accent);
}

.dash-card-title-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

/* ── Help popover — click/hover box for .info-icon (and the chart x-axis'
   own partial-period tick, see attachPartialAxisPopover() in the JS file) ──
   Native `title` only ever showed on hover, never on click/tap (reported bug,
   2026-08-12). Appended straight to <body> and positioned `fixed` from the
   anchor's own getBoundingClientRect()/pixel position (same principle as the
   jsVectorMap tooltip and the Guanxi sidebar dropdown reposition) so it can
   never be clipped by a card's overflow or lose to another element's
   z-index — see initHelpPopovers()/attachPartialAxisPopover() in
   comms_analytics.js for the show/hide/position logic.

   (A dedicated ⚠ icon in the card header + a caption below the chart were
   both tried for the partial-period signal and dropped, 2026-08-12 round 2 —
   client's call: the bold/amber axis tick from partialTickStyle() is signal
   enough on its own, and hovering/clicking that tick now opens this same
   popover directly, so nothing else on the card needs to carry the message.) */
.help-popover {
    position: fixed;
    z-index: 10000;
    display: none;
    max-width: 280px;
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 11px;
    font-size: 11.5px;
    font-weight: 400;
    line-height: 1.45;
    white-space: normal;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
    pointer-events: none;
}

.help-popover::before,
.help-popover::after {
    content: '';
    position: absolute;
    left: var(--help-arrow-left, 16px);
    transform: translateX(-50%);
    border: 7px solid transparent;
}

.help-popover::before { top: 100%; border-top-color: var(--border); }
.help-popover::after   { top: calc(100% - 1px); border-width: 6px; border-top-color: var(--surface-2); }

.help-popover.help-popover-below::before {
    top: auto; bottom: 100%;
    border-top-color: transparent;
    border-bottom-color: var(--border);
}
.help-popover.help-popover-below::after {
    top: auto; bottom: calc(100% - 1px);
    border-top-color: transparent;
    border-bottom-color: var(--surface-2);
}

.dash-card-sub {
    font-size: 11px;
    color: var(--text-muted);
}

/* Bar/donut chart-type toggle (2026-08-12) — a single icon button, deliberately
   understated (no pill/border like .gran-toggle) since this is an optional
   presentation switch, not a real filter: the icon shown is always the type
   you'd switch TO, never the current one (same convention as a light/dark
   mode toggle). Reused wherever a chart in Comms has both a bar and a donut
   reading of the same data — see toggleBusinessMacroChartType() in
   comms_analytics.js and toggleMeChartType() in comms_media_elite.js. */
.chart-type-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    border: none;
    background: none;
    color: var(--text-muted);
    opacity: 0.55;
    cursor: pointer;
    flex-shrink: 0;
}
.chart-type-toggle:hover { opacity: 1; color: var(--accent); }
.chart-type-toggle svg { width: 14px; height: 14px; display: block; }

/* Wider slot for "Stories by Business" when shown as a donut — a circle
   squeezed into the bar's 96px-wide slot reads as a sliver, not a chart. */
.business-chart-wrap.is-donut { width: 140px; }

.dash-card-link {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font);
    padding: 0;
    transition: opacity 0.15s;
}
.dash-card-link:hover { opacity: 0.75; }

/* ── Card export (chart/visual data → .xlsx) ───────────────────────────────────
   A small corner badge, anchored INSIDE the card's own bottom-right corner,
   right at the border's edge — deliberately absolute rather than inline in
   .dash-card-header, since several headers already fill their right side
   with a gran-toggle/ms-wrap/"See all" control that this needs to stay clear
   of. Deliberately subtle (low opacity until hover) so a dashboard full of
   cards doesn't feel cluttered with new chrome. Popup opens upward from the
   icon (not downward) since the icon sits at the card's bottom edge. */
.dash-card-export {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0;
    cursor: pointer;
    opacity: 0.35;
    transition: opacity 0.15s, color 0.15s;
    z-index: 2;
}
.dash-card-export:hover { opacity: 1; color: var(--accent); }
.dash-card-export svg { width: 12px; height: 12px; }

.dash-card-export-menu {
    position: absolute;
    bottom: 32px;
    right: 4px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
    z-index: 5;
    overflow: hidden;
}

.dash-card-export-item {
    display: block;
    width: 100%;
    white-space: nowrap;
    background: none;
    border: none;
    color: var(--text);
    font-size: 12px;
    font-family: var(--font);
    padding: 8px 14px;
    cursor: pointer;
    text-align: left;
}
.dash-card-export-item:hover { background: var(--border); }
.dash-card-export-item:disabled { color: var(--text-muted); cursor: default; }

/* ── Chart wrappers ─────────────────────────────────────────────────────────── */

.dash-chart-wrap  { position: relative; height: 240px; }
.dash-chart-comp  { height: 260px; }
.dash-chart-topics { height: 400px; }

/* "Stories by Business" — narrow single-column 100%-stacked bar with the
   legend beside it (not below), since the axis labels are hidden and the
   card has no other use for the freed-up horizontal space. */
.business-chart-row {
    display: flex;
    align-items: stretch;
    gap: 18px;
    flex: 1;
}

.business-chart-wrap {
    flex: 0 0 auto;
    width: 96px;
}

/* Id-scoped (2026-08-20, client's ask) — only THIS instance of
   .business-chart-wrap (the "Stories by Business" card, now in its own row
   with the 2 Incidents cards, see .dash-incidents-row below), never Topics'
   own #topics-chart-wrap when it borrows the same class in 'stacked' mode.
   Shrunk from 260px to 190px in the 2nd round the same day (client's ask:
   "vamos encolher verticalmente esses dois gráficos" - this card had a lot
   of dead space below its narrow single bar once its neighbors stopped
   being the much-taller world map) — matched to the same ~190px target as
   #incidents-breakdown-list/#incidents-press-cycle-list below. */
#business-chart-wrap {
    height: 190px;
}

/* Custom legend for "Stories by Business" — replaces Chart.js's own legend,
   which wraps to multiple lines and grows the card taller than its neighbors.
   Stacked vertically beside the bar, vertically centered against it. */
.business-legend {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
    font-size: 11px;
    color: var(--text-soft);
    /* Safety net for Topics (up to 8 rows in the same 400px slot Business's
       fixed 4 categories never overflow) — thin scrollbar, harmless here
       since 4 items never trigger it. */
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}
.business-legend::-webkit-scrollbar { width: 6px; }
.business-legend::-webkit-scrollbar-track { background: transparent; }
.business-legend::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
.business-legend::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

.business-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.business-legend-swatch {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    flex-shrink: 0;
}

/* Topics' "stacked" mode (2026-08-19) — legend only shown in that mode (see
   toggleTopicsChartType), 'bar' mode has no use for it. */
.topics-legend.is-hidden { display: none; }
.topics-legend-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
/* 'bar' mode (default, .business-chart-wrap class absent — added by JS only
   in 'stacked' mode) — without an explicit flex-grow, a flex item's width:auto
   shrinks to fit its content instead of filling the row (classic flexbox
   gotcha), collapsing the canvas to 0px wide since #topics-legend is hidden
   and contributes no width to grow against. */
#topics-chart-wrap:not(.business-chart-wrap) { flex: 1 1 auto; width: auto; }

/* Topic Detail drill-in (2026-08-21) — the High Level Topics chart/legend
   swap in place to show one topic's own Topic Detail breakdown (see
   renderTopics()); while drilled in, the card's own title text becomes this
   "‹ Back to..." link instead of a separate arrow icon (client's ask). */
#topics-card-title-text.is-back-link {
    color: var(--accent);
    cursor: pointer;
}
#topics-card-title-text.is-back-link:hover { opacity: 0.75; }

/* ── World map ──────────────────────────────────────────────────────────────── */

/* Coverage by State (2026-08-27) — same "title itself is the back link"
   convention as #topics-card-title-text.is-back-link above, applied to the
   map card's own title when drilled into Brazil/Mexico. */
#map-card-title.is-back-link {
    color: var(--accent);
    cursor: pointer;
}
#map-card-title.is-back-link:hover { opacity: 0.75; }

/* "Unmapped" residual note under the Brazil/Mexico state map (2026-08-27) —
   never hidden silently, see resolveCityState()/computeStateBreakdown() in
   comms_analytics.js. Shared by both countries (renderCountryStateMap()). */
.dash-map-unmapped-note {
    margin-top: 8px;
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
}

/* #id selector needed to beat jsvectormap.min.css's same-specificity
   .jvm-container{height:100%} rule, which loads after this file. */
#world-map.dash-map-wrap {
    position: relative;
    /* 380px → 260px (2026-08-20, client's ask): this card's neighbors in the
       same row (Stories by Business, Top Outlets) were both much shorter, so
       the grid's default row-stretch left dead space in them. Matched to the
       same 260px target as #business-chart-wrap/#outlets-list below so the
       3 cards land close to the same height without relying on stretch to
       paper over the gap. */
    height: 260px;
}

/* jsVectorMap appends the tooltip directly to <body>, not inside .dash-map-wrap.
   z-index guards against the sticky filter bar / topbar stacking above it.
   Styled to match Chart.js's own native tooltip look (2026-08-27, "vamos
   padronizar todos os graficos de comms... devem ser todos igual o share of
   voice") — same semi-transparent dark/no-border/no-shadow values as
   .mb-tooltip and .chart-external-tooltip below, so every tooltip on this
   page reads as one consistent component regardless of which of the 3
   different rendering mechanisms actually draws it (jsVectorMap's own API
   here; Chart.js's native canvas tooltip for most charts; the HTML overlay
   below for the few whose canvas is too narrow for that). No color swatch
   here unlike the other two — this map's fill is a continuous SoV/Leadership
   gradient (visualizeData.scale), not a discrete per-category color the way
   a bar/donut/ranked-list item has, so a swatch wouldn't map to anything
   meaningful the way it does elsewhere. */
.jvm-tooltip {
    background: rgba(0, 0, 0, 0.82);
    /* Explicit light color, not var(--text) — that resolves to near-black (#111)
       in this app's light theme, invisible against the dark tooltip background. */
    color: #f5f5f5;
    font-family: var(--font);
    font-size: 12px;
    padding: 6px 9px;
    border-radius: 6px;
    z-index: 1000;
    /* jsvectormap.min.css ships its own box-shadow on .jvm-tooltip — never
       declared here before, so that library default kept showing through
       even after every OTHER property above started winning the specificity
       tie (this file loads after the library's, see the file-order gotcha
       documented near #world-map below). Explicit `none` is required to
       actually override it, not just omitting the property. */
    box-shadow: none;
}

/* External (HTML, not canvas-painted) Chart.js tooltip — for charts whose
   canvas is too narrow to contain a default on-canvas tooltip without
   clipping it (e.g. "Stories by Business", a 96px-wide column).
   position:fixed + JS-set left/top (see externalTooltipHandler in
   comms_analytics.js) means it's never bounded by the chart's own container.
   Client feedback, 2026-07-31: "as infos ficam cortadas". Styled to match
   Chart.js's own native tooltip look (2026-08-27, see .jvm-tooltip's own
   comment above for the full "why" — same standardization request) — same
   semi-transparent background/no-border/no-shadow as .mb-tooltip, plus the
   same swatch-per-row treatment (via externalTooltipHandler reading Chart.js's
   own tooltip.labelColors, not a hand-picked color) so it's indistinguishable
   from a chart that renders its tooltip on-canvas the normal way. */
.chart-external-tooltip {
    position: fixed;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.82);
    color: #f5f5f5;
    font-family: var(--font);
    font-size: 12px;
    padding: 6px 9px;
    border-radius: 6px;
    z-index: 1000;
    white-space: nowrap;
    line-height: 1.5;
    transform: translateY(-50%);
    transition: opacity 0.1s;
}

.chart-external-tooltip-title {
    font-weight: 700;
    margin-bottom: 2px;
}

.chart-external-tooltip-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.chart-external-tooltip-swatch {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 2px;
    flex-shrink: 0;
}

/* ── Granularity toggle ─────────────────────────────────────────────────────── */

.gran-toggle {
    display: flex;
    gap: 3px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 7px;
    padding: 3px;
    flex-shrink: 0;
}

.gran-btn {
    background: transparent;
    border: none;
    padding: 3px 10px;
    border-radius: 5px;
    font-size: 11.5px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    font-family: var(--font);
    transition: all 0.15s;
}

.gran-btn.active {
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* ── Section dividers — "Main Indicators" / "Brand Battle" / "Coverage
   Breakdown" / "Trendiness" / "All Articles". 2026-08-20: tried 2 louder
   treatments in a row (a filled accent-dim band, then a dashed outline
   wrapping each section) — client didn't like either ("os separadores...
   vamos voltar para o que era... algo mais sutil, sem esses tracejados").
   Back to the original 2026-08-13 style: small caps label + a thin bottom
   border, not a heavy heading. Reinforced same day: margin-top grew (more
   breathing room between sections, client's ask) and a 2nd row was added
   below the label — a short caption clarifying that the page's filters
   apply here too, plus whatever's special/already-default about this
   section (see .dash-section-caption below). AI Summary has no divider at
   all (just its own card, its own caption lives in the card's description
   text instead). */
.dash-section-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    /* 2026-08-21 — client asked to shrink this back down (the 56px above,
       on top of .dash-content's own 20px flex gap, read as too much empty
       space before a section title) — first pass landed on 24px, then
       asked for a bit less still. */
    margin-top: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.dash-section-title-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* Brand Battle/Coverage Breakdown/Trendiness's brand selector sits inside
   the uppercase/small-caps title row — reset the text styling that would
   otherwise cascade into it (would render "DiDi" as "DIDI", wrong tracking/
   weight for a normal control label). */
.dash-section-title-row .ms-wrap {
    text-transform: none;
    letter-spacing: normal;
    font-weight: 400;
}

/* Short explainer line under the title (2026-08-20) — always mentions that
   the page's filters apply, plus one thing worth flagging about this
   section's default scope (e.g. "the rest are DiDi only", "DiDi only by
   default"). Deliberately plain text, no uppercase/tracking — reads as a
   caption, not a second heading. */
.dash-section-caption {
    font-size: 11px;
    font-weight: 400;
    color: var(--text-muted);
    opacity: 0.8;
    text-align: center;
    max-width: 720px;
}

/* The one flagged detail (e.g. "DiDi only") gets the same orange used by
   the DiDi-exclusive KPIs/charts themselves — a visual echo, not just text,
   of "this bit is different from the rest of the section". */
.dash-section-caption .cap-accent {
    color: var(--accent);
    font-weight: 600;
    opacity: 1;
}

/* ── Rows ───────────────────────────────────────────────────────────────────── */

.dash-row { display: grid; gap: 14px; }

/* Same 6-column grid as .dash-kpis (repeat(6,1fr), same 14px gap, same
   .dash-content container) so cards genuinely line up pixel-for-pixel with
   the 6 KPI cards above — a manually-ratioed fr template looks close but
   isn't exact: with fewer gaps, each "fr" share ends up a few px wider than
   a real KPI column. Each of the 3 cards in every one of these rows spans 2
   of the 6 KPI columns — an even 2/2/2 split (was 2/2/1 over 5 columns
   before "Total Mentions" was added, 2026-08-13) — so no nth-child targeting
   is needed anymore, every .dash-card in these 3 rows gets the same span. */
.dash-comp-row { grid-template-columns: repeat(6, 1fr); }
.dash-comp-row .dash-card { grid-column: span 2; }

/* Widened to a plain 50/50 split (2026-08-19) — this row dropped from 3
   cards to 2 (SoV Over Time, Leadership Over Time) when "Sentiment Brands"
   merged into the Sentiment card up in .dash-comp-row, so it no longer needs
   to line up with the 6-column KPI grid the way .dash-comp-row's 3 cards
   still do. */
.dash-brand-trend-row { grid-template-columns: repeat(2, 1fr); }

/* Trendiness's 4 charts (SoV & Leadership Over Time, Stories by Sentiment,
   Top Tier % Over Time, Media Score Over Time — the last 2 added
   2026-08-20) — a plain 2-column grid, same as .dash-brand-trend-row; 4
   cards in 2 columns wrap into 2 rows automatically, no extra rows needed. */
.dash-trendiness-row {
    grid-template-columns: repeat(2, 1fr);
}

/* Orange top stripe on all 4 Trendiness chart cards (2026-08-13 origin,
   client's call: "igual temos nos big numbers de didi" — carried over from
   when the first 2 lived in Main Indicators). Same technique as
   .kpi-accent::before (a 3px bar along the card's top edge), just reused on
   a .dash-card. Needs its own overflow:hidden (the shared .dash-card rule
   doesn't set it) so the stripe's rounded top corners don't visibly poke
   past the card's own border-radius — safe here since none of the 4 cards
   has anything that needs to overflow its own bounds (no dropdown, just a
   gran-toggle button/info-icon). */
.dash-trendiness-row .dash-card {
    overflow: hidden; /* .dash-card is already position:relative by default */
}
.dash-trendiness-row .dash-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--accent);
    border-radius: 99px 99px 0 0;
}

/* "Full period" note (2026-08-20, client's ask) — the one absolute number
   for the ENTIRE selected period, sitting between each Trendiness chart's
   header and its canvas so it's never mistaken for one of the chart's own
   per-bucket (week/month/quarter) values. Filled in by JS; empty until then
   (:empty collapses it to zero height, so a chart with no data yet doesn't
   leave a visible empty bar). */
.dash-card-overall-note {
    font-size: 11px;
    color: var(--text-soft);
    margin-top: -6px;
}
.dash-card-overall-note:empty { display: none; }
.dash-card-overall-note b { color: var(--text); font-weight: 700; }

/* Coverage Breakdown's 3 rows share ONE column template (2026-08-20,
   client's ask: "vamos alinhar os gráficos" - Press Cycles lines up with
   Coverage by Country, Topics lines up with Top Outlets; below, since
   there are 3 charts instead of 2, Stories by Business + Incidents
   Breakdown split the Press Cycles/Country column in half while Press
   Cycles - Incidents lines up with Topics/Outlets). Same principle already
   documented above for the 6-KPI-column system: a shared grid-template
   + grid-column: span N per card is what actually pixel-aligns columns
   across rows with a different number of cards - independently-ratioed
   `fr` templates per row only look close, they don't align. 3 columns,
   the first 2 together (0.7fr + 0.7fr = 1.4fr) forming the "wide" slot,
   the 3rd (1fr) the "narrow" slot - the same 1.4:1 ratio Coverage by
   Country/Top Outlets (the reference row, client's own words) already
   used on its own before this change. */
.dash-bottom-row,
.dash-map-row,
.dash-incidents-row {
    grid-template-columns: minmax(0, 0.7fr) minmax(0, 0.7fr) minmax(0, 1fr);
}

/* Press Cycles / Coverage by Country each take the full wide slot (both
   halves) - Topics/Top Outlets fall into the narrow 3rd column by default
   (span 1, nothing to declare). Stories by Business/Incidents Breakdown
   (.dash-incidents-row) also default to span 1 each, landing in columns
   1 and 2 respectively - exactly the wide slot's 2 halves - with Press
   Cycles - Incidents' own default span 1 landing in column 3, lined up
   with Topics/Top Outlets. */
.dash-bottom-row .dash-card:first-child,
.dash-map-row .dash-card:first-child {
    grid-column: span 2;
}

/* Same title-misalignment class of bug as .dash-comp-row above, checked
   here too (2026-08-20, client's ask: "verifique isso nos outros gráficos
   também") — Topics' 20px chart-type icon button is always visible, but
   Press Cycles' "See all" text link only appears once the list is
   expanded past its default cap, so most of the time Press Cycles' header
   has nothing beside the title at all. Their natural heights differ
   (~20px vs ~16px), same fixed-height + flex-start fix. */
.dash-bottom-row .dash-card-header {
    height: 20px;
    align-items: flex-start;
}

/* Same title/control misalignment as .dash-comp-row/.dash-bottom-row above
   (2026-08-20, client's ask: "verifique isso nos outros gráficos também") -
   only Stories by Business has a control at all (its 20px chart-type icon
   button); the 2 Incidents cards are just a title now that the By Type/By
   Press Cycle toggle was split away, so 22px covers the tallest of the 3
   with a touch of headroom. */
.dash-incidents-row .dash-card-header {
    height: 22px;
    align-items: flex-start;
}

/* Shown only when a list-style card (e.g. either Incidents card) has
   nothing to list for the current scope/period - reused wherever a
   filtered ranked list can legitimately come back empty, rather than just
   rendering a blank .press-cycles-list with no explanation. */
.dash-list-empty {
    font-size: 11.5px;
    color: var(--text-muted);
    padding: 8px 0 2px;
}
.dash-list-empty:empty { display: none; }

/* Id-scoped (2026-08-20, 2nd round: client's ask - "vamos encolher
   verticalmente esses dois gráficos") - both lists in this row capped well
   below the shared class's 400px default (and below #outlets-list's own
   260px elsewhere on the page), matching #business-chart-wrap's 190px
   right beside them. byType has at most 5 real rows (the known incident
   sub-categories) so this rarely even needs the internal scroll the cap
   still guarantees as a safety net for byPressCycle, which has no such
   ceiling. */
#incidents-breakdown-list,
#incidents-press-cycle-list {
    max-height: 190px;
}

@media (max-width: 1100px) {
    .dash-comp-row,
    .dash-trendiness-row,
    .dash-brand-trend-row,
    .dash-map-row,
    .dash-incidents-row,
    .dash-bottom-row { grid-template-columns: 1fr; }
}

/* ── Press cycles ───────────────────────────────────────────────────────────── */

.press-cycles-list {
    display: flex;
    flex-direction: column;
    gap: 9px;
    overflow-y: auto;
    max-height: 400px;
    /* Keeps row content (count, bar) from sitting flush against the
       scrollbar track drawn at the container's own right edge. */
    padding-right: 10px;
    /* Thin, subtle scrollbar instead of the bulky OS default — Firefox */
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.press-cycles-list::-webkit-scrollbar { width: 6px; }
.press-cycles-list::-webkit-scrollbar-track { background: transparent; }
.press-cycles-list::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 99px;
}

/* Id-scoped (2026-08-20, client's ask): "Top Outlets" was the tallest card
   in its row (its list capped at the shared class's 400px, well past its
   2 neighbors' natural height), so the grid's row-stretch left dead space
   in Coverage by Country/Stories by Business beside it. Capped tighter to
   match #world-map/#business-chart-wrap's own 260px in that same row — only
   this one list, never .press-cycles-list elsewhere (Press Cycles/Topics/
   Media Elite/etc. keep their own 400px). */
#outlets-list { max-height: 260px; }
.press-cycles-list::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

.press-cycle-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.pc-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.pc-name {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pc-count {
    font-size: 12.5px;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

.pc-bar-track {
    height: 6px;
    background: var(--bg);
    border-radius: 99px;
    overflow: hidden;
}

/* Fill's own WIDTH is volume-relative (this item's articles / the list's max),
   same as before — what's new is that the fill itself is now segmented by
   sentiment (like the Sentiment by Brand Type / Sentiment Brands mini-bars)
   instead of a single solid color, so the bar communicates both volume
   (length) and sentiment mix (color split) at once. */
.pc-bar-fill {
    height: 100%;
    display: flex;
    border-radius: 99px;
    overflow: hidden;
    transition: width 0.5s ease;
}

.pc-bar-fill .s-pos { background: #348f70; }
.pc-bar-fill .s-neu { background: #ffbc00; }
.pc-bar-fill .s-neg { background: #ef4444; }
.pc-bar-fill .s-unc { background: #3a3a3a; }

.pc-sentiment-pct {
    font-size: 10.5px;
    color: var(--text-muted);
}

/* ── AI Analysis block ──────────────────────────────────────────────────────── */

.dash-ai-card {
    border-color: rgba(255,95,20,0.3);
    gap: 0;
}

/* Same "visible but unavailable" treatment as a restricted dashboard/chat
   card on the project homes (.feature-item.soon in style.css) - milder dim
   here since the card's own description text still needs to read fine, and
   the "Generate Analysis" button's own disabled look already comes from the
   existing .dash-ai-btn:disabled rule below. */
.dash-ai-card-disabled {
    opacity: 0.6;
}

.dash-ai-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.dash-ai-intro {
    display: flex;
    align-items: center;
    gap: 14px;
}

.dash-ai-icon {
    font-size: 24px;
    color: var(--accent);
    line-height: 1;
    flex-shrink: 0;
}

.dash-ai-title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
}

.dash-ai-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.dash-ai-btn {
    background: var(--accent);
    border: none;
    color: #fff;
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--font);
    transition: background 0.15s, opacity 0.15s;
    white-space: nowrap;
    flex-shrink: 0;
}

.dash-ai-btn:hover:not(:disabled) { background: var(--accent-hover); }
.dash-ai-btn:disabled { opacity: 0.55; cursor: default; }

#ai-inline-body {
    margin-top: 20px;
    border-top: 1px solid var(--border);
    padding-top: 20px;
}

.dash-ai-loading {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--text-muted);
    padding: 12px 0;
}

/* ── Articles table ─────────────────────────────────────────────────────────── */

.dash-table-wrap {
    /* No horizontal scrollbar — columns are fixed % widths (see the
       table's <colgroup>) and text wraps/clamps instead of overflowing. */
    overflow-x: hidden;
    overflow-y: auto;
    max-height: 480px;
    border: 1px solid var(--border);
    border-radius: 8px;
    /* A bit more separation from the header/Export button above, matching
       the ~20px rhythm other cards get via an explicit margin (e.g.
       #ai-inline-body) rather than just the base .dash-card gap. */
    margin-top: 4px;
    /* Same thin, light-gray scrollbar convention used app-wide. */
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}
.dash-table-wrap::-webkit-scrollbar { width: 6px; }
.dash-table-wrap::-webkit-scrollbar-track { background: transparent; }
.dash-table-wrap::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
.dash-table-wrap::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

.dash-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 12.5px;
}

.dash-table thead th {
    position: sticky;
    top: 0;
    background: var(--bg);
    text-align: left;
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    padding: 9px 12px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    z-index: 1;
}

.dash-table tbody td {
    padding: 9px 12px;
    border-bottom: 1px solid var(--border-soft, var(--border));
    color: var(--text-soft);
    vertical-align: top;
}

.dash-table tbody tr:last-child td { border-bottom: none; }
.dash-table tbody tr:hover { background: var(--accent-dim); }

/* Wraps each cell's text and clamps it to 3 lines with an ellipsis — lives on
   an inner div (not the <td> itself) because -webkit-line-clamp needs
   display:-webkit-box, which would otherwise fight the <td>'s own
   table-cell display and break the row layout. */
.td-clamp {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
}

/* Removed 2026-09-23 (client screenshot: "o texto é colado com a marge[m]") —
   this used to zero out the first column's own left padding on purpose, so
   its text would line up with the "Articles" title above (which sits flush
   at the card's own padding edge). In practice that reads as text glued to
   the table's edge with no breathing room at all, not as "aligned" — this
   same shared .dash-table class also backs Digital Measurement/Media
   Elite/Stories Stream/Guanxi Analytics/Guanxi Meetings/Press Cycles' own
   per-column table, so every one of them had the identical issue wherever
   nothing else overrode it (Guanxi Analytics' own Advocacy Matrix table and
   Press Cycles' own per-column Articles table had ALREADY reverted this
   exact override independently, for the exact same reason, on 2026-09-20 —
   see ga-advocacy-table-wrap below and .pc-articles-wrap in
   comms_press_cycles.css). Removing it here at the shared base rule instead
   of patching every screen individually means the first column now just
   gets the SAME 9px/12px padding (or each screen's own smaller local
   padding, e.g. Press Cycles' 7px/10px) as every other column, everywhere
   this class is used — a real minimum gap, standardized in one place. */

/* ...which introduced a NEW, smaller misalignment the client flagged right
   after (same day): the "Articles"/"N mentions matched" title block above
   now starts 12px to the LEFT of the table's own first-column text below it
   ("alinhar o titulo, assim fica fora" — the title needs to line up, this
   way it's sticking out). Fix is the other direction from before: nudge the
   TITLE block right by that same 12px instead of zeroing the table's own
   padding again, so both stay aligned AND the table keeps its breathing
   room. Scoped to just this card's header (its first child - the title+sub
   wrapper, not the "Export as Excel" button on the other side of the same
   header, which was never part of this complaint and stays put).

   Same rule ALSO fixes a pre-existing bug the client spotted right after
   (client screenshot, same day): "N mentions matched" was rendering on its
   OWN line below "Articles" instead of beside it, even though the sub span
   already had `margin-left:8px` inline - clearly meant to sit right next to
   the title. Root cause: this div's first child (.dash-card-title-wrap,
   wrapping "Articles" + the "?" icon) is itself `display:flex`, which makes
   IT a block-level box - any block-level element always starts a new line,
   so the plain-inline .dash-card-sub span after it got pushed down
   regardless of its own margin. Adding `display:flex` here too makes both
   children lay out on the same row; `align-items:baseline` keeps the larger
   bold title and the smaller muted sub-text sitting on a shared text
   baseline instead of vertically centered against each other's different
   line-heights. No `gap` added - the sub span's own margin-left:8px already
   provides the spacing this was always meant to have. */
#dash-table-card .dash-card-header > div:first-child {
    display: flex;
    align-items: baseline;
    padding-left: 12px;
}

/* Same var(--text-soft) as every other cell in this table (2026-07-28) — the
   headline link used to sit at var(--text), noticeably darker/bolder than
   its neighbors on the same row, which read as visually inconsistent rather
   than a deliberate emphasis. Hover still shows it's a link (accent color +
   underline); at rest it now blends in with the rest of the row. */
.dash-table td.td-headline {
    color: var(--text-soft);
}

.dash-table td.td-headline a {
    color: var(--text-soft);
    text-decoration: none;
}

.dash-table td.td-headline a:hover {
    color: var(--accent);
    text-decoration: underline;
}

.dash-table-msg {
    text-align: center;
    color: var(--text-muted);
    padding: 24px !important;
    white-space: normal !important;
}

.dash-table-footer {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 10px;
}

/* ── Empty state ────────────────────────────────────────────────────────────── */

.dash-empty {
    text-align: center;
    padding: 60px 24px;
    color: var(--text-muted);
    font-size: 14px;
}

/* ── Press Cycle Detail Modal (2026-09-24, redesigned same day at the
   client's ask — "borda fininha na cor laranja" + "modelo mais moderno e
   criativo") ────────────────────────────────────────────────────────────
   Own width/layout on top of the shared .chart-modal-overlay (style.css) -
   .chart-modal itself is sized for a small chart-expand popup (720px),
   this needs real room for AI text + 3 mini-lists + an article table. */

.pc-detail-modal {
    background: var(--surface);
    border: 1.5px solid var(--accent-border);
    border-radius: 18px;
    padding: 22px 24px;
    width: min(920px, 95vw);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.16), 0 0 0 1px var(--accent-glow);
}

.pc-detail-header {
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-soft);
    margin-bottom: -2px;
    /* Long press cycle names must show in FULL now, not truncated
       (2026-09-24, client's ask — a name like "Br Corp: Partnership With
       Ministry Of Health Offers Free Transportation For Pa…" was cutting
       off mid-word). The shared .chart-modal-header (style.css) defaults to
       align-items:center — override to flex-start so the ✕ button pins to
       the top line instead of re-centering against however tall the
       wrapped title ends up being. */
    align-items: flex-start;
}

/* No icon before the eyebrow/name anymore (2026-09-24, client's ask — "é um
   sistema mais formal") — just stacks the two text lines, min-width:0 so
   the flex row it sits in (.pc-detail-header) can shrink this block instead
   of overflowing past the modal. */
.pc-detail-title-block {
    min-width: 0;
}

/* Same gray as every other uppercase label in the modal (KPI labels, mini-
   titles, "MARKETS", "ARTICLES") — 2026-09-24, client's ask to standardize
   every text to the same colors/gray, dropped the one orange accent text
   had left (var(--accent)) here. */
.pc-detail-title-eyebrow {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    line-height: 1.4;
}

.pc-detail-title-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: -0.01em;
    line-height: 1.3;
}

/* Circular hover highlight, scoped to THIS modal only — the shared
   .chart-modal-close (style.css) stays a plain text-color hover everywhere
   else it's used (the smaller chart-expand popup elsewhere in the app). */
.pc-detail-modal .chart-modal-close {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}
.pc-detail-modal .chart-modal-close:hover {
    background: var(--accent-dim);
    color: var(--accent);
}

.pc-detail-body {
    /* flex:1 + min-height:0 (2026-09-24, real bug found testing this) — without
       these, a flex child with overflow-y:auto never actually constrains
       itself inside a flex column with a max-height on the PARENT: it just
       grows to its own content's natural height instead, so .pc-detail-modal
       (max-height:90vh, no overflow rule of its own) silently clipped the
       Articles table at the bottom instead of the body scrolling to reveal
       it — confirmed with a real Chromium screenshot, not assumed. min-
       height:0 overrides flex's default min-height:auto, which otherwise
       stops the child from ever shrinking below its content size in the
       first place. */
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}
/* Real bug #2, found in the SAME test as #1 above: min-height:0 on the body
   made it scroll instead of growing past 90vh, but every direct child
   (KPIs row, sentiment row, mini-list row, the Articles wrap) is ALSO a
   flex item by default (flex-shrink:1) — so the flex algorithm squeezed
   every section down to fit inside whatever space was actually available
   instead of ever letting .pc-detail-body's content exceed its box and
   trigger the scroll. Confirmed directly: the Articles wrap's own
   max-height:280px never took effect, it measured 32px tall with 200 real
   rows inside it (wrap.scrollHeight was 7825px) — flex-shrink had silently
   crushed it. flex-shrink:0 on every direct child fixes this the same way
   min-height:0 fixed the body itself: never let content shrink below its
   own natural/capped size, only ever scroll to reveal it. */
.pc-detail-body > * { flex-shrink: 0; }
.pc-detail-body::-webkit-scrollbar { width: 6px; }
.pc-detail-body::-webkit-scrollbar-track { background: transparent; }
.pc-detail-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
.pc-detail-body::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
.pc-detail-body { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }

/* AI Summary card — plain, lighter gray (2026-09-24, client's ask: no
   orange wash/border here, this is still a formal internal tool) — same
   .dash-ai-btn/.dash-ai-icon accents used elsewhere are enough to signal
   "this is the AI card" without also tinting the whole background. Just
   without the "Generate" button (auto-fires on open) and living inside the
   modal instead of the page. */
.pc-detail-ai {
    background: #f7f7f7;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px 18px;
}
.pc-detail-ai-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
}
/* .dash-ai-title (comms_analytics.css above) is shared with the main page's
   own AI Summary card, which keeps its darker var(--text) — scoped override
   so only THIS modal's "AI Summary" heading follows the same gray as
   everything else in here (2026-09-24, client's ask). */
.pc-detail-ai .dash-ai-title { color: var(--text-muted); }
.pc-detail-ai-tag {
    margin-left: auto;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: none;
    letter-spacing: 0;
}
.pc-detail-ai-disabled { opacity: 0.6; }
.pc-detail-ai-locked {
    font-size: 12.5px;
    color: var(--text-muted);
}
/* .brief-narrative (style.css) is shared by every "AI Analysis" card
   app-wide at 14.5px/h2 15px — scoped down here only (2026-09-24, client's
   ask: "o texto do resumo IA esta maior, vamos manter o tamanho de fonte
   padrão") to match this modal's own denser scale (.dash-ai-desc's 12px,
   the app's normal body-copy size), without touching the shared class other
   screens' full-page AI cards still rely on. */
.pc-detail-ai .brief-narrative { font-size: 12px; line-height: 1.65; }
.pc-detail-ai .brief-narrative h2 { font-size: 12.5px; }

.pc-detail-scope-note {
    font-size: 10.5px;
    color: var(--text-muted);
    margin-top: -8px;
}
.pc-detail-scope-note b { color: var(--text-muted); font-weight: 700; }

.pc-detail-kpis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}
/* Same "3px accent stripe along the top edge" idiom as the main dashboard's
   .kpi-card::before/.kpi-accent/.kpi-green/.kpi-gray (comms_analytics.css
   above), restored (2026-09-24, client's ask) after a brief detour into a
   single neutral stripe for all 4 — background itself is the SAME light
   gray as .pc-detail-ai on every card in the modal (KPIs + the two mini-
   cols below), only the top stripe still varies per metric. Keeps the
   subtle hover lift since these ARE hoverable/scannable at a glance (not
   clickable, no cursor change) in a way the page's own KPI row isn't (that
   one competes with a dozen other cards; here it's the first thing under
   the AI summary). */
.pc-detail-kpi {
    background: #f7f7f7;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px 10px;
    position: relative;
    overflow: hidden;
    transition: transform 0.15s, box-shadow 0.15s;
}
.pc-detail-kpi:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}
.pc-detail-kpi::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--border);
    border-radius: 99px 99px 0 0;
}
.pc-detail-kpi-accent::before { background: var(--accent); }
.pc-detail-kpi-green::before  { background: var(--green); }
.pc-detail-kpi-gray::before   { background: #9ca3af; }
.pc-detail-kpi-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-bottom: 4px;
}
.pc-detail-kpi-value {
    font-size: 19px;
    font-weight: 700;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.pc-detail-sentiment-row { margin-top: -6px; }
/* Taller + a hairline border than the app's default .sentiment-bar (6px,
   borderless everywhere else it's used) — scoped to just this row so every
   OTHER sentiment-bar in the app (KPI cards, ranked lists, etc.) is
   untouched. A near-solid bar (e.g. 99%+ one color, common for a single
   press cycle) reads as "broken/empty" at 6px with nothing else nearby to
   anchor it; the border + the legend chips below (replacing the old plain-
   text caption) give it a contained, deliberate look even when it's
   basically one flat color. */
.pc-detail-sentiment-row .sentiment-bar {
    height: 10px;
    border: 1px solid var(--border);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}
.pc-detail-sentiment-caption {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin-top: 10px;
}
/* var(--text-muted), same gray as every other label in the modal
   (2026-09-24, client's ask to standardize text colors) — was --text-soft,
   one shade darker, the only place in the modal that still differed. */
.pc-detail-sentiment-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    color: var(--text-muted);
}
.pc-detail-sentiment-chip i {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    flex-shrink: 0;
    font-style: normal;
}
/* Same weight as "Positive"/"Neutral"/"Negative" themselves (2026-09-24,
   client's ask: the count used to be bold, standing out from its own
   label) — font-weight:400 explicitly, not just omitted, since <b> is
   bold by the browser's own default user-agent stylesheet otherwise. */
.pc-detail-sentiment-chip b { color: var(--text-muted); font-weight: 400; }
.pc-detail-sentiment-empty {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* Markets strip (2026-09-24) — plain small pills, not a ranked-bar list:
   client's ask, almost every press cycle only ever has 1-2 markets, so this
   just needs to read at a glance, not compete visually with Outlets/Brands
   below it. */
.pc-detail-markets-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: -6px;
}
.pc-detail-markets-label {
    font-size: 10.5px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.pc-detail-markets-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.pc-detail-market-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-muted);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 99px;
    padding: 2px 10px;
    white-space: nowrap;
}
.pc-detail-market-pill b { color: var(--text-muted); font-weight: 700; }

.pc-detail-mini-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}
/* Each of the three mini-sections (Top Outlets / Top Topics / Brands
   Mentioned) sits in its own bordered card, same surface/border treatment
   as the KPI cards above — before this they floated directly in the grid
   with no visual container of their own, reading as a looser list of loose
   sections rather than distinct, scannable blocks. */
.pc-detail-mini-col {
    background: #f7f7f7;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
}
.pc-detail-mini-title {
    font-size: 10.5px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-bottom: 8px;
}
/* Top Outlets AND Brands Mentioned both reuse the page's own
   .press-cycles-list ranked-bar component (see drawRankedList() in
   comms_analytics.js) — same sentiment-segmented bars, same tooltip
   (2026-09-24: Brands Mentioned had been a Chart.js column chart, then a
   plain horizontal stacked bar before that — client's ask, "brand mentioned
   deve ser mostrado separados por sentimentos", is exactly what
   drawRankedList() already gives Top Outlets for free). Shorter than the
   page's own version (which targets a full dashboard card) since 2 of
   these sit side by side in a modal, no need for 400px each. */
.pc-detail-mini-list { max-height: 160px; }

.pc-detail-articles-title {
    font-size: 10.5px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.pc-detail-articles-wrap {
    max-height: 280px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.pc-detail-articles-wrap::-webkit-scrollbar { width: 6px; }
.pc-detail-articles-wrap::-webkit-scrollbar-track { background: transparent; }
.pc-detail-articles-wrap::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
.pc-detail-articles-wrap::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
.pc-detail-articles-wrap { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }

/* Scoped overrides for shared components reused inside this modal by id
   (2026-09-24, client's ask: every text in this modal follows the same
   gray) — never touching the shared classes themselves, which other
   screens still rely on at their own default colors:
   - Top Outlets (pcMiniListHtml()) and Brands Mentioned (drawRankedList())
     both render a .pc-name (normally var(--text), dark, in Top Press
     Cycles/Outlets elsewhere on this page) — same gray override for both,
     regardless of which of the two functions built the row.
   - Brands Mentioned's "X% pos · X% neu · X% neg" caption (.pc-sentiment-pct,
     only drawRankedList() ever renders this — pcMiniListHtml() doesn't, so
     this half of the rule is a no-op for Top Outlets, kept anyway in case
     that ever changes again) is hidden — the segmented bar + its hover
     tooltip already carry that number, a permanent caption under every row
     was redundant once everything else in the modal converged to plain
     gray text.
   - The Articles table reuses .dash-table, normally var(--text-soft) (one
     shade darker than this modal's own var(--text-muted) standard). */
/* color AND font-weight both overridden (2026-09-24, client's screenshot:
   "Metropoles Online"/"Uber" still rendering bold) — .pc-name's shared
   definition is font-weight:600 by default (semi-bold, used everywhere
   else on this page for a ranked list's name column); the color-only
   override above never touched that, so the name kept reading bold even
   after every other text in this modal converged to plain gray. */
#pc-modal-outlets .pc-name, #pc-modal-topics .pc-name, #pc-modal-brands .pc-name { color: var(--text-muted); font-weight: 400; }
#pc-modal-outlets .pc-sentiment-pct, #pc-modal-brands .pc-sentiment-pct { display: none; }
#pc-modal-articles .dash-table tbody td,
#pc-modal-articles .dash-table td.td-headline a { color: var(--text-muted); }

/* ── Media Score Detail Modal (2026-09-24), also reused by the DiDi SoV
   Detail Modal (same day, follow-up ask) ────────────────────────────────
   Reuses the Press Cycle modal's own .pc-detail-* shell (same overlay/
   header/body/KPI-row/mini-col classes) - only what's genuinely specific to
   a score/percentage-style breakdown (not Press Cycle's own thing) lives
   under the mediascore- prefix (classes and #mediascore-modal- ids) below.
   The DiDi SoV modal's HTML deliberately reuses these SAME classes on its
   own #sov-modal-* elements (mediascore-detail-row/-country-list/-trend-
   col/-trend-wrap/-row-score/-row-delta*) rather than duplicating an
   identical block under a sov- prefix - same "reuse an existing shell,
   don't fork it" precedent this modal itself already set by reusing
   .pc-detail-*. A star immediately followed by a slash closes a CSS comment
   right there, even mid-sentence - this exact block broke that way once
   already (a wildcard class mention with no space before the slash after
   it), silently dropping the very next rule from the parsed stylesheet with
   no visible error. Never write those two characters next to each other in
   a comment, intentional close aside. */

/* KPI card affordance (2026-09-24, extended same day to a 2nd card) — same
   cursor/hover language as .chart-filterable elsewhere on this page, but a
   SEPARATE class: a click here opens a detail modal, it doesn't apply a
   page filter, and mixing the two names would misdescribe what the click
   actually does to a future reader. "DiDi Media Score" and "DiDi SoV" are
   the only 2 of the 6 Main Indicators KPI cards that get this - the other 4
   have no drill-down yet. */
.kpi-card-clickable { cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s; }
.kpi-card-clickable:hover { border-color: var(--accent-border); box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07); }

/* Score-by-market and vs-Competitors sit side by side, same 2-column grid
   as .pc-detail-mini-row's own grid-template-columns machinery — just
   overridden to 2 instead of that class's default 3 (Top Outlets/Topics/
   Brands Mentioned's own row). */
.mediascore-detail-row { grid-template-columns: repeat(2, 1fr); }

/* Taller than the Press Cycle modal's mini-lists (160px) — this is the
   single most strategic list in the modal (which markets need attention),
   worth more vertical room before it needs to scroll; 12+ markets is a
   normal scope width for this page. */
.mediascore-country-list { max-height: 240px; }

.mediascore-trend-col { padding: 14px 16px 16px; }
.mediascore-trend-wrap { position: relative; height: 220px; }

/* Score-by-Country/vs-Competitors row - same .press-cycle-item/.pc-row/
   .pc-name/.pc-count/.pc-bar-track/.pc-bar-fill shape pcMiniListHtml()
   already uses elsewhere in this modal, plus a period-over-period/vs-DiDi
   delta after the value. A colored dot next to the name used to carry the
   same status/brand color the bar already shows - removed (2026-09-24,
   client's ask: "vamos retirar as bolinhas que acompanham os nomes dos
   países e marcas"), the bar alone is enough, explained via each list's own
   info-icon. */

/* Score + delta each get their own fixed-width, right-aligned slot
   (2026-09-24, client's ask: "alinhar os números mostrados") - tabular-nums
   keeps every digit the same width too, so two rows with the same number
   of characters (e.g. "55.40" and "53.64") land pixel-for-pixel aligned,
   not just roughly close. Before this, .pc-count was one plain text node
   (score+delta concatenated with no layout control), so a longer delta on
   one row visually shifted that row's score left relative to its
   neighbors. */
.mediascore-row-score,
.mediascore-row-delta-slot {
    font-variant-numeric: tabular-nums;
}
/* .pc-count as a flex row with an explicit gap (2026-09-24, real bug found
   testing this) — inline-block + min-width alone only LOOKS like it leaves
   a gap between the score and the delta when the delta text happens to be
   shorter than its own min-width (e.g. Score by Country's "+24.1"); vs.
   Competitors' longer delta ("-0.75 vs DiDi") overflows past its min-width
   with nothing to its left, so the two boxes butted up against each other
   with zero space ("36.46-0.75 vs DiDi"). A flex gap holds regardless of
   how long either child's content ends up being. Scoped by CLASS, not by
   the Media Score modal's own ids (2026-09-24 follow-up) — the DiDi SoV
   detail modal reuses this exact same .mediascore-country-list class on its
   own country/competitor lists, and needs the identical fix. */
.mediascore-country-list .pc-count {
    display: flex;
    justify-content: flex-end;
    align-items: baseline;
    gap: 6px;
}
.mediascore-row-score { min-width: 40px; text-align: right; }
.mediascore-row-delta-slot { text-align: right; }
/* Score by Country's delta is always short ("▲ 24.1"/"▼ 5.7", never a
   suffix) - a min-width here keeps ITS right edge aligned column to column
   too, not just the score's. vs. Competitors' delta always ends in " vs
   DiDi", a much longer and more variable string - forcing the same rigid
   column there wouldn't read as cleanly, so it's left to size to its own
   content (still gap-separated from the score, just not column-aligned). */
#mediascore-modal-countries .mediascore-row-delta-slot { min-width: 40px; }
.mediascore-row-delta {
    font-size: 10px;
    font-weight: 600;
}
.mediascore-row-delta.good    { color: #348f70; }
.mediascore-row-delta.bad     { color: #ef4444; }
.mediascore-row-delta.neutral { color: var(--text-muted); }

/* ▲/▼ arrow glyph (2026-09-24 follow-up, client's ask: "vamos adicionar as
   mesmas setinhas que temos usado na tabela de score") - same "shrunk +
   dimmed relative to its surrounding text" treatment comms_score.css's own
   .score-gt-arrow already established for the exact same glyph (that
   comment's own reasoning: a solid ▲/▼ triangle renders noticeably
   bolder/larger than surrounding numerals at the same font-size in most
   fonts). Sized in em, not a fixed px, so the SAME class reads right both
   inside a small 10px delta badge (.mediascore-row-delta, the country/
   competitor list rows) and inside a much larger 19px KPI value
   (.pc-detail-kpi-value, the "vs. Target"/"vs. Previous Period" cards) -
   one rule, two very different contexts. No color of its own - always
   inherits whatever `color` its parent element already set (the delta
   badge's own good/bad/neutral class, or the KPI value's inline gapColor/
   prevColor style), same as .score-gt-arrow inheriting from .score-gt-delta.up/.down. */
.mediascore-row-arrow {
    font-size: 0.7em;
    opacity: 0.75;
}

@media (max-width: 720px) {
    .pc-detail-kpis, .pc-detail-mini-row { grid-template-columns: 1fr; }
}
