/* ============================================================================
   Brokerr Social Inbox — elite messaging surface.
   Reference bar: Superhuman / Front / Linear. Built on Brokerr tokens
   (teal --color-secondary, navy --color-primary). Craft over flash.
   ========================================================================== */

:root {
  --inbox-wa: #25D366;
  --inbox-li: #0A66C2;
  --inbox-ig: #E1306C;
  --ink: #101828;
  --ink-2: #344054;
  --muted: #667085;
  --faint: #98A2B3;
  --line: #EAECF0;
  --line-2: #F2F4F7;
  --teal: var(--color-secondary, #0D9488);
  --teal-d: #0B7F76;
  --wash: #F6F8FA;
  --sh-xs: 0 1px 2px rgba(16,24,40,.05);
  --sh-sm: 0 1px 3px rgba(16,24,40,.08), 0 1px 2px rgba(16,24,40,.04);
  --sh-md: 0 4px 12px -2px rgba(16,24,40,.10), 0 2px 6px -2px rgba(16,24,40,.06);
  --sh-lg: 0 20px 48px -16px rgba(16,24,40,.30);
  --sh-teal: 0 2px 6px rgba(13,148,136,.35), 0 8px 20px -6px rgba(13,148,136,.5);
}

/* Full-bleed: inbox owns the viewport height; only the message list scrolls. */
.page-container:has(.inbox) { padding: 0 !important; height: 100vh; overflow: hidden; }

.inbox {
  height: 100vh; display: flex; flex-direction: column; padding: 22px 26px 22px; box-sizing: border-box;
  background:
    radial-gradient(90% 60% at 100% -10%, rgba(13,148,136,.06), transparent 55%),
    radial-gradient(70% 50% at -5% 110%, rgba(27,42,74,.05), transparent 55%),
    linear-gradient(180deg, #F7F9FB, #F2F5F8);
  font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased;
}

/* ---------- header ---------- */
.inbox-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-shrink: 0; }
.inbox-title { font-size: 21px; font-weight: 780; letter-spacing: -.025em; color: var(--ink); margin: 0; display: flex; align-items: center; gap: 10px; }
.inbox-title-badge { font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--teal); background: rgba(13,148,136,.1); padding: 3px 8px; border-radius: 6px; }
.inbox-subtitle { font-size: 12.5px; color: var(--muted); margin: 3px 0 0; }
.inbox-header-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.inbox-accounts-pill { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border: 1px solid var(--line); background: rgba(255,255,255,.8); backdrop-filter: blur(8px); border-radius: 10px; font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; box-shadow: var(--sh-xs); transition: border-color .15s, box-shadow .15s; }
.inbox-accounts-pill:hover { border-color: #D0D5DD; box-shadow: var(--sh-sm); }
.inbox-accounts-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--inbox-wa); box-shadow: 0 0 0 3px rgba(37,211,102,.18); animation: inbox-pulse 2.4s ease-in-out infinite; }
@keyframes inbox-pulse { 0%,100% { box-shadow: 0 0 0 3px rgba(37,211,102,.18); } 50% { box-shadow: 0 0 0 5px rgba(37,211,102,.05); } }
.inbox-connect-btn { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 16px; border: none; border-radius: 10px; cursor: pointer; font-size: 13px; font-weight: 650; color: #fff; background: linear-gradient(180deg, #14B0A0, var(--teal)); box-shadow: var(--sh-teal); transition: transform .12s cubic-bezier(.2,.9,.3,1), box-shadow .15s, filter .15s; }
.inbox-connect-btn:hover { transform: translateY(-1px); filter: brightness(1.04); }
.inbox-connect-btn:active { transform: translateY(0); }
.inbox-connect-btn svg { width: 15px; height: 15px; }

/* ---------- provider badges ---------- */
.inbox-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--line-2); color: var(--ink-2); }
.inbox-badge--wa { background: rgba(37,211,102,.13); color: #128C4A; }
.inbox-badge--li { background: rgba(10,102,194,.12); color: var(--inbox-li); }
.inbox-badge--ig { background: rgba(225,48,108,.12); color: var(--inbox-ig); }

/* ---------- body / panes ---------- */
.inbox-body { flex: 1; min-height: 0; display: flex; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: #fff; box-shadow: var(--sh-md), 0 0 0 1px rgba(255,255,255,.6) inset; }
.inbox-loading { padding: 40px; color: var(--muted); }

.inbox-list { width: 462px; flex-shrink: 0; display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: linear-gradient(180deg, #FCFDFE, #FAFBFC); }

/* search + filters */
.inbox-list-head { padding: 12px 12px 8px; border-bottom: 1px solid var(--line-2); flex-shrink: 0; }
.inbox-search { position: relative; margin-bottom: 10px; }
.inbox-search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--faint); pointer-events: none; }
.inbox-search input { width: 100%; height: 36px; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 0 12px 0 34px; font-size: 13px; color: var(--ink); box-sizing: border-box; transition: border-color .15s, box-shadow .15s; }
.inbox-search input::placeholder { color: var(--faint); }
.inbox-search input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(13,148,136,.1); }
.inbox-filters { display: flex; flex-direction: column; gap: 10px; }
.inbox-chip { border: 1px solid var(--line); background: #fff; color: var(--ink-2); font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 999px; cursor: pointer; transition: all .14s; }
.inbox-chip:hover { border-color: #CBD2DA; color: var(--ink); }
.inbox-chip.is-active { background: var(--ink); border-color: var(--ink); color: #fff; box-shadow: var(--sh-xs); }

/* filters — segmented status control + compact channel icons */
.inbox-seg { display: flex; background: #EDF0F3; border-radius: 11px; padding: 3px; gap: 2px; }
.inbox-seg-btn { flex: 1; border: none; background: none; padding: 7px 4px; font-size: 12px; font-weight: 640; letter-spacing: -.01em; color: var(--muted); border-radius: 8px; cursor: pointer; transition: color .14s, background .14s, box-shadow .14s; }
.inbox-seg-btn:hover { color: var(--ink); }
.inbox-seg-btn.is-active { background: #fff; color: var(--ink); font-weight: 720; box-shadow: 0 1px 2px rgba(16,24,40,.08), 0 0 0 1px rgba(16,24,40,.03); }
.inbox-channels { display: flex; align-items: center; gap: 6px; }
.inbox-channels > * { flex: 1; }
.inbox-ch-all { border: 1px solid var(--line); background: #fff; color: var(--ink-2); font-size: 12px; font-weight: 650; padding: 6px 13px; border-radius: 9px; cursor: pointer; transition: all .14s; }
.inbox-ch-all:hover { border-color: #CBD2DA; }
.inbox-ch-all.is-active { background: var(--ink); border-color: var(--ink); color: #fff; box-shadow: var(--sh-xs); }
.inbox-ch-btn { height: 31px; border: 1px solid var(--line); background: #fff; border-radius: 9px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: #98A2B3; transition: all .14s; }
.inbox-ch-btn svg { width: 16px; height: 16px; }
.inbox-ch-btn:hover { border-color: #CBD2DA; color: var(--ink-2); }
.inbox-ch-btn.wa.is-active { background: rgba(37,211,102,.14); border-color: transparent; color: #128C4A; box-shadow: var(--sh-xs); }
.inbox-ch-btn.li.is-active { background: rgba(10,102,194,.12); border-color: transparent; color: var(--inbox-li); box-shadow: var(--sh-xs); }
.inbox-ch-btn.ig.is-active { background: rgba(225,48,108,.12); border-color: transparent; color: var(--inbox-ig); box-shadow: var(--sh-xs); }

/* thread list */
.inbox-threads { flex: 1; overflow-y: auto; min-height: 0; padding: 6px; }
.inbox-threads::-webkit-scrollbar, .inbox-messages::-webkit-scrollbar { width: 10px; }
.inbox-threads::-webkit-scrollbar-thumb, .inbox-messages::-webkit-scrollbar-thumb { background: #DDE1E6; border-radius: 999px; border: 3px solid transparent; background-clip: padding-box; }
.inbox-threads::-webkit-scrollbar-thumb:hover, .inbox-messages::-webkit-scrollbar-thumb:hover { background: #CBD0D6; background-clip: padding-box; }
.inbox-threads-empty, .inbox-conversation-empty { padding: 44px 24px; color: var(--faint); font-size: 13.5px; text-align: center; }

.inbox-thread { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 11px 12px; border: none; border-radius: 13px; background: transparent; cursor: pointer; transition: background .14s, box-shadow .14s, transform .06s; position: relative; }
.inbox-thread:hover { background: #fff; box-shadow: var(--sh-sm); }
.inbox-thread:active { transform: scale(.995); }
.inbox-thread.is-active { background: #fff; box-shadow: var(--sh-sm), inset 0 0 0 1px rgba(13,148,136,.18); }
.inbox-thread.is-active::before { content: ""; position: absolute; left: 3px; top: 12px; bottom: 12px; width: 3px; border-radius: 3px; background: linear-gradient(180deg, #16B3A3, var(--teal)); box-shadow: 0 0 8px rgba(13,148,136,.5); }
.inbox-thread.is-unread .inbox-thread-name { font-weight: 800; color: var(--ink); }
.inbox-thread.is-unread .inbox-thread-preview { color: var(--ink); font-weight: 550; }
.inbox-unread-rail { position: absolute; left: 3px; top: 14px; bottom: 14px; width: 3px; border-radius: 3px; background: linear-gradient(180deg, #16B3A3, var(--teal)); }
.inbox-thread.is-active .inbox-unread-rail { display: none; }
.inbox-thread.is-pinned { background: linear-gradient(90deg, rgba(13,148,136,.045), transparent 60%); }
.inbox-thread-muted { display: inline-flex; color: var(--faint); margin-left: 3px; }
.inbox-thread-muted svg { width: 12px; height: 12px; }
.inbox-thread-name { display: inline-flex; align-items: center; gap: 3px; }

/* row end: unread dot swaps for star + ⋯ actions on hover (LinkedIn-style) */
.inbox-thread-end { display: flex; align-items: center; justify-content: flex-end; flex-shrink: 0; min-width: 24px; }
.inbox-thread:hover .inbox-unread-dot { display: none; }
.inbox-thread-actions { display: flex; align-items: center; gap: 1px; }
.inbox-act-btn { width: 28px; height: 28px; border: none; background: none; border-radius: 8px; cursor: pointer; color: var(--faint); display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .12s, background .12s, color .12s; }
.inbox-act-btn svg { width: 16px; height: 16px; }
.inbox-thread:hover .inbox-act-btn { opacity: 1; }
.inbox-act-btn:hover { background: var(--line); color: var(--ink); }
.inbox-star-btn.is-on { opacity: 1; color: #F5A623; }
.inbox-star-btn:hover { color: #F5A623; }

/* conversation-management menu */
.inbox-thread-menu { position: fixed; z-index: 500; width: 196px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--sh-lg); padding: 5px; animation: inbox-pop-in .14s cubic-bezier(.2,.9,.3,1); }
.inbox-menu-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: none; background: none; padding: 9px 11px; border-radius: 9px; cursor: pointer; font-size: 13px; color: var(--ink-2); transition: background .12s; }
.inbox-menu-item:hover { background: var(--line-2); color: var(--ink); }
.inbox-menu-item svg { width: 16px; height: 16px; color: var(--muted); flex-shrink: 0; }

.inbox-avatar { position: relative; width: 46px; height: 46px; flex-shrink: 0; }
.inbox-avatar-img { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; }
.inbox-avatar-initials { width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 700; color: #fff; letter-spacing: .01em; box-shadow: inset 0 1px 1px rgba(255,255,255,.25), 0 1px 2px rgba(16,24,40,.14); }
.inbox-avatar-provider { position: absolute; right: -2px; bottom: -2px; width: 17px; height: 17px; border-radius: 50%; border: 2.5px solid #fff; display: flex; align-items: center; justify-content: center; box-shadow: var(--sh-xs); }
.inbox-avatar-provider svg { width: 9px; height: 9px; color: #fff; }
.inbox-avatar-provider.wa { background: var(--inbox-wa); }
.inbox-avatar-provider.li { background: var(--inbox-li); }
.inbox-avatar-provider.ig { background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fd5949 45%, #d6249f 60%, #285AEB 90%); }

.inbox-thread-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.inbox-thread-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.inbox-thread-name { font-size: 14px; color: var(--ink); font-weight: 620; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.01em; }
.inbox-thread-time { font-size: 11px; color: var(--faint); flex-shrink: 0; font-variant-numeric: tabular-nums; }
.inbox-thread-preview { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.35; }
.inbox-thread-cand { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--teal); font-weight: 650; margin-top: 1px; }
.inbox-thread-cand::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 5px rgba(13,148,136,.6); }
.inbox-unread-dot { flex-shrink: 0; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: linear-gradient(180deg, #16B3A3, var(--teal)); color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; box-shadow: var(--sh-xs); }

/* ---------- conversation ---------- */
.inbox-conversation { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; background: #fff; }
.inbox-conversation-empty-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--faint); }
.inbox-conversation-empty-wrap .ic { width: 56px; height: 56px; border-radius: 18px; display: flex; align-items: center; justify-content: center; background: linear-gradient(180deg, var(--line-2), #fff); box-shadow: var(--sh-sm); color: #B6BECA; }
.inbox-conversation-empty-wrap .ic svg { width: 26px; height: 26px; }

.inbox-conversation-header { display: flex; align-items: center; gap: 12px; padding: 13px 20px; border-bottom: 1px solid var(--line); flex-shrink: 0; background: linear-gradient(180deg, #fff, #FDFDFE); }
.inbox-conversation-header .inbox-avatar { width: 40px; height: 40px; }
.inbox-conversation-header .inbox-avatar-initials, .inbox-conversation-header .inbox-avatar-img { width: 40px; height: 40px; font-size: 14px; }
.inbox-ch-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.inbox-conversation-name { font-size: 15.5px; font-weight: 720; color: var(--ink); letter-spacing: -.015em; }
a.inbox-name-link { display: inline-flex; align-items: center; gap: 5px; text-decoration: none; }
a.inbox-name-link:hover { color: var(--teal); }
a.inbox-name-link:hover .inbox-name-ext { opacity: 1; }
.inbox-name-ext { display: inline-flex; opacity: .4; color: var(--muted); transition: opacity .14s, color .14s; }
.inbox-name-ext svg { width: 13px; height: 13px; }
.inbox-conversation-header a[target="_blank"] .inbox-avatar { transition: transform .12s; }
.inbox-conversation-header a[target="_blank"]:hover .inbox-avatar { transform: scale(1.04); }

/* accounts dropdown */
.inbox-header-actions { position: relative; }
.inbox-accounts-pill svg { width: 14px; height: 14px; color: var(--faint); margin-left: 2px; }
.inbox-accounts-dd {
  position: absolute; top: 46px; right: 0; width: 300px; z-index: 200;
  background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--sh-lg);
  padding: 6px; animation: inbox-pop-in .15s cubic-bezier(.2,.9,.3,1);
}
.inbox-dd-head { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); padding: 8px 10px 6px; }
.inbox-dd-row { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 10px; transition: background .12s; }
.inbox-dd-row:hover { background: var(--line-2); }
.inbox-dd-icon { width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: #fff; }
.inbox-dd-icon svg { width: 16px; height: 16px; }
.inbox-dd-icon.wa { background: var(--inbox-wa); }
.inbox-dd-icon.li { background: var(--inbox-li); }
.inbox-dd-icon.ig { background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fd5949 45%, #d6249f 60%, #285AEB 90%); }
.inbox-dd-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.inbox-dd-name { font-size: 13.5px; font-weight: 650; color: var(--ink); }
.inbox-dd-sub { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-dd-open, .inbox-dd-remove { flex-shrink: 0; width: 28px; height: 28px; border: none; background: none; border-radius: 8px; cursor: pointer; color: var(--faint); display: flex; align-items: center; justify-content: center; transition: background .12s, color .12s; }
.inbox-dd-open:hover { background: #fff; color: var(--teal); box-shadow: var(--sh-xs); }
.inbox-dd-remove:hover { background: #FEF3F2; color: #F04438; }
.inbox-dd-open svg, .inbox-dd-remove svg { width: 15px; height: 15px; }
.inbox-dd-connect { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; margin-top: 4px; padding: 10px; border: none; border-top: 1px solid var(--line-2); background: none; color: var(--teal); font-size: 12.5px; font-weight: 640; cursor: pointer; border-radius: 0 0 10px 10px; }
.inbox-dd-connect:hover { background: rgba(13,148,136,.06); }
.inbox-dd-connect svg { width: 14px; height: 14px; }
.inbox-ch-sub { display: flex; align-items: center; gap: 8px; }
.inbox-ch-cand { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 620; color: var(--teal); background: rgba(13,148,136,.1); padding: 2px 9px; border-radius: 999px; cursor: pointer; text-decoration: none; transition: background .15s; }
.inbox-ch-cand:hover { background: rgba(13,148,136,.16); }
.inbox-ch-cand svg { width: 11px; height: 11px; }
.inbox-account-warning { font-size: 12px; color: #B54708; margin-left: auto; font-weight: 620; background: #FFFAEB; border: 1px solid #FEDF89; padding: 4px 10px; border-radius: 8px; }
.inbox-account-warning-btn { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; transition: background .14s, border-color .14s; }
.inbox-account-warning-btn:hover { background: #FEF0C7; border-color: #FEC84B; }
.inbox-account-warning-btn svg { width: 13px; height: 13px; }

/* Disconnected-account banner (top of inbox) + one-click reconnect */
#inbox-reconnect-banner { margin-bottom: 12px; }
.inbox-reconnect-banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: #FFFAEB; border: 1px solid #FEDF89; border-radius: 14px; padding: 12px 16px; }
.inbox-rb-ic { display: inline-flex; color: #DC6803; flex: none; }
.inbox-rb-ic svg { width: 20px; height: 20px; }
.inbox-rb-text { font-size: 13.5px; color: #93370D; line-height: 1.4; }
.inbox-rb-text strong { color: #7A2E0E; }
.inbox-rb-actions { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.inbox-rb-btn { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 680; color: #fff; background: var(--teal); border: none; padding: 8px 16px; border-radius: 999px; cursor: pointer; transition: filter .14s, opacity .14s; }
.inbox-rb-btn:hover { filter: brightness(1.06); }
.inbox-rb-btn:disabled { opacity: .6; cursor: default; }
.inbox-save-cand { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 640; color: var(--teal); background: rgba(13,148,136,.1); border: 1px solid transparent; padding: 3px 10px 3px 8px; border-radius: 999px; cursor: pointer; transition: background .14s; }
.inbox-save-cand:hover { background: rgba(13,148,136,.16); }
.inbox-save-cand:disabled { opacity: .6; cursor: default; }
.inbox-save-cand svg { width: 12px; height: 12px; }
a.inbox-ch-cand { text-decoration: none; }

/* messages */
.inbox-messages { flex: 1; overflow-y: auto; min-height: 0; padding: 22px 26px 10px; display: flex; flex-direction: column; gap: 2px;
  background: radial-gradient(circle at 1px 1px, rgba(16,24,40,.025) 1px, transparent 0) 0 0 / 24px 24px, #FBFCFD; }
.inbox-date-divider { align-self: center; margin: 16px 0 12px; padding: 4px 13px; font-size: 11px; font-weight: 650; color: #64707F; background: rgba(255,255,255,.9); backdrop-filter: blur(6px); border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--sh-xs); }
.inbox-msg { display: flex; flex-direction: column; max-width: 64%; margin-top: 9px; animation: inbox-msg-in .26s cubic-bezier(.2,.8,.3,1) both; }
@keyframes inbox-msg-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.inbox-msg.grouped { margin-top: 2px; animation: none; }
.inbox-msg--in { align-self: flex-start; align-items: flex-start; }
.inbox-msg--out { align-self: flex-end; align-items: flex-end; }
.inbox-msg-bubble { padding: 9px 13px 8px; border-radius: 16px; font-size: 13.5px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; position: relative; }
.inbox-msg--in .inbox-msg-bubble { background: #fff; color: #1D2939; border: 1px solid var(--line); border-bottom-left-radius: 5px; box-shadow: var(--sh-xs); }
.inbox-msg--out .inbox-msg-bubble { background: linear-gradient(165deg, #16B3A3 0%, var(--teal) 55%, var(--teal-d) 100%); color: #fff; border-bottom-right-radius: 5px; box-shadow: 0 1px 2px rgba(13,148,136,.35), 0 4px 12px -4px rgba(13,148,136,.4); }
.inbox-msg.grouped.inbox-msg--in .inbox-msg-bubble { border-top-left-radius: 7px; }
.inbox-msg.grouped.inbox-msg--out .inbox-msg-bubble { border-top-right-radius: 7px; }
.inbox-msg-foot { display: flex; align-items: center; gap: 5px; margin-top: 3px; padding: 0 5px; opacity: 0; transition: opacity .14s; }
.inbox-msg:hover .inbox-msg-foot, .inbox-msg:last-child .inbox-msg-foot { opacity: 1; }
.inbox-msg-time { font-size: 10.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.inbox-tick { display: inline-flex; color: var(--faint); }
.inbox-tick svg { width: 15px; height: 15px; }
.inbox-tick.seen { color: var(--teal); }
.inbox-msg-attach { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 12px; opacity: .92; }
.inbox-msg-attach svg { width: 13px; height: 13px; }
.inbox-msg-img { max-width: 250px; max-height: 270px; border-radius: 13px; margin-top: 2px; display: block; box-shadow: var(--sh-sm); }

/* composer */
.inbox-composer { flex-shrink: 0; padding: 14px 18px 16px; border-top: 1px solid var(--line); background: linear-gradient(180deg, #FDFDFE, #fff); }
.inbox-composer-pending { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.inbox-attach-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; background: #fff; border: 1px solid var(--line); border-radius: 11px; font-size: 12px; color: var(--ink-2); max-width: 240px; box-shadow: var(--sh-xs); }
.inbox-attach-chip img { width: 30px; height: 30px; border-radius: 7px; object-fit: cover; }
.inbox-attach-chip svg { width: 22px; height: 22px; color: var(--faint); }
.inbox-attach-chip .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-attach-chip button { border: none; background: none; cursor: pointer; color: var(--faint); display: flex; padding: 2px; }
.inbox-attach-chip button:hover { color: #F04438; }
.inbox-composer-bar { display: flex; align-items: flex-end; gap: 6px; padding: 6px 6px 6px 8px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--sh-xs); transition: border-color .16s, box-shadow .16s; }
.inbox-composer-bar:focus-within { border-color: rgba(13,148,136,.5); box-shadow: 0 0 0 3px rgba(13,148,136,.1); }
.inbox-composer-bar.is-recording { border-color: rgba(240,68,56,.4); box-shadow: 0 0 0 3px rgba(240,68,56,.08); align-items: center; padding: 8px; }
.inbox-rec-live { flex: 1; display: flex; align-items: center; gap: 9px; font-size: 13.5px; font-weight: 600; color: #B42318; padding: 0 6px; font-variant-numeric: tabular-nums; }
.inbox-rec-dot { width: 10px; height: 10px; border-radius: 50%; background: #F04438; animation: inbox-rec-pulse 1.2s ease-in-out infinite; }
@keyframes inbox-rec-pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .5; transform: scale(.8); } }
.inbox-rec-cancel:hover { color: #F04438 !important; background: #FEF3F2 !important; }
.inbox-composer textarea { flex: 1; resize: none; border: none; outline: none; background: none; padding: 8px 4px; font-size: 14px; font-family: inherit; line-height: 1.45; max-height: 132px; color: var(--ink); }
.inbox-composer textarea::placeholder { color: var(--faint); }
.inbox-tool { flex-shrink: 0; width: 36px; height: 36px; border: none; background: none; border-radius: 10px; cursor: pointer; color: var(--muted); display: flex; align-items: center; justify-content: center; transition: background .14s, color .14s; }
.inbox-tool:hover { background: var(--line-2); color: var(--ink); }
.inbox-tool svg { width: 20px; height: 20px; }
.inbox-send { flex-shrink: 0; width: 40px; height: 40px; border: none; border-radius: 12px; cursor: pointer; background: linear-gradient(165deg, #16B3A3, var(--teal) 60%, var(--teal-d)); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: var(--sh-teal); transition: transform .12s cubic-bezier(.2,.9,.3,1), filter .15s; }
.inbox-send:hover { transform: translateY(-1px) scale(1.02); filter: brightness(1.05); }
.inbox-send:active { transform: translateY(0); }
.inbox-send:disabled { opacity: .4; cursor: default; transform: none; box-shadow: none; }
.inbox-send svg { width: 18px; height: 18px; }

/* emoji popover */
.inbox-emoji-pop { position: absolute; bottom: 66px; right: 58px; width: 306px; height: 268px; z-index: 50; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--sh-lg); display: flex; flex-direction: column; overflow: hidden; animation: inbox-pop-in .16s cubic-bezier(.2,.9,.3,1); }
@keyframes inbox-pop-in { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: none; } }
.inbox-emoji-tabs { display: flex; gap: 2px; padding: 8px 8px 4px; border-bottom: 1px solid var(--line-2); }
.inbox-emoji-tab { flex: 1; border: none; background: none; cursor: pointer; font-size: 17px; padding: 5px 0; border-radius: 9px; opacity: .55; transition: background .12s, opacity .12s; }
.inbox-emoji-tab:hover { background: var(--line-2); }
.inbox-emoji-tab.is-active { background: rgba(13,148,136,.1); opacity: 1; }
.inbox-emoji-grid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; padding: 8px; }
.inbox-emoji-grid button { border: none; background: none; cursor: pointer; font-size: 20px; padding: 5px 0; border-radius: 9px; line-height: 1; transition: transform .1s, background .12s; }
.inbox-emoji-grid button:hover { background: var(--line-2); transform: scale(1.18); }

/* ---------- skeletons ---------- */
.inbox-skel { background: linear-gradient(90deg, #EEF1F4 25%, #F5F7F9 37%, #EEF1F4 63%); background-size: 400% 100%; animation: inbox-shimmer 1.4s ease infinite; border-radius: 8px; }
@keyframes inbox-shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.inbox-skel-row { display: flex; align-items: center; gap: 12px; padding: 11px 12px; }
.inbox-skel-av { width: 46px; height: 46px; border-radius: 50%; flex-shrink: 0; }
.inbox-skel-lines { flex: 1; display: flex; flex-direction: column; gap: 7px; }

/* ---------- empty / connect state ---------- */
.inbox-empty { margin: auto; max-width: 470px; text-align: center; padding: 48px 24px; display: flex; flex-direction: column; align-items: center; gap: 15px; }
.inbox-empty-icon { width: 72px; height: 72px; border-radius: 22px; display: flex; align-items: center; justify-content: center; background: linear-gradient(160deg, rgba(13,148,136,.16), rgba(13,148,136,.04)); color: var(--teal); box-shadow: inset 0 0 0 1px rgba(13,148,136,.16), var(--sh-sm); }
.inbox-empty-icon svg { width: 32px; height: 32px; }
.inbox-empty h2 { font-size: 21px; font-weight: 780; letter-spacing: -.025em; color: var(--ink); margin: 0; }
.inbox-empty p { font-size: 14px; color: var(--muted); margin: 0; line-height: 1.55; }
.inbox-empty-providers { display: flex; gap: 8px; margin: 4px 0 10px; }

/* ---------- Connect modal ---------- */
.inbox-modal-overlay { position: fixed; inset: 0; z-index: 1000; background: rgba(15,23,42,.5); backdrop-filter: blur(5px); display: flex; align-items: center; justify-content: center; padding: 20px; animation: inbox-fade .18s ease; }
@keyframes inbox-fade { from { opacity: 0; } to { opacity: 1; } }
.inbox-modal { width: 100%; max-width: 448px; background: #fff; border-radius: 22px; box-shadow: var(--sh-lg); overflow: hidden; animation: inbox-modal-in .24s cubic-bezier(.2,.9,.3,1); }
@keyframes inbox-modal-in { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
.inbox-modal-head { padding: 24px 24px 6px; }
.inbox-modal-head h3 { font-size: 19px; font-weight: 780; letter-spacing: -.025em; color: var(--ink); margin: 0; }
.inbox-modal-head p { font-size: 13px; color: var(--muted); margin: 6px 0 0; line-height: 1.5; }
.inbox-modal-close { position: absolute; top: 16px; right: 16px; width: 32px; height: 32px; border: none; background: var(--line-2); border-radius: 9px; cursor: pointer; color: var(--muted); display: flex; align-items: center; justify-content: center; transition: background .14s; }
.inbox-modal-close:hover { background: var(--line); color: var(--ink); }
.inbox-provider-list { padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.inbox-provider { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 15px; background: #fff; cursor: pointer; text-align: left; transition: border-color .16s, transform .1s, box-shadow .16s; }
.inbox-provider:hover { border-color: #D0D6DE; transform: translateY(-1px); box-shadow: var(--sh-md); }
.inbox-provider-icon { width: 46px; height: 46px; border-radius: 13px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: #fff; box-shadow: var(--sh-sm); }
.inbox-provider-icon svg { width: 23px; height: 23px; }
.inbox-provider-icon.wa { background: linear-gradient(160deg, #2AE676, var(--inbox-wa)); }
.inbox-provider-icon.li { background: linear-gradient(160deg, #1A78D4, var(--inbox-li)); }
.inbox-provider-icon.ig { background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fd5949 45%, #d6249f 60%, #285AEB 90%); }
.inbox-provider-main { flex: 1; min-width: 0; }
.inbox-provider-name { font-size: 14.5px; font-weight: 720; color: var(--ink); }
.inbox-provider-desc { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.inbox-provider-arrow { color: #C2C9D2; flex-shrink: 0; transition: transform .16s; }
.inbox-provider:hover .inbox-provider-arrow { transform: translateX(3px); color: var(--teal); }
.inbox-modal-foot { padding: 12px 24px 22px; font-size: 11.5px; color: var(--faint); text-align: center; }
.inbox-cookie-link { border: none; background: none; color: var(--teal); font-weight: 640; font-size: 11.5px; cursor: pointer; padding: 0; text-decoration: underline; text-underline-offset: 2px; }

/* cookie connect form */
.ck-back { display: inline-flex; align-items: center; gap: 4px; border: none; background: none; color: var(--muted); font-size: 12.5px; font-weight: 600; cursor: pointer; padding: 0 0 8px; }
.ck-back svg { width: 14px; height: 14px; transform: rotate(180deg); }
.ck-back:hover { color: var(--ink); }
.ck-body { padding: 8px 24px 4px; }
.ck-steps { margin: 0 0 16px; padding-left: 18px; display: flex; flex-direction: column; gap: 7px; }
.ck-steps li { font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.ck-steps b { color: var(--ink); font-weight: 650; }
.ck-label { display: block; font-size: 12px; font-weight: 650; color: var(--ink); margin-bottom: 6px; }
.ck-label code { background: var(--line-2); padding: 1px 6px; border-radius: 5px; font-size: 11.5px; color: var(--teal); }
.ck-input { width: 100%; box-sizing: border-box; border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; font-size: 12.5px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--ink); resize: vertical; line-height: 1.5; }
.ck-input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(13,148,136,.1); }
.ck-error { font-size: 12.5px; color: #D92D20; margin-top: 8px; min-height: 4px; line-height: 1.4; }
.ck-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 24px 22px; }
.ck-switch { border: none; background: none; color: var(--muted); font-size: 12.5px; font-weight: 600; cursor: pointer; padding: 0; }
.ck-switch:hover { color: var(--ink); text-decoration: underline; }
.ck-actions .inbox-connect-btn { height: 40px; }

.inbox-cand-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: rgba(13,148,136,.1); color: var(--teal); }

/* ---------- settings: Social Inbox seat ---------- */
.inbox-set-warning { background: #FFFAEB; border: 1px solid #FEDF89; color: #B54708; padding: 10px 14px; border-radius: 11px; font-size: 13px; margin-bottom: 16px; }
.inbox-set-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; border: 1px solid var(--line); border-radius: 16px; padding: 20px 22px; background: linear-gradient(180deg, #fff, #FCFDFE); box-shadow: var(--sh-sm); }
.inbox-set-price { font-size: 24px; font-weight: 780; color: var(--ink); letter-spacing: -.02em; }
.inbox-set-price span { font-size: 13px; font-weight: 500; color: var(--muted); }
.inbox-set-desc { font-size: 13px; color: var(--muted); margin-top: 4px; max-width: 460px; }
.settings-subsection { margin-top: 26px; }
.inbox-set-members { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.inbox-set-member { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--line-2); border-radius: 11px; padding: 10px 14px; }
.inbox-set-badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--line-2); color: var(--muted); margin-right: 6px; }
.inbox-set-badge.on { background: rgba(37,211,102,.14); color: #128C4A; }

/* ============================================================================
   In-context Conversation Panel — slides in over the candidate profile so the
   user messages without leaving the profile. Reuses .inbox-msg* / composer.
   ========================================================================== */
.inbox-panel-wrap { position: fixed; inset: 0; z-index: 9999; }
.inbox-panel-backdrop { position: absolute; inset: 0; background: rgba(16,24,40,.26); backdrop-filter: blur(2px); animation: inbox-fade .2s ease; }
.inbox-panel { position: absolute; top: 0; right: 0; bottom: 0; width: 480px; max-width: 100vw; background: #fff; display: flex; flex-direction: column; box-shadow: -24px 0 60px -20px rgba(16,24,40,.35); animation: ip-slide .3s cubic-bezier(.2,.9,.3,1); }
@keyframes ip-slide { from { transform: translateX(36px); opacity: .5; } to { transform: none; opacity: 1; } }
.inbox-panel-topbar { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px 0; }
.ip-back { display: inline-flex; align-items: center; gap: 6px; border: none; background: var(--line-2); color: var(--ink-2); font-size: 12.5px; font-weight: 640; padding: 7px 12px 7px 9px; border-radius: 9px; cursor: pointer; transition: background .14s; }
.ip-back:hover { background: var(--line); color: var(--ink); }
.ip-back svg { width: 15px; height: 15px; }
.ip-close { width: 32px; height: 32px; border: none; background: none; border-radius: 9px; cursor: pointer; color: var(--faint); display: flex; align-items: center; justify-content: center; transition: background .14s, color .14s; }
.ip-close:hover { background: var(--line-2); color: var(--ink); }
.ip-close svg { width: 18px; height: 18px; }
.inbox-panel-contact { display: flex; align-items: center; gap: 12px; padding: 12px 18px 14px; border-bottom: 1px solid var(--line); }
.inbox-panel-contact .inbox-avatar { width: 44px; height: 44px; }
.inbox-panel-contact .inbox-avatar-initials, .inbox-panel-contact .inbox-avatar-img { width: 44px; height: 44px; font-size: 15px; }
.ip-contact-meta { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ip-contact-name { font-size: 16px; font-weight: 730; color: var(--ink); letter-spacing: -.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ip-contact-sub { display: flex; align-items: center; gap: 8px; }
.ip-contact-new { font-size: 11.5px; font-weight: 620; color: var(--teal); background: rgba(13,148,136,.1); padding: 2px 9px; border-radius: 999px; }
.inbox-panel .inbox-messages { padding: 20px; }
.inbox-panel .inbox-msg { max-width: 82%; }
.inbox-panel .inbox-composer { padding: 12px 16px 16px; }

/* template picker */
.ip-templates-pop { position: absolute; bottom: 66px; left: 16px; right: 16px; max-height: 260px; z-index: 60; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--sh-lg); overflow: hidden; display: flex; flex-direction: column; animation: inbox-pop-in .16s cubic-bezier(.2,.9,.3,1); }
.ip-templates-head { padding: 12px 14px 8px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); border-bottom: 1px solid var(--line-2); }
.ip-templates-list { overflow-y: auto; padding: 6px; }
.ip-template { display: block; width: 100%; text-align: left; border: none; background: none; padding: 10px 12px; border-radius: 10px; cursor: pointer; transition: background .12s; }
.ip-template:hover { background: var(--line-2); }
.ip-template-name { font-size: 13px; font-weight: 650; color: var(--ink); }
.ip-template-msg { font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ip-template-empty { padding: 18px 14px; font-size: 12.5px; color: var(--muted); text-align: center; }
.ip-template-manage { display: block; padding: 10px 14px; border-top: 1px solid var(--line-2); font-size: 12px; font-weight: 600; color: var(--teal); text-align: center; cursor: pointer; }

@media (max-width: 540px) { .inbox-panel { width: 100vw; } }

/* ---------- Recruiter Activity report ---------- */
.inbox-activity-btn { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px; border: 1px solid var(--line); background: rgba(255,255,255,.8); backdrop-filter: blur(8px); border-radius: 10px; font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; box-shadow: var(--sh-xs); transition: border-color .15s, box-shadow .15s; }
.inbox-activity-btn:hover { border-color: #D0D5DD; box-shadow: var(--sh-sm); }
.inbox-activity-btn svg { width: 15px; height: 15px; color: var(--teal); }

.inbox-report { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; width: 100%; }
.inbox-report-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 20px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.inbox-report-back { display: inline-flex; align-items: center; gap: 4px; border: none; background: var(--line-2); color: var(--ink-2); font-size: 12.5px; font-weight: 640; padding: 7px 12px 7px 8px; border-radius: 9px; cursor: pointer; transition: background .14s; }
.inbox-report-back:hover { background: var(--line); color: var(--ink); }
.inbox-report-back svg { width: 15px; height: 15px; transform: rotate(90deg); }
.inbox-report-ranges { display: flex; gap: 4px; background: #EDF0F3; border-radius: 10px; padding: 3px; }
.inbox-range-chip { border: none; background: none; font-size: 12px; font-weight: 620; color: var(--muted); padding: 6px 12px; border-radius: 7px; cursor: pointer; transition: all .14s; }
.inbox-range-chip.is-active { background: #fff; color: var(--ink); box-shadow: var(--sh-xs); }
.inbox-report-scroll { flex: 1; overflow-y: auto; padding: 24px; }
.inbox-report-title { font-size: 20px; font-weight: 780; letter-spacing: -.02em; color: var(--ink); margin: 0 0 20px; }
.inbox-report-title span { font-size: 14px; font-weight: 500; color: var(--muted); }
.inbox-report-empty { padding: 40px; text-align: center; color: var(--faint); font-size: 13.5px; }

.inbox-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 26px; }
.inbox-stat { display: flex; align-items: center; gap: 13px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(180deg, #fff, #FCFDFE); box-shadow: var(--sh-xs); }
.inbox-stat-icon { width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.inbox-stat-icon svg { width: 20px; height: 20px; }
.inbox-stat-icon.teal { background: rgba(13,148,136,.12); color: var(--teal); }
.inbox-stat-icon.blue { background: rgba(10,102,194,.12); color: var(--inbox-li); }
.inbox-stat-icon.amber { background: rgba(245,166,35,.14); color: #D97706; }
.inbox-stat-icon.violet { background: rgba(124,58,237,.12); color: #7C3AED; }
.inbox-stat-value { font-size: 24px; font-weight: 780; color: var(--ink); letter-spacing: -.02em; line-height: 1; }
.inbox-stat-label { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

.inbox-report-section { margin-bottom: 26px; }
.inbox-report-h { font-size: 13px; font-weight: 700; color: var(--ink-2); margin: 0 0 12px; letter-spacing: -.01em; }
.inbox-chart { display: flex; align-items: flex-end; gap: 4px; height: 160px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.inbox-chart-col { flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; }
.inbox-chart-bars { display: flex; align-items: flex-end; gap: 2px; height: 100%; width: 100%; justify-content: center; }
.inbox-chart-bar { width: 45%; max-width: 12px; border-radius: 3px 3px 0 0; min-height: 2px; transition: height .3s cubic-bezier(.2,.8,.3,1); }
.inbox-chart-bar.sent { background: linear-gradient(180deg, #16B3A3, var(--teal)); }
.inbox-chart-bar.recv { background: #CBD5E1; }
.inbox-chart-legend { display: flex; gap: 18px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.inbox-chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.inbox-chart-legend .dot { width: 9px; height: 9px; border-radius: 3px; }
.inbox-chart-legend .dot.sent { background: var(--teal); }
.inbox-chart-legend .dot.recv { background: #CBD5E1; }

.inbox-lead { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.inbox-lead-head, .inbox-lead-row { display: grid; grid-template-columns: 2.4fr .8fr 1fr .8fr .8fr .8fr; align-items: center; gap: 8px; padding: 11px 16px; }
.inbox-lead-head { background: #FAFBFC; border-bottom: 1px solid var(--line); font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--faint); }
.inbox-lead-head span:not(:first-child), .inbox-lead-row span:not(.inbox-lead-name) { text-align: right; font-variant-numeric: tabular-nums; }
.inbox-lead-row { border-bottom: 1px solid var(--line-2); font-size: 13.5px; color: var(--ink-2); }
.inbox-lead-row:last-child { border-bottom: none; }
.inbox-lead-name { display: inline-flex; align-items: center; gap: 10px; font-weight: 640; color: var(--ink); }
.inbox-lead-name .inbox-avatar-initials { box-shadow: none; }
.inbox-lead-total { font-weight: 750; color: var(--teal); }

@media (max-width: 980px) { .inbox-stats { grid-template-columns: repeat(2, 1fr); } }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .page-container:has(.inbox) { height: 100dvh; }
  .inbox { padding: 16px 14px; height: 100dvh; }
  .inbox-header { flex-wrap: wrap; }
  .inbox-body { flex-direction: column; }
  .inbox-list { width: 100%; max-height: 40%; border-right: none; border-bottom: 1px solid var(--line); }
  .inbox-msg { max-width: 82%; }
  .inbox-emoji-pop { right: 14px; }
}

/* ---------- Locked / not-yet-enabled preview (sells the add-on) ---------- */
.inbox-teaser { position: relative; min-height: 580px; border-radius: 16px; overflow: hidden;
  border: 1px solid var(--color-gray-200, #E2E8F0); background: var(--color-surface, #fff); margin-top: 8px; }
.inbox-teaser-mock { filter: blur(3px); opacity: 0.55; pointer-events: none; user-select: none; }
.inbox-tz-row { display: flex; gap: 12px; align-items: center; padding: 15px 18px; border-bottom: 1px solid var(--color-gray-100, #F1F5F9); }
.inbox-tz-av { width: 44px; height: 44px; border-radius: 50%; color: #fff; font-weight: 700; font-size: 14px;
  display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.inbox-tz-main { min-width: 0; }
.inbox-tz-name { font-weight: 600; color: var(--color-gray-900, #0F172A); }
.inbox-tz-msg { font-size: 13px; color: var(--color-gray-500, #64748B); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60vw; }
.inbox-teaser-scrim { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(248,250,252,0.35) 0%, rgba(248,250,252,0.9) 55%, #fff 100%); }
.inbox-teaser-panel { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(720px, 92%); background: rgba(255,255,255,0.9); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--color-gray-200, #E2E8F0); border-radius: 18px; padding: 38px 42px;
  box-shadow: 0 24px 70px rgba(15,23,42,0.16); }
.inbox-teaser-eyebrow { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--color-secondary, #0D9488); background: rgba(13,148,136,0.1); padding: 5px 11px; border-radius: 999px; margin-bottom: 16px; }
.inbox-teaser-h { font-size: 27px; line-height: 1.2; font-weight: 700; color: var(--color-gray-900, #0F172A); margin: 0 0 12px; letter-spacing: -0.01em; }
.inbox-teaser-lead { font-size: 15px; line-height: 1.55; color: var(--color-gray-600, #475569); margin: 0 0 22px; }
.inbox-teaser-feats { list-style: none; margin: 0 0 26px; padding: 0; display: grid; gap: 13px; }
.inbox-teaser-feats li { display: flex; gap: 11px; align-items: flex-start; font-size: 14px; line-height: 1.5; color: var(--color-gray-600, #475569); }
.inbox-teaser-tick { color: var(--color-secondary, #0D9488); flex: 0 0 auto; font-weight: 800; margin-top: 1px; }
.inbox-teaser-feats b { color: var(--color-gray-900, #0F172A); font-weight: 600; }
.inbox-teaser-cta-wrap { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.inbox-teaser-cta { background: var(--color-secondary, #0D9488); color: #fff; border: 0; border-radius: 11px;
  font-size: 15px; font-weight: 600; padding: 13px 26px; cursor: pointer; transition: background .14s, transform .14s, box-shadow .14s;
  box-shadow: 0 6px 18px rgba(13,148,136,0.28); }
.inbox-teaser-cta:hover:not(:disabled) { background: #0B7F74; transform: translateY(-1px); box-shadow: 0 10px 24px rgba(13,148,136,0.34); }
.inbox-teaser-cta:disabled { opacity: 0.7; cursor: default; }
.inbox-teaser-cta.is-sent { background: #15803D; box-shadow: none; }
.inbox-teaser-cta-sub { font-size: 13px; color: var(--color-gray-500, #64748B); }
.inbox-teaser-note { font-size: 14px; font-weight: 500; color: var(--color-gray-600, #475569); background: var(--color-gray-50, #F8FAFC);
  border: 1px solid var(--color-gray-200, #E2E8F0); border-radius: 10px; padding: 12px 16px; display: inline-block; }
@media (max-width: 640px) {
  .inbox-teaser-panel { padding: 26px 22px; width: 94%; }
  .inbox-teaser-h { font-size: 22px; }
}

/* Save-as-candidate destination menu (inbox conversation) */
.inbox-save-menu { position: fixed; z-index: 9999; min-width: 260px; max-width: 300px; background: var(--color-surface, #fff);
  border: 1px solid var(--color-gray-200, #E2E8F0); border-radius: 12px; box-shadow: 0 16px 44px rgba(15,23,42,0.18); padding: 6px; }
.inbox-save-head { font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--color-gray-400, #94A3B8); padding: 8px 10px 4px; }
.inbox-save-loading { padding: 14px; font-size: 13px; color: var(--color-gray-500, #64748B); }
.inbox-save-sep { height: 1px; background: var(--color-gray-100, #F1F5F9); margin: 6px 4px; }
.inbox-save-scroll { max-height: 240px; overflow-y: auto; }
.inbox-save-row { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; border: 0; background: transparent;
  padding: 9px 10px; border-radius: 8px; font-size: 13px; color: var(--color-gray-700, #334155); cursor: pointer; }
.inbox-save-row:hover { background: var(--color-gray-50, #F8FAFC); }
.inbox-save-row svg { width: 16px; height: 16px; color: var(--color-secondary, #0D9488); flex: 0 0 auto; }
.inbox-save-row b { font-weight: 600; color: var(--color-gray-900, #0F172A); }
.inbox-save-row span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* AI "suggest reply" composer button */
.inbox-ai { color: var(--color-secondary, #0D9488) !important; font-size: 18px; font-weight: 700; line-height: 1; }
.inbox-ai:hover:not(:disabled) { background: rgba(13,148,136,0.1); }
.inbox-ai.is-loading { opacity: 0.6; animation: inbox-ai-pulse 0.9s ease-in-out infinite; }
@keyframes inbox-ai-pulse { 0%,100% { opacity: 0.5; } 50% { opacity: 1; } }
