/* ==========================================================================
   The Privé Concierge — Official Brand Identity Stylesheet (theprive.vn)
   Palette: Deep Ocean Navy (#093f6a -> #04243d), Royal Navy (#1c448c),
            Signature Rose Copper Gradient (#9b524b -> #ea8d6b -> #9b524b)
   Typography: Montserrat (Headings) + Be Vietnam Pro (Body)
   100% White-Label Configurable via CSS Custom Properties
   ========================================================================== */

:root {
  --brand-primary: #1c448c;
  --accent-start: #ea8d6b;
  --accent-end: #9b524b;
  --gold: var(--accent-start);
  --gold-light: #fca788;
  --gold-dim: rgba(234, 141, 107, 0.14);
  --gold-border: rgba(234, 141, 107, 0.36);
  --brand-gradient: linear-gradient(90deg, var(--accent-end) 0%, var(--accent-start) 50%, var(--accent-end) 100%);
  --heading-gradient: linear-gradient(90deg, var(--accent-start) 0%, #ffd2be 50%, var(--accent-start) 100%);
  --btn-gradient: linear-gradient(135deg, var(--accent-start) 0%, var(--accent-end) 100%);
  --navy-gradient: linear-gradient(135deg, var(--brand-primary) 0%, #102e66 100%);
  --bg-pattern-img: url('../img/theprive-bg-menu.png');

  --bg-page: #04243d;
  --bg-sidebar: #031b2e;
  --bg-surface: rgba(7, 42, 72, 0.84);
  --bg-surface-2: rgba(11, 56, 94, 0.92);
  --border: rgba(234, 141, 107, 0.18);
  --border-strong: rgba(234, 141, 107, 0.38);
  --text-main: #f5f8fc;
  --text-muted: #b6c7de;
  --text-dim: #7f97b5;
  --ok: #22c55e;
  --warn: #f59e0b;
  --err: #ef4444;
  --radius: 14px;
  --font-heading: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-sans: 'Be Vietnam Pro', 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  width: 100%;
  max-width: 100%;
  background: var(--bg-page);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 14.5px;
  line-height: 1.62;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  touch-action: manipulation;
}

.hidden { display: none !important; }

.gradient-heading {
  font-family: var(--font-heading);
  background: var(--heading-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Dual Adaptive Wordmark Logo (White on Dark / Royal Navy on Light) */
.wordmark-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 10px;
}

.brand-wordmark {
  display: block;
  height: 42px;
  width: auto;
  max-width: min(270px, 78vw);
  object-fit: contain;
}

.brand-wordmark.logo-for-light { display: none; }

.app-shell { display: flex; height: var(--app-vh, 100dvh); max-height: var(--app-vh, 100dvh); width: 100%; position: relative; overflow: hidden; }

/* ==================== SIDEBAR (STANDALONE MODE) ==================== */
.sidebar {
  width: 288px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #052845 0%, var(--bg-sidebar) 100%);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 30;
  transition: transform 0.22s ease;
}

.sidebar-top { padding: 18px 15px 14px; border-bottom: 1px solid var(--border); }

.brand { display: flex; align-items: center; gap: 11px; margin-bottom: 14px; }
.brand-home-trigger {
  width: 100%; background: transparent; border: none; padding: 5px; margin: -5px -5px 10px;
  border-radius: 12px; color: inherit; text-align: left; cursor: pointer;
  transition: background 0.16s ease;
}
.brand-home-trigger:hover { background: rgba(234, 141, 107, 0.1); }
.brand-text { min-width: 0; flex: 1; }

.brand-logo-img {
  width: 40px; height: 40px; border-radius: 11px; object-fit: cover;
  border: 1px solid var(--gold-border); background: var(--brand-primary); flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
}

.brand-name {
  font-family: var(--font-heading); font-weight: 700; font-size: 15.5px; letter-spacing: 0.08em;
  text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand-sub { font-size: 11.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 196px; }
.brand-sub-slogan {
  font-family: var(--font-heading); font-size: 9.5px; font-weight: 600; letter-spacing: 0.13em;
  text-transform: uppercase; color: var(--text-muted); margin-top: 2px; max-width: 206px;
}

.btn-new-chat {
  width: 100%; padding: 10px 14px; border-radius: 10px;
  border: 1px solid var(--gold-border);
  background: linear-gradient(135deg, rgba(234, 141, 107, 0.2), rgba(155, 82, 75, 0.14));
  color: #ffe3d6; font-family: var(--font-heading); font-weight: 600; font-size: 13px; letter-spacing: 0.02em;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: all 0.16s ease;
}
.btn-new-chat:hover { background: linear-gradient(135deg, rgba(234, 141, 107, 0.3), rgba(155, 82, 75, 0.22)); border-color: var(--accent-start); }

.sidebar-section-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 13px 14px 6px 16px;
}
.sidebar-section-label {
  font-family: var(--font-heading); font-size: 10px; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--text-dim); font-weight: 700;
}
.btn-clear-history {
  border: 1px solid rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.09);
  color: #fca5a5;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-clear-history:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.22);
  border-color: rgba(239, 68, 68, 0.55);
  color: #fee2e2;
}
.btn-clear-history.confirming {
  background: rgba(220, 38, 38, 0.88);
  border-color: #f87171;
  color: #ffffff;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.28);
}
.btn-clear-history:disabled { opacity: 0.35; cursor: not-allowed; }

.conv-list { flex: 1; overflow-y: auto; padding: 4px 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.conv-empty { color: var(--text-dim); font-size: 12.5px; text-align: center; padding: 22px 10px; }

.conv-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 9px 11px; border-radius: 10px; cursor: pointer; color: var(--text-muted);
  transition: all 0.14s ease; border: 1px solid transparent;
}
.conv-item:hover { background: rgba(255, 255, 255, 0.05); color: var(--text-main); }
.conv-item.active { background: var(--gold-dim); border-color: var(--gold-border); color: var(--gold-light); }
.conv-item-title { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }

.conv-item-del {
  background: transparent; border: none; color: var(--text-dim); cursor: pointer;
  padding: 2px 6px; border-radius: 6px; opacity: 0; font-size: 12.5px;
}
.conv-item:hover .conv-item-del, .conv-item.active .conv-item-del { opacity: 1; }
.conv-item-del:hover { color: var(--err); background: rgba(239, 68, 68, 0.14); }

.sidebar-footer { padding: 12px 14px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }

.hotline-card {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 11px; border-radius: 10px; background: rgba(234, 141, 107, 0.1);
  border: 1px solid var(--gold-border); text-decoration: none; color: #ffd9c7;
  font-family: var(--font-heading); font-size: 12px; font-weight: 700; letter-spacing: 0.02em;
}
.hotline-card:hover { background: rgba(234, 141, 107, 0.18); }

.status-pill {
  display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted);
  padding: 6px 10px; border-radius: 9px; background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.08);
}
.ws-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.ws-dot.online { background: var(--ok); box-shadow: 0 0 8px rgba(34, 197, 94, 0.7); }
.ws-dot.connecting { background: var(--warn); animation: pulse 1.2s infinite; }
.ws-dot.offline { background: var(--err); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.sidebar-backdrop { display: none; }

/* ==================== MAIN CHAT + THE PRIVÉ MENU WATERMARK BACKDROP ==================== */
.chat-main {
  position: relative;
  flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden;
  background:
    radial-gradient(ellipse 80% 62% at 18% 12%, rgba(16, 86, 144, 0.65) 0%, transparent 60%),
    radial-gradient(ellipse 75% 58% at 88% 92%, rgba(155, 82, 75, 0.2) 0%, transparent 55%),
    linear-gradient(155deg, #093f6a 0%, #052c4c 48%, #04243d 100%);
}

.chat-main::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--bg-pattern-img);
  background-position: center bottom;
  background-repeat: no-repeat;
  background-size: min(68vw, 960px) auto;
  opacity: 0.65;
  pointer-events: none;
  z-index: 0;
}

.chat-header,
.messages-viewport,
.composer-wrap {
  position: relative;
  z-index: 1;
}

.chat-header {
  min-height: 60px; flex-shrink: 0; padding: 8px 18px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: rgba(4, 32, 56, 0.86); backdrop-filter: blur(14px);
}
.header-left { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.header-home-trigger {
  display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1;
  background: transparent; border: none; padding: 3px 6px; margin: -3px -6px;
  border-radius: 10px; color: inherit; text-align: left; cursor: pointer;
  transition: background 0.15s ease;
}
.header-home-trigger:hover { background: rgba(234, 141, 107, 0.1); }
.widget-header-logo { width: 32px; height: 32px; border-radius: 9px; }
.header-right { display: flex; align-items: center; gap: 7px; flex-shrink: 0; }

.chat-title-wrap { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.chat-title {
  font-family: var(--font-heading); font-size: 15px; font-weight: 700; line-height: 1.25;
  letter-spacing: 0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chat-title-mobile { display: none; }
.chat-sub-line { font-size: 11.5px; line-height: 1.25; color: var(--text-muted); display: flex; align-items: center; gap: 6px; min-width: 0; margin-top: 2px; }
.chat-sub-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

.btn-header-pill {
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--gold-border);
  background: linear-gradient(135deg, rgba(234, 141, 107, 0.18), rgba(155, 82, 75, 0.16));
  color: #ffe2d5; font-family: var(--font-heading); font-size: 11.5px; font-weight: 700;
  letter-spacing: 0.02em; cursor: pointer; text-decoration: none; white-space: nowrap; transition: all 0.16s ease;
}
.btn-header-pill:hover,
.btn-header-pill.is-active { background: var(--btn-gradient); color: #ffffff; border-color: transparent; }

.icon-btn {
  width: 34px; height: 34px; border-radius: 9px; border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06); color: var(--text-main); cursor: pointer;
  display: grid; place-items: center; font-size: 15px; transition: all 0.15s ease;
}
.icon-btn:hover { background: rgba(234, 141, 107, 0.18); border-color: var(--gold-border); }
.mobile-only { display: none; }

/* ==================== MESSAGES ==================== */
.messages-viewport { flex: 1; overflow-y: auto; padding: 22px 16px 16px; scroll-behavior: smooth; }
.messages-inner { max-width: 820px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }

.welcome-state { margin: auto; text-align: center; padding: 34px 10px 14px; max-width: 680px; }
.welcome-wordmark { margin-bottom: 10px; }
.welcome-tagline {
  font-family: var(--font-heading);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.welcome-heading {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 10px;
  line-height: 1.3;
}
.welcome-desc { color: var(--text-muted); font-size: 14.5px; margin-bottom: 24px; max-width: 560px; margin-left: auto; margin-right: auto; }

.starter-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; text-align: left; }
.starter-card {
  background: rgba(5, 38, 66, 0.78); backdrop-filter: blur(10px);
  border: 1px solid var(--border); border-radius: 13px;
  padding: 12px 14px; cursor: pointer; color: var(--text-main);
  display: flex; flex-direction: column; gap: 3px; transition: all 0.18s ease; text-align: left;
}
.starter-card:hover {
  border-color: var(--accent-start);
  background: rgba(10, 56, 96, 0.88);
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.28);
}
.starter-title { font-family: var(--font-heading); font-weight: 700; font-size: 13px; color: var(--gold-light); letter-spacing: 0.01em; }
.starter-sub { font-size: 12px; color: var(--text-muted); }

/* Message rows */
.msg-row { display: flex; gap: 10px; align-items: flex-start; min-width: 0; max-width: 100%; animation: fadeIn 0.18s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.msg-row.user { flex-direction: row-reverse; }

.msg-avatar {
  width: 31px; height: 31px; border-radius: 9px; display: grid; place-items: center;
  font-size: 13px; font-weight: 700; flex-shrink: 0; margin-top: 2px; overflow: hidden;
}
.msg-row.assistant .msg-avatar { border: 1px solid var(--gold-border); background: var(--brand-primary); }
.msg-row.assistant .msg-avatar img { width: 100%; height: 100%; object-fit: cover; }
.msg-row.user .msg-avatar { background: var(--navy-gradient); border: 1px solid rgba(255, 255, 255, 0.2); color: #ffffff; }

.msg-bubble { max-width: 86%; min-width: 0; border-radius: var(--radius); padding: 12px 16px; word-break: break-word; overflow-wrap: anywhere; box-sizing: border-box; }
.msg-row.user .msg-bubble {
  background: var(--navy-gradient);
  border: 1px solid rgba(234, 141, 107, 0.42);
  color: #ffffff; border-bottom-right-radius: 4px; white-space: pre-wrap; font-weight: 500;
  box-shadow: 0 8px 22px rgba(3, 21, 38, 0.34);
}
.msg-row.assistant .msg-bubble {
  background: var(--bg-surface); backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px; flex: 1 1 auto; min-width: 0; width: auto; max-width: 100%;
  box-shadow: 0 8px 24px rgba(2, 18, 32, 0.28);
}
.msg-row.error .msg-bubble {
  background: rgba(239, 68, 68, 0.14); border-color: rgba(239, 68, 68, 0.38); color: #fecaca;
}

.msg-content { min-width: 0; max-width: 100%; overflow-wrap: break-word; }

.msg-content p { margin-bottom: 8px; }
.msg-content p:last-child { margin-bottom: 0; }
.msg-content h1, .msg-content h2, .msg-content h3 {
  font-family: var(--font-heading); margin: 13px 0 6px; font-weight: 700; letter-spacing: 0.01em;
  background: var(--heading-gradient); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.msg-content ul, .msg-content ol { padding-left: 20px; margin: 6px 0 8px; }
.msg-content li { margin-bottom: 4px; }
.msg-content a { color: var(--gold-light); text-decoration: underline; text-underline-offset: 2px; }
.msg-content strong { color: #ffffff; }
.msg-content code {
  font-size: 0.9em; background: rgba(3, 22, 39, 0.85); border: 1px solid var(--border);
  padding: 1px 6px; border-radius: 5px; color: var(--gold-light);
}

.streaming-cursor::after { content: "▍"; display: inline-block; margin-left: 2px; color: var(--accent-start); animation: blink 0.9s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* CTA Navigation & Utility Pills under Assistant message */
.cta-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 11px; padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  min-width: 0; max-width: 100%;
}

.cta-btn {
  padding: 6px 13px; border-radius: 999px; font-family: var(--font-heading); font-size: 12px; font-weight: 600;
  cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 5px;
  transition: all 0.15s ease; max-width: 100%; white-space: nowrap;
}
.cta-btn-link {
  background: rgba(234, 141, 107, 0.14); border: 1px solid var(--gold-border); color: #ffe2d4;
}
.cta-btn-link:hover { background: rgba(234, 141, 107, 0.28); transform: translateY(-1px); }
.cta-btn-action {
  background: var(--btn-gradient); border: none; color: #ffffff;
}
.cta-btn-action:hover { filter: brightness(1.08); transform: translateY(-1px); }

.cta-util-group {
  display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-left: auto;
}
.cta-btn-util {
  padding: 5px 11px; border-radius: 999px; font-family: var(--font-heading); font-size: 11.5px; font-weight: 600;
  cursor: pointer; display: inline-flex; align-items: center; gap: 5px;
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--border-strong); color: var(--text-muted);
  transition: all 0.15s ease; white-space: nowrap;
}
.cta-btn-util:hover {
  background: rgba(234, 141, 107, 0.18); border-color: var(--accent-start); color: #ffffff; transform: translateY(-1px);
}
.cta-btn-util.copied {
  background: rgba(34, 197, 94, 0.18); border-color: rgba(34, 197, 94, 0.55); color: #86efac;
}
.cta-btn-util svg { width: 13px; height: 13px; flex-shrink: 0; }

/* In-chat Lead & Department Email Form */
.lead-card {
  position: relative;
  margin-top: 12px; padding: 14px; border-radius: 12px;
  background: linear-gradient(180deg, rgba(234, 141, 107, 0.1), rgba(4, 31, 54, 0.9));
  border: 1px solid var(--gold-border);
}
.lead-card-close {
  position: absolute; top: 10px; right: 10px; width: 26px; height: 26px; border-radius: 8px;
  border: 1px solid var(--border); background: rgba(255, 255, 255, 0.06); color: var(--text-muted);
  font-size: 12px; cursor: pointer; display: grid; place-items: center; transition: all 0.15s ease;
}
.lead-card-close:hover { background: rgba(234, 141, 107, 0.22); border-color: var(--gold-border); color: #ffffff; }
.lead-card-title { font-family: var(--font-heading); font-size: 13.5px; font-weight: 700; color: var(--gold-light); margin-bottom: 4px; padding-right: 30px; }
.lead-card-sub { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }

.lead-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.lead-field { display: flex; flex-direction: column; gap: 3px; margin-bottom: 8px; }
.lead-field label { font-size: 11.5px; color: var(--text-muted); font-weight: 600; }
.lead-field input, .lead-field select, .lead-field textarea {
  width: 100%; background: rgba(3, 24, 42, 0.92); border: 1px solid var(--border-strong);
  border-radius: 8px; padding: 8px 10px; color: var(--text-main); font-size: 13px; outline: none;
  font-family: var(--font-sans);
}
.lead-field input:focus, .lead-field select:focus, .lead-field textarea:focus { border-color: var(--accent-start); }

.btn-lead-submit {
  width: 100%; padding: 9px 14px; border-radius: 9px; border: none;
  background: var(--btn-gradient);
  color: #ffffff; font-family: var(--font-heading); font-weight: 700; font-size: 13px;
  letter-spacing: 0.02em; cursor: pointer; margin-top: 4px;
}
.btn-lead-submit:hover:not(:disabled) { filter: brightness(1.08); }
.btn-lead-submit:disabled { opacity: 0.55; cursor: not-allowed; }

.lead-feedback { margin-top: 8px; padding: 8px 10px; border-radius: 8px; font-size: 12.5px; }
.lead-feedback.ok { background: rgba(34, 197, 94, 0.14); border: 1px solid rgba(34, 197, 94, 0.35); color: #bbf7d0; }
.lead-feedback.err { background: rgba(239, 68, 68, 0.14); border: 1px solid rgba(239, 68, 68, 0.35); color: #fecaca; }

/* ==================== COMPOSER ==================== */
.composer-wrap {
  flex-shrink: 0; padding: 8px 14px 14px;
  background: linear-gradient(to top, rgba(4, 32, 56, 0.94) 76%, transparent);
}
.quick-chips {
  max-width: 820px; margin: 0 auto 8px; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; padding-bottom: 2px;
}
.quick-chips::-webkit-scrollbar { display: none; }
.quick-chip {
  flex-shrink: 0; padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 500;
  background: rgba(6, 40, 69, 0.82); backdrop-filter: blur(8px);
  border: 1px solid var(--border); color: var(--text-muted);
  cursor: pointer; transition: all 0.15s ease;
}
.quick-chip:hover { border-color: var(--accent-start); color: #ffe3d5; background: rgba(12, 60, 102, 0.92); }

.stream-status { max-width: 820px; margin: 0 auto 6px; font-size: 12px; color: var(--gold-light); padding-left: 6px; }

.composer-box {
  max-width: 820px; margin: 0 auto; background: rgba(5, 34, 59, 0.9); backdrop-filter: blur(12px);
  border: 1px solid var(--border-strong); border-radius: 14px; padding: 8px 10px 8px 14px;
  display: flex; align-items: flex-end; gap: 8px;
  box-shadow: 0 10px 28px rgba(2, 18, 32, 0.32);
}
.composer-box:focus-within { border-color: var(--accent-start); box-shadow: 0 0 0 3px rgba(234, 141, 107, 0.18); }

#chatInput {
  flex: 1; min-width: 0; width: 100%; background: transparent; border: none; outline: none; resize: none;
  color: var(--text-main); font-family: var(--font-sans); font-size: 14.5px; line-height: 1.45;
  max-height: 140px; padding: 4px 0;
}
#chatInput::placeholder { color: var(--text-dim); }

.composer-actions { display: flex; align-items: center; gap: 6px; }

.btn-send {
  width: 36px; height: 36px; border-radius: 10px; border: none;
  background: var(--btn-gradient); color: #ffffff;
  cursor: pointer; display: grid; place-items: center; transition: transform 0.12s, filter 0.15s;
}
.btn-send:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.08); }
.btn-send:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-stop {
  height: 36px; padding: 0 11px; border-radius: 10px; border: 1px solid rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.16); color: #fecaca; font-weight: 600; font-size: 12.5px; cursor: pointer;
}

.powered-note {
  max-width: 820px; margin: 7px auto 0; text-align: center; font-size: 11px; color: var(--text-dim); line-height: 1.45;
}
.powered-hotline {
  color: var(--gold-light); text-decoration: none; font-weight: 600;
}
.powered-hotline:hover { text-decoration: underline; }
.powered-disclaimer {
  display: block; margin-top: 2px; font-size: 10.5px; opacity: 0.85;
}

/* ==================== IFRAME WIDGET COMPACT MODE ==================== */
body.is-widget .sidebar,
body.is-widget .sidebar-backdrop,
body.is-widget .mobile-only { display: none !important; }
body.is-widget .chat-main::before { background-size: 94% auto; opacity: 0.48; }
body.is-widget .chat-header { min-height: 52px; padding: 7px 12px; gap: 8px; }
body.is-widget .chat-title { font-size: 14px; }
body.is-widget .chat-sub-line { font-size: 11px; }
body.is-widget .btn-header-pill { padding: 5px 10px; font-size: 11px; }
body.is-widget .icon-btn { width: 30px; height: 30px; font-size: 14px; border-radius: 8px; }
body.is-widget .messages-viewport { padding: 14px 12px 10px; }
body.is-widget .welcome-state { padding: 36px 10px 14px; }
body.is-widget .brand-wordmark { height: 32px; max-width: 215px; }
body.is-widget .welcome-tagline { font-size: 9.5px; letter-spacing: 0.24em; margin-bottom: 8px; }
body.is-widget .welcome-heading { font-size: 18px; margin-bottom: 8px; }
body.is-widget .welcome-desc { font-size: 13.5px; line-height: 1.55; margin-bottom: 0; }
body.is-widget .starter-grid { display: none !important; }
body.is-widget .lead-grid { grid-template-columns: 1fr; }
body.is-widget .composer-wrap { padding: 6px 10px 10px; }
body.is-widget .quick-chips {
  flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none; gap: 5px; margin-bottom: 7px; padding: 0 14px 2px 2px;
  -webkit-mask-image: linear-gradient(to right, #000 90%, transparent 100%);
  mask-image: linear-gradient(to right, #000 90%, transparent 100%);
}
body.is-widget .quick-chip { flex-shrink: 0; padding: 4px 9px; font-size: 11.5px; white-space: nowrap; }
body.is-widget .powered-note { font-size: 10px; margin-top: 5px; line-height: 1.38; }
body.is-widget .powered-disclaimer { font-size: 9.8px; }

@media (max-width: 820px) {
  .app-shell {
    position: fixed;
    top: var(--app-vtop, 0px);
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100vw;
    height: var(--app-vh, 100dvh);
    max-height: var(--app-vh, 100dvh);
  }
  .mobile-only { display: grid; }
  .chat-header { min-height: 54px; padding: 7px 12px; gap: 8px; }
  .chat-title-desktop { display: none; }
  .chat-title-mobile { display: inline; font-size: 16px; letter-spacing: 0.04em; }
  .chat-sub-line { display: none !important; }
  .sidebar { position: fixed; top: 0; left: 0; bottom: 0; transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop.open { display: block; position: fixed; inset: 0; background: rgba(2, 16, 30, 0.62); z-index: 25; }
  .chat-main::before { background-size: 92vw auto; opacity: 0.45; }
  .starter-grid { display: none !important; }
  .welcome-state { padding: 40px 12px 16px; }
  .brand-wordmark { height: 34px; }
  .welcome-heading { font-size: 19px; }
  .welcome-desc { margin-bottom: 0; }
  .lead-grid { grid-template-columns: 1fr; }
  .composer-wrap { padding: 6px 10px max(10px, env(safe-area-inset-bottom)); }
  /* 4 tag nhanh luôn nằm gọn trên ĐÚNG 1 HÀNG duy nhất (vuốt ngang mượt, không xuống 2 dòng chiếm màn hình) */
  .quick-chips {
    flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; gap: 6px; margin-bottom: 6px; padding: 0 14px 2px 2px;
    -webkit-mask-image: linear-gradient(to right, #000 90%, transparent 100%);
    mask-image: linear-gradient(to right, #000 90%, transparent 100%);
  }
  .quick-chip { flex-shrink: 0; padding: 4px 10px; font-size: 11.5px; white-space: nowrap; }
}

/* Chống iOS Safari / Zalo in-app browser tự động zoom khi bấm vào ô nhập liệu (bắt buộc >= 16px) & hiện sẵn nút xóa trên thiết bị cảm ứng */
@media (max-width: 1024px), (hover: none) and (pointer: coarse) {
  .conv-item-del {
    opacity: 0.82 !important;
    min-width: 30px;
    min-height: 30px;
    display: grid;
    place-items: center;
    font-size: 13.5px;
    padding: 0;
  }
  #chatInput,
  .lead-field input,
  .lead-field select,
  .lead-field textarea,
  .gate-field input,
  .gate-field select {
    font-size: 16px !important;
    line-height: 1.4;
    touch-action: manipulation;
  }
}

/* ==================== LUXURY MARKDOWN TABLES & STREAM POLISH ==================== */
.md-hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 10px 0;
}

.md-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 10px 0;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(3, 25, 44, 0.78);
  animation: mdTableReveal 0.22s ease;
}

@keyframes mdTableReveal {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.md-table { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: auto; }
.md-table th, .md-table td {
  padding: 8px 11px; text-align: left; vertical-align: top; line-height: 1.45;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  word-break: normal; overflow-wrap: break-word;
}
.md-table th {
  background: rgba(234, 141, 107, 0.14);
  color: var(--gold-light);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.md-table th.col-compact,
.md-table td.col-compact {
  width: 1%; white-space: nowrap; text-align: center; padding-left: 10px; padding-right: 10px;
}
.md-table th.col-action,
.md-table td.col-action {
  width: 1%; white-space: nowrap; text-align: right; padding-left: 10px; padding-right: 11px;
}
.md-table td.col-action a {
  display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; font-weight: 600;
  text-decoration: none; padding: 2px 8px; border-radius: 999px;
  background: rgba(234, 141, 107, 0.14); border: 1px solid rgba(234, 141, 107, 0.35);
  color: var(--gold-light); font-size: 11.5px; transition: background 0.15s ease;
}
.md-table td.col-action a:hover { background: rgba(234, 141, 107, 0.28); }
.md-table tr:last-child td { border-bottom: none; }
.cta-row:not(.hidden) { animation: mdTableReveal 0.25s ease; }

/* ==================== LUXURY CONCIERGE LOADING STATE ==================== */
.concierge-loading {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 4px 2px;
  color: var(--gold-light);
  font-size: 13.5px;
  line-height: 1.45;
  animation: mdTableReveal 0.2s ease;
}
.concierge-loading.hidden { display: none; }
.concierge-emblem {
  color: var(--accent-start);
  font-size: 14px;
  animation: conciergeSpinPulse 2.2s ease-in-out infinite;
  flex-shrink: 0;
}
.concierge-loading-text {
  background: linear-gradient(90deg, var(--accent-end) 0%, #ffd2be 45%, var(--accent-start) 75%, var(--accent-end) 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 500;
  animation: conciergeShimmer 2.4s linear infinite;
}
.concierge-dots { display: inline-flex; align-items: center; gap: 4px; margin-left: 2px; flex-shrink: 0; }
.concierge-dots span {
  width: 5px; height: 5px; border-radius: 50%; background: var(--accent-start);
  opacity: 0.3; animation: conciergeDot 1.3s ease-in-out infinite;
}
.concierge-dots span:nth-child(2) { animation-delay: 0.2s; }
.concierge-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes conciergeShimmer { 0% { background-position: 100% 0; } 100% { background-position: -120% 0; } }
@keyframes conciergeSpinPulse { 0%, 100% { opacity: 0.55; transform: scale(0.92); } 50% { opacity: 1; transform: scale(1.12); } }
@keyframes conciergeDot { 0%, 80%, 100% { opacity: 0.25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-2px); } }

/* ==================== VISUAL MEDIA GALLERY (FLOORPLANS, UNITS, 3D, PROGRESS) ==================== */
.media-gallery {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px; margin-top: 12px; animation: mdTableReveal 0.25s ease;
}
.media-gallery.hidden { display: none; }
.media-gallery.single { grid-template-columns: 1fr; }

@media (min-width: 780px) {
  body:not(.is-widget) .media-gallery.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.media-card {
  position: relative; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--border-strong); background: #031c31;
  cursor: zoom-in; display: flex; flex-direction: column; padding: 0; text-align: left;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.media-card:hover {
  transform: translateY(-2px); border-color: var(--accent-start);
  box-shadow: 0 10px 26px rgba(234, 141, 107, 0.24);
}
.media-thumb-wrap { position: relative; width: 100%; aspect-ratio: 16 / 11; background: #052642; overflow: hidden; }
.media-gallery.single .media-thumb-wrap { aspect-ratio: 16 / 10; max-height: 280px; }
.media-thumb-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.28s ease; }
.media-card:hover .media-thumb-wrap img { transform: scale(1.04); }

.media-tag {
  position: absolute; top: 7px; left: 7px; padding: 2px 8px; border-radius: 999px;
  background: rgba(4, 32, 56, 0.88); border: 1px solid rgba(234, 141, 107, 0.55);
  color: var(--gold-light); font-family: var(--font-heading); font-size: 10px; font-weight: 700;
  letter-spacing: 0.03em; backdrop-filter: blur(4px);
}
.media-zoom-pill {
  position: absolute; right: 7px; bottom: 7px; padding: 2px 7px; border-radius: 999px;
  background: rgba(4, 32, 56, 0.84); color: #f5f8fc; font-size: 10.5px; font-weight: 600; opacity: 0.92;
}
.media-caption {
  padding: 7px 9px; font-size: 11.5px; line-height: 1.35; color: #e2ebf5;
  background: rgba(4, 30, 52, 0.96); display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ==================== DOWNLOADABLE PDF / BROCHURE CARDS ==================== */
.doc-cards-list {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 7px; margin-top: 10px;
  width: 100%; min-width: 0; animation: mdTableReveal 0.25s ease;
}
.doc-cards-list.hidden { display: none; }
.doc-card {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 10px;
  border: 1px solid var(--border-strong); background: rgba(5, 36, 62, 0.88);
  color: var(--text-main); text-decoration: none;
  width: 100%; max-width: 100%; min-width: 0; overflow: hidden; box-sizing: border-box;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}
.doc-card:hover { border-color: var(--accent-start); background: rgba(234, 141, 107, 0.14); transform: translateY(-1px); }
.doc-badge {
  flex-shrink: 0; min-width: 44px; text-align: center; padding: 4px 7px; border-radius: 6px;
  background: rgba(234, 141, 107, 0.18); border: 1px solid rgba(234, 141, 107, 0.5);
  color: var(--gold-light); font-family: var(--font-heading); font-size: 10px; font-weight: 800; letter-spacing: 0.05em;
}
.doc-meta { flex: 1 1 auto; min-width: 0; overflow: hidden; }
.doc-title {
  font-size: 12.5px; font-weight: 600; color: #f8fafd; line-height: 1.38;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; white-space: normal; word-break: break-word;
}
.doc-group { font-size: 11px; color: var(--text-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-open-btn { flex-shrink: 0; white-space: nowrap; font-family: var(--font-heading); font-size: 11.5px; font-weight: 700; color: var(--gold-light); }

@media (max-width: 640px) {
  .messages-viewport { padding: 12px 10px 10px; }
  .msg-row { gap: 7px; }
  .msg-avatar { width: 26px; height: 26px; border-radius: 7px; font-size: 11px; }
  .msg-bubble { padding: 10px 12px; font-size: 13.5px; }
  .md-table { font-size: 12px; }
  .md-table th, .md-table td { padding: 7px 7px; }
  .md-table th.col-compact, .md-table td.col-compact { padding-left: 6px; padding-right: 6px; }
  .md-table th.col-action, .md-table td.col-action { padding-left: 6px; padding-right: 7px; }
  .doc-card { gap: 8px; padding: 8px 9px; }
  .doc-badge { min-width: 38px; padding: 3px 5px; font-size: 9.5px; }
  .doc-title { font-size: 12px; }
  .doc-open-btn { font-size: 11px; }
  .cta-row { gap: 6px; }
  .cta-btn { padding: 5px 10px; font-size: 11.5px; }
  .cta-util-group { margin-left: 0; width: 100%; padding-top: 4px; border-top: 1px dashed rgba(255, 255, 255, 0.08); }
  .cta-btn-util { padding: 5px 10px; font-size: 11px; }
}

body.is-widget .msg-bubble { padding: 10px 12px; font-size: 13.5px; }
body.is-widget .md-table { font-size: 12px; }
body.is-widget .md-table th, body.is-widget .md-table td { padding: 7px 8px; }
body.is-widget .doc-card { gap: 8px; padding: 8px 9px; }
body.is-widget .doc-title { font-size: 12px; }
body.is-widget .cta-util-group { margin-left: 0; }

/* ==================== FULLSCREEN IMAGE LIGHTBOX ==================== */
.tp-lightbox {
  position: fixed; inset: 0; z-index: 99999;
  background: rgba(3, 21, 37, 0.95); backdrop-filter: blur(8px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 18px; opacity: 0; pointer-events: none; transition: opacity 0.2s ease;
}
.tp-lightbox.open { opacity: 1; pointer-events: auto; }
.tp-lb-toolbar {
  position: fixed; top: 12px; left: 16px; right: 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px; z-index: 3;
}
.tp-lb-counter {
  padding: 5px 12px; border-radius: 999px; background: rgba(5, 36, 62, 0.9);
  border: 1px solid rgba(234, 141, 107, 0.45); color: var(--gold-light);
  font-family: var(--font-heading); font-size: 12px; font-weight: 700;
}
.tp-lb-actions { display: flex; align-items: center; gap: 8px; }
.tp-lb-btn {
  padding: 6px 12px; border-radius: 999px; border: 1px solid rgba(234, 141, 107, 0.45);
  background: rgba(5, 36, 62, 0.92); color: #f5f8fc; font-size: 12.5px; font-weight: 600;
  cursor: pointer; text-decoration: none; transition: background 0.16s ease, border-color 0.16s ease;
}
.tp-lb-btn:hover { background: rgba(234, 141, 107, 0.24); border-color: var(--accent-start); }
.tp-lb-stage { position: relative; max-width: 96vw; max-height: 78vh; overflow: auto; display: flex; align-items: center; justify-content: center; }
.tp-lb-stage img {
  max-width: 92vw; max-height: 76vh; border-radius: 10px; border: 1px solid rgba(234, 141, 107, 0.35);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.72); cursor: zoom-in; transition: transform 0.22s ease; background: #04243d;
}
.tp-lb-stage.zoomed img { max-width: none; max-height: none; width: min(1600px, 175vw); cursor: zoom-out; }
.tp-lb-nav {
  position: fixed; top: 50%; transform: translateY(-50%); width: 42px; height: 42px;
  border-radius: 50%; border: 1px solid rgba(234, 141, 107, 0.55); background: rgba(4, 32, 56, 0.9);
  color: var(--gold-light); font-size: 20px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; z-index: 3;
}
.tp-lb-nav:hover { background: rgba(234, 141, 107, 0.24); }
.tp-lb-nav.prev { left: 14px; }
.tp-lb-nav.next { right: 14px; }
.tp-lb-nav.hidden { display: none; }
.tp-lb-caption { margin-top: 10px; max-width: 90vw; text-align: center; color: #eef3f9; font-size: 13px; line-height: 1.4; }
.tp-lb-legend {
  margin-top: 10px; max-width: 92vw; width: 860px; padding: 10px 14px; border-radius: 12px;
  border: 1px solid rgba(234, 141, 107, 0.4); background: rgba(4, 30, 52, 0.94); max-height: 22vh; overflow-y: auto;
}
.tp-lb-legend.hidden { display: none; }
.tp-lb-legend-title {
  font-family: var(--font-heading); font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--gold-light); margin-bottom: 8px;
}
.tp-lb-legend-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 10px; }
.tp-lb-legend-item { display: flex; align-items: center; gap: 7px; font-size: 12px; color: #f4f7fc; }
.tp-lb-legend-num {
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(234, 141, 107, 0.22); border: 1px solid rgba(234, 141, 107, 0.65);
  color: var(--gold-light); font-size: 11px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}

/* ==================== STANDALONE ACCESS GATE + GOOGLE RECAPTCHA ==================== */
body.gate-body {
  position: relative;
  overflow: auto;
  background:
    radial-gradient(ellipse 80% 60% at 18% 12%, rgba(16, 86, 144, 0.68) 0%, transparent 60%),
    radial-gradient(ellipse 75% 58% at 86% 90%, rgba(155, 82, 75, 0.22) 0%, transparent 55%),
    linear-gradient(155deg, #093f6a 0%, #052c4c 48%, #04243d 100%);
}

body.gate-body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: var(--bg-pattern-img);
  background-position: center bottom;
  background-repeat: no-repeat;
  background-size: min(70vw, 980px) auto;
  opacity: 0.65;
  pointer-events: none;
  z-index: 0;
}

.gate-shell {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.gate-card {
  position: relative;
  width: 100%;
  max-width: 510px;
  background: rgba(5, 36, 62, 0.9);
  backdrop-filter: blur(16px);
  border: 1px solid var(--gold-border);
  border-radius: 22px;
  padding: 32px 28px 24px;
  box-shadow: 0 28px 72px rgba(2, 16, 30, 0.62);
}

.gate-top-actions {
  position: absolute;
  top: 16px;
  right: 16px;
}

.gate-brand { text-align: center; margin-bottom: 22px; }
.gate-wordmark .brand-wordmark { height: 38px; }
.gate-tagline {
  font-family: var(--font-heading); font-size: 10px; font-weight: 600;
  letter-spacing: 0.28em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 10px;
}
.gate-brand h1 {
  font-family: var(--font-heading); font-size: 21px; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 8px;
}
.gate-sub { font-size: 13px; color: var(--text-muted); line-height: 1.55; }

.gate-form { display: flex; flex-direction: column; gap: 12px; }
.gate-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.gate-field { display: flex; flex-direction: column; gap: 5px; }
.gate-field label { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.gate-field .req { color: #f87171; }

.gate-field input,
.gate-field select {
  width: 100%; background: rgba(3, 24, 42, 0.9); border: 1px solid var(--border-strong);
  border-radius: 10px; padding: 10px 12px; color: var(--text-main); font-size: 13.5px;
  font-family: var(--font-sans); outline: none; transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.gate-field input:focus,
.gate-field select:focus { border-color: var(--accent-start); box-shadow: 0 0 0 3px rgba(234, 141, 107, 0.18); }

.gate-recaptcha-box { display: flex; justify-content: center; padding: 4px 0; }
.gate-math-box {
  padding: 10px 12px; border-radius: 10px;
  background: rgba(234, 141, 107, 0.1); border: 1px dashed var(--gold-border);
}
.gate-math-box strong { color: var(--gold-light); font-size: 14px; }

.gate-feedback { padding: 9px 12px; border-radius: 10px; font-size: 12.5px; line-height: 1.45; }
.gate-feedback.err { background: rgba(239, 68, 68, 0.14); border: 1px solid rgba(239, 68, 68, 0.4); color: #fecaca; }
.gate-feedback.ok { background: rgba(34, 197, 94, 0.14); border: 1px solid rgba(34, 197, 94, 0.4); color: #bbf7d0; }

.gate-submit-btn {
  width: 100%; padding: 12px 16px; border-radius: 11px; border: none;
  background: var(--btn-gradient); color: #ffffff;
  font-family: var(--font-heading); font-size: 13.5px; font-weight: 700; letter-spacing: 0.03em;
  text-transform: uppercase; cursor: pointer; margin-top: 4px;
  box-shadow: 0 10px 26px rgba(155, 82, 75, 0.35);
  transition: filter 0.15s ease, transform 0.12s ease;
}
.gate-submit-btn:hover:not(:disabled) { filter: brightness(1.08); transform: translateY(-1px); }
.gate-submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.gate-foot {
  margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border);
  text-align: center; font-size: 11.5px; color: var(--text-dim);
}

@media (max-width: 520px) {
  .gate-card { padding: 24px 16px 18px; }
  .gate-grid { grid-template-columns: 1fr; }
}

/* ==================== THE PRIVÉ LIGHT MODE (PEARL WHITE · ROYAL NAVY #1C448C · ROSE COPPER) ==================== */
html.theme-light,
body.theme-light {
  --gold: var(--accent-end);
  --gold-light: var(--accent-end);
  --gold-dim: rgba(28, 68, 140, 0.08);
  --gold-border: rgba(155, 82, 75, 0.32);
  --heading-gradient: linear-gradient(90deg, var(--accent-end) 0%, var(--accent-start) 50%, var(--accent-end) 100%);
  --bg-page: #f5f7fb;
  --bg-sidebar: #ffffff;
  --bg-surface: rgba(255, 255, 255, 0.94);
  --bg-surface-2: #edf2fa;
  --border: rgba(28, 68, 140, 0.12);
  --border-strong: rgba(28, 68, 140, 0.24);
  --text-main: #102442;
  --text-muted: #4b5e7a;
  --text-dim: #798aa4;
  background: var(--bg-page);
  color: var(--text-main);
}

html.theme-light .brand-wordmark.logo-for-dark,
body.theme-light .brand-wordmark.logo-for-dark { display: none; }
html.theme-light .brand-wordmark.logo-for-light,
body.theme-light .brand-wordmark.logo-for-light { display: block; }

html.theme-light .sidebar,
body.theme-light .sidebar {
  background: #ffffff;
  border-right-color: var(--border);
  box-shadow: 2px 0 22px rgba(28, 68, 140, 0.06);
}
html.theme-light .brand-home-trigger:hover,
body.theme-light .brand-home-trigger:hover { background: rgba(28, 68, 140, 0.06); }
html.theme-light .brand-logo-img,
body.theme-light .brand-logo-img {
  background: var(--brand-primary);
  border-color: rgba(28, 68, 140, 0.25);
  box-shadow: 0 4px 12px rgba(28, 68, 140, 0.16);
}
html.theme-light .btn-new-chat,
body.theme-light .btn-new-chat {
  background: var(--navy-gradient);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 6px 16px rgba(28, 68, 140, 0.22);
}
html.theme-light .btn-new-chat:hover,
body.theme-light .btn-new-chat:hover { filter: brightness(1.08); }
html.theme-light .conv-item:hover,
body.theme-light .conv-item:hover { background: #eef3fa; color: var(--brand-primary); }
html.theme-light .conv-item.active,
body.theme-light .conv-item.active {
  background: rgba(28, 68, 140, 0.09);
  border-color: rgba(28, 68, 140, 0.26);
  color: var(--brand-primary);
  font-weight: 600;
}
html.theme-light .btn-clear-history,
body.theme-light .btn-clear-history {
  border-color: rgba(220, 38, 38, 0.28);
  background: rgba(220, 38, 38, 0.06);
  color: #b91c1c;
}
html.theme-light .btn-clear-history:hover:not(:disabled),
body.theme-light .btn-clear-history:hover:not(:disabled) { background: rgba(220, 38, 38, 0.14); color: #991b1b; }
html.theme-light .hotline-card,
body.theme-light .hotline-card {
  background: linear-gradient(135deg, rgba(28, 68, 140, 0.07), rgba(234, 141, 107, 0.09));
  border-color: rgba(28, 68, 140, 0.22);
  color: var(--brand-primary);
}
html.theme-light .status-pill,
body.theme-light .status-pill { background: #f6f8fc; border-color: var(--border); color: var(--text-muted); }

/* Light Mode Main Backdrop + Etched Royal Navy PRIVÉ Watermark */
html.theme-light .chat-main,
body.theme-light .chat-main {
  background:
    radial-gradient(ellipse 78% 58% at 15% 10%, rgba(28, 68, 140, 0.08) 0%, transparent 56%),
    radial-gradient(ellipse 70% 52% at 88% 92%, rgba(234, 141, 107, 0.11) 0%, transparent 52%),
    linear-gradient(180deg, #f8fafd 0%, #f1f5fb 100%);
}
html.theme-light .chat-main::before,
body.theme-light .chat-main::before {
  filter: invert(1) sepia(0.45) hue-rotate(192deg) saturate(3.6) brightness(0.72);
  opacity: 0.12;
}

html.theme-light .chat-header,
body.theme-light .chat-header {
  background: rgba(255, 255, 255, 0.9);
  border-bottom-color: var(--border);
  box-shadow: 0 2px 14px rgba(28, 68, 140, 0.05);
}
html.theme-light .header-home-trigger:hover,
body.theme-light .header-home-trigger:hover { background: rgba(28, 68, 140, 0.06); }
html.theme-light .btn-header-pill,
body.theme-light .btn-header-pill {
  background: rgba(28, 68, 140, 0.08);
  border-color: rgba(28, 68, 140, 0.28);
  color: var(--brand-primary);
}
html.theme-light .btn-header-pill:hover,
html.theme-light .btn-header-pill.is-active,
body.theme-light .btn-header-pill:hover,
body.theme-light .btn-header-pill.is-active { background: var(--btn-gradient); color: #ffffff; border-color: transparent; }
html.theme-light .icon-btn,
body.theme-light .icon-btn {
  background: #f5f7fb;
  border-color: rgba(28, 68, 140, 0.15);
  color: #1e3a5f;
}
html.theme-light .icon-btn:hover,
body.theme-light .icon-btn:hover { background: #e8eff9; border-color: rgba(28, 68, 140, 0.3); color: var(--brand-primary); }

html.theme-light .starter-card,
body.theme-light .starter-card {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(28, 68, 140, 0.12);
  box-shadow: 0 4px 16px rgba(28, 68, 140, 0.055);
}
html.theme-light .starter-card:hover,
body.theme-light .starter-card:hover {
  background: #ffffff;
  border-color: var(--accent-start);
  box-shadow: 0 8px 24px rgba(28, 68, 140, 0.12);
}
html.theme-light .starter-title,
body.theme-light .starter-title { color: var(--brand-primary); }

html.theme-light .msg-row.user .msg-avatar,
body.theme-light .msg-row.user .msg-avatar { background: var(--navy-gradient); color: #ffffff; }
html.theme-light .msg-row.assistant .msg-avatar,
body.theme-light .msg-row.assistant .msg-avatar { background: var(--brand-primary); border-color: rgba(28, 68, 140, 0.24); }
html.theme-light .msg-row.user .msg-bubble,
body.theme-light .msg-row.user .msg-bubble {
  background: var(--navy-gradient);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(28, 68, 140, 0.24);
}
html.theme-light .msg-row.assistant .msg-bubble,
body.theme-light .msg-row.assistant .msg-bubble {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(28, 68, 140, 0.11);
  box-shadow: 0 4px 20px rgba(28, 68, 140, 0.065);
  color: var(--text-main);
}
html.theme-light .msg-row.error .msg-bubble,
body.theme-light .msg-row.error .msg-bubble { background: #fef2f2; border-color: rgba(220, 38, 38, 0.3); color: #991b1b; }

html.theme-light .msg-content strong,
body.theme-light .msg-content strong { color: #0b1c36; }
html.theme-light .msg-content a,
body.theme-light .msg-content a { color: var(--brand-primary); }
html.theme-light .msg-content code,
body.theme-light .msg-content code { background: #eef3fb; border-color: rgba(28, 68, 140, 0.2); color: var(--brand-primary); }
html.theme-light .md-hr,
body.theme-light .md-hr { border-top-color: rgba(28, 68, 140, 0.14); }
html.theme-light .md-table-wrap,
body.theme-light .md-table-wrap { background: #ffffff; border-color: rgba(28, 68, 140, 0.16); }
html.theme-light .md-table th,
body.theme-light .md-table th { background: #eef3fb; color: var(--brand-primary); }
html.theme-light .md-table th,
html.theme-light .md-table td,
body.theme-light .md-table th,
body.theme-light .md-table td { border-bottom-color: rgba(28, 68, 140, 0.08); }
html.theme-light .md-table td.col-action a,
body.theme-light .md-table td.col-action a {
  background: #edf3fc; border-color: rgba(28, 68, 140, 0.25); color: var(--brand-primary);
}
html.theme-light .md-table td.col-action a:hover,
body.theme-light .md-table td.col-action a:hover { background: rgba(28, 68, 140, 0.14); }

html.theme-light .concierge-loading,
body.theme-light .concierge-loading { color: var(--accent-end); }
html.theme-light .concierge-loading-text,
body.theme-light .concierge-loading-text {
  background: linear-gradient(90deg, var(--brand-primary) 0%, var(--accent-start) 48%, var(--accent-end) 80%, var(--brand-primary) 100%);
  background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
}
html.theme-light .concierge-emblem,
html.theme-light .concierge-dots span,
body.theme-light .concierge-emblem,
body.theme-light .concierge-dots span { color: var(--accent-end); background: var(--accent-end); }
html.theme-light .concierge-emblem,
body.theme-light .concierge-emblem { background: transparent; }

html.theme-light .cta-row,
body.theme-light .cta-row { border-top-color: rgba(28, 68, 140, 0.1); }
html.theme-light .cta-btn-link,
body.theme-light .cta-btn-link {
  background: #f0f5fc; border-color: rgba(28, 68, 140, 0.25); color: var(--brand-primary);
}
html.theme-light .cta-btn-link:hover,
body.theme-light .cta-btn-link:hover { background: rgba(28, 68, 140, 0.14); }
html.theme-light .cta-btn-action,
body.theme-light .cta-btn-action { background: var(--btn-gradient); color: #ffffff; }
html.theme-light .cta-util-group,
body.theme-light .cta-util-group { border-top-color: rgba(28, 68, 140, 0.1); }
html.theme-light .cta-btn-util,
body.theme-light .cta-btn-util {
  background: #f5f8fd; border-color: rgba(28, 68, 140, 0.2); color: #364f75;
}
html.theme-light .cta-btn-util:hover,
body.theme-light .cta-btn-util:hover {
  background: rgba(28, 68, 140, 0.1); border-color: var(--brand-primary); color: var(--brand-primary);
}
html.theme-light .cta-btn-util.copied,
body.theme-light .cta-btn-util.copied {
  background: #ecfdf5; border-color: #86efac; color: #166534;
}

html.theme-light .media-card,
body.theme-light .media-card {
  background: #ffffff; border-color: rgba(28, 68, 140, 0.18);
  box-shadow: 0 3px 14px rgba(28, 68, 140, 0.07);
}
html.theme-light .media-thumb-wrap,
body.theme-light .media-thumb-wrap { background: #e9eff8; }
html.theme-light .media-caption,
body.theme-light .media-caption { background: #f8fafd; color: #162a48; }

html.theme-light .doc-card,
body.theme-light .doc-card { background: #f9fbfe; border-color: rgba(28, 68, 140, 0.18); color: #102442; }
html.theme-light .doc-card:hover,
body.theme-light .doc-card:hover { background: #eef4fc; border-color: var(--accent-start); }
html.theme-light .doc-badge,
body.theme-light .doc-badge { background: rgba(28, 68, 140, 0.1); border-color: rgba(28, 68, 140, 0.26); color: var(--brand-primary); }
html.theme-light .doc-title,
body.theme-light .doc-title { color: #102442; }
html.theme-light .doc-group,
body.theme-light .doc-group { color: var(--text-muted); }
html.theme-light .doc-open-btn,
body.theme-light .doc-open-btn { color: var(--accent-end); }

html.theme-light .lead-card,
body.theme-light .lead-card {
  background: linear-gradient(180deg, #f8fbff, #ffffff);
  border-color: rgba(28, 68, 140, 0.22);
}
html.theme-light .lead-card-title,
body.theme-light .lead-card-title { color: var(--brand-primary); }
html.theme-light .lead-card-close,
body.theme-light .lead-card-close { background: #f2f5fb; border-color: rgba(28, 68, 140, 0.18); color: #4b5e7a; }
html.theme-light .lead-card-close:hover,
body.theme-light .lead-card-close:hover { background: #e3ecfa; color: var(--brand-primary); }
html.theme-light .lead-field input,
html.theme-light .lead-field select,
html.theme-light .lead-field textarea,
body.theme-light .lead-field input,
body.theme-light .lead-field select,
body.theme-light .lead-field textarea {
  background: #ffffff; border-color: rgba(28, 68, 140, 0.2); color: #102442;
}
html.theme-light .btn-lead-submit,
body.theme-light .btn-lead-submit { background: var(--btn-gradient); color: #ffffff; }
html.theme-light .lead-feedback.ok,
body.theme-light .lead-feedback.ok { background: #ecfdf5; border-color: #86efac; color: #166534; }
html.theme-light .lead-feedback.err,
body.theme-light .lead-feedback.err { background: #fef2f2; border-color: #fca5a5; color: #991b1b; }

html.theme-light .composer-wrap,
body.theme-light .composer-wrap {
  background: linear-gradient(to top, rgba(243, 246, 251, 0.96) 78%, transparent);
}
html.theme-light .powered-hotline,
body.theme-light .powered-hotline { color: var(--brand-primary); }
html.theme-light .quick-chip,
body.theme-light .quick-chip {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(28, 68, 140, 0.14);
  color: #354c6e;
  box-shadow: 0 2px 6px rgba(28, 68, 140, 0.05);
}
html.theme-light .quick-chip:hover,
body.theme-light .quick-chip:hover {
  border-color: var(--accent-start);
  background: #ffffff;
  color: var(--brand-primary);
}
html.theme-light .composer-box,
body.theme-light .composer-box {
  background: #ffffff;
  border-color: rgba(28, 68, 140, 0.22);
  box-shadow: 0 6px 22px rgba(28, 68, 140, 0.08);
}
html.theme-light .composer-box:focus-within,
body.theme-light .composer-box:focus-within {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(28, 68, 140, 0.12);
}
html.theme-light .btn-send,
body.theme-light .btn-send { background: var(--btn-gradient); color: #ffffff; }
html.theme-light .btn-stop,
body.theme-light .btn-stop { background: #fef2f2; border-color: rgba(220, 38, 38, 0.4); color: #b91c1c; }

/* Light Mode Standalone Gate + Captcha */
html.theme-light body.gate-body,
body.gate-body.theme-light {
  background:
    radial-gradient(ellipse 80% 60% at 15% 10%, rgba(28, 68, 140, 0.09) 0%, transparent 56%),
    radial-gradient(ellipse 72% 54% at 88% 92%, rgba(234, 141, 107, 0.12) 0%, transparent 54%),
    linear-gradient(180deg, #f8fafd 0%, #eef3fa 100%);
}
html.theme-light body.gate-body::before,
body.gate-body.theme-light::before {
  filter: invert(1) sepia(0.45) hue-rotate(192deg) saturate(3.6) brightness(0.72);
  opacity: 0.12;
}
html.theme-light .gate-card,
body.theme-light .gate-card {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(28, 68, 140, 0.18);
  box-shadow: 0 24px 64px rgba(28, 68, 140, 0.14);
}
html.theme-light .gate-field input,
html.theme-light .gate-field select,
body.theme-light .gate-field input,
body.theme-light .gate-field select {
  background: #f7f9fc; border-color: rgba(28, 68, 140, 0.2); color: #102442;
}
html.theme-light .gate-math-box,
body.theme-light .gate-math-box { background: #f2f6fc; border-color: rgba(28, 68, 140, 0.26); }
html.theme-light .gate-math-box strong,
body.theme-light .gate-math-box strong { color: var(--brand-primary); }
html.theme-light .gate-feedback.err,
body.theme-light .gate-feedback.err { background: #fef2f2; border-color: #fca5a5; color: #991b1b; }
html.theme-light .gate-feedback.ok,
body.theme-light .gate-feedback.ok { background: #ecfdf5; border-color: #86efac; color: #166534; }
