/* SilverEdge HelpDesk — shared styles
   Brand: cyan (#00a5bd), navy (#112337), Work Sans, polished cards */

:root {
  --hd-bg: #f6f8fb;
  --hd-card: #ffffff;
  --hd-border: rgba(17, 35, 55, 0.08);
  --hd-border-strong: rgba(17, 35, 55, 0.14);
  --hd-navy: #112337;
  --hd-slate: #475569;
  --hd-slate-soft: #64748b;
  --hd-cyan: #00a5bd;
  --hd-cyan-deep: #00879a;
  --hd-cyan-soft: #e0f8fb;
  --hd-blue: #1e6df0;
  --hd-blue-soft: #eff5ff;
  --hd-green: #059669;
  --hd-green-soft: #d1fae5;
  --hd-amber: #92400e;
  --hd-amber-soft: #fef3c7;
}

body.hd-body { background: var(--hd-bg); color: var(--hd-navy); }

/* hidden attribute always wins over display: flex/grid/inline-block */
[hidden] { display: none !important; }

/* ===== HEADER ===== */
.hd-header {
  background: linear-gradient(135deg, #0c1d33 0%, #1c3358 100%);
  color: #fff;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.hd-header-inner {
  max-width: 1480px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.hd-brand {
  display: flex; align-items: center; gap: 14px;
  text-decoration: none; color: #fff;
  transition: opacity 0.15s;
}
.hd-brand:hover { opacity: 0.9; }
.hd-brand-logo-img {
  width: 180px; height: 40px;
  display: block; object-fit: contain;
}
.hd-brand-divider {
  width: 1px; height: 28px; background: rgba(255, 255, 255, 0.18);
  display: block;
}
.hd-brand-tagline {
  font-size: 0.95rem; font-weight: 600; color: rgba(255, 255, 255, 0.92);
  letter-spacing: -0.005em;
}
.hd-header-right {
  display: flex; align-items: center; gap: 12px;
  flex-shrink: 0;
}
.hd-status {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 100px; background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.02em;
}
.hd-status-text-short, .hd-cta-text-short { display: none !important; }

/* EN | ES language toggle */
.hd-lang-toggle {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 11px; border-radius: 8px;
  background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.85);
  border: 1px solid rgba(255,255,255,0.12);
  font-size: 0.78rem; font-weight: 600; cursor: pointer; font-family: inherit;
  transition: background 0.12s;
}
.hd-lang-toggle:hover { background: rgba(255,255,255,0.12); }
.hd-lang-toggle .hd-lang-en, .hd-lang-toggle .hd-lang-es { transition: color 0.12s; }
.hd-lang-toggle .hd-lang-sep { color: rgba(255,255,255,0.3); }
body.lang-en .hd-lang-en { color: var(--hd-cyan); font-weight: 700; }
body.lang-en .hd-lang-es { color: rgba(255,255,255,0.55); }
body.lang-es .hd-lang-es { color: var(--hd-cyan); font-weight: 700; }
body.lang-es .hd-lang-en { color: rgba(255,255,255,0.55); }
.hd-status::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%; background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
  animation: hdPulse 2s ease-in-out infinite;
}
@keyframes hdPulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
  70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
.hd-header-cta {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255, 255, 255, 0.95); color: var(--hd-navy);
  padding: 9px 16px; border-radius: 10px; font-weight: 600; font-size: 0.92rem;
  text-decoration: none; transition: transform 0.15s, box-shadow 0.15s;
}
.hd-header-cta:hover { transform: translateY(-1px); box-shadow: 0 6px 18px -4px rgba(0, 0, 0, 0.25); }
.hd-header-cta svg { width: 16px; height: 16px; color: var(--hd-cyan-deep); }

/* ===== TABS ===== */
.hd-tabs {
  background: #fff; border-bottom: 1px solid var(--hd-border);
  padding: 0 24px; max-width: 1480px; margin: 0 auto;
  display: flex; gap: 4px; overflow-x: auto;
}
.hd-tab {
  padding: 14px 18px; font-size: 0.92rem; font-weight: 600; color: var(--hd-slate);
  border: none; background: transparent; cursor: pointer; white-space: nowrap;
  border-bottom: 2px solid transparent; transition: color 0.15s, border-color 0.15s;
}
.hd-tab:hover { color: var(--hd-navy); }
.hd-tab.active { color: var(--hd-cyan-deep); border-bottom-color: var(--hd-cyan); }

/* ===== LAYOUT GRID ===== */
.hd-layout {
  max-width: 1480px; margin: 0 auto; padding: 24px;
  display: grid; grid-template-columns: 240px 1fr 320px; gap: 24px;
  min-height: calc(100vh - 200px);
}
@media (max-width: 1200px) {
  .hd-layout { grid-template-columns: 1fr 320px; }
  .hd-sidebar-left { display: none; }
}
@media (max-width: 800px) {
  .hd-layout { grid-template-columns: 1fr; padding: 16px; gap: 16px; }
  .hd-sidebar-right { display: none; }
}

/* ===== SIDEBARS ===== */
.hd-sidebar { display: flex; flex-direction: column; gap: 18px; }
.hd-side-card {
  background: var(--hd-card); border: 1px solid var(--hd-border);
  border-radius: 14px; padding: 16px;
}
.hd-side-card h3 {
  font-size: 0.7rem; font-weight: 700; color: var(--hd-slate); margin: 0 0 12px;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.hd-topic-list { display: flex; flex-direction: column; gap: 2px; }
.hd-topic {
  padding: 9px 12px; border-radius: 8px; font-size: 0.92rem; color: var(--hd-slate);
  cursor: pointer; transition: background 0.12s, color 0.12s;
  display: flex; align-items: center; gap: 9px; text-align: left; border: none;
  background: transparent; width: 100%; font-family: inherit;
}
.hd-topic:hover { background: var(--hd-cyan-soft); color: var(--hd-navy); }
.hd-topic.active { background: var(--hd-cyan-soft); color: var(--hd-cyan-deep); font-weight: 600; }
.hd-topic-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--hd-cyan); flex-shrink: 0; }

/* Quick numbers */
.hd-stat { padding: 10px 0; border-bottom: 1px solid var(--hd-border); }
.hd-stat:last-child { border-bottom: none; padding-bottom: 0; }
.hd-stat:first-child { padding-top: 0; }
.hd-stat-label { font-size: 0.78rem; color: var(--hd-slate); margin-bottom: 2px; }
.hd-stat-val { font-size: 1.25rem; font-weight: 700; color: var(--hd-navy); line-height: 1.1; }
.hd-stat-trend { font-size: 0.74rem; color: var(--hd-slate-soft); margin-top: 2px; }
.hd-stat-trend.up::before { content: '↑ '; color: #d97706; }
.hd-stat-trend.down::before { content: '↓ '; color: var(--hd-green); }

/* Scenario cards */
.hd-scenario {
  padding: 11px 12px; border-radius: 10px; cursor: pointer;
  transition: background 0.12s, transform 0.12s; display: block;
  border: 1px solid transparent; background: transparent;
  width: 100%; text-align: left; font-family: inherit;
}
.hd-scenario:hover { background: var(--hd-blue-soft); border-color: rgba(30, 109, 240, 0.2); }
.hd-scenario-title { font-size: 0.92rem; font-weight: 600; color: var(--hd-navy); margin-bottom: 2px; }
.hd-scenario-sub { font-size: 0.78rem; color: var(--hd-slate); }

/* Talk-to-advisor card */
.hd-advisor-card {
  background: linear-gradient(135deg, var(--hd-cyan-deep) 0%, var(--hd-blue) 100%);
  color: #fff; border: none;
}
.hd-advisor-card h3 { color: rgba(255, 255, 255, 0.85); }
.hd-advisor-card .hd-adv-headline {
  font-size: 1.05rem; font-weight: 700; margin: 6px 0 4px; line-height: 1.25;
}
.hd-advisor-card .hd-adv-sub {
  font-size: 0.85rem; color: rgba(255, 255, 255, 0.85); line-height: 1.45; margin-bottom: 14px;
}
.hd-advisor-card .hd-adv-phone {
  display: flex; align-items: center; gap: 9px; padding: 11px 14px;
  background: rgba(255, 255, 255, 0.15); border-radius: 10px;
  color: #fff; text-decoration: none; font-weight: 700; font-size: 1.02rem;
  transition: background 0.15s;
}
.hd-advisor-card .hd-adv-phone:hover { background: rgba(255, 255, 255, 0.25); }
.hd-advisor-card .hd-adv-phone svg { width: 18px; height: 18px; }
.hd-advisor-card .hd-adv-meta {
  display: flex; align-items: center; gap: 6px; margin-top: 9px;
  font-size: 0.76rem; color: rgba(255, 255, 255, 0.78);
}

/* ===== CHAT ===== */
.hd-chat-card {
  background: var(--hd-card); border: 1px solid var(--hd-border);
  border-radius: 16px; display: flex; flex-direction: column;
  height: calc(100vh - 220px); min-height: 540px; max-height: 800px;
}
.hd-chat-messages {
  flex: 1; overflow-y: auto; padding: 22px;
  display: flex; flex-direction: column; gap: 14px;
}
.hd-msg {
  display: flex; gap: 12px; max-width: 88%;
  animation: hdMsgIn 0.25s ease-out;
}
@keyframes hdMsgIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.hd-msg.hd-user { align-self: flex-end; flex-direction: row-reverse; }
.hd-msg-avatar {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.78rem; color: #fff;
}
.hd-msg-avatar.hd-bot { background: linear-gradient(135deg, var(--hd-cyan) 0%, var(--hd-blue) 100%); }
.hd-msg-avatar.hd-user-av { background: var(--hd-navy); }
.hd-msg-bubble {
  padding: 12px 16px; border-radius: 14px; line-height: 1.55; font-size: 0.95rem;
}
.hd-msg.hd-bot .hd-msg-bubble {
  background: #f1f5f9; color: var(--hd-navy); border-top-left-radius: 4px;
}
.hd-msg.hd-user .hd-msg-bubble {
  background: var(--hd-navy); color: #fff; border-top-right-radius: 4px;
}
.hd-msg-bubble p { margin: 0 0 8px; }
.hd-msg-bubble p:last-child { margin: 0; }
.hd-msg-bubble strong { color: inherit; font-weight: 700; }
.hd-msg-bubble ul, .hd-msg-bubble ol { margin: 6px 0 8px; padding-left: 22px; }
.hd-msg-bubble li { margin: 3px 0; }
.hd-msg-bubble h2, .hd-msg-bubble h3 {
  font-size: 1rem; margin: 12px 0 6px; color: var(--hd-navy);
}
.hd-msg-bubble code {
  font-family: 'SF Mono', Consolas, monospace; font-size: 0.85em;
  background: rgba(0, 0, 0, 0.05); padding: 1px 5px; border-radius: 4px;
}
.hd-msg-bubble table {
  border-collapse: collapse; margin: 10px 0; width: 100%;
  font-size: 0.88rem;
}
.hd-msg-bubble th, .hd-msg-bubble td {
  border: 1px solid var(--hd-border-strong); padding: 7px 10px; text-align: left;
}
.hd-msg-bubble th { background: rgba(0, 0, 0, 0.04); font-weight: 700; }
.hd-msg-bubble em { color: var(--hd-slate); font-style: italic; }

/* Streaming cursor — blinks while AI is mid-response */
.hd-stream-cursor {
  display: inline-block; color: var(--hd-cyan-deep); font-weight: 700;
  margin-left: 1px; animation: hdBlink 1s steps(2, start) infinite;
}
@keyframes hdBlink { to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .hd-stream-cursor { animation: none; }
}

/* 👍/👎 feedback buttons under each AI reply */
.hd-fb {
  margin-top: 10px; padding-top: 8px;
  border-top: 1px dashed rgba(17,35,55,.08);
  display: flex; gap: 4px;
}
.hd-fb-btn {
  background: transparent; border: 1px solid transparent;
  padding: 3px 8px; border-radius: 6px; font-size: 0.95rem; cursor: pointer;
  transition: background 0.12s, border-color 0.12s, transform 0.12s;
  font-family: inherit; opacity: 0.55;
}
.hd-fb-btn:hover:not(:disabled) {
  opacity: 1; background: rgba(0, 0, 0, 0.04); transform: scale(1.1);
}
.hd-fb-btn:disabled { cursor: default; }
.hd-fb-btn.hd-fb-selected {
  opacity: 1; background: rgba(0, 165, 189, 0.12); border-color: rgba(0, 165, 189, 0.3);
}

.hd-typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.hd-typing span {
  width: 7px; height: 7px; border-radius: 50%; background: var(--hd-slate-soft);
  animation: hdDot 1.2s infinite ease-in-out;
}
.hd-typing span:nth-child(2) { animation-delay: 0.15s; }
.hd-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes hdDot {
  0%, 60%, 100% { transform: scale(0.7); opacity: 0.5; }
  30% { transform: scale(1); opacity: 1; }
}

.hd-msg-error {
  background: var(--hd-amber-soft); color: var(--hd-amber);
  border: 1px solid #fcd34d;
}

/* Welcome card — visual hero, signals "this is a chat" */
.hd-welcome {
  background: linear-gradient(135deg, var(--hd-cyan-soft) 0%, var(--hd-blue-soft) 100%);
  border: 1px solid var(--hd-cyan);
  padding: 22px 22px 16px; border-radius: 14px;
  position: relative; overflow: hidden;
}
.hd-welcome::before {
  content: '🤖'; position: absolute; right: -8px; bottom: -12px;
  font-size: 92px; opacity: 0.07; pointer-events: none; line-height: 1;
}
.hd-welcome h2 { margin: 0 0 10px; font-size: 1.28rem; color: var(--hd-navy); line-height: 1.25; }
.hd-welcome p { margin: 0 0 8px; color: var(--hd-slate); line-height: 1.55; font-size: 0.94rem; }
.hd-welcome p:last-child { font-weight: 600; color: var(--hd-cyan-deep); font-size: 1rem; margin-top: 10px; }
.hd-welcome ul { margin: 4px 0 8px; padding-left: 22px; color: var(--hd-slate); font-size: 0.92rem; }
.hd-welcome li { margin: 3px 0; }

/* Suggestions */
.hd-suggestions {
  padding: 12px 18px; border-top: 1px solid var(--hd-border);
  display: flex; gap: 8px; flex-wrap: wrap; background: #fafbfc;
}
.hd-sugg {
  padding: 7px 13px; border: 1px solid var(--hd-border-strong);
  border-radius: 100px; background: #fff; font-size: 0.84rem;
  color: var(--hd-slate); cursor: pointer; transition: all 0.12s;
  font-family: inherit;
}
.hd-sugg:hover { border-color: var(--hd-cyan); color: var(--hd-cyan-deep); background: var(--hd-cyan-soft); }

/* Input bar */
.hd-input-bar {
  padding: 14px 18px; border-top: 1px solid var(--hd-border);
  display: flex; gap: 10px; background: #fff;
  border-radius: 0 0 16px 16px;
}
.hd-input {
  flex: 1; padding: 12px 16px; font-size: 0.96rem;
  border: 1px solid var(--hd-border-strong); border-radius: 10px;
  font-family: inherit; color: var(--hd-navy); background: #fff;
  resize: none; min-height: 44px; max-height: 140px; line-height: 1.45;
}
.hd-input:focus { outline: none; border-color: var(--hd-cyan); box-shadow: 0 0 0 3px rgba(0, 165, 189, 0.15); }
.hd-send {
  padding: 0 18px; border-radius: 10px; border: none;
  background: linear-gradient(135deg, var(--hd-cyan) 0%, var(--hd-blue) 100%);
  color: #fff; cursor: pointer; transition: transform 0.12s, box-shadow 0.12s;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: inherit;
}
.hd-send:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 18px -4px rgba(0, 165, 189, 0.45); }
.hd-send:disabled { opacity: 0.5; cursor: not-allowed; }
.hd-send svg { width: 18px; height: 18px; }

/* Compliance footer */
.hd-compliance {
  background: var(--hd-amber-soft); color: var(--hd-amber);
  padding: 10px 24px; font-size: 0.8rem; text-align: center;
  border-top: 1px solid #fcd34d;
}
.hd-compliance svg { width: 14px; height: 14px; vertical-align: -3px; margin-right: 5px; }

/* Tab panes — hidden attr respected (override any flex/grid display) */
[data-hd-pane][hidden] { display: none !important; }
[data-hd-pane="topics"]:not([hidden]) { display: flex; flex-direction: column; gap: 12px; }

/* Reference panes (for non-chat tabs) */
.hd-ref-pane h2 { font-size: 1.55rem; margin: 0 0 16px; color: var(--hd-navy); }
.hd-ref-callout {
  background: var(--hd-blue-soft); border-left: 4px solid var(--hd-blue);
  padding: 14px 18px; border-radius: 8px; margin-bottom: 22px;
  font-size: 0.94rem; color: var(--hd-slate);
}
.hd-ref-callout strong { color: var(--hd-navy); }
.hd-ref-card {
  background: #fff; border: 1px solid var(--hd-border);
  border-radius: 14px; padding: 22px; margin-bottom: 16px;
}
.hd-ref-card h3 { margin: 0 0 14px; font-size: 1.1rem; color: var(--hd-navy); }
.hd-ref-card ul { margin: 0; padding-left: 22px; color: var(--hd-slate); line-height: 1.7; font-size: 0.94rem; }
.hd-ref-card li { margin: 4px 0; }
.hd-ref-card li strong { color: var(--hd-navy); }
.hd-ref-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 12px; }
@media (max-width: 600px) { .hd-ref-grid { grid-template-columns: 1fr; } }
.hd-ref-stat {
  background: var(--hd-bg); padding: 14px 16px; border-radius: 10px;
  border: 1px solid var(--hd-border);
}
.hd-ref-stat-label { font-size: 0.82rem; color: var(--hd-slate); margin-bottom: 4px; }
.hd-ref-stat-val { font-size: 1.4rem; font-weight: 700; color: var(--hd-navy); line-height: 1.1; }
.hd-ref-stat-sub { font-size: 0.76rem; color: var(--hd-slate-soft); margin-top: 3px; }
.hd-ref-table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 0.92rem; }
.hd-ref-table th, .hd-ref-table td { padding: 9px 12px; border: 1px solid var(--hd-border-strong); text-align: left; }
.hd-ref-table th { background: var(--hd-bg); font-weight: 700; color: var(--hd-navy); }

/* Agent gate */
.hd-gate {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0c1d33 0%, #1c3358 100%);
  padding: 24px;
}
.hd-gate-card {
  width: 100%; max-width: 460px;
  background: rgba(255, 255, 255, 0.04); backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px; padding: 36px 32px; color: #fff;
}
.hd-gate-logo {
  width: 56px; height: 56px; border-radius: 14px; margin: 0 auto 18px;
  background: linear-gradient(135deg, var(--hd-cyan) 0%, var(--hd-blue) 100%);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px -4px rgba(0, 165, 189, 0.5);
}
.hd-gate-logo svg { width: 28px; height: 28px; color: #fff; }
.hd-gate h1 {
  text-align: center; font-size: 1.4rem; margin: 0 0 4px; font-weight: 700;
}
.hd-gate-sub {
  text-align: center; font-size: 0.78rem; color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 28px;
}
.hd-gate-form { display: flex; flex-direction: column; gap: 14px; }
.hd-gate-field { display: flex; flex-direction: column; gap: 5px; }
.hd-gate-field label {
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: rgba(255, 255, 255, 0.7);
}
.hd-gate-field input, .hd-gate-field select {
  padding: 11px 14px; border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05); color: #fff; font-size: 0.96rem;
  font-family: inherit;
}
.hd-gate-field input::placeholder { color: rgba(255, 255, 255, 0.35); }
.hd-gate-field input:focus, .hd-gate-field select:focus {
  outline: none; border-color: var(--hd-cyan);
  box-shadow: 0 0 0 3px rgba(0, 165, 189, 0.2);
}
.hd-gate-submit {
  margin-top: 8px; padding: 13px; border: none; border-radius: 10px;
  background: linear-gradient(135deg, var(--hd-cyan) 0%, var(--hd-blue) 100%);
  color: #fff; font-weight: 700; font-size: 0.98rem;
  cursor: pointer; font-family: inherit;
  transition: transform 0.15s, box-shadow 0.15s;
}
.hd-gate-submit:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 8px 22px -4px rgba(0, 165, 189, 0.5); }
.hd-gate-submit:disabled { opacity: 0.6; cursor: not-allowed; }
.hd-gate-error {
  background: rgba(220, 38, 38, 0.15); color: #fca5a5;
  padding: 9px 14px; border-radius: 8px; font-size: 0.86rem; text-align: center;
  border: 1px solid rgba(220, 38, 38, 0.3);
}
.hd-gate-foot {
  text-align: center; margin-top: 22px; font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.5);
}
.hd-gate-foot a { color: var(--hd-cyan); }

/* ===========================================================================
   TRUST STRIP — under chat title, builds credibility before the AI
   =========================================================================== */
.hd-trust-strip {
  display: flex; gap: 18px; flex-wrap: wrap;
  background: #fff;
  border: 1px solid var(--hd-border);
  border-radius: 12px;
  padding: 11px 16px;
  margin-bottom: 14px;
  font-size: 0.84rem;
  color: var(--hd-slate);
  align-items: center; justify-content: center;
}
.hd-trust-item {
  display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap;
}
.hd-trust-item strong { color: var(--hd-navy); font-weight: 700; }
.hd-trust-svg { width: 16px; height: 16px; color: var(--hd-cyan-deep); flex-shrink: 0; }
.hd-trust-item:nth-child(1) .hd-trust-svg { color: #f59e0b; fill: #f59e0b; stroke: #f59e0b; }
@media (max-width: 720px) {
  .hd-trust-strip { gap: 10px 14px; padding: 10px 14px; font-size: 0.78rem; }
  .hd-trust-svg { width: 14px; height: 14px; }
}
@media (max-width: 460px) {
  /* Hide all but rating + 50 states on tiny screens */
  .hd-trust-strip { justify-content: space-around; }
  .hd-trust-item:nth-child(2), .hd-trust-item:nth-child(4) { display: none; }
}

/* ===========================================================================
   INLINE LEAD CAPTURE — appears in chat after intent / 2nd reply
   =========================================================================== */
.hd-lead-card {
  margin: 14px 0; padding: 18px;
  background: linear-gradient(135deg, var(--hd-cyan-deep) 0%, var(--hd-blue) 100%);
  border-radius: 14px; color: #fff;
  position: relative; overflow: hidden;
  box-shadow: 0 8px 24px -8px rgba(0, 165, 189, 0.4);
  animation: hdLeadIn 0.4s ease-out;
}
@keyframes hdLeadIn {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.hd-lead-card::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at top right, rgba(255,255,255,0.18) 0%, transparent 60%);
  pointer-events: none;
}
.hd-lead-close {
  position: absolute; top: 8px; right: 10px;
  background: rgba(255,255,255,0.15); border: none; color: #fff;
  width: 26px; height: 26px; border-radius: 50%; cursor: pointer;
  font-size: 1.1rem; line-height: 1; padding: 0;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.12s;
}
.hd-lead-close:hover { background: rgba(255,255,255,0.28); }
.hd-lead-head { display: flex; gap: 14px; margin-bottom: 14px; align-items: flex-start; }
.hd-lead-icon {
  width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
  background: rgba(255,255,255,0.18);
  display: flex; align-items: center; justify-content: center;
}
.hd-lead-icon svg { width: 20px; height: 20px; }
.hd-lead-title { font-size: 1.05rem; font-weight: 700; margin-bottom: 3px; line-height: 1.25; }
.hd-lead-sub {
  font-size: 0.86rem; color: rgba(255,255,255,0.9); line-height: 1.45;
  padding-right: 30px;
}
.hd-lead-form {
  display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 8px;
  position: relative;
}
@media (max-width: 600px) {
  .hd-lead-form { grid-template-columns: 1fr 1fr; }
  .hd-lead-form button { grid-column: 1 / -1; }
}
@media (max-width: 360px) {
  .hd-lead-form { grid-template-columns: 1fr; }
}
.hd-lead-form input {
  padding: 10px 12px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.12); color: #fff; font-family: inherit; font-size: 0.92rem;
}
.hd-lead-form input::placeholder { color: rgba(255,255,255,0.65); }
.hd-lead-form input:focus {
  outline: none; border-color: #fff;
  background: rgba(255,255,255,0.18);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.18);
}
.hd-lead-submit {
  padding: 10px 16px; border-radius: 8px; border: none;
  background: #fff; color: var(--hd-navy); font-weight: 700; font-size: 0.92rem;
  cursor: pointer; font-family: inherit; transition: transform 0.12s, box-shadow 0.12s;
  white-space: nowrap;
}
.hd-lead-submit:hover:not(:disabled) {
  transform: translateY(-1px); box-shadow: 0 6px 14px -4px rgba(0,0,0,0.3);
}
.hd-lead-submit:disabled { opacity: 0.6; cursor: not-allowed; }
.hd-lead-status {
  margin-top: 12px; padding: 10px 14px; border-radius: 8px;
  font-size: 0.9rem; line-height: 1.45;
  background: rgba(255,255,255,0.15);
}
.hd-lead-status-ok { background: rgba(255,255,255,0.18); }
.hd-lead-status-err { background: rgba(220,38,38,0.25); }

/* ===========================================================================
   CRO — push customers to call (866) 534-1886
   =========================================================================== */

/* Banner above the chat — first thing in the eyeline */
/* Call banner — quieter secondary CTA (was a hero gradient that competed with chat) */
.hd-call-banner {
  display: flex; align-items: center; gap: 12px;
  background: #fff; border: 1px solid var(--hd-border);
  color: var(--hd-navy); padding: 10px 14px; border-radius: 10px;
  text-decoration: none;
  margin-bottom: 12px; transition: background 0.12s, border-color 0.12s;
}
.hd-call-banner:hover { background: var(--hd-cyan-soft); border-color: var(--hd-cyan); }
.hd-call-banner-icon { background: var(--hd-cyan-soft) !important; color: var(--hd-cyan-deep); }
.hd-call-banner-icon svg { color: var(--hd-cyan-deep); }
.hd-call-banner-title { color: var(--hd-navy) !important; font-size: 0.92rem !important; }
.hd-call-banner-sub { color: var(--hd-slate) !important; font-size: 0.78rem !important; }
.hd-call-banner-cta {
  background: var(--hd-cyan-deep) !important; color: #fff !important;
  font-size: 0.92rem !important;
}
.hd-call-banner.hd-banner-agent { background: #fff; }
.hd-call-banner.hd-banner-agent .hd-call-banner-icon { background: rgba(99,102,241,.12) !important; color: #4338ca; }
.hd-call-banner.hd-banner-agent .hd-call-banner-cta { background: #4338ca !important; }
/* Agent-edition banner — calmer slate-purple gradient (different from customer cyan) */
.hd-call-banner.hd-banner-agent {
  background: linear-gradient(135deg, #4338ca 0%, #6366f1 100%);
  box-shadow: 0 6px 20px -8px rgba(67, 56, 202, 0.5);
}
.hd-call-banner.hd-banner-agent:hover {
  box-shadow: 0 10px 26px -6px rgba(67, 56, 202, 0.6);
}
.hd-call-banner-icon {
  width: 42px; height: 42px; flex-shrink: 0; border-radius: 10px;
  background: rgba(255, 255, 255, 0.18);
  display: flex; align-items: center; justify-content: center;
}
.hd-call-banner-icon svg { width: 22px; height: 22px; }
.hd-call-banner-text { flex: 1; min-width: 0; }
.hd-call-banner-title {
  font-size: 1rem; font-weight: 700; letter-spacing: -0.005em; margin-bottom: 2px;
}
.hd-call-banner-sub {
  font-size: 0.82rem; color: rgba(255, 255, 255, 0.85); line-height: 1.4;
}
.hd-call-banner-cta {
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
  font-weight: 700; font-size: 1.05rem;
  background: rgba(255, 255, 255, 0.18); padding: 8px 14px; border-radius: 10px;
}
.hd-call-banner-arrow { font-size: 1.15rem; transition: transform 0.15s; }
.hd-call-banner:hover .hd-call-banner-arrow { transform: translateX(3px); }

/* (Removed: dead @media rules for .hd-call-banner — banner is hidden on mobile by the
   mobile-rewrite block below. Kept for desktop-only via base styles above.) */

/* High-intent suggestion pill — "Talk to an advisor now" stands out + SVG phone prefix */
.hd-sugg[data-q*="Talk to an advisor"] {
  background: linear-gradient(135deg, var(--hd-cyan) 0%, var(--hd-blue) 100%);
  color: #fff; border-color: transparent;
  font-weight: 700;
  box-shadow: 0 4px 12px -4px rgba(0, 165, 189, 0.4);
  display: inline-flex; align-items: center; gap: 7px;
}
.hd-sugg[data-q*="Talk to an advisor"]::before {
  content: '';
  width: 14px; height: 14px;
  background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 5a2 2 0 012-2h3.28a1 1 0 01.95.68l1.5 4.49a1 1 0 01-.5 1.21l-2.26 1.13a11.04 11.04 0 005.52 5.52l1.13-2.26a1 1 0 011.21-.5l4.49 1.5a1 1 0 01.68.95V19a2 2 0 01-2 2h-1C9.72 21 3 14.28 3 6V5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center; background-size: 14px;
  flex-shrink: 0;
}
.hd-sugg[data-q*="Talk to an advisor"]:hover {
  color: #fff; transform: translateY(-1px);
  background: linear-gradient(135deg, var(--hd-cyan-deep) 0%, var(--hd-blue) 100%);
  box-shadow: 0 6px 16px -4px rgba(0, 165, 189, 0.55);
}

/* "or call (866) 534-1886" inline link below the input bar */
.hd-input-callout {
  text-align: center; padding: 8px 18px 12px;
  background: #fff; border-top: 1px dashed rgba(17,35,55,0.08);
  font-size: 0.84rem; color: var(--hd-slate);
  border-radius: 0 0 16px 16px;
}
.hd-input-callout a {
  color: var(--hd-cyan-deep); font-weight: 700; text-decoration: none;
}
.hd-input-callout a:hover { text-decoration: underline; }

/* Schedule-callback FAB stack — secondary button next to call FAB */
.hd-fab-stack {
  position: fixed; bottom: 22px; right: 22px; z-index: 100;
  display: flex; flex-direction: column; align-items: flex-end; gap: 10px;
}
.hd-fab-stack .hd-fab { position: static; }
.hd-fab.hd-fab-secondary {
  background: #fff; color: var(--hd-cyan-deep);
  border: 1px solid rgba(0, 165, 189, 0.3);
  box-shadow: 0 8px 20px -6px rgba(17, 35, 55, 0.15);
}
.hd-fab.hd-fab-secondary:hover { background: var(--hd-cyan-soft); transform: translateY(-2px); }
.hd-fab.hd-fab-secondary svg { color: var(--hd-cyan-deep); }

/* Schedule-callback modal */
.hd-cb-modal {
  position: fixed; inset: 0; background: rgba(17, 35, 55, 0.55);
  display: flex; align-items: center; justify-content: center; z-index: 200;
  padding: 24px;
}
.hd-cb-card {
  background: #fff; border-radius: 16px; padding: 28px 28px 24px;
  max-width: 460px; width: 100%; max-height: 90vh; overflow-y: auto;
  position: relative;
  animation: hdLeadIn .4s ease-out;
}
.hd-cb-close {
  position: absolute; top: 12px; right: 14px;
  background: rgba(17, 35, 55, 0.06); border: none; cursor: pointer;
  width: 30px; height: 30px; border-radius: 50%;
  font-size: 1.3rem; line-height: 1; color: var(--hd-slate);
}
.hd-cb-close:hover { background: rgba(17, 35, 55, 0.12); }
.hd-cb-card h3 { margin: 0 0 6px; font-size: 1.3rem; color: var(--hd-navy); }
.hd-cb-sub { color: var(--hd-slate); font-size: .94rem; margin: 0 0 18px; }
.hd-cb-field { margin-bottom: 12px; }
.hd-cb-field label {
  display: block; font-size: .76rem; font-weight: 700; color: var(--hd-slate);
  text-transform: uppercase; letter-spacing: .04em; margin-bottom: 5px;
}
.hd-cb-field input {
  width: 100%; padding: 11px 13px; border-radius: 8px;
  border: 1px solid rgba(17, 35, 55, 0.15); font-family: inherit; font-size: .96rem;
  color: var(--hd-navy);
}
.hd-cb-field input:focus { outline: none; border-color: var(--hd-cyan); box-shadow: 0 0 0 3px rgba(0, 165, 189, 0.18); }
.hd-cb-slots {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
  max-height: 220px; overflow-y: auto; padding: 4px;
}
.hd-cb-slot {
  padding: 9px 10px; border-radius: 8px;
  border: 1px solid rgba(17, 35, 55, 0.12); background: #fff;
  font-family: inherit; font-size: .82rem; cursor: pointer; color: var(--hd-navy);
  transition: all .12s;
  text-align: center; line-height: 1.2;
}
.hd-cb-slot:hover { border-color: var(--hd-cyan); color: var(--hd-cyan-deep); }
.hd-cb-slot.selected {
  background: linear-gradient(135deg, var(--hd-cyan) 0%, var(--hd-blue) 100%);
  color: #fff; border-color: transparent;
}
.hd-cb-slot-day {
  display: block; font-size: .68rem; font-weight: 700; color: var(--hd-slate-soft);
  text-transform: uppercase; letter-spacing: .04em; margin-bottom: 1px;
}
.hd-cb-slot.selected .hd-cb-slot-day { color: rgba(255,255,255,.78); }
.hd-cb-status {
  margin-top: 10px; padding: 9px 12px; border-radius: 8px; font-size: .86rem;
}
.hd-cb-status.err { background: #fee2e2; color: #dc2626; }
.hd-cb-status.ok { background: var(--hd-green-soft); color: #065f46; }
.hd-cb-submit {
  width: 100%; padding: 13px; border: none; border-radius: 10px;
  background: linear-gradient(135deg, var(--hd-cyan) 0%, var(--hd-blue) 100%);
  color: #fff; font-weight: 700; font-size: 1rem; cursor: pointer; font-family: inherit;
  margin-top: 8px; transition: transform .15s, box-shadow .15s;
}
.hd-cb-submit:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 8px 22px -4px rgba(0, 165, 189, 0.4); }
.hd-cb-submit:disabled { opacity: .55; cursor: not-allowed; }

/* Floating "Call Now" FAB — always visible, bottom-right */
.hd-fab {
  position: fixed; bottom: 22px; right: 22px; z-index: 100;
  display: inline-flex; align-items: center; gap: 9px;
  padding: 14px 18px;
  background: linear-gradient(135deg, var(--hd-cyan) 0%, var(--hd-blue) 100%);
  color: #fff; border-radius: 100px; text-decoration: none;
  font-weight: 700; font-size: 0.94rem;
  box-shadow: 0 12px 28px -6px rgba(0, 165, 189, 0.55), 0 4px 10px -2px rgba(17,35,55,0.15);
  transition: transform 0.15s, box-shadow 0.15s;
}
.hd-fab:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 16px 36px -6px rgba(0, 165, 189, 0.65), 0 6px 14px -2px rgba(17,35,55,0.2);
}
.hd-fab svg { width: 20px; height: 20px; }
.hd-fab-text { white-space: nowrap; }

/* Pulsing ring on the FAB to draw the eye */
.hd-fab-pulse {
  position: absolute; inset: 0; border-radius: 100px;
  border: 2px solid var(--hd-cyan);
  animation: hdFabPulse 2.4s cubic-bezier(0.4, 0, 0.6, 1) infinite;
  pointer-events: none;
}
@keyframes hdFabPulse {
  0% { transform: scale(1); opacity: 0.7; }
  70% { transform: scale(1.18); opacity: 0; }
  100% { transform: scale(1.18); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .hd-fab-pulse { animation: none; }
}

@media (max-width: 720px) {
  .hd-fab { bottom: 16px; right: 16px; padding: 12px 16px; font-size: 0.88rem; }
  .hd-fab svg { width: 18px; height: 18px; }
  /* Push the chat input above the FAB so it doesn't overlap */
  .hd-chat-card { margin-bottom: 80px !important; }
}
@media (max-width: 460px) {
  .hd-fab { bottom: 14px; right: 14px; padding: 11px 14px; }
  .hd-fab-text { display: none; }
  .hd-fab svg { width: 22px; height: 22px; }
  .hd-fab { padding: 14px; border-radius: 50%; }
}

/* ===========================================================================
   MOBILE / RESPONSIVE
   =========================================================================== */

@media (max-width: 1100px) {
  .hd-brand-tagline { display: none; }
  .hd-brand-divider { display: none; }
}

@media (max-width: 720px) {
  .hd-header { padding: 11px 0; }
  .hd-header-inner { padding: 0 14px; gap: 10px; }
  .hd-brand-logo-img { width: 132px; height: 30px; }
  .hd-status-text { display: none !important; }
  .hd-status-text-short { display: inline !important; }
  .hd-status { padding: 5px 11px; font-size: 0.74rem; }
  .hd-cta-text { display: none !important; }
  .hd-cta-text-short { display: inline !important; }
  .hd-header-cta { padding: 8px 12px; font-size: 0.86rem; }
  .hd-header-cta svg { width: 15px; height: 15px; }

  .hd-tabs { padding: 0 14px; }
  .hd-tab { padding: 12px 14px; font-size: 0.86rem; }

  /* Chat takes full available height on mobile */
  .hd-chat-card {
    height: calc(100vh - 240px);
    min-height: 0;
    border-radius: 12px;
  }
  .hd-chat-messages { padding: 16px; gap: 12px; }
  .hd-msg { max-width: 92%; }
  .hd-msg-bubble { padding: 11px 14px; font-size: 0.92rem; }
  .hd-msg-avatar { width: 28px; height: 28px; font-size: 0.7rem; }

  .hd-welcome { padding: 16px 4px 8px; }
  .hd-welcome h2 { font-size: 1.08rem; }
  .hd-welcome p, .hd-welcome ul { font-size: 0.9rem; }

  .hd-suggestions { padding: 10px 14px; gap: 6px; }
  .hd-sugg { padding: 6px 11px; font-size: 0.78rem; }

  .hd-input-bar { padding: 12px 14px; }
  .hd-input { padding: 10px 13px; font-size: 0.94rem; min-height: 42px; }
  .hd-send { padding: 0 14px; }

  .hd-compliance { padding: 9px 14px; font-size: 0.74rem; line-height: 1.4; }
}

@media (max-width: 460px) {
  .hd-brand-logo-img { width: 110px; height: 25px; }
  .hd-status { padding: 4px 9px; font-size: 0.7rem; }
  .hd-status::before { width: 6px; height: 6px; }
  .hd-header-cta { padding: 7px 10px; font-size: 0.82rem; gap: 5px; }
  .hd-header-cta svg { width: 14px; height: 14px; }
  .hd-tab { padding: 11px 11px; font-size: 0.82rem; }
}

/* iOS safe-area + sticky-call protection (the floating phone button on the
   main site can overlap the helpdesk input bar — push the chat above it). */
@media (max-width: 800px) {
  .hd-chat-card { margin-bottom: 70px; }
}

/* Reduce table font on mobile for AI responses with embedded tables */
@media (max-width: 600px) {
  .hd-msg-bubble table { font-size: 0.8rem; }
  .hd-msg-bubble th, .hd-msg-bubble td { padding: 5px 7px; }
}

/* Agent gate mobile */
@media (max-width: 540px) {
  .hd-gate { padding: 16px; }
  .hd-gate-card { padding: 26px 22px; border-radius: 14px; }
  .hd-gate h1 { font-size: 1.18rem; }
  .hd-gate-sub { font-size: 0.7rem; margin-bottom: 22px; }
  .hd-gate-field input, .hd-gate-field select { padding: 10px 12px; font-size: 0.94rem; }
}

/* ===========================================================================
   MOBILE REDESIGN — chat-first, full-viewport, iMessage-style (≤720px)
   Goal: instantly clear it's a chat window, sticky input, zero clutter.
   =========================================================================== */
@media (max-width: 720px) {
  /* ====== MOBILE REWRITE — chat-only, like iMessage ====== */
  /* Lock viewport, no scroll on body — chat scrolls inside */
  html, body { height: 100dvh; overflow: hidden; margin: 0; padding: 0; }
  body.hd-body {
    display: flex; flex-direction: column;
    background: #fff;
    -webkit-tap-highlight-color: transparent;
  }
  #hd-main {
    display: flex; flex-direction: column;
    flex: 1; min-height: 0; overflow: hidden;
  }

  /* HEADER — slim 48px, just logo + status dot + tiny phone icon */
  .hd-header {
    flex-shrink: 0; padding: 0 !important;
    border-bottom: 1px solid var(--hd-border);
    background: #fff !important; color: var(--hd-navy) !important;
    z-index: 30; min-height: 48px;
  }
  .hd-header-inner {
    padding: 6px 12px !important; max-width: 100% !important;
    gap: 8px !important; min-height: 48px;
  }
  .hd-brand { gap: 8px !important; flex: 1 1 auto; min-width: 0; }
  .hd-brand-logo-img { height: 24px !important; width: auto !important; flex-shrink: 0; filter: invert(0); }
  /* Replace dark logo with version that works on white bg */
  .hd-brand-divider { display: none !important; }
  .hd-brand-tagline { display: none !important; }
  .hd-header-right { gap: 8px !important; flex-shrink: 0; }
  .hd-lang-toggle { display: none !important; }
  /* Status: small dot + "Online" */
  .hd-status { padding: 4px 8px !important; font-size: 0.7rem !important; background: rgba(16,185,129,.12) !important; color: #047857 !important; }
  .hd-status::before { background: #10b981 !important; }
  .hd-status-text { display: none !important; }
  .hd-status-text-short { display: inline !important; }
  /* Header CTA: ICON ONLY, 40px tap target */
  .hd-header-cta {
    background: var(--hd-cyan-deep) !important; color: #fff !important;
    width: 40px; height: 40px; padding: 0 !important;
    border-radius: 50% !important;
    display: inline-flex !important; align-items: center !important; justify-content: center !important;
    gap: 0 !important;
  }
  .hd-header-cta svg { width: 18px !important; height: 18px !important; color: #fff !important; }
  .hd-cta-text, .hd-cta-text-short { display: none !important; }

  /* HIDE everything that isn't the chat */
  .hd-tabs { display: none !important; }
  .hd-trust-strip { display: none !important; }
  .hd-call-banner { display: none !important; }
  .hd-sidebar-left, .hd-sidebar-right { display: none !important; }
  [data-hd-pane="topics"], [data-hd-pane="quick"] { display: none !important; }
  /* Hide the auto-show "Want a licensed advisor to call you?" lead capture on mobile first paint
     — too pushy. User can still trigger it via the + menu. */
  .hd-lead-card { display: none !important; }
  /* Hide the educational compliance footer on mobile — TPMO bar covers compliance */
  .hd-compliance { display: none !important; }
  /* Hide both FABs on mobile — header has Call, + menu has Schedule */
  .hd-fab-stack { display: none !important; }

  /* LAYOUT: single column fills viewport */
  .hd-layout {
    flex: 1; min-height: 0;
    padding: 0; gap: 0; margin: 0; max-width: 100%;
    grid-template-columns: 1fr;
    display: flex !important; flex-direction: column;
  }
  .hd-layout > main {
    flex: 1; min-height: 0; display: flex; flex-direction: column;
  }

  /* CHAT CARD: fills the screen between header and input */
  .hd-chat-card {
    flex: 1; min-height: 0; max-height: none; height: auto;
    border: none !important; border-radius: 0 !important; background: #f6f8fb;
    display: flex; flex-direction: column;
    box-shadow: none !important;
  }
  .hd-chat-messages {
    flex: 1; min-height: 0; padding: 16px 14px 12px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  /* WELCOME — single chat bubble like a first message from the bot.
     Strip everything except a single short greeting line. */
  .hd-welcome {
    background: #fff !important;
    border: 1px solid var(--hd-border) !important;
    padding: 12px 14px !important;
    border-radius: 16px 16px 16px 4px !important;
    box-shadow: none !important;
    margin: 0 !important;
    max-width: 86%; align-self: flex-start;
    position: relative;
  }
  .hd-welcome::before { display: none !important; }
  /* Hide the verbose original H2/paragraphs/bullets entirely */
  .hd-welcome h2,
  .hd-welcome p,
  .hd-welcome ul { display: none !important; }
  /* Show ONE short greeting via ::after — line-specific (Medicare vs ACA) */
  .hd-welcome::after {
    display: block;
    font-size: 0.93rem; line-height: 1.5; color: var(--hd-navy);
  }
  body[data-line="medicare"] .hd-welcome::after {
    content: "👋 Hi! Ask me anything about Medicare in plain English. I'll connect you to a licensed advisor when you need one — free, no signup.";
  }
  body[data-line="aca"] .hd-welcome::after {
    content: "👋 Hi! Ask me anything about Marketplace health insurance. I'll connect you to a licensed advisor when you need one — free, no signup.";
  }
  body.lang-es[data-line="medicare"] .hd-welcome::after {
    content: "👋 ¡Hola! Pregúntame cualquier cosa sobre Medicare. Te conecto con un asesor licenciado cuando lo necesites — gratis, sin registro.";
  }
  body.lang-es[data-line="aca"] .hd-welcome::after {
    content: "👋 ¡Hola! Pregúntame cualquier cosa sobre el seguro del Marketplace. Te conecto con un asesor licenciado cuando lo necesites — gratis, sin registro.";
  }

  /* SUGGESTIONS — wrap to 2 rows of chips, no horizontal scroll, easy to tap */
  .hd-suggestions {
    padding: 10px 12px 12px;
    flex-wrap: wrap !important;
    overflow: visible !important;
    gap: 8px !important;
    background: #fff !important;
    border-top: 1px solid var(--hd-border);
  }
  .hd-sugg {
    flex-shrink: 0; padding: 9px 14px !important; font-size: 0.84rem !important;
    border-radius: 20px !important; white-space: nowrap;
    min-height: 36px; display: inline-flex; align-items: center;
  }
  /* Hide all but the first 4 suggestions on mobile (less choice paralysis) */
  .hd-suggestions .hd-sugg:nth-child(n+5) { display: none !important; }

  /* INPUT BAR — sticky, big tap target, + button for menu */
  .hd-input-bar {
    flex-shrink: 0;
    padding: 10px 12px;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--hd-border);
    background: #fff;
    box-shadow: 0 -2px 12px rgba(15, 23, 42, 0.04);
    align-items: center;
  }
  .hd-input {
    padding: 12px 16px !important; font-size: 16px !important; /* prevent iOS zoom */
    border-radius: 22px !important; min-height: 44px !important;
    background: #f6f8fb !important; border-color: var(--hd-border) !important;
  }
  .hd-send {
    width: 44px !important; height: 44px !important; padding: 0 !important;
    border-radius: 50% !important; flex-shrink: 0;
    display: inline-flex !important; align-items: center; justify-content: center;
  }
  .hd-send svg { width: 18px !important; height: 18px !important; }

  /* MESSAGE BUBBLES — chat-app sized */
  .hd-msg { max-width: 92%; gap: 8px; margin-bottom: 12px; }
  .hd-msg-avatar { width: 28px; height: 28px; font-size: 0.7rem; }
  .hd-msg-bubble {
    padding: 12px 14px !important; font-size: 0.94rem !important;
    line-height: 1.5 !important; border-radius: 16px !important;
  }
  .hd-bot .hd-msg-bubble { background: #fff; border: 1px solid var(--hd-border); }
  .hd-user .hd-msg-bubble {
    background: linear-gradient(135deg, var(--hd-cyan-deep), var(--hd-blue));
    color: #fff; border: none;
  }
  .hd-user .hd-msg-bubble strong { color: #fff; }

  /* TPMO BAR — slim minimal one-liner just above input */
  #hd-compliance-banner {
    padding: 8px 12px !important;
    padding-bottom: max(8px, env(safe-area-inset-bottom)) !important;
    font-size: 0.72rem !important;
    line-height: 1.3 !important;
    box-shadow: 0 -4px 14px rgba(0,0,0,.12) !important;
    border-top: 2px solid #f59e0b !important;
    z-index: 70;
  }
  #hd-compliance-banner button {
    padding: 5px 10px !important; font-size: 0.72rem !important;
  }

  /* + MENU FAB — opens the bottom sheet with topics, schedule, etc */
  .hd-mobile-plus-fab {
    width: 36px; height: 36px;
    border-radius: 50%; border: 1px solid var(--hd-border-strong);
    background: #fff; color: var(--hd-cyan-deep);
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0; cursor: pointer;
    margin-right: 4px;
  }
  .hd-mobile-plus-fab svg { width: 18px; height: 18px; }
  .hd-mobile-plus-fab:active { background: var(--hd-cyan-soft); }

  /* Old topics FAB no longer needed — using + menu in input bar */
  .hd-mobile-topics-fab { display: none !important; }

  /* Topics drawer: opens from bottom, full-width */
  .hd-topics-drawer {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; max-height: 70vh;
    background: #fff; border-radius: 18px 18px 0 0; z-index: 100;
    box-shadow: 0 -8px 30px rgba(15, 23, 42, 0.18);
    overflow-y: auto; padding: 18px 16px;
    transform: translateY(100%); transition: transform 0.25s ease;
    display: flex; flex-direction: column; gap: 10px;
  }
  .hd-topics-drawer.open { transform: translateY(0); }
  .hd-topics-drawer-handle {
    width: 36px; height: 4px; background: #cbd5e1; border-radius: 2px;
    margin: -8px auto 12px; flex-shrink: 0;
  }
  .hd-topics-drawer h3 { margin: 0 0 8px; font-size: 1rem; color: var(--hd-navy); }
  .hd-topics-drawer .hd-topic { width: 100%; text-align: left; }
}

/* Tablet sweet spot — keep desktop-ish but tighter */
@media (min-width: 721px) and (max-width: 1024px) {
  .hd-layout { padding: 16px; gap: 16px; }
  .hd-chat-card { height: calc(100dvh - 240px); }
}

/* ===========================================================================
   TPMO COMPLIANCE BAR — slim bottom bar (NOT a modal)
   Designed to be present but not in the way — like a cookie banner.
   =========================================================================== */
#hd-compliance-banner {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: #0b1828; color: #fff;
  padding: 10px 18px;
  z-index: 60;
  border-top: 2px solid #f59e0b;
  box-shadow: 0 -4px 14px rgba(0,0,0,.18);
  font-size: 0.84rem;
  line-height: 1.4;
}
#hd-compliance-banner .hd-tpmo-collapsed {
  max-width: 1100px; margin: 0 auto;
}
#hd-compliance-banner .hd-tpmo-expanded {
  max-width: 1100px; margin: 0 auto;
  border-top: 1px solid rgba(245,158,11,.3);
  margin-top: 6px;
}
#hd-compliance-banner button:hover { opacity: 0.9; }
/* Make sure other fixed elements (FAB, sticky-call) sit above the TPMO bar */
.hd-fab-stack { bottom: calc(56px + env(safe-area-inset-bottom)) !important; }

/* ===========================================================================
   MOBILE BOTTOM SHEET — single sheet for Topics + Schedule + Quick Numbers
   Triggered by the + button in the input bar.
   =========================================================================== */
.hd-sheet-backdrop {
  position: fixed; inset: 0; background: rgba(11,24,40,.55);
  z-index: 200; opacity: 0;
  transition: opacity .25s; pointer-events: none;
}
.hd-sheet-backdrop.open { opacity: 1; pointer-events: auto; }
.hd-sheet {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: #fff; border-radius: 18px 18px 0 0;
  z-index: 201; max-height: 80dvh; overflow-y: auto;
  transform: translateY(100%); transition: transform .28s ease;
  padding: 16px 16px 24px;
  padding-bottom: max(24px, env(safe-area-inset-bottom));
  box-shadow: 0 -10px 40px rgba(15,23,42,.25);
}
.hd-sheet.open { transform: translateY(0); }
.hd-sheet-handle {
  width: 40px; height: 4px; background: #cbd5e1; border-radius: 2px;
  margin: 0 auto 16px;
}
.hd-sheet-section { margin-bottom: 22px; }
.hd-sheet-section:last-child { margin-bottom: 0; }
.hd-sheet-h {
  font-size: 0.72rem; font-weight: 700; color: var(--hd-slate);
  letter-spacing: .08em; text-transform: uppercase;
  margin: 0 0 10px;
}
.hd-sheet-row {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 12px 14px;
  border-radius: 10px; border: 1px solid var(--hd-border);
  background: #fff; color: var(--hd-navy);
  font-size: 0.94rem; font-weight: 500; text-align: left;
  margin-bottom: 6px; cursor: pointer; font-family: inherit;
  text-decoration: none;
  min-height: 48px;
}
.hd-sheet-row:active { background: var(--hd-cyan-soft); }
.hd-sheet-row svg { width: 18px; height: 18px; color: var(--hd-cyan-deep); flex-shrink: 0; }
.hd-sheet-row.primary {
  background: var(--hd-cyan-deep); color: #fff; border-color: transparent;
}
.hd-sheet-row.primary svg { color: #fff; }
.hd-sheet-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.hd-sheet-stat {
  background: #f6f8fb; border-radius: 10px; padding: 10px 12px;
}
.hd-sheet-stat-label { font-size: 0.72rem; color: var(--hd-slate); margin-bottom: 2px; }
.hd-sheet-stat-val { font-size: 1rem; font-weight: 700; color: var(--hd-navy); }
.hd-sheet-stat-sub { font-size: 0.68rem; color: var(--hd-slate); margin-top: 1px; }

/* ===========================================================================
   MOBILE FIXES — round 2 (after real-device screenshot audit)
   =========================================================================== */
/* Default: show light logo (white-on-dark for desktop dark header), hide dark */
.hd-brand-logo-dark { display: none; }

@media (max-width: 720px) {
  /* Show dark logo on mobile (light header), hide light */
  .hd-brand-logo-light { display: none !important; }
  .hd-brand-logo-dark { display: block !important; }

  /* Welcome: add a SE avatar circle to the LEFT, like other bot messages */
  .hd-welcome {
    display: flex !important; gap: 10px;
    background: transparent !important; border: none !important; padding: 0 !important;
    border-radius: 0 !important;
  }
  .hd-welcome::before {
    display: flex !important;
    content: 'SE'; flex-shrink: 0;
    width: 32px; height: 32px; border-radius: 50%;
    background: linear-gradient(135deg, var(--hd-cyan), var(--hd-blue));
    color: #fff; font-size: 0.72rem; font-weight: 700;
    align-items: center; justify-content: center;
    align-self: flex-start; margin-top: 2px;
    /* override the desktop bot watermark */
    position: static !important; opacity: 1 !important; right: auto !important; bottom: auto !important;
  }
  .hd-welcome::after {
    flex: 1; min-width: 0;
    background: #fff;
    border: 1px solid var(--hd-border);
    padding: 12px 14px;
    border-radius: 16px 16px 16px 4px;
    /* Add space between emoji and text */
    white-space: pre-wrap;
  }

  /* Input bar: ensure textarea has enough room */
  .hd-input-bar {
    display: flex !important; gap: 8px !important;
    align-items: flex-end;
  }
  .hd-input {
    flex: 1 1 auto !important; min-width: 0 !important;
    width: auto !important; max-width: none !important;
    overflow: hidden !important;
  }
  /* + button shrink to stay out of the way */
  .hd-mobile-plus-fab {
    width: 38px !important; height: 38px !important;
    margin-right: 0 !important;
    flex-shrink: 0 !important;
  }
  /* Send button can't shrink past 44px */
  .hd-send {
    flex-shrink: 0 !important;
    margin-left: 0 !important;
  }

  /* Fix textarea wrapping — single-row baseline */
  textarea.hd-input {
    line-height: 22px !important;
    height: 44px !important;
  }
  textarea.hd-input::placeholder {
    line-height: 22px !important; vertical-align: middle;
  }

  /* TPMO bar: ensure it sits on TOP of everything (z-index war)
     and doesn't get clipped by parent overflow:hidden */
  #hd-compliance-banner {
    position: fixed !important;
    z-index: 90 !important;
  }
  /* Reserve space at bottom of #hd-main so input bar isn't covered by TPMO */
  body:has(#hd-compliance-banner) #hd-main {
    padding-bottom: 56px;
  }
  /* Fallback for browsers without :has() — add bottom margin to input bar */
  .hd-input-bar { margin-bottom: 0; }
}

/* ===========================================================================
   MOBILE FIXES — round 3 (input clipping, empty gap, emoji spacing)
   =========================================================================== */
@media (max-width: 720px) {
  /* Justify chat content to BOTTOM so welcome sits near suggestions
     (instead of leaving huge empty gap on tall phones) */
  .hd-chat-messages {
    justify-content: flex-end !important;
  }

  /* Input: shrink + button to 32px to give textarea more room */
  .hd-mobile-plus-fab {
    width: 32px !important; height: 32px !important;
  }
  .hd-mobile-plus-fab svg { width: 16px; height: 16px; }

  /* Reduce textarea padding so placeholder fits */
  textarea.hd-input {
    padding: 11px 12px !important;
    line-height: 22px !important;
    height: 44px !important;
    /* Allow placeholder to show as single line even if narrow */
    overflow: hidden !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
  }

  /* Send button slightly smaller */
  .hd-send {
    width: 40px !important; height: 40px !important;
  }
  .hd-send svg { width: 16px !important; height: 16px !important; }

  /* Welcome ::after — use NBSP after emoji so spacing is preserved */
  body[data-line="medicare"] .hd-welcome::after {
    content: "👋\00A0\00A0Hi! Ask me anything about Medicare in plain English. I'll connect you to a licensed advisor when you need one — free, no signup.";
  }
  body[data-line="aca"] .hd-welcome::after {
    content: "👋\00A0\00A0Hi! Ask me anything about Marketplace health insurance. I'll connect you to a licensed advisor when you need one — free, no signup.";
  }
  body.lang-es[data-line="medicare"] .hd-welcome::after {
    content: "👋\00A0\00A0¡Hola! Pregúntame cualquier cosa sobre Medicare. Te conecto con un asesor licenciado cuando lo necesites — gratis, sin registro.";
  }
  body.lang-es[data-line="aca"] .hd-welcome::after {
    content: "👋\00A0\00A0¡Hola! Pregúntame cualquier cosa sobre el seguro del Marketplace. Te conecto con un asesor licenciado cuando lo necesites — gratis, sin registro.";
  }

  /* Reduce TPMO bar font slightly to ensure buttons fit on narrow phones */
  #hd-compliance-banner .hd-tpmo-collapsed {
    flex-wrap: wrap !important;
  }
}

/* ===========================================================================
   ACCESSIBILITY — respect motion preferences
   =========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .hd-msg, .hd-lead-card, .hd-status::before, .hd-fab, .hd-typing,
  .hd-sheet-backdrop, .hd-sheet, .hd-topics-drawer,
  .hd-call-banner-arrow, .hd-fab-pulse {
    animation: none !important;
    transition: none !important;
  }
}

/* Focus states — keyboard users */
.hd-sugg:focus-visible, .hd-topic:focus-visible, .hd-scenario:focus-visible,
.hd-input:focus-visible, .hd-send:focus-visible, .hd-mobile-plus-fab:focus-visible,
.hd-fab:focus-visible, .hd-header-cta:focus-visible {
  outline: 3px solid var(--hd-cyan);
  outline-offset: 2px;
}

/* Screen reader only */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
