:root {
  --ink:#181713;
  --muted:#66645a;
  --paper:#f4f1e8;
  --card:#fffdf8;
  --line:#ded7c7;
  --green:#2f6d4f;
  --green-dark:#184631;
  --lime:#dce85f;
  --warm:#f5c971;
}
* { box-sizing:border-box; }
body { margin:0; background:var(--paper); color:var(--ink); font-family:Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif; }
button,input,select { font:inherit; }
button,label { -webkit-tap-highlight-color:transparent; }
.shell { width:min(1180px,100%); margin:auto; padding:28px 18px 34px; }
.hero { display:flex; gap:24px; align-items:flex-end; justify-content:space-between; padding:16px 0 24px; }
.eyebrow { margin:0 0 10px; color:var(--green); font-size:12px; font-weight:800; letter-spacing:.13em; }
h1 { max-width:760px; margin:0; font-size:clamp(42px,8vw,86px); line-height:.92; letter-spacing:0; }
.hero p:not(.eyebrow) { max-width:650px; margin:18px 0 0; color:var(--muted); font-size:18px; line-height:1.55; }
.uploadButton { min-height:52px; padding:0 20px; display:inline-flex; align-items:center; justify-content:center; border-radius:8px; background:var(--ink); color:white; font-weight:800; cursor:pointer; white-space:nowrap; }
.uploadButton input { position:absolute; width:1px; height:1px; opacity:0; pointer-events:none; }
.workspace { display:grid; grid-template-columns:minmax(0,1fr) 350px; gap:18px; align-items:start; }
.canvasWrap { position:relative; overflow:hidden; border:1px solid var(--line); border-radius:8px; background:#d8d2c5; box-shadow:0 18px 50px rgba(70,60,40,.12); touch-action:none; }
canvas { width:100%; height:auto; display:block; background:#e8e1d3; touch-action:none; }
.canvasHint { position:absolute; left:18px; right:18px; bottom:16px; padding:12px 14px; border-radius:8px; background:rgba(255,253,248,.9); color:#413d34; font-size:14px; line-height:1.35; pointer-events:none; }
.panel { display:grid; gap:14px; position:sticky; top:14px; }
.panel section,.actions { padding:16px; border:1px solid var(--line); border-radius:8px; background:var(--card); }
.panelLabel { margin:0 0 10px; color:var(--green); font-size:11px; font-weight:850; letter-spacing:.1em; text-transform:uppercase; }
.segmented,.presetGrid,.quickControls { display:grid; gap:8px; }
.segmented { grid-template-columns:1fr 1fr; }
.presetGrid { grid-template-columns:1fr 1fr; }
button { min-height:42px; border:1px solid var(--line); border-radius:8px; background:white; color:var(--ink); font-weight:800; cursor:pointer; }
button.active { background:var(--green); color:white; border-color:var(--green); }
button:hover { border-color:var(--green); }
.dimensions { display:grid; grid-template-columns:1fr 1fr .82fr; gap:8px; }
.dimensions label,.rangeLabel { display:grid; gap:7px; color:var(--muted); font-size:12px; font-weight:750; }
input,select { width:100%; min-height:42px; padding:0 10px; border:1px solid var(--line); border-radius:8px; background:white; color:var(--ink); }
.quickControls { grid-template-columns:1fr 1fr; }
.rangeLabel input { padding:0; }
.resultCard strong { display:block; font-size:24px; line-height:1.1; }
.resultCard span { display:block; margin-top:8px; color:var(--muted); font-size:14px; line-height:1.45; }
.actions { display:grid; grid-template-columns:1fr 1.2fr; gap:10px; }
.primary { background:var(--green); color:white; border-color:var(--green); }
.primary:hover { background:var(--green-dark); }
.secondary { background:#f7f5ee; }
.exportPreview img { width:100%; border-radius:8px; border:1px solid var(--line); background:#eee; }
.downloadLink { min-height:42px; margin-top:10px; display:flex; align-items:center; justify-content:center; border-radius:8px; background:var(--ink); color:white; font-weight:850; }
@media (max-width:880px) {
  .hero { display:grid; }
  .workspace { grid-template-columns:1fr; }
  .panel { position:static; }
}
@media (max-width:520px) {
  .shell { padding:18px 12px 24px; }
  h1 { font-size:44px; }
  .hero p:not(.eyebrow) { font-size:16px; }
  .dimensions { grid-template-columns:1fr 1fr; }
  .dimensions label:last-child { grid-column:1/-1; }
  .canvasHint { font-size:12px; left:10px; right:10px; bottom:10px; }
}
