    :root {
      --border: #e6e6e6;
      --text: #111;
      --muted: #666;
      --bg: #fff;
      --panel: #fafafa;
      --accent: #0b5fff;
      --cell: 16;
    }
    html, body { height: 100%; }
    body {
      margin: 0;
      font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Inter,Arial,sans-serif;
      color: var(--text);
      background: var(--bg);
    }
    .app {
      height: 100%;
      display: grid;
      grid-template-columns: 320px 1fr;
      grid-template-rows: 1fr;
    }
    aside {
      border-right: 1px solid var(--border);
      background: var(--panel);
      padding: 14px;
      overflow: auto;
    }
    main {
      position: relative;
      overflow: hidden;
    }
    h1 { font-size: 16px; margin: 0 0 10px; }
    h2 { font-size: 13px; margin: 16px 0 8px; color: var(--muted); font-weight: 600; letter-spacing: .02em; text-transform: uppercase; }
    .row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
    label { font-size: 12px; color: var(--muted); display: block; margin-bottom: 4px; }
    input[type="number"], input[type="text"] {
      width: 100%;
      padding: 8px 10px;
      border: 1px solid var(--border);
      border-radius: 10px;
      background: #fff;
      box-sizing: border-box;
    }
    input[type="color"] {
      width: 24px;
      height: 24px;
      border: 1px solid var(--border);
      border-radius: 10px;
      background: #fff;
      padding: 0;
      box-sizing: border-box;
    }
    button {
      padding: 8px 10px;
      border-radius: 10px;
      border: 1px solid var(--border);
      background: #fff;
      cursor: pointer;
      font-weight: 600;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
    }
    button.primary {
      background: var(--accent);
      border-color: var(--accent);
      color: #fff;
    }
    button:disabled { opacity: .5; cursor: not-allowed; }
    .icon {
      width: 14px;
      height: 14px;
      flex: 0 0 auto;
      display: inline-block;
    }
    .icon-light { display: none; }
    button.primary .icon-dark { display: none; }
    button.primary .icon-light { display: inline-block; }
    button.icon-only { padding: 3px; width: 24px; height: 24px; }
    button.icon-only .icon { width: 12px; height: 12px; }
    .pill {
      display: inline-flex;
      gap: 6px;
      align-items: center;
      padding: 6px 10px;
      border: 1px solid var(--border);
      border-radius: 999px;
      background: #fff;
      font-size: 12px;
    }
    .toolbar { display: flex; gap: 8px; flex-wrap: wrap; }
    .threads { display: grid; gap: 8px; }
    .thread {
      display: grid;
      grid-template-columns: 46px 1fr 30px;
      gap: 10px;
      align-items: center;
      padding: 8px;
      border: 1px solid var(--border);
      border-radius: 12px;
      background: #fff;
      cursor: pointer;
    }

    .thread-color::-webkit-color-swatch-wrapper { padding: 0; }
    .thread-color::-webkit-color-swatch { border: 0; border-radius: 999px; }
    .thread-color::-moz-color-swatch { border: 0; border-radius: 999px; }
    .thread-color::-moz-focus-inner { border: 0; padding: 0; }
    .thread-color:focus-visible {
      outline: 2px solid var(--accent);
      outline-offset: 2px;
    }
    .thread-remove {
      width: 16px;
      height: 16px;
      padding: 0;
      border-radius: 999px;
    }
    button.danger.thread-remove:hover { background: #fff7f7; }
    .thread.selected { outline: 2px solid var(--accent); outline-offset: 0; }
    .swatch { width: 18px; height: 18px; border-radius: 6px; border: 1px solid var(--border); }
    .small { font-size: 12px; color: var(--muted); }
    .divider { height: 1px; background: var(--border); margin: 14px 0; }
    .collapsible summary {
      cursor: pointer;
      user-select: none;
      display: flex;
      align-items: center;
      justify-content: space-between;
      font-size: 13px;
      margin: 16px 0 8px;
      color: var(--muted);
      font-weight: 600;
      letter-spacing: .02em;
      text-transform: uppercase;
      list-style: none;
    }
    .collapsible summary::-webkit-details-marker { display:none; }
    .collapsible:first-of-type summary { margin-top: 0; }
    .collapsible summary::after { content: "▾"; color: var(--muted); }
    .collapsible:not([open]) summary::after { content: "▸"; }
    .canvas-wrap {
      position: absolute;
      inset: 0;
      display: grid;
      place-items: center;
      background: #fff;
    }
    #p5-root { width: 100%; height: 100%; }
    .full { width: 100%; }
    .statusbar {
      position: absolute;
      left: 12px;
      bottom: 12px;
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      align-items: center;
      pointer-events: none;
    }
    .canvas-actions {
      position: absolute;
      left: 12px;
      top: 12px;
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      align-items: center;
      z-index: 5;
      pointer-events: auto;
    }
