/*
 * Hibox — Chatwoot dashboard-ийг JivoChat-ын операторын апп шиг харагдуулах загвар.
 *
 * Ачаалал : app/views/layouts/vueapp.html.erb (patches/0002-hibox-theme.patch) → <link>
 * Сервер  : nginx `location ^~ /hibox/` → /var/www/hibox/   (chatwoot/deploy-theme.sh)
 * Хамрах  : зөвхөн операторын dashboard (вэб + Electron). Харилцагчийн widget-ийг хөндөхгүй.
 * Туслах  : hibox-theme.js — мессежийн толгой (нэр/аватар/цаг/«bot»/«page»), rail-ыг анх хураах,
 *           «Accept Chat / Reject Chat» (.hx-accept, Jivo), «… авсан» анхааруулга (.hx-taken),
 *           §15 Jivo parity: «Contact Center», хайлт (.hx-search), толгойн суваг, Chat/Comment, Send.
 * Загвар  : Jivo-гийн ЦАЙВАР загвар (эзэн 10-09; app.jivosite.com «Contact Center»-ээс хэмжсэн) — rail + жагсаалт
 *           #FAFBFC, чат #FFF, баруун самбар #F6F8FA, brand цэнхэр #1C6AE1, ногоон #18C139, улаан #F94636.
 *           Хэрэглэгч Chatwoot-д «Dark» сонговол Chatwoot-ийн өөрийн бараан (body.dark-д --hx-* ⇒ Chatwoot токен);
 *           «System» ⇒ Light (hibox-theme.js §8).
 *
 * Chatwoot шинэчлэхэд ДАХИН ШАЛГАХ selector-ууд (hashed class ашиглаагүй):
 *   aside:has(~ main)                    Sidebar.vue — <main>-ийн өмнөх <aside>
 *   aside … a.bg-n-alpha-2               SidebarGroup.vue — идэвхтэй icon (collapsed)
 *   nav a[title="My Inbox"|…]            SidebarGroup.vue :title="label" (англи — rail-ын шошго)
 *   > section a[href$="/search"], button:has(> .i-lucide-pen-line)   Sidebar.vue хайх / ComposeConversation
 *   nav > ul > li:has(a[href*=…])        Sidebar.vue route-ууд (captain/portals/campaigns/calls)
 *   .conversations-list-wrap             ChatList.vue (+ ChatListHeader.vue `> div:has(> div > h1)`)
 *   .conversation(.active) .border-line .conversation--user   ConversationCard.vue (+ InboxName.vue `div[title]`)
 *   a.text-button(.after:bg-n-brand)     components/ui/Tabs/TabsItem.vue (li[data-hx-tab] — JS)
 *   .conversation--header--actions       ConversationHeader.vue (div[title][data-hx-channel] — JS)
 *   .resolve-actions > div > button      buttons/ResolveAction.vue (ButtonGroup + NextButton)
 *   .conversation-panel .message-bubble-container, .left-bubble/.right-bubble,
 *   [class*="grid-area:…"]               components-next/message/Message.vue, bubbles/Base.vue
 *   .resizable-editor-wrapper > .reply-box, .woot-banner, .cursor-row-resize   ResizableEditorWrapper.vue, ReplyBox.vue
 *   .resizable-editor-wrapper[data-hx-accept]   §8 — «Accept Chat» үед reply box нуух (JS)
 *   .resizable-editor-wrapper (relative) > .hx-canned       §9 — absolute, reply box-ын дээр
 *   .reply-box button[data-hx-modes] > div[data-hx-mode]    §12 EditorModeToggle.vue (JS)
 *   .reply-box .left-wrap / .right-wrap > button[data-hx-send]   §12 ReplyBottomPanel.vue (JS)
 *   .conversation-panel > li (beforeAll spinner) + .hx-prev  §10 MessageList.vue / MessagesView.vue
 *   .list-group .drag-handle (+ div)     §13 ContactPanel.vue + Accordion/AccordionItem.vue
 *   *-n-brand utility-ууд                Tailwind (#2781F6 шууд compile болдог тул давхар бичнэ)
 *   kbd.hotkey.w-8[data-hx-kbd]          §11 base/Hotkey.vue + EmptyState/FeaturePlaceholder.vue (w-8 h-6 text-lg)
 * Өнгө: доорх §0 `--hx-*` (гараар; өмнөх gen_tokens.py-ийн бараан @tokens блок 10-09-нд хасагдсан).
 */

/* ── 0. Jivo өнгө (эзэн 10-09 — Jivo операторын аппаас хэмжсэн утга) ─────────────────────────────── */
:root {
  --hx-text: 27 31 35;          /* text-primary #1B1F23 */
  --hx-muted: 94 102 112;       /* text-secondary #5E6670 (прототип: ≥4.5:1 hover #F0F3F4 дээр ч; #6A737D = 4.3:1 байв — S6 10-29) */
  --hx-dim: 149 157 165;        /* text-tertiary #959DA5 */
  --hx-link: 54 127 238;        /* холбоос / фокус #367FEE */
  --hx-accent: 28 106 225;      /* primary: сонгосон мөр, харилцагчийн нэр #1C6AE1 */
  --hx-success: 24 193 57;      /* Accept / идэвхтэй rail #18C139 */
  --hx-send: 24 193 57;         /* Send дугуй товч #18C139 (Jivo: текст бичихэд ногоон сум) — Dark-д ч ижил (T2 R2) */
  --hx-danger: 249 70 54;       /* тоо / алдаа #F94636 */
  --hx-rail: 250 251 252;       /* rail #FAFBFC */
  --hx-list: 250 251 252;       /* ярианы жагсаалт #FAFBFC */
  --hx-hover: 240 243 244;      /* hover, «bot» шошго, идэвхтэй санал #F0F3F4 */
  --hx-line: 225 228 232;       /* зураас, картын хүрээ #E1E4E8 */
  --hx-line-strong: 209 213 218;/* товчны хүрээ #D1D5DA */
  --hx-chat: 255 255 255;       /* чатын талбар */
  --hx-panel: 246 248 250;      /* баруун (харилцагчийн) самбар #F6F8FA */
  --hx-card: 255 255 255;       /* самбарын карт, popover */
  --hx-note: 255 242 214;       /* Comment (private note) #FFF2D6 */
  --hx-pop-shadow: 0 8px 24px rgb(0 0 0 / .12);   /* §9 санал / «Save reply» */
  --hx-font: -apple-system, system-ui, "Segoe UI", Ubuntu, Roboto, sans-serif;   /* Jivo */
  /* Lucide v1.34.0 (ISC, lucide.dev) outline icon — CSS mask ⇒ өнгө нь currentColor */
  --hx-i-search: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21 21-4.34-4.34'/%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3C/svg%3E"); /* search */
  --hx-i-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='m9 12 2 2 4-4'/%3E%3C/svg%3E"); /* circle-check */
  --hx-i-send: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z'/%3E%3Cpath d='m21.854 2.147-10.94 10.939'/%3E%3C/svg%3E"); /* send */
  --hx-i-bot: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 8V4H8'/%3E%3Crect width='16' height='12' x='4' y='8' rx='2'/%3E%3Cpath d='M2 14h2'/%3E%3Cpath d='M20 14h2'/%3E%3Cpath d='M15 13v2'/%3E%3Cpath d='M9 13v2'/%3E%3C/svg%3E"); /* bot */
  --hx-i-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); /* chevron-down */
}
/* Chatwoot Dark (хэрэглэгч өөрөө сонгосон) ⇒ Jivo-гийн гадаргуу Chatwoot-ийн бараан токен руу (_next-colors.scss .dark) */
body.dark {
  --hx-text: var(--slate-12);
  --hx-muted: var(--slate-11);
  --hx-dim: var(--slate-10);
  --hx-link: var(--blue-11);
  --hx-rail: var(--background-color);
  --hx-list: var(--surface-1);
  --hx-hover: var(--slate-3);
  --hx-line: var(--border-weak);
  --hx-line-strong: var(--border-strong);
  --hx-chat: var(--surface-1);
  --hx-panel: var(--surface-2);
  --hx-card: var(--solid-2);
  --hx-note: var(--solid-amber);
  --hx-pop-shadow: 0 8px 24px rgb(0 0 0 / .45);
}

/* Фонт: Jivo-гийн систем фонт (Chatwoot _woot.scss `html, body { font-family: 'Inter', … !important }`-ийг дарна) */
html:root, html body { font-family: var(--hx-font) !important; }
html body { font-size: 14px; }

/* ── 1. Brand: Chatwoot-ийн цэнхэр (--blue-*) → Jivo цэнхэр #1C6AE1 (зөвхөн Light; Dark = Chatwoot) ─── */
html:root {
  --blue-1: 250 252 255; --blue-2: 243 247 254; --blue-3: 232 240 252; --blue-4: 217 230 251;
  --blue-5: 199 217 248; --blue-6: 176 200 243; --blue-7: 145 177 236; --blue-8: 100 146 230;
  --blue-9: 28 106 225;  --blue-10: 22 92 200;  --blue-11: 28 106 225; --blue-12: 12 45 96;
  --solid-blue: 217 230 251; --solid-blue-2: 250 252 255; --text-blue: 12 45 96;
  --border-blue: 28, 106, 225, 0.5; --border-blue-strong: 22 92 200;
}

/* `n-brand` нь Tailwind-д #2781F6 гэж шууд compile болдог — давхар бичнэ (уншаагүй мессежийн pill, таб г.м.). */
html .bg-n-brand, html .bg-\[\#2781F6\],
html .group:hover .group-hover\:bg-n-brand,
html .checked\:bg-n-brand:checked, html .indeterminate\:bg-n-brand:indeterminate,
html .before\:bg-n-brand::before, html .after\:bg-n-brand::after { background-color: rgb(var(--hx-accent)); }
html .bg-n-brand\/5 { background-color: rgb(var(--hx-accent) / .05); }
html .bg-n-brand\/10, html .hover\:bg-n-brand\/10:hover,
html .dark\:bg-n-brand\/10:is(.dark *) { background-color: rgb(var(--hx-accent) / .1); }
html .bg-n-brand\/20, html .focus-visible\:bg-n-brand\/20:focus-visible,
html .hover\:enabled\:bg-n-brand\/20:enabled:hover { background-color: rgb(var(--hx-accent) / .2); }
html .hover\:bg-n-brand\/80:hover { background-color: rgb(var(--hx-accent) / .8); }
html .text-n-brand, html .hover\:text-n-brand:hover,
html .group:hover .group-hover\:text-n-brand,
html .group:focus-within .group-focus-within\:text-n-brand,
html .dark\:hover\:text-n-brand:hover:is(.dark *) { color: rgb(var(--hx-accent)); }
html p a { color: rgb(var(--hx-link)); }   /* Jivo холбоос #367FEE */
html .border-n-brand, html .hover\:border-n-brand:hover, html .focus\:border-n-brand:focus,
html .focus-visible\:border-n-brand:focus-visible, html .checked\:border-n-brand:checked,
html .indeterminate\:border-n-brand:indeterminate,
html .dark\:border-n-brand:is(.dark *) { border-color: rgb(var(--hx-accent)); }
html .border-n-brand\/50 { border-color: rgb(var(--hx-accent) / .5); }
html .border-t-n-brand { border-top-color: rgb(var(--hx-accent)); }
html .outline-n-brand, html .focus\:outline-n-brand:focus,
html .focus-visible\:outline-n-brand:focus-visible, html .focus-within\:outline-n-brand:focus-within,
html .has-\[\:focus\]\:outline-n-brand:has(:focus),
html .dark\:focus-within\:outline-n-brand:focus-within:is(.dark *),
html .dark\:has-\[\:focus\]\:outline-n-brand:has(:focus):is(.dark *) { outline-color: rgb(var(--hx-accent)); }
html .\!outline-n-brand, html .dark\:\!outline-n-brand:is(.dark *) { outline-color: rgb(var(--hx-accent)) !important; }
html .ring-n-brand, html .focus\:ring-n-brand:focus, html .focus-visible\:ring-n-brand:focus-visible,
html .focus-within\:ring-n-brand:focus-within { --tw-ring-color: rgb(var(--hx-accent)); }
html .from-n-brand\/15 { --tw-gradient-from: rgb(var(--hx-accent) / .15) var(--tw-gradient-from-position); }

/* ── 2. Гадаргуу: rail + жагсаалт #FAFBFC (баруун талдаа 1px #E1E4E8), чат #FFF ───────────────────────── */
/* Өмнө нь (10-08 хүртэл) rail + жагсаалт Chatwoot-ийн .dark багцаар үргэлж бараан байсан — Jivo цайвар тул хасав. */
aside:has(~ main) {
  background-color: rgb(var(--hx-rail)) !important;
  border-color: rgb(var(--hx-line)) !important;
  color: rgb(var(--hx-dim));
}
.conversations-list-wrap {
  background-color: rgb(var(--hx-list));
  border-color: rgb(var(--hx-line));
  color: rgb(var(--hx-text));
}
html .conversation-details-wrap { background-color: rgb(var(--hx-chat)); }

/* ── 3. Icon rail (Sidebar хураасан горим) — Jivo шиг icon-ы доор нэр ───────── */
/* Хураасан горимд л (`li > div > a[title]` = SidebarGroup isCollapsed). Chatwoot inline
   width 56px (MIN_WIDTH) — шошго багтахаар 76px; <160 тул Chatwoot хураасан гэж үзсээр. */
@media (min-width: 768px) {
  aside:has(~ main):has(nav li:not([data-hx-hibot]):not([data-hx-app]) > div > a[title]) { width: 76px !important; }
}
aside:has(~ main) nav li > div > a[title],
aside:has(~ main) > section a[href$="/search"][title],
aside:has(~ main) > section span > button:has(> .i-lucide-pen-line) {
  width: 66px !important; height: auto !important; min-height: 50px;
  flex-direction: column; gap: 4px; padding: 7px 2px 6px;
  border-radius: 12px; outline: none !important;
  color: rgb(var(--hx-dim)) !important; background: transparent !important;
}
aside:has(~ main) nav li > div > a[title] > span,
aside:has(~ main) > section a[href$="/search"][title] > span,
aside:has(~ main) > section span > button:has(> .i-lucide-pen-line) > span { width: 20px; height: 20px; flex-shrink: 0; }
aside:has(~ main) nav li > div > a[title]::after,
aside:has(~ main) > section a[href$="/search"][title]::after,
aside:has(~ main) > section span > button:has(> .i-lucide-pen-line)::after {
  content: attr(title);
  display: block; max-width: 100%;
  font-size: 10.5px; line-height: 13px; font-weight: 500; letter-spacing: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* Jivo-гийн англи нэр (эзэн 10-08: Монгол текст байхгүй) — Contact Center ⇒ Chats, CRM, Statistics, Manage.
   Дээрх `li > div > a[title]::after`-аас өндөр specificity хэрэгтэй тул бүтэн замаар. */
aside:has(~ main) nav li > div > a[title="My Inbox"]::after { content: "Alerts"; }
aside:has(~ main) nav li > div > a[title="Conversations"]::after { content: "Chats"; }
aside:has(~ main) nav li > div > a[title="Contacts"]::after { content: "CRM"; }
aside:has(~ main) nav li > div > a[title="Reports"]::after { content: "Statistics"; }
aside:has(~ main) nav li > div > a[title="Settings"]::after { content: "Manage"; }
aside:has(~ main) > section a[href$="/search"][title]::after { content: "Search"; }
aside:has(~ main) > section span > button:has(> .i-lucide-pen-line)::after { content: "New chat"; }
aside:has(~ main) nav li > div > a[title]:hover,
aside:has(~ main) > section a[href$="/search"][title]:hover,
aside:has(~ main) > section span > button:has(> .i-lucide-pen-line):hover {
  background: transparent !important; color: rgb(var(--hx-text)) !important;
}
aside:has(~ main) nav li > div > a.bg-n-alpha-2 { background: transparent !important; color: rgb(var(--hx-success)) !important; }
aside:has(~ main) nav li > a.bg-n-alpha-2 > div > span[class*="i-"] { color: rgb(var(--hx-success)); }

/* Зөвлөхөд хэрэггүй цэс: Captain, Help Center, Campaigns, Calls (хоёр горимд) */
aside:has(~ main) nav > ul > li:has(> a[href*="/captain/"]),
aside:has(~ main) nav > ul > li:has(> div > a[href*="/captain/"]),
aside:has(~ main) nav > ul > li:has(> a[href*="/portals/"]),
aside:has(~ main) nav > ul > li:has(> div > a[href*="/portals/"]),
aside:has(~ main) nav > ul > li:has(> a[href*="/campaigns"]),
aside:has(~ main) nav > ul > li:has(> div > a[href*="/campaigns"]),
aside:has(~ main) nav > ul > li:has(> a[href$="/calls"]),
aside:has(~ main) nav > ul > li:has(> div > a[href$="/calls"]) { display: none !important; }

/* ── hibox sidebar rail (jivo) ───────────────────────────────────────────────
   Jivo-гийн зүүн rail шиг (эзэн 10-08). Эх: Jivo операторын апп (app3 common.js `side-menu`, 2026-10-07):
   өргөн тогтмол, icon 24px, шошго icon-ы доор — хулгана rail дээр очиход л бүгд гарна (10-09 Jivo-д тулгаж
   харсан, эзэн: «mouse ойртуулвал text нь гардаг»; 10-08-ын «үргэлж» шийдвэрийг орлоно). Өргөн тогтмол ⇒
   үндсэн хэсэг хөдлөхгүй. Цайвар rail
   (10-09, Jivo #FAFBFC): icon #959DA5, шошго зөвхөн rail дээр хулгана байхад, hover ⇒ #1B1F23, идэвхтэй ⇒ Jivo
   ногоон #18C139, дэвсгэргүй.
   Улаан тоо icon-ы төвөөс 8px доор (Jivo badge, rail-ын өнгөтэй 2px хүрээ).
   Дараалал/шошгыг hibox-theme.js `paintRail` тавина (`data-hx-item`, inline `order`, `data-hx-label`,
   `data-hx-flat` = display: contents ⇒ section/nav/ul-ын хүүхдүүд aside-ын нэг flex баганад). Chatwoot-ийн
   DOM-ыг хөдөлгөхгүй тул Vue patch, popover-ын байрлал хэвээр. `aside[data-hx-rail]`-ийг JS зөвхөн хураасан
   desktop rail дээр, хамгийн сүүлд тавина ⇒ JS ажиллахгүй бол дээрх §3-ын rail хэвээр (fallback).
   `:not(#hx)` = ID-ийн жин — §3-ын `!important` дүрмүүдийг §3-ыг засахгүйгээр дарна.
   Icon: Lucide v1.34.0 (ISC, lucide.dev), outline stroke 1.75, CSS mask ⇒ өнгө нь currentColor. */
:root {
  --hx-rail-icon: 149 157 165;      /* Jivo text-tertiary #959DA5 */
  --hx-rail-label: 149 157 165;     /* Jivo text-tertiary #959DA5 (10px/500) */
  --hx-rail-label-hi: 27 31 35;     /* hover ⇒ Jivo text-primary #1B1F23 */
  --hx-rail-active: 24 193 57;      /* идэвхтэй icon + шошго — Jivo ногоон #18C139 */
  --hx-rail-badge: 249 70 54;       /* Jivo status-danger #F94636 */
  --hx-rail-fade: 150ms;            /* Jivo duration-[0.15s] ease-linear */
}
body.dark {
  --hx-rail-icon: 119 123 132;      /* Chatwoot dark slate-10 */
  --hx-rail-label: 119 123 132;
  --hx-rail-label-hi: 237 238 240;  /* Chatwoot dark slate-12 */
  --hx-rail-badge: 225 57 41;       /* Jivo night status-danger #E13929 */
}
@media (min-width: 768px) {
  aside[data-hx-rail]:not(#hx) { padding: 12px 0 8px; }  /* баруун 1px зураас = aside-ын border (§2) */
  aside[data-hx-rail]:not(#hx) [data-hx-item] { align-self: center; margin: 0; }
  aside[data-hx-rail]:not(#hx) [data-hx-item="brand"] { display: none; }  /* лого = «Switch account» — ганц данс (Hibox) ⇒ хэрэггүй (эзэн 10-30) */
  aside[data-hx-rail]:not(#hx) [data-hx-gap] { margin-top: auto; }  /* дээд/доод бүлгийн завсар */
  aside[data-hx-rail]:not(#hx) [data-hx-item="me"] { align-self: stretch; padding-top: 6px; }
  aside[data-hx-rail]:not(#hx) [data-hx-item="me"] > div.absolute { display: none; }  /* nav-ын gradient */
  aside[data-hx-rail]:not(#hx) [data-hx-item="me"] > div:not(.absolute) { padding: 0; border-top: 0; box-shadow: none; }

  /* Мөр: 24px icon, доор нь шошго (Jivo `px-1.5 py-1`, `w-6 h-6`, `text-label-small`) */
  aside[data-hx-rail]:not(#hx) [data-hx-label] {
    position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px;
    width: 66px !important; height: auto !important; min-height: 0; padding: 5px 2px 2px;
    border-radius: 10px; outline: none !important; background: transparent !important;
    color: rgb(var(--hx-rail-icon)) !important; transition: color var(--hx-rail-fade) linear;
  }
  aside[data-hx-rail]:not(#hx) [data-hx-label]:focus-visible { outline: 2px solid rgb(var(--hx-accent)) !important; outline-offset: -2px; }
  aside[data-hx-rail]:not(#hx) :is([data-hx-item="chats"], [data-hx-item="crm"], [data-hx-item="companies"], [data-hx-item="alerts"], [data-hx-item="hibot"], [data-hx-item="compose"], [data-hx-item="search"], [data-hx-item="reports"], [data-hx-item="settings"]) [data-hx-label] > :is(span[class^="i-"], span[class*=" i-"]),
  aside[data-hx-rail]:not(#hx) [data-hx-item="search"][data-hx-label] > :is(span[class^="i-"], span[class*=" i-"]) {
    display: block; flex: none; width: 24px !important; height: 24px !important;
    background: currentColor !important;
    -webkit-mask: var(--hx-icon) center / 24px 24px no-repeat !important;
    mask: var(--hx-icon) center / 24px 24px no-repeat !important;
  }
  /* hover ⇒ бараан (Jivo `.item:hover .ico`), идэвхтэй ⇒ ногоон (`.item.actived .ico`) — идэвхтэй нь hover-ыг дарна */
  aside[data-hx-rail]:not(#hx) [data-hx-label]:hover { color: rgb(var(--hx-rail-label-hi)) !important; }
  aside[data-hx-rail]:not(#hx) [data-hx-label]:is(.bg-n-alpha-2, [class~="!bg-n-alpha-2"]),
  aside[data-hx-rail]:not(#hx) [data-hx-item="search"].router-link-active { color: rgb(var(--hx-rail-active)) !important; }

  /* Шошго: Jivo шиг хулгана rail дээр очих (эсвэл Tab-аар фокус орох) үед л БҮГД гарна (эзэн 10-09 — Jivo-д
     тулгаж харсан). Зай нь үргэлж хадгалагдана ⇒ icon хөдлөхгүй; hover/фокус ⇒ бараан, идэвхтэй ⇒ ногоон */
  aside[data-hx-rail]:not(#hx) [data-hx-label]::after {
    content: attr(data-hx-label);
    display: block; max-width: 100%; min-height: 14px;
    font-size: 10px; line-height: 14px; font-weight: 500; letter-spacing: 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    color: rgb(var(--hx-rail-label)); opacity: 0;
    transition: color var(--hx-rail-fade) linear, opacity var(--hx-rail-fade) linear;
  }
  aside[data-hx-rail]:not(#hx):is(:hover, :focus-within) [data-hx-label]::after { opacity: 1; }
  aside[data-hx-rail]:not(#hx) [data-hx-label]:is(:hover, :focus-visible)::after { color: rgb(var(--hx-rail-label-hi)); }
  aside[data-hx-rail]:not(#hx) [data-hx-label]:is(.bg-n-alpha-2, [class~="!bg-n-alpha-2"])::after,
  aside[data-hx-rail]:not(#hx) [data-hx-item="search"].router-link-active::after { color: rgb(var(--hx-rail-active)); }

  /* Улаан тоо (Jivo Badge: 18px, 11px/600, rail-ын өнгөтэй 2px хүрээ, icon-ы зүүн дээд булангаас 12/8px) */
  aside[data-hx-rail]:not(#hx) [data-hx-badge]::before {
    content: attr(data-hx-badge);
    position: absolute; top: 13px; left: 50%; z-index: 1; pointer-events: none;
    box-sizing: border-box; min-width: 18px; height: 18px; padding: 0 4px;
    border: 2px solid rgb(var(--hx-rail)); border-radius: 9px;
    background: rgb(var(--hx-rail-badge)); color: #fff;
    font-size: 11px; font-weight: 600; line-height: 14px; text-align: center; font-variant-numeric: tabular-nums;
  }
  aside[data-hx-rail]:not(#hx) [data-hx-item="chats"] { --hx-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z'/%3E%3Cpath d='M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1'/%3E%3C/svg%3E"); } /* lucide messages-square */
  aside[data-hx-rail]:not(#hx) [data-hx-item="crm"] { --hx-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 2v2'/%3E%3Cpath d='M17.915 21a6 6 0 10-12 0'/%3E%3Cpath d='M8 2v2'/%3E%3Ccircle cx='12' cy='11' r='4'/%3E%3Crect x='3' y='3' width='18' height='18' rx='2'/%3E%3C/svg%3E"); } /* lucide contact-round */
  aside[data-hx-rail]:not(#hx) [data-hx-item="companies"] { --hx-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 12h4'/%3E%3Cpath d='M10 8h4'/%3E%3Cpath d='M14 21v-3a2 2 0 0 0-4 0v3'/%3E%3Cpath d='M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2'/%3E%3Cpath d='M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16'/%3E%3C/svg%3E"); } /* lucide building-2 */
  aside[data-hx-rail]:not(#hx) [data-hx-item="alerts"] { --hx-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.268 21a2 2 0 0 0 3.464 0'/%3E%3Cpath d='M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326'/%3E%3C/svg%3E"); } /* lucide bell */
  aside[data-hx-rail]:not(#hx) [data-hx-item="hibot"] { --hx-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 8V4H8'/%3E%3Crect width='16' height='12' x='4' y='8' rx='2'/%3E%3Cpath d='M2 14h2'/%3E%3Cpath d='M20 14h2'/%3E%3Cpath d='M15 13v2'/%3E%3Cpath d='M9 13v2'/%3E%3C/svg%3E"); } /* lucide bot */
  aside[data-hx-rail]:not(#hx) [data-hx-item="compose"] { --hx-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7'/%3E%3Cpath d='M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z'/%3E%3C/svg%3E"); } /* lucide square-pen */
  aside[data-hx-rail]:not(#hx) [data-hx-item="search"] { --hx-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21 21-4.34-4.34'/%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3C/svg%3E"); } /* lucide search */
  aside[data-hx-rail]:not(#hx) [data-hx-item="reports"] { --hx-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3v16a2 2 0 0 0 2 2h16'/%3E%3Cpath d='M18 17V9'/%3E%3Cpath d='M13 17V5'/%3E%3Cpath d='M8 17v-3'/%3E%3C/svg%3E"); } /* lucide chart-column */
  aside[data-hx-rail]:not(#hx) [data-hx-item="settings"] { --hx-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 5H3'/%3E%3Cpath d='M12 19H3'/%3E%3Cpath d='M14 3v4'/%3E%3Cpath d='M16 17v4'/%3E%3Cpath d='M21 12h-9'/%3E%3Cpath d='M21 19h-5'/%3E%3Cpath d='M21 5h-7'/%3E%3Cpath d='M8 10v4'/%3E%3Cpath d='M8 12H3'/%3E%3C/svg%3E"); } /* lucide sliders-horizontal */
}
/* Нэг багана (Jivo дараалал, display: contents) зөвхөн бүх мөр багтах өндөрт. display: contents нь nav-ын
   гүйлгээг арилгадаг, aside-д overflow тавьж болохгүй (профайл/дансны dropdown aside дотор absolute ⇒ тасарна). */
@media (min-width: 768px) and (min-height: 481px) {
  aside[data-hx-rail]:not(#hx) [data-hx-flat] { display: contents; }
}
/* Богино цонх (desktop апп minHeight 600): шошгын зайг авч хаяна — title tooltip үлдэнэ */
@media (min-width: 768px) and (max-height: 560px) {
  aside[data-hx-rail]:not(#hx) [data-hx-label] { padding: 6px 2px; }
  aside[data-hx-rail]:not(#hx) [data-hx-label]::after { display: none; }
  aside[data-hx-rail]:not(#hx) [data-hx-badge]::before { top: 14px; }
}
/* Маш богино (≤480px: minHeight 600 + 150% zoom ≈ 380px): Chatwoot-ийн өөрийн бүтэц — New chat/Search дээд
   хэсэгт, цэс nav дотроо гүйлгэгдэнэ, аватар/төлөв доор ҮРГЭЛЖ харагдана (nav-ын дотор Jivo дараалал хэвээр). */
@media (min-width: 768px) and (max-height: 480px) {
  aside[data-hx-rail]:not(#hx) { padding: 6px 0 4px; }
  aside[data-hx-rail]:not(#hx) > section[data-hx-flat] { margin: 0 0 4px; gap: 4px; }
  aside[data-hx-rail]:not(#hx) > section[data-hx-flat] > div[data-hx-flat] { gap: 0; }
  aside[data-hx-rail]:not(#hx) [data-hx-item="brand"] { margin-bottom: 0; }
  aside[data-hx-rail]:not(#hx) > nav[data-hx-flat] { min-height: 0; padding-bottom: 0; }
  aside[data-hx-rail]:not(#hx) [data-hx-label] { padding: 4px 2px; }
  aside[data-hx-rail]:not(#hx) [data-hx-badge]::before { top: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  aside[data-hx-rail]:not(#hx) [data-hx-label],
  aside[data-hx-rail]:not(#hx) [data-hx-label]::after { transition: none; }
}
/* ── /hibox sidebar rail (jivo) ── */

/* ── 4. Ярианы жагсаалт — Jivo «Contact Center» ─────────────────────────────────────────────────────── */
/* Гарчиг (ChatListHeader.vue `h1`; «Conversations» ⇒ «Contact Center» — JS §15а) 18px/700. Төлөвийн chip
   (`span.bg-n-slate-3`) ба шүүлтүүр/эрэмбийн icon товч чимээгүй (#959DA5, дэвсгэргүй). Эрэмбийн dropdown-ын
   доторх товчийг хөндөхгүй (зөвхөн header-ийн баруун бүлгийн шууд товч). */
.conversations-list-wrap h1 { font-size: 18px; line-height: 24px; font-weight: 700; color: rgb(var(--hx-text)); }
.conversations-list-wrap > div:has(> div > h1) { height: 56px; padding-inline: 16px 10px; }
.conversations-list-wrap > div:has(> div > h1) span.bg-n-slate-3 {
  background: transparent; color: rgb(var(--hx-muted)); font-size: 12px; padding-inline: 4px;
}
.conversations-list-wrap > div:has(> div > h1) > div:last-child > button,
.conversations-list-wrap > div:has(> div > h1) > div:last-child > div > button {
  background: transparent !important; color: rgb(var(--hx-dim)) !important;
}
.conversations-list-wrap > div:has(> div > h1) > div:last-child > button:hover,
.conversations-list-wrap > div:has(> div > h1) > div:last-child > div > button:hover { color: rgb(var(--hx-text)) !important; }

/* Таб: Jivo дараалал Inbox · My · All. li-г ЗӨӨХГҮЙ — JS `data-hx-tab` ⇒ `order` (Tabs.vue `ul.flex`).
   14px; идэвхтэй 700 #1B1F23 + 2px доогуур зураас; бусад 400 #6A737D. */
.conversations-list-wrap div:has(> ul > li > a.text-button) {
  padding-inline: 16px; margin-bottom: 0; border-bottom: 1px solid rgb(var(--hx-line));
}
.conversations-list-wrap ul:has(> li > a.text-button) { gap: 20px; padding-inline: 0; }
.conversations-list-wrap ul:has(> li > a.text-button) > li { margin: 0 !important; order: 4; }
.conversations-list-wrap ul:has(> li > a.text-button) > li[data-hx-tab="unassigned"] { order: 1; }
.conversations-list-wrap ul:has(> li > a.text-button) > li[data-hx-tab="mine"] { order: 2; }
.conversations-list-wrap ul:has(> li > a.text-button) > li[data-hx-tab="all"] { order: 3; }
.conversations-list-wrap li > a.text-button {
  padding-block: 10px; font-size: 14px !important; line-height: 20px !important; font-weight: 400; color: rgb(var(--hx-muted));
}
.conversations-list-wrap li > a.text-button:hover { color: rgb(var(--hx-text)); }
.conversations-list-wrap li > a.text-button.after\:bg-n-brand { color: rgb(var(--hx-text)); font-weight: 700; }
.conversations-list-wrap li > a.text-button.after\:bg-n-brand::after { bottom: 0; height: 2px; background-color: rgb(var(--hx-text)); }
/* Тоо — дээд индекс (Jivo): Inbox = улаан pill (11px/600 цагаан), My/All = саарал 11px; 0 ⇒ нуух (JS `data-hx-zero`) */
.conversations-list-wrap li > a.text-button > div.rounded-full {
  align-self: flex-start; height: 16px; min-width: 0; margin: 0 0 0 2px; padding: 0; transform: translateY(-5px);
  background: transparent !important; color: rgb(var(--hx-muted)) !important;
  font-size: 12px; font-weight: 400; line-height: 16px;
}
.conversations-list-wrap li[data-hx-tab="unassigned"] > a.text-button > div.rounded-full {
  min-width: 16px; padding: 0 4px; border-radius: 8px;
  background: rgb(var(--hx-danger)) !important; color: #fff !important; font-weight: 600;
}
.conversations-list-wrap li[data-hx-zero] > a.text-button > div.rounded-full { display: none; }
/* All — тоо харуулахгүй (Jivo chats.bundle: allChats `badge: null`; эзэн 10-09 «All дээр тоо шаардлагагүй») */
.conversations-list-wrap li[data-hx-tab="all"] > a.text-button > div.rounded-full { display: none; }

/* Хайлт (JS §15б `.hx-search`, табын доор): icon + «Search», дэвсгэргүй; Enter ⇒ Chatwoot-ийн хайлтын хуудас */
.conversations-list-wrap > .hx-search {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
  height: 32px; margin: 8px 12px 4px; padding: 0 8px; border-radius: 6px;
  border: 1px solid transparent; background: transparent; color: rgb(var(--hx-dim));
}
.conversations-list-wrap > .hx-search:focus-within { border-color: rgb(var(--hx-link)); background: rgb(var(--hx-chat)); }
.conversations-list-wrap > .hx-search::before {
  content: ""; flex: none; width: 16px; height: 16px; background: currentColor;
  -webkit-mask: var(--hx-i-search) center / 16px 16px no-repeat; mask: var(--hx-i-search) center / 16px 16px no-repeat;
}
.hx-search > .hx-search-input {
  flex: 1 1 auto; min-width: 0; height: 30px; margin: 0; padding: 0;
  border: 0 !important; outline: 0 !important; box-shadow: none !important; background: transparent !important;
  font: inherit; font-size: 14px; line-height: 20px; color: rgb(var(--hx-text));
}
.hx-search > .hx-search-input::placeholder { color: rgb(var(--hx-muted)); opacity: 1; }

/* Мөр (ConversationCard.vue): 40px аватар; 1-р мөр нэр 14px/500 + цаг баруун талд 11px; 2–3-р мөр урьдчилсан
   текст 2 мөр 13px #959DA5, өмнө нь сувгийн icon; оноогдсон ажилтан (байвал) доод мөрөнд. DOM хөдлөхгүй:
   `.border-line` flex-wrap + `order`, meta / InboxName (`div[title]`) = display: contents ⇒ icon нь 2-р мөрийн
   эхэнд, inbox нэр нуугдана (`title` tooltip үлдэнэ). Padding 8px 12px, радиус 6px, 4px зай. Hover #F0F3F4;
   сонгосон (нээлттэй) мөр Jivo шиг #1C6AE1, бүх текст/icon цагаан. */
.conversations-list-wrap .conversation {
  margin: 0 8px 4px; padding: 8px 12px !important; border: 0 !important; border-radius: 6px;
  align-items: flex-start; min-height: 0;
}
.conversations-list-wrap .conversation::before { display: none !important; }
.conversations-list-wrap .conversation:hover,
.conversations-list-wrap .conversation.selected { background-color: rgb(var(--hx-hover)) !important; }
.conversations-list-wrap .conversation.active { background-color: rgb(var(--hx-accent)) !important; }
.conversations-list-wrap .conversation.active .border-line,
.conversations-list-wrap .conversation.active .border-line * { color: #fff !important; }
.conversations-list-wrap .conversation > .relative > span,
.conversations-list-wrap .conversation > .relative > span > span[role="img"],
.conversations-list-wrap .conversation > .relative label {
  width: 40px !important; height: 40px !important; margin-top: 0 !important; border-radius: 9999px !important;
}
.conversations-list-wrap .conversation > .relative > span > span[role="img"] > span { font-size: 15px !important; font-weight: 600; }
.conversations-list-wrap .conversation .border-line {
  display: flex; flex-flow: row wrap; align-items: flex-start; align-content: flex-start;
  min-width: 0; padding: 0 !important; margin-inline-start: 10px;
}
.conversations-list-wrap .conversation .border-line > * { margin-inline: 0 !important; }
.conversations-list-wrap .conversation .conversation--user {
  order: 1; flex: 0 0 100%; min-width: 0; padding: 0 48px 0 0 !important;
  font-size: 14px; line-height: 20px; font-weight: 500 !important; color: rgb(var(--hx-text));
}
.conversations-list-wrap .conversation .border-line > div:first-child:not(.absolute),
.conversations-list-wrap .conversation .border-line > div:first-child:not(.absolute) > div[title] { display: contents; }
.conversations-list-wrap .conversation .border-line > div:first-child:not(.absolute) > div[title] > span.truncate { display: none; }
.conversations-list-wrap .conversation .border-line > div:first-child:not(.absolute) > div[title] > span.inline-flex {
  order: 2; flex: none; width: 14px !important; height: 14px !important; margin: 2px 6px 0 0;
}
.conversations-list-wrap .conversation .border-line > div:first-child:not(.absolute) > div:not([title]) {
  order: 4; flex: 0 0 100%; justify-content: flex-start !important; margin-top: 2px;
}
.conversations-list-wrap .conversation .border-line > div:first-child:not(.absolute) > div:not([title]):empty { display: none; }
.conversations-list-wrap .conversation .border-line > div:first-child:not(.absolute) > div:not([title]) span {
  font-size: 12px; line-height: 16px; color: rgb(var(--hx-muted));
}
.conversations-list-wrap .conversation .conversation--user + :is(div, p):not(.absolute) {
  order: 3; flex: 1 1 0; min-width: 0; height: auto !important; max-height: 36px; overflow: hidden;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; white-space: normal !important;
  font-size: 13px; line-height: 18px; font-weight: 400 !important; color: rgb(var(--hx-muted)) !important;
}
.conversations-list-wrap .conversation .border-line > div.absolute ~ div { order: 5; flex: 0 0 100%; }
.conversations-list-wrap .conversation .border-line > div.absolute { top: 10px !important; inset-inline-end: 12px; }
.conversations-list-wrap .conversation .border-line > div.absolute > span,
.conversations-list-wrap .conversation .border-line > div.absolute > span > div { font-size: 12px; line-height: 16px; color: rgb(var(--hx-muted)); }
/* Уншаагүй тоо — rail-ын Alerts-ийн улаантай ижил (UnreadBadge.vue `bg-n-teal-9` ⇒ Jivo status-danger). Цагийн доор
   (Chatwoot `mt-1`) = урьдчилсан текстийн 1-р мөрийн баруун талд (Jivo) — текст тоогоор таслагдахгүйн тулд баруун зай.
   (0.1.4–10-08: 2-р мөр нь ажилтны нэр байсан тул тоог 3-р мөр рүү `margin-top: 20px`-ээр түлхдэг байв — одоо
   ажилтан доод мөрөнд тул хэрэггүй.) */
.conversations-list-wrap .conversation .border-line > div.absolute > span.bg-n-teal-9 { background-color: rgb(var(--hx-rail-badge)); color: #fff; }
.conversations-list-wrap .conversation .border-line:has(> div.absolute > span.bg-n-teal-9) > .conversation--user ~ :not(.absolute) { padding-inline-end: 30px; }
/* Суваг өнгөөр (Jivo шиг). InboxName.vue (`div[title]` = inbox нэр) > ChannelIcon.vue `span.inline-flex > span.i-woot-*`
   (icons/provider.js channelTypeIconMap). Iconify mask icon ⇒ `background-color: currentColor` ⇒ `color` л солино;
   Instagram-д gradient (background-image mask-аар тайрагдана). Сонгосон мөрөнд цагаан. */
.conversations-list-wrap .conversation .border-line div[title] > span.inline-flex > span.i-woot-messenger { color: #1877f2; }
.conversations-list-wrap .conversation .border-line div[title] > span.inline-flex > span.i-woot-instagram {
  color: #e1306c; background-image: linear-gradient(45deg, #feda75 0%, #fa7e1e 25%, #d62976 50%, #962fbf 75%, #4f5bd5 100%);
}
.conversations-list-wrap .conversation .border-line div[title] > span.inline-flex > span.i-woot-website { color: #2dbe60; }
.conversations-list-wrap .conversation .border-line div[title] > span.inline-flex > span:is(.i-woot-mail, .i-woot-gmail, .i-woot-outlook) { color: #12a594; }
.conversations-list-wrap .conversation .border-line div[title] > span.inline-flex > span.i-woot-api { color: #8b95a1; }
.conversations-list-wrap .conversation.active .border-line div[title] > span.inline-flex > span[class*="i-woot-"] { background-image: none; }

/* ── 5. Чатын толгой — Jivo: аватаргүй; нэр 16px/600; доор «<суваг> • <inbox>» 14px #959DA5 ──────────── */
/* ConversationHeader.vue: аватар (Avatar.vue `span.inline-flex`) нуух; «#id •» (copy товч + «•») нуух; InboxName-ийн
   icon нуух, `div[title][data-hx-channel]::before` = «Facebook • » (JS §15в — inbox.channel_type-аас). */
.conversation-details-wrap :has(> .conversation--header--actions) > div:first-child > span {
  font-size: 16px; line-height: 22px; font-weight: 600; color: rgb(var(--hx-text));
}
.conversation-details-wrap span.inline-flex:has(+ div > .conversation--header--actions) { display: none !important; }
.conversation-details-wrap div:has(> .conversation--header--actions) { margin-inline-start: 0; }
.conversation-details-wrap .conversation--header--actions,
.conversation-details-wrap .conversation--header--actions .text-label-small { font-size: 14px; line-height: 20px; color: rgb(var(--hx-muted)); }
.conversation-details-wrap .conversation--header--actions > button:first-child,
.conversation-details-wrap .conversation--header--actions > button:first-child + span:has(+ div[title]) { display: none; }
.conversation-details-wrap .conversation--header--actions div[title] > span.inline-flex { display: none; }
.conversation-details-wrap .conversation--header--actions div[title][data-hx-channel]::before {
  content: attr(data-hx-channel) " \2022 "; flex: none; white-space: pre;
}
@media (min-width: 1280px) {
  .conversation-details-wrap > div:first-child:has(.conversation--header--actions) { height: 64px !important; }
}
/* Resolve (buttons/ResolveAction.vue `.resolve-actions > div` ButtonGroup > NextButton ×2): Jivo «Resolved» шиг
   хүрээтэй товч — 1px #D1D5DA, 6px, 12px #6A737D, зүүн талд check-circle; dropdown (chevron), kebab хэвээр. */
.conversation-details-wrap .resolve-actions > div:first-child {
  overflow: hidden; border: 1px solid rgb(var(--hx-line-strong)); border-radius: 6px; box-shadow: none !important; outline: 0 !important;
}
.conversation-details-wrap .resolve-actions > div:first-child > button {
  height: 28px; border-radius: 0 !important; background: transparent !important; color: rgb(var(--hx-muted)) !important;
  font-size: 12px; font-weight: 500;
}
.conversation-details-wrap .resolve-actions > div:first-child > button:hover:not(:disabled) { background: rgb(var(--hx-hover)) !important; color: rgb(var(--hx-text)) !important; }
.conversation-details-wrap .resolve-actions > div:first-child > button + button { border-inline-start: 1px solid rgb(var(--hx-line-strong)); }
.conversation-details-wrap .resolve-actions > div:first-child > button:first-child:not(:has(> .i-lucide-chevron-down))::before {
  content: ""; flex: none; width: 14px; height: 14px; background: currentColor;
  -webkit-mask: var(--hx-i-check) center / 14px 14px no-repeat; mask: var(--hx-i-check) center / 14px 14px no-repeat;
}

/* ── 6. Мессеж: хавтгай, бүгд зүүн талд (Slack/Jivo) — hibox-theme.js data-hx тавина ── */
.conversation-panel .message-bubble-container[data-hx] {
  display: grid !important; grid-template-columns: 36px minmax(0, 1fr);
  grid-template-areas: "av hd" "av bd"; column-gap: 12px; align-items: start;
  justify-content: stretch !important; margin: 0 !important; padding: 10px 12px 2px; border-radius: 8px;
}
.conversation-panel .message-bubble-container[data-hx]:hover { background-color: rgb(var(--slate-2)); }
/* Jivo шиг харилцагчийн мессежийн зүүн талын 1.5px цэнхэр зураас (#1C6AE1) */
.conversation-panel .message-bubble-container[data-hx="contact"] { box-shadow: inset 1.5px 0 0 rgb(var(--hx-accent)); border-radius: 0 8px 8px 0; }
.conversation-panel .message-bubble-container[data-hx] > :not(.hx-av):not(.hx-hd) { grid-area: bd; min-width: 0; }
.conversation-panel .message-bubble-container[data-hx] > .hx-av {
  grid-area: av; width: 36px; height: 36px; margin-top: 2px; border-radius: 9999px; overflow: hidden;
  display: grid; place-items: center; font-size: 13px; font-weight: 600; color: #fff;
  background: var(--hx-av, #8b8d98); user-select: none;
}
.conversation-panel .message-bubble-container[data-hx] > .hx-av > img { width: 100%; height: 100%; object-fit: cover; }
/* Бот (HiBOT / Hicargo BOT): саарал дугуй + lucide `bot` (JS `.hx-av-bot`, нэрийн үсэггүй) */
.conversation-panel .message-bubble-container[data-hx] > .hx-av.hx-av-bot { background: rgb(var(--hx-hover)); color: rgb(var(--hx-muted)); }
.conversation-panel .message-bubble-container[data-hx] > .hx-av.hx-av-bot::before {
  content: ""; width: 20px; height: 20px; background: currentColor;
  -webkit-mask: var(--hx-i-bot) center / 20px 20px no-repeat; mask: var(--hx-i-bot) center / 20px 20px no-repeat;
}
.conversation-panel .message-bubble-container[data-hx] > .hx-hd {
  grid-area: hd; display: flex; align-items: baseline; gap: 8px; min-width: 0; line-height: 20px;
}
.hx-hd > .hx-name { font-size: 14px; font-weight: 700; color: rgb(var(--hx-text)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[data-hx="contact"] > .hx-hd > .hx-name { color: rgb(var(--hx-accent)); }
body.dark [data-hx="contact"] > .hx-hd > .hx-name { color: rgb(var(--hx-link)); }   /* #1C6AE1 бараан дээр 3.3:1 ⇒ blue-11 (S6 10-29) */
/* Jivo «bot» / «page» шошго: #F0F3F4, 11px/400, 3px, 0 5px */
:is(.hx-hd, .hx-prev-hd) > .hx-tag {
  flex: none; align-self: center; padding: 0 5px; border-radius: 3px;
  font-size: 11px; font-weight: 400; line-height: 16px; background: rgb(var(--hx-hover)); color: rgb(var(--hx-text));
}
.hx-hd > .hx-noted { flex: none; font-size: 12px; color: rgb(var(--hx-muted)); white-space: nowrap; }   /* Jivo «Commented» */
.hx-hd > .hx-time { font-size: 12px; color: rgb(var(--hx-muted)); white-space: nowrap; }
/* Нэг илгээгчийн дараалсан мессеж — толгойгүй */
.conversation-panel .message-bubble-container.group-with-next + .message-bubble-container[data-hx] { padding-top: 1px; }
.conversation-panel .message-bubble-container.group-with-next + .message-bubble-container[data-hx] > .hx-hd { display: none; }
.conversation-panel .message-bubble-container.group-with-next + .message-bubble-container[data-hx] > .hx-av { visibility: hidden; height: 0; margin: 0; }

/* Chatwoot-ийн bubble-ыг хавтгайруулах */
.conversation-panel .message-bubble-container[data-hx] > div.grid {
  display: flex !important; flex-direction: column; align-items: flex-start; gap: 4px;
}
.conversation-panel .message-bubble-container[data-hx] [class*="grid-area:avatar"] { display: none !important; }
.conversation-panel .message-bubble-container[data-hx] [class*="grid-area:bubble"] {
  margin: 0 !important; justify-content: flex-start !important; max-width: 100%;
}
.conversation-panel .message-bubble-container[data-hx] :is(.left-bubble, .right-bubble):not([class*="bg-n-solid-amber"]):not([class*="bg-n-ruby"]) {
  background: transparent !important; padding: 0 !important; border-radius: 0 !important;
  max-width: min(760px, 100%); color: rgb(var(--hx-text));
}
.conversation-panel .message-bubble-container[data-hx] :is(.left-bubble, .right-bubble):not([data-bubble-name="email"]) {
  display: flex; flex-wrap: wrap; align-items: flex-end; column-gap: 6px; font-size: 14px; line-height: 21px;
}
/* хариулсан мессежийн ишлэл — бүтэн мөр */
.conversation-panel .message-bubble-container[data-hx] :is(.left-bubble, .right-bubble) > .bg-n-alpha-black1:first-child { flex-basis: 100%; margin-inline: 0; }
.conversation-panel .message-bubble-container[data-hx] :is(.left-bubble, .right-bubble):is([class*="bg-n-solid-amber"], [class*="bg-n-ruby"]) {
  padding: 8px 12px !important; border-radius: 8px !important; margin-top: 2px;
}
/* Private note = Jivo «Comment»: #FFF2D6, 10px, 8px 21px 8px 15px */
.conversation-panel .message-bubble-container[data-hx] :is(.left-bubble, .right-bubble)[class*="bg-n-solid-amber"] {
  background: rgb(var(--hx-note)) !important; padding: 8px 21px 8px 15px !important; border-radius: 10px !important;
}
/* Цаг толгой хэсэгт байгаа тул bubble доторх цагийг нууж, төлөвийн тэмдгийг үлдээнэ */
.conversation-panel .message-bubble-container[data-hx] :is(.left-bubble, .right-bubble) time { display: none; }
.conversation-panel .message-bubble-container[data-hx] :is(.left-bubble, .right-bubble) > .mt-2:last-child { margin-top: 0 !important; padding-bottom: 3px; justify-content: flex-start !important; }
.conversation-panel .message-bubble-container[data-hx] :is(.left-bubble, .right-bubble) > .mt-2:last-child:not(:has(svg, [class*="i-"])) { display: none; }

/* ── 7. Popover / context menu ───────────────────────────────────────────── */
/* Ярианы мөрийн context menu нь <body> руу teleport болж 50% тунгалаг — бараан
   жагсаалт дээр бүдэг харагддаг тул бүрэн өнгөтэй болгоно. */
html .bg-n-alpha-3\/50.backdrop-blur-\[100px\] { background-color: rgb(var(--solid-2)); }

/* ── 8. «Accept Chat» — Jivo: оноогдоогүй чатад composer-ын ОРОНД төвд 2 товч (hibox-theme.js §3 .hx-accept) ── */
/* JS wrapper-т (`.resizable-editor-wrapper`) `data-hx-accept` тавина ⇒ reply box, Chatwoot-ийн «Надад оноох» banner,
   resize бариул, §9 санал нуугдана — DOM / Vue төлөв (бичсэн ноорог) хэвээр, амжилттай авсны дараа туг арилж
   reply box буцаж харагдана. Accept = #18C139, цагаан 14px/500, 6px, 116×39; Reject = цагаан, 1px #D1D5DA. */
.resizable-editor-wrapper[data-hx-accept] > :is(.reply-box, .woot-banner, .hx-canned, .cursor-row-resize) { display: none !important; }
/* Chatwoot v4.20: ResizableEditorWrapper slot-ыг transition div-ээр ороосон ⇒ reply box-ын эцэг (JS туг тавьдаг газар) нь
   wrapper биш, түүний хүүхэд div. Дээрх дүрэм v4.18-д, доорх хоёр нь v4.20-д ажиллана (хоёр хувилбарт нэг theme). */
.resizable-editor-wrapper > [data-hx-accept] > :is(.reply-box, .woot-banner, .hx-canned) { display: none !important; }
.resizable-editor-wrapper:has(> [data-hx-accept]) > .cursor-row-resize { display: none !important; }
.hx-accept {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px;
  margin: 0 8px 8px; padding: 16px 8px 12px; border-top: 1px solid rgb(var(--hx-line));
}
.hx-accept [hidden] { display: none !important; }
.hx-accept-btn,
.hx-reject-btn {
  flex: none; min-width: 116px; height: 39px; padding: 0 16px; border-radius: 6px; cursor: pointer;
  font-size: 14px; font-weight: 500; line-height: 20px; transition: background-color .15s, border-color .15s;
}
/* Цагаан шошго ≥ 4.5:1: #18C139 дээр 2.41:1 байв ⇒ @hichat/tokens-ийн AA ногоон #0E8528 (4.77:1; HiCall --ws-ok) (S6 10-29) */
.hx-accept-btn { border: 0; background: rgb(14 133 40); color: #fff; }
.hx-accept-btn:hover:not(:disabled) { background: rgb(12 117 35); }
.hx-accept-btn:focus-visible { outline: 2px solid rgb(var(--hx-success)); outline-offset: 2px; }
.hx-accept-btn:disabled { opacity: .7; cursor: progress; }
.hx-reject-btn { border: 1px solid rgb(var(--hx-line-strong)); background: rgb(var(--hx-chat)); color: rgb(var(--hx-text)); }
.hx-reject-btn:hover { background: rgb(var(--hx-hover)); }
.hx-reject-btn:focus-visible { outline: 2px solid rgb(var(--hx-link)); outline-offset: 2px; }
/* Авч чадсангүй (сүлжээ/500) — товч хэвээр, доор нь улаан мөр */
.hx-accept-err { flex: 0 0 100%; text-align: center; font-size: 13px; line-height: 18px; color: rgb(var(--hx-danger)); }
.hx-accept-err:empty { display: none; }
/* «Энэ чатыг <нэр> авсан» (.hx-taken) — авах гэтэл өөр зөвлөх түрүүлсэн. Шар, товчгүй. */
.hx-taken {
  display: flex; align-items: center; gap: 10px;
  margin: 0 8px 8px; padding: 8px 14px; border-radius: 6px;
  background: rgb(245 159 0 / .12); border: 1px solid rgb(245 159 0 / .55);
  color: rgb(var(--hx-text)); font-size: 14px; font-weight: 600; line-height: 20px;
}
.hx-taken::before {
  content: '!'; flex: none; width: 18px; height: 18px; border-radius: 50%;
  background: #f59f00; color: #fff; font-size: 12px; font-weight: 800; line-height: 18px; text-align: center;
}

/* 5) Дуут дуудлага: хөтөч дуу тоглуулахыг хориглосон (хуудсан дээр хараахан дараагүй) үед л */
.hx-ring-hint {
  position: fixed; right: 16px; bottom: 16px; z-index: 9999; max-width: 320px;
  padding: 10px 14px; border-radius: 6px; background: rgb(var(--hx-accent)); color: #fff;
  font-size: 13px; font-weight: 600; line-height: 1.4; box-shadow: 0 6px 20px rgba(0, 0, 0, .18);
  cursor: pointer;
}

/* ── Зураг/видео — Jivo шиг жижиг thumbnail (эзэн 10-08: «зураг маш том»). Дарахад Chatwoot-ийн gallery
   бүтэн хэмжээгээр нээнэ. img/video-д width/height attribute байдаг тул auto + max-аар харьцаа хадгална. */
.conversation-panel .message-bubble-container :is([data-bubble-name="image"], [data-bubble-name="video"], [data-bubble-name="ig-story"]) {
  padding: 4px !important; width: fit-content; max-width: 100%;
}
.conversation-panel .message-bubble-container :is([data-bubble-name="image"], [data-bubble-name="video"], [data-bubble-name="ig-story"]) :is(img, video) {
  display: block; width: auto !important; height: auto !important;
  max-width: min(240px, 100%) !important; max-height: 240px !important; object-fit: contain;
  border-radius: 8px; cursor: zoom-in;
}

/* ── 9. Хадгалсан хариулт — бичих явцад санал + «Save reply» (hibox-theme.js .hx-canned) ─────────── */
/* Wrapper (`relative`) дотор absolute: reply box-ын дээр, мессежийн жагсаалтыг давхарлана (layout шилжихгүй).
   Resize бариул (-top-4, h-4)-тай давхцахгүйн тулд 18px дээш. Өнгө = Chatwoot-ийн token (dark-д өөрөө солигдоно). */
.hx-canned {
  position: absolute; left: 8px; right: 8px; bottom: calc(100% + 18px); z-index: 30;
  display: flex; flex-direction: column; align-items: flex-end; gap: 6px; pointer-events: none;
}
.hx-canned > * { pointer-events: auto; }
.hx-canned [hidden] { display: none !important; }
/* Өнөөдрийн «Quick phrases» (§9 хүрээнээс гадуур): цагаан карт, 1px #E1E4E8, 6px, сүүдэр; гарчиг 11px #959DA5; мөр = тод short_code + 1 мөр агуулга */
.hx-sugg {
  align-self: stretch; max-width: 720px; display: flex; flex-direction: column; padding: 4px;
  border-radius: 6px; background: rgb(var(--hx-card)); border: 1px solid rgb(var(--hx-line)); box-shadow: var(--hx-pop-shadow);
}
.hx-sugg-head { padding: 4px 10px 2px; font-size: 12px; line-height: 16px; color: rgb(var(--hx-muted)); }
/* Ихдээ 3 мөр харагдана (34px × 3), бусад нь гүйлгэнэ — шинэ мессежийг бүү хаа (R1) */
.hx-sugg-rows { position: relative; max-height: 102px; overflow-y: auto; overscroll-behavior: contain; }
.hx-sugg-row {
  display: flex; align-items: center; gap: 10px; min-width: 0; height: 34px; box-sizing: border-box; padding: 7px 10px; border-radius: 4px;
  cursor: pointer; font-size: 14px; line-height: 20px; color: rgb(var(--hx-text));
}
.hx-sugg-row:hover { background: rgb(var(--hx-hover)); }
/* Сонгосон мөр (↑/↓ ⇒ Enter / Tab үүнийг оруулна) hover-оос ялгагдана: #F0F3F4 / #FFF = 1.1:1 байсан (бараанд ~1:1).
   Зүүн 3px зураас (--hx-link: цайвар 3.9:1, бараан 7.9:1 ≥ 3:1) + цэнхэр 10% дэвсгэр; текст 14:1 хэвээр (S6 10-29). */
.hx-sugg-row[aria-selected="true"] { background: rgb(var(--hx-accent) / .1); box-shadow: inset 3px 0 0 rgb(var(--hx-link)); }
.hx-sugg-code {
  flex: none; max-width: 30%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-weight: 700; color: rgb(var(--hx-text));
}
.hx-sugg-text { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: rgb(var(--hx-muted)); }
.hx-sugg-hit { background: transparent; color: rgb(var(--hx-text)); font-weight: 700; }
.hx-sugg-hint { padding: 2px 10px 2px; font-size: 12px; line-height: 16px; color: rgb(var(--hx-muted)); }
/* §9 хүрээнд — Jivo typing hints (эзэн 10-28, `.hx-jivo`): гарчиггүй цагаан карт (хүрээгүй), 10px, Jivo-гийн сүүдэр,
   агуулгадаа таарсан өргөн (зүүн талд, min 150px); мөр = саарал оноо + 1 мөр текст, short_code БАЙХГҮЙ. Оноо өсөхөөр —
   хамгийн өндөр нь доор (оролтын хажууд); ихдээ 9 мөр (JS). Харьцаа: #1B1F23 / #E1E4E8 ≈ 12.8:1, #1B1F23 / #FFF ≈ 16:1;
   бичиг ≥12px. */
.hx-sugg.hx-jivo {
  align-self: flex-start; min-width: 150px; max-width: min(720px, 100%); padding: 0; overflow: hidden; border: 0;
  border-radius: 10px; background: rgb(var(--hx-card));
  box-shadow: 0 0 1px rgba(8, 22, 109, 0.7), 0 7px 17px -5px rgba(34, 39, 64, 0.25);
}
.hx-jivo .hx-sugg-rows { max-height: calc(9 * 34px); }
.hx-jivo .hx-sugg-row { gap: 8px; padding: 7px 15px; border-radius: 0; color: rgb(var(--hx-text)); }
/* Jivo timesUsed: саарал дугуй (pill) тоо */
.hx-sugg-score {
  flex: none; display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; height: 18px; min-width: 18px;
  padding: 0 5px; border-radius: 9px; font-size: 12px; line-height: 18px; font-weight: 600; font-variant-numeric: tabular-nums;
  color: rgb(var(--hx-text)); background: rgb(var(--hx-line));
}
.hx-jivo .hx-sugg-text { color: rgb(var(--hx-text)); }
/* Бараан: картын хүрээ бараан чатад уусдаг, оноон pill (border-weak) алга болдог — 1px хүчтэй хүрээ + slate-5 (S6 10-29) */
body.dark .hx-sugg.hx-jivo { box-shadow: 0 0 0 1px rgb(var(--hx-line-strong)), 0 7px 17px -5px rgb(0 0 0 / .6); }
body.dark .hx-sugg-score { background: rgb(var(--slate-5, 46 49 53)); }
.hx-save { display: flex; align-items: center; gap: 8px; }
.hx-save-status:empty { display: none; }
.hx-save-status {
  padding: 3px 10px; border-radius: 8px; font-size: 12px; line-height: 18px;
  background: rgb(var(--solid-2, 255 255 255)); border: 1px solid rgb(var(--slate-6, 217 217 224)); color: rgb(var(--slate-12)); box-shadow: var(--hx-pop-shadow);
}
.hx-save-btn {
  height: 26px; padding: 0 12px; border-radius: 13px; cursor: pointer;
  border: 1px solid rgb(var(--slate-6, 217 217 224)); background: rgb(var(--solid-2, 255 255 255)); color: rgb(var(--slate-11));
  font-size: 12px; font-weight: 600; box-shadow: var(--hx-pop-shadow); transition: color .15s, border-color .15s;
}
.hx-save-btn:hover:not(:disabled) { color: rgb(var(--hx-link)); border-color: rgb(var(--hx-link) / .6); }
.hx-save-btn:focus-visible { outline: 2px solid rgb(var(--hx-accent)); outline-offset: 2px; }
.hx-save-btn:disabled { opacity: .6; cursor: default; box-shadow: none; }
/* «Save reply» баталгаажуулах цонх — хариу бүх агентад харагдана (код засна, утас/захиалгын дугаар анхааруулна) */
.hx-confirm {
  align-self: stretch; max-width: 520px; margin-left: auto; display: flex; flex-direction: column; gap: 6px; padding: 10px 12px;
  border-radius: 12px; background: rgb(var(--solid-2, 255 255 255)); border: 1px solid rgb(var(--slate-6, 217 217 224)); box-shadow: var(--hx-pop-shadow);
  font-size: 13px; line-height: 18px; color: rgb(var(--slate-12));
}
.hx-confirm-title { font-weight: 700; }
.hx-confirm-preview { padding: 6px 8px; border-radius: 8px; background: rgb(var(--slate-2, 249 249 251)); color: rgb(var(--slate-11)); overflow-wrap: anywhere; }
.hx-confirm-code { display: flex; align-items: center; gap: 6px; font-size: 12px; color: rgb(var(--slate-11)); }
.hx-confirm-input {
  flex: 1 1 auto; min-width: 0; height: 28px; padding: 0 8px; border-radius: 6px; margin: 0;
  border: 1px solid rgb(var(--slate-7, 205 205 212)); background: rgb(var(--slate-1, 252 252 253)); color: rgb(var(--slate-12)); font-size: 13px;
}
.hx-confirm-input:focus { outline: 2px solid rgb(var(--hx-accent)); outline-offset: -1px; }
.hx-confirm-err:empty { display: none; }
.hx-confirm-err { font-size: 12px; color: rgb(var(--ruby-11, 202 36 77)); }
.hx-confirm-warn { font-size: 12px; color: rgb(var(--amber-11, 171 100 0)); }
.hx-confirm-warn::before { content: '⚠ '; }
.hx-confirm-note { font-size: 12px; color: rgb(var(--slate-10)); }
.hx-confirm-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 2px; }
.hx-confirm-actions > button {
  height: 28px; padding: 0 14px; border-radius: 14px; cursor: pointer; font-size: 12px; font-weight: 600;
  border: 1px solid rgb(var(--slate-6, 217 217 224)); background: transparent; color: rgb(var(--slate-11));
}
.hx-confirm-actions > .hx-confirm-save { border-color: transparent; background: rgb(var(--hx-accent)); color: #fff; }
.hx-confirm-actions > button:focus-visible { outline: 2px solid rgb(var(--hx-accent)); outline-offset: 2px; }
.hx-confirm-actions > button:disabled { opacity: .5; cursor: default; }

/* ── 10. Өмнөх чатууд — мессежийн жагсаалтын дээд талд (hibox-theme.js .hx-prev) ──────────────────── */
/* Зөвхөн уншина, бүдэг; мессежийн мөр §6-тай ижил хэлбэр (нэр + цаг, харилцагчид өнгөт зураас).
   11-17: анхдагчаар дэлгээтэй, цаг өсөхөөр (хуучин нь дээр) — дээш гүйлгэхэд өмнөх чат үргэлжилнэ. */
.conversation-panel > .hx-prev { list-style: none; flex-shrink: 0; margin: 4px 0 12px; }
.hx-prev-head {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 12px; border-radius: 10px; cursor: pointer;
  border: 1px dashed rgb(var(--slate-7)); background: rgb(var(--slate-2)); color: rgb(var(--slate-11));
  font-size: 13px; font-weight: 600; line-height: 20px; text-align: start;
}
.hx-prev-head:hover { color: rgb(var(--slate-12)); border-color: rgb(var(--hx-accent) / .6); }
.hx-prev-head:focus-visible { outline: 2px solid rgb(var(--hx-accent)); outline-offset: 2px; }
.hx-prev-chev { margin-inline-start: auto; transition: transform .15s; }
.hx-prev-head[aria-expanded="true"] .hx-prev-chev { transform: rotate(180deg); }
.hx-prev-body { margin-top: 4px; opacity: .78; }
.hx-prev-sep { display: flex; align-items: center; gap: 10px; margin: 14px 0 6px; font-size: 12px; line-height: 16px; color: rgb(var(--slate-10)); }
.hx-prev-sep::before, .hx-prev-sep::after { content: ''; flex: 1 1 0; border-top: 1px solid rgb(var(--slate-6)); }
/* Түүх ба одоогийн чатын зааг (bar-ын хамгийн доод мөр; .hx-prev-body-ийн гадна ⇒ бүдгэрэхгүй) */
.hx-prev-now { margin: 16px 0 2px; font-weight: 600; color: rgb(var(--hx-accent)); }
.hx-prev-now::before, .hx-prev-now::after { border-top-color: rgb(var(--hx-accent) / .45); }
/* 11-17: түүх жагсаалтад шууд дэлгээтэй ⇒ Chatwoot-ийн «Previous chat with this customer» товч (MessagesView beforeAll ⇒
   ContactConversationLink direction=older: li > a.rounded-full > span.i-lucide-arrow-up) давхардал. Дарвал ХУУЧИН чат руу
   үсэрч, тэнд Facebook-ийн 24 цагийн цонх хаагдсан («хариу бичих боломжгүй») харагдаж ажилтныг төөрөгдүүлдэг байсан.
   Зөвхөн манай bar байгаа үед нууна (bar алга ⇒ Chatwoot-ийн товч хэвээр = нөөц зам); «Next chat…» (arrow-down) хэвээр.
   Хуучин чатыг тусад нь нээх = бүлгийн гарчиг (.hx-prev-link). */
.conversation-panel:has(> .hx-prev) > li:has(> a > .i-lucide-arrow-up) { display: none; }
.hx-prev-link { flex: none; max-width: 75%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: inherit; text-decoration: none; }
.hx-prev-link:hover { color: rgb(var(--hx-accent)); text-decoration: underline; }
.hx-prev-msg { padding: 4px 12px; border-radius: 6px; font-size: 13.5px; line-height: 20px; color: rgb(var(--slate-11)); }
.hx-prev-msg[data-hx-kind="contact"] { box-shadow: inset 1.5px 0 0 rgb(var(--hx-accent) / .55); border-radius: 0 6px 6px 0; }
.hx-prev-hd { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.hx-prev-name { font-size: 13px; font-weight: 700; color: rgb(var(--slate-12)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hx-prev-msg[data-hx-kind="contact"] .hx-prev-name { color: rgb(var(--hx-accent)); }
.hx-prev-time { font-size: 11.5px; color: rgb(var(--slate-10)); white-space: nowrap; }
.hx-prev-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.hx-prev-att { display: inline-flex; margin: 4px 6px 0 0; font-size: 12px; color: rgb(var(--hx-accent)); text-decoration: underline; }
.hx-prev-att.hx-prev-att-img {
  display: block; width: 160px; max-width: 100%; height: 120px; overflow: hidden; border-radius: 6px;
  background: rgb(var(--slate-3)); text-decoration: none;
}
/* Тогтмол хайрцаг (өндөр 120px, өргөн JS-ээр харьцаагаар) — зураг ачаалагдахад мөр өндөрсөхгүй, scroll үсрэхгүй */
.hx-prev-att-img > .hx-prev-img { display: block; width: 100%; height: 100%; object-fit: cover; }
.hx-prev-note { padding: 4px 12px; font-size: 12px; color: rgb(var(--slate-10)); }
.hx-prev-btn {
  margin: 4px 12px; padding: 0; border: 0; background: none; cursor: pointer;
  font-size: 12px; font-weight: 600; color: rgb(var(--hx-accent));
}
.hx-prev-btn:hover { text-decoration: underline; }

/* ── 11. Windows товчны шошго (hibox-theme.js §11 `data-hx-kbd`) ─────────────────────────────────────── */
/* Хоосон чатын самбарын «⌘» хайрцаг (FeaturePlaceholder.vue: w-8 h-6 text-lg) «Ctrl» болоход 32px-д багтахгүй
   (Hotkey.vue uppercase ⇒ «CTRL») — өргөнийг текстээр нь, үсгийг хажуугийн «K»-тай ижил (text-xs) болгоно. */
kbd.hotkey.w-8[data-hx-kbd] { width: auto; min-width: 2rem; padding-inline: 6px; font-size: 0.75rem; }

/* ── 12. Reply box — Jivo composer (parity аудит 10-08, загвар 10-09) ─────────────────────────────────────── */
/* Captain ✨ (WootWriter/ReplyTopPanel.vue: `NextButton icon="i-ph-sparkle-fill"` ⇒ button > span.i-ph-sparkle-fill) —
   нуух л (DOM хэвээр); товчгүй ⇒ CopilotMenuBar нээгдэхгүй. Private Note-ийн горим/товч хөндөгдөхгүй. */
.reply-box button:has(> .i-ph-sparkle-fill) { display: none !important; }
/* Placeholder: Editor.vue → @chatwoot/prosemirror-schema `p.empty-node[data-placeholder]`, Chatwoot CSS
   `.ProseMirror p.empty-node:first-child:before { content: attr(data-placeholder) }`. Зөвхөн Reply-ийн анхдагч
   (en CONVERSATION.FOOTER.MSG_INPUT) текстийг Jivo-гийн «Enter your message» болгоно — Private Note
   (PRIVATE_MSG_INPUT), «messaging restricted» (24 цаг/WhatsApp/API) анхааруулга хэвээр. */
.reply-box:not(.is-private) .ProseMirror p.empty-node:first-child[data-placeholder="Shift + enter for new line. Start with '/' to select a Canned Response."]::before {
  content: "Enter your message";
}
/* Хайрцаг: цагаан, 1px #E1E4E8 (фокус #367FEE), 6px (ReplyBox.vue scoped `.reply-box` border rounded-xl bg-n-solid-1);
   Comment горим (`.is-private`) Jivo-гийн шар #FFF2D6. */
html .reply-box {
  border: 1px solid rgb(var(--hx-line)) !important; border-radius: 6px !important; background: rgb(var(--hx-chat)) !important;
  transition: border-color .15s;
}
html .reply-box:focus-within { border-color: rgb(var(--hx-link)) !important; }
html .reply-box.is-private { background: rgb(var(--hx-note)) !important; }
/* Горимын таб (EditorModeToggle.vue — JS §15г `data-hx-modes` / `data-hx-mode`): pill + гулсдаг chip-гүй энгийн текст
   «Chat» (идэвхтэй #1B1F23, 1px доогуур зураас) · «Comment» (#959DA5). Chatwoot-ийн товч бүхэлдээ toggle хийдэг тул
   идэвхтэй таб дээр дарахад горим солигдохгүйн тулд товчийг pointer-events: none, зөвхөн идэвхгүй табыг дарагдана
   (click нь товч руу bubble хийж Chatwoot-ийн өөрийн toggle ажиллана; гарын Tab/Space хэвээр). */
.reply-box > div:first-child:has(> button[data-hx-modes]) { height: 40px; padding: 6px 8px 0 12px; }
.reply-box button[data-hx-modes] {
  height: auto; gap: 16px; padding: 0; border: 0 !important; border-radius: 0; background: transparent !important;
  pointer-events: none;
}
.reply-box button[data-hx-modes] > div:not([data-hx-mode]) { display: none; }
.reply-box button[data-hx-modes] > div[data-hx-mode] {
  padding: 2px 0 3px; border-bottom: 1px solid transparent;
  font-size: 14px; line-height: 20px; color: rgb(var(--hx-muted)); transition: color .15s;
}
.reply-box:not(.is-private) button[data-hx-modes] > [data-hx-mode="chat"],
.reply-box.is-private button[data-hx-modes] > [data-hx-mode="comment"] { color: rgb(var(--hx-text)); border-bottom-color: currentColor; }
.reply-box:not(.is-private) button[data-hx-modes]:not(:disabled) > [data-hx-mode="comment"],
.reply-box.is-private button[data-hx-modes]:not(:disabled) > [data-hx-mode="chat"] { pointer-events: auto; cursor: pointer; }
.reply-box:not(.is-private) button[data-hx-modes]:not(:disabled) > [data-hx-mode="comment"]:hover,
.reply-box.is-private button[data-hx-modes]:not(:disabled) > [data-hx-mode="chat"]:hover { color: rgb(var(--hx-text)); }
/* Toolbar (ReplyBottomPanel.vue `.left-wrap` + `.right-wrap`): icon-ууд БАРУУН талд (#959DA5 20px, hover #1B1F23),
   хамгийн баруунд 32px дугуй НОГООН Send (Jivo: хоосон үед цэнхэр mic, текст бичмэгц ногоон сум #18C139 — 10-09
   Jivo-д бичиж харсан; HiChat-д mic алга ⇒ үргэлж ногоон, хоосон үед бүдэг) (JS `data-hx-send` + aria-label/title «Send (Ctrl+Enter)»; текст нуугдана). */
.reply-box div:has(> .left-wrap + .right-wrap) { align-items: center; gap: 8px; padding: 4px 8px 8px; }
.reply-box .left-wrap { margin-inline-start: auto; gap: 4px; }
.reply-box .left-wrap button:not([aria-pressed="true"]) { background: transparent !important; color: rgb(var(--hx-dim)) !important; }
.reply-box .left-wrap button:hover:not(:disabled) { color: rgb(var(--hx-text)) !important; }
.reply-box .left-wrap button > span[class*="i-"] { width: 20px !important; height: 20px !important; }
.reply-box .right-wrap > button[data-hx-send] {
  justify-content: center; gap: 0; width: 32px; min-width: 32px; height: 32px; padding: 0 !important;
  border: 0; border-radius: 9999px !important; background: rgb(var(--hx-send)) !important; color: #fff !important;
}
.reply-box .right-wrap > button[data-hx-send] > span.truncate { display: none; }
.reply-box .right-wrap > button[data-hx-send]::before {
  content: ""; flex: none; width: 16px; height: 16px; margin-inline-start: -2px; background: currentColor;
  -webkit-mask: var(--hx-i-send) center / 16px 16px no-repeat; mask: var(--hx-i-send) center / 16px 16px no-repeat;
}
.reply-box .right-wrap > button[data-hx-send]:hover:not(:disabled) { background: rgb(21 172 51) !important; }
.reply-box .right-wrap > button[data-hx-send]:focus-visible { outline: 2px solid rgb(var(--hx-send)); outline-offset: 2px; }
.reply-box .right-wrap > button[data-hx-send]:disabled { opacity: .45; }

/* ── 13. Харилцагчийн самбар — Jivo: #F6F8FA, хэсэг бүр цагаан карт (hibox-theme.js §14) ─────────────────── */
/* Macros / Conversation participants / Previous Conversations accordion, хоосон «Not Available» мөр. JS тавина
   (DOM хэвээр — attribute хасвал буцна). */
.list-group [data-hx-hide],
div.group\/row[data-hx-hide] { display: none !important; }
/* Дэвсгэр: ConversationSidebar.vue `.bg-n-surface-2` > div > ContactPanel.vue (`div.w-full` > `.list-group`) */
div.bg-n-surface-2:has(> div > div > .list-group) { background-color: rgb(var(--hx-panel)); }
/* Дээд хэсэг (ContactInfo.vue): Jivo шиг 32px аватар + нэр 14px + холбоосын icon нэг мөрөнд. Аватарын мөрийг absolute
   (48px ⇒ scale 2/3 — Avatar.vue inline хэмжээг хөндөхгүй), нэрийн мөрөнд зүүн зай. */
div.w-full:has(> .list-group) > div.relative.p-4 { padding: 12px 16px; }
div.w-full:has(> .list-group) > div.relative.p-4 > div > div.flex-row:first-child {
  position: absolute; top: 12px; inset-inline-start: 16px; transform: scale(.6667); transform-origin: top left;
}
div.w-full:has(> .list-group) > div.relative.p-4 > div > div.flex-col > div:first-child { min-height: 32px; padding-inline-start: 42px; }
div.w-full:has(> .list-group) > div.relative.p-4 h3 { font-size: 14px; line-height: 20px; font-weight: 600; color: rgb(var(--hx-text)); }
/* Accordion (Accordion/AccordionItem.vue `button.drag-handle` + их бие): гарчиг саарал дэвсгэргүй 14px/600 #6A737D,
   баруун талд chevron (+/− icon-ын оронд; нээлттэй = `rounded-bl-none`); их бие = цагаан карт, 6px, 1px #E1E4E8.
   Гарчгийн нэр Jivo-гийнх (JS §14: Chat / About chat / Attributes / Notes). */
.list-group .drag-handle {
  padding: 8px 4px !important; border-radius: 0 !important; background: transparent !important; outline: 0 !important;
}
.list-group .drag-handle h5 { font-size: 14px; line-height: 20px; font-weight: 600; color: rgb(var(--hx-muted)) !important; }
.list-group .drag-handle > div:last-child > div.w-3 { width: 16px; color: rgb(var(--hx-dim)); }
.list-group .drag-handle > div:last-child > div.w-3 > svg { display: none; }
.list-group .drag-handle > div:last-child > div.w-3::before {
  content: ""; flex: none; width: 16px; height: 16px; background: currentColor; transition: transform .15s;
  -webkit-mask: var(--hx-i-chevron) center / 16px 16px no-repeat; mask: var(--hx-i-chevron) center / 16px 16px no-repeat;
}
.list-group .drag-handle.rounded-bl-none > div:last-child > div.w-3::before { transform: rotate(180deg); }
.list-group .drag-handle + div {
  margin-top: 0 !important; border: 1px solid rgb(var(--hx-line)); border-radius: 6px; outline: 0 !important;
  background: rgb(var(--hx-card));
}

/* 16) Jivo «Set status» (эзэн 10-09 «Адилхан болго»): профайл цэсийн эхэнд hibox-theme.js §16-ийн блок — «Set status»
   17px/700, «Availability» ногоон toggle (Online ↔ Away), «What is your status?» 4 төлөв (emoji + нэр, идэвхтэй нь
   саарал дэвсгэр + ногоон шалгах тэмдэг). Chatwoot-ийн «Set your availability» мөр `data-hx-hide`-аар нуугдана
   («Mark offline automatically» мөр мөн нуугдана — My Profile › Business Hours-д, эзэн 10-09). Хураасан rail-д popover Jivo шиг аватарын БАРУУН талд, доод талаар тэгшилсэн
   (fixed: rail 76px + 10px; DropdownBody-ийн эх `div.absolute` 0×0 тул % ашиглах боломжгүй). */
[data-hx-hide] { display: none !important; }
/* Chatwoot v4.20: «Availability» ба «Mark offline automatically» мөрийн хооронд зураас (div.border-b) нэмэгдсэн ⇒ хоёр мөр
   нуугдахад зураас + 9px зай үлддэг. Бүх мөр нь нуугдсан хэсгийг бүхэлд нь нууна (v4.18-д тэр хэсэг аль хэдийн 0 өндөртэй). */
[data-hx-menu="me"] .n-dropdown-section:has(li.n-dropdown-item[data-hx-hide]):not(:has(li.n-dropdown-item:not([data-hx-hide]))) { display: none !important; }
.hx-status {
  list-style: none; display: grid; justify-items: start; margin: 0; padding: 6px 8px 12px;
  border-bottom: 1px solid rgb(var(--hx-line)); font-family: var(--hx-font);
}
.hx-status-h { margin: 2px 0 14px; font-size: 17px; line-height: 24px; font-weight: 700; color: rgb(var(--hx-text)); }
.hx-status-sub { margin: 0 0 8px; font-size: 14px; line-height: 20px; color: rgb(var(--hx-muted)); }
.hx-status-sw {
  display: inline-flex; align-items: center; gap: 10px; margin: 0 0 18px; padding: 2px 0; border: 0;
  border-radius: 6px; background: none; cursor: pointer; font: inherit; font-size: 15px; line-height: 20px;
  font-weight: 500; color: rgb(var(--hx-muted));
}
.hx-switch {
  position: relative; flex: none; width: 36px; height: 20px; border-radius: 10px;
  background: rgb(var(--hx-line-strong)); transition: background-color 150ms linear;
}
.hx-switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / .2); transition: transform 150ms linear;
}
.hx-status-sw[aria-checked="true"] .hx-switch { background: rgb(var(--hx-success)); }
.hx-status-sw[aria-checked="true"] .hx-switch::after { transform: translateX(16px); }
.hx-status-item {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 9px 8px; border: 0; border-radius: 8px;
  background: none; cursor: pointer; font: inherit; font-size: 15px; line-height: 22px; text-align: start;
  color: rgb(var(--hx-text));
}
.hx-status-item:hover, .hx-status-item[aria-checked="true"] { background: rgb(var(--hx-hover)); }
.hx-status-item[aria-checked="true"]::after {
  content: ""; flex: none; width: 16px; height: 16px; margin-inline-start: auto; background: rgb(var(--hx-success));
  -webkit-mask: var(--hx-i-check) center / 16px 16px no-repeat; mask: var(--hx-i-check) center / 16px 16px no-repeat;
}
.hx-status-emoji { flex: none; width: 22px; font-size: 18px; line-height: 22px; text-align: center; }
.hx-status-sw:focus-visible, .hx-status-item:focus-visible { outline: 2px solid rgb(var(--hx-accent)); outline-offset: 2px; }
@media (min-width: 768px) {
  aside[data-hx-rail]:not(#hx) [data-hx-menu="me"] {
    position: fixed; top: auto !important; bottom: 10px !important; left: 86px !important; right: auto !important;
    margin: 0 !important;
  }
  /* Jivo шиг аватар руу заасан сум (popover-ын зүүн хүрээн дээр, аватарын төвтэй нэг өндөрт) */
  aside[data-hx-rail]:not(#hx) [data-hx-menu="me"]::after {
    content: ""; position: absolute; left: -6px; bottom: 20px; z-index: 1; width: 12px; height: 12px;
    border-left: 1px solid rgb(var(--hx-line)); border-bottom: 1px solid rgb(var(--hx-line));
    background: rgb(var(--hx-card)); transform: rotate(45deg); pointer-events: none;
  }
}

/* 17) Jivo Manage багана (эзэн 10-09; хэмжээг Jivo main.bundle.js settings menu-гээс): тохиргоо/профайлын хуудсанд
   rail-ын хажууд байнгын 216px багана `#hx-manage` (hibox-theme.js §17), `main` түүний хэрээр баруун тийш.
   SYSTEM (Chatwoot-ийн тохиргоо Jivo-гийн нэрээр бүлэглэсэн) дээр flex-grow, MY доор. Гарчиг 11px uppercase
   #959DA5, мөр 14px 8px/24px, hover/идэвхтэй саарал. Бүлэгт ≥2 хуудас бол 3 дахь багана `#hx-sub` (Jivo SettingsBox:
   180px, padding 26px 10px 0 20px; мөр radius 6px, padding 5px 10px, margin-bottom 10px), `main` 396px.
   Профайлын хуудас табд хуваагдана (`data-hx-off`), табын нэр H1 (`.hx-ptitle`). Chatwoot-ийн Manage hover popover
   харагдахгүй (Jivo-д байхгүй; JS жагсаалтаа түүнээс уншина). Аватарын цэсээс 5 мөр нуугдана (`data-hx-moved`,
   Log out хэвээр). Statistics (reports)-д ижил багана, блок «Chats» · «Breakdown» (JS STAT_MAP). Гар утсанд бүгд Chatwoot-ийнх хэвээр (табгүй, бүх хэсэг харагдана). */
@media (min-width: 768px) {
  aside[data-hx-rail]:not(#hx) [data-hx-moved] { display: none !important; }
  [data-hx-pop] { visibility: hidden !important; pointer-events: none !important; }
  body[data-hx-manage] aside[data-hx-rail] ~ main { margin-inline-start: 216px; }
  body[data-hx-manage][data-hx-sub] aside[data-hx-rail] ~ main { margin-inline-start: 396px; }
  #hx-manage {
    position: fixed; top: 0; bottom: 0; left: 76px; z-index: 1; display: flex; flex-direction: column;
    box-sizing: border-box; width: 216px; padding-bottom: 20px; overflow: hidden;
    background: rgb(var(--hx-rail)); border-right: 1px solid rgb(var(--hx-line)); font-family: var(--hx-font);
  }
  .hx-manage-sys { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; padding-top: 12px; }
  .hx-manage-sys[data-hx-empty] > .hx-manage-h { visibility: hidden; }
  .hx-manage-group { flex: none; padding-top: 16px; }
  #hx-manage > .hx-manage-group:first-child { padding-top: 12px; }
  .hx-manage-h {
    padding-left: 24px; font-size: 11px; line-height: 16px; font-weight: 400; text-transform: uppercase;
    color: rgb(var(--hx-dim));
  }
  .hx-manage-links { margin: 2px 0 0; padding: 0; list-style: none; }
  .hx-manage-system { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
  .hx-manage-li { margin: 0; list-style: none; }
  .hx-manage-item {
    display: block; box-sizing: border-box; width: 100%; padding: 8px 24px; border: 0; border-radius: 0;
    background: none; font: inherit; font-size: 14px; line-height: 20px; text-align: start; text-decoration: none;
    color: rgb(var(--hx-text)) !important; cursor: pointer;
  }
  .hx-manage-item:hover { background: rgb(var(--hx-hover)); }
  .hx-manage-item[aria-current="page"] { background: rgb(var(--hx-line)); }
  .hx-manage-item:focus-visible, .hx-sub-item:focus-visible { outline: 2px solid rgb(var(--hx-accent)); outline-offset: -2px; }
  #hx-sub {
    position: fixed; top: 0; bottom: 0; left: 292px; z-index: 1; box-sizing: border-box; width: 180px;
    padding: 26px 10px 0 20px; overflow-y: auto; background: rgb(var(--hx-card)); font-family: var(--hx-font);
  }
  .hx-sub-h {
    margin: 0 0 16px; padding: 0 10px 12px; border-bottom: 1px solid rgb(var(--hx-line));
    font-size: 15px; line-height: 20px; font-weight: 600; color: rgb(var(--hx-text));
  }
  .hx-sub-links { margin: 0; padding: 0; list-style: none; }
  .hx-sub-li { margin: 0; list-style: none; }
  .hx-sub-item {
    display: block; box-sizing: border-box; width: 100%; margin-bottom: 10px; padding: 5px 10px; border-radius: 6px;
    font-size: 14px; line-height: 1.5; text-decoration: none; white-space: pre-line; color: rgb(var(--hx-text)) !important;
  }
  .hx-sub-item:hover { background: rgb(var(--hx-hover)); }
  .hx-sub-item[aria-current="page"] { background: rgb(var(--hx-line)); }
  main [data-hx-off] { display: none !important; }
  .hx-ptitle {
    order: -1; margin: 32px 0 0; font-size: 24px; line-height: 1.3; font-weight: 600; color: rgb(var(--hx-text));
  }
}
/* extra хэсгийн товч/холбоос — гар утсанд ч (тэнд хэсгүүд табгүй харагдана) */
/* My Profile › Business Hours (Jivo-гийн мөр: checkbox + өдөр + 2 цаг; асаалт = §16-ийн .hx-switch) */
.hx-hours { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.hx-hours .hx-hours-sw { margin: 0 0 4px; color: rgb(var(--hx-text)); }
.hx-hours-sw[aria-checked="true"] .hx-switch { background: rgb(var(--hx-success)); }
.hx-hours-sw[aria-checked="true"] .hx-switch::after { transform: translateX(16px); }
.hx-hours-row { display: flex; align-items: center; gap: 12px; font-size: 14px; color: rgb(var(--hx-text)); }
.hx-hours-day { display: flex; align-items: center; gap: 12px; width: 150px; cursor: pointer; }
.hx-hours-day input { width: 18px; height: 18px; margin: 0; accent-color: rgb(var(--hx-success)); cursor: pointer; }
.hx-hours-sel {
  width: 100px; height: 36px; padding: 0 8px; border: 1px solid rgb(var(--hx-line)); border-radius: 6px;
  background: rgb(var(--hx-card)); font: inherit; font-size: 14px; color: rgb(var(--hx-text));
}
.hx-hours-sel:disabled { background: rgb(var(--hx-hover)); color: rgb(var(--hx-dim)); }
.hx-hours-dash { color: rgb(var(--hx-dim)); }
.hx-hours-msg { min-height: 20px; margin: 0; font-size: 13px; color: rgb(var(--hx-dim)); }
.hx-pbtn {
  padding: 6px 14px; border: 1px solid rgb(var(--hx-line)); border-radius: 6px; background: rgb(var(--hx-card));
  font: inherit; font-size: 14px; line-height: 20px; color: rgb(var(--hx-text)); cursor: pointer;
}
.hx-pbtn:hover { background: rgb(var(--hx-hover)); }
.hx-plinks { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.hx-plink { font-size: 14px; color: rgb(var(--hx-accent)) !important; text-decoration: none; }
.hx-plink:hover { text-decoration: underline; }
.hx-ptext { margin: 0; font-size: 14px; color: rgb(var(--hx-text)); }
@media (max-width: 767px) { #hx-manage, #hx-sub, .hx-ptitle { display: none; } }

/* ── 18. Jivo-гийн чатын толгой (hibox-theme.js §18): Pin · Invite agent · Transfer chat · Block · Leave chat +
   «Mark resolved» (`.hx-acts`), «Resolved» карт (`.hx-done`), Invite/Transfer/Block цонх (`.hx-modal`), «Pinned» (`.hx-pins`).
   Icon = lucide (ISC) mask. Jivo-гийн өнгө: pin саарал, invite/transfer ногоон, block улаан, leave цэнхэр. ── */
.hx-acts, .hx-pins, .hx-done, .hx-modal {
  --hx-i-pin: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 17v5'/%3E%3Cpath d='M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z'/%3E%3C/svg%3E"); /* pin */
  --hx-i-user-plus: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M19 8v6'/%3E%3Cpath d='M22 11h-6'/%3E%3C/svg%3E"); /* user-plus */
  --hx-i-forward: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m15 17 5-5-5-5'/%3E%3Cpath d='M4 18v-2a4 4 0 0 1 4-4h12'/%3E%3C/svg%3E"); /* forward */
  --hx-i-ban: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='m4.9 4.9 14.2 14.2'/%3E%3C/svg%3E"); /* ban */
  --hx-i-logout: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m16 17 5-5-5-5'/%3E%3Cpath d='M21 12H9'/%3E%3Cpath d='M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4'/%3E%3C/svg%3E"); /* log-out */
  --hx-i-x: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 6 6 18'/%3E%3Cpath d='m6 6 12 12'/%3E%3C/svg%3E"); /* x */
}
.hx-acts { position: relative; display: flex; align-items: center; gap: 2px; flex: none; }
.hx-act {
  display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 0;
  border: 0; border-radius: 6px; background: transparent; color: rgb(var(--hx-dim)); cursor: pointer;
}
.hx-act[hidden], .hx-resolve[hidden] { display: none; }
.hx-act::before {
  content: ""; width: 18px; height: 18px; background: currentColor;
  -webkit-mask: var(--hx-act-i) center / 18px 18px no-repeat; mask: var(--hx-act-i) center / 18px 18px no-repeat;
}
.hx-act:hover:not(:disabled) { background: rgb(var(--hx-hover)); }
.hx-act:focus-visible, .hx-resolve:focus-visible { outline: 2px solid rgb(var(--hx-link)); outline-offset: 1px; }
.hx-act:disabled, .hx-resolve:disabled { opacity: .5; cursor: progress; }
.hx-act[data-act="pin"] { --hx-act-i: var(--hx-i-pin); }
.hx-act[data-act="pin"][aria-pressed="true"] { color: rgb(var(--hx-accent)); }
.hx-act[data-act="invite"] { --hx-act-i: var(--hx-i-user-plus); color: rgb(var(--hx-success)); }
.hx-act[data-act="transfer"] { --hx-act-i: var(--hx-i-forward); color: rgb(var(--hx-success)); }
.hx-act[data-act="block"] { --hx-act-i: var(--hx-i-ban); color: rgb(var(--hx-danger)); }
.hx-act[data-act="block"][aria-pressed="true"] { background: rgb(var(--hx-danger) / .12); }
.hx-act[data-act="leave"] { --hx-act-i: var(--hx-i-logout); color: rgb(var(--hx-accent)); }
/* min-width: «Mark resolved» ⇒ «Resolved» болоход өргөн хэвээр — зүүн талын icon-ууд курсорын доороос шилжихгүй */
.hx-resolve {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 10.5em; height: 28px;
  margin-inline-start: 6px; padding: 0 10px;
  border: 1px solid rgb(var(--hx-line-strong)); border-radius: 6px; background: transparent; color: rgb(var(--hx-muted));
  font: 500 12px/1 var(--hx-font); white-space: nowrap; cursor: pointer;
}
.hx-resolve::before {
  content: ""; flex: none; width: 14px; height: 14px; background: currentColor;
  -webkit-mask: var(--hx-i-check) center / 14px 14px no-repeat; mask: var(--hx-i-check) center / 14px 14px no-repeat;
}
.hx-resolve:hover:not(:disabled) { background: rgb(var(--hx-hover)); color: rgb(var(--hx-text)); }
.hx-resolve[data-on="1"] { border-color: transparent; background: rgb(var(--hx-success)); color: #fff; }
.hx-resolve[data-on="1"]:hover:not(:disabled) { background: rgb(var(--hx-success) / .88); color: #fff; }
.hx-acts-err:empty { display: none; }
.hx-acts-err {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 30; width: max-content; max-width: 320px; padding: 6px 10px;
  border-radius: 6px; background: rgb(var(--hx-danger)); color: #fff; font-size: 12px; line-height: 1.35; box-shadow: var(--hx-pop-shadow);
}
/* Манай «Mark resolved» харагдах үед Chatwoot-ийн Resolve split товч давхардахгүй (Reopen / бусдын чатад хэвээр) */
.header-actions-wrap[data-hx-own-resolve] .resolve-actions { display: none !important; }

.hx-done {
  display: flex; align-items: flex-start; gap: 12px; margin: 8px 12px; padding: 12px 14px;
  border: 1px solid rgb(var(--hx-line)); border-radius: 8px; background: rgb(var(--hx-card)); color: rgb(var(--hx-text)); font-size: 13px;
}
.hx-done-i {
  flex: none; width: 20px; height: 20px; margin-top: 1px; background: rgb(var(--hx-success));
  -webkit-mask: var(--hx-i-check) center / 20px 20px no-repeat; mask: var(--hx-i-check) center / 20px 20px no-repeat;
}
.hx-done-body { flex: 1; min-width: 0; display: grid; gap: 4px; }
.hx-done-title { font-weight: 600; }
.hx-done-text { color: rgb(var(--hx-muted)); line-height: 1.4; }
.hx-done-auto { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; color: rgb(var(--hx-muted)); font-size: 12px; cursor: pointer; }
.hx-done-cb { width: 14px; height: 14px; margin: 0; accent-color: rgb(var(--hx-success)); cursor: pointer; }
.hx-done-leave {
  flex: none; align-self: center; height: 32px; padding: 0 14px; border: 0; border-radius: 6px;
  background: rgb(var(--hx-success)); color: #fff; font: 600 13px/1 var(--hx-font); cursor: pointer;
}
.hx-done-leave:hover:not(:disabled) { background: rgb(var(--hx-success) / .88); }
.hx-done-leave:disabled { opacity: .6; cursor: progress; }
.hx-done-leave:focus-visible { outline: 2px solid rgb(var(--hx-link)); outline-offset: 2px; }

.hx-modal {
  position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgb(0 0 0 / .32);
}
.hx-modal-box {
  display: flex; flex-direction: column; gap: 12px; width: min(420px, 100%); max-height: calc(100vh - 32px); padding: 18px 20px 16px;
  border-radius: 12px; background: rgb(var(--hx-card)); color: rgb(var(--hx-text)); box-shadow: var(--hx-pop-shadow);
  font-family: var(--hx-font); font-size: 13px;
}
.hx-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hx-modal-title { font-size: 16px; font-weight: 700; }
.hx-modal-x {
  display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0;
  border: 0; border-radius: 6px; background: transparent; color: rgb(var(--hx-muted)); cursor: pointer;
}
.hx-modal-x::before {
  content: ""; width: 16px; height: 16px; background: currentColor;
  -webkit-mask: var(--hx-i-x) center / 16px 16px no-repeat; mask: var(--hx-i-x) center / 16px 16px no-repeat;
}
.hx-modal-x:hover { background: rgb(var(--hx-hover)); }
.hx-modal-text { margin: 0; color: rgb(var(--hx-muted)); line-height: 1.45; }
.hx-pick-q, .hx-pick-note {
  width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid rgb(var(--hx-line-strong)); border-radius: 8px;
  background: rgb(var(--hx-chat)); color: rgb(var(--hx-text)); font: 13px/1.4 var(--hx-font);
}
.hx-pick-note { min-height: 56px; resize: vertical; }
.hx-pick-q:focus, .hx-pick-note:focus { outline: 2px solid rgb(var(--hx-accent)); outline-offset: -1px; }
.hx-pick-list { display: flex; flex-direction: column; gap: 2px; min-height: 48px; max-height: 260px; margin: 0 -6px; overflow-y: auto; }
.hx-pick-row {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px; border: 0; border-radius: 8px;
  background: transparent; color: inherit; font: inherit; text-align: start; cursor: pointer;
}
.hx-pick-row:hover { background: rgb(var(--hx-hover)); }
.hx-pick-row[aria-selected="true"] { background: rgb(var(--hx-accent) / .1); box-shadow: inset 0 0 0 1px rgb(var(--hx-accent)); }
.hx-pick-av {
  display: inline-flex; flex: none; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--hx-av, #8b8d98); color: #fff; font-size: 11px; font-weight: 600;
}
.hx-pick-name { flex: 1; min-width: 0; overflow: hidden; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.hx-pick-status { display: inline-flex; flex: none; align-items: center; gap: 5px; color: rgb(var(--hx-dim)); font-size: 12px; }
.hx-pick-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: rgb(var(--hx-dim)); }
.hx-pick-status[data-s="online"]::before { background: rgb(var(--hx-success)); }
.hx-pick-status[data-s="busy"]::before { background: #f5a524; }
.hx-pick-empty { padding: 12px 6px; color: rgb(var(--hx-dim)); }
.hx-modal-err:empty { display: none; }
.hx-modal-err { color: rgb(var(--hx-danger)); font-size: 12px; }
.hx-modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
.hx-modal-actions > button {
  height: 32px; padding: 0 14px; border: 1px solid rgb(var(--hx-line-strong)); border-radius: 6px;
  background: transparent; color: rgb(var(--hx-text)); font: 600 13px/1 var(--hx-font); cursor: pointer;
}
.hx-modal-actions > .hx-modal-ok { border-color: transparent; background: rgb(var(--hx-success)); color: #fff; }
.hx-modal-actions > .hx-modal-danger { background: rgb(var(--hx-danger)); }
.hx-modal-actions > button:disabled { opacity: .5; cursor: default; }
.hx-modal-actions > button:focus-visible { outline: 2px solid rgb(var(--hx-link)); outline-offset: 2px; }

.hx-pins { display: flex; flex-direction: column; gap: 1px; padding: 4px 8px 6px; border-bottom: 1px solid rgb(var(--hx-line)); }
.hx-pins-title { padding: 2px 6px 4px; color: rgb(var(--hx-dim)); font-size: 11px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; }
.hx-pin-row {
  display: grid; grid-template-columns: 14px minmax(0, 1fr); grid-template-areas: "i n" ". c"; column-gap: 8px;
  width: 100%; padding: 6px; border: 0; border-radius: 6px; background: transparent; color: rgb(var(--hx-text));
  font: inherit; text-align: start; cursor: pointer;
}
.hx-pin-row:hover { background: rgb(var(--hx-hover)); }
.hx-pin-row[aria-current="true"] { background: rgb(var(--hx-accent) / .08); }
.hx-pin-i {
  grid-area: i; align-self: center; width: 14px; height: 14px; background: rgb(var(--hx-dim));
  -webkit-mask: var(--hx-i-pin) center / 14px 14px no-repeat; mask: var(--hx-i-pin) center / 14px 14px no-repeat;
}
.hx-pin-name { grid-area: n; overflow: hidden; font-size: 13px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.hx-pin-ch { grid-area: c; overflow: hidden; color: rgb(var(--hx-muted)); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.hx-pin-ch:empty { display: none; }

/* hibox-theme:end — deploy-theme.sh энэ тэмдгээр файл бүтэн эсэхийг шалгана */
