:root {
  --bg: #f5f5f3;
  --card: #ffffff;
  --text: #111;
  --muted: #6b6b6b;
  --line: #e2e2de;
  --brand: #0f3d2e;
  --accent: #0f3d2e;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 "Urbanist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 1040px; margin: 0 auto; padding: 32px 16px 48px; }
.top { margin-bottom: 28px; }
.brand { margin: 0 0 12px; line-height: 0; }
.brand img { display: block; height: 88px; width: auto; max-width: 100%; }
@media (max-width: 480px) { .brand img { height: 68px; } }
h1 { font-size: 32px; letter-spacing: -0.02em; margin: 4px 0 4px; }
.sub { color: var(--muted); margin: 0; }

.layout { display: grid; grid-template-columns: 340px 1fr; gap: 32px; align-items: start; }
@media (max-width: 760px) { .layout { grid-template-columns: 1fr; } .preview { order: -1; } }

.drop {
  display: flex; flex-direction: column; gap: 4px; align-items: center; justify-content: center;
  text-align: center; padding: 28px 16px; border: 2px dashed var(--line); border-radius: 14px;
  background: var(--card); cursor: pointer; transition: border-color .15s, background .15s;
}
.drop:hover, .drop.over { border-color: var(--accent); background: #f0f5f2; }
.drop strong { font-size: 16px; }
.drop span { color: var(--muted); font-size: 13px; }
.note { font-size: 13px; color: #8a5a00; background: #fff6e0; border-radius: 10px; padding: 8px 12px; margin: 10px 0 0; }

.themes { border: 0; padding: 0; margin: 24px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.themes legend { font-weight: 600; margin-bottom: 10px; padding: 0; }
.theme { position: relative; cursor: pointer; display: flex; flex-direction: column; gap: 6px; align-items: center; font-size: 12px; text-align: center; }
.theme input { position: absolute; opacity: 0; }
.theme img {
  width: 100%; aspect-ratio: 4/5; object-fit: cover; border-radius: 8px;
  border: 2px solid var(--line); background: repeating-conic-gradient(#e9e9e6 0 25%, #fff 0 50%) 0 0/14px 14px;
}
.theme input:checked + img { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(15,61,46,.15); }
.theme input:focus-visible + img { outline: 2px solid var(--accent); outline-offset: 2px; }

.actions { display: flex; gap: 10px; margin-top: 24px; }
.btn {
  flex: 1; font: inherit; font-weight: 600; padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card); color: var(--text); cursor: pointer;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.fine { color: var(--muted); font-size: 12px; margin-top: 12px; }

@media (min-width: 761px) { .preview { position: sticky; top: 24px; } }
#canvas {
  display: block; width: 100%; max-width: 560px; height: auto; margin: 0 auto;
  border-radius: 6px; box-shadow: 0 10px 40px rgba(0,0,0,.12); background: #fff;
}

.foot { border-top: 1px solid var(--line); margin-top: 16px; }
.foot-in {
  max-width: 1040px; margin: 0 auto; padding: 20px 16px 28px;
  display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between;
  color: var(--muted); font-size: 14px;
}
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.foot a { color: var(--text); text-decoration: none; font-weight: 600; }
.foot a:hover { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.foot-about { flex-basis: 100%; margin: 0 0 4px; max-width: 640px; color: var(--muted); font-size: 15px; line-height: 1.6; }
.foot-about strong { color: var(--text); font-weight: 700; }

.actions { flex-wrap: wrap; }
.btn.wide { flex-basis: 100%; }
.btn.primary.wide + .btn.primary { background: var(--card); color: var(--text); border-color: var(--line); }
.progress { margin-top: 16px; }
.progress .bar { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.progress .bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s linear; }
.progress p { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.link { font: inherit; font-size: 13px; background: none; border: 0; padding: 0; margin-top: 4px; color: var(--accent); text-decoration: underline; cursor: pointer; }
.themes:disabled { opacity: .5; }
