/* ============================================================
   ESTTECH AI Chat — premium conversational widget
   Spec refs: r2_01..r2_10 + L99 round-3 fixes
   ============================================================ */

/* Defensive: keep page background dark even if a parent wrapper or extension
   leaks a white default. Prevents any "blank patch" beside or around the
   chat panel at any viewport width. */
html, body {
  background-color: #07080a;
}

/* (mobile fullscreen lock removed — chatbox is always a floating panel) */

/* ---- Local token aliases ----
   Tailwind v4 exposes `--color-*` via @theme; chat.css uses short forms
   for readability. Scope to .chat-fab + .chat-panel so we don't leak. */
.chat-fab,
.chat-panel,
.chat-cite-popover,
.chat-toast {
  --bg: #07080a;
  --bg-2: #0e1014;
  --bg-3: #14171c;
  --ink: #ededee;
  --ink-2: #a8acb3;
  --ink-3: #6b7180;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --gold: #d8b25c;
  --gold-2: #efc977;
  --gold-soft: rgba(216, 178, 92, 0.12);
  --green: #22c55e;
  --red: #ef4444;
  --t: 180ms cubic-bezier(.16, 1, .3, 1);
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}

/* ============================================================
   r2_01: FAB + Open/Close Animation
   ============================================================ */
.chat-fab {
  position: fixed !important; right: 26px; bottom: 26px;
  z-index: 99999 !important;
  width: 64px; height: 64px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-2), #b78d3c);
  border: none; color: #1a1408;
  display: grid; place-items: center;
  box-shadow: 0 14px 30px rgba(216, 178, 92, .4),
              0 4px 10px rgba(0, 0, 0, .4);
  cursor: pointer;
  font-size: 24px;
  /* r2_01: ease-out-expo hover, GPU-only transform/opacity */
  transition: transform .18s cubic-bezier(.16, 1, .3, 1),
              box-shadow .18s cubic-bezier(.16, 1, .3, 1),
              opacity .24s ease-out;
  will-change: transform;
}
.chat-fab:hover {
  transform: translateY(-3px) scale(1.06);
  box-shadow: 0 20px 40px rgba(216, 178, 92, .55);
}
.chat-fab.hidden {
  transform: scale(.85); opacity: 0; pointer-events: none;
}
/* r2_01: pulse runs 3 times then auto-stops (not infinite) */
.chat-fab .pulse {
  position: absolute; inset: -3px; border-radius: 50%;
  border: 2px solid rgba(216, 178, 92, .5);
  opacity: .55;
  animation: chatPulse 4s ease-out 3;
  pointer-events: none;
}
@keyframes chatPulse {
  0%   { transform: scale(1);    opacity: .55; }
  100% { transform: scale(1.35); opacity: 0;   }
}
.chat-fab .badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--red); color: white; font-size: 10px;
  width: 18px; height: 18px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700;
  border: 2px solid var(--bg);
}

/* r2_01: panel transform-origin bottom-right, cubic-bezier overshoot */
.chat-panel {
  position: fixed; right: 26px; bottom: 26px; z-index: 110;
  width: 400px; max-width: calc(100vw - 32px);
  height: 640px; max-height: calc(100vh - 64px);
  background: linear-gradient(180deg, #11141a, #0a0c10);
  border: 1px solid var(--line-2);
  border-radius: 20px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6),
              0 0 0 1px rgba(216, 178, 92, .15);
  display: flex; flex-direction: column;
  overflow: hidden;
  transform-origin: bottom right;
  transform: translateY(12px) scale(.92);
  opacity: 0; pointer-events: none;
  transition: transform .28s cubic-bezier(.16, 1, 1, 1),
              opacity .22s ease-out;
  will-change: transform, opacity;
  font-family: var(--font-sans);
}
.chat-panel.open {
  transform: translateY(0) scale(1);
  opacity: 1; pointer-events: auto;
}
.chat-panel.closing {
  transition: transform .2s cubic-bezier(.4, 0, .2, 1),
              opacity .18s ease-in;
}

/* ============================================================
   r2_08: Empty state header — persona avatar + status dot + SLA
   ============================================================ */
.chat-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(216, 178, 92, .06), transparent);
  display: flex; align-items: center; gap: 12px;
  flex-shrink: 0;
}
.chat-head .avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: #131418 url('/assets/logo-dragonfly-gold.png') center/24px no-repeat;
  border: 1px solid rgba(216, 178, 92, .3);
  position: relative;
  flex-shrink: 0;
}
.chat-head .status-dot {
  position: absolute; right: -1px; bottom: -1px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 1.5px #07080a;
}
.chat-head .info { flex: 1; min-width: 0; }
.chat-head .info .name {
  font-weight: 600; font-size: 13px; color: var(--ink);
  line-height: 1.3;
}
.chat-head .info .status {
  font-size: 11px; color: var(--ink-3);
  margin-top: 2px; line-height: 1.3;
}
.chat-head .info .status .dot { margin: 0 6px; opacity: .5; }
.chat-head .close {
  background: transparent; border: 1px solid var(--line-2); color: var(--ink-2);
  width: 30px; height: 30px; border-radius: 8px;
  display: grid; place-items: center; cursor: pointer;
  transition: color var(--t), border-color var(--t);
  font-size: 13px;
}
.chat-head .close:hover { color: var(--gold); border-color: var(--gold); }
.chat-head .close:focus-visible {
  outline: 2px solid var(--gold); outline-offset: 2px;
}
/* P3 Maya / P2 Rick: persistent escalation — outline-only gold so it's discoverable
   without competing with the primary send CTA. */
.chat-head .human-btn {
  border-color: rgba(216, 178, 92, .55);
  color: var(--gold);
}
.chat-head .human-btn:hover {
  border-color: var(--gold);
  background: rgba(216, 178, 92, .08);
}

/* (mobile grab handle removed — desktop floating panel only) */
.chat-grab { display: none; }

.chat-body {
  flex: 1; overflow-y: auto;
  padding: 16px 16px 8px;
  display: flex; flex-direction: column; gap: 6px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}
.chat-body::-webkit-scrollbar { width: 6px; }
.chat-body::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 3px; }

/* ============================================================
   r2_02: Message bubble — iMessage asymmetric tail
   ============================================================ */
.msg {
  display: flex;
  margin: 4px 0;
  position: relative;
  animation: msgIn .2s ease-out;
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}
.msg.bot  { justify-content: flex-start; }
.msg.user { justify-content: flex-end; }

.msg .bubble-wrap {
  display: flex; flex-direction: column;
  max-width: 78%;
  position: relative;
}
.msg.user .bubble-wrap { max-width: 72%; align-items: flex-end; }

.msg .bubble {
  padding: 10px 14px;
  font-size: 14px;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  transition: opacity .15s ease-out;
  font-family: var(--font-sans);
}
/* r2_02: bot left-tail, neutral dark-grey, lh 1.65 */
.msg.bot .bubble {
  background: #131418;
  color: #e8e4dc;
  border: 1px solid rgba(216, 178, 92, .08);
  border-radius: 16px 16px 16px 4px;
  line-height: 1.65;
}
/* r2_02: user right-tail, gold 12% bg + gold border, lh 1.55 */
.msg.user .bubble {
  background: rgba(216, 178, 92, .12);
  color: #f4ead4;
  border: 1px solid rgba(216, 178, 92, .35);
  border-radius: 16px 16px 4px 16px;
  line-height: 1.55;
  font-weight: 450;
}
/* r2_02: system third style — centered, no bubble */
.msg.system {
  justify-content: center;
  font-size: 12px;
  font-style: italic;
  color: var(--ink-3);
  border-top: 1px solid rgba(216, 178, 92, .15);
  border-bottom: 1px solid rgba(216, 178, 92, .15);
  padding: 6px 0;
  margin: 12px 16px;
}
/* r2_02: hover-only timestamps */
.msg .ts {
  font-size: 10.5px;
  color: var(--ink-3);
  opacity: 0;
  transition: opacity .15s;
  margin: 2px 8px 0;
  align-self: flex-end;
}
.msg:hover .ts { opacity: 1; }
.msg .bubble a {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ============================================================
   r2_06: Markdown rendering inside bubbles
   ============================================================ */
.bubble p { margin: 0 0 6px; }
.bubble p:last-child { margin-bottom: 0; }
.bubble strong { font-weight: 600; color: #fff; }
.bubble em { font-style: italic; }
.bubble code {
  font-family: var(--font-mono); font-size: .92em;
  background: rgba(216, 178, 92, .08);
  padding: 1px 5px; border-radius: 3px;
}
.bubble pre {
  margin: 8px 0; padding: 10px 12px;
  border-radius: 6px;
  background: rgba(216, 178, 92, .04);
  border: 1px solid rgba(216, 178, 92, .2);
  overflow-x: auto;
  position: relative;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.5;
}
.bubble pre code { background: none; padding: 0; font-size: inherit; }
.bubble pre .copy-btn {
  position: absolute; top: 6px; right: 6px;
  opacity: 0;
  transition: opacity 120ms;
  font-size: 11px; color: var(--gold);
  background: rgba(7, 8, 10, .8);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2px 8px;
  cursor: pointer;
  font-family: var(--font-sans);
}
.bubble pre:hover .copy-btn { opacity: 1; }
.bubble blockquote {
  border-left: 3px solid var(--gold);
  padding-left: 10px;
  color: var(--ink-2);
  margin: 6px 0;
}
.bubble ul, .bubble ol { padding-left: 22px; margin: 4px 0; }
.bubble li { margin: 2px 0; }

/* ============================================================
   r2_07: Streaming cursor
   ============================================================ */
.bubble.streaming::after {
  content: "▋";
  display: inline-block;
  margin-left: 2px;
  color: var(--gold);
  animation: esttech-cursor-blink 800ms steps(2) infinite;
  font-weight: 400;
}
@keyframes esttech-cursor-blink { 50% { opacity: 0; } }
.stopped-tag {
  display: inline-block;
  margin-left: 6px;
  font-size: 10.5px; color: var(--ink-3);
  font-style: italic;
}

/* ============================================================
   r2_05: Citations & sources
   ============================================================ */
.source-rail {
  display: flex; gap: 6px;
  overflow-x: auto;
  padding: 0 0 8px;
  margin-bottom: 6px;
  scrollbar-width: none;
}
.source-rail::-webkit-scrollbar { display: none; }
.source-card {
  flex: 0 0 auto;
  min-width: 130px; max-width: 170px;
  padding: 8px 10px;
  background: rgba(216, 178, 92, .04);
  border: 1px solid rgba(216, 178, 92, .2);
  border-radius: 8px;
  text-decoration: none;
  color: var(--ink);
  transition: transform 150ms ease-out, box-shadow 150ms, border-color 150ms;
  display: block;
}
.source-card:hover {
  transform: translateY(-1px);
  border-color: var(--gold);
  box-shadow: 0 2px 8px rgba(216, 178, 92, .15);
}
.source-card.is-flash {
  animation: src-flash 200ms ease-out;
}
@keyframes src-flash {
  0%   { background: rgba(216, 178, 92, .35); }
  100% { background: rgba(216, 178, 92, .04); }
}
.source-card .row1 {
  display: flex; align-items: center; gap: 5px;
  font-size: 10.5px; color: var(--ink-3);
}
.source-card .favicon { width: 12px; height: 12px; }
.source-card .domain {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.source-card .title {
  font-size: 11.5px; line-height: 1.3;
  margin-top: 4px; color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cite-mark {
  display: inline-flex;
  align-items: center; justify-content: center;
  height: 15px; min-width: 15px;
  padding: 0 4px;
  margin: 0 1px;
  font-size: 10px; font-weight: 600;
  background: var(--gold-soft); color: var(--gold);
  border-radius: 3px; cursor: pointer;
  vertical-align: super;
  text-decoration: none;
  border: 0; line-height: 1;
}
.cite-mark:hover { background: var(--gold); color: #07080a; }

.chat-cite-popover {
  position: fixed; z-index: 200;
  width: 200px; min-height: 80px;
  padding: 10px;
  background: #0d1015;
  border: 1px solid rgba(216, 178, 92, .35);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .5);
  font-size: 11.5px;
  color: var(--ink);
  pointer-events: none;
  opacity: 0;
  transition: opacity 200ms;
  font-family: var(--font-sans);
}
.chat-cite-popover.open { opacity: 1; }
.chat-cite-popover .pop-domain {
  font-size: 10.5px; color: var(--ink-3);
  display: flex; align-items: center; gap: 5px;
}
.chat-cite-popover .pop-title {
  font-size: 12px; font-weight: 500;
  margin-top: 4px; line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.chat-cite-popover .pop-snippet {
  font-size: 11px; color: var(--ink-2);
  margin-top: 4px; line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ============================================================
   r2_09: Hover actions toolbar (bot only)
   ============================================================ */
.msg.bot .actions {
  position: absolute;
  bottom: -22px; left: 0;
  display: flex; gap: 2px;
  padding: 3px 4px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 6px;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 80ms ease-out, transform 80ms ease-out;
  pointer-events: none;
  z-index: 5;
}
.msg.bot:hover .actions,
.msg.bot .actions:hover,
.msg.bot.long-press .actions {
  opacity: 1; transform: translateY(0); pointer-events: auto;
}
.msg.bot .actions button {
  background: none; border: 0;
  padding: 3px 6px;
  font-size: 12.5px; color: var(--ink-2);
  cursor: pointer; border-radius: 3px;
  transition: color 80ms, background 80ms;
  font-family: var(--font-sans);
  line-height: 1;
}
.msg.bot .actions button:hover {
  color: var(--gold);
  background: rgba(216, 178, 92, .08);
}
.msg.bot .actions button:focus-visible {
  outline: 1.5px solid var(--gold); outline-offset: 1px;
}
.msg.bot .actions button[data-active="up"]   { color: var(--gold); }
.msg.bot .actions button[data-active="down"] { color: var(--gold); }
.msg.bot .actions button[data-active="report"] { color: var(--red); }

.thumbs-popup {
  position: absolute;
  bottom: -110px; left: 0;
  background: var(--bg-3); border: 1px solid var(--line-2);
  border-radius: 6px;
  padding: 6px;
  display: flex; flex-direction: column; gap: 2px;
  z-index: 10;
  font-size: 12px;
  min-width: 140px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .5);
}
.thumbs-popup button {
  background: none; border: 0; color: var(--ink-2);
  padding: 5px 8px; text-align: left;
  border-radius: 3px; cursor: pointer;
  font-family: var(--font-sans); font-size: 12px;
}
.thumbs-popup button:hover { background: rgba(216, 178, 92, .08); color: var(--gold); }

/* ============================================================
   Product cards / resources / prospects (preserved)
   ============================================================ */
.msg-product-card {
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 12px; margin-top: 8px;
  display: flex; gap: 12px; align-items: center;
  transition: border-color var(--t), transform var(--t);
  cursor: pointer; text-decoration: none; color: var(--ink);
}
.msg-product-card:hover { border-color: var(--gold); transform: translateY(-1px); }
.msg-product-card .img {
  width: 48px; height: 48px; border-radius: 6px;
  background: var(--bg-3); display: grid; place-items: center; padding: 4px;
  flex-shrink: 0;
}
.msg-product-card .img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.msg-product-card .info .name { font-weight: 600; font-size: 13px; }
.msg-product-card .info .meta { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.msg-product-card .arrow { margin-left: auto; color: var(--gold); }

/* ============================================================
   r2_07: typing indicator (also r2_08 welcome typing)
   ============================================================ */
.typing {
  display: flex; gap: 4px; padding: 12px 14px;
  background: #131418; border-radius: 16px 16px 16px 4px;
  border: 1px solid rgba(216, 178, 92, .08);
  width: fit-content; align-self: flex-start;
  margin: 4px 0;
}
.typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ink-3);
  animation: typing 1.2s infinite;
}
.typing span:nth-child(2) { animation-delay: .15s; }
.typing span:nth-child(3) { animation-delay: .3s; }
@keyframes typing {
  0%, 60%, 100% { opacity: .3; transform: translateY(0); }
  30%           { opacity: 1; transform: translateY(-3px); }
}
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ============================================================
   r2_03: Quick reply chips
   ============================================================ */
.chat-quick {
  padding: 0 16px 12px 24px; /* 8px indent past bubble edge */
  display: flex; gap: 8px; flex-wrap: wrap;
  transition: opacity 160ms ease-out, max-height 160ms ease-out;
  max-height: 200px;
  overflow: hidden;
}
.chat-quick.is-input-active { opacity: .4; pointer-events: none; }
.chat-quick.is-collapsing { max-height: 0; opacity: 0; padding-top: 0; padding-bottom: 0; }
.chat-quick button {
  border: 1px solid rgba(216, 178, 92, .5);
  background: rgba(216, 178, 92, .06);
  color: var(--gold);
  font: 500 13px/1.4 var(--font-sans);
  padding: 6px 12px;
  border-radius: 16px;
  max-width: 240px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease,
              transform 150ms ease, color 150ms ease;
  animation: esttech-chip-in 240ms ease-out backwards;
}
.chat-quick button:hover {
  background: rgba(216, 178, 92, .14);
  border-color: var(--gold);
  transform: translateY(-1px);
}
.chat-quick button:focus-visible {
  outline: 2px solid var(--gold); outline-offset: 2px;
}
.chat-quick button.is-selected {
  background: var(--gold); color: #07080a;
  border-color: var(--gold);
}
.chat-quick button:nth-child(1) { animation-delay: 60ms; }
.chat-quick button:nth-child(2) { animation-delay: 120ms; }
.chat-quick button:nth-child(3) { animation-delay: 180ms; }
.chat-quick button:nth-child(4) { animation-delay: 240ms; }
.chat-quick button:nth-child(5) { animation-delay: 300ms; }
.chat-quick button:nth-child(6) { animation-delay: 360ms; }
@keyframes esttech-chip-in {
  from { opacity: 0; transform: translateY(6px) scale(.96); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}

/* ============================================================
   Input row
   ============================================================ */
.chat-input-row {
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  background: var(--bg-2);
  display: flex; gap: 10px; align-items: flex-end;
}
.chat-input-row textarea {
  flex: 1; resize: none;
  background: var(--bg-3);
  border: 1px solid var(--line-2);
  color: var(--ink);
  padding: 10px 14px; border-radius: 12px;
  font: 14px/1.45 var(--font-sans);
  max-height: 120px; min-height: 42px;
  transition: border-color var(--t), box-shadow var(--t);
}
.chat-input-row textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(216, 178, 92, .15);
}
.chat-input-row .send {
  width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  border: none; color: #1a1408;
  display: grid; place-items: center; cursor: pointer;
  transition: transform var(--t), background var(--t);
  flex-shrink: 0;
}
.chat-input-row .send:hover { transform: translateY(-1px); }
.chat-input-row .send:disabled { opacity: .4; cursor: not-allowed; }
/* r2_07: send btn three states (idle/streaming/disabled) */
.chat-input-row .send[data-state="streaming"] {
  background: var(--bg-3); color: var(--gold);
  border: 1px solid var(--gold);
}
.chat-input-row .send[data-state="streaming"]:hover {
  background: rgba(216, 178, 92, .08);
}
.chat-input-row .send:focus-visible {
  outline: 2px solid var(--gold); outline-offset: 2px;
}

.chat-footer-note {
  padding: 6px 16px 8px;
  font-size: 10.5px; color: var(--ink-3);
  text-align: center;
  background: var(--bg);
  border-top: 1px solid var(--line);
}
.chat-footer-note a { color: var(--gold); text-decoration: none; }
.chat-footer-note a:hover { text-decoration: underline; }
.chat-trust {
  font-size: 10.5px; color: var(--ink-3);
  text-align: center; padding: 6px 16px 0;
  letter-spacing: .02em;
}

/* ============================================================
   r2_04: Lead form (inline, progressive disclosure)
   ============================================================ */
.chat-leadform {
  background: var(--bg-2);
  border: 1px solid rgba(216, 178, 92, .25);
  border-radius: 12px; padding: 14px;
  margin: 6px 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.chat-leadform .lf-step {
  font-size: 10.5px; color: var(--ink-3);
  letter-spacing: .04em; text-transform: uppercase;
}
.chat-leadform .lf-prompt {
  font-size: 13px; color: var(--ink);
  line-height: 1.45;
}
.chat-leadform .row { display: flex; flex-direction: column; gap: 4px; }
.chat-leadform label { font-size: 11.5px; color: var(--ink-3); }
.chat-leadform input,
.chat-leadform select {
  background: var(--bg-3);
  border: 1px solid var(--line-2);
  color: var(--ink);
  padding: 9px 11px;
  border-radius: 6px;
  font: 13px/1.4 var(--font-sans);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.chat-leadform input:focus,
.chat-leadform select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(216, 178, 92, .2);
}
.chat-leadform input.invalid,
.chat-leadform select.invalid {
  border-color: var(--red);
}
.chat-leadform .field-error {
  color: var(--red); font-size: 11px;
  margin-top: 2px;
  display: flex; align-items: center; gap: 4px;
}
.chat-leadform .radio-row {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.chat-leadform .radio-row label {
  flex: 1; min-width: 80px;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 12px; color: var(--ink);
  cursor: pointer; text-align: center;
  transition: all 120ms;
}
.chat-leadform .radio-row label.checked {
  background: var(--gold-soft);
  border-color: var(--gold); color: var(--gold);
}
.chat-leadform .radio-row input { display: none; }
.chat-leadform .submit {
  padding: 10px;
  border-radius: 8px; border: none;
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  color: #1a1408; font-weight: 600; cursor: pointer;
  font-family: var(--font-sans); font-size: 13.5px;
  transition: opacity 150ms;
}
.chat-leadform .submit.submitting {
  opacity: .7; cursor: wait; pointer-events: none;
}
.chat-leadform .lf-banner {
  font-size: 11.5px; color: var(--red);
  background: rgba(239, 68, 68, .08);
  border: 1px solid rgba(239, 68, 68, .3);
  border-radius: 6px; padding: 6px 10px;
}
.lf-success {
  background: var(--bg-2);
  border: 1px solid rgba(34, 197, 94, .35);
  border-radius: 10px; padding: 12px 14px;
  margin: 6px 16px;
  font-size: 12.5px; color: var(--ink);
  line-height: 1.5;
}
.lf-success .lf-score {
  color: var(--green); font-weight: 600;
}
.lf-success .lf-ref {
  font-size: 10.5px; color: var(--ink-3);
  font-family: var(--font-mono);
  margin-top: 4px;
}

/* ============================================================
   Toasts (preserved + accent for chat)
   ============================================================ */
.chat-toast {
  position: fixed; bottom: 100px; left: 50%;
  transform: translateX(-50%);
  background: var(--bg-3);
  border: 1px solid var(--gold);
  color: var(--ink); font-size: 12.5px;
  padding: 8px 14px; border-radius: 6px;
  z-index: 300; pointer-events: none;
  opacity: 0; transition: opacity 180ms;
  font-family: var(--font-sans);
}
.chat-toast.show { opacity: 1; }

/* All mobile-fullscreen / data-mode / mode-toggle / grab-handle rules removed
   per request. Chatbox uses the same right-corner floating panel at every
   viewport width — `.chat-panel` base rule's `max-width: calc(100vw - 32px)`
   already handles narrow screens by shrinking. */

/* ============================================================
   r2_10 / r2_01: Reduced motion fallback
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .chat-fab .pulse,
  .typing span,
  .bubble.streaming::after {
    animation: none !important;
  }
  .chat-panel,
  .chat-fab,
  .msg,
  .bubble,
  .chat-quick button,
  .source-card {
    animation: none !important;
    transition: opacity 120ms ease !important;
    transform: none !important;
  }
  .chat-panel { transform: none; }
  .chat-panel.open { opacity: 1; transform: none; }
  .chat-fab:hover { transform: none; }
}

/* mobile-only header shrink rules removed per request — all viewports
   use the same header sizing. */
