/* =====================================================================
   Triple A Muffler — front counter assistant styles
   Loaded after styles.css; consumes its tokens.
   ===================================================================== */

.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;
}

/* A class that sets display beats the UA [hidden] rule — without these an
   invisible panel stays in the layer stack and eats clicks. */
.chat-panel[hidden],
.consent-card[hidden] { display: none !important; }

/* ---------- launcher ---------- */
.chat-launch {
  position: fixed; right: 1.1rem; bottom: 1.1rem; z-index: 90;
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-family: var(--font-display); font-weight: 600;
  font-size: 1.05rem; letter-spacing: 0.06em; text-transform: uppercase;
  background: var(--orange-btn); color: var(--on-accent);
  border: 0; border-radius: 999px;
  padding: 0.75rem 1.3rem; min-height: 44px; cursor: pointer;
  box-shadow: 0 16px 34px -14px rgba(0, 0, 0, 0.55);
  transition: transform 0.18s var(--ease), background-color 0.18s;
}
.chat-launch:hover { transform: translateY(-2px); background: var(--orange-btn-hover); }
.cl-dot {
  width: 9px; height: 9px; border-radius: 50%; background: var(--on-accent);
  animation: cl-pulse 2s infinite;
}
@keyframes cl-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .cl-dot { animation: none; } }

/* ---------- panel ---------- */
.chat-panel {
  position: fixed; right: 1.1rem; bottom: 4.8rem; z-index: 95;
  width: min(390px, calc(100vw - 2.2rem));
  height: min(560px, calc(100vh - 7rem));
  display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 32px 64px -24px rgba(0, 0, 0, 0.5);
  opacity: 0; transform: translateY(14px) scale(0.98);
  transition: opacity 0.24s var(--ease), transform 0.24s var(--ease);
}
.chat-panel.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .chat-panel { transition: none; opacity: 1; transform: none; }
}

.chat-head {
  display: flex; align-items: center; gap: 0.7rem;
  background: var(--ink); color: #fff;
  padding: 0.8rem 0.95rem; border-bottom: 3px solid var(--orange-btn);
}
.ch-av {
  width: 38px; height: 38px; border-radius: 50%;
  object-fit: cover; object-position: 62% 16%;
  border: 2px solid var(--orange); flex: none;
}
.ch-t {
  font-family: var(--font-display); font-weight: 700; font-size: 1.1rem;
  text-transform: uppercase; letter-spacing: 0.04em; line-height: 1.1;
}
.ch-s { font-size: 0.76rem; color: var(--muted-dark); }
.ch-x {
  margin-left: auto; background: none; border: 0; color: var(--muted-dark);
  font-size: 1.5rem; line-height: 1; cursor: pointer; padding: 0.2rem 0.4rem;
}
.ch-x:hover { color: #fff; }

.chat-log {
  flex: 1; overflow-y: auto; padding: 1rem 0.95rem;
  display: flex; flex-direction: column; gap: 0.65rem;
  background: var(--paper);
}
.chat-msg { display: flex; }
.chat-msg.me { justify-content: flex-end; }
.chat-msg .bubble {
  max-width: 85%; padding: 0.6rem 0.8rem; border-radius: 10px;
  font-size: 0.93rem; line-height: 1.5;
}
.chat-msg.bot .bubble {
  background: #fff; border: 1px solid var(--border);
  border-bottom-left-radius: 3px; color: var(--ink);
}
.chat-msg.me .bubble {
  background: var(--ink); color: #fff; border-bottom-right-radius: 3px;
}
.chat-msg .bubble a { color: var(--gold-text); font-weight: 600; }
.chat-msg.me .bubble a { color: var(--orange); }
.chat-msg .bubble strong { color: inherit; }

.bubble.typing { display: inline-flex; gap: 0.3rem; padding: 0.75rem 0.9rem; }
.bubble.typing i {
  width: 6px; height: 6px; border-radius: 50%; background: var(--muted);
  animation: chat-blink 1.2s infinite;
}
.bubble.typing i:nth-child(2) { animation-delay: 0.15s; }
.bubble.typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes chat-blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }

.chat-chips { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.6rem; }
.chat-chip {
  font-family: var(--font-display); font-weight: 600; font-size: 0.85rem;
  letter-spacing: 0.05em; text-transform: uppercase;
  background: #fff; color: var(--ink); border: 1px solid var(--border);
  border-radius: 999px; padding: 0.4rem 0.75rem; cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}
.chat-chip:hover { border-color: var(--orange-btn); background: rgba(240, 86, 74, 0.12); }

.chat-hours {
  border-collapse: collapse; margin-top: 0.5rem; width: 100%;
  font-size: 0.82rem; font-variant-numeric: tabular-nums;
}
.chat-hours th { text-align: left; font-weight: 500; padding: 0.18rem 0.6rem 0.18rem 0; color: var(--muted); }
.chat-hours td { text-align: right; padding: 0.18rem 0; }
.chat-fine { margin: 0.5rem 0 0; font-size: 0.8rem; color: var(--muted); }

.chat-confirm {
  border: 1px solid var(--border);
  border-radius: 8px; background: #fff; padding: 0.85rem 0.9rem; margin-top: 0.2rem;
}
.cc-top {
  display: flex; align-items: center; gap: 0.45rem;
  font-family: var(--font-display); font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--ink); margin-bottom: 0.55rem;
}
.cc-top svg { color: var(--gold-text); }
.cc-rows { margin: 0; }
.cc-rows > div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.22rem 0; border-top: 1px dashed var(--border); }
.cc-rows dt { color: var(--muted); font-size: 0.82rem; }
.cc-rows dd { margin: 0; font-size: 0.85rem; font-weight: 600; text-align: right; }
.cc-ref { font-variant-numeric: tabular-nums; letter-spacing: 0.04em; }
.cc-note { margin: 0.6rem 0 0; font-size: 0.84rem; color: var(--muted); }
.chat-demo-note { font-size: 0.75rem; color: var(--muted); margin: 0.5rem 0 0; }

.chat-form {
  display: flex; gap: 0.5rem; padding: 0.7rem;
  border-top: 1px solid var(--border); background: #fff;
}
.chat-form input {
  flex: 1; font: inherit; font-size: 1rem; color: var(--ink); /* >=16px: no iOS focus zoom */
  border: 1px solid var(--border); border-radius: 999px; padding: 0.55rem 0.95rem;
}
.chat-form input:focus { border-color: var(--orange-btn); outline: none; }
.chat-form button {
  width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--orange-btn); color: var(--on-accent);
  display: flex; align-items: center; justify-content: center;
  transition: background-color 0.15s;
}
.chat-form button:hover { background: var(--orange-btn-hover); }

/* ---------- consent card ---------- */
/* RULING (Mason, verbatim): "smaller and less in your face — it seemed too
   much like an ad." A 340px card anchored bottom-left sat on top of the hero
   headline at desktop widths, which is also the fixed-overlap failure in the
   conversion checklist. It is now a quiet one-line bar. */
.consent-card {
  position: fixed; left: 1.1rem; bottom: 1.1rem; z-index: 80;
  display: flex; align-items: center; gap: 0.9rem; flex-wrap: nowrap;
  width: auto; max-width: min(560px, calc(100vw - 2.2rem));
  background: rgba(12, 15, 22, 0.94);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  color: #fff; border: 1px solid var(--border-dark);
  border-radius: 999px; padding: 0.45rem 0.55rem 0.45rem 1.05rem;
  box-shadow: 0 18px 36px -22px rgba(0, 0, 0, 0.7);
  opacity: 0; transform: translateY(10px);
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease);
}
.consent-card h4 { display: none; }
.consent-card p { margin: 0 !important; font-size: 0.86rem !important; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.consent-actions { flex: none; }
.consent-actions button { padding: 0.4rem 0.85rem !important; font-size: 0.82rem !important;
  border-radius: 999px !important; min-height: 38px; }
@media (max-width: 600px) {
  .consent-card { left: 0.6rem; right: 0.6rem; max-width: none; padding-left: 0.9rem; }
  .consent-card p { white-space: normal; font-size: 0.8rem !important; }
}
.consent-card.in { opacity: 1; transform: none; }
.consent-card h4 {
  margin: 0 0 0.4rem; font-family: var(--font-display); font-weight: 700;
  font-size: 1.2rem; text-transform: uppercase; letter-spacing: 0.04em;
}
.consent-card p { margin: 0 0 0.9rem; font-size: 0.88rem; color: var(--muted-dark); line-height: 1.5; }
.consent-actions { display: flex; gap: 0.6rem; }
.consent-actions button {
  font-family: var(--font-display); font-weight: 600; font-size: 0.95rem;
  letter-spacing: 0.05em; text-transform: uppercase; cursor: pointer;
  border-radius: 6px; padding: 0.5rem 0.85rem; border: 1px solid transparent;
  min-height: 40px;
}
.consent-actions [data-consent="yes"] { background: var(--orange-btn); color: var(--on-accent); border: 0; }
.consent-actions [data-consent="yes"]:hover { background: var(--orange-btn-hover); }
.consent-actions [data-consent="no"] { background: none; color: var(--muted-dark); border-color: var(--border-dark); }
.consent-actions [data-consent="no"]:hover { color: #fff; }

/* ---------- toast ---------- */
.tam-toast {
  position: fixed; left: 50%; bottom: 1.4rem; z-index: 120;
  transform: translate(-50%, 10px); opacity: 0;
  background: var(--ink); color: #fff;
  border-radius: 8px; padding: 0.75rem 1.1rem; font-size: 0.92rem;
  box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.5);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
  max-width: calc(100vw - 2rem);
}
.tam-toast.in { opacity: 1; transform: translate(-50%, 0); }

/* ---------- footer forget link ---------- */
#forgetLink { color: var(--muted-dark); }

/* ---------- mobile: clear the fixed call bar ---------- */
@media (max-width: 768px) {
  /* Ruling (COMPONENT-TASTE): the assistant launcher is an ICON, not a full
     pill, when a call dock is present — a 229px pill floats over the hero
     headline at 390 and that is a fixed-element overlap. */
  .chat-launch {
    right: 0.75rem;
    bottom: calc(4.6rem + env(safe-area-inset-bottom));
    width: 52px; height: 52px; padding: 0; gap: 0;
    justify-content: center;
  }
  .chat-launch .cl-label { display: none; }
  .chat-panel {
    right: 0.6rem;
    bottom: calc(8.2rem + env(safe-area-inset-bottom));
    height: min(480px, calc(100vh - 11.5rem));
  }
  .consent-card {
    left: 0.6rem;
    bottom: calc(8.6rem + env(safe-area-inset-bottom)); /* clears the chat launcher */
  }
  .tam-toast { bottom: calc(4.9rem + env(safe-area-inset-bottom)); }
}


/* screen-reader name for the icon-only mobile launcher */
.cl-sr { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden;
  clip:rect(0 0 0 0); white-space:nowrap; border:0; }
@media (min-width: 769px) { .cl-sr { display:none; } }
