/* ===== Sandlit — Sandbox Simulator ===== */

:root {
  --bg-0: #0a0b10;
  --bg-1: #11131c;
  --bg-2: #181b27;
  --bg-3: #20243200;
  --panel: rgba(24, 27, 39, 0.85);
  --panel-border: rgba(255, 255, 255, 0.08);
  --accent: #6c8cff;
  --accent-2: #b06cff;
  --text: #e6e9f2;
  --text-dim: #8b91a7;
  --text-faint: #5a6076;
  --good: #4ade80;
  --warn: #fbbf24;
  --bad: #f87171;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  --glow: 0 0 24px rgba(108, 140, 255, 0.25);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg-0);
  color: var(--text);
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Ambient background */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(900px 600px at 15% 10%, rgba(108, 140, 255, 0.10), transparent 60%),
    radial-gradient(800px 500px at 85% 90%, rgba(176, 108, 255, 0.10), transparent 60%),
    radial-gradient(600px 400px at 50% 50%, rgba(74, 222, 128, 0.04), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ===== Layout ===== */
.app {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 260px 1fr 260px;
  grid-template-rows: auto 1fr auto;
  grid-template-areas:
    "header header header"
    "left   stage  right"
    "footer footer footer";
  gap: 14px;
  padding: 16px;
  height: 100vh;
}

/* ===== Header ===== */
.header {
  grid-area: header;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-mark {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  filter: drop-shadow(0 0 8px rgba(108, 140, 255, 0.3));
}
.brand-name {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: linear-gradient(90deg, #fff, #b9c0d6);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.brand-tag {
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.header-stats {
  display: flex;
  gap: 18px;
  font-size: 12px;
  color: var(--text-dim);
}
.stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.stat-val {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.stat-lbl {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-faint);
}

/* ===== Panels ===== */
.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
}
.panel::-webkit-scrollbar { width: 6px; }
.panel::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
.panel::-webkit-scrollbar-track { background: transparent; }

.panel-left { grid-area: left; position: relative; overflow: visible; min-height: 0; overflow-y: visible !important; }
.panel-left .panel-scroll {
  position: absolute;
  top: 14px; left: 14px; right: 14px; bottom: 14px;
  overflow-y: auto;
  padding-right: 8px;
}
.panel-left .panel-scroll::-webkit-scrollbar { width: 6px; }
.panel-left .panel-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
.panel-left .panel-scroll::-webkit-scrollbar-track { background: transparent; }

/* Element search */
.search-wrap {
  position: relative;
  margin-bottom: 12px;
}
.search-icon {
  position: absolute;
  left: 8px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  pointer-events: none;
}
.search-input {
  width: 100%;
  background: var(--bg-0);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 12px;
  font-family: inherit;
  padding: 7px 10px 7px 28px;
  outline: none;
  transition: border-color 0.15s;
}
.search-input::placeholder { color: var(--text-faint); }
.search-input:focus {
  border-color: var(--accent);
}
.search-input:focus + .search-icon { color: var(--accent); }
.panel-right { grid-area: right; }

/* Category tabs sticking out the right side */
.cat-tabs {
  position: absolute;
  top: 14px;
  right: -28px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 5;
}
.cat-tab {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  background: var(--bg-2);
  border: 1px solid var(--panel-border);
  border-left: none;
  border-radius: 0 8px 8px 0;
  color: var(--text-faint);
  padding: 10px 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  letter-spacing: 0.5px;
}
.cat-tab:hover {
  background: var(--bg-3);
  color: var(--text);
}
.cat-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 10px rgba(108,140,255,0.4);
}

.section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-faint);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--panel-border), transparent);
}

/* ===== Element palette ===== */
.palette {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cat-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cat-label {
  font-size: 10px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding-left: 2px;
}
.cat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}
.el-btn {
  position: relative;
  border: 1px solid rgba(255,255,255,0.06);
  background: var(--bg-2);
  color: var(--text);
  padding: 8px 6px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: transform 0.08s ease, border-color 0.15s, background 0.15s;
  overflow: hidden;
}
.el-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255,255,255,0.18);
  background: #232739;
}
.el-btn:active { transform: translateY(0) scale(0.97); }
.el-btn.active {
  border-color: var(--accent);
  background: rgba(108, 140, 255, 0.12);
  box-shadow: 0 0 0 1px var(--accent), 0 0 14px rgba(108,140,255,0.3);
}
.el-swatch {
  width: 14px; height: 14px;
  border-radius: 4px;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.3);
}
.el-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ===== Stage ===== */
.stage {
  grid-area: stage;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 0;
}
.canvas-frame {
  position: relative;
  border-radius: var(--radius);
  padding: 6px;
  background: linear-gradient(145deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow), var(--glow);
  display: inline-block;
  max-width: 100%;
  max-height: 100%;
}
canvas {
  display: block;
  background: #050608;
  border-radius: 10px;
  cursor: none;
  image-rendering: pixelated;
  touch-action: none;
  max-width: 100%;
  max-height: 100%;
}

/* Brush cursor overlay */
.brush-cursor {
  position: absolute;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(0, 0, 0, 0.3);
  z-index: 3;
  opacity: 0;
  transition: opacity 0.1s;
}
.brush-cursor.visible { opacity: 1; }
.brush-cursor.square { border-radius: 1px; }
.brush-cursor.circle { border-radius: 50%; }

/* Developer widget */
.dev-widget {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(10, 12, 20, 0.92);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 11px;
  font-family: 'SF Mono', 'Cascadia Code', Consolas, monospace;
  color: #c8d0e0;
  z-index: 10;
  min-width: 180px;
  pointer-events: none;
  display: none;
  line-height: 1.5;
}
.dev-widget.visible { display: block; }
.dev-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.dev-label { color: #6a7a9a; }
.dev-val { color: #e0e8ff; font-weight: 600; }
.dev-sep {
  height: 1px;
  background: var(--panel-border);
  margin: 6px 0;
}
.dev-subtitle {
  color: #6a7a9a;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.dev-elemcounts {
  display: flex;
  flex-direction: column;
  gap: 1px;
  max-height: 180px;
  overflow-y: auto;
}
.dev-elemrow {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 10px;
}
.dev-elemrow .swatch {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  margin-right: 4px;
  vertical-align: middle;
}
/* Quick tweaks (interactive) */
.dev-tweaks { pointer-events: auto; display: flex; flex-direction: column; gap: 5px; }
.dev-tweak {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
}
.dev-tlabel { color: #6a7a9a; width: 54px; flex-shrink: 0; }
.dev-slider {
  flex: 1;
  height: 3px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--panel-border);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  margin: 0;
}
.dev-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #e0e8ff;
  cursor: pointer;
}
.dev-slider::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #e0e8ff;
  border: none;
  cursor: pointer;
}
.dev-check { cursor: pointer; margin: 0; }
.dev-reset {
  cursor: pointer;
  color: #6a7a9a;
  font-size: 10px;
  text-decoration: underline;
  text-transform: none;
  letter-spacing: 0;
}
.dev-reset:hover { color: #e0e8ff; }
.canvas-overlay {
  position: absolute;
  top: 14px; left: 14px;
  display: flex;
  gap: 8px;
  pointer-events: none;
  z-index: 2;
}
.badge {
  background: rgba(10, 11, 16, 0.7);
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  color: var(--text-dim);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  gap: 6px;
}
.badge .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--good);
}
.badge.paused .dot { background: var(--warn); }
.badge .dot { animation: pulse 2s infinite; }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ===== Controls (right panel) ===== */
.control-group { display: flex; flex-direction: column; gap: 10px; }
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-dim);
}
.field-val {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  background: var(--bg-2);
  padding: 2px 8px;
  border-radius: 6px;
  min-width: 36px;
  text-align: center;
}

/* Slider */
input[type=range] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--bg-2);
  outline: none;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: linear-gradient(145deg, #8aa3ff, #6c8cff);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(108,140,255,0.5);
  border: 2px solid #fff2;
}
input[type=range]::-moz-range-thumb {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #6c8cff;
  cursor: pointer;
  border: 2px solid #fff2;
}

/* Segmented toggle */
.seg-toggle {
  display: flex;
  gap: 0;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.seg-btn {
  flex: 1;
  background: var(--bg-2);
  border: none;
  color: var(--text-faint);
  padding: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.seg-btn:hover { color: var(--text); }
.seg-btn.active {
  background: var(--accent);
  color: #fff;
}

/* Buttons */
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn {
  background: var(--bg-2);
  color: var(--text);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  padding: 9px 10px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.12s;
}
.btn:hover { background: #232739; border-color: rgba(255,255,255,0.18); }
.btn:active { transform: scale(0.97); }
.btn.primary {
  background: linear-gradient(145deg, #6c8cff, #5471e6);
  border-color: transparent;
  color: #fff;
  grid-column: 1 / -1;
}
.btn.primary:hover { background: linear-gradient(145deg, #7d9bff, #6480f0); }
.btn.danger:hover { border-color: var(--bad); color: var(--bad); }
.btn .ico { font-size: 13px; line-height: 1; }
.btn iconify-icon.ico { vertical-align: -2px; }

/* Brush preview */
.brush-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 60px;
  background: var(--bg-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--panel-border);
  position: relative;
  overflow: hidden;
}
#brush-canvas {
  image-rendering: pixelated;
}

/* Brush shape toggle */
.brush-shape-toggle {
  display: flex;
  gap: 6px;
}
.shape-btn {
  flex: 1;
  background: var(--bg-2);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  padding: 7px;
  cursor: pointer;
  color: var(--text-faint);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s;
}
.shape-btn:hover { background: #232739; color: var(--text-dim); }
.shape-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(108,140,255,0.1);
}

/* Selected element card */
.selected-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: var(--bg-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--panel-border);
}
.selected-swatch {
  width: 28px; height: 28px;
  border-radius: 7px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.3), 0 0 10px rgba(255,255,255,0.05);
  flex-shrink: 0;
}
.selected-info { display: flex; flex-direction: column; gap: 2px; }
.selected-name { font-size: 13px; font-weight: 600; }
.selected-desc { font-size: 11px; color: var(--text-faint); }

/* Ad-blocker overlay */
.adblock-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(10, 11, 16, 0.97);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.adblock-card {
  max-width: 420px;
  text-align: center;
  background: var(--bg-2);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 40px 32px;
  box-shadow: var(--shadow);
}
.adblock-icon {
  color: var(--warn);
  margin-bottom: 16px;
}
.adblock-card h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}
.adblock-card p {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.6;
  margin-bottom: 8px;
}
.adblock-sub {
  color: var(--text-faint) !important;
  font-size: 13px !important;
  margin-bottom: 20px !important;
}
.adblock-card .btn {
  margin: 8px auto;
  padding: 10px 24px;
  font-size: 14px;
  display: inline-flex;
  justify-content: center;
}
.adblock-note {
  margin-top: 16px;
  font-size: 12px !important;
  color: var(--text-faint) !important;
}
.adblock-note a {
  color: var(--accent);
  text-decoration: none;
}
.adblock-note a:hover {
  text-decoration: underline;
}

/* Ad containers — visually hidden until ad fills, then shown */
.ad-container {
  overflow: hidden;
  width: 100%;
  /* Off-screen but still has dimensions so AdSense can measure width */
  position: absolute;
  left: -9999px;
  top: 0;
  min-height: 100px;
  justify-content: center;
  align-items: center;
}
.ad-container.ad-loaded {
  position: static;
  left: auto;
  display: flex;
  margin-top: 12px;
  border-top: 1px solid var(--panel-border);
  padding-top: 12px;
}
.ad-sidebar .adsbygoogle {
  width: 100% !important;
  height: auto !important;
  max-width: 100%;
  display: block !important;
}

/* Footer */
.footer {
  grid-area: footer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 8px;
  font-size: 11px;
  color: var(--text-faint);
}
.footer-tips { display: flex; gap: 18px; }
.tip { display: flex; align-items: center; gap: 6px; }
.kbd {
  background: var(--bg-2);
  border: 1px solid var(--panel-border);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 10px;
  font-family: 'SF Mono', 'Consolas', monospace;
  color: var(--text-dim);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-2);
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 12px;
  color: var(--text);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s;
  z-index: 300;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Responsive */
@media (max-width: 1100px) {
  .app {
    grid-template-columns: 220px 1fr 220px;
  }
}
@media (max-width: 900px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-areas:
      "header"
      "stage"
      "left"
      "right"
      "footer";
    height: auto;
    overflow-y: auto;
  }
  html, body { overflow: auto; }
}

/* ===== Icon button ===== */
.icon-btn {
  background: var(--bg-2);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  width: 36px; height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.15s;
}
.icon-btn:hover { background: #232739; color: var(--text); border-color: rgba(255,255,255,0.18); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn.small { width: 30px; height: 30px; }
.icon-btn svg, .icon-btn iconify-icon { display: block; }

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 6, 10, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.modal {
  background: var(--bg-1);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow), 0 0 60px rgba(0,0,0,0.5);
  width: 520px;
  max-width: 92vw;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  transform: scale(0.95) translateY(10px);
  transition: transform 0.2s;
}
.modal-overlay.open .modal { transform: scale(1) translateY(0); }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--panel-border);
}
.modal-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
.modal-body {
  padding: 18px;
  overflow-y: auto;
}

/* Tabs */
.tab-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--panel-border);
}
.tab {
  background: none;
  border: none;
  color: var(--text-faint);
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}
.tab:hover { color: var(--text-dim); }
.tab.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}
.tab-pane { display: none; }
.tab-pane.active { display: block; animation: fadeIn 0.2s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.tab-intro {
  font-size: 12px;
  color: var(--text-faint);
  margin-bottom: 14px;
}

/* Keybind list */
.bind-list { display: flex; flex-direction: column; gap: 8px; }
.bind-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--bg-2);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.bind-label { color: var(--text-dim); }
.bind-key {
  background: var(--bg-1);
  border: 1px solid var(--panel-border);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 4px 14px;
  font-size: 12px;
  font-family: 'SF Mono', 'Consolas', monospace;
  color: var(--text);
  cursor: pointer;
  min-width: 70px;
  text-align: center;
  transition: all 0.15s;
}
.bind-key:hover { border-color: var(--accent); color: var(--accent); }
.bind-key.listening {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(108,140,255,0.1);
  animation: pulse 1s infinite;
}

/* Toggle row */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px 0;
}
.toggle-row input { display: none; }
.toggle {
  width: 38px; height: 22px;
  background: var(--bg-2);
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  position: relative;
  transition: background 0.2s;
}
.toggle::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--text-faint);
  transition: all 0.2s;
}
.toggle-row input:checked ~ .toggle {
  background: rgba(108,140,255,0.3);
  border-color: var(--accent);
}
.toggle-row input:checked ~ .toggle::after {
  left: 18px;
  background: var(--accent);
}

/* About tab */
.about-section { margin-bottom: 18px; }
.about-section h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.about-section p {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.6;
}
.about-list {
  list-style: none;
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.8;
}
.about-list li {
  padding-left: 14px;
  position: relative;
}
.about-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--accent);
}
.about-list b { color: var(--text); font-weight: 600; }

/* Presets */
.preset-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.preset-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-2);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 12px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
}
.preset-btn:hover {
  border-color: var(--accent);
  background: var(--bg-3);
}
.preset-btn:disabled {
  opacity: 0.5;
  cursor: wait;
}
.preset-btn .preset-icon {
  width: 28px; height: 28px;
  border-radius: 6px;
  flex-shrink: 0;
}

/* ===== Scene export/import ===== */
.scene-code {
  width: 100%;
  min-height: 220px;
  max-height: 340px;
  background: var(--bg-0);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
  font-size: 11px;
  line-height: 1.5;
  padding: 12px;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s;
}
.scene-code:focus { border-color: var(--accent); }
.scene-code[readonly] { color: var(--text-dim); }
