
    /* ── Reset & base ──────────────────────────────────────── */
    *, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

    :root {
      --bg: #040714;
      --surface-1: rgba(255,255,255,.03);
      --surface-2: rgba(255,255,255,.06);
      --border-subtle: rgba(255,255,255,.07);
      --border: rgba(255,255,255,.1);
      --border-strong: rgba(255,255,255,.22);
      --text-primary: #f9f9f9;
      --text-secondary: #cacaca;
      --text-muted: rgba(255,255,255,.55);
      --accent: #0063e5;
      --font: 'Avenir Next', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
      --text-xs: 0.75rem; --text-sm: 0.875rem; --text-base: 1rem;
      --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
      --radius-sm: 6px; --radius: 10px; --radius-lg: 15px;
      --ease-snap: cubic-bezier(0.34, 1.56, 0.64, 1);
      --dur-fast: 120ms; --dur: 200ms;
      /* Block type colors */
      --c-goal:        #a78bfa;
      --c-problem:     #f87171;
      --c-requirement: #fbbf24;
      --c-risk:        #fb923c;
      --c-question:    #38bdf8;
      --c-decision:    #34d399;
      --c-resource:    #2dd4bf;
      --c-output:      #818cf8;
      --c-context:     #64748b;
      --c-custom:      #c084fc;
    }

    body {
      font-family: var(--font);
      background: var(--bg);
      height: 100vh;
      color: var(--text-primary);
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }

    /* ── Header ────────────────────────────────────────────── */
    .header-bar {
      background: linear-gradient(in oklch 135deg, #B015B0 0%, #3D0080 50%, #040714 100%);
      backdrop-filter: blur(12px);
      border-bottom: 1px solid rgba(255,255,255,.07);
      padding: 0 16px 0 24px;
      height: 68px;
      display: flex;
      align-items: center;
      gap: 8px;
      flex-shrink: 0;
      z-index: 200;
    }

    .header-logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

    .header-logo-img {
      height: 36px; width: auto; flex-shrink: 0;
      filter: brightness(0) invert(1);
      transition: transform 0.3s var(--ease-snap);
      display: block;
    }
    .header-logo-img:hover { transform: scale(1.14) rotate(-9deg); }

    .header-logo h1 { font-size: 1.2em; font-weight: 600; letter-spacing: .5px; }
    .header-subtitle { font-size: .82em; color: rgba(255,255,255,.72); font-weight: 500; margin-top: 2px; }
    #canvasTitle { cursor: text; border-radius: 3px; padding: 0 3px; margin: 0 -3px; transition: background var(--dur-fast); }
    #canvasTitle:hover { background: rgba(255,255,255,.1); }
    #canvasTitle[contenteditable=true] { outline: none; background: rgba(255,255,255,.1); }

    .header-spacer { flex: 1; }

    .header-btn {
      background: rgba(255,255,255,.1);
      border: 1px solid rgba(255,255,255,.15);
      color: rgba(255,255,255,.9);
      font-family: var(--font);
      font-size: var(--text-sm);
      font-weight: 500;
      padding: 8px 14px;
      min-height: 36px;
      border-radius: var(--radius-sm);
      cursor: pointer;
      transition: background var(--dur), border-color var(--dur);
      white-space: nowrap;
    }
    .header-btn:hover { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.28); }
    .header-btn.active { background: rgba(255,255,255,.22); border-color: rgba(255,255,255,.38); }

    .header-btn-danger {
      background: rgba(248,113,113,.12);
      border-color: rgba(248,113,113,.28);
      color: #f87171;
    }
    .header-btn-danger:hover { background: rgba(248,113,113,.25); border-color: rgba(248,113,113,.4); }

    .header-btn-icon {
      padding: 8px;
      display: flex; align-items: center; justify-content: center;
    }
    .header-btn-icon svg { width: 16px; height: 16px; display: block; }

    .header-btn-group {
      display: flex;
      align-items: center;
      gap: 4px;
      padding-left: 8px;
      border-left: 1px solid rgba(255,255,255,.1);
    }
    .header-btn-group:first-of-type { border-left: none; padding-left: 0; }

    /* Export dropdown */
    .export-wrapper { position: relative; }
    .export-dropdown {
      position: absolute;
      top: calc(100% + 6px);
      right: 0;
      background: #14142a;
      border: 1px solid var(--border-strong);
      border-radius: var(--radius);
      padding: 6px;
      min-width: 200px;
      z-index: 999;
      display: none;
      box-shadow: 0 8px 32px rgba(0,0,0,.55);
    }
    .export-wrapper.open .export-dropdown { display: block; }

    .export-item {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 8px 12px;
      border-radius: var(--radius-sm);
      cursor: pointer;
      font-size: var(--text-sm);
      color: var(--text-secondary);
      transition: background var(--dur-fast);
    }
    .export-item:hover, .export-item:focus { background: var(--surface-2); color: var(--text-primary); outline: none; }
    .export-item svg { width: 16px; height: 16px; flex-shrink: 0; opacity: .65; }

    .header-home {
      display: flex; align-items: center;
      margin-left: 4px;
      padding: 5px;
      color: rgba(255,255,255,.9);
      text-decoration: none;
      border-radius: var(--radius-sm);
      transition: color var(--dur), background var(--dur);
      flex-shrink: 0;
    }
    .header-home:hover { color: #fff; background: rgba(255,255,255,.12); }
    .header-home svg { width: 34px; height: 34px; display: block; }

    /* ── App body ───────────────────────────────────────────── */
    .app-body { display: flex; flex: 1; overflow: hidden; }

    /* ── Palette ────────────────────────────────────────────── */
    .palette {
      width: 200px;
      flex-shrink: 0;
      background: rgba(255,255,255,.012);
      border-right: 1px solid var(--border-subtle);
      display: flex;
      flex-direction: column;
      overflow-y: auto;
      transition: width 0.25s ease;
    }

    /* Palette section toggles */
    .palette-section { flex-shrink: 0; }
    .palette-section-toggle {
      padding: 10px 16px 8px;
      font-size: var(--text-xs);
      font-weight: 700;
      color: var(--text-muted);
      letter-spacing: .1em;
      text-transform: uppercase;
      border-bottom: 1px solid var(--border-subtle);
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: space-between;
      user-select: none;
      transition: color var(--dur-fast);
    }
    .palette-section-toggle:hover { color: var(--text-secondary); }
    .palette-chevron {
      width: 16px; height: 16px; flex-shrink: 0;
      transition: transform 0.2s ease;
    }
    .palette-section.collapsed .palette-chevron { transform: rotate(-90deg); }
    .palette-section-body {
      overflow: hidden;
      transition: max-height 0.25s ease;
      max-height: 600px;
    }
    .palette-section.collapsed .palette-section-body { max-height: 0; }

    .palette-item {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 9px 16px;
      cursor: grab;
      border-bottom: 1px solid var(--border-subtle);
      transition: background var(--dur-fast);
      user-select: none;
    }
    .palette-item:hover { background: var(--surface-2); }
    .palette-item:active { background: rgba(255,255,255,.08); cursor: grabbing; }
    .palette-item.dragging { opacity: 0.4; cursor: grabbing; }
    .palette-drag-ghost {
      padding: 6px 14px; border-radius: 8px;
      background: var(--surface-2); color: var(--text-primary);
      font-size: var(--text-sm); font-weight: 600;
      box-shadow: 0 4px 16px rgba(0,0,0,.4);
      transform: translate(-50%, -50%);
      white-space: nowrap;
    }

    .palette-dot {
      width: 10px; height: 10px;
      border-radius: 50%;
      flex-shrink: 0;
    }
    .palette-item-text { min-width: 0; }

    .palette-label { font-size: var(--text-sm); color: var(--text-secondary); font-weight: 500; }
    .palette-desc  { font-size: 11px; color: var(--text-muted); line-height: 1.3; margin-top: 1px; }

    /* Palette collapse button */
    .palette-collapse-btn {
      margin-top: auto; flex-shrink: 0;
      display: flex; align-items: center; justify-content: center;
      padding: 8px; border: none; background: none;
      color: var(--text-muted); cursor: pointer;
      border-top: 1px solid var(--border-subtle);
      transition: color var(--dur-fast), background var(--dur-fast);
    }
    .palette-collapse-btn:hover { color: var(--text-secondary); background: var(--surface-1); }
    .palette-collapse-btn svg { width: 18px; height: 18px; transition: transform 0.25s ease; }

    /* Collapsed palette */
    .palette.collapsed { width: 48px; }
    .palette.collapsed .palette-section-toggle span,
    .palette.collapsed .palette-item-text,
    .palette.collapsed .palette-desc,
    .palette.collapsed .palette-chevron { display: none; }
    .palette.collapsed .palette-section-toggle {
      justify-content: center;
      padding: 8px 4px 6px;
      font-size: 9px;
      letter-spacing: .05em;
    }
    .palette.collapsed .palette-item {
      justify-content: center;
      padding: 10px 4px;
      gap: 0;
    }
    .palette.collapsed .palette-dot { width: 14px; height: 14px; }
    .palette.collapsed .palette-section-body { max-height: 600px !important; }
    .palette.collapsed .palette-section.collapsed .palette-section-body { max-height: 0 !important; }
    .palette.collapsed .palette-collapse-btn svg { transform: rotate(180deg); }
    .palette.collapsed .template-item { justify-content: center; padding: 10px 4px; }
    .palette.collapsed .template-item > div:last-child { display: none; }
    .palette.collapsed .template-icon { margin: 0; }

    /* ── Canvas ─────────────────────────────────────────────── */
    .canvas-viewport {
      flex: 1;
      overflow: hidden;
      position: relative;
      cursor: default;
      touch-action: none;  /* let JS handle all touch events */
    }

    .canvas-viewport.drop-target {
      outline: 2px dashed rgba(255,255,255,.35);
      outline-offset: -4px;
      background-color: rgba(255,255,255,.02);
    }

    .canvas-root {
      position: relative;
      width: 1px; height: 1px;
      transform-origin: 0 0;
    }

    /* SVG arrows layer — sits under blocks */
    .arrows-layer {
      position: absolute;
      top: 0; left: 0;
      width: 1px; height: 1px;
      overflow: visible;
      pointer-events: none;
    }

    /* Arrow paths — color/weight driven by JS-set CSS custom props --ac / --aw / --ac-hi */
    .arrow-path {
      fill: none;
      stroke: var(--ac, rgba(255,255,255,.3));
      stroke-width: var(--aw, 2px);
      pointer-events: none;
      transition: stroke var(--dur-fast), stroke-dasharray 0.5s ease, stroke-width 0.3s ease;
      stroke-dasharray: 20 0;
      stroke-dashoffset: 0;
      animation: arrowFlow 1.8s linear infinite;
    }

    .arrow-label {
      font-size: 10px;
      font-family: var(--font);
      fill: rgba(255,255,255,.6);
      text-anchor: middle;
      dominant-baseline: middle;
      pointer-events: none;
      paint-order: stroke fill;
      stroke: #040714;
      stroke-width: 4px;
      stroke-linejoin: round;
    }
    .arrow-label.selected { fill: rgba(255,255,255,.9); }

    .arrow-hitbox {
      fill: none;
      stroke: transparent;
      stroke-width: 14;
      cursor: pointer;
      pointer-events: stroke;
    }

    .arrow-preview {
      fill: none;
      stroke: rgba(255,255,255,.38);
      stroke-width: 2;
      stroke-dasharray: 7 4;
      pointer-events: none;
    }

    /* Empty canvas hint */
    .canvas-hint {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      text-align: center;
      color: rgba(255,255,255,.35);
      font-size: var(--text-sm);
      line-height: 1.9;
      pointer-events: none;
      user-select: none;
    }
    .canvas-hint svg { width: 40px; height: 40px; opacity: .3; display: block; margin: 0 auto 12px; }

    /* ── Blocks ─────────────────────────────────────────────── */
    .block {
      position: absolute;
      width: 220px;
      border-radius: var(--radius);
      border-left: 3px solid var(--bc, rgba(255,255,255,.12));
      border-top: 1px solid color-mix(in srgb, var(--bc, white) 28%, transparent);
      border-right: 1px solid color-mix(in srgb, var(--bc, white) 28%, transparent);
      border-bottom: 1px solid color-mix(in srgb, var(--bc, white) 28%, transparent);
      background: rgba(8, 8, 22, 0.88);
      padding: 10px 12px 10px;
      cursor: grab;
      user-select: none;
      transition: box-shadow var(--dur);
    }
    .block:hover { box-shadow: 0 4px 20px rgba(0,0,0,.45); }
    .block.selected {
      outline: 2px solid rgba(255,255,255,.38);
      outline-offset: 2px;
      box-shadow: 0 4px 24px rgba(0,0,0,.5);
    }
    .select-box {
      position: absolute;
      border: 1.5px dashed rgba(255,255,255,.55);
      background: rgba(255,255,255,.04);
      border-radius: 4px;
      pointer-events: none;
      display: none;
      z-index: 10;
    }
    .search-overlay {
      position: absolute;
      top: 16px;
      left: 50%;
      transform: translateX(-50%);
      width: 300px;
      z-index: 200;
    }
    .search-input {
      width: 100%;
      background: rgba(8,8,22,.92);
      border: 1px solid rgba(255,255,255,.28);
      border-radius: var(--radius);
      padding: 9px 14px 9px 36px;
      color: var(--text-primary);
      font-family: var(--font);
      font-size: var(--text-sm);
      outline: none;
      backdrop-filter: blur(12px);
      box-shadow: 0 8px 32px rgba(0,0,0,.55);
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='rgba(255,255,255,.35)'%3E%3Cpath d='M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z'/%3E%3C/svg%3E");
      background-repeat: no-repeat;
      background-size: 18px 18px;
      background-position: 11px center;
    }
    .search-input:focus { border-color: rgba(255,255,255,.45); }
    .search-results {
      margin-top: 4px;
      background: rgba(8,8,22,.95);
      border: 1px solid rgba(255,255,255,.14);
      border-radius: var(--radius);
      overflow: hidden;
      backdrop-filter: blur(12px);
      box-shadow: 0 8px 32px rgba(0,0,0,.55);
      display: none;
    }
    .search-results.has-results { display: block; }
    .search-result {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 9px 14px;
      cursor: pointer;
      font-size: var(--text-sm);
      color: var(--text-secondary);
      transition: background var(--dur-fast);
    }
    .search-result:hover, .search-result.focused { background: var(--surface-2); color: var(--text-primary); }
    .search-result-dot {
      width: 8px; height: 8px;
      border-radius: 50%;
      flex-shrink: 0;
    }
    .search-result-title { flex: 1; font-weight: 500; }
    .search-result-type { font-size: var(--text-xs); color: var(--text-muted); }
    .zoom-indicator {
      position: absolute;
      bottom: 14px;
      left: 14px;
      background: rgba(8,8,22,.75);
      border: 1px solid rgba(255,255,255,.12);
      border-radius: var(--radius-sm);
      padding: 4px 9px;
      font-size: var(--text-xs);
      color: var(--text-muted);
      font-variant-numeric: tabular-nums;
      pointer-events: none;
      user-select: none;
      z-index: 100;
      backdrop-filter: blur(6px);
    }
    .block.dragging { cursor: grabbing; box-shadow: 0 10px 36px rgba(0,0,0,.55); z-index: 100; }
    .canvas-root.has-hover .arrow-path:not(.related) { stroke: rgba(255,255,255,.08) !important; }
    .canvas-root.has-hover .block:not(.related):not(:hover) { opacity: 0.4; transition: opacity 120ms; }

    @keyframes arrowFlow { to { stroke-dashoffset: -20; } }
    .arrow-path.related {
      stroke: var(--ac-hi, rgba(255,255,255,.7)) !important;
      stroke-width: 2.5px !important;
      stroke-dasharray: 8 12;
    }

    /* Block type accent — drives left border, faint side borders, and background tint */
    .block[data-type=goal]        { --bc: var(--c-goal); }
    .block[data-type=problem]     { --bc: var(--c-problem); }
    .block[data-type=requirement] { --bc: var(--c-requirement); }
    .block[data-type=risk]        { --bc: var(--c-risk); }
    .block[data-type=question]    { --bc: var(--c-question); }
    .block[data-type=decision]    { --bc: var(--c-decision); }
    .block[data-type=resource]    { --bc: var(--c-resource); }
    .block[data-type=output]      { --bc: var(--c-output); }
    .block[data-type=context]     { --bc: var(--c-context); }
    .block[data-type=custom]      { --bc: var(--c-custom); }

    /* Opt-in colored background tint (toggled via header button) */
    body.tinted-blocks .block {
      background: linear-gradient(135deg, color-mix(in srgb, var(--bc, #080816) 14%, rgba(8,8,22,.92)) 0%, color-mix(in srgb, var(--bc, #080816) 6%, rgba(8,8,22,.92)) 100%);
    }

    .block-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 5px;
    }

    .block-type-badge {
      font-size: 9px;
      font-weight: 700;
      letter-spacing: .07em;
      text-transform: uppercase;
      padding: 2px 6px;
      border-radius: 3px;
      background: rgba(255,255,255,.06);
    }
    .block .block-type-badge { color: var(--bc, var(--text-muted)); }

    .block-gap-icons { display: flex; gap: 3px; }
    .gap-icon { font-size: 11px; line-height: 1; }

    /* Vote indicator in block header */
    .block-vote-indicator {
      margin-left: 6px;
      padding: 3px 6px;
      background: rgba(255, 255, 255, 0.06);
      border-radius: 10px;
      font-size: 11px;
      font-weight: 600;
      color: var(--text-secondary);
      cursor: pointer;
      transition: all var(--dur-fast);
    }
    .block-vote-indicator:hover {
      background: rgba(255, 255, 255, 0.12);
      transform: scale(1.05);
    }
    .block-vote-indicator.has-votes {
      background: rgba(16, 185, 129, 0.15);
      color: #10b981;
    }

    .block-title {
      font-size: var(--text-sm);
      font-weight: 600;
      color: var(--text-primary);
      line-height: 1.35;
      word-break: break-word;
      outline: none;
      min-height: 1.2em;
    }
    .block-title[contenteditable=true] {
      background: rgba(255,255,255,.06);
      border-radius: 3px;
      padding: 2px 4px;
      cursor: text;
    }

    .block-desc {
      font-size: 11px;
      color: rgba(255,255,255,.55);
      line-height: 1.4;
      margin-top: 4px;
      word-break: break-word;
    }

    .block-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 3px;
      margin-top: 6px;
    }

    .action-badge {
      font-size: 9px;
      font-weight: 700;
      letter-spacing: .04em;
      text-transform: uppercase;
      padding: 2px 5px;
      border-radius: 3px;
    }
    .action-badge.resolve   { background: rgba(248,113,113,.18); color: #f87171; }
    .action-badge.prepare   { background: rgba(251,191,36,.18);  color: #fbbf24; }
    .action-badge.recollect { background: rgba(56,189,248,.18);  color: #38bdf8; }
    .action-badge.reinforce { background: rgba(52,211,153,.18);  color: #34d399; }

    /* ── Ports ──────────────────────────────────────────────── */
    .port {
      position: absolute;
      width: 10px; height: 10px;
      background: rgba(255,255,255,.55);
      border: 2px solid rgba(0,0,0,.25);
      border-radius: 50%;
      cursor: crosshair;
      opacity: 0;
      transition: opacity var(--dur-fast), background var(--dur-fast);
      z-index: 20;
    }
    .block:hover .port { opacity: 1; }
    .port:hover { background: #fff; transform: scale(1.3); }
    .port-left   { top: 50%; left: -5px;  transform: translateY(-50%); }
    .port-right  { top: 50%; right: -5px; transform: translateY(-50%); }
    .port-top    { top: -5px;    left: 50%; transform: translateX(-50%); }
    .port-bottom { bottom: -5px; left: 50%; transform: translateX(-50%); }
    .port-left:hover   { transform: translateY(-50%) scale(1.3); }
    .port-right:hover  { transform: translateY(-50%) scale(1.3); }
    .port-top:hover    { transform: translateX(-50%) scale(1.3); }
    .port-bottom:hover { transform: translateX(-50%) scale(1.3); }

    /* ── Gap glows ──────────────────────────────────────────── */
    @keyframes pulseRed {
      0%,100% { box-shadow: 0 0 0   0 rgba(248,113,113,0); }
      50%      { box-shadow: 0 0 18px 4px rgba(248,113,113,.35); }
    }
    @keyframes glowAmber {
      0%,100% { box-shadow: 0 0 8px  2px rgba(251,191,36,.22); }
      50%      { box-shadow: 0 0 20px 5px rgba(251,191,36,.45); }
    }
    @keyframes glowYellow {
      0%,100% { box-shadow: 0 0 6px  2px rgba(250,204,21,.18); }
      50%      { box-shadow: 0 0 16px 4px rgba(250,204,21,.4); }
    }

    .block.gap-isolated {
      border-style: dashed;
      border-left-style: solid;
      border-top-color: rgba(255,255,255,.12);
      border-right-color: rgba(255,255,255,.12);
      border-bottom-color: rgba(255,255,255,.12);
    }

    .block.gap-assumption  { animation: glowAmber  2s ease-in-out infinite; }
    .block.gap-no-req      { animation: glowYellow 2.5s ease-in-out infinite; }
    .block.gap-unaddressed { animation: pulseRed   1.8s ease-in-out infinite; }

    /* ── Right panel ────────────────────────────────────────── */
    .right-panel {
      width: 320px;
      flex-shrink: 0;
      border-left: 1px solid var(--border-subtle);
      display: flex;
      flex-direction: column;
      background: rgba(255,255,255,.01);
      overflow: hidden;
    }

    .panel-tabs {
      display: flex;
      border-bottom: 1px solid var(--border-subtle);
      flex-shrink: 0;
    }

    .panel-tab {
      flex: 1;
      padding: 10px 8px;
      text-align: center;
      font-size: var(--text-xs);
      font-weight: 700;
      letter-spacing: .07em;
      text-transform: uppercase;
      color: var(--text-muted);
      cursor: pointer;
      border: none;
      background: none;
      border-bottom: 2px solid transparent;
      font-family: var(--font);
      transition: color var(--dur), border-color var(--dur);
    }
    .panel-tab.active      { color: var(--text-primary); border-bottom-color: rgba(255,255,255,.38); }
    .panel-tab:hover:not(.active) { color: var(--text-secondary); }

    /* ── Timer Widget ─────────────────────────────────────────── */
    .timer-widget {
      padding: 12px 16px;
      border-bottom: 1px solid var(--border-subtle);
      background: rgba(255,255,255,.02);
      transition: background var(--dur-fast);
    }
    .timer-widget:hover { background: rgba(255,255,255,.04); }
    .timer-widget.active { background: rgba(16, 185, 129, .08); border-bottom-color: rgba(16,185,129,.2); }

    .timer-header {
      display: flex;
      align-items: center;
      gap: 10px;
      margin-bottom: 8px;
    }

    .timer-display {
      flex: 1;
      font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
      font-size: 18px;
      font-weight: 600;
      color: var(--text-primary);
      text-align: center;
      padding: 6px 0;
      background: rgba(255,255,255,.03);
      border-radius: var(--radius-sm);
      transition: all var(--dur-fast);
    }
    .timer-display.warning { color: #f59e0b; background: rgba(245,158,11,.08); animation: pulse 1.5s infinite; }
    .timer-display.critical { color: #ef4444; background: rgba(239,68,68,.08); animation: pulse 1s infinite; }

    .timer-toggle {
      width: 28px;
      height: 28px;
      padding: 4px;
      background: none;
      border: none;
      color: var(--text-muted);
      cursor: pointer;
      border-radius: 6px;
      transition: all var(--dur-fast);
    }
    .timer-toggle svg { width: 100%; height: 100%; }
    .timer-toggle:hover { background: rgba(255,255,255,.06); color: var(--text-secondary); }
    .timer-toggle.active { color: #10b981; }

    .timer-controls { display: flex; align-items: center; gap: 8px; }

    .timer-input {
      width: 56px;
      padding: 6px 8px;
      background: rgba(255,255,255,.03);
      border: 1px solid rgba(255,255,255,.1);
      border-radius: var(--radius-sm);
      color: var(--text-primary);
      font-family: var(--font);
      font-size: var(--text-sm);
      text-align: center;
    }
    .timer-input:focus { outline: none; border-color: var(--ac); }

    .timer-btn-group { display: flex; align-items: center; gap: 6px; }

    .timer-btn {
      padding: 5px 10px;
      background: rgba(255,255,255,.04);
      border: 1px solid rgba(255,255,255,.1);
      border-radius: var(--radius-sm);
      color: var(--text-primary);
      font-family: var(--font);
      font-size: var(--text-xs);
      font-weight: 600;
      cursor: pointer;
      transition: all var(--dur-fast);
    }
    .timer-btn:hover { background: rgba(255,255,255,.08); }
    .timer-btn.primary { background: rgba(16,185,129,.15); border-color: rgba(16,185,129,.2); color: #10b981; }

    body.light-mode .timer-widget { background: rgba(0,0,0,.02); }
    body.light-mode .timer-display { background: rgba(0,0,0,.03); color: var(--text-primary); }
    body.light-mode .timer-display.warning { color: #d97706; background: rgba(217,119,6,.08); }
    body.light-mode .timer-display.critical { color: #dc2626; background: rgba(220,38,38,.08); }

    /* ── Panel content ─────────────────────────────────────────── */
    .panel-content { flex: 1; overflow-y: auto; overflow-x: hidden; }

    .tab-pane         { display: none; padding: 16px; }
    .tab-pane.active  { display: block; }

    /* Inspector */
    .inspector-empty {
      color: var(--text-muted);
      font-size: var(--text-sm);
      text-align: center;
      padding: 36px 16px;
      line-height: 1.7;
    }
    .inspector-empty svg { width: 34px; height: 34px; opacity: .2; display: block; margin: 0 auto 12px; }

    .inspector-multi { padding: 28px 16px; text-align: center; }
    .inspector-multi-count { font-size: var(--text-sm); font-weight: 600; color: var(--text-secondary); margin-bottom: 16px; }

    .inspector-arrow { padding: 16px; }
    .inspector-arrow-info {
      font-size: var(--text-xs);
      color: var(--text-muted);
      line-height: 1.6;
      margin-bottom: 4px;
    }

    .insp-label {
      font-size: var(--text-xs);
      font-weight: 700;
      color: var(--text-muted);
      letter-spacing: .08em;
      text-transform: uppercase;
      margin-bottom: 7px;
    }

    .insp-section { margin-bottom: 16px; }

    .insp-type-picker { display: flex; flex-wrap: wrap; gap: 5px; }

    .type-pill {
      font-size: 10px;
      font-weight: 700;
      letter-spacing: .05em;
      text-transform: uppercase;
      padding: 6px 10px;
      border-radius: 20px;
      border: 1px solid transparent;
      cursor: pointer;
      opacity: .45;
      transition: opacity var(--dur-fast), border-color var(--dur-fast);
    }
    .type-pill.active  { opacity: 1; border-color: currentColor; }
    .type-pill:hover   { opacity: .8; }

    .insp-input {
      width: 100%;
      background: var(--surface-1);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      padding: 7px 10px;
      color: var(--text-primary);
      font-family: var(--font);
      font-size: var(--text-sm);
      font-weight: 600;
      outline: none;
      transition: border-color var(--dur);
    }
    .insp-input:focus { border-color: rgba(255,255,255,.3); }

    .insp-textarea {
      width: 100%;
      background: var(--surface-1);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      padding: 7px 10px;
      color: var(--text-secondary);
      font-family: var(--font);
      font-size: var(--text-sm);
      line-height: 1.5;
      resize: vertical;
      outline: none;
      min-height: 68px;
      transition: border-color var(--dur);
    }
    .insp-textarea:focus { border-color: rgba(255,255,255,.3); }

    .actions-toggles { display: flex; flex-wrap: wrap; gap: 6px; }

    .action-toggle {
      font-size: var(--text-xs);
      font-weight: 700;
      padding: 8px 12px;
      border-radius: var(--radius-sm);
      border: 1px solid transparent;
      cursor: pointer;
      opacity: .45;
      font-family: var(--font);
      transition: opacity var(--dur-fast), background var(--dur-fast);
    }
    .action-toggle.active { opacity: 1; }
    .action-toggle[data-action=resolve]   { color: #f87171; border-color: rgba(248,113,113,.28); background: rgba(248,113,113,.08); }
    .action-toggle[data-action=prepare]   { color: #fbbf24; border-color: rgba(251,191,36,.28);  background: rgba(251,191,36,.08); }
    .action-toggle[data-action=recollect] { color: #38bdf8; border-color: rgba(56,189,248,.28);  background: rgba(56,189,248,.08); }
    .action-toggle[data-action=reinforce] { color: #34d399; border-color: rgba(52,211,153,.28);  background: rgba(52,211,153,.08); }
    .action-toggle.active[data-action=resolve]   { background: rgba(248,113,113,.2); }
    .action-toggle.active[data-action=prepare]   { background: rgba(251,191,36,.2);  }
    .action-toggle.active[data-action=recollect] { background: rgba(56,189,248,.2);  }
    .action-toggle.active[data-action=reinforce] { background: rgba(52,211,153,.2);  }

    .questions-list { display: flex; flex-direction: column; gap: 5px; margin-bottom: 7px; }

    .question-item { display: flex; align-items: center; gap: 6px; }
    .question-item input {
      flex: 1;
      background: var(--surface-1);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      padding: 5px 8px;
      color: var(--text-secondary);
      font-family: var(--font);
      font-size: var(--text-xs);
      outline: none;
    }
    .question-item input:focus { border-color: rgba(255,255,255,.28); }

    .q-del {
      background: none; border: none;
      color: var(--text-muted);
      cursor: pointer;
      font-size: 17px; line-height: 1;
      padding: 6px 8px;
      min-width: 34px; min-height: 34px;
      display: flex; align-items: center; justify-content: center;
      transition: color var(--dur-fast);
      flex-shrink: 0;
    }
    .q-del:hover { color: #f87171; }

    .add-btn {
      background: none;
      border: 1px dashed var(--border);
      color: var(--text-muted);
      font-family: var(--font);
      font-size: var(--text-xs);
      padding: 5px 10px;
      border-radius: var(--radius-sm);
      cursor: pointer;
      transition: border-color var(--dur-fast), color var(--dur-fast);
    }
    .add-btn:hover { border-color: rgba(255,255,255,.3); color: var(--text-secondary); }

    .insp-dupe-btn {
      width: 100%;
      margin-top: 8px;
      padding: 8px;
      background: rgba(255,255,255,.05);
      border: 1px solid rgba(255,255,255,.14);
      border-radius: var(--radius-sm);
      color: var(--text-secondary);
      font-family: var(--font);
      font-size: var(--text-sm);
      font-weight: 600;
      cursor: pointer;
      transition: background var(--dur-fast);
    }
    .insp-dupe-btn:hover { background: rgba(255,255,255,.12); }

    .insp-delete-btn {
      width: 100%;
      margin-top: 18px;
      padding: 8px;
      background: rgba(248,113,113,.08);
      border: 1px solid rgba(248,113,113,.22);
      border-radius: var(--radius-sm);
      color: #f87171;
      font-family: var(--font);
      font-size: var(--text-sm);
      font-weight: 600;
      cursor: pointer;
      transition: background var(--dur-fast);
    }
    .insp-delete-btn:hover { background: rgba(248,113,113,.2); }

    /* Prompt panel */
    .prompt-summary {
      background: var(--surface-1);
      border: 1px solid var(--border-subtle);
      border-radius: var(--radius-sm);
      padding: 10px 12px;
      margin-bottom: 14px;
      font-size: var(--text-xs);
      color: var(--text-secondary);
      line-height: 1.7;
    }
    .prompt-summary strong { color: var(--text-primary); }
    .gap-badge {
      display: inline-block;
      background: rgba(251,191,36,.14);
      color: #fbbf24;
      border-radius: 3px;
      padding: 1px 5px;
      font-weight: 700;
    }

    .dev-options {
      margin-bottom: 14px;
      border: 1px solid var(--border-subtle);
      border-radius: var(--radius-sm);
      overflow: hidden;
    }
    .dev-options-header {
      padding: 8px 12px;
      background: var(--surface-1);
      font-size: var(--text-xs);
      font-weight: 700;
      color: var(--text-muted);
      letter-spacing: .07em;
      text-transform: uppercase;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: space-between;
      user-select: none;
    }
    .dev-options-header:hover { background: var(--surface-2); }
    .dev-options-header svg { width: 14px; height: 14px; transition: transform var(--dur); }
    .dev-options.open .dev-options-header svg { transform: rotate(180deg); }
    .dev-options-body { display: none; padding: 12px; border-top: 1px solid var(--border-subtle); }
    .dev-options.open .dev-options-body { display: block; }

    .prompt-mode-row { margin-bottom: 12px; }

    .dev-row { margin-bottom: 10px; }
    .dev-row:last-child { margin-bottom: 0; }

    .dev-radio-group, .dev-check-group { display: flex; flex-wrap: wrap; gap: 5px; }

    .radio-opt, .check-opt {
      font-size: var(--text-xs);
      padding: 4px 10px;
      border-radius: 20px;
      border: 1px solid var(--border);
      color: var(--text-muted);
      cursor: pointer;
      background: none;
      font-family: var(--font);
      transition: all var(--dur-fast);
    }
    .radio-opt.active, .check-opt.active {
      border-color: rgba(255,255,255,.35);
      color: var(--text-primary);
      background: rgba(255,255,255,.07);
    }
    .radio-opt:hover, .check-opt:hover { color: var(--text-secondary); border-color: var(--border-strong); }

    .prompt-output {
      width: 100%;
      background: var(--surface-1);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      padding: 10px 12px;
      color: var(--text-secondary);
      font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
      font-size: 11px;
      line-height: 1.55;
      resize: none;
      outline: none;
      min-height: 190px;
      margin-bottom: 10px;
    }

    .copy-btn {
      width: 100%;
      padding: 9px;
      background: rgba(255,255,255,.08);
      border: 1px solid rgba(255,255,255,.18);
      border-radius: var(--radius-sm);
      color: var(--text-primary);
      font-family: var(--font);
      font-size: var(--text-sm);
      font-weight: 600;
      cursor: pointer;
      transition: background var(--dur-fast);
    }
    .copy-btn:hover { background: rgba(255,255,255,.15); }
    .copy-btn.copied { background: rgba(52,211,153,.14); border-color: rgba(52,211,153,.32); color: #34d399; }

    /* ── Scrollbars ─────────────────────────────────────────── */
    ::-webkit-scrollbar { width: 5px; height: 5px; }
    ::-webkit-scrollbar-track { background: transparent; }
    ::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 3px; }
    ::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.2); }

    /* ── Shortcut overlay ───────────────────────────────────── */
    .shortcut-overlay {
      position: fixed; inset: 0;
      background: rgba(0,0,0,.65);
      z-index: 900;
      display: flex; align-items: center; justify-content: center;
      backdrop-filter: blur(4px);
    }
    .shortcut-modal {
      background: #0d0d22;
      border: 1px solid rgba(255,255,255,.14);
      border-radius: var(--radius-lg);
      width: 420px; max-width: calc(100vw - 32px);
      box-shadow: 0 24px 64px rgba(0,0,0,.7);
      overflow: hidden;
    }
    .shortcut-modal-header {
      display: flex; align-items: center; justify-content: space-between;
      padding: 16px 20px;
      border-bottom: 1px solid rgba(255,255,255,.08);
      font-size: var(--text-sm); font-weight: 600;
    }
    .shortcut-close {
      background: none; border: none; color: var(--text-muted);
      cursor: pointer; font-size: 17px; padding: 2px 6px; border-radius: 4px;
      transition: color var(--dur-fast), background var(--dur-fast);
    }
    .shortcut-close:hover { color: var(--text-primary); background: var(--surface-2); }
    .shortcut-grid {
      padding: 16px 20px;
      display: grid; grid-template-columns: auto 1fr; gap: 7px 20px;
    }
    .shortcut-key {
      font-size: var(--text-xs);
      font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
      background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14);
      border-radius: 4px; padding: 2px 7px;
      color: var(--text-secondary); white-space: nowrap;
      justify-self: start; align-self: center;
    }
    .shortcut-desc { font-size: var(--text-sm); color: var(--text-muted); align-self: center; }

    .toast {
      position: fixed; bottom: 20px; right: 20px;
      background: rgba(52,211,153,.14); border: 1px solid rgba(52,211,153,.3);
      color: #34d399; border-radius: var(--radius-sm); padding: 8px 16px;
      font-size: var(--text-sm); font-weight: 600; z-index: 1001;
      pointer-events: none; animation: toastIn .18s ease;
    }

    /* New toast notification system */
    .toast-notification {
      position: fixed; top: 24px; right: 24px;
      max-width: 300px;
      padding: 12px 16px;
      background: rgba(15, 23, 42, 0.98);
      border: 1px solid rgba(148, 163, 184, 0.2);
      border-radius: 8px;
      backdrop-filter: blur(16px);
      z-index: 10000;
      animation: slideInRight 0.3s ease;
      box-shadow: 0 8px 20px rgba(0,0,0,0.3);
      font-size: var(--text-sm);
      font-weight: 500;
    }
    .toast-notification.toast-info { color: #38bdf8; border-color: rgba(56, 189, 248, 0.3); }
    .toast-notification.toast-success { color: #34d399; border-color: rgba(52, 211, 153, 0.3); }
    .toast-notification.toast-warning { color: #f59e0b; border-color: rgba(245, 158, 11, 0.3); }
    .toast-notification.toast-error { color: #ef4444; border-color: rgba(239, 68, 68, 0.3); }

    @keyframes slideInRight {
      from { opacity: 0; transform: translateX(100%); }
      to { opacity: 1; transform: translateX(0); }
    }
    @keyframes slideOutRight {
      from { opacity: 1; transform: translateX(0); }
      to { opacity: 0; transform: translateX(100%); }
    }
    .toast-exiting { animation: slideOutRight 0.3s ease forwards; }

    @keyframes toastIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

    .readonly-badge {
      font-size: var(--text-xs); font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
      color: #fbbf24; background: rgba(251,191,36,.1); border: 1px solid rgba(251,191,36,.22);
      border-radius: var(--radius-sm); padding: 3px 9px; flex-shrink: 0;
    }
    .readonly-mode .palette { display: none; }
    .readonly-mode #snapBtn,
    .readonly-mode #clearBtn,
    .readonly-mode #shareWrapper,
    .readonly-mode #exportWrapper { display: none; }
    .readonly-mode #readonlyBadge { display: block !important; }
    .readonly-mode .insp-input,
    .readonly-mode .insp-textarea,
    .readonly-mode .action-toggle,
    .readonly-mode #addQuestionBtn,
    .readonly-mode .type-pill,
    .readonly-mode .insp-dupe-btn,
    .readonly-mode .insp-delete-btn,
    .readonly-mode #deleteMultiBtn,
    .readonly-mode #deleteArrowBtn,
    .readonly-mode #arrowLabelInput,
    .readonly-mode .status-opt,
    .readonly-mode .priority-opt,
    .readonly-mode .arrow-preset-chip { pointer-events: none; opacity: 0.5; }

    :focus-visible {
      outline: 2px solid var(--accent-bright, #0080ff);
      outline-offset: 2px;
    }
    .skip-link {
      position: absolute; top: -100%; left: 16px; z-index: 1000;
      padding: 8px 16px; background: var(--accent-bright, #0080ff); color: #000;
      font-weight: 600; font-size: .875rem; border-radius: 0 0 6px 6px;
      text-decoration: none; transition: top .2s;
    }
    .skip-link:focus { top: 0; }

    /* ── Entrance animation ─────────────────────────────────────── */
    @keyframes fadeIn {
      from { opacity: 0; transform: translateY(8px); }
      to   { opacity: 1; transform: translateY(0); }
    }

    /* ── Skeleton loading ───────────────────────────────────────── */
    @keyframes shimmer { to { background-position: -200% 0; } }
    .skeleton {
      background: linear-gradient(90deg, var(--surface-1) 25%, var(--surface-2) 50%, var(--surface-1) 75%);
      background-size: 200% 100%;
      animation: shimmer 1.5s ease-in-out infinite;
      border-radius: 10px;
    }

    /* ── Block collapse button ──────────────────────────────────── */
    .block-collapse-btn {
      background: none; border: none;
      color: rgba(255,255,255,.25);
      cursor: pointer; font-size: 9px; line-height: 1;
      padding: 0 1px; margin-left: 4px; flex-shrink: 0;
      transition: color var(--dur-fast);
    }
    .block-collapse-btn:hover { color: rgba(255,255,255,.7); }
    .block.collapsed .block-desc,
    .block.collapsed .block-actions { display: none; }

    /* ── Block resize handle ─────────────────────────────────────── */
    .block-resize-handle {
      position: absolute; bottom: 0; right: 0;
      width: 18px; height: 18px;
      cursor: ew-resize; opacity: 0; z-index: 25;
      transition: opacity var(--dur-fast);
    }
    .block:hover .block-resize-handle,
    .block.selected .block-resize-handle { opacity: 1; }
    .block-resize-handle::after {
      content: '';
      position: absolute; bottom: 4px; right: 4px;
      width: 7px; height: 7px;
      border-right: 2px solid rgba(255,255,255,.3);
      border-bottom: 2px solid rgba(255,255,255,.3);
      border-radius: 0 0 2px 0;
    }

    /* ── Color swatches ──────────────────────────────────────────── */
    .color-swatches { display: flex; flex-wrap: wrap; gap: 7px; padding: 2px 0; }
    .color-swatch {
      width: 17px; height: 17px; border-radius: 50%; cursor: pointer;
      border: 2px solid transparent; flex-shrink: 0;
      transition: transform var(--dur-fast), border-color var(--dur-fast);
    }
    .color-swatch:hover { transform: scale(1.2); }
    .color-swatch.active { border-color: rgba(255,255,255,.75); }
    .swatch-reset {
      border: 2px dashed rgba(255,255,255,.25) !important; background: transparent !important;
      position: relative;
    }
    .swatch-reset.active { border-color: rgba(255,255,255,.75) !important; }
    .swatch-reset::after {
      content: '\00D7'; position: absolute; top: 50%; left: 50%;
      transform: translate(-50%, -50%);
      font-size: 11px; color: rgba(255,255,255,.4); line-height: 1;
    }

    /* ── Frames ──────────────────────────────────────────────────── */
    .frames-layer { position: absolute; top: 0; left: 0; width: 0; height: 0; overflow: visible; }
    .frame {
      position: absolute;
      border: 2px solid rgba(255,255,255,.1);
      border-radius: 14px;
      background: rgba(255,255,255,.02);
      cursor: grab;
      transition: border-color var(--dur-fast), background var(--dur-fast);
    }
    .frame:hover { border-color: rgba(255,255,255,.2); background: rgba(255,255,255,.03); }
    .frame.selected { border-color: rgba(255,255,255,.32); }
    .frame-label {
      position: absolute; top: 8px; left: 14px;
      font-size: 11px; font-weight: 600; font-family: var(--font);
      color: rgba(255,255,255,.35); user-select: none; white-space: nowrap;
      transition: color var(--dur-fast);
    }
    .frame:hover .frame-label, .frame.selected .frame-label { color: rgba(255,255,255,.6); }
    .frame-label[contenteditable=true] {
      background: rgba(255,255,255,.06); border-radius: 3px;
      padding: 1px 5px; outline: none; color: rgba(255,255,255,.85);
    }

    /* ── Palette template items ──────────────────────────────────── */
    .template-item {
      display: flex; align-items: flex-start; gap: 10px;
      padding: 8px 16px; cursor: pointer;
      border-bottom: 1px solid var(--border-subtle);
      transition: background var(--dur-fast);
    }
    .template-item:hover { background: var(--surface-2); }
    .template-icon {
      width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px;
      color: var(--text-muted);
    }
    .template-icon svg { width: 100%; height: 100%; display: block; }
    .template-item:hover .template-icon { color: var(--text-secondary); }
    .template-label { font-size: var(--text-sm); color: var(--text-secondary); font-weight: 500; }
    .template-desc  { font-size: 10px; color: var(--text-muted); line-height: 1.3; margin-top: 1px; }

    /* ── Gap fix suggestions ────────────────────────────────────── */
    .gap-fixes-section {
      border-top: 1px solid var(--border-subtle);
      padding-top: 14px; margin-top: 4px; margin-bottom: 4px;
    }
    .gap-fix-item {
      display: flex; align-items: flex-start; gap: 8px; margin-bottom: 9px;
    }
    .gap-fix-icon { font-size: 13px; flex-shrink: 0; line-height: 1.45; }
    .gap-fix-text { flex: 1; font-size: 11px; color: var(--text-muted); line-height: 1.45; }
    .gap-fix-btn {
      flex-shrink: 0; font-size: 10px; padding: 3px 8px;
      border-radius: 20px; border: 1px solid rgba(255,255,255,.2);
      color: var(--text-secondary); background: rgba(255,255,255,.05);
      cursor: pointer; font-family: var(--font); font-weight: 600;
      transition: all var(--dur-fast); white-space: nowrap;
    }
    .gap-fix-btn:hover { background: rgba(255,255,255,.12); color: var(--text-primary); }

    /* ── Health score ────────────────────────────────────────────── */
    .health-bar {
      display: flex; align-items: center; gap: 12px;
      background: var(--surface-1); border: 1px solid var(--border-subtle);
      border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 10px;
    }
    .health-score {
      font-size: 1.55rem; font-weight: 700; font-variant-numeric: tabular-nums;
      line-height: 1; min-width: 40px;
    }
    .health-score.grade-a { color: #34d399; }
    .health-score.grade-b { color: #fbbf24; }
    .health-score.grade-c { color: #f87171; }
    .health-details { font-size: var(--text-xs); color: var(--text-muted); line-height: 1.6; }
    .health-details strong { color: var(--text-secondary); }

    /* ── Prompt diff ────────────────────────────────────────────── */
    .prompt-diff {
      background: var(--surface-1); border: 1px solid var(--border-subtle);
      border-radius: var(--radius-sm); padding: 9px 12px;
      margin-bottom: 10px; font-size: var(--text-xs); line-height: 1.7;
      color: var(--text-muted);
    }
    .prompt-diff-title {
      font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
      color: var(--text-muted); margin-bottom: 5px; font-size: 10px;
    }
    .diff-added   { color: #34d399; font-weight: 600; }
    .diff-removed { color: #f87171; font-weight: 600; }
    .diff-changed { color: #fbbf24; font-weight: 600; }

    /* ── Screen-reader only ─────────────────────────────────────── */
    .sr-only {
      position: absolute; width: 1px; height: 1px;
      padding: 0; margin: -1px; overflow: hidden;
      clip: rect(0,0,0,0); white-space: nowrap; border: 0;
    }

    /* ── Block focus (keyboard navigation) ──────────────────────── */
    .block:focus-visible {
      outline: 2px solid rgba(255,255,255,.7);
      outline-offset: 3px;
      box-shadow: 0 0 0 4px rgba(255,255,255,.15);
    }
    .canvas-viewport:focus { outline: none; }
    .canvas-viewport:focus-visible { box-shadow: inset 0 0 0 2px rgba(0,99,229,.4); }

    /* ── High-contrast mode ─────────────────────────────────────── */
    @media (prefers-contrast: high) {
      :root {
        --border: rgba(255,255,255,.6);
        --border-strong: #fff;
        --text-muted: rgba(255,255,255,.75);
        --text-secondary: #fff;
        --surface-1: rgba(255,255,255,.06);
        --surface-2: rgba(255,255,255,.10);
      }
      .block { border-width: 3px; background: #050510; }
      .block.selected { outline: 3px solid #fff; }
      .block:focus-visible { outline: 3px solid #ffff00; box-shadow: none; }
      .arrow-path { stroke: rgba(255,255,255,.85) !important; }
      .header-bar { backdrop-filter: none; }
      .palette, .right-panel { border-color: rgba(255,255,255,.3); }
    }
    body.high-contrast {
      --border: rgba(255,255,255,.6);
      --border-strong: #fff;
      --text-muted: rgba(255,255,255,.75);
      --text-secondary: #fff;
      --surface-1: rgba(255,255,255,.06);
      --surface-2: rgba(255,255,255,.10);
    }
    body.high-contrast .block { border-width: 3px; background: #050510; }
    body.high-contrast .block.selected { outline: 3px solid #fff; }
    body.high-contrast .block:focus-visible { outline: 3px solid #ffff00; box-shadow: none; }
    body.high-contrast .arrow-path { stroke: rgba(255,255,255,.85) !important; }
    body.high-contrast .header-bar { backdrop-filter: none; }
    body.high-contrast .palette,
    body.high-contrast .right-panel { border-color: rgba(255,255,255,.3); }

    /* ── Light mode ────────────────────────────────────────────── */
    body.light-mode {
      --bg: #f0f1f5;
      --surface-1: rgba(0,0,0,.03);
      --surface-2: rgba(0,0,0,.06);
      --border-subtle: rgba(0,0,0,.09);
      --border: rgba(0,0,0,.14);
      --border-strong: rgba(0,0,0,.26);
      --text-primary: #1a1a2e;
      --text-secondary: #3d3d50;
      --text-muted: rgba(0,0,0,.48);
      background: var(--bg);
      color: var(--text-primary);
    }
    body.light-mode .header-bar {
      background: linear-gradient(135deg, #b030b0 0%, #5a2d90 55%, #2a1648 100%);
      border-bottom: 1px solid rgba(0,0,0,.1);
      box-shadow: 0 1px 4px rgba(0,0,0,.08);
    }
    body.light-mode .header-logo-img { filter: brightness(0) invert(1); }
    body.light-mode .header-btn {
      background: rgba(255,255,255,.2);
      border-color: rgba(255,255,255,.3);
      color: #fff;
    }
    body.light-mode .header-btn:hover { background: rgba(255,255,255,.35); border-color: rgba(255,255,255,.45); }
    body.light-mode .header-btn.active { background: rgba(255,255,255,.4); border-color: rgba(255,255,255,.55); }
    body.light-mode .header-btn-danger { background: rgba(248,113,113,.2); border-color: rgba(248,113,113,.35); color: #d94444; }
    body.light-mode .header-btn-danger:hover { background: rgba(248,113,113,.35); }
    body.light-mode .header-btn-group { border-left-color: rgba(255,255,255,.2); }

    body.light-mode .export-dropdown {
      background: #fff;
      border-color: rgba(0,0,0,.1);
      box-shadow: 0 8px 32px rgba(0,0,0,.14);
    }
    body.light-mode .palette {
      background: #fff;
      border-right: 1px solid rgba(0,0,0,.08);
    }
    body.light-mode .palette-item:hover { background: rgba(0,0,0,.04); }
    body.light-mode .palette-item:active { background: rgba(0,0,0,.08); }
    body.light-mode .palette-section-header { border-top-color: rgba(0,0,0,.06); }

    body.light-mode .block {
      background: #fff;
      border-top-color: color-mix(in srgb, var(--bc, #999) 28%, transparent);
      border-right-color: color-mix(in srgb, var(--bc, #999) 28%, transparent);
      border-bottom-color: color-mix(in srgb, var(--bc, #999) 28%, transparent);
      box-shadow: 0 1px 4px rgba(0,0,0,.06), 0 0 0 0.5px rgba(0,0,0,.04);
    }
    body.light-mode .block:hover { box-shadow: 0 4px 20px rgba(0,0,0,.1), 0 0 0 0.5px rgba(0,0,0,.06); }
    body.light-mode .block.selected {
      outline-color: color-mix(in srgb, var(--bc, #555) 60%, transparent);
      box-shadow: 0 4px 24px rgba(0,0,0,.12), 0 0 0 0.5px rgba(0,0,0,.08);
    }
    body.light-mode .block-title { color: var(--text-primary); }
    body.light-mode .block-desc { color: rgba(0,0,0,.5); }
    body.light-mode .block-type-badge { background: rgba(0,0,0,.05); }
    body.light-mode .action-badge.resolve   { background: rgba(220,38,38,.12); color: #dc2626; }
    body.light-mode .action-badge.prepare   { background: rgba(202,138,4,.12);  color: #ca8a04; }
    body.light-mode .action-badge.recollect { background: rgba(2,132,199,.12);  color: #0284c7; }
    body.light-mode .action-badge.reinforce { background: rgba(22,163,74,.12);  color: #16a34a; }
    body.light-mode .block-collapse-btn { color: rgba(0,0,0,.28); }
    body.light-mode .block-collapse-btn:hover { color: rgba(0,0,0,.6); }
    body.light-mode .block-resize-handle::after {
      border-right-color: rgba(0,0,0,.18);
      border-bottom-color: rgba(0,0,0,.18);
    }

    body.light-mode .block.gap-isolated {
      border-top-color: rgba(0,0,0,.12);
      border-right-color: rgba(0,0,0,.12);
      border-bottom-color: rgba(0,0,0,.12);
      box-shadow: 0 1px 4px rgba(0,0,0,.04);
    }

    body.light-mode .port {
      background: rgba(0,0,0,.3);
      border-color: #fff;
    }
    body.light-mode .port:hover { background: rgba(0,0,0,.6); }

    body.light-mode .block:focus-visible {
      outline-color: rgba(0,0,0,.55);
      box-shadow: 0 0 0 4px rgba(0,0,0,.08);
    }

    body.light-mode .arrow-path { stroke: var(--ac, rgba(0,0,0,.2)); }
    body.light-mode .arrow-preview { stroke: rgba(0,0,0,.28); stroke-dasharray: 7 4; }
    body.light-mode .arrow-label { fill: rgba(0,0,0,.55); stroke: var(--bg); }
    body.light-mode .arrow-label.selected { fill: rgba(0,0,0,.85); }
    body.light-mode .canvas-root.has-hover .arrow-path:not(.related) { stroke: rgba(0,0,0,.06) !important; }
    body.light-mode .arrow-path.related { stroke: var(--ac-hi, rgba(0,0,0,.5)) !important; }

    body.light-mode .canvas-hint { color: rgba(0,0,0,.2); }
    body.light-mode .canvas-hint svg { opacity: .16; }

    body.light-mode .right-panel {
      background: #fff;
      border-left: 1px solid rgba(0,0,0,.08);
    }
    body.light-mode .panel-tab { color: var(--text-muted); }
    body.light-mode .panel-tab.active { border-bottom-color: var(--text-primary); color: var(--text-primary); }

    body.light-mode .insp-input,
    body.light-mode .insp-textarea {
      background: rgba(0,0,0,.02);
      border-color: rgba(0,0,0,.12);
    }
    body.light-mode .insp-input:focus,
    body.light-mode .insp-textarea:focus { border-color: rgba(0,0,0,.3); background: #fff; }
    body.light-mode .question-item input { background: rgba(0,0,0,.02); border-color: rgba(0,0,0,.1); }
    body.light-mode .question-item input:focus { border-color: rgba(0,0,0,.25); background: #fff; }
    body.light-mode .add-btn:hover { border-color: rgba(0,0,0,.25); }

    body.light-mode .insp-dupe-btn {
      background: rgba(0,0,0,.04);
      border-color: rgba(0,0,0,.12);
      color: var(--text-secondary);
    }
    body.light-mode .insp-dupe-btn:hover { background: rgba(0,0,0,.08); }

    body.light-mode .insp-delete-btn {
      background: rgba(224,82,82,.06);
      border-color: rgba(224,82,82,.2);
    }
    body.light-mode .insp-delete-btn:hover { background: rgba(224,82,82,.12); }

    body.light-mode .copy-btn {
      background: rgba(0,0,0,.05);
      border-color: rgba(0,0,0,.14);
    }
    body.light-mode .copy-btn:hover { background: rgba(0,0,0,.1); }

    body.light-mode .radio-opt,
    body.light-mode .check-opt { color: var(--text-muted); border-color: rgba(0,0,0,.12); }
    body.light-mode .radio-opt:hover,
    body.light-mode .check-opt:hover { color: var(--text-secondary); border-color: rgba(0,0,0,.22); }
    body.light-mode .radio-opt.active,
    body.light-mode .check-opt.active {
      border-color: rgba(0,0,0,.32);
      background: rgba(0,0,0,.06);
      color: var(--text-primary);
    }

    body.light-mode .prompt-output {
      background: rgba(0,0,0,.02);
      border-color: rgba(0,0,0,.12);
      color: var(--text-secondary);
    }

    body.light-mode .shortcut-overlay { background: rgba(0,0,0,.3); }
    body.light-mode .shortcut-modal {
      background: #fff;
      border-color: rgba(0,0,0,.1);
      box-shadow: 0 24px 64px rgba(0,0,0,.18);
    }
    body.light-mode .shortcut-modal-header { border-bottom-color: rgba(0,0,0,.08); }
    body.light-mode .shortcut-key {
      background: rgba(0,0,0,.05);
      border-color: rgba(0,0,0,.1);
    }

    body.light-mode .color-swatch.active { border-color: rgba(0,0,0,.55); }
    body.light-mode .swatch-reset { border-color: rgba(0,0,0,.18) !important; }
    body.light-mode .swatch-reset.active { border-color: rgba(0,0,0,.55) !important; }
    body.light-mode .swatch-reset::after { color: rgba(0,0,0,.35); }

    body.light-mode .frame {
      border-color: rgba(0,0,0,.1);
      background: rgba(0,0,0,.015);
    }
    body.light-mode .frame:hover { border-color: rgba(0,0,0,.18); background: rgba(0,0,0,.025); }
    body.light-mode .frame.selected { border-color: rgba(0,0,0,.3); }
    body.light-mode .frame-label { color: rgba(0,0,0,.35); }
    body.light-mode .frame:hover .frame-label,
    body.light-mode .frame.selected .frame-label { color: rgba(0,0,0,.55); }
    body.light-mode .frame-label[contenteditable=true] {
      background: rgba(0,0,0,.04); color: rgba(0,0,0,.8);
    }

    body.light-mode .gap-fix-btn {
      border-color: rgba(0,0,0,.14);
      background: rgba(0,0,0,.03);
    }
    body.light-mode .gap-fix-btn:hover { background: rgba(0,0,0,.08); }

    body.light-mode .health-bar {
      background: rgba(0,0,0,.02);
      border-color: rgba(0,0,0,.08);
    }

    body.light-mode .toast {
      background: rgba(31,184,125,.1);
      border-color: rgba(31,184,125,.28);
    }

    body.light-mode .search-input {
      background: #fff;
      border-color: rgba(0,0,0,.18);
      box-shadow: 0 8px 32px rgba(0,0,0,.1);
    }
    body.light-mode .search-input:focus { border-color: rgba(0,0,0,.35); }
    body.light-mode .search-results {
      background: #fff;
      border-color: rgba(0,0,0,.1);
      box-shadow: 0 8px 32px rgba(0,0,0,.12);
    }
    body.light-mode .search-result:hover,
    body.light-mode .search-result.focused { background: rgba(0,0,0,.04); }

    body.light-mode .canvas-viewport.drop-target {
      outline-color: rgba(0,0,0,.25);
      background-color: rgba(0,0,0,.02);
    }
    body.light-mode .palette-item.dragging { opacity: 0.4; }
    body.light-mode .palette-drag-ghost {
      background: rgba(255,255,255,.92);
      color: var(--text-primary);
      box-shadow: 0 4px 16px rgba(0,0,0,.15);
    }

    body.light-mode .arrow-label {
      fill: rgba(0,0,0,.55);
      stroke: #f0f1f5;
    }
    body.light-mode .arrow-label.selected { fill: rgba(0,0,0,.85); }

    body.light-mode .canvas-hint { color: rgba(0,0,0,.3); }
    body.light-mode .canvas-hint svg { opacity: .2; }

    /* Light-mode gap glows (static tints) */
    body.light-mode .block.gap-assumption  { box-shadow: 0 0 12px 3px rgba(202,144,8,.25); }
    body.light-mode .block.gap-no-req      { box-shadow: 0 0 10px 3px rgba(196,144,8,.2); }
    body.light-mode .block.gap-unaddressed { box-shadow: 0 0 12px 3px rgba(217,68,68,.25); }

    body.light-mode .select-box {
      border-color: rgba(0,0,0,.4);
      background: rgba(0,0,0,.04);
    }

    body.light-mode .zoom-indicator {
      background: rgba(255,255,255,.85);
      border-color: rgba(0,0,0,.1);
      box-shadow: 0 1px 3px rgba(0,0,0,.06);
    }

    body.light-mode ::-webkit-scrollbar-thumb { background: rgba(0,0,0,.12); }
    body.light-mode ::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,.22); }

    body.light-mode.tinted-blocks .block {
      background: linear-gradient(135deg, color-mix(in srgb, var(--bc, #888) 18%, #fff) 0%, color-mix(in srgb, var(--bc, #888) 8%, #fff) 100%);
    }

    /* Adjusted block type colors for light background contrast */
    body.light-mode {
      --c-goal:        #7c5fd4;
      --c-problem:     #d94444;
      --c-requirement: #c49008;
      --c-risk:        #d46e14;
      --c-question:    #1490c8;
      --c-decision:    #18a872;
      --c-resource:    #14a894;
      --c-output:      #5558cc;
      --c-context:     #4b5563;
      --c-custom:      #9250cc;
    }

    /* ── Embed mode (iframe-safe) ───────────────────────────────── */
    .embed-mode .header-bar,
    .embed-mode .palette,
    .embed-mode .right-panel { display: none !important; }
    .embed-mode .app-body    { height: 100vh; }
    .embed-mode .canvas-viewport { border-radius: 0; }

    /* ── Touch devices: always-visible ports + resize handles ── */
    @media (pointer: coarse) {
      .block .port { opacity: 1; width: 14px; height: 14px; }
      .block .block-resize-handle { opacity: 0.5; }
      .port-left   { left: -7px; }
      .port-right  { right: -7px; }
      .port-top    { top: -7px; }
      .port-bottom { bottom: -7px; }
    }

    /* ── Responsive: Tablet (<=1024px) ─────────────────────────── */
    @media (max-width: 1024px) {
      .right-panel { width: 280px; }
      .palette { width: 48px; }
      .palette .palette-section-toggle span,
      .palette .palette-item-text,
      .palette .palette-desc,
      .palette .palette-chevron { display: none; }
      .palette .palette-section-toggle {
        justify-content: center;
        padding: 8px 4px 6px;
        font-size: 9px;
        letter-spacing: .05em;
      }
      .palette .palette-item {
        justify-content: center;
        padding: 10px 4px;
        gap: 0;
      }
      .palette .palette-dot { width: 14px; height: 14px; }
      .palette .palette-collapse-btn { display: none; }
      .palette .template-item { justify-content: center; padding: 10px 4px; }
      .palette .template-item > div:last-child { display: none; }
      .palette .template-icon { margin: 0; }
    }

    /* ── Responsive: Mobile (<=768px) ────────────────────────────── */
    @media (max-width: 768px) {
      .header-bar {
        padding: 0 10px;
        height: 56px;
        gap: 4px;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
      }
      .header-logo h1 { font-size: 1em; }
      .header-subtitle { display: none; }
      .header-logo-img { height: 28px; }
      .header-btn { padding: 5px 10px; font-size: var(--text-xs); }
      .header-btn-group { gap: 3px; padding-left: 6px; }

      .app-body { flex-direction: column; }
      .palette {
        width: 100% !important;
        flex-direction: row;
        border-right: none;
        border-bottom: 1px solid var(--border-subtle);
        overflow-x: auto;
        overflow-y: hidden;
        height: 52px;
        flex-shrink: 0;
      }
      .palette .palette-section { display: flex; flex-shrink: 0; }
      .palette .palette-section-toggle { display: none; }
      .palette .palette-section-body {
        display: flex !important;
        max-height: none !important;
        flex-direction: row;
        overflow: visible;
      }
      .palette .palette-item {
        padding: 8px 12px;
        border-bottom: none;
        border-right: 1px solid var(--border-subtle);
        flex-shrink: 0;
        gap: 6px;
      }
      .palette .palette-item-text { display: block; }
      .palette .palette-desc { display: none; }
      .palette .palette-dot { width: 10px; height: 10px; }
      .palette .palette-collapse-btn { display: none; }
      #templatesSection { display: none; }

      .right-panel {
        width: 100%;
        height: 240px;
        flex-shrink: 0;
        border-left: none;
        border-top: 1px solid var(--border-subtle);
      }
      .canvas-viewport { flex: 1; min-height: 200px; }

      .shortcut-modal { width: calc(100vw - 16px); }
      .search-overlay { width: 260px; }
    }

    /* ── Responsive: Small mobile (<=480px) ──────────────────────── */
    @media (max-width: 480px) {
      .header-btn-group:has(#themeBtn) { display: none; }
      .header-logo { gap: 6px; }
      .header-logo h1 { font-size: 0.9em; }
      .right-panel { height: 200px; }
    }

    /* ── Phase 1: Status & Priority badges on blocks ──────────── */
    .block-meta {
      display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px;
    }
    .status-badge {
      font-size: 9px; font-weight: 600; letter-spacing: .03em;
      padding: 2px 6px; border-radius: 3px;
      background: rgba(255,255,255,.08); color: var(--text-secondary);
    }
    .status-badge.status-in-progress { background: rgba(56,189,248,.15); color: #38bdf8; }
    .status-badge.status-done        { background: rgba(52,211,153,.15); color: #34d399; }
    .status-badge.status-blocked     { background: rgba(248,113,113,.15); color: #f87171; }

    .priority-badge {
      font-size: 9px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
      padding: 2px 6px; border-radius: 3px;
    }
    .priority-badge.priority-high   { background: rgba(248,113,113,.18); color: #f87171; }
    .priority-badge.priority-medium { background: rgba(251,191,36,.18);  color: #fbbf24; }
    .priority-badge.priority-low    { background: rgba(148,163,184,.18); color: #94a3b8; }

    .block.collapsed .block-meta { display: none; }

    /* ── Phase 1: Status & Priority pickers in inspector ────── */
    .status-picker, .priority-picker {
      display: flex; flex-wrap: wrap; gap: 4px;
    }
    .status-opt, .priority-opt {
      font-size: 11px; font-weight: 500; padding: 4px 8px;
      border: 1px solid var(--border); border-radius: 5px;
      background: transparent; color: var(--text-secondary);
      cursor: pointer; transition: background var(--dur-fast), border-color var(--dur-fast);
    }
    .status-opt:hover, .priority-opt:hover {
      background: var(--surface-2); border-color: var(--border-strong);
    }
    .status-opt.active, .priority-opt.active {
      background: rgba(255,255,255,.1); border-color: var(--text-secondary); color: var(--text-primary);
    }
    .priority-opt[data-priority="high"]   { color: #f87171; border-color: rgba(248,113,113,.3); }
    .priority-opt[data-priority="medium"] { color: #fbbf24; border-color: rgba(251,191,36,.3); }
    .priority-opt[data-priority="low"]    { color: #94a3b8; border-color: rgba(148,163,184,.3); }
    .priority-opt.active[data-priority="high"]   { background: rgba(248,113,113,.15); }
    .priority-opt.active[data-priority="medium"] { background: rgba(251,191,36,.15); }
    .priority-opt.active[data-priority="low"]    { background: rgba(148,163,184,.15); }

    /* ── Phase 1: Actions info panel ───────────────────────── */
    .actions-info-btn {
      display: inline-flex; align-items: center; justify-content: center;
      width: 18px; height: 18px; border-radius: 50%;
      border: 1px solid var(--border); background: transparent;
      color: var(--text-muted); font-size: 10px; font-weight: 700;
      cursor: pointer; vertical-align: middle; margin-left: 4px;
      transition: background var(--dur-fast), color var(--dur-fast);
    }
    .actions-info-btn:hover { background: var(--surface-2); color: var(--text-secondary); }

    .actions-info-panel {
      background: var(--surface-1); border: 1px solid var(--border);
      border-radius: var(--radius-sm); padding: 10px 12px;
      margin-bottom: 8px; font-size: 12px; line-height: 1.5;
      color: var(--text-secondary);
    }
    .actions-info-panel p { margin-bottom: 8px; }
    .actions-info-panel dt {
      font-weight: 600; color: var(--text-primary); margin-top: 4px;
    }
    .actions-info-panel dd {
      margin-left: 0; color: var(--text-muted); margin-bottom: 2px;
    }

    /* ── Phase 1: Arrow label presets ──────────────────────── */
    .arrow-label-presets {
      display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px;
    }
    .arrow-preset-chip {
      font-size: 10px; padding: 3px 7px; border-radius: 4px;
      border: 1px solid var(--border); background: transparent;
      color: var(--text-muted); cursor: pointer;
      transition: background var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast);
    }
    .arrow-preset-chip:hover {
      background: var(--surface-2); color: var(--text-secondary); border-color: var(--border-strong);
    }
    .arrow-preset-chip.active {
      background: rgba(255,255,255,.1); color: var(--text-primary); border-color: var(--text-secondary);
    }

    /* ── Phase 1: Palette hover tooltips ──────────────────── */
    .palette-item { position: relative; }
    .palette-tooltip {
      display: none; position: absolute;
      left: 100%; top: 50%; transform: translateY(-50%);
      margin-left: 8px; z-index: 200;
      width: 260px; padding: 10px 12px;
      background: #1a1a2e; border: 1px solid var(--border-strong);
      border-radius: var(--radius-sm);
      box-shadow: 0 8px 24px rgba(0,0,0,.5);
      font-size: 12px; line-height: 1.5; color: var(--text-secondary);
      pointer-events: none;
    }
    .palette-tooltip::before {
      content: ''; position: absolute;
      right: 100%; top: 50%; transform: translateY(-50%);
      border: 6px solid transparent; border-right-color: var(--border-strong);
    }
    .palette-tooltip-example {
      color: var(--text-muted); font-style: italic;
    }
    .palette-tooltip-tip {
      color: var(--accent); font-weight: 500;
    }
    .palette-item:hover .palette-tooltip { display: block; }
    .palette.collapsed .palette-tooltip { display: none !important; }

    /* Hide tooltips on touch devices (no persistent hover) */
    @media (pointer: coarse) {
      .palette-tooltip { display: none !important; }
    }

    /* ── Phase 1: Light-mode overrides for new elements ────── */
    body.light-mode .status-badge { background: rgba(0,0,0,.06); color: #475569; }
    body.light-mode .status-badge.status-in-progress { background: rgba(56,189,248,.12); color: #0284c7; }
    body.light-mode .status-badge.status-done        { background: rgba(52,211,153,.12); color: #059669; }
    body.light-mode .status-badge.status-blocked     { background: rgba(248,113,113,.12); color: #dc2626; }

    body.light-mode .priority-badge.priority-high   { background: rgba(248,113,113,.12); color: #dc2626; }
    body.light-mode .priority-badge.priority-medium { background: rgba(251,191,36,.12);  color: #d97706; }
    body.light-mode .priority-badge.priority-low    { background: rgba(148,163,184,.12); color: #64748b; }

    body.light-mode .status-opt, body.light-mode .priority-opt {
      border-color: rgba(0,0,0,.12); color: #475569;
    }
    body.light-mode .status-opt:hover, body.light-mode .priority-opt:hover {
      background: rgba(0,0,0,.04);
    }
    body.light-mode .status-opt.active, body.light-mode .priority-opt.active {
      background: rgba(0,0,0,.06); border-color: #475569; color: #0f172a;
    }

    body.light-mode .actions-info-panel {
      background: rgba(0,0,0,.03); border-color: rgba(0,0,0,.1);
    }
    body.light-mode .actions-info-btn { border-color: rgba(0,0,0,.15); color: #64748b; }

    body.light-mode .arrow-preset-chip {
      border-color: rgba(0,0,0,.12); color: #64748b;
    }
    body.light-mode .arrow-preset-chip:hover {
      background: rgba(0,0,0,.04); color: #334155;
    }
    body.light-mode .arrow-preset-chip.active {
      background: rgba(0,0,0,.08); color: #0f172a; border-color: #475569;
    }

    body.light-mode .palette-tooltip {
      background: #fff; border-color: rgba(0,0,0,.12);
      color: #334155; box-shadow: 0 8px 24px rgba(0,0,0,.12);
    }
    body.light-mode .palette-tooltip::before { border-right-color: rgba(0,0,0,.12); }
    body.light-mode .palette-tooltip-example { color: #64748b; }
    body.light-mode .palette-tooltip-tip { color: #0063e5; }

    @media (prefers-reduced-motion: reduce) {
      *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
      /* Static gap indicators when motion is disabled */
      .block.gap-isolated    { outline: 2px dashed rgba(255,255,255,.35); outline-offset: 2px; }
      .block.gap-assumption  { box-shadow: 0 0 0 3px rgba(251,191,36,.4); }
      .block.gap-no-req      { box-shadow: 0 0 0 3px rgba(250,204,21,.35); }
      .block.gap-unaddressed { box-shadow: 0 0 0 3px rgba(248,113,113,.4); }
    }
