.cosy-artwork-adjusted {
  transform-origin: center !important;
}

.cosy-artwork-adjusted.cosy-artwork-has-position { translate: var(--cosy-art-x, 0) var(--cosy-art-y, 0) !important; }

.cosy-artwork-adjusted.cosy-artwork-has-scale {
  scale: var(--cosy-art-scale, 1) !important;
}

.cosy-artwork-adjusted.cosy-artwork-has-opacity {
  opacity: var(--cosy-art-opacity, 1) !important;
}

.cosy-artwork-adjusted-after::after {
  transform-origin: center !important;
}

.cosy-artwork-adjusted-after.cosy-artwork-has-position::after { translate: var(--cosy-art-x, 0) var(--cosy-art-y, 0) !important; }

.cosy-artwork-adjusted-after.cosy-artwork-has-scale::after {
  scale: var(--cosy-art-scale, 1) !important;
}

.cosy-artwork-adjusted-after.cosy-artwork-has-opacity::after {
  opacity: var(--cosy-art-opacity, 1) !important;
}

.cosy-artwork-adjusted-background.cosy-artwork-has-position {
  background-position: calc(50% + var(--cosy-art-x, 0px)) calc(100% + var(--cosy-art-y, 0px)) !important;
}

.cosy-artwork-adjusted-background.cosy-artwork-has-scale {
  background-size: calc(100% * var(--cosy-art-scale, 1)) auto !important;
}

.cosy-layout-adjusted-box.cosy-artwork-has-position {
  translate: var(--cosy-art-x, 0) var(--cosy-art-y, 0) !important;
}

.cosy-layout-adjusted-box.cosy-layout-has-width {
  width: var(--cosy-layout-width) !important;
  max-width: none !important;
  box-sizing: border-box !important;
}

.cosy-layout-adjusted-box.cosy-layout-has-height {
  min-height: var(--cosy-layout-height) !important;
  height: auto !important;
  box-sizing: border-box !important;
}

.cosy-layout-adjusted-text.cosy-artwork-has-position {
  translate: var(--cosy-art-x, 0) var(--cosy-art-y, 0) !important;
}

.cosy-layout-adjusted-text.cosy-layout-has-font-size {
  font-size: var(--cosy-layout-font-size) !important;
}

.cosy-layout-has-padding { padding: var(--cosy-layout-padding) !important; }
.cosy-layout-has-gap { gap: var(--cosy-layout-gap) !important; }
.cosy-layout-has-line-height { line-height: var(--cosy-layout-line-height) !important; }

.cosy-artwork-editor-launcher {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 99990;
  min-height: 46px;
  padding: 0 18px;
  color: #fff6df;
  background: #4b2e17;
  border: 2px solid #c99858;
  border-radius: 999px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .32);
  font: 800 .9rem/1.1 Inter, system-ui, sans-serif;
  cursor: pointer;
}

.cosy-artwork-editor {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 100001;
  width: min(360px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  padding: 18px;
  overflow: auto;
  color: #3f2b1d;
  background: rgba(255, 249, 238, .98);
  border: 2px solid #b9823d;
  border-radius: 18px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, .34);
  font: 700 .9rem/1.3 Inter, system-ui, sans-serif;
}

.cosy-artwork-editor[hidden], .cosy-artwork-editor-launcher[hidden], .cosy-artwork-editor [hidden] { display: none !important; }
.cosy-artwork-editor header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.cosy-artwork-editor header > div { display: grid; gap: 2px; }
.cosy-artwork-editor header small { color: #a86717; font-size: .68rem; letter-spacing: .12em; }
.cosy-artwork-editor header strong { font-family: Georgia, serif; font-size: 1.45rem; }
.cosy-artwork-editor header button { width: 38px; height: 38px; padding: 0; border: 1px solid #caa675; border-radius: 50%; background: #fffaf1; font-size: 1.5rem; }
.cosy-artwork-editor section { display: grid; gap: 13px; }
.cosy-artwork-editor section > strong { font-family: Georgia, serif; font-size: 1.12rem; }
.cosy-artwork-editor section > small { margin-top: -10px; color: #735f4e; text-transform: capitalize; }
.cosy-artwork-editor-pick { display: grid; gap: 8px; margin: 10px 0; }
.cosy-artwork-editor-pick label { display: grid; gap: 4px; font-size: .76rem; }
.cosy-artwork-editor-pick button,
.cosy-artwork-editor-pick select,
.cosy-artwork-editor-target-tools button,
.cosy-artwork-editor-target-tools select { width: 100%; min-height: 42px; padding: 8px 10px; color: #3f2b1d; background: #fffaf1; border: 1px solid #b9823d; border-radius: 10px; font: 800 .82rem/1.2 Inter, system-ui, sans-serif; }
.cosy-artwork-editor-target-tools { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; padding: 10px; background: #f4e5cf; border: 1px solid #d3ae7c; border-radius: 12px; }
.cosy-artwork-editor-target-tools label { min-width: 0; }
.cosy-artwork-editor label { display: grid; gap: 6px; }
.cosy-artwork-editor label[hidden] { display: none !important; }
.cosy-artwork-editor label span { display: flex; justify-content: space-between; gap: 12px; }
.cosy-artwork-editor output { color: #8c5616; }
.cosy-artwork-editor input[type="range"] { width: 100%; accent-color: #a86717; }
.cosy-artwork-editor-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cosy-artwork-editor-actions button { min-height: 43px; padding: 8px; border: 1px solid #b9823d; border-radius: 10px; background: #fffaf1; font-weight: 800; }
.cosy-artwork-editor-actions button:last-child { color: #fff8e8; background: #6a3f1d; }
.cosy-artwork-editor-status { min-height: 1.2em; margin: 11px 0 0; color: #466332; }
.cosy-artwork-editor-status.error { color: #8c3028; }

.cosy-artwork-editing .cosy-artwork-editable {
  outline: 3px dashed #d18a24 !important;
  outline-offset: 4px !important;
  cursor: grab !important;
  pointer-events: auto !important;
}
.cosy-artwork-editing .cosy-artwork-selected { outline-color: #6b4cd6 !important; }
.cosy-artwork-editing .cosy-artwork-editable:active { cursor: grabbing !important; }
.cosy-artwork-picking #root { cursor: crosshair !important; }
.cosy-artwork-picking #root * { cursor: crosshair !important; }
.cosy-artwork-picking .cosy-artwork-pick-hover { outline: 4px solid #20a6a0 !important; outline-offset: 3px !important; }

@media (max-width: 620px) {
  .cosy-artwork-editor { right: 8px; bottom: 8px; width: calc(100vw - 16px); max-height: min(64vh, 560px); box-sizing: border-box; }
  .cosy-artwork-editor-launcher { right: 10px; bottom: 10px; }
}
