/* MEP voting intelligence (mep-voting-intel.js): the cards under "Political Intelligence Overview"
   on the MEP card, fed by the prediction service. House tokens; gold marks a notable gap (red is
   kept for real alerts). */
.pm-vi { display: grid; gap: 12px; margin-bottom: 1rem; }
.pm-vi:empty { display: none; }
.pm-vi-basis { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--ma-page-muted, #566861); }
.pm-vi-basis::before, .pm-vi-basis::after { content: ""; height: 1px; flex: 1; background: var(--ma-page-line-strong, rgba(81,101,93,.22)); }
.pm-vi-card {
  display: grid; gap: 12px; min-width: 0; padding: 1.2rem 1.4rem;
  background: var(--ma-surface-raised, #fff); border: 1px solid var(--ma-page-line, rgba(81,101,93,.13));
  border-radius: 10px; box-shadow: 0 1px 2px rgba(15,23,42,.035); color: var(--ma-page-ink, #16211d);
}
/* Card titles keep the page's own h3 style (theme-lock.css), like the other cards. */
/* "Key divergence topics" in the overview card gives way to the topic card (parliament-members.js). */
#pmProfileDivergenceTopics[hidden] { display: none !important; }
.pm-vi-sub { margin: 0; max-width: 78ch; font-size: 13.5px; line-height: 1.5; color: var(--ma-page-muted, #566861); }
.pm-vi-sub b { color: var(--ma-page-ink, #16211d); font-weight: 600; }
.pm-vi-label { font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--ma-page-muted, #566861); }
.pm-vi-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; font-size: 12.5px; color: var(--ma-page-muted, #566861); }
.pm-vi-key { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; box-sizing: border-box; }
.pm-vi-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; }
.pm-vi-more { justify-self: start; padding: 0; border: 0; background: none; font: inherit; font-size: 13px; font-weight: 600; color: var(--ma-action-strong, #1859cc); cursor: pointer; }
.pm-vi-more:hover { text-decoration: underline; text-underline-offset: 3px; }
.pm-vi-more:focus-visible { outline: 2px solid var(--ma-action, #276ef1); outline-offset: 2px; }
.pm-vi-note { margin: 0; font-size: 12.5px; color: var(--ma-page-muted, #566861); }

/* 1. Topic by topic: one row per topic, dots on a 0–100% track */
.pm-vi-dumb { display: grid; }
.pm-vi-axis, .pm-vi-row { display: grid; grid-template-columns: minmax(0, 190px) minmax(0, 1fr) 74px 104px; gap: 12px; align-items: center; }
.pm-vi-axis { font-size: 11px; color: var(--ma-page-faint, #71817b); padding-bottom: 4px; }
.pm-vi-scale { position: relative; height: 14px; }
.pm-vi-scale span { position: absolute; transform: translateX(-50%); }
.pm-vi-scale span:first-child { transform: none; }
.pm-vi-scale span:last-child { transform: translateX(-100%); }
.pm-vi-row { padding-block: 6px; border-top: 1px solid var(--ma-page-line, rgba(81,101,93,.13)); font-size: 13.5px; }
.pm-vi-name { min-width: 0; }
.pm-vi-track { position: relative; height: 22px; background: linear-gradient(to right, transparent calc(50% - .5px), var(--ma-page-line, rgba(81,101,93,.13)) calc(50% - .5px), var(--ma-page-line, rgba(81,101,93,.13)) calc(50% + .5px), transparent calc(50% + .5px)); }
.pm-vi-line { position: absolute; top: 50%; height: 3px; margin-top: -1.5px; border-radius: 2px; background: var(--ma-page-line-strong, rgba(81,101,93,.22)); }
.pm-vi-line.is-gap { background: #c48a19; }
.pm-vi-pt { position: absolute; top: 50%; width: 13px; height: 13px; margin: -6.5px 0 0 -6.5px; border-radius: 50%; box-sizing: border-box; }
.pm-vi-pt.is-mep { background: var(--ma-page-ink, #16211d); }
.pm-vi-pt.is-ref { background: var(--ma-surface-raised, #fff); border: 2.5px solid var(--ma-page-muted, #566861); }
.pm-vi-gap { font-family: "IBM Plex Mono", ui-monospace, monospace; font-variant-numeric: tabular-nums; font-size: 12.5px; text-align: right; white-space: nowrap; color: var(--ma-page-muted, #566861); }
.pm-vi-gap.is-gap { color: #a8700e; font-weight: 600; }
.pm-vi-tag { font-size: 12px; color: var(--ma-page-muted, #566861); }

/* 2. Amendments by author group */
.pm-vi-bars { display: grid; gap: 8px; }
.pm-vi-bar { display: grid; grid-template-columns: 104px minmax(0, 1fr) 124px; gap: 10px; align-items: center; font-size: 13px; }
.pm-vi-bar-name { display: flex; align-items: center; gap: 6px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm-vi-bar-track { position: relative; height: 14px; border-radius: 4px; background: var(--ma-surface-soft, #f2f6f4); border: 1px solid var(--ma-page-line, rgba(81,101,93,.13)); }
.pm-vi-bar-fill { position: absolute; inset: 0 auto 0 0; border-radius: 3px; opacity: .78; }
.pm-vi-bar-tick { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; border-radius: 1px; background: var(--ma-page-ink, #16211d); }
.pm-vi-bar-num { font-family: "IBM Plex Mono", ui-monospace, monospace; font-variant-numeric: tabular-nums; font-size: 12px; color: var(--ma-page-muted, #566861); text-align: right; white-space: nowrap; }
.pm-vi-bar-num b { color: var(--ma-page-ink, #16211d); font-weight: 500; }
.pm-vi-callout { margin: 0; padding: 9px 12px; border-radius: 8px; font-size: 13.5px; background: rgba(217,154,34,.14); }

/* 3. Closest MEPs outside the group */
.pm-vi-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 16px; }
.pm-vi-peers { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 7px; }
.pm-vi-peer { display: grid; grid-template-columns: minmax(0, 1fr) 80px 40px; gap: 8px; align-items: center; font-size: 13px; }
.pm-vi-peer-name { display: flex; align-items: center; gap: 7px; min-width: 0; }
.pm-vi-peer-name span:not(.pm-vi-dot):not(.pm-vi-new) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-vi-kbar { position: relative; height: 6px; border-radius: 3px; overflow: hidden; background: var(--ma-surface-soft, #f2f6f4); }
.pm-vi-kbar i { position: absolute; inset: 0 auto 0 0; border-radius: 3px; background: var(--ma-action, #276ef1); }
.pm-vi-k { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 12px; text-align: right; }
.pm-vi-new { flex: none; padding: 0 4px; border: 1px solid #b07a12; border-radius: 4px; font-size: 10px; font-weight: 600; color: #8a5f0c; }

/* 4. Trajectory */
.pm-vi-svg { display: block; width: 100%; height: auto; }
.pm-vi-svg text { font-family: inherit; font-size: 11px; fill: var(--ma-page-muted, #566861); }
.pm-vi-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); gap: 10px; }
.pm-vi-stat { display: grid; gap: 2px; padding: 10px 12px; border-radius: 8px; background: var(--ma-surface-soft, #f2f6f4); }
.pm-vi-stat b { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 17px; font-weight: 500; }
.pm-vi-stat span { font-size: 12px; color: var(--ma-page-muted, #566861); }
.pm-vi-stat b.is-gap { color: #a8700e; }
.pm-vi-foot { font-size: 12px; color: var(--ma-page-muted, #566861); padding-inline: 2px; }

@media (max-width: 640px) {
  .pm-vi-card { padding: 1rem; }
  .pm-vi-axis { display: none; }
  .pm-vi-row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 4px; }
  .pm-vi-name { grid-column: 1 / -1; font-weight: 500; }
  .pm-vi-track { grid-column: 1 / -1; }
  .pm-vi-gap { text-align: left; }
  .pm-vi-tag { text-align: right; }
  .pm-vi-bar { grid-template-columns: 80px minmax(0, 1fr); }
  .pm-vi-bar-num { grid-column: 2; text-align: left; }
}

/* 0. Independence from the group */
.pm-vi { position: relative; }
.pm-ind-head { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 2fr); gap: 14px; align-items: stretch; }
.pm-ind-hero { display: grid; align-content: center; gap: 4px; padding: 12px 14px; border-radius: 8px; background: var(--ma-surface-soft, #f2f6f4); }
.pm-ind-hero b { font-size: 34px; line-height: 1.05; font-weight: 600; letter-spacing: -.01em; }
.pm-ind-hero span:last-child { font-size: 12.5px; color: var(--ma-page-muted, #566861); }
.pm-ind-band { justify-self: start; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; letter-spacing: .02em;
  border: 1px solid var(--ma-page-line-strong, rgba(81,101,93,.28)); color: var(--ma-page-ink, #16211d); background: var(--ma-surface-raised, #fff); }
.pm-ind-band.is-high { border-color: var(--ma-action, #276ef1); color: var(--ma-action-strong, #1859cc); }
.pm-ind-band.is-low { color: var(--ma-page-muted, #566861); }
.pm-ind-facts { align-content: stretch; }
.pm-ind-facts b { font-size: 17px; }
.pm-vi-svg text.is-strong { fill: var(--ma-page-ink, #16211d); font-weight: 600; }
.pm-ind-hit { cursor: default; outline: none; }
.pm-ind-hit:hover circle:not([fill="transparent"]), .pm-ind-hit:focus circle:not([fill="transparent"]) { fill-opacity: 1; stroke: var(--ma-page-ink, #16211d); }
.pm-ind-hit:hover path, .pm-ind-hit:focus path { filter: brightness(.92); }
.pm-ind-outlook { margin: 0; padding: 9px 12px; border-left: 3px solid var(--ma-action, #276ef1); border-radius: 4px; font-size: 13.5px; background: var(--ma-action-soft, rgba(39,110,241,.08)); }
.pm-ind-proof { font-size: 13px; color: var(--ma-page-muted, #566861); }
.pm-ind-proof summary { cursor: pointer; font-weight: 600; color: var(--ma-action-strong, #1859cc); }
.pm-ind-proof p { margin: 8px 0 0; max-width: 82ch; line-height: 1.5; }
.pm-ind-table { margin-top: 10px; border-collapse: collapse; font-size: 12.5px; }
.pm-ind-table th, .pm-ind-table td { padding: 4px 12px 4px 0; text-align: left; border-bottom: 1px solid var(--ma-page-line, rgba(81,101,93,.13)); font-variant-numeric: tabular-nums; }
.pm-ind-table th { font-weight: 600; color: var(--ma-page-ink, #16211d); }
.pm-ind-table tr.is-me td { color: var(--ma-page-ink, #16211d); font-weight: 600; }
.pm-ind-tip { position: absolute; z-index: 5; display: grid; gap: 1px; max-width: 280px; padding: 7px 10px; border-radius: 6px; pointer-events: none;
  background: var(--ma-surface-raised, #fff); border: 1px solid var(--ma-page-line-strong, rgba(81,101,93,.22)); box-shadow: 0 6px 18px rgba(15,23,42,.12); font-size: 12.5px; }
.pm-ind-tip b { font-size: 14px; font-weight: 600; color: var(--ma-page-ink, #16211d); }
.pm-ind-tip span { color: var(--ma-page-muted, #566861); }
@media (max-width: 640px) {
  .pm-ind-head { grid-template-columns: 1fr; }
}
.pm-ind-tip[hidden] { display: none; }
.pm-vi-svg text.pm-ind-me { paint-order: stroke; stroke: var(--ma-surface-raised, #fff); stroke-width: 4px; stroke-linejoin: round; }
.pm-ind-key-line { display: inline-block; width: 16px; height: 2px; margin-right: 6px; vertical-align: 3px; border-radius: 1px; background: var(--ma-action, #276ef1); }
.pm-ind-key-band { display: inline-block; width: 16px; height: 10px; margin-right: 6px; vertical-align: -1px; border-radius: 2px; background: var(--ma-action, #276ef1); opacity: .16; }
.pm-ind-topic .pm-vi-bar-name { white-space: nowrap; }
.pm-ind-topic { grid-template-columns: minmax(0, 190px) minmax(0, 1fr) 136px; }
.pm-vi-note b { color: var(--ma-page-ink, #16211d); font-weight: 600; }
.pm-ind-party { display: grid; gap: 6px; }
.pm-ind-split { display: flex; gap: 2px; height: 14px; }
.pm-ind-seg { min-width: 3px; border-radius: 2px; }
.pm-ind-seg:first-child { border-radius: 4px 2px 2px 4px; }
.pm-ind-seg:last-child { border-radius: 2px 4px 4px 2px; }
.pm-ind-seg.is-party, .pm-ind-key-sq.is-party { background: var(--ma-action, #276ef1); }
.pm-ind-seg.is-alone, .pm-ind-key-sq.is-alone { background: var(--ma-page-ink, #16211d); opacity: .72; }
.pm-ind-seg.is-none, .pm-ind-key-sq.is-none { background: var(--ma-page-line-strong, rgba(81,101,93,.28)); }
.pm-ind-key-sq { display: inline-block; width: 10px; height: 10px; margin-right: 6px; vertical-align: -1px; border-radius: 2px; }
.pm-ind-seg:hover, .pm-ind-seg:focus { filter: brightness(.9); }
/* 3b. Who they write amendments with */
.pm-ct-peer { grid-template-columns: minmax(0, 1fr) 80px 40px; row-gap: 2px; }
.pm-ct-dossier { grid-column: 1 / -1; padding-left: 16px; font-size: 11.5px; color: var(--ma-page-muted, #566861); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-ct-stats b { font-size: 17px; }
