/* GENERATED from src/features/inbox-v2/styles/styles.css by scripts/scope-inbox-css.cjs — do not edit. */
/* OutGainer — Unified Inbox · layout + new components.
   Reuses kit.css primitives (.btn, .input, .textarea, .avatar, .bubble, .pill).
   Tokens from colors_and_type.css. */

.ib, .ib { height: 100%; }
.ib.ib { font-family: var(--font-sans); color: var(--foreground); background: var(--background);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
.ib * { box-sizing: border-box; }

/* ---------------- minimized app shell ---------------- */
.ib .ui-app { display: flex; height: 100vh; overflow: hidden; background: var(--background); }

.ib .mini-rail { width: 60px; flex-shrink: 0; display: flex; flex-direction: column; align-items: center;
  gap: 4px; padding: 12px 0; border-right: 1px solid var(--sidebar-border); background: var(--sidebar); }
.ib .mini-brand { width: 36px; height: 36px; border-radius: var(--radius-md); background: var(--brand-gradient);
  display: flex; align-items: center; justify-content: center; color: #fff; margin-bottom: 8px; flex-shrink: 0; box-shadow: var(--shadow-card); }
.ib .mini-brand .ic svg { width: 20px; height: 20px; }
.ib .mini-nav { display: flex; flex-direction: column; gap: 2px; align-items: center; width: 100%; flex: 1; overflow-y: auto; }
.ib .mini-nav::-webkit-scrollbar { display: none; }
.ib .mini-item { position: relative; width: 40px; height: 40px; border-radius: var(--radius-md); border: none;
  background: none; cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: var(--muted-foreground); transition: background .12s, color .12s; }
.ib .mini-item:hover { background: color-mix(in oklch, var(--sidebar-accent) 60%, transparent); color: var(--sidebar-foreground); }
.ib .mini-item.active { background: var(--sidebar-accent); color: var(--primary); }
.ib .mini-item .ic svg { width: 19px; height: 19px; }
.ib .mini-item .tip { position: absolute; left: 50px; top: 50%; transform: translateY(-50%) scale(.96);
  background: var(--foreground); color: var(--background); font-size: 12px; font-weight: 500; padding: 5px 9px;
  border-radius: var(--radius-sm); white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .12s, transform .12s; z-index: 60; box-shadow: var(--shadow-elevated); }
.ib .mini-item:hover .tip { opacity: 1; transform: translateY(-50%) scale(1); }
.ib .mini-foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; align-items: center; }

.ib .mini-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* compact top bar */
.ib .ib-top { display: flex; align-items: center; gap: 14px; height: 56px; flex-shrink: 0;
  border-bottom: 1px solid var(--border); background: color-mix(in oklch, var(--background) 80%, white);
  backdrop-filter: blur(8px); padding: 0 18px; }
.ib .ib-top .page-title { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.ib .ib-top .page-sub { font-size: 12.5px; color: var(--muted-foreground); margin-top: 1px; }
.ib .ib-top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.ib .live-pill { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; border-radius: 999px; border: 1px solid color-mix(in oklch, var(--success) 25%, white);
  background: color-mix(in oklch, var(--success) 8%, white); color: var(--success); font-size: 12px; font-weight: 500; padding: 4px 10px; }
.ib .live-dot { width: 6px; height: 6px; border-radius: 999px; background: var(--success); box-shadow: 0 0 0 3px color-mix(in oklch, var(--success) 20%, transparent); }

/* ---------------- inbox 3-column frame ---------------- */
.ib .ux { display: flex; flex: 1; min-height: 0; }

/* === LEFT RAIL: intents / channels / folders === */
.ib .ux-rail { width: 256px; flex-shrink: 0; display: flex; flex-direction: column; border-right: 1px solid var(--border);
  background: var(--sidebar); }
.ib .ux-rail-scroll { flex: 1; overflow-y: auto; padding: 10px 10px 16px; }

.ib .rail-all { display: flex; align-items: center; gap: 10px; width: 100%; border: 1px solid transparent; border-radius: var(--radius-lg);
  padding: 9px 10px; cursor: pointer; background: none; text-align: left; color: var(--foreground); margin-bottom: 6px; transition: background .12s, border-color .12s; }
.ib .rail-all:hover { background: color-mix(in oklch, var(--accent) 55%, transparent); }
.ib .rail-all.active { background: var(--sidebar-accent); border-color: color-mix(in oklch, var(--primary) 22%, white); color: var(--accent-foreground); }
.ib .rail-all .ic svg { width: 18px; height: 18px; }
.ib .rail-all .all-lbl { font-size: 13.5px; font-weight: 600; flex: 1; }
.ib .rail-all .all-count { font-size: 11.5px; font-weight: 600; color: var(--muted-foreground); font-variant-numeric: tabular-nums; }
.ib .rail-all.active .all-count { color: var(--primary); }

.ib .rail-group { margin-top: 8px; }
.ib .rail-group-head { display: flex; align-items: center; gap: 6px; width: 100%; border: none; background: none; cursor: pointer;
  padding: 8px 8px 6px; color: color-mix(in oklch, var(--muted-foreground) 78%, transparent); }
.ib .rail-group-head .chev { transition: transform .15s; display: inline-flex; }
.ib .rail-group-head .chev svg { width: 13px; height: 13px; }
.ib .rail-group-head.collapsed .chev { transform: rotate(-90deg); }
.ib .rail-group-title { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; flex: 1; text-align: left; }
.ib .rail-add { width: 22px; height: 22px; border-radius: var(--radius-sm); border: none; background: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; color: var(--muted-foreground); }
.ib .rail-add:hover { background: color-mix(in oklch, var(--primary) 12%, white); color: var(--primary); }
.ib .rail-add .ic svg { width: 14px; height: 14px; }
.ib .rail-items { display: flex; flex-direction: column; gap: 1px; overflow: hidden; }

.ib .rail-item { display: flex; align-items: center; gap: 10px; width: 100%; border: none; background: none; cursor: pointer;
  padding: 7px 10px; border-radius: var(--radius-md); text-align: left; color: var(--foreground); transition: background .1s; }
.ib .rail-item:hover { background: color-mix(in oklch, var(--accent) 50%, transparent); }
.ib .rail-item.active { background: color-mix(in oklch, var(--primary) 9%, white); }
.ib .rail-item.active .rail-lbl { color: var(--primary); font-weight: 600; }
.ib .rail-dot { width: 9px; height: 9px; border-radius: 999px; flex-shrink: 0; background: var(--c, var(--muted-foreground)); }
.ib .rail-ico { width: 18px; flex-shrink: 0; display: inline-flex; justify-content: center; color: var(--c, var(--muted-foreground)); }
.ib .rail-ico svg { width: 16px; height: 16px; }
.ib .rail-lbl { font-size: 13px; font-weight: 500; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib .rail-count { font-size: 11px; color: var(--muted-foreground); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.ib .rail-custom-tag { font-size: 8.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--primary);
  background: color-mix(in oklch, var(--primary) 10%, white); border-radius: 999px; padding: 1px 5px; }

/* channel row with expandable accounts */
.ib .chan-expand { width: 16px; flex-shrink: 0; display: inline-flex; justify-content: center; color: var(--muted-foreground); }
.ib .chan-expand svg { width: 12px; height: 12px; transition: transform .15s; }
.ib .chan-expand.open svg { transform: rotate(90deg); }
.ib .acct-list { display: flex; flex-direction: column; gap: 1px; margin: 1px 0 3px; padding-left: 14px; }
.ib .acct-item { display: flex; align-items: center; gap: 9px; width: 100%; border: none; background: none; cursor: pointer;
  padding: 6px 10px; border-radius: var(--radius-md); text-align: left; }
.ib .acct-item:hover { background: color-mix(in oklch, var(--accent) 45%, transparent); }
.ib .acct-check { width: 16px; height: 16px; border-radius: 5px; border: 1.5px solid var(--border); flex-shrink: 0; display: inline-flex;
  align-items: center; justify-content: center; background: var(--card); }
.ib .acct-check.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.ib .acct-check svg { width: 11px; height: 11px; }
.ib .acct-av { width: 22px; height: 22px; border-radius: 999px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 600; background: linear-gradient(135deg, color-mix(in oklch, var(--primary) 18%, white), var(--secondary)); color: var(--accent-foreground); }
.ib .acct-name { font-size: 12px; font-weight: 500; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib .acct-role { font-size: 10.5px; color: var(--muted-foreground); }

.ib .rail-new-rule { display: flex; align-items: center; gap: 8px; width: 100%; border: 1px dashed var(--border); background: none; cursor: pointer;
  padding: 7px 10px; border-radius: var(--radius-md); color: var(--muted-foreground); font-size: 12px; font-weight: 500; margin-top: 4px; }
.ib .rail-new-rule:hover { border-color: color-mix(in oklch, var(--primary) 40%, white); color: var(--primary); background: color-mix(in oklch, var(--primary) 5%, white); }
.ib .rail-new-rule .ic svg { width: 14px; height: 14px; }

/* === MIDDLE: conversation list === */
.ib .ux-list { width: 374px; flex-shrink: 0; display: flex; flex-direction: column; border-right: 1px solid var(--border); background: var(--card); min-width: 0; }
.ib .ux-list-head { border-bottom: 1px solid var(--border); padding: 12px 14px 10px; display: flex; flex-direction: column; gap: 10px; }
.ib .list-title-row { display: flex; align-items: center; gap: 8px; }
.ib .list-title { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 7px; }
.ib .list-title .ic svg { width: 16px; height: 16px; }
.ib .list-count { font-size: 11px; font-weight: 600; color: var(--muted-foreground); background: var(--muted); border-radius: 999px; padding: 1px 8px; font-variant-numeric: tabular-nums; }

.ib .list-search { position: relative; }
.ib .list-search .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.ib .list-search .ic svg { width: 15px; height: 15px; color: var(--muted-foreground); }
.ib .list-search input { height: 36px; width: 100%; border: 1px solid var(--input); background: var(--background); border-radius: var(--radius-md);
  padding: 0 12px 0 32px; font-size: 13px; color: var(--foreground); outline: none; font-family: inherit; }
.ib .list-search input:focus { border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring) 20%, transparent); }

.ib .filter-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ib .seg { display: inline-flex; border: 1px solid var(--border); background: var(--background); border-radius: var(--radius-md); padding: 2px; gap: 1px; }
.ib .seg button { border: none; background: none; border-radius: var(--radius-sm); padding: 4px 9px; font-size: 11.5px; font-weight: 500; color: var(--muted-foreground); cursor: pointer; white-space: nowrap; }
.ib .seg button.on { background: var(--card); color: var(--foreground); box-shadow: var(--shadow-card); }

.ib .mini-select { position: relative; }
.ib .mini-select select { appearance: none; -webkit-appearance: none; height: 30px; border: 1px solid var(--border); background: var(--background);
  border-radius: var(--radius-md); padding: 0 26px 0 10px; font-size: 11.5px; font-weight: 500; color: var(--foreground); cursor: pointer; font-family: inherit; outline: none; max-width: 140px; }
.ib .mini-select select:focus { border-color: var(--ring); }
.ib .mini-select .ic { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.ib .mini-select .ic svg { width: 13px; height: 13px; color: var(--muted-foreground); }

/* channel quick-toggle strip */
.ib .chan-strip { display: flex; align-items: center; gap: 5px; overflow-x: auto; padding-bottom: 2px; }
.ib .chan-strip::-webkit-scrollbar { height: 0; }
.ib .chan-toggle { flex-shrink: 0; width: 28px; height: 28px; border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--card);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; color: var(--muted-foreground); position: relative; transition: border-color .12s, background .12s; }
.ib .chan-toggle .ic svg { width: 15px; height: 15px; }
.ib .chan-toggle:hover { background: var(--accent); }
.ib .chan-toggle.on { border-color: currentColor; background: color-mix(in oklch, currentColor 10%, white); }
.ib .chan-toggle .off-x { position: absolute; inset: 0; }

.ib .conv-scroll { flex: 1; overflow-y: auto; }
.ib .crow { display: flex; gap: 11px; width: 100%; border: none; background: none; cursor: pointer; text-align: left;
  padding: 12px 14px; border-bottom: 1px solid color-mix(in oklch, var(--border) 55%, transparent); position: relative; transition: background .1s; }
.ib .crow:hover { background: color-mix(in oklch, var(--accent) 40%, transparent); }
.ib .crow.active { background: color-mix(in oklch, var(--primary) 7%, white); }
.ib .crow.active::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--primary); }
.ib .crow-av { position: relative; width: 42px; height: 42px; border-radius: 999px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; color: var(--accent-foreground); background: linear-gradient(135deg, color-mix(in oklch, var(--primary) 18%, white), var(--secondary)); overflow: hidden; }
.ib .crow-chan { position: absolute; right: -2px; bottom: -2px; width: 18px; height: 18px; border-radius: 999px; background: var(--card);
  border: 2px solid var(--card); display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-card); }
.ib .crow-chan svg { width: 12px; height: 12px; }
.ib .crow-body { flex: 1; min-width: 0; }
.ib .crow-top { display: flex; align-items: baseline; gap: 8px; }
.ib .crow-name { font-size: 13.5px; font-weight: 600; color: var(--foreground); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.ib .crow-name.read { font-weight: 500; }
.ib .crow-time { font-size: 11px; color: var(--muted-foreground); flex-shrink: 0; }
.ib .crow-prev { font-size: 12.5px; color: var(--muted-foreground); margin-top: 3px; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.ib .crow-prev.rtl { direction: rtl; text-align: right; }
.ib .crow-tags { display: flex; align-items: center; gap: 7px; margin-top: 7px; }
.ib .crow-status { font-size: 11px; font-weight: 500; margin-left: auto; flex-shrink: 0; }
.ib .st-replied { color: var(--success); }
.ib .st-to-reply { color: var(--destructive); }
.ib .st-unread { color: var(--primary); display: inline-flex; align-items: center; gap: 4px; }
.ib .unread-dot { width: 7px; height: 7px; border-radius: 999px; background: var(--primary); display: inline-block; }

.ib .list-empty { padding: 40px 24px; text-align: center; color: var(--muted-foreground); font-size: 13px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.ib .list-empty .ic svg { width: 26px; height: 26px; color: color-mix(in oklch, var(--muted-foreground) 50%, transparent); }

/* intent pill (tone-driven) */
.ib .ipill { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 2px 9px; font-size: 11px; font-weight: 500; line-height: 1.3;
  color: var(--c); background: color-mix(in oklch, var(--c) 11%, white); border: 1px solid color-mix(in oklch, var(--c) 22%, white); white-space: nowrap; }
.ib .ipill .ipill-dot { width: 6px; height: 6px; border-radius: 999px; background: currentColor; }
.ib .it-lead       { --c: oklch(0.55 0.23 300); }
.ib .it-interested { --c: oklch(0.58 0.15 155); }
.ib .it-notint     { --c: oklch(0.58 0.2 25); }
.ib .it-question   { --c: oklch(0.55 0.15 250); }
.ib .it-complaint  { --c: oklch(0.6 0.16 40); }
.ib .it-support    { --c: oklch(0.55 0.1 215); }
.ib .it-tbd        { --c: oklch(0.66 0.13 80); }
.ib .it-spam       { --c: oklch(0.6 0.02 260); }

/* === RIGHT: thread === */
.ib .ux-thread { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--card); }
.ib .th-head { display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--border); padding: 11px 20px; flex-shrink: 0; }
.ib .th-av { width: 42px; height: 42px; border-radius: 999px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600;
  color: var(--accent-foreground); background: linear-gradient(135deg, color-mix(in oklch, var(--primary) 18%, white), var(--secondary)); overflow: hidden; }
.ib .th-id { min-width: 0; flex: 1; }
.ib .th-name-row { display: flex; align-items: center; gap: 8px; }
.ib .th-name { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.ib .th-title { font-size: 12.5px; color: var(--muted-foreground); margin-top: 1px; display: flex; align-items: center; gap: 6px; }
.ib .th-title .chan-name { display: inline-flex; align-items: center; gap: 4px; }
.ib .th-title .chan-name svg { width: 13px; height: 13px; }
.ib .th-head-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.ib .th-tag { display: flex; align-items: center; gap: 7px; }
.ib .th-tag-label { font-size: 12px; color: var(--muted-foreground); }
.ib .tag-select { position: relative; }
.ib .tag-select select { appearance: none; -webkit-appearance: none; height: 32px; border: 1px solid var(--input); background: var(--card);
  border-radius: var(--radius-md); padding: 0 28px 0 11px; font-size: 12.5px; font-weight: 500; color: var(--foreground); cursor: pointer; font-family: inherit; outline: none; }
.ib .tag-select select:focus { border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring) 18%, transparent); }
.ib .tag-select .ic { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.ib .tag-select .ic svg { width: 14px; height: 14px; color: var(--muted-foreground); }
.ib .view-on { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 500; color: var(--primary); text-decoration: none; cursor: pointer; }
.ib .view-on:hover { text-decoration: underline; }
.ib .view-on svg { width: 13px; height: 13px; }

/* state banner */
.ib .th-banner { display: flex; align-items: center; gap: 10px; padding: 9px 20px; font-size: 13px; flex-shrink: 0; }
.ib .th-banner.warn { background: color-mix(in oklch, var(--warning) 13%, white); border-bottom: 1px solid color-mix(in oklch, var(--warning) 28%, white); color: var(--warning-foreground); }
.ib .th-banner .ic svg { width: 15px; height: 15px; }
.ib .th-banner .b-text { flex: 1; }
.ib .th-banner .b-text b { font-weight: 600; }

.ib .th-body { flex: 1; overflow-y: auto; padding: 20px 22px; display: flex; flex-direction: column; gap: 16px;
  background: color-mix(in oklch, var(--muted) 28%, var(--background)); }
.ib .th-day { align-self: center; font-size: 11px; font-weight: 500; color: var(--muted-foreground); background: color-mix(in oklch, var(--card) 70%, transparent);
  border: 1px solid var(--border); border-radius: 999px; padding: 3px 12px; }
.ib .campaign-tag { align-self: flex-end; display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 500; color: var(--primary); }
.ib .campaign-tag svg { width: 13px; height: 13px; }

.ib .mrow { display: flex; gap: 10px; max-width: 76%; }
.ib .mrow.them { align-self: flex-start; }
.ib .mrow.me, .ib .mrow.ai { align-self: flex-end; flex-direction: row-reverse; }
.ib .m-av { width: 30px; height: 30px; border-radius: 999px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 600;
  color: var(--accent-foreground); background: var(--secondary); overflow: hidden; align-self: flex-end; }
.ib .m-col { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ib .mrow.me .m-col, .ib .mrow.ai .m-col { align-items: flex-end; }
.ib .m-meta { display: flex; align-items: center; gap: 7px; font-size: 10.5px; color: var(--muted-foreground); }
.ib .m-delivery { display: inline-flex; align-items: center; line-height: 1; }
.ib .m-delivery.sent { color: color-mix(in oklch, var(--primary) 70%, var(--muted-foreground)); }
.ib .m-delivery.sending { color: var(--muted-foreground); opacity: 0.85; }
.ib .m-delivery.failed { color: var(--destructive); }
.ib .m-bubble-wrap { position: relative; display: inline-flex; align-items: center; gap: 10px; max-width: min(580px, 82vw); padding-right: 42px; margin-right: -42px; }
.ib .m-bubble { border-radius: 16px; padding: 11px 15px; font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; box-shadow: var(--shadow-card); }
.ib .m-bubble.them { background: var(--card); border: 1px solid var(--border); border-top-left-radius: 5px; color: var(--foreground); }
.ib .m-bubble.me { background: linear-gradient(135deg, var(--primary), color-mix(in oklch, var(--primary) 82%, black)); color: #fff; border-top-right-radius: 5px; }
.ib .m-bubble.ai { background: color-mix(in oklch, var(--primary) 6%, white); border: 1px dashed color-mix(in oklch, var(--primary) 40%, white); color: var(--foreground); border-top-right-radius: 5px; }
.ib .m-bubble.rtl { direction: rtl; text-align: right; }
.ib .m-react-btn { position: absolute; right: 0; top: 50%; transform: translateY(-50%) scale(.94); width: 34px; height: 34px; border-radius: 999px; border: 1px solid var(--border); background: var(--card); box-shadow: var(--shadow-card); cursor: pointer; opacity: 0; pointer-events: none; transition: opacity .12s ease, transform .12s ease, background .12s ease; font-size: 17px; }
.ib .mrow.them:hover .m-react-btn, .ib .m-bubble-wrap:hover .m-react-btn, .ib .m-react-btn:hover, .ib .m-react-btn:focus-visible { opacity: 1; pointer-events: auto; transform: translateY(-50%) scale(1); }
.ib .m-react-btn:hover { background: var(--accent); }
.ib .m-react-btn:disabled { opacity: .45; cursor: wait; }
.ib .m-reaction { margin-top: -2px; align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; border: 1px solid var(--border); background: var(--card); padding: 2px 8px; font-size: 11px; color: var(--muted-foreground); box-shadow: var(--shadow-card); cursor: pointer; font-family: inherit; }
.ib .m-reaction:hover { background: var(--accent); color: var(--accent-foreground); }
.ib .m-reaction:disabled { opacity: .55; cursor: wait; }
.ib .ai-chip { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; background: color-mix(in oklch, var(--primary) 10%, white); color: var(--primary); padding: 1px 7px; font-size: 9.5px; font-weight: 600; }
.ib .ai-chip svg { width: 10px; height: 10px; }

/* composer */
.ib .composer2 { border-top: 1px solid var(--border); padding: 12px 18px 14px; flex-shrink: 0; background: var(--card); }
.ib .composer2.disabled { background: color-mix(in oklch, var(--muted) 30%, var(--card)); }
.ib .exclude-note { display: flex; align-items: flex-start; gap: 9px; border: 1px solid color-mix(in oklch, var(--warning) 35%, white);
  background: color-mix(in oklch, var(--warning) 9%, white); color: var(--warning-foreground); border-radius: var(--radius-md); padding: 9px 12px; font-size: 12.5px; margin-bottom: 10px; }
.ib .exclude-note .ic svg { width: 15px; height: 15px; flex-shrink: 0; margin-top: 1px; }
.ib .exclude-note a { color: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }
.ib .composer2 textarea { width: 100%; min-height: 64px; resize: none; border: 1px solid var(--input); background: var(--background); border-radius: var(--radius-md);
  padding: 11px 13px; font-size: 13.5px; line-height: 1.5; color: var(--foreground); outline: none; font-family: inherit; }
.ib .composer2 textarea:focus { border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring) 18%, transparent); }
.ib .composer2 textarea:disabled { background: transparent; color: var(--muted-foreground); cursor: not-allowed; }
.ib .composer2-bar { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.ib .icon-mini { width: 34px; height: 34px; border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--card); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; color: var(--muted-foreground); }
.ib .icon-mini:hover { background: var(--accent); color: var(--accent-foreground); }
.ib .icon-mini .ic svg { width: 16px; height: 16px; }
.ib .emoji-picker-wrap { position: relative; display: inline-flex; }
.ib .emoji-modal-backdrop { position: fixed; inset: 0; z-index: 89; background: oklch(0.2 0.03 260 / 0.28); border: 0; }
.ib .emoji-modal { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 90; width: min(440px, calc(100vw - 32px)); max-height: min(560px, calc(100vh - 72px)); display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--border); border-radius: 20px; background: var(--card); box-shadow: 0 24px 80px oklch(0.18 0.03 260 / 0.3); }
.ib .emoji-modal-head { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); padding: 12px 14px; }
.ib .emoji-modal-title { font-size: 14px; font-weight: 800; color: var(--foreground); }
.ib .emoji-modal-close { width: 28px; height: 28px; border: 0; border-radius: 999px; background: var(--secondary); color: var(--muted-foreground); cursor: pointer; font-size: 18px; line-height: 1; }
.ib .emoji-modal-close:hover { background: var(--accent); color: var(--accent-foreground); }
.ib .emoji-modal-picker { padding: 10px; background: var(--card); }
.ib .emoji-modal-picker .EmojiPickerReact { --epr-bg-color: var(--card); --epr-category-label-bg-color: var(--card); --epr-text-color: var(--foreground); --epr-search-input-bg-color: var(--background); --epr-search-input-border-color: var(--border); --epr-hover-bg-color: var(--accent); --epr-focus-bg-color: var(--accent); border: 0 !important; font-family: var(--font-sans) !important; }
.ib .ai-draft-btn { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 13px; border-radius: var(--radius-md); cursor: pointer; font-size: 13px; font-weight: 600;
  border: 1px solid color-mix(in oklch, var(--primary) 30%, white); background: color-mix(in oklch, var(--primary) 7%, white); color: var(--primary); }
.ib .ai-draft-btn:hover { background: color-mix(in oklch, var(--primary) 12%, white); }
.ib .ai-draft-btn .ic svg { width: 15px; height: 15px; }
.ib .ai-draft-btn:disabled { opacity: .45; cursor: not-allowed; }
.ib .composer2-spacer { flex: 1; }

/* empty thread */
.ib .th-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--muted-foreground); background: color-mix(in oklch, var(--muted) 25%, var(--background)); }
.ib .th-empty .ic svg { width: 34px; height: 34px; color: color-mix(in oklch, var(--muted-foreground) 45%, transparent); }

/* ---------------- agent drawer ---------------- */
.ib .drawer-scrim { position: fixed; inset: 0; background: oklch(0.2 0.03 260 / 0.32); z-index: 80; opacity: 0; pointer-events: none; transition: opacity .2s; }
.ib .drawer-scrim.open { opacity: 1; pointer-events: auto; }
.ib .agent-drawer { position: fixed; top: 0; right: 0; height: 100vh; width: 360px; max-width: 90vw; background: var(--card); border-left: 1px solid var(--border);
  box-shadow: var(--shadow-elevated); z-index: 81; transform: translateX(100%); transition: transform .24s cubic-bezier(.4,0,.2,1); display: flex; flex-direction: column; }
.ib .agent-drawer.open { transform: none; }
.ib .drawer-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.ib .drawer-head .ic.spark svg { width: 18px; height: 18px; color: var(--primary); }
.ib .drawer-title { font-size: 15px; font-weight: 600; flex: 1; }
.ib .drawer-body { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 20px; }
.ib .drawer-sec-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted-foreground); margin-bottom: 8px; }
.ib .kv-row { display: flex; align-items: center; justify-content: space-between; font-size: 13px; padding: 5px 0; }
.ib .kv-row .k { color: var(--muted-foreground); }
.ib .kv-row .v { font-weight: 500; }
.ib .agent-card { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--background); padding: 12px; }
.ib .toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; border-top: 1px solid var(--border); }
.ib .toggle-row:first-child { border-top: none; }
.ib .toggle-row .tr-lbl { font-size: 13px; font-weight: 500; }
.ib .toggle-row .tr-sub { font-size: 11.5px; color: var(--muted-foreground); margin-top: 1px; }
.ib .tgl { width: 38px; height: 22px; border-radius: 999px; border: none; background: var(--muted); cursor: pointer; position: relative; flex-shrink: 0; transition: background .15s; }
.ib .tgl.on { background: var(--primary); }
.ib .tgl::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 999px; background: #fff; box-shadow: var(--shadow-card); transition: transform .15s; }
.ib .tgl.on::after { transform: translateX(16px); }

/* ---------------- rule dialog (new intent / folder) ---------------- */
.ib .modal-scrim { position: fixed; inset: 0; background: oklch(0.2 0.03 260 / 0.4); z-index: 90; display: flex; align-items: center; justify-content: center; padding: 24px; opacity: 0; pointer-events: none; transition: opacity .18s; }
.ib .modal-scrim.open { opacity: 1; pointer-events: auto; }
.ib .modal { width: 520px; max-width: 100%; max-height: 88vh; overflow-y: auto; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-elevated); transform: translateY(8px) scale(.99); transition: transform .18s; }
.ib .modal-scrim.open .modal { transform: none; }
.ib .modal-head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 22px 14px; border-bottom: 1px solid var(--border); }
.ib .modal-ico { width: 38px; height: 38px; border-radius: var(--radius-md); background: color-mix(in oklch, var(--primary) 10%, white); color: var(--primary); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ib .modal-ico svg { width: 19px; height: 19px; }
.ib .modal-title { font-size: 16px; font-weight: 600; }
.ib .modal-sub { font-size: 12.5px; color: var(--muted-foreground); margin-top: 2px; }
.ib .modal-close { margin-left: auto; border: none; background: none; cursor: pointer; color: var(--muted-foreground); padding: 4px; border-radius: var(--radius-sm); }
.ib .modal-close:hover { background: var(--accent); }
.ib .modal-close svg { width: 18px; height: 18px; }
.ib .modal-body { padding: 18px 22px; display: flex; flex-direction: column; gap: 16px; }
.ib .fld { display: flex; flex-direction: column; gap: 6px; }
.ib .fld-label { font-size: 12.5px; font-weight: 600; color: var(--foreground); }
.ib .fld input[type=text] { height: 38px; border: 1px solid var(--input); background: var(--background); border-radius: var(--radius-md); padding: 0 12px; font-size: 13.5px; color: var(--foreground); outline: none; font-family: inherit; }
.ib .fld input[type=text]:focus { border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring) 18%, transparent); }
.ib .swatch-row { display: flex; gap: 8px; flex-wrap: wrap; }
.ib .swatch { width: 28px; height: 28px; border-radius: 999px; cursor: pointer; border: 2px solid transparent; display: inline-flex; align-items: center; justify-content: center; }
.ib .swatch.on { border-color: var(--foreground); }
.ib .swatch .ic svg { width: 13px; height: 13px; color: #fff; }
.ib .rule-block { border: 1px solid var(--border); border-radius: var(--radius-lg); background: color-mix(in oklch, var(--muted) 30%, var(--card)); padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.ib .rule-when { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted-foreground); }
.ib .cond-row { display: flex; align-items: center; gap: 8px; }
.ib .cond-row select, .ib .cond-row input { height: 34px; border: 1px solid var(--input); background: var(--card); border-radius: var(--radius-md); padding: 0 10px; font-size: 12.5px; color: var(--foreground); font-family: inherit; outline: none; }
.ib .cond-row select { appearance: none; -webkit-appearance: none; padding-right: 26px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; }
.ib .cond-row input { flex: 1; }
.ib .cond-add { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; border: none; background: none; cursor: pointer; color: var(--primary); font-size: 12.5px; font-weight: 600; padding: 2px 0; }
.ib .cond-add svg { width: 14px; height: 14px; }
.ib .cond-del { border: none; background: none; cursor: pointer; color: var(--muted-foreground); padding: 6px; border-radius: var(--radius-sm); flex-shrink: 0; }
.ib .cond-del:hover { background: color-mix(in oklch, var(--destructive) 10%, white); color: var(--destructive); }
.ib .cond-del svg { width: 15px; height: 15px; }
.ib .auto-row { display: flex; align-items: center; justify-content: space-between; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 10px 12px; }
.ib .modal-foot { display: flex; align-items: center; gap: 10px; padding: 14px 22px 20px; border-top: 1px solid var(--border); }
.ib .modal-foot .spacer { flex: 1; }

/* toast */
.ib .ib-toast-wrap { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 120; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.ib .ib-toast { display: flex; align-items: center; gap: 9px; background: var(--foreground); color: var(--background); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-elevated); padding: 10px 16px; font-size: 13px; font-weight: 500; animation: tIn .2s ease; }
.ib .ib-toast .ic svg { width: 15px; height: 15px; }
@keyframes tIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (max-width: 1180px) {
  .ib .ux-rail { width: 216px; }
  .ib .ux-list { width: 330px; }
}

/* ---- tweakable variants ---- */
.ib .no-chan-strip .chan-strip { display: none; }
.ib .bubbles-flat .m-bubble.me { background: var(--primary); }
.ib .density-compact .crow { padding: 9px 14px; }
.ib .density-compact .crow-av { width: 36px; height: 36px; font-size: 12px; }
.ib .density-compact .crow-prev { margin-top: 2px; }
.ib .density-compact .crow-tags { margin-top: 5px; }
.ib .density-compact .rail-item { padding: 5px 10px; }
.ib .density-compact .rail-all { padding: 7px 10px; }
.ib .density-compact .th-body { gap: 12px; padding: 16px 22px; }

/* ============ ITERATION 2: resizers, expandable nav, menus, compact filter, assign ============ */

/* draggable column resizers */
.ib .col-resizer { width: 6px; flex-shrink: 0; cursor: col-resize; background: transparent; position: relative; z-index: 5; transition: background .12s; }
.ib .col-resizer::after { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: var(--border); transform: translateX(-0.5px); }
.ib .col-resizer:hover, .ib .col-resizer.dragging { background: color-mix(in oklch, var(--primary) 14%, transparent); }
.ib .col-resizer:hover::after, .ib .col-resizer.dragging::after { background: var(--primary); width: 2px; }

/* expandable mini-rail */
.ib .mini-rail { transition: width .2s ease; }
.ib .mini-railtop { width: 100%; display: flex; justify-content: center; margin-bottom: 2px; }
.ib .mini-brandrow { display: flex; align-items: center; justify-content: center; padding: 2px 0 10px; min-height: 36px; }
.ib .mini-logo { height: 22px; width: auto; }
.ib .mini-lbl { font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ib .mini-rail.expanded { width: 212px; align-items: stretch; padding: 12px 10px; }
.ib .mini-rail.expanded .mini-nav { align-items: stretch; }
.ib .mini-rail.expanded .mini-item { width: 100%; justify-content: flex-start; gap: 12px; padding: 0 12px; }
.ib .mini-rail.expanded .mini-item .tip { display: none; }
.ib .mini-rail.expanded .mini-brandrow { justify-content: flex-start; padding-left: 6px; }
.ib .mini-rail.expanded .mini-foot { align-items: stretch; }
.ib .mini-user { display: flex; align-items: center; gap: 10px; padding: 4px 6px; }

/* generic dropdown menu */
.ib .menu-anchor { position: relative; display: inline-flex; }
.ib .menu-backdrop { position: fixed; inset: 0; z-index: 70; }
.ib .dd-menu { position: absolute; top: calc(100% + 6px); z-index: 71; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-elevated); padding: 6px; min-width: 190px; animation: ddIn .14s ease; }
.ib .dd-menu.right { right: 0; } .ib .dd-menu.left { left: 0; }
@keyframes ddIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.ib .dd-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted-foreground); padding: 8px 10px 4px; }
.ib .dd-item { display: flex; align-items: center; gap: 10px; width: 100%; border: none; background: none; cursor: pointer; padding: 8px 10px;
  border-radius: var(--radius-md); font-size: 13px; text-align: left; color: var(--foreground); }
.ib .dd-item:hover { background: var(--accent); color: var(--accent-foreground); }
.ib .dd-item .ic svg { width: 15px; height: 15px; }
.ib .dd-item .check { margin-left: auto; color: var(--primary); }
.ib .dd-sep { height: 1px; background: var(--border); margin: 4px 0; }

/* assign control */
.ib .assign-btn { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 9px; border: 1px solid var(--input); background: var(--card);
  border-radius: var(--radius-md); cursor: pointer; font-size: 12.5px; font-weight: 500; color: var(--foreground); }
.ib .assign-btn:hover { background: var(--accent); }
.ib .assign-btn .ic svg { width: 14px; height: 14px; color: var(--muted-foreground); }
.ib .assign-av { width: 22px; height: 22px; border-radius: 999px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 700; color: #fff; background: var(--primary); }
.ib .assign-av.sm { width: 24px; height: 24px; font-size: 9.5px; }
.ib .assign-av.un { background: var(--muted); color: var(--muted-foreground); }
.ib .assign-name { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* compact filter funnel + popover */
.ib .funnel-btn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border: 1px solid var(--border); background: var(--card);
  border-radius: var(--radius-md); cursor: pointer; font-size: 12.5px; font-weight: 500; color: var(--foreground); }
.ib .funnel-btn:hover { background: var(--accent); }
.ib .funnel-btn.on { border-color: color-mix(in oklch, var(--primary) 40%, white); color: var(--primary); background: color-mix(in oklch, var(--primary) 7%, white); }
.ib .funnel-btn .ic svg { width: 15px; height: 15px; }
.ib .funnel-badge { min-width: 16px; height: 16px; border-radius: 999px; background: var(--primary); color: #fff; font-size: 10px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; padding: 0 4px; }
.ib .filter-pop { position: absolute; top: calc(100% + 6px); right: 0; z-index: 71; width: 290px; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-elevated); padding: 8px 10px 10px; animation: ddIn .14s ease; }
.ib .fp-row { display: flex; align-items: center; gap: 8px; padding: 5px 6px; }
.ib .fp-k { font-size: 12px; color: var(--muted-foreground); width: 64px; flex-shrink: 0; }
.ib .fp-row .seg { flex: 1; }
.ib .fp-row .seg button { flex: 1; padding: 4px 4px; }
.ib .fp-row select { flex: 1; height: 30px; appearance: none; -webkit-appearance: none; border: 1px solid var(--input); background: var(--card);
  border-radius: var(--radius-md); padding: 0 26px 0 10px; font-size: 12px; color: var(--foreground); cursor: pointer; font-family: inherit; outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; }
.ib .fp-chans { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 6px 6px; }
.ib .fp-chan { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; border: 1px solid var(--border); background: var(--card); border-radius: 999px;
  padding: 4px 10px 4px 8px; font-size: 11.5px; font-weight: 500; cursor: pointer; color: var(--muted-foreground); }
.ib .fp-chan.on { border-color: currentColor; }
.ib .fp-chan .ic svg { width: 13px; height: 13px; }
.ib .fp-foot { display: flex; align-items: center; justify-content: space-between; padding: 8px 6px 2px; }
.ib .fp-clear { border: none; background: none; cursor: pointer; font-size: 12.5px; font-weight: 500; color: var(--muted-foreground); }
.ib .fp-clear:hover { color: var(--destructive); }

/* thread header robustness */
.ib .th-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ib .th-title .th-acct { overflow: hidden; text-overflow: ellipsis; }
.ib .th-head-actions { flex-wrap: nowrap; }
.ib .th-head .tag-select select { max-width: 150px; }

/* ============ ITERATION 3: profiles · commerce catalog · AI suggestions ============ */

/* --- clickable person in thread header --- */
.ib .th-person { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; border: none; background: none;
  cursor: pointer; text-align: left; padding: 5px 8px 5px 5px; margin: -5px -4px; border-radius: var(--radius-md); transition: background .12s; }
.ib .th-person:hover { background: color-mix(in oklch, var(--accent) 50%, transparent); }
.ib .th-name-chev { color: var(--muted-foreground); opacity: 0; transition: opacity .12s, transform .12s; }
.ib .th-name-chev svg { width: 15px; height: 15px; }
.ib .th-person:hover .th-name-chev { opacity: 1; transform: translateX(2px); }
.ib .view-profile-btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 11px; border: 1px solid var(--input);
  background: var(--card); border-radius: var(--radius-md); cursor: pointer; font-size: 12.5px; font-weight: 500; color: var(--foreground); white-space: nowrap; }
.ib .view-profile-btn:hover { background: var(--accent); border-color: color-mix(in oklch, var(--primary) 30%, white); color: var(--primary); }
.ib .view-profile-btn .ic svg { width: 15px; height: 15px; }

/* --- product card (in bubbles + attachments) --- */
.ib .prod-thumb { flex-shrink: 0; border-radius: var(--radius-md); position: relative; display: inline-flex; align-items: center; justify-content: center;
  overflow: hidden; box-shadow: inset 0 0 0 1px oklch(0.2 0.03 260 / 0.06); background: var(--muted); }
.ib .prod-thumb-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ib .prod-thumb-code { font-family: var(--font-mono); font-size: 8.5px; font-weight: 600; letter-spacing: 0.02em; color: oklch(0.28 0.03 260 / 0.78);
  background: color-mix(in oklch, white 72%, transparent); padding: 1px 4px; border-radius: 4px; }
.ib .prod-card { display: flex; align-items: stretch; gap: 12px; border: 1px solid color-mix(in oklch, var(--border) 85%, var(--primary));
  background: linear-gradient(135deg, var(--card) 0%, color-mix(in oklch, var(--primary) 4%, var(--card)) 100%);
  border-radius: 14px; padding: 10px 12px; position: relative; box-shadow: var(--shadow-card);
  text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s, transform .12s; min-width: 0; }
.ib a.prod-card-linkable { cursor: pointer; }
.ib a.prod-card-linkable:hover { border-color: color-mix(in oklch, var(--primary) 45%, white); box-shadow: 0 6px 20px color-mix(in oklch, var(--primary) 12%, transparent); transform: translateY(-1px); }
.ib a.prod-card-linkable:hover .prod-card-cta { color: var(--primary); }
.ib .prod-card-body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; justify-content: center; }
.ib .prod-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.ib .prod-card-removable .prod-card-top { padding-right: 26px; }
.ib .prod-card-removable .prod-card-body { padding-right: 4px; }
.ib .prod-card-name { font-size: 13.5px; font-weight: 600; color: var(--foreground); line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; flex: 1; min-width: 0; }
.ib .prod-card-price { font-size: 14px; font-weight: 700; color: var(--primary); font-variant-numeric: tabular-nums; flex-shrink: 0; line-height: 1.2; }
.ib .prod-card-meta { font-size: 11px; color: var(--muted-foreground); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib .prod-card-cta { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600;
  color: var(--muted-foreground); margin-top: 2px; transition: color .12s; }
.ib .prod-card-cta svg { width: 12px; height: 12px; }
.ib .prod-card-sub { font-size: 11.5px; color: var(--muted-foreground); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib .prod-card-x { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 999px; border: none; background: color-mix(in oklch, var(--muted) 70%, transparent);
  color: var(--muted-foreground); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; z-index: 2; }
.ib .prod-card-shop { position: absolute; bottom: 8px; right: 8px; width: 28px; height: 28px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--card); color: var(--primary); display: inline-flex; align-items: center; justify-content: center; z-index: 2;
  text-decoration: none; box-shadow: var(--shadow-card); }
.ib .prod-card-shop:hover { background: color-mix(in oklch, var(--primary) 10%, white); }
.ib .prod-card-shop svg { width: 13px; height: 13px; }
.ib .prod-card-x:hover { background: color-mix(in oklch, var(--destructive) 12%, white); color: var(--destructive); }
.ib .prod-card-x svg { width: 13px; height: 13px; }
/* products inside a sent bubble */
.ib .m-products { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; width: min(100%, 320px); }
.ib .mrow.me .m-products, .ib .mrow.ai .m-products { align-self: flex-end; }
.ib .m-products .prod-card { background: var(--card); }
.ib .m-products a.prod-card-linkable { background: var(--card); }

/* Comment attachment images (inside a chat bubble) */
.ib .m-images { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; max-width: 320px; }
.ib .mrow.me .m-images, .ib .mrow.ai .m-images { align-self: flex-end; justify-content: flex-end; }
.ib .m-image { display: block; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); line-height: 0; }
.ib .m-image img { width: 150px; height: 150px; object-fit: cover; display: block; transition: opacity .15s; }
.ib .m-image:hover img { opacity: .9; }

/* Original-post context block + its images */
.ib .post-context { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; margin: 6px 0 10px; background: color-mix(in oklch, var(--muted) 40%, var(--card)); }
.ib .post-context-label { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted-foreground); margin-bottom: 6px; }
.ib .post-context-body { font-size: 13px; line-height: 1.5; color: var(--foreground); white-space: pre-wrap; }
.ib .post-context-images { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ib .post-context-image { display: block; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); line-height: 0; }
.ib .post-context-image img { width: 120px; height: 120px; object-fit: cover; display: block; transition: opacity .15s; }
.ib .post-context-image:hover img { opacity: .9; }

/* --- composer: share-product button + attachments --- */
.ib .share-prod-btn { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; border-radius: var(--radius-md); cursor: pointer;
  font-size: 13px; font-weight: 600; border: 1px solid var(--border); background: var(--card); color: var(--foreground); }
.ib .share-prod-btn:hover { background: var(--accent); border-color: color-mix(in oklch, var(--primary) 28%, white); color: var(--primary); }
.ib .share-prod-btn:disabled { opacity: .45; cursor: not-allowed; }
.ib .share-prod-btn .ic svg { width: 15px; height: 15px; }
.ib .composer-attach { display: flex; flex-direction: column; gap: 7px; margin-bottom: 10px; padding: 10px; border: 1px dashed color-mix(in oklch, var(--primary) 30%, var(--border));
  border-radius: var(--radius-md); background: color-mix(in oklch, var(--primary) 4%, var(--card)); }
.ib .composer-attach-head { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--primary);
  display: flex; align-items: center; gap: 6px; }
.ib .composer-attach-head svg { width: 13px; height: 13px; }

/* --- AI suggestion panel --- */
.ib .ai-suggest { border: 1px solid color-mix(in oklch, var(--primary) 28%, var(--border)); border-radius: var(--radius-lg);
  background: linear-gradient(180deg, color-mix(in oklch, var(--primary) 7%, var(--card)), var(--card)); padding: 12px 13px; margin-bottom: 11px; }
.ib .ai-suggest-head { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--primary); margin-bottom: 9px; flex-wrap: wrap; }
.ib .ai-suggest-head svg { width: 15px; height: 15px; }
.ib .ai-suggest-hint { margin-left: auto; font-size: 11px; font-weight: 500; color: var(--muted-foreground); }
.ib .ai-suggest-sol { position: relative; padding-right: 84px; }
.ib .ai-sol-text { font-size: 13.5px; font-weight: 600; color: var(--foreground); line-height: 1.4; }
.ib .ai-sol-why { font-size: 12px; color: var(--muted-foreground); margin-top: 3px; line-height: 1.45; }
.ib .ai-sol-apply { position: absolute; top: 0; right: 0; display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px;
  border-radius: var(--radius-md); border: 1px solid color-mix(in oklch, var(--primary) 35%, white); background: var(--card); color: var(--primary);
  font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.ib .ai-sol-apply:hover { background: color-mix(in oklch, var(--primary) 10%, white); }
.ib .ai-sol-apply svg { width: 13px; height: 13px; }
.ib .ai-suggest-block { margin-top: 11px; border-top: 1px solid color-mix(in oklch, var(--border) 70%, transparent); padding-top: 9px; }
.ib .ai-suggest-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted-foreground); margin-bottom: 7px; }
.ib .ai-prod-row { display: flex; flex-wrap: wrap; gap: 7px; }
.ib .ai-prod-chip { display: inline-flex; align-items: center; gap: 8px; padding: 5px 9px 5px 5px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--card); cursor: pointer; font-size: 12px; color: var(--foreground); }
.ib .ai-prod-chip:hover { border-color: color-mix(in oklch, var(--primary) 35%, white); }
.ib .ai-prod-chip.on { border-color: var(--primary); background: color-mix(in oklch, var(--primary) 8%, white); }
.ib .ai-prod-name { font-weight: 600; }
.ib .ai-prod-price { color: var(--primary); font-weight: 700; font-variant-numeric: tabular-nums; }
.ib .ai-prod-chip .ic svg { width: 14px; height: 14px; color: var(--muted-foreground); }
.ib .ai-prod-chip.on .ic svg { color: var(--primary); }
.ib .ai-res-row { display: flex; flex-wrap: wrap; gap: 6px; }
.ib .ai-res-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--muted); font-size: 11.5px; font-weight: 500; color: var(--muted-foreground); }
.ib .ai-res-chip svg { width: 12px; height: 12px; }

/* --- catalog picker modal --- */
.ib .pick-modal { width: 640px; height: min(640px, 86vh); max-height: 86vh; display: flex; flex-direction: column; overflow: hidden; }
.ib .pick-modal .modal-head, .ib .pick-modal .pick-tools, .ib .pick-modal .modal-foot { flex-shrink: 0; }
.ib .pick-tools { display: flex; align-items: center; gap: 12px; padding: 14px 22px 4px; flex-wrap: wrap; flex-shrink: 0; }
.ib .pick-cats { display: flex; gap: 5px; flex-wrap: wrap; }
.ib .pick-cat { border: 1px solid var(--border); background: var(--card); border-radius: 999px; padding: 5px 12px; font-size: 12px; font-weight: 500;
  color: var(--muted-foreground); cursor: pointer; }
.ib .pick-cat:hover { background: var(--accent); }
.ib .pick-cat.on { border-color: var(--primary); color: var(--primary); background: color-mix(in oklch, var(--primary) 8%, white); }
.ib .pick-stores { display: flex; gap: 5px; flex-wrap: wrap; width: 100%; }
.ib .pick-store-tag { display: inline-block; margin-right: 6px; padding: 1px 6px; border-radius: 999px; font-size: 10px; font-weight: 600;
  color: var(--primary); background: color-mix(in oklch, var(--primary) 10%, white); border: 1px solid color-mix(in oklch, var(--primary) 25%, white); }
.ib .pick-body-empty { flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 28px 24px 36px; overflow-y: auto; }
.ib .pick-body-empty .list-empty { width: 100%; }
.ib .pick-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; width: 100%;
  max-width: 400px; padding: 40px 32px; border: 1px dashed color-mix(in oklch, var(--border) 90%, transparent);
  border-radius: var(--radius-xl); background: color-mix(in oklch, var(--muted) 40%, var(--card)); box-shadow: inset 0 1px 0 color-mix(in oklch, white 60%, transparent); }
.ib .pick-empty.compact { padding: 28px 24px; max-width: 360px; }
.ib .pick-empty-ico { display: flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 18px;
  background: color-mix(in oklch, var(--primary) 14%, white); color: var(--primary); margin-bottom: 16px; flex-shrink: 0; }
.ib .pick-empty-ico.sm { width: 44px; height: 44px; border-radius: 14px; margin-bottom: 12px; }
.ib .pick-empty-ico .ic svg { width: 26px; height: 26px; stroke-width: 1.75; }
.ib .pick-empty-ico.sm .ic svg { width: 20px; height: 20px; }
.ib .pick-empty-title { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; color: var(--foreground); }
.ib .pick-empty-desc { margin-top: 8px; max-width: 300px; font-size: 13px; line-height: 1.5; color: var(--muted-foreground); }
.ib .pick-empty-cta { margin-top: 20px; display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 16px; text-decoration: none; font-size: 13px; font-weight: 600; border-radius: var(--radius-md); }
.ib .pick-empty-cta.btn-default { color: white; }
.ib .pick-grid { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 14px 22px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-content: start; }
.ib .pick-item { display: flex; align-items: center; gap: 11px; text-align: left; border: 1px solid var(--border); background: var(--card); border-radius: var(--radius-lg);
  padding: 10px; cursor: pointer; position: relative; transition: border-color .12s, background .12s; }
.ib .pick-item:hover { border-color: color-mix(in oklch, var(--primary) 35%, white); }
.ib .pick-item.on { border-color: var(--primary); background: color-mix(in oklch, var(--primary) 6%, white); }
.ib .pick-item.out { opacity: .55; cursor: not-allowed; }
.ib .pick-check { position: absolute; top: 8px; right: 8px; width: 18px; height: 18px; border-radius: 6px; border: 1.5px solid var(--border);
  display: inline-flex; align-items: center; justify-content: center; background: var(--card); }
.ib .pick-item.on .pick-check { background: var(--primary); border-color: var(--primary); color: #fff; }
.ib .pick-check svg { width: 12px; height: 12px; }
.ib .pick-info { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; padding-right: 26px; }
.ib .pick-name { font-size: 13px; font-weight: 600; color: var(--foreground); line-height: 1.25; }
.ib .pick-meta { font-size: 11px; color: var(--muted-foreground); font-family: var(--font-mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib .pick-row { display: flex; align-items: center; gap: 10px; margin-top: 2px; flex-wrap: wrap; }
.ib .pick-price { font-size: 13px; font-weight: 700; color: var(--primary); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.ib .stock-dot { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 500; color: var(--muted-foreground); }
.ib .stock-dot .sd { width: 6px; height: 6px; border-radius: 999px; background: var(--muted-foreground); }
.ib .stock-dot.ok { color: var(--success); } .ib .stock-dot.ok .sd { background: var(--success); }
.ib .stock-dot.low { color: var(--warning-foreground); } .ib .stock-dot.low .sd { background: var(--warning); }
.ib .stock-dot.out { color: var(--destructive); } .ib .stock-dot.out .sd { background: var(--destructive); }

/* ---------------- profile drawer ---------------- */
.ib .profile-drawer { position: fixed; top: 0; right: 0; height: 100vh; width: 440px; max-width: 92vw; background: var(--card); border-left: 1px solid var(--border);
  box-shadow: var(--shadow-elevated); z-index: 81; transform: translateX(100%); transition: transform .24s cubic-bezier(.4,0,.2,1); display: flex; flex-direction: column; }
.ib .profile-drawer.open { transform: none; }
.ib .pf-hero { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 30px 22px 18px;
  background: linear-gradient(160deg, color-mix(in oklch, var(--primary) 12%, var(--card)), var(--card)); border-bottom: 1px solid var(--border); }
.ib .pf-hero-close { position: absolute; top: 14px; right: 14px; }
.ib .pf-av { width: 64px; height: 64px; border-radius: 999px; display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 600;
  color: #fff; background: var(--brand-gradient-soft); box-shadow: var(--shadow-elevated); }
.ib .pf-name { font-size: 19px; font-weight: 600; letter-spacing: -0.01em; margin-top: 12px; }
.ib .pf-title { font-size: 13px; color: var(--muted-foreground); margin-top: 2px; }
.ib .pf-chan { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; color: var(--foreground); margin-top: 8px;
  background: var(--card); border: 1px solid var(--border); border-radius: 999px; padding: 4px 11px; }
.ib .pf-chan svg { width: 13px; height: 13px; }
.ib .pf-tags { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 12px; }
.ib .pf-tag { font-size: 11px; font-weight: 500; padding: 3px 9px; border-radius: 999px; background: color-mix(in oklch, var(--primary) 10%, white);
  color: var(--primary); border: 1px solid color-mix(in oklch, var(--primary) 20%, white); }
.ib .pf-tag.warn { background: color-mix(in oklch, var(--warning) 14%, white); color: var(--warning-foreground); border-color: color-mix(in oklch, var(--warning) 30%, white); }

.ib .pf-body { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 20px; }
.ib .pf-kv-grid { display: flex; flex-direction: column; gap: 8px; }
.ib .pf-kv { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--foreground); }
.ib .pf-kv svg { width: 15px; height: 15px; color: var(--muted-foreground); flex-shrink: 0; }
.ib .pf-kv span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib .pf-sec-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted-foreground);
  margin-bottom: 9px; display: flex; align-items: center; gap: 7px; }
.ib .pf-sec-label svg { width: 13px; height: 13px; }
.ib .pf-sec-note { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--primary); }

/* source card */
.ib .pf-source { border: 1px solid var(--border); border-radius: var(--radius-lg); background: color-mix(in oklch, var(--muted) 30%, var(--card)); padding: 12px; }
.ib .pf-source-head { display: flex; align-items: center; gap: 10px; }
.ib .pf-source-ico { width: 30px; height: 30px; border-radius: var(--radius-md); flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  background: var(--card); border: 1px solid var(--border); color: var(--primary); }
.ib .pf-source-ico svg { width: 15px; height: 15px; }
.ib .pf-source-label { font-size: 12.5px; font-weight: 600; color: var(--foreground); line-height: 1.3; }
.ib .pf-source-meta { font-size: 11px; color: var(--muted-foreground); display: flex; align-items: center; gap: 5px; margin-top: 2px; }
.ib .pf-source-meta svg { width: 11px; height: 11px; }
.ib .pf-stars { color: var(--warning); font-size: 14px; letter-spacing: 1px; margin-top: 9px; }
.ib .pf-source-quote { font-size: 13px; line-height: 1.5; color: var(--foreground); margin-top: 9px; padding: 9px 11px; background: var(--card);
  border: 1px solid var(--border); border-left: 3px solid color-mix(in oklch, var(--primary) 45%, white); border-radius: var(--radius-sm); }
.ib .pf-source-quote.rtl { direction: rtl; text-align: right; border-left: none; border-right: 3px solid color-mix(in oklch, var(--primary) 45%, white); }

/* match */
.ib .pf-match.ok { border: 1px solid color-mix(in oklch, var(--success) 30%, white); background: color-mix(in oklch, var(--success) 7%, white); border-radius: var(--radius-lg); padding: 11px 12px; }
.ib .pf-match-top { display: flex; align-items: center; gap: 8px; }
.ib .pf-match-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--success); }
.ib .pf-match-badge svg { width: 15px; height: 15px; }
.ib .pf-match-id { margin-left: auto; font-size: 11.5px; font-family: var(--font-mono); color: var(--muted-foreground); }
.ib .pf-match-sub { font-size: 12px; color: var(--muted-foreground); margin-top: 5px; line-height: 1.4; }
.ib .pf-match.none { display: flex; align-items: center; gap: 11px; border: 1px dashed var(--border); border-radius: var(--radius-lg); padding: 12px; }
.ib .pf-match.none > .ic svg { width: 20px; height: 20px; color: var(--muted-foreground); flex-shrink: 0; }

/* stat grid */
.ib .pf-stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.ib .pf-stat { background: var(--card); padding: 13px 14px; }
.ib .pf-stat-v { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.ib .pf-stat-l { font-size: 11px; color: var(--muted-foreground); margin-top: 2px; }
.ib .pf-flag { display: inline-flex; align-items: center; gap: 7px; margin-top: 10px; font-size: 12.5px; font-weight: 500; color: var(--primary);
  background: color-mix(in oklch, var(--primary) 8%, white); border-radius: var(--radius-md); padding: 7px 11px; }
.ib .pf-flag svg { width: 14px; height: 14px; }

/* orders */
.ib .pf-orders { display: flex; flex-direction: column; gap: 9px; }
.ib .pf-order { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card); padding: 11px 12px; }
.ib .pf-order.about { border-color: color-mix(in oklch, var(--warning) 45%, white); background: color-mix(in oklch, var(--warning) 6%, white); }
.ib .pf-order-top { display: flex; align-items: center; gap: 8px; }
.ib .pf-order-id { font-size: 13px; font-weight: 600; font-family: var(--font-mono); }
.ib .pf-order-flag { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 600; color: var(--warning-foreground);
  background: color-mix(in oklch, var(--warning) 20%, white); border-radius: 999px; padding: 2px 8px; }
.ib .pf-order-flag svg { width: 12px; height: 12px; }
.ib .pf-order-total { font-size: 13.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ib .pf-order-mid { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.ib .pf-order-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; }
.ib .pf-order-status .dot { width: 7px; height: 7px; border-radius: 999px; background: currentColor; }
.ib .pf-order-status.ok { color: var(--success); }
.ib .pf-order-status.warn { color: var(--warning-foreground); }
.ib .pf-order-status.muted { color: var(--muted-foreground); }
.ib .pf-order-date { font-size: 11.5px; color: var(--muted-foreground); }
.ib .pf-order-items { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid color-mix(in oklch, var(--border) 70%, transparent); }
.ib .pf-order-item { display: flex; align-items: center; gap: 9px; }
.ib .pf-oi-name { font-size: 12.5px; color: var(--foreground); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib .pf-oi-qty { font-size: 12px; color: var(--muted-foreground); font-variant-numeric: tabular-nums; }
.ib .pf-order-item-text { padding: 4px 0; }
.ib .pf-order-link { display: inline-flex; align-items: center; gap: 5px; margin-top: 8px; font-size: 11.5px; font-weight: 500; color: var(--primary); text-decoration: none; }
.ib .pf-order-link:hover { text-decoration: underline; }
.ib .pf-order-link svg { width: 12px; height: 12px; }
.ib .pf-loading, .ib .pf-error { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted-foreground); padding: 12px; border: 1px dashed var(--border); border-radius: var(--radius-lg); }
.ib .pf-loading svg, .ib .pf-error svg { width: 18px; height: 18px; flex-shrink: 0; }
.ib .pf-error { color: var(--destructive); border-color: color-mix(in oklch, var(--destructive) 25%, white); }
.ib .th-store-pill { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; flex-shrink: 0; }
.ib .th-store-pill.ok { color: var(--success); background: color-mix(in oklch, var(--success) 12%, white); }
.ib .th-store-pill.muted { color: var(--muted-foreground); background: color-mix(in oklch, var(--muted) 50%, white); }
.ib .th-store-pill svg { width: 11px; height: 11px; }

/* CRM */
.ib .pf-crm { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card); padding: 4px 13px; }
.ib .pf-crm-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; padding: 8px 0; border-top: 1px solid color-mix(in oklch, var(--border) 70%, transparent); }
.ib .pf-crm-row:first-child { border-top: none; }
.ib .pf-crm-row .k { color: var(--muted-foreground); flex-shrink: 0; }
.ib .pf-crm-row .v { font-weight: 500; text-align: right; }
.ib .pf-stage { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; color: var(--primary);
  background: color-mix(in oklch, var(--primary) 10%, white); }

.ib .pf-note { font-size: 12.5px; line-height: 1.5; color: var(--foreground); background: color-mix(in oklch, var(--warning) 7%, var(--card));
  border: 1px solid color-mix(in oklch, var(--warning) 22%, white); border-radius: var(--radius-md); padding: 10px 12px; }
.ib .pf-spam { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; color: var(--muted-foreground); padding: 14px; border: 1px dashed var(--border); border-radius: var(--radius-lg); }
.ib .pf-spam svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--warning); }

.ib .pf-foot { display: flex; align-items: center; gap: 9px; padding: 13px 18px; border-top: 1px solid var(--border); flex-shrink: 0; }

@media (max-width: 760px) {
  .ib .pick-modal { width: 100%; height: min(580px, 92vh); max-height: 92vh; }
  .ib .pick-grid { grid-template-columns: 1fr; }
}

/* ============ QUICK ANSWER ============ */
/* trigger button — sits beside the Live sync pill */
.ib .qa-trigger { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 13px; border-radius: 999px; cursor: pointer; font-size: 12.5px; font-weight: 600; white-space: nowrap;
  border: 1px solid color-mix(in oklch, var(--primary) 32%, white); background: color-mix(in oklch, var(--primary) 9%, white); color: var(--primary); transition: background .15s, box-shadow .15s; }
.ib .qa-trigger:hover { background: color-mix(in oklch, var(--primary) 15%, white); box-shadow: var(--shadow-card); }
.ib .qa-trigger .ic svg { width: 14px; height: 14px; }

.ib .qa-scrim { position: fixed; inset: 0; background: oklch(0.2 0.03 260 / 0.42); z-index: 95; display: flex; align-items: center; justify-content: center; padding: 28px;
  opacity: 0; pointer-events: none; transition: opacity .18s; }
.ib .qa-scrim.open { opacity: 1; pointer-events: auto; }
.ib .qa-panel { width: 1080px; max-width: 100%; height: 88vh; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-xl); box-shadow: var(--shadow-elevated); transform: translateY(10px) scale(.99); transition: transform .18s; overflow: hidden; }
.ib .qa-scrim.open .qa-panel { transform: none; }

.ib .qa-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 22px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.ib .qa-ico { width: 38px; height: 38px; border-radius: var(--radius-md); background: color-mix(in oklch, var(--primary) 12%, white); color: var(--primary); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ib .qa-ico svg { width: 19px; height: 19px; }
.ib .qa-title { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.ib .qa-sub-h { font-size: 12.5px; color: var(--muted-foreground); margin-top: 2px; }

.ib .qa-bar { display: flex; align-items: center; gap: 12px; padding: 10px 22px; border-bottom: 1px solid var(--border); background: var(--muted); flex-shrink: 0; }
.ib .qa-selall { display: inline-flex; align-items: center; gap: 8px; border: none; background: none; cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--foreground); padding: 4px 0; }
.ib .qa-bar-count { font-size: 12px; color: var(--muted-foreground); font-variant-numeric: tabular-nums; }
.ib .qa-col-key { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted-foreground); }
.ib .qa-key-out { color: var(--primary); }
@media (max-width: 720px) { .ib .qa-col-key { display: none; } }

/* shared checkbox */
.ib .qa-check { width: 20px; height: 20px; flex-shrink: 0; border-radius: 6px; border: 1.5px solid var(--input); background: var(--card); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; color: #fff; transition: background .12s, border-color .12s; }
.ib .qa-check.on { background: var(--primary); border-color: var(--primary); }
.ib .qa-check svg { width: 13px; height: 13px; }
.ib .qa-check.sm { width: 18px; height: 18px; }

.ib .qa-list { flex: 1; overflow-y: auto; padding: 14px 22px; display: flex; flex-direction: column; gap: 12px; }
.ib .qa-row { display: grid; grid-template-columns: 24px 1fr 1fr; gap: 14px; align-items: stretch; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card); transition: border-color .12s, box-shadow .12s; }
.ib .qa-row.sel { border-color: color-mix(in oklch, var(--primary) 40%, var(--border)); box-shadow: 0 0 0 3px color-mix(in oklch, var(--primary) 9%, transparent); }
.ib .qa-row > .qa-check { margin-top: 2px; }

.ib .qa-cell { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ib .qa-who { display: flex; align-items: center; gap: 9px; }
.ib .qa-av { position: relative; width: 30px; height: 30px; flex-shrink: 0; border-radius: 999px; background: var(--secondary); color: var(--secondary-foreground); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; }
.ib .qa-chan { position: absolute; right: -3px; bottom: -3px; width: 16px; height: 16px; border-radius: 999px; background: var(--card); border: 1.5px solid var(--card); display: flex; align-items: center; justify-content: center; }
.ib .qa-who-text { display: flex; flex-direction: column; min-width: 0; }
.ib .qa-name { font-size: 13px; font-weight: 600; line-height: 1.2; }
.ib .qa-sub { font-size: 11px; color: var(--muted-foreground); margin-top: 1px; }
.ib .qa-who .ipill { margin-left: auto; }
.ib .qa-msg { font-size: 12.5px; line-height: 1.5; color: var(--foreground); background: var(--muted); border-radius: var(--radius-md); padding: 9px 11px; white-space: pre-wrap; }
.ib .qa-msg.rtl { direction: rtl; text-align: right; }

.ib .qa-out { border-left: 1px solid var(--border); padding-left: 14px; }
.ib .qa-out-head { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; color: var(--primary); }
.ib .qa-out-head svg { width: 13px; height: 13px; }
.ib .qa-edit { flex: 1; min-height: 96px; resize: vertical; border: 1px solid var(--input); border-radius: var(--radius-md); background: color-mix(in oklch, var(--primary) 4%, var(--card));
  padding: 9px 11px; font: inherit; font-size: 12.5px; line-height: 1.5; color: var(--foreground); }
.ib .qa-edit:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in oklch, var(--primary) 14%, transparent); }
.ib .qa-edit.rtl { direction: rtl; text-align: right; }

.ib .qa-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--muted-foreground); font-size: 13.5px; }
.ib .qa-empty svg { width: 34px; height: 34px; opacity: 0.5; }

.ib .qa-foot { display: flex; align-items: center; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--border); flex-shrink: 0; background: var(--card); }
.ib .qa-foot-note { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted-foreground); }

@media (max-width: 720px) {
  .ib .qa-row { grid-template-columns: 24px 1fr; }
  .ib .qa-out { border-left: none; padding-left: 0; border-top: 1px solid var(--border); padding-top: 10px; grid-column: 1 / -1; }
}

/* ============ ITERATION 4: customer grouping · threads · timeline · reply destination ============ */

/* --- list head: group-by toggle --- */
.ib .list-mode { display: flex; align-items: center; gap: 8px; }
.ib .list-mode-lbl { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 500; color: var(--muted-foreground); flex-shrink: 0; }
.ib .list-mode-lbl .ic svg { width: 14px; height: 14px; }
.ib .list-mode .seg { flex: 1; }
.ib .list-mode .seg button { flex: 1; padding: 4px 8px; }

/* --- grouped customer row --- */
.ib .crow-group { border-bottom: 1px solid color-mix(in oklch, var(--border) 55%, transparent); }
.ib .crow-group.in-active { background: color-mix(in oklch, var(--primary) 3.5%, transparent); }
.ib .crow.cust { border-bottom: none; }
.ib .crow-chan.multi { box-shadow: 0 0 0 2px var(--card), 2px 2px 0 1px color-mix(in oklch, var(--primary) 45%, var(--card)); }
.ib .cust-threadline { display: inline-flex; align-items: center; gap: 5px; margin-top: 4px; font-size: 11.5px; font-weight: 600;
  color: var(--primary); }
.ib .cust-threadline .ic svg { width: 13px; height: 13px; }
.ib .crow-expand { align-self: center; flex-shrink: 0; width: 26px; height: 26px; border-radius: var(--radius-md); border: none; background: none;
  cursor: pointer; color: var(--muted-foreground); display: inline-flex; align-items: center; justify-content: center; transition: background .12s; }
.ib .crow-expand:hover { background: color-mix(in oklch, var(--accent) 60%, transparent); color: var(--foreground); }
.ib .crow-expand svg { width: 16px; height: 16px; transition: transform .15s; }
.ib .crow-expand.open svg { transform: rotate(180deg); }

/* child threads under a customer */
.ib .cthreads { padding: 2px 12px 10px 30px; display: flex; flex-direction: column; gap: 2px; position: relative; }
.ib .cthreads::before { content: ""; position: absolute; left: 33px; top: 0; bottom: 14px; width: 1.5px; background: color-mix(in oklch, var(--border) 80%, transparent); }
.ib .cthread { display: flex; align-items: center; gap: 10px; width: 100%; border: none; background: none; cursor: pointer; text-align: left;
  padding: 7px 10px 7px 16px; border-radius: var(--radius-md); position: relative; transition: background .1s; }
.ib .cthread::before { content: ""; position: absolute; left: 3px; top: 50%; width: 11px; height: 1.5px; background: color-mix(in oklch, var(--border) 80%, transparent); }
.ib .cthread:hover { background: color-mix(in oklch, var(--accent) 45%, transparent); }
.ib .cthread.active { background: color-mix(in oklch, var(--primary) 9%, white); }
.ib .cthread-ico { width: 22px; height: 22px; border-radius: var(--radius-sm); flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  background: color-mix(in oklch, var(--muted) 60%, var(--card)); border: 1px solid var(--border); }
.ib .cthread-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ib .cthread-kind { font-size: 12.5px; font-weight: 600; color: var(--foreground); }
.ib .cthread.active .cthread-kind { color: var(--primary); }
.ib .cthread-ctx { font-size: 11px; color: var(--muted-foreground); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib .cthread-meta { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; }
.ib .cthread-time { font-size: 11px; color: var(--muted-foreground); font-variant-numeric: tabular-nums; }
.ib .cthread-dot { width: 7px; height: 7px; border-radius: 999px; flex-shrink: 0; background: var(--muted-foreground); }
.ib .cthread-dot.st-replied { background: var(--success); }
.ib .cthread-dot.st-to-reply { background: var(--destructive); }
.ib .cthread-dot.st-unread { background: var(--primary); }

/* --- thread header: customer stats --- */
.ib .th-stat { display: inline-flex; align-items: center; gap: 4px; }
.ib .th-stat .ic svg { width: 12px; height: 12px; }

/* --- customer tabs --- */
.ib .cust-tabs { display: flex; align-items: stretch; gap: 2px; padding: 0 14px; border-bottom: 1px solid var(--border); background: var(--card); flex-shrink: 0; }
.ib .cust-tab { display: inline-flex; align-items: center; gap: 7px; border: none; background: none; cursor: pointer; padding: 11px 12px 10px;
  font-size: 13px; font-weight: 500; color: var(--muted-foreground); position: relative; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.ib .cust-tab:hover { color: var(--foreground); }
.ib .cust-tab .ic svg { width: 15px; height: 15px; }
.ib .cust-tab.on { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.ib .cust-tab-badge { min-width: 17px; height: 17px; padding: 0 5px; border-radius: 999px; background: color-mix(in oklch, var(--primary) 12%, white);
  color: var(--primary); font-size: 10.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }
.ib .cust-tab.on .cust-tab-badge { background: var(--primary); color: #fff; }

/* --- thread switcher (above chat) --- */
.ib .th-switch { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 9px 20px; border-bottom: 1px solid var(--border); flex-shrink: 0;
  background: color-mix(in oklch, var(--muted) 22%, var(--card)); }
.ib .th-switch-lbl { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted-foreground); }
.ib .th-switch .menu-anchor { flex-shrink: 0; }
.ib .th-switch-btn { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 11px; border: 1px solid var(--input); background: var(--card);
  border-radius: var(--radius-md); cursor: pointer; font-size: 13px; color: var(--foreground); white-space: nowrap; flex-shrink: 0; }
.ib .th-switch-btn:hover { border-color: color-mix(in oklch, var(--primary) 35%, white); }
.ib .th-switch-btn b { font-weight: 600; }
.ib .th-switch-btn .ic:last-child svg { width: 14px; height: 14px; color: var(--muted-foreground); }
.ib .th-switch-others { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; color: var(--muted-foreground); }
.ib .tso-lbl { color: var(--muted-foreground); }
.ib .tso-chip { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--border); background: var(--card); border-radius: 999px;
  padding: 3px 10px; font-size: 11.5px; font-weight: 500; color: var(--foreground); cursor: pointer; white-space: nowrap; flex-shrink: 0; }
.ib .tso-chip:hover { border-color: color-mix(in oklch, var(--primary) 35%, white); color: var(--primary); }
.ib .th-switch-timeline { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; border: none; background: none; cursor: pointer;
  font-size: 12.5px; font-weight: 600; color: var(--primary); white-space: nowrap; }
.ib .th-switch-timeline:hover { text-decoration: underline; }
.ib .th-switch-timeline .ic svg { width: 14px; height: 14px; }

/* --- reply destination chip (composer) --- */
.ib .reply-dest { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; padding: 7px 11px; border-radius: var(--radius-md);
  border: 1px solid color-mix(in oklch, var(--primary) 26%, var(--border)); background: color-mix(in oklch, var(--primary) 6%, var(--card)); }
.ib .reply-dest-ico { width: 24px; height: 24px; border-radius: 999px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  background: var(--card); border: 1px solid var(--border); }
.ib .reply-dest-text { flex: 1; min-width: 0; font-size: 12.5px; color: var(--muted-foreground); }
.ib .reply-dest-text b { color: var(--foreground); font-weight: 600; }
.ib .reply-dest-tag { font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--primary);
  background: color-mix(in oklch, var(--primary) 11%, white); border: 1px solid color-mix(in oklch, var(--primary) 22%, white); border-radius: 999px; padding: 2px 7px; flex-shrink: 0; }

/* --- customer panes (threads / timeline / profile) --- */
.ib .cust-pane { flex: 1; overflow-y: auto; padding: 18px 22px; background: color-mix(in oklch, var(--muted) 28%, var(--background)); }
.ib .cust-pane-intro { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted-foreground); margin-bottom: 16px; line-height: 1.45; }
.ib .cust-pane-intro .ic { color: var(--primary); flex-shrink: 0; }
.ib .cust-pane-intro .ic svg { width: 15px; height: 15px; }

/* thread cards */
.ib .thread-cards { display: flex; flex-direction: column; gap: 10px; }
.ib .thread-card { display: block; width: 100%; text-align: left; border: 1px solid var(--border); background: var(--card); border-radius: var(--radius-lg);
  padding: 13px 15px; cursor: pointer; box-shadow: var(--shadow-card); transition: border-color .12s, transform .08s; }
.ib .thread-card:hover { border-color: color-mix(in oklch, var(--primary) 32%, white); }
.ib .thread-card.active { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary), var(--shadow-card); }
.ib .tc-head { display: flex; align-items: center; gap: 9px; }
.ib .tc-ico { width: 28px; height: 28px; border-radius: var(--radius-md); flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  background: color-mix(in oklch, var(--muted) 55%, var(--card)); border: 1px solid var(--border); }
.ib .tc-kind { font-size: 13.5px; font-weight: 600; color: var(--foreground); flex: 1; }
.ib .tc-status { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; flex-shrink: 0; }
.ib .tc-status-dot { width: 7px; height: 7px; border-radius: 999px; background: currentColor; }
.ib .tc-status.st-replied { color: var(--success); }
.ib .tc-status.st-to-reply { color: var(--destructive); }
.ib .tc-status.st-unread { color: var(--primary); }
.ib .tc-ctx { font-size: 12px; font-weight: 500; color: var(--foreground); margin-top: 9px; }
.ib .tc-prev { font-size: 12.5px; color: var(--muted-foreground); margin-top: 4px; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ib .tc-prev.rtl { direction: rtl; text-align: right; }
.ib .tc-foot { display: flex; align-items: center; gap: 10px; margin-top: 11px; }
.ib .tc-last { font-size: 11px; color: var(--muted-foreground); }
.ib .tc-open { margin-left: auto; font-size: 11px; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: 0.05em; }

/* customer timeline */
.ib .ctimeline { display: flex; flex-direction: column; }
.ib .ctl-item { display: flex; gap: 12px; padding-bottom: 16px; position: relative; }
.ib .ctl-item::before { content: ""; position: absolute; left: 15px; top: 30px; bottom: -2px; width: 1.5px; background: color-mix(in oklch, var(--border) 80%, transparent); }
.ib .ctl-item:last-child { padding-bottom: 0; }
.ib .ctl-item:last-child::before { display: none; }
.ib .ctl-dot { width: 30px; height: 30px; border-radius: 999px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  background: var(--card); border: 1px solid var(--border); color: var(--muted-foreground); z-index: 1; }
.ib .ctl-dot svg { width: 14px; height: 14px; }
.ib .ctl-dot.k-ai { background: color-mix(in oklch, var(--primary) 12%, white); border-color: color-mix(in oklch, var(--primary) 30%, white); color: var(--primary); }
.ib .ctl-dot.k-msg-in { background: color-mix(in oklch, var(--muted) 50%, var(--card)); color: var(--foreground); }
.ib .ctl-dot.k-msg-out { background: color-mix(in oklch, var(--primary) 8%, white); color: var(--primary); }
.ib .ctl-dot.k-status { background: color-mix(in oklch, var(--warning) 14%, white); border-color: color-mix(in oklch, var(--warning) 30%, white); color: var(--warning-foreground); }
.ib .ctl-dot.k-order { background: color-mix(in oklch, var(--success) 12%, white); border-color: color-mix(in oklch, var(--success) 28%, white); color: var(--success); }
.ib .ctl-body { flex: 1; min-width: 0; padding-top: 4px; }
.ib .ctl-title { display: flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 600; color: var(--foreground); line-height: 1.35; }
.ib .ctl-chan { display: inline-flex; flex-shrink: 0; }
.ib .ctl-detail { font-size: 12.5px; color: var(--muted-foreground); margin-top: 3px; line-height: 1.45; }
.ib .ctl-at { font-size: 11px; color: var(--muted-foreground); margin-top: 4px; font-variant-numeric: tabular-nums; }

/* profile tab */
.ib .pft-hero { display: flex; align-items: center; gap: 13px; border: 1px solid var(--border); background: var(--card); border-radius: var(--radius-lg); padding: 14px; box-shadow: var(--shadow-card); }
.ib .pft-av { width: 50px; height: 50px; border-radius: 999px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 600; color: #fff; background: var(--brand-gradient-soft); }
.ib .pft-id { flex: 1; min-width: 0; }
.ib .pft-name { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.ib .pft-title { font-size: 12.5px; color: var(--muted-foreground); margin-top: 1px; }
.ib .pft-chans { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.ib .pft-chan { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 500; color: var(--foreground);
  background: color-mix(in oklch, var(--muted) 45%, var(--card)); border: 1px solid var(--border); border-radius: 999px; padding: 2px 8px; }
.ib .pft-open { flex-shrink: 0; }
.ib .pft-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.ib .pft-facts { margin-top: 14px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card); overflow: hidden; }
.ib .pft-fact { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 13px; border-top: 1px solid color-mix(in oklch, var(--border) 60%, transparent); font-size: 13px; }
.ib .pft-fact:first-child { border-top: none; }
.ib .pft-fact .k { color: var(--muted-foreground); }
.ib .pft-fact .v { font-weight: 500; text-align: right; }
.ib .pf-stage { display: inline-block; font-size: 11.5px; font-weight: 600; color: var(--primary); background: color-mix(in oklch, var(--primary) 9%, white);
  border: 1px solid color-mix(in oklch, var(--primary) 20%, white); border-radius: 999px; padding: 2px 9px; }
.ib .pft-statgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin-top: 14px; border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; background: var(--border); }
.ib .pft-stat { background: var(--card); padding: 12px 13px; }
.ib .pft-stat .v { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.ib .pft-stat .l { font-size: 11px; color: var(--muted-foreground); margin-top: 2px; }
.ib .pft-note { display: flex; align-items: flex-start; gap: 9px; margin-top: 14px; padding: 11px 13px; border-radius: var(--radius-md);
  background: color-mix(in oklch, var(--muted) 40%, var(--card)); border: 1px solid var(--border); font-size: 12.5px; color: var(--foreground); line-height: 1.5; }
.ib .pft-note .ic { color: var(--muted-foreground); flex-shrink: 0; margin-top: 1px; }
.ib .pft-note .ic svg { width: 15px; height: 15px; }
.ib .pft-note.warn { background: color-mix(in oklch, var(--warning) 11%, white); border-color: color-mix(in oklch, var(--warning) 28%, white); color: var(--warning-foreground); }
