:root {
  --bg: #efe6d4;
  --ink: #1a1714;
  --muted: #6e655b;
  --card: #fffaf2;
  --line: #e0d3bd;
  --accent: #8d3429;
  --accent-ink: #fff8f2;
  --green: #1e4a38;
  --shadow: 0 18px 40px rgba(58, 40, 18, 0.08);
  --radius: 22px;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  min-height: 100vh;
  color: var(--ink);
  font-family: "Segoe UI", Tahoma, sans-serif;
  background:
    radial-gradient(circle at 12% -10%, #f7f1e4 0, transparent 42%),
    radial-gradient(circle at 100% 0, #e7d3bf 0, transparent 36%),
    var(--bg);
  line-height: 1.6;
}

.top, main, footer {
  width: min(1080px, calc(100% - 32px));
  margin-inline: auto;
}

.top { padding: 36px 0 8px; }

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.mark {
  width: 52px;
  height: 52px;
  flex: none;
  border-radius: 14px;
  background:
    linear-gradient(var(--ink), var(--ink)) 8px 8px / 14px 14px no-repeat,
    linear-gradient(var(--ink), var(--ink)) 30px 8px / 14px 14px no-repeat,
    linear-gradient(var(--ink), var(--ink)) 8px 30px / 14px 14px no-repeat,
    linear-gradient(#fffaf2, #fffaf2) 11px 11px / 8px 8px no-repeat,
    linear-gradient(#fffaf2, #fffaf2) 33px 11px / 8px 8px no-repeat,
    linear-gradient(#fffaf2, #fffaf2) 11px 33px / 8px 8px no-repeat,
    var(--accent);
  box-shadow: inset 0 0 0 3px var(--ink);
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

h1, h2 { margin: 0; font-weight: 750; }

h1 { font-size: 1.85rem; line-height: 1.25; }

.lede {
  max-width: 46rem;
  margin: 14px 0 0;
  color: var(--muted);
}

main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  padding: 18px 0 28px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}

.card-head p {
  margin: 6px 0 16px;
  color: var(--muted);
}

.field {
  display: block;
  font-weight: 650;
  margin-bottom: 8px;
}

textarea, select, input[type="range"] {
  width: 100%;
  font: inherit;
  color: inherit;
}

textarea {
  resize: vertical;
  min-height: 120px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

textarea:focus, select:focus, input:focus-visible, button:focus-visible, .drop:focus-within {
  outline: 3px solid rgba(141, 52, 41, 0.28);
  outline-offset: 2px;
}

.controls {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 14px;
  margin-top: 14px;
}

.compact span, .swatch {
  display: block;
  margin-bottom: 6px;
  font-weight: 650;
}

select {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.colors {
  display: flex;
  gap: 18px;
  margin: 14px 0;
}

.swatch input {
  display: block;
  width: 54px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
}

.preview {
  min-height: 240px;
  display: grid;
  place-items: center;
  margin-bottom: 8px;
  border-radius: 16px;
  background:
    linear-gradient(45deg, #f3eadc 25%, transparent 25%),
    linear-gradient(-45deg, #f3eadc 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #f3eadc 75%),
    linear-gradient(-45deg, transparent 75%, #f3eadc 75%);
  background-size: 22px 22px;
  background-position: 0 0, 0 11px, 11px -11px, -11px 0;
  background-color: #faf6ee;
  border: 1px dashed #d7c8ae;
}

.qr-box canvas, .qr-box img {
  display: block !important;
  width: min(100%, 320px);
  height: auto !important;
  image-rendering: pixelated;
  background: #fff;
  border-radius: 8px;
}

.placeholder, .status {
  margin: 8px 0;
  color: var(--muted);
}

.status.error { color: var(--accent); }
.status.ok { color: var(--green); }

button, .ghost {
  font: inherit;
  cursor: pointer;
  border-radius: 12px;
  text-decoration: none;
  text-align: center;
}

.primary {
  border: 0;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 11px 16px;
  font-weight: 700;
}

.primary:disabled {
  cursor: not-allowed;
  background: #c9b8a6;
}

.drop {
  display: grid;
  place-items: center;
  gap: 4px;
  min-height: 150px;
  margin-bottom: 14px;
  border: 1.5px dashed #c9b396;
  border-radius: 16px;
  background: #fff;
  text-align: center;
  cursor: pointer;
}

.drop.over {
  border-color: var(--green);
  background: #f3f8f4;
}

.pickers {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 8px;
}

.file-btn { position: relative; }

.file-btn input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.drop-title { font-weight: 750; }
.drop-hint { color: var(--muted); font-size: 0.92rem; }

.shot {
  margin: 0 0 12px;
}

.shot img {
  display: block;
  max-width: 100%;
  max-height: 220px;
  margin-inline: auto;
  border-radius: 12px;
  border: 1px solid var(--line);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.ghost {
  display: inline-flex;
  align-items: center;
  padding: 11px 16px;
  border: 1px solid var(--green);
  color: var(--green);
  font-weight: 700;
  background: #fff;
}

.ghost[hidden],
.qr-box[hidden],
.shot[hidden] {
  display: none;
}

footer {
  padding: 0 0 36px;
  color: var(--muted);
}

@media (max-width: 860px) {
  main, .controls { grid-template-columns: 1fr; }
  h1 { font-size: 1.55rem; }
}
