/* Topics & Mandate · Global Discovery (renderGlobalDiscoveryPanel, class tm-gx on the host).
   Loaded after theme-lock.css. The page scrolls; no box inside it scrolls on its own. */
body[data-page="topics-mandates"] .tm-global-discovery-results.tm-gx {
  max-height: none !important;
  overflow: visible !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: none !important;
  box-shadow: none !important;
}
body[data-page="topics-mandates"] .tm-global-discovery-results.tm-gx::before { display: none; }

.tm-gx { color: var(--ma-page-ink, #16211d); font-family: var(--font-ui, inherit); }

/* Header: the Atlas globe, what this is, what was found */
.tm-gx-head {
  display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center;
  padding: 18px 22px; margin-bottom: 14px; border-radius: var(--ma-panel-radius, 16px);
  border: 1px solid var(--ma-page-line, rgba(83, 103, 94, 0.14));
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(37, 99, 235, 0.08) 0%, rgba(37, 99, 235, 0) 55%),
    radial-gradient(90% 120% at 100% 100%, rgba(217, 154, 34, 0.07) 0%, rgba(217, 154, 34, 0) 60%),
    var(--ma-surface-raised, #fff);
}
.tm-gx-globe { width: 84px; height: auto; filter: drop-shadow(0 6px 14px rgba(20, 94, 168, 0.18)); }
.tm-gx-eyebrow {
  margin: 0 0 4px; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: #145ea8;
}
.tm-gx-eyebrow span { color: #d99a22; margin-right: 4px; }
.tm-gx-h {
  margin: 0 0 6px; font-family: var(--font-display, inherit); font-size: 1.35rem; font-weight: 600;
  letter-spacing: -0.01em; line-height: 1.25; text-wrap: balance;
}
.tm-gx-lead { margin: 0; max-width: 78ch; font-size: 0.92rem; line-height: 1.55; color: var(--ma-page-muted, #566861); }

/* Source tabs */
.tm-gx-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.tm-gx-tab {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px;
  border: 1px solid var(--ma-page-line-strong, rgba(83, 103, 94, 0.25)); border-radius: 999px;
  background: var(--ma-surface-raised, #fff); color: var(--ma-page-ink, #16211d);
  font: inherit; font-size: 0.84rem; font-weight: 500; cursor: pointer;
  transition: background-color 160ms cubic-bezier(0.22, 1, 0.36, 1), border-color 160ms cubic-bezier(0.22, 1, 0.36, 1), transform 120ms ease-out;
}
.tm-gx-tab span { font-size: 0.76rem; font-variant-numeric: tabular-nums; color: var(--ma-page-muted, #566861); }
.tm-gx-tab:hover { border-color: var(--ma-action, #276ef1); }
.tm-gx-tab:active { transform: scale(0.97); }
.tm-gx-tab.is-active { background: var(--ma-action-strong, #1859cc); border-color: var(--ma-action-strong, #1859cc); color: #fff; }
.tm-gx-tab.is-active span { color: rgba(255, 255, 255, 0.82); }
.tm-gx-tab:focus-visible, .tm-gx-more:focus-visible, .tm-gx-mep:focus-visible, .tm-gx-title:focus-visible, .tm-gx-ref--btn:focus-visible {
  outline: 2px solid var(--ma-action, #276ef1); outline-offset: 2px;
}

/* Source blocks */
/* Columns, not a grid row: a long block does not leave a hole beside a short one */
.tm-gx-grid { columns: 2 440px; column-gap: 14px; }
.tm-gx-grid > .tm-gx-sec { break-inside: avoid; margin-bottom: 14px; }
.tm-gx-sec {
  display: block; min-width: 0; padding: 16px 18px 12px; border-radius: var(--ma-panel-radius, 16px);
  border: 1px solid var(--ma-page-line, rgba(83, 103, 94, 0.14)); background: var(--ma-surface-raised, #fff);
  box-shadow: var(--ma-shadow-quiet, 0 1px 2px rgba(15, 23, 42, 0.04));
}
.tm-gx-sec[hidden] { display: none; }
.tm-gx-sec-head { display: flex; align-items: center; gap: 9px; }
.tm-gx-ico { width: 18px; height: 18px; color: #145ea8; flex: none; }
.tm-gx-sec-head h4 { margin: 0; font-family: var(--font-display, inherit); font-size: 1.02rem; font-weight: 600; }
.tm-gx-count {
  margin-left: auto; min-width: 28px; padding: 1px 8px; border-radius: 999px; text-align: center;
  font-size: 0.78rem; font-weight: 600; font-variant-numeric: tabular-nums;
  background: var(--ma-action-soft, rgba(39, 110, 241, 0.12)); color: var(--ma-action-strong, #1859cc);
}
.tm-gx-desc { margin: 4px 0 8px; font-size: 0.82rem; line-height: 1.45; color: var(--ma-page-muted, #566861); }

.tm-gx-list { list-style: none; margin: 0; padding: 0; }
.tm-gx-row { padding: 11px 0; border-top: 1px solid var(--ma-page-line, rgba(83, 103, 94, 0.14)); min-width: 0; overflow-wrap: anywhere; }
.tm-gx-row[hidden] { display: none; }
.tm-gx-row > p { margin: 0; }
.tm-gx-row > * + * { margin-top: 4px; }

.tm-gx-title {
  display: block; padding: 0; border: 0; background: none; text-align: left; cursor: pointer;
  font: inherit; font-size: 0.95rem; font-weight: 600; line-height: 1.4; color: var(--ma-page-ink, #16211d); text-decoration: none;
}
/* theme-lock.css gives every button in the page inline-flex !important: a title with a <mark>
   inside then splits into side-by-side columns ("Opport / unities / a-n-d"). */
body[data-page] .tm-gx button.tm-gx-title { display: block !important; width: 100%; text-align: left; }
a.tm-gx-title:hover, button.tm-gx-title:hover { color: var(--ma-action-strong, #1859cc); text-decoration: underline; text-underline-offset: 3px; }
.tm-gx-line { font-size: 0.92rem; font-weight: 500; line-height: 1.45; }
.tm-gx-who { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 0.9rem; }
.tm-gx-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; margin-right: -4px; }
.tm-gx-mep {
  padding: 0; border: 0; background: none; cursor: pointer; font: inherit; font-weight: 600;
  color: var(--ma-action-strong, #1859cc); text-decoration: none;
}
.tm-gx-mep:hover { text-decoration: underline; text-underline-offset: 3px; }
.tm-gx-faint { font-size: 0.8rem; color: var(--ma-page-muted, #566861); }
.tm-gx-ref {
  font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 0.78rem; color: var(--ma-page-muted, #566861);
}
.tm-gx-ref--btn {
  padding: 1px 7px; border: 1px solid var(--ma-page-line-strong, rgba(83, 103, 94, 0.25)); border-radius: 6px;
  background: var(--ma-surface-soft, #f4f7f6); color: var(--ma-action-strong, #1859cc); cursor: pointer;
}
.tm-gx-ref--btn:hover { border-color: var(--ma-action, #276ef1); }
.tm-gx-quote {
  padding-left: 12px; border-left: 3px solid rgba(20, 94, 168, 0.22);
  font-size: 0.9rem; line-height: 1.6; color: var(--ma-page-ink, #16211d);
}
.tm-gx-anchor {
  margin: 6px 0 4px; padding: 7px 10px; border-left: 3px solid var(--ma-action, #276ef1); border-radius: 4px;
  background: var(--ma-action-soft, rgba(39, 110, 241, 0.08)); font-size: 0.86rem; line-height: 1.55;
}
.tm-gx-anchor strong { font-weight: 600; }
.tm-gx-divider {
  margin: 0 0 8px !important; font-size: 0.74rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--ma-page-muted, #566861);
}
.tm-gx mark { background: rgba(217, 154, 34, 0.22); color: inherit; border-radius: 2px; padding: 0 1px; }
.tm-gx-meta { font-size: 0.8rem; line-height: 1.5; color: var(--ma-page-muted, #566861); }
.tm-gx-meta strong { font-weight: 600; color: var(--ma-page-ink, #16211d); }
.tm-gx-ext { color: var(--ma-action-strong, #1859cc); text-decoration: none; white-space: nowrap; }
.tm-gx-ext:hover { text-decoration: underline; }

.tm-gx-row--mep { display: grid; grid-template-columns: 1fr auto; column-gap: 12px; align-items: center; }
.tm-gx-row--mep > * { grid-column: 1; }
.tm-gx-row--mep > * + * { margin-top: 2px; }
.tm-gx-score {
  grid-column: 2; grid-row: 1 / span 2; position: relative; width: 84px; height: 8px; margin: 0 !important;
  border-radius: 999px; background: var(--ma-surface-soft, #eef2f0);
}
.tm-gx-score i { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: linear-gradient(90deg, #2563eb, #145ea8); }
.tm-gx-score b { position: absolute; right: 0; top: -18px; font-size: 0.72rem; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ma-page-muted, #566861); }

.tm-gx-more {
  display: block; width: 100%; margin-top: 4px; padding: 9px 0 3px; border: 0;
  border-top: 1px solid var(--ma-page-line, rgba(83, 103, 94, 0.14)); background: none; cursor: pointer;
  font: inherit; font-size: 0.86rem; font-weight: 600; color: var(--ma-action-strong, #1859cc); text-align: left;
}
.tm-gx-more:hover { text-decoration: underline; text-underline-offset: 3px; }
.tm-gx-none { margin: 14px 2px 0; font-size: 0.82rem; color: var(--ma-page-muted, #566861); }

/* Entrance: sections fade up once when results arrive */
.tm-gx .tm-gx-sec { opacity: 0; transform: translateY(6px); transition: opacity 240ms cubic-bezier(0.22, 1, 0.36, 1), transform 240ms cubic-bezier(0.22, 1, 0.36, 1); }
.tm-gx.is-ready .tm-gx-sec { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .tm-gx .tm-gx-sec, .tm-gx-tab { transition: none; transform: none; }
}

@media (max-width: 640px) {
  .tm-gx-head { grid-template-columns: 1fr; gap: 10px; padding: 16px; }
  .tm-gx-globe { width: 64px; }
  .tm-gx-h { font-size: 1.15rem; }
  .tm-gx-tabs { flex-wrap: nowrap; overflow-x: auto; margin-inline: -4px; padding: 0 4px 4px; scrollbar-width: none; }
  .tm-gx-tab { flex: none; }
  .tm-gx-sec { padding: 14px 14px 10px; }
}

/* Topic Snapshot: a Topic Lens reading without roll-call votes hides the whole-mandate vote summary
   (topics-mandates.js setLensWithoutVotes). */
body[data-page] .tm-snapshot--lens-no-votes :is(.tm-snapshot-row, #tmKpiStrip, .tm-snapshot-guidance) { display: none !important; }
