/* Contact support (support.js, built from account/support-browser.mjs). Every page that loads
   it is a dark KC-X page (body.kx-site). 2026-10-18 redesign (user: it looked plain next to
   mainstream apps): a round chat button at the end of the header, beside "Download for
   Mac", whose label shows as a tooltip; a messenger-style panel that drops down under the
   header on desktop and slides up as a bottom sheet on phones. The floating button that
   support.js also adds stays hidden: the sticky header always offers support. */
body.kx-site .kc-support-nav {
  order: 2; position: relative; flex: none;
  display: inline-grid; place-items: center; width: 40px; height: 40px; min-height: 40px; padding: 0;
  border: 0; border-radius: 50%; background: rgb(255 255 255 / 8%); color: #fff;
  cursor: pointer; transition: background-color 0.15s ease;
}
body.kx-site .kc-support-nav:hover, body.kx-site .kc-support-nav[aria-expanded="true"] { background: rgb(255 255 255 / 16%); }
body.kx-site .kc-support-nav svg { width: 20px; height: 20px; }
/* The label: read by screen readers, shown as a tooltip on hover or keyboard focus. */
body.kx-site .kc-support-nav span {
  position: absolute; top: calc(100% + 10px); left: 50%; z-index: 2; transform: translateX(-50%);
  padding: 6px 10px; border-radius: 8px; background: #f5f5f7; color: #111118;
  font-size: 12px; font-weight: 650; line-height: 1.3; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity 0.15s ease;
}
body.kx-site .kc-support-nav:hover span, body.kx-site .kc-support-nav:focus-visible span { opacity: 1; }
body.kx-site .kc-support-nav[aria-expanded="true"] span { opacity: 0; }
body.kx-site .nav-cta { order: 3; }
body.kx-site .mobile-nav { order: 4; }
body.kx-site .kc-support-floating { display: none; }
body.kx-site:has(.kc-support-floating) { padding-bottom: 0; }
@media (max-width: 1000px) {
  body.kx-site .kc-support-nav { margin-inline-start: auto; }
}

/* The panel. */
.kc-support-panel {
  position: fixed; inset: 82px max(24px, calc((100vw - 1120px) / 2)) auto auto; margin: 0; padding: 0;
  box-sizing: border-box; width: 392px; max-width: calc(100vw - 32px); max-height: calc(100dvh - 100px);
  overflow: auto; overscroll-behavior: contain;
  border: 1px solid rgb(255 255 255 / 10%); border-radius: 20px; background: #15151d; color: #f5f5f7;
  box-shadow: 0 30px 80px rgb(0 0 0 / 55%); font-family: inherit; color-scheme: dark;
}
.kc-support-panel[open] { animation: kc-support-in 0.18s ease-out; }
@keyframes kc-support-in { from { opacity: 0; transform: translateY(-6px) scale(0.98); } }
.kc-support-panel::backdrop { background: rgb(5 5 8 / 45%); }
.kc-support-panel :focus-visible { outline: 2px solid #25f4ee; outline-offset: 2px; }

.kc-support-head {
  position: relative; display: flex; align-items: flex-start; gap: 14px; padding: 22px 20px 20px;
  border-bottom: 1px solid rgb(255 255 255 / 7%);
  background:
    radial-gradient(120% 140% at 0% 0%, rgb(254 44 85 / 26%), transparent 60%),
    radial-gradient(90% 120% at 100% 0%, rgb(37 244 238 / 14%), transparent 55%),
    #1b1b25;
}
.kc-support-avatar { flex: none; width: 48px; height: 48px; border-radius: 13px; box-shadow: 0 6px 18px rgb(0 0 0 / 40%); }
.kc-support-who { flex: 1; min-width: 0; padding-inline-end: 30px; }
.kc-support-panel h2 { margin: 2px 0 4px; color: #fff; font-size: 18px; font-weight: 750; line-height: 1.3; letter-spacing: -0.01em; }
.kc-support-panel .kc-support-who p { margin: 0; color: rgb(255 255 255 / 66%); font-size: 13.5px; line-height: 1.5; }
.kc-support-panel .kc-support-close {
  position: absolute; top: 14px; inset-inline-end: 14px;
  display: grid; place-items: center; width: 32px; height: 32px; min-height: 32px; padding: 0;
  border: 0; border-radius: 50%; background: rgb(255 255 255 / 8%); color: rgb(255 255 255 / 80%); cursor: pointer;
}
.kc-support-panel .kc-support-close:hover { background: rgb(255 255 255 / 16%); color: #fff; }
.kc-support-close svg { width: 16px; height: 16px; }

.kc-support-body { padding: 16px; }
.kc-support-channels { display: grid; gap: 10px; }
.kc-support-channels a {
  display: flex; flex: 1; align-items: center; gap: 12px; min-width: 0; padding: 12px;
  border-radius: 14px; color: #f5f5f7; text-decoration: none;
}
.kc-support-badge { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%; color: #fff; }
.kc-support-badge svg { width: 21px; height: 21px; }
.kc-support-text { display: grid; gap: 2px; flex: 1; min-width: 0; }
.kc-support-text strong { color: #fff; font-size: 15px; font-weight: 650; line-height: 1.35; }
.kc-support-text small { overflow: hidden; color: rgb(255 255 255 / 60%); font-size: 12.5px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.kc-support-go { flex: none; width: 18px; height: 18px; color: rgb(255 255 255 / 45%); }
/* WhatsApp, the main way to reach us, in its own green. */
.kc-support-channels .kc-support-whatsapp { border: 1px solid rgb(37 211 102 / 32%); background: rgb(37 211 102 / 11%); }
.kc-support-channels .kc-support-whatsapp:hover { background: rgb(37 211 102 / 18%); }
.kc-support-whatsapp .kc-support-badge { background: #25d366; }
.kc-support-whatsapp .kc-support-badge svg { width: 23px; height: 23px; }
.kc-support-whatsapp .kc-support-go { color: #25d366; }
/* Email, with the address and a copy button beside it. */
.kc-support-mail { display: flex; align-items: center; gap: 6px; padding-inline-end: 10px; border: 1px solid rgb(255 255 255 / 8%); border-radius: 14px; background: rgb(255 255 255 / 5%); }
.kc-support-mail:hover { background: rgb(255 255 255 / 8%); }
.kc-support-mail .kc-support-badge { background: linear-gradient(135deg, #fe2c55, #b31f63); }
.kc-support-panel .kc-support-copy {
  display: inline-flex; align-items: center; gap: 6px; flex: none; height: 32px; min-height: 32px; padding: 0 12px;
  border: 0; border-radius: 99px; background: rgb(255 255 255 / 10%); color: #fff;
  font: inherit; font-size: 13px; font-weight: 650; cursor: pointer;
}
.kc-support-panel .kc-support-copy:hover { background: rgb(255 255 255 / 18%); }
.kc-support-panel .kc-support-copy[aria-busy] { opacity: 0.6; }
.kc-support-copy svg { width: 15px; height: 15px; }
.kc-support-copy-tools { display: grid; gap: 8px; margin-top: 8px; }
.kc-support-panel .kc-support-copy-tools p { margin: 0; padding: 0 4px; color: rgb(255 255 255 / 50%); font-size: 12px; line-height: 1.5; }
.kc-support-panel .kc-support-email-value {
  box-sizing: border-box; width: 100%; min-width: 0; min-height: 40px; padding: 8px 12px;
  border: 1px solid rgb(255 255 255 / 16%); border-radius: 10px; background: #0f0f15; color: #fff;
  font: inherit; font-size: 14px; user-select: text;
}
.kc-support-panel .kc-support-email-value[hidden] { display: none; }
/* Quick help. */
.kc-support-help { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid rgb(255 255 255 / 7%); }
.kc-support-help h3 { grid-column: 1 / -1; margin: 0 0 2px; color: rgb(255 255 255 / 45%); font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.kc-support-help a {
  display: grid; justify-items: center; gap: 6px; padding: 12px 6px; border-radius: 12px;
  background: rgb(255 255 255 / 4%); color: rgb(255 255 255 / 85%);
  font-size: 12.5px; font-weight: 600; line-height: 1.3; text-align: center; text-decoration: none;
}
.kc-support-help a:hover { background: rgb(255 255 255 / 9%); color: #fff; }
.kc-support-help svg { width: 20px; height: 20px; color: #25f4ee; }

/* Phones: a bottom sheet with a grab handle. */
@media (max-width: 600px) {
  .kc-support-panel {
    inset: auto 0 0 0; width: 100%; max-width: none; max-height: 88dvh;
    border-width: 1px 0 0; border-radius: 22px 22px 0 0; padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .kc-support-panel[open] { animation: kc-support-up 0.22s ease-out; }
  .kc-support-head { padding-top: 26px; }
  .kc-support-head::before { content: ""; position: absolute; top: 9px; left: 50%; width: 36px; height: 4px; border-radius: 2px; background: rgb(255 255 255 / 24%); transform: translateX(-50%); }
}
@keyframes kc-support-up { from { opacity: 0; transform: translateY(28px); } }
@media (prefers-reduced-motion: reduce) {
  .kc-support-panel[open] { animation: none; }
  body.kx-site .kc-support-nav, body.kx-site .kc-support-nav span { transition: none; }
}

/* AI assistant (2026-11-03, payment/support-chat.mjs): above the people channels, a short log
   that scrolls inside the panel, quick questions before the first message and a growing input. */
.kc-support-panel { width: 420px; }
.kc-support-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.kc-support-ai { display: grid; gap: 10px; margin-bottom: 16px; padding: 14px; border: 1px solid rgb(37 244 238 / 22%); border-radius: 16px; background: rgb(37 244 238 / 6%); }
.kc-support-ai-head { display: flex; align-items: center; gap: 10px; }
.kc-support-ai-head > div { flex: 1; min-width: 0; }
.kc-support-ai-mark { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, #25f4ee, #fe2c55); color: #0b0b10; font-size: 12.5px; font-weight: 800; letter-spacing: 0.02em; }
.kc-support-panel .kc-support-ai h3 { margin: 0; color: #fff; font-size: 15px; font-weight: 700; line-height: 1.3; }
.kc-support-panel .kc-support-ai-head p { margin: 1px 0 0; color: rgb(255 255 255 / 60%); font-size: 12.5px; line-height: 1.4; }
.kc-support-panel .kc-support-reset { flex: none; min-height: 28px; padding: 0 10px; border: 0; border-radius: 99px; background: rgb(255 255 255 / 10%); color: #fff; font: inherit; font-size: 12px; font-weight: 650; cursor: pointer; }
.kc-support-panel .kc-support-reset:hover { background: rgb(255 255 255 / 18%); }
.kc-support-panel [hidden] { display: none !important; }
.kc-support-log { display: grid; align-content: start; gap: 8px; max-height: min(320px, 42dvh); overflow-y: auto; overscroll-behavior: contain; padding: 2px; }
.kc-support-msg { max-width: 88%; padding: 9px 12px; border-radius: 14px; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.kc-support-panel .kc-support-msg p { margin: 0; }
.kc-support-panel .kc-support-msg p + p { margin-top: 6px; }
.kc-support-msg[data-role="user"] { justify-self: end; border-end-end-radius: 4px; background: #fe2c55; color: #fff; }
.kc-support-msg[data-role="assistant"] { justify-self: start; border-end-start-radius: 4px; background: rgb(255 255 255 / 9%); color: #f5f5f7; }
.kc-support-msg[data-notice] { background: rgb(255 196 0 / 12%); color: #ffe08a; }
.kc-support-msg a { color: #25f4ee; text-decoration: underline; text-underline-offset: 2px; }
.kc-support-typing p { color: rgb(255 255 255 / 60%); animation: kc-support-blink 1.2s ease-in-out infinite; }
@keyframes kc-support-blink { 50% { opacity: 0.45; } }
.kc-support-panel .kc-support-source { margin-top: 6px; color: rgb(255 255 255 / 55%); font-size: 12px; }
.kc-support-options { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.kc-support-panel .kc-support-options button { min-height: 32px; padding: 6px 11px; border: 1px solid rgb(37 244 238 / 45%); border-radius: 99px; background: rgb(37 244 238 / 10%); color: #f5f5f7; font: inherit; font-size: 13px; line-height: 1.3; text-align: start; cursor: pointer; }
.kc-support-panel .kc-support-options button:hover { background: rgb(37 244 238 / 20%); }
.kc-support-rate { display: flex; align-items: center; gap: 4px; margin-top: 6px; color: rgb(255 255 255 / 50%); font-size: 12px; }
.kc-support-panel .kc-support-rate button { width: 28px; height: 28px; min-height: 28px; padding: 0; border: 0; border-radius: 50%; background: transparent; font-size: 14px; line-height: 1; cursor: pointer; opacity: 0.65; }
.kc-support-panel .kc-support-rate button:hover:not(:disabled) { background: rgb(255 255 255 / 10%); opacity: 1; }
.kc-support-panel .kc-support-rate button:disabled { cursor: default; }
.kc-support-panel .kc-support-rate .kc-support-rated { opacity: 1; background: rgb(255 255 255 / 12%); }
.kc-support-handoff { display: grid; justify-items: start; gap: 8px; margin-top: 8px; padding-top: 8px; border-top: 1px solid rgb(255 255 255 / 10%); }
.kc-support-panel .kc-support-handoff p { color: rgb(255 255 255 / 80%); font-size: 13px; }
.kc-support-panel .kc-support-handoff .kc-support-handoff-status:empty { display: none; }
.kc-support-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.kc-support-panel .kc-support-quick p { flex-basis: 100%; margin: 0; color: rgb(255 255 255 / 45%); font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.kc-support-panel .kc-support-quick button { min-height: 32px; padding: 6px 11px; border: 1px solid rgb(255 255 255 / 14%); border-radius: 99px; background: rgb(255 255 255 / 5%); color: #f5f5f7; font: inherit; font-size: 12.5px; line-height: 1.3; text-align: start; cursor: pointer; }
.kc-support-panel .kc-support-quick button:hover { border-color: rgb(37 244 238 / 50%); background: rgb(37 244 238 / 10%); }
.kc-support-ask { display: flex; align-items: flex-end; gap: 8px; padding: 6px 6px 6px 12px; border: 1px solid rgb(255 255 255 / 16%); border-radius: 18px; background: #0f0f15; }
.kc-support-ask:focus-within { border-color: rgb(37 244 238 / 60%); }
.kc-support-panel .kc-support-ask textarea { flex: 1; min-width: 0; min-height: 34px; max-height: 120px; padding: 7px 0; border: 0; background: transparent; color: #fff; font: inherit; font-size: 15px; line-height: 1.35; resize: none; overflow-y: hidden; outline: none; box-shadow: none; }
.kc-support-panel .kc-support-ask textarea::placeholder { color: rgb(255 255 255 / 40%); }
.kc-support-panel .kc-support-send { display: grid; place-items: center; flex: none; width: 36px; height: 36px; min-height: 36px; padding: 0; border: 0; border-radius: 50%; background: #fe2c55; color: #fff; cursor: pointer; }
.kc-support-panel .kc-support-send:disabled { opacity: 0.5; cursor: progress; }
.kc-support-send svg { width: 18px; height: 18px; }
.kc-support-panel .kc-support-ai-note { margin: 0; color: rgb(255 255 255 / 45%); font-size: 11.5px; line-height: 1.45; }
.kc-support-panel .kc-support-human-title { margin: 0 0 8px; color: rgb(255 255 255 / 45%); font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
@media (max-width: 600px) {
  .kc-support-panel { width: 100%; }
  .kc-support-log { max-height: 38dvh; }
}
@media (prefers-reduced-motion: reduce) { .kc-support-typing p { animation: none; } }
