  :root {
    --bg: #f7f2ea; --grid-dot: #e4dbc8; --panel: #ffffff; --panel-line: #e8e0cf;
    --wire: #c1752e; --accent: #c1752e; --accent-strong: #9c6a35; --pill-bg: #8a6a44;
    --text: #2b2013; --text-dim: #8c7f68; --node-hot: #b45309; --danger: #c0453a;
  }
  [data-theme="dark"] {
    /* Reference-inspired: near-black navy surfaces + restrained warm-gold controls */
    --bg: #070b12; --grid-dot: #26303d; --panel: #0b1019; --panel-line: #202a37;
    --wire: #d8a63f; --accent: #d8a63f; --accent-strong: #e2b54f; --pill-bg: #d5a744;
    --text: #f1f3f5; --text-dim: #a8afb9; --node-hot: #e6b84f; --danger: #ff6b6b;
  }
  [data-theme="dark"] #topbar { background: #090e17; border: 1px solid #1d2734; }
  [data-theme="dark"] .toolbtn { color: #d6d9de; }
  [data-theme="dark"] .toolbtn svg,
  [data-theme="dark"] #themeToggle,
  [data-theme="dark"] #componentsMenuBtn { color: #d9a83e; }
  [data-theme="dark"] .toolbtn.active {
    color: #e4b34a; background: #0d1521; border-color: #23344b;
    box-shadow: inset 0 0 0 1px rgba(216,166,63,.08), 0 0 12px rgba(41,91,153,.14);
  }
  [data-theme="dark"] #sectionSelector { color: #17130b; }
  [data-theme="dark"] #sidebar,
  [data-theme="dark"] #canvas-area,
  [data-theme="dark"] .wf-card,
  [data-theme="dark"] #wfChartWrap { background: #090e16; }
  [data-theme="dark"] #sidebar .sidebar-item { background: #0a0f18; border-color: #202a37; }
  [data-theme="dark"] #sidebar .sidebar-item:hover { background: #0d1420; border-color: #2b3747; }
  [data-theme="dark"] #canvas-wrap { background: #090e16; }
  [data-theme="dark"] #wfChartWrap { border-color: #202a37; }
  * { box-sizing: border-box; -webkit-tap-highlight-color: transparent; user-select: none; }
  html, body {
    margin: 0; padding: 0; height: 100%; background: var(--bg); color: var(--text);
    font-family: 'Segoe UI', system-ui, sans-serif; overflow: hidden; touch-action: none;
  }
  @media screen and (max-aspect-ratio: 99/100) {
    html { transform: rotate(-90deg); transform-origin: left top; width: 100vh; height: 100vw; position: absolute; top: 100%; left: 0; }
  }

