/* ==========================================================================
   Landing live demo (static/js/landing-demo.js), scoped to .landing-demo.

   The demo is drawn with the app's own markup and classes, so it picks up
   the real look from theme.css (tokens), shell.css (rail) and chat.css
   (inbox) and follows them when the app changes. This file only adds:

   1. The structural base those files expect from style.css (which the
      landing does not load). Written as :where(.landing-demo) .x so it
      has the weight of a single class and chat.css always wins.
   2. Sizing for a fixed-height window (no layout shift).
   3. Surfaces that have no shared stylesheet in the app: the Bitrix24
      deal card tab (inline CSS in crm_card_tab.html), the integrations
      cards (style.css + integrations.js) and the phone layout
      (chat_mobile.css, scoped to its own page). Kept to what is drawn.
   ========================================================================== */

/* ── Stage ── */
.demo__stage {
  position: relative;
  height: 640px;
  background: var(--wt-canvas);
  color: var(--wt-ink);
  font-family: var(--wt-font);
  font-size: 14px;
  line-height: 1.45;
  text-align: left;
}
.demo__panel { height: 100%; }
.landing-demo button { font-family: inherit; }
.landing-demo [hidden] { display: none !important; }
.landing-demo :focus-visible { outline: none; box-shadow: var(--wt-focus); }
.ld-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── 1. Structural base (from style.css) ── */
:where(.landing-demo) .flex { display: flex; }
:where(.landing-demo) .items-center { align-items: center; }
:where(.landing-demo) .gap-2 { gap: 8px; }
:where(.landing-demo) .gap-3 { gap: 12px; }

:where(.landing-demo) .chat-layout { display: flex; width: 100%; overflow: hidden; }
:where(.landing-demo) .chat-list { display: flex; flex-direction: column; flex-shrink: 0; }
:where(.landing-demo) .chat-list-search { width: 100%; outline: none; font-family: inherit; }
:where(.landing-demo) .chat-list-items { flex: 1; overflow-y: auto; }
:where(.landing-demo) .chat-item { display: flex; align-items: center; cursor: pointer; }
:where(.landing-demo) .chat-avatar { position: relative; flex-shrink: 0; }
:where(.landing-demo) .avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  line-height: 1;
}
:where(.landing-demo) .avatar-badge {
  position: absolute;
  border-radius: 50%;
  object-fit: contain;
}
:where(.landing-demo) .chat-info { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
:where(.landing-demo) .chat-header-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
:where(.landing-demo) .chat-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
:where(.landing-demo) .chat-time { flex-shrink: 0; white-space: nowrap; }
:where(.landing-demo) .chat-preview-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 3px; }
:where(.landing-demo) .chat-last-msg { display: flex; align-items: center; white-space: nowrap; overflow: hidden; flex: 1; min-width: 0; }
:where(.landing-demo) .chat-preview-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
:where(.landing-demo) .msg-status { display: inline-flex; align-items: center; flex-shrink: 0; margin-right: 1px; }
:where(.landing-demo) .msg-media-icon { display: inline-flex; flex-shrink: 0; color: var(--wt-ink-3); }
:where(.landing-demo) .chat-unread-badge { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }

:where(.landing-demo) .chat-conversation { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
:where(.landing-demo) .chat-conversation-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  overflow: hidden;
  flex-shrink: 0;
}
:where(.landing-demo) .chat-conversation-header > div:first-child { min-width: 0; flex: 1 1 auto; }
:where(.landing-demo) .chat-header-actions { flex-shrink: 0; }
:where(.landing-demo) .chat-header-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  white-space: nowrap;
  cursor: pointer;
}
:where(.landing-demo) .chat-messages { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }
:where(.landing-demo) .date-separator { text-align: center; }
:where(.landing-demo) .date-separator span { display: inline-block; border-radius: 12px; }
:where(.landing-demo) .message-wrap { display: flex; flex-direction: column; }
:where(.landing-demo) .message-wrap-incoming { align-self: flex-start; align-items: flex-start; }
:where(.landing-demo) .message-wrap-outgoing { align-self: flex-end; align-items: flex-end; }
:where(.landing-demo) .message { position: relative; }
:where(.landing-demo) .message-text { overflow-wrap: break-word; white-space: pre-wrap; }
:where(.landing-demo) .message-meta {
  float: right;
  display: inline-flex;
  align-items: center;
  margin: 4px 0 -2px 8px;
  line-height: 1;
  white-space: nowrap;
}
:where(.landing-demo) .message-media { margin: 4px 0; max-width: 300px; overflow: hidden; }
:where(.landing-demo) .message-media img { display: block; max-width: 100%; margin-bottom: 4px; }

:where(.landing-demo) .voice-player { display: flex; align-items: center; gap: 10px; padding: 2px 4px; min-width: 240px; max-width: 340px; }
:where(.landing-demo) .voice-play-btn {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
}
:where(.landing-demo) .voice-speed-btn {
  flex-shrink: 0;
  min-width: 34px;
  height: 24px;
  padding: 0 7px;
  border: 0;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  color: var(--wt-ink-2);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
:where(.landing-demo) .voice-wave-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
:where(.landing-demo) .voice-wave { position: relative; height: 24px; overflow: hidden; border-radius: 4px; cursor: pointer; }
:where(.landing-demo) .voice-wave-progress { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 4px; z-index: 1; }
:where(.landing-demo) .voice-wave-bars { position: relative; z-index: 2; display: flex; align-items: flex-end; gap: 2px; height: 100%; }
:where(.landing-demo) .voice-wave-bars span { flex: 1; min-width: 2px; max-width: 5px; border-radius: 2px; transition: background 0.2s; }
:where(.landing-demo) .voice-time { font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; }

:where(.landing-demo) .msg-video-note {
  position: relative;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  overflow: hidden;
  background: #0A0A0A;
  line-height: 0;
}
:where(.landing-demo) .msg-video-note__poster { width: 100%; height: 100%; object-fit: cover; display: block; margin: 0; }
:where(.landing-demo) .msg-video-note__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.18);
}
:where(.landing-demo) .msg-video-note__overlay svg { width: 28px; height: 28px; margin-left: 3px; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5)); }

:where(.landing-demo) .reactions-row { clear: both; display: flex; flex-wrap: wrap; gap: 3px; margin-top: -2px; padding: 0 6px; position: relative; z-index: 1; }
:where(.landing-demo) .reaction-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  border-radius: 999px;
  border: 0.5px solid rgba(0, 0, 0, 0.05);
  background: var(--wt-surface);
  color: var(--wt-ink);
  font-size: 12px;
  line-height: 1.2;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
:where(.landing-demo) .reaction-emoji { font-size: 13px; line-height: 1; }
:where(.landing-demo) .reaction-stack { display: inline-flex; align-items: center; gap: 2px; margin-left: 2px; }
:where(.landing-demo) .reaction-by {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #64748B;
  color: #FFFFFF;
  font-size: 9px;
  font-weight: 700;
}

:where(.landing-demo) .chat-input-area { display: flex; align-items: flex-end; }
:where(.landing-demo) .chat-input {
  flex: 1;
  border: 0;
  outline: none;
  resize: none;
  font-family: inherit;
}
:where(.landing-demo) .chat-send-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 0;
  cursor: pointer;
}
:where(.landing-demo) .chat-send-btn svg { width: 18px; height: 18px; }

/* Rail items (style.css base for .nav-item, shell.css colours them) */
:where(.landing-demo) .nav-item {
  display: flex;
  align-items: center;
  position: relative;
  width: 100%;
  border: 0;
  background: none;
  text-align: left;
  text-decoration: none;
}
:where(.landing-demo) .nav-section-title { text-transform: uppercase; }
:where(.landing-demo) .nav-badge { margin-left: auto; border-radius: 999px; min-width: 20px; text-align: center; }

/* ── 2. Demo sizing / app shell ── */
.ld-app { display: flex; height: 100%; }
.ld-rail {
  width: 212px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--wt-rail);
  box-shadow: inset -3px 0 0 var(--wt-rail-edge);
  color: var(--wt-rail-ink);
  overflow: hidden;
}
.ld-rail__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 18px 8px;
  color: #FFFFFF;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.ld-rail .sidebar-nav { padding: 2px 10px 10px; }
.ld-rail .nav-section-title { padding: 12px 12px 4px; }
.ld-rail .nav-item { padding: 8px 12px; font-size: 13.5px; gap: 10px; }
.ld-rail span.nav-item { cursor: default; }
.ld-rail span.nav-item:hover { background: none; color: var(--wt-rail-ink); }
.ld-rail button.nav-item { cursor: pointer; }
.ld-rail .nav-item:focus-visible { box-shadow: none; outline: 2px solid var(--wt-rail-edge); outline-offset: -2px; }
.ld-rail .nav-icon { display: inline-flex; }
.ld-rail .nav-item__label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ld-app__page { flex: 1; min-width: 0; height: 100%; padding: 12px; }

.landing-demo .chat-layout { height: 100%; border-radius: 12px; }
.landing-demo .chat-layout .chat-list { width: 320px; }
.landing-demo .chat-folder-rail { -webkit-mask-image: none; mask-image: none; }
.landing-demo .chat-item { width: calc(100% - 16px); text-align: left; font: inherit; color: inherit; }
.landing-demo .chat-item .chat-assignee-row { line-height: 1; }
.landing-demo .chat-assignee__icon svg { width: 11px; height: 11px; }
.landing-demo .avatar-badge { width: 18px; height: 18px; }
.landing-demo .chat-header-btn .ld-ico,
.landing-demo .chat-header-btn svg { width: 16px; height: 16px; }
.landing-demo .chat-header-btn--more svg { width: 18px; height: 18px; }
.ld-back { display: none; }
.landing-demo .chat-messages { overscroll-behavior: contain; }
.landing-demo .message-wrap--new { animation: ld-msg-in 200ms ease-out both; }
@keyframes ld-msg-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

#chat-contact-status .ld-ch-ico { width: 14px; height: 14px; border-radius: 50%; }
#chat-contact-status.typing-active { color: var(--wt-ok); font-weight: 600; }

.landing-demo .msg-image-thumb { width: 260px; height: 195px; object-fit: cover; cursor: default; }
.landing-demo .message-call {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 200px;
  padding: 10px 12px;
  border-radius: 10px;
}
.landing-demo .message-call__ico {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--wt-surface);
}
.landing-demo .message-call__dir {
  position: absolute;
  right: -2px;
  bottom: -2px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  color: var(--wt-surface);
}
.landing-demo .message-call__title { font-weight: 600; font-size: 13px; line-height: 1.3; }
.landing-demo .message-call__sub { font-size: 12px; opacity: 0.85; }

/* Saved-reply strip (chat.css styles #canned-bar / #canned-suggestions .btn) */
#canned-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
#canned-bar .ld-canned__label { display: inline-flex; align-items: center; gap: 6px; color: var(--wt-ink-3); font-size: 12px; font-weight: 600; }
#canned-suggestions { display: flex; gap: 6px; flex-wrap: wrap; }
#canned-suggestions .btn {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
#canned-suggestions .btn.is-picked { background: var(--wt-brand-soft); color: var(--wt-brand-ink); border-color: var(--wt-brand-soft-2) !important; }

/* Read-tick colour stays the app's (#53bdeb read, slate sent) */
.landing-demo .composer-field .chat-input { height: 36px; }

/* ── 3a. Bitrix24 deal card with the WaTell tab ── */
.ld-b24 { display: flex; flex-direction: column; height: 100%; background: #EEF2F4; color: #333; }
.ld-b24__top { display: flex; align-items: baseline; gap: 14px; padding: 16px 22px 10px; flex-wrap: wrap; }
.ld-b24__crumb { color: #6B7785; font-size: 13px; }
.ld-b24__title { font-size: 20px; font-weight: 600; color: #333; letter-spacing: -0.01em; }
.ld-b24__stages { display: flex; gap: 3px; padding: 0 22px 12px; overflow: hidden; }
.ld-b24__stage {
  flex: 1 1 0;
  min-width: 0;
  padding: 7px 10px;
  background: #DFE5EA;
  color: #4F5B67;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 0 100%, 8px 50%);
}
.ld-b24__stage:first-child { clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 0 100%); border-radius: 4px 0 0 4px; }
.ld-b24__stage.is-done { background: #39A8EF; color: #06263D; }
.ld-b24__stage.is-current { background: #1B7BC4; color: #FFFFFF; }
.ld-b24__tabs { display: flex; gap: 2px; padding: 0 22px; border-bottom: 1px solid #D5DDE3; }
.ld-b24__tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border-radius: 8px 8px 0 0;
  color: #525C69;
  font-size: 13px;
  font-weight: 600;
}
.ld-b24__tab.is-active { background: #FFFFFF; color: #1F2D3A; box-shadow: inset 0 2px 0 #2FC6F6; }
.ld-b24__body { flex: 1; min-height: 0; padding: 0 22px 18px; }
.ld-b24__body .ld-crm { height: 100%; border-radius: 0 0 10px 10px; }

.ld-crm {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  background: #F8FAFC;
  color: #1E293B;
  font-size: 14px;
}
.ld-crm .chat-tabs { display: flex; gap: 6px; padding: 8px 12px; background: #FFFFFF; border-bottom: 1px solid #E2E8F0; overflow-x: auto; scrollbar-width: none; }
.ld-crm .chat-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 6px 10px 6px 6px;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  background: #F8FAFC;
  color: #1E293B;
  font: 400 13px/1.2 var(--wt-font);
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
}
.ld-crm .chat-tab:hover { background: #F1F5F9; border-color: #CBD5E1; }
.ld-crm .chat-tab.active { background: rgba(4, 120, 87, 0.08); border-color: #047857; color: #047857; }
.ld-crm .ct-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
}
.ld-crm .ct-text { display: flex; flex-direction: column; text-align: left; }
.ld-crm .ct-name { font-weight: 600; font-size: 12.5px; }
.ld-crm .ct-sub { font-size: 12px; color: #64748B; }
.ld-crm .chat-tab.active .ct-sub { color: #065F46; }
.ld-crm .platform-badge { padding: 1px 6px; border-radius: 4px; background: #E2E8F0; color: #475569; font-size: 12px; font-weight: 600; }
.ld-crm .chat-tab.active .platform-badge { background: rgba(4, 120, 87, 0.15); color: #065F46; }
.ld-crm .ct-unread {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #047857;
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ld-crm .platform-whatsapp { background: #0D7D6F; }
.ld-crm .platform-telegram { background: #0A6FB0; }
.ld-crm .chat-header { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: #FFFFFF; border-bottom: 1px solid #E2E8F0; }
.ld-crm .chat-avatar { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #FFFFFF; font-weight: 600; flex-shrink: 0; }
.ld-crm .chat-header-info { flex: 1; min-width: 0; }
.ld-crm .chat-header-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ld-crm .chat-header-name small { margin-left: 6px; font-weight: 400; color: #475569; font-size: 13px; }
.ld-crm .chat-header-meta { font-size: 12px; color: #64748B; }
.ld-crm .crm-actions { display: flex; gap: 4px; align-items: flex-start; flex-shrink: 0; }
.ld-crm .crm-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 36px;
  padding: 4px 10px;
  border: 1px solid #E2E8F0;
  border-radius: 4px;
  background: #F8FAFC;
  color: #475569;
  font: 500 12px/1.2 var(--wt-font);
  white-space: nowrap;
}
.ld-crm .crm-btn-open { background: #ECFDF5; border-color: #A7F3D0; color: #047857; font-weight: 600; }
.ld-crm .crm-existing { display: inline-flex; flex-direction: column; gap: 2px; max-width: 200px; }
.ld-crm .crm-existing-link { font-size: 12px; color: #5B6678; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ld-crm .open-in-watel {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid #3B82F6;
  border-radius: 6px;
  background: #EFF6FF;
  color: #1D4ED8;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.ld-crm .messages-container { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 16px; }
.ld-crm .message-row { display: flex; flex-direction: column; max-width: 78%; }
.ld-crm .message-row.incoming { align-self: flex-start; }
.ld-crm .message-row.outgoing { align-self: flex-end; align-items: flex-end; }
.ld-crm .message-bubble { padding: 8px 12px; border-radius: 12px; font-size: 13.5px; line-height: 1.4; overflow-wrap: break-word; }
.ld-crm .incoming .message-bubble { background: #FFFFFF; border: 1px solid #E2E8F0; border-bottom-left-radius: 4px; }
.ld-crm .outgoing .message-bubble { background: #047857; color: #FFFFFF; border-bottom-right-radius: 4px; }
.ld-crm .message-time { display: flex; justify-content: flex-end; align-items: center; gap: 3px; margin-top: 2px; font-size: 12px; color: #5B6678; }
.ld-crm .outgoing .message-time { color: rgba(255, 255, 255, 0.92); }
.ld-crm .outgoing .message-time svg path { stroke: currentColor; }
.ld-crm .date-separator { text-align: center; padding: 6px 0; }
.ld-crm .date-separator span { display: inline-block; padding: 2px 10px; border-radius: 10px; background: #E2E8F0; color: #475569; font-size: 12px; }
.ld-crm .ld-crm-media { display: flex; align-items: center; gap: 6px; }
/* Bitrix24 cards stay light in a dark OS theme, so their chips do too. */
.ld-crm .reaction-chip { background: #FFFFFF; color: #1E293B; border-color: rgba(0, 0, 0, 0.06); }
.ld-crm .reply-box { display: flex; align-items: center; gap: 8px; padding: 10px 16px; background: #FFFFFF; border-top: 1px solid #E2E8F0; }
.ld-crm .reply-input {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 9px 12px;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  font: 400 13.5px/1.4 var(--wt-font);
  color: #1E293B;
  background: #FFFFFF;
  resize: none;
  outline: none;
}
.ld-crm .reply-input::placeholder { color: #6B7585; }
.ld-crm .reply-input:focus { border-color: #1D4ED8; box-shadow: 0 0 0 2px #FFFFFF, 0 0 0 4px #1D4ED8; }
.ld-crm .reply-tool { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent; color: #64748B; }
.ld-crm .reply-btn { min-height: 40px; padding: 0 16px; border: 0; border-radius: 8px; background: #1D4ED8; color: #FFFFFF; font: 600 13px/1 var(--wt-font); cursor: pointer; }
.ld-crm .reply-btn:hover { background: #1E40AF; }
.ld-crm .ld-crm__foot { padding: 8px; text-align: center; background: #FFFFFF; border-top: 1px solid #F1F5F9; color: #1D4ED8; font-size: 12.5px; }

/* ── 3b. Integrations page ── */
.ld-int { height: 100%; overflow-y: auto; padding: 20px 22px; border-radius: 12px; background: var(--wt-canvas); overscroll-behavior: contain; }
.ld-int .ds-page-head { margin-bottom: 16px; }
.ld-int .ds-page-head__title { font-size: 24px; margin: 0; }
.ld-int .ds-page-head__sub { margin: 4px 0 0; }
.ld-int .ds-card { margin-bottom: 14px; overflow: hidden; border: 1px solid var(--wt-line); border-radius: 12px; background: var(--wt-surface); }
.ld-int .ds-card__head { padding: 14px 18px; border-bottom: 1px solid var(--wt-line); }
.ld-int .ds-card__title { margin: 0; font-size: 15px; font-weight: 600; }
.ld-int .ds-card__sub { margin-top: 2px; color: var(--wt-ink-3); font-size: 13px; }
.ld-int .ds-card__body { padding: 16px 18px; }
.ld-int .platform-add-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.ld-int .platform-add-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1.5px dashed var(--wt-line-strong);
  border-radius: 12px;
  background: var(--wt-surface);
  color: var(--wt-ink);
}
.ld-int .platform-add-icon { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0; }
.ld-int .platform-add-icon img, .ld-int .platform-add-icon svg, .ld-int .integration-icon img, .ld-int .integration-icon svg { width: 26px; height: 26px; }
.ld-int .platform-add-title { font-size: 13.5px; font-weight: 600; }
.ld-int .platform-add-count { margin-top: 2px; color: var(--wt-ink-3); font-size: 12px; }
.ld-int .integration-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.ld-int .integration-card { padding: 18px; border: 1px solid var(--wt-line); border-radius: 12px; background: var(--wt-surface); }
.ld-int .integration-card-header { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.ld-int .integration-icon { display: flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 10px; flex-shrink: 0; }
.ld-int .integration-card-title { margin: 0; font-size: 15px; font-weight: 700; line-height: 1.25; }
.ld-int .integration-card-desc { margin: 2px 0 0; color: var(--wt-ink-2); font-size: 12px; }
.ld-int .badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.ld-int .badge-success { background: var(--wt-ok-bg); color: var(--wt-ok-ink); }
.ld-int .badge-warning { background: var(--wt-warn-bg); color: var(--wt-warn-ink); }
.ld-int .integration-pending { margin-top: 6px; color: var(--wt-warn-ink); font-size: 13px; }
.ld-int .integration-features { display: flex; gap: 6px; margin-top: 6px; }
.ld-int .feature-tag { padding: 1px 8px; border-radius: 6px; background: var(--wt-info-bg); color: var(--wt-info-ink); font-size: 12px; font-weight: 600; }
.ld-int .integration-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 12px; }
.ld-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--wt-ink-2);
  font: 600 13px/1 var(--wt-font);
  white-space: nowrap;
}
.ld-btn--ghost { padding: 0 2px; }
.ld-btn--secondary { border-color: var(--wt-line-strong); background: var(--wt-surface); color: var(--wt-ink); }
.ld-btn--primary { background: var(--wt-brand); color: var(--wt-on-brand); cursor: pointer; }
.ld-btn--primary:hover { background: var(--wt-brand-hover); }
.ld-qr { display: flex; gap: 14px; align-items: center; margin-top: 12px; padding: 12px; border: 1px solid var(--wt-line); border-radius: 10px; background: var(--wt-surface-2); }
.ld-qr svg { width: 92px; height: 92px; flex-shrink: 0; border-radius: 6px; background: #FFFFFF; padding: 6px; }
.ld-qr__title { font-weight: 700; font-size: 13.5px; }
.ld-qr__hint { margin-top: 2px; color: var(--wt-ink-2); font-size: 12.5px; }
.ld-qr__state { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; color: var(--wt-ink-3); font-size: 12.5px; font-weight: 600; }
.ld-qr__spin { width: 12px; height: 12px; border: 2px solid var(--wt-line-strong); border-top-color: var(--wt-brand); border-radius: 50%; animation: ld-spin 0.8s linear infinite; }
@keyframes ld-spin { to { transform: rotate(360deg); } }

/* ── 3c. Phone layout (mirrors chat_mobile.css) ── */
.ld-phones {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  height: 100%;
  padding: 20px;
  background: var(--wt-canvas);
}
.ld-phone {
  position: relative;
  width: 290px;
  height: 590px;
  flex-shrink: 0;
  padding: 10px;
  border-radius: 40px;
  background: #0F1417;
  box-shadow: 0 24px 50px -24px rgba(2, 20, 18, 0.55), inset 0 0 0 2px #2A3236;
}
.ld-phone__screen {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border-radius: 31px;
  background: var(--wt-canvas);
}
.ld-mv-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 52px;
  padding: 18px 8px 0 12px;
  box-sizing: content-box;
  background: var(--wt-rail);
  color: #FFFFFF;
  box-shadow: inset 0 -3px 0 var(--wt-rail-edge);
  flex-shrink: 0;
}
.ld-mv-brand { display: inline-flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 700; letter-spacing: -0.02em; margin-right: auto; }
.ld-mv-icon { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 10px; background: transparent; color: #FFFFFF; cursor: pointer; flex-shrink: 0; }
.ld-mv-icon svg { width: 20px; height: 20px; }
span.ld-mv-icon { cursor: default; }
.ld-mv-icon:focus-visible { outline: 2px solid var(--wt-rail-edge); outline-offset: -2px; box-shadow: none; }
.ld-mv-who { display: flex; align-items: center; gap: 8px; min-width: 0; margin-right: auto; }
.ld-mv-who .avatar-placeholder { width: 34px; height: 34px; background: var(--wt-brand-soft); color: var(--wt-brand-ink); font-weight: 700; font-size: 14px; flex-shrink: 0; }
.ld-mv-who b { display: block; font-size: 15px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ld-mv-who small { display: flex; align-items: center; gap: 4px; font-size: 12px; color: rgba(255, 255, 255, 0.8); white-space: nowrap; }
.ld-mv-who small img { width: 12px; height: 12px; }
.ld-mv-filters { display: flex; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--wt-line); background: var(--wt-surface); }
.ld-mv-pill { padding: 6px 14px; border: 1px solid var(--wt-line-strong); border-radius: 999px; color: var(--wt-ink-2); font-size: 13px; font-weight: 600; }
.ld-mv-pill.is-active { background: var(--wt-brand-soft); border-color: var(--wt-brand-soft-2); color: var(--wt-brand-ink); }
.ld-mv-list { flex: 1; overflow-y: auto; background: var(--wt-surface); }
.ld-mv-list .chat-item { width: 100%; gap: 10px; padding: 10px 12px; margin: 0; border: 0; border-radius: 0; background: transparent; }
.ld-mv-list .chat-item:hover { background: var(--wt-surface-2); }
.ld-mv-list .chat-item.active { background: var(--wt-brand-soft); }
.ld-mv-list .chat-avatar, .ld-mv-list .avatar-placeholder { width: 44px; height: 44px; }
.ld-mv-list .avatar-placeholder { background: var(--wt-brand-soft); color: var(--wt-brand-ink); font-size: 16px; font-weight: 700; }
.ld-mv-list .avatar-badge { right: -2px; bottom: -2px; width: 17px; height: 17px; border: 2px solid var(--wt-surface); background: var(--wt-surface); }
.ld-mv-list .chat-info { padding-bottom: 10px; margin-bottom: -10px; border-bottom: 1px solid var(--wt-line); }
.ld-mv-list .chat-name { font-size: 14.5px; font-weight: 600; color: var(--wt-ink); }
.ld-mv-list .chat-time { font-size: 12px; color: var(--wt-ink-3); }
.ld-mv-list .chat-time-unread { color: var(--wt-brand-ink); font-weight: 700; }
.ld-mv-list .chat-last-msg { gap: 4px; font-size: 13px; color: var(--wt-ink-2); }
.ld-mv-list .chat-unread-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--wt-brand); color: #FFFFFF; font-size: 12px; font-weight: 700; }
.ld-mv-bottom { display: flex; border-top: 1px solid var(--wt-line); background: var(--wt-surface); padding: 6px 6px 14px; flex-shrink: 0; }
.ld-mv-bn { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--wt-ink-2); font-size: 11.5px; font-weight: 600; }
.ld-mv-bn i { display: grid; place-items: center; width: 52px; height: 28px; border-radius: 14px; }
.ld-mv-bn i svg { width: 20px; height: 20px; }
.ld-mv-bn.is-active { color: var(--wt-brand-ink); }
.ld-mv-bn.is-active i { background: var(--wt-brand-soft); }
.landing-demo .ld-mv-thread.chat-layout { flex: 1; min-height: 0; height: auto; border: 0; border-radius: 0; background: var(--wt-canvas); }
.landing-demo .ld-mv-thread .chat-messages { padding: 12px 10px; gap: 10px; }
.landing-demo .ld-mv-thread .message-wrap { max-width: 86%; }
.landing-demo .ld-mv-thread .message { font-size: 14px; }
.landing-demo .ld-mv-thread .msg-image-thumb { width: 200px; height: 150px; }
.landing-demo .ld-mv-thread .msg-video-note { width: 150px; height: 150px; }
.landing-demo .ld-mv-thread .voice-player { min-width: 190px; }
.ld-mv-composer { display: flex; align-items: center; gap: 6px; padding: 8px 8px 16px; background: var(--wt-surface); border-top: 1px solid var(--wt-line); flex-shrink: 0; }
.ld-mv-field { flex: 1; min-width: 0; display: block; line-height: 38px; height: 40px; padding: 0 12px; border: 1px solid var(--wt-field); border-radius: 20px; color: var(--wt-placeholder); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ld-mv-send { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--wt-neutral-bg); color: var(--wt-ink-3); flex-shrink: 0; }
.ld-mv-send svg, .ld-mv-tool svg { width: 20px; height: 20px; }
.ld-mv-tool { display: inline-grid; place-items: center; width: 32px; height: 40px; color: var(--wt-ink-3); flex-shrink: 0; }
.ld-phone-copy { max-width: 300px; }
.ld-phone-copy h3 { font-size: 22px; font-weight: 700; letter-spacing: -0.015em; }
.ld-phone-copy p { margin-top: 10px; color: var(--wt-ink-2); font-size: 15px; }

/* ── Dark tints the app sets in style.css for these surfaces ── */
@media (prefers-color-scheme: dark) {
  :root:not(.light-mode) .landing-demo .reaction-chip { border-color: rgba(255, 255, 255, 0.08); }
  :root:not(.light-mode) .landing-demo .voice-speed-btn { background: rgba(255, 255, 255, 0.1); }
  :root:not(.light-mode) .ld-int .platform-add-btn { background: var(--wt-surface); }
}

/* ── Responsive ── */
@media (max-width: 1240px) {
  .ld-rail { width: 64px; }
  .ld-rail__brand span,
  .ld-rail .nav-section-title,
  .ld-rail .nav-item__label,
  .ld-rail .nav-badge { display: none; }
  .ld-rail__brand { justify-content: center; padding: 16px 0 10px; }
  .ld-rail .sidebar-nav { padding: 4px 8px; }
  .ld-rail .nav-item { justify-content: center; padding: 10px 0; }
  .landing-demo .chat-layout .chat-list { width: 290px; }
}
@media (max-width: 1100px) {
  .demo__stage { height: 600px; }
  .ld-phone-copy { display: none; }
}
@media (max-width: 900px) {
  .ld-phones .ld-phone--b { display: none; }
}
@media (max-width: 760px) {
  .demo__stage { height: 580px; }
  .ld-rail { display: none; }
  .ld-app__page { padding: 0; }
  .landing-demo .chat-layout { border: 0; border-radius: 0; }
  .landing-demo .chat-layout .chat-list { width: 100%; border-right: 0; }
  .ld-inbox[data-mode="thread"] .chat-list { display: none; }
  .ld-inbox[data-mode="list"] .chat-conversation { display: none; }
  .ld-back { display: inline-flex; }
  .landing-demo .chat-layout .chat-conversation-header { padding: 8px 10px 8px 6px; }
  .landing-demo .chat-header-actions .chat-header-btn--crm,
  .landing-demo .chat-header-actions #chat-close-btn { display: none; }
  .landing-demo .chat-layout .chat-messages { padding: 12px 12px 14px; }
  .landing-demo .chat-layout .message-wrap { max-width: 88%; }
  .landing-demo .msg-image-thumb { width: 210px; height: 158px; }
  .landing-demo .msg-video-note { width: 150px; height: 150px; }
  .landing-demo .voice-player { min-width: 200px; }
  .landing-demo .chat-layout .chat-input-area { padding: 8px 8px 10px; gap: 4px; }
  .landing-demo .chat-layout .chat-attach-btn,
  .landing-demo .chat-layout .chat-mic-btn { width: 36px; }
  .landing-demo .composer-field .composer-tool { display: none; }
  #canned-bar { padding: 6px 10px !important; }
  #canned-bar .ld-canned__label { display: none; }
  #canned-suggestions { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }

  .ld-b24__top { padding: 12px 12px 8px; }
  .ld-b24__title { font-size: 16px; }
  .ld-b24__crumb { display: none; }
  .ld-b24__stages { padding: 0 12px 10px; }
  .ld-b24__stage { font-size: 0; height: 8px; padding: 0; }
  .ld-b24__tabs { padding: 0 12px; overflow-x: auto; scrollbar-width: none; }
  .ld-b24__tab { padding: 8px 10px; white-space: nowrap; }
  .ld-b24__body { padding: 0 12px 12px; }
  .ld-crm .chat-header { flex-wrap: wrap; padding: 8px 10px; }
  .ld-crm .crm-actions { width: 100%; overflow-x: auto; scrollbar-width: none; }
  .ld-crm .crm-existing-link { display: none; }
  .ld-crm .messages-container { padding: 10px; }
  .ld-crm .message-row { max-width: 88%; }
  .ld-crm .reply-box { padding: 8px; gap: 4px; }
  .ld-crm .reply-tool--attach, .ld-crm .reply-tool--mic { display: none; }

  .ld-int { padding: 14px 12px; border-radius: 0; }
  .ld-int .platform-add-grid { grid-template-columns: 1fr 1fr; }
  .ld-int .platform-add-btn { padding: 10px; gap: 8px; }
  .ld-int .platform-add-icon { width: 32px; height: 32px; }
  .ld-int .platform-add-title { font-size: 12.5px; }

  .ld-phones { padding: 0; align-items: stretch; background: var(--wt-canvas); }
  .ld-phone { width: 100%; max-width: 340px; height: 100%; padding: 0; border-radius: 0; background: transparent; box-shadow: none; }
  .ld-phone__screen { border-radius: 0; }
  .ld-mv-bar { padding-top: 0; }
  .ld-mv-bottom { padding-bottom: 6px; }
  .ld-mv-composer { padding-bottom: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .landing-demo .message-wrap--new { animation: none; }
  .ld-qr__spin { animation-duration: 2.4s; }
}
