/* Skin 3 support chat — partials/support-widget.ejs, vega-support.js.
   Same language as the approved swap stage: a graphite stage with a big lime headline, and a light "paper"
   sheet (--v-paper / --v-paper-2, dark ink) carrying the content — white tiles on paper, lime only for the
   main action and my own bubbles. No divider lines anywhere; surfaces part by colour and space.
   Desktop: a 400px window above the launcher. Phones (≤767px): full screen. */
.vsp {
  --sp-paper: var(--v-paper-2, #e9eaec); --sp-tile: var(--v-paper, #f4f5f6); --sp-white: #fff;
  --sp-ink: var(--v-paper-ink, #1b1c23); --sp-t2: var(--v-paper-t2, #6f727c); --sp-t3: #a3a6ae;
  position: fixed; right: 24px; bottom: 24px; z-index: 90; font-family: var(--v-font); color: var(--v-t1);
}
.vsp *, .vsp *::before, .vsp *::after { box-sizing: border-box; }
.vsp [hidden] { display: none !important; }
.vsp-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- launcher ---------- */
.vsp-fab { position: relative; display: grid; place-items: center; width: 56px; height: 56px; padding: 0; border: 0; border-radius: 50%; cursor: pointer; transition: transform .2s var(--v-ease), background-color .15s; -webkit-tap-highlight-color: transparent; }
body.vega .vsp-fab { background: var(--v-brand); color: var(--v-brand-ink); box-shadow: none; }
body.vega .vsp-fab:hover { background: #b9ec3c; }
.vsp-fab:active { transform: scale(.94); }
.vsp-fab__i { position: absolute; display: grid; place-items: center; transition: opacity .2s, transform .25s var(--v-ease); }
.vsp-fab__i--close { opacity: 0; transform: rotate(-90deg) scale(.6); }
.vsp.is-open .vsp-fab__i--open { opacity: 0; transform: rotate(90deg) scale(.6); }
.vsp.is-open .vsp-fab__i--close { opacity: 1; transform: none; }
.vsp-fab__badge { position: absolute; top: -2px; right: -2px; min-width: 20px; height: 20px; padding: 0 6px; border: 2px solid var(--v-bg); border-radius: 99px; background: var(--v-down); color: #fff; font: 700 11px/16px var(--v-font); text-align: center; }

/* ---------- panel: the graphite stage ---------- */
.vsp-panel {
  position: absolute; right: 0; bottom: 72px; display: flex; flex-direction: column; width: 400px; height: min(680px, calc(calc(100dvh / var(--vz, 1)) - 120px));
  overflow: hidden; border: 1px solid var(--v-line-2); border-radius: 28px;
  background: radial-gradient(90% 60% at 0% 100%, rgba(171, 225, 39, .09), transparent 60%), radial-gradient(70% 50% at 100% 0%, rgba(255, 255, 255, .04), transparent 60%), var(--v-surface);
  transform-origin: 100% 100%; animation: vsp-in .28s var(--v-ease);
}
@keyframes vsp-in { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }
.vsp-view { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; }

/* round icon buttons on the stage: plate on hover, press-in on tap */
.vsp-x { display: grid; place-items: center; flex: none; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .06); color: var(--v-t1); cursor: pointer; transition: background-color .15s, transform .12s; -webkit-tap-highlight-color: transparent; }
@media (hover: hover) { .vsp-x:hover { background: rgba(255, 255, 255, .12); } }
.vsp-x:active { background: rgba(255, 255, 255, .18); transform: scale(.88); }

/* ---------- home ---------- */
.vsp-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex: none; padding: 18px 16px 0 22px; }
.vsp-brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.vsp-brand img { width: auto; max-width: 90px; height: 21px; object-fit: contain; }
.vsp-brand strong { overflow: hidden; color: var(--v-t1); font: 700 18px/1.2 var(--v-font); letter-spacing: -.02em; text-overflow: ellipsis; white-space: nowrap; }
.vsp-brand__tag { flex: none; color: var(--v-t3); font: 600 18px/1.2 var(--v-font); letter-spacing: -.02em; }
.vsp-home__scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 26px 14px 14px; scrollbar-width: none; }
.vsp-home__scroll::-webkit-scrollbar { display: none; }
.vsp-hi { margin: 0 8px 6px; color: var(--v-t2); font: 600 17px/1.3 var(--v-font); }
.vsp-title { margin: 0 8px 26px; color: var(--v-brand); font: 700 40px/1.02 var(--v-font); letter-spacing: -.045em; }

/* the paper card */
.vsp-paper { padding: 12px; border-radius: 24px; background: var(--sp-paper); color: var(--sp-ink); }
.vsp-start { display: flex; align-items: center; gap: 12px; width: 100%; padding: 16px; border: 0; border-radius: 18px; background: var(--sp-tile); color: inherit; text-align: left; cursor: pointer; transition: background-color .15s, transform .12s; }
.vsp-start:hover { background: var(--sp-white); }
.vsp-start:active { transform: scale(.985); }
.vsp-team { display: flex; flex: none; }
.vsp-team img { width: 36px; height: 36px; border: 2px solid var(--sp-tile); border-radius: 50%; object-fit: cover; background: #d9dbe0; }
.vsp-team img + img { margin-left: -12px; }
.vsp-start__txt { display: grid; gap: 4px; flex: 1; min-width: 0; }
.vsp-start__txt strong { color: var(--sp-ink); font: 700 16px/1.25 var(--v-font); letter-spacing: -.01em; }
.vsp-online { display: inline-flex; align-items: center; gap: 7px; color: var(--sp-t2); font-size: 13px; line-height: 1.3; }
.vsp-online i { flex: none; width: 7px; height: 7px; border-radius: 50%; background: #7bbf0f; }
.vsp-start__go { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--v-brand); color: var(--v-brand-ink); }

.vsp-arts { display: grid; gap: 2px; margin-top: 14px; }
.vsp-arts h3 { margin: 4px 6px 8px; color: var(--sp-t2); font: 600 13px/1.2 var(--v-font); }
.vsp-arts a { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 50px; padding: 12px 10px 12px 6px; border-radius: 14px; color: var(--sp-ink); font-size: 15px; font-weight: 500; line-height: 1.35; transition: background-color .15s, padding .15s; }
.vsp-arts a:hover { padding-left: 12px; background: var(--sp-tile); }
.vsp-arts a svg { flex: none; color: var(--sp-t3); }
.vsp-arts a.vsp-arts__all { justify-content: center; gap: 8px; margin-top: 8px; padding: 0; border-radius: 99px; background: var(--sp-ink); color: #fff; font-weight: 600; }
.vsp-arts a.vsp-arts__all:hover { padding: 0; background: #2b2c33; }
.vsp-arts a.vsp-arts__all svg { color: var(--v-brand); }

/* ---------- tabs: the site's own tab bar (lime pill behind the current icon) ---------- */
.vsp-tabs { display: flex; flex: none; padding: 6px 8px 8px; }
.vsp-panel.is-chat .vsp-tabs { display: none; }
.vsp-tabs button { display: grid; justify-items: center; gap: 5px; flex: 1; padding: 6px 0 4px; border: 0; background: none; color: var(--v-t3); font: 600 12px/1 var(--v-font); cursor: pointer; transition: color .15s; -webkit-tap-highlight-color: transparent; }
.vsp-tabs button.is-on { color: var(--v-t1); }
.vsp-tabs__ico { position: relative; display: grid; place-items: center; width: 60px; height: 34px; border-radius: 17px; transition: background-color .2s var(--v-ease), color .2s, transform .15s; }
.vsp-tabs button.is-on .vsp-tabs__ico { background: var(--v-brand); color: var(--v-brand-ink); }
.vsp-tabs button:active .vsp-tabs__ico { transform: scale(.9); }
.vsp-tabs__dot { position: absolute; top: -2px; right: 6px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: var(--v-down); color: #fff; font: 700 10px/16px var(--v-font); font-style: normal; }

/* ---------- chat: graphite head, the thread on a paper sheet ---------- */
.vsp-head { display: flex; align-items: center; gap: 12px; flex: none; padding: 14px 14px 14px 12px; }
.vsp-head__ava { position: relative; flex: none; width: 42px; height: 42px; }
.vsp-head__ava img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; background: var(--v-raised); }
.vsp-head__ava i { position: absolute; right: 0; bottom: 0; width: 12px; height: 12px; border: 2px solid var(--v-surface); border-radius: 50%; background: var(--v-brand); }
.vsp-head__txt { display: grid; gap: 3px; flex: 1; min-width: 0; }
.vsp-head__txt strong { overflow: hidden; color: var(--v-t1); font: 700 17px/1.2 var(--v-font); letter-spacing: -.01em; text-overflow: ellipsis; white-space: nowrap; }
.vsp-head__txt .vsp-online { color: var(--v-t3); font-size: 12px; }
.vsp-head__txt .vsp-online i { background: var(--v-brand); }

.vsp-sheet { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; margin: 0 8px 8px; border-radius: 24px; background: var(--sp-paper); color: var(--sp-ink); overflow: hidden; }
.vsp-feed { display: flex; flex: 1 1 auto; flex-direction: column; gap: 4px; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 14px 12px 8px; scrollbar-width: thin; scrollbar-color: rgba(0, 0, 0, .14) transparent; }
.vsp-intro { display: grid; justify-items: center; gap: 10px; margin: auto 0; padding: 20px 8px; text-align: center; }
.vsp-intro .vsp-team img { width: 46px; height: 46px; border-color: var(--sp-paper); }
.vsp-intro .vsp-team img + img { margin-left: -14px; }
.vsp-intro strong { margin-top: 6px; color: var(--sp-ink); font: 700 24px/1.15 var(--v-font); letter-spacing: -.03em; }
.vsp-intro p { max-width: 270px; margin: 0; color: var(--sp-t2); font-size: 14px; line-height: 1.5; }
.vsp-topics { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 10px; }
.vsp-topics button { height: 40px; padding: 0 16px; border: 0; border-radius: 99px; background: var(--sp-white); color: var(--sp-ink); font: 600 14px/1 var(--v-font); cursor: pointer; transition: background-color .15s, color .15s, transform .12s; }
.vsp-topics button:hover { background: var(--sp-ink); color: #fff; }
.vsp-topics button:active { transform: scale(.95); }

.vsp-day { align-self: center; margin: 10px 0 8px; padding: 5px 12px; border-radius: 99px; background: rgba(27, 28, 35, .06); color: var(--sp-t2); font-size: 12px; font-weight: 600; }
.vsp-msg { display: flex; flex-direction: column; max-width: 84%; margin-top: 4px; will-change: transform, opacity; }
.vsp-msg--in { align-self: flex-start; align-items: flex-start; }
.vsp-msg--out { align-self: flex-end; align-items: flex-end; }
.vsp-bubble { position: relative; overflow: hidden; border-radius: 20px; font-size: 15px; line-height: 22px; overflow-wrap: anywhere; }
.vsp-msg--in .vsp-bubble { border-bottom-left-radius: 6px; background: var(--sp-white); color: var(--sp-ink); }
.vsp-msg--out .vsp-bubble { border-bottom-right-radius: 6px; background: var(--v-brand); color: var(--v-brand-ink); font-weight: 500; }
.vsp-body { padding: 10px 14px; }
.vsp-body a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.vsp-msg--media .vsp-bubble { background: none !important; }
.vsp-msg--media .vsp-body { padding: 0; }
.vsp-msg--media .vsp-caption { margin-bottom: 6px; padding: 10px 14px; border-radius: 20px; background: var(--sp-white); }
.vsp-msg--out.vsp-msg--media .vsp-caption { background: var(--v-brand); color: var(--v-brand-ink); }
.vsp-img { display: block; padding: 0; border: 0; border-radius: 16px; background: none; overflow: hidden; cursor: zoom-in; }
.vsp-img img { display: block; max-width: 240px; max-height: 280px; object-fit: cover; }
.vsp-time { display: inline-flex; align-items: center; gap: 4px; margin: 4px 6px 0; color: var(--sp-t2); font-size: 11px; font-variant-numeric: tabular-nums; }
.vsp-tick { display: inline-grid; font-style: normal; color: var(--sp-t3); }
.vsp-tick.is-read { color: #5f9a0b; }
/* streaming reply: the "Typing" pill shimmers while the bubble opens, then each word rises in (vega-support.js) */
.vsp-msg.is-streaming .vsp-bubble { will-change: width, height; }
.vsp-think { position: absolute; top: 10px; left: 14px; white-space: nowrap; font-weight: 600; color: transparent; background: linear-gradient(90deg, var(--sp-t3) 20%, var(--sp-ink) 50%, var(--sp-t3) 80%) 0 0 / 200% 100%; -webkit-background-clip: text; background-clip: text; animation: vsp-shine 1.4s linear infinite; }
@keyframes vsp-shine { to { background-position: -200% 0; } }
.vsp-wd { display: inline-block; will-change: transform, opacity, filter; }

/* ---------- composer: a white capsule on the paper ---------- */
.vsp-foot { flex: none; padding: 6px 8px 8px; }
.vsp-err { margin: 0 8px 8px; color: #d93c4f; font-size: 13px; font-weight: 500; }
.vsp-compose { margin: 0; }
.vsp-preview { position: relative; display: inline-block; margin: 0 0 8px 6px; }
.vsp-preview img { display: block; width: 64px; height: 64px; border-radius: 14px; object-fit: cover; }
.vsp-preview__x { position: absolute; top: -6px; right: -6px; display: grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 2px solid var(--sp-paper); border-radius: 50%; background: var(--sp-ink); color: #fff; cursor: pointer; }
.vsp-cap { display: flex; align-items: flex-end; gap: 4px; min-height: 54px; padding: 7px; border-radius: 27px; background: var(--sp-white); transition: box-shadow .15s; }
.vsp-cap:focus-within { box-shadow: 0 0 0 1.5px var(--sp-ink); }
.vsp-attach { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%; color: var(--sp-t2); cursor: pointer; transition: color .15s, background-color .15s; }
.vsp-attach:hover { color: var(--sp-ink); background: var(--sp-tile); }
.vsp-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.vsp-input { flex: 1; min-width: 0; max-height: 128px; margin: 0; padding: 9px 4px; border: 0; outline: 0; background: none; color: var(--sp-ink); font: 500 16px/22px var(--v-font); resize: none; }
.vsp-input::placeholder { color: var(--sp-t3); font-weight: 400; }
.vsp-send { display: grid; place-items: center; flex: none; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: var(--v-brand); color: var(--v-brand-ink); cursor: pointer; transition: background-color .15s, color .15s, transform .12s; }
.vsp-send:disabled { background: var(--sp-tile); color: var(--sp-t3); cursor: default; }
.vsp-send:not(:disabled):active { transform: scale(.9); }

/* ---------- guests ---------- */
.vsp-gate { display: grid; justify-items: center; gap: 8px; flex: none; padding: 18px 16px 16px; text-align: center; }
.vsp-gate__ico { color: var(--sp-ink); }
.vsp-gate strong { color: var(--sp-ink); font: 700 17px/1.3 var(--v-font); }
.vsp-gate p { max-width: 290px; margin: 0; color: var(--sp-t2); font-size: 13px; line-height: 1.5; }
.vsp-gate__act { display: flex; gap: 8px; width: 100%; margin-top: 8px; }
.vsp-btn { display: grid; place-items: center; flex: 1; height: 48px; border-radius: 99px; background: var(--sp-white); color: var(--sp-ink); font: 600 15px/1 var(--v-font); }
.vsp-btn--brand { background: var(--sp-ink); color: #fff; }

/* ---------- photo viewer ---------- */
.vsp-lightbox { position: fixed; inset: 0; z-index: 700; display: grid; place-items: center; padding: 24px; background: rgba(5, 6, 7, .9); animation: vsp-fade .2s ease; }
.vsp-lightbox img { max-width: 100%; max-height: 100%; border-radius: 14px; }
.vsp-lightbox button { position: absolute; top: 16px; right: 16px; width: 44px; height: 44px; border: 1px solid var(--v-line-2); border-radius: 50%; background: rgba(23, 24, 27, .9); color: var(--v-t1); font-size: 24px; cursor: pointer; }
@keyframes vsp-fade { from { opacity: 0; } }

/* ---------- phones: full screen ---------- */
@media (max-width: 767px) {
  .vsp-panel {
    position: fixed; inset: 0; width: auto; height: auto; padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom);
    border: 0; border-radius: 0; transform-origin: 50% 100%; animation: vsp-up .28s var(--v-ease);
  }
  @keyframes vsp-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
  .vsp-bar { padding: 12px 12px 0 18px; }
  /* the worker's brand reads large on phones: "<domain name> Support" */
  .vsp-brand strong, .vsp-brand__tag { font-size: 22px; }
  .vsp-brand img { height: 25px; }
  .vsp-home__scroll { padding: 26px 10px 10px; }
  .vsp-title { font-size: 44px; }
  .vsp-head { padding: 10px 12px 12px 10px; }
  .vsp-sheet { margin: 0 6px 6px; }
  .vsp-msg { max-width: 86%; }
  html.nsw-lock, html.nsw-lock body { overflow: hidden; }
}
