/* ===========================================================================
   GenkiCars live chat (js/chat.js): a round button in the corner, a panel
   that rises from it. Phones: the panel is full screen and the button sits
   above the tab bar. Motion is transform only (opacity changes made iPhones
   repaint late elsewhere on the site).
   =========================================================================== */

.gkc-launch {
  position: fixed; right: 20px; bottom: 20px; z-index: 140;
  width: 60px; height: 60px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center;
  background: var(--green, #22c55e); color: var(--on-green, #0a0a0a);
  box-shadow: 0 10px 28px rgba(34,197,94,.38), 0 3px 8px rgba(16,20,24,.18);
  transition: transform .2s cubic-bezier(.32,.72,0,1), box-shadow .2s ease;
  -webkit-tap-highlight-color: transparent;
}
.gkc-launch:hover { transform: translateY(-2px) scale(1.04); box-shadow: 0 14px 34px rgba(34,197,94,.45), 0 4px 10px rgba(16,20,24,.2); }
.gkc-launch:active { transform: scale(.94); }
.gkc-launch svg { width: 28px; height: 28px; transition: transform .25s cubic-bezier(.32,.72,0,1); }
.gkc-launch.is-open svg { width: 24px; height: 24px; }
.gkc-launch__dot {
  position: absolute; top: -2px; right: -2px; min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 11px; background: #dc2626; color: #fff; font: 700 12px/22px system-ui, sans-serif; text-align: center;
  border: 2px solid #fff; transform: scale(0); transition: transform .2s cubic-bezier(.34,1.56,.64,1);
}
.gkc-launch__dot.is-on { transform: scale(1); }

.gkc-panel {
  position: fixed; right: 20px; bottom: 92px; z-index: 141;
  width: 380px; height: min(620px, calc(100vh - 120px));
  display: flex; flex-direction: column; overflow: hidden;
  background: #fff; border-radius: 22px;
  box-shadow: 0 2px 6px rgba(16,20,24,.06), 0 24px 60px rgba(16,20,24,.22);
  transform-origin: bottom right;
  transform: translateY(16px) scale(.96); visibility: hidden; pointer-events: none;
  transition: transform .26s cubic-bezier(.32,.72,0,1), visibility 0s .26s;
  font-family: inherit;
}
.gkc-panel.is-open { transform: none; visibility: visible; pointer-events: auto; transition: transform .26s cubic-bezier(.32,.72,0,1), visibility 0s; }

.gkc-head { display: flex; align-items: center; gap: 12px; padding: 16px 16px 14px 18px; background: var(--logo-ink, #231f20); color: #fff; }
.gkc-head__mark { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--green, #22c55e); color: #0a0a0a; font-weight: 800; flex: none; }
.gkc-head__txt { flex: 1; min-width: 0; }
.gkc-head__title { display: block; font-weight: 700; font-size: 1rem; letter-spacing: -.01em; }
.gkc-head__status { display: flex; align-items: center; gap: 6px; font-size: .8rem; color: rgba(255,255,255,.72); }
.gkc-head__status i { width: 8px; height: 8px; border-radius: 50%; background: #9ca3af; flex: none; }
.gkc-head__status.is-online i { background: var(--green, #22c55e); box-shadow: 0 0 0 3px rgba(34,197,94,.25); }
.gkc-x { width: 38px; height: 38px; border: 0; border-radius: 50%; background: rgba(255,255,255,.1); color: #fff; cursor: pointer; display: grid; place-items: center; flex: none; }
.gkc-x:hover { background: rgba(255,255,255,.18); }

.gkc-body { flex: 1; overflow-y: auto; padding: 18px 16px 8px; background: #f6f7f8; overscroll-behavior: contain; scroll-behavior: smooth; }
.gkc-step { animation: gkc-in .28s cubic-bezier(.32,.72,0,1); }
@keyframes gkc-in { from { transform: translateY(10px); } to { transform: none; } }

.gkc-msg { display: flex; margin: 0 0 8px; }
.gkc-msg__b { max-width: 82%; padding: 10px 14px; border-radius: 18px; font-size: .95rem; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; animation: gkc-in .22s cubic-bezier(.32,.72,0,1); }
.gkc-msg--admin .gkc-msg__b { background: #fff; color: var(--ink, #121212); border-bottom-left-radius: 6px; box-shadow: 0 1px 2px rgba(16,20,24,.08); }
.gkc-msg--visitor { justify-content: flex-end; }
.gkc-msg--visitor .gkc-msg__b { background: var(--logo-ink, #231f20); color: #fff; border-bottom-right-radius: 6px; }
.gkc-msg--visitor.is-pending .gkc-msg__b { transform: none; filter: saturate(.6); }
.gkc-msg--visitor.is-failed .gkc-msg__b { background: #b91c1c; cursor: pointer; }
.gkc-msg__b a { color: inherit; text-decoration: underline; }
.gkc-when { text-align: center; font-size: .72rem; color: var(--ink-3, #6b7378); margin: 10px 0 8px; }
.gkc-typing { display: inline-flex; gap: 4px; padding: 12px 14px; background: #fff; border-radius: 18px; border-bottom-left-radius: 6px; box-shadow: 0 1px 2px rgba(16,20,24,.08); margin-bottom: 8px; }
.gkc-typing i { width: 7px; height: 7px; border-radius: 50%; background: #9ca3af; animation: gkc-dot 1.2s infinite ease-in-out; }
.gkc-typing i:nth-child(2) { animation-delay: .15s; } .gkc-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes gkc-dot { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-5px); } }

.gkc-choices { display: grid; gap: 10px; margin: 6px 0 10px; }
.gkc-choice {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; border-radius: 16px; cursor: pointer; text-align: start;
  background: #fff; border: 1.5px solid var(--line, #e3e6e9); color: var(--ink, #121212); font: inherit; font-weight: 600; font-size: .98rem;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease; -webkit-tap-highlight-color: transparent;
}
.gkc-choice:hover { border-color: var(--green, #22c55e); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(16,20,24,.08); }
.gkc-choice:active { transform: scale(.98); }
.gkc-choice svg { width: 26px; height: 26px; flex: none; color: var(--green, #22c55e); }
.gkc-choice small { display: block; font-weight: 400; font-size: .82rem; color: var(--ink-3, #6b7378); }

.gkc-form { display: grid; gap: 10px; margin: 6px 0 10px; }
.gkc-form label { font-size: .82rem; font-weight: 600; color: var(--ink-3, #6b7378); display: grid; gap: 5px; }
.gkc-input { width: 100%; box-sizing: border-box; height: 48px; padding: 0 14px; border-radius: 12px; border: 1.5px solid var(--line, #e3e6e9); background: #fff; font: inherit; font-size: 16px; color: var(--ink, #121212); }
.gkc-input:focus { outline: none; border-color: var(--green, #22c55e); box-shadow: 0 0 0 4px rgba(34,197,94,.15); }
.gkc-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.gkc-go { height: 50px; border: 0; border-radius: 14px; background: var(--green, #22c55e); color: var(--on-green, #0a0a0a); font: inherit; font-weight: 700; font-size: 1rem; cursor: pointer; transition: transform .15s ease; }
.gkc-go:active { transform: scale(.98); }
.gkc-go[disabled] { opacity: .6; cursor: default; }
.gkc-err { color: #b91c1c; font-size: .86rem; margin: 0; min-height: 1.2em; }
.gkc-note { font-size: .76rem; color: var(--ink-3, #6b7378); margin: 2px 0 0; }
.gkc-note a { color: inherit; }
.gkc-back { background: none; border: 0; padding: 0; color: var(--ink-3, #6b7378); font: inherit; font-size: .84rem; cursor: pointer; text-decoration: underline; justify-self: start; }

.gkc-compose { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line, #e3e6e9); }
.gkc-compose textarea {
  flex: 1; resize: none; max-height: 140px; min-height: 44px; padding: 11px 14px; box-sizing: border-box;
  border-radius: 22px; border: 1.5px solid var(--line, #e3e6e9); background: #f6f7f8; font: inherit; font-size: 16px; line-height: 1.4; color: var(--ink, #121212);
}
.gkc-compose textarea:focus { outline: none; border-color: var(--green, #22c55e); background: #fff; }
.gkc-send { width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--green, #22c55e); color: var(--on-green, #0a0a0a); display: grid; place-items: center; cursor: pointer; flex: none; transition: transform .15s ease; }
.gkc-send:active { transform: scale(.9); }
.gkc-send[disabled] { background: #e5e7eb; color: #9ca3af; cursor: default; }
.gkc-away { margin: 0 0 10px; padding: 10px 12px; border-radius: 12px; background: #fff; font-size: .84rem; color: var(--ink-2, #3b4246); box-shadow: 0 1px 2px rgba(16,20,24,.06); }

@media (max-width: 999px) {
  .gkc-launch { bottom: calc(56px + env(safe-area-inset-bottom) + 14px); right: 14px; width: 56px; height: 56px; }
}
@media (max-width: 560px) {
  .gkc-panel { inset: 0; width: auto; height: auto; right: 0; bottom: 0; border-radius: 0; transform: translateY(100%); }
  .gkc-panel.is-open { transform: none; }
  .gkc-head { padding-top: calc(14px + env(safe-area-inset-top)); }
  .gkc-launch.is-open { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .gkc-panel, .gkc-launch, .gkc-step, .gkc-msg__b { transition: none; animation: none; }
}
