.cnc-tire-chat {
  --cnc-chat-blue: var(--blue2, #63b4ff);
  --cnc-chat-ink: var(--panel, #0b1016);
  --cnc-chat-navy: #102d50;
  --cnc-chat-gradient: linear-gradient(135deg, var(--cnc-chat-ink), var(--cnc-chat-navy));
  --cnc-chat-glow: 0 0 18px #1687ff99, 0 5px 18px #05070acc;
  color-scheme: dark;
  font: 15px/1.45 system-ui, sans-serif;
}
.cnc-tire-chat [hidden] { display: none !important; }
.cnc-tire-chat button, .cnc-tire-chat a { font: inherit; }
.cnc-tire-chat button, .cnc-chat-direct a {
  border: 1px solid #63b4ff80;
  border-radius: 10px;
  background: var(--cnc-chat-navy);
  color: #f1f7ff;
  padding: 9px 12px;
  cursor: pointer;
  text-decoration: none;
}
.cnc-tire-chat button:focus-visible, .cnc-tire-chat a:focus-visible,
.cnc-tire-chat input:focus-visible, .cnc-tire-chat textarea:focus-visible {
  outline: 2px solid #81caff;
  outline-offset: 2px;
}
.cnc-tire-chat button:disabled { opacity: .6; cursor: wait; }
.cnc-tire-chat .cnc-chat-launch {
  position: fixed;
  z-index: 850;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  right: calc(16px + env(safe-area-inset-right, 0px));
  max-width: calc(100% - 32px);
  border: 1px solid var(--cnc-chat-blue);
  border-radius: 100px;
  background: var(--cnc-chat-gradient);
  color: var(--white, #f7fbff);
  box-shadow: var(--cnc-chat-glow);
  font-weight: 800;
  min-height: 44px;
  padding-inline: 16px;
}
.cnc-tire-chat .cnc-chat-launch:hover,
.cnc-tire-chat .cnc-chat-launch:focus-visible {
  border-color: #c5e5ff;
  box-shadow: 0 0 26px #1687ffcc, 0 5px 18px #05070acc;
}
.cnc-tire-chat dialog {
  box-sizing: border-box;
  width: min(440px, calc(100% - 24px));
  max-height: min(730px, calc(100dvh - 24px));
  padding: 0;
  border: 1px solid var(--cnc-chat-blue);
  border-radius: 18px;
  background: var(--cnc-chat-gradient);
  color: #f1f7ff;
  overflow: hidden;
  box-shadow: var(--cnc-chat-glow), 0 20px 60px #000b;
}
.cnc-tire-chat dialog[open] { display: flex; flex-direction: column; }
.cnc-tire-chat dialog::backdrop { background: #040a12aa; }
.cnc-chat-header, .cnc-chat-direct, .cnc-chat-body { padding: 12px 15px; }
.cnc-chat-header { display: flex; align-items: center; justify-content: space-between; background: var(--cnc-chat-gradient); border-bottom: 1px solid #63b4ff50; }
.cnc-chat-header small { display: block; color: #b9cce0; }
.cnc-chat-direct, .cnc-chat-compose { display: flex; gap: 8px; flex-wrap: wrap; }
.cnc-chat-direct { padding-block: 9px; border-bottom: 1px solid #63b4ff50; }
.cnc-chat-direct a { min-height: 42px; box-sizing: border-box; }
.cnc-chat-body { min-height: 0; overflow: auto; overscroll-behavior: contain; }
.cnc-chat-log { display: grid; max-height: min(245px, 32dvh); overflow: auto; gap: 7px; padding: 3px; }
.cnc-chat-log p { margin: 0; padding: 9px 11px; max-width: 92%; border-radius: 11px; overflow-wrap: anywhere; }
.cnc-chat-assistant { background: var(--cnc-chat-ink); border: 1px solid #63b4ff50; justify-self: start; }
.cnc-chat-user { background: var(--cnc-chat-navy); border: 1px solid #63b4ff80; justify-self: end; }
.cnc-chat-compose { margin-top: 9px; flex-wrap: nowrap; }
.cnc-tire-chat input, .cnc-tire-chat textarea {
  color: #f1f7ff; background: #08121e; border: 1px solid #526982; border-radius: 8px;
  box-sizing: border-box; width: 100%; min-width: 0; min-height: 42px; padding: 8px;
  font: 16px/1.35 system-ui, sans-serif;
}
.cnc-tire-chat textarea { resize: vertical; }
.cnc-chat-note, .cnc-chat-status, .cnc-tire-chat [data-dispatch-explanation] { color: #c2d2e5; font-size: 13px; margin: 9px 0; }
.cnc-chat-status:empty { display: none; }
.cnc-tire-chat [data-match] { color: #a9d9ff; display: inline-block; margin-top: 8px; }
.cnc-tire-chat [data-job-form] { border-top: 1px solid #334d67; margin-top: 12px; padding-top: 10px; }
.cnc-tire-chat h3 { font: 700 17px/1.35 system-ui, sans-serif; margin: 0; color: #f1f7ff; }
.cnc-chat-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-block: 10px; }
.cnc-chat-fields label { display: grid; gap: 3px; font-size: 13px; }
.cnc-chat-wide { grid-column: 1 / -1; }
.cnc-tire-chat [data-confirm] { background: #94d2ff; color: #071423; font-weight: 750; }
.cnc-tire-chat [data-challenge] { margin-top: 10px; }
.cnc-chat-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
@media (max-width: 380px) {
  .cnc-chat-fields { grid-template-columns: 1fr; }
  .cnc-chat-header, .cnc-chat-direct, .cnc-chat-body { padding-inline: 10px; }
}


.cnc-chat-location [data-location] { margin-top: 7px; min-height: 44px; }
.cnc-chat-location [data-location-status] { margin: 5px 0 0; color: #c2d2e5; font-size: 12px; }
.cnc-chat-location [data-location-status]:empty { display: none; }

.cnc-tire-chat .cnc-chat-review[data-ready="true"] {
  background: #94d2ff;
  border-color: #c5e5ff;
  color: #071423;
  box-shadow: 0 0 18px #1687ff99;
  font-weight: 800;
  min-height: 44px;
}

button.cnc-dispatch-entry {
  display: inline-grid;
  place-items: center;
  box-sizing: border-box;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid #94d2ff;
  border-radius: 10px;
  background: #123455;
  color: #f1f7ff;
  font: 900 12px/1.2 system-ui, sans-serif;
  text-align: center;
  white-space: normal;
  cursor: pointer;
}
button.cnc-dispatch-entry:focus-visible { outline: 2px solid #94d2ff; outline-offset: 2px; }
.cnc-dispatch-contact { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px; }
.cnc-dispatch-contact a { padding: 10px; color: #f1f7ff; }
.floating[data-dispatch-bar] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.floating[data-dispatch-bar] > a,
.floating[data-dispatch-bar] > button { min-width: 0; font-size: clamp(10px, 2.8vw, 12px); text-align: center; }
.floating[data-dispatch-bar] > button { padding-inline: 4px; }
@media (max-width: 640px) {
  body:has(.floating[data-dispatch-bar]) .cnc-tire-chat .cnc-chat-launch { display: none; }
}

/* Accessible, tappable verified site-navigation results. */
.cnc-chat-nav-results { padding: 12px; background: #081321; border: 1px solid #4f9ce0; border-radius: 13px; max-width: 100%; overflow-wrap: anywhere; }
.cnc-chat-nav-results p { margin: 0 0 9px; color: #e8f4ff; }
.cnc-chat-nav-results ul { list-style:none; padding:0; margin:0; display:grid; gap:7px; }
.cnc-chat-nav-results a { display:block; border:1px solid #5ab5ff88; background:#15395e; color:#fff; text-decoration:underline; text-underline-offset:3px; padding:10px 12px; border-radius:9px; min-height:42px; }
.cnc-chat-nav-results a:hover,.cnc-chat-nav-results a:focus-visible { background:#235786; outline:2px solid #b8deff; }
html { scroll-padding-top: 90px; }

/* Assessed-job handoff. Keep the action visually distinct but honor reduced motion. */
.cnc-tire-chat .cnc-chat-review[data-ready="true"] {
  animation: cnc-review-pulse 1.8s ease-in-out 3;
  scroll-margin-block: 18px;
}
@keyframes cnc-review-pulse {
  0%, 100% { box-shadow: 0 0 12px #1687ff99; }
  50% { box-shadow: 0 0 28px #39a4ffdf, 0 0 0 4px #63b4ff35; }
}
@media (prefers-reduced-motion: reduce) {
  .cnc-tire-chat .cnc-chat-review[data-ready="true"] { animation: none; }
}
