:root {
  --ui-bg: #f4f5f7;
  --ui-panel: #ffffff;
  --ui-line: #e2e5ea;
  --ui-text: #1d2026;
  --ui-muted: #6c727e;
  --ui-accent: #2f6fed;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ui-bg);
  color: var(--ui-text);
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.wrap {
  max-width: 1500px;
  margin: 0 auto;
  padding: 24px 20px 64px;
}

.masthead {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 18px;
}
.masthead h1 { font-size: 18px; margin: 0; letter-spacing: -0.01em; }
.masthead p { margin: 0; color: var(--ui-muted); font-size: 13px; }

/* Stage: preserves the 1800:1300 export ratio at any width. */
.stage {
  background: var(--ui-panel);
  border: 1px solid var(--ui-line);
  border-radius: 10px;
  padding: 10px;
  box-shadow: 0 1px 2px rgba(16, 20, 30, 0.05);
}
.stage-inner {
  position: relative;
  width: 100%;
  aspect-ratio: 1800 / 1300;
  background: #fff;
}
.stage-inner svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 20px;
}

button {
  font: inherit;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 7px;
  border: 1px solid var(--ui-line);
  background: #fff;
  color: var(--ui-text);
  cursor: pointer;
}
button:hover { border-color: #c3c9d3; }
button.primary { background: var(--ui-accent); border-color: var(--ui-accent); color: #fff; }
button.primary:hover { background: #2a63d4; }
button.small { padding: 5px 9px; font-size: 12px; font-weight: 500; }

.panel {
  background: var(--ui-panel);
  border: 1px solid var(--ui-line);
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 18px;
}
.panel > h2 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ui-muted);
  margin: 0 0 14px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px 18px;
}

.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12px; font-weight: 600; color: var(--ui-muted); }
.field input[type="text"],
.field select {
  font: inherit;
  padding: 7px 9px;
  border: 1px solid var(--ui-line);
  border-radius: 6px;
  background: #fff;
  color: var(--ui-text);
}
.field input[type="color"] {
  width: 100%;
  height: 34px;
  padding: 2px;
  border: 1px solid var(--ui-line);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}
.field .row { display: flex; align-items: center; gap: 8px; }
.field input[type="range"] { flex: 1; accent-color: var(--ui-accent); }
.field output { font-variant-numeric: tabular-nums; font-size: 12px; color: var(--ui-muted); min-width: 34px; text-align: right; }

.assetRolePicker { margin-bottom: 14px; max-width: 320px; }

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.asset {
  border: 1px solid var(--ui-line);
  border-radius: 9px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #fff;
}
.asset .art {
  background: #fff;
  border-radius: 6px;
  aspect-ratio: 3 / 2;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.asset .art svg { width: 100%; height: 100%; }
.asset .meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.asset .name { font-size: 12px; font-weight: 600; }

.note { color: var(--ui-muted); font-size: 12px; margin: 10px 0 0; }

@media (max-width: 640px) {
  .wrap { padding: 14px 12px 48px; }
  .masthead { flex-direction: column; gap: 2px; }
}
