/* Native V2 Inbox. Layout follows the width of the Inbox container, not the window: the shell sidebar
 * takes space (or a rail), and collapsing it gives all of that width to the Inbox. Tokens: css/tokens.css. */
.ib { position: absolute; inset: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 12px; padding: 0 12px 12px; background: transparent; font-size: 14px; color: var(--wk-text); overflow: hidden; }
.ib.off { visibility: hidden; pointer-events: none; }
.ib[data-layout="wide"] { grid-template-columns: minmax(350px, 430px) minmax(0, 1fr); }
.ib[data-layout="wide"].has-chat { grid-template-columns: minmax(340px, 400px) minmax(0, 1fr) 300px; }
.ib:not(.has-chat) .ib-info, .ib:not(.has-chat) .ib-scrim { display: none !important; }
.ib-kpis { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.ib[data-layout="medium"] { grid-template-columns: minmax(330px, 400px) minmax(0, 1fr); }
.ib[data-layout="narrow"] { grid-template-columns: minmax(0, 1fr); padding: 0; gap: 0; grid-template-rows: minmax(0, 1fr); }
.ib[data-layout="narrow"] .ib-kpis { display: none; }
.ib[data-layout="narrow"][data-view="list"] { grid-template-rows: auto minmax(0, 1fr); }
.ib[data-layout="narrow"][data-view="list"] .ib-kpis { display: flex; overflow-x: auto; padding: 8px 10px; gap: 8px; background: var(--wk-surface); }
.ib[data-layout="narrow"][data-view="list"] .ib-kpi { flex: 0 0 auto; }
@media (max-height: 640px) { .ib[data-layout="wide"] .ib-kpis, .ib[data-layout="medium"] .ib-kpis { display: none; } .ib[data-layout="wide"], .ib[data-layout="medium"] { grid-template-rows: minmax(0, 1fr); } }
.ib-list, .ib-main, .ib-info { background: var(--wk-surface); border-radius: var(--wk-r-card); box-shadow: var(--wk-sh-2); border: 1px solid var(--wk-border); min-height: 0; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.ib[data-layout="narrow"] .ib-list, .ib[data-layout="narrow"] .ib-main { border-radius: 0; border: 0; box-shadow: none; }
.ib[data-layout="narrow"][data-view="list"] .ib-main, .ib[data-layout="narrow"][data-view="chat"] .ib-list { display: none; }
.ib[data-layout="narrow"][data-view="chat"] .ib-main { grid-column: 1; }
.ib-loading { padding: 24px; text-align: center; color: var(--wk-text-2); }

/* KPI cards */
.ib-kpi { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--wk-border); border-radius: var(--wk-r-panel); background: var(--wk-surface); box-shadow: var(--wk-sh-2); text-align: start; cursor: pointer; min-width: 0; transition: border-color var(--wk-t), box-shadow var(--wk-t); }
.ib-kpi:hover { border-color: var(--wk-border-strong); }
.ib-kpi.on { border-color: var(--wk-accent); box-shadow: 0 0 0 3px rgba(42, 146, 69, .12); }
.ib-kpiicon { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 9px; color: #fff; }
.k-total .ib-kpiicon { background: var(--wk-green); } .k-unread .ib-kpiicon { background: #8b3dff; } .k-open .ib-kpiicon { background: #2f7bf6; } .k-pending .ib-kpiicon { background: #f08a1b; } .k-closed .ib-kpiicon { background: #e5484d; }
.ib-kpitext { display: flex; align-items: baseline; gap: 6px; line-height: 1.2; min-width: 0; }
.ib-kpitext b { font-size: 18px; font-weight: 600; letter-spacing: -.3px; }
.ib-kpitext small { color: var(--wk-text-2); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* fields */
.ib-search, .ib-note, .ib-input { width: 100%; border: 1px solid var(--wk-border); border-radius: var(--wk-r-input); background: var(--wk-surface); font: inherit; color: var(--wk-text); padding: 9px 12px; }
.ib-note:focus { outline: none; border-color: var(--wk-green); box-shadow: 0 0 0 3px rgba(42, 146, 69, .14); }

/* ---------- chat list ---------- */
.ib-listhead { padding: 14px 14px 8px; display: grid; gap: 10px; min-width: 0; }
.ib-titlerow { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 2px; }
.ib-title { margin: 0; font-size: 19px; font-weight: 600; letter-spacing: -.3px; }
.ib-titlerow .wk-ibtn { color: var(--wk-text-2); }
.ib-searchbox { position: relative; display: flex; align-items: center; }
.ib-searchbox .wk-i { position: absolute; inset-inline-start: 14px; color: var(--wk-text-3); pointer-events: none; }
.ib-search { height: 36px; padding: 0 14px; padding-inline-start: 40px; border-color: transparent; border-radius: var(--wk-r-pill); background: var(--wk-surface-2); font-size: 13.5px; transition: border-color var(--wk-t), background var(--wk-t), box-shadow var(--wk-t); }
.ib-search::placeholder { color: var(--wk-text-3); }
.ib-search:focus { outline: none; border-color: var(--wk-green); background: #fff; box-shadow: 0 0 0 3px rgba(42, 146, 69, .14); }
/* one row of filters; scrolls sideways when the list column is very narrow */
.ib-filters { display: flex; gap: 4px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.ib-filters::-webkit-scrollbar { display: none; }
.ib-fchip { display: inline-flex; align-items: center; gap: 6px; flex: 1 0 auto; justify-content: center; white-space: nowrap; height: 28px; padding: 0 8px; border: 1px solid transparent; border-radius: var(--wk-r-pill); background: var(--wk-surface-2); color: var(--wk-text); font-size: 12px; font-weight: 400; cursor: pointer; transition: background var(--wk-t), color var(--wk-t); }
.ib-fchip:hover { background: var(--wk-selected); }
.ib-fchip.on { background: var(--wk-green); color: #fff; font-weight: 500; }
.ib-count { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--wk-green); color: #fff; font: 600 11px/18px var(--wk-font); text-align: center; font-style: normal; }
.ib-count[hidden] { display: none; }
.ib-fchip.on .ib-count { background: rgba(255, 255, 255, .24); }
.ib-rows { flex: 1; overflow-y: auto; padding: 0 8px 8px; border-top: 1px solid var(--wk-border); margin-top: 4px; padding-top: 6px; scrollbar-width: thin; }
.ib-row { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 12px; margin-bottom: 2px; border-radius: 14px; cursor: pointer; position: relative; transition: background var(--wk-t); }
.ib-row + .ib-row::before { content: ""; position: absolute; top: -2px; inset-inline: 14px; height: 1px; background: var(--wk-border); }
.ib-row:hover { background: var(--wk-hover); }
.ib-row.unread .ib-name { font-weight: 600; }
.ib-row.unread .ib-preview { color: var(--wk-text); }
.ib-row.active { background: var(--wk-accent-soft); box-shadow: inset 3px 0 0 var(--wk-accent); }
[dir="rtl"] .ib-row.active { box-shadow: inset -3px 0 0 var(--wk-accent); }
.ib-row.active::before, .ib-row.active + .ib-row::before { display: none; }
.ib-avatar { width: 48px; height: 48px; border-radius: 50%; flex: none; display: inline-grid; place-items: center; overflow: hidden; background: linear-gradient(135deg, var(--wk-green), var(--wk-lime)); color: #fff; font-weight: 600; font-size: 16px; border: 0; text-transform: uppercase; }
.ib-avatar.lg { width: 52px; height: 52px; font-size: 18px; }
.ib-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ib-rowmain { display: grid; gap: 3px; min-width: 0; }
.ib-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; font-size: 15px; }
.ib-preview { display: flex; gap: 6px; align-items: center; color: var(--wk-text-2); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib-chips { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-top: 2px; min-width: 0; }
.ib-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 500; border-radius: var(--wk-r-pill); padding: 2px 8px; white-space: nowrap; }
.ib-chip-tag { background: var(--wk-surface-2); color: var(--wk-text-2); border: 1px solid var(--wk-border); }
.ib-chip-tag i, .ib-labelbtn i, .ib-labelchip i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.ib-rowside { display: grid; gap: 6px; justify-items: end; align-self: start; padding-top: 2px; }
.ib-rowside small { color: var(--wk-text-3); font-size: 12px; white-space: nowrap; }
.ib-row.unread .ib-rowside small { color: var(--wk-green-700); font-weight: 500; }
.ib-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--wk-green); box-shadow: 0 0 0 3px rgba(42, 146, 69, .16); }
.ib-rowside .wk-menuwrap { position: absolute; inset-inline-end: 8px; bottom: 8px; opacity: 0; transition: opacity var(--wk-t); }
.ib-row:hover .wk-menuwrap, .ib-row:focus-within .wk-menuwrap, .ib-rowside .wk-menuwrap:has(.wk-menu) { opacity: 1; }
@media (hover: none) { .ib-rowside .wk-menuwrap { opacity: 1; } }
.ib-more { margin: 0 12px 12px; padding: 10px; border: 0; border-radius: var(--wk-r-btn); background: var(--wk-selected); color: var(--wk-green-700); font-weight: 600; cursor: pointer; transition: background var(--wk-t); }
.ib-more:hover { background: #d6eddc; }

/* empty / loading states */
.ib-empty, .ib-placeholder { margin: auto; display: grid; gap: 8px; justify-items: center; align-content: center; text-align: center; padding: 32px 28px; color: var(--wk-text-2); max-width: 340px; }
.ib-empty { margin-top: 32px; }
.ib-empty b, .ib-placeholder b { color: var(--wk-text); font-size: 16px; font-weight: 600; }
.ib-empty p, .ib-placeholder p { margin: 0; font-size: 13.5px; line-height: 1.55; }
.ib-emptyicon { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--wk-selected); color: var(--wk-green); margin-bottom: 6px; }
.ib-emptyicon.big { width: 88px; height: 88px; box-shadow: 0 0 0 12px rgba(228, 244, 232, .55); }
.ib-emptybtn { margin-top: 8px; }
.ib-emptyicon.err { background: #fde8e8; color: var(--wk-error); }
.ib-qcards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; width: 100%; max-width: 960px; margin-top: 28px; }
.ib-qcard { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--wk-border); border-radius: var(--wk-r-panel); background: var(--wk-surface); box-shadow: var(--wk-sh-1); text-decoration: none; color: var(--wk-text); text-align: start; transition: border-color var(--wk-t), box-shadow var(--wk-t); }
.ib-qcard:hover { border-color: var(--wk-border-strong); box-shadow: var(--wk-sh-2); }
.ib-qcard > .wk-i:last-child { margin-inline-start: auto; color: var(--wk-text-3); flex: none; }
[dir="rtl"] .ib-qcard > .wk-i:last-child { transform: scaleX(-1); }
.ib-qicon { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 12px; }
.q0 .ib-qicon { background: #e4f4e8; color: var(--wk-green); } .q1 .ib-qicon { background: #e4f4e8; color: var(--wk-accent); } .q2 .ib-qicon { background: #e3eeff; color: #2f7bf6; } .q3 .ib-qicon { background: #fff0dc; color: #f08a1b; }
.ib-qtext { display: grid; gap: 2px; min-width: 0; } .ib-qtext b { font-size: 13.5px; color: var(--wk-text); font-weight: 500; } .ib-qtext small { font-size: 12px; color: var(--wk-text-2); line-height: 1.35; }
.ib-placeholder { height: 100%; max-width: none; width: 100%; padding: 24px; box-sizing: border-box; overflow-y: auto; }
.ib-placeholder p { max-width: 380px; }
.ib-placeholder { grid-template-columns: minmax(0, 1fr); }
.ib-skel { display: grid; gap: 4px; padding: 4px; }
.ib-skelrow { display: grid; grid-template-columns: 48px 1fr; gap: 12px; align-items: center; padding: 12px; }
.ib-skelrow > span { display: grid; gap: 8px; }
.ib-skelav, .ib-skelln { display: block; background: linear-gradient(90deg, #eef2ee 25%, #f7faf7 50%, #eef2ee 75%); background-size: 200% 100%; animation: ib-wave 1.4s linear infinite; }
.ib-skelav { width: 48px; height: 48px; border-radius: 50%; }
.ib-skelln { height: 12px; border-radius: 6px; width: 70%; } .ib-skelln.short { width: 45%; height: 10px; }
@keyframes ib-wave { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .ib-skelav, .ib-skelln { animation: none; } }

/* ---------- conversation ---------- */
.ib-head { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--wk-border); min-height: 76px; background: var(--wk-surface); }
.ib-headtext { display: grid; line-height: 1.35; min-width: 0; }
.ib-headtext b { font-size: 17px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib-subline { color: var(--wk-text-2); font-size: 13px; display: flex; gap: 6px; align-items: center; overflow: hidden; white-space: nowrap; }
.ib-subline small { font-size: inherit; }
.ib-sep { color: var(--wk-text-3); font-size: 9px; }
.ib-grow { flex: 1; }
.ib-back { display: none; }
.ib[data-layout="narrow"] .ib-back { display: inline-grid; }
.ib-statusbtn { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px 0 18px; border: 0; border-radius: var(--wk-r-btn); color: #fff; font-weight: 500; font-size: 13.5px; cursor: pointer; background: var(--wk-green); transition: filter var(--wk-t); }
.ib-statusbtn:hover { filter: brightness(.93); }
.ib-statusbtn.st-pending { background: #f08a1b; } .ib-statusbtn.st-closed { background: #6b7280; }
.ib-statusbtn svg { width: 16px; height: 16px; }
.ib-detailsbtn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border: 1px solid var(--wk-border-strong); border-radius: var(--wk-r-btn); background: var(--wk-surface); color: var(--wk-text); font-weight: 500; font-size: 13.5px; cursor: pointer; transition: background var(--wk-t); }
.ib-detailsbtn:hover { background: var(--wk-hover); }
.ib-detailsbtn svg { width: 18px; height: 18px; }
.ib-msgs { flex: 1; overflow-y: auto; padding: 20px 28px; background-color: var(--wk-chat-bg); background-image: linear-gradient(rgba(238, 243, 238, .95), rgba(238, 243, 238, .95)), url("/assets/wa_bg.png"); scrollbar-width: thin; }
.ib-msgwrap { display: flex; flex-wrap: wrap; margin-bottom: 10px; }
.ib-msgwrap.out { justify-content: flex-end; }
.ib-daysep { flex: 0 0 100%; display: flex; justify-content: center; margin: 6px 0 14px; }
.ib-daysep span { padding: 5px 16px; border-radius: var(--wk-r-pill); background: rgba(255, 255, 255, .92); color: var(--wk-text-2); font-size: 12.5px; box-shadow: var(--wk-sh-1); }
.ib-bubble { position: relative; max-width: min(72%, 600px); min-width: 72px; padding: 10px 14px 8px; word-break: break-word; overflow-wrap: anywhere; background: var(--wk-surface); border-radius: 4px 18px 18px 18px; box-shadow: 0 1px 2px rgba(31, 60, 38, .07); font-size: 14.5px; }
.ib-msgwrap.out .ib-bubble { background: var(--wk-bubble-out); border-radius: 18px 18px 4px 18px; }
.ib-ibutton, .ib-quote em { color: var(--wk-accent-600); }
[dir="rtl"] .ib-bubble { border-radius: 18px 4px 18px 18px; }
[dir="rtl"] .ib-msgwrap.out .ib-bubble { border-radius: 18px 18px 18px 4px; }
.ib[data-layout="narrow"] .ib-bubble { max-width: 86%; }
.ib[data-layout="narrow"] .ib-msgs { padding: 14px 12px; }
.ib-text { line-height: 1.5; }
.ib-text ul { margin: 4px 0; padding-inline-start: 18px; } .ib-text pre { white-space: pre-wrap; margin: 4px 0; } .ib-text blockquote { margin: 4px 0; padding-inline-start: 8px; border-inline-start: 3px solid var(--wk-border-strong); }
.ib-meta { display: flex; justify-content: flex-end; align-items: center; gap: 6px; margin-top: 4px; color: var(--wk-text-3); }
.ib-meta small { font-size: 11.5px; }
.ib-status { display: inline-flex; color: var(--wk-text-3); } .ib-status.read { color: var(--wk-tick-read); } .ib-status.err { color: var(--wk-error); }
.ib-media { position: relative; }
.ib-media img, .ib-video { display: block; max-width: 100%; width: 400px; border-radius: 12px; }
.ib-open { position: absolute; top: 6px; inset-inline-end: 6px; border: 0; border-radius: 50%; width: 32px; height: 32px; background: rgba(255, 255, 255, .8); cursor: pointer; display: grid; place-items: center; }
.ib-audio { max-width: 100%; }
.ib-card { display: flex; align-items: center; gap: 12px; padding: 12px; border: 0; border-radius: 12px; background: rgba(255, 255, 255, .72); }
.ib-card.clickable { cursor: pointer; transition: background var(--wk-t); } .ib-card.clickable:hover { background: rgba(255, 255, 255, .95); }
.ib-card .wk-i { color: var(--wk-green); width: 26px; height: 26px; }
.ib-fname { font-size: 13px; color: var(--wk-text); word-break: break-all; }
.ib-sub { padding: 6px 2px 0; font-size: 13.5px; }
.ib-phone { display: flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--wk-text-2); }
.ib-quote { border-inline-start: 3px solid var(--wk-accent); background: rgba(42, 146, 69, .07); border-radius: 8px; padding: 6px 10px; margin: 2px 0 8px; cursor: pointer; display: grid; font-size: 12.5px; }
.ib-quote em { color: var(--wk-green-700); font-style: normal; font-weight: 500; }
.ib-ibutton { margin-top: 6px; padding: 7px 10px; border-radius: 10px; background: rgba(255, 255, 255, .7); text-align: center; font-weight: 500; font-size: 13px; color: var(--wk-green-700); }
.ib-listmsg { background: rgba(255, 255, 255, .6); border-radius: 12px; padding: 12px; min-width: 220px; }
.ib-lsec { margin-top: 10px; } .ib-lsec > b { display: block; font-size: 12px; color: var(--wk-text-2); border-bottom: 1px solid var(--wk-border); padding-bottom: 4px; }
.ib-lrow { border: 1px solid var(--wk-border); border-radius: 10px; padding: 8px 10px; margin-top: 6px; display: grid; background: rgba(255, 255, 255, .6); } .ib-lrow small { color: var(--wk-text-2); }
.ib-react { position: absolute; bottom: -10px; inset-inline-end: -6px; background: #fff; border: 1px solid var(--wk-border); border-radius: 50%; padding: 1px 5px; font-size: 12px; box-shadow: var(--wk-sh-1); }
.ib-msgwrap.in .ib-react { inset-inline-end: auto; inset-inline-start: -6px; }
.ib-showlist { display: none; }
.ib[data-layout="narrow"] .ib-showlist { display: inline-flex; }

/* ---------- composer ---------- */
.ib-ctabs { display: flex; align-items: center; gap: 4px; margin-bottom: 8px; }
.ib-ctab { border: 0; background: none; padding: 6px 14px; font-size: 13.5px; font-weight: 500; color: var(--wk-text-2); cursor: pointer; border-bottom: 2px solid transparent; border-radius: 6px 6px 0 0; }
.ib-ctab.on { color: var(--wk-accent); border-bottom-color: var(--wk-accent); }
.ib-chan { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: var(--wk-r-pill); background: var(--wk-surface-2); border: 1px solid var(--wk-border); font-size: 12.5px; color: var(--wk-text-2); }
.ib-chan svg { color: var(--wk-green); }
.ib-notepane { display: grid; gap: 8px; justify-items: end; } .ib-notepane[hidden] { display: none; }
.ib-composenote { width: 100%; height: 74px; resize: vertical; padding: 10px 12px; font: inherit; border-radius: var(--wk-r-input); background: #fffbe8; border: 1px solid #f1e3a6; }
.ib-composenote:focus { outline: none; border-color: var(--wk-accent); }
.ib-field[hidden] { display: none; }
.ib-composer { padding: 12px 16px 16px; background: var(--wk-surface); border-top: 1px solid var(--wk-border); }
.ib-field { display: flex; align-items: center; gap: 4px; padding: 6px 8px 6px 10px; border: 1px solid var(--wk-border); border-radius: 18px; background: var(--wk-surface); box-shadow: var(--wk-sh-1); transition: border-color var(--wk-t), box-shadow var(--wk-t); }
[dir="rtl"] .ib-field { padding: 6px 10px 6px 8px; }
.ib-field:focus-within { border-color: var(--wk-green); box-shadow: 0 0 0 3px rgba(42, 146, 69, .12); }
.ib-field .wk-menuwrap { align-self: center; }
.ib-field .wk-ibtn { color: var(--wk-ink); }
.ib-field .wk-ibtn:hover { background: var(--wk-hover); }
.ib-inputwrap { flex: 1; min-width: 0; }
.ib-input { resize: none; border: 0; border-radius: 0; background: transparent; padding: 10px 8px; max-height: 96px; display: block; line-height: 1.4; font-size: 14.5px; }
.ib-input:focus { outline: none; }
.ib-input::placeholder { color: var(--wk-text-3); }
.ib-send { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 42px; height: 42px; padding: 0 20px; flex: none; border: 0; border-radius: var(--wk-r-btn); background: var(--wk-accent); color: #fff; font-weight: 500; font-size: 14px; cursor: pointer; transition: background var(--wk-t); }
[dir="rtl"] .ib-send svg { transform: scaleX(-1); }
.ib-send:disabled { background: #a9d4b4; cursor: not-allowed; } .ib-send:not(:disabled):hover { background: var(--wk-accent-600); }
.ib-emoji { position: absolute; bottom: calc(100% + 8px); inset-inline-start: 0; z-index: 25; width: 330px; max-width: 88vw; background: #fff; border-radius: var(--wk-r-panel); box-shadow: var(--wk-sh-pop); border: 1px solid var(--wk-border); padding: 10px; display: grid; gap: 8px; }
.ib-etabs { display: flex; gap: 2px; overflow-x: auto; } .ib-etabs button { border: 0; background: none; font-size: 18px; padding: 4px 6px; border-radius: 8px; cursor: pointer; } .ib-etabs .on { background: var(--wk-selected); }
.ib-egrid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; max-height: 220px; overflow-y: auto; } .ib-egrid button { border: 0; background: none; font-size: 22px; padding: 3px; border-radius: 8px; cursor: pointer; } .ib-egrid button:hover { background: var(--wk-hover); }
.ib-egrid .wk-empty { grid-column: 1 / -1; padding: 12px; }

/* ---------- modal bits ---------- */
.ib-drop { border: 2px dashed var(--wk-border-strong); border-radius: var(--wk-r-panel); padding: 24px; text-align: center; cursor: pointer; display: grid; gap: 6px; color: var(--wk-text-2); transition: background var(--wk-t), border-color var(--wk-t); } .ib-drop:hover, .ib-drop.over { background: var(--wk-hover); border-color: var(--wk-green); }
.ib-lsedit { background: var(--wk-surface-2); border-radius: var(--wk-r-panel); padding: 10px; display: grid; gap: 8px; } .ib-lredit { background: #fff; border-radius: 10px; padding: 8px; display: grid; gap: 6px; }
.ib-color { width: 40px; height: 40px; padding: 0; border: 1px solid var(--wk-border); border-radius: 10px; background: none; cursor: pointer; flex: none; }
.ib-labels { display: flex; flex-wrap: wrap; gap: 8px; } .ib-labelchip { display: inline-flex; align-items: center; background: var(--wk-surface-2); border: 1px solid var(--wk-border); border-radius: var(--wk-r-pill); }
.ib-labelchip > button:first-child { display: inline-flex; gap: 6px; align-items: center; border: 0; background: none; padding: 6px 4px 6px 12px; cursor: pointer; }
.ib-tones { display: grid; gap: 2px; max-height: 60vh; overflow-y: auto; } .ib-tone { display: flex; align-items: center; border-radius: 10px; } .ib-tone.on { background: var(--wk-selected); }
.ib-tonepick { flex: 1; display: grid; text-align: start; border: 0; background: none; padding: 8px 10px; cursor: pointer; } .ib-tonepick small { color: var(--wk-text-2); }

/* ---------- details panel ---------- */
.ib-info { overflow-y: auto; padding: 14px; gap: 12px; }
.ib-hero { display: grid; justify-items: center; gap: 10px; padding: 10px 6px 4px; text-align: center; }
.ib-herokv { display: grid; gap: 8px; font-size: 12.5px; width: 100%; text-align: start; } .ib-herokv > div { display: flex; justify-content: space-between; gap: 8px; } .ib-herokv b { font-weight: 500; color: var(--wk-green-700); max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib-avatar.xl { width: 76px; height: 76px; font-size: 26px; }
.ib-heroname { font-size: 17px; font-weight: 600; }
.ib-infohead { display: none; align-items: center; justify-content: space-between; }
.ib-block { background: var(--wk-surface-2); border: 1px solid var(--wk-border); border-radius: var(--wk-r-panel); padding: 14px; display: grid; gap: 10px; }
.ib-blockhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; } .ib-blockhead > span { display: inline-flex; gap: 8px; align-items: center; color: var(--wk-text-2); } .ib-blockhead b { color: var(--wk-text); font-weight: 500; }
.ib-note { height: 80px; resize: vertical; }
.ib-labelbtn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--wk-border-strong); background: #fff; border-radius: var(--wk-r-pill); padding: 5px 12px; cursor: pointer; font-size: 12.5px; }
.ib-kv { display: grid; gap: 8px; font-size: 12.5px; } .ib-kv > div { display: flex; justify-content: space-between; gap: 8px; } .ib-kv b { font-weight: 500; color: var(--wk-green-700); max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib-center { text-align: center; margin: 0; font-size: 13px; }
.ib-ringwrap { display: grid; place-items: center; gap: 6px; }
.ib-ring { --pct: 100; width: 84px; height: 84px; border-radius: 50%; background: conic-gradient(var(--wk-green) calc(var(--pct) * 1%), #e3ebe4 0); -webkit-mask: radial-gradient(circle 33px, transparent 98%, #000); mask: radial-gradient(circle 33px, transparent 98%, #000); }
.ib-ring.low { background: conic-gradient(#e69a1b calc(var(--pct) * 1%), #e3ebe4 0); }
.ib-ringtxt { font-weight: 600; font-variant-numeric: tabular-nums; } .ib-expired { margin: 0; text-align: center; color: var(--wk-error); font-weight: 600; font-size: 16px; }
.ib-tabs { display: flex; gap: 4px; overflow-x: auto; background: #fff; border-radius: var(--wk-r-btn); padding: 4px; } .ib-tabs button { border: 0; background: none; padding: 7px 10px; border-radius: 9px; cursor: pointer; white-space: nowrap; font-size: 12.5px; } .ib-tabs .on { background: var(--wk-selected); font-weight: 600; color: var(--wk-green-700); }
.ib-mgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; max-height: 360px; overflow-y: auto; }
.ib-cell { position: relative; border-radius: 10px; overflow: hidden; background: #fff; min-height: 80px; display: grid; } .ib-cell img, .ib-cell video { width: 100%; height: 100px; object-fit: cover; }
.ib-cellicon { display: grid; justify-items: center; align-content: center; gap: 4px; padding: 10px; text-align: center; } .ib-cellicon .wk-i { color: var(--wk-green); } .ib-cellicon small { overflow: hidden; text-overflow: ellipsis; max-width: 100%; white-space: nowrap; }
.ib-dl { position: absolute; top: 4px; inset-inline-end: 4px; width: 28px; height: 28px; display: grid; place-items: center; background: rgba(0, 0, 0, .55); color: #fff; border-radius: 50%; }
.ib-scrim { display: none; }

/* medium and narrow: the details panel is a drawer opened from the chat header */
.ib[data-layout="medium"] .ib-info, .ib[data-layout="narrow"] .ib-info { position: absolute; top: 0; right: 12px; bottom: 12px; width: min(340px, 92vw); z-index: 30; transform: translateX(110%); transition: transform .2s ease; box-shadow: none; }
.ib[data-layout="narrow"] .ib-info { right: 0; bottom: 0; border-radius: var(--wk-r-card) 0 0 var(--wk-r-card); }
.ib[dir="rtl"][data-layout="medium"] .ib-info, .ib[dir="rtl"][data-layout="narrow"] .ib-info { right: auto; left: 12px; transform: translateX(-110%); }
.ib[dir="rtl"][data-layout="narrow"] .ib-info { left: 0; border-radius: 0 var(--wk-r-card) var(--wk-r-card) 0; }
.ib.has-chat.info-open[data-layout="medium"] .ib-info, .ib.has-chat.info-open[data-layout="narrow"] .ib-info { transform: none; box-shadow: var(--wk-sh-pop); }
.ib[data-layout="medium"] .ib-infohead, .ib[data-layout="narrow"] .ib-infohead { display: flex; }
.ib.info-open[data-layout="medium"] .ib-scrim, .ib.info-open[data-layout="narrow"] .ib-scrim { display: block; position: absolute; inset: 0; background: rgba(20, 30, 20, .3); z-index: 25; }
.ib[data-layout="wide"] .ib-infotoggle { display: none; }
.ib[data-layout="narrow"] .ib-detailsbtn span { display: none; } .ib[data-layout="narrow"] .ib-detailsbtn { width: 40px; padding: 0; justify-content: center; }
.ib[data-layout="narrow"] .ib-head { min-height: 64px; padding: 8px 10px; gap: 10px; }
.ib[data-layout="narrow"] .ib-avatar.lg { width: 44px; height: 44px; }
.ib[data-layout="narrow"] .ib-composer { padding: 8px 10px 10px; }
@media (max-width: 899px) { .ib-media img, .ib-video { width: 100%; } }
.ib-info:empty { background: transparent; border: 0; box-shadow: none; }

/* chat labels */
.ib-linkbtn { border: 0; background: none; padding: 2px 4px; color: var(--wk-accent, #1f6f35); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; border-radius: 6px; }
.ib-linkbtn:hover { text-decoration: underline; } .ib-linkbtn.muted { color: var(--wk-text-2); font-weight: 500; }
.ib-curlabel { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
.ib-tagpill { --tag: #9aa59c; display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--wk-text);
  background: color-mix(in srgb, var(--tag) 14%, #fff); border: 1px solid color-mix(in srgb, var(--tag) 35%, #fff); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib-tagpill i { width: 8px; height: 8px; border-radius: 50%; background: var(--tag); flex: none; }
.ib-addlabel { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; padding: 6px 12px; border: 1px dashed var(--wk-border-strong); border-radius: 999px; background: none; color: var(--wk-text-2); font: inherit; font-size: 12.5px; cursor: pointer; }
.ib-addlabel:hover { border-color: var(--wk-accent, #2a9245); color: var(--wk-accent, #1f6f35); }
.ib-labelbody { display: grid; gap: 10px; min-width: min(420px, 80vw); }
.ib-lhead { margin: 4px 0 0; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--wk-text-2); }
.ib-labellist { display: grid; gap: 6px; max-height: 260px; overflow: auto; }
.ib-lrow { display: flex; align-items: center; gap: 6px; border: 1px solid var(--wk-border); border-radius: 12px; padding: 4px 6px 4px 4px; }
.ib-lrow.on { border-color: var(--wk-accent, #2a9245); background: color-mix(in srgb, var(--wk-accent, #2a9245) 7%, #fff); }
.ib-lpick { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 0; background: none; padding: 6px 8px; border-radius: 8px; cursor: pointer; font: inherit; text-align: left; }
.ib-lpick:hover { background: var(--wk-surface-2); }
.ib-lcheck { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--wk-accent, #1f6f35); }
.ib-newlabel { display: grid; gap: 10px; padding: 12px; border-radius: 12px; background: var(--wk-surface-2); }
.ib-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.ib-sw { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--wk-border); cursor: pointer; }
.ib-sw.on { box-shadow: 0 0 0 2px var(--wk-text); }
.ib-lmsg { min-height: 16px; color: var(--wk-text-2); font-size: 12px; }

/* Platform / label / agent filters */
.ib-titletools { display: inline-flex; align-items: center; gap: 2px; }
.ib-fwrap { position: relative; }
.ib-fbtn { position: relative; color: var(--wk-text-2); }
.ib-fbtn.on { color: var(--wk-green); background: var(--wk-selected); }
.ib-fcount { position: absolute; top: -3px; inset-inline-end: -3px; border: 2px solid var(--wk-surface); min-width: 15px; height: 15px; padding: 0 3px; border-radius: 8px; background: var(--wk-green); color: #fff; font: 600 10px/15px var(--wk-font); font-style: normal; text-align: center; }
.ib-fcount[hidden] { display: none; }
.ib-fpanel { width: 250px; padding: 12px; gap: 10px; right: 0; left: auto; }
[dir="rtl"] .ib-fpanel { right: auto; left: 0; }
.ib-fhead { font-size: 13.5px; font-weight: 600; }
.ib-ffield { display: grid; gap: 4px; font-size: 12px; color: var(--wk-text-2); }
.ib-fsel { height: 36px; padding: 0 30px 0 10px; font-size: 13px; line-height: 34px; }
.ib-fpanel .ib-freset { justify-content: center; color: var(--wk-text-2); font-size: 12.5px; padding: 6px; }
.ib-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: -2px; }
.ib-pills[hidden] { display: none; }
.ib-pill { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 8px; border: 1px solid var(--wk-green); border-radius: var(--wk-r-pill); background: var(--wk-selected); color: var(--wk-green); font-size: 11.5px; font-weight: 500; cursor: pointer; max-width: 100%; }
.ib-pill .wk-i:last-child { opacity: .7; }
.ib-pill:hover .wk-i:last-child { opacity: 1; }
.ib-pillclear { border-color: transparent; background: none; color: var(--wk-text-2); }
.ib-chip-agent { color: #2f5bd3; background: #E8EEFD; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Facebook / Instagram post comments */
.ib-chip-cmt { box-shadow: inset 0 0 0 1px currentColor; }
.ib-cmt { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; margin: -2px 0 6px; padding: 4px 8px; border-radius: 8px; background: rgba(24, 119, 242, .08); color: #1659c7; font-size: 11.5px; font-weight: 500; }
.ib-cmt.reply { background: rgba(255, 255, 255, .55); }
.ib-cmt a { color: inherit; text-decoration: underline; margin-inline-start: auto; }
