:root{
  --ink:#1c2333; --muted:#667085; --line:#e4e7ec; --bg:#f2f4f7;
  --brand:#16233f; --accent:#2f6df6; --card:#ffffff;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  color:var(--ink); background:var(--bg); min-height:100vh;
  display:flex; flex-direction:column;
}
.topbar{
  background:var(--brand); color:#fff;
  display:flex; align-items:center; justify-content:space-between;
  gap:16px; padding:12px 20px; flex-wrap:wrap;
}
.brand{display:flex; align-items:center; gap:12px}
.brand-name{font-size:19px; font-weight:700; letter-spacing:.2px}
.brand-sub{font-size:12px; opacity:.72}
.project{display:flex; align-items:center; gap:8px; flex-wrap:wrap}
#addressInput{
  width:min(340px,60vw); padding:9px 12px; border-radius:8px;
  border:1px solid rgba(255,255,255,.25); background:rgba(255,255,255,.1);
  color:#fff; font-size:14px;
}
#addressInput::placeholder{color:rgba(255,255,255,.55)}
.btn{
  border:1px solid var(--line); background:#fff; color:var(--ink);
  border-radius:8px; padding:9px 16px; font-size:14px; cursor:pointer;
  touch-action:manipulation; white-space:nowrap;
}
.btn:hover{background:#eef1f6}
.btn.ghost{background:transparent; color:#fff; border-color:rgba(255,255,255,.35)}
.btn.ghost:hover{background:rgba(255,255,255,.12)}
.btn.small{padding:7px 12px; font-size:13px}
.btn.primary{background:var(--accent); border-color:var(--accent); color:#fff}
.btn.primary:hover{background:#2559d6}

.layout{
  flex:1; width:100%; max-width:1280px; margin:0 auto;
  padding:20px; display:grid; grid-template-columns:1fr 300px; gap:20px;
  align-items:start;
}
.stage-card{
  background:var(--card); border:1px solid var(--line); border-radius:14px;
  overflow:hidden; box-shadow:0 6px 24px rgba(20,30,50,.08);
}
.toolbar{
  display:flex; align-items:center; gap:8px; padding:12px 16px;
  border-bottom:1px solid var(--line); flex-wrap:wrap;
}
.tool{
  border:1px solid var(--line); background:#f7f8fb; border-radius:8px;
  padding:8px 14px; font-size:13.5px; cursor:pointer; touch-action:manipulation;
}
.tool.active{background:var(--brand); color:#fff; border-color:var(--brand)}
.toolbar-hint{font-size:12.5px; color:var(--muted); margin-left:4px}
.canvas-wrap{background:#10141d; display:flex; justify-content:center}
#stage{display:block; max-width:100%; touch-action:none; cursor:crosshair}
.stage-foot{display:flex; gap:8px; padding:12px 16px; border-top:1px solid var(--line); flex-wrap:wrap}

.panel{display:flex; flex-direction:column; gap:20px}
.panel-section{
  background:var(--card); border:1px solid var(--line); border-radius:14px;
  padding:18px; box-shadow:0 6px 24px rgba(20,30,50,.06);
}
.panel-section h2{margin:0 0 2px; font-size:16px}
.panel-section .sub{margin:0 0 12px; font-size:12.5px; color:var(--muted)}
.swatches{display:flex; flex-wrap:wrap; gap:8px}
.sw{
  width:60px; cursor:pointer; border:2px solid transparent; border-radius:10px;
  padding:4px; background:#fff; touch-action:manipulation;
  transition:border-color .15s, transform .15s; -webkit-tap-highlight-color:transparent;
}
.sw:hover{transform:translateY(-2px)}
.sw.active{border-color:var(--ink)}
.sw .chip{
  height:36px; border-radius:6px; border:1px solid rgba(0,0,0,.14);
  background-image:repeating-linear-gradient(0deg, rgba(0,0,0,.13) 0 2px, transparent 2px 7px);
}
.sw .nm{font-size:10px; line-height:1.25; margin-top:4px; word-break:break-word}
.sel{margin:12px 0 0; font-size:13.5px}
.note{font-size:12px; color:var(--muted); line-height:1.55; margin:0; padding:0 4px}
footer{text-align:center; color:var(--muted); font-size:12px; padding:22px 12px 34px}

@media (max-width:900px){
  .layout{grid-template-columns:1fr; padding:12px}
  .topbar{padding:10px 12px}
}
