:root{
  --paper:#faf6ec; --ink:#2b2118; --dim:#8a7d68; --line:#e4dbc9; --terra:#e0703f;
  --ok:#3f8a5c; --warn:#e0703f; --pending:#f0b028;
}
*{box-sizing:border-box;}
body{
  margin:0; font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Inter,sans-serif;
  background:var(--paper); color:var(--ink);
}
header{
  padding:18px 24px; border-bottom:1px solid var(--line); display:flex; align-items:center; gap:14px; flex-wrap:wrap;
}
header h1{ font-size:18px; margin:0; }
.badge{
  font-size:11px; font-weight:700; letter-spacing:.03em; text-transform:uppercase;
  background:var(--terra); color:#fff; padding:4px 10px; border-radius:100px;
}
header a{ color:var(--dim); font-size:13px; text-decoration:none; margin-left:auto; }
header a:hover{ color:var(--ink); }

.layout{ display:flex; gap:24px; padding:24px; align-items:flex-start; flex-wrap:wrap; }

.canvas-col{ width:720px; max-width:100%; }
.zoom-bar{ display:flex; align-items:center; gap:8px; margin-bottom:10px; flex-wrap:wrap; }
.zoom-bar button{
  width:auto; margin:0; padding:7px 14px; background:#fff; color:var(--ink);
  border:1px solid var(--line); border-radius:100px; font-size:14px; line-height:1;
}
.zoom-bar button:hover{ border-color:var(--dim); }
.zoom-bar .zoom-label{ min-width:62px; font-size:12px; }
.zoom-bar .zoom-fit{ font-size:12px; }
.zoom-hint{ font-size:11px; color:var(--dim); margin-left:auto; }
.canvas-wrap{
  border:1px solid var(--line); border-radius:12px; background:#fff;
  width:100%; height:min(720px, 75vh); overflow:auto; position:relative;
  touch-action:none; /* жесты на тачскрине обрабатываем сами в app.js */
}
.zoom-bar .zoom-mode{ font-size:12px; background:#fdf3e0; border-color:#f0b028; }
.canvas-stage{ position:relative; }
.tile-layer img{ position:absolute; display:block; image-rendering:pixelated; }
.tile-layer.smooth img{ image-rendering:auto; }
.slot-overlay{ position:absolute; top:0; left:0; cursor:crosshair; }
.selection-box{
  position:absolute; border:2px solid var(--terra); background:rgba(224,112,63,.18);
  pointer-events:none; display:none;
}
.selection-box.invalid{ border-color:#c0392b; background:rgba(192,57,43,.22); }

.panel{
  width:340px; max-width:100%; border:1px solid var(--line); border-radius:12px; padding:20px; background:#fff;
}
.panel h2{ font-size:15px; margin:0 0 12px; }
.stat-row{ display:flex; justify-content:space-between; font-size:13px; color:var(--dim); margin-bottom:6px; }
.stat-row b{ color:var(--ink); }

.selection-info{ font-size:13px; color:var(--dim); margin:14px 0; line-height:1.6; }
.selection-info b{ color:var(--ink); }
.price-tag{ font-size:22px; font-weight:700; color:var(--terra); }

.preview-box{
  width:100%; border:1px dashed var(--line); border-radius:8px; overflow:hidden; margin:12px 0;
  display:flex; align-items:center; justify-content:center; background:#fafafa; min-height:80px;
}
.preview-box img{ max-width:100%; display:block; }

input[type=file]{ font-size:13px; width:100%; }
button{
  font-family:inherit; font-size:13px; font-weight:700; border:none; border-radius:100px;
  padding:11px 18px; cursor:pointer; background:var(--terra); color:#fff; width:100%; margin-top:10px;
}
button:disabled{ background:#ccc2ad; cursor:not-allowed; }
button.secondary{ background:transparent; border:1px solid var(--line); color:var(--ink); }

.msg{ font-size:13px; padding:10px 12px; border-radius:8px; margin-top:12px; display:none; white-space:pre-wrap; }
.msg.show{ display:block; }
.msg.ok{ background:#e7f4ec; color:var(--ok); }
.msg.err{ background:#fbeae7; color:#c0392b; }
.msg.info{ background:#fdf3e0; color:#946200; }

.legend{ display:flex; gap:14px; font-size:12px; color:var(--dim); margin-top:16px; flex-wrap:wrap; }
.legend span{ display:inline-flex; align-items:center; gap:6px; }
.swatch{ width:12px; height:12px; border-radius:3px; display:inline-block; }
.swatch.free{ background:#faf6ec; border:1px solid var(--line); }
.swatch.pending{ background:var(--pending); }
.swatch.approved{ background:var(--ok); }
