
.pep3d-app {
  --p: #173C42;
  --ink: #273043;
  --line: #d9dee8;
  --soft: #f4f6fa;
  --panel: #fff;

  font: 14px/1.4 Inter, system-ui, sans-serif;
  color: var(--ink);
  background: var(--soft);
  min-height: 760px;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.pep3d-app * {
  box-sizing: border-box;
}

.pep3d-app [hidden] {
  display: none !important;
}

.pep3d-toolbar {
  height: 68px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  padding: 10px 18px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.pep3d-toolbar strong {
  display: block;
  font-size: 18px;
}

.pep3d-toolbar small {
  display: block;
  color: #70798b;
}

.pep3d-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.pep3d-app button,
.pep3d-app select,
.pep3d-app input {
  font: inherit;
}

.pep3d-app button {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px 13px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

.pep3d-app button:hover {
  background-color: #173C42;
  border-color: #fff;
  color: #fff;
}
.pep3d-app button.is-active {
  border-color: var(--p);
  color: var(--p);
}

.pep3d-app button.is-primary {
  color: #fff;
  background: var(--p);
  border-color: var(--p);
  font-weight: 700;
}

.pep3d-segmented {
  display: flex;
  padding: 3px;
  border-radius: 11px;
  background: #eef0f5;
}

.pep3d-segmented button {
  border: 0;
  background: transparent;
}

.pep3d-segmented button:hover {
  background-color: #173C42;
  color: #fff !important;
}

.pep3d-segmented .is-active {
  background: var(--p);
  color: #fff !important;
}

.pep3d-workspace {
  display: grid;
  grid-template-columns: 230px minmax(360px, 1fr) 230px;
  min-height: 692px;
}

.pep3d-panel {
  background: var(--panel);
  padding: 18px;
  overflow: auto;
  max-height: calc(100vh - 90px);
}

.pep3d-panel-left {
  border-right: 1px solid var(--line);
}

.pep3d-panel-right {
  border-left: 1px solid var(--line);
}

.pep3d-panel h2 {
  margin: 0 0 4px;
}

.pep3d-panel h3 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 18px 0 10px;
}

.pep3d-panel p,
.pep3d-panel small {
  color: #737d90;
}

.pep3d-panel section {
  border-top: 1px solid var(--line);
  margin-top: 16px;
}

.pep3d-collapsible {
  border-top: 1px solid var(--line);
  margin-top: 16px;
}

.pep3d-panel-left > .pep3d-collapsible:first-child {
  border-top: 0;
  margin-top: 0;
}

.pep3d-panel-left > .pep3d-collapsible:first-child > summary {
  padding-top: 12px;
}

.pep3d-collapsible summary {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 14px 0 4px;
  color: var(--p);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.pep3d-collapsible summary::-webkit-details-marker {
  display: none;
}

.pep3d-collapsible summary::before {
  content: '\25B6';
  font-size: 9px;
  line-height: 1;
  transition: transform 0.15s ease;
}

.pep3d-collapsible[open] summary::before {
  transform: rotate(90deg);
}

.pep3d-collapsible summary:focus-visible {
  outline: 2px solid var(--p);
  outline-offset: 3px;
  border-radius: 2px;
}

.pep3d-collapsible-content {
  padding-bottom: 2px;
}

.pep3d-panel label {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  margin: 12px 0;
  align-items: center;
}

.pep3d-panel label input[type="range"],
.pep3d-panel label select {
  grid-column: 1 / -1;
  width: 100%;
}

.pep3d-panel input[type="range"],
.pep3d-adjustments input[type="range"] {
  accent-color: var(--p);
}

.pep3d-panel input[type="color"] {
  width: 46px;
  height: 30px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.pep3d-toggle {
  display: flex !important;
  justify-content: space-between;
}

.pep3d-toggle input {
  width: 40px;
  height: 22px;
  accent-color: var(--p);
}

.pep3d-viewer {
  position: relative;
  min-width: 0;
  min-height: 620px;
  background: #f4f5f8;
}

.pep3d-viewer canvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 620px;
  touch-action: none;
}

.pep3d-view-hint,
.pep3d-status {
  position: absolute;
  bottom: 14px;
  padding: 7px 11px;
  border-radius: 8px;
  background: #ffffffd9;
  box-shadow: 0 2px 12px #27304318;
  color: #657086;
}

.pep3d-view-hint {
  left: 14px;
}

.pep3d-status {
  right: 14px;
}

.pep3d-upload {
  display: flex;
  min-height: 165px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  border: 2px dashed var(--p);
  border-radius: 13px;
  background: #f3f1ff;
  cursor: pointer;
  text-align: center;
}

.pep3d-upload span {
  font-size: 30px;
  color: var(--p);
}

.pep3d-upload input {
  display: none;
}

.pep3d-image-card canvas {
  width: 100%;
  height: 145px;
  object-fit: contain;
  background:
    conic-gradient(
      #eef0f5 25%,
      #fff 0 50%,
      #eef0f5 0 75%,
      #fff 0
    )
    0 / 18px 18px;
  border-radius: 10px;
}

.pep3d-image-card button {
  width: 100%;
  margin-top: 7px;
}

.pep3d-export {
  display: grid;
  grid-template-columns: 1fr 70px;
  gap: 7px;
  margin-top: 20px;
}

.pep3d-export button {
  width: 100%;
}

.pep3d-modal {
  width: min(1080px, 96vw);
  max-width: none;
  padding: 0;
  border: 0;
  border-radius: 18px;
  box-shadow: 0 20px 80px #11182755;
}

.pep3d-modal::backdrop {
  background: #111827b0;
}
.pep3d-modal-card{position:relative}.pep3d-open-image-editor{display:block;margin:10px 0 0 10px;min-width:108px}.pep3d-image-editor[hidden]{display:none}.pep3d-image-editor{position:absolute;inset:0;z-index:20;display:grid;place-items:center;padding:18px;background:#111827b8}.pep3d-image-editor-card{display:flex;flex-direction:column;width:min(920px,100%);max-height:calc(90vh - 36px);overflow:hidden;border-radius:14px;background:#fff;box-shadow:0 20px 70px #0007}.pep3d-image-editor-card>header,.pep3d-image-editor-card>footer{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:12px 16px;border-bottom:1px solid var(--line)}.pep3d-image-editor-card>header h3{margin:0}.pep3d-image-editor-card>header button{border:0;font-size:24px}.pep3d-image-editor-card>footer{justify-content:flex-end;border-top:1px solid var(--line);border-bottom:0}.pep3d-editor-toolbar{display:grid;gap:10px;padding:10px 16px}.pep3d-editor-toolbar-row{display:flex;flex-wrap:wrap;align-items:center;gap:8px}.pep3d-editor-pipeline{align-self:stretch;width:1px;min-height:30px;margin:0 3px 0 auto;background:var(--line)}.pep3d-editor-toolbar-adjustments{padding-top:10px;border-top:1px solid var(--line)}.pep3d-editor-toolbar-adjustments[hidden]{display:none}.pep3d-editor-toolbar button{padding:8px 10px}.pep3d-editor-toolbar-row:first-child>button{display:inline-grid;place-items:center;width:38px;height:36px;padding:7px}.pep3d-editor-toolbar-row:first-child>button svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}.pep3d-editor-toolbar-row:first-child>button svg .is-filled{fill:currentColor;stroke:none}.pep3d-svg-tool-icon{font-size:9px;font-weight:800}.pep3d-editor-toolbar button.is-active{background:var(--p);color:#fff!important}.pep3d-crop-actions{display:inline-flex;gap:6px}.pep3d-crop-actions[hidden]{display:none}.pep3d-editor-toolbar label{display:inline-flex;align-items:center;gap:6px}.pep3d-editor-toolbar input[type=color]{width:38px;height:34px;padding:2px}.pep3d-editor-toolbar input[type=range]{width:100px}.pep3d-editor-toolbar .pep3d-number-field{flex:0 0 92px;width:92px;min-width:92px}.pep3d-editor-toolbar .pep3d-number-input{width:100%;min-width:0;box-sizing:border-box}.pep3d-editor-toolbar-adjustments [data-pep3d-editor-context][hidden]{display:none}.pep3d-editor-rotation-control{flex:1 1 260px}.pep3d-editor-rotation-control input{flex:1 1 180px;width:auto}.pep3d-editor-toolbar-adjustments output{min-width:38px;text-align:right}.pep3d-editor-rotation-control>span,.pep3d-editor-svg-control>span{order:1}.pep3d-editor-rotation-control>.pep3d-number-field,.pep3d-editor-svg-control>.pep3d-number-field{order:2}.pep3d-editor-rotation-control>.pep3d-number-unit,.pep3d-editor-svg-control>.pep3d-number-unit{order:3}.pep3d-editor-rotation-control>.pep3d-range-number-control,.pep3d-editor-svg-control>.pep3d-range-number-control{order:4;flex:1 1 180px}.pep3d-editor-rotation-control>output,.pep3d-editor-svg-control>output{order:5}.pep3d-editor-svg-control{flex:1 1 390px}.pep3d-editor-canvas-wrap{flex:1 1 auto;min-height:240px;overflow:auto;display:grid;place-items:center;padding:14px;background:conic-gradient(#dfe4ec 25%,#fff 0 50%,#dfe4ec 0 75%,#fff 0) 0/20px 20px}.pep3d-editor-canvas-wrap canvas{display:block;max-width:100%;max-height:55vh;touch-action:none;cursor:crosshair;transform-origin:center;will-change:transform}

.pep3d-transparent-colors>[data-pep3d-transparent-color-list]{display:flex;flex-wrap:wrap;gap:6px}.pep3d-transparent-color-item [data-pep3d-remove-transparent-color]{align-items:center;background:#FC9454!important;border:1px solid #173C42!important;border-radius:4px!important;color:#173C42!important;display:inline-flex!important;font-size:18px!important;font-weight:700;height:34px!important;justify-content:center;line-height:1!important;margin:0!important;min-height:34px!important;min-width:24px!important;padding:0!important;width:24px!important}.pep3d-transparent-colors>[data-pep3d-add-transparent-color],.pep3d-transparent-colors>small{grid-column:2;justify-self:start}

.pep3d-modal-card > header,
.pep3d-modal-card > footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
}

.pep3d-modal-card > header h2 {
  margin: 0;
}

.pep3d-modal-card > header button {
  font-size: 24px;
  border: 0;
}

.pep3d-modal-card > footer {
  justify-content: flex-end;
  gap: 12px;
  border: 0;
  border-top: 1px solid var(--line);
}

.pep3d-modal-body {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr);
  gap: 26px;
  padding: 18px 24px;
  max-height: 70vh;
  overflow: auto;
}

.pep3d-crop-stage canvas {
  width: 100%;
  max-height: 440px;
  background:
    conic-gradient(
      #edf0f5 25%,
      #fff 0 50%,
      #edf0f5 0 75%,
      #fff 0
    )
    0 / 22px 22px;
  border-radius: 12px;
}

.pep3d-tip {
  margin-top: 12px;
  padding: 15px;
  border: 1px solid #ccd3df;
  border-radius: 10px;
  background: #f0f3f8;
}

.pep3d-tip p {
  margin: 5px 0;
}

.pep3d-adjustments h3 {
  margin: 0 0 10px;
}

.pep3d-adjustments label {
  display: grid;
  grid-template-columns: 120px 1fr 40px;
  align-items: center;
  gap: 8px;
  margin: 14px 0;
}

.pep3d-adjustments label input,
.pep3d-adjustments label select {
  min-width: 0;
  width: 100%;
}

.pep3d-transparent-colors{display:grid;grid-template-columns:120px 1fr;align-items:start;gap:8px;margin:14px 0}.pep3d-transparent-colors[hidden]{display:none}.pep3d-transparent-colors>span{padding-top:8px}.pep3d-transparent-colors>[data-transparent-color-list]{display:flex;flex-wrap:wrap;gap:6px}.pep3d-transparent-color-item{align-items:center;display:inline-flex;gap:3px}.pep3d-transparent-color-item input[type=color]{height:34px;min-width:54px;padding:2px}.pep3d-transparent-color-item [data-remove-transparent-color]{align-items:center;background:#FC9454!important;border:1px solid #173C42!important;border-radius:4px!important;color:#173C42!important;display:inline-flex!important;font-size:18px!important;font-weight:700;height:34px!important;justify-content:center;line-height:1!important;margin:0!important;min-height:34px!important;min-width:24px!important;padding:0!important;width:24px!important}.pep3d-transparent-colors>[data-add-transparent-color],.pep3d-transparent-colors>small{grid-column:2;justify-self:start}.pep3d-crop-stage canvas.is-selecting-transparent-color{cursor:crosshair}

.pep3d-ratios {
  display: flex;
  gap: 3px;
  margin-bottom: 20px;
}

.pep3d-ratios button {
  padding: 8px 10px;
}

.pep3d-ratios .is-active {
  background: var(--p);
  color: #fff !important;
}

@media (max-width: 1050px) {
  .pep3d-workspace {
    grid-template-columns: 210px 1fr;
  }

  .pep3d-panel-right {
    grid-column: 1 / -1;
    border: 1px solid var(--line);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    max-height: none;
  }

  .pep3d-panel-right > h3 {
    grid-column: 1 / -1;
  }

  .pep3d-upload {
    min-height: 140px;
  }

  .pep3d-toolbar {
    grid-template-columns: 1fr auto;
  }

  .pep3d-actions {
    grid-column: 1 / -1;
    display: none;
  }
}

@media (max-width: 700px) {
  .pep3d-app {
    border-radius: 0;
  }

  .pep3d-toolbar {
    height: auto;
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .pep3d-segmented {
    justify-self: stretch;
  }

  .pep3d-segmented button {
    flex: 1;
  }

  .pep3d-actions {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    width: 100%;
    gap: 6px;
  }

  .pep3d-actions button {
    min-width: 0;
    padding: 9px 4px;
    font-size: 12px;
    white-space: nowrap;
  }

  .pep3d-workspace {
    display: flex;
    flex-direction: column;
  }

  .pep3d-panel {
    max-height: none;
    border: 0;
  }

  .pep3d-panel-left {
    order: 2;
  }

  .pep3d-viewer {
    order: 1;
    min-height: 460px;
  }

  .pep3d-viewer canvas {
    min-height: 460px;
  }

  .pep3d-panel-right {
    order: 3;
    display: block;
  }

  .pep3d-view-hint {
    display: none;
  }

  .pep3d-modal-body {
    grid-template-columns: 1fr;
  }

  .pep3d-adjustments label {
    grid-template-columns: 100px 1fr 35px;
  }
}
.pep3d-toolbar [data-customizer-theme-toggle][aria-pressed=true]{border-color:#fc9454;background:#202a35;color:#fff}
.pep3d-app.is-night-mode{--line:#263442;background:#080d12;color-scheme:dark}
.pep3d-app.is-night-mode .pep3d-viewer{background:#080d12}
.pep3d-app.is-night-mode .pep3d-view-hint,.pep3d-app.is-night-mode .pep3d-status{border-color:#42505d;background:#111a22e8;color:#c2ccd5}
.pep-export-name-dialog{width:min(480px,92vw);padding:0;border:0;border-radius:12px;color:#173c42;box-shadow:0 20px 60px #071f2366}.pep-export-name-dialog::backdrop{background:#071f23b8}.pep-export-name-dialog form{padding:22px}.pep-export-name-dialog h3{margin:0 0 8px}.pep-export-name-dialog p{margin:0 0 18px;color:#64748b;line-height:1.5}.pep-export-name-dialog label>span:first-child{display:block;margin-bottom:6px;font-weight:700}.pep-export-name-field{display:flex;align-items:stretch;overflow:hidden;border:1px solid #aebfc2;border-radius:8px;background:#fff}.pep-export-name-field:focus-within{border-color:#173c42;box-shadow:0 0 0 2px #173c4222}.pep-export-name-field input{width:100%;min-width:0;padding:10px 11px;border:0;outline:0;background:#354044;color:#fff!important;caret-color:#fff;font:inherit}.pep-export-name-field input::selection{background:#fc9454;color:#173c42}.pep-export-name-field strong{display:flex;align-items:center;padding:0 11px;border-left:1px solid #d7e0e1;background:#edf3f3;color:#52666a;text-transform:lowercase}.pep-export-name-actions{display:flex;justify-content:flex-end;flex-wrap:wrap;gap:10px;margin-top:20px}.pep-export-name-actions .is-primary{border-color:#173c42;background:#173c42;color:#fff}
