    /* ── Reset ──────────────────────────────────────────────────── */
    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

    /* ── Design tokens ─────────────────────────────────────────── */
    :root {
      --brand:       #2D6A4F;
      --brand-dark:  #1B4332;
      --brand-light: #D8F3DC;
      --section-bg:  #FFFFFF;   /* white section bodies */
      --accent:      #52B788;
      --danger:      #EF4444;
      --warning:     #F59E0B;
      --info:        #3B82F6;
      --text:        #111827;
      --text-2:      #374151;
      --muted:       #6B7280;
      --border:      #E5E7EB;
      --bg:          #EAF6EE;   /* pastel green app background */
      --card:        #FFFFFF;
      --radius:      12px;
      --shadow:      0 4px 20px rgba(0,0,0,0.09);
      --transition:  0.18s ease;
    }

    body {
      font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
      background: var(--bg);
      color: var(--text);
      min-height: 100vh;
    }

    /* ── Utility ────────────────────────────────────────────────── */
    .hidden { display: none !important; }

    /* ── Loading ────────────────────────────────────────────────── */
    .app-loading {
      min-height: 100vh;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 16px;
      color: var(--muted);
      font-size: 0.9375rem;
    }
    .spinner {
      width: 36px; height: 36px;
      border: 3px solid var(--border);
      border-top-color: var(--brand);
      border-radius: 50%;
      animation: spin 0.8s linear infinite;
    }
    @keyframes spin { to { transform: rotate(360deg); } }

    /* ── Header ─────────────────────────────────────────────────── */
    .header {
      background: linear-gradient(135deg, var(--brand-dark), var(--brand));
      color: #fff;
      padding: 16px 24px;
      display: flex;
      align-items: center;
      gap: 16px;
      position: sticky;
      top: 0;
      z-index: 100;
      box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    }
    .header-logo { height: 40px; }
    .header-title { font-size: 1.2rem; font-weight: 700; flex: 1; }
    .header-user { font-size: 0.875rem; opacity: 0.85; }
    .btn-signout {
      background: rgba(255,255,255,0.15);
      border: 1px solid rgba(255,255,255,0.3);
      color: #fff;
      padding: 6px 14px;
      border-radius: 8px;
      cursor: pointer;
      font-size: 0.8125rem;
      transition: background var(--transition);
    }
    .btn-signout:hover { background: rgba(255,255,255,0.25); }

    /* ── Branded header ────────────────────────────────────────────── */
    .branded-header {
      background: linear-gradient(135deg, #0A1F16 0%, #1B4332 45%, #2D6A4F 100%);
      border-radius: var(--radius);
      padding: 28px 32px;
      margin-bottom: 20px;
      color: #fff;
      position: relative;
      overflow: hidden;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 32px;
      box-shadow: 0 6px 28px rgba(0,0,0,0.22);
    }
    /* Decorative circles */
    .branded-header::before {
      content: ""; position: absolute;
      top: -70px; right: -70px;
      width: 260px; height: 260px; border-radius: 50%;
      background: rgba(255,255,255,0.045); pointer-events: none;
    }
    .branded-header::after {
      content: ""; position: absolute;
      bottom: -90px; right: 160px;
      width: 220px; height: 220px; border-radius: 50%;
      background: rgba(255,255,255,0.03); pointer-events: none;
    }
    .branded-header-left { display: flex; align-items: center; gap: 20px; flex-shrink: 0; }
    .branded-header-logo {
      width: 56px; height: 56px; flex-shrink: 0;
      border-radius: 12px;
      background: #fff;
      border: 1.5px solid rgba(255,255,255,0.3);
      display: flex; align-items: center; justify-content: center;
      overflow: hidden;
    }
    .branded-header-logo img { width: 52px; height: 52px; object-fit: contain; }
    .branded-header-logo-fallback {
      font-size: 1.25rem; font-weight: 900; color: #fff; letter-spacing: -0.05em;
    }
    .branded-header-identity { display: flex; flex-direction: column; gap: 2px; }
    .branded-header-org {
      font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.1em;
      text-transform: uppercase; color: rgba(255,255,255,0.6);
    }
    .branded-header-programme {
      font-size: 1.3rem; font-weight: 800; color: #fff;
      letter-spacing: -0.02em; line-height: 1.2;
    }
    .branded-header-page {
      font-size: 0.8125rem; font-weight: 500;
      color: rgba(255,255,255,0.55); margin-top: 1px;
    }
    .branded-header-divider {
      width: 1px; height: 52px; background: rgba(255,255,255,0.15); flex-shrink: 0;
    }
    .branded-header-stats { display: flex; gap: 28px; align-items: center; }
    .branded-stat { display: flex; flex-direction: column; align-items: center; gap: 2px; }
    .branded-stat-value {
      font-size: 1.75rem; font-weight: 800; color: #fff;
      letter-spacing: -0.03em; line-height: 1;
    }
    .branded-stat-label {
      font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.06em;
      text-transform: uppercase; color: rgba(255,255,255,0.5);
      white-space: nowrap;
    }
    .branded-stat-divider {
      width: 1px; height: 36px; background: rgba(255,255,255,0.12); flex-shrink: 0;
    }
    .branded-header-tagline {
      position: absolute; bottom: 11px; right: 32px;
      font-size: 0.6875rem; color: rgba(255,255,255,0.3);
      font-style: italic; letter-spacing: 0.02em;
    }
    /* Funder badge - sticky header (all pages) */
    .header-funder {
      display: flex; align-items: center; gap: 8px;
      padding: 5px 12px; border-radius: 8px;
      background: rgba(255,255,255,0.95);
      border: 1px solid rgba(255,255,255,0.4);
      flex-shrink: 0;
      min-width: 0;
    }
    .header-funder-label {
      font-size: 0.6rem; font-weight: 700; color: #555;
      text-transform: uppercase; letter-spacing: 0.06em;
      white-space: nowrap; line-height: 1.2;
    }
    .header-funder-logo { height: 28px; width: auto; display: block; }

    /* Funder block - branded header (Insights page) */
    .branded-funder {
      display: flex; flex-direction: column; align-items: center; gap: 6px;
      flex-shrink: 0;
    }
    .branded-funder-label {
      font-size: 0.6rem; font-weight: 700; color: rgba(255,255,255,0.5);
      text-transform: uppercase; letter-spacing: 0.1em; white-space: nowrap;
    }
    .branded-funder-logo-wrap {
      background: #fff; border-radius: 10px;
      padding: 8px 14px; display: flex; align-items: center;
    }
    .branded-funder-logo-wrap img { height: 36px; width: auto; display: block; }

    @media (max-width: 860px) {
      .branded-header { flex-direction: column; align-items: flex-start; gap: 20px; }
      .branded-header-divider { display: none; }
      .branded-header-stats { gap: 20px; }
    }

    /* ── Dashboard nav tabs ─────────────────────────────────────────── */
    /* All link states are pinned to solid white (including :visited, which
       browsers otherwise re-colour from their default palette). Each tab
       uses inline-flex with align-items:center so emoji + text sit on the
       same baseline regardless of glyph height. */
    .dash-nav { background: var(--brand-dark); padding: 0 24px; display: flex; align-items: center; gap: 4px; }
    .dash-nav-link,
    .dash-nav-link:link,
    .dash-nav-link:visited {
      color: #fff;
      text-decoration: none;
      padding: 10px 18px;
      font-size: 0.875rem;
      font-weight: 600;
      line-height: 1.2;
      border-bottom: 3px solid transparent;
      transition: all var(--transition);
      display: inline-flex;
      align-items: center;
    }
    .dash-nav-link:hover { color: #fff; border-bottom-color: rgba(255,255,255,0.4); }
    .dash-nav-link.active { color: #fff; border-bottom-color: #fff; }

    /* ── Container ──────────────────────────────────────────────── */
    .container {
      max-width: 1400px;
      margin: 0 auto;
      padding: 20px;
    }

    /* ── Card ───────────────────────────────────────────────────── */
    .card {
      background: var(--section-bg);
      border: 1.5px solid var(--brand);
      border-radius: var(--radius);
      box-shadow: var(--shadow);
      padding: 20px;
    }
    /* Inner cards (detail panel, nested grids) stay white for readability */
    .collapsible-body .card,
    .submissions-layout > .card,
    #submissionDetail {
      background: var(--card);
      border-color: var(--border);
      box-shadow: none;
    }
    .card-title {
      font-size: 1rem;
      font-weight: 600;
      color: var(--text);
      margin-bottom: 16px;
    }

    /* ── Collapsible sections ───────────────────────────────────── */
    .collapsible-card {
      background: var(--section-bg);
      border: 1.5px solid var(--brand);
      border-radius: var(--radius);
      box-shadow: var(--shadow);
      overflow: hidden;
    }
    .collapsible-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 14px 20px;
      cursor: pointer;
      user-select: none;
      gap: 12px;
      background: var(--brand);
      border-radius: calc(var(--radius) - 2px) calc(var(--radius) - 2px) 0 0;
      transition: background var(--transition);
    }
    .collapsible-header:hover {
      background: var(--brand-dark);
    }
    /* When closed, round all corners */
    .collapsible-card:not(.open) .collapsible-header {
      border-radius: calc(var(--radius) - 2px);
    }
    .collapsible-header-left {
      display: flex;
      align-items: center;
      gap: 10px;
      flex: 1;
      min-width: 0;
    }
    .collapsible-title {
      font-size: 1rem;
      font-weight: 600;
      color: #ffffff;
    }
    .collapsible-subtitle {
      font-size: 0.8125rem;
      color: rgba(255,255,255,0.7);
      margin-left: 4px;
    }
    .collapsible-chevron {
      flex-shrink: 0;
      width: 26px;
      height: 26px;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 6px;
      color: rgba(255,255,255,0.85);
      font-size: 0.7rem;
      transition: transform 0.2s ease;
      background: rgba(255,255,255,0.12);
    }
    .collapsible-header:hover .collapsible-chevron {
      background: rgba(255,255,255,0.2);
    }
    .collapsible-card.open .collapsible-chevron {
      transform: rotate(180deg);
    }
    .collapsible-body {
      display: none;
      padding: 0 20px 20px;
      background: var(--section-bg);
    }
    .collapsible-card.open .collapsible-body {
      display: block;
    }
    /* When a collapsible card has a header-action (e.g. sort select, button) */
    .collapsible-header-actions {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-shrink: 0;
    }
    /* Selects and buttons inside the green header */
    .collapsible-header-actions .filter-select {
      background: rgba(255,255,255,0.15);
      border-color: rgba(255,255,255,0.3);
      color: #fff;
    }
    .collapsible-header-actions .filter-select option {
      background: var(--brand-dark);
      color: #fff;
    }
    .collapsible-header-actions .btn {
      background: rgba(255,255,255,0.15);
      border-color: rgba(255,255,255,0.35);
      color: #fff;
    }
    .collapsible-header-actions .btn:hover {
      background: rgba(255,255,255,0.25);
    }
    .collapsible-header-actions .btn-primary {
      background: rgba(255,255,255,0.25);
      border-color: rgba(255,255,255,0.5);
      color: #fff;
    }
    .collapsible-header-actions .btn-primary:hover {
      background: rgba(255,255,255,0.35);
    }
    /* lp-sort-label inside green header */
    .collapsible-header-actions .lp-sort-label {
      color: rgba(255,255,255,0.8);
    }
    /* Divider line when open */
    .collapsible-card.open .collapsible-header {
      border-bottom: 1px solid rgba(255,255,255,0.15);
    }

    /* ── Grids ──────────────────────────────────────────────────── */
    .grid { display: grid; gap: 16px; }
    .grid-4 { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
    .grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
    .grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

    /* ── Stats cards ────────────────────────────────────────────── */
    .stat-label { font-size: 0.8125rem; color: var(--muted); margin-bottom: 4px; }
    .stat-value { font-size: 1.875rem; font-weight: 700; color: var(--brand); }
    .stat-value.danger  { color: var(--danger); }
    .stat-value.warning { color: var(--warning); }
    .card.clickable {
      cursor: pointer;
      transition: box-shadow var(--transition), transform var(--transition);
    }
    .card.clickable:hover { box-shadow: 0 6px 24px rgba(0,0,0,0.14); transform: translateY(-1px); }
    .card.clickable.panel-open { outline: 2px solid var(--warning); }
    .stat-hint {
      font-size: 0.7rem;
      color: var(--muted);
      margin-top: 2px;
      letter-spacing: 0.02em;
    }

    /* ── Badges ─────────────────────────────────────────────────── */
    .badge {
      display: inline-block;
      padding: 2px 10px;
      border-radius: 999px;
      font-size: 0.75rem;
      font-weight: 600;
    }
    .badge-good     { background: var(--brand-light); color: var(--brand-dark); }
    .badge-review   { background: #FEF3C7; color: #92400E; }
    .badge-poor     { background: #FEE2E2; color: #991B1B; }
    .badge-processed{ background: var(--brand-light); color: var(--brand-dark); }
    .badge-pending  { background: #F3F4F6; color: var(--muted); }
    .badge-flagged  { background: #FEF3C7; color: #92400E; }
    .badge-error    { background: #FEE2E2; color: #991B1B; }
    .badge-transcribing { background: #DBEAFE; color: #1E40AF; }
    .badge-analysing    { background: #EDE9FE; color: #5B21B6; }

    /* ── Safeguarding & AI flags ────────────────────────────────── */
    .wellbeing-queue {
      background: #FEF2F2;
      border: 1px solid #FECACA;
      border-radius: var(--radius);
      padding: 16px 20px;
      margin-bottom: 16px;
    }
    .wellbeing-queue-title {
      font-weight: 700;
      color: var(--danger);
      font-size: 0.9375rem;
      margin-bottom: 12px;
    }
    .safeguarding-subhead {
      font-size: 0.75rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.06em;
      color: var(--danger);
      margin: 12px 0 6px;
    }
    .safeguarding-subhead:first-child { margin-top: 0; }
    .safeguarding-subhead.ai { color: #92400E; }
    .wellbeing-item {
      display: flex;
      align-items: flex-start;
      gap: 12px;
      padding: 8px 0;
      border-bottom: 1px solid #FEE2E2;
      cursor: pointer;
    }
    .wellbeing-item:last-child { border-bottom: none; }
    .wellbeing-item:hover { opacity: 0.8; }

    .ai-flag-item { background: #FFFBEB; border-bottom-color: #FDE68A !important; }
    .ai-flag-pill {
      display: inline-block;
      background: #FEF3C7;
      border: 1px solid #FDE68A;
      color: #92400E;
      border-radius: 6px;
      padding: 2px 8px;
      font-size: 0.75rem;
      margin: 2px 4px 2px 0;
    }

    /* ── AI flag alert (legacy - hidden) ────────────────────────── */
    .ai-flag-banner {
      background: #FFFBEB;
      border: 1px solid #FDE68A;
      border-radius: var(--radius);
      padding: 12px 16px;
      margin-bottom: 16px;
      font-size: 0.875rem;
    }
    .ai-flag-banner strong { color: #92400E; }

    /* ── Demographics filter bar ────────────────────────────────── */
    .demo-filter-bar {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 8px;
      padding-top: 12px;
      margin-top: 12px;
      border-top: 1px solid var(--border);
    }
    .demo-filter-label {
      font-size: 0.75rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.06em;
      color: var(--muted);
      white-space: nowrap;
    }
    .demo-filter-bar .filter-select {
      flex: 1;
      min-width: 140px;
    }
    .demo-active-pill {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      background: var(--brand-light);
      color: var(--brand-dark);
      border-radius: 20px;
      padding: 3px 10px;
      font-size: 0.75rem;
      font-weight: 600;
    }
    .demo-active-pill button {
      background: none;
      border: none;
      cursor: pointer;
      color: var(--brand-dark);
      font-size: 0.8rem;
      padding: 0;
      line-height: 1;
    }

    /* ── Filter bar ─────────────────────────────────────────────── */
    .filter-bar {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      align-items: center;
    }
    .btn {
      padding: 8px 16px;
      border-radius: 8px;
      border: 1px solid var(--border);
      background: var(--card);
      color: var(--text-2);
      cursor: pointer;
      font-size: 0.875rem;
      font-weight: 500;
      transition: all var(--transition);
    }
    .btn:hover { border-color: var(--accent); color: var(--brand); }
    .btn.active {
      background: var(--brand);
      border-color: var(--brand);
      color: #fff;
    }
    .btn-primary {
      background: var(--brand);
      border-color: var(--brand);
      color: #fff;
    }
    .btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
    .btn-retry-all {
      background: #FEF3C7;
      border-color: #F59E0B;
      color: #92400E;
    }
    .btn-retry-all:hover { background: #FDE68A; }
    .btn-retry-all:disabled { opacity: 0.5; cursor: not-allowed; }
    .btn-danger {
      background: var(--danger);
      border-color: var(--danger);
      color: #fff;
    }
    .filter-search {
      padding: 8px 12px;
      border-radius: 8px;
      border: 1px solid var(--border);
      background: var(--card);
      color: var(--text-2);
      font-size: 0.875rem;
      flex: 1;
      min-width: 200px;
    }
    .filter-search:focus {
      outline: none;
      border-color: var(--accent);
      box-shadow: 0 0 0 3px rgba(82,183,136,0.15);
    }
    /* Global search results */
    .gs-result { padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px; cursor: pointer; transition: background var(--transition); display: flex; flex-direction: column; gap: 4px; }
    .gs-result:hover { background: var(--bg); }
    .gs-result-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
    .gs-result-location { font-weight: 700; font-size: 0.9375rem; color: var(--brand); }
    .gs-result-meta { font-size: 0.8125rem; color: var(--muted); }
    .gs-result-field { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; padding: 1px 7px; border-radius: 10px; background: #EDE9FE; color: #5B21B6; }
    .gs-result-snippet { font-size: 0.8125rem; color: var(--text); line-height: 1.5; }
    .gs-result-snippet mark { background: #FEF08A; border-radius: 2px; padding: 0 1px; }
    .gs-empty { font-size: 0.9rem; color: var(--muted); padding: 12px 0; }

    .retry-box {
      margin-top: 12px;
      padding: 12px;
      background: #FEE2E2;
      border-radius: 8px;
      border: 1px solid #FECACA;
    }
    .retry-error-msg {
      font-size: 0.8125rem;
      color: #991B1B;
      margin-top: 6px;
    }
    select.filter-select {
      padding: 8px 12px;
      border-radius: 8px;
      border: 1px solid var(--border);
      background: var(--card);
      color: var(--text-2);
      font-size: 0.875rem;
      cursor: pointer;
    }

    /* ── Theme tags ─────────────────────────────────────────────── */
    .theme-tag {
      display: inline-block;
      padding: 4px 12px;
      border-radius: 8px;
      background: var(--bg);
      border: 1px solid var(--border);
      font-size: 0.8125rem;
      cursor: pointer;
      margin: 3px;
      transition: all var(--transition);
    }
    .theme-tag:hover, .theme-tag.active {
      background: var(--brand-light);
      border-color: var(--accent);
      color: var(--brand-dark);
      font-weight: 600;
    }
    .theme-count {
      font-size: 0.75rem;
      color: var(--muted);
      margin-left: 4px;
    }

    /* ── Active theme banner ────────────────────────────────────── */
    .active-theme-banner {
      background: var(--brand);
      color: #fff;
      padding: 10px 16px;
      border-radius: 8px;
      margin-bottom: 12px;
      font-weight: 600;
      font-size: 0.875rem;
      display: flex;
      align-items: center;
      justify-content: space-between;
    }
    .active-theme-banner button {
      background: rgba(255,255,255,0.2);
      border: none;
      color: #fff;
      padding: 3px 10px;
      border-radius: 6px;
      cursor: pointer;
      font-size: 0.8125rem;
    }

    /* ── Submissions layout ─────────────────────────────────────── */
    .submissions-layout {
      display: grid;
      grid-template-columns: 340px 1fr;
      gap: 16px;
      align-items: start;
    }
    @media (max-width: 900px) {
      .submissions-layout { grid-template-columns: 1fr; }
    }

    /* ── Submission list ────────────────────────────────────────── */
    .submission-list {
      max-height: 600px;
      overflow-y: auto;
    }
    .submission-item {
      padding: 12px 14px;
      border-radius: 8px;
      cursor: pointer;
      border-bottom: 1px solid var(--border);
      transition: background var(--transition);
    }
    .submission-item:last-child { border-bottom: none; }
    .submission-item:hover { background: var(--brand-light); }
    .submission-item.active {
      background: var(--brand-light);
      border-left: 3px solid var(--brand);
    }
    .submission-item-location {
      font-weight: 600;
      font-size: 0.9375rem;
      color: var(--text);
    }
    .submission-item-meta {
      font-size: 0.8125rem;
      color: var(--muted);
      margin-top: 3px;
    }
    .submission-item-badges {
      margin-top: 6px;
      display: flex;
      gap: 6px;
      flex-wrap: wrap;
    }

    /* ── Submission detail ──────────────────────────────────────── */
    .detail-empty {
      display: flex;
      align-items: center;
      justify-content: center;
      min-height: 300px;
      color: var(--muted);
      font-size: 0.9375rem;
      text-align: center;
    }
    /* ── Detail section jump nav ───────────────────────────────── */
    .detail-jump-nav {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      padding: 10px 14px;
      background: var(--brand-light);
      border-radius: 8px;
      margin-bottom: 16px;
    }
    .detail-jump-btn {
      font-size: 0.75rem;
      font-weight: 600;
      padding: 3px 10px;
      border-radius: 20px;
      border: 1.5px solid var(--brand);
      background: transparent;
      color: var(--brand);
      cursor: pointer;
      white-space: nowrap;
      transition: background 0.12s, color 0.12s;
    }
    .detail-jump-btn:hover { background: var(--brand); color: #fff; }

    /* ── Collapsible detail sections ───────────────────────────── */
    .detail-section { margin-bottom: 4px; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
    .detail-section-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 10px 14px;
      cursor: pointer;
      background: #f8fafb;
      user-select: none;
      transition: background 0.12s;
    }
    .detail-section-header:hover { background: var(--brand-light); }
    .detail-section-title {
      font-size: 0.8125rem;
      font-weight: 700;
      color: var(--brand);
      text-transform: uppercase;
      letter-spacing: 0.05em;
      margin: 0;
      border: none;
      padding: 0;
    }
    .detail-section-chevron {
      font-size: 0.75rem;
      color: var(--muted);
      transition: transform 0.2s;
    }
    .detail-section.open .detail-section-chevron { transform: rotate(180deg); }
    .detail-section-body {
      display: none;
      padding: 14px;
    }
    .detail-section.open .detail-section-body { display: block; }
    .detail-meta-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
      font-size: 0.875rem;
    }
    .detail-meta-label { color: var(--muted); }
    .detail-meta-value { font-weight: 500; }
    .audio-row { margin-bottom: 10px; }
    .audio-label {
      font-size: 0.8125rem;
      font-weight: 600;
      color: var(--text-2);
      margin-bottom: 4px;
    }
    audio { width: 100%; border-radius: 8px; }
    .transcript-box {
      background: var(--bg);
      border-radius: 8px;
      padding: 14px;
      font-size: 0.875rem;
      line-height: 1.6;
      color: var(--text-2);
      max-height: 200px;
      overflow-y: auto;
    }
    .transcript-tabs {
      display: flex;
      gap: 8px;
      margin-bottom: 10px;
    }
    .transcript-tab {
      padding: 5px 14px;
      border-radius: 6px;
      border: 1px solid var(--border);
      background: transparent;
      color: var(--muted);
      font-size: 0.8125rem;
      cursor: pointer;
    }
    .transcript-tab.active {
      background: var(--brand-light);
      border-color: var(--accent);
      color: var(--brand-dark);
      font-weight: 600;
    }

    /* Top-level detail tabs (Intro / Conversation / Exit / Listener Notes /
       Analysis). Sits above the per-submission content blocks; only one
       panel visible at a time so researchers don't have to scroll long
       transcripts to find the section they want. */
    .detail-tabs {
      display: flex;
      gap: 4px;
      margin: 14px 0 0;
      padding: 4px;
      background: #F1F5F9;
      border-radius: 10px;
      overflow-x: auto;
      flex-wrap: nowrap;
    }
    .detail-tab {
      flex: 1 1 auto;
      min-width: max-content;
      padding: 8px 14px;
      border: none;
      border-radius: 7px;
      background: transparent;
      color: var(--text-2);
      font-size: 0.875rem;
      font-weight: 500;
      cursor: pointer;
      white-space: nowrap;
      transition: background 0.12s, color 0.12s;
    }
    .detail-tab:hover { background: #E2E8F0; }
    .detail-tab.active {
      background: #fff;
      color: var(--brand-dark);
      font-weight: 600;
      box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    }
    .detail-tab .detail-tab-badge {
      display: inline-block;
      margin-left: 4px;
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: var(--accent);
      vertical-align: middle;
    }
    .detail-panel { display: none; padding-top: 16px; }
    .detail-panel.active { display: block; }
    .detail-panel-empty {
      padding: 28px 16px;
      text-align: center;
      color: var(--muted);
      font-size: 0.875rem;
      background: #F8FAFC;
      border-radius: 8px;
      border: 1px dashed var(--border);
    }
    .detail-panel-section { margin-bottom: 20px; }
    .detail-panel-section:last-child { margin-bottom: 0; }
    .detail-panel-section-label {
      font-size: 0.75rem;
      font-weight: 700;
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: 0.05em;
      margin-bottom: 8px;
    }
    .analysis-category { margin-bottom: 12px; }
    .analysis-category-name {
      font-size: 0.8125rem;
      font-weight: 600;
      color: var(--text-2);
      margin-bottom: 6px;
    }
    .analysis-items {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
    }
    .analysis-chip {
      background: var(--brand-light);
      color: var(--brand-dark);
      padding: 3px 10px;
      border-radius: 999px;
      font-size: 0.8125rem;
    }
    .analysis-chip.flag {
      background: #FEE2E2;
      color: #991B1B;
    }
    /* ── Conversation (diarised) view ──────────────────────────── */
    .convo-box {
      background: var(--bg);
      border-radius: 8px;
      padding: 14px;
      max-height: 400px;
      overflow-y: auto;
      display: flex;
      flex-direction: column;
      gap: 12px;
    }
    .utterance { display: flex; flex-direction: column; gap: 2px; }
    .utterance-header {
      display: flex;
      align-items: baseline;
      gap: 8px;
    }
    .utterance-speaker {
      font-size: 0.6875rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.07em;
    }
    .utterance-speaker.listener        { color: var(--muted); }
    .utterance-speaker.communityMember { color: var(--brand-dark); }
    .utterance-time {
      font-size: 0.6875rem;
      color: var(--muted);
    }
    .utterance-text {
      font-size: 0.875rem;
      line-height: 1.6;
      color: var(--text-2);
      padding: 6px 10px;
      border-radius: 6px;
      background: white;
    }
    .utterance.communityMember .utterance-text {
      background: var(--brand-light);
      color: var(--brand-dark);
    }

    .wellbeing-flag-btn {
      padding: 8px 16px;
      border-radius: 8px;
      border: 1px solid var(--border);
      cursor: pointer;
      font-size: 0.875rem;
      font-weight: 500;
      transition: all var(--transition);
    }
    .wellbeing-flag-btn.flagged {
      background: #FEF2F2;
      border-color: var(--danger);
      color: var(--danger);
    }
    /* ── Manual tag chips ──────────────────────────────────── */
    .manual-tag-chip {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      background: #EFF6FF;
      color: #1E40AF;
      border: 1px solid #BFDBFE;
      padding: 3px 10px 3px 10px;
      border-radius: 999px;
      font-size: 0.8125rem;
      font-weight: 500;
    }
    .manual-tag-chip button {
      background: none;
      border: none;
      cursor: pointer;
      color: #93C5FD;
      font-size: 0.875rem;
      line-height: 1;
      padding: 0;
      transition: color var(--transition);
    }
    .manual-tag-chip button:hover { color: #1E40AF; }
    .manual-tag-input-row {
      display: flex;
      gap: 8px;
      margin-top: 8px;
    }
    .manual-tag-input {
      flex: 1;
      padding: 6px 10px;
      border: 1px solid var(--border);
      border-radius: 8px;
      font-size: 0.875rem;
      color: var(--text);
      background: var(--surface);
      outline: none;
      transition: border-color var(--transition);
    }
    .manual-tag-input:focus { border-color: var(--brand); }
    .manual-tag-add-btn {
      padding: 6px 14px;
      background: var(--brand);
      color: #fff;
      border: none;
      border-radius: 8px;
      font-size: 0.875rem;
      font-weight: 500;
      cursor: pointer;
      transition: background var(--transition);
    }
    .manual-tag-add-btn:hover { background: var(--brand-dark); }
    .exit-form-box {
      background: var(--bg);
      border-radius: 8px;
      padding: 14px;
      font-size: 0.875rem;
      line-height: 1.6;
    }
    .exit-form-field { margin-bottom: 10px; }
    .exit-form-field-label {
      font-size: 0.8125rem;
      font-weight: 600;
      color: var(--muted);
      margin-bottom: 3px;
    }
    .exit-survey-subsection {
      margin-top: 16px;
      padding-top: 14px;
      border-top: 1px solid var(--border);
    }
    .exit-survey-subsection-title {
      font-size: 0.75rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      color: var(--brand);
      margin-bottom: 10px;
    }
    .exit-survey-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px 20px;
    }
    .exit-survey-chips {
      display: flex;
      flex-wrap: wrap;
      gap: 5px;
      margin-top: 3px;
    }
    .exit-survey-chip {
      display: inline-block;
      padding: 2px 10px;
      border-radius: 20px;
      background: var(--brand-pale, #e8f5f2);
      color: var(--brand-dark);
      font-size: 0.8rem;
      font-weight: 500;
    }

    /* ── Quotes ─────────────────────────────────────────────────── */
    .quote {
      background: var(--card);
      padding: 14px 16px 14px 22px;
      border-radius: 8px;
      font-style: italic;
      border-left: 4px solid var(--accent);
      margin-bottom: 10px;
      font-size: 0.9rem;
      color: var(--text-2);
      position: relative;
    }

    /* ── Location list ──────────────────────────────────────────── */
    .location-item {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 9px 12px;
      border-radius: 8px;
      cursor: pointer;
      border-bottom: 1px solid var(--border);
      font-size: 0.9rem;
      transition: background var(--transition);
    }
    .location-item:last-child { border-bottom: none; }
    .location-item:hover { background: var(--bg); }
    .location-item.active {
      background: var(--brand-light);
      border-left: 3px solid var(--brand);
      font-weight: 600;
    }

    /* ── Map ────────────────────────────────────────────────────── */
    #map { height: 450px; border-radius: 8px; }

    /* ── Headline / Insight banner ──────────────────────────────── */
    .insight-banner {
      background: linear-gradient(135deg, var(--brand-dark), var(--brand));
      color: #fff;
      padding: 20px 24px;
      border-radius: var(--radius);
      margin-bottom: 16px;
    }
    .insight-banner-label { font-size: 0.875rem; opacity: 0.8; margin-bottom: 6px; }
    .insight-banner-headline { font-size: 1.4rem; font-weight: 700; line-height: 1.4; }

    /* ── Report output ──────────────────────────────────────────── */
    .report-output {
      background: var(--bg);
      padding: 20px;
      border-radius: 8px;
      border-left: 4px solid var(--brand);
      line-height: 1.7;
      font-size: 0.9rem;
      max-height: 500px;
      overflow-y: auto;
    }

    /* ── Presentation mode ──────────────────────────────────────── */
    .presentation-mode .card { display: none; }
    .presentation-mode .collapsible-card { display: none; }
    .presentation-mode .insight-banner { display: block; }
    .presentation-mode .card.slide { display: block; }
    .presentation-mode .collapsible-card.slide { display: block; }
    /* In presentation mode, force slide collapsibles open */
    .presentation-mode .collapsible-card.slide .collapsible-body { display: block; }
    .presentation-mode .collapsible-card.slide .collapsible-header { display: none; }
    .presentation-mode .card.slide,
    .presentation-mode .collapsible-card.slide {
      border-left: 6px solid var(--brand);
      background: var(--card);
      padding: 24px;
      border-radius: 14px;
      margin-bottom: 20px;
    }
    .presentation-mode .container { max-width: 900px; }
    .presentation-mode .insight-banner-headline { font-size: 2rem; }
    .presentation-mode #map { height: 80vh; }

    /* ── Dashboard tabs ────────────────────────────────────────────
       Same visual pattern as the PowerShare Analytics tabs, retuned to the
       dashboard's green brand palette. The strip lives between the filter
       cards and the panel content. Each .dash-panel groups a related set of
       sections; clicking a tab swaps which panel is visible. */
    .dash-tabs {
      display: flex;
      gap: 0;
      background: var(--card);
      border-radius: var(--radius);
      box-shadow: var(--shadow);
      padding: 0 12px;
      margin-bottom: 16px;
      overflow-x: auto;
      border: 1px solid var(--border);
    }
    .dash-tab {
      background: none;
      border: none;
      border-bottom: 3px solid transparent;
      padding: 12px 18px;
      font-size: 0.875rem;
      font-weight: 600;
      color: var(--muted);
      cursor: pointer;
      font-family: inherit;
      transition: color 0.12s, border-color 0.12s;
      margin-bottom: -1px;
      white-space: nowrap;
      display: inline-flex;
      align-items: center;
      gap: 6px;
    }
    .dash-tab:hover { color: var(--brand-dark); }
    .dash-tab.active { color: var(--brand); border-bottom-color: var(--brand); }
    .dash-panel[hidden] { display: none; }
    /* In presentation mode the tab strip is irrelevant — the slide system
       takes over and cycles through .card.slide elements directly. Force every
       .dash-panel visible so the slides inside the Insights panel are
       reachable regardless of which tab was active. */
    .presentation-mode .dash-tabs { display: none; }
    .presentation-mode .dash-panel[hidden] { display: block; }

    /* ── Listener performance ──────────────────────────────────── */
    .lp-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 0.875rem;
    }
    .lp-table th {
      text-align: left;
      padding: 8px 12px;
      font-size: 0.75rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      color: var(--muted);
      border-bottom: 2px solid var(--border);
      cursor: pointer;
      user-select: none;
      white-space: nowrap;
    }
    .lp-table th:hover { color: var(--brand); }
    .lp-table th .sort-arrow { margin-left: 4px; opacity: 0.4; }
    .lp-table th.sorted .sort-arrow { opacity: 1; color: var(--brand); }
    .lp-table td {
      padding: 10px 12px;
      border-bottom: 1px solid var(--border);
      color: var(--text-2);
      vertical-align: top;
    }
    .lp-table tr:last-child td { border-bottom: none; }
    .lp-table tr:hover td { background: var(--bg); }
    .lp-name {
      font-weight: 600;
      color: var(--text);
    }
    .lp-bar-wrap {
      background: var(--border);
      border-radius: 999px;
      height: 6px;
      margin-top: 4px;
      overflow: hidden;
      min-width: 60px;
    }
    .lp-bar {
      height: 100%;
      border-radius: 999px;
      background: var(--brand);
      transition: width 0.4s ease;
    }
    .lp-bar.danger  { background: var(--danger); }
    .lp-bar.warning { background: var(--warning); }
    .lp-pill {
      display: inline-block;
      padding: 2px 8px;
      border-radius: 999px;
      font-size: 0.75rem;
      font-weight: 600;
    }
    .lp-pill.green  { background: var(--brand-light); color: var(--brand-dark); }
    .lp-pill.amber  { background: #FEF3C7; color: #92400E; }
    .lp-pill.red    { background: #FEE2E2; color: #991B1B; }
    .lp-location-chips { display: flex; flex-wrap: wrap; gap: 4px; }
    .lp-location-chip {
      background: var(--bg);
      border: 1px solid var(--border);
      border-radius: 6px;
      padding: 1px 7px;
      font-size: 0.75rem;
      color: var(--text-2);
    }
    .lp-sort-bar {
      display: flex;
      gap: 8px;
      align-items: center;
      margin-bottom: 14px;
      flex-wrap: wrap;
    }
    .lp-sort-label {
      font-size: 0.75rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      color: var(--muted);
    }
    /* ── Phase filter bar ───────────────────────────────────────── */
    .phase-filter-bar {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
    }
    .phase-filter-label {
      font-size: 0.75rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      color: var(--muted);
    }
    .phase-btn {
      border: 1px solid var(--border);
      background: var(--surface);
      color: var(--text-2);
      border-radius: 999px;
      padding: 4px 14px;
      font-size: 0.8125rem;
      font-weight: 500;
      cursor: pointer;
      transition: background 0.15s, color 0.15s, border-color 0.15s;
    }
    .phase-btn:hover { border-color: var(--brand); color: var(--brand); }
    .phase-btn.active { background: var(--brand); color: #fff; border-color: var(--brand); font-weight: 600; }
    .phase-locked-badge {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      background: #FEF3C7;
      color: #92400E;
      border: 1px solid #F59E0B;
      border-radius: 6px;
      padding: 4px 10px;
      font-size: 0.8125rem;
      font-weight: 600;
    }
    /* ── Platform Control (superadmin only) ─────────────────────── */
    .platform-control-section {
      background: #0F172A;
      border: 2px solid #334155;
      border-radius: var(--radius);
      padding: 24px;
      margin-bottom: 20px;
    }
    .platform-control-title {
      color: #F8FAFC;
      font-size: 1rem;
      font-weight: 700;
      margin-bottom: 4px;
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .platform-control-subtitle {
      color: #94A3B8;
      font-size: 0.8125rem;
      margin-bottom: 20px;
    }
    .pc-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 0.875rem;
      color: #E2E8F0;
    }
    .pc-table th {
      text-align: left;
      padding: 8px 12px;
      font-size: 0.75rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.04em;
      color: #94A3B8;
      border-bottom: 1px solid #334155;
    }
    .pc-table td {
      padding: 10px 12px;
      border-bottom: 1px solid #1E293B;
      vertical-align: middle;
    }
    .pc-table tr:last-child td { border-bottom: none; }
    .pc-table tr:hover td { background: rgba(255,255,255,0.03); }
    .pc-select, .pc-input {
      background: #1E293B;
      border: 1px solid #334155;
      color: #E2E8F0;
      border-radius: 6px;
      padding: 5px 8px;
      font-size: 0.8125rem;
    }
    .pc-select:focus, .pc-input:focus { outline: none; border-color: #52B788; }
    .pc-save-btn {
      background: #1B4332;
      border: 1px solid #2D6A4F;
      color: #D8F3DC;
      border-radius: 6px;
      padding: 5px 12px;
      font-size: 0.8125rem;
      cursor: pointer;
      transition: background 0.15s;
    }
    .pc-save-btn:hover { background: #2D6A4F; }
    .pc-saved-tick { color: #52B788; font-size: 0.8125rem; margin-left: 6px; display: none; }
    .pc-role-badge {
      display: inline-block;
      padding: 2px 8px;
      border-radius: 999px;
      font-size: 0.7rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }
    .pc-role-superadmin  { background: #F59E0B; color: #000; }
    .pc-role-admin      { background: #1E3A5F; color: #93C5FD; }
    .pc-role-researcher { background: #1E3A2F; color: #86EFAC; }
    .pc-role-collaborator { background: #2D1F3D; color: #C4B5FD; }
    /* Role-gated nav links use the standard white nav-link styling — they
       were previously highlighted in amber but that made them visually
       inconsistent with the everyday tabs. Hide/show is driven by the
       .superadmin-only / .admin-only classes via JS. */
    /* ── Workshops section (admin + superadmin) ─────────────────── */
    .workshops-section {
      background: #0F172A;
      border: 2px solid #92400E;
      border-radius: var(--radius);
      padding: 24px;
      margin-bottom: 20px;
    }
    .workshops-title {
      color: #FEF3C7;
      font-size: 1rem;
      font-weight: 700;
      margin-bottom: 4px;
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .workshops-subtitle {
      color: #FCD34D;
      font-size: 0.8125rem;
      margin-bottom: 20px;
      opacity: 0.8;
    }
    .workshops-create-btn {
      background: #92400E;
      border: 1px solid #B45309;
      color: #FEF3C7;
      border-radius: 6px;
      padding: 7px 16px;
      font-size: 0.875rem;
      font-weight: 600;
      cursor: pointer;
      margin-bottom: 16px;
    }
    .workshops-create-btn:hover { background: #B45309; }
    .workshops-empty {
      color: #94A3B8;
      font-size: 0.875rem;
      padding: 16px 0;
      font-style: italic;
    }
    .workshop-row {
      border: 1px solid #334155;
      border-radius: 8px;
      margin-bottom: 10px;
      overflow: hidden;
      background: #1E293B;
    }
    .workshop-row-header {
      padding: 12px 14px;
      display: grid;
      grid-template-columns: 24px 1fr auto auto auto auto;
      gap: 12px;
      align-items: center;
      cursor: pointer;
      color: #E2E8F0;
      font-size: 0.875rem;
    }
    .workshop-row-header:hover { background: #273548; }
    .workshop-row-toggle {
      color: #94A3B8;
      transition: transform 0.15s;
    }
    .workshop-row.expanded .workshop-row-toggle { transform: rotate(90deg); }
    .workshop-row-name { font-weight: 600; }
    .workshop-row-code {
      font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
      background: #0F172A;
      padding: 3px 8px;
      border-radius: 4px;
      color: #FCD34D;
      font-size: 0.8125rem;
      letter-spacing: 0.5px;
    }
    .workshop-row-meta {
      color: #94A3B8;
      font-size: 0.8125rem;
      white-space: nowrap;
    }
    .workshop-row-meta.expired { color: #F87171; }
    .workshop-row-count {
      background: #0F172A;
      padding: 3px 10px;
      border-radius: 999px;
      font-size: 0.75rem;
      color: #93C5FD;
      font-weight: 600;
    }
    .workshop-row-delete {
      background: transparent;
      border: 1px solid #475569;
      color: #94A3B8;
      border-radius: 6px;
      padding: 4px 10px;
      font-size: 0.75rem;
      cursor: pointer;
    }
    .workshop-row-delete:hover { background: #7F1D1D; border-color: #B91C1C; color: #FCA5A5; }
    .workshop-row-body {
      display: none;
      padding: 8px 14px 14px;
      border-top: 1px solid #334155;
      background: #0F172A;
    }
    .workshop-row.expanded .workshop-row-body { display: block; }
    .workshop-sub-row {
      display: grid;
      grid-template-columns: 1fr auto auto;
      gap: 10px;
      padding: 8px 4px;
      align-items: center;
      color: #CBD5E1;
      font-size: 0.8125rem;
      border-bottom: 1px solid #1E293B;
    }
    .workshop-sub-row:last-child { border-bottom: none; }
    .workshop-sub-link {
      background: transparent;
      border: 1px solid #334155;
      color: #93C5FD;
      border-radius: 6px;
      padding: 3px 10px;
      font-size: 0.75rem;
      cursor: pointer;
    }
    .workshop-sub-link:hover { border-color: #93C5FD; }
    .workshop-status-pill {
      display: inline-block;
      padding: 2px 8px;
      border-radius: 999px;
      font-size: 0.7rem;
      font-weight: 600;
      text-transform: uppercase;
    }
    .workshop-status-pill.processed   { background: #1E3A2F; color: #86EFAC; }
    .workshop-status-pill.pending     { background: #422006; color: #FDBA74; }
    .workshop-status-pill.transcribing,
    .workshop-status-pill.analysing   { background: #1E3A5F; color: #93C5FD; }
    .workshop-status-pill.error       { background: #7F1D1D; color: #FCA5A5; }
    /* ── Impersonation banner ───────────────────────────────────── */
    .impersonation-banner {
      position: sticky;
      top: 0;
      z-index: 200;
      background: #7C3AED;
      color: #fff;
      padding: 10px 24px;
      display: flex;
      align-items: center;
      gap: 12px;
      font-size: 0.875rem;
      font-weight: 600;
      box-shadow: 0 2px 8px rgba(124,58,237,0.4);
    }
    .impersonation-banner-label { flex: 1; }
    .impersonation-banner-note {
      font-weight: 400;
      opacity: 0.85;
      font-size: 0.8rem;
    }
    .btn-exit-impersonation {
      background: rgba(255,255,255,0.2);
      border: 1px solid rgba(255,255,255,0.4);
      color: #fff;
      padding: 5px 14px;
      border-radius: 7px;
      cursor: pointer;
      font-size: 0.8125rem;
      font-weight: 700;
      transition: background 0.15s;
    }
    .btn-exit-impersonation:hover { background: rgba(255,255,255,0.35); }
    .pc-view-btn {
      background: #2D1F3D;
      border: 1px solid #7C3AED;
      color: #C4B5FD;
      border-radius: 6px;
      padding: 5px 12px;
      font-size: 0.8125rem;
      cursor: pointer;
      margin-left: 6px;
      transition: background 0.15s;
    }
    .pc-view-btn:hover { background: #3B1F5A; }
    /* ── Listener meta inline controls ─────────────────────────── */
    .lp-meta-select, .lp-meta-input {
      font-size: 0.8125rem;
      border: 1px solid var(--border);
      border-radius: 6px;
      padding: 3px 7px;
      background: var(--surface);
      color: var(--text);
      width: 100%;
      min-width: 90px;
    }
    .lp-meta-select:focus, .lp-meta-input:focus {
      outline: none;
      border-color: var(--brand);
    }
    .lp-row-excluded td { opacity: 0.45; }
    .lp-row-excluded td:last-child { opacity: 1; }
    .lp-toggle-btn {
      border: none;
      border-radius: 999px;
      padding: 3px 12px;
      font-size: 0.75rem;
      font-weight: 600;
      cursor: pointer;
      white-space: nowrap;
      transition: background 0.15s, color 0.15s;
    }
    .lp-toggle-included {
      background: var(--brand-light);
      color: var(--brand-dark);
    }
    .lp-toggle-included:hover { background: #b2dfdb; }
    .lp-toggle-excluded {
      background: #FEE2E2;
      color: #991B1B;
    }
    .lp-toggle-excluded:hover { background: #fecaca; }

    /* ── Analytics panel ────────────────────────────────────────── */
    .analytics-stat { margin-bottom: 6px; font-size: 0.9rem; }

    /* ── Section spacing ────────────────────────────────────────── */
    .section { margin-bottom: 16px; }

    /* ── Location breakdown ─────────────────────────────────────── */
    .loc-row {
      display: grid;
      grid-template-columns: 1fr auto;
      gap: 12px;
      align-items: start;
      padding: 14px 0;
      border-bottom: 1px solid var(--border);
      cursor: pointer;
      transition: background var(--transition);
      border-radius: 6px;
    }
    .loc-row:last-child { border-bottom: none; }
    .loc-row:hover { background: var(--bg); padding-left: 8px; }
    .loc-row.active { background: var(--brand-light); padding-left: 8px; border-left: 3px solid var(--brand); }
    .loc-name {
      font-weight: 700;
      font-size: 0.9375rem;
      color: var(--text);
      margin-bottom: 5px;
    }
    .loc-meta {
      font-size: 0.8125rem;
      color: var(--muted);
      margin-bottom: 7px;
    }
    .loc-themes { display: flex; flex-wrap: wrap; gap: 5px; }
    .loc-theme-chip {
      background: var(--bg);
      border: 1px solid var(--border);
      border-radius: 999px;
      padding: 2px 9px;
      font-size: 0.75rem;
      color: var(--text-2);
    }
    .loc-theme-chip.barrier {
      background: #FEF3C7;
      border-color: #FDE68A;
      color: #92400E;
    }
    .loc-count {
      text-align: right;
      min-width: 60px;
    }
    .loc-count-num {
      font-size: 1.5rem;
      font-weight: 700;
      color: var(--brand);
      line-height: 1;
    }
    .loc-count-pct {
      font-size: 0.75rem;
      color: var(--muted);
      margin-top: 3px;
    }
    .loc-bar-wrap {
      height: 4px;
      background: var(--border);
      border-radius: 2px;
      margin-top: 8px;
      overflow: hidden;
    }
    .loc-bar {
      height: 100%;
      background: var(--accent);
      border-radius: 2px;
    }

    /* ── User Management ────────────────────────────────────────── */
    .um-section { display: none !important; }
    .um-section.visible { display: block !important; }

    .um-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
    .um-table th {
      text-align: left;
      font-size: 0.75rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.06em;
      color: var(--muted);
      padding: 8px 10px;
      border-bottom: 2px solid var(--border);
    }
    .um-table td {
      padding: 10px;
      border-bottom: 1px solid var(--border);
      vertical-align: middle;
    }
    .um-table tr:last-child td { border-bottom: none; }
    .um-table tr:hover td { background: var(--bg); }
    .um-disabled td { opacity: 0.45; }

    .role-pill {
      display: inline-block;
      padding: 2px 10px;
      border-radius: 999px;
      font-size: 0.75rem;
      font-weight: 600;
    }
    .role-superadmin   { background: #F59E0B; color: #000; font-weight: 700; }
    .role-listener     { background: var(--brand-light); color: var(--brand-dark); }
    .role-researcher   { background: #DBEAFE; color: #1E40AF; }
    .role-admin        { background: #EDE9FE; color: #5B21B6; }
    .role-collaborator { background: #F3F4F6; color: var(--muted); }

    .um-actions { display: flex; gap: 6px; }
    .btn-sm {
      padding: 4px 10px;
      border-radius: 6px;
      border: 1px solid var(--border);
      background: var(--card);
      color: var(--text-2);
      cursor: pointer;
      font-size: 0.8125rem;
      font-weight: 500;
      transition: all var(--transition);
    }
    .btn-sm:hover { border-color: var(--accent); color: var(--brand); }
    .btn-sm.danger { border-color: #FECACA; color: var(--danger); }
    .btn-sm.danger:hover { background: #FEE2E2; }
    .btn-sm.success { border-color: #A7F3D0; color: #065F46; }
    .btn-sm.success:hover { background: #D1FAE5; }

    /* Create / edit user modal */
    .um-modal-backdrop {
      position: fixed;
      inset: 0;
      background: rgba(0,0,0,0.45);
      z-index: 1000;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .um-modal {
      background: var(--card);
      border-radius: var(--radius);
      box-shadow: 0 8px 40px rgba(0,0,0,0.18);
      padding: 28px;
      width: 420px;
      max-width: 96vw;
    }
    .um-modal-title {
      font-size: 1.05rem;
      font-weight: 700;
      margin-bottom: 20px;
      color: var(--text);
    }
    .um-form-group { margin-bottom: 14px; }
    .um-form-label {
      display: block;
      font-size: 0.8125rem;
      font-weight: 600;
      color: var(--text-2);
      margin-bottom: 5px;
    }
    .um-form-input, .um-form-select {
      width: 100%;
      padding: 9px 12px;
      border-radius: 8px;
      border: 1px solid var(--border);
      font-size: 0.875rem;
      color: var(--text);
      background: var(--card);
      transition: border-color var(--transition);
    }
    .um-form-input:focus, .um-form-select:focus {
      outline: none;
      border-color: var(--accent);
      box-shadow: 0 0 0 3px rgba(82,183,136,0.15);
    }
    .um-modal-actions {
      display: flex;
      gap: 10px;
      justify-content: flex-end;
      margin-top: 20px;
    }
    .um-msg {
      padding: 8px 12px;
      border-radius: 8px;
      font-size: 0.8125rem;
      margin-bottom: 12px;
    }
    .um-msg.success { background: var(--brand-light); color: var(--brand-dark); }
    .um-msg.error   { background: #FEE2E2; color: #991B1B; }

