/* =====================================================
   DESIGN TOKENS (THEME SYSTEM — MASTER)
   ===================================================== */

:root {
  /* RAW COLORS */
  --color-blue-600: #1565C0;
  --color-blue-700: #0F4FA8;

  --color-red-600: #dc2626;

  --color-gray-50: #EEF2F5;
  --color-gray-900: #0f172a;
  --color-white: #ffffff;

  /* SEMANTIC TOKENS */
  --bg-app: var(--color-gray-50);
  --bg-leftbar: #1F2A33;
  --bg-sidebar: #EEF2F5;
  --bg-panel: var(--color-white);

  --text-primary: var(--color-gray-900);
  --text-secondary: #64748b;
  --text-invert: var(--color-white);

  --accent: var(--color-blue-600);
  --danger: var(--color-red-600);

  /* ===== GLOBAL CARD SYSTEM ===== */
  --card-bg: #ffffff;
  --card-border: #e6eaf0;
  --card-shadow: 0 4px 12px rgba(17, 24, 39, 0.04);
  --card-radius: 14px;
  --card-padding-y: 10px;
  --card-padding-x: 20px;
  --card-spacing: 15px;

  /* ===== GLOBAL SETTINGS ===== */
  --settings-padding-x: 120px;
  --settings-section-top-first: 15px;
  --settings-section-top-default: 15px;

  --tab-active-bg: #dbeafe;
  --tab-hover-bg: var(--state-hover-bg);
  --tab-active-border: var(--accent);
  --tab-active-color: var(--accent);



  /* SURFACE SYSTEM (neutral, reusable) */
  --surface-soft-bg: #f8fafc;
  --surface-soft-border: #e2e8f0;

  --surface-muted-border: #e5e7eb;
  --surface-strong-border: #cbd5e1;

  /* FORM ELEMENTS */
  --input-bg: var(--color-white);
  --input-border: #e5e7eb;
  --input-text: var(--text-primary);

  /* INTERACTIVE STATES */
  --state-hover-bg: rgba(21, 101, 192, 0.06);
  --state-hover-border: rgba(21, 101, 192, 0.35);

  --state-active-bg: rgba(21, 101, 192, 0.12);
  --state-active-border: rgba(21, 101, 192, 0.5);

  /* VISITOR AVATAR COLOR LIST */

  --avatar-1: #D6E3FF;
  --avatar-2: #DED4FF;
  --avatar-3: #D7ECFF;
  --avatar-4: #E1DCF3;
  --avatar-5: #DCE7E7;

  --avatar-content: #64748b;



  /* CHAT */
  --chat-bg-visitor: #ebf0f5;
  --chat-bg-operator: #5AA6FF;
  --chat-bg-system: var(--color-white);

  --chat-bg-ai: #8A63D2;
  --chat-bg-ai-dark: #7A56CD;
  --chat-bg-ai-light: #9A76E0;
  --chat-text-ai: #fff;

  --chat-border-system: #dfe2e6;
  --chat-text-system: #afb7c3;

  --chat-time-system: 1;
  --chat-time-operator: 0.7;
  --chat-time-ai: 0.6;
  --chat-time-visitor: 0.5;

  /* SHORTCUT BUTTONS */

  --shortcut-btn-bg: #f8fafc;
  --shortcut-btn-border: #e2e8f0;
  --shortcut-btn-text: #334155;
  --shortcut-btn-hover-bg: #eef2f7;

  /* SPACING */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 24px;

  /* RADIUS */
  --radius-sm: 6px;
  --radius-md: 10px;

  /* FONT */
  --font-main: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;



  /* ============================= */
  /* UI DESIGN TOKENS */
  /* ============================= */

  /* SPACING */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 24px;

  /* RADIUS */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;

  /* SHADOW */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);

  /* BORDER */
  --border-light: #e6e8eb;

  /* SURFACES */
  --surface-primary: #ffffff;
  --surface-secondary: #f9fafb;

  /* TEXT */
  --text-primary: #111827;
  --text-secondary: #6b7280;




}


/* =====================================
   CONFIRM MODAL
   ===================================== */

.app-confirm-root {
  position: fixed;
  inset: 0;
  z-index: 20000;
}

.confirm-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);

  display: flex;
  align-items: center;
  justify-content: center;
}

.confirm-modal {
  width: 400px;
  background: #fff;
  border-radius: 12px;
  padding: 20px;

  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.confirm-header h3 {
  margin: 0;
  font-size: 16px;
}

.confirm-body {
  margin-top: 10px;
  font-size: 14px;
  color: #475569;
}

.confirm-actions {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.confirm-danger {
  border-top: 4px solid #ef4444;
}

.confirm-warning {
  border-top: 4px solid #f59e0b;
}

.confirm-error {
  border-top: 4px solid #dc2626;
}

.btn-danger {
  background: #dc2626 !important;
  color: #fff !important;
  border: none !important;
}


/* =====================================
    GLOBAL APP STATUS
 =====================================  */

#appSaveStatus.success {
  color: #16a34a;
}

#appSaveStatus.error {
  color: #dc2626;
}

#appSaveStatus.warning {
  color: #d97706;
}

#appSaveStatus {
  opacity: 0;
  transform: translateY(-2px);

  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

#appSaveStatus.saved {
  opacity: 1;
  transform: translateY(0);
}






/* =====================================================
   GLOBAL BUTTONS
   ===================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  /*font-family: var(--font-main);*/
  font-size: 13px;

  cursor: pointer;
  border-radius: 6px;
  min-width: 130px;
  border: none;
}

.btn-lg {
  padding: 7px 35px;
}

.btn-primary {
  background: #1565C0;
  color: white;
  border-radius: 8px;
}

.btn-primary:hover {
  background: #0F4FA8;
}

/* Jeśli martwy to usunąć!
.view-header .btn-primary {
  height: 35px;
  padding: 0 25px;
  font-size: 12px;
  line-height: 1;
}   */

.tool-btn {
  background: transparent;
  border: none;
  width: 34px;
  min-height: 30px;

  font-size: 13px;
  cursor: pointer;
  color: #334155;

  transition: background 0.15s ease, border 0.15s ease;
}

.tool-btn:hover {
  background: rgba(21, 101, 192, 0.08);
  color: var(--accent);
}

.tool-btn:not(.tool-ai):not(.tool-shortcut).active {
  background: rgba(21, 101, 192, 0.08);
  border: 1px solid rgba(21, 101, 192, 0.35);
  color: var(--accent);
}

.btn-neutral {
  background: #ffffff;
  color: #334155;
  border: 1px solid #d1d5db;
}

.btn-neutral:hover {
  background: #f3f4f6;
}

.btn-md {
  padding: 5px 25px;
}

.btn-outline-primary {
  background: #ffffff;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.btn-outline-primary:hover {
  background: rgba(21, 101, 192, 0.06);
}

.btn-outline-danger {
  background: #ffffff;
  color: var(--danger);
  border: 1px solid var(--danger);
}

.btn-outline-danger:hover {
  background: rgba(220, 38, 38, 0.06);
}

.btn-outline-success {
  background: #ffffff;
  color: #16a34a;
  border: 1px solid #16a34a;
}

.btn-outline-success:hover {
  background: rgba(22, 163, 74, 0.06);
}



/* =====================================================
   GLOBAL ICON BUTTONS
   ===================================================== */

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 37px;
  height: 29px;

  border: 1px solid var(--card-border);
  border-radius: 6px;
  background: transparent;

  cursor: pointer;
  transition: all 0.15s ease;
}

.icon-btn:hover {
  background: var(--hover-bg);
  border-color: var(--border-default);
}

.icon-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

.icon-btn svg {
  width: 14px;
  height: 14px;
  display: block;
}

.icon-btn-neutral {
  color: var(--text-primary);
}

.icon-btn-danger {
  color: var(--color-red-600);
}

.icon-btn-danger:hover {
  background: #fef2f2;
  border-color: var(--color-red-600);
}




/* =====================================================
   GLOBAL BADGES
   ===================================================== */

/* BASE */
.badge-ui {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  box-sizing: border-box;

  height: 22px;
  padding: 0 8px;

  border-radius: 7px;
  border: 1px solid rgba(100, 116, 139, 0.12);

  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;

  background: #F8FAFC;
  color: #334155;

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 1px 2px rgba(15, 23, 42, 0.035);

  transition:
    transform 0.15s ease,
    border-color 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease;
}

.badge-ui:hover {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 1),
    0 2px 5px rgba(15, 23, 42, 0.06);
}

/* ================= STATES ================= */

.badge-success {
  background: #ECFDF3;
  color: #15803D;
  border-color: rgba(22, 163, 74, 0.16);
}

.badge-danger {
  background: #FEF2F2;
  color: #B91C1C;
  border-color: rgba(220, 38, 38, 0.16);
}

.badge-error {
  background: #FEF2F2;
  color: #B91C1C;
  border-color: rgba(220, 38, 38, 0.16);
}

.badge-warning {
  background: #FFF7ED;
  color: #C2410C;
  border-color: rgba(249, 115, 22, 0.18);
}

.badge-info {
  background: #EFF6FF;
  color: #1565C0;
  border-color: rgba(21, 101, 192, 0.16);
}

.badge-muted {
  background: #F8FAFC;
  color: #64748B;
  border-color: rgba(100, 116, 139, 0.14);
}

/* ================= SPECIAL ================= */

.badge-priority {
  background: #EEF2FF;
  color: #3730A3;
  border-color: rgba(55, 48, 163, 0.16);
  font-weight: 700;
  letter-spacing: 0.2px;
}

/* ================= WIDTH HELPERS ================= */

.badge-w-xs {
  width: 30px;
}

.badge-w-sm {
  width: 40px;
}

.badge-w-md {
  width: 65px;
}

.badge-w-lg {
  width: 80px;
}

.badge-w-xl {
  min-width: 100px;
}

/* ================= PLACEHOLDER ================= */

.badge-empty {
  visibility: hidden;
}

/* ================= ICON FIX ================= */

.badge-warning-icon {
  font-size: 16px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}

/* ================= GROUP ================= */

.badge-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}








/* =====================================================
   DROPDOWN MENU (GLOBAL)
   ===================================================== */

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 6px;

  min-width: 180px;

  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 10px;

  box-shadow: var(--shadow-md);

  padding: 6px 0;

  z-index: 1000;
}


.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;

  padding: 8px 12px;

  font-size: 13px;
  color: var(--text-primary);

  cursor: pointer;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
}

.dropdown-item:hover {
  background: var(--state-hover-bg);
}






/* =====================================================
   GLOBAL BASE
   ===================================================== */

body {
  margin: 0;
  font-family: var(--font-main);
  background: var(--bg-app);
  color: var(--text-primary);
  overflow: hidden;
  /* 👈 KLUCZ */
}

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
}

.hidden {
  display: none !important;
}

.settings-body {
  height: calc(100vh - 120px);
  overflow-y: auto;
}

/* ===== CORE LAYOUT ===== */

.app {
  display: flex;
  height: 100vh;
}

.main {
  flex: 1;

  display: flex;

  min-width: 0;
  min-height: 0;

  background: var(--bg-app);

  padding: 16px;
  gap: 0;

  box-sizing: border-box;
}

.main-content {
  flex: 1;

  display: flex;

  min-width: 0;
  min-height: 0;

  gap: 16px;
}

.view {
  display: flex;
  flex: 1;
  gap: 16px;
  min-width: 0;
}

.view>.card {
  flex: 1 1 auto;
  min-width: 0;
}


.view>.context {
  flex: 0 0 420px;
  width: 420px;
  min-width: 420px;
  max-width: 420px;
}


/* ------------------------------------------------------
   SETTINGS > WIDGET CONTENT  
--------------------------------------------------------*/

#view-settings.settings-widget-preview-mode .context {
  flex: 0 0 420px;
  width: 420px;
  min-width: 420px;
  max-width: 420px;
}






.view.hidden {
  display: none;
}

.card {
  background: var(--bg-panel);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.card-base {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);

  padding: var(--card-padding-y) var(--card-padding-x);

  box-shadow: var(--card-shadow);
}

/* TOP BANNER INFO */
.global-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;

  background: #fdecea;
  color: #b02a37;

  padding: 12px 40px 12px 16px;
  font-size: 14px;
  text-align: center;

  border-bottom: 1px solid #f5c2c7;
}

.global-banner.hidden {
  display: none;
}

.global-banner-close {
  position: absolute;
  right: 12px;
  top: 10px;
  cursor: pointer;
  font-weight: bold;
}

[data-tooltip] {
  cursor: help;
}

button[data-tooltip],
a[data-tooltip] {
  cursor: pointer;
}

/* ===== NAVIGATION ===== */

.leftbar {
  width: 70px;
  background: var(--bg-leftbar);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 0;
}

.leftbar-top {
  margin-bottom: 16px;
}

.avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.avatar-ring {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  position: relative;
}

.avatar-ring img {
  width: 90%;
  height: 90%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  box-shadow: 0 0 0 2px #1f2937;
}

.avatar-ring::after {
  content: '';
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid white;
  background: #9ca3af;
}

.avatar.online .avatar-ring::after {
  background: #22c55e;
}

.avatar.offline .avatar-ring::after {
  background: #9ca3af;
}

.avatar-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.avatar-modal:not(.hidden) {
  display: flex;
}

.avatar-modal-box {
  background: #fff;
  padding: 24px;
  border-radius: 12px;
  min-width: 400px;
}


/* MAIN ICONS */
.leftbar-main {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

/* BOTTOM ICONS */
.leftbar-bottom {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* BUTTON */
.lb-btn {
  width: 50px;
  height: 50px;
  border-radius: 10px;
  border: none;
  background: transparent;
  cursor: pointer;
  position: relative;

  display: flex;
  align-items: center;
  justify-content: center;
}

.lb-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.lb-btn.active {
  background: #1565C0;
}

/* UNREAD DOT */
.lb-btn[data-icon="chat"].has-unread::after {
  content: "";

  position: absolute;

  top: 8px;
  right: 8px;

  width: 10px;
  height: 10px;

  border-radius: 999px;

  background: #ef4444;
  border: 0px solid #ffffff;

  z-index: 10;
}


/* ICON (PNG / SVG) */
.lb-icon {
  width: 35px;
  /* ← JEDYNE miejsce do zmiany rozmiaru */
  height: 35px;
  object-fit: contain;
  pointer-events: none;
}

.sidebar {
  width: 210px;
  background: var(--bg-app);
  color: #313d4a;
  display: flex;
  flex: 0 0 210px;
  flex-direction: column;
  padding: 12px;
  box-sizing: border-box;

}



.logo {
  font-weight: 600;
  font-size: 18px;
  margin-bottom: var(--space-xl);
  padding: 0 10px;
}

.nav-item {
  font-size: 13px;
  opacity: 0.9;
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  /* 👈 rezerwujemy miejsce */
  color: #313d4a;
  padding: var(--space-sm) var(--space-md);
  text-align: left;
  border-radius: var(--radius-sm);
  cursor: pointer;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  /*justify-content: space-between;*/
  display: flex;
}

.nav-item.active {
  background: rgba(21, 101, 192, 0.10);
  border-color: rgba(21, 101, 192, 0.25);
  color: var(--accent);
}

.nav-item:hover {
  background: rgba(31, 41, 51, 0.06);
}

.nav-item .badge {
  background: #dc2626;
  color: var(--chat-bg-system);
  margin-left: auto;
}

.nav-count {
  margin-left: auto;
  margin-right: 4px;
  font-size: 12px;
  color: var(--text-secondary);
}

.nav-item[data-view="my"] .badge,
.nav-item[data-view="ai"] .badge,
.nav-item[data-view="rules-main"] .badge {
  background: #1565C0;
}

.nav-item[data-view="closed"] .badge {
  background: #6b7280;
}

.nav-item[data-view="inbox"] .badge.badge-muted {
  background: #6b7280;
}

.nav-icon {
  width: 16px;
  height: 16px;
  margin-right: 10px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  opacity: 1;
  flex-shrink: 0;
}

.nav-item:hover .nav-icon {
  opacity: 1;
}

.nav-item.active .nav-icon {
  opacity: 1;
}

.nav-label {
  margin-left: 2px;
}

.sidebar .nav-item .badge {
  margin-left: auto;
  min-width: 18px;
  text-align: center;
}

.nav-item.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.logout {
  margin-top: auto;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: var(--space-sm);
  cursor: pointer;
}

.avatar-menu {
  position: absolute;
  top: 12px;
  left: 75px;
  width: 200px;

  background: var(--chat-bg-system);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  font-size: 13px;
  z-index: 1000;

  padding-bottom: 10px;
  /* 👈 TO JEST KLUCZ */
}

.avatar-menu-header {
  padding: 12px 14px;
  font-weight: 600;
}

.avatar-menu-item {
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.avatar-menu-item:hover {
  background: #f3f4f6;
}

.avatar-menu-item.danger {
  color: #dc2626;
}

.avatar-menu-divider {
  height: 1px;
  background: #e5e7eb;
  margin: 4px 0;
}





/* SETTINGS — ADMIN SEPARATOR */
.settings-admin-separator {
  height: 1px;
  background: #e5e7eb;
  margin: 18px 0 10px 0;
  opacity: 0.8;
}

.settings-admin-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9ca3af;
  padding: 6px 7px;
}





/* LOAD MORE (LIST FOOTER ACTION) */
.load-more {
  flex: 0 0 50%;
  max-width: 50%;

  height: 40px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  background: var(--chat-bg-system);

  font-size: 13px;
  cursor: pointer;
  transition: 0.15s ease;
}

.load-more:hover {
  background: #f3f4f6;
}


#conversations li {
  padding: 12px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid #f0f1f3;
}

#conversations li.active {
  border-left-color: #1565C0;
  background: #eef4ff;
}

/* tylko teksty rozmowy, NIE avatary */
#conversations li .conversation-row .conversation-preview,
#conversations li .conversation-row .conversation-id {
  font-size: 13px;
}

/* 🔹 hover mode — clean actions (TYLKO zakładka Moje) */
#conversations.view-my li:hover .conversation-preview,
#conversations.view-my li:hover .conversation-time {
  opacity: 0;
  transition: opacity 0.15s ease;
}

/* 🔹 hover mode — clean actions dla widoków z akcjami admina */
#conversations.view-inbox li:hover .conversation-preview,
#conversations.view-inbox li:hover .conversation-time,
#conversations.view-ai li:hover .conversation-preview,
#conversations.view-ai li:hover .conversation-time,
#conversations.view-rules li:hover .conversation-preview,
#conversations.view-rules li:hover .conversation-time,
#conversations.view-closed li:hover .conversation-preview,
#conversations.view-closed li:hover .conversation-time {
  opacity: 0;
  transition: opacity 0.15s ease;
}


#conversations li.unread span {
  font-weight: 600;
}



.kbd {
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 5px;
  padding: 1px 5px;
  font-size: 10px;
  font-weight: 500;
  color: #374151;
}


/* ikony link, attach, undoo svg */
.tool-icon {
  width: 18px;
  height: 18px;
  display: block;
}

.attachment-card {
  display: inline-flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px;
  background: #f4f6f8;
  border-radius: 10px;
  border: 1px solid #e2e5e9;
  max-width: 260px;
  font-size: 13px;
}

.attachment-image {
  display: block;
}




/* AI TOOL BUTTON (SOFT SaaS) */
.tool-ai {
  padding: 6px 18px;
  border-radius: 8px;
  border: 2px solid var(--accent);
  /* grubsza ramka */
  background: rgba(21, 101, 192, 0.10);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.6px;
  color: var(--accent);
  box-shadow: 0 1px 2px rgba(21, 101, 192, 0.15);
  /* delikatna głębia */
}

.tool-ai:hover {
  background: rgba(21, 101, 192, 0.16);
}

.tool-ai:active {
  transform: translateY(1px);
}

.tool-ai,
.tool-shortcut {
  width: auto;
  /* height: auto; */
}

.tool-btn.tool-ai.ai-loading {
  opacity: 0.7;
  pointer-events: none;
  position: relative;
}

.tool-btn.tool-ai.ai-loading {
  pointer-events: none;
  animation: ai-border-pulse 1.2s ease-in-out infinite;
}

@keyframes ai-border-pulse {

  0% {
    border-color: #1565c0;
    box-shadow: 0 0 0px rgba(21, 101, 192, 0.4);
  }

  50% {
    border-color: #42a5f5;
    box-shadow: 0 0 10px rgba(21, 101, 192, 0.6);
  }

  100% {
    border-color: #1565c0;
    box-shadow: 0 0 0px rgba(21, 101, 192, 0.4);
  }
}

.emoji-menu {
  position: absolute;
  background: var(--chat-bg-system);
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
  padding: 8px 10px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  max-width: 240px;
  z-index: 1000;
}

.emoji-menu span {
  cursor: pointer;
  font-size: 18px;
}

.emoji-menu span:hover {
  transform: scale(1.2);
}

/* ===== SHORTCUT BUTTONS (PRO UNIFIED) ===== */

.tool-shortcut {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  height: 30px;
  width: 90px;
  padding: 0 18px;

  font-size: 11px;
  font-weight: 500;

  border-radius: 8px;

  border: 1px solid var(--shortcut-btn-border);
  background: var(--shortcut-btn-bg);
  color: var(--shortcut-btn-text);

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;

  cursor: pointer;
  transition: background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    transform 0.05s ease;
}

.tool-shortcut:hover {
  background: var(--shortcut-btn-hover-bg);
  border-color: var(--state-hover-border);
  color: var(--accent);
}

.tool-shortcut.active {
  background: var(--state-hover-bg);
  border-color: var(--state-hover-border);
  color: var(--accent);
}

.tool-shortcut-more::after {
  content: " ▲";
  font-size: 11px;
  font-weight: 600;
  margin-left: 4px;
  opacity: 0.7;
}

.shortcut-tooltip {
  position: fixed;
  max-width: 320px;
  padding: 10px 12px;
  background: var(--chat-bg-system);
  color: #111827;
  font-size: 11px;
  line-height: 1.4;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  white-space: pre-line;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s ease;
}

.shortcut-tooltip.visible {
  opacity: 1;
}







.closed-banner {
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text-secondary);
  background: #f3f4f6;
  border-top: 1px solid #e6e8eb;
  border-bottom: 1px solid #e6e8eb;
}

#takeoverModal .box {
  background: #fff;
  padding: 16px;
  max-width: 420px;
  margin: 12% auto;
  border-radius: 8px;
}



.page-size-select {
  height: 32px;
  padding: 4px 8px;
  font-size: 13px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  background: #fff;
}


.page-size-wrapper {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-size-label {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.1;
  text-align: right;
}

.dot {
  width: 8px;
  height: 8px;
  background: #e53935;
  border-radius: 50%;
  flex-shrink: 0;
}

/* close */
.close-btn {
  border: 1px solid #fca5a5;
  color: #dc2626;
}

.close-btn:hover {
  background: #fee2e2;
}

/* Oddaj = neutral */
/* wspólne */
.release-btn,
.close-btn {
  font-size: 11px;
  padding: 3px 0;
  width: 50px;
  text-align: center;
  background: transparent;
  border-radius: 4px;
  cursor: pointer;
}

/* release */
.release-btn {
  border: 1px solid #d1d5db;
  color: #6b7280;
}


.release-btn:hover {
  background: #f3f4f6;
}


/* reopen */
.reopen-btn {
  border: 1px solid #93c5fd;
  color: #2563eb;
}

.reopen-btn:hover {
  background: #dbeafe;
}


/* 🔹 actions overlay */
.conversation-actions {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);

  display: flex;
  gap: 6px;

  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

#conversations li:hover .conversation-actions {
  opacity: 1;
  pointer-events: auto;
}

/* 🔹 ważne — rodzic */
.conversation-meta {
  position: relative;
}


.conversation-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  /* 🔴 KLUCZOWE */
}

.conversation-row>div {
  min-width: 0;
  /* 🔴 BEZ TEGO ellipsis nie działa */
}

.conversation-avatar {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  flex-shrink: 0;

  display: flex;
  align-items: center;
  justify-content: center;
}


.conversation-flag {
  position: absolute !Important;
  right: -3px;
  bottom: 0cap;
  width: 16px !important;
  height: 12px !important;
  background-size: cover !important;
  border-radius: 2px;
  box-shadow: 0 0 0 1px white;

}


.avatar-color-1 {
  background: var(--avatar-1);
}

.avatar-color-2 {
  background: var(--avatar-2);
}

.avatar-color-3 {
  background: var(--avatar-3);
}

.avatar-color-4 {
  background: var(--avatar-4);
}

.avatar-color-5 {
  background: var(--avatar-5);
}


/* PNG avatar */
.avatar-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-icon svg {
  width: 26px;
  height: 26px;
  fill: var(--avatar-content);
  opacity: 0.55;
}

.conversation-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}


.conversation-avatar .avatar-initials-text {
  font-size: 22px;
  font-weight: 700;
  color: var(--avatar-content);
  line-height: 1;
  letter-spacing: 0.5px;
  user-select: none;
  opacity: 0.6;
}

.conversation-avatar .unread-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 13px;
  height: 13px;
  background: #dc2626;
  border-radius: 50%;
  border: 2px solid var(--chat-bg-system);
}

.conversation-meta {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

#conversations li .conversation-time {
  font-size: 11px;
  color: #9ca3af;
  line-height: 1;
  margin-bottom: 6px;
  user-select: none;
  white-space: nowrap;
}

.conversation-preview {
  font-size: 12px;
  color: #9ca3af;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
  display: block;
  max-width: 100%;
}

.conversation-id {
  font-weight: 600;
  transition: background-color 0.15s ease;
}

#conversations li .close-btn {
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease-in-out;
}

#conversations li:hover .close-btn {
  opacity: 1;
  pointer-events: auto;
}

#conversations li:hover {
  background-color: #f8fafc;
}

#conversations li {
  transition: background-color 0.15s ease, border-left-color 0.15s ease;
  border-left: 3px solid transparent;
  /* 👈 REZERWUJEMY MIEJSCE */
}




/* ======================================
   MESSAGE TRANSLATION (PRO CLEAN)
====================================== */
.msg-translation {
  display: block;
}

.msg-original {
  display: block;
  font-size: 12.5px;
  margin-top: 4px;
}

.operator .msg-original {
  opacity: 0.75;
}

.visitor .msg-original {
  opacity: 0.55;
}


#takeoverModal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .4);
}

.badge {
  margin-left: 6px;
  padding: 2px 6px;
  font-size: 12px;
  border-radius: 10px;
  background: red;
  color: white;
}


.search-more-btn {
  width: 36px;
  height: 36px;
  /* 👈 KLUCZ */
  border-radius: 8px;
  border: 1px solid #d1d5db;
  background: #fff;
  cursor: pointer;
  font-size: 18px;

  display: flex;
  /* 👇 WYŚRODKOWANIE */
  align-items: center;
  justify-content: center;
}

.search-menu-item {
  padding: 10px 14px;
  cursor: pointer;
}

.search-menu-item:hover {
  background: #f3f4f6;
}

.search-menu-item.danger {
  color: #dc2626;
  font-weight: 600;
  margin-top: 6px;
  /* 👈 3–5px, daję 6px dla oddechu */
}

.search-menu-item.disabled {
  color: #9ca3af;
  cursor: not-allowed;
}

.search-menu-divider {
  height: 1px;
  background: #e5e7eb;
  margin: 4px 0;
}

/* SEARCH MENU EXTENDED */
.search-menu-dates label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 10px;
  color: var(--text-secondary);

  padding: 0 10px;
  /* LEWY + PRAWY MARGINES */
}

.search-menu-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 8px 14px;
}

.search-menu-option.active {
  background: #e0edff;
  color: #1e40af;
  font-weight: 600;
}

.search-menu-group {
  padding: 4px 0;
}

.search-menu-option {
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
}

.search-menu-option.active {
  background: #e8f1ff;
  color: #1d4ed8;
  font-weight: 500;
}

.search-menu-dates input[type="date"] {
  height: 30px;
  font-size: 12px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  background: #fff;
}

.search-menu-dates label:last-child {
  margin-bottom: 8px;
}

/* SEARCH POPUP – ANCHOR FIX */
.search-wrap {
  position: relative;
  display: flex;
  gap: 6px;
  align-items: center;
}

.search-more-btn:hover {
  background: #f3f4f6;
}

.search-menu {
  position: fixed;

  top: 0;
  left: 100%;
  /* 👈 zaczyna się dokładnie za wrapperem */
  margin-left: 8px;
  /* 👈 odstęp od przycisku */

  width: 220px;

  background: var(--chat-bg-system);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  font-size: 13px;
  z-index: 1000;
}




.settings-body {
  overflow-x: hidden;
}

.settings-card {
  display: flex;
  justify-content: center;
}

.settings-content {
  flex: 1 1 0;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  display: block;
  padding: 0;
  box-sizing: border-box;
}

/* ===== SETTINGS PANELS (PRO STRUCTURE) ===== */

.settings-panel {
  flex: 1;
  display: none !important;
  overflow-y: auto;

  scrollbar-gutter: stable;

  padding-left: var(--settings-padding-x);
  padding-right: var(--settings-padding-x);

}

.settings-panel.active {
  display: block !important;
}



/* ===== LOGIN ===== */

.login {
  max-width: 320px;
  margin: 120px auto;
  background: #fff;
  padding: 24px;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .1);
}

.login h2 {
  margin-top: 0;
}

.login input {
  width: 100%;
  padding: 8px;
  margin-bottom: 8px;
}

.login button {
  width: 100%;
  padding: 8px;
}






/* ADMIN LAYOUT */
.layout-admin {
  display: flex;
}

.layout-admin .card:first-child {
  flex: 1;
}



/* ===== GLOBAL VIEW HEADER (PRO) ===== */

.view-header {
  padding: 10px 25px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* border-bottom: 1px solid #e5e7eb; */
  min-height: 40px;
  /* stała wysokość */
}

.view-header h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.view-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
}

.view-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 24px 5px 24px;
  box-sizing: border-box;
}

#visitorsBoxLive,
#visitorsBoxLive * {
  min-width: 0;
}

#visitorsBoxLive a,
#visitorsBoxLive div,
#visitorsBoxLive span {
  overflow-wrap: anywhere;
  word-break: break-word;
}



/* =====================================================
   PRZENIESĆ DO RULES CSS
   ===================================================== */
.chatpro-automation-box {
  position: fixed;
  bottom: 160px;
  right: 20px;
  width: 260px;
  background: #fff;
  border: 1px solid #ddd;
  padding: 8px;
  z-index: 999998;
  display: none;

  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);

  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.chatpro-automation-box.visible {
  display: block;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.chatpro-node {
  margin: 8px 4px;
  padding: 10px;
  background: #fff4e5;
  border: 1px solid #f0d9b5;
  border-radius: 8px;
}

.chatpro-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chatpro-button {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #ddd;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chatpro-button:hover {
  background: #111;
  color: #fff;
}

.chatpro-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ==== END ==== */


/* =====================================================
   THEME OVERRIDES
   ===================================================== */

body[data-theme="default"] {
  /* pusty — używa :root */
}


/* ==================== DARK ============================ */
body[data-theme="dark"] {

  /* === BASE LAYERS === */

  --bg-app: #0f172a;
  /* tło całej aplikacji */
  --bg-panel: #1e293b;
  /* karty / dialogi */
  --bg-leftbar: #0b1220;
  /* strukturalny akcent */

  /* === TEXT === */

  --text-primary: #e5e7eb;
  --text-secondary: #94a3b8;

  /* === ACCENT (PRO BLUE) === */

  --accent: #3b82f6;
  --accent-hover: #60a5fa;


  --surface-soft-bg: #1a2436;
  --surface-soft-border: rgba(148, 163, 184, 0.18);

  --input-bg: #0f172a;
  --input-border: rgba(148, 163, 184, 0.25);
  --input-text: #f1f5f9;

  --surface-strong-border: rgba(148, 163, 184, 0.35);


  /* === CHAT === */

  --chat-bg-visitor: #1e293b;
  --chat-bg-operator: #2563eb;
  --chat-bg-system: #1f2937;



}



/* ===== COMPONENT OVERRIDES ===== */

body[data-theme="dark"] .shortcut-item {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

body[data-theme="dark"] .nav-item {
  color: #94a3b8;
}

body[data-theme="dark"] .nav-item:hover {
  background: rgba(148, 163, 184, 0.08);
  color: #e5e7eb;
}

body[data-theme="dark"] .nav-item.active {
  background: rgba(59, 130, 246, 0.15);
  color: #ffffff;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

body[data-theme="dark"] .view-header h2 {
  color: #f1f5f9;
}

body[data-theme="dark"] .view-header {
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

body[data-theme="dark"] .logo {
  color: #e5e7eb;
  letter-spacing: 0.3px;
}


body[data-theme="green"] {
  --accent: #0f766e;
  --chat-bg-operator: #0f766e;
}







/* =====================================================
   RESPONSIVE FOUNDATION — FINAL
   ===================================================== */

/* ================= CONTEXT HANDLE ================= */

.context {
  position: relative;
  overflow: visible;
}


/* ================= DESKTOP >=1600 ================= */

@media (min-width: 1600px) {

  body.context-collapsed .context {
    flex: 0 0 0;
    width: 0;
    min-width: 0;
    max-width: 0;

    overflow: visible;
    box-shadow: none;
  }

}

/* ================= LAPTOP / TABLET / MOBILE <=1599 ================= */

@media (max-width: 1599px) {

  .view>.context {
    display: block !important;

    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;

    flex: none;

    width: var(--context-width, 340px);
    min-width: var(--context-width, 340px);
    max-width: var(--context-width, 340px);

    overflow-y: auto;
    overflow-x: hidden;

    z-index: 2000;

    transform: translateX(100%);
    transition: transform .18s ease;

    pointer-events: none;
  }

  body.context-expanded .view>.context {
    transform: translateX(0);
    pointer-events: auto;
  }

  body.sidebar-expanded::before,
  body.context-expanded::before {
    content: "";

    position: fixed;
    inset: 0;

    background: rgba(15, 23, 42, .22);

    z-index: 1500;
  }

  body.sidebar-expanded .main-content,
  body.context-expanded .main-content {
    pointer-events: none;
  }

  body.sidebar-expanded .sidebar,
  body.context-expanded .context {
    pointer-events: auto;
  }

  .context-global-toggle {
    right: 0;
  }

  body:not(.context-expanded) .context-global-toggle::before {
    content: "‹";
  }

  body.context-expanded .context-global-toggle::before {
    content: "›";
  }
}

/* ================= LAPTOP 1024–1599 ================= */

@media (min-width: 1024px) and (max-width: 1599px) {

  :root {
    --settings-padding-x: 40px;
  }

}


/* ================= TABLET 768–1023 ================= */

@media (min-width: 768px) and (max-width: 1023px) {

  :root {
    --settings-padding-x: 24px;
  }

  .sidebar {
    position: relative;
    z-index: 50;

    flex: 0 0 64px;
    width: 64px;
    min-width: 64px;
    max-width: 64px;

    padding: 12px 8px;
    overflow: hidden;

    align-items: center;
    box-sizing: border-box;
  }

  .sidebar .logo,
  .sidebar .settings-admin-title,
  .sidebar .nav-label,
  .sidebar .nav-count,
  .sidebar .badge {
    display: none;
  }

  .sidebar .nav-item {
    width: 44px;
    height: 36px;
    padding: 0;
    margin-bottom: 6px;

    display: flex;
    align-items: center;
    justify-content: center;

    box-sizing: border-box;
    font-size: 0;
  }

  .sidebar .nav-icon {
    margin: 0;
  }

  body.sidebar-expanded .sidebar {
    position: fixed;
    top: 0;
    left: var(--leftbar-width, 70px);
    bottom: 0;

    flex: none;

    width: var(--sidebar-width, 210px);
    min-width: var(--sidebar-width, 210px);
    max-width: var(--sidebar-width, 210px);

    z-index: 2000;

    align-items: stretch;
    overflow-y: auto;
    overflow-x: hidden;

    box-shadow: 12px 0 30px rgba(15, 23, 42, .18);
  }

  body.sidebar-expanded .sidebar .logo,
  body.sidebar-expanded .sidebar .settings-admin-title,
  body.sidebar-expanded .sidebar .nav-label,
  body.sidebar-expanded .sidebar .nav-count,
  body.sidebar-expanded .sidebar .badge {
    display: block;
  }

  body.sidebar-expanded .sidebar .logo {
    margin-bottom: var(--space-xl);
  }

  body.sidebar-expanded .sidebar .nav-item {
    width: 100%;
    height: auto;
    padding: var(--space-sm) var(--space-md);

    display: flex;
    align-items: center;
    justify-content: flex-start;

    font-size: 13px;
  }

  body.sidebar-expanded .sidebar .nav-icon {
    margin-right: 10px;
  }

  #shortcutsPreviewContainer {
    flex: 1;
    min-width: 0;
    margin-right: 8px;
  }

}


/* ================= MOBILE <768 ================= */

@media (max-width: 767px) {

  :root {
    --settings-padding-x: 16px;
    --leftbar-width: 52px;
  }

  .main {
    padding: 0;
  }

  .main-content {
    gap: 0;
  }

  .view {
    gap: 0;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: var(--leftbar-width, 60px);
    bottom: 0;

    width: calc(100vw - var(--leftbar-width, 60px) - 72px);
    max-width: 260px;
    min-width: 220px;

    z-index: 2000;

    overflow-y: auto;
    overflow-x: hidden;

    transform: translateX(calc(-100% - var(--leftbar-width, 60px)));
    transition: transform .18s ease;

    pointer-events: none;
  }

  body.sidebar-expanded .sidebar {
    transform: translateX(0);
    pointer-events: auto;
  }

  #shortcutsPreviewContainer {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
    min-width: 0;
  }

  #shortcutsPreviewContainer .tool-shortcut {
    flex: 0 1 auto;
    max-width: 100%;
  }

  .leftbar {
    width: var(--leftbar-width, 52px);
    min-width: var(--leftbar-width, 52px);
    max-width: var(--leftbar-width, 52px);
  }

  .lb-btn {
    width: 42px;
    height: 42px;
  }

  .lb-icon {
    width: 30px;
    height: 30px;
  }

  .avatar,
  .avatar-ring {
    width: 42px;
    height: 42px;
  }

}


/* =====================================================
   SIDEBAR OVERLAY — KEEP COMPACT RAIL SPACE
   ===================================================== */

@media (min-width: 768px) and (max-width: 1249px) {

  body.sidebar-expanded .main {
    margin-left: 64px;
  }

}



/* =====================================================
   CHAT — NARROW LAPTOP SIDEBAR OVERLAY
   1024–1249 only for chat
   ===================================================== */

@media (min-width: 1024px) and (max-width: 1249px) {

  body:has(#view-chat:not(.hidden)) .sidebar {
    position: relative;
    z-index: 50;

    flex: 0 0 64px;
    width: 64px;
    min-width: 64px;
    max-width: 64px;

    padding: 12px 8px;
    overflow: hidden;

    align-items: center;
    box-sizing: border-box;
  }

  body:has(#view-chat:not(.hidden)) .sidebar .logo,
  body:has(#view-chat:not(.hidden)) .sidebar .settings-admin-title,
  body:has(#view-chat:not(.hidden)) .sidebar .nav-label,
  body:has(#view-chat:not(.hidden)) .sidebar .nav-count,
  body:has(#view-chat:not(.hidden)) .sidebar .badge {
    display: none;
  }

  body:has(#view-chat:not(.hidden)) .sidebar .nav-item {
    width: 44px;
    height: 36px;
    padding: 0;
    margin-bottom: 6px;

    display: flex;
    align-items: center;
    justify-content: center;

    box-sizing: border-box;
    font-size: 0;
  }

  body:has(#view-chat:not(.hidden)) .sidebar .nav-icon {
    margin: 0;
  }

  body.sidebar-expanded:has(#view-chat:not(.hidden)) .sidebar {
    position: fixed;
    top: 0;
    left: var(--leftbar-width, 70px);
    bottom: 0;

    flex: none;

    width: var(--sidebar-width, 210px);
    min-width: var(--sidebar-width, 210px);
    max-width: var(--sidebar-width, 210px);

    z-index: 2000;

    align-items: stretch;
    overflow-y: auto;
    overflow-x: hidden;

    box-shadow: 12px 0 30px rgba(15, 23, 42, .18);
  }

  body.sidebar-expanded:has(#view-chat:not(.hidden)) .sidebar .logo,
  body.sidebar-expanded:has(#view-chat:not(.hidden)) .sidebar .settings-admin-title,
  body.sidebar-expanded:has(#view-chat:not(.hidden)) .sidebar .nav-label,
  body.sidebar-expanded:has(#view-chat:not(.hidden)) .sidebar .nav-count,
  body.sidebar-expanded:has(#view-chat:not(.hidden)) .sidebar .badge {
    display: block;
  }

  body.sidebar-expanded:has(#view-chat:not(.hidden)) .sidebar .nav-item {
    width: 100%;
    height: auto;
    padding: var(--space-sm) var(--space-md);

    justify-content: flex-start;

    font-size: 13px;
  }

  body.sidebar-expanded:has(#view-chat:not(.hidden)) .sidebar .nav-icon {
    margin-right: 10px;
  }

}






/* =====================================================
   GLOBAL CONTEXT TOGGLE
   ===================================================== */

.context-global-toggle {

  position: fixed;

  top: 50%;
  right: 0;

  transform: translateY(-50%);

  width: 20px;
  height: 72px;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 0;

  border: none;
  border-radius: 8px 0 0 8px;

  background: #ffffff;
  color: #94a3b8;

  cursor: pointer;

  box-shadow: 0 4px 16px rgba(15, 23, 42, .12);

  transition:
    right .18s ease,
    background .15s ease,
    color .15s ease,
    transform .15s ease;

  z-index: 3000;

  font-size: 0;

}

.context-global-toggle::before {

  content: "›";

  font-size: 16px;
  line-height: 1;

}

.context-global-toggle:hover {

  background: #f8fafc;
  color: var(--accent);

}

.context-global-toggle:active {

  transform:
    translateY(-50%) scale(.96);

}


/* ================= DESKTOP ================= */

@media (min-width: 1600px) {

  /* Context otwarty */
  body:not(.context-collapsed) .context-global-toggle {
    right: 0;
  }

  /* Context zwinięty */
  body.context-collapsed .context-global-toggle {
    right: 0;
  }

  /* Kierunek strzałek */
  body:not(.context-collapsed) .context-global-toggle::before {
    content: "›";
  }

  body.context-collapsed .context-global-toggle::before {
    content: "‹";
  }

  body.context-collapsed #view-settings.settings-widget-preview-mode .context {
    flex: 0 0 0;
    width: 0;
    min-width: 0;
    max-width: 0;
  }

}