/* explore.css — /explore/{slug} theme page. Extends taste.css (ivory/black, flat, pill nav).
   Theme info (header + index line chart) then a pill-tab content switcher. Chrome stays neutral;
   the only colour is data (index lines, gain/loss, note accent). */

/* Page content column — the hero, the index chart, and the tab/feed content ALL share this max-width so
   their left/right edges line up (the body used to be full-bleed while the hero capped at 1120px, so on
   wide screens the content sprawled wider than the title). Change here = all three move together. Shared
   by explore / country / asset (they all load this file; asset's .as-class-in reads it too). */
:root{ --ex-page: 1120px; --sheet-overlap: 30px; }

/* ── DARK HERO — treat the megatrend like a stock quote (logo · name · index price · deck), on the
   same full-bleed black slab the /explore hub hero uses so the two pages share one design language. ── */
/* The dark hero owns its own bottom spacing — 2rem breathing room PLUS the sheet-overlap the light
   sheet (.ex-index-wrap) rises into. This is a fixed container style: it never depends on what's
   inside (chips / no chips), so every page (asset · explore · country) gets the same clean gap
   before the sheet's rounded top, and a chip-less asset (e.g. EURUSD.FOREX) can't lose its bottom. */
.ex-hero { background: var(--black); color: var(--ivory); padding: 8.5rem 0 calc(2rem + var(--sheet-overlap)); }
/* 2-row grid: back-link on top (right col), then logo + content — so the LOGO's top lines up with
   the NAME's top (not the back-link). column-gap keeps the logo tight to the content, centered block. */
.ex-hero-in { max-width: var(--ex-page); margin: 0 auto; padding: 0 40px; display: grid;
  grid-template-columns: 132px minmax(0, 1fr); grid-template-rows: auto 1fr; column-gap: 34px; align-items: start; }
.ex-hero-side { grid-column: 1; grid-row: 2; }
.ex-hero-main { grid-column: 2; grid-row: 2; }
.ex-hero .ex-back { grid-column: 2; grid-row: 1; justify-self: start; display: inline-block; color: var(--dim); font-size: 13px; font-weight: 700; text-decoration: none; margin: 0 0 14px; transition: color .15s; }
.ex-hero .ex-back:hover { color: var(--ivory); }
/* breadcrumb trail (JS upgrades the single "← All themes" link to All themes › parent › current for sub-themes) */
.ex-hero .ex-back a { color: inherit; text-decoration: none; transition: color .15s; }
.ex-hero .ex-back a:hover { color: var(--ivory); }
.ex-hero .ex-back .ex-crumb-sep { margin: 0 6px; opacity: .5; }
.ex-hero .ex-back .ex-crumb-cur { color: var(--ivory); }
.ex-hero-logo img { width: 128px; height: 128px; border-radius: 50%; object-fit: cover; display: block; background: #fff; }
.ex-hero-main .ex-title { max-width: none; font-size: clamp(2.3rem, 4.6vw, 3.5rem); font-weight: 700;
  letter-spacing: -.02em; line-height: 1.04; color: var(--ivory); margin: 0; }
/* the "quote": index = price (big), %chg + Core = the movers */
/* index = the "price": big Core number + %chg, then the All index as a smaller reference; all bottom-aligned */
.ex-quote { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 20px; margin: 18px 0 0; }
.ex-quote:empty { display: none; }
.ex-quote .q-idx { font-size: 2.6rem; font-weight: 700; letter-spacing: -.02em; line-height: 1; font-variant-numeric: tabular-nums; color: var(--ivory); }
.ex-quote .q-chg { font-size: 1.25rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.ex-quote .q-core { align-self: baseline; font-size: .92rem; font-weight: 600; line-height: 1; color: var(--dim); font-variant-numeric: tabular-nums; }
.ex-quote .q-core b { color: var(--ivory); font-weight: 700; }
.ex-quote .up, .ex-quote .q-core .up { color: #35c46f; } .ex-quote .down, .ex-quote .q-core .down { color: #ff6b6b; }
.ex-hero-main .ex-desc { max-width: 44rem; margin: 18px 0 0; font-size: clamp(1rem, 1.5vw, 1.1rem); line-height: 1.62; color: var(--dim); font-weight: 500; }
.ex-hero .ex-meta { display: flex; flex-wrap: wrap; gap: .4rem 1.5rem; margin: 22px 0 0; padding-top: 1rem;
  border-top: 1px solid rgba(240, 238, 233, .14); font-size: .82rem; color: var(--dim); }
/* asset.js empties #asMeta (classification lives in .as-class below) → collapse the vestigial element
   so its border-top divider + padding leave no dead space. */
.ex-hero .ex-meta:empty { display: none; }
.ex-hero .ex-meta span { display: inline-flex; align-items: baseline; gap: .35rem; }
.ex-hero .ex-meta b { color: var(--ivory); font-weight: 700; text-transform: capitalize; }
/* "Contains" child-node chips in the dark hero (mirrors the GICS header) */
.ex-kids { margin-top: 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.ex-kids[hidden] { display: none; }
.ex-kids-lbl { font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--dim, #8a8a8a); margin-right: 2px; }
.gk-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; text-decoration: none;
  border-radius: 999px; padding: 6px 13px; border: 1px solid rgba(240,238,233,.20); background: rgba(240,238,233,.08);
  color: var(--ivory, #f0eee9); transition: background .15s, border-color .15s, color .15s; }
.gk-chip::after { content: '\203A'; font-weight: 700; opacity: .5; transition: opacity .15s, transform .15s; }
.gk-chip:hover { background: rgba(240,238,233,.16); border-color: rgba(240,238,233,.42); }
.gk-chip:hover::after { opacity: 1; transform: translateX(2px); }
.gk-chip.gk-hidden { display: none; }
.gk-more { font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; background: transparent;
  border: 1px dashed rgba(240,238,233,.30); color: rgba(240,238,233,.64); border-radius: 999px; padding: 6px 12px;
  transition: color .15s, border-color .15s; }
.gk-more:hover { color: var(--ivory, #f0eee9); border-color: rgba(240,238,233,.52); }
@media (max-width: 720px) {
  .ex-hero { padding: 7rem 0 calc(1.6rem + var(--sheet-overlap)); }
  .ex-hero-in { grid-template-columns: 1fr; grid-template-rows: none; gap: 16px; padding: 0 24px; justify-items: center; text-align: center; }
  .ex-hero .ex-back { grid-column: 1; grid-row: auto; margin: 0; justify-self: center; }   /* back-link centres with the rest of the hero on mobile (was justify-self:start) */
  .ex-hero-side { grid-column: 1; grid-row: auto; order: -1; }   /* logo on top */
  .ex-hero-main { grid-column: 1; grid-row: auto; display: flex; flex-direction: column; align-items: center; }
  .ex-hero-logo img { width: 148px; height: 148px; }
  .ex-quote, .ex-hero .ex-meta { justify-content: center; }
}

/* ── index chart card ── */
/* The light content is a full-width "sheet" that rises over the dark hero with rounded top corners —
   a bottom-sheet / card-over-hero look, shared by asset / explore / country (all: dark .ex-hero →
   .ex-index-wrap → .ex-content). The overlap is symmetric: the sheet rises --sheet-overlap via its
   negative margin, and .ex-hero reserves the same amount in its bottom padding — so no page/content-
   specific rule is needed. ex-index-wrap goes full-width to own the sheet bg + radius; the max-width
   centering moves onto its child .ex-index. .ex-content continues on the same --bg canvas below. */
.ex-index-wrap { background: var(--bg); border-radius: var(--radius) var(--radius) 0 0; margin-top: calc(-1 * var(--sheet-overlap)); position: relative; z-index: 2; }
.ex-index { background: transparent; border-radius: 0; max-width: var(--ex-page); margin-inline: auto; padding: 22px 40px 18px; }
.ex-index-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.ex-index-t { font-size: 13px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--black); }
.ex-index-t .mut { color: var(--muted); font-weight: 600; text-transform: none; letter-spacing: 0; }
.ex-index-ctrl { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.ex-index-ctrl .seg { background: var(--bg); }
/* legend */
.ex-legend { display: flex; align-items: center; gap: 16px; }
.ex-leg { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--muted); }
.ex-leg i { width: 15px; height: 3px; border-radius: 2px; display: inline-block; }
.ex-leg b { color: var(--black); font-weight: 700; font-variant-numeric: tabular-nums; }
.ex-leg .v { font-variant-numeric: tabular-nums; font-weight: 700; }
.ex-leg .v.up { color: var(--gain); } .ex-leg .v.down { color: var(--loss); }
.ex-index-body { position: relative; margin-top: 6px; }
#exChart { width: 100%; height: 270px; display: block; overflow: visible; }
.ex-chart-tip { position: absolute; pointer-events: none; background: var(--black); color: var(--ivory); border-radius: 12px; padding: 8px 12px; font-size: 12px; font-weight: 600; line-height: 1.5; white-space: nowrap; z-index: 5; transform: translate(-50%, -118%); box-shadow: 0 10px 30px rgba(0,0,0,.2); }
.ex-chart-tip .d { color: var(--dim, #ABA298); font-weight: 500; margin-bottom: 2px; }
.ex-chart-tip .r { display: flex; align-items: center; gap: 6px; }
.ex-chart-tip .r i { width: 10px; height: 3px; border-radius: 2px; }
.ex-chart-tip b { font-variant-numeric: tabular-nums; }
.ex-chart-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 14px; font-weight: 600; }
.ex-chart-empty[hidden] { display: none; }
.ex-gridline { stroke: var(--border-medium, #D8D3C7); stroke-width: 1; opacity: .55; }
.ex-axis-lbl { fill: var(--muted); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ex-index-base { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 4; opacity: .5; }
.ex-cross { stroke: var(--black); stroke-width: 1; opacity: .3; }
.ex-line-all { fill: none; stroke: #A89F93; stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; }
.ex-line-core { fill: none; stroke-width: 2.3; stroke-linejoin: round; stroke-linecap: round; }
.ex-line-core.up { stroke: var(--gain); } .ex-line-core.down { stroke: var(--loss); }
.ex-dot { stroke: #fff; stroke-width: 2; }
.ex-dot.all { fill: #A89F93; } .ex-dot.core.up { fill: var(--gain); } .ex-dot.core.down { fill: var(--loss); }

/* ── content: pill tabs ── */
.ex-content { max-width: var(--ex-page); margin-inline: auto; padding: 40px 40px 90px; }
.ex-tabs { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 32px; }
.ex-tabs .tab { background: var(--ivory); color: var(--black); border: none; border-radius: var(--pill); padding: 12px 24px; font: inherit; font-weight: 700; font-size: 15px; cursor: pointer; transition: background .2s, color .2s, opacity .2s; }
.ex-tabs .tab:hover { opacity: .6; }
.ex-tabs .tab.active { background: var(--black); color: var(--ivory); }
.ex-tabs .tab.active:hover { opacity: 1; }
.ex-tabs .tab--ext .ex-tab-ext { margin-left: 5px; font-weight: 700; opacity: .5; font-size: 13px; }
.ex-panel { animation: ex-fade .25s ease; }
@keyframes ex-fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ── feed tab (2-col grid + glance, same as the Feeds page) ── */
.ex-feedbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.ex-feedlead { font-size: 15px; color: var(--muted); font-weight: 500; }
.ex-feedlead b { color: var(--black); font-weight: 700; }
.ex-ripple { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; font-size: 14px; font-weight: 700; color: var(--muted); background: var(--ivory); border-radius: var(--pill); padding: 8px 15px; transition: color .15s; }
.ex-ripple:hover { color: var(--black); }
.ex-ripple input { accent-color: var(--black); width: 15px; height: 15px; cursor: pointer; }

/* notes tab: the note-gallery component (.ex-notes / .ex-note*) lives ONCE in feed.css —
   theme.html loads feed.css, so the Feed Notes view and this Notes tab share the exact same
   styles (no second copy here to drift). Explore-specific note styles, if ever needed, go below. */

/* ── supply chain tab (paper-themed value chain) ── */
.ex-supply-lead { font-size: 15px; color: var(--muted); font-weight: 500; margin-bottom: 20px; }
.ex-supply-lead b { color: var(--black); font-weight: 700; }
.ex-supply-lead:empty { display: none; }
.mvc-host { min-height: 200px; }
/* "you are here" — the current sub-node highlighted inside its tier-1 chain */
.ex-mvc-here { box-shadow: 0 0 0 1.5px var(--black) !important; border-radius: 12px; }
/* value-chain stock-chip + orphaned-leaf CSS moved to megatrend-valuechain.css (the component stylesheet
   both /explore and /explore/theme.html load) so the chips render identically on both. */

/* ── landscape (bubble) tab — light, on-brand ── */
.ex-bubblebar { position: sticky; top: 74px; z-index: 4; display: flex; align-items: center; gap: 14px; margin-bottom: 12px; min-height: 34px; background: var(--bg); padding: 6px 0; }
.ex-bback { background: var(--black); color: var(--ivory); border: none; border-radius: var(--pill); padding: 8px 16px; font: inherit; font-weight: 700; font-size: 13px; cursor: pointer; transition: opacity .15s; }
.ex-bback:hover { opacity: .8; }
.ex-bback.hidden { display: none; }
.ex-bubblehint { font-size: 13px; color: var(--muted); font-weight: 500; }
/* Landscape bubble = the SAME MegatrendScale as the /explore hub → give it the hub's mobile treatment: the
   SVG keeps a 900px min-width (bubbles + labels stay legible) and the frame SCROLLS horizontally instead of
   squashing the whole chart into a narrow viewport (native touch-scroll on phones). */
.ex-bubble-frame { background: transparent; border-radius: var(--radius); overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.ex-bubble-frame::-webkit-scrollbar { display: none; }
.ex-bubble-svg { width: 100%; min-width: 900px; height: auto; display: block; aspect-ratio: 3 / 2; }
/* flush the bubble canvas to the SCREEN edges on mobile — FULL-BLEED (100vw, re-centred with a negative
   margin) so it breaks out of ANY parent padding/margin/max-width, not just .ex-content's 16px. Robust vs
   guessing the gutter. Like the /explore hub's edge-to-edge canvas. */
@media (max-width: 900px) {
  .ex-bubble-frame { width: 100vw; max-width: 100vw; margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); }
}

/* ── skeletons / error ── */
.sk { display: inline-block; background: linear-gradient(90deg, var(--ivory) 25%, #ECE9E2 37%, var(--ivory) 63%); background-size: 400% 100%; animation: sk-sh 1.3s infinite; border-radius: 8px; }
/* width caps against the viewport (min of the desktop px and a vw share) so the fixed px never
   exceeds a narrow screen and balloons the shrink-wrapped hero column during load. One rule, all widths. */
.sk-title { width: min(340px, 62vw); height: 48px; }
.sk-desc { width: min(560px, 84vw); height: 16px; }
@keyframes sk-sh { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.ex-error { padding: 160px 40px; text-align: center; }
.ex-error h2 { font-size: 30px; font-weight: 700; margin-bottom: 12px; }
.ex-error p { color: var(--muted); font-size: 16px; }
.ex-error a { color: var(--black); font-weight: 700; }

@media (max-width: 900px) {
  .ex-head { padding-top: 110px; }
  .ex-index, .ex-content { padding-left: 16px; padding-right: 16px; }
  .ex-index-head { align-items: flex-start; }
  #exChart { height: 220px; }
  .ex-bubblebar { top: 64px; }
}

/* ── landscape legend (bubble anatomy: core/secondary + lifecycle) — ported from the /explore hub ── */
.ex-bubble-legend{display:flex;flex-direction:column;align-items:center;gap:14px;margin-top:18px}
.ex-anatomy{width:100%;max-width:290px;height:auto;display:block}
.ex-anatomy .lead{fill:none;stroke:#b3a89a;stroke-width:1.4}
.ex-anatomy .lbl{font-weight:700;font-size:13px;fill:var(--black)}
.ex-lifecycle{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:6px 20px;font-size:12px;font-weight:600;color:var(--muted)}
.ex-lifecycle span{display:inline-flex;align-items:center;gap:7px}
.ex-lifecycle i{width:10px;height:10px;border-radius:50%;display:inline-block}
.ex-lc-lbl{color:var(--muted)}

/* ══════ MOBILE tabs — icon + short label on ONE row (no wrap) ══════
   The desktop pill tabs wrap to 2 lines when a page has many tabs (theme: Feed/Notes/Supply/Landscape/
   Players). On phones switch to a single row of icon-over-label tabs, each flex:1. Icons are injected per
   data-t via mask-image so they inherit the tab colour (black on ivory · ivory on the active black tab). */
@media (max-width: 760px) {
  .ex-tabs { flex-wrap: nowrap; gap: 6px; margin-bottom: 22px; }
  .ex-tabs .tab {
    flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 5px;
    padding: 9px 3px 7px; border-radius: 14px; font-size: 10.5px; font-weight: 700; line-height: 1.12;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .ex-tabs .tab > span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  .ex-tabs .tab .ex-tab-ext { display: none; }   /* hide the ↗ on mobile */
  .ex-tabs .tab::before {
    content: ''; flex: none; width: 21px; height: 21px; background-color: currentColor;
    -webkit-mask: center / 21px no-repeat; mask: center / 21px no-repeat;
  }
  .ex-tabs .tab[data-t="feed"]::before   { -webkit-mask-image: var(--ic-feed);   mask-image: var(--ic-feed); }
  .ex-tabs .tab[data-t="notes"]::before  { -webkit-mask-image: var(--ic-notes);  mask-image: var(--ic-notes); }
  .ex-tabs .tab[data-t="supply"]::before { -webkit-mask-image: var(--ic-supply); mask-image: var(--ic-supply); }
  .ex-tabs .tab[data-t="bubble"]::before { -webkit-mask-image: var(--ic-grid);   mask-image: var(--ic-grid); }
  .ex-tabs .tab[data-t="comp"]::before   { -webkit-mask-image: var(--ic-comp);   mask-image: var(--ic-comp); }
  .ex-tabs .tab[data-ext="swarm"]::before{ -webkit-mask-image: var(--ic-users);  mask-image: var(--ic-users); }
}
.ex-tabs {
  --ic-feed:   url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 11a9 9 0 0 1 9 9'/%3E%3Cpath d='M4 4a16 16 0 0 1 16 16'/%3E%3Ccircle cx='5' cy='19' r='1'/%3E%3C/svg%3E");
  --ic-notes:  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7'/%3E%3Cpath d='M18.5 2.5a2.12 2.12 0 0 1 3 3L12 15l-4 1 1-4z'/%3E%3C/svg%3E");
  --ic-supply: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71'/%3E%3Cpath d='M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71'/%3E%3C/svg%3E");
  --ic-grid:   url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7' height='7' rx='1'/%3E%3Crect x='14' y='3' width='7' height='7' rx='1'/%3E%3Crect x='14' y='14' width='7' height='7' rx='1'/%3E%3Crect x='3' y='14' width='7' height='7' rx='1'/%3E%3C/svg%3E");
  --ic-users:  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M22 21v-2a4 4 0 0 0-3-3.87'/%3E%3Cpath d='M16 3.13a4 4 0 0 1 0 7.75'/%3E%3C/svg%3E");
  --ic-comp:   url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3v18h18'/%3E%3Cpath d='M18 17V9'/%3E%3Cpath d='M13 17V5'/%3E%3Cpath d='M8 17v-3'/%3E%3C/svg%3E");
}

/* ── Feed filter panel (mig 346) — kebab-style, matches the ripple pill ── */
.ex-feedbar > .ex-ripple { margin-left: auto; }
.ex-filter { position: relative; }
.ex-filter-btn { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--muted); background: var(--ivory); border: 0; border-radius: var(--pill); padding: 8px 15px; cursor: pointer; transition: color .15s; }
.ex-filter-btn:hover, .ex-filter-btn.on { color: var(--black); }
.ex-filter-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--black); }
/* bright active-filter COUNT badge (shared MDXFilter) — reads "how many facets are set" at a glance */
.ex-filter-count { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px;
  padding: 0 5px; border-radius: 9px; background: #ff5a3c; color: #fff; font-size: 11px; font-weight: 800;
  font-variant-numeric: tabular-nums; line-height: 1; box-shadow: 0 1px 4px rgba(255, 90, 60, .45); }
.ex-filter-count[hidden] { display: none; }
.ex-filter-pop { position: absolute; right: 0; top: 46px; z-index: 60; width: 328px; max-width: 88vw; background: #fff; border: 1px solid var(--line, #e7e2d8); border-radius: 16px; box-shadow: 0 18px 50px rgba(0,0,0,.16); flex-direction: column; overflow: hidden; max-height: min(78vh, 600px); display: none; }
.ex-filter-pop:not([hidden]) { display: flex; }   /* hidden by default; only rendered when the user opens it (JS drops [hidden]) */
.ex-filter-head { display: none; align-items: center; justify-content: space-between; padding: 13px 16px; border-bottom: 1px solid var(--line, #efeae0); font-weight: 800; font-size: 15px; }  /* desktop = popover (no header); mobile = modal title bar */
.ex-filter-x { background: none; border: 0; font-size: 15px; color: var(--muted); cursor: pointer; padding: 4px; line-height: 1; }
.ex-filter-scroll { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.ex-filter-backdrop { display: none; }
.ex-filter-sec { padding: 11px 14px; border-bottom: 1px solid var(--line, #efeae0); }
.ex-filter-sec:last-of-type { border-bottom: 0; }
.ex-filter-h { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 9px; }
.ex-filter-chips { display: flex; flex-wrap: wrap; gap: 6px; max-height: 132px; overflow-y: auto; }
.ex-fchip { font-size: 12.5px; font-weight: 600; color: var(--muted); background: var(--ivory); border: 0; border-radius: var(--pill); padding: 5px 11px; cursor: pointer; }
.ex-fchip:hover { color: var(--black); }
.ex-fchip.sel { color: #fff; background: var(--black); }
.ex-filter-broad { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer; }
.ex-filter-broad input { accent-color: var(--black); }
.ex-filter-seg { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.ex-filter-seg button { font-size: 12.5px; font-weight: 700; color: var(--muted); background: var(--ivory); border: 0; border-radius: var(--pill); padding: 6px 12px; cursor: pointer; }
.ex-filter-seg button.on { color: #fff; background: var(--black); }
.ex-filter-foot { display: flex; justify-content: space-between; align-items: center; padding: 11px 14px; background: #fff; border-top: 1px solid var(--line, #efeae0); }
.ex-filter-clear { font-size: 13px; font-weight: 700; color: var(--muted); background: none; border: 0; cursor: pointer; }
.ex-filter-clear:hover { color: var(--black); }
.ex-filter-apply { font-size: 13px; font-weight: 800; color: #fff; background: var(--black); border: 0; border-radius: var(--pill); padding: 8px 20px; cursor: pointer; }
.ex-filter-pop .mut { color: var(--muted); font-size: 12.5px; }

/* selected-value chips (removable) + top-5 quick-add chips */
.ex-sel { max-height: none; margin-top: 9px; }
.ex-sel:empty { margin-top: 0; }
.ex-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ex-quick:empty { margin-top: 0; }
.ex-fx { font-size: 10px; opacity: .7; margin-left: 2px; }
.ex-fchip.sel .ex-fx:hover { opacity: 1; }

/* autocomplete */
.ex-ac { position: relative; }
.ex-ac-in { width: 100%; box-sizing: border-box; font-size: 13.5px; font-family: inherit; color: var(--black); background: var(--ivory); border: 1px solid transparent; border-radius: 10px; padding: 8px 11px; outline: none; }
.ex-ac-in:focus { border-color: var(--line, #e0dacb); background: #fff; }
.ex-ac-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 5; background: #fff; border: 1px solid var(--line, #e7e2d8); border-radius: 12px; box-shadow: 0 12px 34px rgba(0,0,0,.14); max-height: 240px; overflow-y: auto; padding: 4px; }
.ex-ac-item { display: block; width: 100%; text-align: left; font-size: 13px; font-weight: 600; color: var(--black); background: none; border: 0; border-radius: 8px; padding: 8px 10px; cursor: pointer; }
.ex-ac-item:hover { background: var(--ivory); }
.ex-ac-empty { padding: 9px 10px; font-size: 12.5px; }
.ex-ac.loading .ex-ac-in { padding-right: 32px; }
.ex-ac.loading::after { content: ''; position: absolute; right: 11px; top: 9px; width: 14px; height: 14px; border: 2px solid var(--line, #e0dacb); border-top-color: var(--muted); border-radius: 50%; animation: ex-ac-spin .7s linear infinite; }
@keyframes ex-ac-spin { to { transform: rotate(360deg); } }

/* skeleton shown while the theme's facets load (country chips + sector tree) */
.ex-sk { display: inline-block; vertical-align: middle; border-radius: 7px; background: linear-gradient(90deg, var(--ivory) 25%, #efeae0 37%, var(--ivory) 63%); background-size: 400% 100%; animation: ex-sk-shimmer 1.3s ease infinite; }
.ex-sk-chip { height: 27px; width: 96px; border-radius: var(--pill); margin: 0 6px 7px 0; }
.ex-sk-chip:nth-child(2) { width: 72px; } .ex-sk-chip:nth-child(3) { width: 108px; } .ex-sk-chip:nth-child(4) { width: 64px; }
.ex-tree .ex-trow .ex-sk-row { height: 13px; width: 58%; margin-left: 20px; }
.ex-tree .ex-trow:nth-child(even) .ex-sk-row { width: 44%; }
@keyframes ex-sk-shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.ex-ac-in:disabled { opacity: .5; cursor: default; }

/* GICS tree */
.ex-tree { max-height: 260px; overflow-y: auto; margin-top: 9px; }
.ex-trow { display: flex; align-items: center; gap: 4px; padding: 3px 0; }
.ex-ttog { flex: 0 0 16px; text-align: center; font-size: 10px; color: var(--muted); cursor: pointer; user-select: none; }
.ex-ttog.empty { cursor: default; opacity: .35; }
.ex-tlabel { display: flex; align-items: center; gap: 7px; flex: 1; min-width: 0; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.ex-tlabel input { accent-color: var(--black); flex: 0 0 auto; }
.ex-tname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--black); }
.ex-tn { flex: 0 0 auto; font-size: 11px; font-weight: 700; color: var(--muted); }

/* ── mobile: centered scrollable modal with a sticky Clear/Apply footer ── */
@media (max-width: 640px) {
  .ex-filter-backdrop:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 70; background: rgba(20,16,12,.44); }   /* hidden by default (base rule); shown only when opened */
  .ex-filter-pop { position: fixed; z-index: 71; top: 50%; left: 50%; right: auto; transform: translate(-50%, -50%); width: 92vw; max-width: 440px; max-height: 84vh; border-radius: 18px; }
  .ex-filter-head { display: flex; }
  .ex-filter-scroll { flex: 1 1 auto; min-height: 0; }
  .ex-filter-foot { position: sticky; bottom: 0; }
  .ex-filter-apply { padding: 10px 26px; }
  body.ex-filter-open { overflow: hidden; }
}
