/* Guided Travels chat widget — visitor side. Uses the theme's colour tokens with safe fallbacks. */
.gt-chat { --c-ink: var(--gt-ink, #1f2a37); --c-acc: var(--gt-accent, #2f6da3); --c-acc-tint: var(--gt-accent-tint, #eaf1f8); --c-card: #fff; --c-line: var(--gt-border, #e3e7ec); --c-soft: var(--gt-border-soft, #eef1f4); --c-muted: var(--gt-muted, #6b7280); --c-text: var(--gt-ink-2, #374151); --c-ok: var(--gt-success, #2e7d4f); --c-bg: #f5f7fa; --head: var(--gt-head, inherit); --body: var(--gt-body, inherit); --r: 20px; position: fixed; right: 20px; bottom: 20px; z-index: 1150; font-family: var(--body); -webkit-font-smoothing: antialiased; }
.gt-chat * { box-sizing: border-box; }
.gt-chat button { font-family: inherit; }

/* Launcher */
.gt-chat__bubble { position: relative; display: inline-flex; align-items: center; gap: 10px; height: 56px; padding: 0 20px 0 18px; border: 0; border-radius: 999px; background: var(--c-ink); color: #fff; font: 600 14.5px var(--head); letter-spacing: .1px; cursor: pointer; box-shadow: 0 12px 32px rgba(15,23,42,.28), 0 2px 6px rgba(15,23,42,.18); transition: transform .2s cubic-bezier(.2,.8,.2,1), background .2s, box-shadow .2s; }
.gt-chat__bubble:hover { background: var(--c-acc); transform: translateY(-2px); box-shadow: 0 16px 40px rgba(15,23,42,.32); }
.gt-chat__bubble svg { width: 22px; height: 22px; }
.gt-chat__badge { position: absolute; top: -5px; right: -5px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: #e0443a; color: #fff; font: 700 11.5px/22px var(--body); text-align: center; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.2); }
.gt-chat.is-open .gt-chat__bubble { display: none; }
.gt-chat__teaser { position: absolute; right: 0; bottom: 70px; width: 290px; max-width: calc(100vw - 40px); background: #fff; color: var(--c-ink); border: 1px solid var(--c-line); border-radius: 16px; padding: 14px 40px 14px 16px; font: 400 14px/1.45 var(--body); box-shadow: 0 16px 44px rgba(15,23,42,.18); cursor: pointer; opacity: 0; transform: translateY(8px); transition: opacity .25s, transform .25s; }
.gt-chat__teaser.is-in { opacity: 1; transform: none; }
.gt-chat__teaser::after { content: ""; position: absolute; right: 24px; bottom: -7px; width: 14px; height: 14px; background: #fff; border-right: 1px solid var(--c-line); border-bottom: 1px solid var(--c-line); transform: rotate(45deg); }
.gt-chat__teaser button { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border: 0; border-radius: 50%; background: var(--c-soft); color: var(--c-muted); cursor: pointer; font-size: 16px; line-height: 1; }
.gt-chat__preview { position: absolute; right: 0; bottom: 70px; width: 320px; max-width: calc(100vw - 40px); text-align: left; background: #fff; color: var(--c-ink); border: 1px solid var(--c-line); border-radius: 16px; padding: 12px 14px; box-shadow: 0 16px 44px rgba(15,23,42,.2); cursor: pointer; display: grid; gap: 3px; opacity: 0; transform: translateY(8px); transition: opacity .25s, transform .25s; }
.gt-chat__preview.is-in { opacity: 1; transform: none; }
.gt-chat__preview b { font: 600 13px var(--head); color: var(--c-acc); }
.gt-chat__preview span { font: 400 13.5px/1.45 var(--body); color: var(--c-text); }

/* Panel */
.gt-chat__panel { display: none; position: absolute; right: 0; bottom: 0; width: 390px; max-width: calc(100vw - 24px); height: 640px; max-height: calc(100vh - 40px); flex-direction: column; background: var(--c-card); color: var(--c-ink); border-radius: var(--r); box-shadow: 0 30px 80px rgba(15,23,42,.3), 0 4px 14px rgba(15,23,42,.12); overflow: hidden; transform-origin: bottom right; animation: gtChatIn .25s cubic-bezier(.2,.8,.2,1); }
.gt-chat.is-open .gt-chat__panel { display: flex; }
@keyframes gtChatIn { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: none; } }
.gt-chat__head { display: flex; align-items: center; gap: 12px; padding: 16px 14px 16px 18px; background: var(--c-ink); background: linear-gradient(135deg, var(--c-ink) 0%, color-mix(in srgb, var(--c-ink) 78%, var(--c-acc)) 100%); color: #fff; }
.gt-chat__avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--c-acc); display: flex; align-items: center; justify-content: center; font: 700 14px var(--head); flex: 0 0 auto; box-shadow: 0 0 0 2px rgba(255,255,255,.25); }
.gt-chat__avatar--img { object-fit: cover; background: #fff; }
.gt-chat__who { flex: 1 1 auto; min-width: 0; }
.gt-chat__title { font: 600 16px var(--head); line-height: 1.2; letter-spacing: -.1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gt-chat__title small { font: 400 12.5px var(--body); opacity: .75; }
.gt-chat__menu { border: 0; background: rgba(255,255,255,.14); color: #fff; width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 18px; line-height: 1; display: flex; align-items: center; justify-content: center; margin-right: 6px; transition: background .15s; }
.gt-chat__menu:hover { background: rgba(255,255,255,.26); }
.gt-chat__menubox { position: absolute; top: 64px; right: 14px; background: #fff; border: 1px solid var(--c-line); border-radius: 12px; box-shadow: 0 16px 40px rgba(15,23,42,.18); padding: 6px; display: grid; gap: 2px; min-width: 230px; z-index: 5; }
.gt-chat__menubox button { border: 0; background: transparent; text-align: left; padding: 10px 12px; border-radius: 8px; font: 500 13.5px var(--body); color: var(--c-ink); cursor: pointer; }
.gt-chat__menubox button:hover { background: var(--c-bg); }
.gt-chat__menubox button.is-danger { color: #b42318; }
.gt-chat__ended { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 16px; border-top: 1px solid var(--c-soft); background: #fff; font: 400 13.5px var(--body); color: var(--c-muted); text-align: center; }
.gt-chat__ended button { border: 0; border-radius: 10px; padding: 11px 16px; background: var(--c-acc); color: #fff; font: 600 14px var(--head); cursor: pointer; }
.gt-chat__status { display: block; font: 400 12.5px var(--body); opacity: .9; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.gt-chat__status::before { display: inline-block; vertical-align: middle; margin: -2px 6px 0 0; }
.gt-chat__status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 3px rgba(74,222,128,.25); flex: 0 0 auto; }
.gt-chat__status.is-off::before { background: #cbd5e1; box-shadow: none; }
.gt-chat__close { border: 0; background: rgba(255,255,255,.14); color: #fff; width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 20px; line-height: 1; display: flex; align-items: center; justify-content: center; transition: background .15s; }
.gt-chat__close:hover { background: rgba(255,255,255,.26); }

/* Log */
.gt-chat__log { flex: 1 1 auto; overflow-y: auto; padding: 18px 16px 10px; background: var(--c-bg); display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth; overscroll-behavior: contain; }
.gt-chat__day { align-self: center; font: 600 10.5px var(--head); letter-spacing: .6px; text-transform: uppercase; color: var(--c-muted); background: #e9edf2; border-radius: 999px; padding: 4px 10px; margin: 4px 0; }
.gt-chat__msg { max-width: 84%; display: flex; flex-direction: column; gap: 4px; animation: gtMsgIn .18s ease; }
@keyframes gtMsgIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.gt-chat__msg--visitor { align-self: flex-end; align-items: flex-end; }
.gt-chat__msg--bot, .gt-chat__msg--agent { align-self: flex-start; align-items: flex-start; }
.gt-chat__from { font: 500 11px var(--body); color: var(--c-muted); padding: 0 6px; }
.gt-chat__text { padding: 11px 14px; border-radius: 18px; font: 400 14.5px/1.5 var(--body); white-space: pre-wrap; word-wrap: break-word; }
.gt-chat__msg--visitor .gt-chat__text { background: var(--c-acc); color: #fff; border-bottom-right-radius: 6px; box-shadow: 0 2px 8px rgba(47,109,163,.25); }
.gt-chat__msg--bot .gt-chat__text { background: #fff; color: var(--c-text); border: 1px solid var(--c-line); border-bottom-left-radius: 6px; }
.gt-chat__msg--agent .gt-chat__text { background: #fff; color: var(--c-ink); border: 1px solid var(--c-line); border-left: 3px solid var(--c-acc); border-bottom-left-radius: 6px; }
.gt-chat__text a { color: var(--c-acc); text-decoration: underline; text-underline-offset: 2px; }
.gt-chat__msg--visitor .gt-chat__text a { color: #fff; }
.gt-chat__time { font: 400 10.5px var(--body); color: var(--c-muted); padding: 0 6px; }
.gt-chat__chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.gt-chat__chip { border: 1.5px solid var(--c-acc); background: #fff; color: var(--c-acc); border-radius: 999px; padding: 7px 13px; font: 600 12.5px var(--head); cursor: pointer; transition: background .15s, color .15s, transform .15s; }
.gt-chat__chip:hover { background: var(--c-acc); color: #fff; transform: translateY(-1px); }
.gt-chat__cards { display: grid; gap: 10px; width: 100%; max-width: 320px; margin-top: 2px; }
.gt-chat__card { display: block; text-decoration: none; background: #fff; border: 1px solid var(--c-line); border-radius: 14px; overflow: hidden; color: var(--c-ink); transition: box-shadow .2s, transform .2s, border-color .2s; }
.gt-chat__card:hover { border-color: var(--c-acc); box-shadow: 0 10px 28px rgba(15,23,42,.12); transform: translateY(-2px); }
.gt-chat__cardimg { display: block; width: 100%; height: 120px; object-fit: cover; }
.gt-chat__cardbody { padding: 11px 13px 12px; }
.gt-chat__card b { display: block; font: 600 14px/1.3 var(--head); margin-bottom: 3px; }
.gt-chat__card span { display: block; font: 400 12.5px/1.4 var(--body); color: var(--c-muted); }
.gt-chat__card em { display: block; margin-top: 7px; font: 600 14px var(--head); color: var(--c-acc); font-style: normal; }
.gt-chat__card em small { font: 400 11.5px var(--body); color: var(--c-muted); margin-left: 4px; }
.gt-chat__card u { display: inline-block; margin-top: 8px; font: 600 12px var(--head); color: var(--c-ink); text-decoration: none; border-bottom: 1.5px solid var(--c-ink); padding-bottom: 1px; }
.gt-chat__link { display: inline-block; margin-top: 4px; font: 600 13px var(--head); color: var(--c-acc); text-decoration: underline; }
.gt-chat__form, .gt-chat__gate { background: #fff; border: 1px solid var(--c-line); border-radius: 14px; padding: 12px; display: grid; gap: 8px; width: 100%; max-width: 320px; }
.gt-chat__gate { align-self: stretch; max-width: none; padding: 16px; margin-top: 4px; box-shadow: 0 8px 24px rgba(15,23,42,.06); }
.gt-chat__gatehead { display: grid; gap: 3px; margin-bottom: 4px; }
.gt-chat__gatehead b { font: 600 15px var(--head); color: var(--c-ink); }
.gt-chat__gatehead span { font: 400 13px/1.45 var(--body); color: var(--c-muted); }
.gt-chat__form input, .gt-chat__gate input { width: 100%; border: 1px solid var(--c-line); border-radius: 10px; padding: 11px 12px; font: 400 14px var(--body); color: var(--c-ink); background: #fff; transition: border-color .15s, box-shadow .15s; }
.gt-chat__form input:focus, .gt-chat__gate input:focus { outline: 0; border-color: var(--c-acc); box-shadow: 0 0 0 3px var(--c-acc-tint); }
.gt-chat__form .gt-chat__row { display: flex; gap: 6px; }
.gt-chat__form button, .gt-chat__gate .is-primary { border: 0; border-radius: 10px; padding: 11px 14px; font: 600 14px var(--head); cursor: pointer; }
.gt-chat__form .is-primary, .gt-chat__gate .is-primary { background: var(--c-acc); color: #fff; flex: 1; transition: filter .15s; }
.gt-chat__form .is-primary:hover, .gt-chat__gate .is-primary:hover { filter: brightness(1.08); }
.gt-chat__gate .is-primary:disabled { opacity: .6; }
.gt-chat__form .is-ghost { background: transparent; color: var(--c-muted); }
.gt-chat__err { font: 400 12.5px var(--body); color: #c0392b; }
.gt-chat__typing { align-self: flex-start; display: inline-flex; gap: 4px; padding: 12px 14px; background: #fff; border: 1px solid var(--c-line); border-radius: 18px; border-bottom-left-radius: 6px; }
.gt-chat__typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--c-muted); animation: gtDot 1s infinite; }
.gt-chat__typing i:nth-child(2) { animation-delay: .15s; } .gt-chat__typing i:nth-child(3) { animation-delay: .3s; }
@keyframes gtDot { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
.gt-chat__sys { align-self: center; font: 500 11px var(--body); color: var(--c-muted); background: #eef1f4; border-radius: 999px; padding: 3px 10px; }

/* Composer */
.gt-chat__compose { display: flex; align-items: flex-end; gap: 8px; padding: 12px 14px 10px; border-top: 1px solid var(--c-soft); background: #fff; }
.gt-chat__compose textarea { flex: 1 1 auto; resize: none; border: 1px solid var(--c-line); border-radius: 14px; padding: 11px 14px; font: 400 14.5px/1.4 var(--body); color: var(--c-ink); max-height: 120px; min-height: 44px; background: #fff; transition: border-color .15s, box-shadow .15s; }
.gt-chat__compose textarea:focus { outline: 0; border-color: var(--c-acc); box-shadow: 0 0 0 3px var(--c-acc-tint); }
.gt-chat__send { flex: 0 0 auto; width: 44px; height: 44px; border: 0; border-radius: 14px; background: var(--c-acc); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: filter .15s, transform .15s; }
.gt-chat__send:hover { filter: brightness(1.08); transform: translateY(-1px); }
.gt-chat__send:disabled { opacity: .5; cursor: default; transform: none; }
.gt-chat__send svg { width: 18px; height: 18px; }
.gt-chat__foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; font: 400 10.5px var(--body); color: var(--c-muted); padding: 0 16px 10px; background: #fff; }
.gt-chat__mail { color: var(--c-acc); text-decoration: none; font-weight: 600; }
.gt-chat__mail:hover { text-decoration: underline; }

@media (max-width: 820px) {
  .gt-chat { right: 14px; bottom: 16px; }
  .gt-chat--tour { bottom: 78px; }
  .gt-chat__bubble span { display: none; }
  .gt-chat__bubble { width: 56px; padding: 0; justify-content: center; }
  .gt-chat__teaser, .gt-chat__preview { right: 0; }
  .gt-chat.is-open { inset: 0; right: 0; bottom: 0; }
  /* Full-screen sheet that follows the on-screen keyboard: height comes from the visual viewport (set by JS as
     --gt-vvh / --gt-vvt), with 100dvh / 100% as fallbacks, so the compose bar always sits right above the keyboard
     and the page behind never scrolls. */
  .gt-chat__panel { position: fixed; top: var(--gt-vvt, 0px); left: 0; right: 0; bottom: auto; width: 100%; max-width: none; height: 100vh; height: 100dvh; height: var(--gt-vvh, 100dvh); max-height: none; border-radius: 0; animation: none; overscroll-behavior: contain; }
  .gt-chat__head { padding-top: calc(12px + env(safe-area-inset-top)); flex: 0 0 auto; }
  .gt-chat__log { -webkit-overflow-scrolling: touch; }
  .gt-chat__compose { padding-bottom: calc(10px + env(safe-area-inset-bottom)); flex: 0 0 auto; }
  .gt-chat__foot { display: none; }
  .gt-chat__msg { max-width: 88%; }
  /* 16px minimum: iOS Safari zooms the page when a focused field has smaller text, which breaks the layout. */
  .gt-chat__compose textarea, .gt-chat__form input, .gt-chat__gate input { font-size: 16px; }
  .gt-chat__compose textarea { max-height: 96px; }
}
/* While the sheet is open on a phone the page behind is frozen (no rubber-band scrolling under the chat). */
@media (max-width: 820px) {
  html.gt-chat-open, html.gt-chat-open body { overflow: hidden !important; height: 100%; overscroll-behavior: none; }
  html.gt-chat-open body { position: fixed; width: 100%; top: calc(-1 * var(--gt-scroll-y, 0px)); }
}
@media (prefers-reduced-motion: reduce) { .gt-chat *, .gt-chat *::before { animation: none !important; transition: none !important; } }

/* Files */
.gt-chat__attach { flex: 0 0 auto; width: 40px; height: 44px; border: 0; border-radius: 12px; background: transparent; color: var(--c-muted); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.gt-chat__attach:hover { background: var(--c-bg); color: var(--c-acc); }
.gt-chat__attach:disabled { opacity: .4; cursor: default; }
.gt-chat__attach svg { width: 20px; height: 20px; }
.gt-chat__file { display: inline-flex; align-items: center; gap: 10px; max-width: 100%; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--c-line); background: #fff; color: var(--c-ink); text-decoration: none; font: 500 13.5px/1.3 var(--body); }
.gt-chat__file b { flex: 0 0 auto; padding: 4px 6px; border-radius: 6px; background: #e0443a; color: #fff; font: 700 10px/1 var(--head); letter-spacing: .4px; }
.gt-chat__file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gt-chat__file--img { padding: 0; border-radius: 14px; overflow: hidden; }
.gt-chat__file--img img { display: block; max-width: 220px; max-height: 220px; width: auto; height: auto; }

/* Operator photo next to their messages */
.gt-chat__from--photo { display: flex; align-items: center; gap: 6px; }
.gt-chat__from--photo img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }

/* Buttons: true circles that never squeeze (1.40) */
.gt-chat .gt-chat__menu, .gt-chat .gt-chat__close { flex: 0 0 36px; width: 36px; height: 36px; min-width: 36px; min-height: 36px; padding: 0; margin: 0; border-radius: 50%; box-sizing: border-box; line-height: 0; font-size: 0; -webkit-appearance: none; appearance: none; }
.gt-chat .gt-chat__menu { margin-right: 6px; }
.gt-chat .gt-chat__menu svg, .gt-chat .gt-chat__close svg { width: 18px; height: 18px; display: block; flex: 0 0 auto; }
.gt-chat .gt-chat__send { flex: 0 0 44px; width: 44px; height: 44px; min-width: 44px; padding: 0; border-radius: 50%; box-sizing: border-box; -webkit-appearance: none; appearance: none; }
.gt-chat .gt-chat__attach { flex: 0 0 40px; width: 40px; height: 40px; min-width: 40px; padding: 0; border-radius: 50%; align-self: flex-end; margin-bottom: 2px; box-sizing: border-box; -webkit-appearance: none; appearance: none; }
.gt-chat .gt-chat__teaser button { width: 26px; height: 26px; min-width: 26px; padding: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center; line-height: 1; box-sizing: border-box; -webkit-appearance: none; appearance: none; }
.gt-chat .gt-chat__avatar { flex: 0 0 42px; min-width: 42px; }
