/* ──────────────────────────────────────────────────────────────────────────
   License Inquiry chat widget
   A private one-to-one inquiry channel between a visitor and Rob.

   Colours, fonts and shapes are taken straight from the site's existing
   palette (navy / gold / warm white, Georgia headings, Arial body, pill
   buttons, 1px gold borders, soft navy shadows). Nothing new is introduced.
   ────────────────────────────────────────────────────────────────────────── */

.sav-inq {
  --inq-navy: #0d1b2a;
  --inq-navy-deep: #0a1420;
  --inq-navy-panel: #12263b;
  --inq-gold: #d4af37;
  --inq-gold-soft: #e8cf83;
  --inq-warm-white: #f5f2ea;
  --inq-muted: #b9c4d0;
  --inq-shadow: 0 20px 50px rgba(5, 12, 20, 0.45);

  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 14px;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--inq-warm-white);
}

.sav-inq *,
.sav-inq *::before,
.sav-inq *::after { box-sizing: border-box; }

/* ── Floating toggle ── */
.sav-inq-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 0 24px 0 20px;
  border: 1px solid var(--inq-gold);
  border-radius: 999px;
  background: var(--inq-gold);
  color: var(--inq-navy-deep);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.6px;
  cursor: pointer;
  box-shadow: var(--inq-shadow);
  transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
}
.sav-inq-toggle:hover {
  transform: translateY(-2px);
  background: var(--inq-gold-soft);
  box-shadow: 0 10px 24px rgba(5, 12, 20, 0.4);
}
.sav-inq-toggle:focus-visible { outline: 2px solid var(--inq-warm-white); outline-offset: 3px; }
.sav-inq-toggle svg { width: 22px; height: 22px; flex-shrink: 0; fill: currentColor; }

/* Unread badge on the closed button. */
.sav-inq-badge {
  display: none;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--inq-navy-deep);
  color: var(--inq-gold);
  font-size: 11px;
  font-weight: 800;
  line-height: 20px;
  text-align: center;
}
.sav-inq[data-unread="true"] .sav-inq-badge { display: inline-block; }

/* ── Panel ── */
.sav-inq-panel {
  display: none;
  width: 348px;
  max-width: calc(100vw - 32px);
  max-height: min(560px, calc(100vh - 130px));
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--inq-gold);
  border-radius: 22px;
  background: var(--inq-navy-panel);
  box-shadow: var(--inq-shadow);
}
.sav-inq[data-open="true"] .sav-inq-panel { display: flex; }

.sav-inq-head {
  padding: 18px 20px 16px;
  background: var(--inq-navy-deep);
  border-bottom: 1px solid var(--inq-gold);
}
.sav-inq-head-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.sav-inq-head h2 {
  margin: 0;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 20px;
  font-weight: normal;
  letter-spacing: 0.3px;
  color: var(--inq-warm-white);
}
.sav-inq-head p {
  margin: 8px 0 0;
  color: var(--inq-muted);
  font-size: 12.5px;
  line-height: 1.5;
}
.sav-inq-close {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid rgba(212, 175, 55, 0.5);
  border-radius: 999px;
  background: transparent;
  color: var(--inq-gold);
  font: inherit;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.sav-inq-close:hover { background: var(--inq-gold); color: var(--inq-navy-deep); }
.sav-inq-close:focus-visible { outline: 2px solid var(--inq-gold); outline-offset: 2px; }

/* ── Thread ── */
.sav-inq-thread {
  flex: 1;
  min-height: 190px;
  padding: 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--inq-navy);
}
.sav-inq-empty {
  margin: auto 0;
  padding: 6px 4px;
  color: var(--inq-muted);
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
}

.sav-inq-msg { display: flex; flex-direction: column; max-width: 84%; }
.sav-inq-msg[data-sender="visitor"] { align-self: flex-end; align-items: flex-end; }
.sav-inq-msg[data-sender="rob"] { align-self: flex-start; align-items: flex-start; }

.sav-inq-who {
  margin-bottom: 5px;
  color: var(--inq-gold);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 1.4px;
  text-transform: uppercase;
}
.sav-inq-bubble {
  padding: 10px 14px;
  border: 1px solid rgba(212, 175, 55, 0.45);
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.sav-inq-msg[data-sender="visitor"] .sav-inq-bubble {
  background: var(--inq-gold);
  border-color: var(--inq-gold);
  color: var(--inq-navy-deep);
  border-bottom-right-radius: 5px;
}
.sav-inq-msg[data-sender="rob"] .sav-inq-bubble {
  background: var(--inq-navy-panel);
  color: var(--inq-warm-white);
  border-bottom-left-radius: 5px;
}
.sav-inq-time {
  margin-top: 5px;
  color: var(--inq-muted);
  font-size: 10.5px;
  letter-spacing: 0.4px;
}

/* ── Footer: intro form and composer ── */
.sav-inq-foot {
  padding: 14px 16px 16px;
  background: var(--inq-navy-deep);
  border-top: 1px solid rgba(212, 175, 55, 0.4);
}
.sav-inq-label {
  display: block;
  margin-bottom: 6px;
  color: var(--inq-gold);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 1.4px;
  text-transform: uppercase;
}
.sav-inq-field {
  width: 100%;
  padding: 10px 12px;
  color: var(--inq-warm-white);
  background: var(--inq-navy);
  border: 1px solid rgba(212, 175, 55, 0.5);
  border-radius: 10px;
  font: inherit;
  font-size: 13.5px;
}
.sav-inq-field::placeholder { color: rgba(185, 196, 208, 0.75); }
.sav-inq-field:focus { outline: 2px solid var(--inq-gold); outline-offset: 1px; }
.sav-inq-field + .sav-inq-label { margin-top: 12px; }

.sav-inq-intro-note {
  margin: 12px 0 0;
  color: var(--inq-muted);
  font-size: 11.5px;
  line-height: 1.55;
}

.sav-inq-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 22px;
  border: 1px solid var(--inq-gold);
  border-radius: 999px;
  background: var(--inq-gold);
  color: var(--inq-navy-deep);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.6px;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}
.sav-inq-btn:hover:not(:disabled) { background: var(--inq-gold-soft); transform: translateY(-1px); }
.sav-inq-btn:focus-visible { outline: 2px solid var(--inq-warm-white); outline-offset: 2px; }
.sav-inq-btn:disabled { opacity: 0.55; cursor: default; }

.sav-inq-intro-actions { margin-top: 14px; }
.sav-inq-intro-actions .sav-inq-btn { width: 100%; }

.sav-inq-composer { display: flex; align-items: flex-end; gap: 10px; }
.sav-inq-composer textarea {
  flex: 1;
  min-height: 44px;
  max-height: 120px;
  resize: none;
  line-height: 1.5;
}
.sav-inq-composer .sav-inq-btn { flex-shrink: 0; }

.sav-inq-meta {
  margin: 10px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--inq-muted);
  font-size: 11px;
}
.sav-inq-count { letter-spacing: 0.4px; white-space: nowrap; }

/* Status line — reused for validation errors and confirmations. */
.sav-inq-status {
  margin: 10px 0 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--inq-muted);
}
.sav-inq-status[data-tone="error"] { color: var(--inq-gold-soft); }
.sav-inq-status[data-tone="ok"] { color: var(--inq-gold); }
.sav-inq-status:empty { display: none; }

/* ── Small screens ── */
@media (max-width: 480px) {
  .sav-inq { right: 14px; bottom: 14px; gap: 12px; }
  .sav-inq-toggle {
    width: 56px;
    padding: 0;
    justify-content: center;
    border-radius: 999px;
  }
  .sav-inq-toggle .sav-inq-toggle-text { display: none; }
  .sav-inq-panel { max-height: calc(100vh - 110px); }
}
