.workspace-mode-settings {
  display: grid;
  min-width: 0;
  gap: 11px;
}
.workspace-mode-settings .mode-field {
  display: grid;
  min-width: 0;
  gap: 6px;
  font-size: 12px;
  font-weight: 640;
}
.workspace-mode-settings .mode-field > span {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.workspace-mode-settings .mode-field output {
  color: var(--muted);
  font: 11px var(--mono);
}
.workspace-mode-settings .mode-field :is(select, input[type="text"], input[type="file"]) {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--field);
  color: var(--ink);
  padding: 7px;
  font-size: 13px;
}
.workspace-mode-settings .mode-field input[type="range"] { width: 100%; margin: 0; }
.workspace-mode-settings .mode-color {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.workspace-mode-settings .mode-color input {
  width: 37px;
  height: 27px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel);
}
.workspace-mode-settings .mode-options {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.workspace-mode-settings .mode-options .button {
  min-height: 32px;
  padding: 4px 7px;
  font-size: 11px;
}
.workspace-mode-settings .mode-options .button[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.sticker-auto-progress { display: flex; align-items: center; gap: 8px; }
.sticker-auto-progress progress { flex: 1; width: 100%; min-width: 0; height: 8px; }
.sticker-auto-progress .button { min-height: 32px; white-space: nowrap; }
.sticker-auto-status { color: var(--muted); font-size: 12px; line-height: 1.5; }
.sticker-auto-status:empty { display: none; }
.workspace-mode-settings .cutout-preprocessor {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-block-size: 40px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--field);
  font-size: 12px;
  font-weight: 680;
  cursor: pointer;
}
.cutout-preprocessor:hover { border-color: var(--muted); }
.cutout-preprocessor:has(input:disabled) { cursor: default; }
.cutout-switch {
  position: relative;
  flex: none;
  inline-size: 36px;
  block-size: 22px;
}
.cutout-switch input[type="checkbox"] {
  position: absolute;
  inset: 0;
  z-index: 1;
  inline-size: 100%;
  block-size: 100%;
  margin: 0;
  opacity: 0;
  cursor: inherit;
}
.cutout-switch-track {
  position: absolute;
  inset: 0;
  border: 1px solid var(--muted);
  border-radius: 999px;
  background: var(--line);
}
.cutout-switch-track::after {
  content: "";
  position: absolute;
  inset-block-start: 3px;
  inset-inline-start: 3px;
  inline-size: 14px;
  block-size: 14px;
  border-radius: 50%;
  background: var(--panel);
  box-shadow: 0 1px 2px #24231f40;
}
.cutout-switch input:checked + .cutout-switch-track {
  background: var(--accent);
  border-color: var(--accent);
}
.cutout-switch input:checked + .cutout-switch-track::after { inset-inline-start: calc(100% - 17px); }
.cutout-switch input:focus-visible + .cutout-switch-track { outline: 2px solid var(--focus); outline-offset: 3px; }
.cutout-switch input:disabled + .cutout-switch-track { opacity: .55; }
@media (forced-colors: active) {
  .cutout-switch-track { forced-color-adjust: none; border-color: ButtonText; background: Canvas; }
  .cutout-switch-track::after { background: ButtonText; }
  .cutout-switch input:checked + .cutout-switch-track { background: Highlight; border-color: Highlight; }
  .cutout-switch input:checked + .cutout-switch-track::after { background: HighlightText; }
}
.workspace-mode-settings .sticker-material-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.workspace-mode-settings .sticker-material-options .button {
  flex-direction: column;
  padding: 5px 2px;
  min-height: 57px;
  font-size: 10px;
}
.mode-foil-swatch {
  width: 34px;
  height: 21px;
  border: 1px solid #24231f28;
  border-radius: 4px;
  background: #e8dcb6;
}
.mode-foil-swatch[data-sticker-finish="holo"] {
  background: linear-gradient(130deg, #727eef, #6be7e0, #f5a1d0, #fff3aa, #a697f2);
}
.mode-foil-swatch[data-sticker-finish="mosaic"] {
  background: conic-gradient(from 25deg, #31cfa6 25%, #7b7be2 0 50%, #eb637a 0 75%, #e0ae69 0) 0 0 / 10px 10px;
}
.mode-foil-swatch[data-sticker-finish="none"] {
  background: repeating-conic-gradient(#e1dfd7 0 25%, #fff 0 50%) 0 0 / 8px 8px;
}
#image-box[data-kind="sticker"][data-sticker-backdrop="true"] { background: var(--sticker-preview-bg); }
#image-box[data-kind="sticker"][data-sticker-flat="true"] { box-shadow: none; }
#image-box:is([data-kind="cutout"], [data-view="cutout"]) {
  background: repeating-conic-gradient(#dadbd5 0 25%, #fbfbf7 0 50%) 0 0 / 16px 16px;
  box-shadow: none;
}
#image-box[data-kind="sticker"][data-view="draft"] { perspective: 620px; }
#image-box[data-kind="sticker"][data-view="draft"]:not([data-sticker-flat="true"]) .result-frame .layer {
  transform: translate(var(--sticker-move-x, 0px), var(--sticker-move-y, 0px))
    rotateX(var(--sticker-tilt-x, 0deg)) rotateY(var(--sticker-tilt-y, 0deg));
  filter: brightness(var(--sticker-light, 1)) drop-shadow(0 8px 7px #24231f34);
}
#image-box[data-view="draft"]:not([data-sticker-flat="true"]) #mode-preview-sticker {
  pointer-events: auto;
  cursor: grab;
  touch-action: none;
}
#image-box[data-view="draft"]:not([data-sticker-flat="true"]) #mode-preview-sticker:active { cursor: grabbing; }
#image-box:is([data-view="draft"], [data-view="cutout"]) [data-foreground-profile][data-sticker-refining="true"] {
  pointer-events: auto;
  cursor: crosshair;
  touch-action: none;
}
#image-box[data-kind="sticker"].sticker-animation[data-view="draft"] .layer { animation: sticker-material-turn 4s ease-in-out; }
@keyframes sticker-material-turn {
  0%, 100% { transform: rotateY(0); filter: brightness(1) drop-shadow(0 8px 7px #24231f34); }
  35% { transform: translateY(-8px) rotateX(13deg) rotateY(-28deg) rotate(-6deg); filter: brightness(1.15) drop-shadow(0 12px 8px #24231f40); }
  70% { transform: translateY(6px) rotateX(-9deg) rotateY(22deg) rotate(7deg); filter: brightness(.96) drop-shadow(0 5px 6px #24231f34); }
}
@media (prefers-reduced-motion: reduce) {
  #image-box[data-kind="sticker"].sticker-animation[data-view="draft"] .layer { animation: none; }
}
dialog.mode-editor-dialog {
  width: min(1100px, calc(100% - 24px));
  max-width: none;
  padding: 0;
  background: var(--panel);
}
.mode-editor-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
}
.mode-editor-dialog-header h2 { margin: 0; font-size: 14px; }
.mode-editor-dialog-actions { display: flex; gap: 6px; align-items: center; }
.mode-editor-dialog-actions .button { min-height: 33px; }
.mode-editor-canvas { height: min(72vh, 680px); min-height: 290px; }
@media (max-width: 600px) {
  dialog.mode-editor-dialog[open] {
    inset: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    margin: 0;
    border: 0;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .mode-editor-dialog-header { flex: none; padding-top: max(9px, env(safe-area-inset-top)); }
  .mode-editor-dialog-actions .button { min-height: 44px; }
  .mode-editor-canvas { flex: 1; height: auto; min-height: 0; overflow: auto; }
}
