/* ═══════════════════════════════════════════════════════
   /quote — project estimate. Single page, state machine.
   Motion rules: transform + opacity only, translate3d for
   Safari compositing, everything off under reduced motion.
   ═══════════════════════════════════════════════════════ */

:root {
  --q-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --q-dur: 420ms;
  --q-dur-fast: 220ms;
  --q-max: 520px;
  --q-radius: 14px;
  --q-surface: rgba(255, 255, 255, 0.03);
  --q-surface-hover: rgba(255, 255, 255, 0.07);
  --q-border: rgba(255, 255, 255, 0.08);
  --q-border-strong: rgba(255, 255, 255, 0.18);
  --q-composer-h: 0px;
}

/* App shell: the document never scrolls; .quote-app (a fixed box) scrolls inside. */
html, body { height: 100%; overflow: hidden; overscroll-behavior-y: none; }
body { min-height: 0; }
/* Same as main.css: Android draws under the status bar without a safe-area inset. */
html.android { --safe-top: 16px; }
body { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

.quote-app {
  /* A fixed box that scrolls inside, like an app screen: when the keyboard
     opens, quote.js sizes it to the visible viewport, so the sticky composer
     sits right on the keyboard's top edge and nothing drifts while scrolling.
     Inner scrolling also keeps Safari's toolbar from collapsing and resizing
     the page mid-conversation. */
  position: fixed;
  inset: 0;
  overflow: hidden auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  overflow-anchor: none;
  scroll-behavior: auto;
}
.quote-page {
  /* One screen tall plus the site footer below the fold, so the composer sits
     at the bottom edge from the first step (--q-footer-h set by quote.js). */
  min-height: calc(100% + var(--q-footer-h, 0px));
  display: flex;
  flex-direction: column;
}

/* ── Header ──────────────────────────────────────────────
   Mirrors the home hero: logo 36px (40px on mobile) at the
   container padding; the language switch sits where the home
   nav sits (desktop) or where the mobile menu button sits. */
.quote-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: calc(var(--container-padding) + var(--safe-top)) var(--container-padding) 0;
}

.quote-logo { display: block; }
.quote-logo img { height: 36px; width: auto; display: block; transition: opacity 0.15s ease; }
.quote-logo:hover img { opacity: 0.7; }

.quote-header-right { display: flex; align-items: center; }

.availability {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.8125rem; color: var(--text-muted); white-space: nowrap;
}
.availability-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green); animation: q-pulse 2s ease-in-out infinite;
}
@keyframes q-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* Desktop: compact, minimal segmented control. The active language gets a
   soft filled chip so the state reads at a glance. */
.lang-switch {
  display: inline-flex; align-items: center; gap: 1px;
  padding: 2px; margin-top: 4px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
}
.lang-btn {
  font: inherit; font-size: 0.75rem; font-weight: 500; letter-spacing: 0.06em; line-height: 1;
  color: var(--text-muted); background: none; border: 0; border-radius: 7px;
  padding: 6px 9px; min-width: 32px; cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
}
.lang-btn:hover { color: var(--text-secondary); }
.lang-btn[aria-pressed="true"] { color: var(--text-primary); background: rgba(255, 255, 255, 0.12); cursor: default; }
.lang-btn:focus-visible { outline: 2px solid var(--text-primary); outline-offset: 2px; }

/* ── Main column ─────────────────────────────────────── */
.quote-main {
  flex: 1;
  width: 100%;
  max-width: calc(var(--q-max) + var(--container-padding) * 2);
  margin: 0 auto;
  padding: 16px var(--container-padding) 24px;
  display: flex;
  flex-direction: column;
}

.quote-progress {
  display: flex; flex-direction: column; gap: 10px; margin-bottom: 26px;
  transition: opacity var(--q-dur-fast) ease;
}
.quote-progress.is-hidden { opacity: 0; }
.quote-progress-label { font-size: 0.75rem; letter-spacing: 0.02em; color: var(--text-muted); min-height: 1em; }
.quote-progress-track { display: block; height: 2px; border-radius: 2px; background: var(--q-border); overflow: hidden; }
.quote-progress-bar {
  display: block; height: 100%; width: 0; background: var(--text-primary); border-radius: 2px;
  transform-origin: left center;
  transition: width 600ms var(--q-ease);
}

/* ── Thread (history) ────────────────────────────────── */
.quote-thread { display: flex; flex-direction: column; gap: 8px; }
.quote-thread:not(:empty) { margin-bottom: 26px; }

.q-msg {
  max-width: 88%;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-muted);
  transition: opacity var(--q-dur) var(--q-ease), transform var(--q-dur) var(--q-ease);
  will-change: transform, opacity;
  transform: translate3d(0, 0, 0);
}
.q-msg.q-bot { align-self: flex-start; color: #a3a3a3; }
/* One style for everything the chat says (questions, greeting, replies, "Got it"). */
.q-msg.q-intro, .q-msg.q-reply, .q-msg.q-ack { font-size: 0.875rem; color: #a3a3a3; }
/* Typewriter: the untyped rest keeps its place (same wrapping, same height) but isn't seen. */
.q-tw-rest { color: transparent; }
.q-msg.q-reply.q-enter, .q-msg.q-ack.q-enter { transform: none; }   /* typing is the entrance */
/* Your answers read as chat messages, not buttons: soft tinted fill, no
   border, and a "tail" corner on the bottom right like a messaging app. */
.q-msg.q-user {
  align-self: flex-end;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.075);
  border-radius: 16px 16px 5px 16px;
  padding: 7px 13px;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.45;
  transform-origin: right center;
  margin-bottom: 6px;
  cursor: default;
}
.q-msg.q-user.q-free { color: var(--text-secondary); background: rgba(255, 255, 255, 0.055); font-style: normal; }
.q-msg-text { display: inline-block; transition: opacity 140ms ease; }

/* Outgoing content: a still copy that fades while the page glides (see morph in quote.js). */
.q-snapshot {
  position: fixed !important;
  margin: 0 !important;
  bottom: auto !important;
  z-index: 3;
  pointer-events: none;
  box-sizing: border-box;
  will-change: opacity, transform;
}
/* The page moves on its own (FLIP); the browser must not re-anchor the scroll. */
html, body { overflow-anchor: none; }

/* Shape that travels from the chosen option to the user bubble. */
.q-ghost {
  position: fixed;
  z-index: 4;
  pointer-events: none;
  border: 1px solid transparent;
  box-sizing: border-box;
  transition:
    left var(--q-dur) var(--q-ease), top var(--q-dur) var(--q-ease),
    width var(--q-dur) var(--q-ease), height var(--q-dur) var(--q-ease),
    border-radius var(--q-dur) var(--q-ease),
    background-color var(--q-dur) ease, border-color var(--q-dur) ease;
}
.q-msg.q-note { font-size: 0.875rem; color: var(--text-secondary); background: var(--q-surface); border: 1px solid var(--q-border); border-radius: 12px; padding: 10px 14px; }
.q-msg.q-enter { opacity: 0; transform: translate3d(0, 10px, 0); }
.q-msg.q-user.q-enter { transform: translate3d(0, 6px, 0) scale(0.96); }

/* ── Current question ────────────────────────────────── */
.quote-current { display: flex; flex-direction: column; }

.q-question {
  font-size: clamp(1.3rem, 4.3vw, 1.6rem);
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.22;
  color: var(--text-primary);
  margin: 0 0 18px;
}

.q-options { display: flex; flex-direction: column; gap: 6px; }

.q-opt {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  width: 100%; text-align: left;
  padding: 12px 15px;
  min-height: 48px;
  background: rgba(255, 255, 255, 0.022);
  border: 1px solid rgba(255, 255, 255, 0.065);
  border-radius: 13px;
  color: var(--text-secondary);
  font: inherit; font-size: 0.9rem; line-height: 1.35;
  cursor: pointer;
  touch-action: manipulation;
  transition: background var(--q-dur-fast) ease, border-color var(--q-dur-fast) ease, transform var(--q-dur-fast) var(--q-ease), opacity var(--q-dur) var(--q-ease);
  transform: translate3d(0, 0, 0);
  will-change: transform, opacity;
}
.q-opt:hover { background: var(--q-surface-hover); border-color: var(--q-border-strong); }
.q-opt:active { transform: translate3d(0, 0, 0) scale(0.985); }
.q-opt:focus-visible { outline: 2px solid var(--text-primary); outline-offset: 2px; }
.q-opt-text { display: flex; flex-direction: column; gap: 2px; }
.q-opt-hint { font-size: 0.75rem; color: var(--text-muted); }
.q-opt-check {
  flex: 0 0 auto; width: 20px; height: 20px; border-radius: 6px;
  border: 1.5px solid var(--q-border-strong);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--bg-dark);
  transition: background var(--q-dur-fast) ease, border-color var(--q-dur-fast) ease;
}
.q-opt-check svg { width: 12px; height: 12px; opacity: 0; transition: opacity var(--q-dur-fast) ease; }
.q-opt.is-selected { border-color: var(--text-primary); background: var(--q-surface-hover); color: var(--text-primary); }
.q-opt.is-selected .q-opt-check { background: var(--text-primary); border-color: var(--text-primary); }
.q-opt.is-selected .q-opt-check svg { opacity: 1; }

.q-multi-actions { display: flex; justify-content: flex-end; margin-top: 14px; }
/* Typing on a multi-choice question: Send carries the ticks, Continue steps aside (space kept, nothing moves). */
.quote-current.is-typing .q-continue { opacity: 0; visibility: hidden; pointer-events: none; transition: opacity var(--q-dur-fast) ease, visibility 0s linear var(--q-dur-fast); }
.q-continue {
  font: inherit; font-size: 0.875rem; font-weight: 500;
  color: var(--bg-dark); background: var(--text-primary);
  border: 0; border-radius: 11px; padding: 10px 18px; min-height: 42px; cursor: pointer;
  transition: opacity var(--q-dur-fast) ease, transform var(--q-dur-fast) var(--q-ease);
}
.q-continue:disabled { opacity: 0.35; cursor: default; }
.q-continue:not(:disabled):active { transform: scale(0.98); }

/* entrance / exit states */
.q-enter { opacity: 0; transform: translate3d(0, 14px, 0); }
.q-exit { opacity: 0 !important; transform: translate3d(0, -10px, 0) !important; pointer-events: none; }
.q-opt.q-chosen { pointer-events: none; }

/* ── Result ──────────────────────────────────────────── */
.q-result { display: flex; flex-direction: column; gap: 22px; }
.q-result-head { display: flex; flex-direction: column; gap: 6px; }
.q-result-eyebrow { font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.q-result-range {
  font-size: clamp(2rem, 8vw, 3.25rem);
  font-weight: 300; letter-spacing: -0.03em; line-height: 1.05; color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.q-result-range small { font-size: 0.45em; font-weight: 400; color: var(--text-muted); letter-spacing: 0; margin-left: 0.35em; }
.q-result-service { font-size: 1rem; color: var(--text-secondary); }
.q-result-meta { font-size: 0.875rem; color: var(--text-muted); }

.q-breakdown {
  display: flex; flex-direction: column;
  border: 1px solid var(--q-border); border-radius: var(--q-radius); background: var(--q-surface);
  overflow: hidden;
}
.q-breakdown-toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; padding: 12px 16px; border: 0; background: none; cursor: pointer;
  font: inherit; font-size: 0.8125rem; color: var(--text-muted); text-align: left;
  transition: color 0.15s ease;
}
.q-breakdown-toggle:hover { color: var(--text-secondary); }
.q-breakdown-toggle svg { width: 15px; height: 15px; transition: transform var(--q-dur) var(--q-ease); }
.q-breakdown-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.q-breakdown-toggle:focus-visible { outline: 2px solid var(--text-primary); outline-offset: -2px; }

/* Breakdown lines: slightly quieter than the total. */
.q-lines { border-top: 1px solid var(--q-border); }
.q-line {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 9px 16px; font-size: 0.84rem;
  border-top: 1px solid var(--q-border);
  font-variant-numeric: tabular-nums;
}
.q-lines .q-line:first-child { border-top: 0; }
.q-line-label { color: #a3a3a3; }
.q-line-value { color: #cfcfcf; white-space: nowrap; }

/* The total carries the weight. */
.q-line.q-total {
  padding: 14px 16px; border-top: 1px solid var(--q-border-strong);
  font-size: 1rem; font-weight: 600; letter-spacing: -0.01em;
}
.q-line.q-total .q-line-label, .q-line.q-total .q-line-value { color: var(--text-primary); }
.q-line.q-total small { font-size: 0.75rem; font-weight: 500; color: var(--text-muted); margin-left: 2px; }

.q-result-note { font-size: 0.875rem; line-height: 1.55; color: var(--text-muted); }

.q-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; }
.q-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-size: 0.875rem; font-weight: 500; letter-spacing: -0.005em;
  padding: 10px 16px; min-height: 42px; border-radius: 11px; cursor: pointer;
  text-decoration: none; touch-action: manipulation;
  transition: background var(--q-dur-fast) ease, border-color var(--q-dur-fast) ease, color var(--q-dur-fast) ease, transform var(--q-dur-fast) var(--q-ease), opacity var(--q-dur-fast) ease;
}
.q-btn:active { transform: scale(0.98); }
.q-btn svg { width: 15px; height: 15px; flex: 0 0 auto; }
.q-btn-primary { color: var(--bg-dark); background: var(--text-primary); border: 1px solid transparent; }
.q-btn-primary:hover { background: #fff; }
.q-btn-ghost { color: var(--text-secondary); background: transparent; border: 1px solid transparent; }
.q-btn-ghost:hover, .q-btn-ghost.is-open { color: var(--text-primary); background: rgba(255, 255, 255, 0.05); }
.q-btn:focus-visible { outline: 2px solid var(--text-primary); outline-offset: 2px; }

/* Email: folds open under the actions */
.q-email-wrap { margin-top: -8px; }
.q-email { display: flex; flex-direction: column; }
.q-email-row {
  display: flex; align-items: center; gap: 6px;
  background: rgba(255, 255, 255, 0.03); border: 1px solid var(--q-border); border-radius: 13px;
  padding: 4px 4px 4px 13px;
  transition: border-color var(--q-dur-fast) ease;
}
.q-email-row:focus-within { border-color: rgba(255, 255, 255, 0.16); }
.q-email-input {
  flex: 1; min-width: 0; font: inherit; font-size: 0.875rem; color: var(--text-primary);
  background: none; border: 0; outline: none; padding: 8px 0; min-height: 34px;
}
.q-email-input::placeholder { color: var(--text-muted); }
.q-email-send {
  flex: 0 0 34px; width: 34px; height: 34px; border-radius: 10px; border: 0; cursor: pointer;
  background: var(--text-primary); color: var(--bg-dark);
  display: inline-flex; align-items: center; justify-content: center;
  transition: opacity 0.15s ease, transform 0.15s var(--q-ease);
}
.q-email-send svg { width: 15px; height: 15px; }
.q-email-send:disabled { opacity: 0.4; cursor: default; }
.q-email-send:not(:disabled):active { transform: scale(0.94); }
.q-email.is-busy .q-email-send svg { animation: q-spin 0.8s linear infinite; }
.q-email-msg { font-size: 0.8125rem; color: #fca5a5; padding: 8px 2px 0; }

/* Email confirmation: centered, check mark drawn in */
.q-done { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 18px 0 6px; }
.q-done-check { width: 52px; height: 52px; margin-bottom: 8px; }
.q-done-circle {
  stroke: rgba(255, 255, 255, 0.85); stroke-width: 1.5;
  stroke-dasharray: 151; stroke-dashoffset: 151;
  transform: rotate(-90deg); transform-origin: center;
  transition: stroke-dashoffset 0.6s cubic-bezier(0.65, 0, 0.35, 1);
}
.q-done-tick {
  stroke: var(--text-primary); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 34; stroke-dashoffset: 34;
  transition: stroke-dashoffset 0.35s cubic-bezier(0.65, 0, 0.35, 1) 0.45s;
}
.q-done.is-drawn .q-done-circle, .q-done.is-drawn .q-done-tick { stroke-dashoffset: 0; }
.q-done-title { font-size: 1rem; font-weight: 500; color: var(--text-primary); }
.q-done-body { font-size: 0.875rem; color: var(--text-muted); line-height: 1.5; overflow-wrap: anywhere; }
@media (prefers-reduced-motion: reduce) {
  .q-done-circle, .q-done-tick { stroke-dashoffset: 0; transition: none; }
}

/* ── Unavailable (deliberately plain) ────────────────── */
.q-unavailable { display: flex; flex-direction: column; gap: 12px; padding-top: 10vh; }
.q-unavailable h1 { font-size: 1.5rem; font-weight: 300; letter-spacing: -0.02em; }
.q-unavailable p { font-size: 0.9375rem; color: var(--text-muted); line-height: 1.6; max-width: 40ch; }
.q-unavailable a { color: var(--text-secondary); text-decoration: underline; text-underline-offset: 3px; }

/* ── Footer ──────────────────────────────────────────── */
.quote-footer {
  width: 100%;
  max-width: calc(var(--q-max) + var(--container-padding) * 2);
  margin: 0 auto;
  padding: 0 var(--container-padding) 8px;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  font-size: 0.75rem; color: var(--text-muted);
}
.quote-back {
  display: inline-flex; align-items: center; gap: 8px;
  font: inherit; font-size: 0.8125rem; color: var(--text-muted);
  background: none; border: 0; padding: 10px 12px 10px 6px; margin-left: -6px; min-height: 40px;
  border-radius: 10px; cursor: pointer;
  transition: color var(--q-dur-fast) ease, background var(--q-dur-fast) ease;
}
.quote-back:hover { color: var(--text-primary); background: var(--q-surface); }
.quote-back svg { width: 14px; height: 14px; }

/* ── Composer (free text) ────────────────────────────── */
.quote-composer {
  /* Sticky, not fixed: it follows the chat but stops above the site footer. */
  position: sticky;
  bottom: 0;
  /* Bottom gap = top gap of the header (container padding), like the home. */
  padding: 8px var(--container-padding) calc(var(--container-padding) + var(--safe-bottom));
  background: linear-gradient(to top, rgba(22, 22, 22, 0.94) 55%, rgba(22, 22, 22, 0));
  transform: translate3d(0, 0, 0);
  transition: transform var(--q-dur) var(--q-ease), opacity var(--q-dur) var(--q-ease);
  z-index: 5;
}
.quote-composer[hidden] { display: none; }
.quote-composer.q-enter { opacity: 0; transform: translate3d(0, 16px, 0); }
.quote-composer-form {
  width: 100%; max-width: var(--q-max); margin: 0 auto;
  display: flex; align-items: flex-end; gap: 6px;
  background: rgba(26, 26, 26, 0.88);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border: 1px solid var(--q-border); border-radius: 14px;
  padding: 4px 4px 4px 13px;
  transition: border-color var(--q-dur-fast) ease;
}
.quote-composer-form:focus-within { border-color: rgba(255, 255, 255, 0.14); }
.quote-composer-input {
  flex: 1; min-width: 0;
  font: inherit; font-size: 0.875rem; font-weight: 400; line-height: 1.45; letter-spacing: -0.005em;
  color: var(--text-primary);
  background: none; border: 0; outline: none; resize: none;
  padding: 6px 0; margin: 0;
  height: 32px; max-height: 120px;
  overflow-y: hidden;
  overscroll-behavior: contain;
  -webkit-appearance: none; appearance: none;
  /* Scrollbar: hidden at rest, shown only while scrolling (.is-scrolling). */
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
  transition: scrollbar-color 0.3s ease;
}
.quote-composer-input.is-scrollable { overflow-y: auto; }
.quote-composer-input.is-scrolling { scrollbar-color: rgba(255, 255, 255, 0.28) transparent; }
.quote-composer-input::-webkit-scrollbar { width: 6px; }
.quote-composer-input::-webkit-scrollbar-track { background: transparent; }
.quote-composer-input::-webkit-scrollbar-thumb { background: transparent; border-radius: 3px; }
.quote-composer-input.is-scrolling::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.28); }
.quote-composer-input::placeholder { color: var(--text-muted); opacity: 1; }
.quote-composer-send {
  flex: 0 0 32px; width: 32px; height: 32px; border-radius: 10px;
  background: var(--text-primary); color: var(--bg-dark); border: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: opacity var(--q-dur-fast) ease, transform var(--q-dur-fast) var(--q-ease);
}
.quote-composer-send svg { width: 14px; height: 14px; }
.quote-composer-send:disabled { background: rgba(255, 255, 255, 0.08); color: var(--text-muted); cursor: default; }
.quote-composer.is-busy .quote-composer-send:disabled { background: var(--text-primary); color: var(--bg-dark); }
.quote-composer-send:not(:disabled):active { transform: scale(0.94); }
.quote-composer.is-busy .quote-composer-send svg { animation: q-spin 0.8s linear infinite; }
@keyframes q-spin { to { transform: rotate(360deg); } }
.quote-composer-hint {
  max-width: var(--q-max); margin: 5px auto 0; padding: 0 4px;
  font-size: 0.75rem; color: var(--text-muted); min-height: 1.1em; line-height: 1.4;
  transition: color var(--q-dur-fast) ease;
}
.quote-composer-hint:empty { min-height: 0; margin: 0; }
.quote-composer-hint.is-warn { color: #fbbf24; }
/* Cloudflare check: full composer width, spaced from the input, collapsed
   unless Cloudflare needs a click; collapses again once verified. */
.quote-turnstile {
  width: 100%; max-width: var(--q-max); margin: 0 auto;
  max-height: 0; opacity: 0; overflow: hidden;
  transition: max-height 0.35s var(--q-ease), opacity 0.25s ease, margin-top 0.35s var(--q-ease);
}
.quote-turnstile.is-visible { max-height: 96px; opacity: 1; margin-top: 12px; }
.quote-turnstile.is-visible.is-done { max-height: 0; opacity: 0; margin-top: 0; }
.quote-turnstile iframe { display: block; width: 100% !important; border-radius: 12px; }

/* ── Counter ─────────────────────────────────────────── */
.q-count { display: inline-block; font-variant-numeric: tabular-nums; }

/* ── Responsive ──────────────────────────────────────── */
/* Mobile: logo 40px like the home; the switch becomes a pill in the exact
   spot and style of the home's floating menu button. */
@media (max-width: 768px) {
  .quote-logo img { height: 40px; }
  /* Sits in the header next to the logo and scrolls with the page (not floating). */
  .lang-switch {
    position: static;
    align-self: center;
    height: 40px;
    margin-top: 0;
    padding: 3px;
    gap: 1px;
    border-radius: 20px;
    background: rgba(30, 30, 30, 0.92);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
  }
  .lang-btn {
    height: 32px; min-width: 38px; padding: 0 9px;
    border-radius: 16px; font-size: 0.75rem;
  }
  .lang-btn[aria-pressed="true"] { background: var(--text-primary); color: var(--bg-dark); }
}

@media (max-width: 640px) {
  .q-msg { max-width: 92%; }
  .q-actions { flex-direction: column; align-items: stretch; }
}

@media (min-width: 900px) {
  .quote-main { padding-top: 28px; }
}

/* ── Motion preferences ──────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
  .q-enter, .q-msg.q-enter { opacity: 1; transform: none; }
  .quote-progress-bar { transition: none; }
}

.q-restart {
  align-self: center;
  display: inline-flex; align-items: center; justify-content: center;
  font: inherit; font-size: 0.8125rem; text-align: center; color: var(--text-muted);
  background: none; border: 0; border-radius: 10px;
  padding: 10px 16px; min-height: 40px; cursor: pointer;
  transition: color var(--q-dur-fast) ease, background var(--q-dur-fast) ease;
}
.q-restart:hover { color: var(--text-primary); background: var(--q-surface); }

/* ── Chat replies (free text) ────────────────────────── */
.q-msg.q-typing { display: inline-flex; gap: 4px; padding: 10px 2px; }
.q-msg.q-typing span {
  width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted);
  animation: q-typing 1.1s ease-in-out infinite;
}
.q-msg.q-typing span:nth-child(2) { animation-delay: 0.15s; }
.q-msg.q-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes q-typing { 0%, 60%, 100% { opacity: 0.25; transform: translate3d(0, 0, 0); } 30% { opacity: 1; transform: translate3d(0, -3px, 0); } }

/* Text keeps the normal arrow cursor (it can still be selected); only fields show the I-beam. */
html { cursor: default; }
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="button"]):not([type="submit"]):not([type="file"]):not([type="color"]),
textarea,
[contenteditable="true"] { cursor: text; }
input:disabled, textarea:disabled { cursor: default; }

/* ── Deadline calendar ───────────────────────────────── */
.q-cal {
  border: 1px solid var(--q-border); border-radius: var(--q-radius);
  background: var(--q-surface);
  padding: 12px 12px 10px;
  transition: opacity var(--q-dur) var(--q-ease), transform var(--q-dur) var(--q-ease);
}
.q-cal-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 10px; }
.q-cal-title { font-size: 0.9375rem; font-weight: 500; color: var(--text-primary); }
.q-cal-nav { display: flex; gap: 4px; }
.q-cal-btn {
  width: 32px; height: 32px; border-radius: 9px; border: 0; background: none; cursor: pointer;
  color: var(--text-secondary); display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}
.q-cal-btn svg { width: 16px; height: 16px; }
.q-cal-btn:hover { background: var(--q-surface-hover); color: var(--text-primary); }
.q-cal-btn:disabled { opacity: 0.25; cursor: default; background: none; }
.q-cal-grid {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px;
  transition: opacity 140ms ease, transform 140ms ease;
}
.q-cal-grid.is-out-left { opacity: 0; transform: translate3d(-10px, 0, 0); }
.q-cal-grid.is-out-right { opacity: 0; transform: translate3d(10px, 0, 0); }
.q-cal-grid.is-in-right { opacity: 0; transform: translate3d(10px, 0, 0); transition: none; }
.q-cal-grid.is-in-left { opacity: 0; transform: translate3d(-10px, 0, 0); transition: none; }
.q-cal-wd { font-size: 0.6875rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); text-align: center; padding: 4px 0 6px; }
.q-day {
  position: relative;
  height: 40px; border: 0; border-radius: 10px; background: none; cursor: pointer;
  font: inherit; font-size: 0.875rem; font-variant-numeric: tabular-nums; color: var(--text-secondary);
  touch-action: manipulation;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s var(--q-ease);
}
.q-day:hover { background: var(--q-surface-hover); color: var(--text-primary); }
.q-day:active { transform: scale(0.94); }
.q-day:focus-visible { outline: 2px solid var(--text-primary); outline-offset: 1px; }
.q-day.is-off { color: rgba(255, 255, 255, 0.18); cursor: default; background: none; transform: none; }
.q-day.is-today::after {
  content: ''; position: absolute; left: 50%; bottom: 6px; width: 3px; height: 3px; margin-left: -1.5px;
  border-radius: 50%; background: currentColor;
}
.q-day.is-selected { background: var(--text-primary); color: var(--bg-dark); font-weight: 500; }

.q-cal-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-top: 14px;
  transition: opacity var(--q-dur) var(--q-ease), transform var(--q-dur) var(--q-ease);
}
.q-cal-status { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 28px; }
.q-cal-hint { font-size: 0.875rem; color: var(--text-muted); }
.q-cal-hint.is-set { color: var(--text-secondary); }
.q-tag {
  font-size: 0.75rem; font-weight: 500; letter-spacing: 0.01em;
  padding: 4px 10px; border-radius: 999px; border: 1px solid transparent;
  transition: opacity var(--q-dur) var(--q-ease), transform var(--q-dur) var(--q-ease);
}
.q-tag-relaxed { color: #86efac; background: rgba(34, 197, 94, 0.1); border-color: rgba(34, 197, 94, 0.22); }
.q-tag-normal  { color: var(--text-secondary); background: rgba(255, 255, 255, 0.06); border-color: var(--q-border); }
.q-tag-urgent  { color: #fcd34d; background: rgba(251, 191, 36, 0.1); border-color: rgba(251, 191, 36, 0.25); }
/* "As soon as possible · date" and "No deadline": side by side, centered,
   two equal halves so the longer label doesn't pull the pair off-center. */
.q-cal-quick {
  align-self: center; margin-top: 12px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  width: min(100%, 440px);
  transition: opacity var(--q-dur) var(--q-ease), transform var(--q-dur) var(--q-ease);
}
.q-cal-earliest, .q-cal-none {
  font: inherit; font-size: 0.8125rem; line-height: 1.3; color: var(--text-muted); text-align: center;
  background: none; border: 0; border-radius: 10px; padding: 10px 8px; min-height: 40px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: color 0.15s ease, background 0.15s ease;
}
.q-cal-earliest:hover, .q-cal-none:hover { color: var(--text-primary); background: var(--q-surface); }

@media (max-width: 640px) {
  .q-cal { padding: 10px 8px 8px; }
  .q-day { height: 42px; }
  .q-cal-foot .q-continue { flex: 1 1 100%; }
}


/* Suggested option after "I'm not sure" */
.q-opt.is-suggested, .q-cal-none.is-suggested {
  border-color: rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.06);
  animation: q-suggest-in 0.6s var(--q-ease);
}
.q-cal-none.is-suggested { border: 1px solid rgba(255, 255, 255, 0.32); color: var(--text-primary); }
/* Quiet tag next to the label (inline, so nothing else moves). */
.q-suggest-badge {
  display: inline-block; vertical-align: 1px;
  margin-left: 8px; padding: 1px 7px;
  font-size: 0.6875rem; font-weight: 400; line-height: 1.5; letter-spacing: 0.01em;
  color: var(--text-muted);
  border: 1px solid var(--q-border); border-radius: 999px;
  white-space: nowrap;
}
/* The calendar's half-width button has no room inline: the tag sits on its top edge. */
.q-cal-none { position: relative; }
.q-cal-none .q-suggest-badge {
  position: absolute; top: 0; left: 50%; transform: translate(-50%, -50%);
  margin: 0; background: var(--bg-dark);
}
@keyframes q-suggest-in { 0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.25); } 100% { box-shadow: 0 0 0 10px rgba(255, 255, 255, 0); } }
@media (prefers-reduced-motion: reduce) { .q-opt.is-suggested, .q-cal-none.is-suggested { animation: none; } }

/* Legal links */
.q-email-legal { font-size: 0.75rem; line-height: 1.5; color: var(--text-muted); padding: 8px 2px 0; }
.q-email-legal a { color: var(--text-secondary); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(255, 255, 255, 0.25); }

/* ── Site footer (same as the home) ──────────────────── */
.site-footer {
  display: flex; justify-content: space-between; align-items: center; gap: 24px;
  margin-top: 56px;
  padding: 40px var(--container-padding) calc(32px + var(--safe-bottom));
  border-top: 1px solid rgba(255, 255, 255, 0.02);
}
.site-footer .copyright { font-size: 0.8125rem; color: var(--text-muted); line-height: 1.6; }
.site-footer .copyright a { color: var(--text-muted); text-decoration: none; transition: color 0.15s ease; }
.site-footer .copyright a:hover { color: rgba(255, 255, 255, 0.65); }
.footer-item { white-space: nowrap; }
.footer-sep { color: var(--text-muted); }
.availability { display: inline-flex; align-items: center; gap: 8px; font-size: 0.8125rem; color: var(--text-muted); text-decoration: none; transition: color 0.15s ease; }
.availability:hover { color: rgba(255, 255, 255, 0.65); }
.availability.unavailable { pointer-events: none; }
.availability.unavailable .availability-dot { background: var(--text-muted); box-shadow: none; animation: none; }
@media (max-width: 768px) {
  .site-footer { flex-direction: column-reverse; align-items: flex-start; gap: 20px; padding-top: 48px; }
}
@media (max-width: 480px) {
  .site-footer .copyright, .availability { font-size: 0.75rem; }
}

/* Step-zero privacy notice above the composer */
.quote-consent {
  max-width: var(--q-max); margin: 8px auto 0; padding: 0 4px;
  font-size: 0.75rem; line-height: 1.5; color: var(--text-muted); text-align: center;
  transition: opacity 0.35s ease, transform 0.35s var(--q-ease);
}
.quote-consent.is-out { opacity: 0; transform: translate3d(0, -4px, 0); }
.quote-consent a { color: inherit; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: currentColor; }
.quote-consent a:hover { color: var(--text-secondary); }
.site-footer .copyright { display: flex; flex-wrap: wrap; align-items: baseline; min-width: 0; }
.footer-sep { white-space: pre; }

/* Keyboard open (see bindKeyboard in quote.js): a tighter composer, no notice below it. */
.quote-app.kb-open .quote-composer { padding-bottom: 8px; }
.quote-app.kb-open .quote-consent { display: none; }
