.inbox-layout-live { gap: 20px; align-items: stretch; }
.inbox-layout-live { height: calc(100vh - 310px); min-height: 500px; }
.inbox-layout-live .surface { border-color: rgba(6,34,112,.1); box-shadow: 0 18px 45px rgba(6,34,112,.06); }
.inbox-layout-live .inbox-list, .inbox-layout-live .inbox-detail { height: 100%; min-height: 0; }
.inbox-layout-live .inbox-detail { display: flex; flex-direction: column; }
.inbox-layout-live .inbox-list { background: linear-gradient(180deg, #fff 0%, #fffdfb 100%); }
.inbox-toolbar { min-height: 82px; padding: 17px 20px; background: #fff; }
.inbox-toolbar > div { flex-wrap: wrap; }
.inbox-toolbar > div::after { width: 100%; color: #9aa4b7; font-size: 10px; content: "Visitor conversations"; }
.inbox-toolbar strong { font-size: 16px; letter-spacing: -.035em; }
.inbox-live-label { padding: 6px 9px; border: 1px solid #dff2e9; border-radius: 999px; background: #f4fcf8; color: #2a9b76; font-weight: 750; }
.conversation-list { padding: 6px 0; }
.conversation-row { position: relative; min-height: 73px; padding: 14px 20px; border-bottom-color: #f1f2f6; transition: background .18s ease, transform .18s ease; }
.conversation-row:hover { transform: translateX(2px); }
.conversation-row.active { background: linear-gradient(90deg, #fff5ee, #fff); box-shadow: inset 3px 0 0 var(--brand-orange, #ff6500); }
.conversation-avatar { border: 3px solid #fff; box-shadow: 0 4px 10px rgba(6,34,112,.1); }
.conversation-row-copy strong { font-size: 13px; }
.conversation-row-copy small { max-width: 190px; }
.conversation-row-meta time { font-size: 10px; }
.inbox-detail { background: #fff; }
.detail-header { position: relative; min-height: 122px; flex: 0 0 auto; padding: 23px 25px; background: linear-gradient(135deg, #fffaf6, #fff); }
.detail-header::before { position: absolute; top: 0; right: 0; left: 0; height: 3px; background: linear-gradient(90deg, var(--brand-orange, #ff6500), #ff9b5d); content: ""; }
.detail-header h2 { font-size: 23px; letter-spacing: -.05em; }
.detail-channel { border: 1px solid #f7d4bf; }
.detail-messages { height: auto; min-height: 0; flex: 1 1 auto; padding: 27px 25px; overflow-y: auto; background: radial-gradient(circle at 86% 3%, #fff0e6 0, transparent 24%), #f8f9fc; }
.admin-message { max-width: 72%; margin-bottom: 20px; }
.admin-message-bubble { padding: 12px 15px; border-color: #e7ebf2; border-radius: 17px 17px 17px 5px; }
.admin-message--agent .admin-message-bubble { border-color: var(--brand-navy, #062270); background: linear-gradient(135deg, #062270, #123c8c); box-shadow: 0 8px 18px rgba(6,34,112,.14); }
.admin-reply { position: sticky; bottom: 0; flex: 0 0 auto; padding: 16px 19px 18px; background: #fff; }
.admin-reply textarea { min-height: 62px; padding: 12px 13px; border-radius: 13px; background: #fafbfc; }
.admin-reply textarea:focus { background: #fff; }
.admin-reply > div > span { color: #8994a7; }
.admin-reply .primary-button { min-height: 38px; background: var(--brand-orange, #ff6500); border-color: var(--brand-orange, #ff6500); box-shadow: 0 8px 16px rgba(255,101,0,.18); }
.admin-reply .primary-button:hover { background: #d94f00; }
.detail-placeholder { background: radial-gradient(circle at 50% 35%, #fff4eb 0, transparent 25%); }
.detail-placeholder > span { color: #fff; background: var(--brand-orange, #ff6500); box-shadow: 0 12px 24px rgba(255,101,0,.2); }
.mobile-inbox-back { display: none; }
@media (max-width: 980px) { .inbox-layout-live { height: auto; min-height: 0; } .inbox-layout-live .inbox-list { height: auto; min-height: 500px; } .inbox-layout-live .inbox-detail { height: 600px; min-height: 0; display: flex; } }
@media (max-width: 620px) { .inbox-layout-live.has-selected .inbox-list { display: none; } .inbox-layout-live.has-selected .inbox-detail { position: fixed; z-index: 35; inset: 77px 0 0; width: 100%; height: calc(100vh - 77px); min-height: 0; border: 0; border-radius: 0; box-shadow: 0 -10px 35px rgba(6,34,112,.12); } .inbox-layout-live.has-selected .detail-header { min-height: 106px; padding: 50px 18px 16px; } .mobile-inbox-back { position: absolute; top: 14px; left: 18px; display: inline-flex; padding: 0; border: 0; background: transparent; color: var(--brand-orange, #ff6500); font-size: 12px; font-weight: 800; } .inbox-layout-live.has-selected .detail-messages { padding: 20px 16px; } .inbox-layout-live.has-selected .admin-reply { padding: 12px 14px 14px; } .inbox-layout-live.has-selected .admin-reply textarea { min-height: 52px; } }

.inbox-page-heading .inbox-heading-actions { display: flex; align-items: center; gap: 12px; }
.inbox-sync-status { display: inline-flex; align-items: center; gap: 7px; color: #2a9b76; font-size: 11px; font-weight: 800; }
.inbox-sync-status i { width: 7px; height: 7px; display: inline-block; border-radius: 50%; background: #39c28f; box-shadow: 0 0 0 5px rgba(57,194,143,.12); }
.inbox-list { display: flex; flex-direction: column; }
.inbox-list-header { min-height: 78px; padding: 17px 20px 13px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #eef0f5; }
.inbox-list-header > div { display: grid; gap: 4px; }
.inbox-section-label { color: var(--brand-orange, #ff6500); font-size: 9px; font-weight: 850; letter-spacing: .16em; text-transform: uppercase; }
.inbox-list-header strong { color: var(--brand-navy, #062270); font-size: 17px; letter-spacing: -.04em; }
.inbox-filterbar { padding: 10px 17px 4px; display: flex; gap: 4px; border-bottom: 1px solid #f2f3f6; }
.inbox-filter { padding: 7px 9px; border: 0; border-radius: 8px; background: transparent; color: #8a96a9; font-size: 11px; font-weight: 750; cursor: pointer; }
.inbox-filter span { margin-left: 3px; color: #b0b9c6; font-size: 10px; }
.inbox-filter.active { background: #fff0e6; color: #c95112; }
.inbox-filter.active span { color: #c95112; }
.inbox-search { margin: 11px 17px 9px; padding: 9px 11px; display: flex; align-items: center; gap: 8px; border: 1px solid #e7ebf2; border-radius: 10px; background: #fafbfc; color: #98a4b6; }
.inbox-search:focus-within { border-color: var(--brand-orange, #ff6500); background: #fff; box-shadow: 0 0 0 4px rgba(255,101,0,.08); }
.inbox-search input { width: 100%; min-width: 0; padding: 0; border: 0; outline: 0; background: transparent; color: var(--brand-navy, #062270); font-size: 11px; }
.inbox-search input::placeholder { color: #a1aabd; }
.conversation-list { flex: 1; overflow-y: auto; scrollbar-color: #d9dee8 transparent; scrollbar-width: thin; }
.detail-header { display: block; }
.detail-header-top { min-height: 28px; display: flex; align-items: center; justify-content: flex-end; gap: 9px; }
.detail-profile { margin-top: 8px; display: flex; align-items: center; gap: 12px; }
.detail-profile-copy { min-width: 0; }
.detail-name-row { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; }
.detail-name-row h2 { margin: 5px 0 0; }
.detail-meta-inline { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.detail-meta-inline i { margin-right: 0; }
.detail-avatar { width: 43px; height: 43px; display: grid; place-items: center; border: 3px solid #fff; border-radius: 14px; background: #e8edff; color: var(--brand-navy, #062270); font-size: 11px; font-weight: 850; box-shadow: 0 4px 12px rgba(6,34,112,.12); }
.detail-profile h2 { margin: 5px 0 0; }
.detail-channel { display: inline-flex; align-items: center; gap: 5px; }
.detail-channel i { width: 6px; height: 6px; display: inline-block; border-radius: 50%; background: #2fba88; }
.detail-channel-closed i { background: #98a2b1; }
.conversation-status-button { min-height: 31px; padding: 0 10px; display: inline-flex; align-items: center; gap: 7px; border: 1px solid #f2cbb7; border-radius: 9px; background: #fff8f4; color: #ca5316; font-size: 10px; font-weight: 850; cursor: pointer; }
.conversation-status-button:hover { background: var(--brand-orange, #ff6500); color: #fff; }
.conversation-status-button.is-closed { border-color: #d8e0eb; background: #f7f9fc; color: #64748a; }
.conversation-status-button.is-closed:hover { background: var(--brand-navy, #062270); color: #fff; }
.admin-reply.is-resolved { background: #f8f9fb; }
.admin-reply.is-resolved textarea { background: #f1f3f7; color: #9aa4b3; cursor: not-allowed; }
.admin-reply.is-resolved .primary-button { color: #a8b1bd; background: #e7ebf1; border-color: #e7ebf1; box-shadow: none; cursor: not-allowed; }
@media (max-width: 760px) { .inbox-page-heading .inbox-heading-actions { width: 100%; justify-content: space-between; } .inbox-page-heading .inbox-heading-actions .secondary-button { width: auto; } .inbox-list-header { padding-inline: 16px; } .inbox-filterbar { overflow-x: auto; } .inbox-filter { flex: 0 0 auto; } .detail-header-top { justify-content: space-between; } .conversation-status-button { margin-left: auto; } }
@media (max-width: 980px) { .inbox-layout-live.has-selected .inbox-list { display: none; } .inbox-layout-live.has-selected .inbox-detail { position: fixed; z-index: 35; inset: 70px 0 0; width: 100%; height: calc(100vh - 70px); min-height: 0; border: 0; border-radius: 0; box-shadow: 0 -10px 35px rgba(6,34,112,.12); } .inbox-layout-live.has-selected .detail-header { min-height: 106px; padding: 50px 18px 16px; } .inbox-layout-live.has-selected .detail-messages { padding: 20px 16px; } .inbox-layout-live.has-selected .admin-reply { padding: 12px 14px 14px; } .mobile-inbox-back { position: absolute; top: 14px; left: 18px; display: inline-flex; padding: 0; border: 0; background: transparent; color: var(--brand-orange, #ff6500); font-size: 12px; font-weight: 800; } }

.inbox-list-header > div { min-width: 0; }
.inbox-list-header strong { display: block; }
.inbox-count { flex: 0 0 auto; }
.inbox-filter { appearance: none; -webkit-appearance: none; }
.conversation-status-button { appearance: none; -webkit-appearance: none; line-height: 1; }
.inbox-sync-status.is-offline { color: #a27645; }
.inbox-sync-status.is-offline i { background: #d89b45; box-shadow: 0 0 0 5px rgba(216,155,69,.12); }

.notification-button > span { line-height: 1; }
.notification-button b { position: absolute; top: -7px; right: -8px; min-width: 17px; height: 17px; padding: 0 4px; display: grid; place-items: center; color: #fff; background: var(--brand-orange, #ff6500); border: 2px solid #fff; border-radius: 999px; font-size: 9px; line-height: 1; }
.notification-button i[hidden] { display: none; }
.notification-button b[hidden] { display: none; }

.recent-conversations-content { min-height: 170px; }
.recent-conversation-list { display: grid; gap: 4px; margin-top: 17px; }
.recent-conversation-row { width: 100%; min-height: 58px; padding: 9px 2px; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 10px; color: var(--dash-ink); text-align: left; background: transparent; border: 0; border-bottom: 1px solid #f0f2f5; }
.recent-conversation-row:hover { background: #fffaf6; }
.recent-conversation-row .conversation-avatar { width: 34px; height: 34px; font-size: 10px; }
.recent-conversation-copy { min-width: 0; display: grid; gap: 2px; }
.recent-conversation-copy strong,.recent-conversation-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-conversation-copy strong { color: var(--dash-navy); font-size: 12px; }
.recent-conversation-copy small { color: #97a3b1; font-size: 10px; }
.recent-conversation-meta { display: grid; justify-items: end; gap: 3px; }
.recent-conversation-meta time { color: #a1acb8; font-size: 9px; }
.recent-status { padding: 3px 6px; border-radius: 999px; font-size: 8px; font-weight: 800; }
.recent-status-open { color: #258b73; background: #e5f8f2; }
.recent-status-closed { color: #7f8a98; background: #eef1f4; }

/* Live visitor presence */
.visitors-page-heading .inbox-heading-actions { display: flex; align-items: center; gap: 12px; }
.visitors-layout-live { display: grid; grid-template-columns: minmax(290px, 360px) minmax(0, 1fr); gap: 20px; height: calc(100dvh - 250px); min-height: 520px; }
.visitors-layout-live .surface { min-height: 0; border-color: rgba(6,34,112,.1); box-shadow: 0 18px 45px rgba(6,34,112,.06); }
.visitors-list-panel, .visitor-detail-panel { display: flex; flex-direction: column; overflow: hidden; padding: 0; }
.visitors-list-header { min-height: 78px; padding: 17px 20px 13px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #eef0f5; }
.visitors-list-header > div { display: grid; gap: 4px; }
.visitors-list-header strong { color: var(--brand-navy, #062270); font-size: 17px; letter-spacing: -.04em; }
.visitor-filterbar { padding: 10px 17px 4px; display: flex; gap: 4px; border-bottom: 1px solid #f2f3f6; }
.visitor-filter { padding: 7px 9px; border: 0; border-radius: 8px; background: transparent; color: #8a96a9; font-size: 11px; font-weight: 750; cursor: pointer; }
.visitor-filter span { margin-left: 3px; color: #b0b9c6; font-size: 10px; }
.visitor-filter.active { background: #fff0e6; color: #c95112; }
.visitor-filter.active span { color: #c95112; }
.visitor-search { margin-bottom: 9px; }
.visitor-list { flex: 1; overflow-y: auto; scrollbar-color: #d9dee8 transparent; scrollbar-width: thin; }
.visitor-row { width: 100%; min-height: 78px; padding: 13px 18px; display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 10px; color: var(--dash-ink, #172541); text-align: left; background: transparent; border: 0; border-bottom: 1px solid #f1f2f6; cursor: pointer; transition: background .18s ease, transform .18s ease; }
.visitor-row:hover { background: #fffaf6; transform: translateX(2px); }
.visitor-row.active { background: linear-gradient(90deg, #fff5ee, #fff); box-shadow: inset 3px 0 0 var(--brand-orange, #ff6500); }
.visitor-avatar { position: relative; width: 38px; height: 38px; display: grid; place-items: center; border: 3px solid #fff; border-radius: 13px; background: #e8edff; color: var(--brand-navy, #062270); font-size: 10px; font-weight: 850; box-shadow: 0 4px 10px rgba(6,34,112,.1); }
.visitor-avatar::after { position: absolute; right: -2px; bottom: -2px; width: 8px; height: 8px; border: 2px solid #fff; border-radius: 50%; background: #aeb8c6; content: ""; }
.visitor-avatar.is-online::after { background: #34bc8c; }
.visitor-row-copy { min-width: 0; display: grid; gap: 4px; }
.visitor-row-copy strong, .visitor-row-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.visitor-row-copy strong { color: var(--brand-navy, #062270); font-size: 12px; }
.visitor-row-copy small { color: #95a1b2; font-size: 10px; }
.visitor-row-meta { display: grid; justify-items: end; gap: 5px; }
.visitor-presence { display: inline-flex; align-items: center; gap: 5px; color: #8492a5; font-size: 9px; font-weight: 800; white-space: nowrap; }
.visitor-presence i, .detail-channel i { width: 6px; height: 6px; display: inline-block; border-radius: 50%; background: #aeb8c6; }
.visitor-presence.is-online { color: #2a9b76; }
.visitor-presence.is-online i { background: #34bc8c; }
.visitor-row-meta time { color: #a1acb8; font-size: 9px; }
.visitor-detail-panel { background: #fff; }
.visitor-detail-header { position: relative; flex: 0 0 auto; min-height: 125px; padding: 20px 23px 16px; background: linear-gradient(135deg, #fffaf6, #fff); }
.visitor-detail-header::before { position: absolute; top: 0; right: 0; left: 0; height: 3px; background: linear-gradient(90deg, var(--brand-orange, #ff6500), #ff9b5d); content: ""; }
.visitor-detail-top { display: flex; align-items: center; gap: 8px; min-height: 28px; }
.visitor-page-chip { max-width: 46%; overflow: hidden; margin-left: auto; padding: 5px 8px; color: #718097; background: #f4f6fa; border-radius: 7px; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.visitor-detail-messages { min-height: 0; }
.visitor-reply { flex: 0 0 auto; }
.detail-empty { display: flex; align-items: center; flex-direction: column; justify-content: center; min-height: 200px; padding: 35px; color: #8d99ab; text-align: center; }
.detail-empty > span { display: grid; width: 43px; height: 43px; place-items: center; margin-bottom: 12px; color: #fff; background: var(--brand-orange, #ff6500); border-radius: 14px; }
.detail-empty strong { margin-bottom: 5px; color: var(--brand-navy, #062270); font-size: 14px; }
.detail-empty p { max-width: 290px; margin: 0; font-size: 11px; line-height: 1.55; }
@media (max-width: 980px) { .visitors-layout-live { height: auto; min-height: 0; } .visitors-list-panel { min-height: 520px !important; } .visitor-detail-panel { min-height: 600px !important; } }
@media (max-width: 620px) { .visitors-layout-live.has-selected .visitors-list-panel { display: none; } .visitors-layout-live.has-selected .visitor-detail-panel { position: fixed; z-index: 35; inset: 0; width: 100vw; height: 100dvh; min-height: 0 !important; border: 0; border-radius: 0; box-shadow: none; } .visitors-layout-live.has-selected .visitor-detail-header { padding: 14px 16px 16px; } .visitors-layout-live.has-selected .visitor-detail-top { justify-content: flex-start; } .visitors-layout-live.has-selected .visitor-page-chip { display: none; } .visitors-layout-live.has-selected .visitor-detail-messages { flex: 1 1 auto; padding: 18px 16px; } .visitors-layout-live.has-selected .visitor-reply { padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); } .visitors-layout-live.has-selected .reply-compose-row { flex-direction: row; align-items: flex-end; } .visitors-layout-live.has-selected .reply-compose-meta small { display: none; } }

@media (max-width: 620px) {
  .recent-conversation-row { grid-template-columns: 32px minmax(0, 1fr) auto; }
  .recent-conversation-meta time { display: none; }
}

/* Focus mode: the active conversation owns the available workspace. */
.inbox-layout-live { height: calc(100dvh - 250px); min-height: 520px; }
.inbox-layout-live .inbox-detail { min-width: 0; }
.detail-messages { flex: 1 1 auto; height: auto; min-height: 0; }
.admin-reply { flex: 0 0 auto; }
.inbox-layout-live .detail-header { min-height: 108px; padding: 17px 22px 15px; }
.reply-compose-row { display: flex; align-items: flex-end; gap: 10px; margin: 0 !important; }
.admin-reply .reply-compose-row textarea { flex: 1 1 auto; width: auto; min-width: 0; min-height: 46px; max-height: 112px; resize: vertical; }
.reply-compose-row .primary-button { flex: 0 0 auto; min-width: 76px; min-height: 46px; padding-inline: 14px; }
.reply-compose-meta { display: flex !important; align-items: center !important; justify-content: space-between !important; gap: 12px; margin-top: 7px !important; }
.reply-compose-meta small { color: #a4afbc; font-size: 9px; }

@media (min-width: 981px) {
  .inbox-layout-live { grid-template-columns: minmax(290px, 340px) minmax(0, 1fr); }
  .inbox-layout-live.has-selected { height: calc(100dvh - 250px); }
}

@media (max-width: 980px) {
  .inbox-page-heading { display: none; }
  .inbox-layout-live { height: auto; min-height: 0; }
  .dashboard-body.conversation-focus .topbar { display: none; }
  .dashboard-body.conversation-focus .content-area { padding: 0; }
  .inbox-layout-live.has-selected .inbox-list { display: none; }
  .inbox-layout-live.has-selected .inbox-detail { position: fixed; z-index: 70; inset: 0; width: 100vw; height: 100dvh; min-height: 0; border: 0; border-radius: 0; box-shadow: none; }
  .inbox-layout-live.has-selected .detail-header { min-height: 0; padding: 14px 16px 16px; }
  .inbox-layout-live.has-selected .detail-header-top { justify-content: flex-start; gap: 8px; }
  .inbox-layout-live.has-selected .mobile-inbox-back { position: static; display: inline-flex; flex: 0 0 auto; padding: 0; margin-right: 2px; border: 0; background: transparent; color: var(--brand-orange, #ff6500); font-size: 12px; font-weight: 850; }
  .inbox-layout-live.has-selected .conversation-status-button { margin-left: auto; }
  .inbox-layout-live.has-selected .detail-profile { margin-top: 10px; }
  .inbox-layout-live.has-selected .detail-messages { flex: 1 1 auto; padding: 18px 16px; }
  .inbox-layout-live.has-selected .admin-reply { padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); }
  .inbox-layout-live.has-selected .reply-compose-row { flex-direction: row; align-items: flex-end; }
  .inbox-layout-live.has-selected .reply-compose-meta small { display: none; }
  .inbox-layout-live.has-selected .admin-reply .reply-compose-row textarea { min-height: 46px; max-height: 90px; }
}

@media (max-width: 430px) {
  .inbox-layout-live.has-selected .detail-header { padding: 12px 12px 13px; }
  .inbox-layout-live.has-selected .detail-messages { padding-inline: 12px; }
  .inbox-layout-live.has-selected .admin-reply { padding-inline: 10px; }
  .reply-compose-row { gap: 7px; }
  .reply-compose-row .primary-button { min-width: 64px; padding-inline: 10px; }
  .reply-compose-row .primary-button span { display: none; }
}
