@font-face { font-family: Poppins; font-weight: 400; font-display: swap; src: url(/fonts/Poppins-Regular.woff) format("woff"); }
@font-face { font-family: Poppins; font-weight: 500 700; font-display: swap; src: url(/fonts/Poppins-Medium.woff) format("woff"); }
@font-face { font-family: Lora; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/fonts/Lora-Variable.woff) format("woff"); }
@font-face { font-family: Lora; font-style: italic; font-weight: 400 700; font-display: swap; src: url(/fonts/Lora-Italic-Variable.woff) format("woff"); }

:root {
  --green: #2e4630; --green-2: #3d5a3f; --cream: #f6efdc; --paper: #fffaf0;
  --rust: #b5562b; --gold: #e0b04a; --ink: #2b241c;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: Poppins, system-ui, sans-serif; background: var(--cream); color: var(--ink); }
[hidden] { display: none !important; }
header {
  background: var(--green); color: var(--cream); padding: 14px 20px;
  padding-top: max(14px, env(safe-area-inset-top));
  display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
}
header h1 { font-family: Lora, serif; font-weight: 500; font-size: 26px; margin: 0; }
header span { font-family: Lora, serif; font-style: italic; color: var(--gold); font-size: 16px; }
.app { display: grid; grid-template-columns: 200px 1fr 260px; gap: 16px; padding: 16px; height: calc(100% - 62px); }
.panel { background: var(--paper); border: 1px solid #e3d6b6; border-radius: 12px; padding: 12px; overflow: auto; }
.panel h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--green-2); margin: 4px 0 10px; }
.thumbs { display: grid; gap: 10px; }
.thumb { border: 3px solid transparent; border-radius: 8px; overflow: hidden; cursor: pointer; background: white; padding: 0; }
.thumb img { display: block; width: 100%; aspect-ratio: 1000 / 1339; }
.thumb.on { border-color: var(--rust); }
.stage { position: relative; background: #e9dfc6; border-radius: 12px; overflow: auto; touch-action: none; }
.board { position: relative; margin: 0 auto; }
.board canvas { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
#lines { pointer-events: none; }
.zoom { position: sticky; top: 10px; left: 10px; z-index: 3; display: inline-flex; gap: 6px; padding: 10px; }
.zoom button { width: 40px; height: 40px; border-radius: 50%; border: none; background: var(--green); color: white; font-size: 20px; cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.swatches { display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; }
.sw { aspect-ratio: 1; border-radius: 50%; border: 2px solid rgba(0,0,0,.15); cursor: pointer; padding: 0; }
.sw.on { outline: 3px solid var(--ink); outline-offset: 2px; }
.row { display: flex; gap: 8px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.btn { border: 1px solid #cdbb92; background: white; border-radius: 8px; padding: 8px 12px; font: inherit; font-size: 13px; cursor: pointer; color: var(--ink); }
.btn.on { background: var(--green); color: white; border-color: var(--green); }
.btn:active { transform: translateY(1px); }
.current { display: flex; align-items: center; gap: 10px; font-size: 13px; margin-top: 12px; }
.current i { width: 34px; height: 34px; border-radius: 8px; border: 2px solid rgba(0,0,0,.2); display: inline-block; }
input[type=color] { width: 44px; height: 34px; border: none; background: none; padding: 0; cursor: pointer; }
.cta { margin-top: 18px; background: var(--green); color: var(--cream); border-radius: 10px; padding: 14px; font-size: 13px; line-height: 1.45; }
.cta b { font-family: Lora, serif; font-size: 17px; font-weight: 500; color: var(--gold); display: block; margin-bottom: 4px; }
.cta a { display: inline-block; margin-top: 10px; background: var(--gold); color: var(--ink); text-decoration: none; padding: 8px 14px; border-radius: 8px; font-weight: 600; }
.loading { position: absolute; inset: 0; display: grid; place-items: center; font-family: Lora, serif; font-style: italic; color: var(--green-2); pointer-events: none; }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; height: auto; }
  .stage { height: 70vh; order: 1; }
  .thumbs { grid-template-columns: repeat(3, 1fr); }
  .panel.left { order: 2; }
  .panel.right { order: 0; }
  .swatches { grid-template-columns: repeat(12, 1fr); }
}
