/* =====================================================================
   OnlyContact - project styles on top of the Admina theme (style.css)
   Uses theme tokens: --primary-600, --neutral-*, --white, [data-theme=dark]
   ===================================================================== */

/* ---------- Sidebar additions ---------- */
html.twin-pre-collapsed .twin-panel { width: 0; opacity: 0; }
html.twin-pre-collapsed .dashboard-main { margin-inline-start: var(--ts-rail-w); }

.twin-sidebar .rail-icon { position: relative; text-decoration: none; }
.rail-badge {
    position: absolute; top: 4px; inset-inline-end: 4px;
    min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
    background: var(--danger-600, #dc2626); color: #fff;
    font-size: 10px; font-weight: 600; line-height: 18px; text-align: center;
}
.twin-menu__title {
    padding: 4px 12px 10px; font-size: 11px; font-weight: 600;
    letter-spacing: .06em; text-transform: uppercase; color: var(--ts-text); opacity: .7;
}
.twin-menu a .badge { font-size: 11px; }

.workspace-card {
    display: flex; align-items: center; gap: 10px; padding: 12px;
    border-radius: 12px; background: var(--ts-hover);
}
.workspace-card__icon {
    width: 36px; height: 36px; flex-shrink: 0; border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--ts-purple-soft); color: var(--ts-purple); font-size: 18px;
}
.workspace-card__name { margin: 0; font-size: 13px; font-weight: 600; color: var(--ts-heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.workspace-card__domain { margin: 0; font-size: 12px; color: var(--ts-text); }
.min-w-0 { min-width: 0; }

/* ---------- Navbar ---------- */
/* The theme gives .navbar-header a fixed height: keep it on one line and let the search shrink */
.navbar-header > .row { flex-wrap: nowrap; }
.navbar-header .navbar-search input { width: clamp(200px, 22vw, 24.25rem); }
@media (max-width: 1599px) { .oc-system-badge--nav { display: none !important; } }
.oc-theme-toggle { color: var(--text-primary-light, #1f2937); }
.oc-theme-toggle__light { display: none; }
[data-theme=dark] .oc-theme-toggle__light { display: inline-block; color: #fff; }
[data-theme=dark] .oc-theme-toggle__dark { display: none; }

.oc-dot-badge {
    position: absolute; top: -2px; inset-inline-end: -2px;
    min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
    background: var(--danger-600, #dc2626); color: #fff;
    font-size: 11px; font-weight: 600; line-height: 20px; text-align: center;
}
.oc-lang-code {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 20px; border-radius: 4px; font-size: 11px; font-weight: 700;
    background: var(--neutral-200); color: var(--neutral-700, #374151);
}

/* ---------- Avatars ---------- */
.oc-avatar {
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
    border-radius: 50%; background: var(--primary-50, #eef2ff); color: var(--primary-600);
    font-weight: 600; font-size: 14px; text-transform: uppercase; overflow: hidden;
}
.oc-avatar img { width: 100%; height: 100%; object-fit: cover; }
.oc-avatar.sm { width: 32px; height: 32px; font-size: 12px; }
.oc-avatar.md { width: 40px; height: 40px; }
.oc-avatar.lg { width: 64px; height: 64px; font-size: 20px; }

.oc-channel-dot {
    position: absolute; bottom: -2px; inset-inline-end: -2px;
    width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--white);
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff; font-size: 10px;
}

/* ---------- Source / stage chips ---------- */
.oc-chip {
    display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px;
    border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 20px;
    background: color-mix(in srgb, var(--chip, var(--primary-600)) 12%, transparent);
    color: var(--chip, var(--primary-600));
    white-space: nowrap;
}
.oc-stage-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex-shrink: 0; }

/* ---------- KPI ---------- */
.oc-kpi-icon {
    width: 48px; height: 48px; flex-shrink: 0; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center; font-size: 24px;
}

/* ---------- Kanban (lead pipeline) ---------- */
/* Toolbar */
.oc-board-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.oc-stage-nav { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; flex: 1 1 auto; min-width: 0; padding: 2px; }
.oc-stage-nav::-webkit-scrollbar { display: none; }
.oc-stage-pill {
    display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; padding: 6px 10px; border-radius: 999px;
    background: var(--white); border: 1px solid var(--neutral-200); font-size: 13px; font-weight: 500;
    color: var(--text-secondary-light, #6b7280); transition: all .15s;
}
.oc-stage-pill .oc-stage-dot { background: var(--stage); width: 8px; height: 8px; }
.oc-stage-pill__count { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: color-mix(in srgb, var(--stage) 14%, transparent); color: var(--stage); }
.oc-stage-pill.is-visible { border-color: color-mix(in srgb, var(--stage) 55%, transparent); color: var(--text-primary-light, #111827); }
.oc-stage-pill:hover { border-color: var(--stage); }
.oc-board-tools { display: flex; align-items: center; gap: 8px; }
.oc-board-search { position: relative; }
.oc-board-search i { position: absolute; top: 50%; inset-inline-start: 12px; transform: translateY(-50%); color: var(--text-secondary-light, #9ca3af); }
.oc-board-search input {
    width: 230px; height: 36px; padding-inline: 34px 12px; border-radius: 10px; border: 1px solid var(--neutral-200);
    background: var(--white); font-size: 14px; color: var(--text-primary-light, #111827);
}
.oc-board-search input:focus { outline: none; border-color: var(--primary-600); box-shadow: 0 0 0 3px rgba(79, 70, 229, .12); }
.oc-density { border: 1px solid var(--neutral-200); background: var(--white); color: var(--text-secondary-light, #6b7280); height: 36px; width: 38px; }
.oc-density.active { background: var(--primary-600); border-color: var(--primary-600); color: #fff; }

/* Board viewport: fills the screen, scrollbar always visible, edge shadows + arrows */
.oc-board-wrap { position: relative; }
.oc-board-scroll {
    overflow-x: auto; overflow-y: hidden; padding: 2px 2px 10px; border-radius: 16px;
    scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--primary-600) 45%, transparent) transparent;
    cursor: grab;
}
.oc-board-scroll::-webkit-scrollbar { height: 10px; }
.oc-board-scroll::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--primary-600) 40%, transparent); border-radius: 10px; }
.oc-board-scroll::-webkit-scrollbar-track { background: color-mix(in srgb, var(--primary-600) 6%, transparent); border-radius: 10px; }
.oc-board-scroll.is-panning { cursor: grabbing; user-select: none; }
.oc-board-wrap::before, .oc-board-wrap::after {
    content: ""; position: absolute; top: 0; bottom: 10px; width: 48px; z-index: 3; pointer-events: none;
    opacity: 0; transition: opacity .2s;
}
.oc-board-wrap::before { inset-inline-start: 0; background: linear-gradient(90deg, rgba(15, 23, 42, .10), transparent); border-radius: 16px 0 0 16px; }
.oc-board-wrap::after { inset-inline-end: 0; background: linear-gradient(270deg, rgba(15, 23, 42, .10), transparent); border-radius: 0 16px 16px 0; }
.oc-board-wrap.has-prev::before, .oc-board-wrap.has-next::after { opacity: 1; }
.oc-board-arrow {
    position: absolute; top: 50%; z-index: 4; width: 40px; height: 40px; margin-top: -20px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center; font-size: 18px;
    background: var(--white); color: var(--primary-600); box-shadow: 0 6px 18px rgba(15, 23, 42, .18);
    opacity: 0; visibility: hidden; transition: opacity .2s;
}
.oc-board-arrow--prev { inset-inline-start: -8px; }
.oc-board-arrow--next { inset-inline-end: -8px; }
.oc-board-wrap.has-prev .oc-board-arrow--prev, .oc-board-wrap.has-next .oc-board-arrow--next { opacity: 1; visibility: visible; }
[dir=rtl] .oc-board-arrow i { transform: scaleX(-1); }

.oc-board { display: flex; align-items: stretch; gap: 16px; height: 100%; }
.oc-column {
    flex: 0 0 300px; width: 300px; height: 100%;
    background: var(--white); border-radius: 16px; overflow: hidden;
    display: flex; flex-direction: column; cursor: default;
    transition: flex-basis .2s ease, width .2s ease, box-shadow .2s;
}
.oc-column.is-flash { animation: ocFlash 1s ease; }
@keyframes ocFlash { 0%, 60% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--stage) 60%, transparent); } 100% { box-shadow: none; } }
.oc-column__head {
    display: flex; align-items: center; gap: 8px; padding: 14px 14px 8px;
    border-top: 4px solid var(--stage, var(--primary-600)); border-radius: 16px 16px 0 0;
}
.oc-column__title { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.oc-column__toggle, .oc-column__add {
    flex-shrink: 0; width: 28px; height: 28px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center;
    color: var(--text-secondary-light, #9ca3af); font-size: 16px; background: transparent;
}
.oc-column__add { font-size: 20px; }
.oc-column__toggle:hover, .oc-column__add:hover { background: var(--neutral-50); color: var(--primary-600); }
[dir=rtl] .oc-column__toggle i { transform: scaleX(-1); }
.oc-column__sum { padding: 0 16px 8px; }

/* Collapsed column: narrow vertical strip */
.oc-column.is-collapsed { flex-basis: 56px; width: 56px; cursor: pointer; }
.oc-column.is-collapsed .oc-column__head { flex-direction: column; padding: 12px 6px; gap: 12px; height: 100%; }
.oc-column.is-collapsed .oc-column__toggle i { transform: rotate(180deg); }
[dir=rtl] .oc-column.is-collapsed .oc-column__toggle i { transform: rotate(180deg) scaleX(-1); }
.oc-column.is-collapsed .oc-column__title { flex-direction: column; writing-mode: vertical-rl; flex: 0 1 auto; }
.oc-column.is-collapsed .oc-column__title h2 { max-height: 60vh; }
.oc-column.is-collapsed .oc-column__count { writing-mode: horizontal-tb; }
.oc-column.is-collapsed .oc-column__add, .oc-column.is-collapsed .oc-column__sum, .oc-column.is-collapsed .oc-column__body { display: none; }
.oc-column.is-collapsed:hover { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--stage) 35%, transparent); }

/* Compact view */
.oc-board.is-compact .oc-column:not(.is-collapsed) { flex-basis: 240px; width: 240px; }
.oc-board.is-compact .oc-card { padding: 10px 12px; margin-bottom: 8px; }
.oc-board.is-compact .oc-card__meta, .oc-board.is-compact .oc-card__owner, .oc-board.is-compact .oc-card__time { display: none !important; }
.oc-board.is-compact .oc-card__top { margin-bottom: 4px; }
.oc-board.is-compact .oc-card__title { font-size: 14px !important; }

/* Search & drag states */
.oc-card.is-hidden { display: none; }
.oc-board.is-filtering .oc-column__empty { display: none; }
.oc-board.is-dragging .oc-column__body { background: color-mix(in srgb, var(--stage) 4%, transparent); }
.oc-card__top { margin-bottom: 8px; }
@media (max-width: 767px) {
    .oc-board-search input { width: 160px; }
    .oc-column { flex-basis: 82vw; width: 82vw; }
    .oc-board-arrow { display: none; }
}
.oc-column__count {
    min-width: 24px; height: 24px; padding: 0 8px; border-radius: 12px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 600;
    background: color-mix(in srgb, var(--stage, var(--primary-600)) 14%, transparent);
    color: var(--stage, var(--primary-600));
}
.oc-column__body { flex: 1; overflow-y: auto; padding: 4px 14px 14px; min-height: 80px; }
.oc-column__empty {
    border: 2px dashed var(--neutral-200); border-radius: 12px; padding: 18px;
    text-align: center; font-size: 13px; color: var(--neutral-400, #9ca3af);
}
.oc-column__body:has(.oc-card) .oc-column__empty { display: none; }

.oc-card {
    display: block; background: var(--neutral-50); border: 1px solid transparent;
    border-radius: 12px; padding: 14px; margin-bottom: 12px; cursor: grab;
    color: inherit; transition: border-color .15s, box-shadow .15s;
}
.oc-card:hover { border-color: color-mix(in srgb, var(--primary-600) 35%, transparent); box-shadow: 0 6px 16px rgba(17, 24, 39, .06); }
.oc-card:active { cursor: grabbing; }
.oc-card__title { font-size: 15px !important; /* theme forces h3 size */ line-height: 1.35; font-weight: 600; margin: 0 0 2px; color: var(--text-primary-light, #111827); }
.oc-card__meta { font-size: 13px; color: var(--text-secondary-light, #6b7280); }
.oc-card.sortable-ghost { opacity: .35; }
.oc-card.sortable-drag { transform: rotate(2deg); box-shadow: 0 12px 28px rgba(17, 24, 39, .18); }
.oc-card.is-saving { opacity: .6; pointer-events: none; }

/* ---------- Pipeline settings ---------- */
.oc-stage-row { cursor: grab; }
.oc-stage-row.sortable-ghost { opacity: .35; }
.oc-color-input { width: 44px; height: 40px; padding: 4px; border-radius: 8px; }

/* ---------- Inbox: list | conversation | contact (own layout, independent of the theme chat) ---------- */
.ib {
    --ib-line: var(--neutral-200, #e5e7eb);
    --ib-soft: var(--neutral-50, #f8fafc);
    --ib-muted: var(--text-secondary-light, #6b7280);
    display: grid; grid-template-columns: 72px 340px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); height: calc(100vh - 150px); min-height: 520px;
    background: var(--white, #fff); border: 1px solid var(--ib-line); border-radius: 20px; overflow: hidden;
    box-shadow: 0 10px 40px rgba(15, 23, 42, .06);
}
.ib--open { grid-template-columns: 72px 340px minmax(0, 1fr) 300px; }

/* channel rail */
.ib-rail {
    display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 0;
    background: var(--ib-soft); border-inline-end: 1px solid var(--ib-line);
}
.ib-rail__btn {
    --ch: var(--primary-600); position: relative; width: 46px; height: 46px; border-radius: 14px; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center; font-size: 23px; text-decoration: none;
    color: var(--ch); background: var(--white, #fff); border: 1px solid var(--ib-line); transition: transform .12s, box-shadow .12s, background .12s;
}
.ib-rail__btn:hover { transform: translateY(-1px); box-shadow: 0 6px 14px rgba(15, 23, 42, .08); color: var(--ch); }
.ib-rail__btn.is-active { background: var(--ch); border-color: var(--ch); color: #fff; box-shadow: 0 8px 18px color-mix(in srgb, var(--ch) 35%, transparent); }
.ib-rail__btn--bottom { margin-top: auto; font-size: 20px; color: var(--ib-muted); }
.ib-rail__sep { width: 26px; height: 1px; background: var(--ib-line); margin: 2px 0; }
.ib-rail__badge {
    position: absolute; top: -6px; inset-inline-end: -6px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px;
    background: #EF4444; color: #fff; font-size: 10px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
    border: 2px solid var(--ib-soft);
}
/* instant tooltip with the channel name */
.ib-rail__btn[data-tip]::after {
    content: attr(data-tip); position: absolute; inset-inline-start: calc(100% + 12px); top: 50%; transform: translate(-4px, -50%);
    white-space: nowrap; padding: 6px 10px; border-radius: 8px; background: #111827; color: #fff; font-size: 12px; font-weight: 600;
    pointer-events: none; opacity: 0; transition: opacity .12s, transform .12s; z-index: 20; box-shadow: 0 6px 16px rgba(15, 23, 42, .2);
}
.ib-rail__btn[data-tip]::before {
    content: ""; position: absolute; inset-inline-start: calc(100% + 6px); top: 50%; transform: translateY(-50%);
    border: 6px solid transparent; border-inline-end-color: #111827; opacity: 0; transition: opacity .12s; z-index: 20; pointer-events: none;
}
.ib-rail__btn[data-tip]:hover::after, .ib-rail__btn[data-tip]:focus-visible::after { opacity: 1; transform: translate(0, -50%); }
.ib-rail__btn[data-tip]:hover::before, .ib-rail__btn[data-tip]:focus-visible::before { opacity: 1; }
.ib-rail { position: relative; z-index: 5; }
.ib-icon-btn {
    width: 36px; height: 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
    color: var(--ib-muted); background: var(--ib-soft); border: 0; font-size: 18px; flex-shrink: 0; text-decoration: none;
}
.ib-icon-btn:hover { color: var(--primary-600); background: var(--primary-50, #eef2ff); }

/* list */
.ib-list { display: flex; flex-direction: column; min-height: 0; border-inline-end: 1px solid var(--ib-line); }
.ib-list__head { padding: 20px 20px 12px; border-bottom: 1px solid var(--ib-line); }
.ib-title { font-size: 20px !important; font-weight: 700; margin: 0; display: flex; align-items: center; gap: 8px; }
.ib-count { font-size: 12px; font-weight: 700; color: #fff; background: var(--primary-600); border-radius: 999px; padding: 2px 8px; }
.ib-search { position: relative; margin-bottom: 12px; }
.ib-search i { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); color: var(--ib-muted); }
.ib-search input {
    width: 100%; height: 42px; border-radius: 12px; border: 1px solid var(--ib-line); background: var(--ib-soft);
    padding-inline: 40px 12px; font-size: 14px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.ib-search input:focus { border-color: var(--primary-600); box-shadow: 0 0 0 4px rgba(79, 70, 229, .12); background: var(--white, #fff); }
.ib-list__body { flex: 1; overflow-y: auto; padding: 8px; }
.ib-item {
    display: flex; gap: 12px; padding: 12px; border-radius: 14px; text-decoration: none; color: inherit; position: relative;
    transition: background .15s;
}
.ib-item + .ib-item { margin-top: 2px; }
.ib-item:hover { background: var(--ib-soft); }
.ib-item.is-active { background: var(--primary-50, #eef2ff); }
.ib-item.is-active::before { content: ""; position: absolute; inset-inline-start: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 3px; background: var(--primary-600); }
.ib-item__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ib-item__top, .ib-item__bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ib-item__name { font-weight: 600; font-size: 14px; color: var(--text-primary-light, #111827); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ib-item__time { font-size: 11px; color: var(--ib-muted); flex-shrink: 0; }
.ib-item__preview { font-size: 13px; color: var(--ib-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ib-item.is-unread .ib-item__preview { color: var(--text-primary-light, #111827); font-weight: 500; }
.ib-item.is-unread .ib-item__time { color: var(--primary-600); font-weight: 600; }
.ib-item__owner { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--ib-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ib-item__also { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--ib-muted); }
.ib-unread {
    min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--primary-600); color: #fff;
    font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.ib-empty-list { text-align: center; padding: 48px 16px; color: var(--ib-muted); font-size: 14px; }
.ib-empty-list i { font-size: 40px; color: var(--primary-600); display: block; margin-bottom: 8px; }

/* avatars */
.ib-avatar {
    --tint: #4F46E5; position: relative; width: 44px; height: 44px; flex-shrink: 0; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px;
    color: var(--tint); background: color-mix(in srgb, var(--tint) 14%, transparent);
}
.ib-avatar--md { width: 42px; height: 42px; }
.ib-avatar--lg { width: 72px; height: 72px; font-size: 24px; margin: 0 auto 10px; }
.ib-avatar__ch {
    position: absolute; inset-inline-end: -3px; bottom: -3px; width: 20px; height: 20px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 11px; border: 2px solid var(--white, #fff);
}
.ib-ch-pill {
    --ch: var(--primary-600); display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px;
    font-size: 11px; font-weight: 600; color: var(--ch); background: color-mix(in srgb, var(--ch) 12%, transparent);
}

/* conversation */
.ib-chat { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--ib-soft); }
.ib-chat__head {
    display: flex; align-items: center; gap: 12px; padding: 14px 20px; background: var(--white, #fff); border-bottom: 1px solid var(--ib-line);
}
.ib-chat__who { flex: 1; min-width: 0; }
.ib-chat__who h2 { font-size: 16px !important; font-weight: 700; margin: 0 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ib-chat__via { font-size: 12px; color: var(--ib-muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ib-ch-pill { white-space: nowrap; }
.ib-back, .ib-side-toggle { display: none; }
.ib-status { display: inline-flex; background: var(--ib-soft); border: 1px solid var(--ib-line); border-radius: 12px; padding: 3px; gap: 2px; }
.ib-status button {
    border: 0; background: transparent; border-radius: 9px; padding: 5px 10px; font-size: 12px; font-weight: 600; color: var(--ib-muted);
    display: inline-flex; align-items: center; gap: 4px;
}
.ib-status button.is-active { background: var(--white, #fff); box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }
.ib-status button.is-open.is-active { color: var(--primary-600); }
.ib-status button.is-pending.is-active { color: #d97706; }
.ib-status button.is-closed.is-active { color: #16a34a; }
.ib-messages { flex: 1; overflow-y: auto; padding: 20px 24px; display: flex; flex-direction: column; gap: 6px; }
.ib-day { text-align: center; margin: 10px 0; }
.ib-day span { font-size: 11px; font-weight: 600; color: var(--ib-muted); background: var(--white, #fff); border: 1px solid var(--ib-line); padding: 3px 10px; border-radius: 999px; }
.ib-msg { display: flex; }
.ib-msg--out { justify-content: flex-end; }
.ib-bubble {
    max-width: min(72%, 560px); padding: 9px 13px 6px; border-radius: 16px; font-size: 14px; line-height: 1.45;
    background: var(--white, #fff); border: 1px solid var(--ib-line); color: var(--text-primary-light, #111827);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.ib-msg--in .ib-bubble { border-end-start-radius: 4px; }
.ib-msg--out .ib-bubble { background: linear-gradient(135deg, #6366F1, #4F46E5); border-color: transparent; color: #fff; border-end-end-radius: 4px; }
.ib-bubble p { margin: 0; white-space: pre-wrap; word-break: break-word; }
.ib-bubble__agent { display: block; font-size: 11px; font-weight: 700; opacity: .8; margin-bottom: 2px; }
.ib-bubble__meta { display: flex; justify-content: flex-end; align-items: center; gap: 4px; font-size: 11px; opacity: .7; margin-top: 2px; }
.ib-msg--out .ib-bubble__meta .is-read { color: #A5F3FC; opacity: 1; }
.ib-msg.is-failed .ib-bubble { background: #FEF2F2; color: #991B1B; border: 1px solid #FCA5A5; }
.ib-notice { padding: 8px 20px; font-size: 13px; background: #FFFBEB; color: #B45309; border-top: 1px solid #FDE68A; }
.ib-composer { display: flex; align-items: flex-end; gap: 10px; padding: 12px 16px 4px; background: var(--white, #fff); border-top: 1px solid var(--ib-line); }
.ib-composer textarea {
    flex: 1; resize: none; border: 1px solid var(--ib-line); background: var(--ib-soft); border-radius: 14px; padding: 11px 14px;
    font-size: 14px; line-height: 1.4; max-height: 160px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.ib-composer textarea:focus { border-color: var(--primary-600); box-shadow: 0 0 0 4px rgba(79, 70, 229, .12); background: var(--white, #fff); }
.ib-send {
    width: 44px; height: 44px; border-radius: 50%; border: 0; flex-shrink: 0; color: #fff; font-size: 18px;
    background: linear-gradient(135deg, #6366F1, #4F46E5); box-shadow: 0 6px 16px rgba(79, 70, 229, .35);
    display: inline-flex; align-items: center; justify-content: center; transition: transform .1s;
}
.ib-send:active { transform: scale(.94); }
.ib-send:disabled { opacity: .6; }
.ib-composer-hint { font-size: 11px; color: var(--ib-muted); padding: 2px 20px 10px; background: var(--white, #fff); }
.ib-placeholder { margin: auto; text-align: center; padding: 24px; max-width: 360px; }
.ib-placeholder__icon {
    width: 88px; height: 88px; border-radius: 28px; display: inline-flex; align-items: center; justify-content: center; font-size: 44px;
    color: var(--primary-600); background: var(--primary-50, #eef2ff); margin-bottom: 16px;
}
.ib-placeholder h2 { font-size: 18px !important; font-weight: 700; margin-bottom: 6px; }
.ib-placeholder p { color: var(--ib-muted); font-size: 14px; margin: 0; }

/* contact & lead */
.ib-side { min-height: 0; border-inline-start: 1px solid var(--ib-line); overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.ib-side__card { border: 1px solid var(--ib-line); border-radius: 16px; padding: 16px; background: var(--white, #fff); }
.ib-side__name { font-size: 16px !important; font-weight: 700; margin: 0 0 8px; }
.ib-side__title { font-size: 12px !important; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ib-muted); margin: 0 0 12px; }
.ib-facts { list-style: none; padding: 0; margin: 14px 0 0; text-align: start; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.ib-facts li { display: flex; gap: 8px; align-items: center; min-width: 0; }
.ib-facts li i { color: var(--primary-600); font-size: 16px; flex-shrink: 0; }
.ib-facts li a, .ib-facts li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib-lead { background: var(--ib-soft); border-radius: 12px; padding: 12px; font-size: 14px; }
.ib-lead__value { font-size: 20px; font-weight: 800; color: var(--primary-600); }
.ib-related { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; text-decoration: none; color: inherit; }
.ib-related:hover { background: var(--ib-soft); }
.ib-related__icon {
    --ch: var(--primary-600); width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
    color: var(--ch); background: color-mix(in srgb, var(--ch) 12%, transparent); font-size: 17px;
}

/* dark theme */
[data-theme=dark] .ib { box-shadow: none; }
[data-theme=dark] .ib-msg--in .ib-bubble { background: var(--neutral-100); }

/* responsive */
@media (max-width: 1699px) {
    .ib--open { grid-template-columns: 72px 300px minmax(0, 1fr) 280px; }
    .ib--open .ib-status span { display: none; }
    .ib--open .ib-status button { padding: 6px 8px; font-size: 15px; }
}
@media (max-width: 1399px) {
    .ib--open { grid-template-columns: 72px 300px minmax(0, 1fr); }
    .ib--open .ib-side { display: none; }
    .ib-side-toggle { display: inline-flex; }
    .ib--open.ib--side { grid-template-columns: 72px 300px minmax(0, 1fr) 290px; }
    .ib--open.ib--side .ib-side { display: flex; }
}
@media (max-width: 991px) {
    .ib { grid-template-columns: 60px 1fr; height: calc(100vh - 120px); }
    .ib--open, .ib--open.ib--side { grid-template-columns: 1fr; }
    .ib-rail__btn { width: 42px; height: 42px; font-size: 21px; }
    .ib-rail__btn[data-tip]::after, .ib-rail__btn[data-tip]::before { display: none; }
    .ib--open .ib-list, .ib--open .ib-rail { display: none; }
    .ib:not(.ib--open) .ib-chat { display: none; }
    .ib-back { display: inline-flex; }
    .ib-status span { display: none; }
    .ib--open.ib--side { grid-template-columns: 1fr; }
    .ib--open.ib--side .ib-chat { display: none; }
    .ib-bubble { max-width: 85%; }
}

/* ---------- Channel cards ---------- */
.oc-channel-logo {
    width: 52px; height: 52px; border-radius: 14px; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 28px; color: #fff;
}
.oc-channel-card.is-disabled { opacity: .6; }

/* ---------- Code blocks ---------- */
.oc-code {
    position: relative; background: #0f172a; color: #e2e8f0; border-radius: 12px;
    padding: 16px; font-size: 12.5px; line-height: 1.6; overflow-x: auto; white-space: pre; margin: 0;
}
.oc-code-wrap { position: relative; }
.oc-code-wrap .oc-copy {
    position: absolute; top: 8px; inset-inline-end: 8px; z-index: 1;
    padding: 2px 10px; border-radius: 6px; font-size: 12px;
    background: rgba(255, 255, 255, .12); color: #fff;
}

/* ---------- Timeline ---------- */
.oc-timeline { list-style: none; margin: 0; padding: 0; }
.oc-timeline li { position: relative; padding-inline-start: 36px; padding-bottom: 20px; }
.oc-timeline li::before {
    content: ""; position: absolute; inset-inline-start: 13px; top: 30px; bottom: 0;
    width: 2px; background: var(--neutral-200);
}
.oc-timeline li:last-child::before { display: none; }
.oc-timeline__icon {
    position: absolute; inset-inline-start: 0; top: 0; width: 28px; height: 28px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center; font-size: 14px;
    background: var(--primary-50, #eef2ff); color: var(--primary-600);
}

/* ---------- Brand buttons (theme leaves .btn-primary as Bootstrap blue) ---------- */
.btn-primary {
    --bs-btn-bg: var(--primary-600);
    --bs-btn-border-color: var(--primary-600);
    --bs-btn-hover-bg: #4338CA;
    --bs-btn-hover-border-color: #4338CA;
    --bs-btn-active-bg: #3730A3;
    --bs-btn-active-border-color: #3730A3;
    --bs-btn-disabled-bg: var(--primary-600);
    --bs-btn-disabled-border-color: var(--primary-600);
    --bs-btn-focus-shadow-rgb: 79, 70, 229;
}
.btn-outline-primary {
    --bs-btn-color: var(--primary-600);
    --bs-btn-border-color: var(--primary-600);
    --bs-btn-hover-bg: var(--primary-600);
    --bs-btn-hover-border-color: var(--primary-600);
    --bs-btn-active-bg: #4338CA;
    --bs-btn-active-border-color: #4338CA;
    --bs-btn-focus-shadow-rgb: 79, 70, 229;
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary-600);
    box-shadow: 0 0 0 .2rem rgba(79, 70, 229, .15);
}
.form-check-input:checked { background-color: var(--primary-600); border-color: var(--primary-600); }

/* ---------- Brand (wordmark) ---------- */
.oc-brand { display: inline-flex; align-items: center; gap: 10px; line-height: 1; }
.oc-brand__icon { width: 36px; height: 36px; flex-shrink: 0; }
.oc-brand__text { font-size: 20px; font-weight: 700; letter-spacing: -.02em; color: var(--text-primary-light, #111827); }
.oc-brand__text span { color: var(--primary-600); }
.oc-brand--lg .oc-brand__icon { width: 44px; height: 44px; }
.oc-brand--lg .oc-brand__text { font-size: 26px; }
[data-theme=dark] .oc-brand__text { color: #fff; }
[data-theme=dark] .oc-brand__text span { color: #A5B4FC; }

/* Sidebar logo: wordmark in the panel head, icon in the rail */
.twin-panel__logo { text-decoration: none; }
.twin-panel__logo .oc-brand__icon { display: none; }
.twin-rail__brand img { width: 40px; height: 40px; }

/* ---------- Auth ---------- */
/* Language chips stay in the flow (top-end of the form column) so they never overlap on small screens */
.oc-auth-lang { align-self: flex-end; width: max-content; margin-inline-start: auto; }
.oc-auth .auth-right > .max-w-464-px { margin-top: auto; margin-bottom: auto; padding-top: 24px; }
.oc-auth-lang .oc-lang-code.is-active { background: var(--primary-600); color: #fff; }

.oc-auth-hero {
    align-items: center; justify-content: center; padding: 48px 40px;
    background:
        radial-gradient(circle at 15% 10%, rgba(99, 102, 241, .14), transparent 45%),
        radial-gradient(circle at 90% 90%, rgba(34, 197, 94, .10), transparent 40%),
        linear-gradient(135deg, #ECF0FF 0%, #F5F3FF 55%, #FAFBFF 100%);
}
.oc-auth-hero__inner { max-width: 560px; width: 100%; text-align: center; }
.oc-auth-hero__art { width: 100%; max-width: 520px; height: auto; margin: 0 auto 28px; display: block; }
.oc-auth-hero__title { font-size: 28px !important; /* theme forces h2 size with !important */ font-weight: 700; letter-spacing: -.02em; margin-bottom: 12px; color: #111827; }
.oc-auth-hero__text { font-size: 16px; line-height: 1.6; color: #4B5563; margin: 0 auto 24px; max-width: 480px; }
.oc-auth-hero__features { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 0; padding: 0; list-style: none; }
.oc-auth-hero__features li {
    display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
    background: rgba(255, 255, 255, .8); color: #312E81; font-size: 14px; font-weight: 600;
    box-shadow: 0 4px 12px rgba(49, 46, 129, .08);
}
.oc-auth-hero__features i { color: var(--primary-600); font-size: 18px; }

[data-theme=dark] .oc-auth-hero {
    background:
        radial-gradient(circle at 15% 10%, rgba(99, 102, 241, .28), transparent 45%),
        radial-gradient(circle at 90% 90%, rgba(34, 197, 94, .12), transparent 40%),
        linear-gradient(135deg, #111827 0%, #1E1B4B 60%, #111827 100%);
}
[data-theme=dark] .oc-auth-hero__title { color: #fff; }
[data-theme=dark] .oc-auth-hero__text { color: #CBD5E1; }
[data-theme=dark] .oc-auth-hero__features li { background: rgba(255, 255, 255, .08); color: #E0E7FF; box-shadow: none; }
[data-theme=dark] .oc-auth-hero__features i { color: #A5B4FC; }

/* ---------- System panel ---------- */
.oc-system-badge {
    display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
    background: #1E1B4B; color: #E0E7FF; font-size: 12px; font-weight: 600; letter-spacing: .02em;
}
.oc-system-badge i { color: #A5B4FC; }
.oc-avatar--system { background: #1E1B4B; color: #E0E7FF; }
.workspace-card--system { background: #1E1B4B; }
.workspace-card--system .workspace-card__icon { background: rgba(165, 180, 252, .18); color: #A5B4FC; }
.workspace-card--system .workspace-card__name { color: #fff; }
.workspace-card--system .workspace-card__domain { color: #A5B4FC; }
.oc-kpi-link { transition: transform .15s, box-shadow .15s; }
.oc-kpi-link:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(17, 24, 39, .06); }
.oc-svc {
    display: inline-flex; align-items: center; gap: 4px; height: 28px; min-width: 28px; padding: 0 7px;
    border-radius: 8px; font-size: 15px; font-weight: 600;
    background: color-mix(in srgb, var(--chip) 14%, transparent); color: var(--chip);
}
.oc-svc.is-requested { background: transparent; outline: 2px dashed color-mix(in srgb, var(--chip) 55%, transparent); outline-offset: -2px; }
.oc-note-card { background: #FFFBEB; }
[data-theme=dark] .oc-note-card { background: rgba(245, 158, 11, .08); }
.oc-impersonation {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    padding: 10px 24px; background: #1E1B4B; color: #E0E7FF; font-size: 14px; font-weight: 500;
}
.oc-check-card {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; cursor: pointer;
    border: 1px solid var(--neutral-200); background: var(--white); font-size: 14px; font-weight: 500; height: 100%;
}
.oc-check-card i { font-size: 20px; }
.oc-check-card:has(input:checked) { border-color: var(--primary-600); background: color-mix(in srgb, var(--primary-600) 6%, transparent); }
.oc-check-card input { accent-color: var(--primary-600); }
.oc-service-active { box-shadow: inset 0 0 0 2px color-mix(in srgb, #16a34a 35%, transparent); }

.oc-sys-login {
    min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
    background: radial-gradient(circle at 20% 10%, rgba(99, 102, 241, .35), transparent 45%), linear-gradient(135deg, #0F172A, #1E1B4B);
}
.oc-sys-login__card { width: 100%; max-width: 440px; background: var(--white); border-radius: 24px; padding: 36px; box-shadow: 0 24px 60px rgba(0, 0, 0, .35); }

/* ---------- Website CMS editor ---------- */
.oc-editor { min-height: 360px; background: var(--white); }
.oc-editor .ql-editor { min-height: 340px; font-size: 16px; line-height: 1.7; }
.oc-editor .ql-editor h2 { font-size: 24px !important; margin: 20px 0 8px; }
.oc-editor .ql-editor h3 { font-size: 19px !important; margin: 16px 0 6px; }
.ql-toolbar.ql-snow { border-radius: 10px 10px 0 0; border-color: var(--neutral-200); background: var(--neutral-50); }
.ql-container.ql-snow { border-radius: 0 0 10px 10px; border-color: var(--neutral-200); }
.oc-faq-row { position: relative; padding: 14px 44px 14px 14px; border-radius: 12px; background: var(--neutral-50); }
.oc-faq-row__remove { position: absolute; top: 12px; inset-inline-end: 12px; width: 28px; height: 28px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; color: var(--danger-600, #dc2626); background: var(--white); }
.oc-counter { font-weight: 500; color: var(--text-secondary-light, #6b7280); font-size: 12px; }
.oc-counter.is-ok { color: #16a34a; }
.oc-counter.is-warn { color: #d97706; }
.oc-serp { padding: 16px; border-radius: 12px; border: 1px solid var(--neutral-200); background: var(--white); font-family: Arial, sans-serif; }
.oc-serp__url { font-size: 12px; color: #4d5156; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.oc-serp__title { font-size: 19px; color: #1a0dab; line-height: 1.3; margin: 2px 0 4px; }
.oc-serp__desc { font-size: 13.5px; color: #4d5156; line-height: 1.5; }
[data-theme=dark] .oc-serp__title { color: #8ab4f8; }
[data-theme=dark] .oc-serp__url, [data-theme=dark] .oc-serp__desc { color: #bdc1c6; }
.oc-seo-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13px; }
.oc-seo-checks li { display: flex; gap: 8px; align-items: flex-start; color: var(--text-secondary-light, #6b7280); }
.oc-seo-checks li i { color: #fca5a5; font-size: 12px; margin-top: 4px; }
.oc-seo-checks li.is-ok { color: var(--text-primary-light, #111827); }
.oc-seo-checks li.is-ok i { color: #16a34a; }
.oc-image-field { display: flex; align-items: center; gap: 12px; }
.oc-image-field__preview { width: 96px; height: 60px; flex-shrink: 0; border-radius: 10px; border: 1px dashed var(--neutral-300, #d1d5db); background: var(--neutral-50) center / cover no-repeat; display: inline-flex; align-items: center; justify-content: center; font-size: 22px; color: var(--text-secondary-light, #9ca3af); }
.oc-media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.oc-media-item { aspect-ratio: 4 / 3; border-radius: 12px; border: 2px solid transparent; background: var(--neutral-100) center / cover no-repeat; }
.oc-media-item:hover { border-color: var(--primary-600); }
.oc-media-card { border-radius: 16px; overflow: hidden; background: var(--white); }
.oc-media-card__img { aspect-ratio: 4 / 3; background: var(--neutral-100) center / cover no-repeat; display: block; }

/* ---------- Live chat settings + preview ---------- */
.oc-swatch { width: 28px; height: 28px; border-radius: 8px; border: 2px solid var(--white); box-shadow: 0 0 0 1px var(--neutral-200); }
.oc-install-card { border: 2px dashed color-mix(in srgb, var(--primary-600) 30%, transparent) !important; }
.oc-lc-stage {
    position: relative; height: 560px; border-radius: 20px; overflow: hidden; padding: 24px;
    background: linear-gradient(135deg, #F8FAFC, #EEF2FF); border: 1px solid var(--neutral-200);
}
.oc-lc-site span { display: block; height: 12px; border-radius: 6px; background: #E2E8F0; margin-bottom: 12px; }
.oc-lc-site span:first-child { height: 28px; width: 60%; margin-bottom: 20px; }
.oc-lc-panel {
    position: absolute; bottom: 92px; right: 20px; width: 300px; border-radius: 18px; overflow: hidden;
    background: #fff; box-shadow: 0 20px 50px rgba(15, 23, 42, .22); font-size: 14px; color: #111827;
}
.oc-lc-stage[data-position=left] .oc-lc-panel { right: auto; left: 20px; }
.oc-lc-head { display: flex; gap: 10px; align-items: center; padding: 16px; background: var(--lc); color: #fff; }
.oc-lc-head strong { display: block; font-size: 15px; }
.oc-lc-head small { display: block; opacity: .85; font-size: 12px; }
.oc-lc-avatar { width: 36px; height: 36px; border-radius: 50%; background: rgba(255, 255, 255, .2); display: inline-flex; align-items: center; justify-content: center; font-size: 20px; }
.oc-lc-body { padding: 14px; min-height: 180px; background: #F8FAFC; display: flex; flex-direction: column; gap: 8px; }
.oc-lc-msg { max-width: 85%; padding: 9px 12px; border-radius: 14px; line-height: 1.45; white-space: pre-wrap; }
.oc-lc-msg--agent { background: #fff; border: 1px solid #E5E7EB; border-bottom-left-radius: 4px; }
.oc-lc-msg--visitor { align-self: flex-end; background: var(--lc); color: #fff; border-bottom-right-radius: 4px; }
.oc-lc-prechat { background: #fff; border: 1px solid #E5E7EB; border-radius: 14px; padding: 12px; display: grid; gap: 8px; }
.oc-lc-prechat p { margin: 0; font-size: 13px; color: #4B5563; }
.oc-lc-input { display: block; padding: 8px 10px; border: 1px solid #E5E7EB; border-radius: 10px; color: #9CA3AF; font-size: 13px; }
.oc-lc-btn { display: block; text-align: center; padding: 8px; border-radius: 10px; background: var(--lc); color: #fff; font-weight: 600; font-size: 13px; }
.oc-lc-composer { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-top: 1px solid #E5E7EB; color: #9CA3AF; }
.oc-lc-composer i { color: var(--lc); font-size: 20px; }
.oc-lc-launcher {
    position: absolute; bottom: 20px; right: 20px; width: 56px; height: 56px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center; background: var(--lc); color: #fff; font-size: 28px;
    box-shadow: 0 10px 24px color-mix(in srgb, var(--lc) 45%, transparent);
}
.oc-lc-stage[data-position=left] .oc-lc-launcher { right: auto; left: 20px; }

/* ---------- PWA ---------- */
.oc-pwa-banner {
    display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin-bottom: 20px; border-radius: 16px;
    background: linear-gradient(110deg, #EEF2FF, #F5F3FF); border: 1px solid #E0E7FF;
}
.oc-pwa-banner.d-none { display: none !important; }
.oc-pwa-banner img { border-radius: 12px; flex-shrink: 0; }
.oc-pwa-banner__text { flex: 1; min-width: 0; font-size: 14px; color: var(--text-secondary-light, #4b5563); }
.oc-pwa-banner__text strong { display: block; color: var(--text-primary-light, #111827); font-size: 15px; }
.oc-pwa-banner__text i { color: var(--primary-600); font-size: 16px; vertical-align: -2px; }
.oc-pwa-banner__close { width: 32px; height: 32px; flex-shrink: 0; border-radius: 10px; color: var(--text-secondary-light, #6b7280); background: transparent; }
.oc-pwa-banner__close:hover { background: rgba(255, 255, 255, .7); }
[data-theme=dark] .oc-pwa-banner { background: rgba(99, 102, 241, .12); border-color: rgba(99, 102, 241, .25); }
@media (max-width: 575px) { .oc-pwa-banner { flex-wrap: wrap; } .oc-pwa-banner [data-pwa-install] { width: 100%; } }

/* Installed app (standalone): respect notches / home indicator */
@media (display-mode: standalone) {
    .navbar-header { padding-top: calc(1rem + env(safe-area-inset-top)); height: auto; min-height: 4.5rem; }
    .twin-sidebar { padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
    .d-footer { padding-bottom: calc(1.375rem + env(safe-area-inset-bottom)); }
    .twin-mobile-toggle { top: calc(16px + env(safe-area-inset-top)); }
}
html.is-standalone body { overscroll-behavior-y: none; }

/* ---------- Dark mode tweaks ---------- */
[data-theme=dark] .oc-column { background: var(--white); }
[data-theme=dark] .oc-card { background: var(--neutral-50); }
[data-theme=dark] .workspace-card { background: rgba(255, 255, 255, .04); }

/* =====================================================================
   RTL support (for customers who enable an RTL language).
   The theme's twin sidebar uses physical left/right in a few places.
   ===================================================================== */
[dir=rtl] .twin-rail { border-right: 0; border-left: 1px solid var(--ts-border); }
[dir=rtl] .rail-icon .rail-tip { left: auto; right: calc(100% + 12px); transform-origin: right center; }
[dir=rtl] .twin-mobile-toggle { left: auto; right: 16px; }
[dir=rtl] .dashboard-main { transition: margin-right .25s ease; }
[dir=rtl] body.twin-collapsed .dashboard-main { margin-left: 0; margin-right: var(--ts-rail-w); }
[dir=rtl] .twin-collapse .icon { transform: scaleX(-1); }
@media (max-width: 1199px) {
    [dir=rtl] .twin-sidebar { transform: translateX(100%); }
    [dir=rtl] .twin-sidebar.is-open { transform: none; }
    [dir=rtl] .dashboard-main,
    [dir=rtl] body.twin-collapsed .dashboard-main { margin-right: 0; }
}
[dir=rtl] .ph-arrow-right, [dir=rtl] .ph-caret-right, [dir=rtl] .ph-arrow-left { transform: scaleX(-1); }

/* ---------- Plan & credits ---------- */
.oc-feature-pill {
    display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
    font-size: 12px; font-weight: 500; background: var(--neutral-50); border: 1px solid var(--neutral-200);
}
.oc-feature-pill i { font-size: 15px; }
.oc-credit-balance {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; border-radius: 16px;
    color: #fff; background: linear-gradient(135deg, #6366F1, #4338CA);
}
.oc-credit-balance span { font-weight: 500; opacity: .9; display: flex; align-items: center; gap: 6px; }
.oc-credit-balance strong { font-size: 28px; line-height: 1; }
.oc-package { display: flex; align-items: center; gap: 12px; }
/* ---------- Settings hub & menu sub-headings ---------- */
.twin-menu__sub { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-secondary-light, #9ca3af); padding: 14px 16px 4px; list-style: none; }
.oc-setting-card {
    display: flex; align-items: center; gap: 14px; height: 100%; padding: 18px; border-radius: 18px; text-decoration: none;
    background: var(--white, #fff); border: 1px solid var(--neutral-200); transition: border-color .15s, box-shadow .15s, transform .15s;
}
.oc-setting-card:hover { border-color: var(--primary-600); box-shadow: 0 8px 24px rgba(79, 70, 229, .12); transform: translateY(-1px); }
.oc-setting-card__icon {
    width: 46px; height: 46px; border-radius: 14px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
    font-size: 23px; color: var(--primary-600); background: var(--primary-50, #eef2ff);
}
.oc-setting-card__title { display: block; font-weight: 700; font-size: 15px; color: var(--text-primary-light, #111827); }
.oc-setting-card__hint { display: block; font-size: 12px; color: var(--text-secondary-light, #6b7280); line-height: 1.4; margin-top: 2px; }
.oc-setting-card__arrow { margin-inline-start: auto; color: var(--text-secondary-light, #9ca3af); }

.oc-attr { background: var(--neutral-50); border-radius: 12px; padding: 12px; }
.oc-attr__list { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; font-size: 13px; }
.oc-attr__list dt { color: var(--text-secondary-light, #6b7280); font-weight: 500; }
.oc-attr__list dd { margin: 0; word-break: break-word; }
.oc-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.oc-flow__step {
    display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 12px; font-size: 13px; font-weight: 600;
    background: var(--white, #fff); border: 1px solid var(--neutral-200); color: var(--text-primary-light, #111827); text-decoration: none;
}
.oc-flow__step i { font-size: 18px; color: var(--primary-600); }
.oc-flow__step--target { border-color: var(--primary-600); background: var(--primary-50, #eef2ff); color: var(--primary-600); }
.oc-flow__arrow { color: var(--text-secondary-light, #9ca3af); }

/* ---------- Social media: content calendar ---------- */
.sp-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--neutral-200); border-inline-start: 1px solid var(--neutral-200); border-radius: 14px; overflow: hidden; }
.sp-cal__wd { padding: 8px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--text-secondary-light, #6b7280); background: var(--neutral-50); border-inline-end: 1px solid var(--neutral-200); border-bottom: 1px solid var(--neutral-200); text-align: center; }
.sp-cal__day { min-height: 118px; padding: 6px; border-inline-end: 1px solid var(--neutral-200); border-bottom: 1px solid var(--neutral-200); display: flex; flex-direction: column; gap: 4px; min-width: 0; position: relative; }
.sp-cal__day.is-other { background: var(--neutral-50); }
.sp-cal__day.is-other .sp-cal__num span { opacity: .45; }
.sp-cal__num { display: flex; align-items: center; justify-content: space-between; font-size: 13px; font-weight: 600; }
.sp-cal__day.is-today .sp-cal__num span { background: var(--primary-600); color: #fff; border-radius: 999px; min-width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; }
.sp-cal__add { width: 22px; height: 22px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; color: var(--primary-600); background: var(--primary-50, #eef2ff); opacity: 0; transition: opacity .12s; text-decoration: none; }
.sp-cal__day:hover .sp-cal__add { opacity: 1; }
.sp-cal__more { font-size: 11px; color: var(--text-secondary-light, #6b7280); padding-inline-start: 4px; }
.sp-chip {
    --st: #4F46E5; display: flex; align-items: center; gap: 4px; padding: 3px 6px; border-radius: 7px; font-size: 11px; line-height: 1.3;
    background: color-mix(in srgb, var(--st) 10%, transparent); border-inline-start: 3px solid var(--st); color: var(--text-primary-light, #111827);
    text-decoration: none; min-width: 0;
}
.sp-chip:hover { background: color-mix(in srgb, var(--st) 18%, transparent); color: inherit; }
.sp-chip__time { font-weight: 700; color: var(--st); flex-shrink: 0; }
.sp-chip__icons { display: inline-flex; gap: 1px; flex-shrink: 0; color: var(--text-secondary-light, #6b7280); }
.sp-chip__text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.sp-thumb { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; flex-shrink: 0; }
.sp-thumb--lg { width: 96px; height: 96px; }
.sp-thumb--empty { display: inline-flex; align-items: center; justify-content: center; background: var(--neutral-50); color: var(--text-secondary-light, #6b7280); font-size: 18px; }
.sp-acc {
    --ch: #4F46E5; position: relative; width: 38px; height: 38px; border-radius: 12px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
    font-size: 19px; color: var(--ch); background: color-mix(in srgb, var(--ch) 12%, transparent);
}
.sp-acc img { width: 100%; height: 100%; border-radius: 12px; object-fit: cover; }
.sp-acc__badge { position: absolute; inset-inline-end: -4px; bottom: -4px; width: 18px; height: 18px; border-radius: 50%; color: #fff; font-size: 10px; display: inline-flex; align-items: center; justify-content: center; border: 2px solid var(--white, #fff); }
.sp-preview { border: 1px solid var(--neutral-200); border-radius: 14px; padding: 14px; }
.sp-preview__head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.sp-preview__text { white-space: pre-wrap; word-break: break-word; font-size: 14px; margin-bottom: 10px; min-height: 20px; }
.sp-preview__img { width: 100%; border-radius: 10px; max-height: 360px; object-fit: cover; }
/* dashboard week strip */
.sp-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.sp-week__day { background: var(--neutral-50); border-radius: 14px; padding: 8px; min-height: 150px; display: flex; flex-direction: column; gap: 4px; min-width: 0; border: 1px solid transparent; }
.sp-week__day.is-today { border-color: var(--primary-600); background: var(--primary-50, #eef2ff); }
.sp-week__head { display: flex; flex-direction: column; align-items: center; margin-bottom: 4px; }
.sp-week__head span { font-size: 11px; text-transform: uppercase; color: var(--text-secondary-light, #6b7280); font-weight: 600; }
.sp-week__head strong { font-size: 18px; line-height: 1.2; }
.sp-week__add { margin-top: auto; align-self: center; width: 26px; height: 26px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; color: var(--primary-600); background: var(--white, #fff); text-decoration: none; opacity: .6; }
.sp-week__add:hover { opacity: 1; }
@media (max-width: 767px) {
    .sp-cal__day { min-height: 70px; }
    .sp-chip__text, .sp-chip__icons { display: none; }
    .sp-week { grid-template-columns: repeat(7, 120px); overflow-x: auto; }
}

.oc-phone-group { flex-wrap: nowrap; }
.oc-phone-group .form-select { max-width: 132px; flex: 0 0 132px; text-overflow: ellipsis; }
.oc-suggest-card { border: 1px solid var(--warning-200, #fde68a) !important; background: linear-gradient(180deg, #FFFBEB 0%, var(--white, #fff) 70%); }
[data-theme=dark] .oc-suggest-card { background: var(--white); }

/* Live counters (inbox polling): hidden when zero */
[data-live-badge][hidden], [data-rail-badge][hidden], [data-list-count][hidden] { display: none !important; }

/* Live chat: "chat ended" marker under the messages */
.ib-ended { text-align: center; padding: 6px 16px 10px; }
.ib-ended span { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--ib-muted); background: var(--ib-soft); border: 1px dashed var(--ib-line); padding: 4px 12px; border-radius: 999px; }
[data-oc-sound].is-off { opacity: .55; }
