:root {
    --ink: #2b2620;
    --paper: #f4ecd8;
    --accent: #c2410c;
    --red: #dc2626;
    --blue: #2563eb;
    --panel: #1b1b22;
    --line: rgba(255,255,255,.1);
    --text: #f5f5f7;
    --muted: #a6a6af;
  }
  * { box-sizing: border-box; }
  html, body { margin: 0; height: 100%; }
  body {
    background: #141218;
    color: var(--text);
    font-family: Inter, system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
  }
  .app { display: flex; flex-direction: column; height: 100vh; padding: 14px 16px; gap: 10px; }

  .top { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
  .back { color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 600; }
  .back:hover { color: #fff; }
  .top h1 {
    margin: 0;
    font-family: "Bebas Neue", sans-serif;
    font-size: 32px;
    letter-spacing: .05em;
    line-height: 1;
  }
  .top h1 span { color: var(--accent); }
  .top .sub { margin: 0; color: var(--muted); font-size: 12.5px; flex-basis: 100%; }

  .toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
  .sep { width: 1px; height: 26px; background: var(--line); }
  .tool {
    height: 36px;
    padding: 0 13px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255,255,255,.03);
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s, transform .1s;
  }
  .tool:hover { background: rgba(255,255,255,.08); }
  .tool:active { transform: scale(.95); }
  .tool.is-active { border-color: var(--accent); background: rgba(194,65,12,.18); color: #ffd7b0; }
  .tool.side { border-color: rgba(220,38,38,.5); }
  .tool.side.blue { border-color: rgba(37,99,235,.6); color: #bfd4ff; }
  .tool.danger { border-color: rgba(220,38,38,.35); color: #fca5a5; }

  .stage { flex: 1; position: relative; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
  canvas {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none;
    cursor: crosshair;
    background:
      repeating-linear-gradient(to bottom, transparent 0 23px, rgba(43,38,32,.055) 23px 24px),
      var(--paper);
  }
  .status { color: var(--muted); font-size: 12.5px; min-height: 18px; }
  .status b { color: #ffd7b0; }