/* ArtinTech Live Chat — visitor widget.
   Colours come from the site's theme tokens, so it follows light and dark mode.
   Every rule is scoped under .atc: Hello Elementor's reset paints bare buttons
   #c36 on hover and gives textareas its own borders, and both must lose. */

.atc{
  --atc-accent: var(--at-accent, #ec3350);
  --atc-accent-2: var(--at-accent-2, #c8203c);
  --atc-ink: var(--at-heading, #1d1614);
  --atc-text: var(--at-text, #554d48);
  --atc-muted: var(--at-muted, #7b726c);
  --atc-bg: var(--at-surface, #ffffff);
  --atc-bg-2: var(--at-surface-2, #f4ece5);
  --atc-line: var(--at-line-2, rgba(28,20,18,.16));
  --atc-soft: var(--at-accent-soft, #fdeaee);
  --atc-soft-line: var(--at-accent-soft-line, rgba(236,51,80,.2));
  --atc-link: var(--at-accent-ink, #c8203c);
  position: fixed;
  bottom: 28px;
  inset-inline-end: 28px;
  z-index: 9000; /* above content and back-to-top, below the overlay menu and booking modal */
  font-family: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--atc-text);
}
.atc *, .atc *::before, .atc *::after{ box-sizing: border-box; }

/* ---------- Launcher ---------- */
.atc .atc-launch{
  position: relative; display: grid; place-items: center;
  width: 60px; height: 60px; margin: 0; padding: 0;
  border: 0; border-radius: 50%;
  background: var(--atc-accent); color: #fff;
  box-shadow: 0 12px 30px rgba(236,51,80,.35), 0 2px 6px rgba(0,0,0,.14);
  cursor: pointer;
  transition: transform .25s ease, box-shadow .25s ease;
}
.atc .atc-launch:hover,
.atc .atc-launch:focus{ background: var(--atc-accent); color: #fff; transform: translateY(-2px); box-shadow: 0 16px 36px rgba(236,51,80,.42), 0 2px 6px rgba(0,0,0,.14); }
.atc .atc-launch:focus-visible{ outline: 2px solid var(--atc-ink); outline-offset: 3px; }
.atc .atc-launch .atc-i{ grid-area: 1 / 1; width: 27px; height: 27px; transition: transform .3s ease, opacity .2s ease; }
.atc .atc-launch .atc-i-close{ opacity: 0; transform: rotate(-90deg) scale(.6); }
.atc.is-open .atc-launch .atc-i-chat{ opacity: 0; transform: rotate(90deg) scale(.6); }
.atc.is-open .atc-launch .atc-i-close{ opacity: 1; transform: none; }
.atc .atc-badge{
  position: absolute; top: -3px; inset-inline-end: -3px;
  min-width: 21px; height: 21px; padding: 0 6px; border-radius: 11px;
  background: var(--atc-ink); color: var(--at-bg, #fff);
  font: 700 11px/21px 'DM Sans', system-ui, sans-serif; text-align: center;
  box-shadow: 0 0 0 2px var(--at-bg, #fff);
}
.atc .atc-badge[hidden]{ display: none; }

/* ---------- Panel ---------- */
.atc .atc-panel{
  position: absolute; bottom: 76px; inset-inline-end: 0;
  width: 380px; max-width: calc(100vw - 32px);
  height: min(600px, calc(100vh - 140px));
  height: min(600px, calc(100dvh - 140px));
  display: flex; flex-direction: column;
  background: var(--atc-bg);
  border: 1px solid var(--atc-line); border-radius: 22px;
  box-shadow: 0 28px 70px rgba(20,12,10,.24);
  overflow: hidden;
  visibility: hidden; opacity: 0;
  transform: translateY(14px) scale(.98); transform-origin: bottom right;
  transition: opacity .22s ease, transform .22s ease, visibility 0s linear .22s;
}
.atc[dir="rtl"] .atc-panel{ transform-origin: bottom left; }
.atc.is-open .atc-panel{ visibility: visible; opacity: 1; transform: none; transition: opacity .22s ease, transform .22s ease, visibility 0s; }

.atc .atc-head{
  display: flex; align-items: center; gap: 12px;
  padding: 16px 14px 15px 16px;
  background: var(--atc-accent); color: #fff;
}
.atc .atc-av{ width: 40px; height: 40px; flex: none; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px rgba(255,255,255,.35); }
.atc .atc-htxt{ display: flex; flex-direction: column; min-width: 0; flex: 1; }
.atc .atc-name{ font-family: 'Space Grotesk', 'DM Sans', sans-serif; font-weight: 700; font-size: 16px; line-height: 1.25; color: #fff; letter-spacing: -.01em; }
.atc .atc-stat{ display: flex; align-items: center; gap: 7px; font-size: 12.5px; line-height: 1.35; color: rgba(255,255,255,.9); }
.atc .atc-stat::before{ content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.5); }
.atc.is-online .atc-stat::before{ background: #6ff59a; box-shadow: 0 0 0 3px rgba(111,245,154,.28); }
.atc .atc-x{
  display: grid; place-items: center; flex: none;
  width: 36px; height: 36px; margin: 0; padding: 0;
  border: 0; border-radius: 50%;
  background: rgba(255,255,255,.16); color: #fff; cursor: pointer;
}
.atc .atc-x:hover, .atc .atc-x:focus{ background: rgba(255,255,255,.3); color: #fff; }
.atc .atc-x:focus-visible{ outline: 2px solid #fff; outline-offset: 2px; }
.atc .atc-x .atc-i{ width: 18px; height: 18px; }

/* ---------- Conversation ---------- */
.atc .atc-log{
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 10px;
  padding: 18px 16px 10px;
}
.atc .atc-log:focus-visible{ outline: 2px solid var(--atc-accent); outline-offset: -2px; }
.atc .atc-m{ display: flex; flex-direction: column; align-items: flex-start; max-width: 86%; }
.atc .atc-m--me{ align-self: flex-end; align-items: flex-end; }
.atc .atc-b{
  padding: 10px 14px; border-radius: 16px;
  background: var(--atc-bg-2); color: var(--atc-ink);
  font-size: 14.5px; line-height: 1.5;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.atc .atc-m--bot .atc-b{ border-end-start-radius: 6px; }
.atc .atc-m--agent .atc-b{ border-end-start-radius: 6px; background: var(--atc-soft); border: 1px solid var(--atc-soft-line); }
.atc .atc-m--me .atc-b{ background: var(--atc-accent); color: #fff; border-end-end-radius: 6px; }
.atc .atc-b a{ color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.atc .atc-pending{ opacity: .55; }
.atc .atc-who{ margin-top: 4px; padding-inline: 4px; font-size: 11px; color: var(--atc-muted); }
.atc .atc-m--sys{ align-self: center; align-items: center; max-width: 92%; }
.atc .atc-m--sys .atc-b{ background: transparent; color: var(--atc-muted); font-size: 12.5px; text-align: center; padding: 4px 8px; }
.atc .atc-acts{ display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.atc .atc-act{
  display: inline-flex; align-items: center;
  padding: 7px 13px; border-radius: 999px;
  border: 1px solid var(--atc-accent); background: transparent;
  color: var(--atc-link); font-size: 13px; font-weight: 600; line-height: 1.2; text-decoration: none;
  transition: background .2s ease, color .2s ease;
}
.atc .atc-act:hover, .atc .atc-act:focus-visible{ background: var(--atc-accent); color: #fff; text-decoration: none; }
.atc .atc-typing{ display: inline-flex; gap: 4px; padding: 13px 15px; border-radius: 16px; border-end-start-radius: 6px; background: var(--atc-bg-2); }
.atc .atc-typing i{ width: 6px; height: 6px; border-radius: 50%; background: var(--atc-muted); animation: atc-dot 1s infinite ease-in-out; }
.atc .atc-typing i:nth-child(2){ animation-delay: .15s; }
.atc .atc-typing i:nth-child(3){ animation-delay: .3s; }
@keyframes atc-dot{ 0%, 80%, 100%{ transform: translateY(0); opacity: .45; } 40%{ transform: translateY(-4px); opacity: 1; } }

/* ---------- Quick topics ---------- */
.atc .atc-chips{ display: flex; flex-wrap: wrap; gap: 8px; padding: 2px 16px 12px; }
.atc .atc-chips:empty{ display: none; }
.atc .atc-chip{
  margin: 0; padding: 8px 13px;
  border: 1px solid var(--atc-line); border-radius: 999px;
  background: var(--atc-bg); color: var(--atc-ink);
  font: 600 13px/1.2 'DM Sans', system-ui, sans-serif; cursor: pointer;
  transition: border-color .2s ease, color .2s ease;
}
.atc .atc-chip:hover, .atc .atc-chip:focus{ border-color: var(--atc-accent); background: var(--atc-bg); color: var(--atc-link); }
.atc .atc-chip:focus-visible{ outline: 2px solid var(--atc-accent); outline-offset: 2px; }

/* ---------- Composer ---------- */
.atc .atc-err{ margin: 0 16px 10px; padding: 8px 12px; border-radius: 10px; background: var(--atc-soft); color: var(--atc-link); font-size: 13px; line-height: 1.45; }
.atc .atc-err[hidden]{ display: none; }
.atc .atc-form{ position: relative; display: flex; align-items: flex-end; gap: 8px; margin: 0; padding: 10px 12px; border-top: 1px solid var(--atc-line); }
.atc .atc-hp{ position: absolute !important; width: 1px !important; height: 1px !important; opacity: 0 !important; pointer-events: none; inset-inline-start: -9999px; }
.atc .atc-in{
  flex: 1; width: auto; min-height: 44px; max-height: 120px; margin: 0; padding: 10px 13px;
  border: 1px solid var(--atc-line); border-radius: 14px;
  background: var(--atc-bg-2); color: var(--atc-ink);
  font: 400 16px/1.4 'DM Sans', system-ui, sans-serif; /* 16px stops iOS zooming on focus */
  resize: none; box-shadow: none;
}
.atc .atc-in::placeholder{ color: var(--atc-muted); opacity: 1; }
.atc .atc-in:focus{ outline: none; border-color: var(--atc-accent); box-shadow: 0 0 0 3px var(--at-accent-glow, rgba(236,51,80,.2)); }
.atc .atc-send{
  display: grid; place-items: center; flex: none;
  width: 44px; height: 44px; margin: 0; padding: 0;
  border: 0; border-radius: 50%;
  background: var(--atc-accent); color: #fff; cursor: pointer;
  transition: background .2s ease;
}
.atc .atc-send:hover, .atc .atc-send:focus{ background: var(--atc-accent-2); color: #fff; }
.atc .atc-send:focus-visible{ outline: 2px solid var(--atc-ink); outline-offset: 2px; }
.atc .atc-send:disabled{ opacity: .5; cursor: default; }
.atc .atc-send .atc-i{ width: 20px; height: 20px; }
.atc[dir="rtl"] .atc-send .atc-i{ transform: scaleX(-1); }
.atc .atc-note{ margin: 0 4px; padding: 0; font-size: 11.5px; line-height: 1.45; color: var(--atc-muted); }

/* ---------- Make room for the existing back-to-top button ---------- */
body.at-chat-on:not(.rtl) .at-back-to-top{ right: 32px; bottom: 104px; }

/* ---------- Small screens: a bottom sheet ---------- */
@media (max-width: 560px){
  .atc{ bottom: 18px; inset-inline-end: 18px; }
  .atc .atc-panel{
    position: fixed; inset: auto 0 0 0; bottom: 0;
    width: 100%; max-width: none;
    height: 88vh; height: 88dvh;
    border-radius: 22px 22px 0 0; border-bottom: 0;
    transform: translateY(24px);
  }
  .atc.is-open .atc-launch{ visibility: hidden; opacity: 0; }
  body.at-chat-on:not(.rtl) .at-back-to-top{ right: 22px; bottom: 92px; }
}

/* Short windows (landscape phones, small laptops): keep the composer visible —
   topics scroll sideways instead of stacking. */
@media (max-height: 640px){
  .atc .atc-chips{ flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 10px; }
  .atc .atc-chips::-webkit-scrollbar{ display: none; }
  .atc .atc-chip{ flex: none; }
  .atc .atc-head{ padding-top: 12px; padding-bottom: 11px; }
}

@media (prefers-reduced-motion: reduce){
  .atc *, .atc .atc-panel{ transition: none !important; animation: none !important; }
}
@media print{ .atc{ display: none !important; } }
