/* === GLOBAL NAVBAR === */
.global-navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 56px;
  background: #101a33;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 1000;
  box-shadow: 0 2px 8px 0 rgba(30,40,90,0.08);
  padding: 0 2rem;
}
.global-navbar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.global-navbar__logo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}
.global-navbar__title {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.global-navbar__links {
  display: flex;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.global-navbar__links a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  opacity: 0.85;
  transition: opacity 0.2s;
}
.global-navbar__links a.active,
.global-navbar__links a:hover {
  opacity: 1;
  border-bottom: 2px solid #3b82f6;
}
.global-navbar__user {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 1rem;
}
#navbarLogoutBtn {
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 6px 16px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}
#navbarLogoutBtn:hover {
  background: #2563eb;
}

/* body[data-page="news"] layout is handled by inline <style> in news.html */
/* Utility: nascondi pannelli non attivi */
.is-hidden {
  display: none !important;
}
/* Utility: hidden for feed panel buttons/badges */
.feed-btn-hidden {
  display: none !important;
}
/* === NEWS: Classes for removed inline styles (ep panels, empty states) === */
.ep-panel-header {
  padding: 6px 12px 0;
  flex-shrink: 0;
}
.ep-panel-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0 6px;
  font-size: 10px;
  color: var(--muted);
}
.ep-panel-btn-row {
  display: flex;
  gap: 6px;
}
.ep-panel-btn {
  font-size: 10px;
  padding: 2px 7px;
}
.feed-layout-mode-badge {
  display: none;
}
.flex-1 {
  flex: 1;
}
.ep-panel-actions-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ep-panel-label-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
  padding-right: 6px;
}
.np-empty-mt32 {
  margin-top: 32px;
}
.np-empty-mt18 {
  margin-top: 18px;
}
.np-empty-icon-24 {
  font-size: 24px;
  margin-bottom: 8px;
}
.np-empty-icon-22 {
  font-size: 22px;
  margin-bottom: 8px;
}
/* ═══════════════════════════════════════════════════════════════
   Mandate Atlas · NEWS Dashboard Shell
   ═══════════════════════════════════════════════════════════════ */
.dashboard-shell {
  display: flex;
  height: calc(100vh - 56px); /* subtract topbar height */
  background: var(--np-bg, #f0f4fa);
  overflow: hidden;
}

/* ── Sidebar ──────────────────────────────────────────────────── */
.dashboard-sidebar {
  width: 264px;
  min-width: 264px;
  flex-shrink: 0;
  background: #0c1628;
  color: #fff;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin; /* Firefox 64+ */
  scrollbar-color: rgba(255,255,255,0.08) transparent; /* Firefox 64+ */
  border-right: 1px solid rgba(255,255,255,0.05);
  z-index: 10;
}
.dashboard-sidebar::-webkit-scrollbar { width: 4px; }
.dashboard-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 2px; }

/* Section label (FILTERS, WORKSPACE) */
.sidebar-section-head {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #3a5070;
  padding: 1.3rem 1.1rem 0.45rem 1.1rem;
  -webkit-user-select: none;
  user-select: none;
}

/* Search */
.sidebar-search-wrap {
  position: relative;
  padding: 0 1rem 0.6rem 1rem;
}
.sidebar-search-input {
  width: 100%;
  box-sizing: border-box;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 8px;
  color: #d0ddf0;
  font-size: 0.84rem;
  padding: 0.5rem 2.1rem 0.5rem 0.75rem;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
  font-family: inherit;
}
.sidebar-search-input:focus {
  border-color: rgba(80,150,255,0.45);
  background: rgba(255,255,255,0.09);
}
.sidebar-search-btn {
  position: absolute;
  right: 1.35rem;
  top: 50%;
  transform: translateY(-60%);
  background: none;
  border: none;
  color: #3a5070;
  cursor: pointer;
  padding: 0.15rem;
  display: flex;
  align-items: center;
  transition: color 0.13s;
}
.sidebar-search-btn:hover { color: #7eb8ff; }

/* Filters */
.sidebar-filters {
  padding: 0 1rem 0.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.sidebar-filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}
.sidebar-filter-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #3a5070;
}
.sidebar-filter-ctrl {
  width: 100%;
  box-sizing: border-box;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 7px;
  color: #b8ccec;
  font-size: 0.83rem;
  padding: 0.4rem 0.6rem;
  outline: none;
  font-family: inherit;
  transition: border-color 0.13s;
}
.sidebar-filter-ctrl:focus { border-color: rgba(80,150,255,0.45); }
.sidebar-filter-ctrl option { background: #0c1628; color: #b8ccec; }

.sidebar-checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.83rem;
  color: #8aadcc;
  cursor: pointer;
  padding: 0.1rem 0;
  -webkit-user-select: none;
  user-select: none;
}
.sidebar-checkbox-row input[type="checkbox"] { accent-color: #3b82f6; cursor: pointer; }

.sidebar-reset-btn {
  margin-top: 0.15rem;
  background: none;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 7px;
  color: #3a5070;
  font-size: 0.78rem;
  font-family: inherit;
  padding: 0.38rem 0.75rem;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.13s, color 0.13s;
}
.sidebar-reset-btn:hover { border-color: rgba(80,150,255,0.35); color: #7eb8ff; }

/* Divider */
.sidebar-divider {
  height: 1px;
  background: rgba(255,255,255,0.05);
  margin: 0.9rem 1rem 0 1rem;
}

/* Panel navigation */
.sidebar-panel-nav {
  display: flex;
  flex-direction: column;
  padding: 0.35rem 0.7rem;
  gap: 0.1rem;
}
.sidebar-panel-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  background: none;
  border: none;
  color: #5a7898;
  font-size: 0.86rem;
  font-family: inherit;
  font-weight: 500;
  padding: 0.58rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s, color 0.12s;
  white-space: nowrap;
}
.sidebar-panel-link:hover {
  background: rgba(255,255,255,0.06);
  color: #c0d8f0;
}
.sidebar-panel-link.active {
  background: rgba(59,130,246,0.16);
  color: #7eb8ff;
  font-weight: 600;
}
.sidebar-panel-link svg {
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity 0.12s;
}
.sidebar-panel-link.active svg,
.sidebar-panel-link:hover svg { opacity: 1; }

/* Bottom ingest button */
.sidebar-foot {
  margin-top: auto;
  padding: 1.4rem 1rem 1.2rem 1rem;
}
.sidebar-ingest-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  background: rgba(59,130,246,0.12);
  border: 1px solid rgba(59,130,246,0.28);
  border-radius: 9px;
  color: #7eb8ff;
  font-size: 0.85rem;
  font-family: inherit;
  font-weight: 600;
  padding: 0.62rem;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: background 0.14s, border-color 0.14s, color 0.14s;
}
.sidebar-ingest-btn:hover {
  background: rgba(59,130,246,0.22);
  border-color: rgba(59,130,246,0.5);
  color: #a8d0ff;
}

/* ── Main content area ─────────────────────────────────────────── */
.dashboard-main {
  flex: 1 1 0%;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}
.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border-bottom: 1px solid #e3e8f0;
  padding: 0.9rem 1.8rem;
  flex-shrink: 0;
  min-height: 56px;
}
.dashboard-header-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: #1a2340;
  letter-spacing: 0.01em;
}
.dashboard-header-actions {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.dashboard-content {
  flex: 1 1 0%;
  padding: 1.6rem 1.8rem 2rem 1.8rem;
  background: var(--np-bg, #f0f4fa);
  overflow-y: auto;
  overflow-x: hidden;
}

.news-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1.25rem;
  margin-top: 0.5rem;
  margin-bottom: 2rem;
}
.news-card {
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 1px 4px 0 rgba(30,40,90,0.06);
  border: 1px solid #e3e8f0;
  padding: 1.1rem 1.2rem 1rem 1.2rem;
  display: flex;
  flex-direction: column;
  min-height: 160px;
  transition: box-shadow 0.16s, border-color 0.16s;
}
.news-card:hover {
  box-shadow: 0 4px 14px 0 rgba(30,40,90,0.1);
  border-color: #90b4ff;
}

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .dashboard-shell {
    flex-direction: column;
    height: auto;
  }
  .dashboard-sidebar {
    width: 100%;
    min-width: 0;
    flex-direction: row;
    flex-wrap: wrap;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0.5rem 1rem;
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    min-height: 52px;
  }
  .sidebar-section-head { display: none; }
  .sidebar-search-wrap { padding: 0.3rem 0.5rem; }
  .sidebar-filters { flex-direction: row; flex-wrap: wrap; gap: 0.4rem; padding: 0 0.5rem; }
  .sidebar-filter-group { min-width: 120px; }
  .sidebar-panel-nav { flex-direction: row; flex-wrap: wrap; padding: 0.3rem 0.5rem; gap: 0.2rem; }
  .sidebar-panel-link { padding: 0.4rem 0.6rem; font-size: 0.8rem; white-space: nowrap; }
  .sidebar-foot { padding: 0.5rem; margin-top: 0; }
  .sidebar-divider { display: none; }
  .dashboard-header, .dashboard-content { padding-left: 1rem; padding-right: 1rem; }
}
/* ── Decision Snapshot (MEP overlay) ─────────────────────────────── */
    .mep-card-section-title {
      font-size: 13px;
      font-weight: 900;
      color: var(--il-blue);
      margin-bottom: 8px;
      letter-spacing: 0.06em;
      text-transform: uppercase;
    }
    .mep-snapshot-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
      gap: 10px;
      margin-bottom: 6px;
    }
    .mep-metric-cell {
      background: #fff;
      border: 1px solid var(--border);
      border-radius: 10px;
      box-shadow: 0 2px 8px rgba(15,23,42,0.05);
      padding: 12px 10px 10px 12px;
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      min-width: 0;
      transition: box-shadow 0.2s, transform 0.2s;
    }
    .mep-metric-cell:hover {
      box-shadow: 0 4px 16px rgba(15,23,42,0.10);
      transform: translateY(-2px);
    }
    .mep-metric-label {
      font-size: 11px;
      color: var(--muted);
      font-weight: 700;
      margin-bottom: 2px;
      letter-spacing: 0.01em;
    }
    .mep-metric-value {
      font-size: 22px;
      font-weight: 900;
      color: var(--text);
      line-height: 1.1;
    }
    .mep-metric-sub {
      font-size: 10px;
      color: var(--muted);
      font-weight: 600;
      margin-top: 2px;
    }
    .mep-priority-bar {
      width: 100%;
      height: 6px;
      background: #f3f4f6;
      border-radius: 6px;
      overflow: hidden;
      margin-top: 4px;
      margin-bottom: 2px;
    }
    .mep-priority-fill {
      height: 100%;
      background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 100%);
      border-radius: 6px;
      transition: width 0.5s cubic-bezier(0.25,0.46,0.45,0.94);
    }
    :root{
      /* ── Core surfaces ── */
      --bg: #f6f7f9;
      --bg-2: #f1f5f9;
      --card: #ffffff;
      --bg-base: #f6f7f9;
      --bg-surface: #ffffff;
      --card-bg: #ffffff;

      /* ── Text ── */
      --text: #0f172a;
      --muted: #64748b;
      --text-primary: #0f172a;
      --text-secondary: #64748b;

      /* ── Borders + Elevation ── */
      --border: #e2e8f0;
      --border-subtle: #f1f5f9;
      --shadow: 0 1px 3px rgba(15,23,42,.06), 0 4px 16px rgba(15,23,42,.04);
      --shadow-md: 0 4px 20px rgba(15,23,42,.08);
      --shadow-lift: 0 8px 24px rgba(15,23,42,.09), 0 2px 6px rgba(15,23,42,.05);

      /* ── Accent palette ── */
      --il-blue: #2563eb;
      --il-gold: #f59e0b;
      --renew: #f59e0b;
      --accent-primary: #2563eb;
      --accent-support: #c2410c;
      --accent-success: #16a34a;

      /* ── Chrome ── */
      --topbar-bg: #0f172a;
      --topbar-border: #1e293b;

      /* ── Radii ──
         --radius-sm/-md/-lg consolidated: this legacy block used to redefine
         them as 6/8/12px, but a later :root (Premium Intelligence UI System,
         ~line 20480) redeclares the same names at 10/14/20px with no
         !important — being later in source order at equal specificity, that
         block wins the cascade and is the sole remaining definition. */
      --card-radius: 14px;

      /* ── Spacing scale ── */
      --sp-1: 4px;
      --sp-2: 8px;
      --sp-3: 12px;
      --sp-4: 16px;
      --sp-5: 24px;
      --sp-6: 32px;

      /* ── Typography ── */
      --font-display: 'Inter', 'Helvetica Neue', Arial, sans-serif;
      --font-ui: 'Inter', 'Helvetica Neue', Arial, sans-serif;
      --surface-glass: linear-gradient(160deg, rgba(255, 255, 255, 0.96) 0%, rgba(244, 248, 255, 0.9) 100%);
      --surface-strong: linear-gradient(160deg, rgba(255, 255, 255, 0.98) 0%, rgba(240, 246, 255, 0.98) 100%);
      --stroke-soft: rgba(148, 163, 184, 0.34);
    }

    *{ box-sizing:border-box; }
    :focus { outline: none; }
    :focus-visible {
      outline: 2px solid var(--il-blue);
      outline-offset: 2px;
      border-radius: var(--radius-sm);
    }
    html,
    body{
      margin:0;
      font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
      background: #f4f7fb;
      color:var(--text);
      min-height:100vh;
      padding-top: 0;
      line-height: 1.55;
    }

    .navbar {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      background: rgba(255, 255, 255, 0.98);
      -webkit-backdrop-filter: blur(10px);
      backdrop-filter: blur(10px);
      border-bottom: 2px solid var(--il-blue);
      box-shadow: 0 2px 10px rgba(0,102,204,.1);
      z-index: 1000;
    }
    .navbar-content {
      max-width: 1600px;
      margin: 0 auto;
      padding: 12px 24px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 20px;
      flex-wrap: wrap;
    }
    .navbar-brand {
      font-size: 20px;
      font-weight: 900;
      color: var(--il-blue);
      display: flex;
      align-items: center;
      gap: 10px;
    }
    .navbar-brand .logo {
      width: 36px;
      height: 36px;
      background: linear-gradient(135deg, var(--il-blue) 0%, #0052a3 100%);
      border-radius: 8px;
      display: flex;
      align-items: center;
      justify-content: center;
      color: #fff;
      font-weight: 900;
      font-size: 18px;
    }
    .navbar-nav {
      display: flex;
      gap: 10px;
      align-items: center;
      flex-wrap: wrap;
    }
    .nav-btn {
      padding: 8px 18px;
      border-radius: 8px;
      border: 2px solid var(--border);
      background: #fff;
      color: var(--text);
      cursor: pointer;
      font-size: 14px;
      font-weight: 700;
      transition: all 0.2s;
      display: flex;
      align-items: center;
      gap: 6px;
    }
    .nav-btn:hover {
      border-color: var(--il-blue);
      background: #eff6ff;
      transform: translateY(-1px);
    }
    .nav-btn.primary {
      background: linear-gradient(135deg, var(--il-blue) 0%, #0052a3 100%);
      color: #fff;
      border-color: transparent;
    }
    .sessions-badge {
      background: rgba(245,158,11,0.15);
      color: #f59e0b;
      padding: 4px 10px;
      border-radius: 6px;
      font-size: 11px;
      font-weight: 700;
      border: 1px solid rgba(245,158,11,0.25);
    }
.live-update {
  background: rgba(37,99,235,0.15);
  color: #93c5fd;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid rgba(37,99,235,0.3);
  cursor: pointer;
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 1;
}
.live-update.is-info {
  background: rgba(37,99,235,0.15);
  color: #93c5fd;
  border-color: rgba(37,99,235,0.3);
}
.live-update.is-success {
  background: rgba(22,163,74,0.16);
  color: #86efac;
  border-color: rgba(22,163,74,0.34);
}
.live-update.is-warning {
  background: rgba(245,158,11,0.18);
  color: #fde68a;
  border-color: rgba(245,158,11,0.34);
}
.live-update.is-error {
  background: rgba(220,38,38,0.2);
  color: #fecaca;
  border-color: rgba(220,38,38,0.36);
}

    .container{
      max-width: 1600px;
      margin: 0 auto;
      padding: 28px 24px 40px;
    }

    .header{
      text-align:center;
      margin-bottom: 32px;
      padding: 48px 20px 40px;
      background: none;
      border-radius: 0;
      border: none;
      border-bottom: 1px solid var(--border);
    }
    h1{
      margin:0;
      font-size:34px;
      font-weight:900;
      letter-spacing:-.03em;
      color: var(--text);
    }
    .subtitle{
      margin:12px auto 0;
      font-size:15px;
      color:var(--muted);
      line-height:1.7;
      max-width: 720px;
    }
    .il-badge {
      display: inline-block;
      background: var(--bg-2);
      color: var(--muted);
      padding: 5px 14px;
      border-radius: 999px;
      font-weight: 600;
      font-size: 11px;
      margin-top: 14px;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      border: 1px solid var(--border);
    }

    .panel{
      background:var(--card);
      border:1px solid var(--border);
      border-radius:12px;
      box-shadow: var(--shadow);
      padding: 24px 28px;
      margin-bottom: 20px;
    }
    .panel h2{
      margin:0 0 20px;
      font-size:18px;
      font-weight:800;
      display:flex;
      align-items:center;
      gap:10px;
      color: var(--text);
      letter-spacing: -0.01em;
    }

    .upload-zone {
      border: 3px dashed var(--border);
      border-radius: 16px;
      padding: 48px 32px;
      text-align: center;
      background: #fafbfc;
      transition: all 0.3s;
      cursor: pointer;
    }
    .upload-zone:hover {
      border-color: var(--il-blue);
      background: #eff6ff;
    }
    .upload-zone.drag-over {
      border-color: var(--il-gold);
      background: #fef3c7;
    }
    .upload-icon {
      font-size: 64px;
      margin-bottom: 16px;
      opacity: 0.6;
    }
    /* ── Lucide icon sizing ── */
    .h-icon {
      width: 1em;
      height: 1em;
      vertical-align: -0.125em;
      stroke-width: 2;
      flex-shrink: 0;
    }
    .upload-icon .h-icon {
      width: 56px;
      height: 56px;
    }
    .upload-title {
      font-size: 20px;
      font-weight: 800;
      color: var(--text);
      margin-bottom: 8px;
    }
    .upload-desc {
      font-size: 14px;
      color: var(--muted);
      margin-bottom: 20px;
    }
    .upload-btn {
      padding: 14px 32px;
      border-radius: 12px;
      border: none;
      background: linear-gradient(135deg, var(--il-blue) 0%, #0052a3 100%);
      color: #fff;
      cursor: pointer;
      font-size: 16px;
      font-weight: 800;
      box-shadow: 0 4px 12px rgba(0,102,204,.2);
      transition: all 0.2s;
    }
    .upload-btn:hover {
      transform: translateY(-2px);
      box-shadow: 0 6px 20px rgba(0,102,204,.3);
    }
    .upload-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 12px;
      justify-content: center;
      margin-top: 12px;
    }
    .upload-btn.secondary {
      background: #fff;
      color: var(--il-blue);
      border: 2px solid var(--il-blue);
      box-shadow: none;
    }
    .upload-btn.secondary:hover {
      background: #eff6ff;
      transform: translateY(-2px);
      box-shadow: 0 6px 20px rgba(0,102,204,.15);
    }

    .files-list {
      margin-top: 24px;
      max-height: 260px;
      overflow: auto;
      border: 1px solid var(--border);
      border-radius: 12px;
      background: #fff;
    }
    .files-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 12px;
    }
    .files-table th,
    .files-table td {
      padding: 10px 12px;
      border-bottom: 1px solid var(--border);
      text-align: left;
      vertical-align: middle;
    }
    .files-table th {
      position: sticky;
      top: 0;
      background: #f8fafc;
      font-weight: 800;
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: 0.03em;
      font-size: 11px;
      z-index: 1;
    }
    .files-table td .file-name {
      font-weight: 700;
      color: var(--text);
    }
    .files-table td .file-meta {
      color: var(--muted);
      font-size: 11px;
    }
    .files-table .file-index {
      font-weight: 800;
      color: var(--il-blue);
    }
    .file-item {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 14px 18px;
      background: #f8fafc;
      border: 1px solid var(--border);
      border-radius: 10px;
      font-size: 14px;
    }
    .file-info {
      display: flex;
      align-items: center;
      gap: 12px;
      flex: 1;
    }
    .file-icon {
      width: 36px;
      height: 36px;
      background: var(--il-blue);
      color: #fff;
      border-radius: 8px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: 900;
    }
    .file-name {
      font-weight: 700;
      color: var(--text);
    }
    .file-meta {
      color: var(--muted);
      font-size: 12px;
    }
    .remove-btn {
      padding: 6px 12px;
      background: #fee2e2;
      color: #991b1b;
      border: none;
      border-radius: 6px;
      cursor: pointer;
      font-size: 12px;
      font-weight: 700;
      transition: all 0.2s;
    }
    .remove-btn:hover {
      background: #fca5a5;
    }
    .session-toggle {
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 12px;
      font-weight: 700;
      color: var(--muted);
    }
    .session-toggle input {
      width: 16px;
      height: 16px;
      accent-color: var(--il-blue);
    }

    .loading-overlay {
      position: fixed;
      inset: 0;
      background: rgba(15, 23, 42, 0.35);
      display: none;
      align-items: center;
      justify-content: center;
      z-index: 2000;
      -webkit-backdrop-filter: blur(4px);
      backdrop-filter: blur(4px);
    }
    .loading-card {
      background: #fff;
      border-radius: 18px;
      padding: 28px 32px;
      width: min(420px, 92vw);
      box-shadow: 0 20px 50px rgba(15, 23, 42, 0.2);
      border: 2px solid var(--il-blue);
      text-align: center;
    }
    .tm-loading-orbit {
      position: relative;
      width: 72px;
      height: 72px;
      margin: 0 auto 14px;
      display: grid;
      place-items: center;
    }
    .tm-loading-ring {
      position: absolute;
      inset: 0;
      border-radius: 999px;
      border: 2px solid rgba(37, 99, 235, 0.18);
      border-top-color: rgba(37, 99, 235, 0.88);
      animation: tm-loading-spin 1.2s linear infinite;
    }
    .tm-loading-ring--inner {
      inset: 10px;
      border-width: 2px;
      border-color: rgba(29, 78, 216, 0.18);
      border-top-color: rgba(29, 78, 216, 0.86);
      animation-duration: 0.85s;
      animation-direction: reverse;
    }
    .tm-loading-logo {
      inline-size: 28px;
      block-size: 28px;
      filter: drop-shadow(0 4px 10px rgba(37, 99, 235, 0.28));
      animation: tm-loading-pulse 1.1s ease-in-out infinite;
    }
    .loading-title {
      font-size: 16px;
      font-weight: 800;
      color: var(--text);
      margin-bottom: 12px;
    }
    .progress-track {
      height: 10px;
      background: #e2e8f0;
      border-radius: 999px;
      overflow: hidden;
      margin: 8px 0 6px;
    }
    .progress-fill {
      height: 100%;
      width: 0%;
      background: linear-gradient(135deg, var(--il-blue) 0%, #0052a3 100%);
      transition: width 0.2s ease;
    }
    .loading-meta {
      font-size: 12px;
      color: var(--muted);
      font-weight: 700;
    }
    @keyframes tm-loading-spin {
      from { transform: rotate(0deg); }
      to { transform: rotate(360deg); }
    }
    @keyframes tm-loading-pulse {
      0%, 100% { transform: scale(1); opacity: 0.88; }
      50% { transform: scale(1.1); opacity: 1; }
    }
    body.is-loading {
      overflow: hidden;
    }
    .intel-target-picker-overlay {
      position: fixed;
      inset: 0;
      background: rgba(15, 23, 42, 0.45);
      display: none;
      align-items: center;
      justify-content: center;
      z-index: 2200;
      padding: 16px;
      -webkit-backdrop-filter: blur(3px);
      backdrop-filter: blur(3px);
    }
    .intel-target-picker-overlay.open {
      display: flex;
    }
    .intel-target-picker-card {
      width: min(560px, 96vw);
      border-radius: 16px;
      border: 1px solid #cbd5e1;
      background: #ffffff;
      box-shadow: 0 24px 60px rgba(15, 23, 42, 0.24);
      padding: 18px;
      display: grid;
      gap: 12px;
    }
    .intel-target-picker-card h3 {
      margin: 0;
      color: var(--il-blue);
      font-size: 20px;
      font-weight: 900;
    }
    .intel-target-picker-meta {
      margin: 0;
      color: #475569;
      font-size: 13px;
      font-weight: 700;
    }
    .intel-target-picker-actions {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
    }
    .intel-target-picker-btn {
      border: 1px solid #cbd5e1;
      border-radius: 10px;
      background: #f8fafc;
      color: #0f172a;
      font-size: 13px;
      font-weight: 800;
      padding: 10px 12px;
      cursor: pointer;
    }
    .intel-target-picker-btn.primary {
      border-color: #1d4ed8;
      background: #dbeafe;
      color: #1e3a8a;
    }
    .intel-target-picker-group {
      border-top: 1px dashed #dbe2ea;
      padding-top: 10px;
      display: grid;
      gap: 8px;
    }
    .intel-target-picker-group label {
      font-size: 12px;
      font-weight: 800;
      color: #475569;
    }
    .intel-target-picker-group-row {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      align-items: center;
    }
    .intel-target-picker-group-row select {
      flex: 1 1 220px;
      border: 1px solid #cbd5e1;
      border-radius: 10px;
      padding: 9px 10px;
      background: #ffffff;
      font-size: 13px;
      font-weight: 700;
    }
    .intel-target-picker-skip {
      border: none;
      background: transparent;
      color: #1d4ed8;
      font-size: 12px;
      font-weight: 800;
      text-align: left;
      padding: 0;
      cursor: pointer;
    }

    .benchmark-controls {
      display: flex;
      flex-direction: column;
      gap: 12px;
      margin-bottom: 18px;
      padding: 16px;
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      background: #f8fafc;
    }

    .list-controls {
      display: flex;
      flex-wrap: wrap;
      gap: 12px;
      align-items: center;
      justify-content: space-between;
      margin: 12px 0 14px;
      background: linear-gradient(168deg, rgba(255,255,255,0.96) 0%, rgba(248, 251, 255, 0.96) 100%);
      border: 1px solid rgba(148, 163, 184, 0.26);
      border-radius: 14px;
      padding: 12px 13px;
      box-shadow: 0 5px 18px rgba(15,23,42,0.05), inset 0 1px 0 rgba(255,255,255,0.82);
    }
    .search-wrap {
      display: flex;
      align-items: center;
      gap: 8px;
      flex: 1;
      min-width: 240px;
    }
    .search-input {
      flex: 1;
      padding: 10px 12px;
      border-radius: 10px;
      border: 2px solid var(--border);
      font-size: 14px;
      font-weight: 600;
      background: #fff;
    }
    .search-input:focus {
      outline: none;
      border-color: var(--il-blue);
      box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
    }
    .clear-btn {
      padding: 8px 12px;
      border-radius: 8px;
      border: 1px solid var(--border);
      background: #fff;
      font-size: 12px;
      font-weight: 800;
      cursor: pointer;
      color: var(--muted);
      transition: border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
    }
    .clear-btn:hover {
      border-color: rgba(37, 99, 235, 0.42);
      color: #1d4ed8;
      box-shadow: 0 4px 14px rgba(29, 78, 216, 0.12);
      transform: translateY(-1px);
    }
    .control-btn {
      padding: 8px 12px;
      border-radius: 8px;
      border: 1px solid var(--border);
      background: #fff;
      font-size: 12px;
      font-weight: 800;
      cursor: pointer;
      color: var(--muted);
      transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease, background-color 0.16s ease, color 0.16s ease;
    }
    .control-btn:hover {
      border-color: rgba(37, 99, 235, 0.4);
      color: #1d4ed8;
      box-shadow: 0 4px 14px rgba(29, 78, 216, 0.12);
      transform: translateY(-1px);
    }
    /* .control-btn.primary base rule removed: every page sets a data-page
       attribute on <body>, so the scoped body[data-page] .control-btn.primary
       rule (~line 27426) always wins with !important — this base rule had
       zero live effect on any page. */
    .control-btn.danger {
      background: #fee2e2;
      color: #991b1b;
      border-color: #fecaca;
    }
    .control-group {
      display: flex;
      align-items: center;
      gap: 12px;
      flex-wrap: wrap;
    }
    .chip-group {
      display: flex;
      gap: 6px;
      flex-wrap: wrap;
    }
        .chip:hover {
      border-color: rgba(37, 99, 235, 0.4);
      color: #1d4ed8;
      box-shadow: 0 4px 12px rgba(29, 78, 216, 0.1);
      transform: translateY(-1px);
    }
        .sort-wrap {
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 12px;
      font-weight: 800;
      color: var(--muted);
    }
    .mandate-term-filter {
      flex-direction: column;
      align-items: flex-start;
      gap: 6px;
    }
    .mandate-term-filter .chip {
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }
    .mandate-term-note {
      margin: 0;
      font-size: 11px;
      font-weight: 700;
      max-width: 240px;
      line-height: 1.35;
    }
    .sort-wrap select {
      padding: 6px 10px;
      border-radius: 8px;
      border: 1px solid var(--border);
      font-weight: 700;
    }
    .list-meta {
      font-size: 12px;
      color: var(--muted);
      margin-bottom: 12px;
      font-weight: 700;
    }
    .ep-graph-note {
      border: 1px solid rgba(30, 64, 175, 0.2);
      background: linear-gradient(160deg, rgba(239,246,255,0.94) 0%, rgba(245,250,255,0.92) 100%);
      border-radius: 12px;
      padding: 10px 12px;
      margin-bottom: 10px;
      color: #334155;
      box-shadow: inset 0 1px 0 rgba(255,255,255,0.78);
    }

    .show-more {
      display: flex;
      justify-content: center;
      margin-top: 16px;
    }
    .show-more-btn {
      padding: 10px 22px;
      border-radius: 10px;
      border: 2px solid var(--il-blue);
      background: #fff;
      font-size: 13px;
      font-weight: 800;
      color: var(--il-blue);
      cursor: pointer;
      transition: all 0.2s;
    }
    .show-more-btn:hover {
      background: var(--il-blue);
      color: #fff;
      transform: translateY(-1px);
    }

    .global-controls {
      display: flex;
      flex-wrap: wrap;
      gap: 16px;
      align-items: center;
      justify-content: space-between;
      margin: 8px 0 20px;
      background: #f8fafc;
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 12px 16px;
    }
    .threshold-control {
      display: flex;
      align-items: center;
      gap: 12px;
      font-size: 13px;
      font-weight: 800;
      color: var(--muted);
      flex-wrap: wrap;
    }
    .threshold-control input[type="range"] {
      width: 180px;
    }
    .threshold-control select {
      padding: 6px 10px;
      border-radius: 8px;
      border: 1px solid var(--border);
      font-weight: 700;
      background: #fff;
    }
    .threshold-value {
      font-size: 14px;
      font-weight: 900;
      color: var(--il-blue);
    }
    .threshold-note {
      font-size: 12px;
      font-weight: 700;
      color: var(--muted);
    }
    .compact-toggle {
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 13px;
      font-weight: 800;
      color: var(--muted);
    }
    .compact-toggle input {
      width: 16px;
      height: 16px;
      accent-color: var(--il-blue);
    }

    .il-benchmark-panel {
      background: linear-gradient(135deg, #eff6ff 0%, #fef3c7 100%);
      border: 3px solid var(--il-blue);
      padding: 32px;
      border-radius: 20px;
      margin-bottom: 24px;
    }
    .benchmark-mep {
      background: #fff;
      padding: 20px 32px;
      border-radius: 16px;
      box-shadow: 0 4px 12px rgba(0,0,0,.08);
      border: 2px solid var(--il-blue);
      text-align: center;
      min-width: 200px;
    }
    .benchmark-mep h3 {
      margin: 0 0 8px;
      font-size: 20px;
      font-weight: 900;
      color: var(--il-blue);
    }
    .benchmark-mep .role {
      font-size: 12px;
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: 0.05em;
      font-weight: 700;
    }
    .stat-card {
      background: #fff;
      padding: 16px;
      border-radius: 12px;
      text-align: center;
      border: 1px solid var(--border);
    }
        .stat-label {
      font-size: 12px;
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: 0.05em;
      margin-top: 4px;
    }

    .tabs {
      display: flex;
      gap: 8px;
      border-bottom: 1px solid rgba(148, 163, 184, 0.28);
      margin-bottom: 24px;
      padding-bottom: 2px;
    }
    .tab-btn {
      padding: 11px 18px;
      border: none;
      background: transparent;
      color: var(--muted);
      cursor: pointer;
      font-size: 14px;
      font-weight: 800;
      border-bottom: 2px solid transparent;
      border-radius: 11px 11px 0 0;
      transition: color 0.18s ease, border-color 0.18s ease, background-color 0.18s ease, transform 0.18s ease;
      position: relative;
      bottom: -1px;
    }
    .tab-btn:hover {
      color: var(--il-blue);
      background: rgba(219, 234, 254, 0.65);
    }
    .tab-btn.active {
      color: var(--il-blue);
      border-bottom-color: var(--il-blue);
      background: transparent;
      box-shadow: none;
    }

    .tab-content {
      display: none;
    }
    .tab-content.active {
      display: block;
    }

    .analytics-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
      gap: 18px;
      margin-bottom: 24px;
    }
    .chart-card {
      position: relative;
    }
    .chart-card::before {
      display: none;
      content: "";
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      height: 4px;
      background: linear-gradient(90deg, var(--il-blue) 0%, var(--il-gold) 100%);
      border-radius: 16px 16px 0 0;
      opacity: 0.72;
    }
        .chart-card h3 {
      margin: 0 0 14px;
      font-size: 11px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: .07em;
      color: var(--muted, #64748b);
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .chart-toggle {
      display: flex;
      gap: 6px;
      margin: -6px 0 12px;
    }
    .toggle-btn {
      padding: 6px 10px;
      border-radius: 999px;
      border: 1px solid var(--border);
      background: #fff;
      font-size: 11px;
      font-weight: 800;
      color: var(--muted);
      cursor: pointer;
    }
    .toggle-btn.active {
      background: var(--il-blue);
      color: #fff;
      border-color: transparent;
    }
    .chart-container {
      position: relative;
      height: 360px;
    }

    .delegation-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(450px, 1fr));
      gap: 20px;
    }
    .delegation-card {
      background: var(--card-bg, #fff);
      border: 1px solid var(--border-subtle, #e2e8f0);
      border-radius: 10px;
      overflow: hidden;
      box-shadow: 0 2px 8px rgba(15,23,42,0.05);
      transition: box-shadow 0.2s;
    }
        .delegation-card.renew {
      border-color: rgba(255,153,0,0.4);
      background: var(--card-bg, #fff);
    }
    .delegation-card.focus {
      border-color: var(--group-color, var(--il-blue));
      background: var(--card-bg, #fff);
    }

    .delegation-header {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      gap: 12px;
      padding: 20px 24px;
      border-bottom: 2px solid var(--border);
      background: linear-gradient(135deg, #fafbfc 0%, #f8fafc 100%);
    }
    .delegation-header-main {
      flex: 1;
    }
    .card-actions {
      display: flex;
      gap: 8px;
    }
    .card-action-btn {
      padding: 6px 10px;
      border-radius: 8px;
      border: 1px solid var(--border);
      background: #fff;
      font-size: 11px;
      font-weight: 800;
      color: var(--muted);
      cursor: pointer;
    }
    .card-action-btn:hover {
      border-color: var(--il-blue);
      color: var(--il-blue);
    }
    .delegation-card.renew .delegation-header {
      background: linear-gradient(135deg, #fff7ed 0%, #fef3c7 100%);
    }
    .delegation-title {
      font-size: 18px;
      font-weight: 900;
      margin: 0 0 8px;
      color: var(--text);
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .renew-badge {
      background: var(--renew);
      color: #fff;
      padding: 4px 10px;
      border-radius: 6px;
      font-size: 11px;
      font-weight: 800;
      text-transform: uppercase;
    }
    .focus-badge {
      background: var(--group-color, var(--il-blue));
      color: #fff;
      padding: 4px 10px;
      border-radius: 6px;
      font-size: 11px;
      font-weight: 800;
      text-transform: uppercase;
    }
    .delegation-meta {
      display: flex;
      gap: 16px;
      font-size: 13px;
      color: var(--muted);
      flex-wrap: wrap;
    }

    .mep-list {
      padding: 20px 24px;
      list-style: none;
      margin: 0;
      display: flex;
      flex-direction: column;
      gap: 12px;
    }
    .mep-item {
      padding: 14px;
      border-radius: 10px;
      border: 1px solid var(--border);
      background: #fafbfc;
      transition: all 0.2s;
      cursor: help;
    }
    .mep-item:hover {
      background: #fff;
      border-color: var(--il-blue);
      box-shadow: 0 2px 8px rgba(0,102,204,.1);
    }
    .mep-item.high-match {
      background: #d1fae5;
      border-color: #86efac;
    }
    .mep-item.medium-match {
      background: #dbeafe;
      border-color: #93c5fd;
    }
    .mep-item.low-match {
      background: #fee2e2;
      border-color: #fca5a5;
    }
    .mep-item.divergent {
      background: #fef3c7;
      border-color: #fcd34d;
      border-left: 4px solid #f59e0b;
    }

    .mep-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 8px;
    }
    .mep-name {
      font-size: 15px;
      font-weight: 800;
      color: var(--text);
    }
    .match-score {
      font-size: 18px;
      font-weight: 900;
      color: var(--il-blue);
    }
    .mep-meta {
      font-size: 12px;
      color: var(--muted);
      margin-bottom: 10px;
    }
    .vote-pills {
      display: flex;
      gap: 6px;
      flex-wrap: wrap;
    }
    .vote-pill {
      padding: 4px 9px;
      border-radius: 6px;
      font-size: 11px;
      font-weight: 700;
      border: 1px solid;
    }
    .vote-pill.match {
      background: #d1fae5;
      color: #065f46;
      border-color: #86efac;
    }
    .vote-pill.mismatch {
      background: #fee2e2;
      color: #991b1b;
      border-color: #fca5a5;
    }
    .vote-pill.il-conflict {
      background: #fef3c7;
      color: #92400e;
      border-color: #fcd34d;
    }
    .vote-pill.partial {
      background: #e0e7ff;
      color: #3730a3;
      border-color: #a5b4fc;
    }
    .mep-progress {
      height: 6px;
      background: #e2e8f0;
      border-radius: 999px;
      overflow: hidden;
      margin-top: 6px;
    }
    .mep-progress-fill {
      height: 100%;
      background: linear-gradient(90deg, #60a5fa 0%, #2563eb 100%);
    }
    .mep-stack {
      display: none;
      height: 8px;
      border-radius: 999px;
      overflow: hidden;
      background: #e2e8f0;
      margin-top: 8px;
    }
    .mep-stack-seg {
      height: 100%;
      display: inline-block;
    }
    .mep-stack-for { background: #86efac; }
    .mep-stack-against { background: #fca5a5; }
    .mep-stack-abstain { background: #fcd34d; }
    body.compact-mep .vote-pills {
      display: none;
    }
    body.compact-mep .mep-item {
      padding: 10px;
    }
    body.compact-mep .mep-meta {
      margin-bottom: 6px;
    }
    body.compact-mep .mep-stack {
      display: block;
    }

    .dist-legend {
      margin-top: 12px;
      display: flex;
      flex-direction: column;
      gap: 6px;
      font-size: 12px;
      color: var(--muted);
      font-weight: 700;
    }
    .dist-legend-item {
      display: flex;
      justify-content: space-between;
      gap: 8px;
      align-items: center;
    }
    .comparison-panel,
    .breakdown-panel {
      margin-top: 24px;
      background: #fff;
      border: 2px solid var(--border);
      border-radius: 16px;
      padding: 20px;
      box-shadow: var(--shadow);
    }
    .compare-panel {
      background: #fff;
      border: 2px solid var(--border);
      border-radius: 16px;
      padding: 20px;
      box-shadow: var(--shadow);
    }
    .compare-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
      gap: 16px;
      margin-bottom: 16px;
    }
        .compare-card h4 {
      margin: 0 0 8px;
      font-size: 13px;
      font-weight: 800;
      color: var(--text);
    }
    .compare-results {
      display: grid;
      gap: 6px;
      margin-top: 8px;
      max-height: 220px;
      overflow: auto;
    }
    .compare-btn {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 8px 10px;
      border-radius: 10px;
      border: 1px solid var(--border);
      background: #fff;
      font-size: 12px;
      font-weight: 700;
      cursor: pointer;
    }
    .compare-btn:hover {
      border-color: var(--il-blue);
      background: #eff6ff;
    }
    .compare-selected {
      font-size: 12px;
      font-weight: 800;
      color: var(--muted);
      margin-top: 6px;
    }

/* ── MEP Comparison Tool (redesign) ────────────────────────────────── */
.cp-header { margin-bottom: 14px; }
.cp-subtitle {
  font-size: 12px; color: var(--muted); margin: 4px 0 0;
}
.cp-pickers {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
}
.cp-picker {
  flex: 1;
  min-width: 0;
  position: relative;
}
.cp-picker-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 5px;
}
.cp-vs {
  font-size: 11px; font-weight: 900; color: var(--muted);
  padding: 0 4px; align-self: center; margin-top: 22px;
  flex-shrink: 0;
}
.cp-dropdown {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 100;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 8px; box-shadow: 0 8px 24px rgba(15,23,42,0.12);
  max-height: 200px; overflow-y: auto;
}
.cp-dropdown:empty { display: none; }
.cp-dd-item {
  padding: 7px 10px; font-size: 12px; cursor: pointer;
  display: flex; align-items: center; gap: 6px;
  transition: background 0.1s;
}
.cp-dd-item:hover { background: var(--bg-2); }
.cp-dd-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.cp-dd-name { flex: 1; font-weight: 600; color: var(--text); }
.cp-dd-meta { font-size: 10px; color: var(--muted); }
.cp-selected {
  margin-top: 6px; min-height: 32px; display: flex; align-items: center;
}
.cp-sel-empty { font-size: 11px; color: var(--muted); font-style: italic; }
.cp-sel-badge {
  display: flex; align-items: center; gap: 6px; padding: 5px 10px;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 8px; flex: 1; min-width: 0;
}
.cp-sel-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.cp-sel-name { font-size: 12px; font-weight: 700; color: var(--text); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-sel-grp  { font-size: 10px; color: var(--muted); }
.cp-sel-clear { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 13px; padding: 0 2px; }
.cp-sel-clear:hover { color: var(--text); }

/* Comparison result card */
.cp-result-card {
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--card); overflow: hidden;
  animation: cpCardIn 0.25s ease;
}
@keyframes cpCardIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
.cp-result-header {
  display: grid; grid-template-columns: 1fr auto 1fr;
  gap: 12px; align-items: center;
  padding: 14px 16px; background: var(--bg-2);
  border-bottom: 1px solid var(--border);
}
.cp-mep-col {
  display: flex; flex-direction: column; gap: 2px;
}
.cp-mep-col.right { text-align: right; align-items: flex-end; }
.cp-mep-name { font-size: 13px; font-weight: 800; color: var(--text); }
.cp-mep-meta { font-size: 10px; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.cp-mep-col.right .cp-mep-meta { justify-content: flex-end; }
.cp-mep-dot { width: 7px; height: 7px; border-radius: 50%; }
.cp-center-score {
  text-align: center;
}
.cp-agree-pct {
  font-size: 28px; font-weight: 900; line-height: 1;
}
.cp-agree-pct.green { color: #16a34a; }
.cp-agree-pct.amber { color: #d97706; }
.cp-agree-pct.red   { color: #dc2626; }
.cp-agree-lbl { font-size: 10px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; margin-top: 2px; }
.cp-result-stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--border);
}
.cp-stat {
  padding: 10px 12px; text-align: center;
  border-right: 1px solid var(--border);
}
.cp-stat:last-child { border-right: none; }
.cp-stat-val { font-size: 18px; font-weight: 800; color: var(--text); line-height: 1; }
.cp-stat-lbl { font-size: 9px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; margin-top: 3px; }
.cp-votes-section {
  padding: 12px 16px;
}
.cp-votes-title {
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 8px;
}
.cp-vote-row {
  display: grid; grid-template-columns: 1fr auto 1fr;
  gap: 8px; align-items: center; padding: 5px 0;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
}
.cp-vote-row:last-child { border-bottom: none; }
.cp-vote-pos {
  padding: 2px 6px; border-radius: 4px; font-weight: 700;
  font-size: 10px; text-align: center;
}
.cp-vote-pos.for     { background: #dcfce7; color: #16a34a; }
.cp-vote-pos.against { background: #fee2e2; color: #dc2626; }
.cp-vote-pos.abstain { background: #fef9c3; color: #92400e; }
.cp-vote-pos.did-not-vote { background: #e0f2fe; color: #0f766e; }
.cp-vote-pos.absent  { background: #f1f5f9; color: #94a3b8; }
.cp-vote-title {
  font-size: 10px; color: var(--muted); text-align: center;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px;
}
.cp-vote-agree-dot {
  width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-left: 4px;
}
.cp-agree-dot  { background: #4ade80; }
.cp-disagree-dot { background: #f87171; }

    .ranking-panel {
      margin: 20px 0 24px;
      background: #fff;
      border: 2px solid var(--border);
      border-radius: 16px;
      padding: 20px;
      box-shadow: var(--shadow);
    }
    .ranking-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 12px;
    }
    .ranking-table th,
    .ranking-table td {
      padding: 8px 10px;
      border-bottom: 1px solid var(--border);
      text-align: left;
    }
    .ranking-table th {
      background: #f8fafc;
      font-weight: 800;
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: 0.03em;
      font-size: 11px;
    }
    .panel-title {
      margin: 0 0 12px;
      font-size: 16px;
      font-weight: 900;
      color: var(--text);
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .comparison-controls {
      display: flex;
      gap: 10px;
      align-items: center;
      margin-bottom: 12px;
      flex-wrap: wrap;
    }
    .comparison-results {
      display: grid;
      gap: 8px;
      margin-bottom: 12px;
    }
    .comparison-result-btn {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 10px 12px;
      border-radius: 10px;
      border: 1px solid var(--border);
      background: #f8fafc;
      font-size: 13px;
      font-weight: 700;
      cursor: pointer;
    }
    .comparison-result-btn:hover {
      border-color: var(--il-blue);
      background: #eff6ff;
    }
    .comparison-selected {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-bottom: 12px;
    }
    .selection-chip {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 6px 10px;
      border-radius: 999px;
      background: #dbeafe;
      color: #1e3a8a;
      font-size: 12px;
      font-weight: 800;
    }
    .selection-chip button {
      border: none;
      background: transparent;
      cursor: pointer;
      color: #1e3a8a;
      font-weight: 900;
    }
    .comparison-table {
      overflow-x: auto;
    }
    .comparison-table table,
    .breakdown-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 12px;
    }
    .comparison-table th,
    .comparison-table td,
    .breakdown-table th,
    .breakdown-table td {
      padding: 8px 10px;
      border-bottom: 1px solid var(--border);
      text-align: left;
      vertical-align: top;
    }
    .comparison-table th,
    .breakdown-table th {
      background: #f8fafc;
      font-weight: 800;
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: 0.03em;
      font-size: 11px;
    }
    .vote-cell.match { color: #065f46; font-weight: 800; }
    .vote-cell.partial { color: #3730a3; font-weight: 800; }
    .vote-cell.mismatch { color: #991b1b; font-weight: 800; }
    .vote-cell.na { color: var(--muted); }


    .heatmap-wrap {
      overflow-x: auto;
      border: 1px solid var(--border);
      border-radius: 12px;
      background: #fff;
    }
    .heatmap-table {
      border-collapse: collapse;
      width: 100%;
      min-width: 720px;
      font-size: 11px;
    }
    .heatmap-table th,
    .heatmap-table td {
      padding: 6px 8px;
      border-bottom: 1px solid var(--border);
      text-align: center;
      white-space: nowrap;
    }
    .heatmap-table th {
      position: sticky;
      top: 0;
      background: #f8fafc;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: 0.03em;
      font-size: 10px;
      z-index: 2;
    }
    .heatmap-table td:first-child,
    .heatmap-table th:first-child {
      position: sticky;
      left: 0;
      background: #f8fafc;
      text-align: left;
      z-index: 1;
      min-width: 180px;
    }
    .heatmap-cell {
      width: 28px;
      height: 26px;
      border-radius: 6px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 9px;
      font-weight: 800;
      letter-spacing: 0.02em;
      cursor: default;
      transition: transform 0.12s ease, box-shadow 0.12s ease;
    }
    .heatmap-cell:hover {
      transform: scale(1.25);
      box-shadow: 0 2px 8px rgba(0,0,0,0.18);
      z-index: 2;
      position: relative;
    }
    .heatmap-cell.match    { background: linear-gradient(135deg,#4ade80,#86efac); color: #14532d; }
    .heatmap-cell.mismatch { background: linear-gradient(135deg,#f87171,#fca5a5); color: #7f1d1d; }
    .heatmap-cell.conflict { background: linear-gradient(135deg,#fbbf24,#fcd34d); color: #78350f; }
    .heatmap-cell.na       { background: #f1f5f9; color: #94a3b8; }
    .heatmap-table tbody tr:nth-child(even) { background: rgba(241,245,249,0.5); }
    .heatmap-table tbody tr:hover { background: rgba(239,246,255,0.8); }
    .heatmap-mep-cell { display: flex; align-items: center; gap: 6px; }
    .heatmap-mep-name { font-weight: 600; font-size: 11px; color: var(--text); }
    .heatmap-mep-pct  { font-size: 9px; font-weight: 800; padding: 1px 5px; border-radius: 999px; white-space: nowrap; }
    .heatmap-legend {
      display: flex;
      gap: 12px;
      flex-wrap: wrap;
      font-size: 11px;
      font-weight: 700;
      color: var(--muted);
      margin-bottom: 8px;
    }
    .heatmap-legend span {
      display: inline-flex;
      align-items: center;
      gap: 6px;
    }

    .simulator-panel {
      margin-top: 20px;
      border: 1px solid var(--border);
      border-radius: 14px;
      background: #fff;
      padding: 16px;
    }
    .simulator-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 12px;
      margin-bottom: 8px;
      flex-wrap: wrap;
    }
    .simulator-actions {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
    }
    .simulator-table {
      border: 1px solid var(--border);
      border-radius: 12px;
      overflow: auto;
      max-height: 360px;
    }
    .simulator-table table {
      width: 100%;
      border-collapse: collapse;
      font-size: 12px;
    }
    .simulator-table th,
    .simulator-table td {
      padding: 8px 10px;
      border-bottom: 1px solid var(--border);
      text-align: left;
    }
    .simulator-table th {
      background: #f8fafc;
      font-weight: 800;
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: 0.03em;
      font-size: 11px;
      position: sticky;
      top: 0;
      z-index: 1;
    }
    .simulator-select {
      padding: 6px 8px;
      border-radius: 8px;
      border: 1px solid var(--border);
      font-size: 12px;
      font-weight: 700;
    }
    .analyst-panel {
      margin-top: 24px;
    }
    .analyst-shell {
      margin-top: 12px;
      border-radius: 16px;
      border: 1px solid #cbd5e1;
      background:
        radial-gradient(1200px 280px at 0% 0%, rgba(14, 116, 144, 0.08), transparent 60%),
        radial-gradient(1200px 280px at 100% 0%, rgba(29, 78, 216, 0.08), transparent 60%),
        #f8fafc;
      padding: 14px;
      display: grid;
      gap: 12px;
    }
    .analyst-settings {
      display: flex;
      gap: 8px;
      align-items: center;
      flex-wrap: wrap;
    }
    .intel-mep-input  { max-width: 240px; }
    .intel-topk-select { max-width: 120px; }
    .analyst-scope-switch {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      align-items: center;
      justify-content: flex-start;
      margin-top: 2px;
    }
    .analyst-scope-btn {
      padding: 8px 12px;
      border-radius: 999px;
      border: 1px solid #cbd5e1;
      background: #ffffff;
      color: #0f172a;
      font-size: 12px;
      font-weight: 800;
      cursor: pointer;
      transition: all 0.2s ease;
    }
    .analyst-scope-btn:hover {
      border-color: #2563eb;
      background: #eff6ff;
    }
    .analyst-scope-btn.active {
      border-color: #1d4ed8;
      background: #dbeafe;
      color: #1e3a8a;
    }
    .analyst-scope-hint {
      margin-top: -4px;
      color: #475569;
      font-weight: 700;
    }
    .analyst-textarea {
      width: 100%;
      min-height: 84px;
      max-height: 260px;
      resize: vertical;
      border-radius: 12px;
      border: 1px solid #cbd5e1;
      padding: 12px 14px;
      font-size: 14px;
      font-family: inherit;
      background: #fff;
      line-height: 1.5;
    }
    .analyst-textarea:focus {
      outline: none;
      border-color: #2563eb;
      box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    }
    .analyst-chat {
      min-height: 240px;
      max-height: 520px;
      overflow: auto;
      border-radius: 14px;
      border: 1px solid #d8e2ef;
      background: #ffffff;
      padding: 14px;
      display: grid;
      gap: 10px;
      scroll-behavior: smooth;
    }
    .chat-msg {
      display: flex;
      gap: 8px;
      align-items: flex-start;
    }
    .chat-msg.user {
      flex-direction: row-reverse;
    }
    .chat-avatar {
      flex: 0 0 auto;
      width: 28px;
      height: 28px;
      border-radius: 999px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 11px;
      font-weight: 900;
      letter-spacing: 0.03em;
      color: #0f172a;
      background: #e2e8f0;
      border: 1px solid #cbd5e1;
    }
    .chat-msg.assistant .chat-avatar {
      color: #ffffff;
      border-color: #1d4ed8;
      background: linear-gradient(135deg, #1d4ed8, #0f766e);
    }
    .chat-bubble {
      max-width: min(86%, 860px);
      border-radius: 14px;
      border: 1px solid #e2e8f0;
      background: #ffffff;
      color: var(--text);
      padding: 10px 14px;
      font-size: 13px;
      line-height: 1.6;
      position: relative;
      word-break: break-word;
      box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    }
    .chat-msg.user .chat-bubble {
      border-color: #bfdbfe;
      background: #dbeafe;
      color: #1e3a8a;
    }
    .chat-bubble p {
      margin: 0;
    }
    .chat-bubble p + p {
      margin-top: 8px;
    }
    .chat-bubble h4 {
      margin: 2px 0 6px;
      font-size: 12px;
      line-height: 1.2;
      font-weight: 900;
      letter-spacing: 0.03em;
      text-transform: uppercase;
      color: #0f172a;
    }
    .chat-msg.user .chat-bubble h4 {
      color: #dbeafe;
    }
    .chat-bubble ul {
      margin: 4px 0 2px;
      padding: 0;
    }
    .chat-bubble li {
      margin: 0;
    }
    .chat-bubble code {
      font-family: "SFMono-Regular", Menlo, Consolas, monospace;
      font-size: 12px;
      padding: 1px 4px;
      border-radius: 6px;
      background: rgba(15, 23, 42, 0.08);
    }
    .chat-msg.user .chat-bubble code {
      background: rgba(255, 255, 255, 0.2);
    }
    .chat-placeholder {
      color: #64748b;
      font-style: italic;
    }
    .chat-bubble.is-streaming::after {
      content: "";
      position: absolute;
      width: 8px;
      height: 8px;
      border-radius: 999px;
      right: 10px;
      bottom: 8px;
      background: #2563eb;
      animation: analystPulse 1s infinite ease-in-out;
    }
    @keyframes analystPulse {
      0%, 100% { transform: scale(0.8); opacity: 0.35; }
      50% { transform: scale(1.2); opacity: 1; }
    }
    .intel-typing-line {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      font-weight: 600;
      color: #334155;
    }
    .intel-typing-dots {
      display: inline-flex;
      align-items: center;
      gap: 4px;
    }
    .intel-typing-dots i {
      width: 6px;
      height: 6px;
      border-radius: 999px;
      display: inline-block;
      background: #2563eb;
      animation: intelTypingBounce 1.1s infinite ease-in-out;
      opacity: 0.4;
    }
    .intel-typing-dots i:nth-child(2) { animation-delay: 0.16s; }
    .intel-typing-dots i:nth-child(3) { animation-delay: 0.32s; }
    @keyframes intelTypingBounce {
      0%, 80%, 100% { transform: translateY(0); opacity: 0.35; }
      40% { transform: translateY(-3px); opacity: 1; }
    }
    .intel-confidence-row {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      align-items: center;
      margin-bottom: 8px;
    }
    .intel-confidence-pill {
      display: inline-flex;
      align-items: center;
      border-radius: 999px;
      padding: 2px 9px;
      font-size: 10px;
      font-weight: 800;
      letter-spacing: 0.03em;
      text-transform: uppercase;
      border: 1px solid transparent;
    }
    .intel-confidence-pill.is-high {
      color: #166534;
      background: #dcfce7;
      border-color: #86efac;
    }
    .intel-confidence-pill.is-medium {
      color: #92400e;
      background: #fef3c7;
      border-color: #fcd34d;
    }
    .intel-confidence-pill.is-low {
      color: #991b1b;
      background: #fee2e2;
      border-color: #fca5a5;
    }
    .intel-confidence-meta {
      display: inline-flex;
      align-items: center;
      border-radius: 999px;
      padding: 2px 8px;
      font-size: 10px;
      font-weight: 700;
      color: #475569;
      background: #f1f5f9;
      border: 1px solid #e2e8f0;
    }
    .intel-brief-text {
      display: block;
    }
    .analyst-composer {
      display: grid;
      gap: 8px;
    }
    .analyst-actions {
      display: flex;
      gap: 8px;
      align-items: center;
      flex-wrap: wrap;
      justify-content: flex-end;
    }
    .analyst-toggle {
      display: inline-flex;
      align-items: center;
      gap: 6px;
    }
    .analyst-status {
      margin-top: 0;
      min-height: 18px;
      font-weight: 700;
      color: #334155;
    }
    .analyst-retrieval-title { font-size: 11px; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
    .analyst-retrieval-item  { font-size: 12px; color: var(--text); padding: 4px 0; border-top: 1px dashed #e2e8f0; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
    .analyst-retrieval-score { margin-left: auto; color: var(--muted); font-size: 11px; }
    .intel-src-pos           { display: inline-block; padding: 1px 6px; border-radius: 999px; font-size: 10px; font-weight: 700; }
    .intel-src-pos--for      { background: #dcfce7; color: #15803d; }
    .intel-src-pos--against  { background: #fee2e2; color: #b91c1c; }
    .intel-src-pos--abstain  { background: #fef9c3; color: #92400e; }
    .intel-src-pos--vote     { background: #dbeafe; color: #1d4ed8; }
    .intel-src-pos--meeting  { background: #f3e8ff; color: #7e22ce; }
    .intel-src-pos--speech   { background: #ede9fe; color: #5b21b6; }
    .analyst-retrieval {
      margin-top: 10px;
      padding: 12px 14px;
      border-radius: 12px;
      border: 1px solid #dbe7f5;
      background: #ffffff;
      display: grid;
      gap: 8px;
    }
    .analyst-retrieval-head {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 8px;
      font-size: 12px;
      color: var(--muted);
      font-weight: 700;
    }
    .analyst-retrieval-head strong {
      color: var(--text);
      font-weight: 800;
    }
    .analyst-retrieval-tags {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
    }
    .analyst-retrieval-tag {
      display: inline-flex;
      align-items: center;
      border-radius: 999px;
      border: 1px solid #dbeafe;
      background: #eff6ff;
      color: #1d4ed8;
      padding: 3px 8px;
      font-size: 11px;
      font-weight: 700;
    }
    .analyst-retrieval-list {
      list-style: none;
      margin: 0;
      padding: 0;
      display: grid;
      gap: 6px;
      font-size: 11px;
      color: var(--muted);
      font-weight: 700;
    }
    .analyst-retrieval-list li {
      display: flex;
      justify-content: space-between;
      gap: 8px;
      border-top: 1px dashed #e2e8f0;
      padding-top: 6px;
    }
    .analyst-retrieval-list li span:first-child {
      color: var(--text);
      font-weight: 800;
    }
    @media (max-width: 720px) {
      .analyst-shell {
        padding: 10px;
      }
      .analyst-settings {
        gap: 6px;
      }
      .analyst-settings .search-input {
        flex: 1 1 48%;
        min-width: 132px;
        max-width: none !important;
      }
      .analyst-chat {
        min-height: 200px;
        max-height: 420px;
        padding: 10px;
      }
      .analyst-scope-switch {
        width: 100%;
      }
      .analyst-scope-btn {
        flex: 1 1 48%;
        text-align: center;
      }
      .chat-bubble {
        max-width: 92%;
      }
      .analyst-actions {
        justify-content: stretch;
      }
      .analyst-actions .control-btn {
        flex: 1 1 auto;
      }
    }
    .simulator-badge {
      font-size: 11px;
      font-weight: 800;
      padding: 4px 8px;
      border-radius: 999px;
      background: #e2e8f0;
      color: #1e293b;
    }

            .insight-card h4 {
      margin: 0 0 10px;
      font-size: 14px;
      font-weight: 900;
      color: var(--text);
    }
    .insight-list {
      list-style: none;
      margin: 0;
      padding: 0;
      display: flex;
      flex-direction: column;
      gap: 8px;
      font-size: 12px;
      color: var(--muted);
      font-weight: 700;
    }

    .export-section {
      display: flex;
      gap: 12px;
      justify-content: center;
      margin: 24px 0;
      flex-wrap: wrap;
    }
    .export-btn {
      padding: 12px 28px;
      border-radius: 10px;
      border: 2px solid var(--il-blue);
      background: #fff;
      color: var(--il-blue);
      cursor: pointer;
      font-size: 14px;
      font-weight: 800;
      transition: all 0.2s;
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .export-btn:hover {
      background: var(--il-blue);
      color: #fff;
      transform: translateY(-2px);
    }

    /* Dashboard polish overrides */
    h1, h2, h3, h4 {
      letter-spacing: -0.015em;
    }
    .navbar {
      border-bottom: 1px solid var(--border);
      box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
      background: rgba(255, 255, 255, 0.92);
    }
    .navbar-brand {
      font-weight: 800;
      letter-spacing: 0.01em;
    }
    .navbar-brand .logo {
      border-radius: 12px;
      box-shadow: 0 8px 18px rgba(29, 78, 216, 0.25);
    }
    .nav-btn {
      border-radius: var(--radius-sm);
      border: 1px solid var(--border);
      background: rgba(255, 255, 255, 0.85);
      box-shadow: 0 6px 12px rgba(15, 23, 42, 0.06);
    }
    .nav-btn.primary {
      box-shadow: 0 10px 20px rgba(29, 78, 216, 0.25);
    }
    .container {
      padding: 32px 28px 48px;
    }
    .panel,
    .chart-card,
    .comparison-panel,
    .breakdown-panel,
    .compare-panel,
    .ranking-panel,
    .il-benchmark-panel,
    .simulator-panel {
      border-radius: var(--radius-lg);
      border: 1px solid var(--border);
      box-shadow: var(--shadow);
      background: rgba(255, 255, 255, 0.94);
      -webkit-backdrop-filter: blur(8px);
      backdrop-filter: blur(8px);
    }
        .list-controls {
      border-radius: var(--radius-md);
      background: #f1f5f9;
      border: 1px solid var(--border);
    }
    .search-input {
      border-radius: var(--radius-sm);
      border: 1px solid #d6dde8;
      background: #fff;
    }
    .search-input:focus {
      border-color: var(--il-blue);
      box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.1);
    }
    .chart-container {
      height: clamp(240px, 32vw, 420px);
    }
    canvas {
      width: 100% !important;
      height: 100% !important;
    }
    .analytics-grid {
      grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    }
    .delegation-grid {
      grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    }
    .files-table,
    .ranking-table,
    .comparison-table table,
    .breakdown-table,
    .simulator-table,
    .heatmap-table {
      border-collapse: separate;
      border-spacing: 0;
    }
                        .upload-zone {
      border-radius: var(--radius-lg);
    }
        .export-btn,
        .clear-btn,
        .show-more-btn {
      border-radius: var(--radius-sm);
    }

        .empty-icon {
      font-size: 72px;
      margin-bottom: 20px;
      opacity: 0.4;
    }

        h1, h2, h3, h4, h5, h6,
    .topbar-title, .section-title, .panel-title, .card-title,
    .kpi-value, .stat-value, .score-value, .match-score {
      font-family: var(--font-display);
    }
    .subtitle, .list-meta, .command-subtitle, .graph-intel-subtitle,
    .mep-country, .delegation-meta, .session-meta, .card-meta,
    .empty-state p, .hint-text, .nav-pill {
      font-family: var(--font-ui);
    }

    .app-main {
      flex: 1;
      display: flex;
      flex-direction: column;
      min-height: 100vh;
    }
    .topbar {
      background: var(--topbar-bg);
      border-bottom: 1px solid var(--topbar-border);
      padding: 0 28px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      position: sticky;
      top: 0;
      z-index: 5;
    }
    .topbar-brand {
      display: flex;
      align-items: center;
      gap: 10px;
      min-width: 0;
    }
    .topbar-logo {
      width: 28px;
      height: 28px;
      display: block;
      flex: 0 0 auto;
      border-radius: 8px;
    }
    .topbar-title {
      font-size: 14px;
      font-weight: 700;
      color: #94a3b8;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      padding: 20px 0;
    }
    .topbar-actions {
      display: flex;
      align-items: center;
      gap: 12px;
      flex-wrap: wrap;
    }
    .topbar-nav {
      display: flex;
      align-items: center;
      gap: 2px;
      padding: 0;
      background: transparent;
      border-radius: 0;
      border: none;
    }
    .nav-pill {
      padding: 20px 16px;
      border-radius: 0;
      font-weight: 600;
      font-size: 13px;
      color: #64748b;
      text-decoration: none;
      border-bottom: 2px solid transparent;
      border: 1px solid transparent;
      transition: all 0.2s ease;
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }
    .nav-pill:hover {
      color: #e2e8f0;
      background: rgba(255,255,255,0.06);
      border-color: transparent;
    }
    .nav-pill.active {
      color: #f8fafc;
      background: transparent;
      border-bottom-color: #2563eb;
    }
    .hero-logo-full {
      width: min(100%, 420px);
      height: auto;
      display: block;
      border-radius: 14px;
    }
    .home-brand-head {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 10px;
      margin: 8px auto 2px;
    }
    .home-brand-lockup {
      width: min(100%, 520px);
      height: auto;
      display: block;
      filter: drop-shadow(0 12px 26px rgba(29, 78, 216, 0.14));
    }
.dataset-vote-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.dataset-vote-head-main {
  display: grid;
  gap: 4px;
}

.dataset-vote-sub {
  margin: 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.45;
}
    .dashboard-hero {
      border: 1px solid rgba(148, 163, 184, 0.24);
      border-radius: 18px;
      background:
        radial-gradient(720px 320px at 82% -22%, rgba(14, 165, 233, 0.14), transparent 66%),
        linear-gradient(150deg, rgba(255, 255, 255, 0.98) 0%, rgba(242, 248, 255, 0.94) 100%);
      box-shadow: 0 18px 42px rgba(15, 23, 42, 0.10), inset 0 1px 0 rgba(255, 255, 255, 0.9);
      padding: clamp(16px, 2vw, 22px);
      margin-bottom: 14px;
    }
    .dashboard-hero-grid {
      display: grid;
      grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
      gap: 14px;
      align-items: stretch;
    }
    .dashboard-brand-card {
      border: 1px solid rgba(191, 219, 254, 0.9);
      border-radius: 14px;
      background: linear-gradient(140deg, rgba(255, 255, 255, 0.97) 0%, rgba(239, 246, 255, 0.94) 100%);
      padding: 16px;
      display: grid;
      gap: 10px;
      align-content: start;
    }
    .dashboard-brand-eyebrow {
      display: inline-flex;
      width: fit-content;
      align-items: center;
      gap: 6px;
      font-size: 11px;
      font-weight: 800;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: #1d4ed8;
      border-radius: 999px;
      border: 1px solid rgba(37, 99, 235, 0.24);
      background: rgba(37, 99, 235, 0.1);
      padding: 5px 10px;
    }
.dashboard-brand-title {
  margin: 0;
  font-size: clamp(38px, 4.8vw, 64px);
  line-height: 0.95;
  letter-spacing: -0.03em;
  color: #0f172a;
}
.dashboard-brand-sub {
  margin: 0;
  color: #475569;
  font-size: 15px;
  line-height: 1.52;
  max-width: 70ch;
}
    .dashboard-brand-guide {
      margin-top: 4px;
      border-radius: 12px;
      border: 1px solid rgba(191, 219, 254, 0.86);
      background: linear-gradient(180deg, rgba(239, 246, 255, 0.88) 0%, rgba(255, 255, 255, 0.96) 100%);
      padding: 10px;
      display: grid;
      gap: 8px;
    }
    .dashboard-brand-guide h3 {
      margin: 0;
      font-size: 13px;
      letter-spacing: 0.04em;
      text-transform: uppercase;
      color: #1e3a8a;
    }
    .dashboard-brand-guide-list {
      display: grid;
      gap: 7px;
    }
    .dashboard-brand-guide-item {
      display: grid;
      gap: 2px;
      border: 1px solid rgba(148, 163, 184, 0.34);
      border-radius: 9px;
      background: rgba(255, 255, 255, 0.92);
      padding: 7px 8px;
      font-size: 12px;
      line-height: 1.42;
      color: #475569;
    }
    .dashboard-brand-guide-item strong {
      color: #0f172a;
      font-size: 11px;
      letter-spacing: 0.04em;
      text-transform: uppercase;
    }
    .dashboard-dataset-snapshot {
      border: 1px solid rgba(147, 197, 253, 0.42);
      border-radius: 14px;
      background:
        radial-gradient(520px 280px at 10% 0%, rgba(56, 189, 248, 0.2), transparent 72%),
        linear-gradient(162deg, rgba(9, 19, 42, 0.98) 0%, rgba(11, 30, 67, 0.97) 100%);
      color: #dbeafe;
      padding: 14px;
      display: grid;
      gap: 10px;
      box-shadow: 0 14px 30px rgba(2, 6, 23, 0.35);
    }
    .dashboard-snapshot-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      flex-wrap: wrap;
    }
    .dashboard-snapshot-kicker {
      display: inline-flex;
      align-items: center;
      border-radius: 999px;
      border: 1px solid rgba(147, 197, 253, 0.5);
      background: rgba(30, 64, 175, 0.44);
      color: #bfdbfe;
      font-size: 11px;
      font-weight: 800;
      letter-spacing: 0.07em;
      text-transform: uppercase;
      padding: 4px 9px;
    }
    .dashboard-snapshot-updated {
      color: rgba(191, 219, 254, 0.9);
      font-size: 11.5px;
      font-weight: 600;
    }
    .dashboard-snapshot-stats {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 8px;
    }
    .snapshot-stat {
      border: 1px solid rgba(148, 163, 184, 0.34);
      border-radius: 10px;
      background: rgba(12, 26, 54, 0.72);
      padding: 8px 10px;
      display: grid;
      gap: 2px;
    }
    .snapshot-stat-label {
      font-size: 11px;
      letter-spacing: 0.04em;
      text-transform: uppercase;
      color: rgba(191, 219, 254, 0.8);
      font-weight: 700;
    }
    .snapshot-stat strong {
      font-size: 20px;
      line-height: 1.05;
      letter-spacing: -0.015em;
      color: #f8fafc;
    }
    .dashboard-snapshot-notes {
      list-style: none;
      margin: 0;
      padding: 0;
      display: grid;
      gap: 7px;
    }
    .dashboard-snapshot-notes li {
      display: grid;
      grid-template-columns: auto minmax(0, 1fr);
      gap: 8px;
      align-items: flex-start;
      border: 1px solid rgba(147, 197, 253, 0.18);
      border-radius: 10px;
      background: rgba(8, 20, 44, 0.64);
      padding: 8px;
      font-size: 12.5px;
      line-height: 1.45;
      color: rgba(226, 232, 240, 0.98);
    }
    .dashboard-snapshot-notes strong {
      color: #f8fafc;
      font-weight: 700;
    }
    .dashboard-snapshot-notes em {
      display: block;
      margin-top: 2px;
      font-size: 11.5px;
      color: rgba(191, 219, 254, 0.92);
      font-style: normal;
      font-weight: 600;
    }
    .snapshot-icon {
      width: 26px;
      height: 26px;
      border-radius: 8px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      border: 1px solid currentColor;
      background: rgba(255, 255, 255, 0.03);
    }
    .snapshot-icon svg {
      width: 16px;
      height: 16px;
      fill: none;
      stroke: currentColor;
      stroke-width: 1.85;
      stroke-linecap: round;
      stroke-linejoin: round;
    }
    .snapshot-icon--guide {
      color: #60a5fa;
    }
    .snapshot-icon--warning {
      color: #f59e0b;
    }
    .snapshot-icon--source {
      color: #34d399;
    }
    .snapshot-icon--session {
      color: #a78bfa;
    }
    .panel-vote-compact--secondary {
      border-color: rgba(191, 219, 254, 0.62);
      background: linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(248, 250, 255, 0.92) 100%);
      box-shadow: 0 8px 20px rgba(15, 23, 42, 0.07);
      padding: 14px 16px;
    }
    .panel-vote-compact--secondary .upload-actions {
      justify-content: flex-start;
      gap: 10px;
      margin-top: 8px;
    }
    .panel-vote-compact--secondary .upload-btn {
      min-height: 42px;
      padding: 10px 18px;
      font-size: 15px;
      border-radius: 10px;
      box-shadow: 0 5px 14px rgba(37, 99, 235, 0.2);
    }
    .panel-vote-compact--secondary .upload-btn.secondary {
      opacity: 0.86;
      border-width: 1.5px;
      box-shadow: none;
    }
    .dataset-vote-head h2 {
      margin: 0;
    }
    .dataset-data-notice {
      display: none;
      align-items: center;
      gap: 6px;
      max-width: 100%;
      padding: 7px 10px;
      border-radius: 9px;
      border: 1px solid rgba(37, 99, 235, 0.24);
      background: rgba(239, 246, 255, 0.82);
      color: #1e3a8a;
      font-size: 11.5px;
      font-weight: 600;
      line-height: 1.35;
    }
    body[data-page="dataset"] .dashboard-hero {
      border-color: rgba(203, 213, 225, 0.82);
      border-radius: 18px;
      background:
        radial-gradient(760px 300px at 96% -16%, rgba(59, 130, 246, 0.09), transparent 70%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 251, 255, 0.98) 100%);
      box-shadow: 0 16px 34px rgba(15, 23, 42, 0.08);
      padding: clamp(18px, 2.1vw, 24px);
    }
        body[data-page="dataset"] .dashboard-brand-card {
      border-color: rgba(203, 213, 225, 0.72);
      background: linear-gradient(180deg, rgba(255, 255, 255, 0.99) 0%, rgba(246, 250, 255, 0.95) 100%);
      padding: 18px;
      gap: 11px;
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
    }
    body[data-page="dataset"] .dashboard-brand-title {
      font-size: clamp(34px, 4vw, 54px);
      line-height: 0.96;
      letter-spacing: -0.032em;
    }
    body[data-page="dataset"] .dashboard-brand-sub {
      font-size: 15px;
      line-height: 1.58;
      color: #475569;
      max-width: 68ch;
    }
    body[data-page="dataset"] .dashboard-brand-meta {
      display: flex;
      flex-wrap: wrap;
      gap: 7px;
    }
    body[data-page="dataset"] .dashboard-brand-chip {
      display: inline-flex;
      align-items: center;
      min-height: 26px;
      border: 1px solid rgba(191, 219, 254, 0.95);
      border-radius: 999px;
      background: rgba(239, 246, 255, 0.86);
      color: #1e3a8a;
      font-size: 11px;
      font-weight: 700;
      letter-spacing: 0.02em;
      padding: 4px 9px;
      white-space: nowrap;
    }
    body[data-page="dataset"] .dashboard-brand-note {
      margin: 0;
      font-size: 12px;
      line-height: 1.46;
      color: #64748b;
    }
    body[data-page="dataset"] .dashboard-brand-guide {
      margin-top: 4px;
      border-color: rgba(191, 219, 254, 0.96);
      background: linear-gradient(180deg, rgba(240, 247, 255, 0.94) 0%, rgba(255, 255, 255, 0.97) 100%);
    }
    .dashboard-chip-stage {
      position: relative;
      display: grid;
      justify-items: center;
      align-items: center;
      gap: 8px;
      min-height: 176px;
      border-radius: 12px;
      border: 1px solid rgba(191, 219, 254, 0.72);
      background:
        radial-gradient(220px 120px at 50% 22%, rgba(59, 130, 246, 0.16), transparent 72%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(241, 247, 255, 0.95) 100%);
      overflow: hidden;
    }
    .dashboard-chip-stage__halo {
      position: absolute;
      inset: 20% 18% auto 18%;
      height: 92px;
      border-radius: 999px;
      border: 1px solid rgba(59, 130, 246, 0.2);
      background: radial-gradient(circle at 50% 50%, rgba(147, 197, 253, 0.24) 0%, rgba(147, 197, 253, 0.03) 68%, transparent 100%);
      filter: blur(0.2px);
      pointer-events: none;
    }
    .dashboard-chip-stage__asset {
      position: relative;
      width: min(360px, 92%);
      height: auto;
      display: block;
      filter: drop-shadow(0 12px 20px rgba(30, 64, 175, 0.18));
      transform: translateY(2px);
    }
    .dashboard-chip-stage__line {
      width: min(150px, 52%);
      height: 4px;
      border-radius: 999px;
      background: linear-gradient(90deg, rgba(37, 99, 235, 0.1) 0%, rgba(37, 99, 235, 0.95) 52%, rgba(37, 99, 235, 0.1) 100%);
      opacity: 0.88;
    }
    .dashboard-chip-stage__label {
      font-size: 10px;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      font-weight: 800;
      color: #1e3a8a;
      border-radius: 999px;
      border: 1px solid rgba(147, 197, 253, 0.86);
      background: rgba(239, 246, 255, 0.95);
      padding: 3px 8px;
    }
    body[data-page="dataset"] .dashboard-dataset-snapshot {
      border-color: rgba(191, 219, 254, 0.95);
      background: linear-gradient(180deg, rgba(255, 255, 255, 0.99) 0%, rgba(242, 248, 255, 0.97) 100%);
      color: #334155;
      box-shadow: 0 12px 26px rgba(37, 99, 235, 0.10);
      padding: 16px;
      gap: 11px;
    }
    body[data-page="dataset"] .dashboard-snapshot-kicker {
      border-color: rgba(147, 197, 253, 0.88);
      background: rgba(239, 246, 255, 0.92);
      color: #1d4ed8;
    }
    body[data-page="dataset"] .dashboard-snapshot-updated {
      color: #64748b;
    }
    body[data-page="dataset"] .snapshot-stat {
      border-color: rgba(191, 219, 254, 0.9);
      background: rgba(255, 255, 255, 0.9);
    }
    body[data-page="dataset"] .snapshot-stat-label {
      color: #1e3a8a;
    }
    body[data-page="dataset"] .snapshot-stat strong {
      color: #0f172a;
    }
    body[data-page="dataset"] .dashboard-snapshot-notes li {
      border-color: rgba(203, 213, 225, 0.78);
      background: rgba(255, 255, 255, 0.9);
      color: #475569;
    }
    body[data-page="dataset"] .dashboard-snapshot-notes strong {
      color: #0f172a;
    }
    body[data-page="dataset"] .dashboard-snapshot-notes em {
      color: #64748b;
    }
    body[data-page="dataset"] .snapshot-icon {
      background: rgba(255, 255, 255, 0.96);
    }
    body[data-page="dataset"] .snapshot-icon--guide {
      color: #2563eb;
    }
    body[data-page="dataset"] .snapshot-icon--warning {
      color: #d97706;
    }
    body[data-page="dataset"] .snapshot-icon--source {
      color: #059669;
    }
    body[data-page="dataset"] .snapshot-icon--session {
      color: #7c3aed;
    }
    body[data-page="dataset"] .panel-vote-compact--secondary {
      border-color: rgba(203, 213, 225, 0.8);
      border-radius: 14px;
      background: #ffffff;
      box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
      padding: 16px 18px;
    }
    body[data-page="dataset"] .dataset-vote-head {
      margin-bottom: 14px;
    }
    body[data-page="dataset"] .dataset-vote-head h2 {
      font-size: 22px;
      letter-spacing: -0.02em;
      color: #0f172a;
    }
    body[data-page="dataset"] .dataset-vote-sub {
      font-size: 13px;
      color: #64748b;
    }
    body[data-page="dataset"] .panel-vote-compact--secondary .upload-actions {
      gap: 9px;
      margin-top: 6px;
    }
    body[data-page="dataset"] .panel-vote-compact--secondary .upload-btn {
      min-height: 42px;
      padding: 9px 16px;
      font-size: 14px;
      border-radius: 10px;
      box-shadow: 0 4px 12px rgba(37, 99, 235, 0.12);
    }
    body[data-page="dataset"] .panel-vote-compact--secondary .upload-btn.secondary {
      box-shadow: none;
      background: #fff;
      border-color: rgba(148, 163, 184, 0.42);
    }
    body[data-page="dataset"] .dataset-footer-shell {
      margin-top: 20px;
      padding: 16px 18px;
      border-color: rgba(203, 213, 225, 0.82);
      border-radius: 14px;
      background: #ffffff;
      box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
    }
                .dataset-footer-shell {
      margin-top: 18px;
      padding: 14px 16px;
      border: 1px solid rgba(203, 213, 225, 0.9);
      border-radius: 12px;
      background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(249, 251, 255, 0.96) 100%);
      box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
    }
.dataset-footer-top {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
}
    .dataset-footer-brand h3 {
      margin: 0;
      font-size: 18px;
      color: #0f172a;
      letter-spacing: -0.015em;
    }
    .dataset-footer-brand p {
      margin: 4px 0 0;
      font-size: 13px;
      line-height: 1.48;
      color: #64748b;
      max-width: 740px;
    }
    .dataset-partner-chip {
      display: inline-flex;
      align-items: center;
      gap: 10px;
      border: 1px solid rgba(191, 219, 254, 0.9);
      background: rgba(239, 246, 255, 0.9);
      border-radius: 999px;
      padding: 7px 10px;
      white-space: nowrap;
    }
    .dataset-partner-label {
      font-size: 10px;
      font-weight: 700;
      letter-spacing: 0.1em;
      text-transform: uppercase;
      color: #1d4ed8;
    }
    .dataset-partner-logo {
      height: 22px;
      width: auto;
      max-width: 130px;
      display: block;
    }
.dataset-footer-meta {
  display: grid;
  gap: 4px;
  padding-top: 8px;
  margin-bottom: 8px;
  border-top: 1px solid rgba(226, 232, 240, 0.9);
  font-size: 12px;
      color: #64748b;
      line-height: 1.5;
    }
    .dataset-footer-meta a {
      color: #1d4ed8;
      text-decoration: underline;
      text-underline-offset: 2px;
      font-weight: 600;
    }
    .dataset-footer-meta em {
      color: #64748b;
      font-style: italic;
    }
    .dataset-footer-dot {
      color: #94a3b8;
    }
    .dataset-footer-shell .privacy-draft {
      border-top: 1px solid rgba(226, 232, 240, 0.9);
      padding-top: 8px;
      margin-top: 2px;
    }
    .privacy-draft summary {
      cursor: pointer;
      font-weight: 700;
      font-size: 13px;
      color: var(--text);
      list-style: none;
    }
    .privacy-draft summary::-webkit-details-marker {
      display: none;
    }
    .privacy-draft summary::before {
      content: "▸";
      display: inline-block;
      margin-right: 8px;
      color: var(--il-blue);
      transition: transform 0.15s ease;
    }
    .privacy-draft[open] summary::before {
      transform: rotate(90deg);
    }
    .privacy-draft-body {
      margin-top: 10px;
      font-size: 12px;
      line-height: 1.6;
      color: var(--muted);
    }
    .privacy-draft-body h4 {
      margin: 12px 0 4px;
      font-size: 12px;
      color: var(--text);
      font-weight: 700;
    }
    .privacy-draft-body p {
      margin: 0 0 8px;
    }
    .privacy-draft-body ul {
      margin: 0 0 8px 18px;
      padding: 0;
    }
    .privacy-draft-body li {
      margin: 0 0 4px;
    }
    body[data-page="dataset"] #sessionsBadge {
      display: none !important;
    }
    body[data-page="dataset"] #liveUpdateBanner {
      display: none !important;
    }
    .app-content {
      padding: 28px;
    }
    .view {
      display: none;
      animation: fadeIn 0.2s ease;
    }
    body[data-page="dataset"] #view-dataset { display: block; }
    body[data-page="dashboard"] #view-dashboard { display: block; } /* legacy compatibility */
    body[data-page="analysis"] #view-analysis { display: block; }
    body[data-page="graph"] #view-graph { display: block; }
    body[data-page="intel"] #view-intel { display: block; }
    body[data-page="workspace-home"] #view-workspace { display: block; }
    body[data-page="parliament-members"] #view-parliament-members { display: block; }
    body[data-page="topics-mandates"] #view-topics-mandates { display: block; }

    @media (max-width: 768px) {
      h1 { font-size: 32px; }
      .delegation-grid { grid-template-columns: 1fr; }
      .analytics-grid { grid-template-columns: 1fr; }
      .list-controls { flex-direction: column; align-items: stretch; }
      .app-content { padding: 16px; }
      .topbar-actions { width: 100%; justify-content: space-between; }
      .dashboard-hero-grid {
        grid-template-columns: 1fr;
      }
      body[data-page="dataset"] .dashboard-brand-card,
      body[data-page="dataset"] .dashboard-dataset-snapshot {
        padding: 14px;
      }
      /* .dashboard-brand-title's mobile font-size was dead here (a later, higher-specificity
         unconditional rule always won) — but that rule already uses clamp(36px, 4.2vw, 56px),
         which fluidly shrinks to essentially this same size on its own, so nothing to restore. */
      .dashboard-brand-sub {
        font-size: 15px;
      }
      body[data-page="dataset"] .dashboard-brand-meta {
        gap: 6px;
      }
      body[data-page="dataset"] .dashboard-brand-chip {
        font-size: 10px;
        min-height: 24px;
        padding: 4px 8px;
      }
      .dashboard-chip-stage {
        min-height: 150px;
      }
      .dashboard-chip-stage__asset {
        width: min(300px, 94%);
      }
      .dashboard-snapshot-stats {
        grid-template-columns: 1fr;
      }
      .snapshot-stat strong {
        font-size: 18px;
      }
      .dashboard-snapshot-notes li {
        font-size: 12px;
      }
      .home-brand-lockup {
        width: min(100%, 420px);
      }
      .dataset-footer-shell {
        padding: 12px;
      }
      .dataset-footer-top {
        grid-template-columns: 1fr;
        gap: 8px;
      }
      .dataset-partner-chip {
        justify-self: flex-start;
      }
      .dataset-footer-meta {
        gap: 6px;
      }
      .panel-vote-compact--secondary .upload-actions {
        width: 100%;
      }
      .panel-vote-compact--secondary .upload-btn {
        flex: 1 1 calc(50% - 6px);
      }
    }

    @keyframes spin {
      to { transform: rotate(360deg); }
    }

    /* Adminmart-inspired skins */
    .panel,
    .delegation-card,
    .comparison-panel,
    .breakdown-panel,
    .compare-card,
    .ranking-panel,
    .simulator-panel {
      background: #fff;
      border: 1px solid #e8eef3;
      border-radius: 12px;
      box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
    }
    .panel,
    .delegation-card,
    .comparison-panel,
    .breakdown-panel,
    .compare-card,
    .ranking-panel,
    .simulator-panel {
      padding: 22px;
    }
    .panel-title {
      font-weight: 700;
      color: #0f172a;
    }
    .sessions-badge,
    .sidebar-badge {
      background: #e8f0ff;
      color: #1d4ed8;
      border-radius: 8px;
      border: 1px solid #d8e2fb;
    }
    .files-table th,
    .ranking-table th,
    .comparison-table th,
    .breakdown-table th,
    .simulator-table th,
    .heatmap-table th {
      background: #f4f8fb;
      color: #475569;
      font-weight: 700;
      border-bottom: 2px solid #e8eef3;
    }
    .files-table td,
    .ranking-table td,
    .comparison-table td,
    .breakdown-table td,
    .simulator-table td,
    .heatmap-table td {
      border-top: 1px solid #e8eef3;
      padding: 14px 16px;
      color: #334155;
    }
    .files-table tbody tr:nth-child(even),
    .ranking-table tbody tr:nth-child(even),
    .comparison-table tbody tr:nth-child(even),
    .breakdown-table tbody tr:nth-child(even),
    .simulator-table tbody tr:nth-child(even) {
      background: #f9fbfd;
    }
    .files-table tbody tr:hover,
    .ranking-table tbody tr:hover,
    .comparison-table tbody tr:hover,
    .breakdown-table tbody tr:hover,
    .simulator-table tbody tr:hover {
      background: #eef2ff;
    }
    .upload-btn,
    .compare-btn,
    .comparison-result-btn {
      border-radius: 8px;
      font-weight: 600;
    }

    /* Analysis-focused cleanup */
    body[data-page="analysis"] #analysisPanel {
      background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
      border-color: #dbe4f3;
    }
    body[data-page="analysis"] .global-controls {
      position: sticky;
      top: 78px;
      z-index: 12;
      background: rgba(248, 251, 255, 0.95);
      border: 1px solid #d6e3f8;
      box-shadow: 0 10px 24px rgba(29, 78, 216, 0.08);
      -webkit-backdrop-filter: blur(8px);
      backdrop-filter: blur(8px);
    }
    /* Analysis page: launcher bar replaces tabs */
    /* body[data-page="analysis"] .tabs { display: none; } */

    .insights-intro {
      margin: -2px 0 14px;
      padding: 10px 12px;
      border-left: 4px solid var(--il-blue);
      border-radius: 10px;
      background: linear-gradient(135deg, #eef4ff 0%, #f8fbff 100%);
      color: #334155;
      font-weight: 800;
    }
    .analytics-grid--insights {
      grid-template-columns: repeat(12, minmax(0, 1fr));
    }
    .analytics-grid--insights .chart-card {
      grid-column: span 6;
    }
    .analytics-grid--insights .chart-card--wide {
      grid-column: span 6;
    }
    .analytics-grid--insights .chart-card--full {
      grid-column: 1 / -1;
    }

    @media (max-width: 1024px) {
      .analytics-grid--insights {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }
      .analytics-grid--insights .chart-card,
      .analytics-grid--insights .chart-card--wide {
        grid-column: span 1;
      }
      .analytics-grid--insights .chart-card--full {
        grid-column: 1 / -1;
      }
    }
    @media (max-width: 768px) {
      body[data-page="analysis"] .global-controls {
        position: static;
      }
      .analytics-grid--insights {
        grid-template-columns: 1fr;
      }
      .analytics-grid--insights .chart-card,
      .analytics-grid--insights .chart-card--wide,
      .analytics-grid--insights .chart-card--full {
        grid-column: auto;
      }
    }

    /* Command Center */
    .command-center {
      margin-top: 8px;
      padding: 18px;
      border-radius: 18px;
      border: 2px solid var(--border);
      background: #ffffff;
      color: var(--text);
      box-shadow: var(--shadow);
    }
    .command-header {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      gap: 14px;
      flex-wrap: wrap;
      margin-bottom: 14px;
    }
    .command-title {
      margin: 0;
      font-size: 24px;
      font-weight: 900;
      letter-spacing: 0.01em;
      color: var(--text);
    }
    .command-subtitle {
      font-size: 12px;
      color: var(--muted);
      margin-top: 3px;
      max-width: 820px;
      line-height: 1.45;
    }
    .command-filters {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
    }
    .command-filters label {
      display: grid;
      gap: 5px;
      font-size: 11px;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      color: var(--muted);
      min-width: 170px;
    }
    .command-filters select {
      border-radius: 10px;
      border: 1px solid var(--border);
      background: #fff;
      color: var(--text);
      padding: 8px 10px;
      font-size: 12px;
      font-weight: 700;
      outline: none;
    }
    .command-filters select:focus {
      border-color: var(--il-blue);
      box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.16);
    }
    .command-summary {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-bottom: 14px;
    }
    .sum-pill {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 5px 9px;
      border-radius: 999px;
      border: 1px solid var(--border);
      background: #f8fafc;
      font-size: 11px;
      font-weight: 900;
      letter-spacing: 0.03em;
    }
    .sum-pill.yes { color: #166534; border-color: rgba(34, 197, 94, 0.35); background: rgba(134, 239, 172, 0.2); }
    .sum-pill.no { color: #991b1b; border-color: rgba(239, 68, 68, 0.3); background: rgba(252, 165, 165, 0.22); }
    .sum-pill.abstain { color: #475569; border-color: rgba(148, 163, 184, 0.35); background: rgba(226, 232, 240, 0.42); }
    .sum-pill.neutral { color: var(--muted); }
    .sum-pill.scope { color: #1d4ed8; border-color: rgba(37, 99, 235, 0.3); background: rgba(219, 234, 254, 0.5); }
    .command-bento {
      display: grid;
      grid-template-columns: 1.8fr 1fr;
      gap: 12px;
      align-items: stretch;
    }
    .command-card {
      border-radius: 16px;
      border: 1px solid var(--border);
      background: #fff;
      padding: 12px 12px 14px;
      box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
      min-height: 140px;
    }
    .command-card h4 {
      margin: 0 0 2px;
      font-size: 14px;
      font-weight: 900;
      color: var(--text);
      letter-spacing: 0.01em;
    }
    .command-meta {
      font-size: 11px;
      color: var(--muted);
      margin-bottom: 8px;
      font-weight: 700;
    }
    .command-card-hemicycle {
      grid-row: span 2;
    }
    .command-card-feed {
      grid-column: 1 / -1;
    }
    .hemicycle-stage {
      position: relative;
      min-height: 460px;
      border-radius: 14px;
      border: 1px solid var(--border);
      background:
        radial-gradient(120% 130% at 50% -12%, rgba(59, 130, 246, 0.08) 0%, rgba(241, 245, 249, 0.84) 45%, rgba(248, 250, 252, 0.98) 100%),
        #f8fafc;
      overflow: hidden;
    }
    .hemicycle-zones {
      position: absolute;
      top: 10px;
      left: 12px;
      right: 12px;
      display: flex;
      justify-content: space-between;
      pointer-events: none;
      z-index: 2;
    }
    .zone-label {
      padding: 4px 8px;
      border-radius: 999px;
      font-size: 10px;
      font-weight: 900;
      letter-spacing: 0.06em;
      border: 1px solid;
      background: rgba(255, 255, 255, 0.9);
    }
    .zone-yes { color: #4ade80; border-color: rgba(34, 197, 94, 0.55); }
    .zone-abstain { color: #cbd5e1; border-color: rgba(148, 163, 184, 0.55); }
    .zone-no { color: #f87171; border-color: rgba(239, 68, 68, 0.55); }
    .hemicycle-cloud {
      position: absolute;
      inset: 0;
    }
    .hemicycle-dot {
      position: absolute;
      width: 11px;
      height: 11px;
      border-radius: 999px;
      border: 1px solid rgba(15, 23, 42, 0.28);
      background: var(--group-color, #64748b);
      box-shadow: 0 0 0 0 transparent;
      transition: left 0.9s cubic-bezier(.22,.61,.36,1), top 0.9s cubic-bezier(.22,.61,.36,1), opacity 0.24s ease, transform 0.22s ease;
      cursor: pointer;
      z-index: 3;
      padding: 0;
    }
    .hemicycle-dot.outcome-yes { box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.52); }
    .hemicycle-dot.outcome-no { box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.52); }
    .hemicycle-dot.outcome-abstain { box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.5); }
    .hemicycle-dot.outcome-na {
      box-shadow: 0 0 0 1px rgba(100, 116, 139, 0.45);
      opacity: 0.75;
    }
    .hemicycle-dot.filtered-out {
      opacity: 0.2;
    }
    .hemicycle-dot:hover {
      transform: scale(1.35);
      z-index: 8;
    }
    .hemicycle-dot.benchmark-dot {
      width: 13px;
      height: 13px;
      border-color: rgba(251, 191, 36, 0.95);
      box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.45);
      z-index: 6;
    }
    .hemicycle-tooltip {
      display: none;
      position: absolute;
      width: min(290px, 86vw);
      border-radius: 12px;
      border: 1px solid rgba(148, 163, 184, 0.55);
      background: rgba(15, 23, 42, 0.94);
      color: #e2e8f0;
      padding: 10px 11px;
      box-shadow: 0 14px 36px rgba(2, 6, 23, 0.55);
      z-index: 20;
      pointer-events: none;
    }
    .hemicycle-tooltip-head {
      display: flex;
      gap: 10px;
      align-items: center;
      margin-bottom: 8px;
    }
    .hemicycle-avatar {
      width: 34px;
      height: 34px;
      border-radius: 999px;
      background: linear-gradient(135deg, #1d4ed8 0%, #38bdf8 100%);
      color: #fff;
      font-size: 12px;
      font-weight: 900;
      display: flex;
      align-items: center;
      justify-content: center;
      border: 1px solid rgba(255, 255, 255, 0.24);
      flex: 0 0 auto;
    }
    .hemicycle-name {
      font-size: 13px;
      font-weight: 900;
      color: #f8fafc;
      line-height: 1.2;
    }
    .hemicycle-meta {
      font-size: 11px;
      color: #94a3b8;
      line-height: 1.25;
      font-weight: 700;
    }
    .hemicycle-vote-line {
      font-size: 11px;
      font-weight: 800;
      color: #cbd5e1;
      margin-bottom: 8px;
    }
    .hemicycle-votes {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
    }
    .mini-vote {
      display: inline-flex;
      align-items: center;
      padding: 3px 7px;
      border-radius: 999px;
      font-size: 10px;
      font-weight: 900;
      border: 1px solid transparent;
      letter-spacing: 0.02em;
    }
    .vote-yes { color: #86efac; background: rgba(34, 197, 94, 0.18); border-color: rgba(34, 197, 94, 0.4); }
    .vote-no { color: #fca5a5; background: rgba(239, 68, 68, 0.18); border-color: rgba(239, 68, 68, 0.4); }
    .vote-abstain { color: #cbd5e1; background: rgba(148, 163, 184, 0.18); border-color: rgba(148, 163, 184, 0.4); }
    .vote-na { color: #94a3b8; background: rgba(100, 116, 139, 0.18); border-color: rgba(100, 116, 139, 0.4); }
    .command-list {
      display: grid;
      gap: 10px;
      margin-top: 10px;
    }
    .command-row {
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 8px 9px;
      background: #f8fafc;
    }
    .command-row-top {
      display: flex;
      justify-content: space-between;
      gap: 8px;
      font-size: 12px;
      color: var(--text);
      font-weight: 800;
      margin-bottom: 4px;
    }
    .command-row-bar {
      height: 6px;
      border-radius: 999px;
      background: #e2e8f0;
      overflow: hidden;
    }
    .command-row-bar span {
      display: block;
      height: 100%;
      border-radius: 999px;
      background: linear-gradient(90deg, #38bdf8 0%, #22d3ee 100%);
    }
    .command-row-meta {
      margin-top: 5px;
      font-size: 10px;
      color: var(--muted);
      font-weight: 700;
    }
    .command-feed {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
      gap: 10px;
      margin-top: 10px;
    }
    .command-feed-item {
      border-radius: 12px;
      border: 1px solid var(--border);
      background: #fff;
      color: var(--text);
      padding: 9px 10px;
      text-align: left;
      cursor: pointer;
      transition: all 0.2s ease;
    }
    .command-feed-item:hover {
      border-color: var(--il-blue);
      background: #eff6ff;
      transform: translateY(-2px);
    }
    .command-feed-item.active {
      border-color: var(--il-blue);
      box-shadow: 0 0 0 1px rgba(0, 102, 204, 0.16) inset;
      background: #eff6ff;
    }
    .feed-head {
      display: flex;
      justify-content: space-between;
      gap: 8px;
      align-items: flex-start;
    }
    .feed-title {
      font-size: 12px;
      font-weight: 800;
      color: var(--text);
      line-height: 1.3;
    }
    .feed-code {
      font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
      font-size: 10px;
      color: var(--muted);
      flex: 0 0 auto;
    }
    .feed-meta {
      margin: 4px 0 6px;
      font-size: 10px;
      color: var(--muted);
      font-weight: 700;
    }
    .feed-badges {
      display: flex;
      gap: 6px;
      flex-wrap: wrap;
    }
    .feed-badge {
      font-size: 10px;
      font-weight: 900;
      border-radius: 999px;
      padding: 3px 7px;
      border: 1px solid transparent;
    }
    .feed-badge.yes { color: #86efac; background: rgba(34, 197, 94, 0.18); border-color: rgba(34, 197, 94, 0.4); }
    .feed-badge.no { color: #fca5a5; background: rgba(239, 68, 68, 0.18); border-color: rgba(239, 68, 68, 0.4); }
    .feed-badge.abstain { color: #cbd5e1; background: rgba(148, 163, 184, 0.18); border-color: rgba(148, 163, 184, 0.4); }
    .command-empty {
      color: var(--muted);
      font-size: 12px;
      font-weight: 700;
      padding: 14px 4px;
      text-align: center;
    }

    @media (max-width: 1180px) {
      .command-bento {
        grid-template-columns: 1fr;
      }
      .command-card-hemicycle {
        grid-row: auto;
      }
      .command-card-feed {
        grid-column: auto;
      }
      .hemicycle-stage {
        min-height: 400px;
      }
    }
    @media (max-width: 768px) {
      .command-center {
        padding: 12px;
      }
      .command-title {
        font-size: 20px;
      }
      .command-filters label {
        min-width: 150px;
      }
      .hemicycle-stage {
        min-height: 340px;
      }
      .command-feed {
        grid-template-columns: 1fr;
      }
    }

/* ── Mandate badges ────────────────────────────────────────────────────── */
.mandate-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  margin-right: 6px;
  vertical-align: middle;
  letter-spacing: 0.04em;
}
.mandate-9th {
  background: rgba(249, 115, 22, 0.15);
  color: #ea580c;
  border: 1px solid rgba(249, 115, 22, 0.35);
}
.mandate-8th {
  background: rgba(20, 184, 166, 0.12);
  color: #0f766e;
  border: 1px solid rgba(20, 184, 166, 0.3);
}
.mandate-10th {
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
  border: 1px solid rgba(37, 99, 235, 0.3);
}

/* ── Mandate bulk-action row ───────────────────────────────────────────── */
.mandate-bulk-actions {
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}

/* ── Session title tooltip (files list + compare table) ───────────────── */
.session-full-title {
  cursor: default;
  border-bottom: 1px dotted var(--muted);
}
.session-title-cell {
  max-width: 280px;
  white-space: normal;
  line-height: 1.4;
}
.vote-source-link {
  font-size: 10px;
  color: var(--il-blue);
  text-decoration: none;
  margin-left: 4px;
  opacity: 0.7;
  vertical-align: super;
}
.vote-source-link:hover { opacity: 1; text-decoration: underline; }

/* ── Group score cells in compare table ───────────────────────────────── */
.group-score-cell {
  min-width: 110px;
  vertical-align: middle;
}
.group-majority {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.06em;
  margin-right: 4px;
}
.group-for    { background: rgba(34, 197, 94, 0.15); color: #16a34a; border: 1px solid rgba(34,197,94,0.3); }
.group-against { background: rgba(239, 68, 68, 0.12); color: #dc2626; border: 1px solid rgba(239,68,68,0.3); }
.group-abstain { background: rgba(234, 179, 8, 0.12); color: #ca8a04; border: 1px solid rgba(234,179,8,0.3); }

.group-score-bar {
  display: inline-block;
  width: 60px;
  height: 6px;
  background: rgba(148,163,184,0.2);
  border-radius: 3px;
  vertical-align: middle;
  margin-right: 4px;
  overflow: hidden;
}
.group-score-fill {
  height: 100%;
  background: var(--il-blue);
  border-radius: 3px;
}
.group-score-pct {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  vertical-align: middle;
}

/* ── Summary rows in compare table ────────────────────────────────────── */
.summary-row td {
  background: rgba(37, 99, 235, 0.06);
  font-size: 12px;
  border-top: 2px solid var(--border);
  padding: 8px 10px;
}
.summary-row.summary-good td { background: rgba(34, 197, 94, 0.08); }
.summary-row.summary-low td  { background: rgba(239, 68, 68, 0.06); }

/* ── Match icons in MEP vs Group mode ─────────────────────────────────── */
.match-icon {
  font-size: 14px;
  font-weight: 900;
}
.match-icon.match    { color: #16a34a; }
.match-icon.mismatch { color: #dc2626; }

/* ── Column count chip in table header ────────────────────────────────── */
.col-count {
  font-weight: 400;
  font-size: 11px;
  opacity: 0.7;
}

/* ── Vote position colour helpers (used in compare table) ─────────────── */
.vote-for       { background: rgba(34,197,94,0.12);  color: #16a34a; border: 1px solid rgba(34,197,94,0.3); }
.vote-against   { background: rgba(239,68,68,0.12);   color: #dc2626; border: 1px solid rgba(239,68,68,0.3); }
.vote-abstention { background: rgba(234,179,8,0.10);   color: #ca8a04; border: 1px solid rgba(234,179,8,0.3); }

/* ── Intelligence Summary Panel ────────────────────────────────────────── */
#intelSummary { margin-bottom: 24px; }

.intel-summary {
  background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 16px;
  padding: 20px 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.intel-summary-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.intel-summary-title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--il-blue);
}
.intel-summary-scope {
  font-size: 12px;
  color: var(--muted);
}

.intel-kpi-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  background: transparent;
  border: none;
  border-radius: 0;
  overflow: visible;
}
.intel-kpi {
  padding: 12px 14px;
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 8px;
  background: var(--card-bg, #fff);
  box-shadow: 0 1px 4px rgba(15,23,42,0.04);
  transition: box-shadow 0.2s;
}
.intel-kpi:hover { box-shadow: 0 3px 12px rgba(15,23,42,0.08); }
.intel-kpi:last-child { border-right: 1px solid var(--border-subtle, #e2e8f0); }
.intel-kpi-icon { font-size: 16px; margin-bottom: 5px; line-height: 1; }
.intel-kpi-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  font-family: 'SF Mono', 'Fira Code', ui-monospace, monospace;
  letter-spacing: -0.03em;
}
.intel-kpi-unit { font-size: 13px; font-weight: 600; color: var(--muted); font-family: inherit; }
.intel-kpi-sub {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  font-family: 'SF Mono', 'Fira Code', ui-monospace, monospace;
}
.intel-kpi-label {
  font-size: 10px;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.3;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.intel-kpi-bar {
  height: 3px;
  background: rgba(148,163,184,0.2);
  border-radius: 2px;
  margin-top: 8px;
  overflow: hidden;
}
.intel-kpi-bar-fill { height: 100%; border-radius: 2px; transition: width 0.5s ease; }
.intel-kpi-accent { border-color: #f59e0b; background: linear-gradient(135deg,#fffbeb,#fff); }
.intel-kpi-accent .intel-kpi-value { color: #d97706; }
.intel-kpi-ally   { border-color: rgba(22,163,74,0.35); background: linear-gradient(135deg,#f0fdf4,#fff); }
.intel-kpi-ally   .intel-kpi-value { color: #16a34a; }
.intel-kpi-up     { border-color: rgba(22,163,74,0.35); background: linear-gradient(135deg,#f0fdf4,#fff); }
.intel-kpi-up     .intel-kpi-value { color: #16a34a; }
.intel-kpi-down   { border-color: rgba(220,38,38,0.25); background: linear-gradient(135deg,#fef2f2,#fff); }
.intel-kpi-down   .intel-kpi-value { color: #dc2626; }

/* Signal pills row */
.intel-signals {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.signal-pill {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
}
.signal-pill.signal-up      { background: rgba(34,197,94,0.12);  color: #16a34a; border: 1px solid rgba(34,197,94,0.3); }
.signal-pill.signal-down    { background: rgba(239,68,68,0.10);   color: #dc2626; border: 1px solid rgba(239,68,68,0.3); }
.signal-pill.signal-risk    { background: rgba(239,68,68,0.10);   color: #dc2626; border: 1px solid rgba(239,68,68,0.3); }
.signal-pill.signal-warn    { background: rgba(234,179,8,0.12);   color: #ca8a04; border: 1px solid rgba(234,179,8,0.35); }
.signal-pill.signal-neutral { background: rgba(148,163,184,0.12); color: #475569; border: 1px solid rgba(148,163,184,0.3); }

/* Group alignment ranking inside intel summary */
.intel-group-ranking {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.intel-group-ranking-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 4px;
}
.intel-group-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.intel-group-row.intel-group-focus {
  font-weight: 700;
}
.intel-group-label {
  width: 54px;
  flex-shrink: 0;
  color: var(--text);
}
.intel-group-rank {
  width: 22px;
  flex-shrink: 0;
  font-size: 12px;
  text-align: center;
}
.intel-group-bar-wrap {
  flex: 1;
  height: 12px;
  background: rgba(148,163,184,0.15);
  border-radius: 6px;
  overflow: hidden;
}
.intel-group-bar {
  height: 100%;
  border-radius: 6px;
  transition: width 0.5s cubic-bezier(0.25,0.46,0.45,0.94);
  min-width: 3px;
}
.intel-group-row.intel-group-focus .intel-group-label { color: var(--il-blue); font-weight: 800; }
.intel-group-pct {
  width: 32px;
  text-align: right;
  font-weight: 700;
  font-size: 11px;
  color: var(--muted);
}

/* ── Coalition Snapshot chart card ─────────────────────────────────────── */
.command-card-coalition {
  grid-column: 1 / -1;
  min-height: 180px;
}
.command-card-coalition .chart-container {
  height: 280px;
}
.coalition-chart-wrap {
  position: relative;
  overflow: hidden;
}
.coalition-chart-wrap canvas {
  cursor: pointer;
}
.coalition-overlay-panel {
  position: absolute;
  top: 10px;
  right: 10px;
  width: min(390px, 48%);
  max-height: calc(100% - 20px);
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.78);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  box-shadow: 0 12px 28px rgba(2, 6, 23, 0.34);
  color: #e2e8f0;
  padding: 10px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 8px;
  z-index: 4;
}
.coalition-overlay-panel:not(.active) {
  display: none;
}
.coalition-overlay-empty {
  font-size: 11px;
  font-weight: 700;
  color: #cbd5e1;
  line-height: 1.45;
}
.coalition-overlay-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
}
.coalition-overlay-title {
  font-size: 12px;
  font-weight: 900;
  color: #f8fafc;
  line-height: 1.3;
}
.coalition-overlay-sub {
  margin-top: 2px;
  font-size: 10px;
  color: #cbd5e1;
  font-weight: 700;
  line-height: 1.35;
}
.coalition-overlay-clear {
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.72);
  color: #cbd5e1;
  font-size: 10px;
  font-weight: 800;
  padding: 4px 8px;
  cursor: pointer;
}
.coalition-overlay-clear:hover {
  border-color: rgba(147, 197, 253, 0.58);
  color: #dbeafe;
}
.coalition-overlay-kpis {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.coalition-kpi {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 7px;
  font-size: 10px;
  font-weight: 800;
  border: 1px solid transparent;
}
.coalition-kpi.for {
  background: rgba(22, 163, 74, 0.18);
  border-color: rgba(22, 163, 74, 0.44);
  color: #86efac;
}
.coalition-kpi.against {
  background: rgba(220, 38, 38, 0.18);
  border-color: rgba(220, 38, 38, 0.4);
  color: #fca5a5;
}
.coalition-kpi.abstain {
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(245, 158, 11, 0.4);
  color: #fcd34d;
}
.coalition-overlay-list {
  overflow: auto;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.4);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.coalition-overlay-row {
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(30, 41, 59, 0.66);
  padding: 6px 7px;
}
.coalition-overlay-name {
  font-size: 11px;
  font-weight: 800;
  color: #f8fafc;
  line-height: 1.3;
}
.coalition-overlay-meta {
  margin-top: 1px;
  font-size: 10px;
  color: #94a3b8;
  font-weight: 700;
}
.coalition-overlay-badges {
  margin-top: 5px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.coalition-vote,
.coalition-align {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
}
.coalition-vote.for {
  color: #86efac;
  background: rgba(22, 163, 74, 0.16);
  border-color: rgba(22, 163, 74, 0.38);
}
.coalition-vote.against {
  color: #fca5a5;
  background: rgba(220, 38, 38, 0.16);
  border-color: rgba(220, 38, 38, 0.34);
}
.coalition-vote.abstain {
  color: #fcd34d;
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 158, 11, 0.34);
}
.coalition-vote.na {
  color: #cbd5e1;
  background: rgba(148, 163, 184, 0.18);
  border-color: rgba(148, 163, 184, 0.28);
}
.coalition-align.aligned {
  color: #86efac;
  background: rgba(22, 163, 74, 0.16);
  border-color: rgba(22, 163, 74, 0.34);
}
.coalition-align.diverges {
  color: #fda4af;
  background: rgba(190, 24, 93, 0.17);
  border-color: rgba(190, 24, 93, 0.34);
}
.coalition-align.na {
  color: #cbd5e1;
  background: rgba(148, 163, 184, 0.16);
  border-color: rgba(148, 163, 184, 0.28);
}
.coalition-overlay-more {
  margin-top: 4px;
  font-size: 10px;
  font-weight: 700;
  color: #cbd5e1;
  text-align: center;
}

@media (max-width: 1024px) {
  .coalition-overlay-panel {
    position: static;
    width: auto;
    max-height: 210px;
    margin-top: 10px;
  }
}

/* ── Insights details cards ─────────────────────────────────────────────── */
.insights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.insight-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
}
.insight-card h4 {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 800;
}
.insight-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.insight-list li {
  font-size: 12px;
  color: var(--text);
  line-height: 1.4;
}
.insight-card--signals { border-left: 3px solid var(--il-blue); }
.insight-card--sessions { border-left: 3px solid #ff9900; }
.insight-card--allies   { border-left: 3px solid #16a34a; }

@media (max-width: 900px) {
  .intel-kpi { padding: 10px 12px; }
  .intel-kpi-value { font-size: 18px; }
  .intel-group-label { width: 40px; }
}

/* ── Similarity sections (most similar + polar opposites) ── */
.similarity-section { margin-bottom: 28px; }
.similarity-section-title {
  font-size: 14px;
  font-weight: 800;
  margin: 0 0 8px;
  letter-spacing: .02em;
}
.sim-similar .similarity-section-title { color: #16a34a; }
.sim-distant .similarity-section-title { color: #dc2626; }
.sim-distant tbody tr { background: rgba(254,226,226,.15); }
.sim-distant tbody tr:hover { background: rgba(254,226,226,.35); }

/* ── Distribution tiers ── */
.dist-tiers {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 0 4px;
}
.dist-tier {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--card-bg);
}
.dist-tier .tier-label { flex: 1; font-weight: 600; }
.dist-tier .tier-count { font-weight: 700; min-width: 70px; text-align: right; }
.dist-tier .tier-pct   { font-weight: 800; min-width: 38px; text-align: right; color: var(--il-blue); }
.tier-ally  { border-left: 3px solid #16a34a; }
.tier-swing { border-left: 3px solid #d97706; }
.tier-opp   { border-left: 3px solid #dc2626; }

/* ── Divided badge on delegation cards ── */
.divided-badge {
  font-size: 10px;
  font-weight: 700;
  color: #dc2626;
  background: rgba(220,38,38,.1);
  padding: 1px 5px;
  border-radius: 4px;
  margin-left: 4px;
  vertical-align: middle;
}

/* ── Swing MEPs section (Focus Group tab) ── */
#swingMEPsSection { margin: 16px 0 8px; }
#swingMEPsSection h3 { font-size: 18px; font-weight: 800; margin-bottom: 10px; }
.swing-meps-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.swing-mep-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(234,179,8,.1);
  border: 1px solid rgba(234,179,8,.4);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
}
.swing-mep-name    { font-weight: 600; }
.swing-mep-country { color: var(--text-secondary); font-size: 11px; }
.swing-mep-pct     { font-weight: 800; color: #d97706; }

/* ── EP Advanced Filters row ── */
.ep-advanced-filters { flex-wrap: wrap; gap: 8px; margin-top: 8px; }

/* ── Flat individual MEP list ── */
.mep-list-flat {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 860px;
}

/* ── Top Allies Table ── */
.allies-table { width: 100%; border-collapse: separate; border-spacing: 0 2px; font-size: 12px; }
.allies-table thead tr th {
  padding: 6px 8px;
  background: #f8fafc;
  color: #5b6476;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 2px solid var(--border);
}
.allies-table tbody tr { background: #fff; transition: background 0.12s; }
.allies-table tbody tr:hover { background: #eff6ff; }
.allies-table td { padding: 7px 8px; border-bottom: 1px solid rgba(227,232,240,0.5); vertical-align: middle; }
.ally-rank { color: var(--muted); font-size: 11px; font-weight: 800; text-align: right; padding-right: 10px; width: 24px; }
.ally-name strong { font-weight: 700; color: var(--text); }
.ally-country { font-size: 11px; color: var(--muted); }
.ally-match { display: flex; align-items: center; gap: 6px; }
.ally-bar-wrap { width: 80px; height: 8px; background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
}
.ally-bar-fill { height: 100%; border-radius: 4px; transition: width 0.4s ease; }
.ally-pct { font-size: 12px; font-weight: 700; color: var(--text); min-width: 32px; }
.ally-votes { font-size: 11px; color: var(--muted); text-align: center; }
.trend-chip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 6px; font-size: 12px; font-weight: 900;
}
.trend-chip.trend-up   { background: rgba(34,197,94,0.12);   color: #16a34a; }
.trend-chip.trend-down { background: rgba(239,68,68,0.10);   color: #dc2626; }
.trend-chip.trend-flat { background: rgba(148,163,184,0.12); color: #5b6476; }
.group-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}
.mini-bar-bg {
  display: inline-block;
  width: 60px;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  vertical-align: middle;
  margin-right: 4px;
}
.mini-bar-fill { height: 6px; border-radius: 3px; }
.trend-up   { color: #16a34a; font-weight: 700; }
.trend-down { color: #dc2626; font-weight: 700; }
.trend-flat { color: var(--muted); }

/* ── Topic filter bar ── */
.topic-filter-bar {
  padding: 8px 12px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 10px;
}
.active-topic-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  background: var(--il-blue, #0066cc);
  color: #fff;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  margin-top: 6px;
}

/* ── Position Probe badges ── */
.probe-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.probe-badge.aligned  { background: #dcfce7; color: #15803d; }
.probe-badge.mixed    { background: #fef9c3; color: #854d0e; }
.probe-badge.opposed  { background: #fee2e2; color: #b91c1c; }

/* ── Patterns Tab ── */
.analytics-grid--patterns {
  grid-template-columns: 1fr;
  gap: 20px;
}
.chart-container--cohesion { height: 260px; }

/* Topic Position Matrix */
.topic-matrix-wrap {
  overflow-x: auto;
  margin-top: 12px;
}
.topic-matrix {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
}
.topic-matrix thead th {
  padding: 8px 10px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
  border-bottom: 2px solid var(--border);
}
.topic-matrix thead th:first-child { text-align: left; }
.topic-matrix tbody tr:hover { background: var(--bg-2); }
.topic-head-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  border-radius: 8px;
  padding: 4px 6px;
}
.topic-head-btn:hover {
  border-color: #93c5fd;
  background: rgba(59, 130, 246, 0.08);
}
.topic-head-btn.active {
  border-color: #2563eb;
  background: rgba(37, 99, 235, 0.12);
  color: #1e40af;
}
.topic-head-meta {
  font-size: 10px;
  font-weight: 600;
  color: #64748b;
}
.topic-matrix-group {
  padding: 8px 10px;
  font-weight: 700;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 7px;
}
.topic-cell {
  padding: 7px 10px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid rgba(255,255,255,.15);
}
.topic-cell-clickable {
  cursor: pointer;
}
.topic-cell-clickable:hover {
  outline: 2px solid rgba(37, 99, 235, 0.35);
  outline-offset: -2px;
}
.topic-cell-selected {
  box-shadow: inset 0 0 0 2px rgba(29, 78, 216, 0.75);
}
.topic-cell-n {
  font-size: 10px;
  font-weight: 600;
  opacity: 0.72;
  margin-top: 1px;
}
.topic-pct {
  background: hsl(var(--cell-h, 38), 70%, 44%);
  color: #fff;
}
.topic-na {
  color: var(--muted);
  background: var(--bg-2);
  font-weight: 400;
}
.topic-ep-baseline-row {
  border-top: 1px dashed rgba(100, 116, 139, 0.35);
}
.topic-ep-baseline {
  background: rgba(15, 23, 42, 0.08);
  color: #0f172a;
}

/* Rebel MEPs list */
.rebel-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}
.rebel-row {
  display: grid;
  grid-template-columns: 10px 1fr 52px 38px 80px;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.rebel-name { font-weight: 600; }
.rebel-group { font-size: 11px; font-weight: 700; text-transform: uppercase; }
.rebel-dissent { font-size: 12px; font-weight: 700; text-align: right; color: var(--text); }
.rebel-bar-wrap {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.rebel-bar {
  height: 100%;
  border-radius: 3px;
  transition: width .3s;
}

/* ══════════════════════════════════════════════════════════════
   ANALYSIS PAGE · SLIDE-IN DRAWER PANELS
   ══════════════════════════════════════════════════════════════ */

/* Command Center always visible on analysis page */
body[data-page="analysis"] #tabCommand {
  display: block !important;
}

/* Secondary panels are drawers when active */
body[data-page="analysis"] #tabRenew,
body[data-page="analysis"] #tabEp,
body[data-page="analysis"] #tabInsights,
body[data-page="analysis"] #tabPatterns {
  display: none;
  position: fixed;
  top: 57px;
  right: 0;
  bottom: 0;
  width: min(72vw, 1080px);
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--bg);
  border-left: 1px solid var(--border);
  box-shadow: -6px 0 48px rgba(15, 23, 42, 0.16);
  z-index: 300;
}
body[data-page="analysis"] #tabRenew.active,
body[data-page="analysis"] #tabEp.active,
body[data-page="analysis"] #tabInsights.active,
body[data-page="analysis"] #tabPatterns.active {
  display: block;
  animation: drawerIn .22s cubic-bezier(.4,0,.2,1) forwards;
}
@keyframes drawerIn {
  from { transform: translateX(28px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* Drawer header (sticky inside panel) */
.drawer-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  background: rgba(248,250,252,.95);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.drawer-title {
  font-size: 15px;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -0.01em;
}
.drawer-close {
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-2);
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .14s, color .14s, border-color .14s;
}
.drawer-close:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #dc2626;
}
.drawer-body {
  padding: 20px 24px 40px;
}

/* ══════════════════════════════════════════════════════════════
   CSS REFINEMENTS · Global Polish Pass
   ══════════════════════════════════════════════════════════════ */

/* --shadow-lift and --card-radius were re-declared here with the exact same
   values as the main :root (~line 511) — a no-op duplicate, removed. */

/* Chart cards: cleaner with subtle top accent */
.chart-card {
  border-radius: var(--card-radius) !important;
  border: 1px solid var(--border) !important;
  box-shadow: var(--shadow) !important;
  background: #fff !important;
  padding: 20px 22px !important;
  transition: box-shadow .2s, transform .2s;
}
.chart-card::before {
  display: block !important;
  height: 3px !important;
  background: linear-gradient(90deg, var(--il-blue) 0%, rgba(37,99,235,.25) 100%) !important;
  border-radius: var(--card-radius) var(--card-radius) 0 0 !important;
  opacity: 1 !important;
  top: 0; left: 0; right: 0;
}
.chart-card:hover {
  box-shadow: var(--shadow-lift) !important;
  transform: translateY(-2px);
}
.chart-card h3 {
  font-size: 14px !important;
  font-weight: 800 !important;
  letter-spacing: -0.01em !important;
  margin: 0 0 14px !important;
  color: var(--text) !important;
}

/* Delegation cards: tighter, cleaner */
.delegation-card {
  border: 1px solid var(--border) !important;
  border-radius: var(--card-radius) !important;
  transition: box-shadow .18s, transform .18s !important;
}
.delegation-card:hover {
  transform: translateY(-2px) !important;
  box-shadow: var(--shadow-lift) !important;
}

/* Command center: premium feel */
.command-center {
  border-radius: 16px !important;
  border: 1px solid var(--border) !important;
  background: #fff !important;
  box-shadow: var(--shadow) !important;
}
.command-card {
  border-radius: 12px !important;
  border: 1px solid rgba(226,232,240,.8) !important;
  background: var(--bg-2) !important;
}

/* Panel header cleaner */
.panel h2 {
  font-size: 16px !important;
  font-weight: 900 !important;
  letter-spacing: -0.01em !important;
  padding-bottom: 14px !important;
  border-bottom: 1px solid var(--border) !important;
  margin-bottom: 16px !important;
}

/* Topbar: tighter height */
.topbar-title { padding: 18px 0 !important; }

/* list-meta: better readability */
.list-meta {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  font-weight: 500;
}

/* Chips: more refined */
.chip {
  border-radius: 8px !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  padding: 6px 12px !important;
  border: 1px solid var(--border) !important;
  background: var(--bg-2) !important;
  color: var(--muted) !important;
  cursor: pointer !important;
  transition: all .14s !important;
}
.chip.active {
  background: var(--il-blue) !important;
  color: #fff !important;
  border-color: transparent !important;
}
.chip:hover:not(.active) {
  background: #fff !important;
  color: var(--text) !important;
  border-color: var(--il-blue) !important;
}

/* Control buttons */
.control-btn {
  border-radius: 8px !important;
  font-weight: 700 !important;
  font-size: 13px !important;
  padding: 8px 14px !important;
}

/* Insights intro strip */
.insights-intro {
  border-left: 3px solid var(--il-blue) !important;
  background: #f0f6ff !important;
  border-radius: 0 10px 10px 0 !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: #334155 !important;
  padding: 10px 14px !important;
}

/* Patterns grid spacing */
.analytics-grid--patterns {
  gap: 18px;
}

/* Topic matrix improvements */
.topic-matrix thead th {
  background: var(--bg-2);
}
/* Keep zebra only on the group label cell; do not override heatmap cells */
.topic-matrix tbody tr:nth-child(even) td.topic-matrix-group {
  background-color: rgba(0,0,0,.015);
}
.topic-matrix tbody tr:nth-child(even) .topic-pct {
  filter: brightness(.97);
}

/* Rebellion list improvements */
.rebel-list { gap: 8px; }
.rebel-row {
  background: var(--bg-2);
  border-radius: 8px;
  padding: 8px 10px;
}

/* Drawer inner spacing */
body[data-page="analysis"] .drawer-body .analytics-grid {
  margin-top: 4px;
}

@media (max-width: 900px) {
  body[data-page="analysis"] #tabRenew,
  body[data-page="analysis"] #tabEp,
  body[data-page="analysis"] #tabInsights,
  body[data-page="analysis"] #tabPatterns {
    width: 100vw;
    top: 0;
  }
}

/* ══════════════════════════════════════════════════════════════
   FOCUS GROUP DEEP DIVE · Spectrum + Allies/Differ
   ══════════════════════════════════════════════════════════════ */

.chart-container--spectrum { height: 440px; }

.fg-extra-grid {
  grid-template-columns: 1fr;
  margin-top: 8px;
}

/* Allies / Differ section */
.fg-ally-differ-wrap {
  margin: 24px 0 20px;
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  background: #fff;
  overflow: hidden;
}
.fg-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-2);
}
.fg-section-tabs {
  display: flex;
  gap: 6px;
}
.fg-tab-btn {
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  transition: all .14s;
}
.fg-tab-btn.active {
  background: var(--il-blue);
  color: #fff;
  border-color: transparent;
}
.fg-tab-btn:hover:not(.active) {
  border-color: var(--il-blue);
  color: var(--text);
}
.fg-table-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.fg-table-filters select {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  background: #fff;
  outline: none;
}
.fg-table-filters select:focus {
  border-color: var(--il-blue);
}
.fg-scope-chips { gap: 4px; }

.fg-table-panel { padding: 12px 16px; }
.fg-table-panel--hidden { display: none; }

/* Reuse allies-table styles from insights */

/* ══════════════════════════════════════════════════════════════
   STICKY TOPBAR (fixed, all pages)
   ══════════════════════════════════════════════════════════════ */
.topbar {
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  z-index: 400 !important;
}
.app-content {
  padding-top: 57px;
}

/* ══════════════════════════════════════════════════════════════
   FLAT ANALYSIS DASHBOARD · Section layout
   ══════════════════════════════════════════════════════════════ */

/* Sections */
.dash-section {
  margin-bottom: 36px;
}

/* Dark section header band */
.dash-section-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 9px 16px;
  background: var(--topbar-bg);
  border-radius: 10px;
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.dash-section-hdr > span:first-child {
  color: #f1f5f9;
}

/* Filter selects inside dark header */
.dash-section-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.dash-section-controls select {
  border: 1px solid rgba(255,255,255,.15);
  background: rgba(255,255,255,.08);
  color: #e2e8f0;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
}
.dash-section-controls .chip {
  font-size: 11px !important;
  padding: 4px 10px !important;
}
.dash-section-controls .chip.active {
  background: rgba(37,99,235,.7) !important;
  border-color: transparent !important;
  color: #fff !important;
}
.dash-section-controls .chip:not(.active) {
  background: rgba(255,255,255,.07) !important;
  border-color: rgba(255,255,255,.15) !important;
  color: #94a3b8 !important;
}

/* Sub-section header */
.dash-sub-hdr {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  margin: 22px 0 10px;
  letter-spacing: -0.01em;
}

/* ══════════════════════════════════════════════════════════════
   COMPACT LIVE FEED
   ══════════════════════════════════════════════════════════════ */
.command-card-feed--compact {
  grid-column: 1 / -1;
  padding: 10px 14px !important;
  min-height: unset !important;
}
.command-feed-compact-hdr {
  font-size: 10px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.command-feed--compact {
  display: flex;
  flex-direction: row;
  overflow-x: auto;
  overflow-y: hidden;
  gap: 8px;
  max-height: 80px;
  padding-bottom: 4px;
  /* scrollbar-width: thin; Not supported in Chrome <121, Safari, Samsung Internet. Consider custom scrollbar styling. */
}
.command-feed--compact .command-feed-item {
  flex: 0 0 auto;
  max-width: 220px;
  padding: 5px 10px !important;
  font-size: 11px !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ══════════════════════════════════════════════════════════════
   DEFAULT HIDDEN STATE (replaces inline style="display:none")
   ══════════════════════════════════════════════════════════════ */
.sessions-badge,
.live-update,
#navExport { display: none; }

/* Graph page — initial hidden state (replaces inline style="display:none") */
#sigmaVoteFocusRow,
#sigmaTooltip,
#sigmaFa2Badge,
#sgSamplingNotice { display: none; }

/* #analysisPanel, #intelSummary, #topicFilterBar: hidden by default,
   JS sets style.display directly — CSS default ensures clean initial state */
#intelSummary,
#topicFilterBar,
#topicClearBtn,
#activeTopicPill,
#swingMEPsSection,
#renewShowMore,
#epShowMore,
#benchmarkPanel,
#tabGraph { display: none; }

/* ══════════════════════════════════════════════════════════════
   SIGMA.JS GRAPH PAGE
   ══════════════════════════════════════════════════════════════ */

/* Page layout — stable viewport fit for Sigma */

body[data-page="graph"] .app-content {
  height: 100%;
  min-height: 0;
  overflow: hidden;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

body[data-page="graph"] .sigma-page-content {
  padding: 8px 10px 10px !important;
  flex: 1 1 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
  box-sizing: border-box;
}

body[data-page="graph"] .sigma-shell {
  display: flex;
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(4, 11, 22, 0.02) 0%, rgba(4, 11, 22, 0.10) 100%);
  border-top: 1px solid rgba(148, 163, 184, 0.16);
}

/* ── Sidebar ─────────────────────────────────────────────────── */
body[data-page="graph"] .sigma-sidebar {
  width: 272px;
  min-width: 272px;
  background: linear-gradient(180deg, #0f172a 0%, #0b1323 100%);
  border-right: 1px solid rgba(148, 163, 184, 0.22);
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

body[data-page="graph"] .sigma-sidebar-inner {
  padding: 12px 14px 24px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

body[data-page="graph"] .sg-section:last-child { border-bottom: none; }

.sg-section-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 7px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sg-section-actions {
  display: flex;
  gap: 4px;
}

.sg-text-btn {
  background: none;
  border: 1px solid #334155;
  border-radius: 4px;
  color: #94a3b8;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.sg-text-btn:hover {
  background: #1e293b;
  color: #e2e8f0;
}

/* Layout + edge-mode chips */
.sg-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.sigma-layout-chip,
.sigma-edge-mode-chip {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 999px;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 12px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  font-family: inherit;
}
.sigma-layout-chip:hover,
.sigma-edge-mode-chip:hover {
  background: #273549;
  color: #e2e8f0;
}
.sigma-layout-chip.active,
.sigma-edge-mode-chip.active {
  background: #2563eb;
  border-color: #3b82f6;
  color: #fff;
}

.sigma-affinity-chip {
  background: rgba(30, 41, 59, 0.78);
  border: 1px solid #334155;
  border-radius: 999px;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 4px 10px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  font-family: inherit;
}
.sigma-affinity-chip:hover {
  background: #273549;
  color: #e2e8f0;
}
.sigma-affinity-chip.active {
  background: rgba(59, 130, 246, 0.2);
  border-color: #3b82f6;
  color: #dbeafe;
}


/* Select */
.sg-select {
  width: 100%;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 7px;
  color: #e2e8f0;
  font-family: inherit;
  font-size: 11px;
  padding: 5px 8px;
  outline: none;
  cursor: pointer;
  box-sizing: border-box;
}
.sg-select:focus { border-color: #3b82f6; }

/* Group chips */
.sg-group-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.sigma-group-chip {
  background: #1e293b;
  border: 1.5px solid var(--chip-col, #334155);
  border-radius: 5px;
  color: #94a3b8;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 7px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, opacity 0.12s;
  font-family: inherit;
}
.sigma-group-chip.active {
  background: color-mix(in srgb, var(--chip-col, #334155) 18%, #1e293b);
  color: var(--chip-col, #e2e8f0);
}
.sigma-group-chip:not(.active) {
  opacity: 0.4;
  border-color: #334155;
  color: #475569;
}

/* Toggle + range rows */
.sg-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #94a3b8;
  font-size: 12px;
  cursor: pointer;
  padding: 3px 0;
  gap: 8px;
}

.sg-range-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: #94a3b8;
  font-size: 11px;
  padding: 4px 0 0;
}
.sg-range-row input[type="range"] { width: 100%; accent-color: #3b82f6; }

/* Vote focus row */
.sg-vote-focus-row { margin-top: 4px; }
.sg-section-title--sub { margin-top: 8px; }
.sg-subtle-note {
  font-size: 11px;
  color: #64748b;
  line-height: 1.35;
  border: 1px dashed #334155;
  border-radius: 8px;
  padding: 7px 8px;
  background: rgba(15, 23, 42, 0.42);
}

/* ── Canvas area ─────────────────────────────────────────────── */
body[data-page="graph"] .sigma-canvas-wrap {
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  display: flex;
  position: relative;
  background:
    radial-gradient(720px 360px at 46% 2%, rgba(37, 99, 235, 0.18), rgba(4, 11, 22, 0) 64%),
    #040b16;
  border-left: 1px solid rgba(148, 163, 184, 0.14);
  overflow: hidden;
}

body[data-page="graph"] .sigma-canvas-wrap::before {
  content: '';
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 12px;
  pointer-events: none;
  z-index: 0;
}

body[data-page="graph"] .sigma-container,
body[data-page="graph"] .cy-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  z-index: 1;
}

/* Empty state */
.sigma-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #475569;
  font-size: 14px;
  text-align: center;
  gap: 8px;
  line-height: 1.6;
}
.sigma-empty a { color: #3b82f6; }

/* Tooltip */
.sg-tooltip {
  position: absolute;
  background: rgba(15,23,42,0.95);
  border: 1px solid #1e293b;
  border-radius: 8px;
  padding: 10px 12px;
  pointer-events: none;
  z-index: 50;
  min-width: 160px;
  max-width: 220px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.65), 0 0 0 1px rgba(59,130,246,0.12);
  color: #e2e8f0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 8px;
  font-size: 11px;
  line-height: 1.45;
}
.sg-tooltip.hidden { display: none; }

.sg-tip-name {
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 4px;
}
.sg-tip-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #94a3b8;
  font-size: 11px;
  margin-bottom: 6px;
}
.sg-tip-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.sg-tip-row {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.sg-tip-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: #1e293b;
  color: #94a3b8;
}
.sg-tip-badge.green { background: #052e16; color: #4ade80; }
.sg-tip-badge.amber { background: #1c1404; color: #fbbf24; }
.sg-tip-badge.red   { background: #1c0505; color: #f87171; }

/* FA2 computing badge */
.sg-fa2-badge {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(37,99,235,0.15);
  border: 1px solid rgba(59,130,246,0.3);
  border-radius: 20px;
  padding: 5px 14px;
  color: #93c5fd;
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 7px;
  z-index: 30;
  pointer-events: none;
}
.sg-fa2-badge.hidden { display: none; }

.sg-fa2-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3b82f6;
  will-change: opacity;
  animation: sg-pulse 1s ease-in-out infinite;
}
@keyframes sg-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.25; }
}

/* Zoom controls */
.sg-zoom-controls {
  position: absolute;
  bottom: 56px;
  right: 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  z-index: 20;
}

.sg-zoom-btn {
  width: 34px;
  height: 34px;
  background: rgba(15,23,42,0.85);
  border: 1px solid #334155;
  border-radius: 7px;
  color: #94a3b8;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s, color 0.12s;
  font-family: inherit;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.sg-zoom-btn:hover {
  background: #1e293b;
  color: #e2e8f0;
}

/* Axis labels */
.sg-axis-label {
  position: absolute;
  bottom: 14px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: rgba(148,163,184,0.4);
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
}
.sg-axis-left  { left: 14px; }
.sg-axis-right { right: 14px; }

/* Legend */
.sg-legend {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  justify-content: center;
  pointer-events: none;
  max-width: 70%;
  background: rgba(10,17,32,0.75);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
  padding: 6px 10px;
}

.sg-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  pointer-events: all;
}
.sg-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.sg-legend-lbl {
  font-size: 10px;
  font-weight: 600;
  color: #64748b;
  -webkit-user-select: none;
  user-select: none;
}
.sg-legend-item:hover .sg-legend-lbl { color: #94a3b8; }

/* ── Selection panel ─────────────────────────────────────────── */
.sg-sel-wrap {
  padding: 2px 0 0;
}

.sg-sel-empty {
  text-align: center;
  color: #334155;
  font-size: 12px;
  padding: 20px 8px;
  line-height: 1.6;
}
.sg-sel-empty-icon {
  font-size: 24px;
  color: #1e293b;
  margin-bottom: 8px;
}
.sg-sel-empty-hint {
  font-size: 10px;
  color: #334155;
  margin-top: 4px;
}

@keyframes sgPanelIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

.sg-sel-card {
  background: rgba(15,23,42,0.95);
  border: 1px solid #1e293b;
  border-radius: 10px;
  overflow: hidden;
  animation: sgPanelIn 0.22s ease;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.sg-sel-header {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 10px 8px;
  border-bottom: 1px solid #1e293b;
}

.sg-sel-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.sg-sel-identity { flex: 1; min-width: 0; }

.sg-sel-name {
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sg-sel-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #64748b;
  font-size: 10px;
  margin-top: 2px;
}

.sg-sel-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.sg-sel-close {
  background: none;
  border: none;
  color: #475569;
  font-size: 13px;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
  flex-shrink: 0;
}
.sg-sel-close:hover { color: #e2e8f0; }

.sg-sel-vote-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  text-align: center;
  border-bottom: 1px solid #1e293b;
}
.sg-sel-vote-badge.green { background: #052e16; color: #4ade80; }
.sg-sel-vote-badge.amber { background: #1c1404; color: #fbbf24; }
.sg-sel-vote-badge.red   { background: #1c0505; color: #f87171; }

/* KPIs */
.sg-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(58px, 1fr));
  gap: 1px;
  background: #1e293b;
  border-bottom: 1px solid #1e293b;
}

.sg-kpi {
  background: #0f172a;
  padding: 8px 4px;
  text-align: center;
}
.sg-kpi-val {
  font-size: 16px;
  font-weight: 700;
  color: #e2e8f0;
  line-height: 1;
}
.sg-kpi-val.green { color: #4ade80; }
.sg-kpi-val.amber { color: #fbbf24; }
.sg-kpi-val.red   { color: #f87171; }
.sg-kpi-lbl {
  font-size: 9px;
  font-weight: 600;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 3px;
}

/* Connection / similar sections */
.sg-sel-section {
  padding: 8px 10px;
  border-bottom: 1px solid #0f172a;
}
.sg-sel-section-ttl {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #475569;
  margin-bottom: 5px;
}

.sg-mini-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
  font-size: 11px;
  color: #94a3b8;
}
.sg-mini-row.clickable { cursor: pointer; border-radius: 4px; padding: 3px 4px; }
.sg-mini-row.clickable:hover { background: #1e293b; }
.sg-mini-dot  { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.sg-mini-grp  { flex: 1; }
.sg-mini-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sg-mini-cnt  { color: #475569; font-weight: 600; font-size: 10px; }
.sg-mini-pct  { color: #64748b; font-weight: 700; font-size: 10px; margin-left: auto; }

/* Action buttons */
.sg-sel-actions {
  display: flex;
  gap: 6px;
  padding: 8px 10px;
}

.sg-sel-btn {
  flex: 1;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 6px;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 600;
  padding: 6px 8px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  font-family: inherit;
}
.sg-sel-btn:hover { background: #273549; color: #e2e8f0; }
.sg-sel-btn.primary {
  background: #2563eb;
  border-color: #3b82f6;
  color: #fff;
}
.sg-sel-btn.primary:hover { background: #1d4ed8; }

.sg-sel-actions--secondary {
  padding-top: 0;
  border-top: 1px solid #1e293b;
}
.sg-sel-btn--link {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.sg-sel-btn--link:hover { text-decoration: none; }

.sg-sampling-notice {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15,23,42,0.78);
  border: 1px solid rgba(148,163,184,0.25);
  color: #94a3b8;
  font-size: 10px;
  padding: 3px 12px;
  border-radius: 20px;
  max-width: 80%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  pointer-events: none;
  z-index: 10;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
/* Topic filter chips — wrap into multiple rows if many categories */
.sg-chips--wrap { flex-wrap: wrap; gap: 4px; }
.sigma-topic-chip {
  font-size: 9px; font-weight: 600; padding: 2px 7px;
  border-radius: 20px; border: 1px solid rgba(148,163,184,0.3);
  background: transparent; color: #64748b; cursor: pointer;
  white-space: nowrap; transition: all .15s;
}
.sigma-topic-chip.active,
.sigma-topic-chip:hover {
  background: var(--il-blue); color: #fff; border-color: var(--il-blue);
}

/* Analysis decision layout */
.decision-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.decision-filter-bar {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 280px)) 1fr;
  gap: 10px;
  align-items: end;
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.92);
}

.decision-filter-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.decision-filter-item > span {
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.decision-filter-kpi {
  justify-self: end;
  font-size: 12px;
  color: #475569;
}
.decision-filter-kpi strong {
  font-size: 18px;
  color: #0f172a;
  margin-left: 6px;
}

.decision-hidden {
  display: none !important;
}

.command-center--core {
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 14px;
  background: #fff;
  padding: 14px;
}

/* Explorer hub — consolidated.
   This rule used to be redefined 9 separate times across later "canonical"/
   "final" passes (Deploy Canonical, Premium Intelligence, Coordinated
   Refinement, Deploy Harmony, Soft-layered/Permanent Glass), each with
   !important, cycling through different border-radius/background/box-shadow
   values (one intermediate version even set a dark navy background). Below
   are the values that currently win the cascade in the browser today — the
   last !important declaration in source order, per property, wins at equal
   specificity:
     - border-radius: 8px            (last set ~old "Soft-layered" pass)
     - border / background / box-shadow: none / transparent / none
       (last set by the final "Graph: remove redundant inner bar..." pass)
     - backdrop-filter: blur(16px) saturate(1.08)  (from the same glass pass
       as border-radius; nothing later overrides it)
     - height/min-height: 100% / 0   (last set by the final graph-sizing pass)
     - max-height: 100% (set once, never contested)
     - display/flex-direction: flex/column (last set by the Deploy Harmony
       Pass; nothing later overrides it)
   All other competing declarations (border/background/box-shadow/radius
   values from the intervening passes) have been removed as dead — see the
   comments left at each removal site. .explorer-shell is used only on
   graph.html, always under body[data-page="graph"], so a bare selector here
   is equivalent to every scoped variant that used to compete for it. */
.explorer-shell {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  border: 0;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
  -webkit-backdrop-filter: blur(16px) saturate(1.08);
  backdrop-filter: blur(16px) saturate(1.08);
  overflow: hidden;
}

.explorer-tabbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(255, 255, 255, 0.92);
}

.explorer-tab {
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #fff;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}
.explorer-tab:hover {
  border-color: #93c5fd;
  color: #1e3a8a;
}
.explorer-tab.active {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #fff;
}

.explorer-focus-select {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.explorer-focus-select select {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 8px;
  font-family: inherit;
}

.explorer-focus-count {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.9);
  color: #475569;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 5px 10px;
  white-space: nowrap;
}

.explorer-focus-count strong {
  color: #1d4ed8;
  font-size: 12px;
  letter-spacing: 0;
}

.explorer-panel {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 12px;
}

body[data-page="graph"] .explorer-panel {
  min-height: 0;
  min-width: 0;
  flex: 1 1 0;
}

#explorerPanelSigma {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#explorerPanelSigma .sigma-shell {
  flex: 1;
  min-height: 0;
  height: 100%;
}

.explorer-presentation {
  margin: 0 12px 12px;
}

@media (max-width: 900px) {
  body[data-page="graph"] .sigma-page-content {
    padding: 8px !important;
  }
  /* .explorer-shell min-height/border-radius overrides removed: always
     beaten by the unconditional !important rules consolidated at ~line 6812
     (min-height:0, border-radius:8px), so this had zero live effect. */
  .decision-filter-bar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .decision-filter-kpi {
    justify-self: start;
  }
  .explorer-panel {
    padding: 10px;
  }
  .explorer-presentation {
    margin: 0 10px 10px;
  }
  .explorer-focus-select {
    width: 100%;
    margin-left: 0;
    justify-content: space-between;
  }
  .explorer-focus-count {
    width: 100%;
    justify-content: space-between;
    border-radius: 10px;
  }
  .explorer-focus-select select {
    width: 100%;
    max-width: 240px;
  }

  body[data-page="graph"] .sigma-sidebar {
    width: min(84vw, 318px);
    min-width: min(84vw, 318px);
  }
}

/* Hidden stubs (app.js compatibility — never visible) */
.sg-hidden-stub { display: none !important; }

/* ── Cross-group coalition matrix ──────────────────────── */
.cross-group-matrix {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-top: 6px;
}
.cross-group-matrix .cgm-corner { width: 52px; }
.cross-group-matrix th,
.cross-group-matrix td {
  padding: 5px 7px;
  text-align: center;
  border: 1px solid rgba(148, 163, 184, 0.18);
}
.cross-group-matrix .cgm-th {
  font-size: 11px;
  font-weight: 700;
  background: rgba(248, 250, 252, 0.8);
  white-space: nowrap;
}
.cross-group-matrix .cgm-row-th {
  font-size: 11px;
  font-weight: 700;
  text-align: right;
  background: rgba(248, 250, 252, 0.8);
  white-space: nowrap;
  padding-right: 10px;
}
.cross-group-matrix .cgm-cell {
  font-size: 11px;
  font-weight: 600;
  transition: opacity 0.1s;
}
.cross-group-matrix .cgm-cell:hover { opacity: 0.75; cursor: default; }
.cgm-high  { background: #bbf7d0; color: #14532d; }
.cgm-mid   { background: #fef9c3; color: #713f12; }
.cgm-low   { background: #fed7aa; color: #7c2d12; }
.cgm-cold  { background: #fecaca; color: #7f1d1d; }
.cgm-na    { background: #f1f5f9; color: #94a3b8; font-weight: 400; }
.cgm-diag  { background: #f8fafc; color: #cbd5e1; }
.cgm-focus-col,
.cgm-bench-col { background: rgba(29, 78, 216, 0.06) !important; }
.cgm-row-focus  { background: rgba(29, 78, 216, 0.04); }
.cgm-row-bench  { outline: 2px solid rgba(29, 78, 216, 0.3); }
.cross-group-matrix sup { font-size: 8px; color: #1d4ed8; margin-left: 1px; }

/* ── Outreach Priority Score ────────────────────────────── */
.outreach-score-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}
.outreach-sub {
  font-size: 10px;
  color: var(--muted, #94a3b8);
  margin-top: 2px;
  white-space: nowrap;
}

/* ── Swing Window vote dots ────────────────────────────── */
.vote-dots-row {
  display: flex;
  gap: 3px;
  align-items: center;
}
.vote-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-match { background: #22c55e; }
.dot-miss  { background: #ef4444; }

@media (max-width: 700px) {
  .cross-group-matrix { font-size: 10px; }
  .cross-group-matrix th,
  .cross-group-matrix td { padding: 3px 4px; }
}

/* Benchmark MEP search results */
.bench-result-btn {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s, border-color 0.12s;
  margin-bottom: 4px;
}
.bench-result-btn:hover { background: var(--bg-2); border-color: var(--il-blue); }
.bench-result-name { font-size: 13px; font-weight: 700; color: var(--text); }
.bench-result-meta { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); }
.bench-result-pct { font-size: 12px; font-weight: 800; color: var(--il-blue); min-width: 36px; text-align: right; }

/* ═══════════════════════════════════════════════════════════════
   Workstream C — Interaction Quality
   ══════════════════════════════════════════════════════════════ */

/* ── Semantic color tokens (missing from :root) ──
   --danger/-warning/-success used to be redeclared here (#dc2626/#d97706/
   #16a34a). A later :root (Premium Intelligence UI System, ~line 20465)
   redeclares the same three names (#ef4444/#f59e0b/#19b26b) with no
   !important — being later at equal specificity, it wins the cascade and is
   now the sole definition. The -bg/-border companions below are NOT
   duplicated anywhere else, so they stay here unchanged. */
:root {
  --danger-bg:  #fef2f2;
  --warning-bg: #fffbeb;
  --success-bg: #f0fdf4;
  --danger-border:  #fecaca;
  --warning-border: #fde68a;
  --success-border: #bbf7d0;
}

/* ── Empty states ── */
.empty-state {
  text-align: center;
  padding: 56px 24px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.empty-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--bg-2);
  color: var(--muted);
  margin-bottom: 4px;
  opacity: 0.7;
}
/* Lucide SVG inside .empty-icon */
.empty-icon svg { width: 28px; height: 28px; stroke-width: 1.5; }
/* Legacy emoji fallback */
.empty-icon:not(:has(svg)) { font-size: 36px; background: transparent; }
.empty-state h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-display);
}
.empty-state p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  max-width: 320px;
  color: var(--muted);
}

/* Sigma sidebar empty state (dark surface) */
.sg-sel-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 28px 16px;
  color: #475569;
  font-size: 12px;
  text-align: center;
}
.sg-sel-empty-icon {
  font-size: 24px;
  opacity: 0.4;
  margin-bottom: 2px;
}
.sg-sel-empty-hint { font-size: 11px; color: #334155; }

/* ── Status messages ── */
.status-msg {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  line-height: 1.45;
  border: 1px solid transparent;
}
.status-msg svg { width: 15px; height: 15px; flex-shrink: 0; margin-top: 1px; }

.status-msg--error {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  color: var(--danger);
}
.status-msg--warning {
  background: var(--warning-bg);
  border-color: var(--warning-border);
  color: var(--warning);
}
.status-msg--ok {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: var(--success);
}
.status-msg--info {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: var(--il-blue);
}

/* ── Input / select error state ── */
.is-error {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px rgba(220,38,38,0.12) !important;
}
.is-error:focus-visible {
  outline-color: var(--danger) !important;
}
.field-error {
  display: block;
  font-size: 11px;
  color: var(--danger);
  margin-top: 4px;
}

/* ── Disabled states ── */
button:disabled,
.control-btn:disabled,
.upload-btn:disabled,
.chip:disabled,
.toggle-btn:disabled,
.export-btn:disabled,
.nav-pill:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  pointer-events: none;
}
input:disabled,
select:disabled,
textarea:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--bg-2);
}

/* ── Focus rings on dark surfaces (Graph sidebar) ── */
.sigma-sidebar :focus-visible,
.topbar :focus-visible {
  outline: 2px solid rgba(255,255,255,0.6);
  outline-offset: 2px;
}

/* ── Loading skeleton (for empty containers awaiting data) ── */
.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--bg-2);
  border-radius: var(--radius-sm);
}
.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, var(--border) 50%, transparent 100%);
  transform: translateX(-100%);
  will-change: transform;
  animation: skeleton-sweep 1.4s ease infinite;
}
@keyframes skeleton-sweep {
  to { transform: translateX(100%); }
}

/* ═══════════════════════════════════════════════════════════════
   Graph Explorer — Responsive Sidebar Drawer
   ══════════════════════════════════════════════════════════════ */
.sigma-sidebar-drawer-toggle {
  display: none;
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 20;
  background: rgba(15,23,42,0.88);
  border: 1px solid #334155;
  color: #94a3b8;
  border-radius: 8px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.sigma-sidebar-drawer-toggle:hover { background: #1e293b; color: #e2e8f0; }
.sigma-sidebar-drawer-toggle .h-icon { width: 18px; height: 18px; }

.sigma-drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.52);
  z-index: 29;
}
.sigma-drawer-overlay.is-open { display: block; }

@media (max-width: 900px) {
  .sigma-sidebar-drawer-toggle { display: flex; }
  .sigma-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100dvh;
    z-index: 30;
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(0.4,0,0.2,1);
    box-shadow: 4px 0 24px rgba(0,0,0,0.45);
    min-width: 280px;
    width: 280px;
  }
  .sigma-sidebar.is-open { transform: translateX(0); }
}

/* ═══════════════════════════════════════════════════════════════
   Intelligence — Quick-action bar
   ══════════════════════════════════════════════════════════════ */
.intel-actions-bar {
  display: flex;
  gap: 8px;
  padding: 16px 0 8px;
  flex-wrap: wrap;
}
.intel-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  background: var(--il-blue);
  color: #fff;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-display);
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}
.intel-action-btn:hover {
  background: #1d4ed8;
  box-shadow: 0 2px 8px rgba(37,99,235,0.28);
}
.intel-action-btn.secondary {
  background: transparent;
  color: var(--il-blue);
  border: 1.5px solid var(--il-blue);
}
.intel-action-btn.secondary:hover {
  background: #eff6ff;
  box-shadow: none;
}

/* ═══════════════════════════════════════════════════════════════
   Intelligence — Collapsible panels
   ══════════════════════════════════════════════════════════════ */
.panel-collapse-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 0 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}
.panel-collapse-hdr .panel-title { margin-bottom: 0; flex: 1; }

.panel-collapse-btn {
  flex-shrink: 0;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--muted);
  transition: background 0.12s, color 0.12s;
}
.panel-collapse-btn:hover { background: var(--bg-2); color: var(--text); }
.panel-collapse-btn .h-icon { width: 15px; height: 15px; transition: transform 0.2s ease; }

.panel--collapsible.is-collapsed .panel-collapse-btn .h-icon { transform: rotate(-90deg); }

.panel-collapse-body {
  overflow: hidden;
  max-height: 3000px;
  opacity: 1;
  transition: max-height 0.3s ease, opacity 0.2s ease, margin-top 0.2s ease;
  margin-top: 12px;
}
.panel--collapsible.is-collapsed .panel-collapse-body {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
}

/* ═══════════════════════════════════════════════════════════════
   Unified Tooltips (Tippy.js)
   ══════════════════════════════════════════════════════════════ */
.tippy-box[data-theme~='vaa'] {
  background: #0f172a;
  color: #f8fafc;
  border: 1px solid #334155;
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(2, 6, 23, 0.34);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.35;
}

.tippy-box[data-theme~='vaa'] .tippy-content {
  padding: 8px 10px;
}

.tippy-box[data-theme~='vaa'] > .tippy-arrow::before {
  opacity: 0.96;
}
.tippy-box[data-theme~='vaa'][data-placement^='top'] > .tippy-arrow::before {
  border-top-color: #0f172a;
}
.tippy-box[data-theme~='vaa'][data-placement^='bottom'] > .tippy-arrow::before {
  border-bottom-color: #0f172a;
}
.tippy-box[data-theme~='vaa'][data-placement^='left'] > .tippy-arrow::before {
  border-left-color: #0f172a;
}
.tippy-box[data-theme~='vaa'][data-placement^='right'] > .tippy-arrow::before {
  border-right-color: #0f172a;
}

/* ── Settings Panel ──────────────────────────────────────────────────────── */
.settings-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  padding: 16px;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.settings-overlay.open { display: flex; }

.settings-card {
  background: var(--card, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.2);
  width: min(1120px, 96vw);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border, #e2e8f0);
}
.settings-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text, #0f172a);
}
.settings-close {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--muted, #64748b);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  line-height: 1;
}
.settings-close:hover { background: var(--bg-2, #f1f5f9); }

.settings-body {
  overflow-y: auto;
  padding: 18px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.settings-body-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(460px, 1.25fr);
  gap: 18px;
  align-items: start;
}
.settings-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.settings-section {
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  padding: 12px;
  background: #fbfcff;
}
.settings-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.settings-refresh-btn {
  border: 1px solid var(--border, #cbd5e1);
  border-radius: 7px;
  background: #fff;
  color: var(--muted, #64748b);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
  cursor: pointer;
}
.settings-refresh-btn:hover {
  background: var(--bg-2, #f1f5f9);
  color: var(--text, #0f172a);
}
.settings-control-feedback {
  min-height: 16px;
  font-size: 12px;
  color: var(--muted, #64748b);
  margin-bottom: 8px;
}
.settings-control-feedback.ok { color: #166534; }
.settings-control-feedback.error { color: #b91c1c; }
.settings-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.settings-kpi-card {
  border: 1px solid #e4ebfa;
  background: #fff;
  border-radius: 10px;
  padding: 10px;
}
.settings-kpi-label {
  font-size: 10px;
  color: #64748b;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-bottom: 5px;
}
.settings-kpi-value {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.25;
}
.settings-kpi-meta {
  margin-top: 4px;
  font-size: 11px;
  color: #64748b;
}
.settings-subsection {
  border-top: 1px solid #e2e8f0;
  padding-top: 10px;
  margin-top: 10px;
}
.settings-subtitle {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #64748b;
  margin-bottom: 8px;
}
.settings-job-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.settings-job-row {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  padding: 8px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.settings-job-title {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}
.settings-job-meta {
  font-size: 11px;
  color: #64748b;
  margin-top: 2px;
}
.settings-job-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.settings-job-status {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .5px;
  border-radius: 999px;
  padding: 3px 8px;
  border: 1px solid #cbd5e1;
  color: #475569;
  background: #f8fafc;
}
.settings-job-status.running {
  border-color: #93c5fd;
  color: #1d4ed8;
  background: #dbeafe;
}
.settings-job-status.failed {
  border-color: #fecaca;
  color: #b91c1c;
  background: #fee2e2;
}
.settings-job-status.ok {
  border-color: #bbf7d0;
  color: #166534;
  background: #dcfce7;
}
.settings-usage-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.settings-usage-table th {
  text-align: left;
  font-size: 10px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .4px;
  border-bottom: 1px solid #e2e8f0;
  padding: 0 8px 6px 0;
}
.settings-usage-table td {
  border-bottom: 1px solid #eef2f7;
  padding: 6px 8px 6px 0;
  color: #0f172a;
}
.settings-usage-table tr:last-child td { border-bottom: none; }
.settings-log-list {
  max-height: 170px;
  overflow: auto;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
}
.settings-log-row {
  display: grid;
  grid-template-columns: 72px 96px minmax(0,1fr);
  gap: 6px;
  border-bottom: 1px solid #eef2f7;
  padding: 6px 8px;
  font-size: 11px;
}
.settings-log-row:last-child { border-bottom: none; }
.settings-log-time { color: #64748b; font-weight: 600; }
.settings-log-type { color: #1d4ed8; font-weight: 700; }
.settings-log-text {
  color: #0f172a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.settings-empty {
  font-size: 12px;
  color: #64748b;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
}

.settings-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted, #64748b);
  margin-bottom: 10px;
}

/* User table */
.settings-user-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.settings-user-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 0 8px 8px 0;
  border-bottom: 1px solid var(--border, #e2e8f0);
}
.settings-user-table td {
  padding: 9px 8px 9px 0;
  border-bottom: 1px solid var(--bg-2, #f1f5f9);
  vertical-align: middle;
  color: var(--text, #0f172a);
}
.settings-user-table tr:last-child td { border-bottom: none; }
.settings-user-disabled td { opacity: 0.45; }
.settings-role-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  background: #dbeafe;
  color: #1d4ed8;
  margin-right: 3px;
}
.settings-role-badge.admin { background: #fef3c7; color: #92400e; }

.settings-user-actions { display: flex; gap: 5px; }
.settings-user-actions button {
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border, #e2e8f0);
  background: var(--card, #fff);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  color: var(--muted, #64748b);
  transition: background 0.12s, color 0.12s;
}
.settings-user-actions button:hover { background: var(--bg-2, #f1f5f9); color: var(--text, #0f172a); }
.settings-user-actions button.danger { color: #b91c1c; border-color: #fecaca; }
.settings-user-actions button.danger:hover { background: #fee2e2; }

/* Add user form */
.settings-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.settings-form-full { grid-column: 1 / -1; }
.settings-form label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 4px;
}
.settings-form input, .settings-form select {
  width: 100%;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 7px;
  padding: 8px 10px;
  font-size: 13px;
  background: var(--bg, #f6f7f9);
  color: var(--text, #0f172a);
  outline: none;
  transition: border-color 0.15s;
}
.settings-form input:focus, .settings-form select:focus { border-color: #3b82f6; }
.settings-form-error {
  grid-column: 1 / -1;
  font-size: 12px;
  color: #b91c1c;
  background: #fee2e2;
  border-radius: 6px;
  padding: 7px 10px;
  display: none;
}
.settings-form-error.visible { display: block; }
.settings-form-success {
  grid-column: 1 / -1;
  font-size: 12px;
  color: #15803d;
  background: #dcfce7;
  border-radius: 6px;
  padding: 7px 10px;
  display: none;
}
.settings-form-success.visible { display: block; }

.settings-topbar-btn {
  padding: 6px 10px;
  border-radius: 7px;
  border: 1px solid var(--border, #e2e8f0);
  background: var(--card, #fff);
  font-size: 13px;
  cursor: pointer;
  color: var(--muted, #64748b);
  transition: background 0.12s, color 0.12s;
  line-height: 1;
}
.settings-topbar-btn:hover { background: var(--bg-2, #f1f5f9); color: var(--text, #0f172a); }

@media (max-width: 980px) {
  .settings-card {
    width: min(760px, 96vw);
  }
  .settings-body-grid {
    grid-template-columns: 1fr;
  }
  .settings-kpi-grid {
    grid-template-columns: 1fr;
  }
  .settings-job-row {
    flex-direction: column;
    align-items: stretch;
  }
  .settings-job-actions {
    justify-content: flex-start;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   NEWS INTELLIGENCE — intel.html panel
   ═══════════════════════════════════════════════════════════════════ */
.ni-controls {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: flex-end;
}
.ni-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 140px;
}
.ni-field:first-child { min-width: 160px; }
.ni-input { width: 100%; }
.ni-copy-btn { display: none; }
.ni-status { margin-top: 8px; }
.ni-result { margin-top: 12px; }

.ni-article {
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
}
.ni-article:last-child { border-bottom: none; }
.ni-article:hover .ni-article-title { color: var(--il-blue); }
.ni-article-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 3px;
}
.ni-article-source { font-weight: 700; color: var(--text); text-transform: uppercase; letter-spacing: .04em; }
.ni-article-title  { font-size: 12px; font-weight: 600; color: var(--text); line-height: 1.45; margin-bottom: 3px; }
.ni-article-summary { font-size: 11px; color: var(--muted); line-height: 1.5; }

/* ═══════════════════════════════════════════════════════════════════
   NEWS.HTML — standalone EU politics dashboard
   ═══════════════════════════════════════════════════════════════════ */
.news-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1.08fr) minmax(560px, 1.6fr) minmax(340px, 1.08fr);
  grid-template-rows: minmax(260px, 0.82fr) minmax(360px, 1.18fr);
  grid-auto-rows: minmax(0, 1fr);
  gap: var(--sp-4);
  padding: 12px 18px 16px;
  max-width: 1980px;
  margin: 0 auto;
  min-height: 680px;
  height: calc(100dvh - 88px);
  max-height: calc(100dvh - 88px);
  position: relative;
  align-content: start;
}
.news-grid .panel-search  { grid-area: search; }
.news-grid .panel-feed    { grid-area: feed; }
.news-grid .panel-ep-live { grid-area: ep; }
.news-grid .panel-mep     { grid-area: mep; }
.news-grid .panel-sources { grid-area: sources; }

@media (max-width: 1300px) {
  .news-grid {
    grid-template-columns: minmax(260px, 0.95fr) minmax(420px, 1.2fr) minmax(280px, 0.95fr);
    grid-template-rows: minmax(250px, 0.76fr) minmax(340px, 1.24fr);
  }
}
@media (max-width: 900px) {
  .news-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: minmax(220px, auto) minmax(320px, auto) minmax(220px, auto) minmax(220px, auto);
    grid-auto-rows: minmax(220px, auto);
    grid-template-areas:
      "search mep"
      "feed feed"
      "ep ep"
      "sources sources";
    height: auto;
    max-height: none;
    min-height: 0;
  }
}
@media (max-width: 760px) {
  .news-grid {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    grid-template-areas:
      "search"
      "mep"
      "feed"
      "ep"
      "sources";
    padding: 10px;
    gap: 10px;
    height: auto;
  }
  .news-grid .panel-search,
  .news-grid .panel-mep,
  .news-grid .panel-feed,
  .news-grid .panel-ep-live,
  .news-grid .panel-sources { min-height: 340px; }
}

.news-grid[data-news-layout="stacked"] {
  grid-template-columns: 1fr;
  grid-template-rows: none;
  grid-auto-rows: minmax(260px, auto);
}
.news-grid[data-news-layout="focus"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: minmax(340px, 1.25fr) minmax(260px, 0.92fr) minmax(260px, 0.92fr);
}
.news-grid[data-news-layout="focus"] .np.is-large,
.news-grid[data-news-layout="stacked"] .np.is-large {
  border-color: rgba(37, 99, 235, 0.55);
  box-shadow: 0 12px 32px rgba(37, 99, 235, 0.16);
}
.news-grid[data-news-layout="focus"] .np.is-large .np-header,
.news-grid[data-news-layout="stacked"] .np.is-large .np-header {
  background: linear-gradient(120deg, rgba(30, 64, 175, 0.98) 0%, rgba(37, 99, 235, 0.94) 100%);
}

/* Panel shell */
.np {
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 14px;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  max-height: 100%;
  transition: box-shadow .22s ease, transform .22s ease, border-color .22s ease;
}
.news-grid .np:hover {
  border-color: rgba(59, 130, 246, 0.38);
  box-shadow: 0 20px 36px rgba(15, 23, 42, 0.11);
}
.news-grid.news-grid--animate .np {
  opacity: 0;
  transform: translateY(14px) scale(.992);
  animation: newsPanelReveal .46s cubic-bezier(.16,.84,.44,1) forwards;
  animation-delay: calc(var(--panel-index, 0) * 64ms);
}
@keyframes newsPanelReveal {
  from { opacity: 0; transform: translateY(14px) scale(.992); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.np-header {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 11px 13px;
  background: linear-gradient(120deg, rgba(15, 23, 42, 0.96) 0%, rgba(30, 41, 59, 0.94) 100%);
  color: #fff;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  flex-shrink: 0;
}
.np-header .np-title { flex: 1; }
.np-titlebox {
  flex: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.np-title-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 2px rgba(15, 23, 42, 0.25));
  opacity: 0.95;
}
.np-titlebox .np-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.np-panel-size-btn {
  border: 1px solid rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-radius: 7px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.np-panel-size-btn:hover,
.np-panel-size-btn:focus-visible {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.5);
  outline: none;
}
.np-panel-size-btn.is-active {
  background: rgba(16, 185, 129, 0.22);
  border-color: rgba(16, 185, 129, 0.62);
  color: #d1fae5;
}
@media (max-width: 900px) {
  .np-panel-size-btn {
    display: none;
  }
}
.np-subheader {
  padding: 7px 12px;
  border-bottom: 1px solid var(--border-subtle);
  background: #f8fbff;
  color: #64748b;
  font-size: 10px;
  line-height: 1.35;
}

.np-badge {
  background: rgba(255,255,255,.12);
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 600;
}
.np-badge.live { background: #ef4444; animation: np-breathe 2.8s ease-in-out infinite; }
.np-badge.ok   { background: #16a34a; }
.np-badge.warn { background: #b45309; }
@keyframes np-breathe {
  0%, 100% { opacity: 1; transform: translateY(0); }
  50% { opacity: .76; transform: translateY(-1px); }
}

.np-toolbar {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-subtle);
  background: #f5f9ff;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.np-toolbar > label {
  min-width: 90px;
  font-weight: 600;
}
.np-toolbar input {
  flex: 1 1 180px;
  padding: 5px 10px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text);
  outline: none;
}
.np-toolbar input:focus { border-color: var(--il-blue); }
.np-toolbar select {
  padding: 5px 8px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text);
  outline: none;
}
.np-toolbar select:focus { border-color: var(--il-blue); }

.np-btn {
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--il-blue);
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
}
.np-btn:hover { opacity: .85; }
.np-btn.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.np-btn.ghost:hover { background: var(--bg-2); }

.panel-search .np-toolbar {
  display: grid;
  grid-template-columns: auto auto auto minmax(0, 1fr) auto auto;
  align-items: center;
}
.panel-mep .np-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
}
.panel-search .np-toolbar input,
.panel-mep .np-toolbar input {
  min-width: 0;
}

@media (max-width: 1300px) {
  .panel-search .np-toolbar {
    grid-template-columns: auto auto minmax(0, 1fr) auto;
  }
  .panel-search .np-toolbar .np-btn {
    justify-self: start;
  }
  .panel-mep .np-toolbar {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .panel-mep .np-toolbar .np-btn {
    justify-self: start;
  }
}

#searchQualityFilter {
  min-width: 146px;
}

.panel-search .search-stack {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(120px, 0.95fr) minmax(180px, 1.05fr);
}

.panel-search .search-results-body {
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 8px;
}

.search-preview-shell {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: linear-gradient(180deg, #f8fbff 0%, #f5f9ff 100%);
}

.search-preview-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.search-preview-title {
  flex: 1;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #334155;
}

.search-preview-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 9px 12px;
}

.search-preview-footer {
  flex-shrink: 0;
  border-top: 1px solid var(--border-subtle);
  font-size: 10px;
  color: var(--muted);
  padding: 6px 12px;
  background: #f8fbff;
}

.live-stream-frame-wrap {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #0f172a;
  overflow: hidden;
}

.live-stream-frame {
  width: 100%;
  min-height: 260px;
  border: 0;
  background: #0b1220;
}

.live-stream-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: 10px;
}

.live-stream-link-btn {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 9px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #334155;
  background: #f8fbff;
  cursor: pointer;
}

.live-stream-link-btn:hover,
.live-stream-link-btn:focus-visible {
  outline: none;
  border-color: #60a5fa;
  background: #eef4ff;
}

.live-stream-link-btn.is-active {
  border-color: #2563eb;
  color: #1d4ed8;
  background: #dbeafe;
}

@media (max-width: 1300px) {
  .live-stream-links {
    grid-template-columns: 1fr;
  }
  .panel-search .search-stack {
    grid-template-rows: minmax(120px, 1fr) minmax(200px, 0.95fr);
  }
}

.group-tabs {
  display: flex;
  gap: 2px;
  padding: 8px 12px 0;
  background: #f5f9ff;
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  flex-shrink: 0;
}
.group-tab {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 4px 4px 0 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.group-tab:hover  { background: var(--card); color: var(--text); }
.group-tab.active { background: var(--card); color: var(--il-blue); border-bottom-color: var(--il-blue); }

.np-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 10px 12px;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

/* Article list */
.article-list { display: grid; gap: 8px; }
.art-item {
  padding: 10px 11px;
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 12px;
  background: linear-gradient(180deg, #fff 0%, #f9fbff 100%);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.art-item:first-child { padding-top: 10px; }
.art-item:hover {
  transform: translateY(-1px);
  border-color: rgba(37, 99, 235, 0.44);
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.1);
}
.art-item:hover .art-title { color: var(--il-blue); }
.search-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 8px;
}
.search-result-tip {
  font-size: 10px;
  color: #64748b;
}
.search-quality-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.search-quality-pill.quality-institutional {
  color: #0b3b9a;
  background: #dbeafe;
}
.search-quality-pill.quality-major {
  color: #166534;
  background: #dcfce7;
}
.search-quality-pill.quality-thinktank {
  color: #7c2d12;
  background: #ffedd5;
}
.search-quality-pill.quality-other {
  color: #475569;
  background: #e2e8f0;
}
.search-result-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.search-result-card {
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 11px;
  background: #fff;
  padding: 10px 11px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}
.search-result-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
  margin-bottom: 4px;
}
.search-result-summary {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.45;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.search-result-actions {
  display: flex;
  gap: 6px;
}
.search-result-actions .np-btn {
  padding: 4px 9px;
}
.news-browser-meta {
  margin-bottom: 8px;
}
.news-browser-reader {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  padding: 12px 13px;
  display: grid;
  gap: 9px;
  max-height: 340px;
  overflow: auto;
}
.news-browser-reader p {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
  color: #334155;
}
.news-browser-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}
.news-browser-submeta {
  margin-top: 3px;
  font-size: 11px;
  color: var(--muted);
}
.news-browser-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.news-browser-quality {
  margin-top: 6px;
  display: inline-flex;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
}
.news-browser-quality.quality-institutional {
  color: #0b3b9a;
  background: #dbeafe;
}
.news-browser-quality.quality-major {
  color: #166534;
  background: #dcfce7;
}
.news-browser-quality.quality-thinktank {
  color: #7c2d12;
  background: #ffedd5;
}
.news-browser-quality.quality-other {
  color: #475569;
  background: #e2e8f0;
}
.news-browser-frame {
  width: 100%;
  min-height: 320px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
}
.news-browser-embed {
  margin-top: 8px;
}
.news-browser-note {
  margin-top: 8px;
  font-size: 10px;
  color: var(--muted);
}
.news-browser-note--warn {
  color: #b45309;
  font-weight: 700;
}
.art-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
  font-size: 10px;
  color: var(--muted);
}
.art-source {
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.art-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.45;
  margin-bottom: 4px;
  transition: color .15s;
}
.art-summary {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.art-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
}
.art-tag {
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.art-tag.mep   { background: #dbeafe; color: #1d4ed8; }
.art-tag.group { background: #dcfce7; color: #15803d; }
.art-tag.nlp   { background: #fef9c3; color: #854d0e; }
.art-tag.dup   { background: #f1f5f9; color: #64748b; }
.art-score {
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--bg-2);
  color: var(--muted);
}
.art-score.high { background: #dcfce7; color: #15803d; }

/* Stat bar */
.stat-bar {
  display: flex;
  gap: var(--sp-4);
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-subtle);
  background: #f5f9ff;
  font-size: 11px;
  align-items: center;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.stat-item { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.stat-value { font-size: 16px; font-weight: 700; color: var(--text); line-height: 1; }
.stat-label { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .05em; }
.feed-group-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-subtle);
  background: linear-gradient(180deg, rgba(241, 245, 249, 0.95) 0%, rgba(248, 251, 255, 0.95) 100%);
  flex-shrink: 0;
}
.feed-group-chip {
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 999px;
  background: #fff;
  color: #475569;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 10px;
  cursor: pointer;
  transition: all .14s ease;
}
.feed-group-chip:hover,
.feed-group-chip:focus-visible {
  border-color: rgba(59, 130, 246, 0.65);
  color: #1e40af;
  background: #eff6ff;
  outline: none;
}
.feed-group-chip.active {
  border-color: rgba(37, 99, 235, 0.7);
  background: linear-gradient(180deg, #dbeafe 0%, #bfdbfe 100%);
  color: #1e3a8a;
}

/* Source cards */
.sources-shell {
  display: grid;
  gap: 10px;
}
.sources-section {
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 12px;
  background: rgba(248, 251, 255, 0.72);
  padding: 8px;
}
.sources-section.is-muted {
  background: rgba(241, 245, 249, 0.68);
}
.sources-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  padding: 2px 2px 0;
}
.sources-section-head h4 {
  margin: 0;
  font-size: 10px;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: #334155;
}
.sources-section-head span {
  font-size: 10px;
  font-weight: 800;
  color: #64748b;
}
.sources-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(228px, 1fr));
  gap: 8px;
}
.src-card {
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 10px;
  background: #fff;
  padding: 8px 9px;
  display: grid;
  gap: 5px;
  min-width: 0;
}
.src-card--ok {
  box-shadow: 0 7px 14px rgba(15, 23, 42, 0.05);
}
.src-card--warn,
.src-card--off {
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
}
.src-card-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}
.src-card-name {
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.34;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.src-card-meta {
  font-size: 10px;
  color: #64748b;
}
.src-card-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.sources-toggle-row {
  padding-top: 2px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.sources-toggle-btn {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: #f8fbff;
  color: var(--muted);
  cursor: pointer;
}
.sources-toggle-btn:hover,
.sources-toggle-btn:focus-visible {
  color: var(--text);
  border-color: var(--il-blue);
  background: #eef4ff;
  outline: none;
}
.src-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.src-dot.ok   { background: #16a34a; }
.src-dot.warn { background: #f59e0b; }
.src-dot.off  { background: #94a3b8; }
.src-kind  {
  font-size: 9px; font-weight: 700; text-transform: uppercase;
  padding: 1px 5px; border-radius: 3px;
  background: var(--bg-2); color: var(--muted);
}
.src-tag {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 1px 7px;
}
.src-tag--eu {
  background: #dcfce7;
  color: #166534;
}
.src-tag--mixed {
  background: #fef3c7;
  color: #92400e;
}
.src-tag--cat {
  background: #e2e8f0;
  color: #334155;
}
.src-state {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 1px 7px;
}
.src-state--on {
  background: #dbeafe;
  color: #1d4ed8;
}
.src-state--off {
  background: #e2e8f0;
  color: #475569;
}
.src-runtime-note {
  font-size: 10px;
  color: #64748b;
  line-height: 1.35;
}

/* Empty / loading */
.np-empty {
  padding: var(--sp-5);
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}
.np-spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--il-blue);
  border-radius: 50%;
  animation: np-spin .7s linear infinite;
}
@keyframes np-spin { to { transform: rotate(360deg); } }

.np-footer {
  padding: 8px 13px;
  font-size: 10px;
  color: var(--muted);
  border-top: 1px solid var(--border-subtle);
  background: #f8fbff;
  flex-shrink: 0;
}

/* ── News page: avoid top clipping under fixed topbar, keep panel scrolling ─ */
body[data-page="news"] .topbar {
  position: sticky !important;
}
body[data-page="news"] .app-content { flex: 1; min-height: 0; overflow: hidden; padding: 10px 10px 12px; background: radial-gradient(1000px 340px at 18% -12%, rgba(59,130,246,.15), transparent 70%), linear-gradient(180deg,#eef3fb 0%,#f7f9fc 100%); }
body[data-page="news"] .np .article-list,
body[data-page="news"] .np .pm-profile-allies-list {
  overflow-wrap: anywhere;
}
@media (max-width: 900px) {
  body[data-page="news"] .app-main,
  body[data-page="news"] .app-content {
    overflow: visible;
  }
}

/* Feed section dividers */
.feed-section-hdr {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 10px 0 4px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 2px;
}
.feed-section-hdr:first-child { padding-top: 2px; }

.feed-editorial-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 10px;
  align-items: start;
}
.panel-feed.is-editorial .np-body {
  padding-top: 10px;
  background: linear-gradient(180deg, rgba(241, 245, 249, 0.42) 0%, rgba(248, 251, 255, 0.24) 100%);
}
.feed-lane {
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.97) 0%, rgba(248, 251, 255, 0.98) 100%);
  padding: 9px;
  display: grid;
  gap: 6px;
  min-height: 220px;
}
.feed-lane--pending {
  background: linear-gradient(180deg, rgba(255, 251, 235, 0.92) 0%, rgba(255, 255, 255, 0.97) 100%);
}
.feed-lane--review {
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.92) 0%, rgba(255, 255, 255, 0.97) 100%);
}
.feed-lane--approved {
  background: linear-gradient(180deg, rgba(236, 253, 245, 0.88) 0%, rgba(255, 255, 255, 0.97) 100%);
}
.feed-lane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.feed-lane-head h4 {
  margin: 0;
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #0f172a;
}
.feed-lane-head span {
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  color: #1e3a8a;
  background: rgba(191, 219, 254, 0.55);
}
.feed-lane-note {
  font-size: 10px;
  color: #64748b;
  letter-spacing: .03em;
}
.feed-lane-body {
  display: grid;
  gap: 7px;
}
.feed-editorial-card {
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 10px;
  padding: 8px 9px;
  background: #fff;
  cursor: pointer;
  display: grid;
  gap: 5px;
  box-shadow: 0 5px 12px rgba(15, 23, 42, 0.06);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.feed-editorial-card:hover {
  transform: translateY(-1px);
  border-color: rgba(37, 99, 235, 0.4);
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.12);
}
.feed-editorial-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: space-between;
}
.feed-editorial-source {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: #334155;
}
.feed-editorial-title {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.35;
  color: #0f172a;
}
.feed-editorial-summary {
  margin: 0;
  font-size: 11px;
  line-height: 1.45;
  color: #64748b;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.feed-editorial-foot {
  display: flex;
  justify-content: flex-end;
  font-size: 10px;
  color: #64748b;
}
@media (max-width: 1440px) {
  .feed-editorial-board {
    grid-template-columns: 1fr;
  }
}

/* ── MEP Contact Directory ──────────────────────────────────────────────── */
.mep-dir-group {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 6px;
  overflow: hidden;
}
.mep-dir-group summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  cursor: pointer;
  background: var(--bg-2);
  list-style: none;
  -webkit-user-select: none;
  user-select: none;
  font-size: 13px;
  font-weight: 600;
}
.mep-dir-group summary::-webkit-details-marker { display: none; }
.mep-dir-group summary:hover { background: var(--hover-bg, #f0f4ff); }
.mep-dir-group-chevron { margin-left: auto; font-size: 11px; color: var(--muted); transition: transform 0.2s; }
.mep-dir-group[open] .mep-dir-group-chevron { transform: rotate(90deg); }
.mep-dir-group-count { font-size: 11px; color: var(--muted); font-weight: 400; }
.mep-dir-avg { font-size: 11px; color: var(--muted); font-weight: 400; margin-left: 4px; }

.mep-dir-list { border-top: 1px solid var(--border); }
.mep-dir-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-bottom: 1px solid var(--border-subtle, #f0f0f0);
  cursor: pointer;
  font-size: 13px;
  transition: background 0.12s;
}
.mep-dir-row:last-child { border-bottom: none; }
.mep-dir-row:hover { background: var(--hover-bg, #f0f4ff); }
.mep-dir-flag { font-size: 15px; flex-shrink: 0; }
.mep-dir-name { flex: 1; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mep-dir-align {
  font-size: 12px; font-weight: 700; min-width: 38px; text-align: right;
  color: var(--il-blue, #1a5fb4);
}
.mep-dir-align.no-data { color: var(--muted); font-weight: 400; }
.mep-dir-trend { font-size: 13px; min-width: 14px; text-align: center; }
.mep-dir-swing { font-size: 10px; padding: 1px 5px; border-radius: 3px;
  background: #fef3c7; color: #92400e; font-weight: 600; }

/* ── MEP Card Drawer ────────────────────────────────────────────────────── */
.mep-card-backdrop {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.32);
  cursor: pointer;
}
.mep-card-panel {
  position: relative; z-index: 1;
  width: 420px; max-width: 96vw;
  height: 100%; overflow-y: auto;
  background: var(--card-bg, #fff);
  border-left: 1px solid var(--border);
  box-shadow: -4px 0 24px rgba(0,0,0,0.12);
  display: flex; flex-direction: column;
  animation: mep-slide-in 0.22s ease;
}
@keyframes mep-slide-in {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}
.mep-card-topbar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--card-bg, #fff); z-index: 1;
}
.mep-card-close {
  background: none; border: none; cursor: pointer;
  font-size: 18px; color: var(--muted); padding: 2px 6px;
  border-radius: 4px; line-height: 1;
}
.mep-card-close:hover { background: var(--hover-bg); color: var(--fg); }
.mep-card-compare-link {
  margin-left: auto;
  font-size: 11px;
  color: #0f766e;
  text-decoration: none;
  padding: 3px 8px;
  border: 1px solid #0f766e;
  border-radius: 4px;
}
.mep-card-compare-link:hover { background: #0f766e; color: #fff; }
.mep-card-ep-link {
  font-size: 11px; color: var(--il-blue, #1a5fb4);
  text-decoration: none; padding: 3px 8px;
  border: 1px solid var(--il-blue, #1a5fb4); border-radius: 4px;
}
.mep-card-ep-link:hover { background: var(--il-blue, #1a5fb4); color: #fff; }

.mep-card-header { padding: 16px 16px 12px; border-bottom: 1px solid var(--border-subtle); }
.mep-card-name { font-size: 17px; font-weight: 700; margin: 0 0 3px; }
.mep-card-sub { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.mep-card-group-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.mep-card-section { padding: 12px 16px; border-bottom: 1px solid var(--border-subtle); }
/* MEP Card Drawer: expanded for detailed profile and future visualizations */
.mep-card-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: background 0.2s;
}
.mep-card-backdrop {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: transparent;
}
.mep-card-panel {
  position: relative;
  width: 60vw;
  max-width: 900px;
  min-width: 420px;
  min-height: 60vh;
  background: #fff;
  box-shadow: 0 8px 32px 0 rgba(30,41,59,0.18);
  border-radius: 18px;
  margin: 0 auto;
  pointer-events: auto;
  transition: max-width 0.2s, width 0.2s;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
  /* Missing selector or misplaced properties. Add selector or move these into a valid rule. */
.mep-copy-btn:hover { background: var(--il-blue); color: #fff; border-color: var(--il-blue); }

.mep-social-row { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 6px; }
.mep-social-link {
  font-size: 11px; padding: 3px 8px; border-radius: 4px;
  background: var(--bg-2); border: 1px solid var(--border);
  text-decoration: none; color: var(--fg);
}
.mep-social-link:hover { border-color: var(--il-blue); color: var(--il-blue); }

.mep-address-block { font-size: 11px; color: var(--muted); white-space: pre-line; line-height: 1.5; }

.mep-card-no-data { padding: 40px 16px; text-align: center; color: var(--muted); font-size: 13px; }

/* ── Email hero ─────────────────────────────────────────────────────────── */
.mep-email-hero {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--hover-bg, #f8fafc);
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 8px;
  padding: 9px 12px;
  margin-bottom: 10px;
}
.mep-email-text {
  flex: 1;
  font-size: 12px;
  font-weight: 600;
  color: var(--fg);
  word-break: break-all;
  font-family: 'SF Mono', 'Fira Code', monospace;
  letter-spacing: -0.01em;
}
.mep-copy-email {
  flex-shrink: 0;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 5px;
  border: 1px solid var(--border-subtle);
  background: var(--card-bg, #fff);
  color: var(--accent, #2563eb);
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.mep-copy-email:hover { background: var(--accent, #2563eb); color: #fff; border-color: var(--accent, #2563eb); }

/* ── Phones ─────────────────────────────────────────────────────────────── */
.mep-phones-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.mep-phone-item { display: flex; flex-direction: column; gap: 1px; }
.mep-phone-label { font-size: 10px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.mep-phone-val   { font-size: 12px; color: var(--fg); }

/* ── Offices grid ───────────────────────────────────────────────────────── */
.mep-offices-grid  { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.mep-office-city   { font-size: 11px; font-weight: 600; color: var(--muted); margin-bottom: 3px; }

/* ── Assistants placeholder ─────────────────────────────────────────────── */
.mep-assistants-placeholder {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  background: var(--hover-bg, #f8fafc);
  border: 1px dashed var(--border-subtle, #e2e8f0);
  border-radius: 6px;
  padding: 8px 11px;
}
.mep-assistant-icon { font-size: 14px; }

/* ── Doughnut chart + legend ────────────────────────────────────────────── */
.mep-meetings-chart-wrap {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.mep-donut-wrap {
  position: relative;
  flex-shrink: 0;
  width: 160px;
  height: 160px;
}
.mep-donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.mep-donut-total {
  font-size: 26px;
  font-weight: 800;
  color: var(--fg);
  line-height: 1;
  letter-spacing: -0.03em;
}
.mep-donut-label {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-top: 2px;
}
.mep-chart-legend {
  flex: 1;
  min-width: 120px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-top: 4px;
}
.mep-chart-legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
}
.mep-chart-legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.mep-chart-legend-label { flex: 1; color: var(--fg); }
.mep-chart-legend-count {
  font-weight: 700;
  color: var(--muted);
  font-size: 11px;
  min-width: 18px;
  text-align: right;
}

/* ── Meeting list ───────────────────────────────────────────────────────── */
.meeting-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 220px;
  overflow-y: auto;
  border-top: 1px solid var(--border-subtle, #e2e8f0);
}
.meeting-list-item {
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle, #f1f5f9);
}
.meeting-list-item:last-child { border-bottom: none; }
.meeting-list-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}
.meeting-list-date  { font-size: 11px; font-weight: 700; color: var(--fg); }
.meeting-list-place { font-size: 11px; color: var(--muted); }
.meeting-list-subject { font-size: 12px; color: var(--fg); line-height: 1.4; }
.meeting-list-org   { font-size: 11px; color: var(--muted); margin-top: 1px; }
.mep-cat-dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; margin-left: auto;
}

.mep-dir-controls { margin: 12px 0 8px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mep-dir-search   { max-width: 200px; }
.mep-dir-count    { margin: 0; }

/* ── Mandate Atlas hero brand ── */


/* ── EP Live Feeds panel ── */
.ep-feeds-controls  { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.ep-feeds-meta-row  { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.ep-feeds-actions   { display: flex; gap: 6px; }
.ep-feeds-more-hidden { display: none; }

.ep-feed-item {
  display: flex; flex-direction: column; gap: 3px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.ep-feed-item:last-child { border-bottom: none; }
.ep-feed-item-header { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.ep-feed-source {
  font-size: 10px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--il-blue); background: rgba(37,84,184,0.08);
  padding: 1px 6px; border-radius: 4px; white-space: nowrap; flex-shrink: 0;
}
.ep-feed-date { font-size: 11px; color: var(--muted); flex-shrink: 0; }
.ep-feed-title a {
  font-size: 13px; font-weight: 600; color: var(--fg);
  text-decoration: none; line-height: 1.4;
}
.ep-feed-title a:hover { color: var(--il-blue); text-decoration: underline; }
.ep-feed-desc { font-size: 11px; color: var(--muted); line-height: 1.5; margin-top: 1px; }
.ep-feed-cats { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 3px; }
.ep-feed-cat {
  font-size: 10px; padding: 1px 5px; border-radius: 3px;
  background: var(--bg-2); border: 1px solid var(--border); color: var(--muted);
}

/* ── Topic MEP Top-10 Panel ────────────────────────────────────────────── */
.topic-mep-panel {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(15,23,42,.05);
}
.tmep-header {
  display: flex; align-items: baseline; justify-content: space-between;
  flex-wrap: wrap; gap: 8px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.tmep-header-left { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.tmep-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--fg);
}
.tmep-topic-pill {
  display: inline-block;
  font-size: 11px; font-weight: 600; color: var(--il-blue);
  background: rgba(37,84,184,.08); border: 1px solid rgba(37,84,184,.18);
  padding: 1px 8px; border-radius: 20px;
  max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tmep-scoring-note {
  font-size: 10px; color: var(--muted);
  display: flex; align-items: center; gap: 2px; flex-wrap: wrap;
}
.tmep-weight { font-size: 9px; line-height: 1; }
.tmep-weight.meetings-w  { color: #2554b8; }
.tmep-weight.alignment-w { color: #16a34a; }

/* list */
.tmep-list { display: flex; flex-direction: column; gap: 10px; }
.tmep-empty { font-size: 12px; color: var(--muted); padding: 8px 0; }

.tmep-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px;
  background: var(--bg-2, #f8f9fb);
  border: 1px solid var(--border-subtle, rgba(15,23,42,.06));
  border-radius: 8px;
  transition: box-shadow .15s;
}
.tmep-item:hover { box-shadow: 0 2px 8px rgba(15,23,42,.07); }

.tmep-rank {
  font-size: 11px; font-weight: 700;
  color: var(--muted); min-width: 18px;
  font-family: 'SF Mono','Fira Code',ui-monospace,monospace;
  padding-top: 1px;
}
.tmep-item:nth-child(1) .tmep-rank { color: #b45309; }
.tmep-item:nth-child(2) .tmep-rank { color: #64748b; }
.tmep-item:nth-child(3) .tmep-rank { color: #92400e; }

.tmep-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }

.tmep-name-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
}
.tmep-name { font-size: 13px; font-weight: 600; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tmep-score { display: flex; align-items: baseline; gap: 1px; flex-shrink: 0; }
.tmep-score-num {
  font-size: 15px; font-weight: 700; color: var(--il-blue);
  font-family: 'SF Mono','Fira Code',ui-monospace,monospace;
  letter-spacing: -.03em;
}
.tmep-score-lbl { font-size: 10px; color: var(--muted); }

.tmep-meta { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); }
.tmep-sep { opacity: .5; }

.tmep-bars { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.tmep-bar-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.tmep-bar-lbl {
  font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); min-width: 52px; text-align: right; flex-shrink: 0;
}
.tmep-bar-lbl.meetings-lbl  { color: #2554b8; }
.tmep-bar-lbl.speeches-lbl  { color: #7c3aed; }
.tmep-bar-lbl.alignment-lbl { color: #16a34a; }

.tmep-bar-track {
  flex: 1; min-width: 0; height: 5px; background: var(--border, #e2e8f0);
  border-radius: 99px; overflow: hidden;
}
.tmep-bar-fill {
  height: 100%; border-radius: 99px;
  transition: width .4s cubic-bezier(.25,.46,.45,.94);
}
.tmep-bar-fill.meetings-fill  { background: #2554b8; }
.tmep-bar-fill.speeches-fill  { background: #7c3aed; }
.tmep-bar-fill.alignment-fill { background: #16a34a; }

.tmep-bar-num {
  font-size: 10px; color: var(--muted); min-width: 30px;
  font-family: 'SF Mono','Fira Code',ui-monospace,monospace;
  text-align: right; flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════════
   PARLIAMENT MEMBERS PAGE  (pm-* classes)
   ══════════════════════════════════════════════════════════════ */

/* ── Section layout ── */
.pm-section {
  margin-bottom: 32px;
}
.pm-section-header {
  margin-bottom: 20px;
}
.pm-section-header h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 4px;
}
.pm-section-sub {
  font-size: 13px;
  color: var(--muted);
}

/* ── Cards ── */
.pm-card {
  background: var(--panel-bg, var(--card-bg));
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 16px;
}
.pm-card-header h2 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 4px;
}
.pm-card-header p {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 14px;
}

/* ── Directory row ── */
.pm-row--directory {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 16px;
  align-items: start;
}
@media (max-width: 900px) {
  .pm-row--directory { grid-template-columns: 1fr; }
}

/* ── Member list ── */
.pm-toolbar { margin-bottom: 10px; }
.pm-list-wrap {
  max-height: 480px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
}

/* ── KPI grid (extended) ── */
.pm-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

/* ── Charts grid ── */
.pm-charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.pm-chart-card {
  background: var(--card-bg, var(--bg));
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
}
.pm-chart-card h3 {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 10px;
}
.pm-chart-card--wide {
  grid-column: 1 / -1;
}
.pm-chart-container {
  height: 200px;
  position: relative;
}
.pm-chart-card--wide .pm-chart-container {
  height: 260px;
}

/* ── Delegation cards ── */
.pm-delegations-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  max-height: 360px;
  overflow-y: auto;
}
.pm-delegation-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px;
}
.pm-delegation-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}
.pm-delegation-count {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 6px;
}
.pm-delegation-members {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.pm-delegation-member {
  font-size: 10px;
  background: var(--tag-bg, #334155);
  color: var(--tag-text, #94a3b8);
  border-radius: 3px;
  padding: 1px 5px;
}
.pm-delegation-more {
  font-size: 10px;
  color: var(--muted);
}

/* ── Distribution legend ── */
.pm-dist-legend {
  font-size: 11px;
  color: var(--muted);
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pm-dist-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  vertical-align: middle;
}

/* ── Trend alerts ── */
.pm-trend-alerts { margin-top: 8px; }
.pm-trend-alert {
  font-size: 11px;
  color: #f59e42;
  padding: 3px 0;
  border-bottom: 1px dashed var(--border);
}

/* ── Voting behaviour table ── */
.pm-vb-toolbar select {
  background: var(--input-bg, var(--bg));
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
}
.pm-vb-table tr:hover td { background: var(--hover-bg, rgba(255,255,255,0.04)); }

/* ══════════════════════════════════════════════════════════════
   PARLIAMENT MEMBERS PAGE  (pm-* classes)
   ══════════════════════════════════════════════════════════════ */

/* ── Page hero ── */
.pm-page-hero {
  padding: 24px 0 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

/* ── Error banner ── */
.pm-error-banner {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
}

/* ── KPI row ── */
.pm-kpi-row {
  margin-bottom: 20px;
}

/* ── MEP list extras ── */
.mep-group-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 5px;
  flex-shrink: 0;
}
.mep-stats-mini {
  display: flex;
  gap: 12px;
  font-size: 10px;
  color: var(--muted);
  margin-top: 2px;
}

/* ── Behaviour charts grid ── */
.pm-behaviour-grid {
  margin-top: 8px;
}

/* ── Heatmap ── */
.pm-heatmap-legend {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 10px;
}
.hm-legend-cell {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 2px;
  vertical-align: middle;
}
.hm-legend-cell.for      { background: #16a34a; }
.hm-legend-cell.against  { background: #dc2626; }
.hm-legend-cell.abstain  { background: #d97706; }
.hm-legend-cell.absent   { background: #334155; }

.pm-heatmap-wrap { overflow: hidden; }
.pm-heatmap-scroll {
  overflow-x: auto;
  overflow-y: auto;
  max-height: 480px;
}
.pm-heatmap-table {
  border-collapse: collapse;
  font-size: 11px;
  white-space: nowrap;
}
.hm-name-th { min-width: 100px; }
.hm-name {
  position: sticky;
  left: 0;
  background: var(--panel-bg, var(--card, #fff));
  z-index: 1;
  padding: 3px 8px 3px 4px;
  font-size: 11px;
  color: var(--text);
  border-right: 1px solid var(--border);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hm-th {
  font-size: 9px;
  font-weight: 600;
  color: var(--muted);
  padding: 2px 4px;
  text-align: center;
  max-width: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--panel-bg, var(--card, #fff));
  z-index: 2;
}
.hm-date { font-size: 8px; color: var(--muted); }
.hm-cell {
  width: 14px;
  height: 14px;
  padding: 0;
  cursor: default;
  opacity: 0.85;
}
.hm-cell.for      { background: #16a34a; }
.hm-cell.against  { background: #dc2626; }
.hm-cell.abstain  { background: #d97706; }
.hm-cell.did-not-vote { background: #0f766e; opacity: 0.72; }
.hm-cell.absent   { background: #1e293b; opacity: 0.3; }
.hm-cell.hm-match { outline: 2px solid #f59e0b; outline-offset: -2px; }

/* ── Compare extras ── */
.cp-agree  { color: #16a34a !important; }
.cp-disagree { color: #dc2626 !important; }
.cp-votes-section--aligned { border-top: 1px solid var(--border); }
.cp-votes-title--aligned { color: #16a34a; }

/* ── Voting Behaviour Table ── */
.pm-vb-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.pm-vb-select {
  background: var(--input-bg, var(--bg));
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 12px;
}
.pm-vb-table-wrap {
  overflow-x: auto;
  max-height: 420px;
  overflow-y: auto;
  border-radius: 6px;
  border: 1px solid var(--border);
}
.pm-vb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.pm-vb-table th,
.pm-vb-table td {
  padding: 6px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.pm-vb-table th {
  background: var(--topbar-bg, #0f172a);
  color: var(--muted);
  font-weight: 700;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  position: sticky;
  top: 0;
  z-index: 1;
}
.pm-vb-row { cursor: pointer; }
.pm-vb-row:hover td { background: var(--hover-bg, rgba(255,255,255,0.04)); }
.pm-vb-row:focus td { background: var(--hover-bg, rgba(255,255,255,0.06)); outline: none; }
.pm-vb-num { text-align: right; font-family: 'SF Mono','Fira Code',ui-monospace,monospace; }
.pm-vb-diverg { color: #dc2626; }

/* ── Parliament Compare Workspace (v2) ───────────────────────────────────── */
.cp-tool--modern {
  display: grid;
  gap: 10px;
}

.cp-search-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.cp-search-col {
  position: relative;
  min-width: 0;
}

.cp-search-input {
  width: 100%;
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 10px 11px;
  font-size: 13px;
  background: #fff;
  color: var(--text);
  font-weight: 600;
}

.cp-search-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.cp-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.cp-toolbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cp-toolbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
}

.cp-toolbar .control-btn.is-active {
  border-color: #15803d;
  color: #15803d;
  background: #ecfdf3;
}

.cp-url-state {
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
}

.cp-feedback {
  margin-top: 10px;
  margin-bottom: 8px;
  font-size: 12px;
}

.cp-feedback[data-kind="warning"] {
  color: #b45309;
}

.cp-feedback[data-kind="error"] {
  color: #b91c1c;
}

.cp-benchmark-line {
  font-size: 10px;
  color: var(--muted);
}

.cp-personal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
  margin-bottom: 12px;
}

.cp-personal-card {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  min-height: 110px;
}

.cp-personal-card h3 {
  margin: 0 0 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}

.cp-pair-list {
  display: grid;
  gap: 6px;
}

.cp-pair-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  align-items: center;
}

.cp-pair-item {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  text-align: left;
  padding: 7px 8px;
  display: flex;
  justify-content: space-between;
  gap: 6px;
  align-items: center;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.cp-pair-item:hover {
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.12);
  transform: translateY(-1px);
}

.cp-pair-main {
  min-width: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cp-pair-meta {
  font-size: 10px;
  color: var(--muted);
  flex-shrink: 0;
}

.cp-pair-remove {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 7px;
  font-size: 12px;
}

.cp-pair-remove:hover {
  color: #b91c1c;
  border-color: #fecaca;
  background: #fff7f7;
}

.cp-context-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.cp-context-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  padding: 12px;
}

.cp-context-card h3 {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.cp-info-btn {
  border: 1px solid var(--border);
  border-radius: 999px;
  width: 18px;
  height: 18px;
  font-size: 11px;
  font-weight: 800;
  cursor: help;
  color: var(--muted);
  background: #fff;
  line-height: 1;
}

.cp-metric-guide {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.cp-percentile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.cp-percentile-col {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  background: #f8fafc;
}

.cp-percentile-col h4 {
  margin: 0 0 7px;
  font-size: 12px;
  color: var(--text);
}

.cp-percentile-row {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  align-items: center;
  font-size: 11px;
  color: var(--muted);
  padding: 4px 0;
  border-bottom: 1px dashed var(--border);
}

.cp-percentile-row:last-child {
  border-bottom: none;
}

.cp-charts-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.cp-divergence-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.cp-tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cp-tag {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #f8fafc;
  color: var(--text);
  cursor: pointer;
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  position: relative;
  overflow: hidden;
}

.cp-tag:hover {
  border-color: rgba(37, 99, 235, 0.45);
}

.cp-tag-label {
  position: relative;
  z-index: 1;
}

.cp-tag-count {
  position: relative;
  z-index: 1;
  font-weight: 800;
  color: #1d4ed8;
}

.cp-tag-bar {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  background: #1d4ed8;
  opacity: 0.65;
}

.cp-drilldown-card {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

.cp-drilldown-header {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cp-drilldown-header h3 {
  margin: 0;
  font-size: 13px;
  color: var(--text);
}

.cp-drilldown-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cp-drilldown-controls .search-input {
  min-width: 250px;
}

.cp-drill-table-wrap {
  overflow-x: auto;
  max-height: 360px;
  overflow-y: auto;
}

.cp-drill-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.cp-drill-table th,
.cp-drill-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  text-align: left;
}

.cp-drill-table th {
  background: #f8fafc;
  color: var(--muted);
  font-weight: 700;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  position: sticky;
  top: 0;
  z-index: 1;
}

.cp-drill-row:hover td {
  background: #f8fafc;
}

.cp-drill-row.is-selected td {
  background: #eff6ff;
}

.cp-session-link {
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  font-size: 12px;
  color: #1d4ed8;
  cursor: pointer;
  text-align: left;
  max-width: 430px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cp-relation-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.cp-relation-pill.agree {
  background: #dcfce7;
  color: #15803d;
}

.cp-relation-pill.disagree {
  background: #fee2e2;
  color: #b91c1c;
}

.cp-relation-pill.missing {
  background: #e2e8f0;
  color: #334155;
}

button.cp-vote-row {
  width: 100%;
  border: none;
  background: transparent;
  text-align: inherit;
  cursor: pointer;
}

button.cp-vote-row:hover {
  background: #f8fafc;
}

.cp-session-detail {
  border-top: 1px solid var(--border);
  padding: 10px 12px;
  background: #f8fafc;
}

.cp-session-card {
  display: grid;
  gap: 10px;
}

.cp-session-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
}

.cp-session-head h4 {
  margin: 0;
  font-size: 13px;
  color: var(--text);
}

.cp-session-head p {
  margin: 3px 0 0;
  font-size: 11px;
  color: var(--muted);
}

.cp-session-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.cp-session-votes {
  display: grid;
  gap: 6px;
}

.cp-session-votes > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.cp-session-meta-block {
  display: grid;
  gap: 5px;
}

.cp-session-meta-block strong {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.cp-detail-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cp-detail-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  color: var(--text);
  background: #fff;
}

.cp-detail-chip.is-empty {
  color: var(--muted);
}

.cp-help-overlay {
  position: fixed;
  inset: 0;
  z-index: 2600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.cp-help-overlay.is-hidden {
  display: none;
}

.cp-help-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.52);
}

.cp-help-card {
  position: relative;
  width: min(640px, 94vw);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 20px 16px;
  background: #fff;
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.26);
  z-index: 1;
}

.cp-help-close {
  position: absolute;
  right: 10px;
  top: 10px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 8px;
  width: 30px;
  height: 30px;
  cursor: pointer;
  color: var(--muted);
  font-size: 15px;
}

.cp-help-close:hover {
  color: var(--text);
  background: #f8fafc;
}

.cp-help-card h2 {
  margin: 0 0 10px;
  font-size: 18px;
  color: var(--text);
}

.cp-help-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.pm-brief-overlay-card {
  width: min(860px, 96vw);
  max-height: min(86vh, 900px);
  display: grid;
  gap: 10px;
  overflow: auto;
}

.pm-brief-overlay-body {
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 11px;
  padding: 10px 11px;
  background: rgba(248, 251, 255, 0.88);
  font-size: 13px;
  color: #334155;
  line-height: 1.65;
  white-space: pre-line;
}

.pm-brief-overlay-signals {
  display: grid;
  gap: 8px;
}

.pm-brief-signal-row {
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 10px;
  padding: 8px 9px;
  background: #fff;
  display: grid;
  gap: 4px;
}

.pm-brief-signal-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.pm-brief-signal-type {
  font-size: 10px;
  font-weight: 800;
  color: #1d4ed8;
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: 999px;
  padding: 2px 7px;
  background: rgba(239, 246, 255, 0.92);
}

.pm-brief-signal-sentiment {
  font-size: 10px;
  font-weight: 700;
  border-radius: 999px;
  padding: 2px 7px;
  border: 1px solid transparent;
}

.pm-brief-signal-sentiment--positive {
  color: #166534;
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(220, 252, 231, 0.9);
}

.pm-brief-signal-sentiment--neutral {
  color: #334155;
  border-color: rgba(148, 163, 184, 0.38);
  background: rgba(248, 250, 252, 0.95);
}

.pm-brief-signal-sentiment--negative {
  color: #b91c1c;
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(254, 226, 226, 0.92);
}

.pm-brief-signal-date {
  font-size: 10px;
  color: #64748b;
  font-weight: 700;
}

.pm-brief-signal-label {
  font-size: 12px;
  color: #0f172a;
  font-weight: 800;
  line-height: 1.35;
}

.pm-brief-signal-detail {
  font-size: 11px;
  color: #475569;
  line-height: 1.45;
}

.pm-brief-signal-link {
  font-size: 11px;
  font-weight: 700;
  color: #1d4ed8;
  text-decoration: none;
}

.pm-brief-signal-link:hover {
  text-decoration: underline;
}

.pm-brief-overlay-actions {
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 1180px) {
  .cp-search-row {
    grid-template-columns: 1fr;
  }

  .cp-personal-grid,
  .cp-context-grid,
  .cp-charts-grid,
  .cp-divergence-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .cp-toolbar {
    align-items: stretch;
  }

  .cp-toolbar-left {
    width: 100%;
  }

  .cp-toolbar-left .control-btn {
    flex: 1 1 calc(50% - 6px);
  }

  .cp-drilldown-controls {
    width: 100%;
  }

  .cp-drilldown-controls .search-input {
    min-width: 0;
    width: 100%;
  }

  .cp-percentile-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Topics & Mandates Workspace (tm-*) ─────────────────────────────────── */
.tm-panel {
  display: grid;
  gap: 14px;
}

.tm-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.tm-title {
  margin: 0;
  font-size: 30px;
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.tm-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  max-width: 900px;
}

.tm-header-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tm-kpi-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.tm-topic-lens {
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 12px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.98) 0%, rgba(245, 249, 255, 0.96) 100%);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.07);
  padding: 10px;
  display: grid;
  gap: 8px;
}

.tm-topic-lens-head {
  display: grid;
  gap: 3px;
}

.tm-topic-lens-head h3 {
  margin: 0;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

body[data-page="topics-mandates"] #topicFilterBar {
  display: block;
}

.tm-topic-lens .topic-filter-controls {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto auto;
  gap: 6px;
  align-items: center;
}

.tm-topic-lens .search-input {
  min-height: 40px;
  border-radius: 10px;
  font-weight: 600;
}

.tm-filter-card--scope .tm-filter-row--advanced {
  display: grid;
}

.tm-filter-card--scope.is-compact .tm-filter-row--advanced {
  display: none;
}

.tm-scope-toggle {
  justify-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.tm-scope-chevron {
  transition: transform 0.2s ease;
}

[aria-expanded="true"] .tm-scope-chevron {
  transform: rotate(180deg);
}

.tm-kpi-cell {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  background: #fff;
}

.tm-kpi-value {
  display: block;
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
}

.tm-kpi-label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 2px;
}

.tm-filter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.tm-filter-grid--single {
  grid-template-columns: minmax(0, 1fr);
}

.tm-filter-grid--single .tm-filter-card--scope {
  max-width: 960px;
}

.tm-filter-card {
  display: grid;
  gap: 10px;
  align-content: start;
}

.tm-global-discovery-card {
  gap: 12px;
}

.tm-global-discovery-results {
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 11px;
  background: linear-gradient(180deg, rgba(248, 250, 255, 0.92) 0%, rgba(255, 255, 255, 0.98) 100%);
  padding: 10px;
  min-height: 140px;
  max-height: 560px;
  overflow: auto;
}

.tm-global-discovery-advanced {
  border-top: 1px dashed rgba(148, 163, 184, 0.46);
  padding-top: 8px;
  display: grid;
  gap: 8px;
}

.tm-global-discovery-advanced > summary {
  cursor: pointer;
  font-size: 11px;
  color: #475569;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  list-style: none;
}

.tm-global-discovery-advanced > summary::-webkit-details-marker {
  display: none;
}

.tm-global-discovery-advanced[open] > summary {
  color: #1d4ed8;
}

.tm-gd-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  position: sticky;
  top: 0;
  z-index: 2;
  background: linear-gradient(180deg, rgba(248, 250, 255, 0.98) 0%, rgba(248, 250, 255, 0.9) 100%);
  border-bottom: 1px solid rgba(148, 163, 184, 0.24);
  padding-bottom: 7px;
}

.tm-gd-query {
  font-size: 12px;
  color: #334155;
}

.tm-gd-query strong {
  color: #0f172a;
}

.tm-gd-counts {
  font-size: 11px;
  color: #64748b;
  font-weight: 700;
}

.tm-gd-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.tm-gd-col {
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  padding: 8px;
  min-height: 104px;
  max-height: 420px;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.tm-gd-col h4 {
  margin: 0 0 7px;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #1e3a8a;
}

.tm-gd-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
  align-content: start;
  min-height: 0;
  max-height: 100%;
  overflow-y: auto;
  overflow-x: auto;
  padding-right: 4px;
  scrollbar-gutter: stable;
}

.tm-gd-col li {
  display: grid;
  gap: 2px;
  font-size: 11px;
  color: #475569;
  line-height: 1.35;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.tm-gd-col li strong {
  font-size: 11.5px;
  color: #0f172a;
}

.tm-gd-col li a {
  color: #1d4ed8;
  text-decoration: none;
  font-weight: 700;
}

.tm-gd-col li a:hover {
  text-decoration: underline;
}

.tm-gd-col li.is-empty {
  color: #64748b;
}

.tm-gd-col--meps ul {
  gap: 4px;
}

.tm-gd-col--meps li.tm-gd-mep-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding: 8px 12px;
  margin: 0;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.22);
}

.tm-gd-mep-main {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  gap: 2px;
  color: inherit;
  text-decoration: none;
}

.tm-gd-mep-main strong {
  min-width: 0;
  margin-right: 10px;
  overflow-wrap: anywhere;
  white-space: normal;
}

.tm-gd-mep-meta {
  min-width: 0;
  color: #64748b;
  overflow-wrap: anywhere;
}

.tm-gd-mep-score {
  flex: 0 0 auto;
  min-width: 42px;
  text-align: right;
  font-family: 'SF Mono','Fira Code',ui-monospace,monospace;
  font-size: 13px;
  font-weight: 900;
  color: #2563eb;
}

.tm-gd-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tm-gd-chip {
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 999px;
  background: #f8fafc;
  color: #334155;
  font-size: 10px;
  line-height: 1.2;
  padding: 2px 6px;
}

.tm-gd-chip--speech {
  border-color: rgba(99, 102, 241, 0.35);
  background: #eef2ff;
  color: #3730a3;
}

.tm-gd-chip--mep {
  border-color: rgba(39, 110, 241, 0.35);
  background: #eff6ff;
  color: #1e40af;
  font-weight: 700;
  cursor: pointer;
}

.tm-gd-chip--mep:hover,
.tm-gd-chip--mep:focus-visible {
  background: #dbeafe;
  border-color: rgba(39, 110, 241, 0.6);
}

.tm-gd-hit {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: inherit;
}

.tm-gd-hit-title {
  font-size: 11.5px;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.tm-gd-hit-meta {
  font-size: 10.5px;
  color: #64748b;
}

.tm-gd-hit-link {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  color: #1d4ed8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid rgba(29, 78, 216, 0.25);
  background: rgba(29, 78, 216, 0.06);
  margin-top: 2px;
}

.tm-filter-card h3 {
  margin: 0;
  font-size: 13px;
}

/* ── Parliament Signals (topics-mandates) ──────────────────────────── */
.tm-parliament-signals-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tm-psignal-card {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, background 0.15s;
}
.tm-psignal-card:hover {
  border-color: #93c5fd;
  background: #eff6ff;
}
.tm-psignal-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.tm-psignal-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #1d4ed8;
  background: rgba(29,78,216,0.07);
  border: 1px solid rgba(29,78,216,0.18);
  border-radius: 999px;
  padding: 1px 6px;
}
.tm-psignal-date {
  font-size: 11px;
  color: #94a3b8;
  margin-left: auto;
}
.tm-psignal-title {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.4;
}
.tm-psignal-summary {
  font-size: 11.5px;
  color: #64748b;
  margin-top: 3px;
  line-height: 1.45;
}
.tm-psignal-footer {
  margin-top: 10px;
  text-align: right;
}

/* ── EP Desk topic chips (news.html) ───────────────────────────────── */
/* ep-topic-chip styles → theme-lock.css */

.tm-filter-row {
  display: grid;
  gap: 4px;
}

.tm-filter-row label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tm-inline-note {
  font-size: 12px;
  color: var(--muted);
  border-top: 1px dashed var(--border);
  padding-top: 8px;
}

.tm-url-state {
  font-size: 11px;
  color: var(--muted);
}

.tm-state-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.tm-state-title {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  margin-bottom: 4px;
}

.tm-state-list {
  display: grid;
  gap: 6px;
}

.tm-state-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
}

.tm-state-apply {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  text-align: left;
  cursor: pointer;
  padding: 7px 8px;
  display: grid;
  gap: 3px;
}

.tm-state-apply:hover {
  border-color: #93c5fd;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.12);
}

.tm-state-main {
  font-size: 12px;
  color: var(--text);
  font-weight: 700;
}

.tm-state-meta {
  font-size: 10px;
  color: var(--muted);
}

.tm-state-remove {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  width: 30px;
  cursor: pointer;
}

.tm-state-remove:hover {
  color: #b91c1c;
  border-color: #fecaca;
  background: #fff7f7;
}

.tm-topic-chip {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  font-size: 11px;
  color: var(--text);
  padding: 5px 9px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  justify-content: space-between;
}

.tm-topic-chip:hover {
  border-color: #a7f3d0;
  color: #065f46;
  background: #f0fdf4;
}

.tm-section-grid {
  display: grid;
  gap: 12px;
}

.tm-behaviour-grid {
  margin-top: 8px;
}

.tm-topic-focus-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 12px;
}

.tm-topic-focus-grid--top {
  margin-top: 2px;
}

.tm-topic-alliance-card {
  display: grid;
  gap: 10px;
  align-content: start;
}

.tm-topic-alliance-wrap {
  position: relative;
  height: 400px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 8px;
  background: linear-gradient(180deg, rgba(248, 250, 255, 0.9) 0%, rgba(255, 255, 255, 0.98) 100%);
}

.tm-topic-alliance-fallback {
  position: absolute;
  inset: 8px;
  display: grid;
  gap: 12px;
  align-content: start;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(245, 248, 255, 0.98) 100%);
}

.tm-topic-fallback-copy {
  font-size: 12px;
  line-height: 1.55;
  color: #475569;
}

.tm-topic-fallback-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.tm-topic-fallback-col {
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  padding: 10px;
  display: grid;
  gap: 8px;
}

.tm-topic-fallback-col h4 {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #1e3a8a;
}

.tm-topic-fallback-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.tm-topic-fallback-col li {
  display: grid;
  gap: 3px;
  font-size: 11px;
  line-height: 1.45;
  color: #475569;
}

.tm-topic-fallback-col li strong {
  color: #0f172a;
}

.tm-topic-alliance-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tm-topic-tag {
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 999px;
  background: #fff;
  color: #334155;
  font-size: 11px;
  padding: 4px 9px;
}

.tm-topic-interest-panel {
  margin: 0;
  padding: 12px;
  border-radius: 8px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 420px;
  max-height: min(74vh, 760px);
  overflow: hidden;
}

.tm-topic-interest-panel .tmep-list {
  min-height: 0;
  overflow-y: auto;
  overflow-x: auto;
  padding-right: 4px;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
}

.tm-topic-interest-panel .tmep-item {
  min-width: 0;
}

.tm-topic-interest-panel .tmep-name-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
}

.tm-topic-interest-panel .tmep-name {
  min-width: 0;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.tm-topic-interest-panel .tmep-score {
  min-width: 48px;
  justify-content: flex-end;
  text-align: right;
}

.tm-topic-interest-panel .tmep-score-num {
  letter-spacing: 0;
}

.tm-topic-interest-panel .tmep-meta {
  min-width: 0;
  flex-wrap: wrap;
  overflow-wrap: anywhere;
}

.tm-topic-interest-panel .tmep-list::-webkit-scrollbar {
  width: 8px;
}

.tm-topic-interest-panel .tmep-list::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.55);
  border-radius: 999px;
}

.tm-topic-interest-panel .tmep-list::-webkit-scrollbar-track {
  background: rgba(226, 232, 240, 0.45);
  border-radius: 999px;
}

.tm-topic-interest-panel .tmep-empty {
  padding: 12px 4px;
}

.tm-topic-interest-panel .tm-likely-meeting-preview[data-inline-preview] {
  color: #475569;
}

.tm-likely-item {
  align-items: stretch;
}

.tm-likely-score-track {
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: #dbe4f0;
  overflow: hidden;
  margin-top: 2px;
}

.tm-likely-score-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb 0%, #0ea5e9 100%);
}

.tm-likely-reasons {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.tm-likely-reason {
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 10px;
  color: #334155;
  background: #f8fafc;
}

.tm-likely-meeting-preview {
  margin-top: 5px;
  font-size: 11px;
  color: #475569;
  line-height: 1.35;
  border-top: 1px dashed rgba(148, 163, 184, 0.35);
  padding-top: 6px;
}

.tm-likely-actions {
  margin-top: 8px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tm-likely-actions .control-btn {
  min-height: 32px;
  font-size: 11px;
}

#topicFilterStatus.tm-topic-warning {
  color: #b45309;
  font-weight: 700;
}

.tm-section-head {
  display: grid;
  gap: 4px;
}

.tm-section-head h3 {
  margin: 0;
  font-size: 16px;
}

.tm-command-bento {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.tm-hemicycle-stage {
  display: none;
}

.tm-matrix-wrap {
  margin-top: 8px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 11px;
  background: #fff;
  overflow: auto;
  max-height: 560px;
  padding: 8px;
}

#analysisTopicMatrixContainer .topic-matrix-wrap {
  margin-top: 0;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 10px;
  padding: 6px;
  background: #fff;
}

#topicOpportunityInsights {
  margin-top: 10px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 10px;
  background: #fff;
  padding: 10px;
}

.tm-inline-controls {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
  margin-bottom: 8px;
}

.tm-inline-field {
  display: grid;
  gap: 4px;
}

.tm-inline-field span {
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tm-patterns-grid {
  margin-top: 8px;
}

.tm-cluster-wrap,
.tm-rebel-wrap {
  margin-top: 12px;
}

.tm-cluster-wrap h4,
.tm-rebel-wrap h4 {
  margin: 0 0 8px;
  font-size: 13px;
}

.tm-cluster-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.tm-cluster-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.tm-cluster-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
}

.tm-cluster-head h5 {
  margin: 0;
  font-size: 13px;
}

.tm-cluster-head span {
  font-size: 11px;
  color: var(--muted);
}

.tm-cluster-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 10px;
  color: var(--muted);
}

.tm-cluster-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tm-cluster-topic {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #f8fafc;
  color: var(--text);
  font-size: 11px;
  padding: 4px 8px;
  cursor: pointer;
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.tm-cluster-topic:hover {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}

.tm-drill-table-wrap {
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.tm-drill-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.tm-drill-table th,
.tm-drill-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: top;
}

.tm-drill-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  color: #475569;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tm-drill-row {
  cursor: pointer;
}

.tm-drill-row:hover td {
  background: #f8fafc;
}

.tm-drill-row.active td {
  background: #eff6ff;
}

.tm-topic-inline {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 10px;
  display: inline-flex;
  margin-right: 4px;
  margin-bottom: 4px;
}

.tm-drill-detail {
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  background: #fff;
  display: grid;
  gap: 8px;
}

.tm-drill-detail-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.tm-drill-detail-head h4 {
  margin: 0;
  font-size: 14px;
}

.tm-drill-detail-actions a {
  font-size: 12px;
}

.tm-drill-detail-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tm-drill-detail-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
}

.tm-drill-group-table {
  display: grid;
  gap: 4px;
}

.tm-drill-group-row {
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 6px 8px;
  display: grid;
  grid-template-columns: minmax(140px, 1.4fr) repeat(4, minmax(66px, 1fr));
  gap: 6px;
  font-size: 11px;
  align-items: center;
}

.tm-drill-group-name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
}

.tm-context-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.tm-context-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  padding: 10px;
  display: grid;
  gap: 4px;
}

.tm-context-card h4 {
  margin: 0;
  font-size: 12px;
}

.tm-context-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.tm-percentile {
  display: grid;
  gap: 4px;
}

.tm-percentile-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  border-bottom: 1px dashed var(--border);
  padding: 4px 0;
}

/* ── tm: KPI strip accent borders ───────────────────── */
.tm-kpi-value {
  font-feature-settings: 'tnum';
  letter-spacing: -0.01em;
}

.tm-kpi-strip .tm-kpi-cell:nth-child(1) { border-left: 3px solid #3b82f6; padding-left: 9px; }
.tm-kpi-strip .tm-kpi-cell:nth-child(2) { border-left: 3px solid #8b5cf6; padding-left: 9px; }
.tm-kpi-strip .tm-kpi-cell:nth-child(3) { border-left: 3px solid #10b981; padding-left: 9px; }
.tm-kpi-strip .tm-kpi-cell:nth-child(4) { border-left: 3px solid #14b8a6; padding-left: 9px; }
.tm-kpi-strip .tm-kpi-cell:nth-child(5) { border-left: 3px solid #f59e0b; padding-left: 9px; }

/* ── tm: section grid spacing ───────────────────────── */
.tm-section-grid {
  gap: 18px;
}

/* ── tm: filter cards top-aligned ───────────────────── */
.tm-filter-card {
  align-content: start;
}

/* ── tm: topic tag variants ──────────────────────────── */
.tm-topic-tag--best {
  background: #f0fdf4;
  border-color: rgba(16, 185, 129, 0.38);
  color: #065f46;
}

.tm-topic-tag--split {
  background: #fffbeb;
  border-color: rgba(245, 158, 11, 0.38);
  color: #78350f;
}

.tm-topic-tag--count {
  background: #eff6ff;
  border-color: rgba(59, 130, 246, 0.28);
  color: #1e40af;
}

/* ── tm: drill table header weight ──────────────────── */
.tm-drill-table th {
  font-weight: 700;
}

/* ── tm: context card hover ──────────────────────────── */
.tm-context-card {
  transition: border-color 0.15s, box-shadow 0.15s;
}

.tm-context-card:hover {
  border-color: rgba(59, 130, 246, 0.32);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.07);
}

/* ── tm: panel export separator ─────────────────────── */
.tm-panel .export-section {
  border-top: 1px solid rgba(226, 232, 240, 0.85);
  padding-top: 6px;
  margin-top: 4px;
}

/* ── tm: section-head tighter sub-label ─────────────── */
.tm-section-head {
  gap: 6px;
}

/* ── tm: session signal badges (drill table) ─────────── */
.tm-signal-badge {
  display: inline-flex;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 1px 6px;
  vertical-align: middle;
  margin-left: 4px;
  line-height: 1.6;
}

.tm-signal-badge--strong { background: #dcfce7; color: #15803d; }
.tm-signal-badge--low    { background: #fee2e2; color: #b91c1c; }
.tm-signal-badge--split  { background: #fef3c7; color: #b45309; }

/* ── tm: data feedback notice state ─────────────────── */
#tmDataFeedback:not(:empty) {
  background: rgba(248, 250, 252, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 12px;
  color: #475569;
}

.tm-percentile-row strong {
  color: var(--text);
}

.tm-help-overlay {
  position: fixed;
  inset: 0;
  z-index: 2200;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tm-help-overlay.is-hidden {
  display: none;
}

.tm-help-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.46);
}

.tm-help-card {
  position: relative;
  width: min(640px, calc(100vw - 20px));
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: 0 26px 56px rgba(15, 23, 42, 0.32);
  z-index: 1;
  padding: 16px;
}

.tm-help-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.tm-help-head h2 {
  margin: 0;
  font-size: 19px;
}

.tm-help-close {
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 30px;
  height: 30px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
}

.tm-help-close:hover {
  background: #f8fafc;
  color: var(--text);
}

.tm-help-body {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 1180px) {
  .tm-kpi-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tm-topic-focus-grid,
  .tm-filter-grid,
  .tm-behaviour-grid,
  .tm-cluster-grid,
  .tm-context-grid,
  .tm-gd-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .tm-title {
    font-size: 24px;
  }

  .tm-kpi-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tm-inline-controls {
    align-items: stretch;
  }

  .tm-inline-field {
    width: 100%;
  }

  .tm-topic-lens .topic-filter-controls {
    grid-template-columns: 1fr;
  }

  .tm-topic-alliance-wrap {
    height: 320px;
  }

  .tm-topic-interest-panel {
    min-height: 320px;
    max-height: 62vh;
  }

  .tm-gd-col {
    max-height: none;
    overflow: visible;
  }

  .tm-gd-hit-link {
    font-size: 11px;
    padding: 3px 9px;
  }

  .tm-gd-chip {
    font-size: 11px;
    padding: 3px 7px;
  }

  .tm-drill-group-row {
    grid-template-columns: 1fr;
  }
}

/* ── Dedicated Workspaces Polish (Parliament + Topics) ───────────────────── */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

body[data-page="dataset"],
body[data-page="intel"] {
  background:
    radial-gradient(1200px 460px at 12% -12%, rgba(37, 99, 235, 0.13), transparent 62%),
    radial-gradient(860px 360px at 88% -8%, rgba(14, 165, 233, 0.12), transparent 60%),
    linear-gradient(180deg, #eef3ff 0%, #f6f8ff 34%, #f4f7fb 100%);
}

body[data-page="parliament-members"] .app-shell > .app-main {
  padding-top: 88px;
}

body[data-page="topics-mandates"] .app-content {
  padding-top: 88px;
}


body[data-page="graph"] .app-content {
  padding: 88px 0 0 0;
}

body[data-page="parliament-members"] .container--wide,
body[data-page="topics-mandates"] .container--wide {
  max-width: 1540px;
  padding-top: 24px;
}

.topbar.topbar--glass {
  min-height: 72px;
  padding: 9px 20px;
  background:
    linear-gradient(120deg, rgba(15, 23, 42, 0.96) 0%, rgba(30, 41, 59, 0.94) 56%, rgba(15, 23, 42, 0.97) 100%);
  border-bottom: 1px solid rgba(148, 163, 184, 0.24);
  box-shadow: 0 12px 32px rgba(2, 6, 23, 0.32);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.topbar--glass .brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.topbar--glass .brand-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.topbar--glass .brand-kicker {
  color: #7dd3fc;
  font-size: 10px;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
}

.topbar--glass .topbar-title {
  color: #e2e8f0;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.1;
  padding: 0 !important;
  font-weight: 700;
}

.topbar--glass .topbar-nav {
  gap: 6px;
  flex-wrap: wrap;
}

.topbar--glass .nav-pill {
  padding: 9px 13px;
  margin: 0;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #aeb9cc;
  line-height: 1;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  background: transparent;
}

.topbar--glass .nav-pill:hover {
  color: #f1f5f9;
  background: rgba(148, 163, 184, 0.16);
  border-color: rgba(148, 163, 184, 0.24);
}

.topbar--glass .nav-pill.active {
  color: #f8fafc;
  border-color: rgba(96, 165, 250, 0.55);
  border-bottom-color: rgba(96, 165, 250, 0.55);
  background: rgba(59, 130, 246, 0.24);
}

.topbar--glass .topbar-actions {
  gap: 8px;
}

.topbar--glass .sessions-badge {
  background: rgba(37, 99, 235, 0.2);
  border-color: rgba(96, 165, 250, 0.36);
  color: #bfdbfe;
}

.topbar-user-pill {
  font-size: 12px;
  opacity: 0.86;
  flex-shrink: 0;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.26);
  background: rgba(15, 23, 42, 0.08);
  color: inherit;
}

.topbar-user-pill:hover {
  opacity: 1;
  border-color: rgba(96, 165, 250, 0.4);
  background: rgba(59, 130, 246, 0.18);
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.55fr);
  gap: 14px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.26);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.95) 0%, rgba(246, 250, 255, 0.92) 100%);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.09), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  margin-bottom: 16px;
}

.hero-panel__content {
  display: grid;
  gap: 12px;
  align-content: start;
}

.hero-panel__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #1e3a8a;
  border: 1px solid rgba(37, 99, 235, 0.24);
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.1);
  padding: 5px 10px;
}

.hero-panel__title {
  margin: 0;
  font-size: clamp(32px, 3.1vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.hero-panel__text {
  margin: 0;
  max-width: 860px;
  color: #475569;
  font-size: 18px;
  line-height: 1.45;
}

.hero-panel__aside {
  display: flex;
  align-items: stretch;
  min-width: 0;
}

.hero-stat-card {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-top: 3px solid #2563eb;
  border-radius: 14px;
  padding: 18px 16px 16px;
  background: linear-gradient(180deg, rgba(241, 245, 255, 0.94) 0%, rgba(255, 255, 255, 0.95) 100%);
  display: grid;
  gap: 8px;
}

.hero-stat-card__icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(37, 99, 235, 0.16);
  color: #1d4ed8;
}

.hero-stat-card__label {
  font-size: 11px;
  font-weight: 800;
  color: #2563eb;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hero-stat-card__text {
  margin: 0;
  font-size: 12px;
  color: #64748b;
  line-height: 1.5;
}

/* live stats block inside hero aside card */
.hero-stat-card--live {
  gap: 12px;
}

.hero-stat-card--interest {
  border-top-color: #7c3aed;
  background: linear-gradient(180deg, rgba(250, 245, 255, 0.94) 0%, rgba(255, 255, 255, 0.96) 100%);
  align-content: start;
}

.hero-stat-card--interest .hero-stat-card__icon {
  background: rgba(124, 58, 237, 0.15);
  color: #6d28d9;
}

.hero-stat-card--interest .hero-stat-card__label {
  color: #6d28d9;
}

.pm-profile-history-list--hero {
  display: grid;
  gap: 6px;
  max-height: 280px;
  overflow: auto;
  padding-right: 2px;
}

.pm-profile-history-list--hero .list-meta {
  margin: 0;
}

.hero-stat-card__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.hero-stat-card__stat {
  border: 1px solid rgba(203, 213, 225, 0.7);
  border-radius: 8px;
  padding: 8px 6px;
  background: rgba(255, 255, 255, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.hero-stat-card__num {
  font-size: 18px;
  font-weight: 800;
  color: #1d4ed8;
  line-height: 1;
  font-feature-settings: 'tnum';
}

.hero-stat-card__unit {
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.pm-selector-search-wrap--hero {
  position: relative;
  max-width: 820px;
}

.pm-selector-input {
  width: 100%;
  border: 2px solid rgba(148, 163, 184, 0.38);
  background: #ffffff;
  color: #0f172a;
  padding: 10px 12px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.pm-selector-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  outline: none;
}

.pm-selector-input--xl {
  border-radius: 12px;
  min-height: 46px;
  font-size: 15px;
  font-weight: 700;
}

.input-with-icon {
  position: relative;
  width: 100%;
}

.input-with-icon .input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  color: #64748b;
  pointer-events: none;
}

.input-with-icon input,
.input-with-icon .search-input {
  padding-left: 40px;
}

.pm-selector-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 80;
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
  max-height: 330px;
  overflow-y: auto;
}

.pm-selector-dropdown:empty {
  display: none;
}

.pm-sel-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 9px 12px;
  cursor: pointer;
  border-bottom: 1px solid rgba(226, 232, 240, 0.65);
}

.pm-sel-item:last-child {
  border-bottom: 0;
}

.pm-sel-item:hover,
.pm-sel-item.is-active {
  background: #eff6ff;
}

.pm-sel-mark {
  background: rgba(37, 99, 235, 0.14);
  color: #1d4ed8;
  border-radius: 4px;
  padding: 0 3px;
}

.pm-sel-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.pm-sel-name {
  min-width: 0;
  font-size: 13px;
  color: #0f172a;
  font-weight: 700;
}

.pm-sel-meta {
  color: #64748b;
  font-size: 11px;
  white-space: nowrap;
}

.pm-selector-hint {
  font-size: 12px;
  color: #64748b;
  font-weight: 700;
}

.pm-kpi-strip--modern {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
  padding: 10px;
  margin-bottom: 18px;
}

.pm-kpi-strip--modern .pm-kpi-cell {
  border: 1px solid rgba(203, 213, 225, 0.62);
  border-top-width: 3px;
  border-radius: 10px;
  padding: 12px 10px 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(248, 250, 252, 0.98) 100%);
}

/* per-cell accent colours */
.pm-kpi-strip--modern .pm-kpi-cell:nth-child(1) { border-top-color: #2563eb; }
.pm-kpi-strip--modern .pm-kpi-cell:nth-child(2) { border-top-color: #7c3aed; }
.pm-kpi-strip--modern .pm-kpi-cell:nth-child(3) { border-top-color: #059669; }
.pm-kpi-strip--modern .pm-kpi-cell:nth-child(4) { border-top-color: #0891b2; }
.pm-kpi-strip--modern .pm-kpi-cell:nth-child(5) { border-top-color: #d97706; }
.pm-kpi-strip--modern .pm-kpi-cell:nth-child(6) { border-top-color: #db2777; }

.pm-kpi-strip--modern .pm-kpi-sep {
  display: none;
}

.pm-kpi-strip--modern .pm-kpi-val {
  font-size: 22px;
  line-height: 1.1;
  font-weight: 800;
  color: #0f172a;
  font-feature-settings: 'tnum';
}

.pm-kpi-strip--modern .pm-kpi-lbl {
  margin-top: 4px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  font-weight: 800;
}

.panel--elevated {
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.96) 0%, rgba(250, 252, 255, 0.92) 100%);
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.09), inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.panel-heading-group {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.panel-icon-wrap {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  background: rgba(241, 245, 255, 0.9);
  color: #1d4ed8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.panel-subtitle {
  margin: 3px 0 0;
  font-size: 13px;
  color: #64748b;
}

.list-controls--modern {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.pm-directory-search {
  position: relative;
  min-width: 0;
}

.pm-directory-input {
  min-height: 40px;
  font-weight: 600;
}

.pm-selector-dropdown--directory {
  top: calc(100% + 6px);
}

.pm-directory-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.pm-directory-actions--list-only {
  padding-top: 2px;
}

.pm-directory-actions--list-only .pm-vb-select {
  min-width: 180px;
}

.pm-directory-actions--list-only .pm-dir-meta-count {
  margin-left: 0;
}

.pm-view-toggle .chip {
  min-width: 72px;
  justify-content: center;
}

.search-wrap--lg {
  min-width: 0;
}

.pm-mep-grid--modern {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 10px;
}

.pm-mep-grid--list {
  display: block;
}

.pm-list-wrap {
  display: grid;
  gap: 10px;
}

.pm-list-head {
  display: grid;
  grid-template-columns: minmax(240px, 1.7fr) repeat(3, minmax(88px, 0.62fr)) minmax(90px, 0.48fr) auto;
  gap: 10px;
  align-items: center;
  padding: 0 14px;
}

.pm-list-head-cell {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
}

.pm-list-head-cell--main {
  padding-left: 20px;
}

.pm-list-head-cell--action {
  text-align: center;
}

.pm-list-row {
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.99) 0%, rgba(248, 251, 255, 0.98) 100%);
  box-shadow: 0 3px 12px rgba(15, 23, 42, 0.05);
  padding: 12px 14px;
  display: grid;
  grid-template-columns: minmax(240px, 1.7fr) repeat(3, minmax(88px, 0.62fr)) minmax(90px, 0.48fr) auto;
  gap: 10px;
  align-items: center;
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.pm-list-row:hover {
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.12);
  transform: translateY(-1px);
}

.pm-list-row:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.22);
  outline-offset: 1px;
}

.pm-list-main {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.pm-list-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.85), 0 0 0 5px rgba(148, 163, 184, 0.12);
}

.pm-list-identity {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.pm-list-name {
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.pm-list-sub {
  font-size: 12px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pm-list-stat {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.pm-list-stat span {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #64748b;
}

.pm-list-stat strong {
  font-size: 17px;
  line-height: 1.1;
  color: #0f172a;
}

.pm-list-val--high {
  color: #15803d !important;
}

.pm-list-val--mid {
  color: #1d4ed8 !important;
}

.pm-list-val--low {
  color: #b91c1c !important;
}

.pm-list-val--na {
  color: #64748b !important;
}

.pm-list-group-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: start;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.pm-list-open {
  border: 1px solid rgba(37, 99, 235, 0.34);
  border-radius: 10px;
  background: rgba(239, 246, 255, 0.94);
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 800;
  padding: 8px 12px;
  cursor: pointer;
}

.pm-list-open:hover {
  background: #1d4ed8;
  color: #fff;
  border-color: #1d4ed8;
}

.pm-list-open:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.24);
  outline-offset: 2px;
}

.pm-mcard {
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(248, 251, 255, 0.98) 100%);
  padding: 14px 12px;
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.pm-mcard:hover {
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.16);
  transform: translateY(-2px);
}

.pm-mcard:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.22);
  outline-offset: 1px;
}

.pm-mcard-top {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.pm-mcard-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.pm-mcard-identity {
  min-width: 0;
}

.pm-mcard-name {
  font-size: 13px;
  line-height: 1.25;
  font-weight: 800;
  color: #0f172a;
}

.pm-mcard-sub {
  margin-top: 2px;
  font-size: 11px;
  color: #64748b;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.pm-mcard-flag {
  font-size: 10px;
  font-weight: 800;
  color: #475569;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(226, 232, 240, 0.74);
}

.pm-mcard-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.pm-mcard-metric {
  border: 1px solid rgba(203, 213, 225, 0.66);
  border-radius: 9px;
  background: #ffffff;
  padding: 7px;
  display: grid;
  gap: 4px;
}

.pm-mcard-metric-val {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
}

.pm-mcard-metric-lbl {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  font-weight: 700;
}

.pm-mcard-align--high .pm-mcard-metric-val {
  color: #15803d;
}

.pm-mcard-align--mid .pm-mcard-metric-val {
  color: #1d4ed8;
}

.pm-mcard-align--low .pm-mcard-metric-val {
  color: #b91c1c;
}

.pm-mcard-bar-track {
  width: 100%;
  height: 5px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.pm-mcard-bar-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #3b82f6 0%, #0ea5e9 100%);
}

.pm-mcard-footer {
  margin-top: 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.pm-mcard-group-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 7px;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.pm-mcard-cta {
  font-size: 11px;
  color: #1d4ed8;
  font-weight: 800;
}

.pm-profile-workspace.is-hidden {
  display: none;
}

.pm-profile-workspace {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
}

@media (min-width: 1181px) {
  .pm-profile-workspace {
    grid-template-columns: minmax(0, 1fr);
    column-gap: 0;
    align-items: start;
  }
  .pm-profile-head,
  .pm-profile-top-grid,
  .pm-profile-kpi-grid,
  .pm-profile-charts-grid,
  .pm-profile-context-grid,
  .pm-profile-drill-card,
  .pm-debates-card,
  .pm-amendments-card {
    grid-column: 1 / -1;
  }
}

.pm-profile-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.pm-profile-identity {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.pm-profile-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-top: 9px;
  background: #64748b;
  flex-shrink: 0;
  box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.22);
}

.pm-profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

/* visual separator between help button and MEP-action buttons */
.pm-profile-actions .control-btn:first-child {
  margin-right: 6px;
  border-right: 1px solid rgba(203, 213, 225, 0.7);
  padding-right: 14px;
}

.pm-profile-actions .control-btn.is-active {
  border-color: #15803d;
  color: #15803d;
  background: #ecfdf3;
}

.pm-profile-top-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}

.pm-profile-contact-card,
.pm-profile-votemix-card {
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(246, 251, 255, 0.98) 100%);
  padding: 14px;
  display: grid;
  gap: 7px;
}

.pm-profile-side-stack {
  display: grid;
  gap: 10px;
  align-content: start;
}

.pm-profile-contact-card {
  max-height: 420px;
  overflow: auto;
  scrollbar-gutter: stable;
}

.pm-profile-contact-card h3,
.pm-profile-votemix-card h3 {
  margin: 0;
  font-size: 13px;
}

.pm-profile-contact-name {
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
}

.pm-profile-contact-meta {
  font-size: 12px;
  color: #475569;
}

.pm-profile-contact-section {
  border-top: 1px solid rgba(226, 232, 240, 0.94);
  padding-top: 10px;
  display: grid;
  gap: 8px;
}

.pm-profile-contact-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #1d4ed8;
}

.pm-profile-contact-tag {
  border: 1px solid rgba(37, 99, 235, 0.25);
  border-radius: 999px;
  background: rgba(239, 246, 255, 0.8);
  color: #1d4ed8;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.pm-profile-inline-icon {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  flex-shrink: 0;
}

.pm-profile-inline-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.pm-profile-email-row {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(226, 232, 240, 0.96);
  border-radius: 10px;
  background: rgba(248, 250, 252, 0.9);
  padding: 8px 10px;
}

.pm-profile-email-text {
  flex: 1;
  font-size: 12px;
  font-weight: 800;
  color: #0f172a;
  word-break: break-all;
  font-family: 'SF Mono', 'Fira Code', monospace;
}

.pm-profile-copy-btn {
  border: 1px solid rgba(203, 213, 225, 0.95);
  border-radius: 8px;
  background: #fff;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 9px;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.pm-profile-copy-btn:hover {
  background: #1d4ed8;
  color: #fff;
  border-color: #1d4ed8;
}

.pm-profile-phone-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.pm-profile-phone-item {
  display: grid;
  gap: 3px;
}

.pm-profile-phone-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.pm-profile-phone-val {
  font-size: 12px;
  color: #0f172a;
  font-weight: 700;
  text-decoration: none;
}

.pm-profile-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pm-profile-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: #1d4ed8;
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 9px;
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 800;
  background: #fff;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.pm-profile-link-btn:hover {
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.14);
}

.pm-profile-social-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.pm-profile-social-btn {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 8px;
  background: #fff;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, color 0.16s ease;
}

.pm-profile-social-btn .pm-profile-inline-icon {
  width: 15px;
  height: 15px;
  color: inherit;
}

.pm-profile-social-btn:hover {
  color: #1d4ed8;
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.14);
}

.pm-profile-copy-btn:focus-visible,
.pm-profile-link-btn:focus-visible,
.pm-profile-social-btn:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.24);
  outline-offset: 2px;
}

.pm-profile-offices-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.pm-profile-office-card {
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 10px;
  background: #fff;
  padding: 8px 9px;
  display: grid;
  gap: 5px;
}

.pm-profile-office-city {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  color: #64748b;
}

.pm-profile-office-address {
  font-size: 11px;
  color: #475569;
  line-height: 1.45;
  white-space: pre-line;
}

.pm-profile-contact-quality {
  font-size: 10px;
  color: #64748b;
}

.pm-profile-votemix-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.pm-profile-mini-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid rgba(37, 99, 235, 0.24);
  background: rgba(239, 246, 255, 0.78);
  color: #1d4ed8;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 3px 7px;
  text-transform: uppercase;
}

.pm-profile-votemix-body {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 10px;
  align-items: center;
}

.pm-profile-votemix-canvas-wrap {
  position: relative;
  height: 132px;
}

.pm-profile-votemix-legend {
  display: grid;
  gap: 5px;
}

.pm-profile-votemix-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}

.pm-profile-votemix-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.pm-profile-votemix-label {
  color: #334155;
  font-weight: 700;
}

.pm-profile-votemix-value {
  color: #64748b;
  font-weight: 700;
}

.pm-profile-meeting-preview {
  border-top: 1px solid rgba(226, 232, 240, 0.9);
  padding-top: 8px;
}

.pm-profile-meeting-list {
  display: grid;
  gap: 6px;
}

.pm-profile-meeting-row {
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 9px;
  background: #fff;
  padding: 7px 8px;
  display: grid;
  gap: 4px;
}

.pm-profile-meeting-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.pm-profile-meeting-date {
  font-size: 10px;
  font-weight: 800;
  color: #334155;
}

.pm-profile-meeting-cat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  color: #64748b;
  font-weight: 700;
}

.pm-profile-meeting-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.pm-profile-meeting-subject {
  font-size: 11px;
  color: #0f172a;
  font-weight: 700;
  line-height: 1.3;
}

.pm-profile-meeting-org {
  font-size: 10px;
  color: #64748b;
  line-height: 1.3;
}

.pm-profile-workstream-card {
  display: grid;
  gap: 8px;
  border-top-width: 3px;
  border-top-color: rgba(29, 78, 216, 0.55);
  margin-top: -2px;
}

.pm-profile-brief-inline {
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.85) 0%, rgba(255, 255, 255, 0.96) 100%);
  padding: 9px 10px;
  display: grid;
  gap: 7px;
}

.pm-profile-brief-headline {
  font-size: 12px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.35;
}

.pm-profile-brief-short {
  margin: 0;
  font-size: 11px;
  color: #475569;
  line-height: 1.45;
}

.pm-profile-brief-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.pm-profile-workstream-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pm-workstream-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(248, 250, 252, 0.92);
  color: #334155;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
}

.pm-workstream-chip strong {
  color: #1d4ed8;
  font-size: 10px;
}

.pm-workstream-chip.is-empty {
  color: #64748b;
}

.pm-profile-workstream-list {
  display: grid;
  gap: 7px;
  max-height: 300px;
  overflow: auto;
  padding-right: 2px;
}

.pm-profile-contact-more {
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.84);
  padding: 6px 8px;
}

.pm-profile-contact-more > summary {
  cursor: pointer;
  list-style: none;
  font-size: 11px;
  font-weight: 800;
  color: #1d4ed8;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pm-profile-contact-more > summary::-webkit-details-marker {
  display: none;
}

.pm-profile-contact-more > summary::before {
  content: '▸';
  color: #64748b;
  font-size: 11px;
  transform: translateY(-1px);
}

.pm-profile-contact-more[open] > summary::before {
  content: '▾';
}

.pm-profile-contact-more-body {
  margin-top: 8px;
  display: grid;
  gap: 8px;
}

.pm-workstream-row {
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 9px;
  background: #fff;
  padding: 7px 8px;
  display: grid;
  gap: 4px;
}

.pm-workstream-title {
  font-size: 11px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.35;
}

.pm-workstream-meta {
  font-size: 10px;
  color: #64748b;
  line-height: 1.35;
}

.pm-workstream-link {
  font-size: 10px;
  font-weight: 700;
  color: #1d4ed8;
  text-decoration: none;
}

.pm-workstream-link:hover {
  text-decoration: underline;
}

.pm-profile-history {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.pm-profile-history--single {
  grid-template-columns: minmax(0, 1fr);
  max-width: 620px;
}

.pm-profile-history-col {
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(248, 250, 255, 0.9) 0%, rgba(255, 255, 255, 0.96) 100%);
  padding: 8px;
}

.pm-profile-history-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 6px;
}

.pm-profile-history-list {
  display: grid;
  gap: 6px;
}

.pm-profile-history-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  align-items: center;
}

.pm-profile-history-item {
  border: 1px solid rgba(148, 163, 184, 0.34);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  text-align: left;
  padding: 7px 8px;
  display: grid;
  gap: 3px;
}

.pm-profile-history-item:hover {
  border-color: rgba(37, 99, 235, 0.42);
  box-shadow: 0 5px 14px rgba(37, 99, 235, 0.12);
}

.pm-profile-history-main {
  font-size: 12px;
  color: #0f172a;
  font-weight: 700;
}

.pm-profile-history-meta {
  font-size: 10px;
  color: #64748b;
}

.pm-profile-history-remove {
  border: 1px solid rgba(148, 163, 184, 0.34);
  border-radius: 8px;
  background: #fff;
  color: #64748b;
  width: 30px;
  height: 30px;
  cursor: pointer;
}

.pm-profile-history-remove:hover {
  color: #b91c1c;
  border-color: #fecaca;
  background: #fff7f7;
}

.pm-profile-overview-card {
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(246, 251, 255, 0.98) 100%);
  padding: 16px;
  display: grid;
  gap: 10px;
}

.pm-profile-overview-card h3 {
  margin: 0;
  font-size: 14px;
}

.pm-profile-overview-summary {
  display: grid;
  gap: 8px;
}

.pm-profile-overview-archetype {
  display: grid;
  gap: 2px;
}

.pm-profile-overview-archetype strong {
  color: #0f172a;
  font-size: 13px;
}

.pm-profile-overview-archetype span {
  color: #475569;
  font-size: 12px;
}

.pm-profile-overview-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pm-profile-overview-metrics span {
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  color: #334155;
  background: rgba(248, 250, 252, 0.82);
}

.pm-profile-overview-block {
  display: grid;
  gap: 6px;
}

.pm-profile-overview-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
}

.pm-profile-overview-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pm-profile-overview-chip {
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 999px;
  background: #fff;
  color: #0f172a;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
}

.pm-profile-overview-empty {
  font-size: 12px;
  color: #64748b;
}

.pm-profile-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.pm-profile-kpi {
  border: 1px solid rgba(203, 213, 225, 0.7);
  border-top-width: 3px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(248, 251, 255, 0.98) 100%);
  padding: 12px 12px 10px;
}

/* per-kpi accent colours */
.pm-profile-kpi:nth-child(1) { border-top-color: #d97706; }
.pm-profile-kpi:nth-child(2) { border-top-color: #2563eb; }
.pm-profile-kpi:nth-child(3) { border-top-color: #059669; }
.pm-profile-kpi:nth-child(4) { border-top-color: #dc2626; }
.pm-profile-kpi:nth-child(5) { border-top-color: #7c3aed; }

.pm-profile-kpi-val {
  font-size: 21px;
  font-weight: 800;
  line-height: 1.05;
  color: #0f172a;
  font-feature-settings: 'tnum';
}

.pm-profile-kpi-lbl {
  margin-top: 4px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
}

.pm-profile-charts-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.pm-profile-context-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.pm-profile-mini-chart {
  position: relative;
  height: 220px;
  margin-top: 2px;
}

.pm-profile-allies-wrap {
  display: grid;
  gap: 8px;
}

.pm-profile-allies-list {
  display: grid;
  gap: 6px;
}

.pm-profile-ally-row {
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
  text-align: left;
  padding: 8px 9px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.pm-profile-ally-row:hover {
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.12);
}

.pm-profile-ally-row:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.22);
  outline-offset: 1px;
}

.pm-profile-ally-rank {
  font-size: 11px;
  font-weight: 800;
  color: #64748b;
}

.pm-profile-ally-main {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.pm-profile-ally-name {
  font-size: 12px;
  font-weight: 800;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pm-profile-ally-meta {
  font-size: 10px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pm-profile-ally-score {
  font-size: 14px;
  font-weight: 900;
  color: #1d4ed8;
}

.pm-profile-drill-card {
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

/* ── Plenary Debates panel ─────────────────────────────────────────────────── */
.pm-debates-card {
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-top: 3px solid #7c3aed;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

.pm-debates-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  background: linear-gradient(180deg, rgba(245, 243, 255, 0.6) 0%, rgba(255, 255, 255, 0) 100%);
}

.pm-debates-head-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pm-debates-head-left h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
}

.pm-debates-corpus-badge {
  font-size: 10px;
  font-weight: 700;
  color: #7c3aed;
  background: rgba(124, 58, 237, 0.08);
  border: 1px solid rgba(124, 58, 237, 0.22);
  border-radius: 999px;
  padding: 2px 7px;
  letter-spacing: 0.03em;
}

.pm-debates-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  max-width: 100%;
  row-gap: 8px;
}

.pm-debates-translate-btn {
  border-color: rgba(37, 99, 235, 0.45);
  background: rgba(37, 99, 235, 0.09);
  color: #1d4ed8;
  display: none !important;
}

.pm-debates-translate-btn.is-muted {
  border-color: rgba(148, 163, 184, 0.35);
  background: rgba(241, 245, 249, 0.85);
  color: #475569;
}

.pm-debates-topic-input {
  width: 250px;
  flex: 1 1 240px;
  min-width: 180px;
}

.pm-debates-translate-btn {
  white-space: nowrap;
}

.pm-debates-count {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  white-space: nowrap;
}

.pm-debates-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 700;
  color: #334155;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 999px;
  padding: 4px 10px;
}

.pm-debates-toggle input {
  inline-size: 13px;
  block-size: 13px;
  accent-color: #2563eb;
}

.pm-debates-list {
  padding: 10px 12px 12px;
  display: grid;
  gap: 10px;
  max-height: 560px;
  overflow: auto;
  scroll-behavior: smooth;
}

.pm-debates-insights {
  display: grid;
  gap: 10px;
  padding: 10px 16px 8px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  background: rgba(249, 250, 255, 0.72);
}

.pm-debates-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pm-debates-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #334155;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 999px;
  padding: 3px 9px;
  background: #fff;
}

.pm-debates-stat-pill strong {
  color: #0f172a;
  font-weight: 800;
}

.pm-debates-stat-pill--query {
  border-color: rgba(59, 130, 246, 0.38);
  background: rgba(59, 130, 246, 0.08);
}

.pm-debates-sparkline-wrap {
  height: 52px;
}

.pm-debates-topic-chips {
  display: grid;
  gap: 8px;
  padding: 10px 16px 8px;
  border-top: 1px solid rgba(226, 232, 240, 0.68);
  border-bottom: 1px solid rgba(226, 232, 240, 0.68);
  background: rgba(248, 250, 255, 0.56);
}

.pm-debates-chip-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.pm-debates-chip-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
  color: #64748b;
  margin-right: 2px;
}

.pm-debates-topic-chip {
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 999px;
  background: #fff;
  color: #475569;
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 9px;
  cursor: pointer;
  transition: all .15s ease;
  line-height: 1.2;
}

.pm-debates-topic-chip span {
  color: #64748b;
  font-weight: 800;
}

.pm-debates-topic-chip.active,
.pm-debates-topic-chip:hover {
  color: #1d4ed8;
  border-color: rgba(59, 130, 246, 0.42);
  background: rgba(59, 130, 246, 0.1);
}

.pm-debates-topic-chip--theme {
  border-color: rgba(124, 58, 237, 0.28);
  background: rgba(245, 243, 255, 0.85);
  color: #6d28d9;
}

.pm-debate-item {
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-left: 3px solid rgba(37, 99, 235, 0.25);
  border-radius: 12px;
  padding: 10px 12px;
  display: grid;
  gap: 7px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
  transition: border-color .16s ease, box-shadow .16s ease;
}

.pm-debate-item:hover {
  border-left-color: rgba(37, 99, 235, 0.6);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.08);
}

.pm-debate-item.is-english {
  border-left-color: rgba(37, 99, 235, 0.5);
}

.pm-debate-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.pm-debate-title-wrap {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.pm-debate-title {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.35;
  color: #0f172a;
  font-weight: 800;
}

.pm-debate-actions {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.pm-debate-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.pm-debate-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 999px;
  padding: 2px 8px;
  background: rgba(248, 250, 252, 0.95);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: #475569;
}

.pm-debate-signal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.pm-debate-signal-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(15, 118, 110, 0.32);
  border-radius: 999px;
  background: rgba(240, 253, 250, 0.92);
  color: #0f766e;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
}

.pm-debate-tag--date {
  color: #1d4ed8;
  border-color: rgba(37, 99, 235, 0.28);
  background: rgba(239, 246, 255, 0.9);
}

.pm-debate-tag--topic {
  color: #6d28d9;
  border-color: rgba(124, 58, 237, 0.25);
  background: rgba(245, 243, 255, 0.92);
}

.pm-debate-tag--lang {
  color: #334155;
}

.pm-debate-tag--mode {
  color: #1d4ed8;
  border-color: rgba(37, 99, 235, 0.26);
  background: rgba(37, 99, 235, 0.09);
}

.pm-debate-spacer {
  flex: 1 1 auto;
}

.pm-debate-date {
  font-size: 11px;
  font-weight: 800;
  color: #2563eb;
  font-feature-settings: 'tnum';
}

.pm-debate-topic {
  font-size: 11px;
  font-weight: 700;
  color: #6d28d9;
  background: rgba(124, 58, 237, 0.06);
  border: 1px solid rgba(124, 58, 237, 0.16);
  border-radius: 6px;
  padding: 3px 10px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pm-debate-lang {
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.pm-debate-words {
  font-size: 10px;
  color: #94a3b8;
  font-weight: 700;
}

.pm-debate-mode {
  font-size: 10px;
  font-weight: 800;
  color: #1d4ed8;
  background: rgba(37, 99, 235, 0.09);
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: 999px;
  padding: 2px 8px;
}

.pm-debate-text {
  font-size: 12.8px;
  color: #1e293b;
  line-height: 1.66;
  background: rgba(248, 250, 252, 0.6);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 8px;
  padding: 9px 11px;
  transition: border-color .16s ease, background .16s ease;
  text-align: left;
  hyphens: auto;
  overflow-wrap: anywhere;
}

.pm-debate-text.is-expanded {
  border-color: rgba(37, 99, 235, 0.25);
  background: rgba(239, 246, 255, 0.5);
}

.pm-debate-text-short,
.pm-debate-text-full {
  display: block;
}

.pm-debate-item.is-english .pm-debate-text {
  border-color: rgba(59, 130, 246, 0.26);
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.7) 0%, rgba(255, 255, 255, 0.9) 100%);
}

.pm-debate-expand {
  margin-top: 8px;
  border: none;
  border-radius: 0;
  background: transparent;
  color: #2563eb;
  font-size: 12px;
  font-weight: 700;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  display: block;
}

.pm-debate-expand:hover {
  color: #1d4ed8;
}

.pm-debate-expand:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.55);
  outline-offset: 2px;
  border-radius: 4px;
}

.pm-debate-text mark {
  background: rgba(250, 204, 21, 0.45);
  border-radius: 2px;
  padding: 0 1px;
}

.pm-debate-link {
  font-size: 11px;
  font-weight: 800;
  color: #334155;
  text-decoration: none;
}

.pm-debate-link:hover {
  color: #2563eb;
  text-decoration: underline;
}

.pm-debate-translate {
  border: 1px solid rgba(37, 99, 235, 0.35);
  border-radius: 6px;
  background: rgba(37, 99, 235, 0.06);
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .14s, border-color .14s;
}

.pm-debate-translate:hover {
  border-color: rgba(29, 78, 216, 0.5);
  background: rgba(29, 78, 216, 0.12);
}

.pm-debate-translate:disabled {
  opacity: 0.55;
  cursor: wait;
}

.pm-debates-footer {
  padding: 10px 16px;
  border-top: 1px solid rgba(226, 232, 240, 0.7);
}

/* ── Amendments panel ─────────────────────────────────────────────────────── */
.pm-amendments-card {
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-top: 3px solid #0f766e;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

.pm-amendments-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  background: linear-gradient(180deg, rgba(240, 253, 250, 0.7) 0%, rgba(255, 255, 255, 0) 100%);
}

.pm-amendments-head-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pm-amendments-head-left h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
}

.pm-amendments-count {
  font-size: 11px;
  font-weight: 700;
  color: #0f766e;
  background: rgba(15, 118, 110, 0.08);
  border: 1px solid rgba(15, 118, 110, 0.25);
  border-radius: 999px;
  padding: 2px 8px;
}

.pm-amendments-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pm-amendments-input {
  width: 260px;
}

.pm-amendments-input--sm {
  width: 190px;
}

.pm-amendments-label-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 16px 4px;
}

.pm-amendments-label-chip {
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 999px;
  background: #fff;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  cursor: pointer;
}

.pm-amendments-label-chip.active,
.pm-amendments-label-chip:hover {
  color: #0f766e;
  border-color: rgba(15, 118, 110, 0.42);
  background: rgba(15, 118, 110, 0.1);
}

.pm-amendments-grid {
  display: grid;
  grid-template-columns: minmax(220px, 31%) minmax(0, 1fr);
  gap: 0;
  border-top: 1px solid rgba(226, 232, 240, 0.7);
  align-items: stretch;
  min-height: 620px;
  max-height: 620px;
}

.pm-amendments-list {
  border-right: 1px solid rgba(226, 232, 240, 0.9);
  max-height: none;
  height: 100%;
  overflow: auto;
  padding: 8px;
  display: grid;
  gap: 7px;
  background: rgba(248, 250, 252, 0.66);
  scroll-behavior: smooth;
}

.pm-amendment-list-item {
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 10px;
  background: #fff;
  padding: 8px 9px;
  cursor: pointer;
  display: grid;
  gap: 5px;
}

.pm-amendment-list-item:hover {
  border-color: rgba(15, 118, 110, 0.32);
}

.pm-amendment-list-item.is-active {
  border-color: rgba(15, 118, 110, 0.52);
  box-shadow: 0 5px 14px rgba(15, 118, 110, 0.1);
}

.pm-amendment-list-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 10.5px;
}

.pm-amendment-list-date {
  color: #2563eb;
  font-weight: 800;
}

.pm-amendment-list-seq {
  color: #475569;
  font-weight: 700;
}

.pm-amendment-list-ref {
  font-size: 11px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.28;
}

.pm-amendment-list-dossier {
  font-size: 10.5px;
  font-weight: 500;
  color: #64748b;
  line-height: 1.28;
}

.pm-amendment-list-committee {
  font-size: 10.5px;
  font-weight: 700;
  color: #0f766e;
}

.pm-amendment-list-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pm-amendment-mini-chip {
  font-size: 9.5px;
  font-weight: 600;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 999px;
  padding: 1px 7px;
  color: #475569;
  background: rgba(248, 250, 252, 0.9);
}

/* Semantic chip colours by topic */
.pm-amendment-mini-chip--environment,
.pm-amendment-mini-chip--climate,
.pm-amendment-mini-chip--energy { color: #166534; background: rgba(220, 252, 231, 0.8); border-color: rgba(134, 239, 172, 0.5); }
.pm-amendment-mini-chip--fisheries,
.pm-amendment-mini-chip--agriculture { color: #1e40af; background: rgba(219, 234, 254, 0.8); border-color: rgba(147, 197, 253, 0.5); }
.pm-amendment-mini-chip--budget,
.pm-amendment-mini-chip--finance,
.pm-amendment-mini-chip--budget-discharge { color: #92400e; background: rgba(254, 243, 199, 0.8); border-color: rgba(252, 211, 77, 0.5); }
.pm-amendment-mini-chip--migration,
.pm-amendment-mini-chip--rule-of-law { color: #7c2d12; background: rgba(255, 237, 213, 0.8); border-color: rgba(253, 186, 116, 0.5); }
.pm-amendment-mini-chip--digital,
.pm-amendment-mini-chip--AI { color: #4c1d95; background: rgba(237, 233, 254, 0.8); border-color: rgba(196, 181, 253, 0.5); }
.pm-amendment-mini-chip--defense,
.pm-amendment-mini-chip--foreign-policy { color: #1e3a5f; background: rgba(219, 234, 254, 0.7); border-color: rgba(147, 197, 253, 0.4); }
.pm-amendment-mini-chip--health,
.pm-amendment-mini-chip--social,
.pm-amendment-mini-chip--labour { color: #9d174d; background: rgba(252, 231, 243, 0.8); border-color: rgba(249, 168, 212, 0.5); }
.pm-amendment-mini-chip--own-initiative,
.pm-amendment-mini-chip--codecision,
.pm-amendment-mini-chip--non-legislative { color: #374151; background: rgba(243, 244, 246, 0.9); border-color: rgba(209, 213, 219, 0.6); }

.pm-amendment-detail {
  padding: 12px 14px;
  display: grid;
  gap: 10px;
  height: 100%;
  overflow: auto;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(249, 252, 255, 0.9) 100%);
  scroll-behavior: smooth;
}

.pm-amendment-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.pm-amendment-detail-title {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
}

.pm-amendment-detail-ref {
  font-weight: 700;
  color: #475569;
  font-size: 12px;
}

.pm-amendment-detail-dossier {
  font-size: 12px;
  color: #475569;
  line-height: 1.38;
}

.pm-amendment-source {
  font-size: 11px;
  font-weight: 700;
  color: #2563eb;
  text-decoration: none;
}

.pm-amendment-source:hover {
  text-decoration: underline;
}

.pm-amendment-diff-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 10px;
  overflow: hidden;
  min-height: 370px;
  max-height: 430px;
  background: #fff;
}

.pm-amendment-diff-col {
  display: grid;
  grid-template-rows: auto 1fr;
  font-size: 12.7px;
  line-height: 1.6;
  background: #fff;
  min-height: 0;
}

.pm-amendment-diff-col--old {
  border-right: 1px solid rgba(226, 232, 240, 0.9);
}

.pm-amendment-diff-col-header {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 6px 12px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}

.pm-amendment-diff-col-header--old {
  color: #b91c1c;
  background: rgba(254, 242, 242, 0.8);
}

.pm-amendment-diff-col-header--new {
  color: #15803d;
  background: rgba(240, 253, 244, 0.8);
}

.pm-amendment-diff-col-body {
  padding: 10px 11px;
  white-space: pre-wrap;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
}

.pm-amendment-diff-del {
  background: #fecaca;
  border-radius: 2px;
  padding: 0 1px;
}

.pm-amendment-diff-ins {
  background: #bbf7d0;
  border-radius: 2px;
  padding: 0 1px;
}

.pm-amendment-legislators-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pm-amendment-legislators-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #64748b;
}

.pm-amendment-legislators-count {
  font-size: 11px;
  font-weight: 700;
  color: #0f766e;
  background: rgba(15, 118, 110, 0.08);
  border: 1px solid rgba(15, 118, 110, 0.22);
  border-radius: 999px;
  padding: 1px 7px;
}

.pm-amendment-cosigners {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pm-amendment-cosigner-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(148, 163, 184, 0.27);
  border-radius: 999px;
  padding: 3px 8px;
  background: rgba(255, 255, 255, 0.96);
  max-width: 100%;
}

.pm-amendment-cosigner-name {
  font-size: 10.5px;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
}

.pm-amendment-cosigner-meta {
  font-size: 10px;
  color: #64748b;
  white-space: nowrap;
}

.pm-amendment-cosigners-toggle {
  justify-self: start;
  border: 1px solid rgba(15, 118, 110, 0.3);
  border-radius: 999px;
  background: rgba(240, 253, 250, 0.88);
  color: #0f766e;
  font-size: 10.5px;
  font-weight: 700;
  padding: 4px 10px;
  cursor: pointer;
}

.pm-amendment-cosigners-toggle:hover {
  background: rgba(204, 251, 241, 0.94);
}

.pm-amendments-footer {
  padding: 10px 16px;
  border-top: 1px solid rgba(226, 232, 240, 0.7);
}

@media (max-width: 680px) {
  .pm-debates-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .pm-debates-topic-input {
    width: min(100%, 360px);
  }
  .pm-debates-controls {
    width: 100%;
    gap: 8px;
  }
  .pm-debates-controls .control-btn {
    flex: 0 0 auto;
  }
  .pm-debates-controls .pm-debates-translate-btn {
    order: 3;
  }
  .pm-debates-toggle {
    order: 2;
  }
  .pm-debate-item {
    padding: 11px;
  }
  .pm-debate-item-head {
    flex-direction: column;
    align-items: stretch;
  }
  .pm-debate-actions {
    justify-content: flex-start;
  }
  .pm-debate-text {
    font-size: 12px;
    line-height: 1.62;
  }
  .pm-debates-sparkline-wrap {
    height: 44px;
  }
  .pm-debates-list {
    max-height: 500px;
  }
  .pm-debates-chip-group {
    align-items: flex-start;
  }
  .pm-debates-chip-label {
    width: 100%;
  }

  .pm-amendments-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .pm-amendments-controls {
    width: 100%;
  }

  .pm-amendments-input,
  .pm-amendments-input--sm {
    width: min(100%, 360px);
  }

  .pm-amendments-grid {
    grid-template-columns: 1fr;
    max-height: none;
    min-height: 0;
  }

  .pm-amendments-list {
    border-right: 0;
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
    max-height: 280px;
    height: auto;
  }

  .pm-amendment-detail {
    max-height: none;
    overflow: visible;
  }

  .pm-amendment-diff-grid {
    grid-template-columns: 1fr;
    max-height: none;
    min-height: 0;
  }

  .pm-amendment-diff-col--old {
    border-right: 0;
    border-bottom: 1px solid rgba(226, 232, 240, 0.95);
  }
}

.pm-profile-drill-head {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.pm-profile-drill-head h3 {
  margin: 0;
  font-size: 13px;
}

.pm-profile-drill-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pm-profile-drill-controls .search-input {
  min-width: 260px;
}

.cp-tool--modern {
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.74);
  padding: 12px;
}

.chart-card--modern {
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  box-shadow: none;
}

.chart-card__header {
  margin-bottom: 8px;
}

.chart-card__header h3 {
  margin: 0;
}

.tm-panel {
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 18px;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.96) 0%, rgba(247, 251, 255, 0.92) 100%);
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.09), inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.tm-panel .chart-card {
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

.tm-header {
  border-bottom: 1px solid rgba(226, 232, 240, 0.92);
  padding-bottom: 12px;
}

.tm-kpi-cell,
.tm-filter-card,
.tm-cluster-card,
.tm-context-card,
.tm-drill-detail {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.97) 0%, rgba(249, 251, 255, 0.98) 100%);
}

.tm-filter-card h3,
.tm-section-head h3 {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.tm-state-item,
.tm-topic-chip,
.tm-state-apply,
.tm-drill-table-wrap,
.tm-drill-detail {
  border-radius: 10px;
}

@media (max-width: 1180px) {
  .topbar.topbar--glass {
    min-height: 0;
    gap: 10px;
    align-items: flex-start;
    padding-bottom: 12px;
  }

  .topbar--glass .topbar-brand,
  .topbar--glass .topbar-actions,
  .topbar--glass .topbar-nav {
    width: 100%;
  }

  .hero-panel {
    grid-template-columns: 1fr;
  }

  .list-controls--modern {
    grid-template-columns: 1fr;
  }

  .pm-directory-actions {
    justify-content: space-between;
  }

  .pm-list-row {
    grid-template-columns: minmax(220px, 1.2fr) repeat(2, minmax(92px, 0.62fr)) minmax(90px, 0.56fr) auto;
  }

  .pm-list-head {
    grid-template-columns: minmax(220px, 1.2fr) repeat(2, minmax(92px, 0.62fr)) minmax(90px, 0.56fr) auto;
  }

  .pm-list-row .pm-list-stat:nth-of-type(3) {
    display: none;
  }

  .pm-list-head .pm-list-head-cell:nth-of-type(4) {
    display: none;
  }

  .pm-kpi-strip--modern {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .pm-profile-history,
  .pm-profile-top-grid,
  .pm-profile-workstream-card,
  .pm-profile-kpi-grid,
  .pm-profile-charts-grid,
  .pm-profile-context-grid {
    grid-template-columns: 1fr;
  }

  .pm-profile-phone-grid,
  .pm-profile-offices-grid {
    grid-template-columns: 1fr;
  }

  .pm-profile-contact-card {
    max-height: none;
  }
}

@media (max-width: 760px) {
  body[data-page="graph"] .app-content {
    padding-left: 0;
    padding-right: 0;
  }

  /* .explorer-shell min-height/height removed: identical to, and always
     beaten by, the unconditional consolidated rule (~line 6812). */

  .topbar.topbar--glass {
    padding: 8px 10px 9px;
    gap: 8px;
  }

  .topbar--glass .topbar-brand {
    width: auto;
    max-width: 46%;
  }

  .topbar--glass .topbar-actions {
    width: auto;
    flex: 1;
    min-width: 0;
    justify-content: flex-end;
  }

  .topbar--glass .topbar-nav {
    order: 2;
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    padding-bottom: 2px;
  }

  .topbar--glass .topbar-nav::-webkit-scrollbar {
    display: none;
  }

  .topbar--glass .nav-pill {
    min-height: 36px;
    padding: 8px 11px;
    white-space: nowrap;
  }

  .hero-panel__title {
    font-size: 30px;
  }

  .hero-panel__text {
    font-size: 15px;
  }

  .pm-kpi-strip--modern {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pm-mcard-metrics {
    grid-template-columns: 1fr;
  }

  .pm-list-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .pm-list-head {
    display: none;
  }

  .pm-list-main {
    align-items: flex-start;
  }

  .pm-list-row .pm-list-stat {
    grid-template-columns: auto auto;
    align-items: center;
    justify-content: space-between;
    border: 1px solid rgba(203, 213, 225, 0.7);
    border-radius: 9px;
    padding: 8px 10px;
    background: #fff;
  }

  .pm-list-row .pm-list-stat:nth-of-type(3) {
    display: grid;
  }

  .pm-list-group-pill {
    justify-self: flex-start;
  }

  .pm-list-open {
    width: 100%;
  }

  .cp-search-row,
  .cp-personal-grid,
  .cp-context-grid,
  .cp-charts-grid,
  .cp-divergence-grid,
  .tm-kpi-strip {
    grid-template-columns: 1fr;
  }

  .pm-profile-actions {
    width: 100%;
  }

  .pm-profile-actions .control-btn {
    flex: 1 1 calc(50% - 6px);
  }

  .pm-profile-drill-controls .search-input {
    min-width: 0;
    width: 100%;
  }

  .pm-profile-email-row {
    flex-wrap: wrap;
    align-items: flex-start;
  }

.pm-profile-copy-btn {
  margin-left: auto;
}
}

/* ── Graph viewport frame stabilization (desktop) ───────────────────── */

body[data-page="graph"] .sigma-stage-frame {
  flex: 1;
  min-height: 0;
  min-width: 0;
  display: flex;
  align-items: stretch;
  justify-content: center;
}

body[data-page="graph"] .sigma-stage-frame .sigma-shell {
  width: 100%;
  height: 100%;
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  margin: 0;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 14px;
  box-shadow: 0 16px 34px rgba(2, 6, 23, 0.26);
  overflow: hidden;
  background: linear-gradient(180deg, rgba(4, 11, 22, 0.06) 0%, rgba(4, 11, 22, 0.16) 100%);
}

@media (max-width: 1100px) {
  body[data-page="graph"] #explorerPanelSigma {
    padding: 8px;
  }

  body[data-page="graph"] .sigma-stage-frame .sigma-shell {
    height: 100%;
    border-radius: 12px;
  }
}

/* Keep overlay controls always inside visible canvas */
body[data-page="graph"] .sg-zoom-controls {
  right: 12px;
  bottom: 72px;
  z-index: 32;
}
body[data-page="graph"] .sg-legend {
  bottom: 10px;
}
body[data-page="graph"] .sg-axis-label {
  bottom: 10px;
}

@media (max-width: 900px) {
  body[data-page="graph"] #explorerPanelSigma {
    padding: 0;
  }

  body[data-page="graph"] .sigma-stage-frame .sigma-shell {
    width: 100%;
    height: 100%;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    box-shadow: none;
  }
}

/* ── Unified topbar mobile menu + landing public page ───────────────────── */
.topbar-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  background: rgba(15, 23, 42, 0.26);
  color: #e2e8f0;
  cursor: pointer;
  flex-shrink: 0;
}

.topbar-menu-toggle:hover {
  border-color: rgba(96, 165, 250, 0.56);
  background: rgba(30, 64, 175, 0.32);
}

.topbar-menu-toggle__line {
  width: 15px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

/* Landing page */
body[data-page="landing-public"] {
  position: relative;
  overflow-x: hidden;
  background:
    radial-gradient(980px 420px at 94% -20%, rgba(37, 99, 235, 0.14), transparent 66%),
    radial-gradient(860px 360px at -8% -12%, rgba(56, 189, 248, 0.12), transparent 68%),
    linear-gradient(180deg, #f8fbff 0%, #edf3fb 50%, #eef3fa 100%);
}

body[data-page="landing-public"] .app-main {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body[data-page="landing-public"] .app-content.landing-page {
  padding-top: 76px;
  padding-bottom: 0;
}

body[data-page="landing-public"]::before,
body[data-page="landing-public"]::after {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: 0;
}

body[data-page="landing-public"]::before {
  width: min(40vw, 520px);
  height: min(40vw, 520px);
  right: -12vw;
  top: 88px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.14) 0%, rgba(56, 189, 248, 0.04) 46%, transparent 74%);
  filter: blur(6px);
}

body[data-page="landing-public"]::after {
  width: min(36vw, 460px);
  height: min(36vw, 460px);
  left: -14vw;
  bottom: -18vh;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.11) 0%, rgba(37, 99, 235, 0.03) 52%, transparent 75%);
  filter: blur(6px);
}

body[data-page="landing-public"] .topbar.topbar--landing {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 500;
  min-height: 72px;
  padding: 12px 20px;
  border-bottom: 1px solid rgba(203, 213, 225, 0.8);
  background: rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 14px rgba(15, 23, 42, 0.06);
}

body[data-page="landing-public"] .topbar--landing .brand-link {
  color: #0f172a;
  flex-shrink: 0;
}

body[data-page="landing-public"] .topbar--landing .brand-kicker {
  color: #2563eb;
}

body[data-page="landing-public"] .topbar--landing .topbar-title {
  color: #334155;
}

body[data-page="landing-public"] .topbar--landing .topbar-nav {
  gap: 6px;
  flex-wrap: nowrap;
  margin-left: 0;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  justify-content: center;
  scrollbar-width: none;
  padding-bottom: 2px;
}

body[data-page="landing-public"] .topbar--landing .topbar-nav::-webkit-scrollbar {
  display: none;
}

body[data-page="landing-public"] .topbar--landing .nav-pill {
  color: #334155;
  border: 1px solid transparent;
  background: transparent;
  min-height: 36px;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

body[data-page="landing-public"] .topbar--landing .nav-pill:hover {
  background: #f1f5f9;
  border-color: rgba(148, 163, 184, 0.28);
  color: #0f172a;
}

body[data-page="landing-public"] .topbar--landing .nav-pill.active {
  color: #1e40af;
  border-color: rgba(96, 165, 250, 0.42);
  background: rgba(59, 130, 246, 0.1);
}

body[data-page="landing-public"] .topbar--landing .control-btn {
  min-height: 36px;
  border-radius: 10px;
}

body[data-page="landing-public"] .topbar--landing .topbar-actions {
  flex-wrap: nowrap;
  margin-left: 8px;
  flex: 0 0 auto;
}

body[data-page="landing-public"] .topbar--landing .topbar-menu-toggle {
  border-color: rgba(148, 163, 184, 0.4);
  background: #f8fafc;
  color: #334155;
}

body[data-page="landing-public"] .topbar--landing .topbar-menu-toggle:hover {
  border-color: rgba(59, 130, 246, 0.5);
  color: #1d4ed8;
  background: #eef4ff;
}

body[data-page="landing-public"] .topbar--landing .topbar-brand {
  gap: 12px;
  flex: 0 0 auto;
  min-width: 0;
}

.landing-topbar-rotator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  border: 1px solid rgba(96, 165, 250, 0.28);
  border-radius: 999px;
  padding: 5px 10px;
  background: rgba(59, 130, 246, 0.08);
  color: #1d4ed8;
  flex-shrink: 0;
}

.landing-topbar-rotator-prefix {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #1d4ed8;
  opacity: 0.9;
}

.landing-topbar-rotator-window {
  height: 18px;
  overflow: hidden;
  width: clamp(156px, 12vw, 212px);
}

.landing-topbar-rotator-list {
  margin: 0;
  padding: 0;
  list-style: none;
  transition: transform 0.62s cubic-bezier(0.22, 1, 0.36, 1);
}

.landing-topbar-rotator-list li {
  height: 18px;
  display: flex;
  align-items: center;
  font-size: 12px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

body[data-page="landing-public"] .topbar--landing.compact-nav .landing-topbar-rotator {
  display: none;
}


body[data-page="landing-public"] .topbar--landing.compact-nav .topbar-nav {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 10px;
  right: 10px;
  z-index: 410;
  flex-direction: column;
  gap: 4px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(203, 213, 225, 0.92);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 16px 30px rgba(2, 6, 23, 0.14);
  overflow-y: auto;
  max-height: calc(100dvh - 140px);
}

body[data-page="landing-public"] .topbar--landing.compact-nav.menu-open .topbar-nav {
  display: flex;
}


body[data-page="landing-public"] .topbar--landing.compact-nav .topbar-actions {
  margin-left: auto;
}

body[data-page="landing-public"] .topbar--landing .topbar-menu-toggle,
body[data-page="landing-public"] .topbar--landing.compact-nav .topbar-menu-toggle {
  display: none !important;
}

body[data-page="landing-public"] .topbar--landing.compact-nav .topbar-nav {
  display: flex !important;
  position: static;
  top: auto;
  left: auto;
  right: auto;
  flex-direction: row;
  gap: 6px;
  padding: 0 0 2px;
  border: none;
  background: transparent;
  box-shadow: none;
  max-height: none;
  overflow-y: hidden;
}

body[data-page="landing-public"] .topbar--landing.compact-nav .nav-pill {
  width: auto;
  justify-content: center;
  min-height: 36px;
  border-radius: 999px;
  padding: 7px 12px;
}

.landing-wrap {
  max-width: 1280px;
  margin: 0 auto;
}

.landing-hero-lite {
  position: relative;
  min-height: 78vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: linear-gradient(138deg, rgba(255, 255, 255, 0.88) 0%, rgba(245, 250, 255, 0.92) 100%);
  border-bottom: 1px solid rgba(203, 213, 225, 0.55);
}

.landing-hero-lite .landing-wrap {
  position: relative;
  z-index: 2;
  padding: 36px 20px 20px;
  text-align: center;
}

.landing-watermark {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  width: 100%;
  padding: 3% 1vw;
  text-align: center;
  font-size: clamp(60px, 10.5vw, 158px);
  line-height: 0.88;
  font-weight: 800;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  color: #c8d9f7;
  -webkit-user-select: none;
  user-select: none;
  pointer-events: none;
  z-index: 1;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.85) 22%, rgba(0,0,0,0.85) 78%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.85) 22%, rgba(0,0,0,0.85) 78%, transparent 100%);
}

.landing-watermark span {
  display: flex;
  width: 100%;
  white-space: nowrap;
}

.landing-watermark span:first-child {
  justify-content: flex-start;
  transform: translateX(-1.8vw);
}

.landing-watermark span:last-child {
  justify-content: flex-end;
  transform: translateX(1.4vw);
}

.landing-hero-copy {
  position: relative;
  z-index: 3;
  max-width: 980px;
  margin: 0 auto;
  display: grid;
  justify-items: center;
  gap: 4px;
}

.landing-product-title {
  margin-top: 2px;
  font-size: clamp(38px, 5vw, 72px);
  line-height: 0.94;
  letter-spacing: -0.036em;
  font-weight: 800;
  color: #0f172a;
}

.landing-title {
  margin: 4px auto 10px;
  font-size: clamp(24px, 2.5vw, 36px);
  line-height: 1.12;
  letter-spacing: -0.022em;
  color: #0f172a;
  max-width: 24ch;
  font-weight: 700;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}

.landing-title span {
  color: #1d4ed8;
  display: inline;
}

.landing-subtitle {
  margin: 0 auto;
  color: #334155;
  font-size: clamp(13px, 0.95vw, 16px);
  line-height: 1.52;
  max-width: 860px;
}

.landing-cta-row {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.landing-cta-row .upload-btn {
  min-height: 42px;
  padding: 9px 16px;
  font-size: 15px;
  border-radius: 10px;
}

.landing-cta-row .upload-btn.primary {
  background: #1d4ed8;
  box-shadow: 0 2px 10px rgba(29, 78, 216, 0.28);
}

.landing-cta-row .upload-btn.primary:hover {
  background: #1e40af;
  box-shadow: 0 4px 16px rgba(29, 78, 216, 0.38);
  transform: translateY(-1px);
}

.landing-meta {
  margin-top: 10px;
  color: #64748b;
  font-size: 12.5px;
  line-height: 1.5;
}

.landing-scroll-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  margin-top: 10px;
  text-decoration: none;
  font-size: 28px;
  line-height: 1;
  color: rgba(71, 85, 105, 0.9);
  animation: landingBounce 1.8s ease-in-out infinite;
}

.landing-offer-section {
  padding: 70px 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(250, 252, 255, 0.98) 100%);
}

.landing-offer-title-wrap,
.landing-feature-header,
.landing-auth-copy {
  text-align: center;
  margin-bottom: 18px;
}

.landing-offer-title-wrap h2 {
  margin: 0 0 8px;
  font-size: clamp(28px, 2.8vw, 40px) !important;
  letter-spacing: -0.03em;
  color: #1e66c6;
  border-bottom: 0 !important;
  padding-bottom: 0 !important;
}

.landing-offer-title-wrap p {
  margin: 0;
  font-size: 16px;
  color: #64748b;
  max-width: 980px;
  margin-left: auto;
  margin-right: auto;
}

.landing-offer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.landing-offer-card {
  border: 1px solid rgba(203, 213, 225, 0.48);
  border-radius: 16px;
  padding: 28px 22px 24px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 251, 255, 0.88) 100%);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  transition: box-shadow .22s ease, transform .22s ease, border-color .22s ease;
  text-align: center;
}

.landing-offer-card:hover {
  transform: translateY(-2px);
  border-color: rgba(96, 165, 250, 0.32);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07);
}

.landing-offer-step {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 800;
  color: #1d4ed8;
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.9) 0%, rgba(219, 234, 254, 0.7) 100%);
  border: 2px solid rgba(96, 165, 250, 0.38);
  box-shadow: 0 2px 8px rgba(29, 78, 216, 0.1);
  letter-spacing: -0.02em;
}

.landing-offer-card h3 {
  margin: 0 0 10px;
  font-size: 20px;
  letter-spacing: -0.02em;
  font-weight: 700;
  color: #0f172a;
}

.landing-offer-card p {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.56;
  color: #475569;
}

.landing-module-section {
  padding: 70px 0;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.94) 0%, rgba(250, 252, 255, 0.98) 100%);
  border-top: 1px solid rgba(226, 232, 240, 0.45);
  border-bottom: 1px solid rgba(226, 232, 240, 0.45);
}

.landing-feature-header h2 {
  margin: 0 0 8px;
  font-size: clamp(26px, 2.6vw, 36px) !important;
  letter-spacing: -0.03em;
  color: #1e66c6;
  border-bottom: 0 !important;
  padding-bottom: 0 !important;
}

.landing-feature-header p {
  margin: 0;
  font-size: 16px;
  color: #64748b;
  max-width: 980px;
  margin-left: auto;
  margin-right: auto;
}

.landing-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.landing-feature-card {
  border: 1px solid rgba(203, 213, 225, 0.45);
  border-left-width: 3px;
  border-radius: 12px;
  padding: 18px 16px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
  transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}

.landing-feature-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

/* Per-module accent colour on left border */
.landing-feature-card:nth-child(1) { border-left-color: #3b82f6; }
.landing-feature-card:nth-child(2) { border-left-color: #8b5cf6; }
.landing-feature-card:nth-child(3) { border-left-color: #10b981; }
.landing-feature-card:nth-child(4) { border-left-color: #f59e0b; }
.landing-feature-card:nth-child(5) { border-left-color: #14b8a6; }
.landing-feature-card:nth-child(6) { border-left-color: #ec4899; }

.landing-feature-card h3 {
  margin: 0 0 8px;
  font-size: 16px;
  letter-spacing: -0.01em;
  font-weight: 700;
  color: #0f172a;
}

.landing-feature-card p {
  margin: 0;
  font-size: 13.5px;
  color: #64748b;
  line-height: 1.54;
}

.landing-login-section {
  padding: 70px 0 74px;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.9) 0%, rgba(250, 252, 255, 0.96) 100%);
}

body[data-page="landing-public"] .landing-page section[id] {
  scroll-margin-top: 92px;
}

@media (max-width: 1180px) {
  body[data-page="landing-public"] .topbar.topbar--landing {
    min-height: 72px;
    gap: 10px;
    align-items: center;
    padding-bottom: 10px;
  }

  body[data-page="landing-public"] .topbar--landing .topbar-brand,
  body[data-page="landing-public"] .topbar--landing .topbar-actions,
  body[data-page="landing-public"] .topbar--landing .topbar-nav {
    width: auto;
  }

  body[data-page="landing-public"] .topbar--landing .topbar-nav {
    flex: 1 1 auto;
    justify-content: center;
  }

  body[data-page="landing-public"] .topbar--landing .topbar-actions {
    margin-left: 0;
  }
}

.landing-login-section .landing-wrap {
  max-width: 920px;
}

.landing-auth-copy h2 {
  margin: 0 0 8px;
  font-size: clamp(28px, 2.8vw, 38px) !important;
  letter-spacing: -0.03em;
  color: #1e66c6;
  border-bottom: 0 !important;
  padding-bottom: 0 !important;
}

.landing-auth-copy p {
  margin: 0;
  font-size: 16px;
  color: #64748b;
  line-height: 1.52;
  max-width: 920px;
  margin-left: auto;
  margin-right: auto;
}

.landing-login-card {
  margin: 18px auto 0;
  border: 1px solid rgba(203, 213, 225, 0.56);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  padding: 24px 22px 20px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.07), 0 1px 3px rgba(15, 23, 42, 0.04);
  max-width: 430px;
  width: 100%;
}

.landing-login-card h3,
.landing-login-card h2 {
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #0f172a;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

.landing-login-card label {
  display: block;
  margin: 14px 0 5px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #475569;
  font-weight: 700;
}

.landing-login-card input {
  width: 100%;
  border-radius: 9px;
  border: 1px solid rgba(148, 163, 184, 0.42);
  background: #fff;
  color: #0f172a;
  padding: 11px 13px;
  outline: none;
  font-size: 15px;
  transition: border-color .15s, box-shadow .15s;
}

.landing-login-card input:focus {
  border-color: rgba(59, 130, 246, 0.72);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.14);
}

.landing-login-card .upload-btn {
  margin-top: 16px;
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  font-size: 15px;
  font-weight: 700;
}

.landing-login-error {
  margin-top: 10px;
  padding: 8px 9px;
  border-radius: 9px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #b91c1c;
  font-size: 13px;
  display: none;
}

.landing-login-error.visible {
  display: block;
}

.landing-footer {
  background: #ffffff;
  border-top: 1px solid rgba(226, 232, 240, 0.9);
  padding: 36px 0 40px;
}

.landing-footer p {
  margin: 0;
  text-align: center;
  color: #64748b;
  font-size: 13.5px;
}

.landing-footer-copy {
  max-width: 980px;
  margin: 0 auto;
  text-align: center;
  display: grid;
  gap: 0;
}

.landing-footer-copy h3 {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.landing-footer-copy p {
  margin: 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.6;
}

.landing-footer-copy p + p {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(226, 232, 240, 0.7);
}

.landing-footer-copy a {
  color: #1d4ed8;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 600;
}

.policy-page {
  padding-top: 30px;
  padding-bottom: 56px;
  background: #f4f7fc;
}

.policy-wrap {
  max-width: 980px;
}

.policy-hero {
  border: 1px solid rgba(203, 213, 225, 0.9);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
  padding: 20px 22px;
  display: grid;
  gap: 10px;
}

.policy-kicker {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-weight: 700;
  color: #1d4ed8;
  border: 1px solid rgba(147, 197, 253, 0.9);
  background: rgba(239, 246, 255, 0.9);
  border-radius: 999px;
  padding: 4px 10px;
}

.policy-hero h1 {
  margin: 0;
  font-size: clamp(30px, 3vw, 40px);
  letter-spacing: -0.03em;
  line-height: 1.08;
  color: #0f172a;
  border: none !important;
  padding: 0 !important;
}

.policy-hero p {
  margin: 0;
  font-size: 15px;
  line-height: 1.58;
  color: #475569;
}

.policy-toc {
  margin-top: 12px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.8);
  padding: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.policy-toc a {
  text-decoration: none;
  color: #334155;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid rgba(203, 213, 225, 0.8);
  border-radius: 999px;
  background: #f8fafc;
  padding: 6px 10px;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.policy-toc a:hover {
  border-color: rgba(59, 130, 246, 0.55);
  color: #1d4ed8;
  background: #eff6ff;
}

.policy-shell {
  margin-top: 14px;
  border: 1px solid rgba(203, 213, 225, 0.78);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

.policy-section {
  padding: 20px 22px;
  border-top: 1px solid rgba(226, 232, 240, 0.82);
  scroll-margin-top: 90px;
}

.policy-section:first-child {
  border-top: none;
}

.policy-section h2 {
  margin: 0 0 8px;
  font-size: 21px;
  letter-spacing: -0.02em;
  color: #0f172a;
  border: none !important;
  padding: 0 !important;
}

.policy-section p {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.66;
  color: #475569;
}

.policy-section ul {
  margin: 0 0 10px;
  padding-left: 18px;
  display: grid;
  gap: 6px;
}

.policy-section li {
  font-size: 14px;
  line-height: 1.62;
  color: #475569;
}

.policy-section a {
  color: #1d4ed8;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 600;
}

@keyframes landingBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(5px); }
}

@media (max-width: 1360px) {
  .landing-topbar-rotator {
    display: none;
  }
}

@media (max-width: 1024px) {
  .landing-topbar-rotator {
    display: none;
  }

  .landing-offer-grid,
  .landing-feature-grid {
    grid-template-columns: 1fr 1fr;
  }

  .landing-offer-card h3,
  .landing-feature-card h3 {
    font-size: 19px;
  }

  .landing-offer-card p,
  .landing-feature-card p,
  .landing-feature-header p,
  .landing-offer-title-wrap p,
  .landing-auth-copy p {
    font-size: 15px;
  }

  .policy-section h2 {
    font-size: 18px;
  }

  .policy-toc a {
    font-size: 11.5px;
  }
}

@media (max-width: 760px) {
  body[data-page="parliament-members"] .app-shell > .app-main,
  body[data-page="topics-mandates"] .app-content,
  body[data-page="dataset"] .app-content,
  body[data-page="intel"] .app-content,
  body[data-page="graph"] .app-content,
  body[data-page="news"] .app-content {
    padding-top: 86px;
    overflow-y: auto;
  }

  body[data-page="landing-public"] .topbar.topbar--landing {
    min-height: 64px;
    padding: 10px;
  }

  .topbar--landing .topbar-brand {
    width: auto;
    min-width: 0;
    flex: 1;
    max-width: calc(100% - 120px);
  }

  .topbar--landing .topbar-actions {
    width: auto;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-left: auto;
  }

  .topbar--landing .landing-topbar-rotator {
    display: none;
  }

  .topbar-menu-toggle {
    display: none !important;
  }

  .topbar--landing .topbar-nav {
    display: flex;
    order: 2;
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    padding-bottom: 2px;
    justify-content: flex-start;
  }

  .topbar--landing .topbar-nav::-webkit-scrollbar {
    display: none;
  }

  .topbar--landing .nav-pill {
    width: auto;
    justify-content: center;
    min-height: 36px;
    border-radius: 999px;
    padding: 8px 11px;
  }

  body[data-page="landing-public"] .app-content.landing-page {
    padding-top: 64px;
  }

  .landing-hero-lite {
    min-height: 70vh;
  }

  .landing-hero-lite .landing-wrap {
    padding: 28px 12px 16px;
  }

  .landing-watermark {
    text-align: left;
    inset: 8% 0 5% 0;
    justify-content: space-around;
    font-size: clamp(26px, 10.2vw, 52px);
    line-height: 0.92;
    color: #dbe6fc;
    padding: 0 8px;
  }

  .landing-watermark span:first-child {
    justify-content: flex-start;
    padding-left: 2vw;
    transform: translateX(-1.2vw);
  }

  .landing-watermark span:last-child {
    justify-content: flex-end;
    padding-right: 2vw;
    transform: translateX(1.2vw);
  }

  .landing-title {
    font-size: clamp(22px, 6.3vw, 32px);
    max-width: 16ch;
  }

  .landing-product-title {
    font-size: clamp(28px, 9vw, 46px);
    line-height: 0.95;
  }

  .landing-subtitle {
    font-size: 14px;
  }

  .landing-cta-row .upload-btn {
    min-height: 42px;
    padding: 9px 14px;
    font-size: 15px;
  }

  .landing-offer-grid,
  .landing-feature-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .landing-offer-section,
  .landing-module-section,
  .landing-login-section {
    padding: 42px 0;
  }

  .landing-offer-title-wrap h2,
  .landing-feature-header h2,
  .landing-auth-copy h2 {
    font-size: clamp(22px, 7vw, 30px) !important;
  }

  .landing-offer-title-wrap p,
  .landing-feature-header p,
  .landing-auth-copy p,
  .landing-offer-card p,
  .landing-feature-card p {
    font-size: 14px;
  }

  .landing-offer-step {
    width: 52px;
    height: 52px;
    font-size: 22px;
    margin-bottom: 10px;
  }

  .landing-offer-card h3,
  .landing-feature-card h3,
  .landing-login-card h3 {
    font-size: 18px;
  }

  .landing-login-card {
    margin-top: 14px;
    padding: 14px;
  }

  body[data-page="landing-public"] #landingLoginLink {
    display: none;
  }

  .policy-page {
    padding-top: 18px;
    padding-bottom: 32px;
  }

  .policy-toc {
    padding: 8px;
    gap: 6px;
  }

  .policy-toc a {
    padding: 5px 9px;
    font-size: 11px;
  }

  .policy-hero,
  .policy-section {
    padding: 14px;
  }

  .policy-hero h1 {
    font-size: 28px;
  }

  .policy-hero p,
  .policy-section p,
  .policy-section li {
    font-size: 13px;
  }
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* Speeches topic buckets */
/* ─────────────────────────────────────────────────────────────────────────── */

.pm-speeches-topic-section {
  margin-top: 4px;
}

.pm-speeches-topic-header {
  margin: 0;
  padding: 7px 2px 6px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.75);
  font-weight: 700;
  color: #1e293b;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pm-speeches-anchor-link {
  color: #94a3b8;
  text-decoration: none;
  font-size: 11px;
  transition: color 0.2s;
}

.pm-speeches-anchor-link:hover {
  color: #2563eb;
}

.pm-speeches-topic-name {
  font-weight: 800;
  color: #0f172a;
}

.pm-speeches-topic-count {
  font-size: 10px;
  font-weight: 700;
  color: #475569;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 999px;
  padding: 1px 7px;
  background: rgba(248, 250, 252, 0.9);
}

.pm-speeches-topic-theme {
  font-size: 10px;
  font-weight: 700;
  color: #6d28d9;
  border: 1px solid rgba(124, 58, 237, 0.25);
  border-radius: 999px;
  background: rgba(245, 243, 255, 0.88);
  padding: 1px 7px;
}

.pm-speeches-topic-full {
  margin: 4px 0 6px 19px;
  font-size: 10.5px;
  color: #64748b;
  line-height: 1.35;
}

.pm-speeches-items {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 6px;
}

.pm-debates-head {
  gap: 12px;
}

.pm-debates-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

#pmDebatesTopicFilter {
  min-width: 260px;
}

@media (max-width: 900px) {
  #pmDebatesTopicFilter {
    min-width: min(100%, 220px);
  }
}

@media (max-width: 420px) {
  .landing-cta-row {
    width: 100%;
    justify-content: stretch;
  }

  .landing-cta-row .upload-btn {
    width: 100%;
  }

  .landing-title {
    max-width: 11.2ch;
  }
}

/* ── Workspace Rebrand Pass (Parliament + Topics + News) ───────────────── */
body[data-page="parliament-members"],
body[data-page="topics-mandates"],
body[data-page="news"] {
  background:
    radial-gradient(1200px 460px at 8% -12%, rgba(37, 99, 235, 0.16), transparent 62%),
    radial-gradient(940px 340px at 94% -10%, rgba(14, 165, 233, 0.14), transparent 66%),
    linear-gradient(180deg, #edf3ff 0%, #f4f7ff 38%, #f3f7fb 100%);
}

/* topics-mandates */
body[data-page="topics-mandates"] .tm-panel {
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 22px;
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.96) 0%, rgba(247, 251, 255, 0.93) 100%);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.84);
  padding: clamp(12px, 2vw, 18px);
  gap: 16px;
}


.tm-header-copy {
  display: grid;
  gap: 7px;
}

.tm-header-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tm-header-pill {
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #1e3a8a;
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.96) 0%, rgba(255, 255, 255, 0.98) 100%);
}


body[data-page="topics-mandates"] .tm-panel .chart-card,
body[data-page="topics-mandates"] .tm-drill-detail,
body[data-page="topics-mandates"] .tm-context-card {
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 251, 255, 0.98) 100%);
}

body[data-page="topics-mandates"] .tm-drill-table-wrap {
  border-radius: 12px;
  max-height: 400px;
}

body[data-page="topics-mandates"] .tm-drill-table th {
  background: rgba(241, 245, 249, 0.94);
}

/* news */
body[data-page="news"].news-reader-open {
  overflow: hidden;
}

body[data-page="news"] .news-workspace {
  width: 100%;
  max-width: 1980px;
  margin: 0 auto;
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
}

.news-hero-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 16px;
  padding: 12px 14px;
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.92) 0%, rgba(30, 64, 175, 0.9) 56%, rgba(14, 116, 144, 0.88) 100%);
  color: #e2e8f0;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.18);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.news-hero-panel::before,
.news-hero-panel::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}
.news-hero-panel::before {
  width: 280px;
  height: 280px;
  right: -80px;
  top: -120px;
  background: radial-gradient(circle, rgba(191, 219, 254, 0.38) 0%, rgba(191, 219, 254, 0) 70%);
}
.news-hero-panel::after {
  width: 220px;
  height: 220px;
  left: 34%;
  bottom: -140px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.25) 0%, rgba(56, 189, 248, 0) 72%);
}

.news-hero-copy h1 {
  margin: 0;
  font-size: clamp(19px, 1.9vw, 26px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: #f8fafc;
}

.news-hero-copy p {
  margin: 5px 0 0;
  max-width: 920px;
  color: rgba(226, 232, 240, 0.95);
}

.news-hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.news-hero-pill {
  border: 1px solid rgba(191, 219, 254, 0.44);
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.16);
  color: #e2e8f0;
}

body[data-page="news"] .news-grid {
  padding: 0;
  max-width: none;
  height: 100%;
  max-height: none;
  min-height: 0;
}

.news-status-pill {
  font-size: 10px;
  padding: 2px 8px;
}

.news-top-action {
  font-size: 11px;
  padding: 4px 10px;
}
#newsMoveModeBtn.is-active {
  color: #0f172a;
  border-color: rgba(37, 99, 235, 0.62);
  background: linear-gradient(180deg, #dbeafe 0%, #bfdbfe 100%);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.24);
}

.news-filter-input {
  width: 160px;
  padding: 5px 9px;
  font-size: 11px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--card);
  color: var(--text);
}

.news-filter-input:focus {
  border-color: var(--il-blue);
  outline: none;
}

body[data-page="news"] .np {
  position: relative;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 251, 255, 0.98) 100%);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
}
body[data-page="news"] .np::before {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(59, 130, 246, 0), rgba(59, 130, 246, 0.55), rgba(59, 130, 246, 0));
  opacity: 0.4;
  pointer-events: none;
}


.np-drag-handle {
  font-size: 11px;
  line-height: 1;
  color: rgba(226, 232, 240, 0.9);
  border: 1px solid rgba(191, 219, 254, 0.35);
  border-radius: 6px;
  padding: 1px 5px;
  user-select: none;
  opacity: 0.42;
  transition: opacity .15s ease, transform .15s ease, border-color .15s ease;
}

.np[data-panel-key][draggable="true"] .np-header {
  cursor: grab;
}
.news-grid.is-move-mode .np-drag-handle {
  opacity: 1;
  border-color: rgba(147, 197, 253, 0.75);
}
.news-grid.is-move-mode .np[data-panel-key] {
  border-color: rgba(59, 130, 246, 0.52);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.22), 0 14px 28px rgba(15, 23, 42, 0.12);
}
.news-grid.is-move-mode .np[data-panel-key][draggable="true"] .np-header:hover .np-drag-handle {
  transform: translateY(-1px);
}

.np[data-panel-key][draggable="true"] .np-header:active {
  cursor: grabbing;
}

.np--dragging {
  opacity: 0.6;
  transform: scale(0.995);
}

.np--drop-target {
  border-color: rgba(37, 99, 235, 0.7) !important;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.18), 0 18px 30px rgba(37, 99, 235, 0.14);
}

.np-btn--mini {
  padding: 2px 8px;
  font-size: 10px;
}

.np-btn--header {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.32);
}

.np-btn--header:hover,
.np-btn--header:focus-visible {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.52);
  background: rgba(255, 255, 255, 0.16);
}

.news-reader-overlay {
  position: fixed;
  inset: 0;
  z-index: 2600;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity .18s ease, visibility .18s ease;
}


.news-reader-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.62);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.news-reader-modal {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100vw - 26px));
  max-height: min(88vh, 980px);
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.97) 0%, rgba(246, 250, 255, 0.98) 100%);
  box-shadow: 0 36px 70px rgba(2, 6, 23, 0.38);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  transform: translateY(0) scale(1);
  transition: transform .22s ease;
}
.news-reader-overlay.is-hidden .news-reader-modal {
  transform: translateY(10px) scale(.988);
}

.news-reader-modal-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 14px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  background: linear-gradient(120deg, rgba(15, 23, 42, 0.96) 0%, rgba(30, 64, 175, 0.92) 100%);
  color: #e2e8f0;
}

.news-reader-modal-copy h2 {
  margin: 0;
  font-size: 19px;
}

.news-reader-modal-copy p {
  margin: 4px 0 0;
  font-size: 12px;
  color: rgba(226, 232, 240, 0.9);
}

.news-reader-close {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(191, 219, 254, 0.45);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.news-reader-close:hover,
.news-reader-close:focus-visible {
  outline: none;
  background: rgba(255, 255, 255, 0.24);
}

.news-reader-toolbar {
  display: flex;
  gap: 8px;
  padding: 10px 13px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  background: rgba(241, 245, 249, 0.84);
}
.news-reader-toolbar .np-btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.news-reader-content {
  overflow: auto;
  padding: 14px;
}

.news-reader-markdown {
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 12px;
  background: #fff;
  padding: 16px 16px 14px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.news-reader-markdown h2,
.news-reader-markdown h3 {
  margin: 0 0 7px;
  color: #0f172a;
}

.news-reader-markdown h2 {
  font-size: 19px;
}

.news-reader-markdown h3 {
  font-size: 15px;
  margin-top: 14px;
}

.news-reader-markdown p,
.news-reader-markdown li {
  font-size: 13px;
  line-height: 1.55;
  color: #334155;
}

.news-reader-markdown ul {
  margin: 6px 0 8px 18px;
  padding: 0;
}

.news-reader-markdown blockquote {
  margin: 0 0 10px;
  padding: 6px 9px;
  border-left: 3px solid #3b82f6;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 12px;
}

.news-reader-markdown a {
  color: #1d4ed8;
  text-decoration: none;
  font-weight: 700;
}

.news-reader-markdown a:hover {
  text-decoration: underline;
}

@media (max-width: 900px) {
  body[data-page="news"] .news-workspace {
    height: auto;
    grid-template-rows: auto auto;
  }

  body[data-page="news"] .news-grid {
    height: auto;
  }

  .np-drag-handle {
    display: none;
  }

  .news-reader-modal {
    width: min(1120px, calc(100vw - 18px));
    max-height: 92vh;
  }
}

@media (max-width: 760px) {
  .news-hero-panel {
    padding: 10px 11px;
  }

  .news-hero-copy p {
    font-size: 13px;
  }

  .news-filter-input {
    width: 100%;
  }

  .feed-group-filter {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }
  .feed-group-filter::-webkit-scrollbar {
    display: none;
  }
}

/* ── News Premium Refinement (Pass II) ─────────────────────────────────── */
body[data-page="news"] .topbar-actions {
  gap: 8px;
}


body[data-page="news"] .np {
  backdrop-filter: blur(1.5px);
  border-color: rgba(148, 163, 184, 0.32);
}


body[data-page="news"] .np-body {
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.5) transparent;
}
body[data-page="news"] .np-body::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
body[data-page="news"] .np-body::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.42);
  border-radius: 999px;
}
body[data-page="news"] .np-body::-webkit-scrollbar-track {
  background: transparent;
}

#feedLayoutModeBadge {
  background: linear-gradient(180deg, rgba(14, 165, 233, 0.24) 0%, rgba(59, 130, 246, 0.24) 100%);
  border: 1px solid rgba(125, 211, 252, 0.45);
  color: #dbeafe;
}

#feedBody.feed-rendering {
  opacity: 0.36;
  transform: translateY(2px);
  transition: opacity .16s ease, transform .16s ease;
}

.panel-feed.is-editorial .stat-bar {
  background:
    linear-gradient(180deg, rgba(241, 245, 249, 0.94) 0%, rgba(248, 250, 252, 0.96) 100%);
  border-bottom-color: rgba(148, 163, 184, 0.2);
}

.feed-editorial-board {
  gap: 12px;
}

.panel-feed.is-editorial .feed-lane {
  position: relative;
  min-height: 260px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.panel-feed.is-editorial .feed-lane::before {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(37, 99, 235, 0), rgba(37, 99, 235, 0.42), rgba(37, 99, 235, 0));
  opacity: 0.35;
}

.panel-feed.is-editorial .feed-lane-head,
.panel-feed.is-editorial .feed-lane-note {
  position: sticky;
  top: 0;
  z-index: 2;
}

.panel-feed.is-editorial .feed-lane-head {
  padding: 2px 0 2px;
  background: inherit;
}

.panel-feed.is-editorial .feed-lane-note {
  padding-bottom: 4px;
  background: inherit;
}

.panel-feed.is-editorial .feed-lane-body {
  display: grid;
  gap: 8px;
}

.panel-feed.is-editorial .feed-editorial-card {
  border-color: rgba(148, 163, 184, 0.28);
}

.panel-feed.is-editorial .feed-editorial-title {
  font-size: 13px;
  letter-spacing: -0.01em;
}

.panel-feed.is-editorial .feed-editorial-summary {
  line-height: 1.5;
}

.panel-feed.is-editorial .feed-editorial-foot {
  border-top: 1px dashed rgba(148, 163, 184, 0.32);
  padding-top: 5px;
}

body[data-page="news"] .src-card {
  border-radius: 12px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}

body[data-page="news"] .src-card:hover {
  transform: translateY(-1px);
  border-color: rgba(59, 130, 246, 0.42);
  box-shadow: 0 14px 24px rgba(37, 99, 235, 0.12);
}

body[data-page="news"] .news-reader-modal {
  width: min(1160px, calc(100vw - 26px));
  border-color: rgba(125, 211, 252, 0.32);
}

body[data-page="news"] .news-reader-content {
  padding: 18px 16px;
  background: linear-gradient(180deg, rgba(248, 251, 255, 0.84) 0%, rgba(255, 255, 255, 0.95) 100%);
}

body[data-page="news"] .news-reader-markdown {
  max-width: 920px;
  margin: 0 auto;
  padding: 22px 22px 18px;
  border-radius: 14px;
}

body[data-page="news"] .news-reader-markdown p {
  text-align: justify;
  text-justify: inter-word;
}

@media (prefers-reduced-motion: reduce) {
  .news-grid.news-grid--animate .np,
  .np-badge.live,
  .feed-editorial-card,
  .src-card,
  #feedBody.feed-rendering {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
}

/* ── News Deploy Hardening ───────────────────────────────────────────── */


body[data-page="news"] .news-hero-panel {
  padding: 10px 12px;
  border-radius: 15px;
}

body[data-page="news"] .news-hero-copy h1 {
  font-size: clamp(18px, 1.6vw, 24px);
}

body[data-page="news"] .news-hero-copy p {
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.35;
}


body[data-page="news"] .np-subheader {
  padding: 6px 11px;
  font-size: 10px;
}

body[data-page="news"] .np-toolbar {
  padding: 7px 11px;
  gap: 7px;
}

body[data-page="news"] .np-toolbar input,
body[data-page="news"] .np-toolbar select {
  min-height: 34px;
}

body[data-page="news"] .np-btn {
  min-height: 34px;
}

body[data-page="news"] .np-btn--mini,
body[data-page="news"] .np-btn--header {
  min-height: 28px;
}

body[data-page="news"] .stat-bar {
  gap: 10px;
  padding: 7px 11px;
}

body[data-page="news"] .stat-item {
  min-width: 56px;
}

body[data-page="news"] .stat-value {
  font-size: 14px;
}

body[data-page="news"] .feed-group-filter {
  gap: 5px;
  padding: 7px 11px;
}

body[data-page="news"] .feed-group-chip {
  min-height: 28px;
  padding: 3px 9px;
}

body[data-page="news"] .np-body {
  overflow-y: auto !important;
  overflow-x: hidden;
  padding: 9px 11px;
}

body[data-page="news"] .np-footer {
  padding: 7px 11px;
  font-size: 10px;
}

body[data-page="news"] .panel-search .np-toolbar {
  grid-template-columns: minmax(110px, auto) minmax(136px, auto) auto minmax(0, 1fr) auto auto;
  gap: 7px;
}


body[data-page="news"] .panel-search .search-results-body,
body[data-page="news"] .panel-search .search-preview-body {
  padding-top: 8px;
}

body[data-page="news"] .panel-feed .np-body,
body[data-page="news"] .panel-ep-live .np-body,
body[data-page="news"] .panel-sources .np-body {
  padding-top: 8px;
}

body[data-page="news"] .panel-mep .np-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}


body[data-page="news"] .live-stream-links {
  margin-top: 0;
}

body[data-page="news"] .live-stream-link-btn {
  min-height: 34px;
}


body[data-page="news"] .art-item,
body[data-page="news"] .search-result-card {
  border-radius: 11px;
}

body[data-page="news"] .search-result-head {
  margin-bottom: 6px;
}


body[data-page="news"] .news-grid[data-news-layout="focus"] .np.is-large .np-body {
  padding-top: 10px;
}

@media (max-width: 1380px) {
  body[data-page="news"] .panel-search .np-toolbar {
    grid-template-columns: minmax(110px, auto) minmax(130px, auto) minmax(0, 1fr) auto auto;
  }
}

@media (max-width: 1180px) {
  body[data-page="news"] .news-grid {
    grid-template-columns: minmax(260px, 0.94fr) minmax(360px, 1.18fr) minmax(260px, 0.94fr);
    grid-template-rows: minmax(240px, 0.8fr) minmax(320px, 1.2fr);
  }

  body[data-page="news"] .panel-search .np-toolbar {
    grid-template-columns: minmax(110px, auto) minmax(126px, auto) minmax(0, 1fr) auto;
  }

  body[data-page="news"] .panel-search .np-toolbar label {
    grid-column: 1 / -1;
  }

  body[data-page="news"] .news-grid[data-news-layout="focus"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  body[data-page="news"] .app-content {
    padding: 10px;
  }

  body[data-page="news"] .np-body {
    overflow: visible !important;
  }

  body[data-page="news"] .panel-search .np-toolbar,
  body[data-page="news"] .panel-mep .np-toolbar {
    grid-template-columns: 1fr;
  }

  body[data-page="news"] .news-filter-input {
    width: 100%;
  }
}

/* ── News Production Polish ───────────────────────────────────────────── */


body[data-page="news"] .news-hero-panel {
  background:
    linear-gradient(120deg, rgba(31, 51, 117, 0.92), rgba(59, 105, 177, 0.84) 62%, rgba(126, 179, 214, 0.72));
  border: 1px solid rgba(152, 190, 235, 0.34);
  box-shadow: 0 12px 28px rgba(15, 29, 67, 0.18);
}

body[data-page="news"] .news-hero-pills {
  gap: 6px;
}

body[data-page="news"] .news-hero-pill {
  min-height: 28px;
  padding: 4px 10px;
  border-color: rgba(231, 239, 255, 0.22);
  background: rgba(240, 246, 255, 0.14);
}


body[data-page="news"] .np-subheader,
body[data-page="news"] .np-footer {
  color: #667493;
}


body[data-page="news"] .np-toolbar input,
body[data-page="news"] .np-toolbar select,
body[data-page="news"] .news-filter-input {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(155, 177, 220, 0.42);
  box-shadow: none;
}

body[data-page="news"] .np-btn.ghost,
body[data-page="news"] .live-stream-link-btn,
body[data-page="news"] .src-card-actions .np-btn {
  background: rgba(242, 247, 255, 0.9);
  border-color: rgba(148, 171, 218, 0.4);
}

body[data-page="news"] .art-item,
body[data-page="news"] .search-result-card,
body[data-page="news"] .feed-editorial-card,
body[data-page="news"] .src-card,
body[data-page="news"] .ep-feed-item {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(166, 185, 224, 0.28);
  box-shadow: none;
}

body[data-page="news"] .search-result-card,
body[data-page="news"] .feed-editorial-card {
  padding: 12px 13px;
}

body[data-page="news"] .panel-search .search-preview-shell {
  min-height: 0;
}

body[data-page="news"] .live-stream-frame {
  min-height: clamp(240px, 28vh, 360px);
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px rgba(165, 186, 228, 0.3);
}

body[data-page="news"] .sources-cards-grid {
  gap: 10px;
}

body[data-page="news"] .src-card {
  padding: 8px 9px;
}

body[data-page="news"] .np-body {
  scrollbar-width: thin;
}

@media (max-width: 1180px) {
  body[data-page="news"] .app-content {
    padding: 10px 12px 16px;
  }
}

/* ── App Shell Alignment Pass ──────────────────────────────────────────── */
:root {
  --app-shell-max-width: 1600px;
  --app-panel-radius: 16px;
  --app-panel-border: rgba(148, 163, 184, 0.28);
  --app-panel-shadow: 0 10px 24px rgba(15, 23, 42, 0.07);
  --app-control-height-sm: 40px;
  --app-control-height-md: 44px;
}

body[data-page="dataset"] .app-content,
body[data-page="topics-mandates"] .app-content,
body[data-page="parliament-members"] .app-content,
body[data-page="news"] .app-content {
  max-width: var(--app-shell-max-width);
  margin: 0 auto;
}

body[data-page="dataset"] .container {
  max-width: none;
}

.topbar.topbar--glass {
  min-height: 68px;
  padding: 10px 24px;
}

.topbar--glass .topbar-nav {
  gap: 8px;
}

.topbar--glass .nav-pill {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
}

.topbar--glass .topbar-actions {
  margin-left: auto;
  align-items: center;
}

.topbar--glass .sessions-badge,
.topbar--glass .control-btn,
body[data-page="news"] .news-status-pill,
body[data-page="news"] .news-top-action {
  min-height: 36px;
}

body[data-page="dataset"] .topbar.topbar--glass,
body[data-page="topics-mandates"] .topbar.topbar--glass,
body[data-page="parliament-members"] .topbar.topbar--glass,
body[data-page="intel"] .topbar.topbar--glass,
body[data-page="news"] .topbar.topbar--glass,
body[data-page="graph"] .topbar.topbar--glass {
  position: sticky !important;
  top: 0;
  z-index: 120;
  backdrop-filter: blur(14px);
}

@media (max-width: 980px) {
  .tm-topic-fallback-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.page-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid rgba(203, 213, 225, 0.78);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 248, 253, 0.96));
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
}

.page-toolbar__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.page-toolbar__kicker {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(96, 165, 250, 0.24);
  color: #1e3a8a;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.page-toolbar__text {
  color: #64748b;
  font-size: 12px;
  line-height: 1.45;
}

.page-toolbar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

body[data-page="dataset"] .panel,
body[data-page="dataset"] .chart-card,
body[data-page="topics-mandates"] .panel,
body[data-page="topics-mandates"] .chart-card,
body[data-page="parliament-members"] .panel,
body[data-page="parliament-members"] .chart-card {
  border-radius: var(--app-panel-radius);
  border-color: var(--app-panel-border);
  box-shadow: var(--app-panel-shadow);
}

body[data-page="dataset"] .control-btn,
body[data-page="topics-mandates"] .control-btn,
body[data-page="parliament-members"] .control-btn,
body[data-page="dataset"] .search-input,
body[data-page="topics-mandates"] .search-input,
body[data-page="parliament-members"] .search-input {
  min-height: var(--app-control-height-sm);
}

body[data-page="dataset"] .control-btn.primary,
body[data-page="topics-mandates"] .control-btn.primary,
body[data-page="parliament-members"] .control-btn.primary {
  min-height: var(--app-control-height-md);
}

/* ── Dataset page alignment ───────────────────────────────────────────── */
body[data-page="dataset"] .dashboard-hero {
  border-radius: var(--app-panel-radius);
  box-shadow: var(--app-panel-shadow);
  padding: clamp(20px, 2.2vw, 28px);
  background:
    radial-gradient(700px 280px at 100% -20%, rgba(59, 130, 246, 0.12), transparent 70%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.985), rgba(246, 250, 255, 0.98));
}

body[data-page="dataset"] .dashboard-hero-grid {
  gap: 24px;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
  align-items: stretch;
}

body[data-page="dataset"] .dashboard-brand-card,
body[data-page="dataset"] .dashboard-dataset-snapshot,
body[data-page="dataset"] .panel-vote-compact--secondary {
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

body[data-page="dataset"] .dashboard-brand-guide h3 {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0f172a;
}

body[data-page="dataset"] .dashboard-brand-guide-list {
  gap: 10px;
}

body[data-page="dataset"] .dashboard-brand-title {
  font-size: clamp(36px, 4.2vw, 56px);
  line-height: 0.98;
}

body[data-page="dataset"] .dashboard-brand-sub {
  max-width: 62ch;
  font-size: 15px;
  line-height: 1.62;
}

body[data-page="dataset"] .dashboard-brand-meta {
  gap: 8px;
}

body[data-page="dataset"] .dashboard-brand-chip {
  min-height: 28px;
  padding: 5px 10px;
  font-size: 10px;
  letter-spacing: 0.07em;
}

body[data-page="dataset"] .dashboard-brand-guide {
  padding: 14px 14px 13px;
}

body[data-page="dataset"] .dashboard-brand-guide-item {
  gap: 4px;
}

body[data-page="dataset"] .dashboard-snapshot-head {
  align-items: center;
}

body[data-page="dataset"] .dashboard-snapshot-stats {
  gap: 10px;
}

body[data-page="dataset"] .snapshot-stat {
  min-height: 88px;
  padding: 12px 12px 10px;
}

body[data-page="dataset"] .dataset-footer-shell {
  padding: 12px 16px;
  border-radius: 14px;
}

body[data-page="dataset"] .dataset-footer-meta {
  gap: 10px;
  font-size: 12px;
  line-height: 1.45;
}

/* ── Topics & mandate alignment ───────────────────────────────────────── */
body[data-page="topics-mandates"] .tm-header {
  gap: 16px;
  align-items: flex-start;
  padding-bottom: 16px;
}

body[data-page="topics-mandates"] .tm-header-pills {
  gap: 6px;
}

body[data-page="topics-mandates"] .tm-header-pill {
  min-height: 28px;
  padding: 4px 10px;
  font-size: 10px;
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(96, 165, 250, 0.22);
}

body[data-page="topics-mandates"] .topic-filter-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: stretch;
}

body[data-page="topics-mandates"] .topic-filter-controls .search-input,
body[data-page="topics-mandates"] .topic-filter-controls .control-btn {
  height: 100%;
}

body[data-page="topics-mandates"] .tm-panel {
  border-radius: 18px;
  padding: 22px;
}

body[data-page="topics-mandates"] .tm-title {
  font-size: clamp(34px, 3.9vw, 48px);
  line-height: 1.02;
}

body[data-page="topics-mandates"] .tm-subtitle {
  max-width: 72ch;
  font-size: 15px;
  line-height: 1.58;
}

body[data-page="topics-mandates"] .tm-topic-lens {
  padding: 16px;
  border-radius: 16px;
}

body[data-page="topics-mandates"] .tm-topic-lens-head {
  gap: 5px;
}

body[data-page="topics-mandates"] .tm-kpi-cell {
  min-height: 88px;
  padding: 14px 14px 12px;
}


body[data-page="topics-mandates"] .tm-section-head {
  gap: 5px;
  margin-bottom: 12px;
}

body[data-page="topics-mandates"] .chart-container {
  padding-top: 4px;
}

body[data-page="topics-mandates"] .tm-panel .chart-card {
  border-radius: 16px;
  padding: 18px;
}

body[data-page="topics-mandates"] .tm-panel .chart-card h3,
body[data-page="topics-mandates"] .tm-panel .chart-card h4 {
  margin-bottom: 8px;
}

/* ── Parliament members alignment ─────────────────────────────────────── */
body[data-page="parliament-members"] .pm-profile-actions {
  gap: 8px;
}

body[data-page="parliament-members"] .pm-profile-actions .control-btn:first-child {
  margin-right: 0;
  border-right: 0;
  padding-right: 14px;
}

body[data-page="parliament-members"] .pm-profile-actions .control-btn {
  min-height: var(--app-control-height-sm);
}

body[data-page="parliament-members"] .hero-panel {
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  padding: 20px;
}

/* Minimal "less generic-SaaS" pass (2026-09): the shared .hero-panel__eyebrow renders as a
   rounded, bordered, tinted-background chip -- a stock dashboard-badge look. Policy Atlas's own
   equivalent (.pa-eyebrow) is plain mono-spaced text with no pill/border/fill, which reads as an
   editorial kicker instead of a UI badge. Scoped to this page only -- not touching the shared
   .hero-panel__eyebrow rule other pages still use as-is. */
body[data-page="parliament-members"] .hero-panel__eyebrow {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--ma-action-strong, #1859cc);
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  font-weight: 700;
}

body[data-page="parliament-members"] .hero-panel__title {
  font-size: clamp(36px, 4vw, 50px);
}

/* The page's own local @media(max-width:960px) rule for this selector (parliament-members.html)
   was dead — this selector's higher specificity always won regardless of viewport, so the
   36px clamp() floor rendered even on mobile instead of the intended, smaller 1.3rem. Restoring
   the intended mobile size here, on the rule that actually wins. */
@media (max-width: 960px) {
  body[data-page="parliament-members"] .hero-panel__title {
    font-size: 1.3rem;
  }
}

body[data-page="parliament-members"] .hero-panel__text {
  max-width: 64ch;
  font-size: 16px;
  line-height: 1.58;
}

body[data-page="parliament-members"] .hero-stat-card {
  border-radius: 16px;
  padding: 20px 18px 18px;
}

body[data-page="parliament-members"] .pm-kpi-strip--modern {
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

body[data-page="parliament-members"] .pm-profile-workspace {
  border-radius: 18px;
  padding: 20px;
}

body[data-page="parliament-members"] .pm-profile-head {
  gap: 14px;
  align-items: flex-start;
}

body[data-page="parliament-members"] .pm-profile-actions {
  width: auto;
  max-width: 820px;
}

body[data-page="parliament-members"] .pm-profile-actions .control-btn.is-primary {
  background: #1d4ed8;
  color: #fff;
  border-color: transparent;
  box-shadow: 0 8px 18px rgba(29, 78, 216, 0.18);
}

body[data-page="parliament-members"] .pm-profile-actions .control-btn.is-primary:hover {
  color: #fff;
  background: #1e40af;
  border-color: transparent;
}

body[data-page="parliament-members"] .pm-profile-actions .control-btn.is-utility {
  background: #f8fafc;
  color: #64748b;
  border-color: rgba(203, 213, 225, 0.9);
  box-shadow: none;
}

body[data-page="parliament-members"] .pm-profile-actions .control-btn.is-utility:hover {
  color: #0f172a;
  background: #ffffff;
}

body[data-page="parliament-members"] .pm-profile-charts-grid {
  gap: 16px;
}

body[data-page="parliament-members"] .pm-profile-contact-card,
body[data-page="parliament-members"] .pm-profile-votemix-card,
body[data-page="parliament-members"] .pm-profile-overview-card,
body[data-page="parliament-members"] .chart-card--modern {
  border-radius: 16px;
  padding: 16px;
}

/* ── News layout hardening from final UI pass ─────────────────────────── */
body[data-page="news"] .page-toolbar--news {
  margin-top: 0;
  margin-bottom: 4px;
}

body[data-page="news"] .news-hero-panel {
  padding-bottom: 12px;
}

body[data-page="news"] .panel-search .np-toolbar {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
}

body[data-page="news"] .panel-search .np-toolbar > :nth-child(1) { grid-column: 1; }
body[data-page="news"] .panel-search .np-toolbar > :nth-child(2) { grid-column: 2; }
body[data-page="news"] .panel-search .np-toolbar > :nth-child(3) { grid-column: 1; }
body[data-page="news"] .panel-search .np-toolbar > :nth-child(4) { grid-column: 2; }
body[data-page="news"] .panel-search .np-toolbar > :nth-child(5) { grid-column: 1; }
body[data-page="news"] .panel-search .np-toolbar > :nth-child(6) { grid-column: 2; }

body[data-page="news"] .panel-search .np-toolbar label {
  min-height: var(--app-control-height-sm);
  padding-right: 0;
  padding-left: 2px;
}

body[data-page="news"] .panel-search .np-toolbar input,
body[data-page="news"] .panel-search .np-toolbar select,
body[data-page="news"] .panel-search .np-toolbar .np-btn {
  min-height: var(--app-control-height-sm);
  width: 100%;
}

body[data-page="news"] .panel-search .search-results-body .np-empty,
body[data-page="news"] .panel-ep-live .np-empty,
body[data-page="news"] .panel-sources .np-empty {
  max-width: 32ch;
  margin: 24px auto 0;
  text-align: center;
}

body[data-page="news"] .art-title,
body[data-page="news"] .feed-editorial-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

body[data-page="news"] .art-summary,
body[data-page="news"] .feed-editorial-summary {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

body[data-page="news"] .art-tags > *:nth-child(n+4),
body[data-page="news"] .feed-editorial-tags > *:nth-child(n+4) {
  display: none;
}

@media (max-width: 1180px) {
  .page-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  body[data-page="dataset"] .dashboard-hero-grid {
    grid-template-columns: 1fr;
  }

  body[data-page="topics-mandates"] .topic-filter-controls {
    grid-template-columns: 1fr;
  }

  body[data-page="parliament-members"] .hero-panel {
    grid-template-columns: 1fr;
  }

  body[data-page="news"] .panel-search .np-toolbar {
    grid-template-columns: 1fr;
  }

  body[data-page="news"] .panel-search .np-toolbar > :nth-child(1),
  body[data-page="news"] .panel-search .np-toolbar > :nth-child(2),
  body[data-page="news"] .panel-search .np-toolbar > :nth-child(3),
  body[data-page="news"] .panel-search .np-toolbar > :nth-child(4),
  body[data-page="news"] .panel-search .np-toolbar > :nth-child(5),
  body[data-page="news"] .panel-search .np-toolbar > :nth-child(6) {
    grid-column: 1;
  }
}

@media (max-width: 900px) {
  .topbar.topbar--glass {
    padding: 10px 14px;
  }

  body[data-page="dataset"] .app-content,
  body[data-page="topics-mandates"] .app-content,
  body[data-page="parliament-members"] .app-content,
  body[data-page="news"] .app-content {
    padding-left: 10px;
    padding-right: 10px;
  }

  body[data-page="parliament-members"] .pm-profile-actions {
    width: 100%;
  }

  body[data-page="parliament-members"] .pm-profile-actions .control-btn {
    flex: 1 1 calc(50% - 6px);
  }
}

/* ── News professional layout balance: compact by default, spacious on focus ── */


@media (max-width: 1180px) {
  body[data-page="news"] .news-grid {
    height: clamp(820px, calc(100dvh - 188px), 1120px) !important;
    min-height: 820px !important;
    max-height: 1120px !important;
  }

  body[data-page="news"] .news-grid[data-news-layout="focus"] {
    min-height: 1220px !important;
    grid-template-rows: minmax(560px, 66vh) minmax(260px, auto) minmax(260px, auto) !important;
  }
}

@media (max-width: 900px) {
  body[data-page="news"] .news-grid,
  body[data-page="news"] .news-grid[data-news-layout="default"],
  body[data-page="news"] .news-grid[data-news-layout="focus"],
  body[data-page="news"] .news-grid[data-news-layout="responsive"] {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
  }

  body[data-page="news"] .np,
  body[data-page="news"] .news-grid[data-news-layout="focus"] .np {
    height: auto !important;
    max-height: none !important;
  }
}

/* ── News viewport fix: default compact, focus expanded, mobile free ── */


body[data-page="news"] .np {
  height: 100% !important;
  min-height: 0 !important;
  max-height: 100% !important;
  overflow: hidden !important;
  align-self: stretch;
}


body[data-page="news"] .news-grid[data-news-layout="focus"] .np.is-large {
  min-height: clamp(620px, 72vh, 860px);
}

body[data-page="news"] .news-grid[data-news-layout="focus"] .np:not(.is-large) {
  min-height: 250px;
}

/* ── NEWS EOF OVERRIDE: production layout lock (keep at end) ─────────── */
body[data-page="news"] .app-main {
  height: 100dvh !important;
  min-height: 100dvh !important;
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) !important;
  overflow: hidden !important;
}

body[data-page="news"] .app-content {
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

body[data-page="news"] .news-workspace {
  min-height: 0 !important;
  height: 100% !important;
  display: grid !important;
  grid-template-rows: auto auto minmax(0, 1fr) !important;
  gap: 10px !important;
  overflow: hidden !important;
}

body[data-page="news"] .news-grid {
  height: clamp(700px, calc(100dvh - 210px), 940px) !important;
  min-height: 0 !important;
  max-height: clamp(700px, calc(100dvh - 210px), 940px) !important;
  overflow: hidden !important;
  align-content: stretch !important;
  align-items: stretch !important;
}

body[data-page="news"] .news-grid[data-news-layout="default"] {
  grid-template-columns: minmax(280px, 0.96fr) minmax(520px, 1.38fr) minmax(280px, 0.96fr) !important;
  grid-template-rows: minmax(250px, 0.88fr) minmax(320px, 1.12fr) !important;
}

body[data-page="news"] .news-grid[data-news-layout="focus"] {
  height: clamp(700px, calc(100dvh - 210px), 940px) !important;
  min-height: 0 !important;
  max-height: clamp(700px, calc(100dvh - 210px), 940px) !important;
  overflow: hidden !important;
  grid-template-columns: minmax(0, 1.28fr) minmax(0, 0.92fr) !important;
  grid-template-rows: minmax(0, 1.72fr) minmax(220px, 0.84fr) minmax(220px, 0.84fr) !important;
}

body[data-page="news"] .np,
body[data-page="news"] .news-grid[data-news-layout="focus"] .np {
  height: 100% !important;
  min-height: 0 !important;
  max-height: 100% !important;
  overflow: hidden !important;
}

body[data-page="news"] .np-body,
body[data-page="news"] .panel-search .search-results-body,
body[data-page="news"] .panel-search .search-preview-body,
body[data-page="news"] .panel-feed .np-body,
body[data-page="news"] .panel-ep-live .np-body,
body[data-page="news"] .panel-mep .np-body,
body[data-page="news"] .panel-sources .np-body {
  min-height: 0 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

body[data-page="news"] .panel-search .search-stack {
  min-height: 0 !important;
  flex: 1 1 auto !important;
  display: grid !important;
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr) !important;
}

body[data-page="news"] .sources-cards-grid {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
}

body[data-page="news"] .src-card-name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 1180px) {
  body[data-page="news"] .news-grid,
  body[data-page="news"] .news-grid[data-news-layout="focus"] {
    height: clamp(760px, calc(100dvh - 196px), 1040px) !important;
    max-height: clamp(760px, calc(100dvh - 196px), 1040px) !important;
  }

  body[data-page="news"] .news-grid[data-news-layout="default"] {
    grid-template-columns: minmax(260px, 0.94fr) minmax(360px, 1.2fr) minmax(260px, 0.94fr) !important;
    grid-template-rows: minmax(240px, 0.82fr) minmax(340px, 1.18fr) !important;
  }
}

@media (max-width: 900px) {
  body[data-page="news"] .app-main,
  body[data-page="news"] .app-content,
  body[data-page="news"] .news-workspace,
  body[data-page="news"] .news-grid,
  body[data-page="news"] .news-grid[data-news-layout="default"],
  body[data-page="news"] .news-grid[data-news-layout="focus"],
  body[data-page="news"] .news-grid[data-news-layout="responsive"] {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
  }

  body[data-page="news"] .np,
  body[data-page="news"] .news-grid[data-news-layout="focus"] .np,
  body[data-page="news"] .np-body {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }
}

/* ── NEWS Investigative Cards (production pass) ───────────────────────── */
body[data-page="news"] {
  --news-surface: var(--bg-2, #f7f9fc);
  --news-card: var(--card-bg, #ffffff);
  --news-ink: var(--text, #0f1a33);
  --news-muted: var(--muted, #5f6f8f);
  --news-border: var(--border, #d9e4fb);
  --news-glow: var(--shadow-lift, 0 14px 26px rgba(24, 46, 95, 0.08));
  --news-accent: var(--il-blue, #2960ea);
  --news-accent-soft: rgba(41, 96, 234, 0.11);
  --news-radius: var(--card-radius, 14px);
  --news-radius-sm: var(--radius-md, 10px);
  font-family: var(--font-ui);
}

body[data-page="news"].news-theme-dark {
  --news-surface: #121a2c;
  --news-card: #16233a;
  --news-ink: #eaf1ff;
  --news-muted: #b7c5e3;
  --news-border: #2a3a5f;
  --news-glow: 0 16px 28px rgba(0, 0, 0, 0.35);
  --news-accent: #7ba2ff;
  --news-accent-soft: rgba(123, 162, 255, 0.2);
}


body[data-page="news"] .news-control-dock {
  position: sticky;
  top: 6px;
  z-index: 12;
  border: 1px solid var(--news-border);
  border-radius: var(--news-radius);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(246, 249, 255, 0.92));
  backdrop-filter: blur(6px);
  box-shadow: var(--news-glow);
  padding: 12px 14px;
  display: grid;
  gap: 10px;
}

body[data-page="news"].news-theme-dark .news-control-dock {
  background: linear-gradient(145deg, rgba(22, 35, 58, 0.95), rgba(16, 28, 48, 0.92));
}

body[data-page="news"] .news-control-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

body[data-page="news"] .news-control-row--primary {
  justify-content: space-between;
}

body[data-page="news"] .news-control-search {
  min-width: min(520px, 100%);
  flex: 1 1 420px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
}

body[data-page="news"] .news-control-label {
  font-size: 11px;
  letter-spacing: 0.07em;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--news-muted);
}

body[data-page="news"] .news-control-search input,
body[data-page="news"] .news-control-field input,
body[data-page="news"] .news-control-field select {
  min-height: 44px;
  border: 1px solid var(--news-border);
  border-radius: var(--news-radius-sm);
  background: var(--news-card);
  color: var(--news-ink);
  padding: 0 12px;
  font-size: 16px;
}

body[data-page="news"].news-theme-dark .news-control-search input,
body[data-page="news"].news-theme-dark .news-control-field input,
body[data-page="news"].news-theme-dark .news-control-field select {
  background: #1b2a45;
}

body[data-page="news"] .news-control-field {
  display: grid;
  gap: 4px;
  min-width: 160px;
}

body[data-page="news"] .news-control-field--mode {
  min-width: 130px;
}

body[data-page="news"] .news-control-field > span {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--news-muted);
  font-weight: 700;
}

body[data-page="news"] .news-results-pill {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--news-border) 86%, transparent);
  padding: 0 14px;
  color: var(--news-ink);
  background: var(--news-card);
  font-size: 13px;
  font-weight: 700;
}

body[data-page="news"] .news-inline-check {
  min-height: 44px;
  border: 1px solid var(--news-border);
  border-radius: var(--news-radius-sm);
  background: var(--news-card);
  color: var(--news-ink);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 700;
}

body[data-page="news"] .news-inline-check input {
  width: 18px;
  height: 18px;
}

body[data-page="news"] .news-view-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

body[data-page="news"] .news-view-btn.is-active {
  background: var(--news-accent) !important;
  color: #fff !important;
  border-color: var(--news-accent) !important;
}

body[data-page="news"] .news-group-chip-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

body[data-page="news"] .news-active-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

body[data-page="news"] .news-active-chip {
  border-radius: 999px;
  border: 1px solid var(--news-border);
  background: var(--news-accent-soft);
  color: var(--news-ink);
  padding: 6px 11px;
  font-size: 12px;
  font-weight: 700;
}

body[data-page="news"] .news-active-chip--muted {
  background: transparent;
  color: var(--news-muted);
}

body[data-page="news"] .feed-group-filter--legacy {
  display: none !important;
}

body[data-page="news"] .panel-search .np-subheader,
body[data-page="news"] .panel-search .np-toolbar {
  display: none !important;
}

body[data-page="news"] .panel-search .search-stack {
  grid-template-rows: minmax(0, 1.2fr) minmax(0, 0.8fr) !important;
}

body[data-page="news"] .news-feed-dashboard {
  display: grid;
  gap: 14px;
}

body[data-page="news"] .news-highlights {
  border: 1px solid color-mix(in srgb, var(--news-border) 88%, transparent);
  border-radius: var(--news-radius);
  padding: 10px;
  background: var(--news-card);
}

body[data-page="news"] .news-highlights-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

body[data-page="news"] .news-highlights-head h3 {
  margin: 0;
  font-size: 14px;
  color: var(--news-ink);
}

body[data-page="news"] .news-highlights-head span {
  font-size: 12px;
  color: var(--news-muted);
  font-weight: 700;
}

body[data-page="news"] .news-highlights-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

body[data-page="news"] .news-highlight-card {
  border-radius: var(--news-radius-sm);
  border: 1px solid var(--news-border);
  background: linear-gradient(145deg, rgba(41, 96, 234, 0.08), rgba(41, 96, 234, 0.02));
  padding: 10px 12px;
  cursor: pointer;
}

body[data-page="news"] .news-highlight-card:focus-visible,
body[data-page="news"] .news-highlight-card:hover {
  outline: none;
  border-color: var(--news-accent);
  box-shadow: 0 0 0 3px rgba(41, 96, 234, 0.16);
}

body[data-page="news"] .news-highlight-kicker {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--news-muted);
  margin-bottom: 4px;
  font-weight: 700;
}

body[data-page="news"] .news-highlight-card h4 {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
  color: var(--news-ink);
}

body[data-page="news"] .news-story-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

body[data-page="news"] .news-story-card {
  border-radius: var(--news-radius);
  border: 1px solid color-mix(in srgb, var(--news-border) 88%, transparent);
  background: var(--news-card);
  box-shadow: 0 1px 0 rgba(9, 22, 49, 0.04);
  padding: 12px;
  color: var(--news-ink);
  cursor: pointer;
  display: grid;
  gap: 8px;
  min-height: 210px;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

body[data-page="news"] .news-story-card.is-extended {
  min-height: 260px;
}

body[data-page="news"] .news-story-card.is-compact .news-story-summary {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

body[data-page="news"] .news-story-card.is-extended .news-story-summary {
  -webkit-line-clamp: unset;
  overflow: visible;
}

body[data-page="news"] .news-story-card:hover,
body[data-page="news"] .news-story-card:focus-visible {
  transform: translateY(-1px);
  border-color: var(--news-accent);
  box-shadow: var(--news-glow);
  outline: none;
}

body[data-page="news"] .news-story-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--news-muted);
}

body[data-page="news"] .news-story-title {
  margin: 0;
  font-size: 18px;
  line-height: 1.35;
  color: var(--news-ink);
}

body[data-page="news"] .news-story-summary {
  margin: 0;
  font-size: 14px;
  color: var(--news-muted);
  line-height: 1.55;
  text-align: justify;
}

body[data-page="news"] .news-card-signal {
  display: grid;
  gap: 6px;
}

body[data-page="news"] .news-card-signal > span {
  display: block;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--news-accent), #5fd0b5);
}

body[data-page="news"] .news-story-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

body[data-page="news"] .news-story-actions .np-btn {
  min-height: 36px;
  border-radius: 10px;
}

body[data-page="news"] .search-result-head {
  position: sticky;
  top: 0;
  z-index: 2;
  background: color-mix(in srgb, var(--news-surface) 88%, transparent);
  backdrop-filter: blur(4px);
  border-bottom: 1px solid var(--news-border);
  padding: 6px 2px 10px;
}

body[data-page="news"] .search-result-list {
  margin-top: 6px;
}

body[data-page="news"] .search-preview-body .news-browser-reader p {
  text-align: justify;
}

body[data-page="news"] .news-reader-modal {
  border: 1px solid var(--news-border);
  box-shadow: var(--news-glow);
}

body[data-page="news"] .news-story-card:focus-visible,
body[data-page="news"] .news-highlight-card:focus-visible,
body[data-page="news"] .news-control-search input:focus-visible,
body[data-page="news"] .news-control-field input:focus-visible,
body[data-page="news"] .news-control-field select:focus-visible,
body[data-page="news"] .news-inline-check:focus-within {
  outline: 2px solid color-mix(in srgb, var(--news-accent) 72%, #fff 28%);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  body[data-page="news"] .news-story-card,
  body[data-page="news"] .news-highlight-card,
  body[data-page="news"] .np-btn,
  body[data-page="news"] .feed-group-chip {
    transition: none !important;
    animation: none !important;
    transform: none !important;
  }
}

@media (max-width: 1240px) {
  body[data-page="news"] .news-control-row--filters {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 10px;
    align-items: end;
  }

  body[data-page="news"] .news-view-switch,
  body[data-page="news"] #newsThemeToggle {
    align-self: end;
  }
}

@media (max-width: 980px) {
  body[data-page="news"] .news-control-dock {
    position: static;
  }

  body[data-page="news"] .news-control-row--primary {
    align-items: stretch;
  }

  body[data-page="news"] .news-results-pill {
    width: 100%;
    justify-content: center;
  }

  body[data-page="news"] .news-control-row--filters {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }

  body[data-page="news"] .news-story-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
}

@media (max-width: 680px) {
  body[data-page="news"] .news-control-row--filters {
    grid-template-columns: 1fr;
  }

  body[data-page="news"] .news-story-grid {
    grid-template-columns: 1fr;
  }

  body[data-page="news"] .news-story-title {
    font-size: 17px;
  }

  body[data-page="news"] .news-story-actions .np-btn {
    min-height: 44px;
    flex: 1 1 45%;
  }
}

/* ── NEWS Final stability patch: intel view + reliable feed scroll ───── */
body[data-page="news"] .panel-feed .np-body {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

body[data-page="news"] .news-feed-dashboard {
  min-height: 0;
  align-content: start;
}

body[data-page="news"] .news-feed-dashboard .news-highlights {
  margin-bottom: 2px;
}

body[data-page="news"] .news-story-grid {
  align-content: start;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

body[data-page="news"] .news-feed-pager {
  position: sticky;
  bottom: -2px;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 2px 4px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(248, 251, 255, 0.95) 30%, rgba(248, 251, 255, 0.98) 100%);
}

body[data-page="news"].news-theme-dark .news-feed-pager {
  background: linear-gradient(180deg, rgba(18, 26, 44, 0), rgba(20, 31, 53, 0.94) 30%, rgba(20, 31, 53, 0.98) 100%);
}


body[data-page="news"].news-intel-view .panel-search {
  grid-column: 1 / 2 !important;
  grid-row: 1 / 2 !important;
}

body[data-page="news"].news-intel-view .panel-feed {
  grid-column: 2 / 3 !important;
  grid-row: 1 / 2 !important;
}

@media (max-width: 980px) {
  body[data-page="news"].news-intel-view .news-grid {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto auto !important;
    height: auto !important;
    max-height: none !important;
  }

  body[data-page="news"].news-intel-view .panel-search,
  body[data-page="news"].news-intel-view .panel-feed {
    grid-column: auto !important;
    grid-row: auto !important;
  }
}

/* card-focused search panel in intel view */
body[data-page="news"].news-intel-view .panel-search .search-result-list .news-story-grid {
  grid-template-columns: 1fr;
}

body[data-page="news"].news-intel-view .panel-search .search-result-list .news-story-card {
  min-height: 190px;
}

/* ── NEWS HOTFIX: unlock global scroll + lighter chrome (production) ── */
body[data-page="news"] {
  overflow-y: auto !important;
  --news-border: #e5ecf8;
  --news-glow: 0 8px 18px rgba(16, 36, 79, 0.06);
}


body[data-page="news"] .np-subheader,
body[data-page="news"] .np-footer {
  border-color: color-mix(in srgb, var(--news-border) 72%, transparent) !important;
}

body[data-page="news"] .news-control-dock {
  border-color: color-mix(in srgb, var(--news-border) 78%, transparent) !important;
  box-shadow: 0 8px 18px rgba(18, 37, 79, 0.07) !important;
}


body[data-page="news"] .panel-feed .np-body,
body[data-page="news"] .panel-search .np-body {
  max-height: min(58vh, 760px);
}

body[data-page="news"] .panel-ep-live .np-body,
body[data-page="news"] .panel-mep .np-body,
body[data-page="news"] .panel-sources .np-body {
  max-height: min(44vh, 560px);
}

body[data-page="news"] .news-grid[data-news-layout="focus"] .np.is-large .np-body {
  max-height: min(72vh, 920px);
}

body[data-page="news"] .news-grid[data-news-layout="focus"] .np:not(.is-large) .np-body {
  max-height: min(36vh, 430px);
}

body[data-page="news"].news-intel-view .news-grid {
  grid-template-columns: minmax(340px, 0.92fr) minmax(520px, 1.28fr) !important;
  grid-template-rows: minmax(0, auto) !important;
  height: auto !important;
  max-height: none !important;
}

body[data-page="news"].news-intel-view .panel-search .np-body,
body[data-page="news"].news-intel-view .panel-feed .np-body {
  max-height: min(68vh, 860px);
}

@media (max-width: 980px) {
  body[data-page="news"] .news-control-dock {
    box-shadow: none !important;
  }

  body[data-page="news"] .panel-search .np-body,
  body[data-page="news"] .panel-feed .np-body,
  body[data-page="news"] .panel-ep-live .np-body,
  body[data-page="news"] .panel-mep .np-body,
  body[data-page="news"] .panel-sources .np-body {
    max-height: none;
  }
}

/* ── NEWS Dashboard v2: celestial-like cards + institutional navigator ── */
body[data-page="news"] .news-overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

body[data-page="news"] .news-overview-card {
  position: relative;
  border: 1px solid color-mix(in srgb, var(--news-border) 78%, transparent);
  border-radius: 12px;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.95), rgba(245, 249, 255, 0.93));
  padding: 10px 12px;
  display: grid;
  gap: 4px;
  box-shadow: 0 6px 14px rgba(16, 36, 79, 0.05);
}

body[data-page="news"] .news-overview-card::before {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  top: 0;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(37, 99, 235, 0), rgba(37, 99, 235, 0.72), rgba(37, 99, 235, 0));
}

body[data-page="news"] .news-overview-card__kicker {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: var(--news-muted);
}

body[data-page="news"] .news-overview-card__value {
  font-size: clamp(22px, 2vw, 28px);
  line-height: 1.05;
  font-weight: 800;
  color: var(--news-ink);
}

body[data-page="news"] .news-overview-card__meta {
  font-size: 12px;
  color: var(--news-muted);
}

body[data-page="news"] .institutional-links-body {
  padding: 10px;
}

body[data-page="news"] .institutional-links-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

body[data-page="news"] .institutional-link-card {
  border: 1px solid color-mix(in srgb, var(--news-border) 82%, transparent);
  border-radius: 12px;
  padding: 10px 11px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  color: var(--news-ink);
  text-decoration: none;
  display: grid;
  gap: 6px;
  min-height: 128px;
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}

body[data-page="news"] .institutional-link-card:hover,
body[data-page="news"] .institutional-link-card:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 10px 20px rgba(16, 36, 79, 0.11);
  outline: none;
}

body[data-page="news"] .institutional-link-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

body[data-page="news"] .institutional-link-tag,
body[data-page="news"] .institutional-link-scope {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 3px 7px;
}

body[data-page="news"] .institutional-link-tag {
  background: rgba(37, 99, 235, 0.12);
  color: #1e40af;
}

body[data-page="news"] .institutional-link-scope {
  background: rgba(15, 23, 42, 0.08);
  color: #334155;
}

body[data-page="news"] .institutional-link-title {
  font-size: 15px;
  line-height: 1.35;
  font-weight: 700;
}

body[data-page="news"] .institutional-link-hint {
  font-size: 12px;
  color: var(--news-muted);
}

body[data-page="news"] #institutionalPipelineStatus {
  margin-left: 8px;
  font-size: 12px;
  color: var(--news-muted);
}

/* Intel view should stay focused, but keep pipeline/institutional panels visible */
body[data-page="news"].news-intel-view .panel-ep-live,
body[data-page="news"].news-intel-view .panel-mep,
body[data-page="news"].news-intel-view .panel-sources {
  display: flex !important;
}

body[data-page="news"].news-intel-view .news-grid,
body[data-page="news"].news-intel-view .news-grid[data-news-layout="default"],
body[data-page="news"].news-intel-view .news-grid[data-news-layout="focus"] {
  height: auto !important;
  max-height: none !important;
  min-height: 0 !important;
}

body[data-page="news"].news-intel-view .news-grid[data-news-layout="default"] {
  grid-template-columns: minmax(320px, 1.08fr) minmax(560px, 1.6fr) minmax(320px, 1.08fr) !important;
  grid-template-rows: minmax(250px, 0.82fr) minmax(340px, 1.18fr) !important;
}

body[data-page="news"].news-intel-view .news-grid[data-news-layout="focus"] {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-template-rows: minmax(360px, 1.25fr) minmax(240px, 0.92fr) minmax(240px, 0.92fr) !important;
}

@media (max-width: 1200px) {
  body[data-page="news"] .news-overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  body[data-page="news"] .news-overview-grid {
    grid-template-columns: 1fr;
  }

  body[data-page="news"] .institutional-links-grid {
    grid-template-columns: 1fr;
  }

  body[data-page="news"] #institutionalPipelineStatus {
    display: block;
    margin: 4px 0 0;
  }
}

/* ── Admin Control Center (dataset.html) ────────────────��──────────────── */
body[data-page="dataset"] .admin-cc {
  margin-top: 1.5rem;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 255, 0.96) 100%);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
  padding: 1rem;
}
body[data-page="dataset"] .admin-cc__head {
  margin-bottom: .85rem;
}
body[data-page="dataset"] .admin-cc__section-label {
  margin: .45rem 0 .55rem;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #64748b;
}
body[data-page="dataset"] .admin-cc__job-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: .75rem;
  margin-bottom: 1rem;
}
body[data-page="dataset"] .admin-cc__full-col {
  grid-column: 1 / -1;
}
body[data-page="dataset"] .admin-cc__action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: .75rem;
  margin-bottom: 1rem;
}
body[data-page="dataset"] .admin-cc__action-card {
  border: 1px solid rgba(203, 213, 225, 0.7);
  border-radius: 12px;
  background: #fff;
  padding: .85rem;
  display: grid;
  gap: .55rem;
}
body[data-page="dataset"] .admin-cc__action-card h3 {
  margin: 0;
  font-size: .83rem;
  color: #0f172a;
  letter-spacing: .01em;
}
body[data-page="dataset"] .admin-cc__action-card p {
  margin: 0;
  font-size: .73rem;
  line-height: 1.45;
  color: #64748b;
  min-height: 44px;
}
body[data-page="dataset"] .admin-cc__action-card .upload-btn {
  justify-self: start;
}
body[data-page="dataset"] .admin-cc__sources {
  border: 1px solid rgba(203, 213, 225, 0.66);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94);
  padding: .82rem;
  margin-bottom: .95rem;
}
body[data-page="dataset"] .admin-cc__sources-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .65rem;
  margin-bottom: .72rem;
  font-size: .75rem;
  color: #475569;
}
body[data-page="dataset"] .admin-cc__sources-actions {
  display: flex;
  align-items: center;
  gap: .38rem;
}
body[data-page="dataset"] .admin-cc__sources-actions .upload-btn {
  font-size: .7rem;
  padding: .28rem .62rem;
}
body[data-page="dataset"] .admin-cc__source-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: .62rem;
}
body[data-page="dataset"] .admin-cc__source-card {
  border: 1px solid rgba(203, 213, 225, 0.78);
  border-radius: 10px;
  background: #fff;
  padding: .55rem .65rem;
  display: grid;
  gap: .24rem;
}
body[data-page="dataset"] .admin-cc__source-title {
  font-size: .76rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.35;
}
body[data-page="dataset"] .admin-cc__source-meta {
  font-size: .7rem;
  color: #64748b;
}
body[data-page="dataset"] .admin-cc__source-state {
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}
body[data-page="dataset"] .admin-cc__source-state.is-active {
  color: #0f766e;
}
body[data-page="dataset"] .admin-cc__source-state.is-dormant {
  color: #b45309;
}
body[data-page="dataset"] .admin-cc__source-state.is-paused {
  color: #64748b;
}
body[data-page="dataset"] .admin-cc__status {
  font-size: .74rem;
  color: #475569;
  margin-bottom: 1rem;
  min-height: 1.35rem;
  border-top: 1px dashed rgba(148, 163, 184, 0.4);
  padding-top: .6rem;
}
body[data-page="dataset"] .admin-cc__audit-label {
  font-size: .8rem;
  font-weight: 600;
  color: #334155;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: .5rem;
}
body[data-page="dataset"] .admin-cc__audit-body {
  font-family: monospace;
  font-size: .72rem;
  background: #0f172a;
  border: 1px solid rgba(15, 23, 42, 0.8);
  border-radius: .5rem;
  padding: .75rem 1rem;
  max-height: 240px;
  overflow-y: auto;
  color: #cbd5e1;
}
body[data-page="dataset"] .admin-cc__audit-foot {
  display: flex;
  justify-content: flex-end;
  margin-top: .4rem;
}
body[data-page="dataset"] .admin-cc__audit-refresh {
  font-size: .72rem;
  padding: .25rem .7rem;
}

body[data-page="dataset"] .admin-cc__toolbar,
body[data-page="dataset"] .admin-cc__tabs,
body[data-page="dataset"] .admin-cc__job-actions,
body[data-page="dataset"] .admin-cc__metric-head,
body[data-page="dataset"] .admin-cc__job-top {
  display: flex;
  align-items: center;
  gap: .55rem;
}

body[data-page="dataset"] .admin-cc__toolbar {
  flex-wrap: wrap;
  justify-content: flex-end;
}

body[data-page="dataset"] .admin-cc__tabs {
  flex-wrap: wrap;
  border-bottom: 1px solid rgba(203, 213, 225, 0.72);
  margin: .9rem 0 1rem;
  padding-bottom: .45rem;
}

body[data-page="dataset"] .admin-cc__tab {
  border: 1px solid rgba(203, 213, 225, 0.8);
  border-radius: 999px;
  background: #fff;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  padding: .42rem .72rem;
  cursor: pointer;
}

body[data-page="dataset"] .admin-cc__tab.is-active {
  color: #0f172a;
  border-color: rgba(37, 99, 235, 0.42);
  background: #eff6ff;
}

body[data-page="dataset"] .admin-cc__tab-panel {
  display: none;
}

body[data-page="dataset"] .admin-cc__tab-panel.is-active {
  display: block;
}

body[data-page="dataset"] .admin-cc__health-grid,
body[data-page="dataset"] .admin-cc__storage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: .75rem;
  margin-bottom: 1rem;
}

body[data-page="dataset"] .admin-cc__metric-card,
body[data-page="dataset"] .admin-cc__job-card {
  border: 1px solid rgba(203, 213, 225, 0.7);
  border-radius: 13px;
  background: linear-gradient(180deg, #fff 0%, rgba(248, 250, 252, 0.98) 100%);
  padding: .85rem;
  min-width: 0;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

body[data-page="dataset"] .admin-cc__metric-head,
body[data-page="dataset"] .admin-cc__job-top {
  justify-content: space-between;
  align-items: flex-start;
}

body[data-page="dataset"] .admin-cc__metric-head span:first-child {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #64748b;
}

body[data-page="dataset"] .admin-cc__metric-card strong {
  display: block;
  margin-top: .55rem;
  color: #0f172a;
  font-size: 24px;
  line-height: 1.05;
}

body[data-page="dataset"] .admin-cc__metric-card p,
body[data-page="dataset"] .admin-cc__job-card p,
body[data-page="dataset"] .admin-cc__job-meta {
  margin: .45rem 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: #64748b;
}

body[data-page="dataset"] .admin-cc__pill,
body[data-page="dataset"] .admin-cc__tag {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  padding: .16rem .48rem;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  border: 1px solid rgba(148, 163, 184, 0.45);
  color: #64748b;
  background: #f8fafc;
}

body[data-page="dataset"] .admin-cc__pill.is-ok {
  color: #047857;
  border-color: rgba(16, 185, 129, 0.25);
  background: #ecfdf5;
}

body[data-page="dataset"] .admin-cc__pill.is-running {
  color: #1d4ed8;
  border-color: rgba(59, 130, 246, 0.3);
  background: #eff6ff;
}

body[data-page="dataset"] .admin-cc__pill.is-warn {
  color: #b45309;
  border-color: rgba(245, 158, 11, 0.32);
  background: #fffbeb;
}

body[data-page="dataset"] .admin-cc__pill.is-bad {
  color: #b91c1c;
  border-color: rgba(239, 68, 68, 0.26);
  background: #fef2f2;
}

body[data-page="dataset"] .admin-cc__job-card {
  display: grid;
  gap: .5rem;
}

body[data-page="dataset"] .admin-cc__job-card h3 {
  margin: 0;
  color: #0f172a;
  font-size: 14px;
  line-height: 1.25;
}

body[data-page="dataset"] .admin-cc__job-card p {
  margin-top: .25rem;
}

body[data-page="dataset"] .admin-cc__job-command {
  display: block;
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid rgba(203, 213, 225, 0.65);
  background: #f8fafc;
  color: #334155;
  padding: .42rem .5rem;
  font-size: 11px;
  white-space: nowrap;
}

body[data-page="dataset"] .admin-cc__tag {
  margin-right: .35rem;
}

body[data-page="dataset"] .admin-cc__tag.is-heavy {
  color: #92400e;
  border-color: rgba(245, 158, 11, 0.32);
  background: #fffbeb;
}

body[data-page="dataset"] .admin-cc__job-error {
  border-radius: 8px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 12px;
  line-height: 1.35;
  padding: .42rem .5rem;
}

body[data-page="dataset"] .admin-cc__job-actions {
  flex-wrap: wrap;
}

body[data-page="dataset"] .admin-cc__job-actions .upload-btn {
  font-size: 11px;
  padding: .3rem .62rem;
}

body[data-page="dataset"] .admin-cc__mini-list {
  margin-top: .65rem;
  border-top: 1px solid rgba(203, 213, 225, 0.7);
  padding-top: .5rem;
  display: grid;
  gap: .25rem;
  font-size: 11px;
  color: #475569;
}

body[data-page="dataset"] .admin-cc__audit-row {
  padding: .18rem 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
}

@media (max-width: 760px) {
  body[data-page="dataset"] .admin-cc__toolbar {
    justify-content: flex-start;
  }
  body[data-page="dataset"] .admin-cc__tab {
    flex: 1 1 auto;
  }
}

/* ── Workspace Home (user welcome) ───────────────────────────────────────── */
body[data-page="workspace-home"] .app-main {
  min-height: 100vh;
  background: linear-gradient(176deg, #f8faff 0%, #f1f5f9 100%);
}

body[data-page="workspace-home"] .view {
  display: block;
  padding-top: 1.2rem;
  padding-bottom: 2rem;
}


@media (max-width: 760px) {
  
  
  
  /* .workspace-hero__title mobile font-size now lives on the later "richer gradient" pass,
     which is the rule that actually wins (see above) — this was dead code. */
  
  
}

/* ── User UI Harmonization Pass (Parliament Members baseline) ───────────────── */
body[data-page="workspace-home"] .topbar.topbar--glass,
body[data-page="parliament-members"] .topbar.topbar--glass,
body[data-page="topics-mandates"] .topbar.topbar--glass,
body[data-page="intel"] .topbar.topbar--glass,
body[data-page="news"] .topbar.topbar--glass,
body[data-page="graph"] .topbar.topbar--glass {
  min-height: 72px;
  padding: 9px 20px;
  background:
    linear-gradient(120deg, rgba(15, 23, 42, 0.96) 0%, rgba(30, 41, 59, 0.94) 56%, rgba(15, 23, 42, 0.97) 100%);
  border-bottom: 1px solid rgba(148, 163, 184, 0.24);
  box-shadow: 0 12px 32px rgba(2, 6, 23, 0.32);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

body[data-page="workspace-home"] .topbar--glass .topbar-actions,
body[data-page="parliament-members"] .topbar--glass .topbar-actions,
body[data-page="topics-mandates"] .topbar--glass .topbar-actions,
body[data-page="intel"] .topbar--glass .topbar-actions,
body[data-page="news"] .topbar--glass .topbar-actions,
body[data-page="graph"] .topbar--glass .topbar-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

body[data-page="workspace-home"] .topbar--glass .topbar-nav,
body[data-page="parliament-members"] .topbar--glass .topbar-nav,
body[data-page="topics-mandates"] .topbar--glass .topbar-nav,
body[data-page="intel"] .topbar--glass .topbar-nav,
body[data-page="news"] .topbar--glass .topbar-nav,
body[data-page="graph"] .topbar--glass .topbar-nav {
  gap: 6px;
  flex-wrap: wrap;
}

body[data-page="workspace-home"] .topbar--glass .nav-pill,
body[data-page="parliament-members"] .topbar--glass .nav-pill,
body[data-page="topics-mandates"] .topbar--glass .nav-pill,
body[data-page="intel"] .topbar--glass .nav-pill,
body[data-page="news"] .topbar--glass .nav-pill,
body[data-page="graph"] .topbar--glass .nav-pill {
  padding: 9px 13px;
  margin: 0;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #aeb9cc;
  line-height: 1;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  background: transparent;
}

body[data-page="workspace-home"] .topbar--glass .nav-pill:hover,
body[data-page="parliament-members"] .topbar--glass .nav-pill:hover,
body[data-page="topics-mandates"] .topbar--glass .nav-pill:hover,
body[data-page="intel"] .topbar--glass .nav-pill:hover,
body[data-page="news"] .topbar--glass .nav-pill:hover,
body[data-page="graph"] .topbar--glass .nav-pill:hover {
  color: #f1f5f9;
  background: rgba(148, 163, 184, 0.16);
  border-color: rgba(148, 163, 184, 0.24);
}

body[data-page="workspace-home"] .topbar--glass .nav-pill.active,
body[data-page="parliament-members"] .topbar--glass .nav-pill.active,
body[data-page="topics-mandates"] .topbar--glass .nav-pill.active,
body[data-page="intel"] .topbar--glass .nav-pill.active,
body[data-page="news"] .topbar--glass .nav-pill.active,
body[data-page="graph"] .topbar--glass .nav-pill.active {
  color: #f8fafc;
  border-color: rgba(96, 165, 250, 0.55);
  background: rgba(59, 130, 246, 0.24);
}

body[data-page="workspace-home"] .topbar-user-pill,
body[data-page="parliament-members"] .topbar-user-pill,
body[data-page="topics-mandates"] .topbar-user-pill,
body[data-page="intel"] .topbar-user-pill,
body[data-page="news"] .topbar-user-pill,
body[data-page="graph"] .topbar-user-pill,
body[data-page="workspace-home"] #topbarLogoutBtn,
body[data-page="parliament-members"] #topbarLogoutBtn,
body[data-page="topics-mandates"] #topbarLogoutBtn,
body[data-page="intel"] #topbarLogoutBtn,
body[data-page="news"] #topbarLogoutBtn,
body[data-page="graph"] #topbarLogoutBtn {
  color: #e2e8f0 !important;
  border: 1px solid rgba(148, 163, 184, 0.32) !important;
  background: rgba(15, 23, 42, 0.34) !important;
  opacity: 1 !important;
}

body[data-page="workspace-home"] .topbar-user-pill:hover,
body[data-page="parliament-members"] .topbar-user-pill:hover,
body[data-page="topics-mandates"] .topbar-user-pill:hover,
body[data-page="intel"] .topbar-user-pill:hover,
body[data-page="news"] .topbar-user-pill:hover,
body[data-page="graph"] .topbar-user-pill:hover {
  border-color: rgba(96, 165, 250, 0.52) !important;
  background: rgba(59, 130, 246, 0.24) !important;
}

/* ── Workspace home: intro + preferences ─────────────────────────────────── */
body[data-page="workspace-home"] .app-content {
  max-width: 1600px;
  margin: 0 auto;
  padding: 12px 14px 18px;
}


/* ── News page: lighter container bars, less heavy blue ─────────────────── */
body[data-page="news"] .np {
  border: 1px solid rgba(148, 163, 184, 0.28) !important;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.07) !important;
  border-radius: 14px !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99) 0%, rgba(247, 250, 255, 0.97) 100%) !important;
}

body[data-page="news"] .np-header {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%) !important;
  border-bottom: 1px solid rgba(148, 163, 184, 0.30) !important;
  box-shadow: none !important;
  min-height: 42px !important;
  padding: 8px 12px !important;
}

body[data-page="news"] .np-title,
body[data-page="news"] .np-header .np-title {
  color: #0f172a !important;
  font-size: 0.76rem !important;
  letter-spacing: 0.07em !important;
}

body[data-page="news"] .np-icon {
  color: #2563eb !important;
}

body[data-page="news"] .np-subheader {
  background: linear-gradient(180deg, rgba(250, 252, 255, 0.96), rgba(244, 248, 253, 0.92)) !important;
}

body[data-page="news"] .np-badge.live {
  background: #ef4444 !important;
  border-color: #ef4444 !important;
  color: #fff !important;
}

/* ── Graph page: cleaner shell + sidebar like other modules ─────────────── */
/* .explorer-shell border/border-radius/background/box-shadow removed here:
   superseded by later passes and, ultimately, always beaten by the final
   consolidated rule (~line 6812). */


body[data-page="graph"] .explorer-tab[data-explorer-tab="sigma"] {
  display: none !important;
}

body[data-page="graph"] .explorer-focus-select {
  margin-left: 0 !important;
}


/* ==========================================================================
   Deploy Canonical Layer (April 2026)
   Keep this block at EOF so it resolves earlier overlapping hotfixes.
   ========================================================================== */

:root {
  --deploy-shell-pad-x: clamp(10px, 1.3vw, 20px);
  --deploy-shell-pad-y: 10px;
  --deploy-grid-gap: 10px;
  --deploy-radius-lg: var(--card-radius, 14px);
  --deploy-radius-md: var(--radius-md, 8px);

  --graph-shell-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(246, 249, 255, 0.96) 100%);
  --graph-shell-border: rgba(148, 163, 184, 0.28);
  --graph-shell-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
  --graph-sidebar-bg: linear-gradient(180deg, #f8fafc 0%, #eef2f8 100%);
  --graph-sidebar-border: rgba(148, 163, 184, 0.28);
  --graph-canvas-bg:
    radial-gradient(720px 360px at 46% 2%, rgba(37, 99, 235, 0.14), rgba(4, 11, 22, 0) 64%),
    #f5f8fe;
  --graph-control-bg: #ffffff;
  --graph-control-border: rgba(148, 163, 184, 0.40);
  --graph-control-text: #475569;
  --graph-control-active-bg: rgba(37, 99, 235, 0.14);
  --graph-control-active-border: rgba(37, 99, 235, 0.44);
  --graph-control-active-text: #1d4ed8;
  --graph-muted: #64748b;

  --news-shell-bg:
    radial-gradient(1000px 340px at 18% -12%, rgba(59, 130, 246, 0.15), transparent 70%),
    linear-gradient(180deg, #eef3fb 0%, #f7f9fc 100%);
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Contrast corrections on dark chrome */
.sidebar-section-head {
  color: #8ea6c5;
}

.sidebar-search-input::placeholder {
  color: #9cb3d1;
}

.topbar--glass .nav-pill {
  color: #cbd5e1;
}

.topbar--glass .nav-pill:hover,
.topbar--glass .nav-pill.active {
  color: #f8fafc;
}

/* ── Graph canonical shell ───────────────────────────────────────────────── */
body[data-page="graph"] .app-main {
  min-height: 100dvh !important;
  height: auto !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

body[data-page="graph"] .app-content {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}


/* .explorer-shell border/border-radius/background/box-shadow/min-height
   removed here: superseded by later passes and always beaten by the final
   consolidated rule (~line 6812). --graph-shell-bg/-shadow and
   --deploy-radius-lg (declared ~line 20173-20178) have no other consumer
   after this removal; left in place as harmless unused tokens rather than
   expanding this pass's scope. */


body[data-page="graph"] .sigma-shell {
  border-top: 0 !important;
}


body[data-page="graph"] .sigma-layout-chip,
body[data-page="graph"] .sigma-edge-mode-chip,
body[data-page="graph"] .sigma-affinity-chip,
body[data-page="graph"] .sigma-topic-chip,
body[data-page="graph"] .sg-text-btn {
  background: var(--graph-control-bg) !important;
  border-color: var(--graph-control-border) !important;
  color: var(--graph-control-text) !important;
}


body[data-page="graph"] .sg-select,
body[data-page="graph"] .sg-search-input {
  background: #fff !important;
  border-color: rgba(148, 163, 184, 0.44) !important;
  color: #0f172a !important;
}


body[data-page="graph"] .sg-legend-item:hover .sg-legend-lbl {
  color: #1e293b !important;
}

/* ── News canonical viewport behavior ────────────────────────────────────── */
body[data-page="news"] {
  overflow-y: auto !important;
}

body[data-page="news"] .app-main {
  display: block !important;
  min-height: 100dvh !important;
  height: auto !important;
  overflow: visible !important;
}

body[data-page="news"] .app-content {
  min-height: 0 !important;
  overflow: visible !important;
  padding: var(--deploy-shell-pad-y) var(--deploy-shell-pad-x) calc(var(--deploy-shell-pad-y) + 2px) !important;
  background: var(--news-shell-bg) !important;
}

body[data-page="news"] .news-workspace {
  display: grid !important;
  grid-template-rows: auto auto auto minmax(0, auto) !important;
  gap: var(--deploy-grid-gap) !important;
  height: auto !important;
  overflow: visible !important;
}

body[data-page="news"] .news-grid,
body[data-page="news"] .news-grid[data-news-layout="default"],
body[data-page="news"] .news-grid[data-news-layout="focus"],
body[data-page="news"] .news-grid[data-news-layout="responsive"] {
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: visible !important;
  gap: var(--deploy-grid-gap) !important;
  grid-auto-rows: minmax(280px, auto);
}

body[data-page="news"] .np {
  min-height: 0 !important;
  height: auto !important;
  max-height: none !important;
}

body[data-page="news"] .panel-search .search-results-body,
body[data-page="news"] .panel-search .search-preview-body,
body[data-page="news"] .panel-feed .np-body,
body[data-page="news"] .panel-ep-live .np-body,
body[data-page="news"] .panel-mep .np-body,
body[data-page="news"] .panel-sources .np-body {
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

/* ── Mobile + zoom safety ────────────────────────────────────────────────── */
@media (max-width: 900px) {
  body[data-page] input[type="text"],
  body[data-page] input[type="search"],
  body[data-page] input[type="email"],
  body[data-page] input[type="password"],
  body[data-page] select,
  body[data-page] textarea {
    font-size: 16px !important;
  }

  body[data-page="graph"] .app-main,
  body[data-page="graph"] .app-content {
    overflow: visible !important;
  }

  body[data-page="graph"] .sigma-page-content {
    padding: 8px 0 0 !important;
    overflow: visible !important;
  }

  body[data-page="graph"] #explorerPanelSigma {
    padding: 0 !important;
    overflow: visible !important;
  }

  body[data-page="graph"] .sigma-stage-frame {
    min-height: clamp(520px, 72dvh, 760px);
  }

  body[data-page="graph"] .sigma-stage-frame .sigma-shell {
    min-height: clamp(520px, 72dvh, 760px);
  }

  body[data-page="graph"] .sigma-sidebar {
    height: 100dvh;
  }

  body[data-page="graph"] .sg-zoom-btn {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }

  body[data-page="news"] .panel-feed .np-body,
  body[data-page="news"] .panel-search .np-body,
  body[data-page="news"] .panel-ep-live .np-body,
  body[data-page="news"] .panel-mep .np-body,
  body[data-page="news"] .panel-sources .np-body {
    max-height: none !important;
  }
}

/* ==========================================================================
   Premium Intelligence UI System (April 2026)
   Canonical layer for global consistency across all MandateAtlas pages.
   Keep at EOF so legacy styles resolve underneath this system.
   ========================================================================== */

:root {
  --bg-0: #070d19;
  --bg-1: #0e172b;
  --bg-2: #15233d;
  --bg-3: #1d2d4f;
  --text-1: #e7eefb;
  --text-2: #aebdd8;
  --text-3: #7f94b8;
  --text-panel: #0f172a;
  --text-panel-muted: #475569;
  --accent: #5ba2ff;
  --accent-strong: #3f8df7;
  --accent-soft: rgba(91, 162, 255, 0.16);
  --accent-ring: rgba(91, 162, 255, 0.34);
  /* Sole surviving definition of --success/-warning/-danger (an earlier
     :root, ~line 7074, redeclared the same names at #16a34a/#d97706/#dc2626
     and has been removed as dead). Intentionally NOT aliased to the
     --ma-civic/-caution/-danger trio (~line 24118: #16846f/#b7791f/#c2413d)
     — the hex values differ from both prior sets, so forcing either
     direction would change the color rendered by this pair's current
     consumers (color: var(--success)/var(--warning)/var(--danger) at
     ~line 7160-7190, ~6 call sites total). Unifying the semantic color
     vocabulary is follow-up, per-component work, not part of this pass. */
  --success: #19b26b;
  --warning: #f59e0b;
  --danger: #ef4444;

  --border-soft: rgba(148, 163, 184, 0.24);
  --border-mid: rgba(148, 163, 184, 0.35);
  --border-strong: rgba(148, 163, 184, 0.5);
  --glass-bg: linear-gradient(180deg, rgba(14, 23, 43, 0.82) 0%, rgba(10, 18, 36, 0.78) 100%);
  --glass-bg-soft: linear-gradient(180deg, rgba(16, 27, 49, 0.62) 0%, rgba(9, 17, 34, 0.58) 100%);
  --glass-stroke: rgba(148, 163, 184, 0.26);

  --surface-0: rgba(245, 250, 255, 0.92);
  --surface-1: rgba(250, 253, 255, 0.94);
  --surface-2: rgba(239, 246, 255, 0.88);
  --surface-3: rgba(225, 235, 251, 0.82);

  /* Sole surviving definition of --radius-sm/-md/-lg — a legacy :root
     (~line 511) used to redeclare these same names at 6/8/12px; that block
     lost the cascade (this one is later, equal specificity, no !important)
     and has been removed. Note this is a distinct scale from --ma-radius
     (8px, defined ~line 24106) and is intentionally NOT aliased to it here —
     the values differ (10/14/20 vs 8), so aliasing would change rendering
     for this scale's ~9 remaining consumers. Unifying the two radius scales
     is follow-up work, not part of this de-duplication pass. */
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  /* --space-1..7 removed: declared here but never consumed anywhere in this
     file or the HTML pages (zero `var(--space-N)` call sites) — dead code.
     The active spacing scale used across the newest layers is --ma-step-*
     (defined ~line 24101, 41 call sites); the legacy --sp-1..6 scale
     (~line 552, 5 call sites) is still referenced and left in place. */

  --shadow-1: 0 8px 24px rgba(2, 8, 24, 0.2);
  --shadow-2: 0 18px 52px rgba(2, 8, 24, 0.3);
  --shadow-3: 0 28px 72px rgba(2, 8, 24, 0.4);

  --blur-sm: blur(8px);
  --blur-md: blur(14px);
  --blur-lg: blur(20px);

  --dur-fast: 140ms;
  --dur-base: 210ms;
  --dur-slow: 280ms;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);

  --z-base: 1;
  --z-topbar: 110;
  --z-floating: 220;
  --z-overlay: 3200;
  --z-modal: 3300;
}

html,
body {
  min-height: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "SF Pro Text", "SF Pro Display", Roboto, "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(900px 360px at 8% -18%, rgba(69, 144, 255, 0.24), transparent 70%),
    radial-gradient(760px 340px at 95% -15%, rgba(56, 189, 248, 0.16), transparent 72%),
    linear-gradient(175deg, var(--bg-1) 0%, var(--bg-0) 68%);
  color: var(--text-1);
}

body[data-page],
body[data-page="analysis-redirect"],
body[data-page="login"] {
  margin: 0;
  min-height: 100dvh;
}

* {
  scrollbar-color: rgba(148, 163, 184, 0.42) rgba(15, 23, 42, 0.08);
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.42);
  border-radius: 999px;
  border: 2px solid rgba(15, 23, 42, 0.08);
}

*::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.08);
}

::selection {
  background: rgba(59, 130, 246, 0.3);
  color: #fff;
}

a {
  color: #2f83ff;
}

a:hover {
  color: #1f6fe2;
}

:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.82), 0 0 0 4px var(--accent-ring);
}

/* -- Shell + Layout ------------------------------------------------------- */
body[data-page] .app-main,
body[data-page] .app-shell {
  min-height: 100dvh;
}

body[data-page] .app-main {
  display: flex;
  flex-direction: column;
}

body[data-page] .app-content,
body[data-page] .dashboard-content,
body[data-page] .sigma-page-content,
body[data-page] .policy-page,
body[data-page] .landing-page {
  position: relative;
  z-index: var(--z-base);
}

body[data-page] .container,
body[data-page] .container--wide,
body[data-page] .landing-wrap,
body[data-page] .policy-wrap {
  width: min(1460px, 100% - clamp(18px, 3.2vw, 50px));
  margin-inline: auto;
}

body[data-page="dataset"] .app-content,
body[data-page="dashboard"] .app-content,
body[data-page="intel"] .app-content,
body[data-page="graph"] .app-content,
body[data-page="workspace-home"] .app-content,
body[data-page="parliament-members"] .dashboard-content {
  padding-top: clamp(12px, 1.5vw, 18px) !important;
  padding-bottom: clamp(16px, 2.2vw, 28px) !important;
}


/* -- Topbar + Navigation -------------------------------------------------- */
body[data-page] .topbar,
body[data-page] .topbar.topbar--glass {
  position: sticky !important;
  top: 0;
  z-index: var(--z-topbar);
  min-height: 62px;
  padding: 10px clamp(12px, 2vw, 26px);
  border-bottom: 1px solid var(--glass-stroke);
  background: var(--glass-bg) !important;
  color: var(--text-1);
  -webkit-backdrop-filter: var(--blur-md);
  backdrop-filter: var(--blur-md);
  box-shadow: 0 10px 34px rgba(2, 8, 24, 0.32);
}

body[data-page] .topbar-brand {
  gap: 12px;
}

body[data-page] .brand-link {
  border-radius: var(--radius-sm);
  transition: transform var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}

body[data-page] .brand-link:hover {
  transform: translateY(-1px);
}


body[data-page] .topbar-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

body[data-page] .nav-pill {
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  color: var(--text-2) !important;
  background: transparent;
  min-height: 34px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition:
    color var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out),
    background var(--dur-fast) var(--ease-out),
    transform var(--dur-fast) var(--ease-out);
}


body[data-page] .topbar-actions {
  gap: 10px;
}

body[data-page] .sessions-badge,
body[data-page] .live-update,
body[data-page] .topbar-user-pill {
  border-radius: var(--radius-pill);
  border: 1px solid rgba(148, 163, 184, 0.32);
  background: rgba(148, 163, 184, 0.14);
  color: var(--text-1);
  min-height: 32px;
  padding: 6px 11px;
  font-size: 11px;
  font-weight: 600;
}

body[data-page] .topbar-user-pill:hover {
  background: rgba(91, 162, 255, 0.2);
  border-color: rgba(91, 162, 255, 0.48);
}

/* -- Typographic rhythm --------------------------------------------------- */

body[data-page] .landing-subtitle {
  color: var(--text-panel-muted);
}

/* -- Core surfaces -------------------------------------------------------- */
body[data-page] .panel,
body[data-page] .chart-card,
body[data-page] .landing-offer-card,
body[data-page] .landing-feature-card,
body[data-page] .landing-login-card,
body[data-page] .policy-hero,
body[data-page] .policy-toc,
body[data-page] .policy-shell,
body[data-page] .news-panel-section,
body[data-page] .news-hero-panel,
body[data-page] .np,
body[data-page] .admin-cc__action-card,
body[data-page] .snapshot-stat,
body[data-page] .dashboard-dataset-snapshot,
body[data-page] .dashboard-brand-card,
body[data-page] .pm-profile-votemix-card,
body[data-page] .pm-profile-overview-card,
body[data-page] .pm-profile-contact-card,
body[data-page] .pm-profile-kpi,
body[data-page] .cp-context-card,
body[data-page] .cp-personal-card,
body[data-page] .cp-drilldown-card,
body[data-page] .tm-discovery-card,
body[data-page] .tm-gd-card,
body[data-page] .tm-hypothesis,
body[data-page] .tm-cluster-card,
body[data-page] .tm-context-card,
body[data-page] .tm-topic-focus-card,
body[data-page] .tm-topic-card,
body[data-page] .tm-opportunity-card {
  background: linear-gradient(180deg, var(--surface-1) 0%, var(--surface-0) 100%) !important;
  border: 1px solid var(--border-soft) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-1);
  color: var(--text-panel);
}

body[data-page] .sigma-sidebar,
body[data-page] .news-left-rail {
  background: var(--glass-bg-soft) !important;
  border-right: 1px solid var(--glass-stroke) !important;
  color: var(--text-1);
  -webkit-backdrop-filter: var(--blur-sm);
  backdrop-filter: var(--blur-sm);
}

body[data-page] .article-card,
body[data-page] .cp-context-card,
body[data-page] .cp-personal-card {
  transition:
    transform var(--dur-base) var(--ease-out),
    box-shadow var(--dur-base) var(--ease-out),
    border-color var(--dur-base) var(--ease-out);
}


/* -- Buttons -------------------------------------------------------------- */
body[data-page] .control-btn,
body[data-page] .upload-btn,
body[data-page] .np-btn,
body[data-page] .news-top-action,
body[data-page] .sidebar-reset-btn,
body[data-page] .tm-lens-chip,
body[data-page] .explorer-tab,
body[data-page] .panel-collapse-btn,
body[data-page] .pm-profile-influence-preset,
body[data-page] .tm-discovery-overlay-close,
body[data-page] .news-reader-close,
body[data-page] .cp-help-close,
body[data-page] .tm-help-close {
  border-radius: 11px;
  border: 1px solid var(--border-mid);
  min-height: 34px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 620;
  line-height: 1.2;
  letter-spacing: 0.01em;
  transition:
    transform var(--dur-fast) var(--ease-out),
    background var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-fast) var(--ease-out);
}

body[data-page] .upload-btn.secondary,
body[data-page] .control-btn.ghost,
body[data-page] .control-btn.is-utility,
body[data-page] .np-btn.ghost {
  background: rgba(255, 255, 255, 0.9);
  color: #1e293b;
}

body[data-page] .tm-lens-chip:hover,
body[data-page] .explorer-tab:hover,
body[data-page] .pm-profile-influence-preset:hover {
  transform: translateY(-1px);
  border-color: rgba(91, 162, 255, 0.45);
  color: #0f172a;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.14);
}

/* .control-btn.primary/.control-btn.is-primary/.upload-btn.primary/
   .np-btn.primary/.news-top-action.is-primary removed from the two selector
   lists below: this pass's contribution to those specific selectors was
   already fully dead (overridden by two later passes — see the consolidated
   rule near line 24354/27434). The remaining selectors here
   (sidebar-reset-btn, tm-lens-chip.active, sidebar-panel-link.active,
   explorer-tab.active, pm-profile-influence-preset.is-active) are unrelated
   "active state" pileups of their own and are out of scope for this pass —
   left exactly as they were. */
body[data-page] .pm-profile-influence-preset.is-active {
  background: linear-gradient(138deg, #3d86f3 0%, #2f73db 56%, #2d67ca 100%) !important;
  color: #f8fbff !important;
  border-color: rgba(59, 130, 246, 0.78) !important;
  box-shadow: 0 10px 22px rgba(44, 107, 209, 0.36);
}

body[data-page] .explorer-tab.active:hover {
  background: linear-gradient(138deg, #4a94ff 0%, #3179e6 62%, #2a66ca 100%) !important;
}


body[data-page] .sidebar-panel-link[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* -- Forms / Filters ------------------------------------------------------ */
body[data-page] input[type="text"],
body[data-page] input[type="search"],
body[data-page] input[type="email"],
body[data-page] input[type="password"],
body[data-page] select,
body[data-page] textarea,
body[data-page] .search-input,
body[data-page] .sidebar-filter-ctrl,
body[data-page] .sidebar-search-input,
body[data-page] .pm-vb-select,
body[data-page] .ns-input,
body[data-page] .cp-search-input,
body[data-page] .sg-select,
body[data-page] .sg-search-input {
  border-radius: 11px;
  border: 1px solid var(--border-mid);
  background: rgba(255, 255, 255, 0.92);
  color: #0f172a;
  min-height: 38px;
  padding: 8px 11px;
  font-size: 13px;
  font-family: inherit;
  transition:
    border-color var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-fast) var(--ease-out),
    background var(--dur-fast) var(--ease-out);
}

body[data-page] input::placeholder,
body[data-page] textarea::placeholder,
body[data-page] .search-input::placeholder,
body[data-page] .cp-search-input::placeholder,
body[data-page] .sg-search-input::placeholder {
  color: #7c8ba7;
}

body[data-page] .cp-search-input:focus,
body[data-page] .sg-search-input:focus {
  border-color: rgba(91, 162, 255, 0.66);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(91, 162, 255, 0.18);
  outline: 0;
}

body[data-page] input[type="radio"] {
  accent-color: #3f8df7;
}


/* -- Chips / badges ------------------------------------------------------- */
body[data-page] .dashboard-brand-chip,
body[data-page] .group-badge,
body[data-page] .pm-profile-mini-badge,
body[data-page] .sidebar-kpi,
body[data-page] .tm-signal-badge,
body[data-page] .tm-discovery-overlay-pill,
body[data-page] .ns-status-tag,
body[data-page] .feed-layout-mode-badge,
body[data-page] .inst-tab,
body[data-page] .sg-legend-item,
body[data-page] .pm-brief-signal-type,
body[data-page] .pm-brief-signal-sentiment,
body[data-page] .cp-detail-chip,
body[data-page] .snapshot-icon {
  border-radius: var(--radius-pill);
  border: 1px solid rgba(148, 163, 184, 0.38);
  background: rgba(226, 235, 248, 0.7);
  color: #334155;
}

body[data-page] .inst-tab.active,
body[data-page] .tm-signal-badge--strong,
body[data-page] .ns-status-tag.is-live {
  border-color: rgba(59, 130, 246, 0.52);
  background: rgba(59, 130, 246, 0.16);
  color: #1d4ed8;
}

/* -- Tables / data lists -------------------------------------------------- */
body[data-page] table,
body[data-page] .cp-drill-table,
body[data-page] .table,
body[data-page] .tm-table,
body[data-page] .pm-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.94);
}

body[data-page] table thead th,
body[data-page] .cp-drill-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #475569;
  background: rgba(241, 245, 249, 0.96);
  border-bottom: 1px solid var(--border-soft);
  padding: 10px 11px;
}

body[data-page] table tbody td,
body[data-page] .cp-drill-table tbody td {
  font-size: 12px;
  color: #1e293b;
  border-bottom: 1px solid rgba(226, 232, 240, 0.74);
  padding: 9px 11px;
}

body[data-page] .cp-drill-table tbody tr:hover {
  background: rgba(56, 139, 253, 0.08);
}

/* -- Loading / empty / error states -------------------------------------- */


body[data-page] .np-empty,
body[data-page] .mep-card-no-data,
body[data-page] .sg-sel-empty,
body[data-page] .tm-empty,
body[data-page] .pm-empty,
body[data-page] .error-banner,
body[data-page] .pm-error-banner {
  border: 1px dashed rgba(148, 163, 184, 0.44);
  border-radius: var(--radius-md);
  background: rgba(248, 250, 252, 0.82);
  color: #64748b;
}

body[data-page] .spinner {
  border-color: rgba(148, 163, 184, 0.4);
  border-top-color: #4d8ff8;
}

/* -- Unified overlays / drawers / modals --------------------------------- */
.mep-card-drawer,
.cp-help-overlay,
.tm-help-overlay,
.tm-discovery-overlay,
.news-reader-overlay,
.settings-overlay,
.intel-target-picker-overlay {
  z-index: var(--z-overlay) !important;
}

.cp-help-backdrop,
.tm-help-backdrop,
.tm-discovery-overlay-backdrop,
.news-reader-backdrop,
.settings-overlay,
.intel-target-picker-overlay,
.mep-card-drawer:not(.is-hidden) {
  background: rgba(3, 9, 20, 0.6) !important;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.cp-help-card,
.tm-help-card,
.tm-discovery-overlay-card,
.settings-card,
.intel-target-picker-card,
.news-reader-modal,
.mep-card-panel,
.pm-brief-overlay-card {
  border: 1px solid rgba(148, 163, 184, 0.34) !important;
  border-radius: 18px !important;
  background: linear-gradient(180deg, rgba(252, 254, 255, 0.98) 0%, rgba(243, 249, 255, 0.96) 100%) !important;
  box-shadow: var(--shadow-3) !important;
}

.cp-help-overlay,
.tm-help-overlay,
.tm-discovery-overlay,
.news-reader-overlay,
.settings-overlay,
.intel-target-picker-overlay {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity var(--dur-base) var(--ease-out), visibility var(--dur-base) var(--ease-out);
}

.cp-help-overlay.is-hidden,
.tm-help-overlay.is-hidden,
.news-reader-overlay.is-hidden,
.tm-discovery-overlay[aria-hidden="true"],
.settings-overlay:not(.open),
.intel-target-picker-overlay:not(.open) {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.settings-overlay:not(.open),
.intel-target-picker-overlay:not(.open) {
  display: none !important;
}

.mep-card-drawer {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  pointer-events: none;
  background: rgba(3, 9, 20, 0);
  transition: background var(--dur-base) var(--ease-out);
}

.mep-card-drawer.is-hidden {
  display: none !important;
  pointer-events: none !important;
  background: rgba(3, 9, 20, 0) !important;
}

.mep-card-drawer:not(.is-hidden) {
  pointer-events: auto;
  background: rgba(3, 9, 20, 0.56);
}

.mep-card-backdrop {
  background: transparent !important;
}

.mep-card-panel {
  width: min(560px, 95vw) !important;
  min-width: min(420px, 95vw) !important;
  max-width: 95vw !important;
  height: 100dvh !important;
  border-radius: 0 !important;
  border-left: 1px solid rgba(148, 163, 184, 0.34) !important;
  transform: translateX(26px);
  opacity: 0.98;
  transition: transform var(--dur-slow) var(--ease-out), opacity var(--dur-slow) var(--ease-out);
}

.mep-card-drawer:not(.is-hidden) .mep-card-panel {
  transform: translateX(0);
  opacity: 1;
}

/* -- Graph container harmony --------------------------------------------- */
/* .explorer-shell removed here: this intermediate pass set a dark-navy
   radial/linear gradient background with an 18px radius, which was itself
   overridden by later passes and, ultimately, always beaten by the final
   consolidated rule (~line 6812) — it never renders dark navy today. */


body[data-page="graph"] .explorer-tab,
body[data-page="graph"] .sigma-layout-chip,
body[data-page="graph"] .sigma-edge-mode-chip,
body[data-page="graph"] .sigma-affinity-chip,
body[data-page="graph"] .sigma-topic-chip,
body[data-page="graph"] .sg-text-btn {
  border-radius: 10px;
  min-height: 32px;
  padding: 6px 10px;
  color: #c7d8f4 !important;
  background: rgba(26, 41, 67, 0.8) !important;
  border: 1px solid rgba(148, 163, 184, 0.34) !important;
}

body[data-page="graph"] .explorer-tab.active {
  color: #eef5ff !important;
  background: linear-gradient(140deg, rgba(59, 130, 246, 0.54) 0%, rgba(56, 189, 248, 0.36) 100%) !important;
  border-color: rgba(91, 162, 255, 0.62) !important;
}


body[data-page="graph"] .sg-section,
body[data-page="graph"] .sg-selection-panel,
body[data-page="graph"] .sg-sel-wrap {
  border-bottom: 1px solid rgba(148, 163, 184, 0.22) !important;
  color: #c7d8f4 !important;
}


body[data-page="graph"] .sigma-stage-frame .sigma-shell {
  border-color: rgba(148, 163, 184, 0.24) !important;
  box-shadow: 0 16px 42px rgba(2, 8, 24, 0.46) !important;
}


/* -- Landing / privacy / legal polish ------------------------------------ */
body[data-page="landing-public"] .landing-page,
body[data-page="privacy-public"] .policy-page {
  padding-top: 18px;
}

body[data-page="landing-public"] .landing-hero-lite,
body[data-page="landing-public"] .landing-offer-section,
body[data-page="landing-public"] .landing-module-section,
body[data-page="landing-public"] .landing-login-section,
body[data-page="privacy-public"] .policy-hero,
body[data-page="privacy-public"] .policy-toc,
body[data-page="privacy-public"] .policy-shell {
  border-color: rgba(148, 163, 184, 0.26) !important;
  box-shadow: var(--shadow-1);
}

body[data-page="privacy-public"] .policy-section,
body[data-page="privacy-public"] .policy-section p,
body[data-page="privacy-public"] .policy-section li {
  color: #1e293b;
}

/* -- Login + Analysis redirect ------------------------------------------- */
body[data-page="login"] {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
}

body[data-page="login"] .login-card {
  width: min(420px, 100%);
  background: var(--glass-bg);
  border: 1px solid var(--glass-stroke);
  border-radius: 18px;
  padding: 30px 26px;
  box-shadow: var(--shadow-3);
  -webkit-backdrop-filter: var(--blur-md);
  backdrop-filter: var(--blur-md);
}

body[data-page="login"] .login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

body[data-page="login"] .login-brand img {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

body[data-page="login"] .login-brand-name {
  color: #f8fbff;
  font-size: 19px;
  font-weight: 700;
}

body[data-page="login"] .login-title {
  color: var(--text-2);
  font-size: 13px;
  margin-bottom: 20px;
}

body[data-page="login"] #loginForm {
  display: grid;
  gap: 0;
}

body[data-page="login"] label {
  display: block;
  font-size: 11px;
  color: var(--text-2);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

body[data-page="login"] input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 14px;
  background: rgba(250, 253, 255, 0.98);
}

body[data-page="login"] .login-btn {
  display: block;
  width: 100%;
  border-radius: 11px;
  /* Same gradient as the shared .control-btn.primary elsewhere in the app — this page had its
     own distinct blue gradient (138deg, different color stops) for the same "primary action"
     role. Color-only change: radius/height/padding left untouched. */
  border: 1px solid rgba(39, 110, 241, 0.58);
  background: linear-gradient(180deg, var(--ma-action, #276ef1) 0%, var(--ma-action-strong, #1859cc) 100%);
  color: #f8fbff;
  min-height: 40px;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out), filter var(--dur-fast) var(--ease-out);
}

body[data-page="login"] .login-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

body[data-page="login"] .login-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

body[data-page="login"] .login-error {
  margin-top: 14px;
  border-radius: 10px;
  border: 1px solid rgba(248, 113, 113, 0.44);
  background: rgba(127, 29, 29, 0.3);
  color: #fecaca;
  padding: 9px 11px;
  font-size: 12px;
  display: none;
}

body[data-page="login"] .login-error.visible {
  display: block;
}

body[data-page="login"] .login-legal {
  margin-top: 14px;
  text-align: center;
  font-size: 12px;
  color: var(--text-2);
}

body[data-page="login"] .login-legal a {
  color: #93c5fd;
}

body[data-page="analysis-redirect"] {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
}

body[data-page="analysis-redirect"] .analysis-redirect-wrap {
  width: min(520px, 100%);
}

body[data-page="analysis-redirect"] .analysis-redirect-card {
  border-radius: 18px;
  border: 1px solid var(--glass-stroke);
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--blur-md);
  backdrop-filter: var(--blur-md);
  box-shadow: var(--shadow-2);
  padding: 24px;
  color: var(--text-1);
  text-align: center;
}

body[data-page="analysis-redirect"] .analysis-redirect-card h1 {
  margin: 0 0 10px;
  font-size: 22px;
  color: #f8fbff;
}

body[data-page="analysis-redirect"] .analysis-redirect-card p {
  margin: 0 0 16px;
  color: var(--text-2);
}

body[data-page="analysis-redirect"] .analysis-redirect-card .control-btn {
  display: inline-flex;
}

/* -- Responsive system ---------------------------------------------------- */
@media (max-width: 1240px) {
  body[data-page] .topbar {
    padding-inline: clamp(10px, 1.8vw, 18px);
  }

  body[data-page] .topbar-actions {
    gap: 8px;
  }

  body[data-page] .nav-pill {
    min-height: 32px;
    padding: 6px 10px;
    font-size: 11px;
  }
}

@media (max-width: 960px) {
  body[data-page] .topbar,
  body[data-page] .topbar.topbar--glass {
    min-height: 58px;
    gap: 8px;
  }

  body[data-page] .topbar-nav {
    max-width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    flex-wrap: nowrap;
    padding-bottom: 2px;
  }

  body[data-page] .sessions-badge,
  body[data-page] .live-update {
    display: none !important;
  }

  body[data-page="parliament-members"] .dashboard-shell,
  body[data-page="topics-mandates"] .dashboard-shell,
  body[data-page="news"] .dashboard-shell {
    min-height: 0 !important;
  }

  body[data-page] .panel,
  body[data-page] .chart-card,
  body[data-page] .news-panel-section {
    border-radius: 16px !important;
  }

  .mep-card-panel {
    width: min(100vw, 100%) !important;
    min-width: 0 !important;
  }
}

@media (max-width: 720px) {
  body[data-page] .container,
  body[data-page] .container--wide,
  body[data-page] .landing-wrap,
  body[data-page] .policy-wrap {
    width: min(100% - 20px, 1460px);
  }

  body[data-page] .topbar-brand .brand-copy {
    display: none;
  }

  body[data-page] .topbar-actions {
    margin-left: auto;
    min-width: 0;
  }

  body[data-page] .control-btn,
  body[data-page] .upload-btn,
  body[data-page] .np-btn,
  body[data-page] .sidebar-panel-link,
  body[data-page] .explorer-tab {
    min-height: 36px;
    font-size: 12px;
  }

  body[data-page] .panel,
  body[data-page] .chart-card,
  body[data-page] .landing-feature-card,
  body[data-page] .landing-offer-card,
  body[data-page] .news-panel-section {
    padding: 14px !important;
  }

  body[data-page="login"] {
    padding: 14px;
  }

  body[data-page="login"] .login-card {
    padding: 24px 18px;
  }
}

/* ==========================================================================
   Production UI Polish (April 2026)
   Refines buttons, cards, inputs, chips, and scroll animations across all
   body[data-page] pages. Dark-surface aware. Apple-adjacent design language.
   ========================================================================== */

/* ── 1. Button system – refined glass-surface with depth ─────────────────── */
body[data-page] .control-btn,
body[data-page] .upload-btn,
body[data-page] .np-btn,
body[data-page] .news-top-action,
body[data-page] .panel-collapse-btn,
body[data-page] .tm-discovery-overlay-close,
body[data-page] .news-reader-close,
body[data-page] .cp-help-close,
body[data-page] .tm-help-close {
  border-radius: 10px !important;
  border: 1px solid rgba(148, 163, 184, 0.32) !important;
  background: rgba(255, 255, 255, 0.94) !important;
  color: #1a2740 !important;
  min-height: 34px !important;
  padding: 7px 13px !important;
  font-size: 12.5px !important;
  font-weight: 580 !important;
  letter-spacing: 0.005em !important;
  box-shadow:
    0 1px 3px rgba(15, 23, 42, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.85) !important;
  transition:
    transform 120ms cubic-bezier(0.22, 1, 0.36, 1),
    background 120ms ease,
    border-color 120ms ease,
    box-shadow 120ms ease,
    color 120ms ease !important;
}

body[data-page] .control-btn:hover,
body[data-page] .upload-btn:hover,
body[data-page] .np-btn:hover,
body[data-page] .news-top-action:hover,
body[data-page] .panel-collapse-btn:hover,
body[data-page] .tm-discovery-overlay-close:hover,
body[data-page] .news-reader-close:hover {
  background: rgba(255, 255, 255, 0.99) !important;
  border-color: rgba(91, 162, 255, 0.42) !important;
  color: #0d1c35 !important;
  box-shadow:
    0 4px 12px rgba(15, 23, 42, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
  transform: translateY(-1px) !important;
}

body[data-page] .control-btn:active,
body[data-page] .upload-btn:active,
body[data-page] .np-btn:active {
  transform: scale(0.975) translateY(0) !important;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.1) !important;
}

/* Primary CTA — rich blue, pastel glow.
   The base (non-:hover) rule that used to sit here is removed: it was fully
   dead, overridden by the consolidated rule (~line 24354/27434 area) for
   every selector it targeted. The :hover rule below is, however, currently
   the ONLY :hover declaration in the file for these four selectors — it is
   the live, winning hover state and is kept as-is. */
body[data-page] .control-btn.primary:hover,
body[data-page] .control-btn.is-primary:hover,
body[data-page] .upload-btn.primary:hover,
body[data-page] .np-btn.primary:hover {
  background: linear-gradient(152deg, #5498ff 0%, #3680f0 52%, #2a6bdd 100%) !important;
  box-shadow:
    0 6px 20px rgba(44, 107, 209, 0.46),
    inset 0 1px 0 rgba(255, 255, 255, 0.26) !important;
  border-color: rgba(59, 130, 246, 0.82) !important;
  transform: translateY(-1px) !important;
}

/* Danger */
body[data-page] .control-btn.danger,
body[data-page] .upload-btn.danger,
body[data-page] .np-btn.danger {
  background: rgba(254, 242, 242, 0.96) !important;
  border-color: rgba(239, 68, 68, 0.38) !important;
  color: #b91c1c !important;
  box-shadow: 0 1px 3px rgba(185, 28, 28, 0.08) !important;
}

body[data-page] .control-btn.danger:hover,
body[data-page] .upload-btn.danger:hover {
  background: rgba(254, 226, 226, 0.98) !important;
  border-color: rgba(239, 68, 68, 0.56) !important;
  box-shadow: 0 4px 12px rgba(185, 28, 28, 0.14) !important;
}

/* Disabled */
body[data-page] .control-btn[disabled],
body[data-page] .upload-btn[disabled],
body[data-page] .np-btn[disabled] {
  opacity: 0.44 !important;
  cursor: not-allowed !important;
  transform: none !important;
  box-shadow: none !important;
}

/* ── 2. Chips — pastel active, elegant default ───────────────────────────── */
body[data-page] .chip {
  border-radius: 8px !important;
  border: 1px solid rgba(148, 163, 184, 0.32) !important;
  background: rgba(255, 255, 255, 0.9) !important;
  color: #334155 !important;
  font-size: 12px !important;
  font-weight: 540 !important;
  padding: 5px 11px !important;
  min-height: 28px !important;
  transition:
    background 120ms ease,
    border-color 120ms ease,
    color 120ms ease,
    box-shadow 120ms ease !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.07) !important;
}

body[data-page] .chip:hover:not(.active):not([aria-pressed="true"]) {
  background: rgba(255, 255, 255, 0.98) !important;
  border-color: rgba(91, 162, 255, 0.38) !important;
  color: #1e293b !important;
}

body[data-page] .chip.active,
body[data-page] .chip[aria-pressed="true"] {
  background: linear-gradient(145deg, rgba(219, 234, 254, 0.98) 0%, rgba(199, 220, 255, 0.95) 100%) !important;
  border-color: rgba(59, 130, 246, 0.52) !important;
  color: #1d4ed8 !important;
  font-weight: 640 !important;
  box-shadow:
    0 2px 8px rgba(59, 130, 246, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.7) !important;
}

/* ── 3. Inputs — cleaner, more precise ──────────────────────────────────── */
body[data-page] input[type="text"],
body[data-page] input[type="search"],
body[data-page] input[type="email"],
body[data-page] select,
body[data-page] textarea,
body[data-page] .search-input,
body[data-page] .pm-vb-select,
body[data-page] .ns-input,
body[data-page] .cp-search-input,
body[data-page] .sg-select,
body[data-page] .sg-search-input {
  border-radius: 10px !important;
  border: 1px solid rgba(148, 163, 184, 0.34) !important;
  background: rgba(255, 255, 255, 0.94) !important;
  color: #0f172a !important;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.05) !important;
  transition:
    border-color 130ms ease,
    background 130ms ease,
    box-shadow 130ms ease !important;
}

body[data-page] input:focus,
body[data-page] select:focus,
body[data-page] textarea:focus,
body[data-page] .search-input:focus,
body[data-page] .pm-vb-select:focus,
body[data-page] .sg-select:focus {
  border-color: rgba(59, 130, 246, 0.6) !important;
  background: #fff !important;
  box-shadow:
    0 0 0 3px rgba(59, 130, 246, 0.14),
    inset 0 1px 2px rgba(15, 23, 42, 0.04) !important;
  outline: 0 !important;
}

/* ── 4. Panel / card surface – crisper elevation ─────────────────────────── */
body[data-page] .landing-feature-card,
body[data-page] .landing-offer-card {
  background: rgba(252, 254, 255, 0.95) !important;
  border: 1px solid rgba(200, 215, 235, 0.55) !important;
  border-radius: 14px !important;
  box-shadow:
    0 1px 3px rgba(15, 23, 42, 0.07),
    0 4px 14px rgba(15, 23, 42, 0.05) !important;
}


/* MEP cards — light, clean */
body[data-page="parliament-members"] .pm-mcard {
  background: linear-gradient(165deg, rgba(255,255,255,0.98) 0%, rgba(246,250,255,0.96) 100%) !important;
  border: 1px solid rgba(200, 215, 235, 0.52) !important;
  border-radius: 12px !important;
  box-shadow: 0 1px 3px rgba(15,23,42,0.07), 0 1px 2px rgba(15,23,42,0.04) !important;
  transition:
    transform 160ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 160ms ease,
    border-color 160ms ease !important;
}
body[data-page="parliament-members"] .pm-mcard:hover {
  border-color: rgba(59, 130, 246, 0.34) !important;
  box-shadow:
    0 6px 18px rgba(37, 99, 235, 0.14),
    0 1px 4px rgba(15,23,42,0.06) !important;
  transform: translateY(-2px) !important;
}

/* ── 5. Topbar pills — refined active indicator ──────────────────────────── */


/* ── 6. Scroll-reveal animations ─────────────────────────────────────────── */
@keyframes ma-fade-up {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes ma-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Elements start invisible only when animations.js is running (it sets html.ma-reveal); on a
   page without it they are simply visible instead of stuck at opacity 0. */
html.ma-reveal body[data-page] .panel,
html.ma-reveal body[data-page] .chart-card,
html.ma-reveal body[data-page] .pm-mcard,
html.ma-reveal body[data-page] .tm-topic-card,
html.ma-reveal body[data-page] .tm-opportunity-card,
html.ma-reveal body[data-page] .landing-feature-card,
html.ma-reveal body[data-page] .landing-offer-card,
html.ma-reveal body[data-page] .news-story-card,
html.ma-reveal body[data-page] .hero-panel,
html.ma-reveal body[data-page] .dashboard-hero,
html.ma-reveal body[data-page] .pm-kpi-strip,
html.ma-reveal body[data-page] .pm-kpi-strip--modern {
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    border-color var(--dur-base) var(--ease-out),
    box-shadow var(--dur-base) var(--ease-out) !important;
}

body[data-page] .panel.ma-visible,
body[data-page] .chart-card.ma-visible,
body[data-page] .pm-mcard.ma-visible,
body[data-page] .tm-topic-card.ma-visible,
body[data-page] .tm-opportunity-card.ma-visible,
body[data-page] .landing-feature-card.ma-visible,
body[data-page] .landing-offer-card.ma-visible,
body[data-page] .news-story-card.ma-visible,
body[data-page] .hero-panel.ma-visible,
body[data-page] .dashboard-hero.ma-visible,
body[data-page] .pm-kpi-strip.ma-visible,
body[data-page] .pm-kpi-strip--modern.ma-visible {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  body[data-page] .panel,
  body[data-page] .chart-card,
  body[data-page] .pm-mcard,
  body[data-page] .tm-topic-card,
  body[data-page] .tm-opportunity-card,
  body[data-page] .landing-feature-card,
  body[data-page] .landing-offer-card,
  body[data-page] .news-story-card,
  body[data-page] .hero-panel,
  body[data-page] .dashboard-hero,
  body[data-page] .pm-kpi-strip,
  body[data-page] .pm-kpi-strip--modern {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* ==========================================================================
   Sidebar — Apple-quality dark panel (production polish, April 2026)
   Overrides the global body[data-page] light-mode defaults for all sidebar
   elements. Sidebar is always dark glass regardless of page theme.
   ========================================================================== */

/* ── 1. Shell ─────────────────────────────────────────────────────────────── */
body[data-page] .dashboard-sidebar {
  background: rgba(7, 12, 24, 0.84) !important;
  -webkit-backdrop-filter: blur(22px) saturate(1.5) !important;
  backdrop-filter: blur(22px) saturate(1.5) !important;
  border-right: 1px solid rgba(255, 255, 255, 0.065) !important;
  box-shadow: 2px 0 24px rgba(0, 0, 0, 0.18);
  width: 252px;
  min-width: 252px;
}

/* scrollbar – hairline */
body[data-page] .dashboard-sidebar::-webkit-scrollbar { width: 3px; }
body[data-page] .dashboard-sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.13);
  border-radius: 3px;
}
body[data-page] .dashboard-sidebar::-webkit-scrollbar-track { background: transparent; }

/* ── 2. Section headings ─────────────────────────────────────────────────── */
body[data-page] .sidebar-section-head {
  font-size: 10px !important;
  font-weight: 700 !important;
  letter-spacing: 0.115em !important;
  text-transform: uppercase !important;
  color: rgba(120, 148, 190, 0.62) !important;
  padding: 18px 14px 5px 14px !important;
  -webkit-user-select: none;
  user-select: none;
}

/* ── 3. Navigation links – dark-surface style ─────────────────────────────── */
body[data-page] .sidebar-panel-nav {
  padding: 3px 8px !important;
  gap: 1px !important;
}

body[data-page] .sidebar-panel-link {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: rgba(165, 192, 230, 0.68) !important;
  border-radius: 8px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  line-height: 1.3 !important;
  padding: 7px 10px !important;
  min-height: 30px !important;
  gap: 8px !important;
  letter-spacing: 0 !important;
  transition:
    background 130ms ease,
    color 130ms ease !important;
}

body[data-page] .sidebar-panel-link:hover {
  background: rgba(255, 255, 255, 0.075) !important;
  color: rgba(215, 232, 255, 0.92) !important;
  transform: none !important;
  box-shadow: none !important;
  border-color: transparent !important;
}

body[data-page] .sidebar-panel-link.active {
  background: rgba(59, 130, 246, 0.2) !important;
  color: #8cc4ff !important;
  font-weight: 600 !important;
  border: none !important;
  box-shadow: none !important;
}

body[data-page] .sidebar-panel-link.active:hover {
  background: rgba(59, 130, 246, 0.27) !important;
  box-shadow: none !important;
}

body[data-page] .sidebar-panel-link svg {
  opacity: 0.65;
  flex-shrink: 0;
}
body[data-page] .sidebar-panel-link:hover svg,
body[data-page] .sidebar-panel-link.active svg { opacity: 1; }

body[data-page] .sidebar-panel-link[disabled] {
  opacity: 0.38 !important;
  cursor: not-allowed !important;
  pointer-events: none;
}

/* ── 4. Filter labels ─────────────────────────────────────────────────────── */
body[data-page] .sidebar-filter-label {
  font-size: 10px !important;
  font-weight: 700 !important;
  letter-spacing: 0.1em !important;
  text-transform: uppercase !important;
  color: rgba(120, 148, 190, 0.55) !important;
  margin-bottom: 3px;
}

/* ── 5. Inputs and selects inside sidebar – dark-mode override ────────────── */
body[data-page] .dashboard-sidebar .sidebar-filter-ctrl,
body[data-page] .dashboard-sidebar .sidebar-search-input,
body[data-page] .sidebar-filter-ctrl,
body[data-page] .sidebar-search-input {
  background: rgba(255, 255, 255, 0.07) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #c4d4ed !important;
  border-radius: 8px !important;
  min-height: 32px !important;
  padding: 6px 10px !important;
  font-size: 12.5px !important;
  box-shadow: none !important;
  transition:
    border-color 130ms ease,
    background 130ms ease,
    box-shadow 130ms ease !important;
}

body[data-page] .dashboard-sidebar .sidebar-filter-ctrl:focus,
body[data-page] .dashboard-sidebar .sidebar-search-input:focus,
body[data-page] .sidebar-filter-ctrl:focus,
body[data-page] .sidebar-search-input:focus {
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(91, 162, 255, 0.52) !important;
  box-shadow: 0 0 0 3px rgba(91, 162, 255, 0.13) !important;
  outline: 0;
}

body[data-page] .sidebar-filter-ctrl option {
  background: #0c1628 !important;
  color: #b8ccec !important;
}

body[data-page] .sidebar-filter-ctrl::placeholder {
  color: rgba(120, 148, 190, 0.52) !important;
}

/* ── 6. Filter section spacing ───────────────────────────────────────────── */
body[data-page] .sidebar-filters {
  padding: 0 14px 6px 14px !important;
  gap: 10px !important;
}
body[data-page] .sidebar-filter-group { gap: 4px !important; }
body[data-page] .sidebar-search-wrap { padding: 0 14px 8px 14px !important; }

/* Search button inside search wrap */
body[data-page] .sidebar-search-btn {
  color: rgba(120, 148, 190, 0.55) !important;
  background: none !important;
  border: none !important;
}
body[data-page] .sidebar-search-btn:hover { color: #7eb8ff !important; }

/* ── 7. Divider ───────────────────────────────────────────────────────────── */
body[data-page] .sidebar-divider {
  background: rgba(255, 255, 255, 0.055) !important;
  height: 1px !important;
  margin: 8px 14px !important;
}

/* ── 8. Reset button ─────────────────────────────────────────────────────── */
body[data-page] .sidebar-reset-btn:hover {
  background: rgba(255, 255, 255, 0.07) !important;
  border-color: rgba(91, 162, 255, 0.32) !important;
  color: #7eb8ff !important;
  transform: none !important;
  box-shadow: none !important;
}

/* ── 9. Checkbox rows ─────────────────────────────────────────────────────── */
body[data-page] .sidebar-checkbox-row {
  color: rgba(165, 192, 230, 0.72) !important;
  font-size: 12.5px !important;
}

/* ── 10. Footer ingest button ────────────────────────────────────────────── */
body[data-page] .sidebar-ingest-btn {
  background: rgba(59, 130, 246, 0.13) !important;
  border: 1px solid rgba(59, 130, 246, 0.28) !important;
  color: #7eb8ff !important;
  border-radius: 9px !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  min-height: 34px !important;
  box-shadow: none !important;
  transition:
    background 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease !important;
}
body[data-page] .sidebar-ingest-btn:hover {
  background: rgba(59, 130, 246, 0.22) !important;
  border-color: rgba(59, 130, 246, 0.48) !important;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.22) !important;
  transform: none !important;
}

/* ── 11. Parliament Members — MEP search input (dark override) ────────────── */
body[data-page="parliament-members"] .pm-sidebar-search-wrap .input-with-icon {
  background: rgba(255, 255, 255, 0.07) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 8px !important;
  box-shadow: none !important;
}
body[data-page="parliament-members"] .pm-sidebar-search-wrap .input-with-icon:focus-within {
  border-color: rgba(91, 162, 255, 0.52) !important;
  box-shadow: 0 0 0 3px rgba(91, 162, 255, 0.13) !important;
  background: rgba(255, 255, 255, 0.1) !important;
}
body[data-page="parliament-members"] #pmMemberSearch {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: #c4d4ed !important;
  font-size: 13px !important;
  min-height: unset !important;
  padding: 7px 10px 7px 2.3rem !important;
}
body[data-page="parliament-members"] .pm-sidebar-search-wrap .input-icon {
  color: rgba(120, 148, 190, 0.55) !important;
}

/* Pinned MEPs strip */
body[data-page="parliament-members"] .pm-sidebar-pinned {
  padding: 0 14px !important;
}

/* ── 12. Mobile: sidebar collapses cleanly ───────────────────────────────── */
@media (max-width: 860px) {
  body[data-page] .dashboard-sidebar {
    width: 100% !important;
    min-width: 0 !important;
    border-right: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.065) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    backdrop-filter: blur(16px) !important;
  }
}

/* ==========================================================================
   MandateAtlas — Full Desktop Beauty Pass (April 2026)
   Premium intelligence platform aesthetic: calm · expensive · coherent.
   Covers: typography hierarchy, topbar brand, graph sidebar, KPI strips,
   admin cards, page background, chart frames, section labels, motion.
   ========================================================================== */

/* ── 0. Page canvas — subtle warmth, not flat ────────────────────────────── */
body[data-page] {
  background:
    radial-gradient(ellipse 1200px 600px at 72% -8%, rgba(59, 130, 246, 0.055), transparent 72%),
    radial-gradient(ellipse 900px 400px at 8% 80%, rgba(99, 102, 241, 0.04), transparent 66%),
    #f2f5f9 !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Graph page keeps its own dark canvas — leave untouched */
body[data-page="graph"] {
  background: #0b131f !important;
}

/* ── 1. Topbar — brand hierarchy ─────────────────────────────────────────── */
body[data-page] .topbar--glass {
  background: linear-gradient(180deg, rgba(10, 18, 36, 0.98) 0%, rgba(8, 14, 28, 0.96) 100%) !important;
  -webkit-backdrop-filter: blur(22px) saturate(1.6) !important;
  backdrop-filter: blur(22px) saturate(1.6) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.072) !important;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04),
    0 4px 24px rgba(0, 0, 0, 0.28) !important;
}

body[data-page] .topbar-logo {
  width: 30px !important;
  height: 30px !important;
  border-radius: 9px !important;
  box-shadow:
    0 4px 12px rgba(37, 99, 235, 0.36),
    0 0 0 1px rgba(255, 255, 255, 0.1) inset !important;
  transition: transform 200ms cubic-bezier(0.22, 1, 0.36, 1) !important;
}
body[data-page] .brand-link:hover .topbar-logo {
  transform: scale(1.08) !important;
}

body[data-page] .brand-kicker {
  font-size: 9px !important;
  letter-spacing: 0.12em !important;
  text-transform: uppercase !important;
  font-weight: 700 !important;
  color: rgba(148, 180, 230, 0.55) !important;
  line-height: 1 !important;
}


/* ── 2. Nav pills — underline accent, frosted hover ─────────────────────── */
body[data-page] .nav-pill {
  padding: 5px 11px !important;
  border-radius: 7px !important;
  font-size: 12.5px !important;
  font-weight: 550 !important;
  color: rgba(180, 205, 245, 0.62) !important;
  border: 1px solid transparent !important;
  background: transparent !important;
  position: relative !important;
  transition:
    color 140ms ease,
    background 140ms ease,
    border-color 140ms ease !important;
}
body[data-page] .nav-pill.active,
body[data-page] .nav-pill[aria-current="page"] {
  color: #a5c8ff !important;
  font-weight: 660 !important;
  background: rgba(59, 130, 246, 0.16) !important;
  border-color: rgba(59, 130, 246, 0.28) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}

/* Sessions badge */
body[data-page] .sessions-badge {
  font-size: 11px !important;
  font-weight: 580 !important;
  color: rgba(148, 180, 230, 0.72) !important;
  letter-spacing: 0.02em !important;
  padding: 3px 8px !important;
  border-radius: 20px !important;
  border: 1px solid rgba(148, 163, 184, 0.2) !important;
  background: rgba(255, 255, 255, 0.04) !important;
}

/* ── 3. Typography hierarchy ─────────────────────────────────────────────── */

/* Page-level section headings inside panels */
body[data-page] .panel h2,
body[data-page] .chart-card h2 {
  font-size: 17px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  letter-spacing: -0.02em !important;
  line-height: 1.25 !important;
  margin-top: 0 !important;
  margin-bottom: 4px !important;
}

body[data-page] .panel h3,
body[data-page] .chart-card h3 {
  font-size: 14px !important;
  font-weight: 650 !important;
  color: #1e293b !important;
  letter-spacing: -0.01em !important;
  line-height: 1.3 !important;
  margin-top: 0 !important;
  margin-bottom: 3px !important;
}

/* Section kickers / uppercase labels */
body[data-page] .section-label,
body[data-page] .admin-cc__section-label,
body[data-page] .dash-section-hdr > span:first-child,
body[data-page] .sg-section-title {
  font-size: 10px !important;
  font-weight: 780 !important;
  letter-spacing: 0.1em !important;
  text-transform: uppercase !important;
}

/* ── 4. Graph sidebar — dark-surface section hierarchy ───────────────────── */

/* Section titles: dim default, brighter text */
body[data-page="graph"] .sg-section-title {
  font-size: 10px !important;
  font-weight: 780 !important;
  letter-spacing: 0.1em !important;
  text-transform: uppercase !important;
  color: rgba(130, 163, 215, 0.58) !important;
  padding-bottom: 4px !important;
}

/* Chips in dark sidebar context */
body[data-page="graph"] .sigma-sidebar .sigma-layout-chip,
body[data-page="graph"] .sigma-sidebar .sigma-edge-mode-chip,
body[data-page="graph"] .sigma-sidebar .sigma-affinity-chip,
body[data-page="graph"] .sigma-sidebar .sigma-topic-chip,
body[data-page="graph"] .sigma-sidebar .sg-text-btn {
  background: rgba(255, 255, 255, 0.055) !important;
  border: 1px solid rgba(148, 163, 184, 0.2) !important;
  color: rgba(168, 198, 240, 0.82) !important;
  font-size: 11.5px !important;
  font-weight: 540 !important;
  border-radius: 8px !important;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease !important;
}
body[data-page="graph"] .sigma-sidebar .sigma-layout-chip.active,
body[data-page="graph"] .sigma-sidebar .sigma-edge-mode-chip.active,
body[data-page="graph"] .sigma-sidebar .sigma-affinity-chip.active,
body[data-page="graph"] .sigma-sidebar .sigma-topic-chip.active {
  background: rgba(59, 130, 246, 0.22) !important;
  border-color: rgba(59, 130, 246, 0.48) !important;
  color: #93c5fd !important;
  font-weight: 660 !important;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.18) !important;
}

/* Select in dark sidebar */
body[data-page="graph"] .sigma-sidebar .sg-select {
  background: rgba(255, 255, 255, 0.065) !important;
  border: 1px solid rgba(148, 163, 184, 0.22) !important;
  color: rgba(168, 198, 240, 0.88) !important;
  border-radius: 9px !important;
  font-size: 12.5px !important;
}
body[data-page="graph"] .sigma-sidebar .sg-select:focus {
  border-color: rgba(91, 162, 255, 0.52) !important;
  background: rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.14) !important;
}

/* Range input track — dark */
body[data-page="graph"] .sigma-sidebar input[type="range"] {
  accent-color: #3b82f6;
}

/* Affinity profile subsection note */
body[data-page="graph"] .sg-subtle-note {
  background: rgba(255, 255, 255, 0.045) !important;
  border: 1px dashed rgba(148, 163, 184, 0.22) !important;
  color: rgba(130, 163, 215, 0.72) !important;
  font-size: 11px !important;
  border-radius: 7px !important;
  padding: 6px 8px !important;
}

/* Toggle rows */
body[data-page="graph"] .sg-toggle-row,
body[data-page="graph"] .sg-range-row {
  color: rgba(148, 180, 230, 0.72) !important;
  font-size: 12.5px !important;
}
body[data-page="graph"] .sg-toggle-row strong,
body[data-page="graph"] .sg-range-row strong {
  color: rgba(180, 210, 255, 0.92) !important;
}

/* Selection panel empty state */
body[data-page="graph"] .sg-sel-empty-icon {
  color: rgba(91, 162, 255, 0.38) !important;
  font-size: 28px !important;
}
body[data-page="graph"] .sg-sel-empty-hint {
  font-size: 11px !important;
  color: rgba(130, 163, 215, 0.42) !important;
}

/* Graph group chips — darken inactive */
body[data-page="graph"] .sigma-group-chip {
  opacity: 0.55 !important;
  transition: opacity 130ms ease !important;
  border-radius: 7px !important;
  font-size: 11px !important;
}
body[data-page="graph"] .sigma-group-chip.is-visible {
  opacity: 1 !important;
}

/* Axis labels */
body[data-page="graph"] .sg-axis-label {
  font-size: 10.5px !important;
  font-weight: 700 !important;
  letter-spacing: 0.08em !important;
  color: rgba(148, 180, 230, 0.48) !important;
  text-transform: uppercase !important;
}

/* FA2 badge */
body[data-page="graph"] .sg-fa2-badge {
  background: rgba(12, 22, 44, 0.88) !important;
  border: 1px solid rgba(59, 130, 246, 0.3) !important;
  border-radius: 20px !important;
  color: rgba(147, 197, 253, 0.9) !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  padding: 5px 12px !important;
}
body[data-page="graph"] .sg-fa2-dot {
  background: #3b82f6 !important;
  box-shadow: 0 0 6px rgba(59, 130, 246, 0.7) !important;
}

/* ── 5. Panel / section surface refinements ──────────────────────────────── */

/* Main content panels — cleaner white surface with subtle gradient */
body[data-page] .panel {
  background: linear-gradient(180deg, #ffffff 0%, rgba(248, 250, 253, 0.98) 100%) !important;
  border: 1px solid rgba(203, 213, 225, 0.5) !important;
  border-radius: 16px !important;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.06),
    0 4px 16px rgba(15, 23, 42, 0.05) !important;
  transition:
    opacity 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 200ms ease,
    box-shadow 200ms ease !important;
}

/* Hero panel on dataset — richer gradient */
body[data-page="dataset"] .dashboard-hero {
  background:
    radial-gradient(800px 300px at 85% -20%, rgba(14, 165, 233, 0.12), transparent 70%),
    radial-gradient(500px 250px at 5% 100%, rgba(99, 102, 241, 0.07), transparent 70%),
    linear-gradient(155deg, #ffffff 0%, rgba(240, 246, 255, 0.97) 100%) !important;
  border: 1px solid rgba(200, 215, 235, 0.5) !important;
  border-radius: 18px !important;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.07) !important;
}

/* ── 6. KPI strips — elevated, colored top borders ───────────────────────── */
body[data-page] .pm-kpi-strip--modern {
  background: linear-gradient(180deg, #ffffff 0%, rgba(248, 250, 252, 0.98) 100%) !important;
  border: 1px solid rgba(203, 213, 225, 0.5) !important;
  border-radius: 14px !important;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06) !important;
  gap: 8px !important;
}

/* Same "less generic-SaaS" pass: monospaced KPI numbers read as institutional data rather than a
   stock dashboard stat tile. Scoped to this page only. */
body[data-page="parliament-members"] .pm-kpi-strip--modern .pm-kpi-val {
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace !important;
  letter-spacing: 0 !important;
}
body[data-page] .pm-kpi-strip--modern .pm-kpi-cell {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(246, 249, 255, 0.98) 100%) !important;
  border-radius: 10px !important;
  transition: box-shadow 180ms ease, border-color 180ms ease !important;
}
body[data-page] .pm-kpi-strip--modern .pm-kpi-cell:hover {
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.1) !important;
}
body[data-page] .pm-kpi-strip--modern .pm-kpi-val {
  font-size: 21px !important;
  font-weight: 800 !important;
  letter-spacing: -0.03em !important;
  color: #0f172a !important;
}

/* ── 7. Admin Control Center ─────────────────────────────────────────────── */
body[data-page="dataset"] .admin-cc__section-label {
  font-size: 10px !important;
  font-weight: 780 !important;
  letter-spacing: 0.11em !important;
  text-transform: uppercase !important;
  color: #64748b !important;
  margin-top: 20px !important;
  margin-bottom: 10px !important;
  padding-bottom: 5px !important;
  border-bottom: 1px solid rgba(203, 213, 225, 0.5) !important;
}

body[data-page="dataset"] .admin-cc__action-card {
  background: linear-gradient(165deg, #ffffff 0%, rgba(246, 250, 255, 0.97) 100%) !important;
  border: 1px solid rgba(203, 213, 225, 0.52) !important;
  border-radius: 13px !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 2px 8px rgba(15, 23, 42, 0.04) !important;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms cubic-bezier(0.22, 1, 0.36, 1) !important;
}
body[data-page="dataset"] .admin-cc__action-card:hover {
  border-color: rgba(91, 162, 255, 0.32) !important;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.1), 0 1px 3px rgba(15, 23, 42, 0.06) !important;
  transform: translateY(-2px) !important;
}
body[data-page="dataset"] .admin-cc__action-card h3 {
  font-size: 13.5px !important;
  font-weight: 680 !important;
  color: #0f172a !important;
  letter-spacing: -0.01em !important;
  margin-top: 0 !important;
  margin-bottom: 4px !important;
}
body[data-page="dataset"] .admin-cc__action-card p {
  font-size: 12.5px !important;
  color: #64748b !important;
  line-height: 1.5 !important;
  margin: 0 0 10px !important;
}

/* Admin job grid tiles */
body[data-page="dataset"] .admin-cc {
  background: linear-gradient(180deg, #ffffff 0%, rgba(248, 250, 252, 0.98) 100%) !important;
  border: 1px solid rgba(203, 213, 225, 0.5) !important;
  border-radius: 16px !important;
}

/* Source cards in news pipeline snapshot */
body[data-page="dataset"] .admin-cc__source-grid .source-card,
body[data-page="dataset"] .admin-cc__source-grid [class*="source"] {
  border-radius: 10px !important;
  border: 1px solid rgba(203, 213, 225, 0.48) !important;
  background: rgba(255, 255, 255, 0.92) !important;
}

/* ── 8. Chart containers ──────────────────────────────────────────────────── */
body[data-page] .chart-wrap,
body[data-page] [class*="chart-container"] {
  background: linear-gradient(180deg, #ffffff 0%, rgba(248, 250, 252, 0.98) 100%) !important;
  border: 1px solid rgba(203, 213, 225, 0.5) !important;
  border-radius: 14px !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 3px 10px rgba(15, 23, 42, 0.04) !important;
}

/* ── 9. Topics & Mandate — opportunity + topic cards ─────────────────────── */
body[data-page="topics-mandates"] .tm-topic-card,
body[data-page="topics-mandates"] .tm-opportunity-card {
  background: linear-gradient(165deg, #ffffff 0%, rgba(245, 249, 255, 0.98) 100%) !important;
  border: 1px solid rgba(203, 213, 225, 0.5) !important;
  border-radius: 14px !important;
  transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1), border-color 180ms ease, box-shadow 180ms ease !important;
}
body[data-page="topics-mandates"] .tm-topic-card:hover,
body[data-page="topics-mandates"] .tm-opportunity-card:hover {
  border-color: rgba(91, 162, 255, 0.3) !important;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.1) !important;
  transform: translateY(-2px) !important;
}

/* ── 10. News cards ──────────────────────────────────────────────────────── */
body[data-page="news"] .news-story-card {
  background: linear-gradient(165deg, #ffffff 0%, rgba(246, 249, 255, 0.98) 100%) !important;
  border: 1px solid rgba(203, 213, 225, 0.48) !important;
  border-radius: 13px !important;
  transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1), border-color 180ms ease, box-shadow 180ms ease !important;
}
body[data-page="news"] .news-story-card:hover {
  border-color: rgba(91, 162, 255, 0.3) !important;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.1) !important;
  transform: translateY(-2px) !important;
}

/* ── 11. Loading overlay — premium treatment ─────────────────────────────── */
body[data-page] .loading-overlay {
  background: rgba(10, 18, 36, 0.78) !important;
  -webkit-backdrop-filter: blur(18px) !important;
  backdrop-filter: blur(18px) !important;
}
body[data-page] .loading-card {
  background: linear-gradient(160deg, rgba(15, 25, 50, 0.96) 0%, rgba(10, 18, 40, 0.98) 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 20px !important;
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.07) !important;
  min-width: 260px !important;
  padding: 28px 28px 24px !important;
}
body[data-page] .loading-title {
  font-size: 15px !important;
  font-weight: 660 !important;
  color: rgba(230, 242, 255, 0.96) !important;
  letter-spacing: -0.01em !important;
}
body[data-page] .loading-meta {
  font-size: 11.5px !important;
  color: rgba(148, 180, 230, 0.65) !important;
  font-weight: 540 !important;
  letter-spacing: 0.04em !important;
}
body[data-page] .progress-track {
  background: rgba(255, 255, 255, 0.1) !important;
  border-radius: 4px !important;
  height: 4px !important;
  overflow: hidden !important;
}
body[data-page] .progress-fill {
  background: linear-gradient(90deg, #3b82f6 0%, #60a5fa 100%) !important;
  border-radius: 4px !important;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.5) !important;
}

/* ── 12. Table / row refinements ─────────────────────────────────────────── */
body[data-page] table th {
  font-size: 10.5px !important;
  font-weight: 750 !important;
  letter-spacing: 0.07em !important;
  text-transform: uppercase !important;
  color: #64748b !important;
}
body[data-page] table tbody tr {
  transition: background 120ms ease !important;
}
body[data-page] table tbody tr:hover {
  background: rgba(241, 247, 255, 0.7) !important;
}

/* ── 13. Explorer tab bar (graph page) ───────────────────────────────────── */
body[data-page="graph"] .explorer-tabbar {
  background: rgba(10, 18, 36, 0.88) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  backdrop-filter: blur(12px) !important;
}
body[data-page="graph"] .explorer-tab {
  color: rgba(148, 180, 230, 0.65) !important;
  font-size: 12.5px !important;
  font-weight: 580 !important;
  border-bottom: 2px solid transparent !important;
  transition: color 130ms ease, border-color 130ms ease !important;
}
body[data-page="graph"] .explorer-tab.active,
body[data-page="graph"] .explorer-tab[aria-current] {
  color: #93c5fd !important;
  font-weight: 680 !important;
  border-bottom-color: #3b82f6 !important;
}
body[data-page="graph"] .explorer-focus-select span,
body[data-page="graph"] .explorer-focus-count span {
  color: rgba(130, 163, 215, 0.6) !important;
  font-size: 11.5px !important;
}
body[data-page="graph"] .explorer-focus-count strong {
  color: rgba(147, 197, 253, 0.9) !important;
  font-weight: 720 !important;
  font-size: 13px !important;
}

/* ── 14. Empty state refinements ─────────────────────────────────────────── */
body[data-page] .empty-state,
body[data-page] [class*="-empty"] {
  color: #94a3b8 !important;
  font-size: 13px !important;
}

/* ── 15. Focus-group select (graph header) ───────────────────────────────── */
body[data-page="graph"] #focusGroupSelect {
  background: rgba(255, 255, 255, 0.065) !important;
  border: 1px solid rgba(148, 163, 184, 0.22) !important;
  color: rgba(168, 198, 240, 0.88) !important;
  border-radius: 8px !important;
  font-size: 12px !important;
}

/* ── 16. Scrollbar system (panels + main content) ────────────────────────── */
body[data-page] .panel::-webkit-scrollbar,
body[data-page] .app-content::-webkit-scrollbar { width: 5px; height: 5px; }
body[data-page] .panel::-webkit-scrollbar-thumb,
body[data-page] .app-content::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.38);
  border-radius: 4px;
}
body[data-page] .panel::-webkit-scrollbar-track,
body[data-page] .app-content::-webkit-scrollbar-track { background: transparent; }

/* ==========================================================================
   MandateAtlas — Beauty Pass COMPLETION (April 2026)
   Covers: Intel KPI, group ranking, intel summary, TM filter cards, TM KPI,
   PM profile cards, PM mcard metrics, workspace home, news grid polish,
   command center, hemicycle, tabs, focus-group select, modal overlays,
   micro-typography, hover transitions, and global spacing rhythm.
   ========================================================================== */

/* ── I. Intel page — KPI strip ───────────────────────────────────────────── */
body[data-page="intel"] .intel-kpi-strip {
  gap: 10px !important;
}
body[data-page="intel"] .intel-kpi {
  background: linear-gradient(170deg, #ffffff 0%, rgba(246, 250, 255, 0.98) 100%) !important;
  border: 1px solid rgba(203, 213, 225, 0.52) !important;
  border-radius: 12px !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 2px 8px rgba(15, 23, 42, 0.04) !important;
  transition: box-shadow 180ms ease, transform 180ms cubic-bezier(0.22, 1, 0.36, 1), border-color 180ms ease !important;
}
body[data-page="intel"] .intel-kpi:hover {
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.1) !important;
  border-color: rgba(91, 162, 255, 0.3) !important;
  transform: translateY(-2px) !important;
}
body[data-page="intel"] .intel-kpi-value {
  font-size: 22px !important;
  font-weight: 820 !important;
  letter-spacing: -0.035em !important;
  color: #0f172a !important;
}
body[data-page="intel"] .intel-kpi-label {
  font-size: 9.5px !important;
  font-weight: 760 !important;
  letter-spacing: 0.08em !important;
  color: #64748b !important;
}
body[data-page="intel"] .intel-kpi-accent {
  border-top: 3px solid #f59e0b !important;
  background: linear-gradient(170deg, #fffcf0 0%, #ffffff 100%) !important;
}
body[data-page="intel"] .intel-kpi-ally,
body[data-page="intel"] .intel-kpi-up {
  border-top: 3px solid #10b981 !important;
  background: linear-gradient(170deg, #f0fdf8 0%, #ffffff 100%) !important;
}
body[data-page="intel"] .intel-kpi-down {
  border-top: 3px solid #ef4444 !important;
  background: linear-gradient(170deg, #fff4f4 0%, #ffffff 100%) !important;
}

/* Intel summary banner */
body[data-page="intel"] .intel-summary {
  background:
    radial-gradient(600px 200px at 90% -10%, rgba(99, 102, 241, 0.1), transparent 70%),
    linear-gradient(140deg, #f8faff 0%, #eef2ff 100%) !important;
  border: 1px solid rgba(99, 102, 241, 0.2) !important;
  border-radius: 16px !important;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.08) !important;
}
body[data-page="intel"] .intel-summary-title {
  font-size: 10px !important;
  font-weight: 780 !important;
  letter-spacing: 0.12em !important;
  text-transform: uppercase !important;
  color: #4f46e5 !important;
}

/* Intel group ranking */
body[data-page="intel"] .intel-group-ranking {
  border-radius: 12px !important;
  border: 1px solid rgba(203, 213, 225, 0.48) !important;
  background: linear-gradient(170deg, #ffffff 0%, rgba(248, 250, 252, 0.98) 100%) !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05) !important;
}
body[data-page="intel"] .intel-group-ranking-title {
  font-size: 10px !important;
  font-weight: 780 !important;
  letter-spacing: 0.1em !important;
  text-transform: uppercase !important;
  color: #64748b !important;
  border-bottom: 1px solid rgba(203, 213, 225, 0.44) !important;
}
body[data-page="intel"] .intel-group-row {
  transition: background 120ms ease !important;
  border-radius: 7px !important;
}
body[data-page="intel"] .intel-group-row:hover {
  background: rgba(241, 247, 255, 0.8) !important;
}
body[data-page="intel"] .intel-group-bar {
  border-radius: 3px !important;
  height: 5px !important;
}

/* Intel signals */
body[data-page="intel"] .intel-signals {
  border-radius: 12px !important;
  border: 1px solid rgba(203, 213, 225, 0.48) !important;
  background: linear-gradient(170deg, #ffffff 0%, rgba(248, 250, 252, 0.98) 100%) !important;
}

/* ── II. Topics & Mandate page ───────────────────────────────────────────── */
body[data-page="topics-mandates"] .tm-kpi-cell {
  background: linear-gradient(170deg, #ffffff 0%, rgba(246, 250, 255, 0.98) 100%) !important;
  border: 1px solid rgba(203, 213, 225, 0.52) !important;
  border-radius: 11px !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05) !important;
  transition: box-shadow 180ms ease, border-color 180ms ease !important;
}
body[data-page="topics-mandates"] .tm-kpi-cell:hover {
  border-color: rgba(91, 162, 255, 0.28) !important;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.09) !important;
}
body[data-page="topics-mandates"] .tm-kpi-value {
  font-size: 19px !important;
  font-weight: 820 !important;
  letter-spacing: -0.03em !important;
  color: #0f172a !important;
}
body[data-page="topics-mandates"] .tm-kpi-label {
  font-size: 9.5px !important;
  font-weight: 760 !important;
  letter-spacing: 0.08em !important;
  color: #64748b !important;
}

/* TM topic filter card */
body[data-page="topics-mandates"] .tm-filter-card {
  background: linear-gradient(165deg, #ffffff 0%, rgba(246, 249, 255, 0.98) 100%) !important;
  border: 1px solid rgba(203, 213, 225, 0.5) !important;
  border-radius: 14px !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06) !important;
}
body[data-page="topics-mandates"] .tm-filter-card h3 {
  font-size: 13px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  letter-spacing: -0.01em !important;
}

/* TM topic chips */
body[data-page="topics-mandates"] .tm-topic-chip {
  border-radius: 8px !important;
  border: 1px solid rgba(148, 163, 184, 0.3) !important;
  background: rgba(255, 255, 255, 0.9) !important;
  color: #334155 !important;
  font-size: 11.5px !important;
  font-weight: 560 !important;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease !important;
}
body[data-page="topics-mandates"] .tm-topic-chip:hover {
  background: rgba(241, 247, 255, 0.98) !important;
  border-color: rgba(91, 162, 255, 0.36) !important;
  color: #1e3a8a !important;
}
body[data-page="topics-mandates"] .tm-topic-chip.active,
body[data-page="topics-mandates"] .tm-topic-chip[aria-pressed="true"] {
  background: linear-gradient(145deg, rgba(219, 234, 254, 0.98) 0%, rgba(199, 220, 255, 0.95) 100%) !important;
  border-color: rgba(59, 130, 246, 0.5) !important;
  color: #1d4ed8 !important;
  font-weight: 660 !important;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.16) !important;
}

/* TM topic lens */
body[data-page="topics-mandates"] .tm-topic-lens-head h3 {
  font-size: 14px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  letter-spacing: -0.01em !important;
}

/* TM alliance/opportunity cards */
body[data-page="topics-mandates"] .tm-topic-alliance-card {
  background: linear-gradient(165deg, #ffffff 0%, rgba(245, 249, 255, 0.98) 100%) !important;
  border: 1px solid rgba(203, 213, 225, 0.5) !important;
  border-radius: 12px !important;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms cubic-bezier(0.22,1,0.36,1) !important;
}
body[data-page="topics-mandates"] .tm-topic-alliance-card:hover {
  border-color: rgba(91, 162, 255, 0.3) !important;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.09) !important;
  transform: translateY(-2px) !important;
}

/* ── III. Parliament Members — MEP card metrics ───────────────────────────── */
body[data-page="parliament-members"] .pm-mcard-metric {
  background: linear-gradient(165deg, #ffffff 0%, rgba(246, 250, 255, 0.97) 100%) !important;
  border: 1px solid rgba(203, 213, 225, 0.58) !important;
  border-radius: 8px !important;
  transition: border-color 140ms ease !important;
}
body[data-page="parliament-members"] .pm-mcard-metric:hover {
  border-color: rgba(91, 162, 255, 0.28) !important;
}
body[data-page="parliament-members"] .pm-mcard-metric-val {
  font-size: 14px !important;
  font-weight: 820 !important;
  letter-spacing: -0.02em !important;
}
body[data-page="parliament-members"] .pm-mcard-metric-lbl {
  font-size: 9px !important;
  font-weight: 760 !important;
  letter-spacing: 0.07em !important;
  color: #94a3b8 !important;
}
body[data-page="parliament-members"] .pm-mcard-name {
  font-size: 13px !important;
  font-weight: 760 !important;
  color: #0f172a !important;
  letter-spacing: -0.01em !important;
}
body[data-page="parliament-members"] .pm-mcard-sub {
  font-size: 10.5px !important;
  color: #64748b !important;
}
body[data-page="parliament-members"] .pm-mcard-flag {
  font-size: 9.5px !important;
  font-weight: 720 !important;
  background: rgba(226, 232, 240, 0.6) !important;
  color: #475569 !important;
  border-radius: 999px !important;
}

/* PM Profile workspace panel */
body[data-page="parliament-members"] .pm-profile-contact-card h3,
body[data-page="parliament-members"] .pm-profile-votemix-card h3 {
  font-size: 12.5px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  letter-spacing: -0.005em !important;
}
body[data-page="parliament-members"] .pm-profile-workspace {
  border-radius: 16px !important;
  border: 1px solid rgba(203, 213, 225, 0.48) !important;
  background: linear-gradient(165deg, #ffffff 0%, rgba(246, 250, 255, 0.98) 100%) !important;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.07) !important;
}
body[data-page="parliament-members"] .pm-profile-dot {
  box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.18), 0 0 0 7px rgba(148, 163, 184, 0.06) !important;
}

/* PM KPI strip accent borders */
body[data-page="parliament-members"] .tm-kpi-strip .tm-kpi-cell:nth-child(1) { border-top: 3px solid #2563eb !important; }
body[data-page="parliament-members"] .tm-kpi-strip .tm-kpi-cell:nth-child(2) { border-top: 3px solid #8b5cf6 !important; }
body[data-page="parliament-members"] .tm-kpi-strip .tm-kpi-cell:nth-child(3) { border-top: 3px solid #10b981 !important; }
body[data-page="parliament-members"] .tm-kpi-strip .tm-kpi-cell:nth-child(4) { border-top: 3px solid #14b8a6 !important; }
body[data-page="parliament-members"] .tm-kpi-strip .tm-kpi-cell:nth-child(5) { border-top: 3px solid #f59e0b !important; }

/* ── IV. Workspace home ───────────────────────────────────────────────────── */


/* Workspace hero — richer gradient */


/* The page's own @media(max-width:760px) mobile override for this selector (further up this
   file, and once also declared unconditionally without !important) was dead — this rule's
   !important always won regardless of viewport. Restoring the intended mobile shrink here. */


/* ── V. Command Center / hemicycle ───────────────────────────────────────── */
body[data-page] .command-center {
  gap: 10px !important;
}

body[data-page] .command-card-hemicycle {
  background: linear-gradient(160deg, #ffffff 0%, rgba(246, 250, 255, 0.98) 100%) !important;
  border: 1px solid rgba(203, 213, 225, 0.5) !important;
  border-radius: 14px !important;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06) !important;
}

body[data-page] .hemicycle-dot {
  transition: transform 120ms ease, box-shadow 120ms ease !important;
}
body[data-page] .hemicycle-dot:hover {
  transform: scale(1.5) !important;
  z-index: 10 !important;
}
body[data-page] .hemicycle-dot.outcome-yes {
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.6) !important;
}
body[data-page] .hemicycle-dot.outcome-no {
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.6) !important;
}
body[data-page] .hemicycle-dot.outcome-abstain {
  box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.52) !important;
}

body[data-page] .hemicycle-tooltip {
  background: linear-gradient(155deg, rgba(10, 18, 36, 0.97) 0%, rgba(15, 25, 50, 0.98) 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 12px !important;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.38) !important;
}

/* Coalition chart card */
body[data-page] .command-card-coalition {
  background: linear-gradient(165deg, #ffffff 0%, rgba(246, 250, 255, 0.98) 100%) !important;
  border: 1px solid rgba(203, 213, 225, 0.5) !important;
  border-radius: 14px !important;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06) !important;
}

/* ── VI. News page — light mode card refinement ──────────────────────────── */
body[data-page="news"] .news-story-card {
  border-radius: 14px !important;
  transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 180ms ease, border-color 180ms ease !important;
}
body[data-page="news"] .news-story-title {
  font-size: 17px !important;
  font-weight: 720 !important;
  letter-spacing: -0.015em !important;
  line-height: 1.3 !important;
}
body[data-page="news"] .news-story-summary {
  font-size: 13.5px !important;
  line-height: 1.6 !important;
}

/* News reader modal refinements */
.news-reader-modal-head {
  background: linear-gradient(120deg, rgba(10, 18, 36, 0.98) 0%, rgba(30, 60, 160, 0.92) 100%) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}
.news-reader-modal-copy h2 {
  font-size: 18px !important;
  font-weight: 720 !important;
  letter-spacing: -0.015em !important;
  line-height: 1.3 !important;
}

/* ── VII. Tab bars across pages ───────────────────────────────────────────── */
body[data-page] .panel-tabs,
body[data-page] .tab-bar,
body[data-page] .view-tabs,
body[data-page] [role="tablist"] {
  border-bottom: 1px solid rgba(203, 213, 225, 0.5) !important;
  gap: 0 !important;
}
body[data-page] [role="tab"],
body[data-page] .tab-btn,
body[data-page] .panel-tab {
  font-size: 12.5px !important;
  font-weight: 580 !important;
  color: #64748b !important;
  border-bottom: 2px solid transparent !important;
  padding: 8px 14px !important;
  transition: color 130ms ease, border-color 130ms ease !important;
  background: transparent !important;
  border-left: none !important;
  border-right: none !important;
  border-top: none !important;
}
body[data-page] [role="tab"][aria-selected="true"],
body[data-page] .tab-btn.active,
body[data-page] .panel-tab.active {
  color: #2563eb !important;
  font-weight: 700 !important;
  border-bottom-color: #2563eb !important;
}
body[data-page] [role="tab"]:hover,
body[data-page] .tab-btn:hover,
body[data-page] .panel-tab:hover {
  color: #1e3a8a !important;
}

/* ── VIII. Focus-group select across all pages ───────────────────────────── */
body[data-page] select#focusGroupSelect,
body[data-page] .focus-group-select,
body[data-page] .scope-select {
  font-size: 12.5px !important;
  font-weight: 580 !important;
  border-radius: 9px !important;
}

/* ── IX. Inline section kickers / group labels across pages ─────────────── */
body[data-page] .dash-section-hdr {
  background: linear-gradient(135deg, rgba(10, 18, 36, 0.96) 0%, rgba(15, 28, 60, 0.94) 100%) !important;
  border-radius: 10px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12) !important;
  border: none !important;
}

/* ── X. Filter row labels, range inputs ──────────────────────────────────── */
body[data-page] label,
body[data-page] .filter-label,
body[data-page] .sg-range-row > span {
  font-size: 11.5px !important;
  font-weight: 580 !important;
  color: #475569 !important;
}

body[data-page] input[type="range"] {
  accent-color: #3b82f6;
  cursor: pointer;
}
body[data-page] input[type="checkbox"] {
  accent-color: #3b82f6;
  cursor: pointer;
}

/* ── XI. Badges, pills, tags ─────────────────────────────────────────────── */
body[data-page] .mandate-badge,
body[data-page] .term-badge,
body[data-page] .group-badge,
body[data-page] .tag-pill {
  font-size: 9.5px !important;
  font-weight: 720 !important;
  letter-spacing: 0.04em !important;
  border-radius: 999px !important;
  padding: 2px 7px !important;
}

/* Live update banner */
body[data-page] .live-update {
  font-size: 10.5px !important;
  font-weight: 620 !important;
  color: rgba(148, 180, 230, 0.72) !important;
  letter-spacing: 0.04em !important;
  border-radius: 20px !important;
  border: 1px solid rgba(148, 163, 184, 0.18) !important;
  background: rgba(255, 255, 255, 0.04) !important;
  padding: 2px 8px !important;
}

/* ── XII. Modal backdrop across pages ────────────────────────────────────── */
body[data-page] .modal-backdrop,
body[data-page] .overlay-backdrop,
body[data-page] .tm-discovery-overlay-backdrop {
  background: rgba(4, 10, 24, 0.64) !important;
  -webkit-backdrop-filter: blur(6px) !important;
  backdrop-filter: blur(6px) !important;
}
body[data-page] .modal-card,
body[data-page] .overlay-card,
body[data-page] .tm-discovery-card {
  border-radius: 18px !important;
  border: 1px solid rgba(203, 213, 225, 0.48) !important;
  box-shadow: 0 32px 64px rgba(2, 6, 23, 0.4) !important;
  background: linear-gradient(165deg, #ffffff 0%, rgba(246, 250, 255, 0.98) 100%) !important;
}

/* ── XIII. Global empty-state refinement ─────────────────────────────────── */
body[data-page] .np-empty,
body[data-page] .no-results,
body[data-page] .empty-hint {
  font-size: 13px !important;
  color: #94a3b8 !important;
  font-style: italic !important;
  font-weight: 450 !important;
}

/* ── XIV. Intel page — briefing text ─────────────────────────────────────── */
body[data-page="intel"] .intel-brief-text {
  font-size: 13.5px !important;
  line-height: 1.65 !important;
  color: #334155 !important;
}
body[data-page="intel"] .intel-brief-text > :first-child { margin-top: 0; }
body[data-page="intel"] .intel-brief-text > :last-child { margin-bottom: 0; }
body[data-page="intel"] .intel-brief-text p { margin: 0 0 10px; }
body[data-page="intel"] .intel-brief-text h3,
body[data-page="intel"] .intel-brief-text h4,
body[data-page="intel"] .intel-brief-text h5,
body[data-page="intel"] .intel-brief-text h6 {
  margin: 16px 0 6px;
  font-family: var(--font-display, inherit);
  font-weight: 650;
  line-height: 1.3;
  color: var(--ma-ink, #0f172a);
}
body[data-page="intel"] .intel-brief-text h3 { font-size: 16px; }
body[data-page="intel"] .intel-brief-text h4 { font-size: 15px; }
body[data-page="intel"] .intel-brief-text h5,
body[data-page="intel"] .intel-brief-text h6 {
  font-size: 11.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ma-action-strong, #1859cc);
}
body[data-page="intel"] .intel-brief-text ul,
body[data-page="intel"] .intel-brief-text ol { margin: 4px 0 10px; padding-left: 20px; }
body[data-page="intel"] .intel-brief-text li { margin: 3px 0; padding-left: 2px; }
body[data-page="intel"] .intel-brief-text li > ul,
body[data-page="intel"] .intel-brief-text li > ol { margin: 4px 0 6px; }
body[data-page="intel"] .intel-brief-text ul > li::marker { color: var(--ma-action, #276ef1); }
body[data-page="intel"] .intel-brief-text ol > li::marker { color: var(--ma-action-strong, #1859cc); font-weight: 600; }
body[data-page="intel"] .intel-brief-text strong { font-weight: 650; color: var(--ma-ink, #0f172a); }
body[data-page="intel"] .intel-brief-text code {
  font-size: 12.5px;
  padding: 1px 5px;
  border-radius: 4px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}
body[data-page="intel"] .intel-brief-text hr { border: 0; border-top: 1px solid #e2e8f0; margin: 12px 0; }
body[data-page="intel"] .intel-brief-text a { color: var(--ma-action-strong, #1859cc); text-decoration: underline; text-underline-offset: 2px; }

/* ── XV. Compare tool refinements ────────────────────────────────────────── */
body[data-page] .cp-result-card {
  background: linear-gradient(165deg, #ffffff 0%, rgba(246, 250, 255, 0.98) 100%) !important;
  border: 1px solid rgba(203, 213, 225, 0.5) !important;
  border-radius: 13px !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06) !important;
  transition: box-shadow 180ms ease, border-color 180ms ease !important;
}
body[data-page] .cp-result-card:hover {
  border-color: rgba(91, 162, 255, 0.28) !important;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.09) !important;
}
body[data-page] .cp-center-score {
  font-size: 28px !important;
  font-weight: 820 !important;
  letter-spacing: -0.04em !important;
}
body[data-page] .cp-mep-name {
  font-size: 13px !important;
  font-weight: 740 !important;
  color: #0f172a !important;
  letter-spacing: -0.01em !important;
}
body[data-page] .cp-picker-label {
  font-size: 10px !important;
  font-weight: 760 !important;
  letter-spacing: 0.09em !important;
  text-transform: uppercase !important;
  color: #64748b !important;
}

/* ── XVI. Dataset footer ─────────────────────────────────────────────────── */
body[data-page="dataset"] .dataset-footer-shell {
  border-top: 1px solid rgba(203, 213, 225, 0.44) !important;
  padding-top: 20px !important;
  margin-top: 10px !important;
}
body[data-page="dataset"] .dataset-footer-brand h3 {
  font-size: 13px !important;
  font-weight: 720 !important;
  color: #334155 !important;
  letter-spacing: -0.01em !important;
}
body[data-page="dataset"] .dataset-footer-brand p {
  font-size: 12px !important;
  color: #64748b !important;
  line-height: 1.55 !important;
  margin: 4px 0 0 !important;
}
body[data-page="dataset"] .dataset-footer-meta {
  font-size: 11px !important;
  color: #94a3b8 !important;
  font-weight: 480 !important;
}
body[data-page="dataset"] .dataset-footer-meta a {
  color: #64748b !important;
  text-decoration: none !important;
  transition: color 130ms ease !important;
}
body[data-page="dataset"] .dataset-footer-meta a:hover {
  color: #2563eb !important;
}

/* ── XVII. Sampling notice (graph) ───────────────────────────────────────── */
body[data-page="graph"] .sg-sampling-notice {
  background: rgba(12, 22, 44, 0.88) !important;
  border: 1px solid rgba(245, 158, 11, 0.35) !important;
  border-radius: 8px !important;
  color: rgba(253, 230, 138, 0.9) !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  padding: 5px 10px !important;
}

/* ── XVIII. Graph legend ─────────────────────────────────────────────────── */
body[data-page="graph"] .sg-legend {
  background: rgba(12, 22, 44, 0.82) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 10px !important;
  -webkit-backdrop-filter: blur(10px) !important;
  backdrop-filter: blur(10px) !important;
  padding: 7px 10px !important;
}
body[data-page="graph"] .sg-legend-lbl {
  font-size: 10.5px !important;
  font-weight: 580 !important;
  color: rgba(168, 198, 240, 0.78) !important;
}

/* ── XIX. Sidebar pinned MEPs strip ─────────────────────────────────────── */
body[data-page="parliament-members"] .pm-sidebar-pinned {
  border-top: 1px solid rgba(255, 255, 255, 0.07) !important;
}

/* ── XX. Focus-group count bubble ────────────────────────────────────────── */
body[data-page] .explorer-focus-count {
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(148, 163, 184, 0.18) !important;
  border-radius: 8px !important;
  padding: 3px 8px !important;
}

/* ==========================================================================
   Dark-surface text & palette fix (April 2026)
   Fixes all components where var(--bg-0/1/2/3) dark navy backgrounds
   inherited dark text. Also harmonizes command-center, rebel radar,
   and MEP Contact Directory with the sidebar dark glass aesthetic.
   ========================================================================== */

/* ── 1. Global rule: any element with dark bg-variable gets light text ─────── */
body[data-page] [style*="--bg-0"],
body[data-page] [style*="--bg-1"],
body[data-page] [style*="--bg-2"],
body[data-page] [style*="--bg-3"] {
  color: var(--text-1, #e7eefb);
}

/* ── 2. command-card — dark glass surface + light text ───────────────────── */
body[data-page] .command-card {
  background:
    linear-gradient(160deg, rgba(13, 24, 46, 0.92) 0%, rgba(9, 18, 36, 0.94) 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 14px !important;
  -webkit-backdrop-filter: blur(10px) !important;
  backdrop-filter: blur(10px) !important;
  color: #e7eefb !important;
}
body[data-page] .command-card h3,
body[data-page] .command-card h4,
body[data-page] .command-card .panel-title,
body[data-page] .command-card .card-title {
  color: #f0f6ff !important;
  font-size: 12px !important;
  font-weight: 720 !important;
  letter-spacing: 0.09em !important;
  text-transform: uppercase !important;
}
body[data-page] .command-card h2 {
  color: #f0f6ff !important;
  border-bottom-color: rgba(255, 255, 255, 0.1) !important;
}

/* Command card hemicycle/coalition — keep dark glass */
body[data-page] .command-card-hemicycle,
body[data-page] .command-card-coalition,
body[data-page] .command-card-feed {
  background:
    linear-gradient(160deg, rgba(13, 24, 46, 0.92) 0%, rgba(9, 18, 36, 0.94) 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 14px !important;
  color: #e7eefb !important;
}

/* ── 3. MEP Contact Directory — dark glass rows ──────────────────────────── */
body[data-page] .mep-dir-group {
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 10px !important;
  background: rgba(13, 24, 46, 0.7) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  backdrop-filter: blur(8px) !important;
  margin-bottom: 5px !important;
  overflow: hidden !important;
}
body[data-page] .mep-dir-group summary {
  background: rgba(255, 255, 255, 0.05) !important;
  color: #e0ecff !important;
  font-size: 12.5px !important;
  font-weight: 680 !important;
  padding: 10px 14px !important;
  transition: background 130ms ease !important;
}
body[data-page] .mep-dir-group-count,
body[data-page] .mep-dir-avg {
  color: rgba(148, 180, 230, 0.65) !important;
  font-size: 11px !important;
}

body[data-page] .mep-dir-list {
  border-top: 1px solid rgba(255, 255, 255, 0.06) !important;
}
body[data-page] .mep-dir-row {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
  color: rgba(200, 220, 255, 0.88) !important;
  font-size: 12.5px !important;
  transition: background 120ms ease !important;
}
body[data-page] .mep-dir-name {
  color: rgba(225, 238, 255, 0.95) !important;
  font-weight: 560 !important;
}
body[data-page] .mep-dir-align {
  color: #7eb8ff !important;
  font-weight: 720 !important;
}
body[data-page] .mep-dir-align.no-data {
  color: rgba(148, 180, 230, 0.45) !important;
}

/* ── 4. Rebel Radar — dark glass rows ────────────────────────────────────── */
body[data-page] .rebel-list {
  gap: 4px !important;
}
body[data-page] .rebel-row {
  background: rgba(255, 255, 255, 0.04) !important;
  border-radius: 8px !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
  padding: 6px 10px !important;
  color: rgba(210, 228, 255, 0.88) !important;
  transition: background 120ms ease !important;
}
body[data-page] .rebel-row:hover {
  background: rgba(255, 255, 255, 0.08) !important;
}
body[data-page] .rebel-name {
  color: rgba(225, 240, 255, 0.96) !important;
  font-weight: 640 !important;
  font-size: 12.5px !important;
}
body[data-page] .rebel-dissent {
  color: rgba(200, 220, 255, 0.9) !important;
  font-weight: 720 !important;
  font-size: 12px !important;
}
body[data-page] .rebel-group {
  font-size: 10px !important;
  font-weight: 760 !important;
  color: rgba(148, 180, 230, 0.65) !important;
}
body[data-page] .rebel-bar-wrap {
  background: rgba(255, 255, 255, 0.1) !important;
  border-radius: 4px !important;
}

/* ── 5. Intel group ranking rows — dark glass ────────────────────────────── */
body[data-page] .intel-group-row {
  color: rgba(200, 220, 255, 0.88) !important;
  border-radius: 6px !important;
}
body[data-page] .intel-group-row:hover {
  background: rgba(255, 255, 255, 0.06) !important;
}
body[data-page] .intel-group-label {
  color: rgba(200, 220, 255, 0.85) !important;
  font-size: 12px !important;
}
body[data-page] .intel-group-pct {
  color: rgba(148, 180, 230, 0.75) !important;
  font-size: 11.5px !important;
}
body[data-page] .intel-group-ranking-title {
  color: rgba(148, 180, 230, 0.65) !important;
}
body[data-page] .intel-group-bar-wrap {
  background: rgba(255, 255, 255, 0.1) !important;
}

/* ── 6. Recent session feed cards (dark context) ─────────────────────────── */
body[data-page] .command-card-feed .command-card-feed-item,
body[data-page] .command-card-feed .feed-item {
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.07) !important;
  border-radius: 10px !important;
  color: rgba(210, 228, 255, 0.88) !important;
  transition: background 120ms ease !important;
}
body[data-page] .command-card-feed .command-card-feed-item:hover,
body[data-page] .command-card-feed .feed-item:hover {
  background: rgba(255, 255, 255, 0.09) !important;
}

/* ── 7. General: panels inside command-center, dark-bg text nodes ────────── */
body[data-page] .command-center .panel-title,
body[data-page] .command-center [class*="-title"],
body[data-page] .command-center [class*="-label"],
body[data-page] .command-center [class*="-meta"],
body[data-page] .command-center p,
body[data-page] .command-center span:not([class*="badge"]):not([class*="pill"]) {
  color: rgba(200, 220, 255, 0.82);
}

/* ── 8. Drop-down controls inside dark panels ────────────────────────────── */
body[data-page] .command-card select,
body[data-page] .command-card input[type="text"],
body[data-page] .command-card input[type="search"] {
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  color: rgba(210, 228, 255, 0.92) !important;
  border-radius: 8px !important;
}
body[data-page] .command-card select option {
  background: #0f1a30;
  color: #e0ecff;
}

/* ── 9. Parliament Members — "Members" panel header (light) ─────────────── */
body[data-page="parliament-members"] .pm-dir-panel,
body[data-page="parliament-members"] #pmMemberPanel {
  background: linear-gradient(165deg, #ffffff 0%, rgba(246, 250, 255, 0.98) 100%) !important;
  border: 1px solid rgba(203, 213, 225, 0.5) !important;
  border-radius: 16px !important;
}
body[data-page="parliament-members"] .pm-dir-panel h2,
body[data-page="parliament-members"] #pmMemberPanel h2 {
  color: #0f172a !important;
}
body[data-page="parliament-members"] .pm-dir-panel p,
body[data-page="parliament-members"] #pmMemberPanel p {
  color: #64748b !important;
}

/* ── 10. Intel KPI variant text — dark bg ────────────────────────────────── */
body[data-page] .intel-kpi-strip .intel-kpi {
  color: #0f172a !important;
}
body[data-page] .intel-kpi-value,
body[data-page] .intel-kpi-label {
  color: inherit !important;
}

/* ==========================================================================
   Coordinated Refinement Pass (April 2026)
   Scope: Amendments, Plenary Debates, Topics & Mandates major sections,
   Graph page harmonization, unified chart fullscreen behavior.
   ========================================================================== */

:root {
  --ma-refine-radius: 14px;
  --ma-refine-radius-sm: 10px;
  --ma-refine-border: rgba(148, 163, 184, 0.30);
  --ma-refine-border-soft: rgba(148, 163, 184, 0.22);
  --ma-refine-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  --ma-refine-shadow-soft: 0 4px 14px rgba(15, 23, 42, 0.06);
  --ma-refine-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.99) 0%, rgba(246, 250, 255, 0.98) 100%);
}

/* ── Unified fullscreen for chart/visual modules ───────────────────────── */
body[data-page] .ma-fs-host {
  position: relative !important;
}

body[data-page] .ma-fs-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 8;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.42);
  background: rgba(255, 255, 255, 0.9);
  color: #334155;
  font-size: 10.5px;
  font-weight: 760;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0 10px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, color 140ms ease;
}

body[data-page] .ma-fs-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(59, 130, 246, 0.55);
  background: rgba(239, 246, 255, 0.95);
  color: #1e40af;
}

body[data-page] .ma-fs-btn-icon {
  font-size: 12px;
  line-height: 1;
}

.ma-fs-overlay {
  position: fixed;
  inset: 0;
  z-index: 2600;
  display: none;
}

.ma-fs-overlay.is-open {
  display: block;
}

.ma-fs-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 9, 20, 0.74);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.ma-fs-dialog {
  position: absolute;
  inset: clamp(12px, 2vw, 26px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.34);
  background: linear-gradient(180deg, rgba(250, 253, 255, 0.98) 0%, rgba(240, 247, 255, 0.97) 100%);
  box-shadow: 0 28px 64px rgba(2, 6, 23, 0.46);
  overflow: hidden;
}

.ma-fs-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.34);
  background: linear-gradient(140deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 41, 59, 0.93) 100%);
}

.ma-fs-title {
  color: #f8fafc;
  font-size: 13px;
  font-weight: 760;
  letter-spacing: 0.01em;
}

.ma-fs-close {
  min-height: 32px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(15, 23, 42, 0.38);
  color: #dbeafe;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  padding: 0 11px;
}

.ma-fs-close:hover {
  border-color: rgba(96, 165, 250, 0.62);
  color: #eff6ff;
}

.ma-fs-content {
  min-height: 0;
  overflow: auto;
  padding: 12px;
}

body.ma-fs-open {
  overflow: hidden !important;
}

.ma-fs-content > .ma-fs-active-container {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
}

.ma-fs-content > .chart-card.ma-fs-active-container {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: min(82vh, 980px);
}

.ma-fs-content > .chart-card.ma-fs-active-container .chart-container {
  min-height: min(74vh, 900px) !important;
  height: 100% !important;
}

.ma-fs-content > .sigma-canvas-wrap.ma-fs-active-container,
.ma-fs-content > .tm-power-canvas-wrap.ma-fs-active-container,
.ma-fs-content > .pm-profile-influence-canvas.ma-fs-active-container,
.ma-fs-content > .tm-topic-alliance-wrap.ma-fs-active-container {
  min-height: min(80vh, 980px) !important;
  height: min(80vh, 980px) !important;
}

.ma-fs-content > .tm-matrix-wrap.ma-fs-active-container,
.ma-fs-content > #analysisTopicMatrixContainer.ma-fs-active-container,
.ma-fs-content > #topicOpportunityInsights.ma-fs-active-container {
  min-height: min(78vh, 940px) !important;
  max-height: none !important;
}

/* ── Amendments + Debates refinement ────────────────────────────────────── */
body[data-page="parliament-members"] .pm-amendments-card {
  border-radius: var(--ma-refine-radius) !important;
  border: 1px solid var(--ma-refine-border) !important;
  box-shadow: var(--ma-refine-shadow-soft) !important;
}

body[data-page="parliament-members"] .pm-amendments-grid {
  grid-template-columns: minmax(240px, 28%) minmax(0, 1fr) !important;
  min-height: 640px !important;
  max-height: 640px !important;
}

body[data-page="parliament-members"] .pm-amendments-list {
  padding: 7px !important;
  gap: 6px !important;
  background: rgba(248, 250, 252, 0.84) !important;
}

body[data-page="parliament-members"] .pm-amendment-list-item {
  padding: 7px 8px !important;
  gap: 4px !important;
}

body[data-page="parliament-members"] .pm-amendment-list-ref {
  font-size: 10.8px !important;
}

body[data-page="parliament-members"] .pm-amendment-list-dossier {
  font-size: 10px !important;
  line-height: 1.22 !important;
}

body[data-page="parliament-members"] .pm-amendment-detail {
  padding: 10px 12px !important;
  gap: 8px !important;
}

body[data-page="parliament-members"] .pm-amendment-detail-title {
  font-size: 14px !important;
}

body[data-page="parliament-members"] .pm-amendment-diff-grid {
  min-height: 430px !important;
  max-height: 530px !important;
  border-radius: 12px !important;
}

body[data-page="parliament-members"] .pm-amendment-diff-col-body {
  font-size: 12.5px !important;
  line-height: 1.58 !important;
  padding: 9px 10px !important;
}

body[data-page="parliament-members"] .pm-amendment-cosigners {
  gap: 5px !important;
}

body[data-page="parliament-members"] .pm-amendment-cosigner-chip {
  padding: 2px 7px !important;
  gap: 5px !important;
  border-radius: 999px !important;
}

body[data-page="parliament-members"] .pm-amendment-cosigner-name {
  font-size: 10px !important;
  font-weight: 680 !important;
}

body[data-page="parliament-members"] .pm-amendment-cosigner-meta {
  font-size: 9.4px !important;
}

body[data-page="parliament-members"] .pm-debates-head {
  padding: 10px 14px !important;
}

body[data-page="parliament-members"] .pm-debates-insights,
body[data-page="parliament-members"] .pm-debates-topic-chips {
  padding: 8px 14px 7px !important;
}


body[data-page="parliament-members"] .pm-debate-title {
  font-size: 12px !important;
  line-height: 1.33 !important;
}

body[data-page="parliament-members"] .pm-debates-topic-chip {
  font-size: 10px !important;
}


body[data-page="parliament-members"] .pm-debates-footer {
  padding: 9px 14px !important;
}

/* ── Topics & Mandates harmonization ────────────────────────────────────── */


body[data-page="topics-mandates"] .tm-workspace-nav {
  top: calc(var(--tm-topbar-h) + 6px) !important;
  gap: 0.34rem !important;
  padding: 0.42rem !important;
  border-radius: 12px !important;
}

body[data-page="topics-mandates"] .tm-workspace-link {
  min-height: 30px !important;
  padding: 0.34rem 0.64rem !important;
  font-size: 0.69rem !important;
}

body[data-page="topics-mandates"] .tm-kpi-strip {
  border-radius: 12px !important;
  box-shadow: var(--ma-refine-shadow-soft) !important;
}

body[data-page="topics-mandates"] .tm-kpi-cell {
  padding: 0.8rem 0.92rem !important;
}

body[data-page="topics-mandates"] .tm-kpi-value {
  font-size: 1.32rem !important;
  font-weight: 760 !important;
}

body[data-page="topics-mandates"] .tm-kpi-label {
  font-size: 0.64rem !important;
}


body[data-page="topics-mandates"] .tm-section-card-head {
  padding: 0.74rem 0.96rem 0.66rem !important;
}

body[data-page="topics-mandates"] .tm-section-card-title {
  font-size: 0.92rem !important;
  font-weight: 740 !important;
}

body[data-page="topics-mandates"] .tm-section-card-sub {
  font-size: 0.72rem !important;
}

body[data-page="topics-mandates"] .tm-section-card-body {
  padding: 0.86rem 0.96rem !important;
}

body[data-page="topics-mandates"] .tm-ctrl-row {
  gap: 0.5rem !important;
  padding-bottom: 0.66rem !important;
}


body[data-page="topics-mandates"] .tm-topic-alliance-wrap,
body[data-page="topics-mandates"] .tm-power-canvas-wrap,
body[data-page="topics-mandates"] .tm-matrix-wrap,
body[data-page="topics-mandates"] .tm-drill-table-wrap {
  border-radius: 12px !important;
  border: 1px solid var(--ma-refine-border) !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5), 0 6px 16px rgba(15, 23, 42, 0.06) !important;
}


body[data-page="topics-mandates"] .tm-global-discovery-results {
  border-radius: 12px !important;
  border: 1px solid var(--ma-refine-border) !important;
}

/* ── Graph page harmonization ───────────────────────────────────────────── */

/* .explorer-shell border/border-radius/background/box-shadow removed here:
   superseded by later passes and always beaten by the final consolidated
   rule (~line 6812). --ma-refine-border/-shadow still have other consumers
   in this file, so those tokens are untouched. */


body[data-page="graph"] .explorer-tab {
  min-height: 34px !important;
  border-radius: 9px !important;
  font-size: 12px !important;
}


body[data-page="graph"] .sigma-layout-chip,
body[data-page="graph"] .sigma-edge-mode-chip,
body[data-page="graph"] .sigma-affinity-chip,
body[data-page="graph"] .sigma-topic-chip,
body[data-page="graph"] .sg-text-btn {
  border-radius: 9px !important;
  background: rgba(255, 255, 255, 0.96) !important;
  color: #334155 !important;
  border: 1px solid rgba(148, 163, 184, 0.38) !important;
  font-size: 11px !important;
}

body[data-page="graph"] .sigma-layout-chip.active,
body[data-page="graph"] .sigma-edge-mode-chip.active,
body[data-page="graph"] .sigma-affinity-chip.active,
body[data-page="graph"] .sigma-topic-chip.active {
  background: rgba(37, 99, 235, 0.14) !important;
  border-color: rgba(37, 99, 235, 0.48) !important;
  color: #1d4ed8 !important;
}


body[data-page="graph"] .sg-sel-wrap {
  border-radius: 11px !important;
  border: 1px solid rgba(148, 163, 184, 0.34) !important;
  background: rgba(255, 255, 255, 0.9) !important;
}


/* ── Shared chart container framing ─────────────────────────────────────── */


/* ── Responsive tuning for refinement pass ──────────────────────────────── */
@media (max-width: 1080px) {
  body[data-page="parliament-members"] .pm-amendments-grid {
    grid-template-columns: 1fr !important;
    min-height: 0 !important;
    max-height: none !important;
  }
  body[data-page="parliament-members"] .pm-amendments-list {
    max-height: 280px !important;
    border-right: 0 !important;
    border-bottom: 1px solid rgba(226, 232, 240, 0.92) !important;
  }
  body[data-page="topics-mandates"] .tm-topic-alliance-wrap,
  body[data-page="topics-mandates"] .tm-power-canvas-wrap {
    min-height: 460px !important;
  }
}

@media (max-width: 760px) {
  body[data-page] .ma-fs-btn-text {
    display: none;
  }
  body[data-page] .ma-fs-btn {
    min-height: 30px;
    min-width: 30px;
    padding: 0;
    justify-content: center;
    border-radius: 8px;
  }
  .ma-fs-dialog {
    inset: 8px;
    border-radius: 12px;
  }
  .ma-fs-head {
    padding: 8px 10px;
  }
  .ma-fs-content {
    padding: 8px;
  }
}

/* ==========================================================================
   Deploy Harmony Pass (April 2026)
   A final, low-risk visual layer that normalizes proportion, states and rhythm
   across the static app without touching business logic.
   ========================================================================== */

:root {
  --ma-step-1: 8px;
  --ma-step-2: 13px;
  --ma-step-3: 21px;
  --ma-step-4: 34px;
  --ma-step-5: 55px;
  --ma-radius: 8px;
  --ma-radius-sm: 6px;
  --ma-surface: #fbfcfd;
  --ma-surface-soft: #f2f6f4;
  --ma-surface-raised: #ffffff;
  --ma-ink: #15211c;
  --ma-ink-muted: #5d6c65;
  --ma-line: rgba(83, 103, 94, 0.22);
  --ma-line-strong: rgba(83, 103, 94, 0.34);
  --ma-action: #276ef1;
  --ma-action-strong: #1859cc;
  --ma-action-soft: rgba(39, 110, 241, 0.12);
  --ma-civic: #16846f;
  --ma-civic-soft: rgba(22, 132, 111, 0.12);
  --ma-caution: #b7791f;
  --ma-caution-soft: rgba(183, 121, 31, 0.12);
  --ma-danger: #c2413d;
  --ma-danger-soft: rgba(194, 65, 61, 0.12);
  --ma-shadow-quiet: 0 1px 2px rgba(21, 33, 28, 0.06), 0 8px 21px rgba(21, 33, 28, 0.07);
  --ma-shadow-lift: 0 3px 8px rgba(21, 33, 28, 0.08), 0 13px 34px rgba(21, 33, 28, 0.1);
}

body[data-page] {
  background:
    linear-gradient(180deg, rgba(250, 252, 251, 0.98) 0%, rgba(238, 245, 242, 0.98) 48%, rgba(245, 248, 252, 0.98) 100%) !important;
  color: var(--ma-ink) !important;
  font-family: var(--font-ui) !important;
}

body[data-page] * {
  letter-spacing: 0 !important;
}

body[data-page] h1,
body[data-page] h2,
body[data-page] h3,
body[data-page] h4,
body[data-page] .topbar-title,
body[data-page] .panel-title,
body[data-page] .card-title,
body[data-page] .section-title,
body[data-page] .command-title,
body[data-page] .dashboard-title,
body[data-page] .pm-profile-name,
body[data-page] .tm-section-card-title {
  color: var(--ma-ink) !important;
  font-family: var(--font-display) !important;
  line-height: 1.16 !important;
}

body[data-page] .list-meta,
body[data-page] .panel-subtitle,
body[data-page] .panel-kicker,
body[data-page] .command-subtitle,
body[data-page] .graph-intel-subtitle,
body[data-page] .empty-state p,
body[data-page] .hint-text,
body[data-page] .card-meta,
body[data-page] .dashboard-brand-note {
  color: var(--ma-ink-muted) !important;
  line-height: 1.48 !important;
}

body[data-page] .topbar,
body[data-page] .topbar.topbar--glass {
  min-height: 55px !important;
  padding: var(--ma-step-1) var(--ma-step-3) !important;
  background: linear-gradient(180deg, rgba(18, 28, 24, 0.94) 0%, rgba(14, 22, 20, 0.92) 100%) !important;
  border-bottom: 1px solid rgba(199, 211, 205, 0.14) !important;
  box-shadow: 0 8px 21px rgba(15, 23, 20, 0.18) !important;
}

body[data-page] .topbar-logo {
  border-radius: var(--ma-radius-sm) !important;
  box-shadow: 0 5px 13px rgba(0, 0, 0, 0.18) !important;
}

body[data-page] .topbar-title {
  color: #eef7f2 !important;
  font-size: 15px !important;
  font-weight: 650 !important;
  padding: 0 !important;
}

body[data-page] .topbar-nav {
  gap: var(--ma-step-1) !important;
  scrollbar-width: thin;
}

body[data-page] .nav-pill {
  min-height: 34px !important;
  border-radius: var(--ma-radius) !important;
  padding: 7px 13px !important;
  color: rgba(235, 244, 239, 0.74) !important;
  background: transparent !important;
  border: 1px solid transparent !important;
  box-shadow: none !important;
}

body[data-page] .nav-pill:hover {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.09) !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
  transform: none !important;
}

body[data-page] .nav-pill.active,
body[data-page] .nav-pill[aria-current="page"] {
  color: #ffffff !important;
  background: rgba(39, 110, 241, 0.24) !important;
  border-color: rgba(144, 190, 255, 0.38) !important;
  box-shadow: inset 0 0 0 1px rgba(144, 190, 255, 0.12) !important;
}

body[data-page] .container,
body[data-page] .container--wide,
body[data-page] .landing-wrap,
body[data-page] .policy-wrap {
  width: min(1440px, 100% - var(--ma-step-5)) !important;
}


body[data-page] .chart-card,
body[data-page] .landing-offer-card,
body[data-page] .landing-feature-card,
body[data-page] .landing-login-card,
body[data-page] .policy-hero,
body[data-page] .policy-toc,
body[data-page] .tm-inner-card,
body[data-page] .tm-topic-card,
body[data-page] .tm-opportunity-card,
body[data-page] .pm-mcard,
body[data-page] .command-card {
  /* .explorer-shell removed from this selector list: its contribution here
     (border-radius/border-color/background/box-shadow) is superseded by
     later passes and always beaten by the final consolidated rule
     (~line 6812); the rest of this shared rule is unchanged for the other
     card-like selectors above. */
  border-radius: var(--ma-radius) !important;
  border-color: var(--ma-line) !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(249, 251, 250, 0.98) 100%) !important;
  box-shadow: var(--ma-shadow-quiet) !important;
}

body[data-page] .panel:hover,
body[data-page] .chart-card:hover,
body[data-page] .landing-offer-card:hover,
body[data-page] .landing-feature-card:hover,
body[data-page] .tm-topic-card:hover,
body[data-page] .tm-opportunity-card:hover,
body[data-page] .pm-mcard:hover {
  border-color: var(--ma-line-strong) !important;
  box-shadow: var(--ma-shadow-lift) !important;
  transform: translateY(-1px) !important;
}

body[data-page] .panel h2,
body[data-page] .panel h3,
body[data-page] .chart-card h3,
body[data-page] .chart-card h4,
body[data-page] .np-title,
body[data-page] .tm-section-card-title {
  margin-bottom: var(--ma-step-2) !important;
  padding-bottom: var(--ma-step-2) !important;
  border-bottom-color: var(--ma-line) !important;
  font-size: 16px !important;
  font-weight: 750 !important;
}

body[data-page] .control-btn,
body[data-page] .upload-btn,
body[data-page] .np-btn,
body[data-page] .news-top-action,
body[data-page] .panel-collapse-btn,
body[data-page] .tm-lens-chip,
body[data-page] .explorer-tab,
body[data-page] .sidebar-reset-btn,
body[data-page] .pm-profile-influence-preset,
body[data-page] .ma-fs-btn,
body[data-page] .ma-fs-close {
  min-height: 34px !important;
  border-radius: var(--ma-radius) !important;
  border: 1px solid var(--ma-line-strong) !important;
  background: rgba(255, 255, 255, 0.94) !important;
  color: var(--ma-ink) !important;
  padding: 7px 13px !important;
  font-size: 13px !important;
  font-weight: 620 !important;
  box-shadow: 0 1px 2px rgba(21, 33, 28, 0.05) !important;
  transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease, color 140ms ease, transform 140ms ease !important;
}

body[data-page] .control-btn:hover,
body[data-page] .upload-btn:hover,
body[data-page] .np-btn:hover,
body[data-page] .news-top-action:hover,
body[data-page] .panel-collapse-btn:hover,
body[data-page] .tm-lens-chip:hover,
body[data-page] .explorer-tab:hover,
body[data-page] .sidebar-reset-btn:hover,
body[data-page] .pm-profile-influence-preset:hover,
body[data-page] .ma-fs-btn:hover,
body[data-page] .ma-fs-close:hover {
  background: #ffffff !important;
  border-color: rgba(39, 110, 241, 0.38) !important;
  box-shadow: 0 5px 13px rgba(21, 33, 28, 0.11) !important;
  transform: translateY(-1px) !important;
}

/* background/border-color/color removed from this rule: a later pass
   (~line 27425) redeclares all of them for every selector below with
   !important and wins the cascade (same specificity, later source order),
   so those three properties had no live effect. box-shadow is kept — it is
   NOT redeclared anywhere later, so this remains its sole, winning source. */
body[data-page] .control-btn.primary,
body[data-page] .control-btn.is-primary,
body[data-page] .upload-btn.primary,
body[data-page] .np-btn.primary,
body[data-page] .news-top-action.is-primary,
body[data-page] .tm-lens-chip.active,
body[data-page] .explorer-tab.active {
  box-shadow: 0 5px 13px rgba(39, 110, 241, 0.24) !important;
}

body[data-page] .control-btn.danger,
body[data-page] .upload-btn.danger,
body[data-page] .np-btn.danger {
  background: rgba(194, 65, 61, 0.09) !important;
  border-color: rgba(194, 65, 61, 0.26) !important;
  color: var(--ma-danger) !important;
}

body[data-page] .chip,
body[data-page] .feed-group-chip,
body[data-page] .feed-category-chip,
body[data-page] .sigma-layout-chip,
body[data-page] .sigma-edge-mode-chip,
body[data-page] .sigma-affinity-chip,
body[data-page] .sigma-topic-chip,
body[data-page] .pm-hm-group-chip {
  border-radius: var(--ma-radius-sm) !important;
  border-color: var(--ma-line) !important;
  background: rgba(255, 255, 255, 0.9) !important;
  color: var(--ma-ink-muted) !important;
  min-height: 29px !important;
  padding: 5px 8px !important;
}

body[data-page] .chip.active,
body[data-page] .chip[aria-pressed="true"],
body[data-page] .feed-group-chip.active,
body[data-page] .feed-category-chip.active,
body[data-page] .sigma-layout-chip.active,
body[data-page] .sigma-edge-mode-chip.active,
body[data-page] .sigma-affinity-chip.active,
body[data-page] .sigma-topic-chip.active,
body[data-page] .pm-hm-group-chip.active {
  background: var(--ma-civic-soft) !important;
  border-color: rgba(22, 132, 111, 0.34) !important;
  color: #0f5f50 !important;
  box-shadow: none !important;
}

body[data-page] input[type="text"],
body[data-page] input[type="search"],
body[data-page] input[type="email"],
body[data-page] input[type="password"],
body[data-page] select,
body[data-page] textarea,
body[data-page] .search-input,
body[data-page] .sidebar-filter-ctrl,
body[data-page] .sidebar-search-input,
body[data-page] .pm-vb-select,
body[data-page] .ns-input,
body[data-page] .cp-search-input,
body[data-page] .sg-select,
body[data-page] .sg-search-input {
  min-height: 34px !important;
  border-radius: var(--ma-radius) !important;
  border-color: var(--ma-line-strong) !important;
  background: rgba(255, 255, 255, 0.96) !important;
  color: var(--ma-ink) !important;
  box-shadow: inset 0 1px 2px rgba(21, 33, 28, 0.04) !important;
}

body[data-page] input:focus,
body[data-page] select:focus,
body[data-page] textarea:focus,
body[data-page] .search-input:focus,
body[data-page] .sidebar-filter-ctrl:focus,
body[data-page] .sidebar-search-input:focus,
body[data-page] .pm-vb-select:focus,
body[data-page] .sg-select:focus,
body[data-page] .sg-search-input:focus {
  border-color: rgba(39, 110, 241, 0.55) !important;
  box-shadow: 0 0 0 3px var(--ma-action-soft), inset 0 1px 2px rgba(21, 33, 28, 0.04) !important;
}

body[data-page] :focus-visible {
  outline: 2px solid rgba(39, 110, 241, 0.74) !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 4px var(--ma-action-soft) !important;
}

body[data-page] .empty-state,
body[data-page] .sg-sel-empty,
body[data-page] .coalition-overlay-empty {
  padding: var(--ma-step-4) var(--ma-step-3) !important;
  color: var(--ma-ink-muted) !important;
}

body[data-page] .empty-icon {
  width: var(--ma-step-5) !important;
  height: var(--ma-step-5) !important;
  border-radius: var(--ma-radius) !important;
  background: var(--ma-surface-soft) !important;
  color: var(--ma-civic) !important;
}

body[data-page] .status-msg,
body[data-page] .error-message,
body[data-page] .success-message {
  border-radius: var(--ma-radius) !important;
  padding: var(--ma-step-2) var(--ma-step-3) !important;
  border-color: var(--ma-line) !important;
}

body[data-page] .loading-card {
  border-radius: var(--ma-radius) !important;
  background: rgba(255, 255, 255, 0.96) !important;
  color: var(--ma-ink) !important;
  box-shadow: 0 21px 55px rgba(21, 33, 28, 0.18) !important;
}

body[data-page] .progress-fill {
  background: linear-gradient(90deg, var(--ma-civic) 0%, var(--ma-action) 100%) !important;
}

body[data-page] .skeleton::after {
  background: linear-gradient(90deg, transparent 0%, rgba(22, 132, 111, 0.2) 50%, transparent 100%) !important;
}

body[data-page] .dashboard-sidebar {
  background: linear-gradient(180deg, rgba(18, 28, 24, 0.96) 0%, rgba(14, 22, 20, 0.96) 100%) !important;
  border-right-color: rgba(199, 211, 205, 0.12) !important;
  box-shadow: 8px 0 21px rgba(15, 23, 20, 0.12) !important;
}


body[data-page] .pm-profile-influence-canvas,
body[data-page] .sigma-canvas-wrap {
  border-radius: var(--ma-radius) !important;
  border-color: var(--ma-line) !important;
  background: linear-gradient(180deg, rgba(250, 252, 251, 0.98) 0%, rgba(244, 248, 246, 0.98) 100%) !important;
}

body[data-page] table,
body[data-page] .data-table,
body[data-page] .topic-matrix,
body[data-page] .pm-hm-table {
  border-color: var(--ma-line) !important;
}

body[data-page] th {
  background: var(--ma-surface-soft) !important;
  color: var(--ma-ink) !important;
}

body[data-page] ::selection {
  background: rgba(22, 132, 111, 0.22) !important;
  color: var(--ma-ink) !important;
}

@media (max-width: 960px) {
  body[data-page] .topbar,
  body[data-page] .topbar.topbar--glass {
    padding: var(--ma-step-1) var(--ma-step-2) !important;
  }

  body[data-page] .topbar-actions {
    min-width: 0 !important;
  }

  body[data-page] .topbar-nav {
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
    max-width: calc(100vw - 89px) !important;
    padding-bottom: 3px !important;
  }

  body[data-page] .nav-pill {
    flex: 0 0 auto !important;
  }
}

@media (max-width: 720px) {
  body[data-page] .container,
  body[data-page] .container--wide,
  body[data-page] .landing-wrap,
  body[data-page] .policy-wrap {
    width: min(100% - var(--ma-step-3), 1440px) !important;
  }

  body[data-page] .panel,
  body[data-page] .chart-card,
  body[data-page] .landing-feature-card,
  body[data-page] .landing-offer-card,
  body[data-page] .news-panel-section,
  body[data-page] .tm-section-card,
  body[data-page] .tm-inner-card {
    padding: var(--ma-step-3) !important;
  }

  body[data-page] .upload-actions,
  body[data-page] .pm-profile-actions,
  body[data-page] .tm-sections-actions,
  body[data-page] .news-top-actions {
    gap: var(--ma-step-1) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body[data-page] *,
  body[data-page] *::before,
  body[data-page] *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================================================
   Deploy Shell Alignment Pass (April 2026)
   Normalizes persistent chrome across Dataset, Parliament Members, Topics,
   News, Intelligence and Graph. Graph is treated as a full-screen workspace.
   ========================================================================== */

:root {
  --ma-topbar-h: 55px;
  --ma-sidebar-w: 264px;
  --ma-sidebar-bg: linear-gradient(180deg, rgba(18, 28, 24, 0.98) 0%, rgba(13, 21, 19, 0.98) 100%);
  --ma-sidebar-line: rgba(199, 211, 205, 0.13);
  --ma-sidebar-text: rgba(231, 242, 236, 0.84);
  --ma-sidebar-muted: rgba(224, 238, 231, 0.54);
  --ma-graph-canvas:
    linear-gradient(rgba(21, 33, 28, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21, 33, 28, 0.035) 1px, transparent 1px),
    radial-gradient(720px 340px at 50% 0%, rgba(39, 110, 241, 0.12), transparent 68%),
    linear-gradient(180deg, #f8fbf9 0%, #eef5f2 100%);
}

body[data-page] .topbar,
body[data-page] .topbar.topbar--glass {
  position: sticky !important;
  top: 0 !important;
  z-index: var(--z-topbar, 110) !important;
  min-height: var(--ma-topbar-h) !important;
  height: var(--ma-topbar-h) !important;
  flex: 0 0 var(--ma-topbar-h) !important;
  box-sizing: border-box !important;
}

body[data-page] .topbar-brand,
body[data-page] .brand-link,
body[data-page] .topbar-actions,
body[data-page] .topbar-nav {
  min-height: 0 !important;
}

body[data-page] .dashboard-sidebar,
body[data-page="graph"] .sigma-sidebar {
  width: var(--ma-sidebar-w) !important;
  min-width: var(--ma-sidebar-w) !important;
  background: var(--ma-sidebar-bg) !important;
  border-right: 1px solid var(--ma-sidebar-line) !important;
  box-shadow: 8px 0 21px rgba(15, 23, 20, 0.13) !important;
  color: var(--ma-sidebar-text) !important;
}

/* width/min-width here are already handled by a later, wider-range @media(max-width:960px)
   rule further down this file (confirmed by re-checking the full cascade, not just the first
   later match) -- only adding the border treatment neither that rule nor anything else covers
   for this selector at mobile widths. .sigma-sidebar's own mobile width is likewise already
   handled by a later rule; no separate fix needed for it here. */
@media (max-width: 860px) {
  body[data-page] .dashboard-sidebar {
    border-right: none !important;
    border-bottom: 1px solid var(--ma-sidebar-line) !important;
  }
}

body[data-page] .dashboard-sidebar {
  max-height: calc(100dvh - var(--ma-topbar-h)) !important;
}

body[data-page] .sidebar-section-head,
body[data-page] .sidebar-filter-label,
body[data-page="graph"] .sg-section-title {
  color: var(--ma-sidebar-muted) !important;
  font-size: 11px !important;
  font-weight: 720 !important;
  text-transform: uppercase !important;
}

body[data-page] .sidebar-search-input,
body[data-page] .sidebar-filter-ctrl,
body[data-page="parliament-members"] #pmMemberSearch,
body[data-page="topics-mandates"] #topicSearchInput,
body[data-page="graph"] .sigma-sidebar .sg-select {
  background: rgba(255, 255, 255, 0.07) !important;
  border: 1px solid rgba(231, 242, 236, 0.13) !important;
  color: rgba(238, 247, 242, 0.92) !important;
  border-radius: var(--ma-radius) !important;
}

body[data-page] .sidebar-search-input::placeholder,
body[data-page="parliament-members"] #pmMemberSearch::placeholder,
body[data-page="topics-mandates"] #topicSearchInput::placeholder {
  color: rgba(224, 238, 231, 0.44) !important;
}

body[data-page] .sidebar-panel-link,
body[data-page="topics-mandates"] .tm-sidebar-export-btn,
body[data-page="topics-mandates"] #topicSearchBtn,
body[data-page="topics-mandates"] #topicClearBtn,
body[data-page="graph"] .sigma-sidebar .sigma-layout-chip,
body[data-page="graph"] .sigma-sidebar .sigma-edge-mode-chip,
body[data-page="graph"] .sigma-sidebar .sigma-affinity-chip,
body[data-page="graph"] .sigma-sidebar .sigma-topic-chip,
body[data-page="graph"] .sigma-sidebar .sg-text-btn {
  border-radius: var(--ma-radius) !important;
  border: 1px solid rgba(231, 242, 236, 0.12) !important;
  background: rgba(255, 255, 255, 0.055) !important;
  color: rgba(231, 242, 236, 0.78) !important;
  box-shadow: none !important;
}

body[data-page] .sidebar-panel-link:hover,
body[data-page="topics-mandates"] .tm-sidebar-export-btn:hover,
body[data-page="topics-mandates"] #topicSearchBtn:hover,
body[data-page="topics-mandates"] #topicClearBtn:hover,
body[data-page="graph"] .sigma-sidebar .sigma-layout-chip:hover,
body[data-page="graph"] .sigma-sidebar .sigma-edge-mode-chip:hover,
body[data-page="graph"] .sigma-sidebar .sigma-affinity-chip:hover,
body[data-page="graph"] .sigma-sidebar .sigma-topic-chip:hover,
body[data-page="graph"] .sigma-sidebar .sg-text-btn:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(144, 190, 255, 0.34) !important;
  color: #ffffff !important;
  transform: none !important;
}

body[data-page] .sidebar-panel-link.active,
body[data-page="graph"] .sigma-sidebar .sigma-layout-chip.active,
body[data-page="graph"] .sigma-sidebar .sigma-edge-mode-chip.active,
body[data-page="graph"] .sigma-sidebar .sigma-affinity-chip.active,
body[data-page="graph"] .sigma-sidebar .sigma-topic-chip.active {
  background: rgba(39, 110, 241, 0.24) !important;
  border-color: rgba(144, 190, 255, 0.38) !important;
  color: #ffffff !important;
  box-shadow: inset 0 0 0 1px rgba(144, 190, 255, 0.12) !important;
}

body[data-page="graph"] {
  overflow: hidden !important;
}

body[data-page="graph"] .app-main {
  height: 100dvh !important;
  min-height: 100dvh !important;
  overflow: hidden !important;
}

body[data-page="graph"] .sigma-page-content {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: calc(100dvh - var(--ma-topbar-h)) !important;
  padding: var(--ma-step-2) !important;
  overflow: hidden !important;
}

/* .explorer-shell removed here: height/min-height/display/flex-direction
   match, and border-radius/border/background/box-shadow are superseded by
   later passes — all folded into the final consolidated rule (~line 6812). */

body[data-page="graph"] .explorer-tabbar {
  flex: 0 0 auto !important;
  min-height: var(--ma-topbar-h) !important;
  align-items: center !important;
  gap: var(--ma-step-1) !important;
  padding: var(--ma-step-1) var(--ma-step-2) !important;
  background: linear-gradient(180deg, #fbfcfd 0%, #f4f8f6 100%) !important;
  border-bottom: 1px solid var(--ma-line) !important;
}

body[data-page="graph"] .explorer-tab,
body[data-page="graph"] .explorer-focus-select,
body[data-page="graph"] .explorer-focus-count {
  border-radius: var(--ma-radius) !important;
}

body[data-page="graph"] #explorerPanelSigma,
body[data-page="graph"] .explorer-panel.active,
body[data-page="graph"] .sigma-stage-frame,
body[data-page="graph"] .sigma-stage-frame .sigma-shell {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  min-width: 0 !important;
}

body[data-page="graph"] #explorerPanelSigma {
  display: flex !important;
  padding: 0 !important;
  overflow: hidden !important;
}

body[data-page="graph"] .sigma-stage-frame {
  display: flex !important;
  padding: var(--ma-step-2) !important;
  background: var(--ma-surface-soft) !important;
}

body[data-page="graph"] .sigma-stage-frame .sigma-shell {
  border-radius: var(--ma-radius) !important;
  border: 1px solid var(--ma-line) !important;
  box-shadow: none !important;
  background: #ffffff !important;
  overflow: hidden !important;
}

body[data-page="graph"] .sigma-sidebar {
  height: 100% !important;
  max-height: none !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

body[data-page="graph"] .sigma-sidebar-inner {
  padding: var(--ma-step-2) var(--ma-step-2) var(--ma-step-3) !important;
  gap: var(--ma-step-1) !important;
}

body[data-page="graph"] .sg-section {
  padding: var(--ma-step-2) 0 !important;
  border-bottom: 1px solid rgba(231, 242, 236, 0.1) !important;
}

body[data-page="graph"] .sg-subtle-note,
body[data-page="graph"] .sg-toggle-row,
body[data-page="graph"] .sg-range-row,
body[data-page="graph"] .sg-sel-empty,
body[data-page="graph"] .sg-sel-empty-hint {
  color: rgba(231, 242, 236, 0.62) !important;
}

body[data-page="graph"] .sg-subtle-note,
body[data-page="graph"] .sg-sel-wrap {
  background: rgba(255, 255, 255, 0.055) !important;
  border-color: rgba(231, 242, 236, 0.12) !important;
  border-radius: var(--ma-radius) !important;
}

body[data-page="graph"] .sigma-canvas-wrap {
  min-height: 0 !important;
  background: var(--ma-graph-canvas) !important;
  background-size: 34px 34px, 34px 34px, auto, auto !important;
  border-left: 1px solid var(--ma-line) !important;
  border-radius: 0 !important;
}

body[data-page="graph"] .sigma-canvas-wrap::before {
  inset: var(--ma-step-2) !important;
  border-radius: var(--ma-radius) !important;
  border-color: rgba(83, 103, 94, 0.16) !important;
}

body[data-page="graph"] .sg-axis-label {
  color: rgba(93, 108, 101, 0.72) !important;
  font-size: 11px !important;
  font-weight: 650 !important;
  text-transform: none !important;
}

body[data-page="graph"] .sg-legend,
body[data-page="graph"] .sg-fa2-badge,
body[data-page="graph"] .sg-sampling-notice {
  border-radius: var(--ma-radius) !important;
  border: 1px solid var(--ma-line) !important;
  background: rgba(255, 255, 255, 0.9) !important;
  color: var(--ma-ink) !important;
  box-shadow: var(--ma-shadow-quiet) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  backdrop-filter: blur(8px) !important;
}


body[data-page="graph"] .sigma-sidebar-drawer-toggle,
body[data-page="graph"] .sg-zoom-btn {
  border-radius: var(--ma-radius) !important;
  border: 1px solid var(--ma-line-strong) !important;
  background: rgba(255, 255, 255, 0.92) !important;
  color: var(--ma-ink) !important;
  box-shadow: var(--ma-shadow-quiet) !important;
}

body[data-page="graph"] .sigma-sidebar-drawer-toggle:hover,
body[data-page="graph"] .sg-zoom-btn:hover {
  background: #ffffff !important;
  border-color: rgba(39, 110, 241, 0.38) !important;
}

body[data-page="graph"] .sigma-group-chip {
  border-radius: var(--ma-radius-sm) !important;
  font-size: 11px !important;
}

@media (max-width: 960px) {
  body[data-page] .dashboard-sidebar {
    width: 100% !important;
    min-width: 0 !important;
    max-height: none !important;
  }

  body[data-page="graph"] {
    overflow: auto !important;
  }

  body[data-page="graph"] .app-main {
    height: auto !important;
    min-height: 100dvh !important;
    overflow: visible !important;
  }

  body[data-page="graph"] .sigma-page-content {
    height: auto !important;
    min-height: calc(100dvh - var(--ma-topbar-h)) !important;
    padding: var(--ma-step-1) !important;
    overflow: visible !important;
  }

  /* .explorer-shell min-height override removed: at this breakpoint it was
     always beaten (equal specificity, both !important, later source order)
     by the unconditional min-height:0 that used to sit further down the
     file — now the single consolidated rule (~line 6812) — so it never had
     a live effect. */

  body[data-page="graph"] .explorer-tabbar {
    min-height: 0 !important;
    align-items: stretch !important;
  }

  body[data-page="graph"] .sigma-stage-frame {
    min-height: 620px !important;
    padding: 0 !important;
  }

  body[data-page="graph"] .sigma-stage-frame .sigma-shell {
    min-height: 620px !important;
    border-radius: 0 !important;
    border-left: 0 !important;
    border-right: 0 !important;
  }

  body[data-page="graph"] .sigma-sidebar {
    width: min(86vw, 318px) !important;
    min-width: min(86vw, 318px) !important;
    height: 100dvh !important;
  }
}

/* ==========================================================================
   Parliament Members + News Production UX Pass (April 2026)
   Debate interventions use one canonical text body: no duplicated short/full
   text, no generated title copied from the first sentence.
   ========================================================================== */

body[data-page="parliament-members"] .pm-debates-card:not(.pm-profile-pane-hidden) {
  display: grid !important;
  grid-template-rows: auto auto auto auto minmax(0, 1fr) auto !important;
  overflow: hidden !important;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfd 100%) !important;
}

body[data-page="parliament-members"] .pm-debates-head {
  align-items: flex-start !important;
  gap: var(--ma-step-2) !important;
  background: linear-gradient(180deg, rgba(242, 246, 244, 0.95) 0%, rgba(255, 255, 255, 0.98) 100%) !important;
}

body[data-page="parliament-members"] .pm-debates-head-left {
  min-width: 220px !important;
  padding-top: 2px !important;
}

body[data-page="parliament-members"] .pm-debates-corpus-badge {
  border-radius: var(--ma-radius-sm) !important;
  border-color: rgba(22, 132, 111, 0.26) !important;
  background: rgba(22, 132, 111, 0.09) !important;
  color: #0f5f50 !important;
}

body[data-page="parliament-members"] .pm-debates-controls {
  justify-content: flex-end !important;
  flex: 1 1 520px !important;
}

body[data-page="parliament-members"] .pm-debates-topic-input {
  flex: 1 1 280px !important;
  max-width: 420px !important;
}

body[data-page="parliament-members"] .pm-debates-insights,
body[data-page="parliament-members"] .pm-debates-topic-chips {
  background: rgba(248, 251, 249, 0.82) !important;
  border-color: var(--ma-line) !important;
}

body[data-page="parliament-members"] .pm-debates-chip-group {
  align-items: center !important;
  gap: 6px !important;
}

body[data-page="parliament-members"] .pm-debates-chip-label {
  min-width: 72px !important;
  color: var(--ma-ink-muted) !important;
  font-size: 10.5px !important;
  text-transform: none !important;
  font-weight: 680 !important;
}

body[data-page="parliament-members"] .pm-debates-topic-chip {
  border-radius: var(--ma-radius-sm) !important;
  background: rgba(255, 255, 255, 0.92) !important;
  color: var(--ma-ink-muted) !important;
  font-weight: 620 !important;
  max-width: min(340px, 100%) !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body[data-page="parliament-members"] .pm-debates-topic-chip.active,
body[data-page="parliament-members"] .pm-debates-topic-chip:hover {
  background: var(--ma-civic-soft) !important;
  border-color: rgba(22, 132, 111, 0.34) !important;
  color: #0f5f50 !important;
}

body[data-page="parliament-members"] .pm-debates-topic-chip--theme {
  border-color: rgba(39, 110, 241, 0.25) !important;
  background: rgba(39, 110, 241, 0.08) !important;
  color: #1859cc !important;
}

body[data-page="parliament-members"] #pmDebatesMeta {
  padding: 0 var(--ma-step-3) !important;
  min-height: 0 !important;
}

body[data-page="parliament-members"] .pm-debates-list {
  max-height: min(74vh, 760px) !important;
  min-height: 360px !important;
  padding: var(--ma-step-2) !important;
  gap: var(--ma-step-2) !important;
  background:
    linear-gradient(rgba(21, 33, 28, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21, 33, 28, 0.028) 1px, transparent 1px),
    linear-gradient(180deg, rgba(248, 251, 249, 0.95) 0%, rgba(243, 248, 245, 0.95) 100%) !important;
  background-size: 34px 34px, 34px 34px, auto !important;
  scrollbar-gutter: stable !important;
  overscroll-behavior: contain !important;
}

body[data-page="parliament-members"] .pm-speeches-topic-section {
  display: grid !important;
  gap: var(--ma-step-1) !important;
  margin: 0 !important;
}

body[data-page="parliament-members"] .pm-speeches-topic-header {
  position: sticky !important;
  top: 0 !important;
  z-index: 3 !important;
  margin: 0 !important;
  padding: 8px 10px !important;
  border: 1px solid var(--ma-line) !important;
  border-radius: var(--ma-radius) !important;
  background: rgba(255, 255, 255, 0.94) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  backdrop-filter: blur(8px) !important;
  box-shadow: 0 3px 8px rgba(21, 33, 28, 0.06) !important;
}

body[data-page="parliament-members"] .pm-speeches-anchor-link {
  color: rgba(93, 108, 101, 0.48) !important;
}

body[data-page="parliament-members"] .pm-speeches-topic-name {
  color: var(--ma-ink) !important;
  font-size: 12.5px !important;
  line-height: 1.25 !important;
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body[data-page="parliament-members"] .pm-speeches-topic-count,
body[data-page="parliament-members"] .pm-speeches-topic-theme {
  border-radius: var(--ma-radius-sm) !important;
  flex: 0 0 auto !important;
}

body[data-page="parliament-members"] .pm-speeches-topic-count {
  background: var(--ma-surface-soft) !important;
  border-color: var(--ma-line) !important;
  color: var(--ma-ink-muted) !important;
}

body[data-page="parliament-members"] .pm-speeches-topic-theme {
  background: rgba(39, 110, 241, 0.08) !important;
  border-color: rgba(39, 110, 241, 0.24) !important;
  color: #1859cc !important;
}

body[data-page="parliament-members"] .pm-speeches-topic-full {
  display: none !important;
}

body[data-page="parliament-members"] .pm-speeches-items {
  gap: var(--ma-step-2) !important;
  margin: 0 !important;
}

body[data-page="parliament-members"] .pm-debate-item {
  border-radius: var(--ma-radius) !important;
  border: 1px solid var(--ma-line) !important;
  border-left: 3px solid rgba(22, 132, 111, 0.32) !important;
  background: rgba(255, 255, 255, 0.98) !important;
  box-shadow: var(--ma-shadow-quiet) !important;
  padding: var(--ma-step-2) !important;
  gap: var(--ma-step-2) !important;
}

body[data-page="parliament-members"] .pm-debate-item:hover {
  border-left-color: rgba(22, 132, 111, 0.64) !important;
  box-shadow: var(--ma-shadow-lift) !important;
}

body[data-page="parliament-members"] .pm-debate-item-head {
  align-items: center !important;
  gap: var(--ma-step-2) !important;
}

body[data-page="parliament-members"] .pm-debate-title,
body[data-page="parliament-members"] .pm-debate-title-wrap {
  display: none !important;
}

body[data-page="parliament-members"] .pm-debate-meta-wrap {
  min-width: 0 !important;
  display: grid !important;
  gap: 6px !important;
  flex: 1 1 auto !important;
}

body[data-page="parliament-members"] .pm-debate-tags,
body[data-page="parliament-members"] .pm-debate-signal-tags {
  gap: 5px !important;
}

body[data-page="parliament-members"] .pm-debate-tag,
body[data-page="parliament-members"] .pm-debate-signal-chip {
  border-radius: var(--ma-radius-sm) !important;
  font-size: 10.5px !important;
  font-weight: 640 !important;
  letter-spacing: 0 !important;
  padding: 3px 7px !important;
}

body[data-page="parliament-members"] .pm-debate-tag {
  background: rgba(248, 251, 249, 0.94) !important;
  border-color: var(--ma-line) !important;
  color: var(--ma-ink-muted) !important;
}

body[data-page="parliament-members"] .pm-debate-tag--date {
  background: rgba(22, 132, 111, 0.09) !important;
  border-color: rgba(22, 132, 111, 0.26) !important;
  color: #0f5f50 !important;
  font-weight: 720 !important;
}

body[data-page="parliament-members"] .pm-debate-tag--mode {
  background: rgba(39, 110, 241, 0.08) !important;
  border-color: rgba(39, 110, 241, 0.24) !important;
  color: #1859cc !important;
}

body[data-page="parliament-members"] .pm-debate-signal-chip {
  background: rgba(21, 33, 28, 0.045) !important;
  border-color: rgba(83, 103, 94, 0.18) !important;
  color: var(--ma-ink-muted) !important;
}

body[data-page="parliament-members"] .pm-debate-actions {
  align-items: center !important;
  gap: 6px !important;
  flex: 0 0 auto !important;
}

body[data-page="parliament-members"] .pm-debate-link,
body[data-page="parliament-members"] .pm-debate-translate {
  border-radius: var(--ma-radius-sm) !important;
  font-size: 11px !important;
  text-decoration: none !important;
}

body[data-page="parliament-members"] .pm-debate-link {
  border: 1px solid var(--ma-line) !important;
  background: rgba(255, 255, 255, 0.9) !important;
  color: var(--ma-ink-muted) !important;
  padding: 4px 8px !important;
}

body[data-page="parliament-members"] .pm-debate-text-shell {
  max-height: clamp(180px, 26vh, 340px) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  scrollbar-gutter: stable !important;
  overscroll-behavior: contain !important;
  border: 1px solid var(--ma-line) !important;
  border-radius: var(--ma-radius) !important;
  background: linear-gradient(180deg, rgba(251, 252, 253, 0.98) 0%, rgba(246, 249, 247, 0.98) 100%) !important;
  padding: var(--ma-step-2) var(--ma-step-3) !important;
}

body[data-page="parliament-members"] .pm-debate-text-shell:focus-visible {
  outline: 2px solid rgba(39, 110, 241, 0.45) !important;
  outline-offset: 2px !important;
}

body[data-page="parliament-members"] .pm-debate-text {
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: #1f2b26 !important;
  font-size: 13px !important;
  line-height: 1.68 !important;
  white-space: pre-wrap !important;
  overflow-wrap: anywhere !important;
  word-break: normal !important;
  hyphens: auto !important;
}

body[data-page="parliament-members"] .pm-debate-text-short,
body[data-page="parliament-members"] .pm-debate-text-full,
body[data-page="parliament-members"] .pm-debate-expand {
  display: none !important;
}

body[data-page="parliament-members"] .pm-debate-text mark {
  background: rgba(255, 221, 87, 0.42) !important;
  border-radius: 3px !important;
  padding: 0 2px !important;
}

body[data-page="news"] .news-panel-section,
body[data-page="news"] .news-story-card,
body[data-page="news"] .article-card {
  border-radius: var(--ma-radius) !important;
  border-color: var(--ma-line) !important;
  box-shadow: var(--ma-shadow-quiet) !important;
}

body[data-page="news"] .news-story-card:hover,
body[data-page="news"] .article-card:hover,
body[data-page="news"] .news-highlight-card:hover {
  box-shadow: var(--ma-shadow-lift) !important;
  transform: translateY(-1px) !important;
}

body[data-page="news"] .np-title,
body[data-page="news"] .news-story-title,
body[data-page="news"] .art-title,
body[data-page="news"] .feed-editorial-title {
  color: var(--ma-ink) !important;
  letter-spacing: 0 !important;
}

body[data-page="news"] .art-summary,
body[data-page="news"] .feed-editorial-summary,
body[data-page="news"] .news-story-summary {
  color: var(--ma-ink-muted) !important;
  line-height: 1.52 !important;
}

@media (max-width: 760px) {
  body[data-page="parliament-members"] .pm-debates-head,
  body[data-page="parliament-members"] .pm-debate-item-head {
    align-items: stretch !important;
  }

  body[data-page="parliament-members"] .pm-debates-controls,
  body[data-page="parliament-members"] .pm-debate-actions {
    justify-content: flex-start !important;
    width: 100% !important;
  }

  body[data-page="parliament-members"] .pm-debates-topic-input {
    max-width: none !important;
  }

  body[data-page="parliament-members"] .pm-speeches-topic-name {
    white-space: normal !important;
  }

  body[data-page="parliament-members"] .pm-debate-text-shell {
    max-height: 300px !important;
    padding: var(--ma-step-2) !important;
  }
}

/* ==========================================================================
   Production corrective pass: density, export, contrast, source links
   ========================================================================== */

body[data-page="parliament-members"] .container--wide,
body[data-page="topics-mandates"] .container--wide {
  width: calc(100% - clamp(16px, 1.8vw, 34px)) !important;
  max-width: none !important;
  margin-inline: auto !important;
}

body[data-page="parliament-members"] .dashboard-content,
body[data-page="topics-mandates"] .dashboard-content {
  padding: clamp(10px, 1.1vw, 18px) !important;
}

body[data-page="parliament-members"] .dashboard-main,
body[data-page="topics-mandates"] .dashboard-main,
body[data-page="parliament-members"] .dashboard-content,
body[data-page="topics-mandates"] .dashboard-content {
  min-width: 0 !important;
  width: 100% !important;
}

/* Parliament Members: remove the oversized blank contact plane and use the viewport. */
body[data-page="parliament-members"] .pm-profile-top-grid {
  grid-template-columns: minmax(320px, 0.82fr) minmax(560px, 1.18fr) !important;
  gap: clamp(10px, 1.2vw, 18px) !important;
  align-items: start !important;
}

body[data-page="parliament-members"] .pm-profile-contact-card {
  align-self: start !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: visible !important;
  padding-bottom: 16px !important;
}

body[data-page="parliament-members"] .pm-profile-side-stack {
  gap: clamp(10px, 1.2vw, 16px) !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  align-items: stretch !important;
}

body[data-page="parliament-members"] .pm-profile-votemix-card {
  min-width: 0 !important;
  height: 100% !important;
}

body[data-page="parliament-members"] .pm-profile-votemix-body {
  grid-template-columns: minmax(118px, clamp(124px, 32%, 166px)) minmax(0, 1fr) !important;
  gap: clamp(10px, 1.2vw, 18px) !important;
  align-items: start !important;
}


body[data-page="parliament-members"] .pm-profile-votemix-canvas-wrap .ma-fs-btn,
body[data-page="parliament-members"] .pm-profile-mini-chart .ma-fs-btn {
  display: none !important;
}

@media (max-width: 1480px) {
  body[data-page="parliament-members"] .pm-profile-top-grid {
    grid-template-columns: 1fr !important;
  }

  body[data-page="parliament-members"] .pm-profile-side-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 860px) {
  body[data-page="parliament-members"] .pm-profile-side-stack,
  body[data-page="parliament-members"] .pm-profile-votemix-body {
    grid-template-columns: 1fr !important;
  }
}

body[data-page="parliament-members"] .pm-profile-phone-grid,
body[data-page="parliament-members"] .pm-profile-offices-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
}

body[data-page="parliament-members"] .pm-profile-contact-section + .pm-profile-phone-grid,
body[data-page="parliament-members"] .pm-profile-contact-section + .pm-profile-social-row,
body[data-page="parliament-members"] .pm-profile-contact-section + .pm-social-feed-wrap,
body[data-page="parliament-members"] .pm-profile-contact-section + .pm-profile-contact-section {
  margin-top: 2px !important;
}

body[data-page="parliament-members"] .pm-profile-votemix-legend {
  align-content: start !important;
  min-width: 0 !important;
}

body[data-page="parliament-members"] .pm-profile-votemix-item {
  padding: 2px 0 !important;
}

body[data-page="parliament-members"] .pm-profile-votemix-value {
  text-align: right !important;
  white-space: nowrap !important;
}

/* Debates: one readable scroll shell, fewer nested planes, better reflow on zoom. */
body[data-page="parliament-members"] .pm-debates-card {
  overflow: visible !important;
  background: #ffffff !important;
}

body[data-page="parliament-members"] .pm-debates-list {
  max-height: min(78vh, 860px) !important;
  background:
    linear-gradient(rgba(21, 33, 28, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21, 33, 28, 0.018) 1px, transparent 1px),
    #f9fbfa !important;
  background-size: 34px 34px, 34px 34px, auto !important;
  border-top: 1px solid rgba(83, 103, 94, 0.14) !important;
}

body[data-page="parliament-members"] .pm-debate-item {
  border-left-width: 2px !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.045) !important;
}

body[data-page="parliament-members"] .pm-debate-text-shell {
  max-height: clamp(240px, 34vh, 520px) !important;
  border-color: rgba(83, 103, 94, 0.16) !important;
  background: #ffffff !important;
  padding: clamp(13px, 1.3vw, 21px) !important;
}

body[data-page="parliament-members"] .pm-debate-text {
  font-size: clamp(13px, 0.92vw, 15px) !important;
  line-height: 1.72 !important;
  max-width: 118ch !important;
  overflow-wrap: break-word !important;
}

body[data-page="parliament-members"] .pm-speeches-topic-header {
  box-shadow: 0 1px 2px rgba(21, 33, 28, 0.05) !important;
}

/* Workstream source links: make rows scannable and avoid "fake source" feel. */
body[data-page="parliament-members"] .pm-profile-workstream-list {
  max-height: min(52vh, 520px) !important;
  gap: 8px !important;
}

body[data-page="parliament-members"] .pm-workstream-row {
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 4px 13px !important;
  padding: 10px 12px !important;
}

body[data-page="parliament-members"] .pm-workstream-title,
body[data-page="parliament-members"] .pm-workstream-meta {
  min-width: 0 !important;
}

body[data-page="parliament-members"] .pm-workstream-meta {
  grid-column: 1 / 2 !important;
}

body[data-page="parliament-members"] .pm-workstream-link {
  grid-column: 2 / 3 !important;
  grid-row: 1 / 3 !important;
  align-self: center !important;
  border: 1px solid rgba(39, 110, 241, 0.22) !important;
  border-radius: 999px !important;
  background: rgba(39, 110, 241, 0.07) !important;
  color: #1859cc !important;
  padding: 5px 9px !important;
  white-space: nowrap !important;
}

body[data-page="parliament-members"] .pm-workstream-link:hover {
  background: rgba(39, 110, 241, 0.13) !important;
  text-decoration: none !important;
}

/* Vote heatmap: align with the current civic/blue visual system. */
body[data-page="parliament-members"] .pm-heatmap-wrap,
body[data-page="parliament-members"] .pm-heatmap-scroll {
  border: 1px solid var(--ma-line) !important;
  border-radius: var(--ma-radius) !important;
  background: #ffffff !important;
  box-shadow: var(--ma-shadow-quiet) !important;
}

body[data-page="parliament-members"] .pm-heatmap-scroll {
  max-height: min(72vh, 780px) !important;
}

body[data-page="parliament-members"] .pm-heatmap-table {
  border-collapse: separate !important;
  border-spacing: 2px !important;
  padding: 8px !important;
}

body[data-page="parliament-members"] .hm-th,
body[data-page="parliament-members"] .hm-name {
  background: #ffffff !important;
  color: var(--ma-ink-muted) !important;
}

body[data-page="parliament-members"] .hm-cell {
  width: 18px !important;
  height: 18px !important;
  border-radius: 5px !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.34) !important;
  opacity: 0.94 !important;
}

body[data-page="parliament-members"] .hm-cell.for { background: #16846f !important; }
body[data-page="parliament-members"] .hm-cell.against { background: #c2413d !important; }
body[data-page="parliament-members"] .hm-cell.abstain { background: #b7791f !important; }
body[data-page="parliament-members"] .hm-cell.did-not-vote { background: #4c8a88 !important; opacity: 0.86 !important; }
body[data-page="parliament-members"] .hm-cell.absent { background: #d7e0dc !important; opacity: 0.72 !important; }
body[data-page="parliament-members"] .hm-cell.hm-match {
  outline: 2px solid #276ef1 !important;
  outline-offset: -2px !important;
}

body[data-page="parliament-members"] .pm-heatmap-legend {
  background: #ffffff !important;
  border: 1px solid var(--ma-line) !important;
  border-radius: 999px !important;
  padding: 7px 10px !important;
  width: fit-content !important;
}

/* Compare Members: remove old dark-blue block and restore contrast. */
body[data-page="parliament-members"] .cp-result-header {
  background: linear-gradient(180deg, #f8fbff 0%, #eef5ff 100%) !important;
  border-bottom: 1px solid rgba(148, 163, 184, 0.28) !important;
}

body[data-page="parliament-members"] .cp-mep-name,
body[data-page="parliament-members"] .cp-benchmark-line {
  color: var(--ma-ink) !important;
}

body[data-page="parliament-members"] .cp-mep-meta,
body[data-page="parliament-members"] .cp-agree-lbl {
  color: var(--ma-ink-muted) !important;
}

body[data-page="parliament-members"] .cp-sel-badge {
  background: #ffffff !important;
  border: 1px solid rgba(148, 163, 184, 0.34) !important;
  color: var(--ma-ink) !important;
}

body[data-page="parliament-members"] .cp-sel-name {
  color: var(--ma-ink) !important;
}

body[data-page="parliament-members"] .cp-sel-grp,
body[data-page="parliament-members"] .cp-sel-clear {
  color: var(--ma-ink-muted) !important;
}

/* Fullscreen export controls and captured caption. */
.ma-fs-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ma-fs-export {
  min-height: 32px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(255, 255, 255, 0.08);
  color: #eaf2ff;
  font-size: 11px;
  font-weight: 730;
  cursor: pointer;
  padding: 0 11px;
}

.ma-fs-export:hover {
  border-color: rgba(96, 165, 250, 0.62);
  background: rgba(96, 165, 250, 0.18);
  color: #ffffff;
}

.ma-export-caption {
  display: none;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 13px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fafc 100%);
  color: #15211c;
  margin: 0 0 12px;
  padding: 12px 14px;
}

body.ma-fs-exporting .ma-export-caption {
  display: block;
}

.ma-export-caption__title {
  font-size: 17px;
  font-weight: 820;
  line-height: 1.2;
}

.ma-export-caption__meta {
  margin-top: 5px;
  color: #5d6c65;
  font-size: 12.5px;
  line-height: 1.45;
}

.ma-export-caption__foot {
  margin-top: 8px;
  color: #789087;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.ma-fs-content > .sigma-canvas-wrap.ma-fs-active-container .ma-export-caption,
.ma-fs-content > .tm-power-canvas-wrap.ma-fs-active-container .ma-export-caption,
.ma-fs-content > .pm-profile-influence-canvas.ma-fs-active-container .ma-export-caption,
.ma-fs-content > .tm-topic-alliance-wrap.ma-fs-active-container .ma-export-caption {
  position: absolute;
  top: 13px;
  left: 13px;
  right: 13px;
  z-index: 60;
}

/* Graph page: use the full viewport and make the left column feel anchored. */

/* .explorer-shell border-radius/border-left/border-right removed here:
   superseded by later passes and always beaten by the final consolidated
   rule (~line 6812), which already renders border:0 and border-radius:8px. */


/* Desktop only: under 900px the sidebar is an off-canvas drawer (position: fixed); forcing
   relative there kept its 264px in the flow and squeezed the graph into a sliver on phones. */
@media (min-width: 901px) {
  body[data-page="graph"] .sigma-sidebar {
    position: relative !important;
    top: auto !important;
    align-self: stretch !important;
    height: 100% !important;
  }
}

body[data-page="graph"] .sigma-canvas-wrap::before {
  inset: 0 !important;
  border-left: 0 !important;
  border-right: 0 !important;
  border-radius: 0 !important;
}

body[data-page="graph"] .sg-legend {
  max-width: min(82%, 980px) !important;
}

/* Topics & Mandates sidebar: fixed shell with internal nav scroll. */
body[data-page="topics-mandates"] .dashboard-sidebar {
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  width: var(--ma-sidebar-w) !important;
  min-width: var(--ma-sidebar-w) !important;
}

body[data-page="topics-mandates"] .sidebar-panel-nav {
  flex: 1 1 auto !important;
  min-height: 150px !important;
  max-height: none !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding-bottom: 8px !important;
  scrollbar-gutter: stable !important;
}

body[data-page="topics-mandates"] .tm-sections-actions,
body[data-page="topics-mandates"] .tm-sidebar-foot {
  flex: 0 0 auto !important;
}

body[data-page="topics-mandates"] .tm-sections-showall {
  margin-inline: 1rem !important;
  width: calc(100% - 2rem) !important;
}

body[data-page="topics-mandates"] .tm-sidebar-foot {
  background: linear-gradient(180deg, rgba(18, 28, 24, 0.84) 0%, rgba(13, 21, 19, 0.98) 100%) !important;
}

body[data-page="topics-mandates"] .loading-card .loading-title,
body[data-page="topics-mandates"] .loading-card .loading-meta {
  color: var(--ma-ink) !important;
  text-shadow: none !important;
}

body[data-page="topics-mandates"] .loading-card .progress-track {
  background: rgba(21, 33, 28, 0.12) !important;
}

body[data-page="topics-mandates"] .loading-card .progress-fill {
  min-width: 8px !important;
}

/* Topics: Likely Interested MEPs must be a light, high-contrast analysis card. */
body[data-page="topics-mandates"] .tm-topic-interest-panel,
body[data-page="topics-mandates"] .tm-topic-interest-panel .tmep-list {
  background: #ffffff !important;
  color: var(--ma-ink) !important;
}

body[data-page="topics-mandates"] .tm-topic-interest-panel {
  border: 1px solid var(--ma-line) !important;
  box-shadow: var(--ma-shadow-quiet) !important;
}

body[data-page="topics-mandates"] .tm-topic-interest-panel .tmep-title,
body[data-page="topics-mandates"] .tm-topic-interest-panel .tmep-name,
body[data-page="topics-mandates"] .tm-topic-interest-panel .tmep-score-num {
  color: var(--ma-ink) !important;
}

body[data-page="topics-mandates"] .tm-topic-interest-panel .tmep-scoring-note,
body[data-page="topics-mandates"] .tm-topic-interest-panel .tmep-meta,
body[data-page="topics-mandates"] .tm-topic-interest-panel .tmep-score-lbl,
body[data-page="topics-mandates"] .tm-topic-interest-panel .tmep-bar-num {
  color: var(--ma-ink-muted) !important;
}

body[data-page="topics-mandates"] .tm-topic-interest-panel .tmep-item {
  background: #ffffff !important;
  border: 1px solid rgba(148, 163, 184, 0.28) !important;
  color: var(--ma-ink) !important;
}

body[data-page="topics-mandates"] .tm-topic-interest-panel .tmep-bar-track {
  background: rgba(21, 33, 28, 0.1) !important;
}

body[data-page="topics-mandates"] .tm-topic-interest-panel .tmep-topic-pill {
  background: rgba(39, 110, 241, 0.09) !important;
  border-color: rgba(39, 110, 241, 0.24) !important;
  color: #1859cc !important;
}

/* Landing dashboard: replace the oversized empty hero with a denser evidence-first layout. */

body[data-page="landing-public"] .landing-hero-lite {
  min-height: clamp(560px, 68vh, 760px) !important;
  align-items: center !important;
  border-bottom: 1px solid rgba(149, 164, 157, 0.28) !important;
  background:
    radial-gradient(circle at 18% 24%, rgba(39, 110, 241, 0.12) 0, transparent 30%),
    radial-gradient(circle at 88% 72%, rgba(28, 140, 98, 0.10) 0, transparent 28%),
    linear-gradient(138deg, rgba(255, 255, 255, 0.94) 0%, rgba(245, 250, 247, 0.95) 100%) !important;
}

body[data-page="landing-public"] .landing-hero-lite .landing-wrap {
  width: min(100% - 96px, 1800px) !important;
  max-width: 1800px !important;
  padding: clamp(28px, 4vw, 56px) 0 !important;
  text-align: left !important;
}

body[data-page="landing-public"] .landing-hero-grid {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(440px, 0.78fr);
  align-items: center;
  gap: clamp(28px, 5vw, 78px);
}

body[data-page="landing-public"] .landing-watermark {
  padding: 3.5vh 1vw !important;
  font-size: clamp(52px, 8.4vw, 132px) !important;
  color: rgba(184, 204, 238, 0.46) !important;
  justify-content: space-between !important;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.70) 18%, rgba(0,0,0,0.58) 78%, transparent 100%) !important;
  mask-image: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.70) 18%, rgba(0,0,0,0.58) 78%, transparent 100%) !important;
}


body[data-page="landing-public"] .landing-hero-kicker {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border: 1px solid rgba(39, 110, 241, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: #1859cc;
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 10px 28px rgba(21, 33, 28, 0.06);
}

body[data-page="landing-public"] .landing-product-title {
  margin: 0 !important;
  font-size: clamp(56px, 6.8vw, 118px) !important;
  line-height: 0.86 !important;
  letter-spacing: -0.065em !important;
  color: #111827 !important;
}

body[data-page="landing-public"] .landing-title {
  margin: 0 !important;
  max-width: 18ch !important;
  font-size: clamp(30px, 3.4vw, 58px) !important;
  line-height: 1.02 !important;
  letter-spacing: -0.045em !important;
  font-weight: 800 !important;
  text-align: left !important;
  color: #15211c !important;
}

body[data-page="landing-public"] .landing-title span {
  color: #276ef1 !important;
}

body[data-page="landing-public"] .landing-subtitle {
  margin: 0 !important;
  max-width: 72ch !important;
  color: #43534b !important;
  font-size: clamp(15px, 1.1vw, 18px) !important;
  line-height: 1.62 !important;
  text-align: left !important;
}

body[data-page="landing-public"] .landing-hero-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

body[data-page="landing-public"] .landing-hero-metrics span {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  border: 1px solid rgba(149, 164, 157, 0.30);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: #59665f;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(21, 33, 28, 0.05);
}

body[data-page="landing-public"] .landing-hero-metrics strong {
  color: #15211c;
  font-size: 18px;
  letter-spacing: -0.03em;
}

body[data-page="landing-public"] .landing-cta-row {
  justify-content: flex-start !important;
  margin-top: 8px !important;
}

body[data-page="landing-public"] .landing-proof-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(149, 164, 157, 0.30);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.93) 0%, rgba(248, 251, 249, 0.95) 100%);
  box-shadow: 0 28px 76px rgba(21, 33, 28, 0.14), 0 1px 0 rgba(255,255,255,0.75) inset;
  padding: clamp(22px, 2.5vw, 34px);
}

body[data-page="landing-public"] .landing-proof-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, #276ef1 0%, #1c8c62 55%, #c7a33a 100%);
}

body[data-page="landing-public"] .landing-proof-label {
  margin-bottom: 18px;
  color: #59665f;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}

body[data-page="landing-public"] .landing-proof-list {
  display: grid;
  gap: 14px;
}

body[data-page="landing-public"] .landing-proof-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 14px;
  padding: 15px;
  border: 1px solid rgba(149, 164, 157, 0.22);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
}

body[data-page="landing-public"] .landing-proof-item > span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: rgba(39, 110, 241, 0.10);
  color: #1859cc;
  font-size: 12px;
  font-weight: 900;
}

body[data-page="landing-public"] .landing-proof-item strong {
  display: block;
  color: #15211c;
  font-size: 15px;
  line-height: 1.25;
  letter-spacing: -0.018em;
}

body[data-page="landing-public"] .landing-proof-item p {
  margin: 6px 0 0;
  color: #59665f;
  font-size: 13.5px;
  line-height: 1.52;
}

body[data-page="landing-public"] .landing-offer-section,
body[data-page="landing-public"] .landing-module-section,
body[data-page="landing-public"] .landing-login-section {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

@media (max-width: 1060px) {
  /* .landing-hero-grid's mobile grid-template-columns/gap now live on the later, actually-
     winning unconditional rule for this selector (see below) -- this was dead code. */

  body[data-page="landing-public"] .landing-proof-panel {
    max-width: 760px;
  }
}

@media (max-width: 700px) {
  body[data-page="landing-public"] .landing-wrap,
  body[data-page="landing-public"] .landing-hero-lite .landing-wrap {
    width: min(100% - 28px, 1520px) !important;
  }

  body[data-page="landing-public"] .landing-hero-lite {
    min-height: unset !important;
  }

  body[data-page="landing-public"] .landing-hero-lite .landing-wrap {
    padding: 30px 0 34px !important;
  }

  body[data-page="landing-public"] .landing-watermark {
    font-size: clamp(34px, 15vw, 72px) !important;
    opacity: 0.62;
  }

  body[data-page="landing-public"] .landing-product-title {
    font-size: clamp(42px, 16vw, 74px) !important;
  }

  body[data-page="landing-public"] .landing-title {
    font-size: clamp(28px, 9vw, 42px) !important;
  }

  body[data-page="landing-public"] .landing-proof-item {
    grid-template-columns: 1fr;
  }
}

/* Landing interactive demo: one strong product preview instead of generic offer/module slides. */
body[data-page="landing-public"] .landing-demo-section {
  position: relative;
  padding: clamp(58px, 6vw, 104px) 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 12%, rgba(39, 110, 241, 0.10) 0, transparent 28%),
    radial-gradient(circle at 92% 82%, rgba(28, 140, 98, 0.10) 0, transparent 30%),
    linear-gradient(180deg, #f8faf8 0%, #eef4f1 100%);
  border-top: 1px solid rgba(149, 164, 157, 0.26);
  border-bottom: 1px solid rgba(149, 164, 157, 0.26);
}

body[data-page="landing-public"] .landing-demo-shell {
  border: 1px solid rgba(149, 164, 157, 0.28);
  border-radius: 34px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.90), rgba(249,252,250,0.92));
  box-shadow: 0 34px 90px rgba(21, 33, 28, 0.12);
  padding: clamp(22px, 3vw, 42px);
}

body[data-page="landing-public"] .landing-demo-header {
  max-width: 980px;
  margin-bottom: clamp(22px, 3vw, 36px);
}

body[data-page="landing-public"] .landing-demo-kicker {
  display: inline-flex;
  width: fit-content;
  border: 1px solid rgba(39, 110, 241, 0.24);
  border-radius: 999px;
  background: rgba(39, 110, 241, 0.08);
  color: #1859cc;
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body[data-page="landing-public"] .landing-demo-header h2 {
  margin: 14px 0 10px;
  color: #15211c;
  font-size: clamp(34px, 4.4vw, 76px) !important;
  line-height: 0.95;
  letter-spacing: -0.06em;
  border: 0 !important;
  padding: 0 !important;
}

body[data-page="landing-public"] .landing-demo-header p {
  margin: 0;
  max-width: 78ch;
  color: #59665f;
  font-size: clamp(15px, 1.1vw, 18px);
  line-height: 1.62;
}

body[data-page="landing-public"] .landing-demo-grid {
  display: grid;
  grid-template-columns: minmax(270px, 0.72fr) minmax(440px, 1.08fr) minmax(260px, 0.62fr);
  gap: clamp(14px, 1.8vw, 24px);
  align-items: stretch;
}

body[data-page="landing-public"] .landing-demo-controls,
body[data-page="landing-public"] .landing-kiviat-card,
body[data-page="landing-public"] .landing-demo-groups {
  border: 1px solid rgba(149, 164, 157, 0.26);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 18px 46px rgba(21, 33, 28, 0.08);
}

body[data-page="landing-public"] .landing-demo-controls {
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 18px;
}

body[data-page="landing-public"] .landing-demo-person {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(149, 164, 157, 0.20);
}

body[data-page="landing-public"] .landing-demo-avatar {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 18px;
  background: linear-gradient(135deg, #15211c 0%, #1c8c62 100%);
  color: #ffffff;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: -0.02em;
  box-shadow: 0 14px 30px rgba(21, 33, 28, 0.18);
}

body[data-page="landing-public"] .landing-demo-name {
  color: #15211c;
  font-size: 19px;
  font-weight: 900;
  letter-spacing: -0.025em;
}

body[data-page="landing-public"] .landing-demo-role {
  margin-top: 2px;
  color: #6c7972;
  font-size: 12px;
  font-weight: 700;
}

body[data-page="landing-public"] .landing-demo-field {
  display: grid;
  gap: 7px;
}

body[data-page="landing-public"] .landing-demo-field span {
  color: #59665f;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body[data-page="landing-public"] .landing-demo-field select {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(149, 164, 157, 0.36);
  border-radius: 14px;
  background: #ffffff;
  color: #15211c;
  padding: 0 13px;
  font: inherit;
  font-weight: 800;
  outline: none;
  box-shadow: 0 8px 24px rgba(21, 33, 28, 0.04);
}

body[data-page="landing-public"] .landing-demo-field select:focus {
  border-color: rgba(39, 110, 241, 0.60);
  box-shadow: 0 0 0 4px rgba(39, 110, 241, 0.12);
}

body[data-page="landing-public"] .landing-demo-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

body[data-page="landing-public"] .landing-demo-preset {
  border: 1px solid rgba(149, 164, 157, 0.32);
  border-radius: 999px;
  background: #ffffff;
  color: #43534b;
  padding: 8px 11px;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, color .18s ease;
}

body[data-page="landing-public"] .landing-demo-preset:hover {
  transform: translateY(-1px);
  border-color: rgba(39, 110, 241, 0.38);
}

body[data-page="landing-public"] .landing-demo-preset.active {
  background: #276ef1;
  border-color: #276ef1;
  color: #ffffff;
  box-shadow: 0 12px 26px rgba(39, 110, 241, 0.22);
}

body[data-page="landing-public"] .landing-demo-result {
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(21, 33, 28, 0.96), rgba(24, 89, 62, 0.94));
  color: #ffffff;
  padding: 16px;
}

body[data-page="landing-public"] .landing-demo-result span {
  display: block;
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.64);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body[data-page="landing-public"] .landing-demo-result strong {
  display: block;
  font-size: 20px;
  letter-spacing: -0.03em;
}

body[data-page="landing-public"] .landing-demo-result p {
  margin: 7px 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13.5px;
  line-height: 1.55;
}

body[data-page="landing-public"] .landing-kiviat-card {
  position: relative;
  overflow: hidden;
  padding: clamp(18px, 2vw, 28px);
}

body[data-page="landing-public"] .landing-kiviat-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(39, 110, 241, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(39, 110, 241, 0.055) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.60), transparent 80%);
}

body[data-page="landing-public"] .landing-kiviat-head,
body[data-page="landing-public"] .landing-kiviat-stage,
body[data-page="landing-public"] .landing-kiviat-legend {
  position: relative;
  z-index: 1;
}

body[data-page="landing-public"] .landing-kiviat-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 8px;
}

body[data-page="landing-public"] .landing-kiviat-label {
  color: #59665f;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

body[data-page="landing-public"] .landing-kiviat-head h3 {
  margin: 5px 0 0;
  color: #15211c;
  font-size: clamp(20px, 1.7vw, 28px);
  letter-spacing: -0.035em;
}

body[data-page="landing-public"] .landing-kiviat-score {
  min-width: 92px;
  border: 1px solid rgba(39, 110, 241, 0.18);
  border-radius: 18px;
  background: rgba(39, 110, 241, 0.08);
  color: #1859cc;
  padding: 10px 12px;
  text-align: center;
}

body[data-page="landing-public"] .landing-kiviat-score strong {
  display: block;
  font-size: 32px;
  line-height: 0.95;
  letter-spacing: -0.06em;
}

body[data-page="landing-public"] .landing-kiviat-score span {
  color: #59665f;
  font-size: 11px;
  font-weight: 900;
}

body[data-page="landing-public"] .landing-kiviat-stage {
  display: grid;
  place-items: center;
  min-height: 420px;
}

body[data-page="landing-public"] .landing-kiviat-svg {
  width: min(100%, 520px);
  height: auto;
  overflow: visible;
}

body[data-page="landing-public"] .landing-kiviat-grid polygon,
body[data-page="landing-public"] .landing-kiviat-grid line {
  fill: none;
  stroke: rgba(149, 164, 157, 0.36);
  stroke-width: 1.2;
}

body[data-page="landing-public"] .landing-kiviat-benchmark {
  fill: rgba(149, 164, 157, 0.18);
  stroke: rgba(89, 102, 95, 0.58);
  stroke-width: 2;
  stroke-dasharray: 5 5;
  transition: points .28s ease;
}

body[data-page="landing-public"] .landing-kiviat-member {
  fill: rgba(39, 110, 241, 0.24);
  stroke: #276ef1;
  stroke-width: 3.2;
  filter: drop-shadow(0 18px 28px rgba(39, 110, 241, 0.18));
  transition: points .28s ease;
}

body[data-page="landing-public"] .landing-kiviat-dots circle {
  fill: #ffffff;
  stroke: #276ef1;
  stroke-width: 3;
}

body[data-page="landing-public"] .landing-kiviat-axis-labels text {
  fill: #43534b;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: -0.01em;
}

body[data-page="landing-public"] .landing-kiviat-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-top: 2px;
  color: #59665f;
  font-size: 12px;
  font-weight: 900;
}

body[data-page="landing-public"] .landing-kiviat-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

body[data-page="landing-public"] .landing-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

body[data-page="landing-public"] .landing-legend-dot--member {
  background: #276ef1;
}

body[data-page="landing-public"] .landing-legend-dot--benchmark {
  background: #95a49d;
}

body[data-page="landing-public"] .landing-demo-groups {
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 18px;
}

body[data-page="landing-public"] .landing-demo-groups-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(149, 164, 157, 0.20);
}

body[data-page="landing-public"] .landing-demo-groups-head span {
  color: #59665f;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

body[data-page="landing-public"] .landing-demo-groups-head strong {
  color: #15211c;
  font-size: 17px;
  letter-spacing: -0.025em;
}

body[data-page="landing-public"] .landing-demo-bars {
  display: grid;
  gap: 12px;
}

body[data-page="landing-public"] .landing-demo-bar {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 10px;
  color: #43534b;
  font-size: 12px;
  font-weight: 900;
}

body[data-page="landing-public"] .landing-demo-bar i {
  position: relative;
  display: block;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(149, 164, 157, 0.18);
}

body[data-page="landing-public"] .landing-demo-bar i::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--w, 50%);
  border-radius: inherit;
  background: linear-gradient(90deg, #276ef1, #1c8c62);
  transition: width .28s ease;
}

body[data-page="landing-public"] .landing-demo-bar.is-benchmark span {
  color: #1859cc;
}

body[data-page="landing-public"] .landing-demo-bar.is-benchmark i {
  box-shadow: 0 0 0 3px rgba(39, 110, 241, 0.10);
}

body[data-page="landing-public"] .landing-demo-bar strong {
  color: #15211c;
  text-align: right;
}

body[data-page="landing-public"] .landing-demo-note {
  margin: 0;
  border-top: 1px solid rgba(149, 164, 157, 0.20);
  padding-top: 14px;
  color: #6c7972;
  font-size: 12px;
  line-height: 1.52;
}

@media (max-width: 1180px) {
  body[data-page="landing-public"] .landing-demo-grid {
    grid-template-columns: 1fr;
  }

  body[data-page="landing-public"] .landing-demo-controls,
  body[data-page="landing-public"] .landing-demo-groups {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-page="landing-public"] .landing-demo-person,
  body[data-page="landing-public"] .landing-demo-result,
  body[data-page="landing-public"] .landing-demo-groups-head,
  body[data-page="landing-public"] .landing-demo-bars,
  body[data-page="landing-public"] .landing-demo-note {
    grid-column: 1 / -1;
  }
}

@media (max-width: 700px) {
  body[data-page="landing-public"] .landing-demo-shell {
    border-radius: 24px;
    padding: 16px;
  }

  body[data-page="landing-public"] .landing-demo-controls,
  body[data-page="landing-public"] .landing-demo-groups {
    grid-template-columns: 1fr;
  }

  body[data-page="landing-public"] .landing-kiviat-head {
    display: grid;
  }

  body[data-page="landing-public"] .landing-kiviat-score {
    width: fit-content;
  }

  body[data-page="landing-public"] .landing-kiviat-stage {
    min-height: 330px;
  }

  body[data-page="landing-public"] .landing-kiviat-axis-labels text {
    font-size: 10px;
  }
}

/* Landing hardening: full-width sections, cleaner hero, safer mobile/tablet layout. */
body[data-page="landing-public"] .landing-wrap {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
}

body[data-page="landing-public"] .landing-hero-lite {
  min-height: max(100svh - 72px, 720px) !important;
  align-items: stretch !important;
}

body[data-page="landing-public"] .landing-hero-lite .landing-wrap {
  width: 100% !important;
  max-width: none !important;
  min-height: 100%;
  padding: clamp(20px, 3vw, 44px) clamp(24px, 4vw, 56px) 0 !important;
}

body[data-page="landing-public"] .landing-hero-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1.02fr) minmax(420px, 0.98fr) !important;
  align-items: start !important;
  gap: clamp(24px, 4vw, 64px) !important;
  min-height: calc(100svh - 72px - clamp(20px, 3vw, 44px));
}
/* An earlier @media(max-width:1060px) rule meant to stack this to a single column below tablet
   width, but this unconditional !important rule always won -- the hard `minmax(420px, ...)`
   second column never collapsed, so anything under ~950-1000px wide (tablets, phones) was
   forced past its natural width. Restoring the intended stack on the rule that actually wins. */
@media (max-width: 1060px) {
  body[data-page="landing-public"] .landing-hero-grid {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }
}

body[data-page="landing-public"] .landing-hero-copy {
  align-content: start;
  justify-items: start !important;
  gap: 14px !important;
  max-width: 920px !important;
  margin: 0 !important;
  padding: clamp(10px, 2vh, 24px) 0 clamp(28px, 4vh, 40px);
}

body[data-page="landing-public"] .landing-hero-logo {
  width: clamp(240px, 26vw, 420px);
  max-width: 100%;
  height: auto;
}

body[data-page="landing-public"] .landing-title {
  max-width: 10.8ch !important;
  margin: 0 !important;
  font-size: clamp(32px, 3.6vw, 64px) !important;
}

body[data-page="landing-public"] .landing-subtitle {
  max-width: 62ch !important;
  text-align: left !important;
}

body[data-page="landing-public"] .landing-cta-row {
  justify-content: flex-start !important;
}

body[data-page="landing-public"] .landing-trust-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  width: min(100%, 980px);
  margin-top: 14px;
}

body[data-page="landing-public"] .landing-trust-row span {
  display: grid;
  gap: 5px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(149, 164, 157, 0.22);
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 14px 30px rgba(21, 33, 28, 0.06);
  color: #59665f;
  font-size: 13px;
  line-height: 1.5;
}

body[data-page="landing-public"] .landing-trust-row strong {
  color: #15211c;
  font-size: 18px;
  letter-spacing: -0.03em;
}

body[data-page="landing-public"] .landing-hero-visual {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: 100%;
  padding: 0 0 clamp(22px, 4vh, 40px);
}

body[data-page="landing-public"] .landing-hero-visual-shell {
  position: relative;
  width: 100%;
  min-height: clamp(420px, 54vh, 700px);
  overflow: visible;
  border-radius: 0;
  border: 0;
  background:
    url("mandate-atlas-hero-illustration.png") center center / contain no-repeat,
    radial-gradient(circle at 70% 34%, rgba(39, 110, 241, 0.08) 0, transparent 30%),
    radial-gradient(circle at 84% 76%, rgba(199, 163, 58, 0.10) 0, transparent 16%);
}

body[data-page="landing-public"] .landing-hero-visual-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 22% 18%, rgba(39, 110, 241, 0.08) 0, transparent 22%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02) 0%, rgba(255, 255, 255, 0.22) 100%);
  pointer-events: none;
}

body[data-page="landing-public"] .landing-hero-visual-card {
  position: absolute;
  z-index: 1;
  max-width: min(320px, calc(100% - 32px));
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 18px 40px rgba(21, 33, 28, 0.12);
}

body[data-page="landing-public"] .landing-hero-visual-card--primary {
  left: clamp(18px, 2vw, 26px);
  top: clamp(18px, 2vw, 26px);
}

body[data-page="landing-public"] .landing-hero-visual-card--floating {
  right: clamp(18px, 2vw, 26px);
  bottom: clamp(18px, 2vw, 26px);
  max-width: 260px;
}

body[data-page="landing-public"] .landing-hero-visual-label,
body[data-page="landing-public"] .landing-hero-visual-mini {
  display: inline-flex;
  margin-bottom: 10px;
  color: #1859cc;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body[data-page="landing-public"] .landing-hero-visual-card strong {
  display: block;
  color: #15211c;
  font-size: clamp(20px, 1.8vw, 32px);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

body[data-page="landing-public"] .landing-hero-visual-card p {
  margin: 10px 0 0;
  color: #59665f;
  font-size: 13.5px;
  line-height: 1.55;
}

body[data-page="landing-public"] .landing-outcomes-section,
body[data-page="landing-public"] .landing-demo-section,
body[data-page="landing-public"] .landing-login-section,
body[data-page="landing-public"] .landing-footer {
  width: 100%;
}

body[data-page="landing-public"] .landing-outcomes-section .landing-wrap,
body[data-page="landing-public"] .landing-demo-section .landing-wrap,
body[data-page="landing-public"] .landing-login-section .landing-wrap,
body[data-page="landing-public"] .landing-footer .landing-wrap {
  padding-left: clamp(24px, 4vw, 56px);
  padding-right: clamp(24px, 4vw, 56px);
}

body[data-page="landing-public"] .landing-outcomes-section {
  padding: clamp(56px, 7vw, 96px) 0;
}

body[data-page="landing-public"] .landing-outcomes-head {
  max-width: 980px;
  margin: 0 0 clamp(28px, 4vw, 44px);
}

body[data-page="landing-public"] .landing-outcomes-head h2 {
  margin: 18px 0 0;
  max-width: 14ch;
  color: #15211c;
  font-size: clamp(38px, 5vw, 86px);
  line-height: 0.96;
  letter-spacing: -0.07em;
}

body[data-page="landing-public"] .landing-outcome-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 2vw, 24px);
}

body[data-page="landing-public"] .landing-outcome-card {
  min-height: 280px;
  padding: clamp(22px, 2.4vw, 30px);
  border-radius: 22px;
}

body[data-page="landing-public"] .landing-outcome-card h3 {
  margin: 0 0 18px;
  color: #15211c;
  font-size: clamp(28px, 2.5vw, 44px);
  line-height: 1.04;
  letter-spacing: -0.05em;
}

body[data-page="landing-public"] .landing-outcome-card p {
  margin: 0;
  color: #59665f;
  font-size: clamp(16px, 1.05vw, 19px);
  line-height: 1.55;
}

body[data-page="landing-public"] .landing-login-section .landing-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 460px);
  align-items: start;
  gap: clamp(24px, 4vw, 54px);
}

body[data-page="landing-public"] .landing-auth-copy {
  margin: 0;
  text-align: left;
  max-width: 720px;
  padding-top: 12px;
}

body[data-page="landing-public"] .landing-login-card {
  margin: 0 0 0 auto;
  max-width: 460px;
}

body[data-page="landing-public"] .landing-footer {
  padding: 0 0 44px;
  background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(247,250,248,0.98) 100%);
}

body[data-page="landing-public"] .landing-footer-agency-band {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: clamp(34px, 6vw, 56px) clamp(24px, 4vw, 56px) 22px;
}

body[data-page="landing-public"] .landing-footer-agency-logo {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: min(100%, 420px);
}

body[data-page="landing-public"] .landing-footer-agency-logo img {
  display: block;
  width: 100%;
  max-width: 360px;
  height: auto;
}

body[data-page="landing-public"] .landing-footer-copy {
  gap: 10px;
  padding: 0 clamp(24px, 4vw, 56px);
}

body[data-page="landing-public"] .landing-footer-copy p + p {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

@media (max-width: 1180px) {
  body[data-page="landing-public"] .landing-hero-grid,
  body[data-page="landing-public"] .landing-demo-grid,
  body[data-page="landing-public"] .landing-login-section .landing-wrap {
    grid-template-columns: 1fr !important;
  }

  body[data-page="landing-public"] .landing-outcome-grid,
  body[data-page="landing-public"] .landing-trust-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-page="landing-public"] .landing-login-card {
    margin-left: 0;
  }
}

@media (max-width: 760px) {
  body[data-page="landing-public"] .landing-hero-lite {
    min-height: unset !important;
  }

  body[data-page="landing-public"] .landing-hero-lite .landing-wrap,
  body[data-page="landing-public"] .landing-outcomes-section .landing-wrap,
  body[data-page="landing-public"] .landing-demo-section .landing-wrap,
  body[data-page="landing-public"] .landing-login-section .landing-wrap,
  body[data-page="landing-public"] .landing-footer .landing-wrap {
    padding-left: 18px !important;
    padding-right: 18px !important;
  }

  body[data-page="landing-public"] .landing-hero-lite .landing-wrap {
    padding-top: 18px !important;
    padding-bottom: 28px !important;
  }

  body[data-page="landing-public"] .landing-hero-grid {
    min-height: auto;
    gap: 20px !important;
  }

  body[data-page="landing-public"] .landing-hero-copy {
    padding: 18px 0 0;
  }

  body[data-page="landing-public"] .landing-title {
    max-width: 12ch !important;
    font-size: clamp(28px, 8.8vw, 42px) !important;
  }

  body[data-page="landing-public"] .landing-subtitle {
    font-size: 15px !important;
  }

  body[data-page="landing-public"] .landing-trust-row,
  body[data-page="landing-public"] .landing-outcome-grid {
    grid-template-columns: 1fr;
  }

  body[data-page="landing-public"] .landing-hero-visual {
    padding: 0 0 10px;
  }

  body[data-page="landing-public"] .landing-hero-visual-shell {
    min-height: 360px;
    background-size: cover;
  }

  body[data-page="landing-public"] .landing-hero-visual-card {
    max-width: calc(100% - 24px);
    padding: 14px;
  }

  body[data-page="landing-public"] .landing-outcomes-head h2 {
    max-width: 9.5ch;
    font-size: clamp(34px, 12vw, 52px);
  }

  body[data-page="landing-public"] .landing-outcome-card {
    min-height: 0;
  }

  body[data-page="landing-public"] .landing-kiviat-card {
    display: none;
  }

  body[data-page="landing-public"] .landing-demo-controls,
  body[data-page="landing-public"] .landing-demo-groups {
    grid-template-columns: 1fr;
  }
}

body[data-page="landing-public"] .landing-watermark {
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0.60), transparent 80%);
}

/* Final panel polish: keep Topics & Mandate and Parliament Members on the same border language. */
body[data-page="topics-mandates"] {
  --ma-panel-border: rgba(83, 103, 94, 0.18);
  --ma-panel-border-strong: rgba(83, 103, 94, 0.24);
  --ma-panel-surface: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(247, 251, 249, 0.98) 100%);
  --ma-panel-shadow: 0 16px 34px rgba(15, 23, 42, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.82);
  --ma-panel-radius: 16px;
}

body[data-page="topics-mandates"] .tm-panel,
body[data-page="topics-mandates"] .tm-section-card,
body[data-page="topics-mandates"] .tm-topic-lens,
body[data-page="topics-mandates"] .tm-section-card .chart-card,
body[data-page="topics-mandates"] .tm-section-card .command-card,
body[data-page="topics-mandates"] .tm-section-card .tm-cluster-card,
body[data-page="topics-mandates"] .tm-section-card .tm-context-card,
body[data-page="topics-mandates"] .tm-section-card .tm-drill-detail,
body[data-page="topics-mandates"] #analysisTopicMatrixContainer .topic-matrix-wrap,
body[data-page="topics-mandates"] #topicOpportunityInsights,
body[data-page="topics-mandates"] article.tm-topic-interest-panel {
  border: 1px solid var(--ma-panel-border) !important;
  border-radius: var(--ma-panel-radius) !important;
  background: var(--ma-panel-surface) !important;
  box-shadow: var(--ma-panel-shadow) !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

body[data-page="topics-mandates"] .tm-section-card-head,
body[data-page="topics-mandates"] .tm-section-card-body,
body[data-page="topics-mandates"] .tm-inner-card-head,
body[data-page="topics-mandates"] .chart-card__header {
  border-color: var(--ma-panel-border) !important;
}


body[data-page="parliament-members"] {
  --ma-pm-panel-border: rgba(148, 163, 184, 0.22);
  --ma-pm-panel-surface: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(247, 250, 255, 0.98) 100%);
  --ma-pm-panel-shadow: 0 16px 34px rgba(15, 23, 42, 0.07), inset 0 1px 0 rgba(255,255,255,0.82);
}

body[data-page="parliament-members"] .pm-profile-contact-card,
body[data-page="parliament-members"] .pm-profile-votemix-card,
body[data-page="parliament-members"] .pm-profile-overview-card,
body[data-page="parliament-members"] .pm-profile-drill-card,
body[data-page="parliament-members"] .pm-brief-overlay-card,
body[data-page="parliament-members"] .pm-debates-card,
body[data-page="parliament-members"] .chart-card,
body[data-page="parliament-members"] .cp-context-card,
body[data-page="parliament-members"] .cp-drilldown-card,
body[data-page="parliament-members"] .cp-drill-table-wrap,
body[data-page="parliament-members"] .pm-kiviat-card {
  border: 1px solid var(--ma-pm-panel-border) !important;
  border-radius: 16px !important;
  background: var(--ma-pm-panel-surface) !important;
  box-shadow: var(--ma-pm-panel-shadow) !important;
}

body[data-page="parliament-members"] .pm-profile-votemix-canvas-wrap,
body[data-page="parliament-members"] .chart-container,
body[data-page="parliament-members"] .pm-profile-mini-chart {
  border-radius: 14px !important;
}

body[data-page="parliament-members"] .pm-debates-head,
body[data-page="parliament-members"] .chart-card__header,
body[data-page="parliament-members"] .pm-profile-head,
body[data-page="parliament-members"] .pm-profile-tabs {
  border-color: var(--ma-pm-panel-border) !important;
}

/* ==========================================================================
   Topics & Mandate contrast and chart polish
   Keeps the page on the light parliament-members visual system and cancels
   older dark-glass text rules that made feed/radar content too faint.
   ========================================================================== */

body[data-page="topics-mandates"] {
  --tm-polish-ink: #15211c;
  --tm-polish-muted: #4b5f58;
  --tm-polish-faint: #6c7972;
  --tm-polish-line: rgba(83, 103, 94, 0.24);
  --tm-polish-line-strong: rgba(83, 103, 94, 0.34);
  --tm-polish-surface: rgba(255, 255, 255, 0.98);
  --tm-polish-soft: rgba(244, 248, 246, 0.98);
}

body[data-page="topics-mandates"] .tm-section-card,
body[data-page="topics-mandates"] .tm-section-card .chart-card,
body[data-page="topics-mandates"] .tm-section-card .command-card,
body[data-page="topics-mandates"] .tm-section-card .tm-cluster-card,
body[data-page="topics-mandates"] .tm-section-card .tm-drill-detail,
body[data-page="topics-mandates"] .tm-section-card .tm-context-card,
body[data-page="topics-mandates"] #analysisTopicMatrixContainer .topic-matrix-wrap,
body[data-page="topics-mandates"] #topicOpportunityInsights {
  color: var(--tm-polish-ink) !important;
  border-color: var(--tm-polish-line) !important;
  background: linear-gradient(180deg, var(--tm-polish-surface) 0%, var(--tm-polish-soft) 100%) !important;
}

body[data-page="topics-mandates"] .tm-section-card-title,
body[data-page="topics-mandates"] .tm-section-card .chart-card h3,
body[data-page="topics-mandates"] .tm-section-card .chart-card h4,
body[data-page="topics-mandates"] .tm-cluster-wrap h4,
body[data-page="topics-mandates"] .tm-rebel-wrap h4,
body[data-page="topics-mandates"] .command-title,
body[data-page="topics-mandates"] .command-card h4 {
  color: var(--tm-polish-ink) !important;
  font-weight: 760 !important;
}

body[data-page="topics-mandates"] .tm-section-card-sub,
body[data-page="topics-mandates"] .list-meta,
body[data-page="topics-mandates"] .command-subtitle,
body[data-page="topics-mandates"] .command-meta,
body[data-page="topics-mandates"] .feed-meta,
body[data-page="topics-mandates"] .feed-code,
body[data-page="topics-mandates"] .tm-cluster-head span,
body[data-page="topics-mandates"] .tm-cluster-metrics {
  color: var(--tm-polish-muted) !important;
  opacity: 1 !important;
}

body[data-page="topics-mandates"] .chart-container,
body[data-page="topics-mandates"] .tm-matrix-wrap,
body[data-page="topics-mandates"] .tm-topic-alliance-wrap,
body[data-page="topics-mandates"] .tm-power-canvas-wrap {
  border-color: var(--tm-polish-line) !important;
  background:
    linear-gradient(rgba(83, 103, 94, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(83, 103, 94, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(252, 253, 252, 0.98) 0%, rgba(244, 248, 246, 0.98) 100%) !important;
  background-size: 28px 28px, 28px 28px, auto !important;
}

body[data-page="topics-mandates"] .tm-behaviour-grid .chart-container,
body[data-page="topics-mandates"] .tm-patterns-grid .chart-container {
  min-height: 330px;
}

body[data-page="topics-mandates"] .coalition-chart-wrap {
  min-height: 330px;
}

body[data-page="topics-mandates"] .command-center,
body[data-page="topics-mandates"] .command-card,
body[data-page="topics-mandates"] .command-card-coalition,
body[data-page="topics-mandates"] .command-card-feed {
  color: var(--tm-polish-ink) !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99) 0%, rgba(247, 250, 248, 0.99) 100%) !important;
  border-color: var(--tm-polish-line) !important;
}

body[data-page="topics-mandates"] .command-center [class*="-title"],
body[data-page="topics-mandates"] .command-center [class*="-label"],
body[data-page="topics-mandates"] .command-center [class*="-meta"],
body[data-page="topics-mandates"] .command-center p,
body[data-page="topics-mandates"] .command-center span:not([class*="badge"]):not([class*="pill"]) {
  color: var(--tm-polish-muted) !important;
}

body[data-page="topics-mandates"] .command-center .command-title,
body[data-page="topics-mandates"] .command-center .feed-title,
body[data-page="topics-mandates"] .command-center .command-card h4 {
  color: var(--tm-polish-ink) !important;
}

body[data-page="topics-mandates"] .command-filters span,
body[data-page="topics-mandates"] .tm-inline-field span,
body[data-page="topics-mandates"] .tm-ctrl-label {
  color: var(--tm-polish-muted) !important;
  font-weight: 760 !important;
}

body[data-page="topics-mandates"] .command-feed {
  gap: 11px !important;
}

body[data-page="topics-mandates"] .command-card-feed .command-feed-item,
body[data-page="topics-mandates"] .command-card-feed .feed-item,
body[data-page="topics-mandates"] .command-feed-item {
  color: var(--tm-polish-ink) !important;
  background: rgba(255, 255, 255, 0.96) !important;
  border: 1px solid var(--tm-polish-line) !important;
  border-radius: 8px !important;
  box-shadow: 0 1px 2px rgba(21, 33, 28, 0.05) !important;
}

body[data-page="topics-mandates"] .command-card-feed .command-feed-item:hover,
body[data-page="topics-mandates"] .command-card-feed .feed-item:hover,
body[data-page="topics-mandates"] .command-feed-item:hover,
body[data-page="topics-mandates"] .command-feed-item.active {
  color: var(--tm-polish-ink) !important;
  background: #ffffff !important;
  border-color: rgba(39, 110, 241, 0.42) !important;
  box-shadow: 0 5px 13px rgba(21, 33, 28, 0.10) !important;
}

body[data-page="topics-mandates"] .feed-badge {
  border-radius: 8px !important;
  font-weight: 760 !important;
  opacity: 1 !important;
}

body[data-page="topics-mandates"] .feed-badge.yes {
  color: #0f5f50 !important;
  background: rgba(22, 132, 111, 0.12) !important;
  border-color: rgba(22, 132, 111, 0.25) !important;
}

body[data-page="topics-mandates"] .feed-badge.no {
  color: #8b2522 !important;
  background: rgba(194, 65, 61, 0.10) !important;
  border-color: rgba(194, 65, 61, 0.24) !important;
}

body[data-page="topics-mandates"] .feed-badge.abstain {
  color: #71511c !important;
  background: rgba(183, 121, 31, 0.12) !important;
  border-color: rgba(183, 121, 31, 0.24) !important;
}

body[data-page="topics-mandates"] .topic-matrix {
  color: var(--tm-polish-ink) !important;
  border-collapse: separate;
  border-spacing: 0;
}

body[data-page="topics-mandates"] .topic-matrix thead th {
  color: var(--tm-polish-muted) !important;
  border-bottom-color: var(--tm-polish-line-strong) !important;
}

body[data-page="topics-mandates"] .topic-head-btn {
  color: var(--tm-polish-muted) !important;
}

body[data-page="topics-mandates"] .topic-head-btn.active {
  color: #1859cc !important;
}

body[data-page="topics-mandates"] .topic-matrix-group {
  color: var(--tm-polish-ink) !important;
  background: rgba(255, 255, 255, 0.74) !important;
  border-bottom: 1px solid rgba(83, 103, 94, 0.14);
}

body[data-page="topics-mandates"] .topic-cell {
  border-color: rgba(255, 255, 255, 0.38) !important;
  color: #10231e;
}

body[data-page="topics-mandates"] .topic-pct {
  background: hsl(var(--cell-h, 142), 52%, 57%) !important;
  color: #10231e !important;
}

body[data-page="topics-mandates"] .topic-cell-n {
  opacity: 0.84 !important;
  font-weight: 720 !important;
}

body[data-page="topics-mandates"] .topic-na {
  color: var(--tm-polish-faint) !important;
  background: rgba(244, 248, 246, 0.96) !important;
}

body[data-page="topics-mandates"] .topic-ep-baseline {
  color: var(--tm-polish-ink) !important;
  background: rgba(83, 103, 94, 0.10) !important;
}

body[data-page="topics-mandates"] .tm-chart-empty-state {
  position: absolute;
  inset: 12px;
  display: grid;
  place-items: center;
  min-height: 120px;
  border: 1px dashed rgba(83, 103, 94, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--tm-polish-muted);
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
  padding: 18px;
}

body[data-page="topics-mandates"] #alignmentTrendAlerts:not(:empty) {
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(83, 103, 94, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--tm-polish-muted) !important;
  font-weight: 700;
}

body[data-page="topics-mandates"] .rebel-list {
  gap: 8px !important;
}

body[data-page="topics-mandates"] .rebel-row {
  grid-template-columns: 10px minmax(170px, 1fr) minmax(56px, auto) 44px minmax(88px, 12%);
  min-height: 38px;
  color: var(--tm-polish-ink) !important;
  background: rgba(255, 255, 255, 0.92) !important;
  border: 1px solid var(--tm-polish-line) !important;
  border-radius: 8px !important;
  box-shadow: 0 1px 2px rgba(21, 33, 28, 0.04) !important;
}

body[data-page="topics-mandates"] .rebel-row:hover {
  background: #ffffff !important;
  border-color: var(--tm-polish-line-strong) !important;
}

body[data-page="topics-mandates"] .rebel-name {
  color: var(--tm-polish-ink) !important;
  font-size: 13px !important;
  font-weight: 740 !important;
}

body[data-page="topics-mandates"] .rebel-group {
  color: var(--tm-polish-muted) !important;
  font-size: 10.5px !important;
  font-weight: 800 !important;
}

body[data-page="topics-mandates"] .rebel-dissent {
  color: var(--tm-polish-ink) !important;
  font-weight: 800 !important;
}

body[data-page="topics-mandates"] .rebel-bar-wrap {
  background: rgba(83, 103, 94, 0.15) !important;
  border-radius: 6px !important;
}

body[data-page="topics-mandates"] .rebel-bar {
  border-radius: 6px !important;
  min-width: 3px;
}

body[data-page="topics-mandates"] .tm-cluster-card,
body[data-page="topics-mandates"] .tm-cluster-topic {
  color: var(--tm-polish-ink) !important;
}

body[data-page="topics-mandates"] .tm-cluster-topic {
  background: rgba(255, 255, 255, 0.86) !important;
  border-color: var(--tm-polish-line) !important;
}

@media (max-width: 760px) {
  body[data-page="topics-mandates"] .rebel-row {
    grid-template-columns: 10px minmax(0, 1fr) 44px;
  }

  body[data-page="topics-mandates"] .rebel-group,
  body[data-page="topics-mandates"] .rebel-bar-wrap {
    display: none;
  }
}

/* ==========================================================================
   Soft-layered deploy pass
   Global visual layer: translucent institutional surfaces, merged containers,
   wider ambient shadows, and stronger text contrast.
   ========================================================================== */

:root {
  --ma-glass-bg: rgba(255, 255, 255, 0.66);
  --ma-glass-bg-strong: rgba(255, 255, 255, 0.78);
  --ma-glass-bg-soft: rgba(255, 255, 255, 0.46);
  --ma-glass-edge: rgba(255, 255, 255, 0.64);
  --ma-glass-line: rgba(83, 103, 94, 0.18);
  --ma-glass-line-strong: rgba(83, 103, 94, 0.28);
  --ma-glass-ink: #15211c;
  --ma-glass-muted: #52655d;
  --ma-glass-faint: #6f8179;
  --ma-glass-halo: 0 22px 70px rgba(15, 23, 42, 0.085), 0 2px 8px rgba(15, 23, 42, 0.045);
  --ma-glass-halo-soft: 0 14px 42px rgba(15, 23, 42, 0.065), 0 1px 4px rgba(15, 23, 42, 0.04);
  --ma-glass-inner: inset 0 1px 0 rgba(255, 255, 255, 0.74);
}


body[data-page] .topbar,
body[data-page] .topbar.topbar--glass {
  background: rgba(18, 28, 24, 0.88) !important;
  -webkit-backdrop-filter: blur(18px) saturate(1.12) !important;
  backdrop-filter: blur(18px) saturate(1.12) !important;
  box-shadow: 0 12px 34px rgba(15, 23, 20, 0.13) !important;
}

body[data-page] .chart-card,
body[data-page] .news-overview-card,
body[data-page] .news-story-card,
body[data-page] .article-card,
body[data-page] .np,
body[data-page] .tm-inner-card,
body[data-page] .tm-topic-card,
body[data-page] .tm-opportunity-card,
body[data-page] .pm-mcard,
body[data-page] .pm-profile-contact-card,
body[data-page] .pm-profile-votemix-card,
body[data-page] .pm-profile-overview-card,
body[data-page] .command-card {
  /* .explorer-shell removed from this selector list: its border-radius
     (8px) and backdrop-filter were the two properties from this rule that
     actually won the cascade for .explorer-shell (border/background/
     box-shadow were overridden by a later pass) — both are now folded into
     the final consolidated rule (~line 6812), so nothing here is lost.
     The rest of this shared rule is unchanged for the other selectors. */
  border-radius: 8px !important;
  border: 1px solid var(--ma-glass-edge) !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72) 0%, rgba(255, 255, 255, 0.54) 100%) !important;
  box-shadow: var(--ma-glass-halo-soft), var(--ma-glass-inner) !important;
  -webkit-backdrop-filter: blur(16px) saturate(1.08) !important;
  backdrop-filter: blur(16px) saturate(1.08) !important;
}

body[data-page] .dashboard-content,
body[data-page] .app-content,
body[data-page] .news-workspace,
body[data-page] .tm-section-card-body,
body[data-page] .pm-profile-body {
  color: var(--ma-glass-ink) !important;
}

body[data-page] .panel h2,
body[data-page] .panel h3,
body[data-page] .chart-card h3,
body[data-page] .chart-card h4,
body[data-page] .np-title,
body[data-page] .tm-section-card-title,
body[data-page] .pm-profile-name,
body[data-page] .hero-panel__title,
body[data-page] .dashboard-title {
  color: var(--ma-glass-ink) !important;
  font-weight: 760 !important;
  letter-spacing: 0 !important;
}

body[data-page] .np-subheader,
body[data-page] .pm-profile-subtitle {
  color: var(--ma-glass-muted) !important;
  opacity: 1 !important;
}

body[data-page] .news-reader-modal {
  border-radius: 8px !important;
  border: 1px solid var(--ma-glass-line) !important;
  background:
    linear-gradient(rgba(83, 103, 94, 0.026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(83, 103, 94, 0.026) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.54) 0%, rgba(248, 251, 249, 0.42) 100%) !important;
  background-size: 30px 30px, 30px 30px, auto !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.56) !important;
}


body[data-page] .news-overview-card,
body[data-page] .hero-stat-card,
body[data-page] .tm-kpi-cell,
body[data-page] .pm-profile-kpi,
body[data-page] .stat-item {
  background: rgba(255, 255, 255, 0.40) !important;
  border-color: rgba(255, 255, 255, 0.54) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.58), 0 10px 30px rgba(15, 23, 42, 0.055) !important;
}

body[data-page] .news-story-card,
body[data-page] .article-card,
body[data-page] .command-feed-item,
body[data-page] .tm-cluster-card,
body[data-page] .pm-profile-ally-row {
  background: rgba(255, 255, 255, 0.50) !important;
  border-color: rgba(255, 255, 255, 0.58) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.52), 0 8px 24px rgba(15, 23, 42, 0.048) !important;
}

body[data-page] .news-story-card:hover,
body[data-page] .article-card:hover,
body[data-page] .command-feed-item:hover,
body[data-page] .pm-profile-ally-row:hover {
  background: rgba(255, 255, 255, 0.68) !important;
  border-color: rgba(255, 255, 255, 0.78) !important;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.085), inset 0 1px 0 rgba(255, 255, 255, 0.72) !important;
  transform: translateY(-1px) !important;
}

body[data-page] .control-btn,
body[data-page] .upload-btn,
body[data-page] .np-btn,
body[data-page] .news-top-action,
body[data-page] .panel-collapse-btn,
body[data-page] .tm-lens-chip,
body[data-page] .explorer-tab,
body[data-page] .sidebar-reset-btn,
body[data-page] .pm-profile-influence-preset,
body[data-page] .ma-fs-btn,
body[data-page] .ma-fs-close,
body[data-page] .chip,
body[data-page] .toggle-btn {
  border-radius: 8px !important;
  border-color: rgba(83, 103, 94, 0.24) !important;
  background: rgba(255, 255, 255, 0.52) !important;
  color: var(--ma-glass-ink) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.54) !important;
}

/* .news-top-action.is-primary added below (bug fix): every earlier pass in
   this pileup (~line 20910 note, ~line 24350) included it alongside
   .control-btn.primary/.control-btn.is-primary/.upload-btn.primary/
   .np-btn.primary, but this rule — the last one in the file, and therefore
   the one that wins for every selector it lists — dropped it, silently
   leaving .news-top-action.is-primary on the earlier (0.78-alpha)
   border-color instead of the 0.58-alpha one every other primary button
   gets. There is no comment anywhere in the file suggesting the news page's
   primary action button was meant to look different, and the class is not
   currently used by any element in the app (grep of *.html/*.js finds no
   "is-primary" usage today), so re-adding it here is a zero-risk fix that
   also makes the selector consistent for whenever it is used. */
body[data-page] .control-btn.primary,
body[data-page] .control-btn.is-primary,
body[data-page] .upload-btn.primary,
body[data-page] .np-btn.primary,
body[data-page] .news-top-action.is-primary,
body[data-page] .sidebar-reset-btn,
body[data-page] .tm-lens-chip.active,
body[data-page] .explorer-tab.active,
body[data-page] .toggle-btn.active {
  /* var() fallbacks match the literal values this replaced exactly (--ma-action/-action-strong
     already resolve to these same hexes) — zero visual change, just named instead of hardcoded,
     so .lo-btn.primary/.login-btn (styles.css, legislation-observatory.html) can reference the
     same "primary action" gradient instead of each carrying their own divergent blue. */
  background: linear-gradient(180deg, var(--ma-action, #276ef1) 0%, var(--ma-action-strong, #1859cc) 100%) !important;
  color: #ffffff !important;
  border-color: rgba(39, 110, 241, 0.58) !important;
}

/* News: corpus search and feed filters need dense but calm surfaces. */
body[data-page="news"] .dashboard-content {
  background:
    radial-gradient(720px 360px at 14% -8%, rgba(39, 110, 241, 0.11), transparent 68%),
    linear-gradient(180deg, rgba(245, 248, 247, 0.54) 0%, rgba(237, 244, 241, 0.44) 100%) !important;
}

body[data-page="news"] .news-card-grid {
  gap: 14px !important;
}

body[data-page="news"] .np-header {
  background: rgba(255, 255, 255, 0.34) !important;
  border-bottom: 1px solid rgba(83, 103, 94, 0.14) !important;
}

body[data-page="news"] .np-toolbar,
body[data-page="news"] .stat-bar,
body[data-page="news"] .feed-category-filter,
body[data-page="news"] .feed-group-filter {
  background: rgba(255, 255, 255, 0.30) !important;
  border-color: rgba(83, 103, 94, 0.14) !important;
}

body[data-page="news"] .search-result-head,
body[data-page="news"] .search-preview-header,
body[data-page="news"] .news-browser-meta {
  color: var(--ma-glass-ink) !important;
  background: rgba(255, 255, 255, 0.34) !important;
  border-color: rgba(83, 103, 94, 0.14) !important;
}

body[data-page="news"] .news-story-title,
body[data-page="news"] .news-browser-title,
body[data-page="news"] .src-card-name {
  color: var(--ma-glass-ink) !important;
}

body[data-page="news"] .news-story-meta,
body[data-page="news"] .news-browser-submeta,
body[data-page="news"] .src-card-meta,
body[data-page="news"] .src-runtime-note {
  color: var(--ma-glass-muted) !important;
}

body[data-page="news"] .src-card,
body[data-page="news"] .feed-editorial-card,
body[data-page="news"] .news-highlight-card {
  border-radius: 8px !important;
  border-color: rgba(255, 255, 255, 0.58) !important;
  background: rgba(255, 255, 255, 0.48) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.54), 0 8px 24px rgba(15, 23, 42, 0.048) !important;
}

/* Graph: remove redundant inner bar and restore contrast in the workspace. */
body[data-page="graph"] .explorer-tabbar {
  display: none !important;
}

body[data-page="graph"] .sigma-page-content {
  height: calc(100dvh - var(--ma-topbar-h)) !important;
  padding: 0 !important;
}

/* .explorer-shell removed from this selector list, and its dedicated
   border/background/box-shadow rule removed entirely: this was the LAST
   (and therefore, at equal specificity, winning) declaration in the file
   for those three properties — border:0, background:transparent,
   box-shadow:none — now folded into the final consolidated rule
   (~line 6812) which reproduces the exact same computed values. */
body[data-page="graph"] #explorerPanelSigma,
body[data-page="graph"] .sigma-stage-frame,
body[data-page="graph"] .sigma-stage-frame .sigma-shell {
  height: 100% !important;
  min-height: 0 !important;
}

body[data-page="graph"] .sigma-stage-frame {
  padding: 0 !important;
}

body[data-page="graph"] .sigma-stage-frame .sigma-shell {
  border: 0 !important;
  border-radius: 0 !important;
}

body[data-page="graph"] .sigma-sidebar {
  background:
    linear-gradient(180deg, rgba(18, 28, 24, 0.96) 0%, rgba(13, 22, 19, 0.96) 100%) !important;
  color: rgba(240, 247, 243, 0.92) !important;
  border-right-color: rgba(231, 242, 236, 0.14) !important;
}

body[data-page="graph"] .sigma-sidebar .sg-section-title {
  color: rgba(231, 242, 236, 0.70) !important;
}

body[data-page="graph"] .sigma-sidebar .sg-toggle-row,
body[data-page="graph"] .sigma-sidebar .sg-range-row,
body[data-page="graph"] .sigma-sidebar .sg-subtle-note,
body[data-page="graph"] .sigma-sidebar .sg-sel-empty,
body[data-page="graph"] .sigma-sidebar .sg-sel-empty-hint,
body[data-page="graph"] .sigma-sidebar .sg-mini-row,
body[data-page="graph"] .sigma-sidebar .sg-sel-meta {
  color: rgba(231, 242, 236, 0.78) !important;
}

body[data-page="graph"] .sigma-sidebar .sg-select,
body[data-page="graph"] .sigma-sidebar .sg-search-input {
  color: #f5fbf8 !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(231, 242, 236, 0.18) !important;
}

body[data-page="graph"] .sigma-sidebar .sg-select option {
  background: #121c18 !important;
  color: #f5fbf8 !important;
}

body[data-page="graph"] .sg-sel-card,
body[data-page="graph"] .sg-sel-wrap,
body[data-page="graph"] .sg-subtle-note {
  background: rgba(255, 255, 255, 0.07) !important;
  border-color: rgba(231, 242, 236, 0.14) !important;
}

body[data-page="graph"] .sg-sel-name,
body[data-page="graph"] .sg-kpi-val,
body[data-page="graph"] .sg-sel-section-ttl,
body[data-page="graph"] .sg-mini-name,
body[data-page="graph"] .sg-mini-grp {
  color: #f5fbf8 !important;
}

body[data-page="graph"] .sg-kpi,
body[data-page="graph"] .sg-sel-btn {
  color: rgba(231, 242, 236, 0.86) !important;
  background: rgba(255, 255, 255, 0.07) !important;
  border-color: rgba(231, 242, 236, 0.14) !important;
}

body[data-page="graph"] .sigma-canvas-wrap {
  background:
    linear-gradient(rgba(21, 33, 28, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21, 33, 28, 0.045) 1px, transparent 1px),
    radial-gradient(780px 360px at 48% -4%, rgba(39, 110, 241, 0.13), transparent 68%),
    linear-gradient(180deg, #f8fbf9 0%, #eef5f2 100%) !important;
  background-size: 34px 34px, 34px 34px, auto, auto !important;
}

body[data-page="graph"] .sg-axis-label {
  color: rgba(82, 101, 93, 0.92) !important;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.74) !important;
}

body[data-page="graph"] .sg-legend,
body[data-page="graph"] .sg-fa2-badge,
body[data-page="graph"] .sg-sampling-notice,
body[data-page="graph"] .sg-zoom-btn,
body[data-page="graph"] .sigma-sidebar-drawer-toggle {
  color: var(--ma-glass-ink) !important;
  background: rgba(255, 255, 255, 0.78) !important;
  border-color: rgba(255, 255, 255, 0.70) !important;
  box-shadow: var(--ma-glass-halo-soft), inset 0 1px 0 rgba(255, 255, 255, 0.70) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  backdrop-filter: blur(14px) !important;
}

body[data-page="graph"] .sg-legend-lbl,
body[data-page="graph"] .sg-sampling-notice {
  color: var(--ma-glass-muted) !important;
}

/* ==========================================================================
   Blended Deploy Layer
   Removes the visible "stack of cards" effect by making outer workspaces carry
   the atmospheric shadow while inner panels read as translucent insets.
   ========================================================================== */


body[data-page] .panel,
body[data-page] .policy-shell,
body[data-page] .news-panel-section,
body[data-page] .news-hero-panel,
body[data-page] .tm-section-card,
body[data-page] .pm-profile-workspace,
body[data-page] .command-center {
  border-color: rgba(255, 255, 255, 0.62) !important;
  background:
    radial-gradient(720px 320px at 74% -8%, rgba(39, 110, 241, 0.075), transparent 68%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.40)) !important;
  box-shadow: 0 24px 72px rgba(15, 23, 42, 0.078), inset 0 1px 0 rgba(255,255,255,0.74) !important;
  -webkit-backdrop-filter: blur(20px) saturate(1.10) !important;
  backdrop-filter: blur(20px) saturate(1.10) !important;
}

body[data-page] .panel .chart-card,
body[data-page] .panel .cp-context-card,
body[data-page] .panel .cp-personal-card,
body[data-page] .panel .cp-drilldown-card,
body[data-page] .panel .pm-profile-contact-card,
body[data-page] .panel .pm-profile-votemix-card,
body[data-page] .panel .pm-profile-overview-card,
body[data-page] .panel .pm-profile-kpi,
body[data-page] .panel .pm-debates-card,
body[data-page] .panel .pm-amendments-card,
body[data-page] .panel .tm-inner-card,
body[data-page] .panel .tm-topic-card,
body[data-page] .panel .tm-opportunity-card,
body[data-page] .news-panel-section .article-card,
body[data-page] .news-panel-section .news-story-card,
body[data-page] .news-panel-section .src-card {
  border-color: rgba(83, 103, 94, 0.105) !important;
  background: rgba(255, 255, 255, 0.30) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.48) !important;
  -webkit-backdrop-filter: blur(12px) saturate(1.06) !important;
  backdrop-filter: blur(12px) saturate(1.06) !important;
}

body[data-page] .panel .cp-context-card:hover {
  background: rgba(255, 255, 255, 0.43) !important;
  border-color: rgba(83, 103, 94, 0.18) !important;
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.055), inset 0 1px 0 rgba(255, 255, 255, 0.62) !important;
  transform: translateY(-1px) !important;
}

body[data-page] .chart-container,
body[data-page] .pm-profile-votemix-canvas-wrap,
body[data-page] .pm-profile-mini-chart,
body[data-page] .tm-matrix-wrap,
body[data-page] .tm-topic-alliance-wrap,
body[data-page] .tm-power-canvas-wrap,
body[data-page] .news-browser-reader,
body[data-page] .search-preview-shell {
  border-color: rgba(83, 103, 94, 0.095) !important;
  background:
    linear-gradient(rgba(83, 103, 94, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(83, 103, 94, 0.018) 1px, transparent 1px),
    rgba(255, 255, 255, 0.20) !important;
  background-size: 32px 32px, 32px 32px, auto !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42) !important;
}

body[data-page="parliament-members"] .pm-profile-section-label {
  color: rgba(82, 101, 93, 0.76) !important;
  border-top: 1px solid rgba(83, 103, 94, 0.12) !important;
  padding-top: 14px !important;
}

body[data-page="parliament-members"] .pm-kiviat-card:not(.pm-profile-pane-hidden) {
  display: grid !important;
  grid-template-columns: minmax(260px, 0.36fr) minmax(420px, 0.64fr) !important;
  align-items: stretch !important;
  border-color: rgba(255, 255, 255, 0.66) !important;
  background:
    radial-gradient(560px 280px at 78% 16%, rgba(39, 110, 241, 0.115), transparent 66%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.34)) !important;
  box-shadow: 0 24px 72px rgba(15, 23, 42, 0.078), inset 0 1px 0 rgba(255,255,255,0.74) !important;
}

body[data-page="parliament-members"] .pm-kiviat-info {
  justify-content: center !important;
}

body[data-page="parliament-members"] .pm-kiviat-stage {
  min-width: 0 !important;
  justify-content: center !important;
}

body[data-page="parliament-members"] .pm-kiviat-legend,
body[data-page="parliament-members"] .pm-kiviat-bench-ctrl {
  align-self: flex-start !important;
}

body[data-page="parliament-members"] .pm-kiviat-axis-row {
  grid-template-columns: 76px minmax(82px, 1fr) 34px !important;
}

@media (max-width: 900px) {
  body[data-page="parliament-members"] .pm-kiviat-card {
    grid-template-columns: 1fr !important;
  }

}

/* ==========================================================================
   Permanent Glass System
   Final source-of-truth visual layer. This deliberately wins over earlier
   page-specific card styles so nested containers merge into one soft surface.
   ========================================================================== */

:root {
  --font-ui: "Inter", "IBM Plex Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "IBM Plex Sans", "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;

  --ma-topbar-h: 55px;
  --ma-page-ink: #16211d;
  --ma-page-muted: #566861;
  --ma-page-faint: #71817b;
  --ma-page-line: rgba(81, 101, 93, 0.13);
  --ma-page-line-strong: rgba(81, 101, 93, 0.22);
  --ma-glass-page:
    radial-gradient(980px 420px at 8% -12%, rgba(55, 136, 225, 0.12), transparent 70%),
    radial-gradient(780px 380px at 92% 0%, rgba(20, 156, 130, 0.08), transparent 66%),
    linear-gradient(180deg, #f1f6f4 0%, #e7efec 100%);
  --ma-glass-outer: linear-gradient(180deg, rgba(255, 255, 255, 0.52), rgba(255, 255, 255, 0.30));
  --ma-glass-inner: linear-gradient(180deg, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0.14));
  --ma-shadow-outer: 0 24px 68px rgba(15, 23, 42, 0.09), 0 4px 16px rgba(15, 23, 42, 0.035), inset 0 1px 0 rgba(255, 255, 255, 0.72);
  --ma-shadow-inner: inset 0 1px 0 rgba(255, 255, 255, 0.48);
  --ma-blur-outer: blur(22px) saturate(1.12);
  --ma-blur-inner: blur(14px) saturate(1.08);
}

html,
body,
button,
input,
select,
textarea {
  font-family: var(--font-ui) !important;
}

body[data-page] {
  background: var(--ma-glass-page) !important;
  color: var(--ma-page-ink) !important;
}

body[data-page] h1,
body[data-page] h2,
body[data-page] h3,
body[data-page] h4,
body[data-page] h5,
body[data-page] h6,
body[data-page] .topbar-title,
body[data-page] .panel-title,
body[data-page] .section-title,
body[data-page] .card-title,
body[data-page] .dashboard-title,
body[data-page] .tm-section-card-title,
body[data-page] .pm-profile-name,
body[data-page] .kpi-value,
body[data-page] .stat-value,
body[data-page] .score-value,
body[data-page] .match-score,
body[data-page] .tm-kpi-value,
body[data-page] .pm-kpi-val,
body[data-page] .pm-profile-kpi-val {
  font-family: var(--font-display) !important;
  color: var(--ma-page-ink) !important;
  letter-spacing: 0 !important;
}

body[data-page] code,
body[data-page] pre,
body[data-page] .feed-code,
body[data-page] .pm-vb-num,
body[data-page] .intel-kpi-value,
body[data-page] .tm-kpi-value,
body[data-page] .dashboard-metric-value {
  font-family: var(--font-mono) !important;
}

body[data-page] .app-content,
body[data-page] .dashboard-content,
body[data-page] .sigma-page-content,
body[data-page] .landing-page,
body[data-page] .policy-page {
  background: transparent !important;
}

body[data-page] .dashboard-shell,
body[data-page] .container,
body[data-page] .container--wide {
  background: transparent !important;
}

body[data-page] .panel,
body[data-page] .policy-hero,
body[data-page] .policy-toc,
body[data-page] .policy-shell,
body[data-page] .news-panel-section,
body[data-page] .news-hero-panel,
body[data-page] .tm-section-card,
body[data-page] .pm-profile-workspace,
body[data-page] .command-center,
body[data-page] .mep-card-panel {
  border: 1px solid rgba(255, 255, 255, 0.62) !important;
  border-radius: 8px !important;
  background: var(--ma-glass-outer) !important;
  box-shadow: var(--ma-shadow-outer) !important;
  -webkit-backdrop-filter: var(--ma-blur-outer) !important;
  backdrop-filter: var(--ma-blur-outer) !important;
}

body[data-page] .panel .chart-card,
body[data-page] .panel .command-card,
body[data-page] .panel .cp-context-card,
body[data-page] .panel .cp-personal-card,
body[data-page] .panel .cp-drilldown-card,
body[data-page] .panel .pm-profile-contact-card,
body[data-page] .panel .pm-profile-votemix-card,
body[data-page] .panel .pm-profile-overview-card,
body[data-page] .panel .pm-profile-kpi,
body[data-page] .panel .pm-debates-card,
body[data-page] .panel .pm-amendments-card,
body[data-page] .panel .tm-inner-card,
body[data-page] .panel .tm-topic-card,
body[data-page] .panel .tm-opportunity-card,
body[data-page] .panel .tm-cluster-card,
body[data-page] .panel .tm-context-card,
body[data-page] .panel .tm-drill-detail,
body[data-page] .news-panel-section .article-card,
body[data-page] .news-panel-section .news-story-card,
body[data-page] .news-panel-section .src-card,
body[data-page] .news-panel-section .feed-editorial-card,
body[data-page] .news-panel-section .news-highlight-card,
body[data-page] .dashboard-brand-card,
body[data-page] .dashboard-dataset-snapshot,
body[data-page] .snapshot-stat {
  border: 1px solid var(--ma-page-line) !important;
  border-radius: 8px !important;
  background: var(--ma-glass-inner) !important;
  box-shadow: var(--ma-shadow-inner) !important;
  -webkit-backdrop-filter: var(--ma-blur-inner) !important;
  backdrop-filter: var(--ma-blur-inner) !important;
}

body[data-page] .chart-container,
body[data-page] .pm-profile-votemix-canvas-wrap,
body[data-page] .pm-profile-mini-chart,
body[data-page] .pm-profile-influence-canvas,
body[data-page] .tm-matrix-wrap,
body[data-page] .tm-topic-alliance-wrap,
body[data-page] .tm-power-canvas-wrap,
body[data-page] .tm-drill-table-wrap,
body[data-page] .search-preview-shell,
body[data-page] .news-browser-reader,
body[data-page] .sigma-canvas-wrap {
  border: 1px solid rgba(81, 101, 93, 0.10) !important;
  border-radius: 8px !important;
  background:
    linear-gradient(rgba(81, 101, 93, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(81, 101, 93, 0.018) 1px, transparent 1px),
    rgba(255, 255, 255, 0.12) !important;
  background-size: 32px 32px, 32px 32px, auto !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.38) !important;
}

body[data-page] .panel .chart-card:hover,
body[data-page] .panel .command-card:hover,
body[data-page] .panel .pm-profile-votemix-card:hover,
body[data-page] .panel .pm-profile-kpi:hover,
body[data-page] .news-panel-section .article-card:hover,
body[data-page] .news-panel-section .news-story-card:hover {
  border-color: var(--ma-page-line-strong) !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.20)) !important;
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.055), inset 0 1px 0 rgba(255, 255, 255, 0.58) !important;
  transform: translateY(-1px) !important;
}

body[data-page] .list-meta,
body[data-page] .panel-subtitle,
body[data-page] .panel-kicker,
body[data-page] .section-meta,
body[data-page] .card-meta,
body[data-page] .chart-card__subtitle,
body[data-page] .tm-section-card-sub,
body[data-page] .news-story-summary,
body[data-page] .art-summary,
body[data-page] p {
  color: var(--ma-page-muted) !important;
  opacity: 1 !important;
}

/* Topics & Mandate: permanent zero-gap shell fix. */
body[data-page="topics-mandates"] {
  --tm-topbar-h: var(--ma-topbar-h) !important;
}

body[data-page="topics-mandates"] .topbar,
body[data-page="topics-mandates"] .topbar.topbar--glass {
  height: var(--ma-topbar-h) !important;
  min-height: var(--ma-topbar-h) !important;
  flex-basis: var(--ma-topbar-h) !important;
}

body[data-page="topics-mandates"] .app-shell,
body[data-page="topics-mandates"] .app-shell > .app-main,
body[data-page="topics-mandates"] .dashboard-shell,
body[data-page="topics-mandates"] .dashboard-main,
body[data-page="topics-mandates"] .dashboard-content {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

body[data-page="topics-mandates"] .dashboard-shell {
  min-height: calc(100dvh - var(--ma-topbar-h)) !important;
  height: auto !important;
  align-items: stretch !important;
}

body[data-page="topics-mandates"] .dashboard-sidebar {
  top: var(--ma-topbar-h) !important;
  max-height: calc(100dvh - var(--ma-topbar-h)) !important;
}

body[data-page="topics-mandates"] .dashboard-content {
  padding-right: clamp(10px, 1.1vw, 16px) !important;
  padding-bottom: clamp(18px, 2vw, 28px) !important;
  padding-left: clamp(10px, 1.1vw, 16px) !important;
  max-width: none !important;
}

body[data-page="topics-mandates"] .container--wide {
  width: 100% !important;
  margin: 0 !important;
}

body[data-page="topics-mandates"] .tm-content-wrap {
  gap: 10px !important;
}

body[data-page="topics-mandates"] .tm-workspace-nav {
  top: var(--ma-topbar-h) !important;
  margin: 0 !important;
  border-color: rgba(255, 255, 255, 0.58) !important;
  background: rgba(255, 255, 255, 0.34) !important;
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.055), inset 0 1px 0 rgba(255, 255, 255, 0.60) !important;
  -webkit-backdrop-filter: blur(18px) saturate(1.08) !important;
  backdrop-filter: blur(18px) saturate(1.08) !important;
}

body[data-page="topics-mandates"] .tm-kpi-strip {
  gap: 8px !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body[data-page="topics-mandates"] .tm-kpi-cell {
  border: 1px solid rgba(255, 255, 255, 0.56) !important;
  border-radius: 8px !important;
  background: rgba(255, 255, 255, 0.38) !important;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.055), inset 0 1px 0 rgba(255, 255, 255, 0.58) !important;
  -webkit-backdrop-filter: blur(16px) saturate(1.08) !important;
  backdrop-filter: blur(16px) saturate(1.08) !important;
}

body[data-page="topics-mandates"] .tm-section-card .chart-card,
body[data-page="topics-mandates"] .tm-section-card .command-card,
body[data-page="topics-mandates"] .tm-section-card .tm-cluster-card,
body[data-page="topics-mandates"] .tm-section-card .tm-context-card,
body[data-page="topics-mandates"] .tm-section-card .tm-drill-detail,
body[data-page="topics-mandates"] #topicOpportunityInsights,
body[data-page="topics-mandates"] #analysisTopicMatrixContainer .topic-matrix-wrap,
body[data-page="topics-mandates"] article.tm-topic-interest-panel {
  border-color: rgba(81, 101, 93, 0.10) !important;
  background: rgba(255, 255, 255, 0.18) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42) !important;
}

body[data-page="topics-mandates"] .tm-section-card-head,
body[data-page="topics-mandates"] .tm-section-card-body,
body[data-page="topics-mandates"] .tm-inner-card-head,
body[data-page="topics-mandates"] .chart-card__header,
body[data-page="topics-mandates"] .np-header,
body[data-page="news"] .np-header {
  background: transparent !important;
}

body[data-page="topics-mandates"] .tm-section-card-head,
body[data-page="topics-mandates"] .chart-card__header {
  border-bottom-color: rgba(81, 101, 93, 0.10) !important;
}

body[data-page="topics-mandates"] .tm-topic-alliance-wrap,
body[data-page="topics-mandates"] .tm-power-canvas-wrap {
  min-height: 520px !important;
}

/* MEP contact directory and drawer: force light, readable surfaces. */
body[data-page] .mep-list,
body[data-page] .mep-list li,
body[data-page] .mep-item,
body[data-page] .mep-dir-group,
body[data-page] .mep-dir-group summary,
body[data-page] .mep-dir-list,
body[data-page] .mep-dir-row,
body[data-page] .mep-profile-card,
body[data-page] .mep-profile-modal,
body[data-page] .mep-profile-sheet,
body[data-page] .mep-profile,
body[data-page] .mep-profile-content,
body[data-page] .mep-profile-header,
body[data-page] .mep-profile-section,
body[data-page] .mep-card-panel,
body[data-page] #mepCardContent,
body[data-page] .mep-card-topbar,
body[data-page] .mep-card-header,
body[data-page] .mep-card-section {
  background: #fff !important;
  background-color: #fff !important;
  background-image: none !important;
  color: #1e293b !important;
}

body[data-page] .mep-card-panel,
body[data-page] .mep-profile-card,
body[data-page] .mep-profile-modal,
body[data-page] .mep-profile-sheet,
body[data-page] .mep-dir-group,
body[data-page] .mep-list,
body[data-page] .mep-item {
  --fg: #1e293b;
  --text: #111827;
  --text-1: #1e293b;
  --muted: #64748b;
  --card-bg: #fff;
  --bg-2: #f8fafc;
  --hover-bg: #f8fafc;
  --border: #e2e8f0;
  --border-subtle: #e2e8f0;
  --ma-glass-ink: #1e293b;
  border-color: #e2e8f0 !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

body[data-page] .mep-dir-group summary {
  border-bottom: 1px solid #e2e8f0 !important;
}

body[data-page] .mep-dir-row,
body[data-page] .mep-list li,
body[data-page] .mep-item {
  border-color: #e2e8f0 !important;
}

body[data-page] .mep-dir-row:hover,
body[data-page] .mep-dir-group summary:hover,
body[data-page] .mep-item:hover {
  background: #f8fafc !important;
  color: #1e293b !important;
}

body[data-page] .mep-dir-name,
body[data-page] .mep-dir-group summary,
body[data-page] .mep-name,
body[data-page] .mep-card-name,
body[data-page] .mep-card-section-title,
body[data-page] .mep-profile-card .section-title,
body[data-page] .mep-profile-modal .section-title,
body[data-page] .mep-profile-header h2,
body[data-page] .mep-profile-header h3,
body[data-page] .mep-profile-card .panel-title,
body[data-page] .mep-profile-modal .panel-title,
body[data-page] .mep-metric-value,
body[data-page] .mep-email-text,
body[data-page] .meeting-list-date,
body[data-page] .meeting-list-subject,
body[data-page] .mep-chart-legend-label {
  color: #1e293b !important;
}

body[data-page] .mep-dir-group-count,
body[data-page] .mep-dir-avg,
body[data-page] .mep-dir-group-chevron,
body[data-page] .mep-meta,
body[data-page] .mep-card-sub,
body[data-page] .mep-address-block,
body[data-page] .mep-phone-label,
body[data-page] .mep-office-city,
body[data-page] .mep-metric-label,
body[data-page] .mep-metric-sub,
body[data-page] .meeting-list-place,
body[data-page] .meeting-list-org,
body[data-page] .mep-chart-legend-count {
  color: #64748b !important;
}

body[data-page] .mep-dir-align,
body[data-page] .match-score,
body[data-page] .mep-profile-card .mep-score,
body[data-page] .mep-profile-modal .mep-score {
  color: #2563eb !important;
}

body[data-page] .mep-profile-card .panel,
body[data-page] .mep-profile-modal .panel,
body[data-page] .mep-email-hero,
body[data-page] .mep-assistants-placeholder,
body[data-page] .mep-metric-cell,
body[data-page] .mep-social-link,
body[data-page] .mep-copy-email,
body[data-page] .meeting-list-item {
  background: #fff !important;
  background-color: #fff !important;
  background-image: none !important;
  border-color: #e2e8f0 !important;
  color: #1e293b !important;
}

body[data-page] .mep-card-close,
body[data-page] .mep-card-compare-link,
body[data-page] .mep-card-ep-link,
body[data-page] .mep-copy-email {
  background: #fff !important;
  border-color: #cbd5e1 !important;
  color: #2563eb !important;
}

body[data-page] .topbar-logo,
body[data-page] .mandate-hero-icon,
body[data-page] .tm-loading-logo,
body[data-page] .landing-hero-mark,
body[data-page="login"] .login-brand img {
  object-fit: contain;
  object-position: center;
}

/* Parliament Members deploy pass: keep dense profile UI contained under zoom. */
body[data-page="parliament-members"] .pm-profile-workspace,
body[data-page="parliament-members"] .pm-profile-workspace *,
body[data-page="parliament-members"] .pm-profile-workspace *::before,
body[data-page="parliament-members"] .pm-profile-workspace *::after {
  box-sizing: border-box;
}

body[data-page="parliament-members"] .pm-profile-workspace,
body[data-page="parliament-members"] .pm-profile-head,
body[data-page="parliament-members"] .pm-profile-identity,
body[data-page="parliament-members"] .pm-profile-actions,
body[data-page="parliament-members"] .pm-profile-tabs,
body[data-page="parliament-members"] .pm-profile-top-grid,
body[data-page="parliament-members"] .pm-profile-side-stack,
body[data-page="parliament-members"] .pm-profile-votemix-card,
body[data-page="parliament-members"] .pm-profile-votemix-body,
body[data-page="parliament-members"] .pm-profile-votemix-legend,
body[data-page="parliament-members"] .pm-profile-overview-card,
body[data-page="parliament-members"] .pm-profile-charts-grid,
body[data-page="parliament-members"] .pm-profile-context-grid,
body[data-page="parliament-members"] .pm-profile-drill-card,
body[data-page="parliament-members"] .chart-card,
body[data-page="parliament-members"] .chart-container,
body[data-page="parliament-members"] .cp-context-card,
body[data-page="parliament-members"] .cp-drilldown-card,
body[data-page="parliament-members"] .cp-drill-table-wrap,
body[data-page="parliament-members"] .pm-kiviat-card {
  min-width: 0 !important;
  max-width: 100% !important;
}

body[data-page="parliament-members"] .pm-profile-head {
  flex-wrap: wrap !important;
  row-gap: 12px !important;
}

body[data-page="parliament-members"] .pm-profile-identity {
  flex: 1 1 260px !important;
}

body[data-page="parliament-members"] .pm-profile-actions {
  flex: 1 1 360px !important;
  justify-content: flex-end !important;
}

body[data-page="parliament-members"] .pm-profile-actions .control-btn {
  min-width: 0 !important;
  max-width: 100% !important;
}

body[data-page="parliament-members"] .pm-profile-tabs {
  scrollbar-gutter: stable !important;
  overscroll-behavior-x: contain !important;
}

body[data-page="parliament-members"] .pm-profile-tab {
  flex: 0 0 auto !important;
}

body[data-page="parliament-members"] .pm-profile-votemix-card {
  overflow: hidden !important;
}

body[data-page="parliament-members"] .pm-profile-votemix-body {
  grid-template-columns: minmax(112px, clamp(118px, 28%, 150px)) minmax(0, 1fr) !important;
  align-items: center !important;
  overflow: hidden !important;
}
/* NOT adding an @media(max-width:860px) override here: re-checking the FULL cascade (not just
   the first later match) shows later rules already provide a real, deliberate 3-tier breakpoint
   sequence for this selector's grid-template-columns (2-col here -> 2-col narrower at
   max-width:1180px -> 1-col at max-width:720px) -- an 860px override would have been silently
   defeated by the 1180px one anyway in the 721-860px range, and was fully redundant below 720px.
*/

body[data-page="parliament-members"] .pm-profile-votemix-canvas-wrap {
  width: 100% !important;
  max-width: 156px !important;
  min-height: 112px !important;
  height: auto !important;
  aspect-ratio: 1 / 1 !important;
  justify-self: center !important;
  overflow: hidden !important;
}

body[data-page="parliament-members"] .pm-profile-votemix-canvas-wrap canvas,
body[data-page="parliament-members"] .chart-container canvas,
body[data-page="parliament-members"] .pm-profile-mini-chart canvas {
  display: block !important;
  max-width: 100% !important;
  max-height: 100% !important;
}

body[data-page="parliament-members"] .pm-profile-votemix-item {
  grid-template-columns: auto minmax(0, 1fr) auto !important;
  min-width: 0 !important;
}

body[data-page="parliament-members"] .pm-profile-votemix-label {
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body[data-page="parliament-members"] .pm-profile-votemix-value {
  white-space: nowrap !important;
}

body[data-page="parliament-members"] .chart-card {
  overflow: hidden !important;
}

body[data-page="parliament-members"] .chart-container,
body[data-page="parliament-members"] .pm-profile-mini-chart {
  overflow: hidden !important;
}

body[data-page="parliament-members"] .cp-drill-table-wrap {
  /* overflow-y was "hidden" here — this rule wins over the base .cp-drill-table-wrap's
     max-height:360px/overflow-y:auto (line ~10147) since it's more specific and !important,
     which silently capped Session Drilldown at 360px with no way to scroll to the rest of the
     rows. This block's own intent (min-width:760px + table-layout:fixed just below) is a
     horizontal-scroll fix for narrow viewports; vertical scroll needs to stay enabled too. */
  overflow-x: auto !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
}

body[data-page="parliament-members"] .cp-drill-table {
  min-width: 760px !important;
  table-layout: fixed !important;
}

body[data-page="parliament-members"] .cp-drill-table th,
body[data-page="parliament-members"] .cp-drill-table td {
  overflow-wrap: anywhere !important;
  word-break: normal !important;
}

body[data-page="parliament-members"] .cp-drill-table th:first-child,
body[data-page="parliament-members"] .cp-drill-table td:first-child {
  width: 34% !important;
}

body[data-page="parliament-members"] .cp-session-link {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
}

body[data-page="parliament-members"] .cp-relation-pill {
  max-width: 100% !important;
  white-space: normal !important;
}

body[data-page="parliament-members"] .cp-session-detail,
body[data-page="parliament-members"] .cp-session-card,
body[data-page="parliament-members"] .cp-session-card *,
body[data-page="parliament-members"] .cp-session-head,
body[data-page="parliament-members"] .cp-session-votes,
body[data-page="parliament-members"] .cp-session-meta-block {
  min-width: 0 !important;
  max-width: 100% !important;
}

body[data-page="parliament-members"] .cp-session-head,
body[data-page="parliament-members"] .cp-session-votes > div {
  overflow-wrap: anywhere !important;
}

body[data-page="parliament-members"] .cp-session-head > div,
body[data-page="parliament-members"] .cp-session-actions {
  min-width: 0 !important;
  max-width: 100% !important;
}

body[data-page="parliament-members"] .pm-mcard,
body[data-page="parliament-members"] .pm-mcard *,
body[data-page="parliament-members"] .mep-list,
body[data-page="parliament-members"] .mep-list * {
  min-width: 0;
}

body[data-page="parliament-members"] .pm-mcard-name,
body[data-page="parliament-members"] .pm-mcard-sub,
body[data-page="parliament-members"] .mep-name,
body[data-page="parliament-members"] .mep-meta {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

@media (max-width: 1180px) {
  body[data-page="parliament-members"] .pm-profile-actions {
    justify-content: flex-start !important;
  }

  body[data-page="parliament-members"] .pm-profile-votemix-body {
    grid-template-columns: minmax(108px, 132px) minmax(0, 1fr) !important;
  }
}

@media (max-width: 720px) {
  body[data-page="parliament-members"] .pm-profile-workspace {
    padding: 12px !important;
    border-radius: 14px !important;
  }

  body[data-page="parliament-members"] .pm-profile-actions {
    flex-basis: 100% !important;
  }

  body[data-page="parliament-members"] .pm-profile-votemix-body {
    grid-template-columns: 1fr !important;
  }

  body[data-page="parliament-members"] .pm-profile-votemix-canvas-wrap {
    max-width: 150px !important;
  }

  body[data-page="parliament-members"] .pm-profile-charts-grid[data-profile-pane],
  body[data-page="parliament-members"] .pm-profile-context-grid[data-profile-pane],
  body[data-page="parliament-members"] .pm-profile-top-grid[data-profile-pane],
  body[data-page="parliament-members"] .pm-profile-workstream-card[data-profile-pane],
  body[data-page="parliament-members"] .pm-profile-overview-card[data-profile-pane],
  body[data-page="parliament-members"] .pm-profile-drill-card[data-profile-pane],
  body[data-page="parliament-members"] .pm-debates-card[data-profile-pane],
  body[data-page="parliament-members"] .pm-amendments-card[data-profile-pane],
  body[data-page="parliament-members"] .pm-profile-influence-card[data-profile-pane],
  body[data-page="parliament-members"] .pm-kiviat-card[data-profile-pane] {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
}

/* ═══════════════════════════════════════════════════════════════
   Collapsible dashboard sidebar (News / Parliament Members / Topics & Mandate)
   Shared by sidebar-collapse.js. High-specificity + !important on the collapsed
   state deliberately, since .dashboard-sidebar's own width/min-width is already
   redefined by several earlier, page-specific layers in this file.
   ═══════════════════════════════════════════════════════════════ */
.dashboard-shell { position: relative; }
.sidebar-collapse-toggle {
  flex: 0 0 auto;
  align-self: flex-start;
  margin-top: 14px;
  width: 20px;
  height: 40px;
  border: none;
  border-radius: 0 8px 8px 0;
  background: rgba(15, 23, 42, 0.82);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  z-index: 20;
  padding: 0;
  transition: background 0.15s ease;
}
.sidebar-collapse-toggle:hover { background: rgba(15, 23, 42, 1); }
.sidebar-collapse-toggle svg { display: block; transition: transform 0.18s ease; }
.dashboard-shell.sidebar-collapsed .sidebar-collapse-toggle svg { transform: rotate(180deg); }
.dashboard-shell.sidebar-collapsed .dashboard-sidebar {
  width: 0 !important;
  min-width: 0 !important;
  border: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
