/* "Preview on my account" window (listing page + marketplace). Self-contained: tw-* classes only. */
.tw-overlay {
  --tw-bg: #10141d;
  --tw-card: #171c28;
  --tw-line: rgba(255, 255, 255, .10);
  --tw-text: #eef1f7;
  --tw-muted: #9aa3b8;
  --tw-primary: #f2f4fb;
  --tw-primary-ink: #10131a;
  --tw-gold: linear-gradient(180deg, #d7d7d7, #b0b0b0);
  --tw-gold-ink: #1b1305;
  --tw-ok: #b8b8b8;
  --tw-err: #a8a8a8;
  --tw-focus: rgba(210,210,210, .45);
  position: fixed;
  inset: 0;
  z-index: 3000;   /* above the floating nav (2200) and seasonal decorations */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: rgba(6, 8, 12, .62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
  font-family: Poppins, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  touch-action: manipulation;   /* no double-tap zoom: on iPhone a quick double tap zoomed the window off the left edge */
}
html:not([data-theme="dark"]) .tw-overlay {
  --tw-bg: #ffffff;
  --tw-card: #f4f5f7;
  --tw-line: #e2e5ea;
  --tw-text: #17191d;
  --tw-muted: #5f6670;
  --tw-primary: #17191d;
  --tw-primary-ink: #ffffff;
  --tw-ok: #7f7f7f;
  --tw-err: #5b5b5b;
  --tw-focus: rgba(23, 25, 29, .25);
  background: rgba(23, 25, 29, .38);
}
.tw-overlay.open { opacity: 1; pointer-events: auto; }

.tw-modal {
  width: min(460px, 100%);
  max-height: calc(100dvh - 24px);
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  border: 1px solid var(--tw-line);
  background: var(--tw-bg);
  color: var(--tw-text);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
  overflow: hidden;
  transform: translateY(10px) scale(.98);
  transition: transform .22s ease;
}
.tw-overlay.open .tw-modal { transform: none; }

.tw-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 14px;
  border-bottom: 1px solid var(--tw-line);
}
.tw-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--tw-muted);
}
.tw-eyebrow i { color: #b0b0b0; }
.tw-title { margin: 6px 0 0; font-size: 1.25rem; line-height: 1.25; font-weight: 800; }
.tw-title #tryOnHandle { color: #b0b0b0; }
html:not([data-theme="dark"]) .tw-title #tryOnHandle { color: #737373; }
.tw-close {
  flex: none;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid var(--tw-line);
  background: var(--tw-card);
  color: var(--tw-text);
  cursor: pointer;
}
.tw-close:hover { border-color: var(--tw-muted); }

.tw-body { display: grid; gap: 14px; padding: 18px 20px 20px; overflow-y: auto; overscroll-behavior: contain; }

.tw-label { font-size: .84rem; font-weight: 600; color: var(--tw-muted); }
.tw-field {
  display: flex;
  align-items: center;
  height: 50px;
  margin-top: -6px;
  border-radius: 14px;
  border: 1px solid var(--tw-line);
  background: var(--tw-card);
  transition: border-color .15s, box-shadow .15s;
}
.tw-field:focus-within { border-color: transparent; box-shadow: 0 0 0 3px var(--tw-focus); }
.tw-at { padding: 0 2px 0 16px; font-weight: 700; color: var(--tw-muted); font-size: 1.05rem; }
.tw-input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--tw-text);
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  padding: 0 14px 0 2px;
}
.tw-overlay .tw-input {   /* pages style every <input>; keep this one flat inside its field */
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  margin: 0 !important;
}
.tw-input::placeholder { color: var(--tw-muted); opacity: .7; font-weight: 500; }

.tw-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tw-seg { display: inline-flex; padding: 3px; gap: 3px; border-radius: 12px; border: 1px solid var(--tw-line); background: var(--tw-card); }
.tw-theme-opt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--tw-muted);
  font-family: inherit;
  font-size: .84rem;
  font-weight: 600;
  cursor: pointer;
}
.tw-theme-opt.active { background: var(--tw-bg); color: var(--tw-text); box-shadow: 0 1px 4px rgba(0, 0, 0, .18); }

.tw-run {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 52px;
  border: 0;
  border-radius: 14px;
  background: var(--tw-primary);
  color: var(--tw-primary-ink);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform .15s, opacity .15s;
}
.tw-run:hover { transform: translateY(-1px); }
.tw-run[disabled] { cursor: progress; opacity: .85; transform: none; }
.tw-timer { display: none; font-variant-numeric: tabular-nums; font-weight: 600; opacity: .7; }
.tw-run[disabled] .tw-timer { display: inline; }
.tw-run[disabled] i { animation: tw-spin 1s linear infinite; }
@keyframes tw-spin { to { transform: rotate(360deg); } }

/* Progress: one slim row of three steps, only while something is happening */
.tw-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.tw-steps:not(:has(.active, .done, .error)) { display: none; }
.tw-step { display: grid; gap: 6px; font-size: .74rem; color: var(--tw-muted); }
.tw-dot { height: 4px; border-radius: 4px; background: var(--tw-line); overflow: hidden; position: relative; }
.tw-step.active .tw-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 45%;
  border-radius: inherit;
  background: #b0b0b0;
  animation: tw-slide 1s ease-in-out infinite;
}
@keyframes tw-slide { from { transform: translateX(-100%); } to { transform: translateX(230%); } }
.tw-step.done .tw-dot { background: var(--tw-ok); }
.tw-step.error .tw-dot { background: var(--tw-err); }
.tw-step.active, .tw-step.done { color: var(--tw-text); }
.tw-step-state { display: none; }

.tw-status { font-size: .86rem; color: var(--tw-muted); line-height: 1.45; }
.tw-status.ok { color: var(--tw-ok); font-weight: 600; }
.tw-status.error { color: var(--tw-err); font-weight: 600; }

.tw-result { display: none; justify-content: center; }
.tw-result.show { display: flex; }
.tw-shot {
  display: block;
  width: min(100%, 300px);
  aspect-ratio: 1320 / 1650;   /* show the top of the profile; Download keeps the full image */
  object-fit: cover;
  object-position: top;
  border-radius: 22px;
  border: 1px solid var(--tw-line);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .35);
}

.tw-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tw-actions:not(:has(.show)) { display: none; }
.tw-btn {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  border-radius: 13px;
  border: 1px solid var(--tw-line);
  background: var(--tw-card);
  color: var(--tw-text) !important;
  font-family: inherit;
  font-size: .92rem;
  font-weight: 700;
  text-decoration: none !important;
  cursor: pointer;
}
.tw-btn.show { display: inline-flex; }
.tw-btn:hover { border-color: var(--tw-muted); }
.tw-btn--primary { grid-column: 1 / -1; height: 50px; border: 0; background: var(--tw-gold); color: var(--tw-gold-ink) !important; font-weight: 800; font-size: 1rem; }
.tw-btn--primary:hover { filter: brightness(1.06); }

/* Phones: a bottom sheet */
@media (max-width: 560px) {
  .tw-overlay { align-items: flex-end; padding: 0; }
  .tw-modal { width: 100%; max-height: 94dvh; border-radius: 22px 22px 0 0; border-bottom: 0; transform: translateY(24px); }
  .tw-head { padding: 18px 16px 12px; }
  .tw-body { padding: 16px 16px calc(18px + env(safe-area-inset-bottom)); }
  .tw-shot { width: min(100%, 260px); }
}
@media (prefers-reduced-motion: reduce) {
  .tw-overlay, .tw-modal { transition: none; }
  .tw-run[disabled] i, .tw-step.active .tw-dot::after { animation: none; }
}
