/* ============================================================
   Multivendor Larix — Frontend Styles
   Colors: #121212 bg | #FF5722 primary | #00F0FF accent
           #00FF9F green | #FF2E63 pink | #FFAA00 yellow
   ============================================================ */

:root {
  --larix-bg:        #0B0E13;
  --larix-bg2:       #10151C;
  --larix-bg3:       #161D28;
  --larix-border:    #1F2D3D;
  --larix-primary:   #FF5722;
  --larix-primary2:  #E64A19;
  --larix-yellow:    #FFAA00;
  --larix-cyan:      #00F0FF;
  --larix-cyan2:     #00D4FF;
  --larix-green:     #00FF9F;
  --larix-pink:      #FF2E63;
  --larix-red:       #FF1744;
  --larix-gray:      #7A7A7A;
  --larix-dark-green:#1E3A2F;
  --larix-text:      #E8EDF5;
  --larix-text2:     #8896A8;
  --larix-radius:    10px;
  --larix-shadow:    0 4px 20px rgba(0,0,0,0.4);
}

* { box-sizing: border-box; }

.larix-wrap {
  background: var(--larix-bg);
  color: var(--larix-text);
  font-family: 'Segoe UI', Arial, sans-serif;
  min-height: 100vh;
  padding: 20px;
}

/* ── Buttons ─────────────────────────────── */
.larix-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 20px; border-radius: var(--larix-radius);
  border: none; cursor: pointer; font-weight: 600;
  font-size: 14px; text-decoration: none; transition: all .2s;
}
.larix-btn-primary   { background: var(--larix-primary);  color: #fff; }
.larix-btn-primary:hover { background: var(--larix-primary2); transform: translateY(-1px); }
.larix-btn-cyan      { background: var(--larix-cyan);     color: #000; }
.larix-btn-cyan:hover   { background: var(--larix-cyan2); }
.larix-btn-green     { background: var(--larix-green);    color: #000; }
.larix-btn-danger    { background: var(--larix-red);      color: #fff; }
.larix-btn-yellow    { background: var(--larix-yellow);   color: #000; }
.larix-btn-outline   { background: transparent; border: 1px solid var(--larix-border); color: var(--larix-text); }
.larix-btn-outline:hover { border-color: var(--larix-primary); color: var(--larix-primary); }
.larix-btn-sm        { padding: 6px 12px; font-size: 12px; }
.larix-btn:disabled  { opacity: .5; cursor: not-allowed; }

/* ── Cards ───────────────────────────────── */
.larix-card {
  background: var(--larix-bg2);
  border: 1px solid var(--larix-border);
  border-radius: var(--larix-radius);
  padding: 20px;
  box-shadow: var(--larix-shadow);
}

/* ── Forms ───────────────────────────────── */
.larix-form-group { margin-bottom: 16px; }
.larix-form-group label {
  display: block; margin-bottom: 6px;
  color: var(--larix-text2); font-size: 13px; font-weight: 500;
}
.larix-input, .larix-select, .larix-textarea {
  width: 100%; padding: 11px 14px;
  background: var(--lbb-bg3, #161D28);
  border: 1px solid var(--lbb-border2, #263345);
  border-radius: 8px;
  color: var(--lbb-text, #E8EDF5);
  font-size: 14px;
  font-family: var(--lbb-font, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
  outline: none; transition: border-color .15s;
}
.larix-input:focus, .larix-select:focus, .larix-textarea:focus {
  border-color: var(--larix-cyan);
  box-shadow: 0 0 0 3px rgba(0,240,255,.1);
}
.larix-input::placeholder, .larix-textarea::placeholder { color: var(--lbb-text3, #4D5F72); }
.larix-textarea { min-height: 100px; resize: vertical; }
.larix-select option { background: var(--lbb-bg3, #161D28); }
/* TinyMCE dark theme — comprehensive */
#wp-lx_full_desc_editor-wrap,
#wp-lx_full_desc_editor-editor-container,
#wp-lx_full_desc_editor-editor-container .mce-container,
#wp-lx_full_desc_editor-editor-container iframe,
.wp-editor-wrap { background: #161D28 !important; border-color: #1F2D3D !important; }

/* Toolbar */
#wp-lx_full_desc_editor-editor-container .mce-toolbar-grp,
#wp-lx_full_desc_editor-editor-container .mce-toolbar,
#wp-lx_full_desc_editor-editor-container .mce-container-body,
#wp-lx_full_desc_editor-editor-container .mce-top-part,
#wp-lx_full_desc_editor-editor-container .mce-menubar,
#wp-lx_full_desc_editor-editor-container .mce-statusbar,
#wp-lx_full_desc_editor-editor-container .mce-edit-area { background: #10151C !important; border-color: #1F2D3D !important; }

/* Buttons */
#wp-lx_full_desc_editor-editor-container .mce-btn,
#wp-lx_full_desc_editor-editor-container .mce-btn button { background: #161D28 !important; border-color: #1F2D3D !important; color: #8896A8 !important; }
#wp-lx_full_desc_editor-editor-container .mce-btn:hover { background: #1C2535 !important; }

/* Visual/Code tabs */
#wp-lx_full_desc_editor-wrap .wp-editor-tabs { background: #10151C !important; }
#wp-lx_full_desc_editor-wrap .wp-switch-editor,
.wp-switch-editor { background: #10151C !important; border-color: #1F2D3D !important; color: #8896A8 !important; }
.wp-switch-editor:hover { background: #161D28 !important; color: #E8EDF5 !important; }

/* Select dropdowns inside form matching backbone */
.lx-fs select,
.lx-fs input[type="text"],
.lx-fs input[type="number"] {
    background: #161D28 !important;
    border-color: #263345 !important;
    color: #E8EDF5 !important;
}

/* ── Notification Bell ───────────────────── */
.larix-notif-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.larix-notif-badge {
  position: absolute;
  top: 4px; right: 4px;
  background: var(--larix-red);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  border-radius: 50%;
  min-width: 15px; height: 15px;
  display: none;
  align-items: center; justify-content: center;
  line-height: 1;
  border: 2px solid var(--larix-bg2);
  pointer-events: none;
}
.larix-notif-badge.visible { display: flex; }
.larix-notif-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 360px;
  background: #1c1c1c;
  border: 1px solid #2c2c2c;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,.9), 0 0 0 1px rgba(255,255,255,.03);
  z-index: 99999;
  display: none;
  overflow: hidden;
}
.larix-notif-dropdown.open { display: block; animation: larix-fadein .18s ease; }
.larix-notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 12px;
  border-bottom: 1px solid #262626;
}
.larix-notif-header strong { font-size: 13px; font-weight: 700; color: #fff; }
.larix-mark-all-read {
  background: none !important; border: none !important;
  color: var(--larix-cyan) !important; font-size: 11px !important;
  cursor: pointer; font-weight: 600; padding: 0 !important;
}
.larix-notif-scroll { max-height: 360px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #333 #1c1c1c; }
.larix-notif-scroll::-webkit-scrollbar { width: 4px; }
.larix-notif-scroll::-webkit-scrollbar-track { background: #1c1c1c; }
.larix-notif-scroll::-webkit-scrollbar-thumb { background: #444; border-radius: 4px; }
.larix-notif-item {
  display: flex; gap: 11px; padding: 12px 16px;
  border-bottom: 1px solid #232323; text-decoration: none !important;
  color: inherit; cursor: pointer; transition: background .12s;
  align-items: flex-start; position: relative;
}
.larix-notif-item:last-child { border-bottom: none; }
.larix-notif-item:hover { background: rgba(255,255,255,.03); }
.larix-notif-item.unread { background: rgba(0,240,255,.035); }
.larix-notif-item.unread::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: var(--larix-cyan); border-radius: 0 2px 2px 0;
}
.larix-notif-icon {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,87,34,.12);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; flex-shrink: 0; margin-top: 1px;
}
.larix-notif-item.unread .larix-notif-icon { background: rgba(0,240,255,.1); }
.larix-notif-body { flex: 1; min-width: 0; }
.larix-notif-title {
  font-size: 12.5px; font-weight: 700; color: #E8E8E8;
  line-height: 1.35; margin-bottom: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.larix-notif-item.unread .larix-notif-title { color: #fff; }
.larix-notif-msg {
  font-size: 11.5px; color: #888; line-height: 1.45; word-break: break-word;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.larix-notif-time { font-size: 10px; color: #555; margin-top: 4px; display: block; }
.larix-notif-empty { padding: 36px 20px; text-align: center; color: #555; font-size: 13px; }

/* ── Dashboard Layout ────────────────────── */
.larix-dashboard { display: grid; grid-template-columns: 240px 1fr; gap: 0; min-height: 100vh; align-items: stretch; }
.larix-sidebar {
  background: var(--larix-bg2);
  border-right: 1px solid var(--larix-border);
  padding: 24px 0;
}
.larix-sidebar-brand {
  padding: 0 20px 24px;
  font-size: 18px; font-weight: 700; color: var(--larix-primary);
  border-bottom: 1px solid var(--larix-border);
}
.larix-sidebar-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 20px; color: var(--larix-text2);
  text-decoration: none; font-size: 14px; transition: all .15s;
}
.larix-sidebar-nav a:hover,
.larix-sidebar-nav a.active {
  background: var(--larix-bg3); color: var(--larix-cyan);
  border-left: 3px solid var(--larix-cyan);
}
.larix-sidebar-nav a .icon { width: 20px; text-align: center; }
.larix-main-content { padding: 0 !important; display: flex; flex-direction: column; }

/* ── Stats Grid ──────────────────────────── */
.larix-stats-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px; margin-bottom: 28px;
}
.larix-stat-card {
  background: var(--larix-bg2); border: 1px solid var(--larix-border);
  border-radius: var(--larix-radius); padding: 20px; text-align: center;
}
.larix-stat-card .stat-value { font-size: 28px; font-weight: 700; color: var(--larix-cyan); }
.larix-stat-card .stat-label { font-size: 12px; color: var(--larix-text2); margin-top: 4px; }
.larix-stat-card.orange .stat-value { color: var(--larix-primary); }
.larix-stat-card.green  .stat-value { color: var(--larix-green); }
.larix-stat-card.yellow .stat-value { color: var(--larix-yellow); }
.larix-stat-card.pink   .stat-value { color: var(--larix-pink); }

/* ── Listings Grid ───────────────────────── */
.larix-listings-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.larix-listing-card {
  background: var(--larix-bg2); border: 1px solid var(--larix-border);
  border-radius: var(--larix-radius); overflow: hidden;
  transition: transform .2s, border-color .2s; cursor: pointer;
}
.larix-listing-card:hover { transform: translateY(-4px); border-color: var(--larix-primary); }
.larix-listing-card.featured { border-color: var(--larix-yellow); }
.larix-listing-card.featured::before {
  content: '⭐ FEATURED';
  display: block; background: var(--larix-yellow); color: #000;
  font-size: 10px; font-weight: 700; padding: 4px 10px; text-align: center;
}
.larix-listing-img { width: 100%; height: 160px; object-fit: cover; }
.larix-listing-body { padding: 14px; }
.larix-listing-type {
  display: inline-block; font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 4px; margin-bottom: 8px; text-transform: uppercase;
}
.larix-listing-type.account  { background: rgba(0,240,255,.15); color: var(--larix-cyan); }
.larix-listing-type.boosting { background: rgba(255,87,34,.15);  color: var(--larix-primary); }
.larix-listing-title { font-size: 15px; font-weight: 600; color: var(--larix-text); margin-bottom: 6px; }
.larix-listing-game  { font-size: 12px; color: var(--larix-text2); margin-bottom: 4px; }
.larix-listing-meta  { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.larix-tag {
  font-size: 11px; padding: 2px 8px; border-radius: 4px;
  background: var(--larix-bg3); color: var(--larix-text2); border: 1px solid var(--larix-border);
}
.larix-listing-footer { display: flex; align-items: center; justify-content: space-between; }
.larix-listing-price  { font-size: 18px; font-weight: 700; color: var(--larix-green); }
.larix-vendor-info    { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--larix-text2); }
.larix-verified-badge { color: var(--larix-cyan); font-size: 14px; }
.larix-rating         { color: var(--larix-yellow); font-size: 12px; }

/* ── Filters Bar ─────────────────────────── */
.larix-filters {
  background: var(--larix-bg2); border: 1px solid var(--larix-border);
  border-radius: var(--larix-radius); padding: 16px; margin-bottom: 24px;
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
}
.larix-search-input {
  flex: 1; min-width: 200px; padding: 9px 14px;
  background: var(--larix-bg3); border: 1px solid var(--larix-border);
  border-radius: 8px; color: var(--larix-text); font-size: 14px; outline: none;
}
.larix-search-input:focus { border-color: var(--larix-cyan); }

/* ── Chat ────────────────────────────────── */
.larix-chat-wrap {
  background: var(--larix-bg2); border: 1px solid var(--larix-border);
  border-radius: var(--larix-radius); height: 400px;
  display: flex; flex-direction: column;
}
.larix-chat-messages {
  flex: 1; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.larix-msg {
  max-width: 70%; padding: 10px 14px; border-radius: 12px; font-size: 13px;
}
.larix-msg.sent    { background: var(--larix-primary); color: #fff; align-self: flex-end; border-radius: 12px 12px 0 12px; }
.larix-msg.received{ background: var(--larix-bg3); color: var(--larix-text); align-self: flex-start; border-radius: 12px 12px 12px 0; }
.larix-msg.flagged { border: 1px solid var(--larix-red); }
.larix-msg-time    { font-size: 10px; opacity: .6; margin-top: 4px; }
.larix-chat-input-wrap {
  padding: 12px; border-top: 1px solid var(--larix-border);
  display: flex; gap: 8px;
}
.larix-chat-input  {
  flex: 1; padding: 10px 14px; background: var(--larix-bg3);
  border: 1px solid var(--larix-border); border-radius: 8px;
  color: var(--larix-text); outline: none; font-size: 13px;
}
.larix-chat-input:focus { border-color: var(--larix-cyan); }

/* ── Warning Banner ──────────────────────── */
.larix-warning {
  background: rgba(255,23,68,.12); border: 1px solid var(--larix-red);
  border-radius: 8px; padding: 12px 16px; color: var(--larix-red);
  font-size: 13px; margin-bottom: 12px;
}
.larix-notice {
  background: rgba(0,240,255,.08); border: 1px solid var(--larix-cyan);
  border-radius: 8px; padding: 12px 16px; color: var(--larix-cyan);
  font-size: 14px;
}

/* ── Status Badges ───────────────────────── */
.larix-status {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
}
.larix-status.pending    { background: rgba(255,170,0,.15);  color: var(--larix-yellow); }
.larix-status.active     { background: rgba(0,255,159,.15);  color: var(--larix-green); }
.larix-status.approved   { background: rgba(0,255,159,.15);  color: var(--larix-green); }
.larix-status.completed  { background: rgba(0,240,255,.15);  color: var(--larix-cyan); }
.larix-status.suspended  { background: rgba(255,23,68,.15);  color: var(--larix-red); }
.larix-status.rejected   { background: rgba(255,23,68,.15);  color: var(--larix-red); }
.larix-status.disputed   { background: rgba(255,87,34,.15);  color: var(--larix-primary); }
.larix-status.cancelled  { background: rgba(122,122,122,.15);color: var(--larix-gray); }
.larix-status.sold       { background: rgba(255,46,99,.15);  color: var(--larix-pink); }

/* ── Tables ──────────────────────────────── */
.larix-table { width: 100%; border-collapse: collapse; }
.larix-table th {
  background: var(--larix-bg3); color: var(--larix-text2);
  padding: 10px 14px; text-align: left; font-size: 12px;
  text-transform: uppercase; border-bottom: 1px solid var(--larix-border);
}
.larix-table td {
  padding: 12px 14px; border-bottom: 1px solid var(--larix-border);
  font-size: 13px; color: var(--larix-text);
}
.larix-table tr:hover td { background: var(--larix-bg3); }

/* ── Stars Rating ────────────────────────── */
.larix-stars { color: var(--larix-yellow); font-size: 14px; }
.larix-stars .star { cursor: pointer; transition: color .1s; }
.larix-stars .star.active { color: var(--larix-yellow); }
.larix-stars .star:not(.active) { color: var(--larix-gray); }


/* ── Loading Spinner ─────────────────────── */
.larix-spinner {
  width: 20px; height: 20px; border: 2px solid var(--larix-border);
  border-top-color: var(--larix-cyan); border-radius: 50%;
  animation: larix-spin .7s linear infinite; display: inline-block;
}
@keyframes larix-spin { to { transform: rotate(360deg); } }
@keyframes larix-fadein { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:translateY(0); } }

/* ══════════════════════════════════════════════════════════════════════════
   MOBILE RESPONSIVE — Vendor Dashboard
   Classes are added directly in PHP template files, NOT via JS or [style*=].
   This is 100% reliable regardless of whitespace in inline styles.
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Tablet (≤768px) ──────────────────────────────────────────────────── */
@media (max-width: 768px) {

  /* PAGE */
  html, body { overflow-x: hidden; }
  .larix-wrap { overflow-x: hidden; }

  /* DASHBOARD MAIN GRID: sidebar + content → single col */
  .larix-dash-grid {
    grid-template-columns: 1fr !important;
  }

  /* SIDEBAR → slide-in drawer */
  .larix-vendor-sidebar {
    display: flex !important;
    position: fixed !important;
    top: 0 !important;
    left: -280px !important;
    width: 260px !important;
    height: 100vh !important;
    z-index: 99999 !important;
    overflow-y: auto !important;
    box-shadow: 4px 0 24px rgba(0,0,0,.8) !important;
    transition: left .28s cubic-bezier(.4,0,.2,1) !important;
    flex-direction: column !important;
    min-height: unset !important;
  }
  .larix-vendor-sidebar.mob-open { left: 0 !important; }

  /* DESKTOP TOPBAR → hidden on mobile */
  .larix-desktop-topbar { display: none !important; }

  /* MOBILE TOPBAR → show */
  #larix-mobile-topbar { display: flex !important; }

  /* CONTENT PADDING → reduce */
  .larix-vendor-content { padding: 14px !important; }

  /* ── PHP-CLASS GRID OVERRIDES ── */

  /* 6-col stats row → 2 col */
  .lx-g6 { grid-template-columns: repeat(2, 1fr) !important; }

  /* 4-col stats row → 2 col */
  .lx-g4 { grid-template-columns: repeat(2, 1fr) !important; }

  /* 3-col rows → 1 col */
  .lx-g3 { grid-template-columns: 1fr !important; }

  /* 2-col equal rows → 1 col */
  .lx-g2 { grid-template-columns: 1fr !important; }

  /* Split layouts (chart + sidebar panel) → 1 col */
  .lx-gsplit { grid-template-columns: 1fr !important; }

  /* Auto-fill grids → 2 col */
  .lx-gauto { grid-template-columns: repeat(2, 1fr) !important; }

  /* LISTING FORM grids (already classed .lx-gr, .lx-id3) */
  .lx-gr  { grid-template-columns: 1fr !important; }
  .lx-id3 { grid-template-columns: 1fr 1fr !important; }

  /* ── SCROLLABLE TABLES ── */
  .lx-tscroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
  }
  .lx-tscroll .larix-table { min-width: 480px; }
  .larix-table th { font-size: 11px !important; padding: 8px 10px !important; }
  .larix-table td { font-size: 12px !important; padding: 8px 10px !important; }

  /* ── FILTER ROW: horizontal scroll ── */
  .lx-filter-row {
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }

  /* ── WITHDRAW TABS: horizontal scroll ── */
  #lxwd-wrap > div[style*="border-bottom:2px solid"] {
    overflow-x: auto;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch;
  }
  .lxwd-tab { white-space: nowrap; }

  /* ── PROMOTE TABS: horizontal scroll ── */
  #lxp-wrap > div[style*="border-bottom:2px solid"] {
    overflow-x: auto;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch;
  }
  .lxp-tab { white-space: nowrap; }

  /* PROMOTE pay buttons: stack vertically */
  .lx-paywrap { flex-direction: column !important; }
  .lxp-pay-btn { min-width: unset !important; width: 100% !important; box-sizing: border-box; }

  /* COIN PRESETS: already .lx-g4 → 2col above */

  /* ── STAT NUMBERS: shrink on small screens ── */
  .lx-g6 [style*="font-size:28px"],
  .lx-g4 [style*="font-size:22px"],
  .lx-g4 [style*="font-size:28px"] {
    font-size: 18px !important;
  }

  /* ── CHAT: stack sidebar + chat vertically ── */
  .lxm-wrap { flex-direction: column !important; height: auto !important; min-height: unset !important; }
  .lxm-sidebar { width: 100% !important; height: auto !important; border-right: none !important; border-bottom: 1px solid var(--larix-border) !important; max-height: 260px; }
  .lxm-chat { min-height: 360px; }
  .lxm-messages { max-height: 280px; }
  .lxm-bubble { max-width: 88% !important; }

  /* ── FLOATING CHAT WINDOW ── */
  #larix-chat-win {
    width: calc(100vw - 24px) !important;
    right: 12px !important;
    left: auto !important;
    bottom: 82px !important;
  }

  /* ── NOTIFICATION DROPDOWN ── */
  #larix-notif-dropdown {
    position: fixed !important;
    top: 52px !important;
    left: 8px !important;
    right: 8px !important;
    width: auto !important;
    max-height: 70vh;
    overflow-y: auto;
  }

  /* ── OVERVIEW: header action buttons wrap ── */
  .larix-wrap div[style*="display:flex;gap:10px;flex-wrap:wrap"] {
    width: 100%;
  }

  /* ── LARIX CARDS: reduce padding ── */
  .larix-card { padding: 14px !important; }
  .lxp-card { padding: 14px !important; }
  .lxwd-card { padding: 16px !important; }
}

/* ── Small phones (≤480px) ────────────────────────────────────────────── */
@media (max-width: 480px) {
  .lx-g6, .lx-g4, .lx-g3, .lx-g2, .lx-gauto { grid-template-columns: 1fr !important; }
  .lx-id3 { grid-template-columns: 1fr !important; }

  .lxm-sidebar { max-height: 220px; }
  .lxm-chat { min-height: 320px; }
  .lxm-messages { max-height: 240px; }
  .lxm-bubble { max-width: 94% !important; }

  /* Page header: stack title + buttons */
  .larix-wrap div[style*="display:flex;align-items:center;justify-content:space-between;margin-bottom:24px"] {
    flex-direction: column !important;
    align-items: flex-start !important;
  }
}

/* ── Fiverr-Style Top Bar ─────────────────────────────────────────────────── */
.larix-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 58px;
  background: var(--larix-bg2);
  border-bottom: 1px solid var(--larix-border);
  width: 100%;
  flex-shrink: 0;
  box-sizing: border-box;
}
.larix-topbar-left { display: flex; align-items: center; }
.larix-topbar-date { font-size: 12px; color: var(--larix-text2); font-weight: 500; }
.larix-topbar-right { display: flex; align-items: center; gap: 4px; }

/* Topbar icon buttons */
.larix-topbar-icon-btn {
  position: relative;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--larix-text2);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
  text-decoration: none;
}
.larix-topbar-icon-btn:hover { background: rgba(255,255,255,.07); color: #fff; }

/* Message unread badge */
.larix-topbar-msg-badge {
  position: absolute;
  top: 4px; right: 4px;
  background: var(--larix-cyan);
  color: #000;
  font-size: 9px; font-weight: 700;
  border-radius: 50%;
  min-width: 15px; height: 15px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--larix-bg2);
  pointer-events: none;
}

/* Avatar */
.larix-topbar-avatar-wrap { position: relative; margin-left: 6px; }
.larix-topbar-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--larix-primary), #FF8A65);
  border: 2px solid var(--larix-border);
  color: #fff; font-size: 14px; font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: border-color .15s, transform .15s;
  overflow: hidden;
}
.larix-topbar-avatar:hover { border-color: var(--larix-primary); transform: scale(1.05); }
.larix-topbar-avatar-menu {
  position: absolute;
  top: calc(100% + 10px); right: 0;
  width: 200px;
  background: #1c1c1c;
  border: 1px solid #2c2c2c;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,.9);
  z-index: 99999;
  display: none;
  overflow: hidden;
  padding: 6px 0;
}
.larix-topbar-avatar-menu.open { display: block; animation: larix-fadein .15s ease; }
.larix-topbar-avatar-menu a {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px; font-size: 13px;
  color: var(--larix-text) !important;
  text-decoration: none !important;
  transition: background .12s;
}
.larix-topbar-avatar-menu a:hover { background: rgba(255,255,255,.05); }

/* Main content layout */


/* ── Notification dropdown scrollbar fix ── */
#larix-notif-dropdown > div[style*="overflow-y:auto"],
#larix-notif-dropdown > div[style*="overflow-y: auto"] {
  scrollbar-width: thin;
  scrollbar-color: #444 #1c1c1c;
}
#larix-notif-dropdown > div[style*="overflow-y:auto"]::-webkit-scrollbar,
#larix-notif-dropdown > div[style*="overflow-y: auto"]::-webkit-scrollbar { width: 4px; }
#larix-notif-dropdown > div[style*="overflow-y:auto"]::-webkit-scrollbar-track,
#larix-notif-dropdown > div[style*="overflow-y: auto"]::-webkit-scrollbar-track { background: #1c1c1c; }
#larix-notif-dropdown > div[style*="overflow-y:auto"]::-webkit-scrollbar-thumb,
#larix-notif-dropdown > div[style*="overflow-y: auto"]::-webkit-scrollbar-thumb { background: #444; border-radius: 4px; }

/* ═══════════════════════════════════════════════════════════════
   FLOATING CHAT WIDGET  (Crisp / Intercom style)
   Classes: #larix-chat-fab, #larix-chat-win, lcw-*, lcfab-*
   ═══════════════════════════════════════════════════════════════ */

/* FAB button */
#larix-chat-fab {
  position: fixed !important;
  bottom: 24px !important;
  right: 24px !important;
  width: 58px !important;
  height: 58px !important;
  border-radius: 50% !important;
  background: var(--larix-primary) !important;
  border: none !important;
  cursor: pointer !important;
  z-index: 999990 !important;
  display: none !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 4px 20px rgba(255,87,34,.55) !important;
  transition: transform .2s, box-shadow .2s !important;
  padding: 0 !important;
  flex-shrink: 0 !important;
}
#larix-chat-fab.ready { display: flex !important; }
#larix-chat-fab:hover { transform: scale(1.1) !important; box-shadow: 0 6px 30px rgba(255,87,34,.75) !important; }
.lcfab-icon  { width: 26px; height: 26px; fill: #fff; flex-shrink: 0; }
.lcfab-close { width: 24px; height: 24px; fill: #fff; flex-shrink: 0; display: none; }
#larix-chat-fab.open .lcfab-icon  { display: none; }
#larix-chat-fab.open .lcfab-close { display: block; }
.lcfab-badge {
  position: absolute !important;
  top: -2px !important; right: -2px !important;
  background: #ff1744 !important;
  color: #fff !important;
  font-size: 10px !important; font-weight: 700 !important;
  border-radius: 50% !important;
  width: 20px !important; height: 20px !important;
  display: flex !important; align-items: center !important; justify-content: center !important;
  border: 2px solid #121212 !important;
  pointer-events: none !important;
}

/* Chat window */
#larix-chat-win {
  position: fixed !important;
  bottom: 94px !important;
  right: 24px !important;
  width: 360px !important;
  height: 520px !important;
  background: #161616 !important;
  border: 1px solid #2a2a2a !important;
  border-radius: 18px !important;
  box-shadow: 0 20px 60px rgba(0,0,0,.85), 0 0 0 1px rgba(255,255,255,.04) !important;
  z-index: 999989 !important;
  display: none !important;
  flex-direction: column !important;
  overflow: hidden !important;
}
#larix-chat-win.open {
  display: flex !important;
  animation: lcwSlideIn .25s cubic-bezier(.16,1,.3,1);
}
@keyframes lcwSlideIn {
  from { opacity:0; transform: translateY(16px) scale(.97); }
  to   { opacity:1; transform: translateY(0) scale(1); }
}

/* Header */
.lcw-header {
  background: linear-gradient(135deg, #1e1e1e 0%, #242424 100%);
  border-bottom: 1px solid #252525;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.lcw-header-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--larix-primary), #ff8a65);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 800; color: #fff;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(255,87,34,.4);
}
.lcw-header-info { flex: 1; min-width: 0; }
.lcw-header-name { font-size: 13px; font-weight: 700; color: #fff; }
.lcw-header-sub  { font-size: 11px; color: #666; margin-top: 1px; }
.lcw-header-close {
  background: none; border: none; color: #555; cursor: pointer;
  font-size: 18px; line-height: 1; padding: 3px 5px;
  border-radius: 6px; transition: color .15s, background .15s; flex-shrink: 0;
}
.lcw-header-close:hover { color: #E0E0E0; background: rgba(255,255,255,.07); }

/* Tabs */
.lcw-tabs {
  display: flex;
  background: #1a1a1a;
  border-bottom: 1px solid #222;
  flex-shrink: 0;
}
.lcw-tab {
  flex: 1; padding: 9px 6px;
  font-size: 11px; font-weight: 700; text-align: center;
  cursor: pointer; border: none; background: none;
  color: #555; text-transform: uppercase; letter-spacing: .5px;
  border-bottom: 2px solid transparent;
  transition: all .15s;
}
.lcw-tab.active { color: var(--larix-cyan); border-bottom-color: var(--larix-cyan); background: rgba(0,240,255,.04); }

/* List panes */
.lcw-list-pane {
  display: none; flex-direction: column;
  overflow-y: auto; flex: 1;
}
.lcw-list-pane::-webkit-scrollbar { width: 3px; }
.lcw-list-pane::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 4px; }
.lcw-list-pane.active { display: flex; }

/* Conversation item */
.lcw-conv-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; cursor: pointer;
  transition: background .12s; border-bottom: 1px solid rgba(255,255,255,.025);
  text-decoration: none; color: #E0E0E0;
}
.lcw-conv-item:hover { background: rgba(255,255,255,.04); }
.lcw-conv-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, #222, #2e2e2e);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: var(--larix-cyan);
  flex-shrink: 0;
}
.lcw-conv-avatar.order { color: var(--larix-primary); }
.lcw-conv-name    { font-size: 13px; font-weight: 600; color: #E0E0E0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lcw-conv-preview { font-size: 11px; color: #555; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lcw-conv-unread  { background: var(--larix-cyan); color: #000; font-size: 10px; font-weight: 700; border-radius: 10px; padding: 2px 6px; margin-left: auto; flex-shrink: 0; }
.lcw-empty { padding: 40px 16px; text-align: center; color: #444; font-size: 12px; }

/* Thread pane */
.lcw-thread { display: none; flex-direction: column; flex: 1; overflow: hidden; }
.lcw-thread.active { display: flex; }
.lcw-thread-header {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-bottom: 1px solid #222;
  background: #1a1a1a; flex-shrink: 0;
}
.lcw-back-btn {
  background: none; border: none; color: #666; cursor: pointer;
  font-size: 17px; padding: 0 4px; transition: color .15s; flex-shrink: 0;
}
.lcw-back-btn:hover { color: #E0E0E0; }
.lcw-thread-name { font-size: 13px; font-weight: 600; color: #E0E0E0; }
.lcw-thread-sub  { font-size: 11px; color: #555; margin-top: 1px; }

/* Messages */
.lcw-msgs {
  flex: 1; overflow-y: auto; padding: 12px 12px 6px;
  display: flex; flex-direction: column; gap: 8px;
}
.lcw-msgs::-webkit-scrollbar { width: 3px; }
.lcw-msgs::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 4px; }
.lcw-bubble {
  max-width: 78%; padding: 8px 12px;
  font-size: 13px; line-height: 1.5; word-break: break-word;
}
.lcw-bubble.sent {
  background: var(--larix-primary); color: #fff;
  align-self: flex-end;
  border-radius: 14px 14px 3px 14px;
}
.lcw-bubble.received {
  background: #2a2a2a; color: #E0E0E0;
  align-self: flex-start;
  border-radius: 14px 14px 14px 3px;
}
.lcw-msg-time { font-size: 10px; opacity: .5; margin-top: 3px; display: block; }
.lcw-warn { padding: 5px 12px; font-size: 11px; color: var(--larix-red); background: rgba(255,23,68,.06); display: none; }

/* Input bar */
.lcw-input-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; border-top: 1px solid #1e1e1e;
  background: #141414; flex-shrink: 0;
}
.lcw-input {
  flex: 1; background: #222; border: 1px solid #2c2c2c;
  border-radius: 20px; padding: 8px 14px;
  color: #E0E0E0; font-size: 13px; outline: none;
  transition: border-color .15s;
}
.lcw-input:focus { border-color: rgba(255,87,34,.4); }
.lcw-send {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--larix-primary); border: none; color: #fff;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .15s, transform .1s; flex-shrink: 0;
  font-size: 13px;
}
.lcw-send:hover { background: var(--larix-primary2); transform: scale(1.06); }

/* ═══════════════════════════════════════════════════════════════
   MESSAGES TAB  (Fiverr-style split layout)
   Classes: lxm-*
   ═══════════════════════════════════════════════════════════════ */
.lxm-wrap {
  display: flex;
  height: calc(100vh - 120px);
  min-height: 500px;
  background: var(--larix-bg2);
  border: 1px solid var(--larix-border);
  border-radius: 14px;
  overflow: hidden;
}
.lxm-sidebar {
  width: 280px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--larix-border);
  background: var(--larix-bg);
}
.lxm-sidebar-header {
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--larix-border);
}
.lxm-sidebar-title { font-size: 16px; font-weight: 700; color: #fff; margin: 0 0 10px; }
.lxm-tabs {
  display: flex; gap: 4px;
  background: #1a1a1a; border-radius: 8px; padding: 3px;
}
.lxm-tab {
  flex: 1; padding: 6px 4px; font-size: 11px; font-weight: 600;
  text-align: center; cursor: pointer; border-radius: 6px;
  border: none; background: none; color: var(--larix-text2);
  transition: all .15s; text-transform: uppercase; letter-spacing: .3px;
}
.lxm-tab.active { background: var(--larix-bg2); color: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.lxm-list { flex: 1; overflow-y: auto; }
.lxm-list::-webkit-scrollbar { width: 3px; }
.lxm-list::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 4px; }
.lxm-list-pane { display: none; }
.lxm-list-pane.active { display: block; }
.lxm-conv-item {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; cursor: pointer;
  transition: background .12s; border-bottom: 1px solid rgba(255,255,255,.03);
  text-decoration: none; color: inherit;
}
.lxm-conv-item:hover { background: rgba(255,255,255,.04); }
.lxm-conv-item.active { background: rgba(0,240,255,.06); border-left: 3px solid var(--larix-cyan); }
.lxm-conv-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, #222, #2e2e2e);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; color: var(--larix-cyan); flex-shrink: 0;
}
.lxm-conv-avatar.order { color: var(--larix-primary); }
.lxm-conv-name    { font-size: 13px; font-weight: 600; color: #E0E0E0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lxm-conv-preview { font-size: 11px; color: #666; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lxm-conv-meta    { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex-shrink: 0; }
.lxm-unread-badge { background: var(--larix-cyan); color: #000; font-size: 10px; font-weight: 700; border-radius: 10px; padding: 1px 6px; min-width: 18px; text-align: center; }
.lxm-conv-time    { font-size: 10px; color: #555; }
.lxm-empty { padding: 32px 16px; text-align: center; color: #555; font-size: 12px; }
.lxm-chat { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.lxm-chat-header {
  padding: 13px 18px; border-bottom: 1px solid var(--larix-border);
  display: flex; align-items: center; gap: 11px;
  background: var(--larix-bg2); flex-shrink: 0;
}
.lxm-chat-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--larix-primary), #FF8A65);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.lxm-chat-header-info { flex: 1; min-width: 0; }
.lxm-chat-header-name { font-size: 14px; font-weight: 700; color: #fff; }
.lxm-chat-header-sub  { font-size: 11px; color: var(--larix-text2); margin-top: 1px; }
.lxm-messages {
  flex: 1; overflow-y: auto; padding: 14px 16px 8px;
  display: flex; flex-direction: column; gap: 10px;
}
.lxm-messages::-webkit-scrollbar { width: 4px; }
.lxm-messages::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 4px; }
.lxm-bubble-wrap { display: flex; flex-direction: column; }
.lxm-bubble-wrap.sent     { align-items: flex-end; }
.lxm-bubble-wrap.received { align-items: flex-start; }
.lxm-bubble {
  max-width: 72%; padding: 9px 13px;
  font-size: 13px; line-height: 1.5; word-break: break-word;
}
.lxm-bubble.sent     { background: var(--larix-primary); color: #fff; border-radius: 14px 14px 2px 14px; }
.lxm-bubble.received { background: #2a2a2a; color: #E0E0E0; border-radius: 14px 14px 14px 2px; }
.lxm-bubble-time { font-size: 10px; color: #666; margin-top: 3px; padding: 0 2px; }
.lxm-input-area {
  display: flex; gap: 8px; align-items: center;
  padding: 10px 14px; border-top: 1px solid var(--larix-border);
  background: var(--larix-bg); flex-shrink: 0;
}
.lxm-input {
  flex: 1; background: #222; border: 1px solid #2c2c2c;
  border-radius: 22px; padding: 9px 15px;
  color: #E0E0E0; font-size: 13px; outline: none; transition: border-color .15s;
}
.lxm-input:focus { border-color: var(--larix-cyan); }
.lxm-send-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--larix-primary); border: none; color: #fff;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 14px; transition: background .15s, transform .1s;
}
.lxm-send-btn:hover { background: var(--larix-primary2); transform: scale(1.05); }
.lxm-no-chat {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; color: #444; gap: 10px;
}
.lxm-no-chat-icon { font-size: 44px; opacity: .35; }
.lxm-warn { padding: 5px 14px; font-size: 11px; color: var(--larix-red); background: rgba(255,23,68,.06); border-top: 1px solid rgba(255,23,68,.1); display: none; }

/* ═══════════════════════════════════════════════════════════════
   REVIEW STAR WIDGET
   ═══════════════════════════════════════════════════════════════ */
.larix-star-row { display: flex; gap: 5px; margin: 6px 0; }
.larix-star-row .star {
  font-size: 26px; cursor: pointer; color: #333;
  transition: color .12s, transform .1s; line-height: 1;
}
.larix-star-row .star:hover,
.larix-star-row .star.active { color: var(--larix-yellow); transform: scale(1.15); }

/* Root wrapper — invisible, no layout impact */
#larix-chat-root {
  position: fixed;
  bottom: 0; right: 0;
  width: 0; height: 0;
  overflow: visible;
  z-index: 999988;
  pointer-events: none;
}
#larix-chat-root > * { pointer-events: all; }
