:root {
  color-scheme: light;
  font-family: system-ui, sans-serif;
  color: #26372d;
  background: #f4efe5;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background-color: #71472d;
  background-image: radial-gradient(ellipse at 38% 12%, #f8b66123, #24120977 85%), url(poyta.webp);
  background-size: cover, 1440px 1000px;
}
main { width: min(100% - 44px, 1056px); margin: 0 auto; padding: 36px 0 60px; }
.intro { text-align: center; margin-bottom: 36px; color: #fff3db; text-shadow: 0 2px 7px #28170e; }
h1, h2 { margin: 0; font-family: Georgia, serif; }
h1 { font-size: clamp(2rem, 6vw, 3.65rem); font-weight: normal; letter-spacing: -.035em; }
.intro p { margin: 10px 0 0; color: #faedda; }
.workbench { display: grid; grid-template-columns: 1fr minmax(340px, 460px); gap: clamp(20px, 5vw, 60px); align-items: start; }
.preview { display: grid; justify-items: center; align-content: start; gap: 21px; padding: 12px 15px 22px; color: #fff3db; }
h2 { font-size: 1.45rem; }
.preview h2 { font-size: 1.15rem; font-weight: normal; text-shadow: 0 2px 7px #28170e; }
canvas {
  display: block;
  width: min(100%, 348px);
  height: auto;
  aspect-ratio: 9 / 14;
  background: #eee3cd;
  border-radius: 2px;
  transform: rotate(-2.5deg);
  box-shadow: 2px 3px 0 #bf9d72, 8px 16px 28px #2b140cb3, 2px 5px 9px #2b140c90;
}
.editor {
  position: relative;
  padding: clamp(21px, 4vw, 37px);
  color: #362b21;
  background: linear-gradient(150deg, #fff7e5, #f2e0bf);
  border: 1px solid #e3c79b;
  border-radius: 3px;
  box-shadow: 2px 3px 0 #b59162, 5px 7px 0 -1px #ebd5af, 9px 15px 30px #28140e94;
}
.editor h2 { margin-bottom: 21px; padding-bottom: 11px; border-bottom: 1px solid #b59261; }
label { display: block; font-size: .92rem; font-weight: 700; margin: 16px 0 6px; }
label span, small { color: #586252; font-weight: normal; }
input, textarea { display: block; width: 100%; border: 1px solid #a99677; border-radius: 8px; background: #fffaf0; color: #26372d; font: inherit; font-size: 16px; padding: 10px 12px; }
textarea { resize: vertical; }
small { display: block; margin-top: 5px; font-size: .78rem; }
.counter { text-align: right; }
.actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 23px; }
button { flex: 1 0 auto; min-height: 46px; padding: 10px 15px; border: 1px solid #25483c; border-radius: 8px; background: #25483c; color: white; font: inherit; font-weight: 700; cursor: pointer; }
button.secondary { color: #25483c; background: transparent; }
button:disabled { opacity: .55; cursor: default; }
button[hidden] { display: none; }
:focus-visible { outline: 3px solid #9a6225; outline-offset: 3px; }
.status { margin: 10px 0 0; font-size: .85rem; }
.status:empty { display: none; }
@media (max-width: 675px) {
  main { padding-top: 26px; }
  .intro { margin-bottom: 20px; }
  .workbench { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .preview { padding: 8px 14px 14px; gap: 14px; }
  canvas { width: min(100%, 230px); }
}
dialog { width: min(92vw, 470px); max-height: 92dvh; padding: 16px; border: 1px solid #ded3bf; border-radius: 16px; background: #fffaf2; color: #26372d; }
dialog::backdrop { background: #142b25b8; }
.save-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#save-help { font-size: .9rem; margin: 8px 0 12px; }
#export-image { display: block; height: auto; width: min(100%, 33dvh, 285px); margin: auto; -webkit-touch-callout: default; }
.save-link { display: block; margin-top: 12px; padding: 12px; background: #25483c; border-radius: 8px; color: white; text-align: center; font-weight: 700; }
.text-colors { margin: 20px 0 0; padding: 0; border: 0; min-width: 0; }
.text-colors legend { padding: 0; font-weight: 700; }
.text-colors label { margin-top: 10px; font-weight: 500; }
.editor select { width: 100%; min-height: 44px; border: 1px solid #a99677; border-radius: 8px; background: #fffaf0; color: #26372d; padding: 8px 12px; font: inherit; font-size: 16px; }

#choose-artwork { background: #fbefd7; color: #362b21; border-color: #b59261; margin-bottom: 5px; }
#artwork-gallery { width: min(92vw, 720px); }
.artwork-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 116px), 1fr)); gap: 10px; margin-top: 15px; }
.artwork-option { display: grid; align-content: start; gap: 6px; min-width: 0; padding: 5px; background: #fffaf0; color: #26372d; border: 2px solid #c7b394; font-size: .82rem; }
.artwork-option[aria-pressed="true"] { border-color: #25483c; background: #25483c; color: white; }
.artwork-option img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 3px; }
