:root {
  --bg: #121212;
  --panel: #1a1a1a;
  --line: #2a2a2a;
  --text: #e0e0e0;
  --muted: #888;
  --btn: #222;
  --btn-hover: #333;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 13px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

body { display: flex; }

.panel {
  width: 320px;
  flex: 0 0 320px;
  height: 100vh;
  overflow-y: auto;
  padding: 20px;
  background: var(--panel);
  border-right: 1px solid var(--line);
}

header h1 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -0.2px; }
header .sub { margin: 4px 0 24px; color: var(--muted); font-size: 11px; line-height: 1.45; }

.field { margin-bottom: 18px; }
.field .row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.field label { color: var(--text); font-size: 12px; }
.field output { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12px; }

input[type="range"] {
  width: 100%;
  height: 20px;
  margin: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track { height: 3px; background: #333; border-radius: 2px; }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  margin-top: -5.5px;
  border-radius: 50%;
  background: #fff;
  border: none;
}
input[type="range"]::-moz-range-track { height: 3px; background: #333; border-radius: 2px; }
input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border: none; border-radius: 50%; background: #fff; }
input[type="range"]:focus-visible { outline: 1px solid #666; outline-offset: 4px; }

button {
  width: 100%;
  padding: 10px;
  background: var(--btn);
  color: #eee;
  border: 1px solid var(--line);
  border-radius: 4px;
  font: inherit;
  cursor: pointer;
}
button:hover { background: var(--btn-hover); }
button:disabled { opacity: 0.5; cursor: default; }
button.ghost { margin-top: 4px; }
button:focus-visible { outline: 1px solid #666; outline-offset: 2px; }

.export { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.export h2 {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--muted);
}
.export button + button { margin-top: 8px; }

.note { color: var(--muted); font-size: 11px; line-height: 1.5; }
.export .note { min-height: 16px; margin: 10px 0 0; }
.note.footer { margin: 16px 0 0; }

.support-section { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.support-section p {
  margin: 0 0 8px;
  font-size: 11px;
  color: #777;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.support-section a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 20px;
  background: #ffc439;
  color: #000;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.support-section a:hover { background: #f0b429; }

#view { position: relative; flex: 1 1 auto; min-width: 0; height: 100vh; }
#canvas { display: block; width: 100%; height: 100%; }
.hint {
  position: absolute;
  left: 16px;
  bottom: 12px;
  margin: 0;
  color: #666;
  font-size: 11px;
  pointer-events: none;
}

@media (max-width: 768px) {
  body { flex-direction: column; }
  #view { order: 1; height: 60vh; flex: 0 0 60vh; }
  .panel { order: 2; width: 100%; flex: 1 1 auto; height: auto; border-right: none; border-top: 1px solid var(--line); }
}
