﻿.pds-designer {
  --ink: #20242a;
  --muted: #77808c;
  --line: #d9dee6;
  --panel: #ffffff;
  --soft: #f4f6f9;
  --rail: #27313d;
  --rail-ink: #cbd3de;
  --accent: #2db7a3;
  --accent-dark: #188d7d;
  --danger: #e15a4f;
  --shadow: 0 18px 42px rgba(24, 31, 42, 0.16);
  color-scheme: light;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

body.pds-fullscreen-designer-page {
  margin: 0;
  background: #edf1f5;
  overflow: hidden;
}

body.pds-fullscreen-designer-page .pds-designer {
  width: 100vw;
  height: 100vh;
}

.pds-designer,
.pds-designer * {
  box-sizing: border-box;
}

.pds-designer {
  height: 100%;
}

.pds-designer {
  margin: 0;
  background: #eef1f5;
  color: var(--ink);
  overflow: hidden;
}

.pds-designer button,
.pds-designer input {
  font: inherit;
}

.pds-designer button {
  cursor: pointer;
}

.pds-designer svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.pds-designer [hidden] {
  display: none !important;
}

.app-shell {
  height: 100vh;
  display: grid;
  grid-template-columns: 66px 286px minmax(420px, 1fr) 300px;
  grid-template-rows: 58px 1fr;
  background: #edf1f5;
}

.topbar {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 352px 1fr auto;
  align-items: center;
  gap: 16px;
  min-width: 0;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(28, 36, 47, 0.03);
  z-index: 5;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 100%;
  padding: 0 18px;
  color: #15191f;
  border-right: 1px solid var(--line);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 7px;
  color: #ffffff;
  font-weight: 800;
  background: linear-gradient(135deg, #293541 0%, #34bea9 100%);
}

.brand-lockup strong,
.brand-lockup span {
  display: block;
  line-height: 1.1;
}

.brand-lockup strong {
  font-size: 15px;
}

.brand-lockup span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.top-tools {
  display: flex;
  align-items: center;
  min-width: 0;
}

.left-tools {
  gap: 7px;
}

.right-tools {
  justify-content: flex-end;
  gap: 10px;
  padding-right: 14px;
}

.tool-button,
.ghost-button,
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--ink);
  background: transparent;
  transition: background 140ms ease, border 140ms ease, color 140ms ease, transform 140ms ease;
}

.tool-button {
  width: 36px;
}

.tool-button:hover,
.ghost-button:hover {
  background: #f0f3f6;
  border-color: #dce2ea;
}

.tool-button:disabled {
  color: #b8c0ca;
  cursor: not-allowed;
}

.ghost-button,
.primary-button,
.status-pill {
  gap: 8px;
  padding: 0 13px;
  font-size: 13px;
  font-weight: 700;
}

.ghost-button {
  border-color: #dde3eb;
  background: #ffffff;
}

.ghost-button[aria-pressed="true"] {
  color: var(--accent-dark);
  border-color: #bce7df;
  background: #ecfbf7;
}

.primary-button,
.primary-wide {
  color: #ffffff;
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 8px 18px rgba(45, 183, 163, 0.26);
}

.primary-button:hover,
.primary-wide:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  max-width: 170px;
  overflow: hidden;
  color: var(--muted);
  border: 1px solid #dde3eb;
  border-radius: 999px;
  background: #f8fafc;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toolbar-separator {
  width: 1px;
  height: 24px;
  background: var(--line);
  margin: 0 3px;
}

.zoom-field {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 140px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.zoom-field input {
  width: 86px;
  accent-color: var(--accent);
}

.left-rail {
  grid-column: 1;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 13px 8px;
  background: var(--rail);
  border-right: 1px solid #1d2631;
}

.rail-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 7px;
  color: var(--rail-ink);
  background: transparent;
}

.rail-button:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.rail-button.active {
  color: #ffffff;
  background: var(--accent);
}

.rail-button.active::after {
  content: "";
  position: absolute;
  right: -9px;
  top: 50%;
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 8px solid var(--accent);
  transform: translateY(-50%);
}

.panel,
.inspector {
  background: var(--panel);
  overflow: auto;
}

.panel {
  grid-column: 2;
  grid-row: 2;
  border-right: 1px solid var(--line);
}

.inspector {
  grid-column: 4;
  grid-row: 2;
  padding: 16px;
  border-left: 1px solid var(--line);
}

.panel-tab {
  display: none;
  padding: 18px;
}

.panel-tab.active {
  display: block;
}

.panel-heading {
  margin-bottom: 16px;
}

.panel-heading h2,
.section-title h2 {
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
}

.panel-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.product-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 156px;
  padding: 10px;
  border: 1px solid #dde4ec;
  border-radius: 8px;
  background: #f8fafc;
  text-align: left;
}

.product-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(45, 183, 163, 0.14);
}

.product-thumb {
  display: grid;
  place-items: center;
  height: 96px;
  border-radius: 7px;
  background:
    linear-gradient(45deg, #eef2f7 25%, transparent 25%),
    linear-gradient(-45deg, #eef2f7 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #eef2f7 75%),
    linear-gradient(-45deg, transparent 75%, #eef2f7 75%);
  background-color: #ffffff;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
  overflow: hidden;
}

.product-thumb img {
  display: block;
  max-width: 92%;
  max-height: 92%;
  object-fit: contain;
}

.product-card strong {
  display: block;
  margin-top: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.product-card span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.wide-action,
.primary-wide,
.shape-pick,
.layer-row {
  width: 100%;
  border-radius: 7px;
  border: 1px solid #dce3ec;
  background: #ffffff;
}

.wide-action {
  min-height: 48px;
  margin-bottom: 10px;
  padding: 0 13px;
  text-align: left;
  color: var(--ink);
  font-size: 17px;
  font-weight: 600;
}

.wide-action.strong {
  font-weight: 900;
}

.wide-action.script {
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
}

.wide-action.arc {
  color: var(--accent-dark);
  text-align: center;
  border-style: dashed;
}

.wide-action:hover,
.shape-pick:hover,
.layer-row:hover {
  border-color: var(--accent);
}

.field-label {
  display: grid;
  gap: 7px;
  margin: 14px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.field-label input[type="text"],
.field-label input[type="number"],
.field-label select {
  width: 100%;
  min-height: 38px;
  border: 1px solid #dce3ec;
  border-radius: 7px;
  color: var(--ink);
  background: #ffffff;
  padding: 0 10px;
}

.field-label input[type="color"] {
  width: 100%;
  height: 38px;
  padding: 3px;
  border: 1px solid #dce3ec;
  border-radius: 7px;
  background: #ffffff;
}

.primary-wide {
  min-height: 42px;
  font-weight: 800;
}

.clipart-grid,
.shape-grid {
  display: grid;
  gap: 10px;
}

.clipart-item {
  min-height: 74px;
  padding: 10px;
  border: 1px solid #dce3ec;
  border-radius: 8px;
  color: var(--ink);
  background: #ffffff;
  text-align: left;
}

.clipart-item strong {
  display: block;
  font-size: 20px;
  letter-spacing: 0;
}

.clipart-item span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.shape-pick {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 12px;
  color: var(--ink);
  font-weight: 700;
  text-align: left;
}

.shape-preview {
  display: block;
  width: 26px;
  height: 26px;
  background: var(--accent);
}

.shape-preview.circle {
  border-radius: 999px;
}

.shape-preview.triangle {
  background: var(--danger);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.shape-preview.star {
  background: #f5ad28;
  clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 56%, 79% 91%, 50% 70%, 21% 91%, 32% 56%, 2% 35%, 39% 35%);
}

.upload-zone {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 190px;
  border: 1px dashed #b8c4d2;
  border-radius: 8px;
  background: #f8fafc;
  padding: 20px;
  text-align: center;
  color: var(--muted);
}

.upload-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.upload-zone svg {
  width: 34px;
  height: 34px;
  color: var(--accent);
}

.upload-zone strong {
  color: var(--ink);
}

.fine-print {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.layers-list {
  display: grid;
  gap: 8px;
}

.layer-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(86px, 0.8fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 6px 8px;
  color: var(--ink);
  text-align: left;
}

.layer-row.is-dragging {
  opacity: 0.55;
}

.layer-row.active {
  border-color: var(--accent);
  background: #effaf8;
}

.layer-row em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-style: normal;
  font-weight: 700;
}

.layer-row span {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.layer-name-input {
  width: 100%;
  min-height: 30px;
  border: 1px solid #dce3ec;
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  padding: 0 8px;
  font-size: 12px;
}

.layer-pick {
  min-width: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.layer-pick small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.layer-actions {
  display: grid;
  grid-template-columns: repeat(5, 24px);
  gap: 3px;
}

.layer-actions button {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid #dce3ec;
  border-radius: 6px;
  color: var(--muted);
  background: #ffffff;
}

.layer-actions button.active {
  color: var(--accent-dark);
  border-color: #bce7df;
  background: #ecfbf7;
}

.layer-actions svg {
  width: 15px;
  height: 15px;
}

.layer-row.is-hidden .layer-pick {
  opacity: 0.55;
}

.layer-row.is-locked .layer-pick em::after {
  content: " locked";
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.workspace {
  grid-column: 3;
  grid-row: 2;
  display: grid;
  grid-template-rows: 62px minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
}

.stage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.stage-header strong,
.stage-header span {
  display: block;
}

.stage-header strong {
  font-size: 14px;
}

.stage-header span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.stage-tabs {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.stage-tab-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.stage-tabs button {
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid #dce3ec;
  border-radius: 7px;
  color: var(--ink);
  background: #ffffff;
  font-size: 12px;
  font-weight: 800;
}

.stage-tabs button.active {
  color: #ffffff;
  border-color: var(--rail);
  background: var(--rail);
}

.zone-tabs button.active {
  border-color: var(--accent-dark);
  background: var(--accent-dark);
}

.stage-wrap {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  padding: 28px;
  overflow: auto;
  background:
    linear-gradient(45deg, rgba(160, 171, 185, 0.12) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(160, 171, 185, 0.12) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(160, 171, 185, 0.12) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(160, 171, 185, 0.12) 75%);
  background-color: #e7ebf1;
  background-position: 0 0, 0 13px, 13px -13px, -13px 0;
  background-size: 26px 26px;
}

.stage-shadow {
  width: min(62vh, 540px);
  min-width: 420px;
  transform: scale(var(--zoom, 1));
  transform-origin: center center;
  transition: transform 160ms ease;
}

.product-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 5 / 6;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
  overflow: hidden;
  isolation: isolate;
}

.product-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(rgba(52, 64, 80, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(52, 64, 80, 0.06) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0;
}

.product-stage.show-grid::before {
  opacity: 1;
}

#productImage {
  position: absolute;
  inset: 5%;
  z-index: 1;
  width: 90%;
  height: 90%;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
  filter: drop-shadow(0 16px 20px rgba(17, 23, 31, 0.18));
}

.print-zones {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.print-boundary {
  position: absolute;
  z-index: 2;
  border: 1px solid rgba(64, 69, 78, 0.42);
  background: rgba(255, 255, 255, 0.03);
  outline: 1px dashed transparent;
  outline-offset: -1px;
  pointer-events: auto;
  cursor: crosshair;
}

.print-boundary.active {
  border-color: rgba(45, 183, 163, 0.95);
  background: rgba(45, 183, 163, 0.035);
  outline-color: rgba(45, 183, 163, 0.74);
}

.print-boundary.secondary {
  background: rgba(255, 255, 255, 0.015);
}

.boundary-label {
  position: absolute;
  left: 0;
  top: 0;
  transform: translateY(-1px);
  padding: 2px 4px;
  color: rgba(80, 76, 91, 0.68);
  background: rgba(255, 255, 255, 0.58);
  border: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  white-space: nowrap;
  pointer-events: none;
}

.design-area {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.snap-guides {
  position: absolute;
  z-index: 5;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.snap-guide {
  position: absolute;
  display: none;
  background: #f5ad28;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.85);
}

.snap-guide.visible {
  display: block;
}

.snap-guide.vertical {
  top: -8px;
  bottom: -8px;
  width: 2px;
}

.snap-guide.horizontal {
  left: -8px;
  right: -8px;
  height: 2px;
}

.design-object {
  position: absolute;
  display: grid;
  place-items: center;
  min-width: 24px;
  min-height: 20px;
  color: #111111;
  user-select: none;
  touch-action: none;
  transform-origin: center center;
}

.design-object.is-locked {
  cursor: not-allowed;
}

.design-object.selected {
  outline: 1.5px solid var(--accent);
}

.design-object.selected::before {
  content: "";
  position: absolute;
  inset: -6px;
  border: 1px solid rgba(45, 183, 163, 0.35);
  pointer-events: none;
}

.design-object.text {
  padding: 2px 4px;
  text-align: center;
  font-weight: 800;
  line-height: 1;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.design-object.text.curved {
  padding: 0;
}

.curved-text-svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.curved-text-svg text {
  fill: currentColor;
  font-weight: 900;
  letter-spacing: 0;
  dominant-baseline: middle;
}

.design-object.clipart {
  padding: 4px;
  border: 3px solid currentColor;
  background: rgba(255, 255, 255, 0.66);
  text-align: center;
  font-weight: 900;
  line-height: 1;
}

.design-object.clipart span {
  display: block;
  font-size: 0.9em;
}

.design-object img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.shape-node {
  width: 100%;
  height: 100%;
  background: currentColor;
}

.shape-node.circle {
  border-radius: 999px;
}

.shape-node.triangle {
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.shape-node.star {
  clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 56%, 79% 91%, 50% 70%, 21% 91%, 32% 56%, 2% 35%, 39% 35%);
}

.resize-handle {
  position: absolute;
  right: -8px;
  bottom: -8px;
  width: 15px;
  height: 15px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 2px 8px rgba(28, 37, 49, 0.22);
  cursor: nwse-resize;
}

.price-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
  padding: 0 14px;
  border-radius: 8px;
  color: #ffffff;
  background: var(--rail);
  margin-bottom: 16px;
}

.price-card span {
  color: #cad3dc;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.price-card strong {
  font-size: 22px;
}

.inspector-section {
  padding: 15px 0;
  border-top: 1px solid var(--line);
}

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.empty-selection {
  padding: 15px;
  border: 1px dashed #c9d2df;
  border-radius: 8px;
  color: var(--muted);
  background: #f8fafc;
  font-size: 12px;
  line-height: 1.45;
}

.control-stack {
  display: grid;
  gap: 2px;
}

.two-column-controls {
  display: grid;
  grid-template-columns: 1fr 82px;
  gap: 10px;
}

.range-label {
  display: grid;
  gap: 7px;
  margin: 10px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.range-label input {
  width: 100%;
  accent-color: var(--accent);
}

.control-label {
  display: block;
  margin: 10px 0 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.segmented-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border: 1px solid #dce3ec;
  border-radius: 8px;
  background: #f8fafc;
}

.segmented-control.three {
  grid-template-columns: repeat(3, 1fr);
}

.segmented-control button {
  min-height: 32px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 800;
}

.segmented-control button.active {
  color: #ffffff;
  background: var(--rail);
}

.swatch-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.swatch {
  width: 28px;
  height: 28px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  box-shadow: 0 0 0 1px #cbd4df;
}

.swatch.active {
  box-shadow: 0 0 0 2px var(--accent);
}

.spec-list {
  display: grid;
  gap: 10px;
  margin: 0;
}

.spec-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.spec-list dt,
.spec-list dd {
  margin: 0;
}

.spec-list dd {
  color: var(--ink);
  font-weight: 800;
}

.dpi-card {
  padding: 11px 12px;
  border: 1px solid #cbd4df;
  border-radius: 8px;
  color: var(--muted);
  background: #f8fafc;
  font-size: 12px;
  line-height: 1.4;
}

.dpi-card.good {
  color: #167969;
  border-color: #bce7df;
  background: #ecfbf7;
}

.dpi-card.warning {
  color: #8d5a0c;
  border-color: #f0cf8c;
  background: #fff8e8;
}

.dpi-card.danger {
  color: #a53f38;
  border-color: #efb8b2;
  background: #fff0ef;
}

.production-actions {
  display: grid;
  gap: 9px;
  margin-top: 12px;
}

.full-action {
  width: 100%;
}

.preview-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  place-items: center;
  background: rgba(21, 26, 34, 0.54);
  padding: 22px;
}

.preview-modal.open {
  display: grid;
}

.preview-dialog {
  position: relative;
  width: min(860px, 96vw);
  max-height: 92vh;
  overflow: auto;
  padding: 18px;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 28px 80px rgba(7, 10, 15, 0.35);
}

.preview-dialog h2 {
  margin: 0 0 14px;
  font-size: 18px;
}

.modal-close {
  position: absolute;
  right: 12px;
  top: 12px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 7px;
  background: #f1f4f7;
}

.preview-surface {
  display: grid;
  place-items: center;
  min-height: 460px;
  border-radius: 8px;
  background: #edf1f5;
}

.preview-surface .product-stage {
  width: min(520px, 82vw);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 30;
  min-width: 260px;
  max-width: min(460px, calc(100vw - 32px));
  padding: 12px 16px;
  border-radius: 8px;
  color: #ffffff;
  background: #1f2a34;
  box-shadow: 0 14px 36px rgba(10, 16, 24, 0.26);
  text-align: center;
  transform: translate(-50%, 90px);
  opacity: 0;
  transition: transform 180ms ease, opacity 180ms ease;
  pointer-events: none;
}

.toast.show {
  transform: translate(-50%, 0);
  opacity: 1;
}

@media (max-width: 1160px) {
  .app-shell {
    grid-template-columns: 58px 250px minmax(360px, 1fr);
  }

  .topbar {
    grid-template-columns: 308px 1fr;
  }

  .right-tools {
    grid-column: 1 / -1;
    justify-content: flex-start;
    padding: 0 14px 8px;
    overflow-x: auto;
  }

  .topbar {
    grid-template-rows: 58px 46px;
    grid-auto-flow: row;
    height: 104px;
  }

  .app-shell {
    grid-template-rows: 104px 1fr;
  }

  .inspector {
    display: none;
  }
}

@media (max-width: 820px) {
  .pds-designer {
    overflow: auto;
  }

  .app-shell {
    min-height: 100vh;
    height: auto;
    grid-template-columns: 54px 1fr;
    grid-template-rows: auto auto auto;
  }

  .topbar {
    grid-column: 1 / -1;
    grid-template-columns: 1fr;
    height: auto;
  }

  .brand-lockup {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 12px 14px;
  }

  .left-tools,
  .right-tools {
    padding: 8px 14px;
    overflow-x: auto;
  }

  .left-rail {
    grid-row: 2 / 4;
  }

  .panel {
    grid-column: 2;
    grid-row: 2;
    max-height: none;
  }

  .workspace {
    grid-column: 2;
    grid-row: 3;
    min-height: 650px;
  }

  .product-grid {
    grid-template-columns: repeat(3, minmax(112px, 1fr));
  }

  .stage-shadow {
    width: min(92vw, 500px);
    min-width: 300px;
  }

  .stage-wrap {
    padding: 18px 10px;
  }
}

/* WordPress plugin additions */
.pds-designer {
  width: 100%;
  min-height: 760px;
  isolation: isolate;
}

.pds-designer .app-shell {
  min-height: 760px;
}

.pds-designer .template-grid {
  display: grid;
  gap: 12px;
}

.pds-designer .template-card {
  display: grid;
  grid-template-columns: 72px 1fr;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 76px;
  padding: 10px;
  border: 1px solid #dce3ec;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  text-align: left;
}

.pds-designer .template-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(45, 183, 163, 0.12);
}

.pds-designer .template-card-preview {
  display: grid;
  place-items: center;
  width: 72px;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid #e0e6ee;
  border-radius: 7px;
  background: linear-gradient(180deg, #f9fbfd, #edf2f7);
}

.pds-designer .template-card-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pds-designer .template-card-preview span {
  display: block;
  width: 44px;
  height: 44px;
  border: 3px solid var(--accent);
  border-radius: 50%;
}

.pds-designer .template-card strong,
.pds-designer .template-card small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pds-designer .template-card small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.pds-designer .empty-note {
  margin: 0;
  padding: 12px;
  border: 1px dashed #cfd8e3;
  border-radius: 8px;
  color: var(--muted);
  background: #f8fafc;
  font-size: 13px;
}

.pds-designer .variation-panel {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.pds-designer .compact-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.pds-designer .compact-field input,
.pds-designer .compact-field select {
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid #d9e1ea;
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
}

.pds-designer .variation-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.pds-designer .product-stage.dpi-warning .print-boundary.active {
  border-color: #d7971f;
}

.pds-designer .product-stage.dpi-danger .print-boundary.active {
  border-color: var(--danger);
  box-shadow: inset 0 0 0 2px rgba(225, 90, 79, 0.22);
}

@media (max-width: 1160px) {
  .pds-designer .app-shell {
    grid-template-columns: 58px 250px minmax(360px, 1fr);
    grid-template-rows: 104px minmax(620px, 1fr) auto;
  }

  .pds-designer .inspector {
    display: grid;
    grid-column: 2 / -1;
    grid-row: 3;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

@media (max-width: 820px) {
  .pds-designer {
    min-height: 100vh;
  }

  .pds-designer .app-shell {
    grid-template-columns: 54px minmax(0, 1fr);
    grid-template-rows: auto auto minmax(560px, auto) auto;
    min-height: 100vh;
  }

  .pds-designer .left-rail {
    grid-row: 2 / 5;
  }

  .pds-designer .panel {
    grid-column: 2;
    grid-row: 2;
  }

  .pds-designer .workspace {
    grid-column: 2;
    grid-row: 3;
    min-height: 560px;
  }

  .pds-designer .inspector {
    grid-column: 2;
    grid-row: 4;
    grid-template-columns: 1fr;
  }

  .pds-designer .product-grid {
    grid-template-columns: repeat(2, minmax(110px, 1fr));
  }

  .pds-designer .stage-shadow {
    width: min(100%, 460px);
  }
}

