:root {
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: #292735;
  background: #f8f8fc;
  font-synthesis: none;
  --purple: #6246e5;
  --purple-dark: #5034ce;
  --soft: #f0edff;
  --line: #e9e8ef;
  --muted: #777582;
  --panel: #fff;
  --shadow: 0 8px 32px #28223d0a;
  font-size: 16px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select,
summary {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: default;
  opacity: 0.35;
}
button,
a,
input,
select,
summary {
  outline-offset: 3px;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid #9b86fa;
}
a {
  color: inherit;
}
button {
  color: inherit;
}
button,
select,
input[type="text"],
input[type="number"] {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
}
input[type="text"],
input[type="number"],
select {
  width: 100%;
  min-height: 38px;
  padding: 8px 11px;
  font-size: 0.875rem;
}
select {
  appearance: none;
  padding-right: 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23817e8c' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-position: right 10px center;
  background-repeat: no-repeat;
}
input[type="range"] {
  appearance: none;
  width: 100%;
  height: 4px;
  background: linear-gradient(
    to right,
    var(--purple) var(--progress, 20%),
    #eae8f2 var(--progress, 20%)
  );
  border-radius: 5px;
  margin: 10px 0 17px;
  cursor: pointer;
  accent-color: var(--purple);
}
input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 14px;
  height: 14px;
  background: white;
  border: 3px solid var(--purple);
  border-radius: 100%;
  box-shadow: 0 1px 3px #29273524;
}
input[type="range"]::-moz-range-thumb {
  width: 10px;
  height: 10px;
  background: white;
  border: 3px solid var(--purple);
  border-radius: 100%;
}
input[type="checkbox"] {
  accent-color: var(--purple);
  width: 16px;
  height: 16px;
  margin: 0;
}
input[type="color"] {
  padding: 2px;
  width: 30px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  cursor: pointer;
}
h1,
h2,
h3,
p {
  margin: 0;
}
button svg,
a svg {
  pointer-events: none;
}
.icon {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.icon-defs {
  width: 0;
  height: 0;
  position: absolute;
  overflow: hidden;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: fixed;
  top: -50px;
  left: 20px;
  z-index: 100;
  padding: 12px;
  background: white;
}
.skip-link:focus {
  top: 10px;
}
[hidden] {
  display: none !important;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 39px;
  padding: 9px 15px;
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  transition:
    background 0.15s,
    box-shadow 0.15s;
}
.button:hover {
  background: #f7f6fb;
  border-color: #d7d2e6;
}
.button.primary {
  background: var(--purple);
  color: #fff;
  border-color: var(--purple);
  box-shadow: 0 2px 3px #5940ce20;
}
.button.primary:hover {
  background: var(--purple-dark);
  border-color: var(--purple-dark);
  box-shadow: 0 3px 10px #5940ce30;
}
.button.quiet {
  border-color: transparent;
  background: transparent;
}
.button.quiet:hover {
  background: var(--soft);
}
.button.small {
  font-size: 0.8125rem;
  min-height: 33px;
  padding: 6px 9px;
}
.button.large {
  min-height: 46px;
  padding: 12px 23px;
}
.icon-button {
  width: 33px;
  height: 33px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-color: transparent;
  background: transparent;
  font-size: 22px;
}
.icon-button:hover {
  background: var(--soft);
  color: var(--purple);
}
.text-button {
  padding: 0;
  border: 0;
  background: none;
  font-size: 0.8125rem;
  color: var(--purple);
  font-weight: 600;
}
.text-button:hover {
  text-decoration: underline;
}
.app-header {
  height: 76px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 23px;
  position: relative;
  z-index: 5;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 750;
  font-size: 1.65rem;
  text-decoration: none;
  letter-spacing: -1.2px;
}
.brand-dot {
  color: var(--purple);
}
.header-divider {
  width: 1px;
  height: 24px;
  background: var(--line);
}
.app-description {
  font-size: 0.875rem;
  color: var(--muted);
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}
.privacy {
  font-size: 0.8125rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 7px;
  margin-right: 12px;
}
.privacy .icon {
  width: 15px;
  height: 15px;
  color: #7a927d;
}
.chevron {
  display: block;
  width: 6px;
  height: 6px;
  transform: rotate(45deg);
  border-right: 1.5px solid;
  border-bottom: 1.5px solid;
  margin: 0 2px 4px 8px;
}
.popover {
  position: absolute;
  right: 158px;
  top: 65px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  width: 244px;
  box-shadow: 0 15px 50px #25203621;
  padding: 7px;
}
.popover button,
.popover a {
  display: flex;
  justify-content: space-between;
  text-align: left;
  text-decoration: none;
  border: 0;
  background: transparent;
  border-radius: 5px;
  padding: 11px 12px;
  width: 100%;
  font-size: 0.875rem;
}
.popover button:hover,
.popover a:hover {
  background: var(--soft);
}
kbd {
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 500;
  background: #f4f3f7;
  border: 1px solid #e7e5ee;
  border-radius: 4px;
  padding: 2px 5px;
  color: #77727e;
  white-space: nowrap;
}
.editor {
  display: grid;
  grid-template-columns: 274px minmax(0, 1fr) 260px;
  height: calc(100dvh - 76px);
  min-height: 560px;
}
.settings-panel,
.images-panel {
  background: var(--panel);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.settings-panel {
  border-right: 1px solid var(--line);
}
.images-panel {
  border-left: 1px solid var(--line);
}
.panel-title {
  display: flex;
  gap: 9px;
  align-items: center;
  height: 66px;
  min-height: 66px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
}
.panel-title h1,
.panel-title h2 {
  font-size: 0.9375rem;
  font-weight: 650;
  letter-spacing: -0.2px;
}
.panel-title .icon {
  color: #8e86a6;
  width: 17px;
}
.panel-title .text-button,
.panel-title .add-mini {
  margin-left: auto;
}
.panel-title h2 {
  display: flex;
  align-items: center;
  gap: 8px;
}
.count-badge {
  background: #f0eef7;
  color: #86818f;
  min-width: 24px;
  height: 21px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
}
.settings-scroll,
.image-panel-scroll {
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: #dad7e4 transparent;
  flex: 1;
}
.control-section {
  padding: 21px 22px;
  border-bottom: 1px solid var(--line);
}
.control-section h2 {
  font-size: 0.875rem;
  font-weight: 650;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
}
.unit {
  font-size: 0.75rem;
  color: #9993a5;
  font-weight: 400;
}
.layout-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 17px;
}
.layout-option {
  padding: 8px 4px;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #898392;
  min-width: 0;
  background: #fff;
  border: 1px solid #e9e6ef;
}
.layout-option.active {
  color: var(--purple);
  border-color: #9c88ee;
  background: #f7f5ff;
  box-shadow: 0 0 0 1px #6246e50b;
}
.layout-option:hover {
  border-color: #a497d4;
}
.layout-preview {
  height: 25px;
  margin: 1px 3px 8px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 3px;
}
.layout-preview i {
  display: block;
  background: #c7c1d5;
  border-radius: 1px;
}
.active .layout-preview i {
  background: #8e76e8;
}
.layout-preview.featured i:first-child {
  grid-column: span 2;
  grid-row: span 2;
}
.layout-preview.featured i:nth-child(n + 4) {
  display: none;
}
.layout-preview.row {
  grid-template-rows: 1fr;
}
.layout-preview.column {
  grid-template-columns: 1fr;
  grid-template-rows: repeat(3, 1fr);
  margin-inline: 12px;
}
.field-label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.8125rem;
  margin-top: 11px;
  margin-bottom: 3px;
  line-height: 1.4;
}
.field-label output {
  font-variant-numeric: tabular-nums;
  font-size: 0.75rem;
  color: var(--muted);
}
.dimension-fields {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  margin-top: 13px;
}
.dimension-fields label {
  flex: 1;
  min-width: 0;
}
.dimension-fields label span {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 6px;
}
.dimension-fields input {
  font-size: 0.8125rem;
  padding: 8px;
  width: 100%;
  font-variant-numeric: tabular-nums;
}
.dimension-fields .icon-button {
  flex-shrink: 0;
  margin-bottom: 3px;
  width: 24px;
  font-size: 21px;
  color: #9a93a9;
}
.color-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8125rem;
  margin-top: 5px;
  margin-bottom: 12px;
}
.color-control {
  display: flex;
  align-items: center;
  gap: 7px;
}
.color-control span {
  font-family: monospace;
  color: #86818f;
  font-size: 0.6875rem;
}
.swatches {
  display: flex;
  gap: 8px;
  margin: 4px 0 15px;
}
.swatches button {
  width: 23px;
  height: 23px;
  border-radius: 100%;
  background: var(--swatch);
  border: 1px solid #00000018;
  box-shadow: 0 0 0 2px #fff;
}
.swatches button:hover {
  box-shadow: 0 0 0 2px #b8a7f0;
}
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  cursor: pointer;
}
.control-section details {
  margin-top: 17px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
summary {
  font-size: 0.8125rem;
  cursor: pointer;
  color: #777080;
}
details[open] summary {
  margin-bottom: 14px;
}
.hint {
  font-size: 0.75rem;
  color: #928a9b;
  line-height: 1.65;
  margin: 9px 0 13px;
}
.panel-footer {
  display: flex;
  justify-content: center;
  gap: 7px;
  align-items: center;
  border-top: 1px solid var(--line);
  min-height: 43px;
  padding: 10px 12px;
  font-size: 0.6875rem;
  color: #9991a2;
}
.panel-footer .icon {
  width: 12px;
  height: 12px;
}
.workspace {
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #f5f5fa;
}
.workspace-toolbar {
  height: 66px;
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  gap: 12px;
  border-bottom: 1px solid #e9e8f080;
  background: #fafafd;
}
.toolbar-group {
  display: flex;
  align-items: center;
  gap: 4px;
}
.workspace-label {
  font-size: 0.625rem;
  letter-spacing: 1.8px;
  color: #9a93a8;
  font-weight: 600;
  margin-right: 6px;
}
.toolbar-separator {
  width: 1px;
  height: 19px;
  background: var(--line);
  margin: 0 8px;
}
.toolbar-group .icon {
  width: 16px;
  height: 16px;
}
.toolbar-group .button.quiet {
  font-weight: 500;
  color: #81798e;
  font-size: 0.75rem;
}
.zoom-select {
  width: 66px;
  font-size: 0.75rem;
  background-color: transparent;
  border-color: transparent;
  padding-left: 6px;
  margin-left: 4px;
}
.canvas-viewport {
  position: relative;
  display: flex;
  align-items: safe center;
  justify-content: safe center;
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 44px;
  overscroll-behavior: contain;
  background-image: radial-gradient(#d7d5e2 0.7px, transparent 0.7px);
  background-size: 18px 18px;
}
.empty-state {
  text-align: center;
  display: flex;
  align-items: center;
  flex-direction: column;
  padding: 26px 0 40px;
  max-width: 100%;
  margin: auto;
}
.empty-art {
  width: 204px;
  height: 176px;
  position: relative;
  margin-bottom: 35px;
  transform: rotate(-5deg);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  filter: drop-shadow(0 12px 15px #5b49891c);
}
.art-tile {
  position: relative;
  border: 5px solid #fff;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 0 0 1px #d5d1df70;
}
.tile-one {
  background: #dbd4f6;
}
.tile-two {
  background: #e7d7cc;
}
.tile-three {
  background: #d2dfd8;
}
.tile-four {
  background: #e8e2f5;
  border: 1px dashed #b5a9d2;
  box-shadow: none;
  display: grid;
  place-items: center;
  transform: translate(6px, 4px) rotate(8deg);
}
.tile-four svg {
  fill: none;
  stroke: #b8a9d4;
  stroke-width: 1;
  width: 30px;
  height: 30px;
}
.sun {
  position: absolute;
  left: 55%;
  top: 15%;
  width: 18px;
  height: 18px;
  background: #faf5e6;
  border-radius: 100%;
}
.mountain {
  position: absolute;
  width: 130px;
  height: 90px;
  left: -30px;
  top: 43px;
  transform: rotate(45deg);
  background: #a49bc2;
  border-radius: 8px;
}
.tile-one .mountain:after {
  content: "";
  position: absolute;
  background: #beb3d9;
  width: 80px;
  height: 100px;
  left: 30px;
  top: -45px;
}
.tile-two .mountain {
  background: #bc9e86;
  top: 49px;
  left: 12px;
}
.tile-three .mountain {
  background: #829c92;
  top: 52px;
  left: -5px;
}
.tile-three .sun {
  background: #e8ede0;
  left: 70%;
  top: 18%;
}
.art-spark {
  position: absolute;
  transform: rotate(5deg);
  color: #b3a3dc;
  font-size: 24px;
}
.spark-one {
  top: 10px;
  left: -33px;
}
.spark-two {
  right: -25px;
  bottom: 1px;
  font-size: 17px;
}
.eyebrow {
  font-size: 0.625rem;
  letter-spacing: 1.8px;
  font-weight: 650;
  color: #9d90bb;
}
.empty-state h2 {
  font-size: clamp(1.5rem, 2.15vw, 2rem);
  letter-spacing: -1.1px;
  font-weight: 650;
  color: #3a324b;
  margin: 13px 0 14px;
}
.empty-state p {
  font-size: 0.875rem;
  line-height: 1.8;
  color: #91889f;
  margin-bottom: 25px;
}
.empty-or {
  margin: 16px 0 0;
  font-size: 0.8125rem;
  color: #a49aae;
}
.empty-or .text-button {
  font-weight: 500;
  margin-left: 3px;
}
.file-types {
  margin-top: 33px;
  font-size: 0.6875rem;
  color: #aba2b7;
}
.workspace-status {
  height: 43px;
  min-height: 43px;
  border-top: 1px solid var(--line);
  background: #fafafd;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 20px;
  color: #a098ab;
  font-size: 0.6875rem;
}
.workspace-status .text-button {
  font-size: 0.6875rem;
  color: #9990a6;
  font-weight: 400;
}
.status-dot {
  margin: 0 5px;
}
.canvas-container {
  position: relative;
  flex: none;
  box-shadow: 0 8px 35px #3f345125;
  background: repeating-conic-gradient(#ecebf0 0% 25%, white 0% 50%) 50%/16px
    16px;
  line-height: 0;
}
canvas {
  width: 100%;
  height: 100%;
  display: block;
}
.cell-overlays {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.cell-hit {
  position: absolute;
  pointer-events: auto;
  border: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  padding: 0;
  cursor: grab;
  touch-action: pan-y;
}
.cell-hit:hover {
  border-color: #a18cf2;
  background: #ffffff08;
}
.cell-hit.selected {
  border: 2px solid #8a68fa;
  box-shadow:
    0 0 0 1px #fff,
    0 0 0 3px #8a68fa55;
  z-index: 1;
}
.cell-hit.crop-mode {
  cursor: move;
  border-style: dashed;
  touch-action: none;
}
.cell-hit.drag-over {
  border: 3px dashed #6246e5;
  background: #6246e530;
}
.cell-hit .cell-number {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  background: #ffffffea;
  font-size: 10px;
  display: none;
  align-items: center;
  justify-content: center;
  color: var(--purple);
  font-weight: 700;
  box-shadow: 0 1px 4px #0002;
}
.cell-hit.selected .cell-number {
  display: flex;
}
.drop-overlay {
  position: fixed;
  inset: 90px 20px 20px;
  background: #f5f2fff5;
  z-index: 30;
  border: 3px dashed #9c86ea;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  pointer-events: none;
  color: var(--purple);
  gap: 12px;
  box-shadow: 0 0 0 40px #ffffffa0;
}
.drop-overlay .icon {
  width: 50px;
  height: 50px;
  stroke-width: 1;
}
.drop-overlay strong {
  font-size: 1.5rem;
}
.drop-overlay span {
  font-size: 0.875rem;
  color: #9c8db8;
}
.image-panel-scroll {
  padding: 18px 18px 24px;
}
.upload-box {
  width: 100%;
  display: flex;
  align-items: center;
  flex-direction: column;
  border: 1px dashed #d9d2e9;
  background: #fdfcff;
  padding: 21px 5px;
  border-radius: 8px;
  gap: 9px;
}
.upload-box:hover {
  background: var(--soft);
  border-color: #b5a2ea;
}
.upload-box .icon {
  color: #9e8dc4;
  width: 22px;
  height: 22px;
  margin-bottom: 4px;
}
.upload-box strong {
  font-size: 0.75rem;
  font-weight: 550;
  color: #8e7eaa;
}
.upload-box span {
  font-size: 0.625rem;
  color: #afa4bd;
}
.library-empty {
  padding: 48px 0;
  text-align: center;
  color: #b6acbf;
}
.library-empty .icon {
  width: 31px;
  height: 31px;
  stroke-width: 1.2;
  color: #c8bfce;
}
.library-empty p {
  font-size: 0.75rem;
  margin: 14px 0 8px;
  color: #a095ad;
}
.library-empty span {
  font-size: 0.6875rem;
  line-height: 1.8;
}
.library-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 17px 0 11px;
}
.library-actions .text-button {
  font-size: 0.6875rem;
  font-weight: 500;
}
.library-actions select {
  font-size: 0.6875rem;
  width: 113px;
  min-height: 30px;
  padding: 5px 18px 5px 6px;
  border-color: transparent;
  background-position: right 2px center;
}
.image-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}
.image-thumb {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 2px solid transparent;
  padding: 0;
  min-width: 0;
  border-radius: 6px;
  background: #f5f3f8;
  overflow: hidden;
  text-align: left;
  cursor: grab;
}
.image-thumb img {
  width: 100%;
  aspect-ratio: 1.18;
  object-fit: cover;
  pointer-events: none;
}
.image-thumb .thumb-name {
  padding: 6px;
  font-size: 0.625rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  color: #9c91a9;
  background: #fbfaff;
}
.image-thumb .thumb-order {
  position: absolute;
  top: 5px;
  left: 5px;
  min-width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  background: #fffdfde6;
  border-radius: 3px;
  color: #6c597f;
  font-size: 0.625rem;
}
.image-thumb.selected {
  border-color: var(--purple);
  background: var(--soft);
}
.image-thumb.selected .thumb-name {
  color: var(--purple);
  background: var(--soft);
}
.image-thumb.selected .thumb-order {
  background: var(--purple);
  color: white;
}
.image-thumb:hover {
  border-color: #c6b6f4;
}
.image-thumb.drag-over {
  border-style: dashed;
  border-color: var(--purple);
}
.selection-editor {
  margin-top: 23px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}
.selection-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}
.selection-heading h3 {
  font-size: 0.8125rem;
  font-weight: 600;
}
.selection-heading .text-button {
  font-size: 0.6875rem;
}
.selection-editor select,
.selection-editor input[type="text"] {
  font-size: 0.75rem;
}
.selection-editor .hint {
  font-size: 0.6875rem;
}
.selection-editor .field-label {
  font-size: 0.75rem;
}
.selection-editor input[type="range"] {
  margin-bottom: 11px;
}
.image-tool-buttons {
  display: flex;
  gap: 5px;
  margin: 10px 0;
}
.image-tool-buttons .button {
  font-size: 0.6875rem;
  padding: 5px 7px;
  flex: 1;
}
.image-tool-buttons .icon {
  width: 14px;
  height: 14px;
}
.selection-editor > #reset-image {
  font-size: 0.6875rem;
  margin-top: 5px;
  font-weight: 500;
}
.selection-footer {
  display: flex;
  gap: 7px;
  border-top: 1px solid var(--line);
  padding-top: 15px;
  margin-top: 19px;
}
.selection-footer .button {
  flex: 1;
  font-size: 0.6875rem;
}
.selection-footer .icon {
  width: 14px;
  height: 14px;
}
.danger {
  color: #bb5967;
}
.danger:hover {
  background: #fff1f3;
}
.toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  background: #322b43;
  color: white;
  padding: 13px 21px;
  border: 1px solid #fff2;
  border-radius: 10px;
  font-size: 0.8125rem;
  z-index: 100;
  box-shadow: 0 8px 25px #0002;
  max-width: min(540px, 90vw);
  line-height: 1.5;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 26px;
  max-width: 560px;
  width: calc(100% - 32px);
  max-height: 90dvh;
  overflow: auto;
  box-shadow: 0 30px 100px #29213c30;
  color: #3e354e;
  background: #fff;
}
dialog::backdrop {
  background: #29213c60;
  backdrop-filter: blur(4px);
}
.dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}
.dialog-heading h2 {
  font-size: 1.4rem;
  font-weight: 650;
  letter-spacing: -0.6px;
  margin-top: 8px;
}
.export-preview-wrap {
  height: 210px;
  background: #f6f4fa;
  border-radius: 8px;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-image: radial-gradient(#e0dce8 0.7px, transparent 0.7px);
  background-size: 12px 12px;
}
.export-preview-wrap img {
  max-width: 100%;
  max-height: 100%;
  box-shadow: 0 3px 13px #3621461f;
}
.export-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 22px 0 16px;
}
.export-fields > label {
  font-size: 0.8125rem;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.export-fields output {
  float: right;
  align-self: flex-end;
  margin-top: -24px;
  font-size: 0.75rem;
  color: var(--muted);
}
.export-fields input[type="range"] {
  margin-top: 18px;
}
.export-fields select,
.export-fields input {
  font-size: 0.8125rem;
}
.export-details {
  font-size: 0.75rem;
  color: #8b8099;
  line-height: 1.6;
  min-height: 20px;
}
.dialog-footer {
  border-top: 1px solid var(--line);
  padding-top: 18px;
  margin-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.dialog-footer span {
  font-size: 0.75rem;
  color: #a094ac;
}
.help-body {
  font-size: 0.875rem;
  line-height: 1.8;
  color: #8c809a;
}
.help-body p {
  margin: 16px 0;
}
.help-body dl {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin: 20px 0;
}
.help-body dt,
.help-body dd {
  margin: 0;
}
.error {
  font-size: 0.8125rem;
  color: #bc4054;
  line-height: 1.6;
  margin-top: 12px;
}
#confirm-dialog > p {
  font-size: 0.875rem;
  color: #9a8ba7;
  line-height: 1.8;
}
.noscript {
  position: fixed;
  top: 80px;
  left: 10px;
  right: 10px;
  padding: 30px;
  background: #fff1f1;
  z-index: 100;
}
@media (min-width: 1600px) {
  .editor {
    grid-template-columns: 292px minmax(0, 1fr) 280px;
  }
  .control-section {
    padding-inline: 26px;
  }
  .empty-state h2 {
    font-size: 2.25rem;
  }
  .empty-art {
    width: 225px;
    height: 192px;
  }
  .empty-state {
    padding-bottom: 60px;
  }
  .empty-state p {
    font-size: 0.9375rem;
  }
  .image-panel-scroll {
    padding: 22px;
  }
  .canvas-viewport {
    padding: 60px;
  }
}
@media (max-width: 1150px) {
  .editor {
    grid-template-columns: 242px minmax(0, 1fr) 222px;
  }
  .app-description,
  .privacy {
    display: none;
  }
  .app-header {
    padding: 0 20px;
  }
  .control-section {
    padding: 19px 17px;
  }
  .panel-title {
    padding: 0 17px;
  }
  .image-panel-scroll {
    padding: 15px;
  }
  .canvas-viewport {
    padding: 28px;
  }
  .workspace-toolbar {
    padding: 0 13px;
  }
  .workspace-label {
    display: none;
  }
  .toolbar-separator {
    display: none;
  }
  #interaction-hint {
    display: none;
  }
  .empty-state h2 {
    font-size: 1.55rem;
  }
  .empty-state p {
    font-size: 0.8125rem;
  }
  .empty-art {
    width: 165px;
    height: 145px;
  }
  .file-types {
    max-width: 240px;
    line-height: 1.7;
  }
  .desktop-break {
    display: none;
  }
  .upload-box span {
    font-size: 0.5625rem;
  }
  .button.small {
    padding: 6px;
  }
  .image-tool-buttons {
    flex-wrap: wrap;
  }
}
@media (max-width: 850px) {
  .app-header {
    height: 65px;
    padding: 0 16px;
    gap: 10px;
  }
  .header-divider {
    display: none;
  }
  .header-actions {
    gap: 5px;
  }
  .header-actions .button {
    padding: 9px 10px;
    font-size: 0.8125rem;
  }
  .brand {
    font-size: 1.5rem;
  }
  .brand img {
    width: 29px;
    height: 29px;
  }
  .editor {
    height: auto;
    min-height: calc(100dvh - 65px);
    grid-template-columns: 236px minmax(0, 1fr);
  }
  .settings-panel {
    grid-row: 1 / span 2;
    max-height: calc(100dvh - 65px);
    position: sticky;
    top: 0;
  }
  .workspace {
    height: calc(100dvh - 65px);
    min-height: 540px;
  }
  .images-panel {
    grid-column: 2;
    min-height: 250px;
    border-top: 1px solid var(--line);
    border-left: 0;
  }
  .images-panel .image-panel-scroll {
    overflow: visible;
  }
  .images-panel .image-list {
    grid-template-columns: repeat(4, 1fr);
  }
  .images-panel .selection-editor {
    max-width: 400px;
    margin-inline: auto;
  }
  .library-empty {
    padding: 20px;
  }
  .images-panel .panel-footer {
    display: none;
  }
  .images-panel .upload-box {
    padding: 12px;
  }
  .images-panel .upload-box span {
    font-size: 0.6875rem;
  }
  .workspace-toolbar {
    height: 52px;
    min-height: 52px;
  }
  .workspace-toolbar .button {
    font-size: 0.6875rem;
  }
  .canvas-viewport {
    padding: 24px;
  }
  .workspace-status {
    padding: 0 12px;
  }
  .popover {
    right: 115px;
    top: 58px;
  }
}
@media (max-width: 570px) {
  .app-header {
    height: 62px;
  }
  .brand {
    font-size: 1.4rem;
  }
  .brand img {
    width: 27px;
    height: 27px;
  }
  .header-actions .button {
    min-height: 35px;
    padding: 8px;
    font-size: 0.75rem;
  }
  .header-actions .icon {
    width: 15px;
    height: 15px;
  }
  .editor {
    display: flex;
    flex-direction: column;
  }
  .workspace {
    order: 0;
    height: 72dvh;
    min-height: 510px;
  }
  .settings-panel {
    order: 1;
    position: static;
    max-height: none;
    border-right: 0;
    border-top: 1px solid var(--line);
  }
  .images-panel {
    order: 2;
    border-left: 0;
  }
  .settings-scroll {
    display: grid;
    grid-template-columns: 1fr 1fr;
    overflow: visible;
  }
  .control-section {
    padding: 20px 16px;
  }
  .control-section:nth-child(odd) {
    border-right: 1px solid var(--line);
  }
  .control-section h2 {
    font-size: 0.8125rem;
  }
  .layout-options {
    gap: 4px;
  }
  .layout-option {
    font-size: 0.625rem;
    padding: 8px 1px;
  }
  .layout-preview {
    margin-inline: 3px;
    height: 23px;
  }
  .dimension-fields {
    gap: 3px;
  }
  .dimension-fields input {
    padding: 7px 5px;
  }
  .dimension-fields .icon-button {
    width: 20px;
  }
  .field-label {
    font-size: 0.75rem;
  }
  .color-control span {
    display: none;
  }
  .swatches {
    gap: 6px;
  }
  .swatches button {
    width: 20px;
    height: 20px;
  }
  .checkbox-row {
    font-size: 0.6875rem;
  }
  .settings-panel .panel-footer {
    display: none;
  }
  .settings-panel .panel-title {
    height: 54px;
    min-height: 54px;
  }
  .images-panel .image-list {
    grid-template-columns: repeat(3, 1fr);
  }
  .image-panel-scroll {
    padding: 18px;
  }
  .empty-art {
    width: 158px;
    height: 137px;
    margin-bottom: 27px;
  }
  .empty-state h2 {
    font-size: 1.65rem;
  }
  .file-types {
    margin-top: 24px;
    max-width: 320px;
  }
  .empty-state {
    padding: 20px 0;
  }
  .canvas-viewport {
    padding: 24px;
  }
  .export-fields {
    gap: 12px;
  }
  .dialog-heading h2 {
    font-size: 1.2rem;
  }
  .dialog-footer span {
    font-size: 0.6875rem;
  }
  .toolbar-group .button.small {
    font-size: 0.75rem;
  }
  .workspace-status {
    font-size: 0.6875rem;
  }
  .popover {
    right: 10px;
    top: 55px;
  }
  .panel-footer {
    font-size: 0.75rem;
  }
  .upload-box strong {
    font-size: 0.875rem;
  }
  .upload-box span {
    font-size: 0.75rem !important;
  }
}
.editor {
  height: calc(100dvh - 130px);
}
.site-footer {
  min-height: 54px;
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  border-top: 1px solid var(--line);
  background: #fafafd;
  color: #928a9f;
  font-size: 0.75rem;
}
.site-footer a {
  text-decoration: none;
  line-height: 1.5;
}
.site-footer a:hover {
  color: var(--purple);
}
.github-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.field-label,
.color-row,
.checkbox-row,
.selection-editor .field-label,
.selection-heading h3,
.selection-editor select,
.selection-editor input[type="text"],
.image-tool-buttons .button,
.selection-footer .button {
  font-size: 0.875rem;
}
.layout-option {
  font-size: 0.75rem;
}
.workspace-toolbar .button.small {
  font-size: 0.8125rem;
}
.upload-box strong {
  font-size: 0.875rem;
}
.hint {
  font-size: 0.8125rem;
}
.image-thumb .thumb-name {
  font-size: 0.75rem;
}
.image-tool-buttons {
  flex-wrap: wrap;
}
@media (max-width: 850px) {
  .editor {
    height: auto;
  }
  .workspace {
    height: calc(100dvh - 119px);
  }
  .settings-panel {
    max-height: calc(100dvh - 119px);
  }
}
@media (max-width: 570px) {
  .workspace {
    height: 72dvh;
  }
  .settings-panel {
    max-height: none;
  }
  .site-footer {
    padding: 18px 20px;
    min-height: 58px;
    font-size: 0.6875rem;
  }
  .field-label,
  .color-row,
  .checkbox-row {
    font-size: 0.8125rem;
  }
  .layout-option {
    font-size: 0.6875rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
