.ks-vto {
  --ks-vto-accent: #1d8f64;
  --ks-vto-accent-dark: #116f4b;
  --ks-vto-ink: #171a1d;
  --ks-vto-muted: #667079;
  --ks-vto-surface: #fff;
  --ks-vto-line: rgba(18, 28, 35, .14);
  font: inherit;
  color: var(--ks-vto-ink);
}

.ks-vto-launcher {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  min-height: 46px;
  margin: 14px 0 0;
  padding: 10px 18px;
  color: #292929;
  background: #fff;
  border: 1px solid var(--ks-vto-ink);
  border-radius: 7px;
  font: inherit;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color .18s ease, border-color .18s ease, transform .18s ease;
}

/* Journal applies high-specificity button styles inside the product gallery.
   Keep this extension-scoped override so the launcher text and surface cannot
   collapse to white-on-white without affecting any storefront button. */
button.ks-vto-launcher {
  --ks-vto-accent-dark: #116f4b;
  --ks-vto-ink: #171a1d;
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  color: #292929 !important;
  -webkit-text-fill-color: #292929 !important;
  background: #fff !important;
  border-color: #dedede !important;
}

button.ks-vto-launcher > span {
  visibility: visible !important;
  opacity: 1 !important;
  color: #292929 !important;
  -webkit-text-fill-color: #292929 !important;
}

.ks-vto-launcher:hover,
.ks-vto-launcher:focus-visible {
  color: #292929;
  background: #f7f7f7;
  border-color: #999;
}

button.ks-vto-launcher:hover,
button.ks-vto-launcher:focus-visible {
  color: #292929 !important;
  background: #f7f7f7 !important;
  border-color: #999 !important;
}
button.ks-vto-launcher:focus-visible { outline: 2px solid #292929; outline-offset: 3px; }
.ks-vto-launcher-icon svg { display: block; width: 24px; height: 24px; }

.ks-vto-launcher:active { transform: translateY(1px); }
.ks-vto-launcher-icon { font-size: 18px; line-height: 1; }

.ks-vto-modal[hidden],
.ks-vto [hidden] { display: none !important; }

.ks-vto-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(6, 10, 13, .76);
  backdrop-filter: blur(5px);
}

.ks-vto-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(980px, 100%);
  height: min(760px, calc(100dvh - 40px));
  overflow: hidden;
  background: var(--ks-vto-surface);
  border-radius: 14px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .34);
}

.ks-vto-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--ks-vto-line);
}

.ks-vto-eyebrow {
  color: var(--ks-vto-accent-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.ks-vto-header h2 {
  margin: 3px 0 0;
  color: var(--ks-vto-ink);
  font: inherit;
  font-size: clamp(15px, 2vw, 19px);
  font-weight: 750;
  line-height: 1.25;
}

.ks-vto-close {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  padding: 0;
  color: var(--ks-vto-ink);
  background: #f1f3f4;
  border: 0;
  border-radius: 50%;
  font: inherit;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.ks-vto-main {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 0;
  background: #0b0f12;
}

.ks-vto-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  overflow: hidden;
  background: radial-gradient(circle at 50% 35%, #26323a 0, #0b0f12 68%);
}

.ks-vto-canvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.ks-vto-start,
.ks-vto-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
}

.ks-vto-start-card {
  width: min(440px, 100%);
  padding: clamp(22px, 5vw, 38px);
  color: var(--ks-vto-ink);
  text-align: center;
  background: rgba(255, 255, 255, .96);
  border-radius: 14px;
}

.ks-vto-start-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  color: #fff;
  background: var(--ks-vto-accent);
  border-radius: 50%;
  font-size: 24px;
}

.ks-vto-start h3 { margin: 0 0 9px; font: inherit; font-size: 21px; font-weight: 800; }
.ks-vto-start p { margin: 0; color: var(--ks-vto-muted); font-size: 14px; line-height: 1.55; }
.ks-vto-start-actions { display: grid; gap: 9px; margin-top: 20px; }

.ks-vto-primary,
.ks-vto-secondary,
.ks-vto-tool {
  min-height: 44px;
  padding: 9px 16px;
  border-radius: 7px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.ks-vto-primary { color: #fff; background: var(--ks-vto-accent); border: 1px solid var(--ks-vto-accent); }
.ks-vto-primary:hover { background: var(--ks-vto-accent-dark); border-color: var(--ks-vto-accent-dark); }
.ks-vto-secondary { color: var(--ks-vto-ink); background: #fff; border: 1px solid var(--ks-vto-line); }

.ks-vto-loading {
  align-content: center;
  gap: 12px;
  color: #fff;
  background: rgba(9, 14, 18, .78);
  font-weight: 700;
}

.ks-vto-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: ks-vto-spin .8s linear infinite;
}

@keyframes ks-vto-spin { to { transform: rotate(360deg); } }

.ks-vto-guidance {
  position: absolute;
  left: 50%;
  bottom: 16px;
  max-width: calc(100% - 32px);
  padding: 9px 14px;
  color: #fff;
  background: rgba(10, 14, 17, .78);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  transform: translateX(-50%);
}

.ks-vto-toolbar {
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: #fff;
  background: #171d21;
}

.ks-vto-tool { color: #fff; background: transparent; border: 1px solid rgba(255,255,255,.25); }
.ks-vto-scale { display: grid; grid-template-columns: auto minmax(100px, 1fr); align-items: center; gap: 10px; font-size: 13px; }
.ks-vto-scale input { width: 100%; accent-color: var(--ks-vto-accent); }

.ks-vto-footer {
  padding: 9px 18px calc(9px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--ks-vto-line);
  text-align: center;
}

.ks-vto-footer p { margin: 0; color: var(--ks-vto-muted); font-size: 12px; line-height: 1.4; }
html.ks-vto-open, html.ks-vto-open body { overflow: hidden !important; }

@media (max-width: 700px) {
  .ks-vto-modal { padding: 0; }
  .ks-vto-panel { width: 100%; height: 100dvh; border-radius: 0; }
  .ks-vto-header { padding-top: calc(10px + env(safe-area-inset-top, 0px)); }
  .ks-vto-toolbar { grid-template-columns: 1fr 1fr; }
  .ks-vto-scale { grid-column: 1 / -1; grid-row: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .ks-vto *, .ks-vto *::before, .ks-vto *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
