/* components.css
 * Extracted from the original inline <style> block.
 * Load order matters: see the <link> order in index.html.
 */
    /* ================= HEADER ACTION BAR (strict flexbox — no overlap) ================= */
    .header-actions {
      display: flex; gap: 15px; align-items: center; justify-content: flex-end;
      position: static;
    }
    .header-actions > * { position: static; flex: 0 0 auto; }
    .header-btn {
      display: inline-flex; align-items: center; justify-content: center;
      height: 2.5rem; min-width: 2.5rem; padding: 0 0.7rem;
      border-radius: 0.75rem; border: 1px solid rgba(255, 255, 255, 0.12);
      background: rgba(255, 255, 255, 0.06); color: #e8ecf5;
      font-size: 0.95rem; line-height: 1; font-weight: 600;
      transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
    }
    .header-btn:hover { background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.22); }
    .header-btn:active { transform: translateY(1px); }
    #chatHeader { flex-wrap: wrap; }
    #chatHeader > div:last-child { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; justify-content: flex-end; }
    @media (max-width: 768px) {
      .header-actions { gap: 10px; width: 100%; justify-content: flex-end; }
      #pageHeader { gap: 0.75rem; }
    }

    /* ================= TAB 2 HEADER ACTIONS (hard flex guard — no overlap) ================= */
    #chatActions {
      display: flex !important;
      flex-direction: row !important;
      gap: 12px !important;
      align-items: center !important;
      justify-content: flex-end !important;
      position: relative !important;
      width: auto;
      margin-left: auto;
      flex-wrap: wrap;
    }
    #chatActions > * {
      position: static !important;
      top: auto !important;
      right: auto !important;
      bottom: auto !important;
      left: auto !important;
      margin: 0 !important;
      flex: 0 0 auto;
    }
    /* Individual action buttons: no absolute/fixed offsets, no negative margins */
    #exportChatBtn, #importChatBtn, #openSettingsBtn, #openCharactersBtn, #editCharacterBtn, #immersiveToggle {
      position: static !important;
      top: auto !important;
      right: auto !important;
      bottom: auto !important;
      left: auto !important;
      margin: 0 !important;
      transform: none !important;
    }
    #immersiveToggle {
      position: static !important;
      top: auto !important; right: auto !important; bottom: auto !important; left: auto !important;
      margin: 0 !important;
      opacity: 1;
      transition: background 0.2s ease;
    }
    @media (max-width: 640px) {
      #chatActions { gap: 8px !important; }
    }

