:root {
  color-scheme: light;
  color: #22201c;
  background: #f7f5f2;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

body { margin: 0; }

.topbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 62px;
  padding: 0 4vw;
  border-bottom: 1px solid #e4ded7;
  background: #fff;
}

.topbar h1 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.topbar-mark {
  display: grid;
  place-items: center;
  width: 30px;
  aspect-ratio: 1;
  border-radius: 7px;
  background: #26231f;
  color: #fff;
}

.topbar-mark svg,
.download svg {
  width: 19px;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.editor {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  align-items: start;
  gap: clamp(20px, 3vw, 44px);
  width: min(92vw, 1270px);
  margin: clamp(24px, 4vw, 48px) auto;
}

.controls,
.preview {
  min-width: 0;
  border: 1px solid #e5dfd7;
  border-radius: 14px;
  background: #fff;
}

.controls { padding: clamp(18px, 2.45vw, 30px); }

.controls h2,
.preview-header h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

#editor-form { margin-top: 22px; }

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 17px;
}

.field label {
  font-size: 0.82rem;
  font-weight: 620;
}

.field textarea,
.field select,
.field input {
  width: 100%;
  min-width: 0;
  border: 1px solid #d7d0c8;
  border-radius: 7px;
  background: #fff;
  color: inherit;
  font: inherit;
  font-size: 0.91rem;
}

.field textarea,
.field select { padding: 10px 11px; }

.field textarea {
  min-height: 4.3rem;
  line-height: 1.4;
  resize: vertical;
}

.field input {
  padding: 7px;
  font-size: 0.79rem;
}

.field input::file-selector-button {
  margin-right: 8px;
  padding: 6px 8px;
  border: 0;
  border-radius: 4px;
  background: #eeebe6;
  color: #26231f;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid #aa2632;
  outline-offset: 2px;
}

.reset-photo {
  justify-self: start;
  padding: 4px 0;
  border: 0;
  background: none;
  color: #60554a;
  font: inherit;
  font-size: 0.8rem;
  text-decoration: underline;
  cursor: pointer;
}

.download {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  width: 100%;
  min-height: 43px;
  padding: 8px;
  border: 1px solid #2b2824;
  border-radius: 7px;
  background: #2b2824;
  color: #fff;
  font: inherit;
  font-size: 0.87rem;
  font-weight: 650;
  cursor: pointer;
}

.download:not(:disabled):hover { background: #413a32; }
.download:disabled { opacity: 0.65; cursor: wait; }

.feedback {
  margin: 9px 0 0;
  color: #926323;
  font-size: 0.79rem;
  line-height: 1.45;
}

.feedback:empty { display: none; }

.preview { overflow: hidden; }

.preview-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  padding: 17px clamp(16px, 3vw, 25px);
}

#dimensions {
  color: #645d54;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.preview-surface {
  min-height: 200px;
  padding: clamp(12px, 3.2vw, 34px);
  border-top: 1px solid #e5dfd7;
  background: #eae5dd;
}

.preview-surface .ad-sheet {
  max-width: 560px;
  box-shadow: 0 10px 30px #483a2925, 0 2px 5px #483a2920;
}

@media (max-width: 680px) {
  .editor { grid-template-columns: 1fr; }
}
