/* --- Sigma graph flex chain fix (scoped to graph page) --- */
    body[data-page="graph"] .app-main,
    body[data-page="graph"] .app-content,
    body[data-page="graph"] .sigma-page-content,
    body[data-page="graph"] .explorer-panel,
    body[data-page="graph"] .explorer-panel.active,
    body[data-page="graph"] .sigma-shell {
      display: flex;
      flex-direction: column;
      flex: 1 1 0;
      min-height: 0;
      min-width: 0;
    }
    body[data-page="graph"] .sigma-shell {
      flex-direction: row;
    }
    body[data-page="graph"] .explorer-panel.active {
      flex: 1 1 0;
    }
    body[data-page="graph"] .sigma-canvas-wrap {
      flex: 1 1 0;
      min-width: 0;
      min-height: 0;
      position: relative;
      overflow: hidden;
      display: flex;
    }
    body[data-page="graph"] #sigmaContainer {
      width: 100% !important;
      height: 100% !important;
      min-width: 0;
      min-height: 0;
      position: absolute;
      inset: 0;
    }
    /* ── 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-lg: 12px;
      --radius-md: 8px;
      --radius-sm: 6px;
      --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: 'Gilmer', system-ui, sans-serif;
      --font-ui: 'Tofino', 'Gilmer', system-ui, sans-serif;
    }

    *{ box-sizing:border-box; }
    :focus { outline: none; }
    :focus-visible {
      outline: 2px solid var(--il-blue);
      outline-offset: 2px;
      border-radius: var(--radius-sm);
    }
    body{
      margin:0;
      font-family: 'Tofino', 'Gilmer', system-ui, 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;
    }
    .spinner {
      width: 48px;
      height: 48px;
      border-radius: 999px;
      border: 4px solid #dbeafe;
      border-top-color: var(--il-blue);
      margin: 0 auto 16px;
      animation: spin 0.9s linear 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;
    }
    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 {
      background: var(--il-blue);
      color: #fff;
      border-color: transparent;
    }
    .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 {
      padding: 6px 12px;
      border-radius: 999px;
      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;
    }
    .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);
    }
    .chip.active {
      background: var(--il-blue);
      color: #fff;
      border-color: transparent;
    }
    .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-header {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 24px;
      margin-bottom: 24px;
      flex-wrap: wrap;
    }
    .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;
    }
    .benchmark-stats {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
      gap: 16px;
      margin-top: 24px;
    }
    .stat-card {
      background: #fff;
      padding: 16px;
      border-radius: 12px;
      text-align: center;
      border: 1px solid var(--border);
    }
    .stat-value {
      font-size: 32px;
      font-weight: 900;
      color: var(--il-blue);
    }
    .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:hover {
      box-shadow: 0 4px 16px rgba(15,23,42,0.08);
    }
.chart-card {
      background: var(--card-bg, #fff);
      border: 1px solid var(--border-subtle, #e2e8f0);
      border-radius: 10px;
      padding: 18px 20px;
      box-shadow: 0 2px 8px rgba(15,23,42,0.05);
      transition: box-shadow 0.2s ease;
    }
    .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:hover {
      box-shadow: 0 4px 16px rgba(15,23,42,0.09);
    }
    .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 {
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 12px;
      background: #fafbfc;
    }
    .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.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); }

    .breakdown-item {
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 10px 14px;
      margin-bottom: 10px;
      background: #fafbfc;
    }
    .breakdown-item summary {
      cursor: pointer;
      font-weight: 800;
      font-size: 13px;
      color: var(--text);
      outline: none;
      list-style: none;
    }
    .breakdown-item summary::-webkit-details-marker { display: none; }
    .breakdown-meta {
      font-size: 12px;
      color: var(--muted);
      margin-top: 6px;
    }
    .breakdown-table-wrap {
      margin-top: 10px;
      overflow-x: auto;
    }

    .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; }
    }
    .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; }
    .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;
    }

    .insights-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
      gap: 16px;
      margin-top: 20px;
    }
    .insight-card {
      background: #fff;
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 16px;
    }
    .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);
    }
    .chart-card h3,
    .panel-title {
      font-weight: 800;
    }
    .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;
    }
    .files-table th,
    .ranking-table th,
    .comparison-table th,
    .breakdown-table th,
    .simulator-table th,
    .heatmap-table th {
      background: #eef2f7;
      border-bottom: 1px solid var(--border);
    }
    .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: #f8fafc;
    }
    .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;
    }
    .chart-card,
    .delegation-card {
      transition: transform 0.2s ease, box-shadow 0.2s ease;
    }
    .chart-card:hover,
    .delegation-card:hover {
      transform: translateY(-3px);
      box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
    }
    .upload-zone {
      border-radius: var(--radius-lg);
    }
    .upload-btn {
      border-radius: var(--radius-md);
    }
    .export-btn,
    .control-btn,
    .clear-btn,
    .compare-btn,
    .comparison-result-btn,
    .show-more-btn {
      border-radius: var(--radius-sm);
    }

    .empty-state {
      text-align: center;
      padding: 80px 20px;
      color: var(--muted);
    }
    .empty-icon {
      font-size: 72px;
      margin-bottom: 20px;
      opacity: 0.4;
    }

    @font-face {
      font-family: 'Gilmer';
      src: url('fonts/adminmart/Gilmer-Regular.woff') format('woff');
      font-weight: 400;
      font-style: normal;
      font-display: swap;
    }
    @font-face {
      font-family: 'Gilmer';
      src: url('fonts/adminmart/Gilmer-Medium.woff') format('woff');
      font-weight: 500;
      font-style: normal;
      font-display: swap;
    }
    @font-face {
      font-family: 'Gilmer';
      src: url('fonts/adminmart/Gilmer-Bold.woff') format('woff');
      font-weight: 700;
      font-style: normal;
      font-display: swap;
    }
    @font-face {
      font-family: 'Gilmer';
      src: url('fonts/adminmart/Gilmer-Heavy.woff') format('woff');
      font-weight: 800;
      font-style: normal;
      font-display: swap;
    }
    @font-face {
      font-family: 'Gilmer';
      src: url('fonts/adminmart/Gilmer-Heavy.woff') format('woff');
      font-weight: 900;
      font-style: normal;
      font-display: swap;
    }
    @font-face {
      font-family: 'Tofino';
      src: url('fonts/adminmart/TofinoPersonal-Book.woff') format('woff');
      font-weight: 300;
      font-style: normal;
      font-display: swap;
    }
    @font-face {
      font-family: 'Tofino';
      src: url('fonts/adminmart/TofinoPersonal-Regular.woff') format('woff');
      font-weight: 400;
      font-style: normal;
      font-display: swap;
    }
    @font-face {
      font-family: 'Tofino';
      src: url('fonts/adminmart/TofinoPersonal-Medium.woff') format('woff');
      font-weight: 500;
      font-style: normal;
      font-display: swap;
    }
    body {
      font-family: 'Tofino', 'Gilmer', system-ui, sans-serif;
    }
    h1, h2, h3, h4, h5, h6,
    .topbar-title, .section-title, .panel-title, .card-title,
    .kpi-value, .stat-value, .score-value, .match-score {
      font-family: 'Gilmer', system-ui, sans-serif;
    }
    .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: 'Tofino', system-ui, sans-serif;
    }

    .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;
    }
    .brand-inline-logo {
      width: 24px;
      height: 24px;
      border-radius: 6px;
      vertical-align: -5px;
      margin-right: 8px;
    }
    .brand-showcase {
      margin: 10px 0 12px;
      max-width: 420px;
    }
    .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;
    }
    .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(34px, 4vw, 48px);
      line-height: 1;
      letter-spacing: -0.03em;
      color: #0f172a;
    }
    .dashboard-brand-sub {
      margin: 0;
      color: #475569;
      font-size: 16px;
      line-height: 1.48;
      max-width: 70ch;
    }
    .dashboard-logo-mark {
      margin-top: 2px;
      border-radius: 12px;
      border: 1px solid rgba(148, 163, 184, 0.24);
      background: linear-gradient(145deg, rgba(255, 255, 255, 0.94) 0%, rgba(226, 240, 255, 0.88) 100%);
      padding: 8px;
    }
    .dashboard-logo-mark svg {
      width: 100%;
      max-width: 340px;
      height: auto;
      display: block;
    }
    .dashboard-graph-preview {
      text-decoration: none;
      border: 1px solid rgba(148, 163, 184, 0.26);
      border-radius: 14px;
      background: linear-gradient(165deg, rgba(9, 18, 39, 0.98) 0%, rgba(14, 27, 54, 0.96) 100%);
      color: #dbeafe;
      padding: 14px;
      display: grid;
      gap: 8px;
      transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
      box-shadow: 0 14px 28px rgba(2, 6, 23, 0.34);
    }
    .dashboard-graph-preview:hover {
      transform: translateY(-2px);
      border-color: rgba(96, 165, 250, 0.58);
      box-shadow: 0 18px 34px rgba(2, 6, 23, 0.4);
    }
    .dashboard-graph-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      flex-wrap: wrap;
    }
    .dashboard-graph-kicker {
      display: inline-flex;
      align-items: center;
      border-radius: 999px;
      border: 1px solid rgba(147, 197, 253, 0.4);
      background: rgba(37, 99, 235, 0.26);
      color: #bfdbfe;
      font-size: 11px;
      font-weight: 800;
      letter-spacing: 0.07em;
      text-transform: uppercase;
      padding: 4px 8px;
    }
    .dashboard-graph-cta {
      font-size: 12px;
      font-weight: 700;
      color: #93c5fd;
    }
    .dashboard-graph-sub {
      margin: 0;
      font-size: 13px;
      line-height: 1.45;
      color: rgba(219, 234, 254, 0.88);
    }
    .dashboard-graph-canvas {
      border: 1px solid rgba(148, 163, 184, 0.2);
      border-radius: 10px;
      background:
        radial-gradient(520px 220px at 20% 10%, rgba(14, 165, 233, 0.16), transparent 70%),
        linear-gradient(180deg, rgba(12, 22, 44, 0.98) 0%, rgba(8, 15, 32, 0.98) 100%);
      padding: 8px;
    }
    .dashboard-graph-canvas svg {
      display: block;
      width: 100%;
      height: auto;
    }
    .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);
    }
    .panel-vote-compact--secondary .upload-btn.secondary {
      opacity: 0.86;
    }
    .dataset-vote-head h2 {
      margin: 0;
    }
    .dataset-data-notice {
      display: none;
      align-items: center;
      gap: 6px;
      max-width: 100%;
      padding: 8px 12px;
      border-radius: 10px;
      border: 1px solid rgba(37, 99, 235, 0.24);
      background: rgba(239, 246, 255, 0.82);
      color: #1e3a8a;
      font-size: 12px;
      font-weight: 600;
      line-height: 1.35;
    }
    .dataset-legal-footer {
      margin-top: 22px;
      padding: 14px 16px;
      border: 1px solid var(--border);
      border-radius: 12px;
      background: #fff;
    }
    .dataset-legal-line {
      font-size: 12px;
      color: var(--muted);
      margin-bottom: 8px;
    }
    .bk-agency-hero-inner {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 18px;
      flex-wrap: wrap;
      padding: 2px 0;
    }
    .bk-agency-made-for {
      font-size: 15px;
      color: #64748b;
      font-weight: 700;
      letter-spacing: 0.04em;
    }
    .bk-agency-logo-main {
      height: 38px;
      width: auto;
      max-width: 180px;
      display: block;
    }
    .mandate-atlas-footer-block {
      margin-top: 10px;
      font-size: 13px;
      color: #64748b;
      font-family: inherit;
    }
    .mandate-atlas-footer-signature {
      font-size: 13px;
      color: #7b8794;
      font-style: italic;
      margin-bottom: 4px;
    }
    .mandate-atlas-footer-signature-sub {
      font-size: 12px;
      color: #94a3b8;
      font-style: normal;
    }
    .mandate-atlas-footer-links {
      margin-bottom: 4px;
    }
    .mandate-atlas-footer-links a {
      color: #3b82f6;
      text-decoration: underline;
      text-underline-offset: 2px;
    }
    .mandate-atlas-footer-note {
      font-size: 12px;
      color: #a3a3a3;
      margin-top: 2px;
    }
    .mandate-atlas-footer-note span {
      font-style: italic;
      color: #b91c1c;
    }
    .dataset-made-for-footer {
      display: flex;
      align-items: center;
      gap: 10px;
      margin-bottom: 10px;
    }
    .dataset-made-for-label {
      font-size: 11px;
      text-transform: lowercase;
      letter-spacing: 0.04em;
      color: var(--muted);
      font-weight: 700;
    }
    .dataset-made-for-logo {
      width: 246px;
      height: auto;
      display: block;
    }
    .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="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;
      }
      .dashboard-brand-title {
        font-size: 34px;
      }
      .dashboard-brand-sub {
        font-size: 15px;
      }
      .home-brand-lockup {
        width: min(100%, 420px);
      }
      .dataset-made-for-logo {
        width: 192px;
      }
      .dataset-legal-footer {
        padding: 12px;
      }
    }

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

    /* Adminmart-inspired skins */
    .panel,
    .chart-card,
    .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,
    .chart-card,
    .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;
    }
    .control-btn,
    .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; } */

    .analysis-launcher {
      display: flex;
      align-items: center;
      gap: 10px;
      margin: 18px 0 22px;
      flex-wrap: wrap;
    }
    .launcher-home {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 11px 18px;
      background: var(--bg-2);
      border: 1px solid var(--border);
      border-radius: 10px;
      font-size: 13px;
      font-weight: 800;
      color: var(--text);
      cursor: pointer;
      transition: all .16s;
      white-space: nowrap;
    }
    .launcher-home.active,
    .launcher-home:hover {
      background: #fff;
      border-color: var(--il-blue);
      color: var(--il-blue);
      box-shadow: 0 2px 10px rgba(37,99,235,.12);
    }
    .launcher-panels {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      flex: 1;
    }
    .launcher-panel {
      flex: 1;
      min-width: 110px;
      display: flex;
      align-items: center;
      gap: 6px;
      padding: 10px 14px;
      background: var(--bg-2);
      border: 1px solid var(--border);
      border-radius: 10px;
      font-size: 12px;
      font-weight: 800;
      color: var(--muted);
      cursor: pointer;
      transition: all .16s;
      white-space: nowrap;
      justify-content: space-between;
    }
    .launcher-panel:hover {
      background: #fff;
      border-color: var(--il-blue);
      color: var(--text);
      box-shadow: 0 2px 10px rgba(37,99,235,.1);
      transform: translateY(-1px);
    }
    .launcher-panel.active {
      background: #eff6ff;
      border-color: var(--il-blue);
      color: var(--il-blue);
    }
    .launcher-label { flex: 1; }
    .launcher-arrow { opacity: .5; font-size: 13px; }
    .launcher-icon { font-size: 15px; }
    .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;
      }
      .analysis-launcher { flex-wrap: wrap; }
      .launcher-panels { flex-wrap: wrap; }
      .launcher-panel { min-width: 90px; }
      .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;
      }
    }

    /* Intelligence Graph */
    .graph-intel-shell {
      margin-top: 8px;
      padding: 18px;
      border-radius: 22px;
      border: 1px solid rgba(148, 163, 184, 0.24);
      background:
        linear-gradient(165deg, rgba(255,255,255,0.95) 0%, rgba(246,250,255,0.96) 52%, rgba(237,245,255,0.98) 100%);
      box-shadow:
        0 16px 36px rgba(15, 23, 42, 0.08),
        inset 0 1px 0 rgba(255,255,255,0.92);
    }
    .graph-intel-header {
      display: flex;
      flex-wrap: wrap;
      justify-content: space-between;
      gap: 14px;
      margin-bottom: 12px;
    }
    .graph-intel-title {
      margin: 0;
      font-size: 23px;
      font-weight: 900;
      letter-spacing: 0.01em;
    }
    .graph-intel-subtitle {
      margin-top: 4px;
      color: var(--muted);
      font-size: 12px;
      font-weight: 700;
      line-height: 1.45;
      max-width: 820px;
    }
    .graph-intel-controls {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
      gap: 9px;
      align-items: stretch;
      width: min(100%, 1140px);
    }
    .graph-intel-controls label {
      display: grid;
      gap: 5px;
      font-size: 11px;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      color: var(--muted);
      min-width: 0;
      border: 1px solid rgba(148, 163, 184, 0.28);
      border-radius: 11px;
      padding: 7px 9px;
      background: rgba(255,255,255,0.74);
      -webkit-backdrop-filter: blur(6px);
      backdrop-filter: blur(6px);
      box-shadow: inset 0 1px 0 rgba(255,255,255,0.78);
    }
    .graph-intel-controls select {
      border-radius: 10px;
      border: 1px solid rgba(148, 163, 184, 0.34);
      background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
      color: var(--text);
      padding: 8px 10px;
      font-size: 12px;
      font-weight: 700;
      outline: none;
    }
    .graph-intel-controls select:focus {
      border-color: var(--il-blue);
      box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.16);
    }
    .graph-intel-controls #graphTargetSelect { min-width: 0; }
    .graph-intel-controls #graphRelationSelect { min-width: 0; }
    .graph-intel-controls #graphResetBtn {
      width: 100%;
      min-height: 40px;
      border-radius: 11px;
      font-size: 12px;
      font-weight: 800;
      border: 1px solid rgba(148, 163, 184, 0.34);
      background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
      color: #334155;
    }
    .graph-timeline-control {
      grid-column: span 2;
      min-width: 0;
      display: grid;
      grid-template-columns: 1fr;
      gap: 6px;
      align-items: center;
      border: 1px solid rgba(148, 163, 184, 0.3);
      border-radius: 11px;
      padding: 8px 10px;
      background: linear-gradient(180deg, rgba(255,255,255,0.82) 0%, rgba(248, 250, 252, 0.92) 100%);
      box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
    }
    .graph-timeline-control input[type="range"] {
      width: 100%;
      accent-color: #1d4ed8;
      margin: 0;
      cursor: pointer;
    }
    .graph-timeline-label {
      font-size: 11px;
      font-weight: 800;
      color: #334155;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .graph-timeline-bounds {
      display: flex;
      justify-content: space-between;
      align-items: center;
      font-size: 10px;
      font-weight: 700;
      color: #64748b;
      letter-spacing: 0.01em;
      min-height: 14px;
      gap: 8px;
    }
    .graph-timeline-bounds span {
      display: inline-flex;
      align-items: center;
      border-radius: 999px;
      padding: 1px 6px;
      border: 1px solid rgba(148, 163, 184, 0.28);
      background: rgba(255,255,255,0.58);
      white-space: nowrap;
    }
    .graph-intel-summary {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-bottom: 12px;
    }
    .graph-selected-details {
      margin: -2px 0 10px;
      border-radius: 12px;
      border: 1px solid rgba(148, 163, 184, 0.3);
      background: linear-gradient(160deg, rgba(248, 250, 252, 0.94) 0%, rgba(240, 249, 255, 0.86) 100%);
      padding: 10px 12px;
      font-size: 11px;
      font-weight: 700;
      color: #334155;
      min-height: 36px;
      box-shadow: inset 0 1px 0 rgba(255,255,255,0.84);
    }
    .graph-selected-details strong {
      color: #0f172a;
      font-size: 12px;
    }
    .graph-pill {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 6px 10px;
      border-radius: 999px;
      border: 1px solid rgba(148, 163, 184, 0.28);
      background: linear-gradient(180deg, rgba(255,255,255,0.96) 0%, rgba(241,245,249,0.94) 100%);
      font-size: 11px;
      font-weight: 900;
      color: #0f172a;
      letter-spacing: 0.02em;
    }
    .graph-pill strong {
      font-size: 12px;
      color: #1d4ed8;
    }
    .graph-stage-wrap {
      position: relative;
      border-radius: 18px;
      border: 1px solid rgba(148, 163, 184, 0.28);
      background:
        radial-gradient(120% 150% at 12% 2%, rgba(16, 185, 129, 0.2) 0%, rgba(255, 255, 255, 0) 52%),
        radial-gradient(120% 145% at 92% 100%, rgba(59, 130, 246, 0.22) 0%, rgba(255, 255, 255, 0) 58%),
        linear-gradient(165deg, rgba(255,255,255,0.92) 0%, rgba(238,246,255,0.95) 44%, rgba(247,251,255,0.98) 100%);
      overflow: hidden;
      min-height: 620px;
      -webkit-backdrop-filter: blur(6px);
      backdrop-filter: blur(6px);
      box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.92),
        inset 0 -32px 72px rgba(30,64,175,0.08),
        0 12px 26px rgba(15,23,42,0.07);
    }
    .graph-stage-wrap::before {
      content: "";
      position: absolute;
      inset: 0;
      pointer-events: none;
      z-index: 1;
      background:
        linear-gradient(130deg, rgba(255,255,255,0.34) 0%, rgba(255,255,255,0) 38%),
        radial-gradient(70% 50% at 50% 100%, rgba(15,23,42,0.14) 0%, rgba(15,23,42,0) 72%);
    }
    .graph-stage-wrap::after {
      content: "";
      position: absolute;
      inset: 0;
      pointer-events: none;
      z-index: 1;
      background-image:
        linear-gradient(to right, rgba(15,23,42,0.04) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(15,23,42,0.04) 1px, transparent 1px);
      background-size: 34px 34px;
      opacity: 0.06;
    }
    .graph-axis-track {
      position: absolute;
      left: 44px;
      right: 44px;
      top: 64px;
      border-top: 2px dashed rgba(100, 116, 139, 0.45);
      pointer-events: none;
      z-index: 1;
    }
    .graph-axis-label {
      position: absolute;
      top: 36px;
      font-size: 11px;
      font-weight: 900;
      text-transform: uppercase;
      letter-spacing: 0.06em;
      color: #475569;
      pointer-events: none;
      z-index: 2;
      background: rgba(255,255,255,0.72);
      border: 1px solid rgba(148, 163, 184, 0.34);
      border-radius: 999px;
      padding: 4px 10px;
    }
    .graph-axis-left {
      left: 46px;
    }
    .graph-axis-right {
      right: 46px;
      text-align: right;
    }
    .intelligence-graph {
      position: relative;
      z-index: 3;
      display: block;
      width: 100%;
      height: 680px;
      cursor: grab;
      -webkit-user-select: none;
      user-select: none;
      touch-action: none;
    }
    .intelligence-graph.panning { cursor: grabbing; }
    .graph-viewport { transition: none; will-change: transform; }
    .graph-cloud-layer { pointer-events: none; mix-blend-mode: multiply; }
    .graph-cloud {
      filter: blur(2px);
      transition: opacity 0.2s ease;
      opacity: 0.44;
    }
    .graph-pan-surface { fill: transparent; pointer-events: all; }

    /* ── Edges ── */
    .graph-edge {
      pointer-events: none;
      transition: opacity 0.15s ease, stroke-width 0.15s ease;
    }
    .intelligence-graph.viewport-moving .graph-edge,
    .intelligence-graph.viewport-moving .graph-node circle,
    .intelligence-graph.viewport-moving .graph-flow-badge { transition: none !important; }
    .intelligence-graph.viewport-moving .graph-edge-flow,
    .intelligence-graph.viewport-moving .graph-node-group circle,
    .intelligence-graph.viewport-moving .graph-node.target circle,
    .intelligence-graph.viewport-moving .graph-node.pinned circle { filter: none !important; }
    .graph-edge-membership { stroke: rgba(148,163,184,0.18); stroke-width: 0.8; }
    .graph-edge-similarity  { stroke: rgba(37,99,235,0.28); stroke-width: 1.4; stroke-dasharray: 4 5; }
    .graph-edge-bridge      { stroke: rgba(13,148,136,0.48); stroke-width: 2.6; opacity: 0.82; }
    .graph-edge-target      { stroke: rgba(6,182,212,0.72); stroke-width: 2.4; stroke-dasharray: 5 3; opacity: 0.92; }
    .graph-edge-affinity    { stroke: rgba(245,158,11,0.48); stroke-width: 1.7; stroke-dasharray: 2 5; opacity: 0.60; }
    .graph-edge-flow {
      stroke: rgba(6,182,212,0.68);
      stroke-width: 2.8;
      opacity: 0.80;
      filter: drop-shadow(0 0 6px rgba(6,182,212,0.28));
    }
    .intelligence-graph:not(.graph-focused) .graph-edge-similarity { opacity: 0.04; }
    .intelligence-graph:not(.graph-focused) .graph-edge-affinity   { opacity: 0.10; }
    .intelligence-graph:not(.graph-focused) .graph-edge-target      { opacity: 0.14; }
    .intelligence-graph:not(.graph-focused) .graph-edge-flow        { opacity: 0.64; }
    .graph-edge.dimmed   { opacity: 0.05; }
    .graph-edge.group-link { opacity: 0.96 !important; stroke-width: 2.8 !important; }

    /* ── Flow badges ── */
    .graph-flow-badge { pointer-events: none; transition: opacity 0.18s ease; }
    .graph-flow-badge.dimmed { opacity: 0.10; }
    .graph-flow-badge rect {
      fill: rgba(8,15,32,0.82);
      stroke: rgba(99,179,237,0.36);
      stroke-width: 1;
      /* rx/ry not supported in Safari; use border-radius or SVG attributes if needed */
    }
    .graph-flow-badge text {
      fill: #bfdbfe;
      font-size: 8.5px;
      font-weight: 800;
      letter-spacing: 0.04em;
      dominant-baseline: middle;
      text-anchor: middle;
    }

    /* ── Nodes ── */
    .graph-node { cursor: pointer; transition: opacity 0.14s ease; }
    .graph-node-hit { fill: rgba(255,255,255,0.001); stroke: none; pointer-events: all; }
    .graph-node.dimmed { opacity: 0.12; }
    .graph-node-mep   { opacity: calc(0.70 + (var(--node-depth,0.5) * 0.24)); }
    .graph-node-group { opacity: 1; }
    .graph-node circle {
      transform-box: fill-box;
      transform-origin: center;
      transition: transform 0.14s ease-out, filter 0.18s ease;
      will-change: transform;
    }
    .graph-node:hover circle { transform: scale(1.10); }
    .intelligence-graph.dragging-node .graph-node:hover circle { transform: none; }
    .graph-node-gloss  { pointer-events: none; opacity: 0.68; }
    .graph-node-halo   { pointer-events: none; transition: opacity 0.2s ease; }
    .graph-node.dimmed .graph-node-halo { opacity: 0; }

    /* MEP node strokes by vote */
    .graph-node-mep circle {
      stroke-width: 1.2;
      fill-opacity: 0.93;
      filter: drop-shadow(0 1.5px 4px rgba(2,6,23,0.22));
    }
    .graph-node-mep.vote-for        circle { stroke: rgba(22,163,74,0.82);  stroke-width: 1.6; }
    .graph-node-mep.vote-against    circle { stroke: rgba(220,38,38,0.82);  stroke-width: 1.6; }
    .graph-node-mep.vote-abstention circle { stroke: rgba(217,119,6,0.82);  stroke-width: 1.6; }
    .graph-node-mep.vote-na         circle { stroke: rgba(148,163,184,0.55); }

    /* Group node */
    .graph-node-group circle {
      stroke: rgba(15,23,42,0.48);
      stroke-width: 2.2;
      fill-opacity: 0.96;
      filter:
        drop-shadow(0 6px 16px rgba(15,23,42,0.30))
        drop-shadow(0 2px 4px rgba(15,23,42,0.18));
    }
    .graph-node-group-label {
      font-size: 12px;
      font-weight: 900;
      fill: #0f172a;
      text-anchor: middle;
      pointer-events: none;
      paint-order: stroke;
      stroke: rgba(255,255,255,0.95);
      stroke-width: 3.5px;
      stroke-linejoin: round;
      letter-spacing: -0.01em;
    }
    .graph-node-group-count {
      font-size: 8.5px;
      font-weight: 700;
      fill: rgba(15,23,42,0.60);
      text-anchor: middle;
      pointer-events: none;
      paint-order: stroke;
      stroke: rgba(255,255,255,0.85);
      stroke-width: 2.5px;
      stroke-linejoin: round;
      letter-spacing: 0.02em;
    }
    /* Backwards compat: old selector if text not given class */
    .graph-node-group text {
      font-size: 12px;
      font-weight: 900;
      fill: #0f172a;
      text-anchor: middle;
      pointer-events: none;
      paint-order: stroke;
      stroke: rgba(255,255,255,0.95);
      stroke-width: 3.5px;
      stroke-linejoin: round;
    }

    /* Active / pinned / target */
    .graph-node.active circle {
      stroke-width: 2.4;
      filter:
        drop-shadow(0 0 8px rgba(59,130,246,0.55))
        drop-shadow(0 0 18px rgba(59,130,246,0.22));
    }
    .graph-node.pinned circle {
      stroke-width: 2.8 !important;
      filter:
        drop-shadow(0 0 10px rgba(6,182,212,0.60))
        drop-shadow(0 0 24px rgba(6,182,212,0.28))
        drop-shadow(0 0 40px rgba(6,182,212,0.12));
    }
    .graph-node.target circle {
      stroke: rgba(6,182,212,0.95) !important;
      stroke-width: 3.4 !important;
      filter:
        drop-shadow(0 0 12px rgba(6,182,212,0.65))
        drop-shadow(0 0 28px rgba(6,182,212,0.30));
    }

    /* ── Tooltip ── */
    .graph-tooltip {
      display: none;
      position: absolute;
      min-width: 200px;
      max-width: 320px;
      border-radius: 14px;
      border: 1px solid rgba(99,179,237,0.22);
      background: rgba(8,15,36,0.88);
      -webkit-backdrop-filter: blur(16px) saturate(1.5);
      backdrop-filter: blur(16px) saturate(1.5);
      color: #e2e8f0;
      padding: 11px 13px;
      box-shadow:
        0 2px 0 rgba(255,255,255,0.06) inset,
        0 16px 40px rgba(2,6,23,0.64);
      z-index: 10;
      pointer-events: none;
      font-size: 11px;
      line-height: 1.45;
    }
    .graph-tooltip-title {
      color: #f1f5f9;
      font-size: 12.5px;
      font-weight: 900;
      margin-bottom: 5px;
      letter-spacing: -0.01em;
    }
    .graph-tooltip-meta {
      color: #7dd3fc;
      font-weight: 700;
      margin-bottom: 5px;
    }

    /* ── Footer / legend ── */
    .graph-intel-footer {
      margin-top: 12px;
      display: grid;
      grid-template-columns: 1fr;
      gap: 10px;
      align-items: start;
    }
    .graph-legend {
      border-radius: 12px;
      border: 1px solid rgba(148,163,184,0.22);
      background: linear-gradient(180deg,rgba(248,250,252,0.92) 0%,rgba(241,245,249,0.88) 100%);
      padding: 10px 14px;
      min-height: 44px;
      font-size: 11px;
      color: #334155;
      font-weight: 700;
      line-height: 1.5;
      box-shadow: 0 1px 3px rgba(15,23,42,0.06);
    }
    .graph-legend strong {
      color: #0f172a;
      font-size: 10.5px;
      text-transform: uppercase;
      letter-spacing: 0.06em;
      display: block;
      margin-bottom: 4px;
    }

    @media (max-width: 1040px) {
      .graph-intel-controls {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }
      .graph-timeline-control {
        grid-column: 1 / -1;
      }
      .graph-intel-footer {
        grid-template-columns: 1fr;
      }
      .graph-stage-wrap,
      .intelligence-graph {
        min-height: 520px;
        height: 520px;
      }
    }
    @media (max-width: 768px) {
      .graph-intel-shell {
        padding: 12px;
      }
      .graph-intel-title {
        font-size: 20px;
      }
      .graph-intel-controls {
        grid-template-columns: 1fr;
      }
      .graph-intel-controls label {
        min-width: 0;
      }
      .graph-timeline-control {
        min-width: 100%;
        grid-column: 1;
      }
      .graph-stage-wrap,
      .intelligence-graph {
        min-height: 460px;
        height: 460px;
      }
      .graph-axis-track {
        left: 26px;
        right: 26px;
      }
      .graph-axis-left {
        left: 26px;
      }
      .graph-axis-right {
        right: 26px;
      }
    }

/* ── 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: 10px 16px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 14px;
}
.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;
}

/* Backdrop */
.analysis-drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.38);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  z-index: 299;
}
.analysis-drawer-backdrop.active {
  display: block;
  animation: backdropIn .2s ease forwards;
}
@keyframes backdropIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

/* Sharper, more focused root palette */
:root {
  --shadow-lift: 0 8px 24px rgba(15,23,42,.09), 0 2px 6px rgba(15,23,42,.05);
  --card-radius: 14px;
}

/* 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;
}

/* 2-column grid */
.analytics-grid--2col {
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 900px) {
  .analytics-grid--2col { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════════════════
   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") */
#sigmaMepSearchResults,
#sigmaVoteFocusRow,
#sigmaTooltip,
#sigmaFa2Badge,
#sgSamplingNotice,
#explorerPanelSpectrum { 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-main {
  min-height: 100dvh;
}

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

body[data-page="graph"] .sigma-shell {
  display: flex;
  flex: 1;
  min-height: 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 {
  padding: 10px 0 8px;
  border-bottom: 1px solid #1e293b;
}
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;
}

/* Search */
.sg-search-wrap { position: relative; }

.sg-search-input {
  width: 100%;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 7px;
  color: #e2e8f0;
  font-family: inherit;
  font-size: 12px;
  padding: 6px 10px;
  outline: none;
  transition: border-color 0.15s;
  box-sizing: border-box;
}
.sg-search-input:focus { border-color: #3b82f6; }
.sg-search-input::placeholder { color: #475569; }

.sg-search-dd {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 100;
  max-height: 220px;
  overflow-y: auto;
}

.sg-search-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  cursor: pointer;
  transition: background 0.12s;
}
.sg-search-item:hover,
.sg-search-item--active { background: #273549; }

.sg-search-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.sg-search-name {
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 500;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sg-search-meta {
  color: #64748b;
  font-size: 10px;
  white-space: nowrap;
}
.sg-no-results {
  padding: 10px;
  color: #64748b;
  font-size: 12px;
  text-align: center;
}

/* 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; }

/* ── Canvas area ─────────────────────────────────────────────── */
body[data-page="graph"] .sigma-canvas-wrap {
  flex: 1;
  min-width: 0;
  min-height: 0;
  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 {
  position: absolute;
  inset: 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;
  padding: 10px 12px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 8px;
  z-index: 20;
  pointer-events: none;
  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 */
.explorer-shell {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: 100%;
  min-height: calc(100dvh - 126px);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(248, 250, 252, 0.95) 100%);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.10), inset 0 1px 0 rgba(255, 255, 255, 0.88);
  overflow: hidden;
}
body[data-page="graph"] .explorer-shell {
  min-height: 0 !important;
  height: 100% !important;
  max-height: 100%;
}
/* When inside sigma-page-content, fill the remaining viewport */
.sigma-page-content > .explorer-shell {
  flex: 1;
  min-height: 0;
}

.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;
}

#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: calc(100dvh - 114px);
    border-radius: 12px;
  }
  .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; }

/* ── Benchmark compact bar (analysis.html) ─────────────── */
.bench-bar-panel {
  border: 1px solid rgba(29, 78, 216, 0.18);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(239,246,255,0.9) 0%, rgba(255,255,255,0.95) 100%);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bench-bar-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.bench-bar-label {
  font-size: 11px;
  font-weight: 800;
  color: #1d4ed8;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.bench-bar-search {
  flex: 1;
  min-width: 200px;
}
.bench-bar-presets {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

/* ── 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) {
  .bench-bar-top { flex-direction: column; align-items: stretch; }
  .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) ── */
:root {
  --danger:  #dc2626;
  --warning: #d97706;
  --success: #16a34a;
  --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: 'Gilmer', system-ui, sans-serif;
}
.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: 100vh;
    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: 'Gilmer', system-ui, sans-serif;
  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(560px, 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-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); }

/* ═══════════════════════════════════════════════════════════════════
   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: 1fr 1fr 1fr 280px;
  grid-template-rows: 1fr 1fr;
  gap: var(--sp-4);
  padding: var(--sp-4);
  max-width: 1800px;
  margin: 0 auto;
  height: 100%;
}
.news-grid .panel-ep-live { grid-column: 1; grid-row: 1 / 3; }
.news-grid .panel-feed    { grid-column: 2; grid-row: 1 / 3; }
.news-grid .panel-groups  { grid-column: 3; grid-row: 1; }
.news-grid .panel-search  { grid-column: 3; grid-row: 2; }
.news-grid .panel-mep     { grid-column: 4; grid-row: 1 / 3; }

@media (max-width: 1300px) {
  .news-grid {
    grid-template-columns: 1fr 1fr 280px;
    grid-template-rows: 1fr 1fr;
  }
  .news-grid .panel-ep-live { grid-column: 1; grid-row: 1 / 3; }
  .news-grid .panel-feed    { grid-column: 2; grid-row: 1 / 3; }
  .news-grid .panel-groups  { grid-column: 3; grid-row: 1; }
  .news-grid .panel-search  { display: none; }
  .news-grid .panel-mep     { grid-column: 3; grid-row: 2; }
}
@media (max-width: 900px) {
  .news-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
  }
  .news-grid .panel-ep-live,
  .news-grid .panel-feed,
  .news-grid .panel-groups,
  .news-grid .panel-mep,
  .news-grid .panel-search { grid-column: auto; grid-row: auto; height: 400px; }
}

/* Panel shell */
.np {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.np-header {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 10px var(--sp-4);
  background: var(--topbar-bg);
  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-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-pulse 2s infinite; }
.np-badge.ok   { background: #16a34a; }
.np-badge.warn { background: #b45309; }
@keyframes np-pulse { 0%,100%{opacity:1} 50%{opacity:.6} }

.np-toolbar {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 8px var(--sp-4);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-2);
  flex-shrink: 0;
}
.np-toolbar input {
  flex: 1;
  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-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); }

.group-tabs {
  display: flex;
  gap: 2px;
  padding: 8px var(--sp-4) 0;
  background: var(--bg-2);
  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;
  overflow-y: auto;
  padding: var(--sp-3) var(--sp-4);
}

/* Article list */
.article-list { display: flex; flex-direction: column; gap: 1px; }
.art-item {
  padding: 9px 0;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
}
.art-item:last-child  { border-bottom: none; }
.art-item:hover .art-title { color: var(--il-blue); }
.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 var(--sp-4);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-2);
  font-size: 11px;
  align-items: center;
  flex-shrink: 0;
}
.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; }

/* Source rows */
.src-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 11px;
}
.src-row:last-child { border-bottom: 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-name  { flex: 1; font-weight: 600; color: var(--text); }
.src-count { color: var(--muted); }
.src-kind  {
  font-size: 9px; font-weight: 700; text-transform: uppercase;
  padding: 1px 5px; border-radius: 3px;
  background: var(--bg-2); color: var(--muted);
}

/* Empty / loading */
.np-empty {
  padding: var(--sp-5);
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  padding: 18px 0;
  text-align: center;
}
.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: 5px var(--sp-4);
  font-size: 10px;
  color: var(--muted);
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-2);
  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-main    { min-height: 100dvh; height: 100dvh; overflow: hidden; }
body[data-page="news"] .app-content { flex: 1; min-height: 0; overflow: hidden; padding: 16px 28px; }
body[data-page="news"] .news-grid   { height: 100%; }
body[data-page="news"] .np          { height: 100%; min-height: 0; }

/* 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; }

/* ── 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-drawer {
  position: fixed; inset: 0; z-index: 2000;
  display: flex; justify-content: flex-end;
}
.mep-card-drawer.is-hidden { display: none; }
.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-drawer:not(.is-hidden) {
  pointer-events: auto;
  background: rgba(30,41,59,0.32);
}
.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 ── */
.mandate-hero { text-align: left; padding: 36px 0 28px; }
.mandate-hero-lockup {
  display: flex; align-items: center; gap: 24px;
}
.mandate-hero-icon {
  width: 88px; height: 88px;
  border-radius: 22px;
  box-shadow: 0 8px 32px rgba(17,34,72,0.18), 0 2px 8px rgba(17,34,72,0.10);
  flex-shrink: 0;
}
.mandate-hero-icon--sm { width: 64px; height: 64px; border-radius: 16px; }
.mandate-hero-text { display: flex; flex-direction: column; gap: 6px; }
.mandate-hero-title {
  font-size: 2.4rem; font-weight: 800; letter-spacing: -0.03em;
  color: var(--fg); line-height: 1.1; margin: 0;
  background: linear-gradient(135deg, #1d4ed8 0%, #0b1830 80%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.mandate-hero-sub {
  font-size: 0.95rem; color: var(--muted); line-height: 1.5;
  max-width: 560px; margin: 0;
}
@media (max-width: 600px) {
  .mandate-hero-lockup { flex-direction: column; align-items: flex-start; gap: 14px; }
  .mandate-hero-title  { font-size: 1.8rem; }
  .mandate-hero-icon   { width: 64px; height: 64px; border-radius: 16px; }
}

/* ── 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);
}

/* ── Analysis page section headers (A / B) ─────────────────────────────── */
.analysis-section { margin-bottom: 32px; }
.analysis-section-header {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 0 10px;
  border-top: 2px solid var(--il-blue);
  margin-bottom: 16px;
}
.analysis-section-label {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; flex-shrink: 0;
  background: var(--il-blue); color: #fff;
  font-size: 11px; font-weight: 700; letter-spacing: .03em;
  border-radius: 5px;
  margin-top: 1px;
}
.analysis-section-titles { display: flex; flex-direction: column; gap: 2px; }
.analysis-section-title {
  font-size: 13px; font-weight: 700; color: var(--fg);
  letter-spacing: .01em; text-transform: uppercase;
}
.analysis-section-sub { font-size: 11px; color: var(--muted); line-height: 1.4; }

/* ── 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; }
.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.alignment-lbl { color: #16a34a; }

.tmep-bar-track {
  flex: 1; 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.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 {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.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-wrap {
  overflow-x: auto;
  max-height: 400px;
  overflow-y: auto;
}
.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: 600;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.05em;
  position: sticky;
  top: 0;
  z-index: 1;
}
.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;
}

/* ── chart-card KPI variant ── */
.chart-card--kpi {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 100px;
}
.chart-card-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}
.chart-card-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}

/* ── 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.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;
}

@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: 12px;
  display: grid;
  gap: 10px;
}

.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(280px, 1fr) auto auto;
  gap: 8px;
  align-items: center;
}

.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;
}

.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-card {
  display: grid;
  gap: 10px;
  align-content: start;
}

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

.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-alliance-card {
  display: grid;
  gap: 10px;
  align-content: start;
}

.tm-topic-alliance-wrap {
  position: relative;
  height: 260px;
  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-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: 14px;
}

.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-actions {
  margin-top: 8px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

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

.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;
}

.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-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 {
    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: 240px;
  }

  .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="parliament-members"],
body[data-page="topics-mandates"],
body[data-page="graph"],
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="dataset"] .app-content {
  padding-top: 88px;
}

body[data-page="intel"] .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.35fr) minmax(220px, 0.65fr);
  gap: 16px;
  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;
}

.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;
}

.hero-stat-card {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 14px;
  padding: 14px;
  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: 12px;
  font-weight: 800;
  color: #0f172a;
}

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

.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: 8px;
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
  padding: 8px;
  margin-bottom: 16px;
}

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

.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;
}

.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(240px, 1.2fr) minmax(260px, 1.7fr) auto;
  gap: 10px;
  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: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.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: 8px;
}

.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 12px;
}

.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.28);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 251, 255, 0.98) 100%);
  padding: 10px 12px;
  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 10px 24px rgba(37, 99, 235, 0.14);
  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: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.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;
}

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

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

.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: 9px;
  background: rgba(239, 246, 255, 0.9);
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 800;
  padding: 7px 10px;
  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: 10px;
  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: 12px;
  margin-bottom: 16px;
}

.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: 8px;
}

.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, 1.2fr) minmax(0, 0.8fr);
  gap: 10px;
}

.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: 12px;
  display: grid;
  gap: 8px;
}

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

.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-history {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.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: 12px;
  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: 8px;
}

.pm-profile-kpi {
  border: 1px solid rgba(203, 213, 225, 0.7);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(248, 251, 255, 0.98) 100%);
  padding: 10px;
}

.pm-profile-kpi-val {
  font-size: 21px;
  font-weight: 800;
  line-height: 1.05;
  color: #0f172a;
}

.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: 10px;
}

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

.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;
}

.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: auto;
    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: flex-start;
  }

  .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-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;
  }
}

@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 {
  padding-top: 112px;
}

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

  body[data-page="graph"] .explorer-shell {
    min-height: 0;
    height: 100%;
  }

  .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"] #explorerPanelSigma {
  padding: 8px 10px 10px;
  overflow: hidden;
}

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;
  }
}

/* Graph viewport must stay bounded to keep controls/camera in frame */
body[data-page="graph"] .app-main {
  height: 100dvh;
  overflow: hidden;
}
body[data-page="graph"] .app-content {
  height: 100dvh;
  overflow: hidden;
  box-sizing: border-box;
}

/* 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;
  }
}
