/* feature-specific styles for inbox + chat (shared pieces live in styles/features.css) */

/* ---------- inbox: list ---------- */
.inbox .conv-list .head h2 { font-size: var(--fs-lg); } .inbox .conv-list .head h2 svg { width: 20px; height: 20px; color: var(--brand); }
.inbox .segmented.folders { display: flex; } .inbox .segmented.folders button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 8px; } .inbox .segmented.folders svg { width: 14px; height: 14px; }
.chips-scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; } .chips-scroll::-webkit-scrollbar { display: none; } .chips-scroll .chip { flex: none; height: 28px; padding: 0 10px; font-size: var(--fs-xs); }
.select-sm { height: 34px; font-size: var(--fs-xs); border-radius: var(--r-xs); }
.inbox .conv { align-items: flex-start; }
.inbox .conv::before { content: ""; position: absolute; inset-inline-start: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--brand); opacity: 0; transition: opacity var(--t-fast); }
.inbox .conv.active::before { opacity: 1; } .inbox .conv.unread .who { color: var(--text); } .inbox .conv.unread .kind { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--rose-500); }
.inbox .conv .prev .you { color: var(--text-4); font-weight: 500; }
.inbox .conv .cmeta { display: flex; align-items: center; gap: 6px; margin-top: 4px; min-width: 0; } .inbox .conv .cmeta > span:first-child { flex: 1; display: inline-flex; align-items: center; gap: 4px; }
.inbox .conv .cmeta svg { width: 12px; height: 12px; flex: none; } .inbox .conv .cmeta .badge { height: 18px; padding: 0 6px; font-size: 10px; }
.inbox .conv .cmeta .unlinked { color: var(--accent); display: inline-flex; align-items: center; gap: 3px; } [data-theme="dark"] .inbox .conv .cmeta .unlinked { color: var(--accent-strong); }
.inbox .conv .cmeta .dealdot { color: var(--ai); display: inline-flex; margin-inline-start: 4px; } [data-theme="dark"] .inbox .conv .cmeta .dealdot { color: var(--ai-strong); }
.inbox .conv .unread-n { position: static; animation: pop var(--t-slow) var(--ease-spring) both; }
.inbox .conv.closed .kind, .inbox .conv.snoozed .kind { opacity: .55; filter: grayscale(.4); }
.avatar.xs { width: 20px; height: 20px; font-size: 8.5px; }
.inbox .conv-list .foot { border-top: 1px solid var(--border); padding: 8px 12px; background: var(--surface-2); }
.inbox .conv-list .foot .btn { width: 100%; justify-content: flex-start; } .inbox .conv-list .foot .badge { margin-inline-start: auto; height: 20px; font-size: 10px; }

/* ---------- inbox: thread ---------- */
.thread .head .kind { width: 40px; height: 40px; border-radius: var(--r-md); display: grid; place-items: center; flex: none; } .thread .head .kind svg { width: 20px; height: 20px; }
.thread .head .kind.whatsapp { background: var(--success-soft); color: var(--leaf-600); } .thread .head .kind.email { background: var(--info-soft); color: var(--sky-600); }
.thread .head b { font-size: var(--fs-md); } .thread .head .badge svg { width: 12px; height: 12px; } .thread .head a.badge:hover { filter: brightness(.95); }
.thread .head .unlinked-b { background: var(--accent-soft); color: var(--accent); cursor: pointer; } [data-theme="dark"] .thread .head .unlinked-b { color: var(--accent-strong); }
.thread .head .actions { flex: none; } .thread .head .assignee { width: 160px; height: 34px; }
.thread .head .back { display: none; }
.thread .banner { display: flex; align-items: center; gap: 8px; padding: 8px 18px; font-size: var(--fs-xs); background: var(--surface-3); color: var(--text-2); border-bottom: 1px solid var(--border); } .thread .banner svg { width: 15px; height: 15px; }
.thread .banner.snoozed { background: var(--warning-soft); color: var(--warning); } .thread .banner.closed { background: var(--surface-3); } .thread .banner.manual { background: var(--info-soft); color: var(--info); } [data-theme="dark"] .thread .banner.snoozed { color: var(--warning); }
.thread .msgs { background: radial-gradient(600px 300px at 20% 0%, var(--brand-soft), transparent 70%), var(--bg); }
.msg { white-space: normal; box-shadow: var(--shadow-sm); } .msg .body { white-space: pre-wrap; }
.msg .body a { text-decoration: underline; } .msg.out .body a { color: var(--on-solid); }
.msg .meta { display: flex; align-items: center; justify-content: flex-end; gap: 6px; } .msg .meta .st { display: inline-flex; align-items: center; } .msg .meta .st svg { width: 13px; height: 13px; }
.msg .meta .st.delivered svg + svg, .msg .meta .st.read svg + svg { margin-inline-start: -8px; } .msg.out .meta .st.read { color: #BFF1EE; opacity: 1; } .msg.out .meta .st.read svg { filter: drop-shadow(0 0 2px rgba(255,255,255,.6)); }
.msg .meta .st.failed { color: var(--danger); opacity: 1; } .msg .meta .err { color: var(--danger); font-weight: 600; opacity: 1; }
.msg.out.failed { background: var(--danger); }
.msg .att { color: inherit; text-decoration: none; } .msg.in .att { background: var(--surface-3); } .msg .att svg { width: 14px; height: 14px; flex: none; } .msg .att:hover { filter: brightness(.96); }
.thread .msgs .empty { flex: 1; }
.composer .pending { display: flex; gap: 6px; flex-wrap: wrap; } .composer .pending .badge button { margin-inline-start: 4px; color: inherit; opacity: .7; font-size: 14px; line-height: 1; } .composer .pending .badge button:hover { opacity: 1; }
.composer textarea { min-height: 52px; max-height: 220px; resize: none; }
.composer .ai-engine { animation: pop var(--t-slow) var(--ease-spring) both; }
.composer .btn-ai svg { animation: wiggle 2.2s var(--ease) infinite; }
.inbox-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px; padding: 40px; color: var(--text-3); }
.inbox-empty .orb { width: 72px; height: 72px; border-radius: var(--r-xl); display: grid; place-items: center; color: var(--text-4); background: var(--surface-3); margin-bottom: 8px; }
.inbox-empty .orb svg { width: 44px; height: 44px; } .inbox-empty b { color: var(--text); font-size: var(--fs-xl); } .inbox-empty span { max-width: 360px; }

/* ---------- inbox: context panel ---------- */
.ctx-sec { display: flex; flex-direction: column; gap: 10px; padding-bottom: 14px; border-bottom: 1px dashed var(--border); animation: rise-in var(--t-base) var(--ease-out) both; } .ctx-sec:last-child { border-bottom: 0; }
.ctx-sec h4 .btn { margin-inline-start: auto; width: 26px; height: 26px; } .ctx-sec h4 .badge { margin-inline-start: auto; height: 18px; font-size: 10px; text-transform: none; letter-spacing: 0; }
.kv-tight { grid-template-columns: 22px 1fr; gap: 6px 8px; align-items: center; } .kv-tight dt svg { width: 15px; height: 15px; color: var(--text-4); } .kv.xs { grid-template-columns: 90px 1fr; }
.ctx-card { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface-2); color: var(--text); transition: all var(--t-fast); } .ctx-card:hover { border-color: var(--brand); box-shadow: var(--shadow-sm); transform: translateY(-1px); color: var(--text); }
.ctx-sec.notes { background: linear-gradient(180deg, var(--amber-50), transparent); margin: 0 -16px; padding: 12px 16px 14px; border-radius: 0; } [data-theme="dark"] .ctx-sec.notes { background: linear-gradient(180deg, rgba(255,190,69,.08), transparent); }
.private-hint { display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--warning); } .private-hint svg { width: 13px; height: 13px; flex: none; } [data-theme="dark"] .private-hint { color: var(--warning); }
.mynote .nbody { white-space: pre-wrap; word-break: break-word; } .mynote .meta .del { color: var(--text-4); display: inline-flex; } .mynote .meta .del:hover { color: var(--danger); } .mynote .meta .del svg { width: 13px; height: 13px; }
.note-inp { min-height: 56px; font-size: var(--fs-sm); }
.ctx .summary { white-space: pre-wrap; }

/* ---------- templates picker ---------- */
.tpl-list { display: grid; gap: 8px; } .tpl { text-align: start; display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface); transition: all var(--t-fast); }
.tpl:hover { border-color: var(--brand); background: var(--brand-soft); transform: translateY(-1px); } .tpl b { font-size: var(--fs-sm); display: flex; justify-content: space-between; align-items: center; gap: 8px; } .tpl p { font-size: var(--fs-xs); color: var(--text-3); white-space: pre-wrap; }

/* ---------- chat ---------- */
.chat .chans { display: flex; flex-direction: column; } .chat .chans .head { padding: 14px 16px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.chat .chans .head h2 { font-size: var(--fs-lg); display: flex; align-items: center; gap: 8px; } .chat .chans .head h2 svg { width: 20px; height: 20px; color: var(--brand); }
.chat .chans .items { overflow: auto; flex: 1; } .chat .chans .grp { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-4); padding: 10px 16px 4px; font-weight: 600; }
.chan { position: relative; } .chan::before { content: ""; position: absolute; inset-inline-start: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--brand); opacity: 0; transition: opacity var(--t-fast); } .chan.active::before { opacity: 1; }
.chan .ico { width: 36px; height: 36px; border-radius: var(--r-sm); display: grid; place-items: center; flex: none; background: var(--surface-3); color: var(--text-2); } .chan .ico svg { width: 18px; height: 18px; }
.chan .ico.team { background: linear-gradient(135deg, var(--brand), var(--blue-700)); color: var(--on-solid); } .chan .ico.group { background: var(--ai-soft); color: var(--ai); } [data-theme="dark"] .chan .ico.group { color: var(--ai-strong); }
.chan .nm { font-weight: 600; font-size: var(--fs-sm); display: flex; justify-content: space-between; gap: 6px; } .chan .nm time { font-size: 10.5px; color: var(--text-4); font-weight: 400; } .chan .sub { font-size: var(--fs-xs); color: var(--text-3); }
.chan.unread .nm { color: var(--text); } .chan .pill-count.hot { background: var(--accent); color: var(--on-solid); animation: pop var(--t-slow) var(--ease-spring) both; }
.chat .thread .head .ico { width: 40px; height: 40px; border-radius: var(--r-md); display: grid; place-items: center; flex: none; background: var(--surface-3); color: var(--text-2); } .chat .thread .head .ico svg { width: 20px; height: 20px; }
.chat .thread .head .ico.team { background: linear-gradient(135deg, var(--brand), var(--blue-700)); color: var(--on-solid); } .chat .thread .head .ico.group { background: var(--ai-soft); color: var(--ai); }
.chat .thread .head .back { display: none; }
.chat .msgs { padding: 14px 18px; }
.cmsg .avatar { margin-top: 2px; } .cmsg .body a.deal-ref { font-family: var(--font-mono); font-weight: 600; background: var(--ai-soft); color: var(--ai); padding: 0 5px; border-radius: 4px; } [data-theme="dark"] .cmsg .body a.deal-ref { color: var(--ai-strong); }
.cmsg .mention.me { background: var(--accent-soft); color: var(--accent); } [data-theme="dark"] .cmsg .mention.me { color: var(--accent-strong); }
.cmsg.cont { padding-top: 0; margin-top: -2px; } .cmsg.cont .avatar { visibility: hidden; height: 0; margin: 0; } .cmsg.cont .who, .cmsg.cont .when { display: none; }
.cmsg .when { opacity: 0; transition: opacity var(--t-fast); } .cmsg:hover .when, .cmsg:first-child .when { opacity: 1; } .cmsg .who + .when { opacity: 1; }
.cmsg.mentioned { background: var(--accent-soft); }
.chat .load-older { align-self: center; margin-bottom: 6px; }
/* @mention picker above the chat composer — one definition (the items are <div data-u>, see chat.js). */
.mention-pop { position: absolute; bottom: calc(100% + 6px); inset-inline-start: 18px; min-width: 240px; max-height: 240px; overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-lg); padding: 5px; z-index: 40; animation: drop-in var(--t-fast) var(--ease-out) both; }
.mention-pop div { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: var(--r-sm); cursor: pointer; font-size: var(--fs-sm); } .mention-pop div:hover, .mention-pop div.hl { background: var(--brand-soft); color: var(--brand-ink); }
.mention-pop small { color: var(--text-4); margin-inline-start: auto; }
.chat .composer { position: relative; }
.chat-empty-members { display: flex; align-items: center; gap: 6px; }
.member-list { display: flex; flex-direction: column; gap: 4px; max-height: 320px; overflow: auto; } .member-list label { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm); cursor: pointer; transition: background var(--t-fast); } .member-list label:hover { background: var(--surface-hover); } .member-list label input { accent-color: var(--brand); width: 16px; height: 16px; }
.member-list label.on { background: var(--brand-soft); }

/* ---------- responsive: single column under 900px ---------- */
@media (max-width: 900px) {
  .inbox, .chat { grid-template-columns: 1fr; height: calc(100vh - var(--topbar-h)); margin: calc(-1 * var(--sp-4)); }
  .inbox .thread, .chat .thread { display: none; } .inbox.has-active .thread, .chat.has-active .thread { display: flex; }
  .inbox.has-active .conv-list, .chat.has-active .chans { display: none; }
  .thread .head .back, .chat .thread .head .back { display: inline-flex; }
  .msg { max-width: 88%; }
}

/* ---------- chat ---------- */
.chat .chans { display: flex; flex-direction: column; }
.chans-head { padding: 14px 16px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.chans-list { overflow: auto; flex: 1; }
.chan-group-h { font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-4); padding: 12px 16px 4px; }
.chan .chan-ico { width: 32px; height: 32px; border-radius: var(--r-sm); display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-ink); flex: none; }
.chan .chan-ico svg { width: 17px; height: 17px; }
.chan-ico.lg { width: 40px; height: 40px; border-radius: var(--r-md); } .chan-ico.lg svg { width: 20px; height: 20px; }
.chan .badge-count { background: var(--accent); color: var(--on-solid); font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; }
.chat .thread { display: flex; flex-direction: column; background: var(--bg); }
.chat .thread .head { padding: 12px 18px; border-bottom: 1px solid var(--border); background: var(--surface); display: flex; align-items: center; gap: 12px; }
.chat .msgs { flex: 1; overflow: auto; padding: 18px; display: flex; flex-direction: column; gap: 2px; }
.cmsg { display: flex; gap: 10px; padding: 5px 8px; border-radius: var(--r-sm); }
.cmsg-av { width: 26px; flex: none; display: flex; justify-content: center; } .cmsg-av .t { opacity: 0; font-size: 10px; } .cmsg:hover .cmsg-av .t { opacity: 1; }
.cmsg.grouped { padding-top: 1px; padding-bottom: 1px; }
.thread-empty { flex: 1; display: grid; place-items: center; }
.chat .composer { position: relative; }
