
    :root {
      --bg-dark: #0a0a0f;
      --bg-panel: #12121a;
      --bg-card: #1a1a25;
      --border: #2a2a3a;
      --red: #ff3b3b;
      --red-glow: rgba(255, 59, 59, 0.3);
      --amber: #ffb830;
      --amber-glow: rgba(255, 184, 48, 0.3);
      --blue: #3b8bff;
      --gray: #9aa0aa;
      --green: #00ff88;
      --text: #e8e8f0;
      --text-dim: #8888aa;
      --fire: #ff6b35;
      --medical: #ff3b6b;
      --police: #3b8bff;
      --sheriff: #9b59b6;
      --header-height: 100px;
    }
    
    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }
    
    body {
      font-family: 'JetBrains Mono', monospace;
      background: var(--bg-dark);
      color: var(--text);
      min-height: 100vh;
      overflow-x: hidden;
    }
    
    .header {
      background: linear-gradient(180deg, var(--bg-panel) 0%, transparent 100%);
      padding: 20px 30px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      border-bottom: 1px solid var(--border);
      position: relative;
    }
    
    .header::after {
      content: '';
      position: absolute;
      bottom: 0;
      left: 0;
      right: 0;
      height: 1px;
      background: linear-gradient(90deg, transparent, var(--red), transparent);
      animation: none;
    }
    
    @keyframes pulse-line {
      0%, 100% { opacity: 0.3; }
      50% { opacity: 1; }
    }
    
    .logo {
      display: flex;
      align-items: center;
      gap: 15px;
    }
    
    .logo-icon {
      width: 62px;
      height: 62px;
      border-radius: 50%;
      overflow: hidden;
      background: rgba(0,0,0,0.25);
      border: 1px solid rgba(255, 255, 255, 0.10);
      box-shadow: 0 0 30px rgba(255, 59, 59, 0.12);
      animation: none;
      display: block;
    }
    
    .logo-icon-img {
      width: 100%;
      height: 100%;
      display: block;
      object-fit: contain;
    }
    
    @keyframes logo-pulse {
      0%, 100% { box-shadow: 0 0 20px var(--red-glow); }
      50% { box-shadow: 0 0 40px var(--red-glow), 0 0 60px var(--red-glow); }
    }
    
    .logo-text h1 {
      font-family: 'Space Grotesk', sans-serif;
      font-size: 28px;
      font-weight: 700;
      background: linear-gradient(90deg, var(--text), var(--red));
      background-clip: text;
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      letter-spacing: 2px;
    }
    
    .logo-text p {
      font-size: 11px;
      color: var(--text-dim);
      letter-spacing: 3px;
      text-transform: uppercase;
    }

    
    .status-bar {
      display: flex;
      gap: 25px;
      align-items: center;
    }
    
    .status-item {
      display: flex;
      flex-direction: column;
      align-items: flex-end;
    }
    
    .status-label {
      font-size: 10px;
      color: var(--text-dim);
      text-transform: uppercase;
      letter-spacing: 1px;
    }
    
    .status-value {
      font-size: 18px;
      font-weight: 600;
    }
    
    .status-value.live {
      color: var(--red);
      animation: none;
    }
    
    .map-theme-toggle,
    .location-btn {
      padding: 8px 10px;
      border-radius: 10px;
      border: 1px solid var(--border);
      background: linear-gradient(180deg, rgba(26, 26, 37, 0.95), rgba(26, 26, 37, 0.65));
      color: var(--text);
      font-size: 14px;
      font-family: 'JetBrains Mono', monospace;
      cursor: pointer;
      transition: all 0.2s ease;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 42px;
      height: 32px;
    }
    
    .map-theme-toggle:hover,
    .location-btn:hover {
      border-color: var(--text-dim);
      color: var(--red);
      box-shadow: 0 0 18px rgba(255, 59, 59, 0.1);
      transform: translateY(-1px);
    }
    
    .map-theme-toggle .map-theme-icon {
      font-size: 16px;
      line-height: 1;
    }

    .location-btn .map-location-icon {
      font-size: 16px;
      line-height: 1;
    }

    .location-btn.locating {
      border-color: rgba(255, 184, 48, 0.55);
      color: var(--amber);
      box-shadow: 0 0 18px rgba(255, 184, 48, 0.15);
    }

    .location-btn.active {
      border-color: rgba(59, 139, 255, 0.6);
      color: var(--blue);
      box-shadow: 0 0 18px rgba(59, 139, 255, 0.2);
    }

    .location-btn.error {
      border-color: rgba(255, 59, 59, 0.65);
      color: var(--red);
      box-shadow: 0 0 18px rgba(255, 59, 59, 0.18);
    }
    
    @keyframes blink {
      0%, 100% { opacity: 1; }
      50% { opacity: 0.5; }
    }
    
    .live-dot {
      display: inline-block;
      width: 8px;
      height: 8px;
      background: var(--red);
      border-radius: 50%;
      margin-right: 8px;
      animation: none;
    }
    
    @keyframes live-pulse {
      0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 var(--red-glow); }
      50% { transform: scale(1.2); box-shadow: 0 0 10px 5px var(--red-glow); }
    }
    
    .main-container {
      display: grid;
      grid-template-columns: 1fr 400px;
      height: calc(100vh - var(--header-height));
      min-height: 0;
    }
    
    .map-container {
      position: relative;
      background: var(--bg-panel);
    }
    
    #map {
      height: 100%;
      width: 100%;
      background: #0a0a12;
    }
    
    .legend-container {
      position: absolute;
      top: 20px;
      left: 20px;
      z-index: 1000;
    }
    
    .dot-stack {
      display: grid;
      gap: 6px;
      justify-items: center;
    }
    
    .dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      box-shadow:
        0 0 0 2px rgba(0,0,0,0.30),
        0 0 10px rgba(0,0,0,0.25);
    }
    
    .legend-collapse {
      position: absolute;
      top: 6px;
      right: 6px;
      width: 19px;
      height: 19px;
      border-radius: 6px;
      border: 1px solid rgba(255, 255, 255, 0.10);
      background: var(--bg-card);
      color: var(--text-dim);
      cursor: pointer;
      transition: all 0.2s ease;
      display: grid;
      place-items: center;
      font-size: 11px;
      line-height: 1;
    }
    
    .legend-collapse:hover {
      background: var(--bg-dark);
      border-color: rgba(255, 59, 59, 0.55);
      color: var(--red);
      box-shadow: 0 0 18px rgba(255, 59, 59, 0.12);
    }
    
    .map-overlay {
      background: rgba(18, 18, 26, 0.95);
      padding: 15px 20px;
      border-radius: 10px;
      border: 1px solid var(--border);
      box-shadow: 0 12px 40px rgba(0,0,0,0.4);
      width: 240px;
      transition:
        width 0.24s cubic-bezier(0.2, 0, 0, 1),
        padding 0.24s cubic-bezier(0.2, 0, 0, 1),
        border-radius 0.2s ease;
      position: relative;
      overflow: hidden;
      will-change: width, padding;
    }
    
    .legend-content {
      padding-right: 32px; /* keep space for the collapse arrow */
      max-height: 420px;
      overflow: hidden;
      opacity: 1;
      transform: translateX(0);
      visibility: visible;
      transition:
        max-height 0.18s ease 0.02s,
        opacity 0.12s ease 0.08s,
        transform 0.2s ease 0.05s,
        visibility 0s linear 0s;
    }
    
    .legend-mini {
      position: absolute;
      top: 31px;
      left: 50%;
      display: flex;
      height: auto;
      width: auto;
      padding: 0;
      justify-content: center;
      align-items: flex-start;
      opacity: 0;
      visibility: hidden;
      pointer-events: none;
      transform: translate(-50%, 6px) scale(0.95);
      transition:
        opacity 0.14s ease,
        transform 0.2s ease,
        visibility 0s linear 0.2s;
    }

    .legend-mini .dot-stack {
      gap: 4px;
    }

    .legend-mini .dot {
      width: 6px;
      height: 6px;
      box-shadow: 0 0 0 1px rgba(0,0,0,0.35);
    }
    
    .legend-container.collapsed .map-overlay {
      width: 34px;
      padding: 28px 6px 8px;
      border-radius: 12px;
      height: auto;
      min-height: 70px;
    }
    
    .legend-container.collapsed .legend-content {
      max-height: 0;
      padding-right: 0;
      opacity: 0;
      transform: translateX(-10px);
      visibility: hidden;
      pointer-events: none;
      transition:
        max-height 0.1s ease,
        opacity 0.08s ease,
        transform 0.12s ease,
        visibility 0s linear 0.12s;
    }
    
    .legend-container.collapsed .legend-mini {
      opacity: 1;
      visibility: visible;
      transform: translate(-50%, 0) scale(1);
      transition:
        opacity 0.14s ease 0.06s,
        transform 0.2s ease 0.04s,
        visibility 0s linear 0s;
    }
    
    .map-overlay h3 {
      font-size: 12px;
      color: var(--text-dim);
      margin-bottom: 10px;
      text-transform: uppercase;
      letter-spacing: 1px;
    }
    
    .legend-item {
      display: flex;
      align-items: center;
      gap: 10px;
      margin: 8px 0;
      font-size: 12px;
    }
    
    .legend-dot {
      width: 12px;
      height: 12px;
      border-radius: 50%;
    }
    
    .sidebar {
      background: var(--bg-panel);
      border-left: 1px solid var(--border);
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }

    /* Ensure the sidebar panels become real flex columns so lists can scroll */
    #live-panel,
    #history-panel {
      flex: 1;
      display: flex;
      flex-direction: column;
      min-height: 0; /* critical for nested overflow */
      overflow: hidden;
    }
    
    .tabs {
      display: flex;
      border-bottom: 1px solid var(--border);
      align-items: center;
      gap: 6px;
    }
    
    .tab {
      flex: 1;
      padding: 15px;
      text-align: center;
      font-size: 12px;
      text-transform: uppercase;
      letter-spacing: 1px;
      cursor: pointer;
      background: transparent;
      border: none;
      color: var(--text-dim);
      transition: all 0.3s ease;
      position: relative;
    }

    .panel-toggle {
      display: none;
      width: 32px;
      height: 32px;
      border-radius: 10px;
      border: 1px solid rgba(255, 255, 255, 0.12);
      background: var(--bg-card);
      color: var(--text);
      cursor: pointer;
      transition: all 0.2s ease;
      flex: 0 0 auto;
    }

    .panel-toggle:hover {
      border-color: rgba(255, 59, 59, 0.55);
      color: var(--red);
      box-shadow: 0 0 18px rgba(255, 59, 59, 0.12);
    }
    
    .tab:hover {
      color: var(--text);
      background: rgba(255,255,255,0.02);
    }
    
    .tab.active {
      color: var(--red);
    }
    
    .tab.active::after {
      content: '';
      position: absolute;
      bottom: 0;
      left: 20%;
      right: 20%;
      height: 2px;
      background: var(--red);
    }

    .source-tabs {
      display: flex;
      gap: 6px;
      padding: 8px 10px;
      border-bottom: 1px solid var(--border);
      background: var(--bg-panel);
    }

    .source-tab {
      border: 1px solid rgba(255, 255, 255, 0.14);
      background: rgba(255, 255, 255, 0.03);
      color: var(--text-dim);
      border-radius: 999px;
      padding: 6px 10px;
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: 0.7px;
      font-weight: 700;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      transition: all 0.2s ease;
    }

    .source-tab:hover {
      color: var(--text);
      border-color: rgba(255, 255, 255, 0.3);
    }

    .source-tab.active {
      color: var(--red);
      border-color: rgba(255, 59, 59, 0.45);
      box-shadow: 0 0 14px rgba(255, 59, 59, 0.16);
      background: rgba(255, 59, 59, 0.08);
    }

    .beta-pill {
      font-size: 9px;
      line-height: 1;
      padding: 3px 6px;
      border-radius: 999px;
      border: 1px solid rgba(255, 184, 48, 0.45);
      color: var(--amber);
      background: rgba(255, 184, 48, 0.12);
    }

    .source-group {
      margin-bottom: 12px;
    }

    .source-group-header {
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: 1px;
      color: var(--text-dim);
      padding: 6px 8px;
      margin-bottom: 6px;
      border: 1px solid rgba(255, 255, 255, 0.12);
      border-radius: 8px;
      background: rgba(255, 255, 255, 0.03);
    }
    
    .incident-list {
      flex: 1;
      overflow-y: auto;
      padding: 10px;
      min-height: 0; /* critical for nested overflow */
    }
    
    .incident-list::-webkit-scrollbar {
      width: 6px;
    }
    
    .incident-list::-webkit-scrollbar-track {
      background: var(--bg-dark);
    }
    
    .incident-list::-webkit-scrollbar-thumb {
      background: var(--border);
      border-radius: 3px;
    }
    
    .incident-card {
      background: var(--bg-card);
      border-radius: 10px;
      padding: 15px;
      margin-bottom: 10px;
      border: 1px solid var(--border);
      cursor: pointer;
      transition: border-color 0.14s ease, background-color 0.14s ease, opacity 0.14s ease;
      position: relative;
      overflow: hidden;
      contain: paint;
    }
    
    .incident-card::before {
      content: '';
      position: absolute;
      left: 0;
      top: 0;
      bottom: 0;
      width: 4px;
    }
    
    /* Severity-based accent (meaningful colors):
       - High: red
       - Medium: amber/yellow
       - Low: blue
    */
    .incident-card.sev-high::before { background: var(--red); }
    .incident-card.sev-medium::before { background: var(--amber); }
    .incident-card.sev-low::before { background: var(--blue); }
    .incident-card.sev-service::before { background: var(--green); }
    .incident-card.sev-medical::before {
      background: repeating-linear-gradient(
        135deg,
        rgba(255, 59, 59, 0.6) 0 6px,
        rgba(255, 255, 255, 0.4) 6px 12px
      );
    }

    .incident-card.sev-custody::before {
      background: repeating-linear-gradient(
        135deg,
        rgba(154, 160, 170, 0.9) 0 6px,
        rgba(255, 255, 255, 0.35) 6px 12px
      );
    }

    .incident-card.sev-medical {
      background-image:
        linear-gradient(180deg, rgba(255, 59, 59, 0.05), rgba(255, 59, 59, 0.015)),
        repeating-linear-gradient(
          135deg,
          rgba(255, 255, 255, 0.04) 0 10px,
          rgba(255, 59, 59, 0.08) 10px 20px
        );
      background-color: var(--bg-card);
      border-color: rgba(255, 255, 255, 0.12);
    }

    .incident-card.sev-custody {
      background-image:
        linear-gradient(180deg, rgba(154, 160, 170, 0.08), rgba(154, 160, 170, 0.02)),
        repeating-linear-gradient(
          135deg,
          rgba(255, 255, 255, 0.05) 0 12px,
          rgba(154, 160, 170, 0.10) 12px 24px
        );
      background-color: var(--bg-card);
      border-color: rgba(154, 160, 170, 0.2);
    }
    
    .incident-card:hover {
      border-color: rgba(255, 59, 59, 0.55);
      background-color: rgba(26, 26, 37, 0.98);
    }
    
    .incident-card.new {
      animation: none;
    }
    
    @keyframes new-incident {
      0% { 
        transform: translateX(-100%);
        opacity: 0;
      }
      100% { 
        transform: translateX(0);
        opacity: 1;
      }
    }
    
    .incident-header {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      margin-bottom: 10px;
    }
    
    .incident-type {
      font-size: 13px;
      font-weight: 600;
      color: var(--text);
    }
    
    .incident-time {
      font-size: 11px;
      color: var(--amber);
      background: rgba(255, 184, 48, 0.1);
      padding: 3px 8px;
      border-radius: 4px;
    }
    
    .incident-location {
      font-size: 11px;
      color: var(--text-dim);
      margin-bottom: 8px;
    }
    
    .incident-meta {
      display: flex;
      justify-content: space-between;
      align-items: center;
    }
    
    .incident-agency {
      font-size: 10px;
      padding: 3px 8px;
      border-radius: 4px;
      font-weight: 600;
    }
    
    /* Agency badge now uses severity colors (so sidebar + map match). */
    .incident-agency.sev-high { background: rgba(255, 59, 59, 0.18); color: var(--red); }
    .incident-agency.sev-medium { background: rgba(255, 184, 48, 0.18); color: var(--amber); }
    .incident-agency.sev-low { background: rgba(59, 139, 255, 0.18); color: var(--blue); }
    .incident-agency.sev-service { background: rgba(0, 255, 136, 0.18); color: var(--green); }
    .incident-agency.sev-medical {
      background: repeating-linear-gradient(
        135deg,
        rgba(255, 59, 59, 0.16) 0 8px,
        rgba(255, 255, 255, 0.08) 8px 16px
      );
      color: var(--red);
    }

    .incident-agency.sev-custody {
      background: repeating-linear-gradient(
        135deg,
        rgba(154, 160, 170, 0.25) 0 8px,
        rgba(255, 255, 255, 0.08) 8px 16px
      );
      color: var(--gray);
    }
    
    .incident-units {
      font-size: 10px;
      color: var(--text-dim);
    }
    
    .filter-bar {
      display: flex;
      flex-wrap: wrap;
      align-items: flex-start;
      gap: 8px;
      padding: 10px 7px;
      background: var(--bg-dark);
      border-bottom: 1px solid var(--border);
      flex-shrink: 0;
    }

    .filter-rows {
      display: flex;
      flex-direction: column;
      gap: 6px;
      flex: 1 1 260px;
      min-width: 0;
    }

    .filter-group {
      display: flex;
      flex-wrap: wrap;
      gap: 5px;
      align-items: center;
    }

    .filter-group[data-filter-type="urgency"] {
      padding-top: 2px;
    }

    .filter-meta {
      display: flex;
      flex-direction: column;
      gap: 6px;
      margin-left: auto;
    }
    
    .history-count {
      width: 100%;
      padding: 6px 10px;
      border-radius: 999px;
      border: 1px solid rgba(255, 255, 255, 0.12);
      background: linear-gradient(180deg, rgba(26, 26, 37, 0.95), rgba(26, 26, 37, 0.65));
      color: var(--text);
      font-size: 11px;
      font-family: 'JetBrains Mono', monospace;
      letter-spacing: 0.5px;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      white-space: nowrap;
      box-shadow: 0 0 18px rgba(0, 0, 0, 0.22);
      line-height: 1;
    }

    .history-count-label {
      font-size: clamp(8px, 1.1vw, 9px);
      color: var(--text-dim);
      text-transform: uppercase;
      letter-spacing: 1px;
    }

    .history-count strong {
      font-size: clamp(10px, 1.3vw, 12px);
      color: var(--text);
    }

    .history-count.today {
      border-color: rgba(0, 255, 136, 0.45);
      background: rgba(0, 255, 136, 0.12);
      box-shadow: 0 0 18px rgba(0, 255, 136, 0.16);
    }

    .history-count.today .history-count-label {
      color: rgba(0, 255, 136, 0.9);
    }

    .history-count.today strong {
      color: var(--green);
    }

    .history-count.incidents {
      border-color: rgba(154, 160, 170, 0.35);
      background: rgba(154, 160, 170, 0.12);
      box-shadow: 0 0 16px rgba(154, 160, 170, 0.16);
    }

    .history-count.incidents .history-count-label {
      color: rgba(154, 160, 170, 0.9);
    }

    .history-count.incidents strong {
      color: var(--gray);
    }
    
    .history-count.hidden {
      display: none !important;
    }
    
    .filter-btn {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 0;
      padding: 4px;
      font-size: 10px;
      font-family: 'JetBrains Mono', monospace;
      background: linear-gradient(180deg, rgba(26, 26, 37, 0.95), rgba(26, 26, 37, 0.65));
      border: 1px solid rgba(255, 255, 255, 0.10);
      border-radius: 8px;
      color: var(--text-dim);
      cursor: pointer;
      transition: all 0.2s ease;
    }
    
    .filter-btn:hover {
      background: var(--bg-panel);
      color: var(--text);
      border-color: var(--text-dim);
      transform: translateY(-1px);
    }
    
    .filter-btn.active {
      background: rgba(255, 59, 59, 0.16);
      border-color: rgba(255, 59, 59, 0.55);
      color: var(--text);
      box-shadow: 0 0 24px rgba(255, 59, 59, 0.12);
    }
    
    .filter-logo {
      width: 26px;
      height: 26px;
      border-radius: 6px;
      object-fit: contain;
      background: rgba(0,0,0,0.25);
      border: 1px solid rgba(255, 255, 255, 0.10);
      padding: 2px;
    }

    .filter-btn.active .filter-logo {
      border-color: rgba(255, 59, 59, 0.55);
      box-shadow: 0 0 0 1px rgba(255, 59, 59, 0.12) inset;
    }

    /* Filters with 0 incidents */
    .filter-btn.empty {
      opacity: 0.55;
    }

    .filter-btn.empty:hover {
      opacity: 0.8;
    }

    /* Urgency/Severity filter buttons */
    .urgency-btn {
      min-width: 30px;
      height: 30px;
      padding: 4px;
    }

    .urgency-btn[data-urgency="all"] {
      font-size: 9px;
      padding: 4px 8px;
    }

    .urgency-dot {
      display: block;
      width: 14px;
      height: 14px;
      border-radius: 50%;
      transition: transform 0.15s ease, box-shadow 0.15s ease;
    }

    .urgency-btn:hover .urgency-dot {
      transform: scale(1.15);
    }

    .urgency-btn.active .urgency-dot {
      transform: scale(1.1);
    }

    /* Urgency dot colors */
    .urgency-high .urgency-dot {
      background: var(--red);
      box-shadow: 0 0 8px rgba(255, 59, 59, 0.5);
    }

    .urgency-medical .urgency-dot {
      background: repeating-linear-gradient(
        135deg,
        rgba(255, 59, 59, 0.85) 0 4px,
        rgba(255, 255, 255, 0.6) 4px 8px
      );
      box-shadow: 0 0 8px rgba(255, 59, 59, 0.4);
    }

    .urgency-medium .urgency-dot {
      background: var(--amber);
      box-shadow: 0 0 8px rgba(255, 184, 48, 0.5);
    }

    .urgency-low .urgency-dot {
      background: var(--blue);
      box-shadow: 0 0 8px rgba(59, 139, 255, 0.5);
    }

    .urgency-service .urgency-dot {
      background: var(--green);
      box-shadow: 0 0 8px rgba(0, 255, 136, 0.5);
    }

    .urgency-custody .urgency-dot {
      background: repeating-linear-gradient(
        135deg,
        rgba(154, 160, 170, 0.9) 0 4px,
        rgba(255, 255, 255, 0.5) 4px 8px
      );
      box-shadow: 0 0 8px rgba(154, 160, 170, 0.4);
    }

    /* Active state for urgency buttons */
    .urgency-high.active {
      background: rgba(255, 59, 59, 0.16);
      border-color: rgba(255, 59, 59, 0.55);
    }

    .urgency-medical.active {
      background: rgba(255, 59, 59, 0.12);
      border-color: rgba(255, 59, 59, 0.45);
    }

    .urgency-medium.active {
      background: rgba(255, 184, 48, 0.16);
      border-color: rgba(255, 184, 48, 0.55);
    }

    .urgency-low.active {
      background: rgba(59, 139, 255, 0.16);
      border-color: rgba(59, 139, 255, 0.55);
    }

    .urgency-service.active {
      background: rgba(0, 255, 136, 0.16);
      border-color: rgba(0, 255, 136, 0.55);
    }

    .urgency-custody.active {
      background: rgba(154, 160, 170, 0.16);
      border-color: rgba(154, 160, 170, 0.55);
    }

    .sort-control {
      position: relative;
      width: 100%;
    }

    .agency-bank-controls {
      display: inline-flex;
      gap: 6px;
      width: 100%;
      margin-bottom: 4px;
      padding: 2px;
      border-radius: 10px;
      background: rgba(255, 255, 255, 0.03);
      border: 1px solid rgba(255, 255, 255, 0.09);
    }

    .agency-bank-controls.hidden {
      display: none !important;
    }

    .agency-bank-btn {
      flex: 1;
      border: 1px solid rgba(255, 255, 255, 0.14);
      background: rgba(255, 255, 255, 0.03);
      color: var(--text-dim);
      border-radius: 8px;
      padding: 7px 10px;
      font-size: 10px;
      font-weight: 600;
      min-height: 32px;
      letter-spacing: 0.4px;
      cursor: pointer;
      transition: all 0.2s ease;
    }

    .agency-bank-btn:hover {
      color: var(--text);
      border-color: rgba(255, 255, 255, 0.32);
    }

    .agency-bank-btn.active {
      color: var(--text);
      border-color: rgba(59, 139, 255, 0.6);
      background: rgba(59, 139, 255, 0.22);
      box-shadow: 0 0 14px rgba(59, 139, 255, 0.22);
    }

    .agency-bank-btn:focus-visible {
      outline: none;
      border-color: rgba(255, 255, 255, 0.55);
      box-shadow: 0 0 0 2px rgba(59, 139, 255, 0.22);
    }

    .agency-group {
      width: 100%;
      flex-wrap: wrap;
      animation: slideIn 0.15s ease-out;
    }

    .agency-group.hidden {
      display: none !important;
    }

    .sort-btn {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 7px 10px;
      font-size: 10px;
      font-family: 'JetBrains Mono', monospace;
      background: linear-gradient(180deg, rgba(26, 26, 37, 0.95), rgba(26, 26, 37, 0.65));
      border: 1px solid rgba(255, 255, 255, 0.10);
      border-radius: 10px;
      color: var(--text-dim);
      cursor: pointer;
      transition: all 0.2s ease;
      white-space: nowrap;
      width: 100%;
      justify-content: center;
    }

    .sort-btn:hover {
      background: var(--bg-panel);
      color: var(--text);
      border-color: var(--text-dim);
      transform: translateY(-1px);
    }

    .sort-btn[aria-expanded="true"] {
      border-color: rgba(59, 139, 255, 0.55);
      box-shadow: 0 0 18px rgba(59, 139, 255, 0.12);
      color: var(--text);
    }

    .sort-icon {
      width: 14px;
      height: 14px;
      color: var(--blue);
      opacity: 0.9;
    }

    .sort-menu {
      position: absolute;
      right: 0;
      top: calc(100% + 8px);
      min-width: 160px;
      background: rgba(18, 18, 26, 0.95);
      border: 1px solid rgba(255, 255, 255, 0.10);
      border-radius: 12px;
      padding: 6px;
      display: none;
      z-index: 20;
      box-shadow: 0 12px 40px rgba(0,0,0,0.45);
      backdrop-filter: blur(8px);
    }

    .sort-menu.open {
      display: grid;
      gap: 6px;
      animation: slideIn 0.12s ease-out;
    }

    .sort-option {
      width: 100%;
      text-align: left;
      padding: 8px 10px;
      border-radius: 10px;
      border: 1px solid transparent;
      background: transparent;
      color: var(--text-dim);
      font-size: 11px;
      font-family: 'JetBrains Mono', monospace;
      cursor: pointer;
      transition: all 0.2s ease;
    }

    .sort-option:hover {
      background: rgba(59, 139, 255, 0.12);
      border-color: rgba(59, 139, 255, 0.35);
      color: var(--text);
    }

    .sort-option.active {
      background: rgba(59, 139, 255, 0.18);
      border-color: rgba(59, 139, 255, 0.55);
      color: var(--text);
      font-weight: 600;
    }
    
    /* Settings Button */
    .settings-btn {
      width: 32px;
      height: 32px;
      border-radius: 50%;
      background: var(--bg-card);
      border: 1px solid var(--border);
      color: var(--text-dim);
      cursor: pointer;
      transition: all 0.2s ease;
      margin-left: 15px;
      display: grid;
      place-items: center;
    }
    
    .settings-btn:hover {
      background: var(--bg-dark);
      border-color: var(--text-dim);
      color: var(--text);
    }
    
    .settings-btn:hover svg {
      transform: rotate(45deg);
    }
    
    .settings-btn svg {
      transition: transform 0.3s ease;
    }

    /* Info Button */
    .info-btn {
      width: 32px;
      height: 32px;
      border-radius: 50%;
      background: var(--bg-card);
      border: 1px solid var(--border);
      color: var(--text-dim);
      font-family: Georgia, serif;
      font-size: 16px;
      font-style: italic;
      cursor: pointer;
      transition: all 0.2s ease;
      margin-left: 8px;
    }
    
    .info-btn:hover {
      background: var(--red);
      border-color: var(--red);
      color: white;
    }
    
    /* Settings Modal */
    .settings-modal {
      position: fixed;
      inset: 0;
      display: none;
      align-items: center;
      justify-content: center;
      z-index: 3000;
    }
    
    .settings-modal.open {
      display: flex;
    }
    
    .settings-modal .modal-backdrop {
      position: absolute;
      inset: 0;
      background: rgba(0, 0, 0, 0.6);
      backdrop-filter: blur(6px);
    }
    
    .settings-modal .settings-dialog {
      position: relative;
      width: min(420px, 90vw);
      background: linear-gradient(180deg, rgba(18, 18, 26, 0.98), rgba(18, 18, 26, 0.95));
      border: 1px solid var(--border);
      border-radius: 16px;
      padding: 22px 22px 18px;
      box-shadow: 0 12px 60px rgba(0, 0, 0, 0.55);
      z-index: 1;
      animation: slideIn 0.12s ease-out;
    }
    
    .settings-content h3 {
      font-family: 'Space Grotesk', sans-serif;
      font-size: 16px;
      color: var(--text);
      margin-bottom: 18px;
      padding-bottom: 12px;
      border-bottom: 1px solid var(--border);
    }
    
    .setting-item {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 16px;
      padding: 14px 0;
      border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }
    
    .setting-item:last-child {
      border-bottom: none;
    }
    
    .setting-label {
      flex: 1;
      cursor: pointer;
    }
    
    .setting-title {
      display: block;
      font-size: 13px;
      font-weight: 600;
      color: var(--text);
      margin-bottom: 4px;
    }
    
    .setting-desc {
      display: block;
      font-size: 11px;
      color: var(--text-dim);
      line-height: 1.5;
    }
    
    /* Toggle Switch */
    .toggle-switch {
      position: relative;
      width: 48px;
      height: 26px;
      flex-shrink: 0;
    }
    
    .toggle-switch input {
      opacity: 0;
      width: 0;
      height: 0;
    }
    
    .toggle-slider {
      position: absolute;
      cursor: pointer;
      inset: 0;
      background: var(--bg-dark);
      border: 1px solid var(--border);
      border-radius: 26px;
      transition: all 0.2s ease;
    }
    
    .toggle-slider::before {
      position: absolute;
      content: "";
      height: 18px;
      width: 18px;
      left: 3px;
      bottom: 3px;
      background: var(--text-dim);
      border-radius: 50%;
      transition: all 0.2s ease;
    }
    
    .toggle-switch input:checked + .toggle-slider {
      background: rgba(0, 255, 136, 0.2);
      border-color: rgba(0, 255, 136, 0.5);
    }
    
    .toggle-switch input:checked + .toggle-slider::before {
      transform: translateX(22px);
      background: var(--green);
    }
    
    .toggle-switch input:focus + .toggle-slider {
      box-shadow: 0 0 0 2px rgba(0, 255, 136, 0.2);
    }

    /* Info Modal */
    .info-modal {
      position: fixed;
      inset: 0;
      display: none;
      align-items: center;
      justify-content: center;
      z-index: 3000;
    }
    
    .info-modal.open {
      display: flex;
    }
    
    .info-modal .modal-backdrop {
      position: absolute;
      inset: 0;
      background: rgba(0, 0, 0, 0.6);
      backdrop-filter: blur(6px);
    }
    
    .info-modal .modal-dialog {
      position: relative;
      width: min(840px, 92vw);
      max-height: min(88vh, 860px);
      background: linear-gradient(180deg, rgba(18, 18, 26, 0.95), rgba(18, 18, 26, 0.9));
      border: 1px solid var(--border);
      border-radius: 16px;
      padding: 22px 22px 16px;
      box-shadow: 0 12px 60px rgba(0, 0, 0, 0.55);
      z-index: 1;
      animation: slideIn 0.12s ease-out;
    }

    .info-content {
      display: flex;
      flex-direction: column;
      gap: 14px;
      max-height: calc(88vh - 44px);
      overflow-y: auto;
      padding-right: 4px;
    }

    .incident-modal {
      position: fixed;
      inset: 0;
      display: none;
      align-items: center;
      justify-content: center;
      padding: 20px;
      z-index: 3200;
    }

    .incident-modal.open {
      display: flex;
    }

    .incident-modal .modal-backdrop {
      position: absolute;
      inset: 0;
      background: rgba(4, 8, 16, 0.68);
      backdrop-filter: blur(10px);
    }

    .incident-modal .incident-dialog {
      position: relative;
      width: min(420px, calc(100vw - 28px));
      background: linear-gradient(180deg, rgba(17, 21, 31, 0.98), rgba(13, 16, 24, 0.98));
      border: 1px solid rgba(255, 255, 255, 0.08);
      border-radius: 24px;
      padding: 22px 20px 18px;
      box-shadow: 0 28px 80px rgba(0, 0, 0, 0.48);
      z-index: 1;
      animation: slideIn 0.14s ease-out;
      text-align: center;
    }

    .incident-modal-copy h3 {
      font-family: 'Space Grotesk', sans-serif;
      font-size: 20px;
      line-height: 1.2;
      color: var(--text);
      margin-bottom: 16px;
    }

    .incident-modal-kicker {
      margin-bottom: 8px;
      font-size: 11px;
      letter-spacing: 0.18em;
      text-transform: uppercase;
      color: var(--text-dim);
    }

    .incident-modal-body {
      display: grid;
      gap: 10px;
    }

    .incident-modal-severity {
      justify-self: center;
      min-width: 110px;
      padding: 7px 14px;
      border-radius: 999px;
      font-size: 11px;
      font-weight: 700;
      letter-spacing: 0.12em;
      text-transform: uppercase;
      border: 1px solid transparent;
      margin-bottom: 4px;
    }

    .incident-modal-severity.sev-high {
      background: rgba(255, 59, 59, 0.16);
      border-color: rgba(255, 59, 59, 0.34);
      color: var(--red);
    }

    .incident-modal-severity.sev-medium {
      background: rgba(255, 184, 48, 0.16);
      border-color: rgba(255, 184, 48, 0.3);
      color: var(--amber);
    }

    .incident-modal-severity.sev-low {
      background: rgba(59, 139, 255, 0.16);
      border-color: rgba(59, 139, 255, 0.34);
      color: var(--blue);
    }

    .incident-modal-severity.sev-service {
      background: rgba(0, 255, 136, 0.14);
      border-color: rgba(0, 255, 136, 0.28);
      color: var(--green);
    }

    .incident-modal-severity.sev-medical,
    .incident-modal-severity.sev-custody {
      background: rgba(255, 255, 255, 0.08);
      border-color: rgba(255, 255, 255, 0.14);
      color: var(--text);
    }

    .incident-modal-detail {
      display: grid;
      gap: 4px;
      padding: 12px 14px;
      border-radius: 14px;
      background: rgba(255, 255, 255, 0.035);
      border: 1px solid rgba(255, 255, 255, 0.06);
      text-align: left;
    }

    .incident-modal-label {
      font-size: 10px;
      letter-spacing: 0.14em;
      text-transform: uppercase;
      color: var(--text-dim);
    }

    .incident-modal-value {
      font-size: 13px;
      line-height: 1.45;
      color: var(--text);
      word-break: break-word;
    }

    .incident-modal-actions {
      display: grid;
      gap: 10px;
      margin-top: 18px;
    }

    .incident-modal-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 100%;
      min-height: 46px;
      border-radius: 14px;
      border: 1px solid transparent;
      font-family: 'Space Grotesk', sans-serif;
      font-size: 14px;
      font-weight: 600;
      text-decoration: none;
      cursor: pointer;
      transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
    }

    .incident-modal-btn:hover {
      transform: translateY(-1px);
    }

    .incident-modal-btn.primary {
      background: linear-gradient(180deg, rgba(59, 139, 255, 0.96), rgba(39, 114, 221, 0.96));
      border-color: rgba(59, 139, 255, 0.55);
      color: #fff;
    }

    .incident-modal-btn.secondary {
      background: rgba(255, 255, 255, 0.045);
      border-color: rgba(255, 255, 255, 0.08);
      color: var(--text);
    }
    
    .modal-close {
      position: absolute;
      top: 14px;
      right: 14px;
      width: 30px;
      height: 30px;
      border-radius: 50%;
      border: 1px solid var(--border);
      background: var(--bg-card);
      color: var(--text);
      cursor: pointer;
      transition: all 0.2s ease;
    }
    
    .modal-close:hover {
      background: var(--red);
      border-color: var(--red);
      color: white;
    }
    
    @keyframes slideIn {
      from { opacity: 0; transform: translateY(-10px); }
      to { opacity: 1; transform: translateY(0); }
    }
    
    .info-hero {
      display: flex;
      align-items: center;
      gap: 14px;
      margin-bottom: 14px;
    }

    .info-section-tabs {
      display: inline-flex;
      gap: 8px;
      padding: 4px;
      border-radius: 12px;
      background: rgba(255, 255, 255, 0.03);
      border: 1px solid rgba(255, 255, 255, 0.06);
      align-self: flex-start;
    }

    .info-section-tab {
      border: 0;
      border-radius: 10px;
      padding: 10px 14px;
      background: transparent;
      color: var(--text-dim);
      font-family: 'Space Grotesk', sans-serif;
      font-size: 13px;
      font-weight: 700;
      cursor: pointer;
      transition: all 0.2s ease;
    }

    .info-section-tab:hover {
      color: var(--text);
      background: rgba(255, 255, 255, 0.04);
    }

    .info-section-tab.active {
      color: var(--text);
      background: linear-gradient(180deg, rgba(255, 59, 59, 0.18), rgba(255, 59, 59, 0.08));
      box-shadow: inset 0 0 0 1px rgba(255, 59, 59, 0.2);
    }

    .info-panes {
      min-height: 0;
    }

    .info-pane {
      display: grid;
      gap: 14px;
    }
    
    .info-logo {
      width: 52px;
      height: 52px;
      border-radius: 12px;
      object-fit: cover;
      background: rgba(255,255,255,0.04);
      border: 1px solid rgba(255,255,255,0.08);
      box-shadow: 0 0 20px rgba(255, 59, 59, 0.12);
    }
    
    .info-content h3 {
      font-family: 'Space Grotesk', sans-serif;
      font-size: 18px;
      color: var(--red);
      margin-bottom: 8px;
    }
    
    .info-content p {
      font-size: 12px;
      color: var(--text-dim);
      margin-bottom: 15px;
      line-height: 1.5;
    }
    
    .info-links {
      display: flex;
      flex-direction: column;
      gap: 8px;
      margin-bottom: 15px;
    }

    .info-dropdown {
      border: 1px solid var(--border);
      border-radius: 10px;
      background: rgba(18, 18, 26, 0.55);
      overflow: hidden;
    }

    .info-dropdown summary {
      list-style: none;
      cursor: pointer;
      padding: 10px 12px;
      font-size: 12px;
      font-weight: 600;
      color: var(--text);
      display: flex;
      align-items: center;
      justify-content: space-between;
      background: var(--bg-card);
      user-select: none;
    }

    .info-dropdown summary::-webkit-details-marker {
      display: none;
    }

    .info-dropdown summary::after {
      content: '▾';
      color: var(--text-dim);
      transition: transform 0.2s ease;
    }

    .info-dropdown[open] summary::after {
      transform: rotate(180deg);
      color: var(--red);
    }

    .info-dropdown-links {
      display: grid;
      gap: 8px;
      padding: 10px;
      border-top: 1px solid var(--border);
      background: rgba(10, 10, 15, 0.35);
    }
    
    /* Notion-style disclaimer callout (blue) */
    .notion-callout {
      display: flex;
      gap: 10px;
      align-items: flex-start;
      padding: 12px 12px 12px 12px;
      margin: 12px 0 14px;
      border-radius: 12px;
      background: rgba(59, 139, 255, 0.12);
      border: 1px solid rgba(59, 139, 255, 0.28);
      border-left: 4px solid rgba(59, 139, 255, 0.9);
      color: rgba(220, 235, 255, 0.95);
    }
    
    .notion-callout .icon {
      width: 20px;
      height: 20px;
      border-radius: 6px;
      display: grid;
      place-items: center;
      background: rgba(59, 139, 255, 0.18);
      border: 1px solid rgba(59, 139, 255, 0.28);
      color: rgba(220, 235, 255, 0.95);
      flex: 0 0 auto;
      margin-top: 1px;
      font-weight: 700;
      font-family: 'Space Grotesk', sans-serif;
    }
    
    .notion-callout p {
      margin: 0;
      font-size: 12px;
      line-height: 1.45;
    }
    
    .info-link {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 10px 12px;
      background: var(--bg-card);
      border: 1px solid var(--border);
      border-radius: 8px;
      color: var(--text);
      text-decoration: none;
      font-size: 12px;
      transition: all 0.2s ease;
    }
    
    .info-link:hover {
      background: var(--bg-dark);
      border-color: var(--red);
      color: var(--red);
    }
    
    .info-link svg {
      flex-shrink: 0;
    }

    .info-link-icon {
      width: 22px;
      height: 22px;
      flex-shrink: 0;
      object-fit: contain;
      filter: drop-shadow(0 0 8px rgba(255, 59, 59, 0.2));
    }

    .info-link-badge {
      width: 22px;
      height: 22px;
      border-radius: 6px;
      border: 1px solid rgba(59, 139, 255, 0.45);
      background: rgba(59, 139, 255, 0.14);
      color: var(--blue);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 10px;
      font-weight: 700;
      letter-spacing: 0.4px;
      flex-shrink: 0;
    }
    
    .info-credit {
      font-size: 10px;
      color: var(--text-dim);
      text-align: center;
      border-top: 1px solid var(--border);
      padding-top: 12px;
      margin-bottom: 4px !important;
    }

    .info-credit-link {
      color: var(--text);
      text-decoration: underline;
      text-decoration-color: rgba(255, 59, 59, 0.45);
      text-underline-offset: 2px;
    }

    .info-credit-link:hover {
      color: var(--red);
      text-decoration-color: rgba(255, 59, 59, 0.9);
    }
    
    .info-version {
      font-size: 9px;
      color: var(--text-dim);
      opacity: 0.6;
      text-align: center;
      margin-bottom: 0 !important;
      letter-spacing: 0.5px;
    }

    .report-shell {
      display: grid;
      gap: 14px;
    }

    .report-intro {
      padding: 14px 16px;
      border-radius: 14px;
      border: 1px solid rgba(59, 139, 255, 0.16);
      background:
        radial-gradient(circle at top right, rgba(59, 139, 255, 0.14), transparent 38%),
        rgba(255, 255, 255, 0.025);
    }

    .report-kicker {
      font-size: 11px;
      letter-spacing: 0.16em;
      text-transform: uppercase;
      color: var(--blue);
      margin-bottom: 6px !important;
    }

    .report-copy {
      color: var(--text);
      font-size: 13px;
      line-height: 1.55;
      margin-bottom: 0 !important;
    }

    .report-controls {
      display: grid;
      grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
      gap: 10px;
      align-items: end;
    }

    .report-field {
      display: grid;
      gap: 6px;
    }

    .report-field span {
      font-size: 10px;
      letter-spacing: 0.14em;
      text-transform: uppercase;
      color: var(--text-dim);
    }

    .report-field input,
    .report-field select {
      width: 100%;
      min-height: 42px;
      border-radius: 12px;
      border: 1px solid rgba(255, 255, 255, 0.08);
      background: rgba(255, 255, 255, 0.04);
      color: var(--text);
      padding: 0 12px;
      font-family: 'JetBrains Mono', monospace;
      font-size: 13px;
    }

    .report-refresh-btn,
    .report-focus-btn {
      min-height: 42px;
      border-radius: 12px;
      border: 1px solid rgba(59, 139, 255, 0.28);
      background: linear-gradient(180deg, rgba(59, 139, 255, 0.22), rgba(59, 139, 255, 0.1));
      color: #eef5ff;
      padding: 0 14px;
      font-family: 'Space Grotesk', sans-serif;
      font-size: 13px;
      font-weight: 700;
      cursor: pointer;
      transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
    }

    .report-refresh-btn:hover,
    .report-focus-btn:hover {
      transform: translateY(-1px);
      border-color: rgba(59, 139, 255, 0.45);
      background: linear-gradient(180deg, rgba(59, 139, 255, 0.28), rgba(59, 139, 255, 0.14));
    }

    .report-status {
      min-height: 18px;
      font-size: 12px;
      color: var(--text-dim);
    }

    .report-status.loading {
      color: var(--blue);
    }

    .report-status.error {
      color: var(--red);
    }

    .report-view {
      display: grid;
      gap: 14px;
    }

    .report-summary-card,
    .report-panel,
    .report-stat-card {
      border-radius: 16px;
      border: 1px solid rgba(255, 255, 255, 0.06);
      background: rgba(255, 255, 255, 0.03);
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
    }

    .report-summary-card {
      padding: 18px;
      background:
        radial-gradient(circle at top right, rgba(255, 59, 59, 0.16), transparent 32%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.025));
    }

    .report-summary-head,
    .report-panel-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
    }

    .report-summary-label,
    .report-mini-label {
      font-size: 10px;
      letter-spacing: 0.14em;
      text-transform: uppercase;
      color: var(--text-dim);
      margin-bottom: 6px !important;
    }

    .report-summary-card h4,
    .report-panel h5 {
      font-family: 'Space Grotesk', sans-serif;
      color: var(--text);
    }

    .report-summary-card h4 {
      font-size: 20px;
    }

    .report-panel h5 {
      font-size: 16px;
    }

    .report-summary-text {
      margin-bottom: 0 !important;
      margin-top: 12px;
      color: var(--text);
      font-size: 14px;
      line-height: 1.6;
    }

    .report-source-pill,
    .report-panel-badge {
      flex-shrink: 0;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border-radius: 999px;
      padding: 7px 11px;
      border: 1px solid rgba(255, 255, 255, 0.08);
      background: rgba(255, 255, 255, 0.05);
      color: var(--text);
      font-size: 11px;
      font-weight: 700;
    }

    .report-stat-grid {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 10px;
    }

    .report-stat-card {
      padding: 14px;
      display: grid;
      gap: 8px;
    }

    .report-stat-label {
      font-size: 10px;
      letter-spacing: 0.14em;
      text-transform: uppercase;
      color: var(--text-dim);
    }

    .report-stat-value {
      font-family: 'Space Grotesk', sans-serif;
      font-size: 22px;
      color: var(--text);
    }

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

    .report-panel {
      padding: 16px;
      display: grid;
      gap: 14px;
    }

    .report-keyline {
      display: grid;
      gap: 4px;
    }

    .report-keyline strong {
      font-size: 16px;
      line-height: 1.35;
      color: var(--text);
    }

    .report-keyline span {
      font-size: 12px;
      color: var(--text-dim);
      line-height: 1.45;
    }

    .report-type-list {
      display: grid;
      gap: 8px;
    }

    .report-type-row {
      display: grid;
      gap: 6px;
    }

    .report-type-meta {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      font-size: 12px;
      color: var(--text);
    }

    .report-type-name {
      max-width: 75%;
      line-height: 1.35;
    }

    .report-type-bar {
      width: 100%;
      height: 8px;
      border-radius: 999px;
      overflow: hidden;
      background: rgba(255, 255, 255, 0.05);
    }

    .report-type-fill {
      height: 100%;
      border-radius: inherit;
      background: linear-gradient(90deg, rgba(255, 59, 59, 0.9), rgba(255, 184, 48, 0.92));
    }

    .report-hotspot-grid {
      display: grid;
      gap: 12px;
    }

    .report-hotspot-block {
      display: grid;
      gap: 8px;
    }

    .report-chip-list {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
    }

    .report-chip {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 7px 10px;
      border-radius: 999px;
      background: rgba(255, 255, 255, 0.045);
      border: 1px solid rgba(255, 255, 255, 0.06);
      font-size: 11px;
      line-height: 1.3;
      color: var(--text);
    }

    .report-chip strong {
      color: var(--blue);
      font-family: 'Space Grotesk', sans-serif;
      font-size: 12px;
    }
    
    .history-controls {
      padding: 15px;
      background: var(--bg-dark);
      border-bottom: 1px solid var(--border);
      flex-shrink: 0;
      max-height: 100%;
      overflow-y: auto;
      overscroll-behavior: contain;
    }
    
    .date-input {
      width: 100%;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 12px 14px;
      background: linear-gradient(180deg, rgba(26, 26, 37, 0.95), rgba(26, 26, 37, 0.70));
      border: 1px solid rgba(255, 255, 255, 0.10);
      border-radius: 12px;
      color: var(--text);
      font-family: 'JetBrains Mono', monospace;
      font-size: 13px;
      cursor: pointer;
    }

    .date-input:hover {
      border-color: var(--text-dim);
      background: var(--bg-panel);
    }

    .date-input-left {
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      gap: 2px;
      text-align: left;
    }

    .date-input-label {
      font-size: 10px;
      color: var(--text-dim);
      text-transform: uppercase;
      letter-spacing: 1px;
    }

    .date-input-value {
      font-size: 13px;
      font-weight: 600;
      color: var(--text);
    }

    .date-input-icon {
      width: 18px;
      height: 18px;
      color: var(--amber);
      opacity: 0.9;
      flex-shrink: 0;
    }
    
    .date-input:focus {
      outline: none;
      border-color: var(--red);
    }

    /* Inline date picker */
    .date-picker {
      display: none;
      margin-top: 12px;
      background: rgba(18, 18, 26, 0.95);
      border: 1px solid rgba(255, 255, 255, 0.10);
      border-radius: 14px;
      padding: 12px;
      backdrop-filter: blur(10px);
      max-height: min(60vh, 360px);
      overflow-y: auto;
    }

    .history-pagination {
      margin-top: 12px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      padding: 10px 12px;
      border-radius: 12px;
      background: rgba(18, 18, 26, 0.85);
      border: 1px solid rgba(255, 255, 255, 0.08);
    }

    .history-pagination.hidden {
      display: none !important;
    }

    .page-btn {
      width: 34px;
      height: 34px;
      border-radius: 10px;
      background: var(--bg-card);
      border: 1px solid rgba(255, 255, 255, 0.10);
      color: var(--text);
      cursor: pointer;
      transition: all 0.2s ease;
      display: grid;
      place-items: center;
      font-size: 16px;
      line-height: 1;
    }

    .page-btn:hover:not(:disabled) {
      border-color: rgba(255, 59, 59, 0.55);
      color: var(--red);
      box-shadow: 0 0 18px rgba(255, 59, 59, 0.12);
    }

    .page-btn:disabled {
      opacity: 0.45;
      cursor: not-allowed;
    }

    .page-status {
      font-size: 11px;
      color: var(--text-dim);
      letter-spacing: 0.5px;
    }

    .date-picker.open {
      display: block;
      animation: slideIn 0.12s ease-out;
    }

    .dp-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      margin-bottom: 10px;
    }

    .dp-month {
      font-size: 12px;
      font-weight: 700;
      color: var(--text);
      letter-spacing: 1px;
      text-transform: uppercase;
      font-family: 'Space Grotesk', sans-serif;
    }

    .dp-nav {
      width: 34px;
      height: 34px;
      border-radius: 10px;
      background: var(--bg-card);
      border: 1px solid rgba(255, 255, 255, 0.10);
      color: var(--text);
      cursor: pointer;
      transition: all 0.2s ease;
      display: grid;
      place-items: center;
    }

    .dp-nav:hover {
      border-color: rgba(255, 59, 59, 0.55);
      color: var(--red);
      box-shadow: 0 0 18px rgba(255, 59, 59, 0.12);
    }

    .dp-grid {
      display: grid;
      grid-template-columns: repeat(7, 1fr);
      gap: 6px;
    }

    .dp-dow {
      font-size: 9px;
      color: var(--text-dim);
      text-align: center;
      text-transform: uppercase;
      letter-spacing: 1px;
      padding: 4px 0 6px;
    }

    .dp-day {
      height: 34px;
      border-radius: 10px;
      background: rgba(26, 26, 37, 0.65);
      border: 1px solid rgba(255, 255, 255, 0.08);
      color: var(--text);
      cursor: pointer;
      transition: all 0.15s ease;
      font-family: 'JetBrains Mono', monospace;
      font-size: 12px;
    }

    .dp-day:hover {
      border-color: var(--text-dim);
      background: rgba(26, 26, 37, 0.9);
      transform: translateY(-1px);
    }

    .dp-day.empty {
      opacity: 0;
      pointer-events: none;
      border: none;
      background: transparent;
    }

    .dp-day.freq-low {
      background: rgba(59, 139, 255, 0.18);
      border-color: rgba(59, 139, 255, 0.45);
      color: var(--text);
    }

    .dp-day.freq-medium {
      background: rgba(255, 184, 48, 0.18);
      border-color: rgba(255, 184, 48, 0.55);
      color: var(--text);
    }

    .dp-day.freq-high {
      background: rgba(255, 59, 59, 0.2);
      border-color: rgba(255, 59, 59, 0.6);
      color: var(--text);
    }

    .dp-day.today:not(.selected) {
      border-color: rgba(0, 255, 136, 0.7);
      box-shadow: 0 0 0 1px rgba(0, 255, 136, 0.18) inset, 0 0 14px rgba(0, 255, 136, 0.18);
    }

    .dp-day.selected {
      background: transparent;
      border-color: rgba(255, 255, 255, 0.75);
      box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25) inset;
      color: var(--text);
      font-weight: 700;
    }

    .dp-day.today.selected {
      border-color: rgba(0, 255, 136, 0.8);
      box-shadow: 0 0 0 1px rgba(0, 255, 136, 0.25) inset;
    }
    
    .empty-state {
      text-align: center;
      padding: 40px 20px;
      color: var(--text-dim);
    }
    
    .empty-state .icon {
      font-size: 48px;
      margin-bottom: 15px;
      opacity: 0.3;
    }
    
    .hidden {
      display: none !important;
    }
    
    /* Custom Leaflet styles */
    .leaflet-container {
      background: #0a0a12;
    }
    
    .custom-marker {
      display: flex;
      align-items: center;
      justify-content: center;
    }
    
    .marker-pulse {
      width: 20px;
      height: 20px;
      border-radius: 50%;
      position: relative;
    }

    /* Static (non-pulsing) marker used for History mode */
    .marker-static {
      width: 14px;
      height: 14px;
      border-radius: 50%;
      position: relative;
      box-shadow: 0 0 0 2px rgba(0,0,0,0.35);
    }
    
    .marker-pulse::after {
      content: '';
      position: absolute;
      inset: -5px;
      border-radius: 50%;
      border: 2px solid currentColor;
      animation: marker-pulse 1.1s ease-out infinite;
    }
    
    @keyframes marker-pulse {
      0% { transform: scale(1); opacity: 1; }
      100% { transform: scale(2); opacity: 0; }
    }
    
    .leaflet-popup-content-wrapper {
      background: var(--bg-panel);
      color: var(--text);
      border-radius: 10px;
      border: 1px solid var(--border);
    }
    
    .leaflet-popup-tip {
      background: var(--bg-panel);
    }
    
    .popup-content {
      font-family: 'JetBrains Mono', monospace;
      padding: 5px;
    }
    
    .popup-title {
      font-weight: 600;
      font-size: 13px;
      margin-bottom: 8px;
      color: var(--red);
    }
    
    .popup-detail {
      font-size: 11px;
      color: var(--text-dim);
      margin: 4px 0;
    }

    .popup-link {
      display: inline-block;
      margin-top: 8px;
      font-size: 11px;
      color: var(--blue);
      text-decoration: none;
      border-bottom: 1px solid rgba(59, 139, 255, 0.35);
      padding-bottom: 1px;
    }

    .popup-link:hover {
      color: var(--text);
      border-bottom-color: rgba(255, 59, 59, 0.6);
    }
    
    .popup-goto-btn {
      display: block;
      width: 100%;
      margin-top: 10px;
      padding: 8px 12px;
      background: rgba(59, 139, 255, 0.18);
      border: 1px solid rgba(59, 139, 255, 0.45);
      border-radius: 8px;
      color: var(--blue);
      font-size: 11px;
      font-family: 'JetBrains Mono', monospace;
      cursor: pointer;
      transition: all 0.2s ease;
    }
    
    .popup-goto-btn:hover {
      background: rgba(59, 139, 255, 0.28);
      border-color: rgba(59, 139, 255, 0.65);
      color: var(--text);
    }
    
    /* Highlighted incident card (when navigating from map marker) */
    .incident-card.highlighted {
      border-color: rgba(59, 139, 255, 1) !important;
      box-shadow: 0 0 0 3px rgba(59, 139, 255, 0.7), 0 0 25px rgba(59, 139, 255, 0.5), inset 0 0 20px rgba(59, 139, 255, 0.1) !important;
      animation: none;
      background: linear-gradient(135deg, rgba(59, 139, 255, 0.15), rgba(59, 139, 255, 0.05)) !important;
    }
    
    @keyframes card-highlight-pulse {
      0%, 100% {
        box-shadow: 0 0 0 3px rgba(59, 139, 255, 0.7), 0 0 25px rgba(59, 139, 255, 0.5), inset 0 0 20px rgba(59, 139, 255, 0.1);
      }
      50% {
        box-shadow: 0 0 0 5px rgba(59, 139, 255, 0.9), 0 0 40px rgba(59, 139, 255, 0.7), inset 0 0 30px rgba(59, 139, 255, 0.15);
      }
    }

    /* Keep map tile rendering lightweight for smooth pan/zoom. */
    .leaflet-labels-pane .leaflet-tile {
      filter: none;
      opacity: 1;
    }

    .leaflet-base-pane .leaflet-tile {
      filter: none;
    }
    
    /* Light-map overrides */
    body.map-light .leaflet-labels-pane .leaflet-tile,
    body.map-light .leaflet-base-pane .leaflet-tile {
      filter: none;
      opacity: 1;
    }
    
    /* Prevent background scroll when modal is open */
    body.modal-open {
      overflow: hidden;
    }
    
    /* Responsive */
    @media (max-width: 900px) {
      .info-modal .modal-dialog {
        width: min(92vw, 680px);
      }

      .report-stat-grid,
      .report-panels,
      .report-controls {
        grid-template-columns: 1fr;
      }

      .main-container {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(36vh, 44vh) 1fr;
        height: calc(100dvh - var(--header-height));
      }
      
      .sidebar {
        border-left: none;
        border-top: 1px solid var(--border);
      }
    }

    @media (max-width: 720px) {
      body {
        min-height: 100dvh;
      }

      .incident-modal {
        padding: 14px;
      }

      .incident-modal .incident-dialog {
        width: min(100%, 420px);
        border-radius: 22px;
        padding: 20px 16px 16px;
      }

      .incident-modal-copy h3 {
        font-size: 18px;
      }

      .incident-modal-value {
        font-size: 12px;
      }

      .main-container {
        display: block;
        height: calc(100dvh - var(--header-height));
      }

      .map-container {
        height: 100%;
      }

      .sidebar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        height: 52vh;
        max-height: 65vh;
        border-left: none;
        border-top: 1px solid var(--border);
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -16px 40px rgba(0, 0, 0, 0.45);
        z-index: 2000;
        overflow: hidden;
        transition: height 0.2s ease;
        padding-bottom: env(safe-area-inset-bottom);
      }

      .sidebar.collapsed {
        height: 56px;
      }

      .sidebar.collapsed .filter-bar,
      .sidebar.collapsed .source-tabs,
      .sidebar.collapsed #live-panel,
      .sidebar.collapsed #history-panel,
      .sidebar.collapsed .history-controls {
        display: none;
      }

      .sidebar.collapsed .tabs {
        border-bottom: none;
      }

      .header {
        padding: 14px 16px 10px;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
      }

      .logo {
        gap: 10px;
      }

      .logo-icon {
        width: 44px;
        height: 44px;
      }

      .logo-text h1 {
        font-size: 20px;
        letter-spacing: 1px;
      }

      .logo-text p {
        font-size: 9px;
        letter-spacing: 2px;
      }

      .status-bar {
        width: 100%;
        flex-wrap: wrap;
        gap: 10px 12px;
        justify-content: space-between;
      }

      .status-item {
        align-items: flex-start;
      }

      .status-item.status-live {
        display: none;
      }

      .status-label {
        font-size: 8px;
        letter-spacing: 0.5px;
      }

      .status-value {
        font-size: 14px;
      }

      .status-item.status-update .status-value {
        font-size: 12px;
      }

      .tabs {
        padding: 6px 8px;
      }

      .source-tabs {
        padding: 6px 8px 8px;
        gap: 5px;
      }

      .source-tab {
        font-size: 9px;
        padding: 5px 9px;
      }

      .panel-toggle {
        display: grid;
        place-items: center;
        font-size: 14px;
      }

      .map-theme-toggle,
      .location-btn {
        width: 36px;
        height: 30px;
      }

      .settings-btn {
        width: 30px;
        height: 30px;
        margin-left: auto;
      }
      
      .settings-btn svg {
        width: 14px;
        height: 14px;
      }

      .info-btn {
        width: 30px;
        height: 30px;
        margin-left: 6px;
      }

      .info-content {
        max-height: calc(90vh - 36px);
      }

      .report-summary-head,
      .report-panel-head {
        align-items: flex-start;
        flex-direction: column;
      }

      .report-source-pill,
      .report-panel-badge,
      .report-focus-btn,
      .report-refresh-btn {
        width: 100%;
      }

      .legend-container {
        display: none;
      }

      .tab {
        padding: 10px;
        font-size: 11px;
      }

      .filter-bar {
        gap: 6px;
        padding: 6px 6px;
      }

      .agency-bank-controls {
        margin-bottom: 3px;
        gap: 4px;
        padding: 2px;
      }

      .agency-bank-btn {
        min-height: 30px;
        padding: 6px 8px;
        font-size: 9px;
        letter-spacing: 0.2px;
      }

      .filter-logo {
        width: 22px;
        height: 22px;
      }

      .incident-list {
        padding: 8px;
      }

      .incident-card {
        padding: 8px 10px;
        margin-bottom: 6px;
      }

      .incident-header {
        margin-bottom: 6px;
      }

      .incident-type {
        font-size: 12px;
      }

      .incident-time {
        font-size: 10px;
        padding: 2px 6px;
      }

      .incident-location {
        font-size: 10px;
        margin-bottom: 4px;
      }

      .incident-agency {
        padding: 2px 6px;
        font-size: 9px;
      }

      .incident-units {
        font-size: 9px;
      }

      .incident-meta {
        flex-wrap: wrap;
        gap: 6px;
      }

      .history-controls {
        padding: 10px 10px 8px;
      }

      .date-input {
        padding: 10px 12px;
      }

      .date-picker {
        padding: 10px;
        max-height: 55vh;
      }

      .dp-grid {
        gap: 4px;
      }

      .dp-day {
        height: 30px;
        font-size: 11px;
        border-radius: 9px;
      }

      .dp-dow {
        font-size: 8px;
        padding: 3px 0 5px;
      }

      .dp-nav {
        width: 30px;
        height: 30px;
        border-radius: 9px;
      }

      .dp-month {
        font-size: 11px;
      }
    }
  
