  /* ── canvas view (Figma-style infinite board) ────────── */
  body.view-canvas { overflow: hidden; }
  /* Dotted bg painted on the view itself — body collapses to 0 height under
     `overflow: hidden` with a fixed child, so the body-level bg never renders. */
  #view-canvas {
    position: fixed;
    inset: 0;
    overflow: hidden;
    touch-action: none;
    background-color: var(--bg);
    background-image: radial-gradient(circle, rgba(201, 195, 183, .45) 1px, transparent 1.2px);
    background-size: 26px 26px;
    background-position: 13px 13px;
  }
  #view-canvas:not(.active) { display: none; }
  .canvas-viewport {
    position: absolute;
    inset: 0;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
  }
  .canvas-viewport.is-panning { cursor: grabbing; }
  /* Brush-shaped cursor (Lucide paintbrush) — hotspot near the bristle tip. */
  .canvas-viewport.is-drawing {
    cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 24 24' fill='none' stroke='%231a1a1a' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'><path d='M9.06 11.9l8.07-8.06a2.85 2.85 0 1 1 4.03 4.03l-8.06 8.08'/><path d='M7.07 14.94c-1.66 0-3 1.35-3 3.02 0 1.33-2.5 1.52-2 2.02 1.08 1.1 2.49 2.02 4 2.02 2.2 0 4-1.8 4-4.04a3.01 3.01 0 0 0-3-3.02z' fill='%23d97757'/></svg>") 5 22, crosshair;
  }
  .canvas-world {
    position: absolute;
    top: 0; left: 0;
    transform-origin: 0 0;
    will-change: transform;
  }
  .canvas-draw-layer {
    position: absolute;
    top: 0; left: 0;
    pointer-events: none;
    overflow: visible;
  }
  .canvas-draw-layer path {
    fill: none;
    stroke: var(--accent);
    stroke-width: 2.6;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
  }
  .canvas-cards {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
  }
  .canvas-card {
    position: absolute;
    background: var(--card);
    border: 1px solid var(--line);
    cursor: grab;
    transition: border-color .2s, box-shadow .25s, transform .25s cubic-bezier(.2,.8,.2,1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .canvas-card:hover {
    border-color: var(--ink);
    box-shadow: 0 22px 50px -22px rgba(26,26,26,.35);
    transform: translateY(-3px);
    z-index: 2;
  }
  .canvas-card.is-dragging {
    cursor: grabbing;
    transition: none;
    box-shadow: 0 30px 60px -20px rgba(26,26,26,.45);
    z-index: 9;
  }
  /* When the brush tool is active, cards inherit the viewport's brush cursor
     so drawing over cards feels seamless. */
  .canvas-viewport.is-drawing .canvas-card { cursor: inherit; }
  .canvas-card-thumb {
    position: relative;
    flex: 1 1 auto;
    overflow: hidden;
    background: var(--bg-tint);
    border-bottom: 1px solid var(--line);
  }
  .canvas-card-thumb video,
  .canvas-card-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  .canvas-card-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    overflow: hidden;
    background: var(--card);
    box-shadow: 0 4px 14px -4px rgba(26,26,26,.4);
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .canvas-card-badge svg { width: 100%; height: 100%; display: block; }
  .canvas-card-badge.is-text {
    width: auto;
    height: 22px;
    padding: 0 9px;
    border-radius: 999px;
    border: 1px solid var(--line);
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--ink-soft);
  }
  .canvas-card-body {
    flex: 0 0 auto;
    padding: 14px 16px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  .canvas-card-meta {
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--ink-mute);
    display: flex;
    justify-content: space-between;
    gap: 12px;
  }
  .canvas-card-title {
    font-family: var(--serif);
    font-weight: 500;
    font-size: 18px;
    line-height: 1.18;
    letter-spacing: -.005em;
    color: var(--ink);
    margin: 0;
    transition: color .2s;
  }
  .canvas-card.is-large .canvas-card-title { font-size: 22px; }
  .canvas-card.is-small .canvas-card-title { font-size: 16px; }
  .canvas-card:hover .canvas-card-title { color: var(--accent); }

  /* canvas toolbar */
  .canvas-toolbar {
    position: absolute;
    top: 92px;
    left: 40px;
    z-index: 30;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 5px;
    box-shadow:
      0 2px 6px rgba(26,26,26,.08),
      0 12px 28px -10px rgba(26,26,26,.25),
      0 30px 60px -20px rgba(26,26,26,.35);
  }
  .canvas-toolbar button {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: 0;
    background: transparent;
    color: var(--ink-mute);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .2s, color .2s;
  }
  .canvas-toolbar button:hover { color: var(--ink); }
  .canvas-toolbar button.on {
    background: var(--ink);
    color: var(--bg);
  }
  .canvas-toolbar button svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.4;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .canvas-toolbar .canvas-tool-sep {
    width: 1px;
    height: 18px;
    background: var(--line);
    margin: 0 4px;
  }
  .canvas-zoom-input {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--ink-soft);
    padding: 6px 4px;
    width: 54px;
    text-align: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    outline: none;
    cursor: text;
    transition: background .2s, border-color .2s, color .2s;
  }
  .canvas-zoom-input:hover { color: var(--ink); }
  .canvas-zoom-input:focus {
    color: var(--ink);
    background: var(--bg);
    border-color: var(--line);
  }
  @media (max-width: 820px) {
    .canvas-toolbar { top: 70px; left: 12px; padding: 4px; }
    .canvas-toolbar button { width: 32px; height: 32px; }
  }

