/* ============================================================
   Floating support widget.

   A corner launcher that opens onto the exact same ticket system
   support.html uses (/api/ticket, /api/ticket-thread, /api/ticket-
   reply, /api/ticket-lookup) — this is a second door into one
   system, not a second system. Every colour, radius and font here
   is a design token already defined in styles.css; nothing is
   reinvented, so the widget can never drift from the site around it.

   Not included on support.html itself — that page already is this,
   full width. widget.js checks for #ticketForm and stands down.
   ============================================================ */

.vs-widget{ font-family:"IBM Plex Sans",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif; }

/* ---------------------------------------------------------- bubble */
.vs-w-bubble{
  position:fixed; right:22px; bottom:22px; z-index:400;
  width:56px; height:56px; border-radius:50%;
  border:none; padding:0; cursor:pointer;
  background:linear-gradient(155deg,var(--accent),var(--accent-hi));
  box-shadow:var(--shadow-lg), 0 0 0 1px rgba(255,255,255,.08) inset;
  display:flex; align-items:center; justify-content:center;
  transition:transform .22s var(--ease), box-shadow .22s var(--ease);
}
.vs-w-bubble:hover{ transform:translateY(-2px) scale(1.045); box-shadow:var(--shadow-lg), 0 0 0 1px rgba(255,255,255,.12) inset; }
.vs-w-bubble:active{ transform:translateY(0) scale(.96); }
/* A contained ring — an offset outline here drew a stray purple line where
   the bubble meets the panel's bottom edge. */
.vs-w-bubble:focus-visible{ outline:none; box-shadow:var(--shadow-lg), 0 0 0 1px rgba(255,255,255,.08) inset, 0 0 0 3px rgba(255,255,255,.28); }

/* Belt and braces: no element inside the widget uses an OFFSET outline, so a
   focus ring can never sit off an edge and read as a line against the panel.
   Focus stays visible via each element's own contained indicator below. */
.vs-widget :focus-visible{ outline:none; }

.vs-w-bubble svg{
  position:absolute; width:24px; height:24px;
  stroke:#fff; fill:none; stroke-width:2; stroke-linecap:round; stroke-linejoin:round;
  transition:opacity .18s var(--ease), transform .18s var(--ease);
}
.vs-w-bubble .vs-w-ic-close{ opacity:0; transform:rotate(-45deg) scale(.5); }
.vs-w-bubble.is-open .vs-w-ic-chat{ opacity:0; transform:rotate(45deg) scale(.5); }
.vs-w-bubble.is-open .vs-w-ic-close{ opacity:1; transform:rotate(0) scale(1); }

.vs-w-dot{
  position:absolute; top:-1px; right:-1px; width:15px; height:15px;
  border-radius:50%; background:var(--mint); border:2.5px solid var(--bg);
}

/* ---------------------------------------------------------- panel */
.vs-w-panel{
  position:fixed; right:22px; bottom:90px; z-index:400;
  width:378px; max-width:calc(100vw - 32px);
  height:min(616px, calc(100vh - 118px));
  background:var(--surface-2);
  border:none;
  border-radius:var(--r-xl);
  /* Definition comes from the drop shadow alone — a 1px border drew a
     visible hairline at the rounded bottom edge. */
  box-shadow:var(--shadow-lg);
  display:flex; flex-direction:column; overflow:hidden;
  transform-origin:bottom right;
  animation:vsWOpen .26s var(--ease);
}
@keyframes vsWOpen{
  from{ opacity:0; transform:translateY(14px) scale(.95); }
  to{ opacity:1; transform:translateY(0) scale(1); }
}
@media (prefers-reduced-motion:reduce){
  .vs-w-panel{ animation:none; }
  .vs-w-bubble, .vs-w-bubble svg{ transition:none; }
}
@media (max-width:480px){
  .vs-w-panel{
    right:10px; left:10px; bottom:88px; width:auto; max-width:none;
    height:min(620px, calc(100vh - 108px));
  }
}

/* ------------------------------------------------------------ head */
.vs-w-head{
  position:relative; flex:0 0 auto;
  padding:18px 46px 16px 16px;
  background:
    radial-gradient(130% 160% at 0% 0%, var(--accent-dim), transparent 62%),
    var(--surface-2);
  border-bottom:1px solid var(--line);
}
.vs-w-head-row{ display:flex; align-items:center; gap:11px; }
.vs-w-back{
  flex:0 0 auto; width:30px; height:30px; border-radius:50%;
  border:1px solid var(--line-2); background:var(--surface);
  color:var(--text-2); display:flex; align-items:center; justify-content:center;
  cursor:pointer; transition:border-color .15s,color .15s,background .15s;
}
.vs-w-back svg{ width:16px; height:16px; stroke:currentColor; fill:none; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.vs-w-back:hover{ border-color:var(--line-3); background:var(--surface-3); color:var(--text); }

.vs-w-logo{
  flex:0 0 auto; width:30px; height:30px; border-radius:8px;
  object-fit:contain;
}
.vs-w-head-txt{ flex:1 1 auto; min-width:0; }
.vs-w-title{
  font-family:"Archivo",sans-serif; font-weight:700; font-size:14.5px;
  color:var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.vs-w-sub{
  display:flex; align-items:center; gap:6px; margin-top:2px;
  font-size:12px; color:var(--text-2);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.vs-w-status-dot{
  flex:0 0 auto; width:7px; height:7px; border-radius:50%;
  background:var(--mint); box-shadow:0 0 0 3px rgba(59,232,176,.16);
}
.vs-w-pill{
  flex:0 0 auto; font-size:10px; font-weight:600; text-transform:uppercase;
  letter-spacing:.04em; padding:3px 8px; border-radius:20px;
}
.vs-w-pill.is-open{ background:var(--accent-dim); color:var(--accent-hi); }
.vs-w-pill.is-closed{ background:var(--line-2); color:var(--text-2); }

.vs-w-close{
  position:absolute; top:14px; right:14px; width:28px; height:28px;
  border-radius:50%; border:none; background:transparent; color:var(--text-2);
  display:flex; align-items:center; justify-content:center; cursor:pointer;
  transition:background .15s,color .15s;
}
.vs-w-close svg{ width:16px; height:16px; stroke:currentColor; fill:none; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.vs-w-close:hover{ background:var(--surface-3); color:var(--text); }

/* ------------------------------------------------------------ body */
.vs-w-body{
  flex:1 1 auto; overflow-y:auto; padding:18px 16px;
  display:flex; flex-direction:column; gap:14px;
}
.vs-w-body::-webkit-scrollbar{ width:8px; }
.vs-w-body::-webkit-scrollbar-thumb{ background:var(--line-2); border-radius:4px; }

.vs-w-hero h3{ font-family:"Archivo",sans-serif; font-size:19px; margin:0 0 3px; }
.vs-w-hero p{ margin:0; font-size:13px; color:var(--text-2); }

/* ============================================================
   HOME — one-screen gradient, matched to the store's dark/purple.
   The whole panel takes a single top-down gradient that fades into
   the panel surface, the header sits transparent on top of it, and
   a floating box holds the two options. Only the home view; every
   other view removes .vs-w-home and the plain surface returns.
   ============================================================ */
.vs-w-panel.vs-w-home{
  background:
    radial-gradient(120% 80% at 12% -8%, rgba(155,130,255,.55), transparent 55%),
    linear-gradient(168deg, #4a34a8 0%, #35275f 20%, var(--surface-2) 44%);
}
.vs-w-home .vs-w-head{ background:transparent; border-bottom:none; }
.vs-w-home .vs-w-body.is-home{ background:transparent; gap:16px; padding-top:6px; }
.vs-w-home .vs-w-close{ color:rgba(255,255,255,.75); }
.vs-w-home .vs-w-close:hover{ background:rgba(255,255,255,.14); color:#fff; }
.vs-w-home .vs-w-sub{ color:rgba(255,255,255,.7); }

.vs-w-greeting{ padding:2px 2px 4px; }
.vs-w-greet-hi{ font-size:16px; color:rgba(255,255,255,.72); margin-bottom:2px; }
.vs-w-greet-q{ font-family:"Archivo",sans-serif; font-weight:700; font-size:26px; color:#fff; letter-spacing:-.02em; }

/* the floating box that holds the two options */
.vs-w-homebox{
  background:var(--surface); border:1px solid var(--line-2); border-radius:var(--r-lg);
  box-shadow:var(--shadow); overflow:hidden;
}
.vs-w-boxrow{
  display:flex; align-items:center; gap:12px; width:100%; height:66px;
  padding:0 14px; background:none; border:none; border-bottom:1px solid var(--line);
  color:var(--text); font-family:inherit; font-size:13.5px; text-align:left;
  text-decoration:none; cursor:pointer; transition:background .15s;
}
.vs-w-boxrow:last-child{ border-bottom:none; }
.vs-w-boxrow:hover{ background:var(--surface-2); }
.vs-w-boxrow .vs-w-row-txt b{ color:var(--text); }
/* One line each, truncated — so both rows are always the exact same height. */
.vs-w-boxrow .vs-w-row-txt b,
.vs-w-boxrow .vs-w-row-txt small{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.vs-w-boxrow-discord .vs-w-row-ic{ background:rgba(88,101,242,.18); color:#5865F2; }

/* "Send us a message" — the conversation starter under the box */
.vs-w-start{
  display:flex; align-items:center; justify-content:space-between; gap:10px; width:100%;
  padding:14px 16px; border-radius:var(--r-lg); cursor:pointer; font-family:inherit;
  font-size:14px; font-weight:600; color:#fff; border:none;
  background:linear-gradient(150deg,var(--accent),var(--accent-hi));
  box-shadow:0 8px 22px rgba(124,92,255,.28);
  transition:transform .16s var(--ease), box-shadow .16s var(--ease);
}
.vs-w-start:hover{ transform:translateY(-1px); box-shadow:0 12px 28px rgba(124,92,255,.36); }
.vs-w-start:active{ transform:translateY(0); }
.vs-w-start svg{ flex:0 0 auto; width:18px; height:18px; }

/* quick-compose entry pill */
.vs-w-quick{
  display:flex; align-items:center; gap:10px; width:100%;
  background:var(--surface); border:1px solid var(--line-2); border-radius:var(--r-lg);
  padding:13px 14px; cursor:pointer; text-align:left; color:var(--text-2);
  font-size:13.5px; font-family:inherit; transition:border-color .15s,background .15s;
}
.vs-w-quick:hover{ border-color:var(--accent-line); background:var(--surface-2); }
.vs-w-quick span{ flex:1 1 auto; }
.vs-w-quick svg{ flex:0 0 auto; width:17px; height:17px; color:var(--accent); }

/* action row list */
.vs-w-rows{ background:var(--surface); border:1px solid var(--line-2); border-radius:var(--r-lg); overflow:hidden; }
.vs-w-row{
  display:flex; align-items:center; gap:12px; width:100%;
  padding:13px 14px; background:none; border:none; border-bottom:1px solid var(--line);
  color:var(--text); font-family:inherit; font-size:13.5px; text-align:left; cursor:pointer;
  transition:background .15s;
}
.vs-w-row:last-child{ border-bottom:none; }
.vs-w-row:hover{ background:var(--surface-2); }
.vs-w-row-ic{
  flex:0 0 auto; width:32px; height:32px; border-radius:9px;
  background:var(--accent-dim); color:var(--accent-hi);
  display:flex; align-items:center; justify-content:center;
}
.vs-w-row-ic svg{ width:16px; height:16px; stroke:currentColor; fill:none; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.vs-w-row-txt{ flex:1 1 auto; min-width:0; }
.vs-w-row-txt b{ display:block; font-weight:600; }
.vs-w-row-txt small{ display:block; color:var(--text-2); font-weight:400; margin-top:1px; font-size:12px; }
.vs-w-row-chev{ flex:0 0 auto; width:15px; height:15px; color:var(--muted); stroke:currentColor; fill:none; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }

/* option cards — one shared size so every home card reads as a matched set */
.vs-w-opt{
  display:flex; align-items:center; gap:12px; width:100%; min-height:62px;
  padding:13px 14px; background:var(--surface); border:1px solid var(--line-2);
  border-radius:var(--r-lg); color:var(--text); font-family:inherit; font-size:13.5px;
  text-align:left; text-decoration:none; cursor:pointer;
  transition:border-color .15s,background .15s;
}
.vs-w-opt:hover{ border-color:var(--accent-line); background:var(--surface-2); }
.vs-w-opt .vs-w-row-txt b{ color:var(--text); }

/* discord card — same size as the others, its own blurple skin */
.vs-w-discord{
  background:linear-gradient(155deg, rgba(88,101,242,.14), rgba(88,101,242,.02));
  border-color:rgba(88,101,242,.28);
}
.vs-w-discord:hover{ border-color:rgba(88,101,242,.5); background:linear-gradient(155deg, rgba(88,101,242,.18), rgba(88,101,242,.04)); }
.vs-w-discord .vs-w-row-ic{ background:rgba(88,101,242,.18); color:#5865F2; }

/* ------------------------------------------------------- bottom nav */
.vs-w-nav{
  flex:0 0 auto; display:flex;
  border-top:1px solid var(--line); background:var(--surface-2);
}
.vs-w-tab{
  flex:1 1 0; display:flex; flex-direction:column; align-items:center; gap:4px;
  padding:9px 4px 8px; background:none; border:none; cursor:pointer;
  color:var(--muted); font-family:inherit; font-size:11px; font-weight:600;
  transition:color .15s;
}
.vs-w-tab svg{ width:20px; height:20px; stroke:currentColor; fill:none; stroke-width:1.9; stroke-linecap:round; stroke-linejoin:round; }
.vs-w-tab:hover{ color:var(--text-2); }
.vs-w-tab.is-active{ color:var(--accent-hi); }
/* No purple focus ring at the panel's edge on click/press — the global
   button:focus-visible outline sits half off the panel and reads as a
   line. Keyboard users still get a contained, non-purple highlight. */
.vs-w-tab:focus,
.vs-w-tab:focus-visible{ outline:none; background:none; }

/* ------------------------------------------------------------- faq */
.vs-w-faq{ display:flex; flex-direction:column; gap:8px; }
.vs-w-faq-item{
  background:var(--surface); border:1px solid var(--line-2); border-radius:var(--r-lg);
  overflow:hidden;
}
.vs-w-faq-item summary{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:12px 14px; cursor:pointer; list-style:none;
  font-size:13px; font-weight:600; color:var(--text);
}
.vs-w-faq-item summary::-webkit-details-marker{ display:none; }
.vs-w-faq-item summary svg{
  flex:0 0 auto; width:16px; height:16px; color:var(--muted);
  stroke:currentColor; fill:none; stroke-width:2; stroke-linecap:round; stroke-linejoin:round;
  transition:transform .2s var(--ease);
}
.vs-w-faq-item[open] summary svg{ transform:rotate(180deg); }
.vs-w-faq-item[open] summary{ color:var(--accent-hi); }
.vs-w-faq-a{
  padding:0 14px 13px; font-size:12.5px; line-height:1.5; color:var(--text-2);
}
.vs-w-faq-a a{ color:var(--accent-hi); text-decoration:underline; }

/* ------------------------------------------------------------ form */
.vs-w-form{ display:flex; flex-direction:column; gap:12px; }
.vs-w-form .co-label{ font-size:12px; }
.vs-w-form .co-input{ padding:10px 12px; font-size:13.5px; }
.vs-w-form textarea.co-input{ resize:vertical; min-height:74px; }
.vs-w-more{
  align-self:flex-start; background:none; border:none; padding:0; margin-top:-4px;
  font-family:inherit; font-size:12px; font-weight:600; color:var(--accent-hi); cursor:pointer;
}
.vs-w-more:hover{ color:var(--accent); text-decoration:underline; }
.vs-w-hp{ position:absolute; left:-9999px; }

.vs-w-submit{ width:100%; justify-content:center; gap:8px; }

/* --------------------------------------------------------- thread */
.vs-w-body.is-thread{ padding:0; gap:0; }

.vs-w-log{
  flex:1 1 auto; overflow-y:auto; padding:16px; display:flex; flex-direction:column; gap:9px;
  min-height:0;
}
.vs-w-msg{ max-width:84%; }
.vs-w-msg .vs-w-bubble2{
  padding:9px 12px; border-radius:15px; font-size:13.5px; line-height:1.45; word-wrap:break-word;
}
.vs-w-msg .vs-w-meta{ font-size:10.5px; color:var(--muted); margin-top:3px; padding:0 2px; }

.vs-w-msg.is-customer{ align-self:flex-end; }
.vs-w-msg.is-customer .vs-w-bubble2{ background:var(--accent); color:#fff; border-bottom-right-radius:4px; }
.vs-w-msg.is-customer .vs-w-meta{ text-align:right; }

.vs-w-msg.is-staff{ align-self:flex-start; }
.vs-w-msg.is-staff .vs-w-bubble2{ background:var(--surface-3); color:var(--text); border-bottom-left-radius:4px; }

.vs-w-msg.is-system{ align-self:center; max-width:92%; }
.vs-w-msg.is-system .vs-w-bubble2{
  background:transparent; border:1px dashed var(--line-2); color:var(--text-2);
  font-size:12px; text-align:center;
}

.vs-w-composer{
  flex:0 0 auto; display:flex; align-items:flex-end; gap:8px;
  padding:12px; border-top:1px solid var(--line); background:var(--surface-2);
}
.vs-w-composer textarea{
  flex:1 1 auto; resize:none; max-height:92px; min-height:38px;
  background:var(--surface); border:1px solid var(--line-2); border-radius:var(--r-sm);
  color:var(--text); font-family:inherit; font-size:13.5px; padding:9px 12px;
}
.vs-w-composer textarea:focus{ outline:none; border-color:var(--accent-line); box-shadow:0 0 0 3px var(--accent-dim); }
.vs-w-send{
  flex:0 0 auto; width:38px; height:38px; border-radius:50%; border:none;
  background:var(--accent); color:#fff; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  transition:background .15s,transform .15s;
}
.vs-w-send svg{ width:16px; height:16px; fill:currentColor; }
.vs-w-send:hover:not(:disabled){ background:var(--accent-hi); }
.vs-w-send:active:not(:disabled){ transform:scale(.93); }
.vs-w-send:disabled{ opacity:.4; cursor:default; }

.vs-w-closed-note{
  flex:0 0 auto; padding:12px 16px; text-align:center; font-size:12.5px;
  color:var(--text-2); border-top:1px solid var(--line);
}
.vs-w-closed-note a{ color:var(--accent-hi); text-decoration:underline; }

/* ----------------------------------------------------------- misc */
.vs-w-body .co-alert{ margin:0; }
.vs-w-empty{ text-align:center; padding:30px 10px; color:var(--text-2); font-size:13px; }

.vs-w-done{ text-align:center; padding:10px 4px 4px; }
.vs-w-done-mark{
  width:46px; height:46px; margin:0 auto 12px; border-radius:50%;
  background:var(--accent-dim); color:var(--mint);
  display:flex; align-items:center; justify-content:center;
}
.vs-w-done-mark svg{ width:22px; height:22px; stroke:currentColor; fill:none; stroke-width:2.4; stroke-linecap:round; stroke-linejoin:round; }
.vs-w-done h3{ font-family:"Archivo",sans-serif; font-size:16px; margin:0 0 5px; }
.vs-w-done p{ margin:0 0 16px; font-size:13px; color:var(--text-2); }
