/* ============================================================
   Workspace activation flow — r1ax.xyz
   A full-screen overlay that mirrors the polysniper /app desk:
   a skeleton "loading dashboard" behind a centered activation
   wizard (loading -> 3 gated steps). Styled to match the site's
   glass / sky / instrument-serif design system.
   ============================================================ */

/* ---- overlay shell -------------------------------------------------- */
#ws-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  overflow: hidden;
  background-color: var(--sky-deep, #232629);
  background-image: linear-gradient(180deg,
      var(--sky-top, #45494d) 0%,
      var(--sky-mid, #33363a) 38%,
      var(--sky-deep, #232629) 72%,
      var(--sky-close, #141516) 100%);
  font-family: var(--font-sans, "SF Pro", -apple-system, sans-serif);
  color: #fff;
  /* subtle accent palette — the one splash of color in an otherwise
     monochrome site, scoped entirely to the workspace overlay. */
  --ws-mint: #7be38c;
  --ws-sky: #79bfe2;
  --ws-violet: #b0a5ee;
  --ws-amber: #e7b673;
}
#ws-overlay.ws-open { display: block; }
html.ws-locked, body.ws-locked { overflow: hidden; }

.ws-font-display {
  font-family: var(--font-display, "Instrument Serif", Georgia, serif);
  font-style: italic;
  font-feature-settings: "liga" 1, "kern" 1;
}

/* reuse the site's glass recipes so the overlay feels native */
.ws-glass {
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  background: #ffffff14;
  border: 1px solid #ffffff8c;
  box-shadow: 0 25px 50px -12px #0000002e, inset 0 1px #fff6;
}
.ws-glass-hi {
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  backdrop-filter: blur(22px) saturate(150%);
  background: linear-gradient(140deg, #ffffff2e 0%, #ffffff17 60%, #ffffff0f 100%);
  border: 1px solid #ffffffb3;
  box-shadow: 0 30px 60px -15px #00000038, 0 0 40px #ffffff14, inset 0 1px #ffffff8c;
}

.ws-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  color: rgba(255, 255, 255, 0.62);
}

/* ---- skeleton desk (background) ------------------------------------- */
.ws-desk {
  position: absolute;
  inset: 0;
  padding: 22px clamp(16px, 4vw, 56px) 40px;
  overflow: hidden;
  filter: blur(1.5px);
  opacity: 0.9;
  transform: scale(1.01);
  pointer-events: none;
}
.ws-desk-inner {
  max-width: 1280px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.ws-desk-top {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 56px;
  padding: 0 20px;
  border-radius: 999px;
}
.ws-brand {
  font-size: 19px;
  letter-spacing: -0.02em;
  font-weight: 500;
  color: #fff;
  white-space: nowrap;
}
.ws-brand .ws-font-display { font-weight: 400; }
.ws-chip {
  height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
}
.ws-desk-hero { display: flex; flex-direction: column; gap: 14px; padding: 6px 4px; }
.ws-desk-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  flex: 0 0 auto;
}
.ws-desk-cols {
  display: grid;
  grid-template-columns: 1fr 1.6fr 1fr;
  gap: 16px;
  flex: 1 1 auto;
  min-height: 0;
}
.ws-card {
  border-radius: 22px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
}
.ws-card .ws-label { color: rgba(255, 255, 255, 0.5); }

/* shimmer skeleton primitives */
.ws-sk {
  border-radius: 8px;
  background: linear-gradient(90deg,
      rgba(255, 255, 255, 0.06) 0%,
      rgba(255, 255, 255, 0.14) 40%,
      rgba(255, 255, 255, 0.06) 80%);
  background-size: 220% 100%;
  animation: ws-shimmer 1.8s ease-in-out infinite;
}
@keyframes ws-shimmer {
  0% { background-position: 120% 0; }
  100% { background-position: -120% 0; }
}
.ws-sk-line { height: 12px; }
.ws-sk-line.sm { height: 9px; }
.ws-sk-line.lg { height: 26px; }
.ws-sk-title { height: 40px; width: 62%; border-radius: 12px; }
.ws-sk-pill { height: 28px; width: 96px; border-radius: 999px; display: inline-block; }
.ws-sk-block { flex: 1; min-height: 46px; border-radius: 14px; }
.ws-w40 { width: 40%; } .ws-w55 { width: 55%; } .ws-w70 { width: 70%; }
.ws-w85 { width: 85%; } .ws-w100 { width: 100%; } .ws-w30 { width: 30%; }

/* ---- modal scrim + shell -------------------------------------------- */
.ws-scrim {
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 90% at 50% 40%, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0.62) 100%);
  display: flex;
  padding: 24px 20px;
  overflow-y: auto;
}
/* The stage owns the width + centering. Using an explicit max-width +
   margin:auto (instead of the modal's intrinsic size) keeps every step
   perfectly centered regardless of its content width, and margin:auto
   avoids the flex-overflow top-clipping bug when a step is tall. */
.ws-stage {
  width: 100%;
  max-width: 760px;
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.ws-close {
  position: absolute;
  top: 18px;
  right: 20px;
  z-index: 3;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(28, 30, 32, 0.7);
  color: rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}
.ws-close:hover { background: #fff; color: #1a4c72; }

/* ---- loading modal -------------------------------------------------- */
.ws-loader {
  width: 100%;
  max-width: 440px;
  border-radius: 26px;
  padding: 40px 36px;
  text-align: center;
  animation: ws-pop 0.4s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.ws-loader .ws-label { color: rgba(255, 255, 255, 0.7); letter-spacing: 0.28em; }
.ws-loader h2 {
  margin: 14px 0 10px;
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 400;
}
.ws-loader p {
  margin: 0 auto;
  max-width: 320px;
  font-size: 14px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.72);
}
.ws-loader-bars { margin-top: 26px; display: flex; flex-direction: column; gap: 9px; }
.ws-loader-bars .ws-sk-line { border-radius: 999px; }
.ws-progress {
  margin-top: 24px;
  height: 4px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.12);
}
.ws-progress > span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--ws-mint), var(--ws-sky));
  animation: ws-fill 2.4s cubic-bezier(0.5, 0, 0.1, 1) forwards;
}
@keyframes ws-fill { from { width: 4%; } to { width: 100%; } }
@keyframes ws-pop {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

/* ---- wizard modal --------------------------------------------------- */
.ws-modal {
  width: 100%;
  border-radius: 28px;
  padding: 26px clamp(20px, 3vw, 34px) 22px;
  animation: ws-pop 0.4s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.ws-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.ws-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.82);
  white-space: nowrap;
}
.ws-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background-color: #c2c7cc;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.25);
}
/* the "Activation required" badge reads as attention -> amber */
.ws-badge .ws-dot { background-color: var(--ws-amber); box-shadow: 0 0 8px rgba(231, 182, 115, 0.55); }
/* a resolved/positive state -> mint */
.ws-row .ws-dot { background-color: var(--ws-mint); box-shadow: 0 0 8px rgba(123, 227, 140, 0.6); }
.ws-step-count { font-size: 12px; letter-spacing: 0.14em; color: rgba(255, 255, 255, 0.7); }

.ws-step { display: none; }
.ws-step.active { display: block; animation: ws-fade 0.35s ease both; }
@keyframes ws-fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.ws-h {
  font-size: clamp(26px, 3.6vw, 36px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-weight: 400;
  margin: 0;
}
.ws-sub {
  margin: 10px 0 0;
  font-size: 14.5px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.78);
  max-width: 560px;
}

/* two-column body (step 1) */
.ws-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 22px;
}
.ws-panel {
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.045);
  padding: 18px;
}
.ws-panel > .ws-label { display: block; margin-bottom: 14px; }
.ws-list { display: flex; flex-direction: column; gap: 14px; }
.ws-bullets { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 13px; }
.ws-bullets li {
  position: relative;
  padding-left: 20px;
  font-size: 14px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.9);
}
.ws-bullets li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 8px;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
}
.ws-item { display: flex; gap: 12px; align-items: flex-start; }
.ws-ico {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.ws-ico.c-mint   { color: var(--ws-mint);   background: rgba(123, 227, 140, 0.14); border-color: rgba(123, 227, 140, 0.42); }
.ws-ico.c-sky    { color: var(--ws-sky);    background: rgba(121, 191, 226, 0.14); border-color: rgba(121, 191, 226, 0.42); }
.ws-ico.c-violet { color: var(--ws-violet); background: rgba(176, 165, 238, 0.16); border-color: rgba(176, 165, 238, 0.44); }
.ws-item strong { display: block; font-size: 13.5px; font-weight: 600; letter-spacing: -0.01em; }
.ws-item p { margin: 3px 0 0; font-size: 12.5px; line-height: 1.5; color: rgba(255, 255, 255, 0.7); }
.ws-flow { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; counter-reset: f; }
.ws-flow li {
  position: relative;
  padding-left: 34px;
  font-size: 13.5px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.86);
}
.ws-flow li::before {
  counter-increment: f;
  content: counter(f);
  position: absolute;
  left: 0;
  top: -1px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

/* step 2: video + drag + browser cards */
.ws-video {
  position: relative;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background:
      radial-gradient(120% 120% at 50% 0%, rgba(121, 191, 226, 0.14), transparent 62%),
      rgba(0, 0, 0, 0.28);
  aspect-ratio: 16 / 8.4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
  overflow: hidden;
}
.ws-play {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  border: 1px solid rgba(121, 191, 226, 0.45);
  background: rgba(121, 191, 226, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ws-sky);
}
.ws-video small {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: rgba(255, 255, 255, 0.6);
}
.ws-video video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}
.ws-pin {
  border-radius: 16px;
  border: 1px dashed rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.04);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.ws-pin-text { flex: 1; min-width: 220px; }
.ws-pin-text b { display: block; font-size: 13px; font-weight: 600; }
.ws-pin-text p { margin: 4px 0 0; font-size: 12.5px; line-height: 1.5; color: rgba(255, 255, 255, 0.68); }
.ws-drag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  background: #fff;
  color: #3a3f44; /* match monochrome override */
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  cursor: grab;
  user-select: none;
  white-space: nowrap;
  box-shadow: 0 10px 24px -10px rgba(0, 0, 0, 0.5);
  transition: transform 0.15s, box-shadow 0.15s;
}
.ws-drag:active { cursor: grabbing; transform: scale(0.97); }
.ws-drag.ws-shake { animation: ws-shake 0.42s cubic-bezier(0.36, 0.07, 0.19, 0.97); }
@keyframes ws-shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-5px); }
  40%, 60% { transform: translateX(5px); }
}
.ws-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.ws-cards article {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  padding: 14px;
}
.ws-cards strong { font-size: 12.5px; font-weight: 600; }
.ws-cards p { margin: 6px 0 0; font-size: 11.5px; line-height: 1.5; color: rgba(255, 255, 255, 0.66); }

/* step 3: connection check */
.ws-rows { display: flex; flex-direction: column; gap: 10px; margin: 18px 0; }
.ws-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
}
.ws-row span { font-size: 13px; color: rgba(255, 255, 255, 0.75); }
.ws-row b { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.ws-status-wait {
  color: var(--ws-amber);
  font-weight: 500;
}
.ws-status-wait::before {
  content: "";
  width: 7px; height: 7px; border-radius: 999px;
  background: var(--ws-amber);
  box-shadow: 0 0 8px rgba(231, 182, 115, 0.5);
  animation: ws-blink 1.2s ease-in-out infinite;
}
@keyframes ws-blink { 50% { opacity: 0.25; } }
.ws-retry {
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.045);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* ---- footer: dots + nav --------------------------------------------- */
.ws-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  flex-wrap: wrap;
}
.ws-dots { display: flex; gap: 8px; }
.ws-dots button {
  width: 26px;
  height: 6px;
  border-radius: 999px;
  border: 0;
  padding: 0;
  background: rgba(255, 255, 255, 0.22);
  cursor: pointer;
  transition: background 0.2s, width 0.2s;
}
.ws-dots button.on { background: rgba(255, 255, 255, 0.9); width: 34px; }
.ws-nav { display: flex; gap: 10px; }
.ws-btn {
  height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, opacity 0.18s, border-color 0.18s;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.ws-btn-ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
}
.ws-btn-ghost:hover:not(:disabled) { background: rgba(255, 255, 255, 0.1); }
.ws-btn-ghost:disabled { opacity: 0.35; cursor: not-allowed; }
.ws-btn-solid {
  background: #fff;
  color: #3a3f44; /* match monochrome override */
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, 0.4);
}
.ws-btn-solid:hover { filter: brightness(0.94); }
.ws-btn-solid.ws-gated { background: rgba(255, 255, 255, 0.14); color: rgba(255, 255, 255, 0.7); box-shadow: none; cursor: not-allowed; }

.ws-toast {
  position: absolute;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%) translateY(10px);
  background: rgba(20, 21, 22, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 13px;
  padding: 11px 18px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 5;
}
.ws-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---- responsive ----------------------------------------------------- */
@media (max-width: 720px) {
  .ws-two { grid-template-columns: 1fr; }
  .ws-cards { grid-template-columns: 1fr; }
  .ws-desk-grid { grid-template-columns: repeat(2, 1fr); }
  .ws-desk-cols { display: none; }
  .ws-modal { padding: 22px 18px 18px; }
  .ws-badge span.ws-hide-sm { display: none; }
}
