:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --code: #ffffff;
  --line: rgba(0, 0, 0, .12);
  --text: #111827;
  --sub: #856259;
  --topbar: #ffffff;
  --primary: #fa9403;
  --muted: #667085;
}

html[data-theme="dark"] {
	--bg: #000;
	--surface: #000;
	--code: #444;
	--line: rgba(255, 255, 255, .16);
	--text: #e5e7eb;
	--sub: #d9b8a0;
	--topbar: #000;
	--muted: #9ca3af;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; color: var(--text); background: var(--bg); }

.dt-topbar {
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: var(--topbar);
  border-bottom: 1px solid var(--line);
}
.dt-brand { display: flex; align-items: center; gap: 12px; }
.dt-logotop { width: 500px; max-width: 100%; height: auto; display: block; }
.dt-title { color: var(--sub); font-weight: 700; }

.dt-secondary-btn,
button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 12px;
  font-weight: 700;
  cursor: pointer;
}
.dt-secondary-btn:hover,
button:hover { border-color: var(--primary); color: var(--primary); }

.dt-main { width: 100%; margin: 18px 0; padding: 0 14px 40px; }

.bs-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 430px;
  gap: 16px;
  align-items: start;
}

.bs-stage,
.bs-panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: var(--surface);
}

.bs-panel h1, .bs-panel h2, .bs-presets-box h2 {
	margin: 0 0 10px;
	color: var(--sub);
	font-weight: 600;
}

.bs-preview-wrap {
  position: relative;
  min-height: 600px;
  border-radius: 12px;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.bs-preview-grid {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right, rgba(127, 127, 127, .12) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(127, 127, 127, .12) 1px, transparent 1px);
  background-size: 24px 24px;
}

.bs-preview-box {
  position: relative;
  width: 260px;
  height: 180px;
  border-radius: 24px;
  background: #fa9403;
  box-shadow: 0 14px 40px -10px rgba(0, 0, 0, .24);
}

.bs-row { display: grid; gap: 10px; margin-bottom: 12px; }
.bs-row.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
label { display: block; font-size: 12px; font-weight: 700; }
input[type="range"] { width: 100%; margin-top: 6px; }
select,
input[type="text"] {
  width: 100%;
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
}
input[type="color"] {
  width: 100%;
  margin-top: 6px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  padding: 2px;
}

textarea {
  width: 100%;
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 10px;
  min-height: 128px;
  resize: vertical;
  background: var(--code);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.bs-mini { display: inline-block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.bs-check { display: flex; gap: 8px; align-items: center; margin: 8px 0 12px; }
.bs-check input { margin: 0; }
.bs-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
.bs-feedback { min-height: 20px; color: #22c55e; font-weight: 700; margin: 8px 0 0; }

.bs-layer-list {
  display: grid;
  gap: 8px;
  margin-bottom: 8px;
}
.bs-layer {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  text-align: left;
  background: var(--surface);
  color: var(--text);
}
.bs-layer.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary) 45%, transparent);
}
.bs-layer small {
  display: block;
  color: var(--muted);
  font-weight: 600;
  margin-top: 3px;
}

.bs-preset-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.bs-preset {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  padding: 10px 8px;
  text-align: left;
}
.bs-preset .swatch {
  height: 180px;
  background: #fa9403;
  border-radius: 10px;
  margin-bottom: 8px;
}
.bs-preset .name { font-size: 11px; font-weight: 700; }
.is-hidden { display: none !important; }

.bs-dropzone {
  width: 100%;
  margin-top: 6px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 14px 12px;
  text-align: center;
  color: var(--muted);
  font-weight: 600;
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  cursor: pointer;
}
.bs-dropzone:hover,
.bs-dropzone.dragover {
  border-color: var(--primary);
  color: var(--text);
}

@media (max-width: 1200px) {
  .bs-shell { grid-template-columns: 1fr; }
  .bs-preset-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .bs-row.two,
  .bs-preset-list { grid-template-columns: 1fr; }
}
