/* CARE-001 · support UI is isolated so a chat outage or style failure cannot affect checkout. */
.lt-support-widget,
.lt-support-page {
  --lt-support-ink: var(--ink, #0d1b2a);
  --lt-support-sky: var(--sky, #f3f7fb);
  --lt-support-paper: var(--paper, #fff);
  --lt-support-line: var(--line, #dbe4ef);
  --lt-support-muted: var(--muted, #54677d);
  --lt-support-signal: var(--signal, #0cb56b);
  --lt-support-signal-dark: var(--signal-dark, #078f53);
  --lt-support-danger: var(--danger, #b03a2e);
  color: var(--lt-support-ink);
  font-family: "Onest", system-ui, -apple-system, sans-serif;
}

.lt-support-widget *,
.lt-support-page * { box-sizing: border-box; }
.lt-support-widget button,
.lt-support-widget textarea,
.lt-support-page button,
.lt-support-page textarea { font: inherit; }

.lt-support-widget {
  position: fixed;
  z-index: 10020;
  inset-inline-end: 22px;
  bottom: max(22px, env(safe-area-inset-bottom, 0px));
  width: min(390px, calc(100vw - 28px));
  pointer-events: none;
}

.lt-support-launcher {
  pointer-events: auto;
  width: max-content;
  max-width: 100%;
  min-height: 62px;
  margin-inline-start: auto;
  display: flex;
  align-items: center;
  gap: 11px;
  border: 1px solid rgba(13, 27, 42, .12);
  border-radius: 18px;
  padding: 8px 13px 8px 9px;
  background: var(--lt-support-paper);
  color: var(--lt-support-ink);
  box-shadow: 0 14px 42px rgba(13, 27, 42, .2);
  cursor: pointer;
  text-align: start;
  transition: transform .16s ease, box-shadow .16s ease;
}
.lt-support-launcher:hover { transform: translateY(-2px); box-shadow: 0 18px 48px rgba(13, 27, 42, .24); }
.lt-support-launcher:focus-visible,
.lt-support-close:focus-visible,
.lt-support-send:focus-visible,
.lt-support-retry:focus-visible {
  outline: 3px solid rgba(12, 181, 107, .32);
  outline-offset: 2px;
}

.lt-support-avatar {
  position: relative;
  width: 46px;
  height: 46px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #15c77a, #057a48);
  color: #fff;
  font: 600 17px "Unbounded", system-ui, sans-serif;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.24);
}
.lt-support-avatar.has-photo {
  background-color: #d9e2e8;
  background-position: center;
  background-size: cover;
  color: transparent;
}
.lt-support-presence {
  position: absolute;
  inset-inline-end: 0;
  bottom: 1px;
  width: 12px;
  height: 12px;
  border: 2px solid var(--lt-support-paper);
  border-radius: 50%;
  background: #39d98a;
}
.lt-support-avatar.is-offline .lt-support-presence { background: #91a0af; }

.lt-support-launch-copy { min-width: 0; display: grid; gap: 2px; }
.lt-support-launch-copy strong {
  max-width: 230px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  line-height: 1.25;
}
.lt-support-launch-copy span,
.lt-support-identity span {
  color: var(--lt-support-signal-dark);
  font: 700 10px/1.3 "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: .03em;
}
.lt-support-badge {
  min-width: 21px;
  height: 21px;
  display: grid;
  place-items: center;
  border: 2px solid var(--lt-support-paper);
  border-radius: 999px;
  padding: 0 5px;
  background: #d94436;
  color: #fff;
  font: 700 10px/1 "JetBrains Mono", ui-monospace, monospace;
}
.lt-support-badge[hidden],
.lt-support-launcher[hidden],
.lt-support-panel[hidden] { display: none; }

.lt-support-panel {
  pointer-events: auto;
  width: 100%;
  height: min(620px, calc(100dvh - 44px));
  overflow: hidden;
  border: 1px solid rgba(13, 27, 42, .13);
  border-radius: 22px;
  background: var(--lt-support-paper);
  box-shadow: 0 22px 70px rgba(13, 27, 42, .26);
}

.lt-support-chat { height: 100%; min-height: 0; display: flex; flex-direction: column; background: var(--lt-support-sky); }
.lt-support-head {
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--lt-support-line);
  background: var(--lt-support-paper);
}
.lt-support-identity { min-width: 0; display: grid; gap: 4px; }
.lt-support-identity strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  line-height: 1.25;
}
.lt-support-close {
  width: 38px;
  height: 38px;
  margin-inline-start: auto;
  border: 1px solid var(--lt-support-line);
  border-radius: 11px;
  background: var(--lt-support-paper);
  color: var(--lt-support-muted);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.lt-support-close:hover { border-color: var(--lt-support-ink); color: var(--lt-support-ink); }

.lt-support-connection {
  padding: 8px 14px;
  border-bottom: 1px solid #f0d5cf;
  background: #fff5f2;
  color: var(--lt-support-danger);
  font-size: 11px;
  line-height: 1.4;
}
.lt-support-connection[hidden] { display: none; }

.lt-support-messages {
  flex: 1;
  min-height: 160px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 17px 14px;
  scrollbar-width: thin;
  scrollbar-color: #c8d2dd transparent;
}
.lt-support-message-row { display: flex; margin-bottom: 10px; }
.lt-support-message-row.is-user { justify-content: flex-end; }
.lt-support-message-row.is-support { justify-content: flex-start; }
.lt-support-message {
  width: fit-content;
  max-width: 83%;
  border: 1px solid var(--lt-support-line);
  border-radius: 17px 17px 17px 5px;
  padding: 10px 12px 8px;
  background: var(--lt-support-paper);
  box-shadow: 0 2px 8px rgba(13, 27, 42, .04);
}
[dir="rtl"] .lt-support-message { border-radius: 17px 17px 5px 17px; }
.lt-support-message-row.is-user .lt-support-message {
  border-color: var(--lt-support-signal-dark);
  border-radius: 17px 17px 5px 17px;
  background: var(--lt-support-signal-dark);
  color: #fff;
}
[dir="rtl"] .lt-support-message-row.is-user .lt-support-message { border-radius: 17px 17px 17px 5px; }
.lt-support-message p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.45; }
.lt-support-message time {
  display: block;
  margin-top: 5px;
  color: var(--lt-support-muted);
  font: 500 9px/1 "JetBrains Mono", ui-monospace, monospace;
  text-align: end;
}
.lt-support-message-row.is-user time { color: rgba(255,255,255,.72); }

.lt-support-typing {
  width: fit-content;
  max-width: 83%;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--lt-support-line);
  border-radius: 17px 17px 17px 5px;
  padding: 10px 12px;
  background: var(--lt-support-paper);
}
.lt-support-typing-dots { display: flex; gap: 4px; flex: none; }
.lt-support-typing i { width: 5px; height: 5px; border-radius: 50%; background: #7c8ea1; animation: lt-support-bounce 1s infinite ease-in-out; }
.lt-support-typing i:nth-child(2) { animation-delay: .12s; }
.lt-support-typing i:nth-child(3) { animation-delay: .24s; }
.lt-support-typing-label { color: var(--lt-support-muted); font-size: 12px; line-height: 1.35; }
@keyframes lt-support-bounce { 0%, 55%, 100% { transform: translateY(0); opacity: .55; } 28% { transform: translateY(-3px); opacity: 1; } }

.lt-support-empty {
  min-height: 100%;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 12px;
  padding: 28px;
  color: var(--lt-support-muted);
  text-align: center;
  font-size: 13px;
  line-height: 1.5;
}
.lt-support-empty strong { color: var(--lt-support-ink); font-size: 13px; }
.lt-support-loader {
  width: 24px;
  height: 24px;
  border: 2px solid var(--lt-support-line);
  border-top-color: var(--lt-support-signal);
  border-radius: 50%;
  animation: lt-support-spin .8s linear infinite;
}
@keyframes lt-support-spin { to { transform: rotate(360deg); } }
.lt-support-retry {
  border: 1px solid #bde7d2;
  border-radius: 9px;
  padding: 8px 11px;
  background: #eaf8f1;
  color: var(--lt-support-signal-dark);
  font-weight: 700;
  cursor: pointer;
}

.lt-support-guest {
  margin: 0;
  padding: 7px 14px 0;
  background: var(--lt-support-paper);
  color: var(--lt-support-muted);
  font-size: 10px;
  line-height: 1.4;
  text-align: center;
}
.lt-support-composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 9px 11px max(11px, env(safe-area-inset-bottom, 0px));
  background: var(--lt-support-paper);
}
.lt-support-input {
  flex: 1;
  min-width: 0;
  min-height: 42px;
  max-height: 118px;
  resize: none;
  overflow-y: auto;
  border: 1px solid var(--lt-support-line);
  border-radius: 17px;
  padding: 10px 13px;
  background: var(--lt-support-sky);
  color: var(--lt-support-ink);
  font-size: 14px;
  line-height: 1.45;
}
.lt-support-input:focus { outline: 0; border-color: var(--lt-support-signal); box-shadow: 0 0 0 3px rgba(12,181,107,.13); }
.lt-support-input::placeholder { color: #728398; }
.lt-support-send {
  width: 42px;
  height: 42px;
  flex: none;
  border: 0;
  border-radius: 50%;
  background: var(--lt-support-signal-dark);
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
}
.lt-support-send:disabled { background: #b7c1cc; cursor: default; }
.lt-support-send.is-sending { color: transparent; position: relative; }
.lt-support-send.is-sending::after {
  content: "";
  position: absolute;
  inset: 12px;
  border: 2px solid rgba(255,255,255,.48);
  border-top-color: #fff;
  border-radius: 50%;
  animation: lt-support-spin .8s linear infinite;
}
.lt-support-send-error {
  margin: 0;
  padding: 0 14px 10px;
  background: var(--lt-support-paper);
  color: var(--lt-support-danger);
  font-size: 10px;
  line-height: 1.4;
}
.lt-support-send-error[hidden] { display: none; }

/* Full support page — same morning-terminal system as the storefront. */
body.support-page { min-height: 100vh; margin: 0; background: var(--sky, #f3f7fb); color: var(--ink, #0d1b2a); }
.support-page .support-main { padding: 72px 0 88px; }
.support-page .support-layout { display: grid; grid-template-columns: minmax(0, .9fr) minmax(360px, 1.1fr); gap: 58px; align-items: start; }
.support-page .support-copy { padding-top: 34px; }
.support-page .support-eyebrow { margin: 0 0 18px; color: var(--signal-dark); font: 700 11px/1.3 var(--font-mono, "JetBrains Mono", monospace); letter-spacing: .12em; }
.support-page .support-copy h1 { max-width: 720px; margin: 0; font: 600 clamp(32px, 4.5vw, 54px)/1.08 var(--font-display, "Unbounded", sans-serif); letter-spacing: -.035em; }
.support-page .support-lead { max-width: 610px; margin: 22px 0 0; color: var(--muted); font-size: 18px; line-height: 1.55; }
.support-page .support-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.support-page .support-trust { display: grid; gap: 12px; margin: 36px 0 0; padding: 0; list-style: none; }
.support-page .support-trust li { display: flex; gap: 10px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.support-page .support-trust li::before { content: ""; width: 8px; height: 8px; flex: none; margin-top: 6px; border-radius: 50%; background: var(--signal); }
.support-page .lt-support-page {
  height: min(680px, calc(100dvh - 150px));
  min-height: 560px;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(13,27,42,.13);
  border-radius: 24px;
  background: var(--paper);
  box-shadow: 0 24px 70px rgba(13,27,42,.14);
}
.support-page main .lt-support-chat { padding: 0; }
.support-page .support-fallback {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  margin-top: 28px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--paper);
}
.support-page .support-fallback h2 { margin: 0 0 6px; font-size: 16px; }
.support-page .support-fallback p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.support-page .support-fallback a { color: var(--signal-dark); font-weight: 700; white-space: nowrap; }
.support-page .support-note { margin-top: 18px; color: var(--muted); font-size: 12px; line-height: 1.55; }

@media (prefers-reduced-motion: reduce) {
  .lt-support-launcher,
  .lt-support-loader,
  .lt-support-typing i,
  .lt-support-send.is-sending::after { animation: none; transition: none; }
}

.lt-support-unread-divider { text-align: center; margin-block: 12px; color: var(--muted, #62748b); font-size: 12px; }
.lt-support-jump { align-self: center; margin: 6px; padding: 9px 16px; border-radius: 22px; border: 1px solid var(--line, #dbe5ef); background: var(--paper, white); color: var(--signal-dark, #078b55); cursor: pointer; }
.lt-support-suggestions { display: flex; flex-wrap: wrap; gap: 6px; padding-inline: 14px; }
.lt-support-suggestions:empty { display: none; }
.lt-support-suggestion { border: 1px solid var(--line, #dbe5ef); border-radius: 16px; background: var(--paper, white); color: var(--ink, #0d1b2a); padding: 9px 12px; font: inherit; font-size: 12px; cursor: pointer; }
.lt-support-suggestion:focus-visible, .lt-support-jump:focus-visible { outline: 2px solid var(--signal, #00ba78); outline-offset: 2px; }
.lt-support-jump[hidden] { display: none; }

@media (max-width: 820px) {
  .support-page .support-main { padding: 46px 0 64px; }
  .support-page .support-layout { grid-template-columns: 1fr; gap: 30px; }
  .support-page .support-copy { padding-top: 0; }
  .support-page .support-copy h1 { font-size: clamp(30px, 8.5vw, 46px); }
  .support-page .lt-support-page { height: min(680px, 78dvh); min-height: 540px; }
}

@media (max-width: 640px) {
  .lt-support-widget { inset: auto 0 0; width: 100%; }
  .lt-support-launcher { margin: 0 12px max(12px, env(safe-area-inset-bottom, 0px)) auto; }
  [dir="rtl"] .lt-support-launcher { margin-right: 12px; margin-left: auto; }
  .lt-support-panel { width: 100%; height: 100dvh; border: 0; border-radius: 0; }
  .lt-support-head { padding-top: max(12px, env(safe-area-inset-top, 0px)); }
  .support-page .support-main { padding: 34px 0 52px; }
  .support-page .support-lead { font-size: 16px; }
  .support-page .support-actions { display: grid; }
  .support-page .support-actions .btn { justify-content: center; }
  .support-page .lt-support-page { width: calc(100% + 24px); height: 74dvh; min-height: 520px; margin-inline: -12px; border-inline: 0; border-radius: 20px; }
  .support-page .support-fallback { grid-template-columns: 1fr; gap: 12px; padding: 18px; }
}
