:root {
  --primary: #0b4f6c;
  --primary-600: #0a4560;
  --primary-700: #08354a;
  --primary-50: #e6f1f6;
  --primary-100: #cfe4ee;
  --accent: #ff6b5b;
  --accent-50: #fff0ee;
  --success: #1f9d6b;
  --success-50: #e7f6ef;
  --warning: #b7791f;
  --warning-50: #fdf5e6;
  --danger: #c2413a;
  --danger-50: #fdecea;
  --bg: #f3f6f9;
  --surface: #ffffff;
  --text: #142433;
  --muted: #5b6b7a;
  --border: #e1e7ed;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(16, 38, 56, 0.06), 0 1px 3px rgba(16, 38, 56, 0.08);
  --shadow: 0 10px 30px -12px rgba(16, 38, 56, 0.25);
  --shadow-lg: 0 24px 60px -20px rgba(8, 53, 74, 0.45);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

body { font-size: 15px; line-height: 1.5; }

svg { width: 20px; height: 20px; flex-shrink: 0; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85em; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }

/* Botões */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 10px 18px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.05s, box-shadow 0.15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; }
.btn--primary { background: var(--primary); color: #fff; box-shadow: 0 6px 16px -8px rgba(11, 79, 108, 0.7); }
.btn--primary:hover:not(:disabled) { background: var(--primary-600); }
.btn--accent { background: var(--accent); color: #fff; }
.btn--accent:hover:not(:disabled) { background: #f05a4a; }
.btn--outline { background: #fff; color: var(--primary); border-color: var(--primary-100); }
.btn--outline:hover:not(:disabled) { border-color: var(--primary); background: var(--primary-50); }
.btn--ghost { background: var(--primary-50); color: var(--primary); }
.btn--ghost:hover:not(:disabled) { background: var(--primary-100); }
.btn--block { width: 100%; }
.btn--lg { padding: 14px 22px; font-size: 16px; }
.btn--sm { padding: 8px 14px; font-size: 14px; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.12); }

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.badge--discount { background: var(--accent); color: #fff; }

/* Telas */
.screen { display: none; min-height: 100vh; }
.screen.is-active { display: flex; flex-direction: column; }

/* Entrada */
.entry-screen {
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(255, 107, 91, 0.12), transparent 60%),
    radial-gradient(900px 600px at -10% 110%, rgba(11, 79, 108, 0.16), transparent 60%),
    var(--bg);
}
.entry-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px clamp(20px, 5vw, 64px);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 34px; height: 34px; }
.brand-name { font-weight: 800; font-size: 18px; color: var(--primary-700); letter-spacing: -0.01em; }
.entry-secure {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--success);
  font-weight: 600;
  background: var(--success-50);
  padding: 6px 12px;
  border-radius: 999px;
}
.entry-secure svg { width: 16px; height: 16px; }

.entry-body {
  flex: 1;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(24px, 5vw, 72px);
  align-items: center;
  padding: 12px clamp(20px, 5vw, 64px) 48px;
  max-width: 1240px;
  width: 100%;
  margin: 0 auto;
}
.eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}
.entry-hero h1 {
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 0 0 16px;
  color: var(--primary-700);
}
.entry-hero > p { font-size: 17px; color: var(--muted); max-width: 540px; margin: 0 0 22px; }
.entry-perks { list-style: none; padding: 0; margin: 0 0 32px; display: grid; gap: 10px; }
.entry-perks li { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.entry-perks svg {
  width: 22px;
  height: 22px;
  padding: 3px;
  border-radius: 50%;
  color: #fff;
  background: var(--success);
}

.entry-illustration { position: relative; height: 170px; max-width: 520px; }
.ill-card {
  position: absolute;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
}
.ill-card--chat { left: 0; top: 10px; display: flex; gap: 12px; align-items: center; max-width: 330px; animation: float 6s ease-in-out infinite; }
.ill-card--chat strong { display: block; font-size: 14px; }
.ill-card--chat span { font-size: 14px; color: var(--muted); }
.ill-avatar { width: 44px; height: 44px; }
.ill-card--price {
  right: 10px;
  top: 80px;
  display: grid;
  grid-template-columns: auto auto;
  gap: 2px 10px;
  align-items: center;
  animation: float 6s ease-in-out infinite 1.5s;
}
.ill-label { grid-column: 1 / -1; font-size: 12px; font-weight: 600; color: var(--muted); }
.ill-old { font-size: 13px; color: var(--muted); text-decoration: line-through; }
.ill-new { font-size: 22px; font-weight: 800; color: var(--primary-700); grid-column: 1; }
.ill-card--price .badge { grid-column: 2; grid-row: 2 / 4; }
.ill-plane { position: absolute; left: 52%; top: 0; width: 34px; height: 34px; color: var(--accent); transform: rotate(45deg); opacity: 0.9; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

.entry-card {
  background: var(--surface);
  border-radius: 22px;
  box-shadow: var(--shadow-lg);
  padding: 28px;
  border: 1px solid rgba(225, 231, 237, 0.7);
}
.entry-card h2 { font-size: 18px; margin: 0 0 4px; letter-spacing: -0.01em; }
.entry-card-section { display: grid; gap: 12px; }
.entry-card-section .muted { margin: -4px 0 0; font-size: 14px; }
.link-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--muted);
  overflow: hidden;
}
.link-preview code { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-preview svg { width: 18px; height: 18px; color: var(--primary); }

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0;
  color: var(--muted);
  font-size: 13px;
}
.divider::before, .divider::after { content: ""; height: 1px; flex: 1; background: var(--border); }

.field { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.field input {
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #fff;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-50); }
.hint { margin: 0; font-size: 12px; color: var(--muted); text-align: center; }

.alert {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: var(--warning-50);
  color: #7a4e0e;
}
.alert svg { width: 18px; height: 18px; margin-top: 1px; }
.alert--danger { background: var(--danger-50); color: #8f2a24; }

/* Chat */
.chat-screen { height: 100vh; min-height: 0; background: var(--bg); }
.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 5;
}
.topbar #btnHeaderAnalyst { justify-self: end; }
.brand--compact .brand-mark { width: 28px; height: 28px; }
.brand--compact .brand-name { font-size: 16px; }
.agent-id { display: flex; align-items: center; gap: 10px; }
.agent-id strong { display: block; font-size: 15px; line-height: 1.2; }
.agent-status { font-size: 12.5px; color: var(--muted); }
.avatar-wrap { position: relative; }
.avatar { width: 40px; height: 40px; display: block; }
.status-dot {
  position: absolute;
  right: 0;
  bottom: 1px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--success);
  border: 2px solid #fff;
}
.status-dot.is-degraded { background: var(--warning); }

.chat-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  max-width: 1240px;
  width: 100%;
  margin: 0 auto;
}
.chat-main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0 clamp(12px, 3vw, 32px);
}
.messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px 4px 12px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  scroll-behavior: smooth;
}
.day-sep {
  align-self: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: #e8eef3;
  padding: 4px 12px;
  border-radius: 999px;
}

.msg { display: flex; gap: 10px; max-width: 88%; animation: msgIn 0.25s ease-out; }
.msg--user { align-self: flex-end; flex-direction: row-reverse; }
.msg-avatar { width: 34px; height: 34px; margin-top: 2px; }
.msg-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.msg--user .msg-body { align-items: flex-end; }
.bubble {
  padding: 12px 16px;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  word-wrap: break-word;
  white-space: pre-wrap;
}
.msg--agent .bubble { border-top-left-radius: 6px; }
.msg--user .bubble { background: var(--primary); color: #fff; border-top-right-radius: 6px; box-shadow: none; }
.bubble strong { font-weight: 700; }
.bubble.is-streaming::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 15px;
  margin-left: 2px;
  vertical-align: -2px;
  background: var(--primary);
  border-radius: 2px;
  animation: blink 0.9s steps(2) infinite;
}
.bubble--error { background: var(--danger-50); color: #8f2a24; box-shadow: none; }
.bubble--notice { background: var(--warning-50); color: #6d470c; box-shadow: none; }
.bubble .partial { color: var(--text); }
.msg-meta { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); padding: 0 4px; }
.msg-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
  background: #e8eef3;
  color: var(--muted);
}
.feedback { display: inline-flex; gap: 2px; opacity: 0; transition: opacity 0.15s; }
.msg:hover .feedback, .feedback.has-vote { opacity: 1; }
.feedback button {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 3px;
  border-radius: 6px;
  display: grid;
  place-items: center;
}
.feedback button svg { width: 14px; height: 14px; }
.feedback button:hover { background: #e8eef3; color: var(--primary); }
.feedback button.is-on { color: var(--primary); background: var(--primary-50); }
.feedback button.is-on.down { color: var(--danger); background: var(--danger-50); }

.typing { display: inline-flex; gap: 4px; padding: 4px 2px; }
.typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9fb1c0;
  animation: bounce 1.2s infinite ease-in-out;
}
.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }
.btn-retry {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
}
.btn-retry svg { width: 15px; height: 15px; }
.inline-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.inline-actions .btn { padding: 7px 14px; font-size: 13px; }

@keyframes blink { 50% { opacity: 0; } }
@keyframes bounce { 0%, 80%, 100% { transform: translateY(0); opacity: 0.5; } 40% { transform: translateY(-5px); opacity: 1; } }
@keyframes msgIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Chips */
.suggestions { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 4px 12px 48px; min-height: 8px; }
.chip {
  border: 1px solid var(--primary-100);
  background: #fff;
  color: var(--primary);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  max-width: 100%;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  animation: msgIn 0.3s ease-out both;
}
.chip:nth-child(2) { animation-delay: 0.06s; }
.chip:nth-child(3) { animation-delay: 0.12s; }
.chip:hover { background: var(--primary-50); border-color: var(--primary); }
.chip--next { background: var(--primary); color: #fff; border-color: var(--primary); }
.chip--next:hover { background: var(--primary-600); }

/* Composer */
.composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 6px 6px 6px 18px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.composer:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-50); }
.composer textarea {
  flex: 1;
  border: 0;
  outline: none;
  resize: none;
  font: inherit;
  font-size: 15px;
  padding: 9px 0;
  max-height: 140px;
  background: transparent;
  color: var(--text);
}
.composer.is-disabled { opacity: 0.6; }
.send-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 0;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.send-btn:hover:not(:disabled) { background: #f05a4a; }
.send-btn:disabled { background: #c4ced6; cursor: not-allowed; }
.composer-note { font-size: 12px; color: var(--muted); text-align: center; margin: 8px 0 14px; }
.handed-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--success-50);
  color: #136546;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 10px;
}

/* Bloco de fechamento */
.closing-card {
  align-self: stretch;
  margin-left: 44px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--primary-100);
  box-shadow: var(--shadow);
  padding: 20px;
  animation: msgIn 0.3s ease-out;
}
.closing-card h3 { margin: 0 0 4px; font-size: 17px; letter-spacing: -0.01em; }
.closing-card > p { margin: 0 0 16px; color: var(--muted); font-size: 14px; }
.closing-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.closing-option {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  text-align: left;
  font: inherit;
  color: inherit;
  background: var(--bg);
  border: 1.5px solid transparent;
  border-radius: 14px;
  padding: 14px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.closing-option:hover:not(:disabled) { border-color: var(--primary); background: #fff; }
.closing-option:disabled { opacity: 0.55; cursor: default; }
.closing-option .co-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--primary);
  color: #fff;
  flex-shrink: 0;
}
.closing-option .co-icon--alt { background: var(--accent); }
.closing-option strong { display: block; font-size: 15px; margin-bottom: 2px; }
.closing-option span { display: block; font-size: 13px; color: var(--muted); }
.closing-option .co-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
}
.co-status svg { width: 13px; height: 13px; }
.closing-option .co-status--ok { color: var(--success); }
.closing-option .co-status--warn { color: var(--warning); }
.closing-option .co-status--off { color: var(--danger); }
.closing-foot { margin: 14px 0 0; font-size: 12.5px; color: var(--muted); }
.closing-loading { color: var(--muted); font-size: 14px; display: flex; gap: 8px; align-items: center; }

/* Cotação */
.quote-aside {
  border-left: 1px solid var(--border);
  padding: 24px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: linear-gradient(180deg, #fff 0, var(--bg) 280px);
}
.quote-aside > * { flex-shrink: 0; }
.quote-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.quote-top {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-700) 100%);
  color: #fff;
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
}
.quote-top::after {
  content: "";
  position: absolute;
  right: -30px;
  top: -40px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
}
.quote-head { display: flex; justify-content: space-between; align-items: center; font-size: 12px; opacity: 0.85; margin-bottom: 10px; }
.quote-label { font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.quote-dest { display: flex; gap: 12px; align-items: center; }
.quote-dest .dest-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.15);
  display: grid;
  place-items: center;
}
.quote-dest strong { display: block; font-size: 20px; letter-spacing: -0.01em; line-height: 1.2; }
.quote-dest span { font-size: 13px; opacity: 0.85; }
.quote-facts { list-style: none; margin: 0; padding: 14px 18px 4px; display: grid; gap: 9px; font-size: 14px; }
.quote-facts li { display: flex; gap: 10px; align-items: center; }
.quote-facts svg { width: 17px; height: 17px; color: var(--primary); }
.quote-price { padding: 12px 18px 18px; border-top: 1px dashed var(--border); margin-top: 10px; }
.price-row { display: flex; align-items: center; gap: 8px; }
.price-old { color: var(--muted); text-decoration: line-through; font-size: 14px; }
.price-final { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; color: var(--primary-700); line-height: 1.15; margin-top: 2px; }
.price-sub { font-size: 13px; color: var(--muted); }
.coupon {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-50);
  color: #b8372a;
  font-size: 13px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px dashed rgba(255, 107, 91, 0.5);
}
.coupon svg { width: 16px; height: 16px; }
.quote-card--degraded { padding: 18px; }
.quote-card--degraded h4 { margin: 0 0 6px; display: flex; align-items: center; gap: 8px; color: var(--warning); }
.quote-card--degraded p { margin: 0; font-size: 14px; color: var(--muted); }

.side-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 16px 18px;
}
.side-card h4 { margin: 0 0 4px; font-size: 15px; }
.side-card p { margin: 0 0 12px; font-size: 13.5px; color: var(--muted); }
.side-card .btn + .btn { margin-top: 8px; }
.good-to-know { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: 13.5px; }
.good-to-know li { display: flex; gap: 8px; align-items: flex-start; }
.good-to-know svg { width: 16px; height: 16px; margin-top: 2px; color: var(--success); }
.good-to-know li.no svg { color: var(--danger); }

.quote-mini { display: none; }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(8, 30, 44, 0.5); backdrop-filter: blur(3px); animation: fadeIn 0.2s; }
.modal-dialog {
  position: relative;
  width: min(520px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: #fff;
  border-radius: 22px;
  box-shadow: var(--shadow-lg);
  padding: 28px;
  animation: pop 0.22s ease-out;
}
.modal-x { position: absolute; top: 14px; right: 14px; border: 0; background: var(--bg); width: 34px; height: 34px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; color: var(--muted); }
.modal-icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; margin-bottom: 14px; color: #fff; background: var(--primary); }
.modal-icon svg { width: 28px; height: 28px; }
.modal-icon--success { background: var(--success); }
.modal-icon--warn { background: var(--warning); }
.modal-icon--danger { background: var(--danger); }
.modal-dialog h3 { margin: 0 0 6px; font-size: 21px; letter-spacing: -0.02em; }
.modal-dialog > div > p { margin: 0 0 16px; color: var(--muted); }
.summary-box { background: var(--bg); border-radius: 14px; padding: 14px 16px; display: grid; gap: 10px; font-size: 14px; margin-bottom: 18px; }
.summary-box dt { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.summary-box dd { margin: 2px 0 0; }
.modal-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.modal-actions .btn { flex: 1; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(0.98); } }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: var(--primary-700);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow);
  z-index: 60;
  animation: msgIn 0.2s;
}

/* Painel dev */
.dev-toggle {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  background: #142433;
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow);
  opacity: 0.88;
}
.dev-toggle:hover { opacity: 1; }
.dev-toggle svg { width: 16px; height: 16px; }
.dev-panel {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(380px, 92vw);
  background: #0f1d29;
  color: #d6e1ea;
  z-index: 45;
  transform: translateX(-102%);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  font-size: 13px;
}
.dev-panel.is-open { transform: none; }
.dev-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 18px 18px 14px; border-bottom: 1px solid #1f3242; }
.dev-head strong { display: block; color: #fff; font-size: 15px; }
.dev-head span { font-size: 12px; color: #8ea3b5; }
.dev-head code { color: #ffb4aa; }
.dev-body { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }
.dev-group { padding: 14px 18px; border-bottom: 1px solid #1f3242; display: grid; gap: 10px; }
.dev-group--grow { flex: 1; border-bottom: 0; align-content: start; }
.dev-group label { display: grid; gap: 5px; font-weight: 600; color: #a9bccb; font-size: 12px; }
.dev-group select {
  font: inherit;
  font-size: 13px;
  color: #fff;
  background: #182a39;
  border: 1px solid #284052;
  border-radius: 8px;
  padding: 8px 10px;
}
.dev-note { margin: 0; font-size: 12px; color: #7f95a8; }
.dev-subhead { display: flex; justify-content: space-between; align-items: center; }
.dev-subhead strong { color: #fff; }
.dev-subhead span { color: #7f95a8; }
.dev-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.dev-kpis div { background: #182a39; border-radius: 10px; padding: 8px 10px; }
.dev-kpis span { display: block; font-size: 11px; color: #7f95a8; }
.dev-kpis strong { color: #fff; font-size: 14px; }
.telemetry { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.telemetry li { background: #182a39; border-radius: 10px; padding: 10px 12px; border-left: 3px solid #3a87ad; }
.telemetry li.src-guardrail { border-left-color: #f0a35e; }
.telemetry li.src-cache { border-left-color: #6fcf97; }
.telemetry li.src-fallback, .telemetry li.has-flag { border-left-color: #ff6b5b; }
.telemetry .t-head { display: flex; justify-content: space-between; color: #fff; font-weight: 600; margin-bottom: 4px; }
.telemetry .t-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; color: #a9bccb; font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; }
.telemetry .t-flags { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px; }
.telemetry .t-flags span { background: rgba(255, 107, 91, 0.18); color: #ffb4aa; border-radius: 6px; padding: 1px 6px; font-size: 11px; }
.telemetry-empty { color: #7f95a8; font-size: 12px; }

/* Nova cotação: entrada */
.entry-new h2::before {
  content: "Novo";
  display: inline-block;
  vertical-align: middle;
  margin-right: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-50);
  color: #b8372a;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.btn--accent { box-shadow: 0 6px 16px -8px rgba(255, 107, 91, 0.8); }

/* Nova cotação: cards no chat */
.nq-card {
  align-self: stretch;
  margin-left: 44px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--primary-100);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  animation: msgIn 0.3s ease-out;
}
.nq-card.is-stale { opacity: 0.6; box-shadow: none; }
.nq-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.nq-card-head > svg { width: 20px; height: 20px; color: var(--primary); flex-shrink: 0; }
.nq-card-head h3 { margin: 0; font-size: 16px; letter-spacing: -0.01em; }
.nq-rows { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px 18px; margin: 0 0 16px; background: var(--bg); border-radius: 12px; padding: 14px 16px; }
.nq-rows dt { font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.nq-rows dd { margin: 2px 0 0; font-size: 14px; }
.nq-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.nq-note { display: flex; gap: 6px; align-items: flex-start; margin: 12px 0 0; font-size: 12.5px; color: var(--muted); }
.nq-note svg { width: 14px; height: 14px; color: var(--success); margin-top: 2px; flex-shrink: 0; }

.nq-plan-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.nq-plan {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 16px 14px 14px;
  background: #fff;
}
.nq-plan.is-recommended { border-color: var(--primary); box-shadow: 0 10px 24px -16px rgba(11, 79, 108, 0.7); }
.nq-plan-badge {
  position: absolute;
  top: -10px;
  left: 14px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.nq-plan h4 { margin: 0; font-size: 15px; }
.nq-plan-price { font-size: 24px; font-weight: 800; color: var(--primary-700); letter-spacing: -0.02em; margin-top: 6px; }
.nq-plan-sub { font-size: 12.5px; color: var(--muted); }
.nq-plan-medical { margin: 10px 0 8px; font-size: 13px; background: var(--primary-50); color: var(--primary-700); border-radius: 8px; padding: 6px 8px; }
.nq-plan ul { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 6px; font-size: 12.5px; flex: 1; }
.nq-plan li { display: flex; gap: 6px; align-items: flex-start; }
.nq-plan li svg { width: 14px; height: 14px; color: var(--success); flex-shrink: 0; margin-top: 2px; }
.nq-plan li.no { color: var(--muted); }
.nq-plan li.no svg { color: var(--danger); }

.nq-payment { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.nq-payment .nq-card-head, .nq-payment .nq-test-hint, .nq-payment .nq-form-alert, .nq-payment > .btn, .nq-payment .nq-secure { grid-column: 1 / -1; }
.nq-payment .nq-card-head { margin-bottom: 0; }
.nq-pay-total { margin-left: auto; font-size: 18px; font-weight: 800; color: var(--primary-700); }
.nq-test-hint { display: flex; gap: 8px; align-items: flex-start; background: var(--warning-50); color: #7a5214; font-size: 12.5px; padding: 8px 10px; border-radius: var(--radius-sm); }
.nq-test-hint svg { width: 15px; height: 15px; flex-shrink: 0; margin-top: 1px; }
.nq-field { display: grid; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.nq-field--full { grid-column: 1 / -1; }
.nq-field > span { display: flex; justify-content: space-between; }
.nq-brand { font-style: normal; color: var(--primary); font-weight: 700; }
.nq-field input, .nq-field select {
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: #fff;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.nq-field input:focus, .nq-field select:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-50); }
.nq-field small { font-weight: 500; color: var(--danger); min-height: 0; }
.nq-field small:empty { display: none; }
.nq-field.has-error input { border-color: var(--danger); }
.nq-form-alert { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--danger-50); color: #8f2a24; }
.nq-form-alert svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; }
.nq-form-alert--warn { background: var(--warning-50); color: #7a5214; }
.nq-form-alert[hidden] { display: none; }
.nq-secure { display: flex; gap: 6px; align-items: center; justify-content: center; margin: 0; font-size: 12px; color: var(--muted); }
.nq-secure svg { width: 14px; height: 14px; color: var(--success); }

.nq-policy { border-color: rgba(31, 157, 107, 0.4); }
.nq-policy-head { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.nq-policy-icon { width: 42px; height: 42px; border-radius: 12px; background: var(--success); color: #fff; display: grid; place-items: center; flex-shrink: 0; }
.nq-policy-icon svg { width: 22px; height: 22px; }
.nq-policy-head .quote-label { display: block; font-size: 11.5px; color: var(--success); }
.nq-policy-head strong { font-size: 18px; }
.nq-policy .nq-note { margin: 0 0 14px; }

/* Nova cotação: card lateral */
.nq-stage { background: rgba(255, 255, 255, 0.16); padding: 2px 8px; border-radius: 999px; font-weight: 600; }
.nq-progress { position: relative; z-index: 1; height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.18); overflow: hidden; }
.nq-progress span { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width 0.4s ease; }
.nq-facts { list-style: none; margin: 0; padding: 14px 18px 6px; display: grid; gap: 9px; font-size: 13.5px; }
.nq-facts li { display: grid; grid-template-columns: 17px 82px 1fr; gap: 8px; align-items: center; }
.nq-facts svg { width: 16px; height: 16px; color: var(--muted); }
.nq-facts .is-done svg { color: var(--success); }
.nq-k { color: var(--muted); }
.nq-v { font-weight: 600; }
.nq-facts .is-pending .nq-v { color: #9aa8b5; font-weight: 500; font-style: italic; }

.telemetry li.src-nlu { border-left-color: #b39ddb; }
.telemetry li.src-gateway { border-left-color: #6fcf97; }

@media print {
  body * { visibility: hidden; }
  .nq-policy.is-printing, .nq-policy.is-printing * { visibility: visible; }
  .nq-policy.is-printing { position: fixed; inset: 0 auto auto 0; width: 100%; margin: 0; box-shadow: none; border: 0; }
  .nq-policy.is-printing .nq-actions { display: none; }
}

/* Responsivo */
@media (max-width: 980px) {
  .quote-mini .nq-facts { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 10px 14px 0; font-size: 12.5px; }
  .quote-mini .nq-facts li { display: flex; gap: 5px; }
  .quote-mini .nq-facts .is-pending { display: none; }
  .quote-mini .nq-facts svg { width: 14px; height: 14px; }
  .quote-mini .nq-aside-card .quote-price .price-sub:first-child { order: 0; flex-basis: auto; }
  .nq-plan-grid { grid-template-columns: 1fr; }
}

@media (max-width: 980px) {
  .chat-layout { grid-template-columns: 1fr; }
  .quote-aside { display: none; }
  .quote-mini { display: block; padding-top: 12px; }
  .quote-mini details {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
  }
  .quote-mini summary {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    font-size: 14px;
  }
  .quote-mini summary::-webkit-details-marker { display: none; }
  .quote-mini summary .qm-dest { font-weight: 700; }
  .quote-mini summary .qm-price { margin-left: auto; font-weight: 800; color: var(--primary-700); }
  .quote-mini summary svg { width: 18px; height: 18px; color: var(--primary); }
  .quote-mini .quote-card { border: 0; border-top: 1px solid var(--border); border-radius: 0 0 14px 14px; box-shadow: none; }
  .quote-mini .quote-top { display: none; }
  .quote-mini .quote-facts { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 10px 14px 0; font-size: 13px; color: var(--muted); }
  .quote-mini .quote-facts svg { width: 15px; height: 15px; }
  .quote-mini .quote-price {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 12px;
    padding: 10px 14px 12px;
    margin-top: 10px;
  }
  .quote-mini .price-row { order: 2; }
  .quote-mini .price-row .badge { display: none; }
  .quote-mini .price-final { order: 1; font-size: 20px; margin: 0; }
  .quote-mini .price-sub { order: 3; flex-basis: 100%; font-size: 12px; }
  .quote-mini .coupon { order: 4; flex-basis: 100%; margin-top: 4px; padding: 6px 10px; font-size: 12px; }
  .quote-mini .quote-card--degraded { padding: 12px 14px; }
}

@media (max-width: 820px) {
  .entry-body { grid-template-columns: 1fr; }
  .entry-illustration { display: none; }
}

@media (max-width: 640px) {
  .topbar { grid-template-columns: auto 1fr auto; padding: 10px 12px; }
  .topbar .brand { display: none; }
  .topbar #btnHeaderAnalyst span { display: none; }
  .topbar #btnHeaderAnalyst { padding: 9px; }
  .msg { max-width: 96%; }
  .suggestions { padding-left: 4px; }
  .closing-card, .nq-card { margin-left: 0; }
  .nq-card { padding: 16px; }
  .entry-card { padding: 20px; }
}

@media (max-width: 980px) {
  .dev-toggle { bottom: auto; top: 50%; left: 0; border-radius: 0 12px 12px 0; padding: 10px 8px; }
  .dev-toggle span { display: none; }
}
