/* The chat launcher and panel. To change the colours, edit the first block below. */

:root {
  /* The same colours as the website (styles.css). */
  --chat-navy: #0a2540;
  --chat-brand: #0a66c2;
  --chat-brand-deep: #084f97;
  --chat-teal: #00a79d;
  --chat-tint: #edf4fb;
  --chat-tint-2: #dbe9f7;
  --chat-grey: #f1f4f8;
  --chat-ink: #10243a;
  --chat-ink-2: #4d6176;
  --chat-line: #dfe6ee;
  --chat-good: #00796f;
  --chat-bad: #c5312a;
  --chat-font: Inter, "Segoe UI", system-ui, sans-serif;
}

/* ---- the logo mark ---- */
.chat-mark { position: relative; display: grid; flex: none; place-items: center; width: 50px; height: 50px; color: var(--chat-navy); background: #fff; border-radius: 15px; box-shadow: 0 6px 18px rgba(6, 26, 48, 0.3); }
.chat-mark svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }
.chat-online { position: absolute; right: -3px; bottom: -3px; width: 14px; height: 14px; background: var(--chat-teal); border: 2.5px solid #fff; border-radius: 50%; }

/* ---- launcher ---- */
.chat-launcher { position: fixed; right: 24px; bottom: 24px; z-index: 50; display: flex; align-items: center; gap: 12px; height: 62px; padding: 0 24px 0 8px; color: #fff; background: linear-gradient(135deg, var(--chat-brand), var(--chat-brand-deep)); border: 0; border-radius: 31px; box-shadow: 0 14px 34px rgba(10, 102, 194, 0.45), 0 3px 8px rgba(6, 26, 48, 0.25); font: 600 15.5px var(--chat-font); cursor: pointer; transition: transform 0.18s, box-shadow 0.18s; }
.chat-launcher:hover { transform: translateY(-2px); box-shadow: 0 18px 42px rgba(10, 102, 194, 0.55), 0 3px 8px rgba(6, 26, 48, 0.25); }
.chat-launcher .chat-mark { width: 46px; height: 46px; border-radius: 50%; box-shadow: none; }
.chat-launcher .chat-mark svg { width: 30px; height: 30px; }
.chat-launcher .chat-online { right: 0; bottom: 0; }
@media (prefers-reduced-motion: reduce) { .chat-launcher { transition: none; } .chat-launcher:hover { transform: none; } }

/* ---- panel ---- */
.chat-panel { position: fixed; right: 24px; bottom: 24px; z-index: 60; display: flex; flex-direction: column; width: 420px; height: min(720px, calc(100vh - 48px)); height: min(720px, calc(100dvh - 48px)); overflow: hidden; color: var(--chat-ink); background: #fff; border-radius: 20px; box-shadow: 0 30px 80px rgba(6, 26, 48, 0.38), 0 0 0 1px rgba(6, 26, 48, 0.06); font: 400 14.5px/1.55 var(--chat-font); }
.chat-panel svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.chat-head { position: relative; display: flex; flex: none; flex-direction: column; align-items: center; padding: 20px 20px 22px; overflow: hidden; color: #fff; text-align: center; background: linear-gradient(155deg, #061a30 0%, var(--chat-navy) 45%, var(--chat-brand-deep) 100%); }
/* Soft shapes that give the header depth. */
.chat-head::before, .chat-head::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.chat-head::before { top: -70px; right: -50px; width: 190px; height: 190px; background: rgba(255, 255, 255, 0.1); }
.chat-head::after { bottom: -80px; left: -40px; width: 170px; height: 170px; background: rgba(255, 255, 255, 0.07); }
.chat-head > * { position: relative; z-index: 1; }
.chat-head h2 { margin-top: 12px; font-size: 23px; font-weight: 600; line-height: 1.2; letter-spacing: -0.02em; }
.chat-status { margin-top: 4px; color: rgba(255, 255, 255, 0.9); font-size: 13px; line-height: 1.35; }
.chat-icon-button { position: absolute; top: 10px; right: 10px; display: grid; place-items: center; width: 34px; height: 34px; color: inherit; background: transparent; border: 0; border-radius: 10px; cursor: pointer; }
.chat-icon-button:hover { background: rgba(255, 255, 255, 0.18); }
.chat-icon-button svg { width: 19px; height: 19px; stroke-width: 2; }
.chat-clear { position: absolute; top: 12px; left: 12px; display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 10px; color: inherit; background: rgba(255, 255, 255, 0.18); border: 0; border-radius: 9px; font: 500 12.5px var(--chat-font); cursor: pointer; }
.chat-clear:hover { background: rgba(255, 255, 255, 0.3); }
.chat-clear svg { width: 15px; height: 15px; }

.chat-tools { display: flex; flex: none; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px; background: var(--chat-tint); border-bottom: 1px solid var(--chat-tint-2); font-size: 13.5px; font-weight: 500; }
.chat-tools span { flex: 1 1 100%; }
.chat-tools button { height: 34px; padding: 0 14px; border-radius: 9px; font: 600 13px var(--chat-font); cursor: pointer; }
.chat-confirm-yes { color: #fff; background: var(--chat-bad); border: 1px solid var(--chat-bad); }
.chat-confirm-no { color: var(--chat-ink); background: #fff; border: 1px solid #cfd9e4; }

.chat-test-note { flex: none; padding: 6px 16px; color: #6b4e00; background: #fdf3d4; font-size: 12px; text-align: center; }
.chat-log { display: flex; flex: 1; flex-direction: column; gap: 10px; min-height: 0; padding: 16px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #c3cfdb transparent; }

/* ---- menu ---- */
.chat-menu { display: grid; flex: none; gap: 14px; }
.chat-section { display: grid; gap: 7px; }
.chat-section h4 { color: var(--chat-ink); font-size: 13px; font-weight: 600; letter-spacing: -0.005em; }
.chat-cards { display: grid; gap: 8px; }
.chat-section-tiles .chat-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.chat-card { display: flex; align-items: center; gap: 12px; width: 100%; min-width: 0; color: var(--chat-ink); background: #fff; border: 1px solid var(--chat-line); border-radius: 14px; font: inherit; text-align: left; cursor: pointer; transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s; }
.chat-card:hover { border-color: var(--chat-brand); box-shadow: 0 8px 22px rgba(10, 102, 194, 0.16); transform: translateY(-1px); }
.chat-card-icon { display: grid; flex: none; place-items: center; width: 38px; height: 38px; color: var(--chat-brand); background: var(--chat-tint); border-radius: 11px; }
.chat-card-icon svg { width: 21px; height: 21px; }
.chat-card-text { flex: 1; min-width: 0; }
.chat-card-text strong { display: block; font-size: 14px; font-weight: 600; line-height: 1.3; }
.chat-card-text small { display: block; margin-top: 1px; color: var(--chat-ink-2); font-size: 12.5px; line-height: 1.35; }
.chat-card-arrow { display: grid; flex: none; color: #94a3b3; }
.chat-card-arrow svg { width: 17px; height: 17px; }
.chat-card:hover .chat-card-arrow { color: var(--chat-brand); }
.chat-card-feature { padding: 13px 12px 13px 14px; color: #fff; background: linear-gradient(120deg, var(--chat-navy), var(--chat-brand)); border-color: transparent; box-shadow: 0 8px 20px rgba(10, 102, 194, 0.26); }
.chat-card-feature:hover { border-color: transparent; box-shadow: 0 12px 26px rgba(10, 102, 194, 0.36); }
.chat-card-feature .chat-card-icon { color: #fff; background: rgba(255, 255, 255, 0.2); }
.chat-card-feature .chat-card-text small { color: rgba(255, 255, 255, 0.9); }
.chat-card-feature .chat-card-arrow, .chat-card-feature:hover .chat-card-arrow { color: #fff; }
.chat-card-tiles { flex-direction: column; gap: 7px; padding: 12px 6px 11px; text-align: center; }
.chat-card-tiles strong { font-size: 12.5px; }
.chat-card-rows { padding: 8px 10px 8px 10px; }
@media (prefers-reduced-motion: reduce) { .chat-card { transition: none; } .chat-card:hover { transform: none; } }

/* ---- messages ---- */
.chat-msg { padding: 11px 14px; overflow-wrap: anywhere; white-space: pre-wrap; font-size: 14px; line-height: 1.55; }
.chat-msg a { color: inherit; font-weight: 500; }
.chat-msg-me { align-self: flex-end; max-width: 84%; color: #fff; background: var(--chat-brand); border-radius: 14px 4px 14px 14px; }
.chat-row { display: flex; align-items: center; gap: 9px; align-self: flex-start; max-width: 94%; }
.chat-msg-them { min-width: 0; color: var(--chat-ink); background: var(--chat-grey); border-radius: 12px; }
.chat-avatar { display: grid; flex: none; place-items: center; width: 34px; height: 34px; color: #fff; background: var(--chat-navy); border-radius: 11px; }
.chat-avatar svg { width: 23px; height: 23px; stroke-width: 2.2; }
.chat-avatar-human { background: var(--chat-brand); }
.chat-from { align-self: flex-start; margin: 6px 0 -5px 43px; color: var(--chat-ink-2); font-size: 12px; font-weight: 500; }
.chat-notice { align-self: center; max-width: 94%; padding: 3px 8px; color: var(--chat-ink-2); font-size: 12.5px; text-align: center; }
.chat-notice-error { color: var(--chat-bad); }
.chat-typing { display: inline-flex; gap: 5px; padding: 14px; background: var(--chat-grey); border-radius: 12px; }
.chat-typing i { width: 7px; height: 7px; background: var(--chat-brand); border-radius: 50%; animation: chat-typing 1.2s infinite; }
.chat-typing i:nth-child(2) { animation-delay: 0.16s; }
.chat-typing i:nth-child(3) { animation-delay: 0.32s; }
@keyframes chat-typing { 0%, 60%, 100% { opacity: 0.25; } 30% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .chat-typing i { animation: none; opacity: 0.6; } }

/* ---- photo upload ---- */
.chat-upload { display: grid; flex: none; gap: 10px; margin-left: 43px; padding: 13px; background: #fff; border: 1px solid var(--chat-line); border-radius: 14px; box-shadow: 0 6px 18px rgba(6, 26, 48, 0.07); }
.chat-upload-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.chat-upload-top strong { font-size: 13.5px; font-weight: 600; }
.chat-upload-secure { display: inline-flex; flex: none; align-items: center; gap: 4px; color: var(--chat-good); font-size: 12px; font-weight: 500; }
.chat-upload-secure svg { width: 13px; height: 13px; stroke-width: 2.2; }
.chat-upload-drop { display: grid; justify-items: center; gap: 5px; padding: 15px 12px 12px; text-align: center; background: var(--chat-tint); border: 1.5px dashed #a9c7e6; border-radius: 12px; transition: border-color 0.15s, background 0.15s; }
.chat-upload-over { background: var(--chat-tint-2); border-color: var(--chat-brand); }
.chat-upload-badge { display: grid; place-items: center; width: 38px; height: 38px; color: #fff; background: var(--chat-brand); border-radius: 11px; }
.chat-upload-badge svg { width: 20px; height: 20px; stroke-width: 2; }
.chat-upload-hint { color: var(--chat-ink-2); font-size: 12.5px; }
.chat-upload-button { height: 38px; padding: 0 20px; color: #fff; background: var(--chat-brand); border: 0; border-radius: 10px; font: 600 13.5px var(--chat-font); cursor: pointer; }
.chat-upload-button:hover { background: var(--chat-brand-deep); }
.chat-upload-drop small { color: var(--chat-ink-2); font-size: 11.5px; }
.chat-upload-result { display: flex; align-items: center; gap: 11px; }
.chat-upload-thumb { flex: none; width: 56px; height: 56px; object-fit: cover; background: var(--chat-grey); border-radius: 10px; }
.chat-upload-details { flex: 1; min-width: 0; }
.chat-upload-name { display: block; overflow: hidden; font-size: 13px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.chat-upload-status { color: var(--chat-ink-2); font-size: 12.5px; line-height: 1.35; }
.chat-upload-bar { height: 6px; margin-top: 6px; overflow: hidden; background: var(--chat-tint-2); border-radius: 3px; }
.chat-upload-bar i { display: block; height: 100%; background: var(--chat-brand); border-radius: 3px; transition: width 0.15s; }
.chat-upload[data-state="uploaded"] { border-color: #a9dccb; box-shadow: none; }
.chat-upload[data-state="uploaded"] .chat-upload-status { color: var(--chat-good); font-weight: 500; }
.chat-upload[data-state="failed"] .chat-upload-status { color: var(--chat-bad); font-weight: 500; }
.chat-upload[data-state="failed"] .chat-upload-drop { background: #fdf4f3; border-color: #eab6b2; }
.chat-upload[data-state="failed"] .chat-upload-badge { background: var(--chat-bad); }

/* ---- composer ---- */
.chat-composer { display: flex; flex: none; align-items: flex-end; gap: 8px; margin: 0 12px; padding: 6px 6px 6px 14px; background: #fff; border: 1.5px solid #cfd9e4; border-radius: 16px; transition: border-color 0.15s, box-shadow 0.15s; }
.chat-composer:focus-within { border-color: var(--chat-brand); box-shadow: 0 0 0 3px rgba(10, 102, 194, 0.14); }
.chat-composer textarea { flex: 1; min-width: 0; max-height: 110px; padding: 7px 0; color: var(--chat-ink); background: transparent; border: 0; outline: 0; font: 400 15px/1.4 var(--chat-font); resize: none; }
.chat-composer textarea::placeholder { color: #5f7286; }
.chat-send { display: grid; flex: none; place-items: center; width: 38px; height: 38px; color: #fff; background: var(--chat-brand); border: 0; border-radius: 11px; cursor: pointer; }
.chat-send:hover:not(:disabled) { background: var(--chat-brand-deep); }
.chat-send:disabled { cursor: default; opacity: 0.4; }
.chat-send svg { width: 18px; height: 18px; stroke-width: 2; }
.chat-ended { display: flex; flex: none; flex-direction: column; gap: 9px; padding: 12px 16px 4px; color: var(--chat-ink-2); font-size: 13px; text-align: center; border-top: 1px solid var(--chat-line); }
.chat-ended .button { height: 44px; color: #fff; background: var(--chat-brand); border: 0; border-radius: 12px; font: 600 14px var(--chat-font); cursor: pointer; }
.chat-ended .button:hover { background: var(--chat-brand-deep); }
.chat-foot { flex: none; padding: 8px 14px 10px; color: var(--chat-ink-2); font-size: 11px; line-height: 1.35; text-align: center; }

/* Shorter windows and zoomed screens: the whole menu still has to fit without scrolling. */
@media (max-height: 800px) {
  .chat-head { padding: 12px 20px 14px; }
  .chat-head .chat-mark { width: 40px; height: 40px; border-radius: 12px; }
  .chat-head .chat-mark svg { width: 27px; height: 27px; }
  .chat-head h2 { margin-top: 8px; font-size: 20px; }
  .chat-status { margin-top: 2px; font-size: 12.5px; }
  .chat-log { padding: 12px 16px; }
  .chat-menu { gap: 10px; }
  .chat-section { gap: 5px; }
  .chat-card-feature { padding: 10px 12px; }
  .chat-card-tiles { padding: 9px 6px 8px; gap: 5px; }
  .chat-card-rows { padding: 6px 10px; }
  .chat-card-icon { width: 34px; height: 34px; }
  .chat-foot { padding: 6px 14px 8px; }
}
@media (max-height: 680px) {
  .chat-head .chat-mark, .chat-status { display: none; }
  .chat-head { padding: 12px 52px; }
  .chat-head h2 { margin-top: 0; font-size: 18px; }
  .chat-clear span { display: none; }
  .chat-card-text small { display: none; }
}

@media (max-width: 520px) {
  .chat-launcher { right: 16px; bottom: 16px; justify-content: center; width: 62px; padding: 0; }
  .chat-launcher-text { display: none; }
  .chat-panel { inset: 0; width: 100%; height: 100%; height: 100dvh; border-radius: 0; }
}
