* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  display: flex;
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
  background: #16181d;
  color: #e6e8ee;
}

#panel {
  width: 320px;
  flex: 0 0 320px;
  padding: 18px 16px 24px;
  overflow-y: auto;
  background: #1e2128;
  border-right: 1px solid #2c3039;
}
#stage { flex: 1; position: relative; min-width: 0; }
#view { width: 100%; height: 100%; display: block; }

h1 { font-size: 20px; margin: 0 0 2px; letter-spacing: 0.5px; }
.sub { margin: 0 0 14px; color: #9aa3b2; font-size: 12.5px; }
h2 {
  font-size: 11px; text-transform: uppercase; letter-spacing: 1.2px;
  color: #8a93a5; margin: 18px 0 8px; border-bottom: 1px solid #2c3039;
  padding-bottom: 4px;
}

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; }
.span2 { grid-column: 1 / -1; }
input[type="text"] {
  width: 100%; padding: 6px 8px; border-radius: 6px;
  border: 1px solid #353a45; background: #14161a; color: #e6e8ee;
  font: inherit;
}
input[type="text"]:focus { outline: 1px solid #5b8cff; }
label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: #b7bfcc; }
input[type="number"], select {
  width: 100%; padding: 6px 8px; border-radius: 6px;
  border: 1px solid #353a45; background: #14161a; color: #e6e8ee;
  font: inherit;
}
input[type="number"]:focus, select:focus { outline: 1px solid #5b8cff; }

button {
  padding: 7px 10px; border-radius: 6px; border: 1px solid #3a4150;
  background: #2a2f39; color: #e6e8ee; font: inherit; cursor: pointer;
}
button:hover:not(:disabled) { background: #343b48; }
button:disabled { opacity: 0.45; cursor: default; }

.row { display: flex; gap: 8px; }
.file-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 7px 10px; border-radius: 6px; border: 1px solid #4c72d8;
  background: #2f4ba0; cursor: pointer; color: #fff; font-size: 13px;
}
.file-btn:hover { background: #3757b8; }
.file-btn input { display: none; }
.filelabel { margin-top: 6px; font-size: 11.5px; color: #8a93a5; }

.btnlabel button { margin-top: 0; }
.slider { flex-direction: column; }
.slider input { width: 100%; }

.status { margin-top: 14px; font-size: 12.5px; color: #9fd39f; min-height: 18px; white-space: pre-wrap; }
.status.error { color: #ff8f8f; }
.warnings { font-size: 11.5px; color: #e8c976; white-space: pre-wrap; }

.exports { display: flex; gap: 8px; flex-wrap: wrap; }

/* --- surface picker overlay --- */
.picker {
  position: fixed; inset: 0; z-index: 50;
  display: flex; flex-direction: column;
  background: #0d0b14;
}
.picker-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 14px; border-bottom: 1px solid #2a2440;
  background: #120f1c;
}
.picker-title {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px; color: #d9d3ee; flex: 1; min-width: 220px;
}
.picker-btns { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.picker-btns button {
  padding: 6px 14px; border-radius: 999px;
  border: 1px solid #3b3357; background: #1d1830; color: #ded8f0;
  font-size: 13px; cursor: pointer;
}
.picker-btns button:hover { background: #29223f; }
.picker-btns button.primary { background: #8b5cf6; border-color: #8b5cf6; color: #fff; }
.picker-btns button.primary:hover { background: #9d74f7; }
.picker-btns button.primary-ghost { border-color: #8b5cf6; color: #c4a9ff; }
.picker-height {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: #a89ec9; flex-direction: row;
}
.picker-height input {
  width: 74px; padding: 5px 8px; border-radius: 6px;
  border: 1px solid #3b3357; background: #14111f; color: #ded8f0; font: inherit;
}
.picker-svg { flex: 1; width: 100%; min-height: 0; display: block; }
.picker-hint {
  padding: 8px 14px; font-size: 12px; color: #7d76a0;
  border-top: 1px solid #2a2440; background: #120f1c;
}
.face {
  fill: #46405e;
  stroke: #0d0b14;
  stroke-width: 0.6;
  cursor: pointer;
  transition: fill 0.1s;
}
.face:hover { fill: #6d6392; }
.face.raised {
  fill: color-mix(in srgb, #a855f7 calc(var(--lvl) * 100%), #46405e);
}
.face.sel { stroke: #f0abfc; stroke-width: 1.4; }
.foot { margin-top: 18px; font-size: 11px; color: #6d7686; }
