/*
 * WhatsLink brand override — loaded AFTER tp-apple-theme.css in every layout.
 * Never edit tp-apple-theme.css directly; it's a vendored copy shared with
 * TextPay/Mtumba so it can be re-synced later. All brand identity lives here.
 */
[x-cloak] {
  display: none !important;
}

/*
 * Password show/hide toggle — see assets/js/password-toggle.js, which
 * auto-wraps every input[type=password] on the page in .wl-password-wrapper
 * and injects the .wl-password-toggle button.
 */
.wl-password-wrapper {
  position: relative;
}
.wl-password-wrapper input {
  padding-right: 2.75rem !important;
}
.wl-password-toggle {
  position: absolute;
  right: 0.4rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--st-text-muted);
  cursor: pointer;
  padding: 0.35rem;
  display: flex;
  align-items: center;
  font-size: 1rem;
  line-height: 1;
}
.wl-password-toggle:hover {
  color: var(--st-text);
}

/*
 * Sidebar nav scrolling — tp-apple-theme.css's .st-sidebar sets
 * overflow:hidden (needed to clip the width/label transition when
 * collapsing), which also silently clips .sidebar-nav's content on
 * shorter viewports with nothing to scroll it back into view. Give the
 * nav its own scroll region instead of touching the vendored file.
 */
.st-sidebar {
  display: flex;
  flex-direction: column;
}
.sidebar-nav {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
}

/*
 * Bootstrap modals — tp-apple-theme.css never themes .modal-content/etc, so
 * every create/edit dialog (contacts, templates, team, API keys, webhooks,
 * plans...) rendered as a hardcoded-white Bootstrap box regardless of
 * data-theme-mode, even though the form fields inside already respect it.
 */
.modal-content {
  background-color: var(--st-surface-solid);
  color: var(--st-text);
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius-md);
}
.modal-header,
.modal-footer {
  border-color: var(--st-border);
}
.modal-title {
  color: var(--st-text);
}
[data-theme-mode="dark"] .btn-close {
  filter: invert(1) grayscale(100%) brightness(1.5);
}

:root {
  --st-primary: #0F9D6D;
  --st-primary-hover: #0B7A54;
  --st-primary-rgb: 15, 157, 109;
}

[data-theme-mode="dark"] {
  --st-primary: #16C48A;
  --st-primary-hover: #10A876;
  --st-primary-rgb: 22, 196, 138;
}

/*
 * Notification bell — not part of the vendored tp-apple-theme.css (neither
 * TextPay nor Mtumba define it), added here using the same design tokens so
 * it's dark-mode-aware automatically via var(--st-*).
 */
.notif-bell-btn {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--st-text);
  cursor: pointer;
  transition: background 0.2s ease;
  font-size: 1.1rem;
}
.notif-bell-btn:hover {
  background: rgba(var(--st-primary-rgb), 0.08);
}
.notif-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: #DC2626;
  color: #fff;
  font-size: 0.65rem;
  line-height: 16px;
  text-align: center;
  font-weight: 600;
}

/*
 * Docs code blocks — always-dark, tabbed (curl/PHP/Node) snippets used by
 * Views/public/docs/index.php. Deliberately theme-invariant (like a code
 * editor) rather than following data-theme-mode, since syntax-highlighted
 * terminal output reads better on a fixed dark background either way.
 */
.wl-code {
  position: relative;
  border-radius: 1rem;
  background: #0d1117;
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
  margin-bottom: 1rem;
}
.wl-code-tabs {
  display: flex;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.wl-code-tabs button {
  background: none;
  border: none;
  padding: 0.6rem 1.2rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.wl-code-tabs button:hover {
  color: rgba(255, 255, 255, 0.7);
}
.wl-code-tabs button.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  border-bottom-color: var(--st-primary);
}
.wl-code-body {
  position: relative;
}
.wl-code pre {
  display: none;
  margin: 0;
  padding: 1.1rem;
  font-size: 0.72rem;
  line-height: 1.6;
  color: #e6edf3;
  overflow-x: auto;
  white-space: pre;
}
.wl-code pre.active {
  display: block;
}
.wl-copy-btn {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  padding: 0.35rem 0.5rem;
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  font-size: 0.8rem;
}
.wl-copy-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}
.wl-copy-btn.copied {
  color: var(--st-primary);
}
.wl-copy-inline {
  padding: 0.35rem 0.5rem;
  border-radius: 0.5rem;
  background: rgba(var(--st-primary-rgb), 0.08);
  border: none;
  color: var(--st-primary);
  cursor: pointer;
  font-size: 0.8rem;
  line-height: 1;
}
.wl-copy-inline:hover {
  background: rgba(var(--st-primary-rgb), 0.16);
}
.wl-copy-inline.copied {
  color: #0f9d6d;
}
.wl-method-badge {
  display: inline-flex;
  padding: 0.3rem 0.7rem;
  border-radius: 0.5rem;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.wl-method-get { background: rgba(15, 157, 109, 0.15); color: var(--st-primary); }
.wl-method-post { background: rgba(37, 99, 235, 0.15); color: #2563EB; }
.wl-method-delete { background: rgba(220, 38, 38, 0.15); color: #DC2626; }
.wl-docs-nav a {
  display: block;
  padding: 0.4rem 0.75rem;
  border-radius: 0.6rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--st-text-muted, #6b7280);
  text-decoration: none;
}
.wl-docs-nav a:hover {
  color: var(--st-primary);
  background: rgba(var(--st-primary-rgb), 0.06);
}
.wl-docs-nav a.active {
  color: var(--st-primary);
  background: rgba(var(--st-primary-rgb), 0.1);
  font-weight: 800;
}
.wl-docs-param-table th {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.5;
  font-weight: 800;
}
.wl-docs-param-table code {
  color: var(--st-primary);
  font-weight: 700;
}

/*
 * Inbox provenance badges — small tag next to an outbound bubble's timestamp
 * showing whether an agent, the developer API, a bot flow, or a broadcast
 * sent it (docs/SYSTEM_AUDIT_AND_MONOLITH_ROADMAP.md Part B.6).
 */
.wl-provenance {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.65rem;
  font-weight: 700;
  opacity: 0.75;
  margin-top: 0.15rem;
}
.wl-msg-failed {
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.3);
  border-radius: 0.75rem;
  padding: 0.5rem 0.75rem;
}
.wl-msg-note {
  background: rgba(217, 119, 6, 0.08);
  border-left: 3px solid #D97706;
  border-radius: 0.5rem;
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
}

/*
 * Meter — a same-ramp track for a single ratio-against-a-limit (delivery
 * rate, read rate). Per the dataviz skill: a ratio like this is a meter, not
 * a 2-slice pie/donut — the fill is the brand accent, the track is a lighter
 * step of the same ramp so state reads across the whole bar.
 */
.wl-meter-track {
  height: 8px;
  border-radius: 4px;
  background: rgba(var(--st-primary-rgb), 0.15);
  overflow: hidden;
}
.wl-meter-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--st-primary);
  transition: width 0.3s ease;
}

/* ══════════════════════════════════════════════════════════════════════
 * Public marketing nav — floating "Dynamic Island" pill
 *
 * position:fixed, anchored to the viewport — deliberately NOT sticky.
 * tp-apple-theme.css sets `overflow-x:hidden` on both html and body, which
 * per spec forces the other axis's computed overflow to `auto`, turning
 * body into its own scroll container; position:sticky descendants lose
 * their "stick across the whole page" behavior in that setup (this is the
 * single most common reason sticky silently stops working). Fixed
 * positioning is immune to that since it's always relative to the
 * viewport, so the pill stays floating at the same spot regardless of
 * scroll position — see the compensating `main` padding-top below, since a
 * fixed element takes itself out of document flow entirely.
 * ══════════════════════════════════════════════════════════════════════ */
.wl-island-wrap {
  position: fixed;
  top: 1rem;
  left: 0;
  right: 0;
  z-index: 999;
  display: flex;
  justify-content: center;
  padding: 0 1rem;
  pointer-events: none;
}

/* Compensates for .wl-island-wrap being removed from flow — every public
 * page keeps its own hero padding-top for the gap AFTER the nav, this just
 * reserves the space the nav itself now floats over. Scoped to the direct
 * <main> child of the marketing layout only (dashboard/auth layouts don't
 * use this partial and don't have a bare <main> element). */
body.st-apple-ui > main {
  padding-top: 6rem;
}
.wl-island {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  max-width: 920px;
  padding: 0.55rem 0.6rem 0.55rem 1.1rem;
  border-radius: 999px;
  background: var(--st-glass-bg);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--st-glass-border);
  box-shadow: var(--st-shadow-lg);
}

.wl-island-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--st-text) !important;
  text-decoration: none !important;
  white-space: nowrap;
}
.wl-island-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--st-primary);
  box-shadow: 0 0 0 3px rgba(var(--st-primary-rgb), 0.18);
  flex-shrink: 0;
}

/* A live-activity chip, true and verifiable rather than a fabricated
 * counter — it just states the platform's real connection status. */
.wl-island-status {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  overflow: hidden;
  color: var(--st-text-muted);
  font: 500 0.78rem/1 var(--st-font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
  white-space: nowrap;
  margin-left: 0.25rem;
}
.wl-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--st-primary);
  flex-shrink: 0;
  animation: wl-pulse 2s ease-in-out infinite;
}
@keyframes wl-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(var(--st-primary-rgb), 0.5); }
  50% { box-shadow: 0 0 0 5px rgba(var(--st-primary-rgb), 0); }
}

.wl-island-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-left: auto;
  margin-right: 0.25rem;
}
.wl-island-links a {
  color: var(--st-text) !important;
  text-decoration: none !important;
  font-size: 0.88rem;
  font-weight: 600;
  opacity: 0.75;
  transition: opacity 0.15s ease;
}
.wl-island-links a:hover {
  opacity: 1;
}

.wl-island-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}
.wl-island-toggle {
  display: none;
}

@media (max-width: 991.98px) {
  .wl-island {
    padding: 0.5rem 0.5rem 0.5rem 1rem;
  }
  .wl-island-status,
  .wl-island-links {
    display: none;
  }
  .wl-island-toggle {
    display: inline-flex;
  }
}

/* Mobile menu sheet — only rendered/expanded state below the lg breakpoint,
 * dropped from a floating pill rather than a full-width bar to match. */
.wl-island-sheet {
  position: absolute;
  top: calc(100% + 0.6rem);
  left: 1rem;
  right: 1rem;
  background: var(--st-glass-bg);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--st-glass-border);
  border-radius: var(--st-radius-md);
  box-shadow: var(--st-shadow-lg);
  padding: 0.75rem;
  display: none;
  flex-direction: column;
  gap: 0.25rem;
}
.wl-island-sheet.is-open {
  display: flex;
}
.wl-island-sheet a {
  padding: 0.65rem 0.75rem;
  border-radius: var(--st-radius-sm);
  color: var(--st-text) !important;
  text-decoration: none !important;
  font-weight: 600;
  font-size: 0.92rem;
}
.wl-island-sheet a:hover {
  background: rgba(var(--st-primary-rgb), 0.08);
}

@media (prefers-reduced-motion: reduce) {
  .wl-pulse {
    animation: none !important;
  }
}

/* ══════════════════════════════════════════════════════════════════════
 * Landing hero — headline scale/tracking and the live chat demo panel
 * ══════════════════════════════════════════════════════════════════════ */
.wl-hero-title {
  font-size: clamp(2.75rem, 6vw, 5.25rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.04;
}
.wl-hero-sub {
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  line-height: 1.6;
  color: var(--st-text-muted);
}

.wl-chat-demo {
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
  padding: 1.5rem 1.35rem;
  border-radius: 28px;
  background: var(--st-glass-bg);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--st-glass-border);
  box-shadow: var(--st-shadow-lg);
  text-align: left;
}
.wl-chat-demo-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.1rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--st-border);
}
.wl-chat-demo-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--st-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.wl-chat-demo-title {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--st-text);
  line-height: 1.2;
}
.wl-chat-demo-sub {
  font-size: 0.72rem;
  color: var(--st-text-muted);
}
.wl-chat-bubble {
  max-width: 82%;
  padding: 0.55rem 0.85rem;
  border-radius: 16px;
  font-size: 0.82rem;
  line-height: 1.45;
  margin-bottom: 0.6rem;
  opacity: 0;
  transform: translateY(6px);
  animation: wl-bubble-in 0.5s ease forwards;
}
.wl-chat-bubble.in {
  background: var(--st-surface-solid);
  border: 1px solid var(--st-border);
  color: var(--st-text);
  border-bottom-left-radius: 4px;
}
.wl-chat-bubble.out {
  background: var(--st-primary);
  color: #fff;
  margin-left: auto;
  border-bottom-right-radius: 4px;
}
.wl-chat-bubble:nth-child(1) { animation-delay: 0.3s; }
.wl-chat-bubble:nth-child(2) { animation-delay: 1.1s; }
@keyframes wl-bubble-in {
  to { opacity: 1; transform: translateY(0); }
}
.wl-chat-tick {
  display: inline-flex;
  gap: 1px;
  margin-left: 0.35rem;
  font-size: 0.7rem;
  opacity: 0.8;
}
.wl-chat-tick.is-read {
  color: #34D6FF;
  animation: wl-tick-read 0.3s ease 1.9s forwards;
  opacity: 0.8;
}
@keyframes wl-tick-read {
  from { color: rgba(255, 255, 255, 0.75); }
  to { color: #34D6FF; }
}
@media (prefers-reduced-motion: reduce) {
  .wl-chat-bubble {
    opacity: 1;
    transform: none;
    animation: none !important;
  }
  .wl-chat-tick.is-read {
    animation: none !important;
    color: #34D6FF;
  }
}

/* Feature cards — quieter than .st-card's default border+shadow combo so a
 * 4-up grid reads as one calm surface, not four competing boxes. */
.wl-feature-card {
  padding: 1.85rem 1.6rem;
  border-radius: var(--st-radius-lg);
  background: var(--st-surface-solid);
  border: 1px solid var(--st-border);
  height: 100%;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.wl-feature-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--st-shadow-lg);
}
.wl-feature-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(var(--st-primary-rgb), 0.1);
  color: var(--st-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  margin-bottom: 1rem;
}

.wl-cta-banner {
  padding: clamp(2.5rem, 5vw, 4rem);
  border-radius: 32px;
  background: linear-gradient(135deg, var(--st-primary), var(--st-primary-hover));
  color: #fff;
  text-align: center;
}
.wl-cta-banner .btn {
  background: #fff;
  color: var(--st-primary) !important;
  font-weight: 700;
}
.wl-cta-banner .btn:hover {
  background: #fff;
  opacity: 0.92;
}

/* ══════════════════════════════════════════════════════════════════════
 * WhatsApp connection page (Settings → WhatsApp)
 * ══════════════════════════════════════════════════════════════════════ */

/* Segmented pill toggle — same shape language as the broadcast-create
 * "Pick contacts / Use a saved list" toggle, reused here for consistency
 * rather than plain Bootstrap nav-pills. */
.wl-segmented {
  display: inline-flex;
  padding: 0.25rem;
  border-radius: 999px;
  background: var(--st-bg);
  border: 1px solid var(--st-border);
  gap: 0.25rem;
}
.wl-segmented button {
  border: none;
  background: transparent;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--st-text-muted);
  transition: all 0.15s ease;
}
.wl-segmented button.active {
  background: var(--st-primary);
  color: #fff;
}

/* Trust callout — surfaces WhatsLink's own App ID as the FIRST thing seen
 * in the manual-connect flow, not buried at step 6 of a numbered list. This
 * is the single highest-leverage fix for the token/app-mismatch failure
 * mode: nobody can miss it if it's the header of the section. */
.wl-trust-callout {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-radius: var(--st-radius-md);
  background: rgba(var(--st-primary-rgb), 0.06);
  border: 1px solid rgba(var(--st-primary-rgb), 0.2);
  margin-bottom: 1.25rem;
}
.wl-trust-callout-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(var(--st-primary-rgb), 0.15);
  color: var(--st-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.wl-trust-callout-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  color: var(--st-text-muted);
  margin-bottom: 0.15rem;
}
.wl-trust-callout-id {
  font: 700 0.95rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--st-text);
  user-select: all;
}
.wl-trust-callout-copy {
  margin-left: auto;
  flex-shrink: 0;
}

/* Vertical stepper — a genuine sequence (each step depends on the previous
 * one having actually happened in Meta's own UI), so numbering carries real
 * information here, unlike a decorative 01/02/03. Steps flagged .is-critical
 * get a filled, brand-colored marker instead of an outline one — visually
 * separating "just find an ID" steps from "this is the part people get
 * wrong" steps. */
.wl-stepper {
  position: relative;
  padding-left: 2.25rem;
  list-style: none;
  margin: 0;
}
.wl-stepper-item {
  position: relative;
  padding-bottom: 1.35rem;
}
.wl-stepper-item:last-child {
  padding-bottom: 0;
}
.wl-stepper-item::before {
  content: '';
  position: absolute;
  left: -1.6rem;
  top: 1.6rem;
  bottom: -0.35rem;
  width: 2px;
  background: var(--st-border);
}
.wl-stepper-item:last-child::before {
  display: none;
}
.wl-stepper-num {
  position: absolute;
  left: -2.25rem;
  top: 0;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--st-surface-solid);
  border: 2px solid var(--st-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--st-text-muted);
}
.wl-stepper-item.is-critical .wl-stepper-num {
  border-color: var(--st-primary);
  color: #fff;
  background: var(--st-primary);
}
.wl-stepper-item p {
  margin: 0;
}

/* Business profile live preview — a lightweight "About" card, distinct from
 * the wl-bubble message preview elsewhere (this isn't a chat bubble, it's
 * what a contact sees when they tap the business name in WhatsApp). */
.wl-profile-preview {
  border-radius: var(--st-radius-lg);
  border: 1px solid var(--st-border);
  padding: 1.25rem;
}
.wl-profile-preview-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.wl-profile-preview-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(var(--st-primary-rgb), 0.12);
  color: var(--st-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.wl-profile-preview p,
.wl-profile-preview div {
  margin-bottom: 0.4rem;
}

/* Connected-number card — quality rating as a same-ramp dot+label (per the
 * dataviz skill: a rating like this is a status indicator, not a badge
 * blob) instead of a solid-fill badge competing with the status badge next
 * to it. */
.wl-number-card {
  border-radius: var(--st-radius-lg);
  background: var(--st-surface-solid);
  border: 1px solid var(--st-border);
  padding: 1.1rem 1.25rem;
  height: 100%;
  transition: box-shadow 0.2s ease;
}
.wl-number-card:hover {
  box-shadow: var(--st-shadow-lg);
}
.wl-quality-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.wl-quality-green { background: #16A34A; }
.wl-quality-yellow { background: #D97706; }
.wl-quality-red { background: #DC2626; }
.wl-quality-unknown { background: var(--st-text-muted); opacity: 0.4; }

/*
 * Inbox chat bubbles — WhatsApp-standard tail, per-message timestamp/ticks,
 * day dividers, and inline media rendering.
 */
.wl-bubble {
  position: relative;
  padding: 0.5rem 0.75rem;
  border-radius: 0.9rem;
  max-width: 70%;
}
.wl-bubble-out {
  background: var(--st-primary);
  color: #fff;
  border-bottom-right-radius: 0.2rem;
}
.wl-bubble-out::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: -6px;
  width: 12px;
  height: 12px;
  background: inherit;
  clip-path: polygon(0 0, 0 100%, 100% 100%);
}
.wl-bubble-in {
  background: rgba(0, 0, 0, 0.05);
  border-bottom-left-radius: 0.2rem;
}
[data-theme-mode="dark"] .wl-bubble-in {
  background: rgba(255, 255, 255, 0.08);
}
.wl-bubble-in::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: -6px;
  width: 12px;
  height: 12px;
  background: inherit;
  clip-path: polygon(100% 0, 0 100%, 100% 100%);
}
.wl-bubble-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.2rem;
  font-size: 0.65rem;
  opacity: 0.75;
  margin-top: 0.2rem;
}
.wl-tick-read { color: #34B7F1; }
.wl-bubble-media img,
.wl-bubble-media video {
  max-width: 260px;
  max-height: 260px;
  border-radius: 0.6rem;
  display: block;
  cursor: pointer;
}
.wl-bubble-media audio {
  max-width: 240px;
}
.wl-doc-card {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.6rem;
  border-radius: 0.5rem;
  background: rgba(0, 0, 0, 0.06);
  text-decoration: none;
  color: inherit;
}
.wl-bubble-out .wl-doc-card {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}
.wl-day-divider {
  display: flex;
  justify-content: center;
  margin: 0.85rem 0;
}
.wl-day-divider span {
  background: rgba(var(--st-primary-rgb), 0.1);
  color: var(--st-primary);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
}
.wl-inbox-row.unread .wl-contact-name,
.wl-inbox-row.unread .wl-last-message {
  font-weight: 800;
  color: var(--st-text);
}

/*
 * Tom Select theme parity — the vendored tom-select.bootstrap5.min.css uses
 * Bootstrap's own --bs-* variables, which this app never repoints to its
 * --st-* theme, so every Tom Select control (currently: the "New message"
 * contact picker) previously rendered as a plain, unstyled white box no
 * matter which theme mode was active. Mirrors the exact tokens
 * tp-apple-theme.css uses for .form-control/.form-select.
 */
.ts-wrapper.single .ts-control,
.ts-dropdown {
  background-color: var(--st-surface-solid) !important;
  color: var(--st-text) !important;
  border-color: var(--st-border) !important;
}
.ts-control input {
  color: var(--st-text) !important;
}
.ts-control input::placeholder {
  color: var(--st-placeholder);
}
.ts-wrapper.focus .ts-control {
  border-color: var(--st-primary) !important;
  box-shadow: 0 0 0 4px rgba(var(--st-primary-rgb), 0.12) !important;
}
.ts-dropdown .option.active,
.ts-dropdown .active.create {
  background-color: rgba(var(--st-primary-rgb), 0.1) !important;
  color: var(--st-text) !important;
}
.ts-dropdown .create {
  color: var(--st-primary) !important;
  font-weight: 700;
}
.ts-dropdown .no-results {
  color: var(--st-text-muted);
  font-size: 0.85rem;
}
[data-theme-mode="dark"] .ts-wrapper.single .ts-control,
[data-theme-mode="dark"] .ts-dropdown {
  background-color: #1c1c1e !important;
  color: var(--st-text) !important;
  border-color: rgba(255, 255, 255, 0.13) !important;
}
[data-theme-mode="dark"] .ts-wrapper.focus .ts-control {
  background-color: #232328 !important;
  border-color: var(--st-primary) !important;
}
