    /* =========================================================================
       1. GLOBAL & LIGHT MODE DEFAULT STYLES
       ========================================================================= */
    :root {
      --primary-blue: #2563eb;
      --primary-dark: #1e3a8a;
      --accent-cyan: #0284c7;
      --chat-bg: #f8fafc;
      --chat-card-bg: #ffffff;
      --text-main: #1e293b;
      --text-muted: #64748b;
      --border-light: #e2e8f0;
    }

    @keyframes pulseGlow {
      0% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7), 0 4px 14px rgba(245, 158, 11, 0.5);
        transform: translate(-50%, -100%) scale(1);
      }
      100% {
        box-shadow: 0 0 0 14px rgba(245, 158, 11, 0), 0 6px 22px rgba(245, 158, 11, 0.7);
        transform: translate(-50%, -100%) scale(1.06);
      }
    }

    body {
      font-family: 'Plus Jakarta Sans', sans-serif;
      background-color: #f1f5f9;
      color: #1e293b;
    }

    .content-wrapper {
      padding: 14px 18px !important;
    }

    .ai-chat-wrapper {
      display: flex;
      flex-direction: column;
      height: calc(100vh - 142px);
      min-height: 530px;
      background: var(--chat-card-bg);
      border-radius: 16px;
      border: 1px solid var(--border-light);
      box-shadow: 0 6px 20px -2px rgba(0, 0, 0, 0.05);
      overflow: hidden;
      transition: background-color 0.3s, border-color 0.3s;
    }

    /* Top Bar */
    .ai-chat-header {
      background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #0284c7 100%);
      color: #ffffff;
      padding: 14px 22px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-shrink: 0;
      box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
      z-index: 5;
    }

    .ai-avatar-icon {
      width: 42px;
      height: 42px;
      border-radius: 12px;
      background: rgba(255, 255, 255, 0.2);
      backdrop-filter: blur(8px);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 20px;
      color: #ffffff;
      border: 1px solid rgba(255, 255, 255, 0.35);
    }

    .ai-status-badge {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      background: rgba(16, 185, 129, 0.25);
      border: 1px solid rgba(52, 211, 153, 0.5);
      color: #ecfdf5;
      padding: 3px 10px;
      border-radius: 20px;
      font-size: 11px;
      font-weight: 600;
    }

    .ai-status-dot {
      width: 7px;
      height: 7px;
      border-radius: 50%;
      background: #10b981;
      box-shadow: 0 0 8px #10b981;
    }

    /* Semantic Response Badges (Ultimate Prompt V2) */
    .ai-semantic-badge {
      display: inline-flex;
      align-items: center;
      padding: 3px 8px;
      font-size: 10px;
      font-weight: 800;
      letter-spacing: 0.5px;
      border-radius: 6px;
      text-transform: uppercase;
      box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    }
    .ai-semantic-fact {
      background: rgba(2, 132, 199, 0.15);
      color: #0284c7;
      border: 1px solid rgba(2, 132, 199, 0.4);
    }
    .ai-semantic-analysis {
      background: rgba(37, 99, 235, 0.15);
      color: #2563eb;
      border: 1px solid rgba(37, 99, 235, 0.4);
    }
    .ai-semantic-insight {
      background: rgba(217, 119, 6, 0.15);
      color: #d97706;
      border: 1px solid rgba(217, 119, 6, 0.4);
    }
    .ai-semantic-projection {
      background: rgba(124, 58, 237, 0.15);
      color: #7c3aed;
      border: 1px solid rgba(124, 58, 237, 0.4);
    }
    .ai-semantic-simulation {
      background: rgba(13, 148, 136, 0.15);
      color: #0d9488;
      border: 1px solid rgba(13, 148, 136, 0.4);
    }
    .ai-semantic-recommendation {
      background: rgba(5, 150, 105, 0.15);
      color: #059669;
      border: 1px solid rgba(5, 150, 105, 0.4);
    }

    /* Scrollable Chat Area */
    .ai-chat-messages {
      flex: 1;
      overflow-y: auto;
      overflow-x: hidden !important;
      padding: 22px;
      background: var(--chat-bg);
      display: flex;
      flex-direction: column;
      gap: 18px;
      width: 100%;
      max-width: 100%;
      box-sizing: border-box;
    }

    .ai-chat-messages::-webkit-scrollbar {
      width: 6px;
      height: 6px;
    }

    .ai-chat-messages::-webkit-scrollbar-track {
      background: transparent;
    }

    .ai-chat-messages::-webkit-scrollbar-thumb {
      background: #cbd5e1;
      border-radius: 4px;
    }

    .ai-chat-messages::-webkit-scrollbar-thumb:hover {
      background: #94a3b8;
    }

    /* Chat Bubbles - Light Mode */
    .chat-row-user {
      display: flex;
      align-items: flex-start;
      justify-content: flex-end;
      gap: 12px;
      max-width: 82%;
      margin-left: auto;
      min-width: 0 !important;
      box-sizing: border-box;
    }

    .chat-bubble-user {
      background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
      color: #ffffff !important;
      padding: 13px 18px;
      border-radius: 18px 18px 4px 18px;
      box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
      font-size: 14px;
      line-height: 1.5;
      min-width: 0 !important;
      max-width: 100% !important;
      word-break: break-word !important;
      overflow-wrap: break-word !important;
      box-sizing: border-box !important;
    }

    .chat-row-ai {
      display: flex;
      align-items: flex-start;
      gap: 12px;
      max-width: 92%;
      width: 100%;
      min-width: 0 !important;
      box-sizing: border-box !important;
    }

    .ai-msg-avatar {
      width: 38px;
      height: 38px;
      border-radius: 12px;
      background: linear-gradient(135deg, #2563eb, #6366f1);
      color: #ffffff;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 16px;
      flex-shrink: 0;
      box-shadow: 0 4px 10px rgba(37, 99, 235, 0.2);
    }

    .user-msg-avatar {
      width: 40px;
      height: 40px;
      border-radius: 13px;
      background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 50%, #1e40af 100%);
      color: #ffffff;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 17px;
      flex-shrink: 0;
      box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
      border: 1.5px solid rgba(255, 255, 255, 0.25);
      position: relative;
      transition: all 0.25s ease;
      cursor: default;
    }
    .user-msg-avatar:hover {
      transform: scale(1.06);
      box-shadow: 0 6px 18px rgba(37, 99, 235, 0.55);
    }
    .user-status-dot {
      position: absolute;
      bottom: -1px;
      right: -1px;
      width: 11px;
      height: 11px;
      background: #10b981;
      border-radius: 50%;
      border: 2px solid #0f172a;
      box-shadow: 0 0 6px #10b981;
    }
    html:not(.dark) .user-status-dot {
      border-color: #ffffff;
    }

    .chat-bubble-ai {
      background: #ffffff;
      border: 1px solid #e2e8f0;
      border-radius: 18px 18px 18px 4px;
      padding: 20px;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
      flex: 1 1 auto;
      min-width: 0 !important;
      max-width: 100% !important;
      width: 100%;
      color: #1e293b;
      font-size: 14px;
      line-height: 1.6;
      box-sizing: border-box !important;
      word-break: break-word !important;
      overflow-wrap: break-word !important;
      overflow-x: hidden;
    }

    .chat-bubble-ai p {
      color: #334155;
      margin-bottom: 8px;
    }

    .chat-bubble-ai strong,
    .chat-bubble-ai b {
      color: #0f172a;
    }

    .chat-bubble-ai .ai-header-bar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      border-bottom: 1px solid #f1f5f9;
      padding-bottom: 8px;
      margin-bottom: 12px;
      flex-wrap: wrap;
      gap: 8px;
      width: 100%;
      min-width: 0;
      box-sizing: border-box;
    }

    .chat-bubble-ai .ai-header-bar strong {
      color: #0f172a;
      font-size: 14px;
    }

    /* -------------------------------------------------------------
       MODERN NARRATIVE & AI RESPONSE CARD SYSTEM
       ------------------------------------------------------------- */
    .narrative-content {
      font-size: 14.5px;
      line-height: 1.7;
      color: #334155;
      word-break: break-word;
      overflow-wrap: break-word;
    }
    .narrative-content .ai-paragraph {
      margin-bottom: 12px;
      line-height: 1.7;
    }
    .narrative-content .ai-spacer {
      height: 8px;
    }
    .narrative-content .ai-link {
      color: #0284c7;
      text-decoration: underline;
      font-weight: 700;
    }
    .narrative-content .ai-bold {
      color: #0f172a;
      font-weight: 700;
    }
    .narrative-content .ai-italic {
      font-style: italic;
    }
    .narrative-content .ai-inline-code {
      background: rgba(99, 102, 241, 0.1);
      color: #4f46e5;
      padding: 2px 6px;
      border-radius: 5px;
      font-family: monospace;
      font-size: 12px;
      font-weight: 700;
    }

    /* Section Headings */
    .narrative-content .ai-section-heading {
      display: flex;
      align-items: center;
      gap: 10px;
      margin: 18px 0 10px 0;
      padding-bottom: 8px;
      border-bottom: 1.5px solid #e2e8f0;
    }
    .narrative-content .ai-section-heading:first-child {
      margin-top: 4px;
    }
    .narrative-content .ai-badge-num {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 26px;
      height: 26px;
      border-radius: 8px;
      background: linear-gradient(135deg, #0284c7, #38bdf8);
      color: #ffffff;
      font-size: 12px;
      font-weight: 800;
      flex-shrink: 0;
      box-shadow: 0 3px 8px rgba(2, 132, 199, 0.35);
    }
    .narrative-content .ai-badge-dot {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 24px;
      height: 24px;
      border-radius: 7px;
      background: #e0f2fe;
      color: #0284c7;
      font-size: 11px;
      flex-shrink: 0;
    }
    .narrative-content .ai-heading-title {
      font-size: 15px;
      font-weight: 700;
      color: #0369a1;
      letter-spacing: -0.01em;
    }

    /* Structured Lists & Cards */
    .narrative-content .ai-list-group {
      display: flex;
      flex-direction: column;
      gap: 8px;
      margin: 8px 0 14px 0;
    }
    .narrative-content .ai-list-item {
      display: flex;
      align-items: flex-start;
      gap: 10px;
      padding: 10px 14px;
      border-radius: 10px;
      background: #f8fafc;
      border: 1px solid #e2e8f0;
      transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    }
    .narrative-content .ai-list-item:hover {
      transform: translateX(3px);
      border-color: #cbd5e1;
      background: #f1f5f9;
    }
    /* Clickable Clarification & Numbered Options (1, 2, 3...) */
    .narrative-content .ai-list-item.ai-option-clickable {
      cursor: pointer !important;
      position: relative;
      user-select: none;
      align-items: center;
    }
    .narrative-content .ai-list-item.ai-option-clickable:hover {
      transform: translateX(4px);
      border-color: #0284c7;
      background: #eff6ff;
      box-shadow: 0 4px 14px rgba(2, 132, 199, 0.15);
    }
    .narrative-content .ai-list-item.ai-option-clickable:active {
      transform: scale(0.99) translateX(2px);
    }
    .narrative-content .ai-item-action {
      display: inline-flex;
      align-items: center;
      margin-left: auto;
      padding-left: 10px;
      flex-shrink: 0;
    }
    .narrative-content .ai-item-action-badge {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      font-size: 11px;
      font-weight: 700;
      padding: 4px 10px;
      border-radius: 6px;
      background: rgba(2, 132, 199, 0.12);
      color: #0284c7;
      border: 1px solid rgba(2, 132, 199, 0.25);
      transition: all 0.2s ease;
      white-space: nowrap;
    }
    .narrative-content .ai-list-item.ai-option-clickable:hover .ai-item-action-badge {
      background: #0284c7;
      color: #ffffff;
      border-color: #0284c7;
      box-shadow: 0 2px 8px rgba(2, 132, 199, 0.35);
    }
    .narrative-content .ai-bullet-dot {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 18px;
      height: 18px;
      border-radius: 6px;
      background: rgba(2, 132, 199, 0.12);
      color: #0284c7;
      font-size: 9px;
      margin-top: 3px;
      flex-shrink: 0;
    }
    .narrative-content .ai-item-num {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 20px;
      height: 20px;
      border-radius: 6px;
      background: linear-gradient(135deg, #0284c7, #38bdf8);
      color: #ffffff;
      font-size: 10.5px;
      font-weight: 700;
      margin-top: 2px;
      flex-shrink: 0;
    }
    .narrative-content .ai-item-content {
      flex: 1;
      font-size: 13.5px;
      line-height: 1.65;
      color: inherit;
    }
    .narrative-content .ai-item-content strong {
      color: #0284c7;
      font-weight: 700;
    }

    /* Alert Banners */
    .narrative-content .ai-alert-banner {
      display: flex;
      align-items: flex-start;
      gap: 12px;
      padding: 12px 16px;
      border-radius: 12px;
      margin: 12px 0;
      font-size: 13.5px;
      line-height: 1.6;
    }
    .narrative-content .ai-alert-security {
      background: #f0f9ff;
      border: 1px solid #bae6fd;
      color: #0369a1;
    }
    .narrative-content .ai-alert-free {
      background: #f0fdf4;
      border: 1px solid #bbf7d0;
      color: #15803d;
    }
    .narrative-content .ai-alert-icon {
      font-size: 18px;
      margin-top: 2px;
      flex-shrink: 0;
    }

    /* Quote Callouts */
    .narrative-content .ai-quote-callout {
      border-left: 3.5px solid #0284c7;
      background: rgba(2, 132, 199, 0.06);
      padding: 10px 14px;
      border-radius: 0 8px 8px 0;
      margin: 10px 0;
      font-style: italic;
      color: #334155;
    }

    /* AI Model Chip in Bubble Header */
    .ai-model-chip {
      font-size: 10px !important;
      padding: 2px 7px !important;
      border-radius: 5px !important;
      background: #e0f2fe !important;
      color: #0284c7 !important;
      border: 1px solid #bae6fd !important;
      font-weight: 700 !important;
      letter-spacing: 0.02em;
    }

    /* -------------------------------------------------------------
       DARK MODE OVERRIDES FOR NARRATIVE CARDS
       ------------------------------------------------------------- */
    html.dark .narrative-content {
      color: #e2e8f0;
    }
    html.dark .narrative-content .ai-link {
      color: #38bdf8;
    }
    html.dark .narrative-content .ai-bold {
      color: #ffffff;
    }
    html.dark .narrative-content .ai-inline-code {
      background: rgba(99, 102, 241, 0.22);
      color: #a5b4fc;
    }
    html.dark .narrative-content .ai-section-heading {
      border-bottom-color: rgba(56, 189, 248, 0.2);
    }
    html.dark .narrative-content .ai-badge-dot {
      background: rgba(56, 189, 248, 0.16);
      color: #38bdf8;
    }
    html.dark .narrative-content .ai-heading-title {
      color: #38bdf8;
      text-shadow: 0 0 16px rgba(56, 189, 248, 0.25);
    }
    html.dark .narrative-content .ai-list-item {
      background: rgba(15, 23, 42, 0.65);
      border: 1px solid rgba(56, 189, 248, 0.14);
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    }
    html.dark .narrative-content .ai-list-item:hover {
      border-color: rgba(56, 189, 248, 0.38);
      background: rgba(15, 23, 42, 0.88);
      box-shadow: 0 4px 14px rgba(2, 132, 199, 0.18);
    }
    html.dark .narrative-content .ai-list-item.ai-option-clickable {
      background: rgba(15, 23, 42, 0.75);
      border: 1px solid rgba(56, 189, 248, 0.22);
    }
    html.dark .narrative-content .ai-list-item.ai-option-clickable:hover {
      border-color: #38bdf8;
      background: rgba(30, 58, 138, 0.35);
      box-shadow: 0 4px 18px rgba(56, 189, 248, 0.28);
    }
    html.dark .narrative-content .ai-item-action-badge {
      background: rgba(56, 189, 248, 0.15);
      color: #38bdf8;
      border: 1px solid rgba(56, 189, 248, 0.35);
    }
    html.dark .narrative-content .ai-list-item.ai-option-clickable:hover .ai-item-action-badge {
      background: #0284c7;
      color: #ffffff;
      border-color: #38bdf8;
      box-shadow: 0 0 12px rgba(56, 189, 248, 0.55);
    }
    html.dark .narrative-content .ai-bullet-dot {
      background: rgba(56, 189, 248, 0.18);
      color: #38bdf8;
    }
    html.dark .narrative-content .ai-item-content strong {
      color: #38bdf8;
    }
    html.dark .narrative-content .ai-alert-security {
      background: linear-gradient(90deg, rgba(14, 165, 233, 0.15) 0%, rgba(30, 58, 138, 0.22) 100%);
      border: 1px solid rgba(56, 189, 248, 0.35);
      color: #e0f2fe;
      box-shadow: 0 4px 14px rgba(2, 132, 199, 0.15);
    }
    html.dark .narrative-content .ai-alert-security .ai-alert-icon {
      color: #38bdf8;
    }
    html.dark .narrative-content .ai-alert-free {
      background: linear-gradient(90deg, rgba(34, 197, 94, 0.15) 0%, rgba(20, 83, 45, 0.22) 100%);
      border: 1px solid rgba(74, 222, 128, 0.35);
      color: #dcfce7;
      box-shadow: 0 4px 14px rgba(34, 197, 94, 0.15);
    }
    html.dark .narrative-content .ai-alert-free .ai-alert-icon {
      color: #4ade80;
    }
    html.dark .narrative-content .ai-quote-callout {
      border-left-color: #38bdf8;
      background: rgba(56, 189, 248, 0.1);
      color: #cbd5e1;
    }
    html.dark .ai-model-chip {
      background: rgba(56, 189, 248, 0.15) !important;
      color: #38bdf8 !important;
      border: 1px solid rgba(56, 189, 248, 0.35) !important;
    }

    /* 3-Tier Navigation Tabs */
    .tier-tabs-bar {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      background: #eff6ff;
      padding: 6px;
      border-radius: 12px;
      margin: 14px 0;
      border: 1.5px solid #bfdbfe;
      width: 100%;
      max-width: 100%;
      box-sizing: border-box;
    }

    .tier-tab-btn {
      flex: 1 1 auto;
      min-width: 0;
      padding: 8px 12px;
      border-radius: 8px;
      font-size: 12px;
      font-weight: 700;
      border: none;
      background: transparent;
      color: #1e40af;
      cursor: pointer;
      transition: all 0.2s ease;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      text-align: center;
      box-sizing: border-box;
    }

    .tier-tab-btn:hover {
      background: rgba(37, 99, 235, 0.1);
      color: #1d4ed8;
    }

    .tier-tab-btn.active {
      background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
      color: #ffffff !important;
      box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25) !important;
    }

    .tier-pane {
      width: 100%;
      max-width: 100%;
      min-width: 0;
      box-sizing: border-box;
    }

    /* Filter & Search Toolbar */
    .filter-toolbar {
      display: flex;
      gap: 10px;
      align-items: center;
      margin-bottom: 10px;
      flex-wrap: wrap;
    }

    .filter-select,
    .filter-input {
      padding: 6px 12px;
      border-radius: 8px;
      border: 1.5px solid #cbd5e1;
      font-size: 12px;
      color: #1e293b;
      background: #ffffff;
      outline: none;
    }

    .filter-select:focus,
    .filter-input:focus {
      border-color: #2563eb;
    }

    /* Welcome Quick Questions Box */
    .quick-chips-box {
      background: #eff6ff;
      border: 1px solid #dbeafe;
      border-radius: 12px;
      padding: 14px;
    }

    .quick-chips-box .box-title {
      font-size: 12px;
      font-weight: 700;
      color: #1e40af;
      margin-bottom: 10px;
    }

    /* Action Chips */
    .chip-btn {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 7px 13px;
      border-radius: 20px;
      background: #ffffff;
      border: 1.5px solid #cbd5e1;
      color: #334155;
      font-size: 12px;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s ease;
      white-space: nowrap;
      text-decoration: none !important;
    }

    .chip-btn:hover {
      background: #2563eb;
      color: #ffffff !important;
      border-color: #2563eb;
      transform: translateY(-2px);
      box-shadow: 0 4px 10px rgba(37, 99, 235, 0.2);
    }

    .chip-btn.amber {
      border-color: #fde68a;
      background: #fffbeb;
      color: #92400e;
    }

    .chip-btn.amber:hover {
      background: #d97706;
      border-color: #d97706;
      color: #ffffff !important;
    }

    /* Stat Cards */
    .stat-card-box {
      background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
      border: 1.5px solid #dbeafe;
      border-radius: 12px;
      padding: 14px;
      margin: 14px 0;
      width: 100%;
      max-width: 100%;
      box-sizing: border-box;
      overflow: hidden;
    }

    .stat-card-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
      gap: 12px;
      margin-top: 10px;
      width: 100%;
      max-width: 100%;
      box-sizing: border-box;
    }

    .stat-card {
      background: #ffffff;
      border: 1px solid #e2e8f0;
      border-radius: 12px;
      padding: 12px 14px;
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
      min-width: 0;
      box-sizing: border-box;
    }

    .stat-card .label {
      font-size: 11px;
      font-weight: 700;
      color: #64748b;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }

    .stat-card .value {
      font-size: 20px;
      font-weight: 800;
      color: #0f172a;
      margin-top: 4px;
    }

    .stat-card.total .value {
      color: #1d4ed8;
    }

    .stat-card.laki .value {
      color: #0284c7;
    }

    .stat-card.perempuan .value {
      color: #db2777;
    }

    /* Typewriter Cursor */
    .typing-cursor {
      display: inline-block;
      width: 7px;
      height: 14px;
      background-color: #2563eb;
      margin-left: 3px;
      vertical-align: middle;
      animation: blinkCursor 0.7s infinite;
      border-radius: 2px;
    }
    @keyframes blinkCursor {
      0%, 100% { opacity: 1; }
      50% { opacity: 0; }
    }

    /* =========================================================================
       ACTION CTA CARDS (Layanan & Aksi Terkait)
       ========================================================================= */
    .action-cta-wrapper {
      margin: 16px 0 14px 0;
      padding: 14px 16px;
      background: linear-gradient(135deg, rgba(240, 249, 255, 0.75) 0%, rgba(241, 245, 249, 0.9) 100%);
      border: 1px solid rgba(186, 230, 253, 0.8);
      border-radius: 14px;
      box-shadow: 0 4px 18px rgba(0, 0, 0, 0.04);
      backdrop-filter: blur(12px);
    }
    .action-cta-heading {
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
      gap: 8px;
      margin-bottom: 12px;
      padding-bottom: 8px;
      border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    }
    .action-cta-heading-left {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
    }
    .cta-heading-icon {
      width: 26px;
      height: 26px;
      border-radius: 7px;
      background: linear-gradient(135deg, #f59e0b, #d97706);
      color: #ffffff;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 12px;
      box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35);
    }
    .cta-heading-title {
      font-size: 13px;
      font-weight: 800;
      color: #0f172a;
      letter-spacing: 0.3px;
    }
    .cta-heading-badge {
      font-size: 10px;
      font-weight: 700;
      background: rgba(37, 99, 235, 0.1);
      color: #2563eb;
      padding: 2px 8px;
      border-radius: 20px;
      border: 1px solid rgba(37, 99, 235, 0.2);
    }
    .cta-heading-sub {
      font-size: 11px;
      color: #64748b;
      width: 100%;
      margin-top: 1px;
    }
    .action-cta-grid {
      display: flex;
      flex-direction: column;
      gap: 9px;
    }
    .cta-card-btn {
      display: flex;
      align-items: center;
      gap: 14px;
      padding: 11px 15px;
      background: #ffffff;
      border-radius: 12px;
      border: 1px solid #e2e8f0;
      text-decoration: none !important;
      transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
      cursor: pointer;
      position: relative;
      overflow: hidden;
    }
    .cta-card-btn:hover {
      transform: translateY(-2px);
      box-shadow: 0 8px 22px rgba(37, 99, 235, 0.12);
      border-color: #3b82f6;
      background: #f8fafc;
    }
    .cta-icon-box {
      width: 40px;
      height: 40px;
      border-radius: 11px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 17px;
      flex-shrink: 0;
      transition: transform 0.22s ease;
    }
    .cta-card-btn:hover .cta-icon-box {
      transform: scale(1.08);
    }
    .cta-blue .cta-icon-box {
      background: linear-gradient(135deg, #2563eb, #1d4ed8);
      color: #ffffff;
      box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
    }
    .cta-amber .cta-icon-box {
      background: linear-gradient(135deg, #f59e0b, #d97706);
      color: #ffffff;
      box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
    }
    .cta-green .cta-icon-box, .cta-emerald .cta-icon-box {
      background: linear-gradient(135deg, #10b981, #059669);
      color: #ffffff;
      box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
    }
    .cta-content-box {
      flex: 1;
      min-width: 0;
    }
    .cta-title-row {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
    }
    .cta-title {
      font-size: 13.5px;
      font-weight: 700;
      color: #0f172a;
      transition: color 0.2s ease;
    }
    .cta-card-btn:hover .cta-title {
      color: #2563eb;
    }
    .cta-desc {
      font-size: 11.5px;
      color: #64748b;
      margin-top: 3px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      line-height: 1.4;
    }
    .cta-badge {
      font-size: 10px;
      font-weight: 800;
      padding: 2px 7px;
      border-radius: 6px;
      letter-spacing: 0.3px;
    }
    .cta-badge-blue, .cta-badge-primary {
      background: #eff6ff;
      color: #2563eb;
      border: 1px solid #bfdbfe;
    }
    .cta-badge-amber {
      background: #fffbeb;
      color: #b45309;
      border: 1px solid #fde68a;
    }
    .cta-badge-green, .cta-badge-emerald {
      background: #f0fdf4;
      color: #15803d;
      border: 1px solid #bbf7d0;
    }
    .cta-arrow-box {
      display: flex;
      align-items: center;
      gap: 6px;
      padding: 5px 10px;
      border-radius: 20px;
      background: rgba(241, 245, 249, 0.8);
      color: #64748b;
      font-size: 11px;
      font-weight: 700;
      transition: all 0.22s ease;
      flex-shrink: 0;
    }
    .cta-card-btn:hover .cta-arrow-box {
      background: #2563eb;
      color: #ffffff;
      transform: translateX(3px);
      box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
    }

    /* Mini GIS Interactive Map Widget */
    .mini-gis-card {
      margin: 14px 0;
      border-radius: 12px;
      overflow: hidden;
      border: 1.5px solid #0284c7;
      background: #0f172a;
      box-shadow: 0 6px 20px rgba(15, 23, 42, 0.35);
      position: relative;
    }
    .mini-gis-header {
      background: linear-gradient(90deg, #0f172a, #1e293b);
      padding: 9px 14px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      border-bottom: 1px solid #334155;
    }
    .mini-gis-viewport {
      height: 270px;
      min-height: 270px;
      width: 100%;
      background: #0f172a;
      position: relative;
      overflow: hidden;
    }
    .mini-gis-viewport .leaflet-container {
      background: #0f172a !important;
      font-family: inherit;
    }
    .mini-gis-footer {
      padding: 7px 14px;
      font-size: 11px;
      color: #94a3b8;
      background: #0f172a;
      border-top: 1px solid #1e293b;
      display: flex;
      justify-content: space-between;
      align-items: center;
      flex-wrap: wrap;
      gap: 6px;
    }

    /* GIS Hover Tooltip Ultra-Clean Floating Badge */
    .gis-hover-tooltip,
    .gis-hover-tooltip-clean,
    .leaflet-tooltip.gis-hover-tooltip,
    .leaflet-tooltip.gis-hover-tooltip-clean,
    .mini-gis-card .leaflet-tooltip {
      background: transparent !important;
      background-color: transparent !important;
      border: none !important;
      box-shadow: none !important;
      padding: 0 !important;
    }
    .gis-hover-tooltip:before,
    .gis-hover-tooltip-clean:before,
    .leaflet-tooltip.gis-hover-tooltip:before,
    .leaflet-tooltip.gis-hover-tooltip-clean:before,
    .mini-gis-card .leaflet-tooltip:before {
      display: none !important;
    }

    /* Tables */
    .ai-data-table-wrapper {
      border-radius: 12px;
      border: 1px solid #e2e8f0;
      overflow: hidden;
      margin: 14px 0;
      box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
      width: 100%;
      max-width: 100% !important;
      box-sizing: border-box !important;
    }

    .ai-data-table-header {
      background: #f1f5f9;
      padding: 10px 16px;
      font-size: 12px;
      font-weight: 700;
      color: #475569;
      display: flex;
      align-items: center;
      justify-content: space-between;
      border-bottom: 1px solid #e2e8f0;
      flex-wrap: wrap;
      gap: 6px;
    }

    .ai-data-table-scroll {
      max-height: 280px;
      overflow-y: auto;
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
      width: 100%;
      max-width: 100% !important;
      box-sizing: border-box !important;
    }

    .ai-data-table {
      width: 100%;
      min-width: 620px;
      font-size: 12px;
      border-collapse: collapse;
      margin: 0;
      table-layout: auto;
    }

    .ai-data-table th,
    .ai-data-table td {
      padding: 8px 12px;
      word-break: normal !important;
      overflow-wrap: normal !important;
      vertical-align: middle;
    }

    .ai-data-table th {
      background: #f8fafc;
      color: #475569;
      font-weight: 700;
      border-bottom: 1px solid #e2e8f0;
      white-space: nowrap;
    }

    .ai-data-table td {
      border-bottom: 1px solid #f1f5f9;
      color: #334155;
    }

    .ai-data-table tr:hover td {
      background-color: #f8fafc;
    }

    .ai-data-table tfoot td {
      background: #eff6ff;
      font-weight: 800;
      color: #1e3a8a;
      border-top: 2px solid #bfdbfe;
      white-space: nowrap;
    }

    /* Boundary / Limitation Callout Quote (Light Mode) */
    .ai-quote-callout {
      margin: 12px 0;
      padding: 12px 16px;
      border-left: 4px solid #3b82f6;
      background: #eff6ff;
      border-radius: 0 10px 10px 0;
      font-size: 13px;
      line-height: 1.6;
      color: #1e293b;
      box-shadow: 0 2px 8px rgba(59, 130, 246, 0.06);
    }

    /* Predictive Demographics & Forecasting Card (Light Mode) */
    .forecasting-box {
      margin-top: 14px;
      border-radius: 14px;
      border: 1px solid #ddd6fe;
      border-left: 5px solid #8b5cf6;
      background: linear-gradient(180deg, #faf5ff 0%, #ffffff 100%);
      padding: 16px;
      box-shadow: 0 4px 16px rgba(139, 92, 246, 0.08);
      transition: background 0.3s, border-color 0.3s;
    }

    .forecasting-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 12px;
      flex-wrap: wrap;
      gap: 8px;
    }

    .forecasting-title {
      font-weight: 800;
      font-size: 13.5px;
      color: #5b21b6;
      display: flex;
      align-items: center;
      gap: 7px;
    }

    .forecasting-badge {
      background: #ede9fe;
      color: #6d28d9;
      font-weight: 700;
      font-size: 10.5px;
      padding: 4px 10px;
      border-radius: 6px;
      border: 1px solid #ddd6fe;
      display: inline-flex;
      align-items: center;
    }

    .forecasting-table-wrap {
      border-radius: 10px;
      border: 1px solid #e2e8f0;
      overflow: hidden;
      margin-bottom: 12px;
      box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
      background: #ffffff;
    }

    .forecasting-table {
      width: 100%;
      margin-bottom: 0;
      font-size: 12px;
      border-collapse: collapse;
      text-align: center;
    }

    .forecasting-table thead th {
      background: #f5f3ff;
      color: #581c87;
      font-weight: 700;
      padding: 9px 12px;
      border-bottom: 1px solid #e2e8f0;
      white-space: nowrap;
    }

    .forecasting-table tbody td {
      padding: 9px 12px;
      border-bottom: 1px solid #f1f5f9;
      color: #1e293b;
      vertical-align: middle;
      background: #ffffff;
    }

    .forecasting-table tbody tr:hover td {
      background-color: #faf5ff;
    }

    .forecasting-table .col-year {
      font-weight: 800;
      color: #0f172a;
    }

    .forecasting-table .col-pop {
      font-weight: 800;
      color: #4338ca;
    }

    .forecasting-table .col-growth {
      font-weight: 700;
      color: #16a34a;
    }

    .forecasting-table .col-rate-badge {
      display: inline-block;
      padding: 3px 8px;
      border-radius: 4px;
      font-size: 11px;
      font-weight: 600;
      background: #f8fafc;
      color: #334155;
      border: 1px solid #cbd5e1;
    }

    .forecasting-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
      gap: 10px;
    }

    .forecasting-card {
      background: #ffffff;
      border: 1px solid #e9d5ff;
      border-radius: 10px;
      padding: 10px 14px;
      box-shadow: 0 2px 6px rgba(124, 58, 237, 0.04);
    }

    .forecasting-card .fc-label {
      font-size: 10.5px;
      color: #6b21a8;
      font-weight: 700;
      text-transform: uppercase;
      margin-bottom: 3px;
    }

    .forecasting-card .fc-val {
      font-size: 15px;
      font-weight: 800;
      line-height: 1.3;
    }

    .forecasting-card .fc-val.text-purple {
      color: #7e22ce;
    }

    .forecasting-card .fc-val.text-indigo {
      color: #4338ca;
    }

    .forecasting-card .fc-val.text-amber {
      color: #b45309;
    }

    .forecasting-card .fc-sub {
      font-size: 10.5px;
      color: #64748b;
      margin-top: 2px;
    }

    /* Interactive Visual Analytics Studio */
    .live-charts-container {
      margin: 14px 0;
      padding: 16px 18px;
      background: #ffffff;
      border: 1px solid #e2e8f0;
      border-radius: 14px;
      box-shadow: 0 4px 18px rgba(15, 23, 42, 0.04);
      transition: all 0.25s ease;
    }

    .chart-header-bar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
      gap: 10px;
      border-bottom: 1px solid rgba(148, 163, 184, 0.2);
      padding-bottom: 10px;
      margin-bottom: 14px;
    }

    .chart-header-left {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
    }

    .chart-main-title {
      font-size: 12.5px;
      font-weight: 800;
      letter-spacing: 0.3px;
      color: #0f172a;
    }

    .live-pulse-dot {
      display: inline-block;
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: #10b981;
      box-shadow: 0 0 0 rgba(16, 185, 129, 0.7);
      animation: livePulse 1.8s infinite;
    }

    @keyframes livePulse {
      0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
      }

      70% {
        box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
      }

      100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
      }
    }

    .badge-primary-light {
      background: #eff6ff;
      color: #2563eb;
      font-size: 10.5px;
      font-weight: 700;
      padding: 3px 8px;
      border-radius: 6px;
      border: 1px solid #bfdbfe;
    }

    .chart-header-actions {
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .btn-chart-action {
      background: #f8fafc;
      color: #475569;
      border: 1px solid #cbd5e1;
      border-radius: 7px;
      padding: 4px 10px;
      font-size: 11px;
      font-weight: 600;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 4px;
      transition: all 0.2s ease;
    }

    .btn-chart-action:hover {
      background: #f1f5f9;
      color: #1e293b;
      border-color: #94a3b8;
      transform: translateY(-1px);
    }

    /* KPI Summary Row */
    .chart-kpi-summary-row {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
      gap: 10px;
      margin-bottom: 14px;
    }

    .chart-kpi-mini-card {
      background: #f8fafc;
      border: 1px solid #e2e8f0;
      border-radius: 10px;
      padding: 8px 12px;
      display: flex;
      flex-direction: column;
      gap: 2px;
      transition: all 0.2s ease;
    }

    .chart-kpi-mini-card:hover {
      background: #ffffff;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
      border-color: #cbd5e1;
    }

    .chart-kpi-label {
      font-size: 10px;
      font-weight: 700;
      color: #64748b;
      text-transform: uppercase;
      letter-spacing: 0.4px;
      display: flex;
      align-items: center;
      gap: 4px;
    }

    .chart-kpi-val {
      font-size: 13px;
      font-weight: 800;
      color: #0f172a;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .chart-kpi-sub {
      font-size: 10px;
      color: #94a3b8;
    }

    /* Filter Toolbar */
    .chart-filter-toolbar {
      background: #f8fafc;
      border: 1px solid #e2e8f0;
      border-radius: 10px;
      padding: 8px 12px;
      margin-bottom: 14px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
      gap: 8px;
    }

    .chart-btn-group {
      display: flex;
      align-items: center;
      gap: 4px;
      flex-wrap: wrap;
    }

    .chart-type-btn {
      background: #ffffff;
      border: 1px solid #cbd5e1;
      color: #475569;
      font-size: 11px;
      font-weight: 600;
      padding: 5px 10px;
      border-radius: 6px;
      cursor: pointer;
      transition: all 0.2s ease;
      display: inline-flex;
      align-items: center;
    }

    .chart-type-btn:hover {
      background: #f1f5f9;
      color: #1e293b;
      border-color: #94a3b8;
    }

    .chart-type-btn.active {
      background: linear-gradient(135deg, #2563eb, #1d4ed8);
      color: #ffffff;
      border-color: #1d4ed8;
      box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
    }

    .chart-sub-controls {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
    }

    .chart-select-wrapper {
      display: flex;
      align-items: center;
      gap: 5px;
      font-size: 11px;
      font-weight: 600;
      color: #475569;
    }

    .chart-select-control {
      background: #ffffff;
      border: 1px solid #cbd5e1;
      border-radius: 6px;
      font-size: 11px;
      font-weight: 600;
      color: #1e293b;
      padding: 4px 8px;
      cursor: pointer;
      outline: none;
      transition: all 0.2s ease;
    }

    .chart-select-control:focus {
      border-color: #2563eb;
      box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
    }

    /* Chart Canvas Stage */
    .chart-card-box {
      background: #ffffff;
      border: 1px solid #e2e8f0;
      border-radius: 10px;
      padding: 12px;
      display: flex;
      flex-direction: column;
    }

    .chart-box-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 10px;
    }

    .chart-box-title-main {
      font-size: 11.5px;
      font-weight: 700;
      color: #334155;
    }

    .chart-quick-drilldown {
      margin-top: 10px;
      padding-top: 8px;
      border-top: 1px dashed #e2e8f0;
      display: flex;
      flex-wrap: wrap;
      gap: 4px;
    }

    .chart-chip-mini {
      font-size: 10px;
      padding: 2px 7px;
      background: #f1f5f9;
      color: #334155;
      border-radius: 4px;
      border: 1px solid #e2e8f0;
      cursor: pointer;
      transition: all 0.15s ease;
    }

    .chart-chip-mini:hover {
      background: #e2e8f0;
      color: #0f172a;
    }

    /* Export Buttons */
    .btn-export-excel {
      background: #16a34a;
      color: #ffffff !important;
      border-radius: 8px;
      padding: 7px 14px;
      font-size: 12px;
      font-weight: 700;
      border: none;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      transition: all 0.2s ease;
      text-decoration: none !important;
    }

    .btn-export-excel:hover {
      background: #15803d;
      box-shadow: 0 4px 12px rgba(22, 163, 74, 0.25);
    }

    .btn-export-pdf {
      background: #dc2626;
      color: #ffffff !important;
      border-radius: 8px;
      padding: 7px 14px;
      font-size: 12px;
      font-weight: 700;
      border: none;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      transition: all 0.2s ease;
      text-decoration: none !important;
    }

    .btn-export-pdf:hover {
      background: #b91c1c;
      box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
    }

    .btn-export-all {
      background: #4f46e5;
      color: #ffffff !important;
      border-radius: 8px;
      padding: 7px 14px;
      font-size: 12px;
      font-weight: 700;
      border: none;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      transition: all 0.2s ease;
      text-decoration: none !important;
    }

    .btn-export-all:hover {
      background: #4338ca;
      box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
    }

    /* OPD Policy Directives */
    .opd-container {
      background: #f8fafc;
      border: 1px solid #e2e8f0;
      border-radius: 12px;
      padding: 14px;
      margin: 14px 0;
    }

    .opd-directive-item {
      background: #ffffff;
      border: 1px solid #e2e8f0;
      border-radius: 10px;
      padding: 10px 14px;
      margin-bottom: 8px;
    }

    /* Proactive Suggestion Box */
    .proactive-box {
      margin-top: 16px;
      padding: 14px 16px;
      border-radius: 12px;
      background: #fffbeb;
      border: 1px solid #fef3c7;
    }

    /* Voice Recording Bar */
    .voice-bar {
      display: none;
      align-items: center;
      justify-content: space-between;
      background: #fee2e2;
      border-top: 1px solid #fca5a5;
      padding: 10px 24px;
      flex-shrink: 0;
    }

    .voice-bar.active {
      display: flex;
    }

    .sound-waves {
      display: inline-flex;
      align-items: center;
      gap: 3px;
      height: 18px;
    }

    .sound-bar {
      width: 3px;
      height: 100%;
      background-color: #dc2626;
      border-radius: 3px;
      animation: sound-bar-wave 1s ease-in-out infinite alternate;
    }

    .sound-bar:nth-child(2) {
      animation-delay: 0.2s;
    }

    .sound-bar:nth-child(3) {
      animation-delay: 0.4s;
    }

    .sound-bar:nth-child(4) {
      animation-delay: 0.1s;
    }

    .sound-bar:nth-child(5) {
      animation-delay: 0.3s;
    }

    @keyframes sound-bar-wave {
      0% {
        height: 4px;
      }

      100% {
        height: 18px;
      }
    }

    /* Bottom Input Bar */
    .ai-chat-input-bar {
      position: relative;
      background: #ffffff;
      border-top: 1px solid #e2e8f0;
      padding: 16px 24px;
      flex-shrink: 0;
    }

    /* Autocomplete Suggestions Popup */
    .autocomplete-popup {
      position: absolute;
      bottom: calc(100% + 8px);
      left: 16px;
      right: 16px;
      background: #ffffff;
      border: 1px solid #cbd5e1;
      border-radius: 14px;
      box-shadow: 0 12px 28px -4px rgba(15, 23, 42, 0.18), 0 4px 8px -2px rgba(15, 23, 42, 0.08);
      max-height: 290px;
      overflow-y: auto;
      z-index: 1050;
      padding: 8px;
    }
    .autocomplete-item {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 8px 12px;
      border-radius: 8px;
      cursor: pointer;
      font-size: 12px;
      font-weight: 600;
      color: #1e293b;
      transition: all 0.15s ease;
    }
    .autocomplete-item:hover, .autocomplete-item.active {
      background: #eff6ff;
      color: #2563eb;
    }
    .autocomplete-item .badge-cat {
      font-size: 10px;
      padding: 2px 8px;
      border-radius: 9999px;
      background: #f1f5f9;
      color: #475569;
      font-weight: 700;
      white-space: nowrap;
    }
    html.dark .autocomplete-popup {
      background: #1e293b;
      border-color: #334155;
      box-shadow: 0 12px 28px -4px rgba(0, 0, 0, 0.5);
    }
    html.dark .autocomplete-item {
      color: #f1f5f9;
    }
    html.dark .autocomplete-item:hover, html.dark .autocomplete-item.active {
      background: #0f172a;
      color: #38bdf8;
    }
    html.dark .autocomplete-item .badge-cat {
      background: #334155;
      color: #94a3b8;
    }

    /* RAG Semantic Regulatory & SOP Card (Light & Dark Mode) */
    .rag-knowledge-card {
      margin-top: 14px;
      border-radius: 12px;
      border: 1px solid #10b981;
      background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
      padding: 14px 16px;
      box-shadow: 0 4px 14px rgba(16, 185, 129, 0.1);
      transition: all 0.25s ease;
    }
    .rag-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 12px;
      padding-bottom: 8px;
      border-bottom: 1px solid rgba(16, 185, 129, 0.25);
    }
    .rag-title {
      font-weight: 800;
      font-size: 13px;
      color: #065f46;
      display: flex;
      align-items: center;
      gap: 6px;
    }
    .rag-doc-item {
      background: #ffffff;
      border: 1px solid #a7f3d0;
      border-radius: 10px;
      padding: 12px 14px;
      margin-bottom: 8px;
      box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    }
    .rag-doc-head {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 8px;
      margin-bottom: 8px;
    }
    .rag-doc-name {
      color: #047857 !important;
      font-size: 13px !important;
      font-weight: 800 !important;
      line-height: 1.35 !important;
      display: flex;
      align-items: center;
      gap: 6px;
    }
    .rag-doc-number {
      font-size: 10.5px !important;
      font-weight: 700 !important;
      color: #0f172a !important;
      background: #e2e8f0 !important;
      border: 1px solid #cbd5e1 !important;
      border-radius: 6px !important;
      padding: 3px 8px !important;
      white-space: nowrap !important;
    }
    .rag-doc-excerpt {
      font-size: 12px !important;
      color: #334155 !important;
      margin: 0 0 8px 0 !important;
      line-height: 1.5 !important;
    }
    .rag-doc-list {
      margin: 0 !important;
      padding-left: 18px !important;
      font-size: 11.5px !important;
      color: #1e293b !important;
      line-height: 1.55 !important;
    }
    .rag-doc-list li {
      margin-bottom: 4px !important;
      color: #1e293b !important;
    }

    /* DARK MODE STYLES FOR RAG CARD */
    html.dark .rag-knowledge-card {
      background: linear-gradient(135deg, rgba(6, 78, 59, 0.4) 0%, rgba(15, 23, 42, 0.9) 100%) !important;
      border: 1px solid rgba(16, 185, 129, 0.5) !important;
      box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4) !important;
    }
    html.dark .rag-header {
      border-bottom-color: rgba(16, 185, 129, 0.3) !important;
    }
    html.dark .rag-title {
      color: #34d399 !important;
    }
    html.dark .rag-doc-item {
      background: rgba(15, 23, 42, 0.95) !important;
      border: 1px solid rgba(16, 185, 129, 0.35) !important;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
    }
    html.dark .rag-doc-name {
      color: #34d399 !important;
    }
    html.dark .rag-doc-number {
      color: #f1f5f9 !important;
      background: #1e293b !important;
      border-color: #475569 !important;
    }
    html.dark .rag-doc-excerpt {
      color: #cbd5e1 !important;
    }
    html.dark .rag-doc-list {
      color: #e2e8f0 !important;
    }
    html.dark .rag-doc-list li {
      color: #e2e8f0 !important;
    }

    .input-form-flex {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .chat-textarea {
      flex: 1;
      border: 1.5px solid #cbd5e1;
      border-radius: 16px;
      padding: 14px 20px;
      font-size: 15px;
      resize: none;
      min-height: 52px;
      max-height: 130px;
      outline: none;
      transition: border-color 0.2s, box-shadow 0.2s;
      font-family: inherit;
      color: #0f172a;
      background: #ffffff;
      box-sizing: border-box;
      line-height: 1.45;
    }

    .chat-textarea:focus {
      border-color: #2563eb;
      box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    }

    .btn-mic-icon {
      width: 50px;
      height: 50px;
      border-radius: 16px;
      border: 1.5px solid #cbd5e1;
      background: #f8fafc;
      color: #475569;
      font-size: 19px;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: all 0.2s ease;
      flex-shrink: 0;
    }

    .btn-mic-icon:hover {
      background: #eff6ff;
      color: #2563eb;
      border-color: #93c5fd;
    }

    .btn-mic-icon.recording {
      background: #dc2626 !important;
      color: #ffffff !important;
      border-color: #dc2626 !important;
      animation: mic-pulse 1.5s infinite cubic-bezier(0.45, 0, 0.55, 1);
    }

    @keyframes mic-pulse {
      0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7);
      }

      70% {
        transform: scale(1.08);
        box-shadow: 0 0 0 12px rgba(220, 38, 38, 0);
      }

      100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0);
      }
    }

    .btn-send-icon {
      width: 50px;
      height: 50px;
      border-radius: 16px;
      background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
      color: #ffffff;
      border: none;
      font-size: 19px;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: all 0.2s ease;
      box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
      flex-shrink: 0;
    }

    .btn-send-icon:hover {
      transform: translateY(-2px);
      box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
    }

    .input-hint-text {
      color: #94a3b8;
    }

    /* Loading dots */
    .loading-dot {
      display: inline-block;
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: #2563eb;
      animation: loading-dot-jump 1.2s infinite ease-in-out both;
    }

    .loading-dot:nth-child(1) {
      animation-delay: -0.32s;
    }

    .loading-dot:nth-child(2) {
      animation-delay: -0.16s;
    }

    @keyframes loading-dot-jump {

      0%,
      80%,
      100% {
        transform: scale(0);
      }

      40% {
        transform: scale(1);
      }
    }

    /* ============================================================
       EXECUTIVE INTELLIGENCE CARD (HIGH-TECH GLASSMORPHISM)
       ============================================================ */
    .ai-insight-box {
      background: linear-gradient(145deg, rgba(255,255,255,0.97) 0%, rgba(237,246,255,0.96) 50%, rgba(245,240,255,0.95) 100%);
      border: 1px solid rgba(14, 165, 233, 0.22);
      border-radius: 18px;
      padding: 0;
      margin-bottom: 16px;
      box-shadow: 0 12px 32px -6px rgba(14, 165, 233, 0.12), 0 4px 12px -2px rgba(0, 0, 0, 0.05);
      position: relative;
      overflow: hidden;
      backdrop-filter: blur(12px);
      transition: all 0.3s ease;
      width: 100%;
      max-width: 100%;
      min-width: 0;
      box-sizing: border-box;
    }
    .ai-insight-box::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      width: 4px;
      height: 100%;
      background: linear-gradient(180deg, #38bdf8 0%, #2563eb 50%, #8b5cf6 100%);
      border-radius: 4px 0 0 4px;
    }
    /* Header band */
    .ai-insight-header-band {
      background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 60%, #1e40af 100%);
      padding: 11px 18px 11px 22px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
      gap: 8px;
      width: 100%;
      max-width: 100%;
      box-sizing: border-box;
    }
    .ai-insight-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
      gap: 10px;
      padding: 12px 18px 10px 22px;
      border-bottom: 1px solid rgba(14, 165, 233, 0.12);
    }
    .ai-insight-header-left {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
    }
    .ai-insight-pulse {
      width: 8px;
      height: 8px;
      background: #38bdf8;
      border-radius: 50%;
      display: inline-block;
      box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.7);
      animation: aiIntelPulse 2s infinite;
    }
    @keyframes aiIntelPulse {
      0% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.7); }
      70% { box-shadow: 0 0 0 7px rgba(56, 189, 248, 0); }
      100% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0); }
    }
    .ai-insight-badge {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      background: rgba(255,255,255,0.12);
      color: #e0f2fe;
      padding: 3px 9px;
      border-radius: 20px;
      font-size: 10px;
      font-weight: 800;
      letter-spacing: 0.6px;
      border: 1px solid rgba(255,255,255,0.2);
      text-transform: uppercase;
    }
    .ai-insight-domain-pill {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      background: rgba(255,255,255,0.18);
      color: #ffffff;
      padding: 3px 10px;
      border-radius: 6px;
      font-size: 11.5px;
      font-weight: 700;
      border: 1px solid rgba(255,255,255,0.25);
    }
    .ai-insight-header-right {
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .ai-insight-total-pill {
      font-size: 11.5px;
      font-weight: 700;
      color: #bfdbfe;
      background: rgba(255,255,255,0.1);
      padding: 3px 10px;
      border-radius: 20px;
      border: 1px solid rgba(255,255,255,0.15);
    }
    .ai-insight-voice-btn {
      background: linear-gradient(135deg, rgba(255,255,255,0.22), rgba(255,255,255,0.1));
      color: #e0f2fe;
      border: 1px solid rgba(255,255,255,0.25);
      border-radius: 6px;
      padding: 4px 10px;
      font-size: 11px;
      font-weight: 700;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 5px;
      transition: all 0.2s;
      backdrop-filter: blur(4px);
    }
    .ai-insight-voice-btn:hover {
      background: rgba(255,255,255,0.28);
      transform: translateY(-1px);
      color: #ffffff;
    }
    /* Body padding wrapper */
    .ai-insight-body {
      padding: 14px 18px 14px 22px;
    }
    /* Micro stats strip */
    .ai-intel-micro-stats {
      display: flex;
      gap: 6px;
      flex-wrap: wrap;
      margin-bottom: 12px;
      padding-bottom: 12px;
      border-bottom: 1px dashed rgba(14,165,233,0.15);
    }
    .ai-intel-micro-stat {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      background: rgba(14,165,233,0.06);
      border: 1px solid rgba(14,165,233,0.15);
      border-radius: 8px;
      padding: 4px 10px;
      font-size: 11px;
      font-weight: 600;
      color: #0369a1;
    }
    .ai-intel-micro-stat i { opacity: 0.75; }

    /* 3-KPI Cards Grid */
    .ai-intel-kpi-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 10px;
      margin-bottom: 12px;
    }
    @media (max-width: 768px) {
      .ai-intel-kpi-grid {
        grid-template-columns: 1fr;
      }
    }
    .ai-intel-kpi-card {
      background: #ffffff;
      border: 1px solid rgba(226, 232, 240, 0.9);
      border-radius: 13px;
      padding: 11px 13px;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      position: relative;
      overflow: hidden;
      box-shadow: 0 2px 8px rgba(0,0,0,0.04);
      transition: transform 0.2s, box-shadow 0.2s;
    }
    .ai-intel-kpi-card:hover {
      transform: translateY(-2px);
      box-shadow: 0 6px 18px rgba(0,0,0,0.08);
    }
    .ai-intel-kpi-card.gold {
      border-top: 3px solid #f59e0b;
      background: linear-gradient(160deg, rgba(254,243,199,0.45) 0%, #ffffff 60%);
    }
    .ai-intel-kpi-card.purple {
      border-top: 3px solid #8b5cf6;
      background: linear-gradient(160deg, rgba(237,233,254,0.45) 0%, #ffffff 60%);
    }
    .ai-intel-kpi-card.cyan {
      border-top: 3px solid #06b6d4;
      background: linear-gradient(160deg, rgba(207,250,254,0.45) 0%, #ffffff 60%);
    }
    .ai-intel-kpi-tag {
      font-size: 9.5px;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      margin-bottom: 5px;
      display: flex;
      align-items: center;
      gap: 4px;
    }
    .ai-intel-kpi-tag.gold { color: #d97706; }
    .ai-intel-kpi-tag.purple { color: #7c3aed; }
    .ai-intel-kpi-tag.cyan { color: #0891b2; }

    .ai-intel-kpi-name {
      font-size: 13px;
      font-weight: 700;
      color: #0f172a;
      line-height: 1.3;
      margin-bottom: 7px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .ai-intel-kpi-stat-row {
      display: flex;
      align-items: baseline;
      justify-content: space-between;
      gap: 6px;
      margin-bottom: 7px;
    }
    .ai-intel-kpi-value {
      font-size: 17px;
      font-weight: 800;
      color: #1e293b;
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
      letter-spacing: -0.3px;
    }
    .ai-intel-kpi-pct {
      font-size: 12px;
      font-weight: 800;
      padding: 2px 7px;
      border-radius: 12px;
    }
    .ai-intel-kpi-pct.gold { background: rgba(245, 158, 11, 0.15); color: #b45309; }
    .ai-intel-kpi-pct.purple { background: rgba(139, 92, 246, 0.15); color: #6d28d9; }
    .ai-intel-kpi-pct.cyan { background: rgba(6, 182, 212, 0.15); color: #0e7490; }

    .ai-intel-bar-bg {
      width: 100%;
      height: 5px;
      background: rgba(226,232,240,0.8);
      border-radius: 4px;
      overflow: hidden;
    }
    .ai-intel-bar-fill {
      height: 100%;
      border-radius: 4px;
      transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .ai-intel-bar-fill.gold { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
    .ai-intel-bar-fill.purple { background: linear-gradient(90deg, #a78bfa, #7c3aed); }
    .ai-intel-bar-fill.cyan { background: linear-gradient(90deg, #22d3ee, #0891b2); }

    /* Strategic Callout Box */
    .ai-intel-callout {
      background: linear-gradient(135deg, rgba(239,246,255,0.9) 0%, rgba(245,243,255,0.9) 100%);
      border: 1px solid rgba(147,197,253,0.5);
      border-radius: 13px;
      padding: 12px 14px;
      display: flex;
      gap: 12px;
      align-items: flex-start;
    }
    .ai-intel-callout-icon {
      width: 34px;
      height: 34px;
      border-radius: 10px;
      background: linear-gradient(135deg, #2563eb, #7c3aed);
      color: #ffffff;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 15px;
      flex-shrink: 0;
      box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
    }
    .ai-intel-callout-content {
      flex: 1;
      font-size: 12.5px;
      line-height: 1.6;
      color: #334155;
    }
    .ai-intel-callout-title {
      font-size: 10.5px;
      font-weight: 800;
      letter-spacing: 0.6px;
      text-transform: uppercase;
      color: #2563eb;
      margin-bottom: 5px;
      display: flex;
      align-items: center;
      gap: 6px;
    }
    .ai-intel-callout-text {
      font-size: 12.5px;
      line-height: 1.65;
      color: #1e293b;
      font-weight: 500;
    }
    .ai-intel-male-stat {
      font-size: 11px;
      font-weight: 700;
      color: #0369a1;
    }
    .ai-intel-female-stat {
      font-size: 11px;
      font-weight: 700;
      color: #be185d;
    }
    .studio-total-cell {
      color: #1e293b;
    }
    .ai-intel-chip {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      background: rgba(255, 255, 255, 0.85);
      border: 1px solid rgba(147,197,253,0.5);
      border-radius: 6px;
      padding: 3px 8px;
      color: #475569;
      font-weight: 600;
      font-size: 11px;
    }

    /* Studio Action Button */
    .btn-studio-action {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 10px;
      width: 100%;
      padding: 12px 20px;
      margin-top: 14px;
      background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #0284c7 100%);
      color: #ffffff !important;
      font-size: 13.5px;
      font-weight: 700;
      border: none;
      border-radius: 12px;
      box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
      cursor: pointer;
      transition: all 0.2s ease-in-out;
      text-decoration: none;
    }
    .btn-studio-action:hover {
      transform: translateY(-2px);
      box-shadow: 0 8px 22px rgba(37, 99, 235, 0.38);
      filter: brightness(1.08);
      color: #ffffff !important;
    }

    /* Universal Analytics Studio Modal Styles */
    .studio-modal-backdrop {
      display: none;
      position: fixed;
      top: 0; left: 0; right: 0; bottom: 0;
      background: rgba(15, 23, 42, 0.85);
      backdrop-filter: blur(8px);
      z-index: 999999;
      align-items: center;
      justify-content: center;
      padding: 16px;
      overscroll-behavior: contain;
    }
    .studio-modal-card {
      background: #ffffff;
      width: 100%;
      max-width: 1120px;
      max-height: 92vh;
      border-radius: 20px;
      box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
      border: 1px solid #e2e8f0;
      display: flex;
      flex-direction: column;
      overflow: hidden;
      animation: modalPopIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }
    .studio-modal-header {
      background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 50%, #2563eb 100%);
      color: #ffffff;
      padding: 16px 22px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-shrink: 0;
    }
    .studio-header-icon {
      font-size: 26px;
      width: 46px;
      height: 46px;
      border-radius: 12px;
      background: rgba(255, 255, 255, 0.18);
      display: flex;
      align-items: center;
      justify-content: center;
      border: 1px solid rgba(255, 255, 255, 0.28);
      flex-shrink: 0;
    }
    .studio-kpi-grid {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 12px;
      padding: 12px 22px;
      background: #f8fafc;
      border-bottom: 1px solid #e2e8f0;
      flex-shrink: 0;
    }
    .studio-kpi-card {
      background: #ffffff;
      border: 1px solid #e2e8f0;
      border-radius: 12px;
      padding: 10px 14px;
      box-shadow: 0 2px 4px rgba(0,0,0,0.02);
      min-width: 0;
    }
    .studio-kpi-card .label {
      font-size: 11px;
      font-weight: 700;
      color: #64748b;
      text-transform: uppercase;
      letter-spacing: 0.4px;
      margin-bottom: 2px;
    }
    .studio-kpi-card .value {
      font-size: 17px;
      font-weight: 800;
      color: #1e293b;
    }
    .studio-kpi-card .sub {
      font-size: 11px;
      color: #64748b;
    }
    .studio-tabs-bar {
      display: flex;
      gap: 8px;
      padding: 10px 22px 0 22px;
      background: #f8fafc;
      border-bottom: 1px solid #e2e8f0;
      flex-shrink: 0;
    }
    .studio-tab-btn {
      padding: 8px 18px;
      border: none;
      background: transparent;
      font-size: 13px;
      font-weight: 700;
      color: #64748b;
      border-bottom: 3px solid transparent;
      cursor: pointer;
      transition: all 0.2s ease;
    }
    .studio-tab-btn.active {
      color: #2563eb;
      border-bottom-color: #2563eb;
      background: #ffffff;
      border-top-left-radius: 8px;
      border-top-right-radius: 8px;
    }
    .studio-modal-body {
      flex: 1 1 auto;
      overflow-y: auto;
      min-height: 0;
      -webkit-overflow-scrolling: touch;
      overscroll-behavior: contain;
      padding: 18px 22px;
    }
    .studio-table-scroll-wrapper {
      border: 1px solid #e2e8f0;
      border-radius: 12px;
      overflow-x: auto;
      overflow-y: auto;
      max-height: 420px;
      -webkit-overflow-scrolling: touch;
      position: relative;
      background: #ffffff;
    }
    .studio-table-scroll-wrapper table {
      width: 100%;
      min-width: 680px;
      margin-bottom: 0;
    }
    .studio-table-scroll-wrapper thead th {
      position: sticky;
      top: 0;
      z-index: 3;
      background: #f8fafc;
      box-shadow: 0 1px 2px rgba(0,0,0,0.06);
    }
    .studio-table-scroll-wrapper tfoot td {
      position: sticky;
      bottom: 0;
      z-index: 3;
      box-shadow: 0 -1px 2px rgba(0,0,0,0.06);
    }
    .studio-modal-footer {
      padding: 12px 22px;
      background: #f8fafc;
      border-top: 1px solid #e2e8f0;
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-shrink: 0;
      gap: 10px;
    }
    .studio-search-toolbar {
      display: flex;
      flex-wrap: wrap;
      gap: 12px;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 14px;
    }
    .studio-search-input-wrap {
      position: relative;
      display: flex;
      align-items: center;
      flex: 1;
      min-width: 260px;
      max-width: 480px;
    }
    .studio-search-clear-btn {
      position: absolute;
      right: 10px;
      top: 50%;
      transform: translateY(-50%);
      background: none;
      border: none;
      color: #94a3b8;
      cursor: pointer;
      padding: 4px 6px;
      font-size: 14px;
      display: none;
      align-items: center;
      justify-content: center;
      transition: color 0.15s ease;
    }
    .studio-search-clear-btn:hover {
      color: #ef4444;
    }
    .studio-search-controls {
      display: flex;
      align-items: center;
      gap: 10px;
      flex-wrap: wrap;
    }

    @media (max-width: 768px) {
      .studio-modal-backdrop {
        padding: 0 !important;
        align-items: stretch !important;
        justify-content: stretch !important;
      }
      .studio-modal-card {
        width: 100vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        max-width: 100vw !important;
        max-height: 100vh !important;
        max-height: 100dvh !important;
        border-radius: 0 !important;
        border: none !important;
        box-shadow: none !important;
        animation: none !important;
      }
      .studio-modal-header {
        padding: 10px 14px !important;
      }
      .studio-header-icon {
        width: 36px !important;
        height: 36px !important;
        font-size: 18px !important;
        border-radius: 8px !important;
      }
      #studio-title {
        font-size: 14px !important;
        line-height: 1.25 !important;
      }
      #studio-subtitle {
        font-size: 11px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 220px !important;
      }
      .studio-kpi-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 6px !important;
        padding: 6px 10px !important;
      }
      .studio-kpi-card {
        padding: 6px 8px !important;
        border-radius: 8px !important;
      }
      .studio-kpi-card .label {
        font-size: 9.5px !important;
        margin-bottom: 1px !important;
      }
      .studio-kpi-card .value {
        font-size: 13.5px !important;
        line-height: 1.2 !important;
      }
      .studio-kpi-card .sub {
        font-size: 9.5px !important;
      }
      .studio-tabs-bar {
        padding: 4px 10px 0 10px !important;
        gap: 4px !important;
        overflow-x: auto;
      }
      .studio-tab-btn {
        padding: 6px 12px !important;
        font-size: 12px !important;
        white-space: nowrap !important;
      }
      .studio-modal-body {
        padding: 10px 12px !important;
      }
      .studio-search-toolbar {
        margin-bottom: 8px !important;
        gap: 8px !important;
      }
      .studio-search-input-wrap {
        min-width: 100% !important;
        max-width: 100% !important;
      }
      .studio-search-controls {
        width: 100% !important;
        justify-content: space-between !important;
      }
      .studio-table-scroll-wrapper {
        border-radius: 8px !important;
        max-height: calc(100dvh - 360px) !important;
        min-height: 180px !important;
      }
      .studio-modal-footer {
        padding: 8px 12px !important;
        gap: 6px !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        justify-content: space-between !important;
        align-items: center !important;
      }
      .studio-footer-note {
        font-size: 10px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 38% !important;
      }
      .studio-footer-actions {
        display: flex !important;
        gap: 5px !important;
        flex-shrink: 0 !important;
      }
      .studio-footer-actions .studio-btn-act {
        padding: 6px 9px !important;
        font-size: 11px !important;
        border-radius: 6px !important;
        white-space: nowrap !important;
      }
    }
    @media (max-width: 480px) {
      .studio-footer-note {
        display: none !important;
      }
      .studio-footer-actions {
        width: 100% !important;
        justify-content: space-between !important;
      }
      .studio-footer-actions .studio-btn-act {
        flex: 1 !important;
        text-align: center !important;
      }
    }

    /* Modal Animation */
    @keyframes modalPopIn {
      from {
        opacity: 0;
        transform: scale(0.92) translateY(12px);
      }
      to {
        opacity: 1;
        transform: scale(1) translateY(0);
      }
    }

    /* =========================================================================
       2. DARK MODE DEDICATED OVERRIDES (Active when <html class="dark">)
       ========================================================================= */
    html.dark body {
      background-color: #0b0f19 !important;
      color: #f1f5f9 !important;
    }

    html.dark .content-wrapper {
      background-color: #0b0f19 !important;
    }

    /* Main Container Card */
    html.dark .ai-chat-wrapper {
      background: #0f172a !important;
      border-color: #1e293b !important;
      box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
    }

    /* Top Bar */
    html.dark .ai-chat-header {
      background: linear-gradient(135deg, #090d16 0%, #0f172a 50%, #1e3a8a 100%) !important;
      border-bottom: 1px solid #1e293b !important;
      box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35) !important;
    }

    /* Messages Area */
    html.dark .ai-chat-messages {
      background: #0b0f19 !important;
    }

    html.dark .ai-chat-messages::-webkit-scrollbar-thumb {
      background: #334155;
    }

    /* AI Chat Bubble in Dark Mode */
    html.dark .chat-bubble-ai {
      background: #1e293b !important;
      border-color: #334155 !important;
      color: #f1f5f9 !important;
      box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
    }

    html.dark .chat-bubble-ai p {
      color: #cbd5e1 !important;
    }
    html.dark #welcome-greeting-title {
      color: #38bdf8 !important;
    }

    html.dark .chat-bubble-ai strong,
    html.dark .chat-bubble-ai b {
      color: #ffffff !important;
    }

    html.dark .chat-bubble-ai .ai-header-bar {
      border-bottom-color: #334155 !important;
    }

    html.dark .chat-bubble-ai .ai-header-bar strong {
      color: #f8fafc !important;
    }

    /* User Bubble in Dark Mode */
    html.dark .chat-bubble-user {
      background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%) !important;
      color: #ffffff !important;
      box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4) !important;
    }

    /* 3-Tier Tabs in Dark Mode */
    html.dark .tier-tabs-bar {
      background: rgba(15, 23, 42, 0.7) !important;
      border-color: #334155 !important;
    }

    html.dark .tier-tab-btn {
      color: #94a3b8 !important;
    }

    html.dark .tier-tab-btn:hover {
      background: rgba(255, 255, 255, 0.08) !important;
      color: #f1f5f9 !important;
    }

    html.dark .tier-tab-btn.active {
      background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
      color: #ffffff !important;
      box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4) !important;
    }

    html.dark .filter-select,
    html.dark .filter-input {
      background: #1e293b !important;
      border-color: #334155 !important;
      color: #f8fafc !important;
    }

    /* Quick Chips in Dark Mode */
    html.dark .quick-chips-box {
      background: #131c2e !important;
      border-color: #1e3a8a !important;
    }

    html.dark .quick-chips-box .box-title {
      color: #60a5fa !important;
    }

    html.dark .chip-btn {
      background: #1e293b !important;
      border-color: #334155 !important;
      color: #f1f5f9 !important;
    }

    html.dark .chip-btn:hover {
      background: #2563eb !important;
      border-color: #3b82f6 !important;
      color: #ffffff !important;
      box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4) !important;
    }

    html.dark .chip-btn.amber {
      background: rgba(245, 158, 11, 0.15) !important;
      border-color: rgba(245, 158, 11, 0.35) !important;
      color: #fbbf24 !important;
    }

    html.dark .chip-btn.amber:hover {
      background: #d97706 !important;
      border-color: #f59e0b !important;
      color: #ffffff !important;
    }

    /* AI Inline Code Badges */
    html.dark .ai-inline-code {
      background: rgba(99, 102, 241, 0.28) !important;
      color: #c7d2fe !important;
      border: 1px solid rgba(129, 140, 248, 0.25) !important;
    }

    /* Stat Cards in Dark Mode */
    html.dark .stat-card-box {
      background: #131c2e !important;
      border-color: #1e3a8a !important;
    }

    html.dark .stat-card-box .stat-box-title {
      color: #60a5fa !important;
    }

    html.dark .stat-card-box .stat-box-sub {
      color: #94a3b8 !important;
    }

    html.dark .stat-card {
      background: #1e293b !important;
      border-color: #334155 !important;
    }

    html.dark .stat-card .label {
      color: #94a3b8 !important;
    }

    html.dark .stat-card .value {
      color: #ffffff !important;
    }

    /* Action CTA Dark Mode */
    html.dark .action-cta-wrapper {
      background: linear-gradient(135deg, rgba(15, 23, 42, 0.9) 0%, rgba(30, 41, 59, 0.8) 100%) !important;
      border-color: rgba(56, 189, 248, 0.28) !important;
      box-shadow: 0 8px 26px rgba(0, 0, 0, 0.45) !important;
    }
    html.dark .action-cta-heading {
      border-bottom-color: rgba(51, 65, 85, 0.8) !important;
    }
    html.dark .cta-heading-title {
      color: #f8fafc !important;
    }
    html.dark .cta-heading-sub {
      color: #94a3b8 !important;
    }
    html.dark .cta-heading-badge {
      background: rgba(56, 189, 248, 0.15) !important;
      color: #38bdf8 !important;
      border-color: rgba(56, 189, 248, 0.35) !important;
    }
    html.dark .cta-card-btn {
      background: rgba(30, 41, 59, 0.75) !important;
      border-color: rgba(71, 85, 105, 0.6) !important;
      box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25) !important;
    }
    html.dark .cta-card-btn:hover {
      background: rgba(30, 41, 59, 0.98) !important;
      border-color: #38bdf8 !important;
      box-shadow: 0 8px 24px rgba(56, 189, 248, 0.22) !important;
    }
    html.dark .cta-title {
      color: #f1f5f9 !important;
    }
    html.dark .cta-card-btn:hover .cta-title {
      color: #38bdf8 !important;
    }
    html.dark .cta-desc {
      color: #94a3b8 !important;
    }
    html.dark .cta-badge-blue, html.dark .cta-badge-primary {
      background: rgba(37, 99, 235, 0.22) !important;
      color: #93c5fd !important;
      border-color: rgba(59, 130, 246, 0.45) !important;
    }
    html.dark .cta-badge-amber {
      background: rgba(217, 119, 6, 0.22) !important;
      color: #fcd34d !important;
      border-color: rgba(245, 158, 11, 0.45) !important;
    }
    html.dark .cta-badge-green, html.dark .cta-badge-emerald {
      background: rgba(16, 185, 129, 0.22) !important;
      color: #6ee7b7 !important;
      border-color: rgba(16, 185, 129, 0.45) !important;
    }
    html.dark .cta-arrow-box {
      background: rgba(15, 23, 42, 0.75) !important;
      color: #94a3b8 !important;
    }
    html.dark .cta-card-btn:hover .cta-arrow-box {
      background: #0284c7 !important;
      color: #ffffff !important;
      box-shadow: 0 2px 10px rgba(2, 132, 199, 0.45) !important;
    }

    html.dark .stat-card.total .value {
      color: #60a5fa !important;
    }

    html.dark .stat-card.laki .value {
      color: #38bdf8 !important;
    }

    html.dark .stat-card.perempuan .value {
      color: #f472b6 !important;
    }

    /* Live Charts in Dark Mode */
    html.dark .live-charts-container {
      background: #1e293b !important;
      border-color: #334155 !important;
      box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
    }

    html.dark .chart-main-title {
      color: #f8fafc !important;
    }

    html.dark .badge-primary-light {
      background: rgba(37, 99, 235, 0.2) !important;
      color: #93c5fd !important;
      border-color: rgba(37, 99, 235, 0.4) !important;
    }

    html.dark .btn-chart-action {
      background: #0f172a !important;
      color: #cbd5e1 !important;
      border-color: #334155 !important;
    }

    html.dark .btn-chart-action:hover {
      background: #334155 !important;
      color: #f8fafc !important;
    }

    html.dark .chart-kpi-mini-card {
      background: #0f172a !important;
      border-color: #334155 !important;
    }

    html.dark .chart-kpi-val {
      color: #f8fafc !important;
    }

    html.dark .chart-kpi-label {
      color: #94a3b8 !important;
    }

    html.dark .chart-filter-toolbar {
      background: #0f172a !important;
      border-color: #334155 !important;
    }

    html.dark .chart-type-btn {
      background: #1e293b !important;
      border-color: #334155 !important;
      color: #cbd5e1 !important;
    }

    html.dark .chart-type-btn:hover {
      background: #334155 !important;
      color: #ffffff !important;
    }

    html.dark .chart-type-btn.active {
      background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
      color: #ffffff !important;
      border-color: #3b82f6 !important;
    }

    html.dark .chart-select-control {
      background: #1e293b !important;
      border-color: #334155 !important;
      color: #f8fafc !important;
    }

    html.dark .chart-select-wrapper {
      color: #cbd5e1 !important;
    }

    html.dark .chart-card-box {
      background: #0f172a !important;
      border-color: #334155 !important;
    }

    html.dark .chart-box-title-main {
      color: #cbd5e1 !important;
    }

    html.dark .chart-quick-drilldown {
      border-top-color: #334155 !important;
    }

    html.dark .chart-chip-mini {
      background: #1e293b !important;
      color: #cbd5e1 !important;
      border-color: #334155 !important;
    }

    html.dark .chart-chip-mini:hover {
      background: #334155 !important;
      color: #ffffff !important;
    }

    /* Tables in Dark Mode */
    html.dark .ai-data-table-wrapper {
      border-color: #334155 !important;
    }

    html.dark .ai-data-table-header {
      background: #1e293b !important;
      border-bottom-color: #334155 !important;
      color: #f8fafc !important;
    }

    html.dark .ai-data-table th {
      background: #0f172a !important;
      border-bottom-color: #334155 !important;
      color: #94a3b8 !important;
    }

    html.dark .ai-data-table td {
      border-bottom-color: #1e293b !important;
      color: #e2e8f0 !important;
      background: transparent !important;
    }

    html.dark .ai-data-table tr:hover td {
      background-color: #334155 !important;
    }

    html.dark .ai-data-table tfoot td {
      background: #0f172a !important;
      color: #60a5fa !important;
      border-top: 2px solid #3b82f6 !important;
    }

    /* Boundary / Limitation Callout Quote (Dark Mode) */
    html.dark .ai-quote-callout {
      background: rgba(30, 58, 138, 0.25) !important;
      border-left-color: #60a5fa !important;
      color: #f1f5f9 !important;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25) !important;
    }

    /* Forecasting Box in Dark Mode */
    html.dark .forecasting-box {
      background: linear-gradient(180deg, #181c32 0%, #0f172a 100%) !important;
      border-color: #3b2d54 !important;
      border-left-color: #a855f7 !important;
      box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4) !important;
    }

    html.dark .forecasting-title {
      color: #c084fc !important;
    }

    html.dark .forecasting-badge {
      background: rgba(139, 92, 246, 0.25) !important;
      color: #d8b4fe !important;
      border-color: rgba(168, 85, 247, 0.4) !important;
    }

    html.dark .forecasting-table-wrap {
      border-color: #334155 !important;
      background: #0f172a !important;
    }

    html.dark .forecasting-table thead th {
      background: #1e1b38 !important;
      color: #d8b4fe !important;
      border-bottom-color: #334155 !important;
    }

    html.dark .forecasting-table tbody td {
      border-bottom-color: #1e293b !important;
      background: #0f172a !important;
      color: #e2e8f0 !important;
    }

    html.dark .forecasting-table tbody tr:hover td {
      background-color: #1e293b !important;
    }

    html.dark .forecasting-table .col-year {
      color: #ffffff !important;
    }

    html.dark .forecasting-table .col-pop {
      color: #818cf8 !important;
    }

    html.dark .forecasting-table .col-growth {
      color: #4ade80 !important;
    }

    html.dark .forecasting-table .col-rate-badge {
      background: #1e293b !important;
      color: #cbd5e1 !important;
      border-color: #334155 !important;
    }

    html.dark .forecasting-card {
      background: #1e1b38 !important;
      border-color: #3b2d54 !important;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25) !important;
    }

    html.dark .forecasting-card .fc-label {
      color: #c084fc !important;
    }

    html.dark .forecasting-card .fc-val.text-purple {
      color: #d8b4fe !important;
    }

    html.dark .forecasting-card .fc-val.text-indigo {
      color: #93c5fd !important;
    }

    html.dark .forecasting-card .fc-val.text-amber {
      color: #fcd34d !important;
    }

    html.dark .forecasting-card .fc-sub {
      color: #94a3b8 !important;
    }

    /* Proactive Box in Dark Mode */
    html.dark .proactive-box {
      background: rgba(245, 158, 11, 0.1) !important;
      border-color: rgba(245, 158, 11, 0.25) !important;
    }

    html.dark .proactive-box strong {
      color: #fbbf24 !important;
    }

    html.dark .proactive-box .proactive-text {
      color: #fde68a !important;
    }

    /* OPD Directives in Dark Mode */
    html.dark .opd-container {
      background: #131c2e !important;
      border-color: #1e3a8a !important;
    }

    html.dark .opd-container .opd-main-title {
      color: #60a5fa !important;
    }

    html.dark .opd-directive-item {
      background: #1e293b !important;
      border-color: #334155 !important;
      color: #cbd5e1 !important;
    }

    html.dark .opd-directive-item strong {
      color: #ffffff !important;
    }

    /* Bottom Input Bar in Dark Mode */
    html.dark .ai-chat-input-bar {
      background: #0f172a !important;
      border-top-color: #1e293b !important;
    }

    html.dark .chat-textarea {
      background: #1e293b !important;
      border-color: #334155 !important;
      color: #f8fafc !important;
    }

    html.dark .chat-textarea:focus {
      border-color: #3b82f6 !important;
      box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25) !important;
    }

    html.dark .chat-textarea::placeholder {
      color: #64748b !important;
    }

    html.dark .btn-mic-icon {
      background: #1e293b !important;
      border-color: #334155 !important;
      color: #94a3b8 !important;
    }

    html.dark .btn-mic-icon:hover {
      background: #334155 !important;
      color: #38bdf8 !important;
      border-color: #60a5fa !important;
    }

    html.dark .input-hint-text {
      color: #64748b !important;
    }

    html.dark .voice-bar {
      background: rgba(220, 38, 38, 0.2) !important;
      border-top-color: rgba(220, 38, 38, 0.4) !important;
    }

    /* Mic Permission Modal Dark Mode */
    html.dark #modal-mic-permission .mic-modal-card {
      background: #1e293b !important;
      border-color: #334155 !important;
      color: #f8fafc !important;
    }
    html.dark #modal-mic-permission .mic-modal-body {
      color: #cbd5e1 !important;
    }
    html.dark #modal-mic-permission .mic-instruction-box {
      background: #0f172a !important;
      color: #94a3b8 !important;
      border-color: #334155 !important;
    }
    html.dark #modal-mic-permission .btn-modal-close {
      background: #334155 !important;
      border-color: #475569 !important;
      color: #f8fafc !important;
    }

    /* Universal Executive Intelligence Card Dark Mode */
    html.dark .ai-insight-box {
      background: linear-gradient(145deg, rgba(15,23,42,0.96) 0%, rgba(30,41,59,0.98) 100%) !important;
      border: 1px solid rgba(56, 189, 248, 0.25) !important;
      box-shadow: 0 12px 36px -6px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
      color: #f1f5f9 !important;
    }
    html.dark .ai-insight-header-band {
      background: linear-gradient(135deg, #020617 0%, #0c1a3a 60%, #0f2364 100%) !important;
      border-bottom: 1px solid rgba(56, 189, 248, 0.2) !important;
    }
    html.dark .ai-insight-body {
      background: transparent !important;
    }
    html.dark .ai-intel-micro-stats {
      border-bottom-color: rgba(56, 189, 248, 0.12) !important;
    }
    html.dark .ai-intel-micro-stat {
      background: rgba(56, 189, 248, 0.08) !important;
      border-color: rgba(56, 189, 248, 0.2) !important;
      color: #7dd3fc !important;
    }
    html.dark .ai-insight-header {
      border-bottom-color: rgba(56, 189, 248, 0.2) !important;
    }
    html.dark .ai-insight-badge {
      background: rgba(56, 189, 248, 0.15) !important;
      color: #38bdf8 !important;
      border-color: rgba(56, 189, 248, 0.35) !important;
    }
    html.dark .ai-insight-domain-pill {
      background: rgba(255,255,255,0.15) !important;
      color: #e0f2fe !important;
    }
    html.dark .ai-insight-total-pill {
      background: rgba(255,255,255,0.08) !important;
      color: #bfdbfe !important;
      border-color: rgba(255,255,255,0.12) !important;
    }
    html.dark .ai-intel-kpi-card {
      background: rgba(15, 23, 42, 0.9) !important;
      border-color: rgba(51, 65, 85, 0.9) !important;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35) !important;
    }
    html.dark .ai-intel-kpi-card.gold {
      background: linear-gradient(180deg, rgba(245, 158, 11, 0.08) 0%, rgba(30, 41, 59, 0.9) 100%) !important;
    }
    html.dark .ai-intel-kpi-card.purple {
      background: linear-gradient(180deg, rgba(139, 92, 246, 0.08) 0%, rgba(30, 41, 59, 0.9) 100%) !important;
    }
    html.dark .ai-intel-kpi-card.cyan {
      background: linear-gradient(180deg, rgba(6, 182, 212, 0.08) 0%, rgba(30, 41, 59, 0.9) 100%) !important;
    }
    html.dark .ai-intel-kpi-name {
      color: #f8fafc !important;
    }
    html.dark .ai-intel-kpi-value {
      color: #f8fafc !important;
    }
    html.dark .ai-intel-bar-bg {
      background: #1e293b !important;
    }
    html.dark .ai-intel-callout {
      background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 41, 59, 0.85) 100%) !important;
      border: 1px solid rgba(56, 189, 248, 0.32) !important;
      box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45) !important;
    }
    html.dark .ai-intel-callout-icon {
      background: linear-gradient(135deg, #0284c7, #6366f1) !important;
      color: #ffffff !important;
      box-shadow: 0 0 16px rgba(56, 189, 248, 0.4) !important;
    }
    html.dark .ai-intel-callout-content {
      color: #f1f5f9 !important;
    }
    html.dark .ai-intel-callout-title {
      color: #38bdf8 !important;
      text-shadow: 0 0 12px rgba(56, 189, 248, 0.35);
    }
    html.dark .ai-intel-callout-text {
      color: #f1f5f9 !important;
      font-weight: 400;
      text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
    }
    html.dark .ai-intel-chip {
      background: rgba(30, 41, 59, 0.9) !important;
      border-color: rgba(56, 189, 248, 0.3) !important;
      color: #e2e8f0 !important;
      box-shadow: 0 2px 6px rgba(0,0,0,0.25) !important;
    }
    html.dark .ai-intel-chip .text-primary {
      color: #38bdf8 !important;
    }
    html.dark .ai-intel-chip .text-success {
      color: #4ade80 !important;
    }
    html.dark .ai-intel-chip .text-info {
      color: #22d3ee !important;
    }
    html.dark .ai-intel-male-stat {
      color: #38bdf8 !important;
    }
    html.dark .ai-intel-female-stat {
      color: #f472b6 !important;
    }
    html.dark .studio-total-cell {
      color: #f8fafc !important;
    }
    html.dark .studio-modal-card {
      background: #0f172a !important;
      border-color: #334155 !important;
      color: #f1f5f9 !important;
    }
    html.dark .studio-kpi-grid,
    html.dark .studio-tabs-bar,
    html.dark .studio-modal-footer {
      background: #1e293b !important;
      border-color: #334155 !important;
    }
    html.dark .studio-kpi-card {
      background: #0f172a !important;
      border-color: #334155 !important;
    }
    html.dark .studio-kpi-card .value {
      color: #f8fafc !important;
    }
    html.dark .studio-tab-btn {
      color: #94a3b8 !important;
    }
    html.dark .studio-tab-btn.active {
      color: #60a5fa !important;
      border-bottom-color: #60a5fa !important;
      background: #0f172a !important;
    }
    html.dark #studio-search-input,
    html.dark #studio-sort-select {
      background: #1e293b !important;
      color: #f1f5f9 !important;
      border-color: #334155 !important;
    }
    html.dark .studio-matrix-table td,
    html.dark .studio-table-scroll-wrapper td {
      color: #cbd5e1 !important;
      border-color: #334155 !important;
    }
    html.dark .studio-table-scroll-wrapper {
      border-color: #334155 !important;
      background: #0f172a !important;
    }
    html.dark .studio-table-scroll-wrapper thead th {
      background: #1e293b !important;
      color: #f1f5f9 !important;
      box-shadow: 0 1px 2px rgba(0,0,0,0.3) !important;
    }
    html.dark .studio-matrix-table tfoot td,
    html.dark .studio-table-scroll-wrapper tfoot td {
      background: #1e293b !important;
      color: #f8fafc !important;
      box-shadow: 0 -1px 2px rgba(0,0,0,0.3) !important;
    }
    html.dark .studio-search-clear-btn {
      color: #64748b !important;
    }
    html.dark .studio-search-clear-btn:hover {
      color: #f87171 !important;
    }
    .studio-search-match {
      background: #fef08a;
      color: #854d0e;
      padding: 1px 4px;
      border-radius: 4px;
      font-weight: 700;
    }
    html.dark .studio-search-match {
      background: rgba(234, 179, 8, 0.4) !important;
      color: #fef08a !important;
    }

    /* JARVIS Arc Reactor & Audio Wave Glow */
    .ai-avatar-icon.jarvis-speaking,
    .welcome-card-avatar.jarvis-speaking {
      box-shadow: 0 0 25px rgba(6, 182, 212, 0.9), 0 0 50px rgba(14, 165, 233, 0.6) !important;
      border-color: #38bdf8 !important;
      animation: arcReactorPulse 1.2s infinite alternate !important;
    }

    @keyframes arcReactorPulse {
      0% {
        box-shadow: 0 0 15px rgba(6, 182, 212, 0.7), 0 0 30px rgba(14, 165, 233, 0.4);
        transform: scale(1);
      }

      100% {
        box-shadow: 0 0 30px rgba(56, 189, 248, 1), 0 0 60px rgba(6, 182, 212, 0.85);
        transform: scale(1.05);
      }
    }

    .jarvis-hud-badge {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      background: rgba(6, 182, 212, 0.2);
      border: 1px solid rgba(56, 189, 248, 0.5);
      color: #38bdf8;
      padding: 2px 8px;
      border-radius: 6px;
      font-size: 10px;
      font-weight: 800;
      letter-spacing: 0.5px;
    }

    /* =========================================================================
       3. RESPONSIVE BREAKPOINTS & MOBILE FIRST UX
       ========================================================================= */
    .header-brand-group {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .header-main-title {
      margin: 0;
      font-size: 17px;
      font-weight: 800;
      letter-spacing: -0.2px;
      color: #ffffff !important;
    }

    .desktop-header-controls {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
    }

    .mobile-header-controls {
      display: none;
    }

    .btn-header-icon-mobile {
      width: 36px;
      height: 36px;
      border-radius: 10px;
      background: rgba(255, 255, 255, 0.15);
      border: 1px solid rgba(255, 255, 255, 0.25);
      color: #ffffff;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 14px;
      cursor: pointer;
      transition: all 0.2s ease;
      outline: none;
    }

    .btn-header-icon-mobile:hover,
    .btn-header-icon-mobile:active {
      background: rgba(255, 255, 255, 0.3);
      color: #ffffff;
    }

    .mobile-settings-panel {
      background: #0f172a;
      border-bottom: 1px solid #1e293b;
      padding: 12px 14px;
      animation: slideDownPanel 0.2s ease-out;
      box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
      z-index: 10;
    }

    @keyframes slideDownPanel {
      from {
        opacity: 0;
        transform: translateY(-8px);
      }

      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    .export-buttons-group {
      display: flex;
      align-items: center;
      gap: 8px;
      margin: 12px 0;
      flex-wrap: wrap;
    }

    /* Tablet Devices (<= 991px) */
    @media (max-width: 991.98px) {
      .content-wrapper {
        padding: 8px 10px !important;
      }

      .ai-chat-wrapper {
        height: calc(100vh - 120px);
      }

      .ai-chat-header {
        padding: 10px 14px !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
        height: auto !important;
        min-height: 52px !important;
      }

      .header-subtitle {
        display: none !important;
      }

      .jarvis-hud-badge,
      .badge-gemini {
        display: none !important;
      }

      .desktop-header-controls {
        gap: 6px !important;
        flex-wrap: wrap !important;
      }

      .desktop-header-controls select {
        max-width: 130px !important;
      }

      .chart-kpi-summary-row {
        grid-template-columns: repeat(2, 1fr);
      }
    }

    /* Mobile Phones (<= 767.98px) */
    @media (max-width: 767.98px) {

      html,
      body {
        height: 100% !important;
        height: 100dvh !important;
        overflow: hidden !important;
        position: fixed !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
      }

      .wrapper {
        position: fixed !important;
        top: 0 !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        height: 100% !important;
        height: 100dvh !important;
        min-height: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
        background: var(--chat-bg) !important;
      }

      .main-header {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        height: 48px !important;
        min-height: 48px !important;
        margin-left: 0 !important;
        padding: 0 10px !important;
        display: flex !important;
        align-items: center !important;
        z-index: 1000 !important;
      }

      .main-header #navbar-brand-title {
        font-size: 13.5px !important;
      }

      .content-wrapper {
        position: fixed !important;
        top: 48px !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        height: calc(100% - 48px) !important;
        height: calc(100dvh - 48px) !important;
        min-height: 0 !important;
        max-height: none !important;
        padding: 0 !important;
        margin: 0 !important;
        overflow: hidden !important;
        z-index: 99 !important;
        display: flex !important;
        flex-direction: column !important;
      }

      .main-footer {
        display: none !important;
      }

      .ai-chat-wrapper {
        position: absolute !important;
        top: 0 !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        height: 100% !important;
        min-height: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        border-radius: 0 !important;
        border: none !important;
        box-shadow: none !important;
        overflow: hidden !important;
        background: var(--chat-bg) !important;
      }

      .ai-chat-header {
        flex: 0 0 42px !important;
        height: 42px !important;
        min-height: 42px !important;
        padding: 4px 10px !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 6px !important;
        z-index: 10 !important;
      }

      .header-brand-group {
        gap: 6px !important;
      }

      .header-main-title {
        font-size: 13px !important;
      }

      .ai-avatar-icon {
        width: 28px !important;
        height: 28px !important;
        font-size: 13px !important;
        border-radius: 6px !important;
      }

      .ai-status-badge {
        font-size: 9px !important;
        padding: 1px 5px !important;
      }

      .desktop-header-controls {
        display: none !important;
      }

      .mobile-header-controls {
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
      }

      .btn-header-icon-mobile {
        width: 32px !important;
        height: 32px !important;
        font-size: 12px !important;
      }

      .ai-chat-messages {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        padding: 14px 10px !important;
        gap: 12px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
      }

      .chat-row-user {
        max-width: 95% !important;
        min-width: 0 !important;
        gap: 6px !important;
        box-sizing: border-box !important;
      }

      .chat-row-ai {
        max-width: 100% !important;
        width: 100% !important;
        min-width: 0 !important;
        gap: 6px !important;
        box-sizing: border-box !important;
      }

      .ai-msg-avatar {
        width: 28px !important;
        height: 28px !important;
        font-size: 12px !important;
        border-radius: 8px !important;
        flex-shrink: 0 !important;
      }

      .chat-bubble-ai {
        padding: 12px 10px !important;
        border-radius: 14px !important;
        font-size: 13px !important;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04) !important;
        min-width: 0 !important;
        max-width: calc(100% - 34px) !important;
        width: calc(100% - 34px) !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
      }

      .chat-bubble-user {
        padding: 10px 12px !important;
        border-radius: 16px 16px 4px 16px !important;
        font-size: 13px !important;
        min-width: 0 !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
      }

      .stat-card-box {
        padding: 10px 8px !important;
        margin: 10px 0 !important;
        border-radius: 10px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
      }

      .stat-card-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 6px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
      }

      .stat-card {
        padding: 8px 8px !important;
        border-radius: 8px !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
      }

      .stat-card .label {
        font-size: 9px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
      }

      .stat-card .value {
        font-size: 13.5px !important;
        margin-top: 2px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
      }

      .tier-tabs-bar {
        padding: 3px !important;
        gap: 3px !important;
        border-radius: 10px !important;
        margin: 10px 0 !important;
        display: flex !important;
        flex-wrap: wrap !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
      }

      .tier-tab-btn {
        flex: 1 1 calc(33.333% - 4px) !important;
        min-width: 70px !important;
        padding: 6px 3px !important;
        font-size: 9.5px !important;
        border-radius: 6px !important;
        white-space: normal !important;
        line-height: 1.2 !important;
        box-sizing: border-box !important;
      }

      .filter-toolbar {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 6px !important;
        width: 100% !important;
      }

      .filter-select,
      .filter-input {
        width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
      }

      .chip-btn {
        white-space: normal !important;
        max-width: 100% !important;
        line-height: 1.3 !important;
        font-size: 11px !important;
        padding: 5px 10px !important;
      }

      .export-buttons-group {
        display: grid !important;
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)) !important;
        gap: 6px !important;
        width: 100% !important;
        margin: 10px 0 !important;
      }

      .btn-export-excel,
      .btn-export-pdf,
      .btn-export-all {
        width: 100% !important;
        font-size: 10.5px !important;
        padding: 7px 6px !important;
        justify-content: center !important;
        text-align: center !important;
        border-radius: 8px !important;
      }

      .proactive-box {
        padding: 10px 12px !important;
        margin-top: 10px !important;
        border-radius: 10px !important;
      }

      .ai-chat-input-bar {
        flex: 0 0 auto !important;
        padding: 12px 14px !important;
        padding-bottom: max(28px, calc(env(safe-area-inset-bottom, 0px) + 24px)) !important;
        background: var(--chat-card-bg) !important;
        border-top: 1.5px solid var(--border-light) !important;
        box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.12) !important;
        z-index: 20 !important;
      }

      .input-form-flex {
        display: flex !important;
        align-items: center !important;
        gap: 10px !important;
        width: 100% !important;
      }

      .chat-textarea {
        flex: 1 1 auto !important;
        min-height: 56px !important;
        height: 56px !important;
        max-height: 140px !important;
        padding: 15px 20px !important;
        font-size: 15px !important;
        border-radius: 28px !important;
        line-height: 1.45 !important;
        border: 2px solid #94a3b8 !important;
        box-sizing: border-box !important;
        background: #ffffff !important;
        color: #0f172a !important;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05) !important;
      }

      .chat-textarea:focus {
        border-color: #2563eb !important;
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2) !important;
      }

      html.dark .chat-textarea {
        background: #1e293b !important;
        border-color: #475569 !important;
        color: #f8fafc !important;
      }

      html.dark .chat-textarea:focus {
        border-color: #3b82f6 !important;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3) !important;
      }

      .btn-mic-icon,
      .btn-send-icon {
        width: 52px !important;
        height: 52px !important;
        min-width: 52px !important;
        min-height: 52px !important;
        font-size: 20px !important;
        border-radius: 50% !important;
        flex-shrink: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12) !important;
      }

      .input-hint-text {
        display: none !important;
      }

      .live-charts-container {
        padding: 10px 10px !important;
        margin: 10px 0 !important;
        border-radius: 10px !important;
      }

      .chart-main-title {
        font-size: 11px !important;
      }

      .chart-type-btn {
        font-size: 9.5px !important;
        padding: 3px 6px !important;
      }

      .chart-select-wrapper {
        font-size: 10px !important;
      }

      .chart-select-control {
        font-size: 10px !important;
        padding: 2px 4px !important;
      }

      .chart-kpi-summary-row {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 6px !important;
        margin-bottom: 10px !important;
      }

      .chart-kpi-mini-card {
        padding: 6px 8px !important;
      }

      .chart-kpi-val {
        font-size: 12px !important;
      }

      .chart-kpi-label {
        font-size: 9px !important;
      }

      .voice-bar {
        padding: 8px 12px !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
      }

      .voice-bar strong {
        font-size: 11.5px !important;
      }
    }

    /* Small Mobile Phones (<= 420px) */
    @media (max-width: 420px) {
      .header-main-title {
        font-size: 13px !important;
      }

      .tier-tab-btn {
        font-size: 9px !important;
        padding: 5px 2px !important;
      }
    }
