:root {
  --ps-ink: #08070b;
  --ps-panel: #121017;
  --ps-line: rgba(255,255,255,.12);
  --ps-pink: #ff0aa8;
  --ps-violet: #7b22ff;
  --ps-white: #fff;
}

.ps-studio-open { overflow: hidden; }
.ps-modal, .ps-modal * { box-sizing: border-box; }

.ps-product-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 24px 0;
  padding: 24px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 18px;
  color: #fff;
  background:
    radial-gradient(circle at 85% 0, rgba(123,34,255,.28), transparent 42%),
    linear-gradient(135deg, #15111a, #09080c);
  box-shadow: 0 18px 48px rgba(0,0,0,.22);
}
.ps-product-entry small { color: #ff65c8; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.ps-product-entry h3 { margin: 7px 0 4px; color: #fff; font-size: clamp(22px,2vw,31px); line-height: 1.05; }
.ps-product-entry p { margin: 0; color: rgba(255,255,255,.68); max-width: 520px; }
.ps-product-entry.is-ready { border-color: rgba(255,10,168,.55); }
.ps-launch, .ps-save {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  min-height: 54px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  font-weight: 850;
  white-space: nowrap;
  cursor: pointer;
  background: linear-gradient(110deg, var(--ps-pink), var(--ps-violet));
  box-shadow: 0 12px 34px rgba(255,10,168,.24);
  transition: transform .2s ease, box-shadow .2s ease;
}
.ps-launch:hover, .ps-save:hover { transform: translateY(-2px); box-shadow: 0 16px 44px rgba(255,10,168,.34); }
.ps-launch span, .ps-save span { font-size: 20px; }

.ps-modal {
  position: fixed;
  z-index: 999999;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  color: #fff;
  background: rgba(4,3,7,.88);
  backdrop-filter: blur(16px);
}
.ps-shell {
  display: grid;
  grid-template-rows: 72px minmax(0,1fr) 74px;
  width: min(1500px, calc(100vw - 32px));
  height: min(900px, calc(100dvh - 32px));
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--ps-line);
  border-radius: 24px;
  background: #0b0a0e;
  box-shadow: 0 40px 120px rgba(0,0,0,.65);
}
.ps-header, .ps-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 17px 22px;
  border-bottom: 1px solid var(--ps-line);
  background: rgba(18,16,23,.96);
}
.ps-header small, .ps-live-head small { display: block; color: #ff46bd; font-size: 10px; font-weight: 900; letter-spacing: .16em; }
.ps-header strong { display: block; margin-top: 3px; font-size: 16px; }
.ps-close { width: 42px; height: 42px; border: 1px solid var(--ps-line); border-radius: 50%; color: #fff; font-size: 28px; line-height: 1; cursor: pointer; background: transparent; }
.ps-workspace { display: grid; grid-template-columns: 270px minmax(380px, 1fr) 330px; min-width: 0; min-height: 0 !important; overflow: hidden; }
.ps-workspace > * { min-width: 0; min-height: 0 !important; }
.ps-tools, .ps-live { overflow: auto; background: var(--ps-panel); }
.ps-tools, .ps-live, .ps-stage { scrollbar-width: thin; scrollbar-color: #6b6270 #151219; }
.ps-tools::-webkit-scrollbar, .ps-live::-webkit-scrollbar, .ps-stage::-webkit-scrollbar { width: 8px; height: 8px; }
.ps-tools::-webkit-scrollbar-track, .ps-live::-webkit-scrollbar-track, .ps-stage::-webkit-scrollbar-track { background: #151219; }
.ps-tools::-webkit-scrollbar-thumb, .ps-live::-webkit-scrollbar-thumb, .ps-stage::-webkit-scrollbar-thumb { border: 2px solid #151219; border-radius: 999px; background: #6b6270; }
.ps-tools { padding: 18px; border-right: 1px solid var(--ps-line); }
.ps-tools section { padding: 0 0 19px; margin: 0 0 19px; border-bottom: 1px solid var(--ps-line); }
.ps-tools h3 { margin: 0 0 11px; color: #fff; font-size: 13px; }
.ps-upload { display: grid; gap: 3px; padding: 15px; border: 1px dashed rgba(255,255,255,.25); border-radius: 12px; cursor: pointer; background: rgba(255,255,255,.035); }
.ps-upload span { font-weight: 800; }
.ps-upload small { color: rgba(255,255,255,.48); font-size: 10px; }
.ps-upload input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.ps-text-row { display: grid; grid-template-columns: 1fr 42px; gap: 7px; }
.ps-text-row input { min-width: 0; height: 42px; padding: 0 12px; border: 1px solid var(--ps-line); border-radius: 10px; color: #fff; background: #09080c; }
.ps-text-row button, .ps-canvas-toolbar button { border: 1px solid var(--ps-line); border-radius: 9px; color: #fff; cursor: pointer; background: rgba(255,255,255,.06); }
.ps-library { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; }
.ps-library button { display: grid; gap: 5px; padding: 8px; border: 1px solid var(--ps-line); border-radius: 10px; color: rgba(255,255,255,.72); font-size: 9px; cursor: pointer; background: #09080c; }
.ps-library img { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 7px; background: #f8f6fa; }
.ps-tools section > label:not(.ps-upload) { display: grid; gap: 5px; margin-top: 9px; color: rgba(255,255,255,.62); font-size: 11px; }
.ps-tools input[type=range] { accent-color: var(--ps-pink); }
.ps-tools .is-disabled { opacity: .3; pointer-events: none; }
.ps-stage { display: flex; flex-direction: column; align-items: center; min-width: 0; min-height: 0; padding: 18px; overflow: auto; background: radial-gradient(circle at 50% 25%, #29202f, #0d0b10 68%); }
.ps-sides { display: flex; align-self: stretch; justify-content: center; gap: 7px; }
.ps-sides button { padding: 9px 16px; border: 1px solid var(--ps-line); border-radius: 999px; color: rgba(255,255,255,.62); font-weight: 800; cursor: pointer; background: rgba(255,255,255,.03); }
.ps-sides button.is-active { color: #fff; border-color: #ff32b6; background: rgba(255,10,168,.16); }
.ps-canvas-toolbar { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; margin: 13px 0 9px; }
.ps-canvas-toolbar button { padding: 7px 10px; font-size: 11px; }
.ps-canvas-toolbar button.is-danger { color: #ff9bd6; }
.ps-canvas-frame { display: grid; place-items: center; padding: 10px; border: 1px solid rgba(255,255,255,.15); border-radius: 8px; background: repeating-linear-gradient(45deg,#dad7dd 0 8px,#eeeaf0 8px 16px); box-shadow: 0 22px 60px rgba(0,0,0,.38); }
.ps-canvas-frame .canvas-container { border: 1px dashed rgba(255,10,168,.65); }
.ps-safe-note { max-width: 580px; margin: 11px 0 0; color: rgba(255,255,255,.47); font-size: 10px; text-align: center; }
.ps-live { padding: 20px; border-left: 1px solid var(--ps-line); }
.ps-live-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.ps-live-head span { color: rgba(255,255,255,.55); font-size: 12px; }
.ps-product-mockup { position: relative; overflow: hidden; aspect-ratio: 1/1.12; border: 1px solid var(--ps-line); border-radius: 18px; background: radial-gradient(circle at 50% 38%, #47344c, #141117 72%); }
.ps-mockup-base { width: 100%; height: 100%; object-fit: cover; }
.ps-mockup-art { position: absolute; object-fit: contain; filter: drop-shadow(0 3px 5px rgba(0,0,0,.2)); }
.ps-product-mockup.is-shirt .ps-mockup-art { left: 59%; top: 24%; width: 27%; height: 38%; }
.ps-product-mockup.is-shirt.side-front .ps-mockup-art { left: 25%; top: 29%; width: 14%; height: 18%; }
.ps-product-mockup.is-mug .ps-mockup-art { left: 23%; top: 30%; width: 56%; height: 39%; transform: perspective(260px) rotateY(-4deg); border-radius: 8% 14% 14% 8%; }
.ps-mockup-empty { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); width: 70%; color: rgba(255,255,255,.5); font-size: 12px; text-align: center; }
.ps-quality, .ps-price { display: grid; gap: 4px; margin-top: 12px; padding: 14px; border: 1px solid var(--ps-line); border-radius: 13px; background: rgba(255,255,255,.035); }
.ps-quality span { color: #6fffc0; font-size: 11px; font-weight: 800; }
.ps-quality strong, .ps-price strong { color: #fff; }
.ps-quality small, .ps-price span { color: rgba(255,255,255,.48); font-size: 10px; }
.ps-footer { border-top: 1px solid var(--ps-line); border-bottom: 0; }
.ps-footer { position: relative; z-index: 5; min-height: 0; }
.ps-footer p { margin: 0; color: rgba(255,255,255,.55); font-size: 12px; }
.ps-footer p.is-visible { color: #ff73ce; }
.ps-save { min-height: 48px; }
.ps-save:disabled { opacity: .55; cursor: wait; }
.ps-cart-preview { width: 80px !important; height: 80px !important; object-fit: contain !important; border-radius: 9px; background: #f3eff5; }

.ps-color-picker { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 7px; margin-bottom: 11px; }
.ps-color-picker > span { color: rgba(255,255,255,.58); font-size: 11px; font-weight: 700; }
.ps-color-picker button { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 9px; border: 1px solid var(--ps-line); border-radius: 999px; color: rgba(255,255,255,.68); font-size: 10px; font-weight: 800; cursor: pointer; background: rgba(255,255,255,.03); }
.ps-color-picker button i { width: 13px; height: 13px; border: 1px solid rgba(255,255,255,.32); border-radius: 50%; background: #111014; }
.ps-color-picker button.is-white i { border-color: #aaa; background: #f6f6f3; }
.ps-color-picker button.is-active { color: #fff; border-color: #ff22b1; box-shadow: 0 0 0 2px rgba(255,10,168,.12); }
.ps-shirt-scene { position: relative; overflow: hidden; aspect-ratio: 1; border: 1px solid var(--ps-line); border-radius: 18px; background: #17131b; }
.ps-shirt-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ps-shirt-art { position: absolute; z-index: 2; object-fit: contain; filter: drop-shadow(0 2px 3px rgba(0,0,0,.18)); }
.ps-shirt-art.side-front { left: 55.5%; top: 26.5%; width: 14%; height: 18%; }
.ps-shirt-art.side-back { left: 30%; top: 22%; width: 40%; height: 48%; }
.ps-shirt-empty { position: absolute; z-index: 2; left: 50%; top: 43%; transform: translate(-50%,-50%); width: 45%; color: rgba(255,255,255,.58); font-size: 11px; text-align: center; text-shadow: 0 1px 4px rgba(0,0,0,.8); }
.ps-shirt-scene.is-light .ps-shirt-empty { color: rgba(0,0,0,.42); }

.ps-saved-tray { margin: 18px 0 24px; padding: 18px; border: 1px solid rgba(255,255,255,.13); border-radius: 18px; color: #fff; background: linear-gradient(135deg,#141118,#0a090d); }
.ps-saved-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.ps-saved-heading small { display: block; color: #ff46bd; font-size: 9px; font-weight: 900; letter-spacing: .14em; }
.ps-saved-heading strong { display: block; margin-top: 3px; font-size: 17px; }
.ps-new-design { min-height: 40px; padding: 0 15px; border: 1px solid #ff2ab4; border-radius: 999px; color: #fff; font-size: 11px; font-weight: 850; cursor: pointer; background: rgba(255,10,168,.12); }
.ps-saved-list { display: flex; gap: 10px; padding-bottom: 4px; overflow-x: auto; scrollbar-width: thin; scrollbar-color: #6b6270 #151219; }
.ps-saved-card { position: relative; flex: 0 0 126px; border: 1px solid var(--ps-line); border-radius: 12px; overflow: hidden; background: #0a090d; }
.ps-saved-card.is-selected { border-color: #ff20b0; box-shadow: 0 0 0 2px rgba(255,10,168,.14); }
.ps-saved-select { display: grid; width: 100%; padding: 7px; border: 0; color: #fff; text-align: left; cursor: pointer; background: transparent; }
.ps-saved-select img { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 7px; background: repeating-linear-gradient(45deg,#dedbe1 0 7px,#f1eef3 7px 14px); }
.ps-saved-select span { margin-top: 7px; font-size: 11px; font-weight: 850; }
.ps-saved-select small { color: #ff68cb; font-size: 8px; }
.ps-saved-remove { position: absolute; top: 3px; right: 3px; width: 24px; height: 24px; border: 1px solid rgba(255,255,255,.2); border-radius: 50%; color: #fff; line-height: 1; cursor: pointer; background: rgba(6,5,8,.82); }

@media (max-width: 1100px) {
  .ps-workspace { grid-template-columns: 235px minmax(360px,1fr); }
  .ps-live { display: none; }
}
@media (max-height: 790px) and (min-width: 761px) {
  .ps-modal { padding: 8px; }
  .ps-shell { width: calc(100vw - 16px); height: calc(100dvh - 16px); grid-template-rows: 64px minmax(0,1fr) 66px; border-radius: 18px; }
  .ps-header, .ps-footer { padding: 12px 18px; }
  .ps-tools { padding: 14px; }
  .ps-tools section { padding-bottom: 14px; margin-bottom: 14px; }
  .ps-stage { padding: 12px; }
  .ps-live { padding: 14px; }
  .ps-product-mockup { aspect-ratio: 1.18/1; }
  .ps-quality, .ps-price { padding: 10px 12px; }
}
@media (max-width: 760px) {
  .ps-product-entry { align-items: stretch; flex-direction: column; }
  .ps-launch { width: 100%; }
  .ps-modal { padding: 0; }
  .ps-shell { width: 100vw; height: 100dvh; grid-template-rows: 68px minmax(0,1fr) auto; border: 0; border-radius: 0; }
  .ps-workspace { display: block; overflow: auto; }
  .ps-tools { border-right: 0; border-bottom: 1px solid var(--ps-line); }
  .ps-library { grid-template-columns: repeat(3,1fr); }
  .ps-stage { min-height: 600px; }
  .ps-footer { align-items: stretch; flex-direction: column; }
  .ps-save { width: 100%; }
  .ps-saved-heading { align-items: stretch; flex-direction: column; }
  .ps-new-design { width: 100%; }
}
