: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-actions { display: flex; gap: 8px; align-items: center; }

.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; }

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

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

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

label { display: block; font-size: 12px; font-weight: 700; }
input[type="number"],
select,
textarea {
  width: 100%;
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 10px;
  font-size: 13px;
  background: var(--code);
  color: var(--text);
}
input[type="range"] { width: 100%; margin-top: 6px; }

.gg-row { display: grid; gap: 10px; margin-bottom: 10px; }
.gg-row.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.gg-preview-wrap {
  position: relative;
  border-radius: 12px;
  overflow: hidden;

}
.gg-preview { height: 600px; width: 100%; }
.gg-noise {
  position: absolute;
  inset: 0;
  pointer-events: none;
  mix-blend-mode: overlay;
  opacity: .12;
  background-image:
    radial-gradient(rgba(255,255,255,.44) 0.35px, transparent 0.35px),
    radial-gradient(rgba(0,0,0,.38) 0.3px, transparent 0.3px),
    radial-gradient(rgba(255,255,255,.2) 0.25px, transparent 0.25px);
  background-size: 2px 2px, 3px 3px, 5px 5px;
  background-position: 0 0, 1px 1px, 2px 0;
}

.gg-stop-track {
  position: relative;
  height: 30px;
  border-radius: 999px;
  border: 1px solid var(--line);
  margin: 10px 0 12px;
  background: #f6f7fb;
}
html[data-theme="dark"] .gg-stop-track { background: #1f2937; }

.gg-stop {
  position: absolute;
  top: 50%;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,.2);
  transform: translate(-50%, -50%);
  cursor: ew-resize;
}
.gg-stop.active { box-shadow: 0 0 0 2px var(--primary); z-index: 2; }

.gg-stage-actions,
.gg-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }

.gg-angle-box {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 12px;
}
.gg-angle-head {
  display: grid;
  grid-template-columns: 1fr 90px;
  gap: 8px;
  align-items: end;
}

.gg-angle-points {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}
.gg-angle-points button {
  padding: 6px 0;
  border-radius: 8px;
  font-size: 14px;
}

.gg-stop-editor { display: grid; gap: 8px; margin: 8px 0 12px; }
.gg-stop-row {
  display: grid;
  grid-template-columns: 40px 1fr 70px 70px 44px;
  gap: 8px;
  align-items: center;
}
.gg-stop-row input[type="color"] {
  width: 40px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 2px;
  background: var(--surface);
}
.gg-stop-row .remove { width: 44px; height: 36px; padding: 0; }

.gg-preset-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.gg-preset {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  padding: 0;
}
.gg-preset-swatch { height: 100px; }
.gg-preset-name { padding: 6px 8px; font-size: 11px; font-weight: 700; color: var(--text); background: var(--surface); text-align: left; }

textarea {
  min-height: 120px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
.gg-feedback { min-height: 20px; color: #22c55e; font-weight: 700; margin: 8px 0 0; }
.gg-mini { display: inline-block; margin-top: 4px; color: var(--muted); font-size: 12px; }

@media (max-width: 1200px) {
  .gg-shell { grid-template-columns: 1fr; }
  .gg-preset-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .gg-row.two,
  .gg-stop-row,
  .gg-preset-list,
  .gg-angle-points { grid-template-columns: 1fr; }
}
