:root{
  --bg: #fadab2;
  --panel: #e0c2a3a5;
  --text: #1f1a17;
  --muted: #6f625c;
  --border: #25754a;
  --accent: #ff914d;
  --accent-dark: #25754a;
  --accent-soft: #f1e7de;
  --shadow: 0 10px 30px rgba(31,26,23,.08);
  --radius: 18px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  background: linear-gradient(180deg, var(--bg), #fff);
  color: var(--text);
}

#designerApp {
  min-height: 100vh;
  padding: 16px 0;
}

.wrap {
  max-width: 1100px;
  margin: auto;
  padding: 16px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: visible;
}

.header {
  padding: 18px;
  border-bottom: 1px solid var(--border);
}

.header h1 { margin: 0; }
.header p { margin: 6px 0 0; color: var(--muted); }

.grid {
  display: grid;
  grid-template-columns: 1fr;
}

.form {
  padding: 18px;
  border-bottom: 1px solid var(--border);
}

.preview-panel {
  padding: 18px;
  background: #fbf8f5;
}

.row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.field { margin-bottom: 12px; }

label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
}

input[type="file"] {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 10px;
  background: #fff;
}

.hint {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.variant-status {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text);
}

select {
  width: 100%;
  height: 46px;
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 0 10px;
  background: #fff;
  color: var(--text);
  outline: none;
}

select:focus {
  border-color: var(--accent-dark);
  box-shadow: 0 0 0 3px rgba(37,117,74,.15);
}

.back-wrap { display: none; }

.preview-box {
  min-height: 280px;
  border: 1px dashed var(--border);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  text-align: center;
  padding: 16px;
  overflow: hidden;
}

.summary {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  line-height: 1.5;
}

.actions {
  display: grid;
  gap: 10px;
}

button {
  height: 48px;
  border: none;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
}

.preview {
  background: var(--accent-soft);
  color: var(--text);
}

.cart {
  background: var(--accent);
  color: white;
}

.preview-pair {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: flex-start;
  flex-wrap: wrap;
  width: 100%;
}

.preview-pair img,
.preview-stack img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
}

.preview-pair img {
  width: min(45%, 280px);
}

.preview-stack img {
  width: min(90%, 360px);
}

@media (min-width: 768px) {
  .grid { grid-template-columns: 1fr 1fr; }
  .row { grid-template-columns: 1fr 1fr; }
  .actions { grid-template-columns: 1fr 1fr; }
}