    :root {
      color-scheme: dark;
      font-family: Inter, system-ui, sans-serif;
    }

    * {
      box-sizing: border-box;
    }

    body {
      margin: 0;
      background: #111;
      color: #eee;
    }

    button,
    input,
    textarea {
      font: inherit;
    }

    .app {
      display: grid;
      grid-template-columns: minmax(0, 1fr) 440px;
      min-height: 100vh;
    }

    .preview-pane {
      min-width: 0;
      padding: 16px;
      display: flex;
      flex-direction: column;
      gap: 12px;
    }

    .toolbar {
      display: flex;
      flex-wrap: wrap;
      gap: 8px 12px;
      align-items: end;
    }

    .toolbar label {
      display: grid;
      gap: 4px;
      font-size: 12px;
      color: #bbb;
    }

    .toolbar input[type="number"] {
      width: 100px;
    }

    button,
    .file-button {
      border: 1px solid #444;
      border-radius: 6px;
      padding: 8px 12px;
      background: #242424;
      color: #eee;
      cursor: pointer;
    }

    button:hover,
    .file-button:hover {
      background: #303030;
    }

    .file-button input {
      display: none;
    }

    .canvas-wrap {
      flex: 1;
      min-height: 320px;
      overflow: auto;
      border: 1px solid #333;
      border-radius: 8px;
      padding: 20px;
      display: grid;
      place-items: center;
      background:
        linear-gradient(45deg, #1c1c1c 25%, transparent 25%) 0 0 / 20px 20px,
        linear-gradient(45deg, transparent 75%, #1c1c1c 75%) 0 0 / 20px 20px,
        linear-gradient(45deg, transparent 75%, #1c1c1c 75%) 10px -10px / 20px 20px,
        linear-gradient(45deg, #1c1c1c 25%, #171717 25%) 10px -10px / 20px 20px;
    }

    canvas {
      display: block;
      max-width: 100%;
      max-height: calc(100vh - 130px);
      box-shadow: 0 8px 40px #0009;
      background:
        linear-gradient(45deg, #ddd 25%, transparent 25%) 0 0 / 16px 16px,
        linear-gradient(45deg, transparent 75%, #ddd 75%) 0 0 / 16px 16px,
        linear-gradient(45deg, transparent 75%, #ddd 75%) 8px -8px / 16px 16px,
        linear-gradient(45deg, #ddd 25%, #fff 25%) 8px -8px / 16px 16px;
      cursor: grab;
    }

    canvas.dragging {
      cursor: grabbing;
    }

    .sidebar {
      border-left: 1px solid #333;
      padding: 16px;
      overflow: auto;
      max-height: 100vh;
      display: flex;
      flex-direction: column;
      gap: 14px;
      background: #171717;
    }

    h1 {
      margin: 0;
      font-size: 18px;
    }

    h2 {
      margin: 0 0 8px;
      font-size: 14px;
    }

    select {
      color: #eee;
      background: #242424;
      border: 1px solid #444;
      border-radius: 6px;
      padding: 8px;
      font: inherit;
    }

    .preset-row {
      align-items: center;
      margin: 0 0 10px;
    }

    .preset-row label {
      color: #bbb;
      font-size: 12px;
    }

    button:disabled {
      opacity: 0.5;
      cursor: default;
    }

    textarea {
      width: 100%;
      min-height: 250px;
      resize: vertical;
      border: 1px solid #444;
      border-radius: 6px;
      padding: 10px;
      background: #0e0e0e;
      color: #ddd;
      line-height: 1.4;
      tab-size: 2;
      transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
    }

    textarea.drop-target,
    #configDropZone.drop-target textarea {
      border-color: #4aa3ff;
      box-shadow: 0 0 0 2px #4aa3ff55;
      background: #111923;
    }

    #configDropZone {
      border-radius: 6px;
    }

    .native-json-drop-zone {
      position: relative;
      display: grid;
      place-items: center;
      min-height: 54px;
      margin-bottom: 8px;
      border: 2px dashed #555;
      border-radius: 6px;
      background: #131313;
      color: #aaa;
      cursor: pointer;
      user-select: none;
      overflow: hidden;
    }

    .native-json-drop-zone:hover {
      border-color: #4aa3ff;
      color: #ddd;
      background: #111923;
    }

    .native-json-drop-zone input[type="file"] {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      opacity: 0;
      cursor: pointer;
    }

    .button-row {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-top: 8px;
    }

    .status {
      min-height: 20px;
      font-size: 12px;
      color: #aaa;
    }

    .status.error {
      color: #ff8d8d;
    }

    .layers {
      display: grid;
      gap: 8px;
    }

    .layer {
      border: 1px solid #333;
      border-radius: 7px;
      padding: 9px;
      background: #202020;
    }

    .layer.selected {
      outline: 2px solid #4aa3ff;
      outline-offset: -1px;
    }

    .layer.dragging {
      opacity: 0.45;
    }

    .layer.drag-over {
      border-top: 3px solid #4aa3ff;
    }

    .layer-head {
      display: flex;
      justify-content: space-between;
      gap: 8px;
      align-items: center;
      margin-bottom: 8px;
    }

    .layer-title {
      display: flex;
      align-items: center;
      min-width: 0;
      gap: 8px;
    }

    .drag-handle {
      flex: 0 0 auto;
      cursor: grab;
      user-select: none;
      color: #888;
      font-size: 18px;
      line-height: 1;
      padding: 2px 4px;
    }

    .drag-handle:active {
      cursor: grabbing;
    }

    .layer-name {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      font-weight: 600;
      font-size: 13px;
    }

    .visible-label {
      display: flex;
      gap: 5px;
      align-items: center;
      font-size: 12px;
      color: #aaa;
      cursor: pointer;
      user-select: none;
    }

    .layer-grid {
      display: grid;
      grid-template-columns: 70px 1fr;
      gap: 6px 8px;
      align-items: center;
      font-size: 12px;
      color: #aaa;
    }

    .layer-grid input[type="text"],
    .layer-grid input[type="number"] {
      width: 100%;
      min-width: 0;
      border: 1px solid #444;
      border-radius: 4px;
      padding: 5px 6px;
      background: #111;
      color: #eee;
    }

    .hint {
      font-size: 12px;
      line-height: 1.45;
      color: #999;
    }

    code {
      color: #cfe6ff;
    }

    @media (max-width: 900px) {
      .app {
        grid-template-columns: 1fr;
      }

      .sidebar {
        border-left: 0;
        border-top: 1px solid #333;
        max-height: none;
      }
    }
