/* Scryptex 3D App Mockup Studio — tool workspace (extends site styles.css) */

.pss-page {
  padding-top: 64px;
  --pss-layout-max: min(1680px, calc(100vw - 2rem));
}

.pss-page .wrap {
  width: var(--pss-layout-max);
  max-width: none;
}

.pss-hero {
  border-bottom: 1px solid var(--line);
  padding: 2.5rem 0 2rem;
}

.pss-hero__grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: start;
}

.pss-hero__text {
  color: var(--muted);
  max-width: 52ch;
  margin-top: 0.75rem;
  font-size: 0.95rem;
}

.pss-hero__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.pss-badge {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
}

.pss-badge--accent {
  border-color: rgba(45, 212, 191, 0.35);
  color: var(--accent);
}

.pss-pricing-card {
  background: #111;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.25rem 1.35rem;
  min-width: 240px;
}

.pss-pricing-card h3 {
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.pss-pricing-card p {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.85rem;
}

.pss-pricing-card .btn {
  width: 100%;
  justify-content: center;
  font-size: 0.82rem;
  padding: 0.55rem 1rem;
}

.pss-quota {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.65rem;
}

.pss-workspace {
  padding: 1.75rem 0 4rem;
}

.pss-layout {
  display: grid;
  grid-template-columns: minmax(260px, 280px) minmax(480px, 1fr) minmax(240px, 300px);
  gap: 2rem;
  align-items: start;
}

.pss-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  justify-self: start;
  width: 100%;
  max-width: 280px;
}

.pss-panel {
  background: #0f0f0f;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.1rem;
}


.pss-panel__title {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.85rem;
}

.pss-swatch-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.45rem;
}

.pss-style-preview {
  width: 100%;
  height: 64px;
  margin-top: 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #ececec;
}

.pss-color-pickers {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}

.pss-color-field {
  font-size: 0.72rem;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.pss-color-field input[type="color"] {
  width: 42px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px;
  background: #111;
  cursor: pointer;
}

.pss-swatch {
  aspect-ratio: 1;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  background: none;
  transition: transform 0.15s, border-color 0.15s;
}

.pss-swatch:hover {
  transform: scale(1.06);
}

.pss-swatch.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.pss-swatch__inner {
  width: 100%;
  height: 100%;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.pss-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.pss-chip {
  font-size: 0.74rem;
  font-weight: 500;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s;
}

.pss-chip:hover {
  border-color: #444;
}

.pss-chip.is-active {
  border-color: var(--accent);
  background: rgba(45, 212, 191, 0.1);
  color: var(--accent);
}

.pss-color-row {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  margin-top: 0.75rem;
}

.pss-color-row label {
  font-size: 0.72rem;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.pss-color-row input[type="color"] {
  width: 42px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px;
  background: #111;
  cursor: pointer;
}

.pss-select {
  width: 100%;
  background: #111;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
  font-family: inherit;
  font-size: 0.82rem;
}

.pss-main {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-width: 0;
}

.pss-promo-rail {
  position: sticky;
  top: 80px;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  justify-self: end;
  width: 100%;
  max-width: 300px;
}

.pss-promo-card {
  min-height: 0;
}

.pss-promo-card__link {
  position: relative;
  display: block;
  background: #0f0f0f;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, transform 0.15s;
}

.pss-promo-card__link:hover {
  border-color: #444;
  transform: translateY(-1px);
}

.pss-promo-card__link--canva {
  border-color: rgba(124, 58, 237, 0.35);
}

.pss-promo-card__badge {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  z-index: 1;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.25rem 0.45rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.65);
  color: var(--muted);
}

.pss-promo-card__media {
  position: relative;
  aspect-ratio: 9 / 14;
  background: #111;
  overflow: hidden;
}

.pss-promo-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.pss-promo-card__placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #7c3aed 0%, #06b6d4 55%, #8b5cf6 100%);
}

.pss-promo-card__placeholder span {
  font-size: 3.5rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  font-family: var(--mono);
}

.pss-promo-card__body {
  padding: 0.85rem 0.95rem 1rem;
}

.pss-promo-card__name {
  font-size: 0.92rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.pss-promo-card__tagline {
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.45;
  margin-bottom: 0.55rem;
}

.pss-promo-card__cta {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
}

.pss-promo-dots {
  display: flex;
  justify-content: center;
  gap: 0.35rem;
}

.pss-promo-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  border: none;
  padding: 0;
  background: #333;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}

.pss-promo-dot.is-active {
  background: var(--accent);
  transform: scale(1.15);
}

.pss-promo-hint {
  font-size: 0.68rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.4;
}

.pss-modal__list {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 1rem;
  padding-left: 1.1rem;
}

.pss-modal__buy {
  display: flex;
  width: 100%;
  justify-content: center;
  margin-bottom: 1rem;
  text-decoration: none;
}

.pss-modal__key-label {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.45rem;
}

.pss-dropzone {
  border: 2px dashed #333;
  border-radius: 16px;
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: #0c0c0c;
}

.pss-dropzone:hover,
.pss-dropzone.is-dragover {
  border-color: var(--accent);
  background: rgba(45, 212, 191, 0.04);
}

.pss-dropzone__icon {
  font-size: 2rem;
  margin-bottom: 0.65rem;
  opacity: 0.5;
}

.pss-dropzone h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.pss-dropzone p {
  font-size: 0.82rem;
  color: var(--muted);
}

.pss-dropzone input {
  display: none;
}

.pss-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  justify-content: space-between;
}

.pss-toolbar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pss-btn-secondary {
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s;
}

.pss-btn-secondary:hover:not(:disabled) {
  border-color: #555;
}

.pss-btn-secondary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pss-slots {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

@media (min-width: 1320px) {
  .pss-slots {
    grid-template-columns: repeat(8, 1fr);
  }
}

.pss-slot {
  background: #0f0f0f;
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 0.5rem;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.pss-slot:hover {
  border-color: #444;
}

.pss-slot.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(45, 212, 191, 0.25);
}

.pss-slot__num {
  font-family: var(--mono);
  font-size: 0.62rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.pss-slot__preview {
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  border-radius: 6px;
  background: repeating-conic-gradient(#1a1a1a 0% 25%, #141414 0% 50%) 50% / 12px 12px;
}

.pss-slot__name {
  font-size: 0.62rem;
  color: var(--muted);
  margin-top: 0.35rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pss-preview-stage {
  display: grid;
  grid-template-columns: minmax(220px, 340px) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
  background: #0f0f0f;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
}

.pss-dropzone.is-compact {
  padding: 1rem 1.25rem;
}

.pss-dropzone.is-compact .pss-dropzone__icon,
.pss-dropzone.is-compact h3 {
  display: none;
}

.pss-dropzone.is-compact p {
  margin: 0;
  font-size: 0.78rem;
}

.pss-preview-stage__frame {
  aspect-ratio: 9 / 16;
  border-radius: 10px;
  overflow: hidden;
  background: #ececec;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
  position: relative;
}

.pss-preview-stage__frame canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: none;
  object-fit: contain;
}

.pss-preview-stage__frame canvas.is-dragging {
  cursor: grabbing;
}

.pss-panel__title--spaced {
  margin-top: 1rem;
}

.pss-hint {
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 0.55rem;
  line-height: 1.4;
}

.pss-pan-pad {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.35rem;
  width: min(100%, 168px);
  margin-bottom: 0.75rem;
}

.pss-pan-pad__row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.35rem;
  align-items: center;
}

.pss-pan-pad__center {
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
  width: 2rem;
}

.pss-pan-btn {
  font-size: 1rem;
  line-height: 1;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #111;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s;
}

.pss-pan-btn:hover {
  border-color: var(--accent);
  background: rgba(45, 212, 191, 0.08);
}

.pss-preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pss-reset-btn {
  margin-top: 0;
}

.pss-preview-stage__meta h3 {
  font-size: 0.95rem;
  margin-bottom: 0.35rem;
}

.pss-preview-stage__meta p {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.pss-angle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.pss-angle-btn {
  font-size: 0.72rem;
  padding: 0.35rem 0.55rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #111;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
}

.pss-angle-btn.is-active {
  border-color: var(--accent);
  color: var(--accent);
}

.pss-status {
  font-size: 0.78rem;
  color: var(--muted);
  min-height: 1.25em;
}

.pss-status--error {
  color: #f87171;
}

.pss-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.pss-modal-backdrop[hidden] {
  display: none;
}

.pss-modal {
  background: #111;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.75rem;
  max-width: 420px;
  width: 100%;
}

.pss-modal h2 {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

.pss-modal p {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.pss-modal input {
  width: 100%;
  background: #0a0a0a;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.82rem;
  margin-bottom: 0.75rem;
}

.pss-modal__actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

.pss-features {
  border-top: 1px solid var(--line);
  padding: 3rem 0;
}

.pss-features__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.pss-feature {
  background: #0f0f0f;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.25rem;
}

.pss-feature h3 {
  font-size: 0.92rem;
  margin-bottom: 0.4rem;
}

.pss-feature p {
  font-size: 0.82rem;
  color: var(--muted);
}

.pss-disclaimer {
  font-size: 0.72rem;
  color: var(--muted);
  text-align: center;
  margin-top: 2rem;
  max-width: 52ch;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
}

#exportCanvas {
  position: fixed;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 1280px) {
  .pss-layout {
    grid-template-columns: minmax(240px, 260px) minmax(0, 1fr);
  }

  .pss-promo-rail {
    grid-column: 1 / -1;
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-self: stretch;
    max-width: none;
  }

  .pss-promo-card {
    flex: 1 1 280px;
    max-width: 320px;
  }

  .pss-promo-dots,
  .pss-promo-hint {
    flex: 1 1 100%;
  }
}

@media (max-width: 960px) {
  .pss-page .wrap {
    width: min(var(--max), 92vw);
  }

  .pss-hero__grid {
    grid-template-columns: 1fr;
  }

  .pss-layout {
    grid-template-columns: 1fr;
  }

  .pss-sidebar,
  .pss-promo-rail {
    max-width: none;
    justify-self: stretch;
  }

  .pss-panel {
    position: static;
  }

  .pss-slots {
    grid-template-columns: repeat(2, 1fr);
  }

  .pss-preview-stage {
    grid-template-columns: 1fr;
  }

  .pss-preview-stage__frame {
    max-width: 240px;
    margin: 0 auto;
  }

  .pss-features__grid {
    grid-template-columns: 1fr;
  }
}
