    .node-parent-candidate {
      box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.6), 0 0 12px rgba(59, 130, 246, 0.45);
      border-color: #3b82f6;
    }
    .node-parent-candidate-closest {
      box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.9), 0 0 16px rgba(37, 99, 235, 0.6);
      border-color: #2563eb;
    }
    .node-selected {
      box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.55), 0 8px 24px rgba(59, 130, 246, 0.25);
      border-color: #3b82f6;
      z-index: 60 !important;
    }
    .node-relation-create-start {
      box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.55), 0 8px 24px rgba(245, 158, 11, 0.25);
      border-color: #d97706;
      z-index: 58 !important;
    }
    html.dark .node-relation-create-start {
      box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.6), 0 8px 24px rgba(251, 191, 36, 0.3);
      border-color: #f59e0b;
    }
    /* ホバー時のz-indexを選択中より低く抑える */
    .node:hover:not(.node-selected) {
      z-index: 50 !important;
    }
    /* 強調アニメーションを約半分の時間に短縮（デフォルト150ms → 75ms目安） */
    .node {
      transition: box-shadow 75ms ease, border-color 75ms ease, transform 75ms ease;
    }
    .node.node--category {
      border-color: #111827 !important;
      border-width: 2px;
    }
    .node.node--category:hover {
      border-color: #111827 !important;
    }
    html.dark .node.node--category,
    html.dark .node.node--category:hover,
    .nm-export-dark .node.node--category,
    .nm-export-dark .node.node--category:hover {
      border-color: #f8fafc !important;
    }

    .node-image-wrapper {
      position: absolute;
      pointer-events: none;
      z-index: 5;
    }
    .node-image {
      width: 100%;
      height: 100%;
      object-fit: contain;
      pointer-events: none;
      border-radius: 6px;
      box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
      background: #f8fafc;
    }
    /* 閲覧モードでは編集系ホバーアイコンを非表示にする */
    .view-only .add-child-btn,
    .view-only .delete-node-btn {
      display: none !important;
    }

    /* Dark mode overrides for canvas UI */
    html.dark .node-image {
      background: #0f172a;
      box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    }
    /* Dark mode icon inversion */
    html.dark .node-type-icon img,
    html.dark .menu-btn img,
    html.dark .memo-icon img {
      filter: invert(1) brightness(1.1);
    }
    html.dark #node-type-display-icon,
    html.dark #state-display-icon,
    html.dark .nm-node-type-select-icon,
    html.dark .node-settings-type-icon {
      filter: invert(1) brightness(1.15);
    }
    /* Export用に強制反転するクラス（複製側に付与） */
    .nm-export-dark .node-type-icon img,
    .nm-export-dark .menu-btn img,
    .nm-export-dark .memo-icon img {
      filter: invert(1) brightness(1.1) !important;
    }
    /* Export中はUI側アイコンを固定（dark時） */
    .nm-export-lock-icon-color .node-type-icon img,
    .nm-export-lock-icon-color .menu-btn img,
    .nm-export-lock-icon-color .memo-icon img {
      filter: invert(1) brightness(1.1) !important;
    }
    html.dark #sub-header {
      background: #0f172a;
      border-color: #1f2937;
    }

    /* Dark mode: form controls / dropdown */
    html.dark select {
      background-color: #0f172a;
      color: #e2e8f0;
      border-color: #1f2937;
    }
    html.dark select:focus {
      border-color: #3b82f6;
      box-shadow: 0 0 0 1px #3b82f6;
    }
    html.dark select option {
      background-color: #0f172a;
      color: #e2e8f0;
    }
    html.dark select option:disabled {
      color: #475569;
    }

    /* Edge パネルのタブ（ダークモード視認性改善） */
    .edge-tab,
    .relation-edge-tab {
      color: #374151;
      background: transparent;
      transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
    }
    .edge-tab:hover,
    .relation-edge-tab:hover {
      background: #f3f4f6;
    }
    .edge-tab--active,
    .relation-edge-tab--active {
      color: #111827;
      background: #e8f0ff;
      border-color: #3b82f6 !important;
    }
    html.dark .edge-tab,
    html.dark .relation-edge-tab {
      color: #cbd5e1;
      background: transparent;
    }
    html.dark .edge-tab:hover,
    html.dark .relation-edge-tab:hover {
      background: #1f2937;
    }
    html.dark .edge-tab--active,
    html.dark .relation-edge-tab--active {
      color: #e2e8f0;
      background: #1e293b;
      border-color: #60a5fa !important;
    }
    .line-style-tab,
    .relation-line-style-tab {
      color: #374151;
      background: transparent;
      transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
    }
    .line-style-tab:hover,
    .relation-line-style-tab:hover {
      background: #f3f4f6;
    }
    .line-style-tab--active,
    .relation-line-style-tab--active {
      color: #111827;
      background: #e8f0ff;
      border-color: #3b82f6 !important;
    }
    .line-style-tab-panels,
    .relation-line-style-tab-panels {
      height: clamp(430px, 66dvh, 440px);
      min-height: 430px;
    }
    .line-style-tab-content,
    .relation-line-style-tab-content {
      height: 100%;
      overflow-y: auto;
      padding: 8px 8px 10px;
      box-sizing: border-box;
    }
    @supports not (height: 1dvh) {
      .line-style-tab-panels,
      .relation-line-style-tab-panels {
        height: clamp(430px, 66vh, 440px);
      }
    }
    html.dark .line-style-tab,
    html.dark .relation-line-style-tab {
      color: #cbd5e1;
      background: transparent;
    }
    html.dark .line-style-tab:hover,
    html.dark .relation-line-style-tab:hover {
      background: #1f2937;
    }
    html.dark .line-style-tab--active,
    html.dark .relation-line-style-tab--active {
      color: #e2e8f0;
      background: #1e293b;
      border-color: #60a5fa !important;
    }
    .nm-opacity-control {
      margin-bottom: 12px;
      display: flex;
      flex-direction: column;
      gap: 8px;
    }
    .nm-opacity-control-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
    }
    .nm-opacity-control-label {
      font-size: 12px;
      font-weight: 600;
      color: #374151;
    }
    .nm-opacity-control-value {
      font-size: 12px;
      font-weight: 600;
      color: #1f2937;
      min-width: 40px;
      text-align: right;
      font-variant-numeric: tabular-nums;
    }
    .nm-opacity-range {
      width: 100%;
      accent-color: #3b82f6;
      appearance: none;
      -webkit-appearance: none;
      background: transparent;
      cursor: pointer;
    }
    .nm-opacity-range::-webkit-slider-runnable-track {
      height: 4px;
      border-radius: 9999px;
      background: #d1d5db;
    }
    .nm-opacity-range::-webkit-slider-thumb {
      -webkit-appearance: none;
      appearance: none;
      width: 14px;
      height: 14px;
      margin-top: -5px;
      border-radius: 9999px;
      border: 2px solid #ffffff;
      background: #2563eb;
    }
    .nm-opacity-range::-moz-range-track {
      height: 4px;
      border-radius: 9999px;
      background: #d1d5db;
    }
    .nm-opacity-range::-moz-range-thumb {
      width: 14px;
      height: 14px;
      border-radius: 9999px;
      border: 2px solid #ffffff;
      background: #2563eb;
    }
    html.dark .nm-opacity-control-label {
      color: #cbd5e1;
    }
    html.dark .nm-opacity-control-value {
      color: #e2e8f0;
    }
    html.dark .nm-opacity-range::-webkit-slider-runnable-track {
      background: #334155;
    }
    html.dark .nm-opacity-range::-webkit-slider-thumb {
      border-color: #0f172a;
      background: #93c5fd;
    }
    html.dark .nm-opacity-range::-moz-range-track {
      background: #334155;
    }
    html.dark .nm-opacity-range::-moz-range-thumb {
      border-color: #0f172a;
      background: #93c5fd;
    }

    /* Right panel / parent and relation edge forms */
    .nm-editor-edge-form {
      color: #1f2937;
    }
    .nm-editor-edge-form-body {
      min-width: 0;
    }
    .nm-editor-edge-summary {
      min-width: 0;
      padding-bottom: 12px;
      border-bottom: 1px solid #e2e8f0;
    }
    .nm-editor-edge-summary-value {
      color: #1f2937;
      line-height: 1.5;
    }
    .nm-editor-edge-field {
      min-width: 0;
    }
    .nm-editor-edge-label {
      color: #475569;
      font-size: 13px;
      font-weight: 600;
      line-height: 1.4;
    }
    .nm-editor-edge-memo {
      min-height: 96px;
    }
    .nm-editor-edge-tabs {
      gap: 2px;
      border-color: #cbd5e1;
    }
    .nm-editor-edge-tab {
      flex: 1 1 0;
      min-width: 0;
      min-height: 40px;
      padding: 8px 6px;
      border-radius: 6px 6px 0 0;
      color: #64748b;
      font-size: 13px;
      font-weight: 500;
      line-height: 1.25;
      white-space: nowrap;
      box-shadow: none;
      transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease;
    }
    .nm-editor-edge-tab:hover {
      background: #f8fafc;
      color: #334155;
    }
    .nm-editor-edge-tab[aria-selected="true"] {
      border-color: #2563eb !important;
      background: #eff6ff;
      color: #1e3a8a;
      font-weight: 600;
    }
    .nm-editor-edge-tab:focus-visible {
      position: relative;
      z-index: 1;
      outline: 2px solid #2563eb;
      outline-offset: -2px;
    }
    .nm-editor-edge-tab-panel {
      min-width: 0;
      padding-top: 2px;
    }
    .nm-editor-edge-choice {
      width: 100%;
      min-width: 0;
      min-height: 64px;
      border: 1px solid #cbd5e1;
      border-radius: 6px;
      background: #ffffff;
      color: #334155;
      box-shadow: none;
      transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease, box-shadow 150ms ease;
      appearance: none;
      -webkit-appearance: none;
      -webkit-text-fill-color: currentColor;
    }
    .nm-editor-edge-choice:hover {
      border-color: #94a3b8;
      background: #f8fafc;
    }
    .nm-editor-edge-choice[aria-pressed="true"] {
      border-color: #2563eb;
      background: #eff6ff;
      color: #1e3a8a;
      box-shadow: 0 0 0 1px #2563eb;
    }
    .nm-editor-edge-choice:focus-visible {
      outline: none;
      border-color: #2563eb;
      box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
    }
    .nm-editor-edge-choice--swatch {
      width: 48px;
      min-width: 48px;
      min-height: 48px;
      border-radius: 9999px;
    }
    .nm-editor-edge-choice--swatch[aria-pressed="true"] {
      box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px #2563eb;
    }
    .nm-editor-edge-opacity {
      padding-bottom: 2px;
    }
    .nm-editor-edge-opacity .nm-opacity-range:focus-visible {
      outline: 2px solid #2563eb;
      outline-offset: 4px;
      border-radius: 9999px;
    }
    .nm-editor-edge-footer {
      box-shadow: none;
    }
    html.dark .nm-editor-edge-form {
      color: #e2e8f0;
    }
    html.dark .nm-editor-edge-summary {
      border-bottom-color: #334155;
    }
    html.dark .nm-editor-edge-summary-value {
      color: #e2e8f0;
    }
    html.dark .nm-editor-edge-label {
      color: #94a3b8;
    }
    html.dark .nm-editor-edge-tabs {
      border-color: #334155;
    }
    html.dark .nm-editor-edge-tab {
      color: #94a3b8;
    }
    html.dark .nm-editor-edge-tab:hover {
      background: #1e293b;
      color: #e2e8f0;
    }
    html.dark .nm-editor-edge-tab[aria-selected="true"] {
      border-color: #60a5fa !important;
      background: #1e293b;
      color: #bfdbfe;
    }
    html.dark .nm-editor-edge-tab:focus-visible {
      outline-color: #60a5fa;
    }
    html.dark .nm-editor-edge-choice {
      border-color: #475569;
      background: #0f172a;
      color: #cbd5e1;
    }
    html.dark .nm-editor-edge-choice:hover {
      border-color: #64748b;
      background: #1e293b;
      color: #f8fafc;
    }
    html.dark .nm-editor-edge-choice[aria-pressed="true"] {
      border-color: #60a5fa;
      background: #1e293b;
      color: #bfdbfe;
      box-shadow: 0 0 0 1px #60a5fa;
    }
    html.dark .nm-editor-edge-choice:focus-visible {
      border-color: #60a5fa;
      box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.32);
    }
    html.dark .nm-editor-edge-choice--swatch[aria-pressed="true"] {
      box-shadow: 0 0 0 2px #0f172a, 0 0 0 4px #60a5fa;
    }
    html.dark .nm-editor-edge-opacity .nm-opacity-range:focus-visible {
      outline-color: #60a5fa;
    }
    @media (prefers-reduced-motion: reduce) {
      .nm-editor-edge-tab,
      .nm-editor-edge-choice {
        transition-duration: 1ms;
      }
    }

    /* Phase 4-C-4: filter controls */
    .nm-editor-filter-panel {
      color: #334155;
    }
    .nm-editor-filter-tabs {
      gap: 2px;
      border-color: #cbd5e1;
    }
    .nm-editor-filter-tab {
      flex: 1 1 0;
      min-width: 0;
      min-height: 40px;
      padding: 8px 10px;
      border-radius: 6px 6px 0 0;
      color: #64748b;
      box-shadow: none;
      transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease;
    }
    .nm-editor-filter-tab:hover {
      background: #f8fafc;
      color: #334155;
    }
    .nm-editor-filter-tab[aria-selected="true"] {
      border-color: #2563eb !important;
      background: #eff6ff;
      color: #1e3a8a;
    }
    .nm-editor-filter-tab:focus-visible,
    .nm-editor-filter-action:focus-visible,
    .nm-editor-filter-tag-delete:focus-visible {
      position: relative;
      z-index: 1;
      outline: 2px solid #2563eb;
      outline-offset: 2px;
    }
    .nm-editor-filter-tab[aria-disabled="true"] {
      cursor: not-allowed;
      opacity: 0.66;
    }
    .nm-editor-filter-tab-panel,
    .nm-editor-filter-field {
      min-width: 0;
    }
    .nm-editor-filter-label {
      color: #475569;
      font-size: 13px;
      font-weight: 600;
      line-height: 1.4;
    }
    .nm-editor-filter-mode-group {
      width: 100%;
    }
    .nm-editor-filter-mode {
      flex: 1 1 0;
      min-width: 0;
      min-height: 40px;
      border-color: #cbd5e1;
      color: #334155;
      box-shadow: none;
      transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease;
    }
    .nm-editor-filter-mode[aria-pressed="true"] {
      border-color: #2563eb;
      background: #2563eb;
      color: #ffffff;
    }
    .nm-editor-filter-mode:focus-visible {
      outline: none;
      border-color: #2563eb;
      box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
    }
    .nm-editor-filter-choice {
      display: flex;
      align-items: center;
      gap: 8px;
      min-height: 36px;
      padding: 6px 8px;
      border: 1px solid transparent;
      border-radius: 6px;
      background: #ffffff;
      color: #334155;
      transition: border-color 150ms ease, background-color 150ms ease;
    }
    .nm-editor-filter-choice:hover {
      background: #f8fafc;
    }
    .nm-editor-filter-choice:focus-within {
      border-color: #2563eb;
      box-shadow: 0 0 0 1px #2563eb;
    }
    .nm-editor-filter-checkbox {
      width: 18px;
      height: 18px;
      flex: 0 0 auto;
      accent-color: #2563eb;
    }
    .nm-editor-filter-action {
      min-height: 40px;
      border-radius: 6px;
      box-shadow: none;
    }
    .nm-editor-filter-action--primary {
      background: #2563eb;
    }
    .nm-editor-filter-action--primary:hover {
      background: #1d4ed8;
    }
    .nm-editor-filter-tag-delete {
      min-width: 32px;
      min-height: 32px;
      border-radius: 6px;
    }
    html.dark .nm-editor-filter-panel {
      color: #e2e8f0;
    }
    html.dark .nm-editor-filter-tabs {
      border-color: #334155;
    }
    html.dark .nm-editor-filter-tab {
      color: #94a3b8;
    }
    html.dark .nm-editor-filter-tab:hover,
    html.dark .nm-editor-filter-tab[aria-selected="true"] {
      background: #1e293b;
      color: #bfdbfe;
    }
    html.dark .nm-editor-filter-tab[aria-selected="true"] {
      border-color: #60a5fa !important;
    }
    html.dark .nm-editor-filter-label {
      color: #94a3b8;
    }
    html.dark .nm-editor-filter-mode {
      border-color: #475569;
      background: #0f172a;
      color: #cbd5e1;
    }
    html.dark .nm-editor-filter-mode[aria-pressed="true"] {
      border-color: #60a5fa;
      background: #2563eb;
      color: #ffffff;
    }
    html.dark .nm-editor-filter-choice {
      background: #0f172a;
      color: #cbd5e1;
    }
    html.dark .nm-editor-filter-choice:hover {
      background: #1e293b;
    }
    @media (prefers-reduced-motion: reduce) {
      .nm-editor-filter-tab,
      .nm-editor-filter-mode,
      .nm-editor-filter-choice {
        transition-duration: 1ms;
      }
    }

    /* Phase 4-C-5: right-panel dialogs and management lists */
    .nm-editor-subdialog,
    .nm-editor-management-dialog {
      color: #334155;
    }
    .nm-editor-subdialog-panel {
      border: 1px solid #cbd5e1;
      border-radius: 8px;
      background: #ffffff;
      color: #334155;
      box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
    }
    .nm-editor-subdialog-header {
      min-height: 40px;
      border-color: #e2e8f0;
    }
    .nm-editor-subdialog-title {
      color: #1f2937;
      line-height: 1.35;
    }
    .nm-editor-subdialog-close {
      min-width: 40px;
      min-height: 40px;
      border-radius: 6px;
      box-shadow: none;
    }
    .nm-editor-subdialog-close:hover {
      background: #f1f5f9;
    }
    .nm-editor-subdialog-close:focus-visible,
    .nm-editor-management-action:focus-visible {
      outline: 2px solid #2563eb;
      outline-offset: 2px;
    }
    .nm-editor-management-form,
    .nm-editor-management-list,
    .nm-editor-management-section,
    .nm-editor-management-row {
      min-width: 0;
    }
    .nm-editor-management-section {
      border-color: #cbd5e1;
      border-radius: 6px;
      background: #f8fafc;
    }
    .nm-editor-management-header {
      min-height: 36px;
    }
    .nm-editor-management-label {
      color: #475569;
    }
    .nm-editor-management-list {
      scrollbar-width: thin;
    }
    .nm-editor-management-row,
    .nm-editor-management-choice {
      border-color: #cbd5e1;
      border-radius: 6px;
      background: #ffffff;
      color: #334155;
      box-shadow: none;
      transition: border-color 150ms ease, background-color 150ms ease;
    }
    .nm-editor-management-choice {
      min-height: 36px;
    }
    .nm-editor-management-choice:hover,
    .nm-editor-management-row:hover {
      border-color: #94a3b8;
      background: #f8fafc;
    }
    .nm-editor-management-choice:focus-within,
    .nm-editor-management-row:focus-within {
      border-color: #2563eb;
      box-shadow: 0 0 0 1px #2563eb;
    }
    .nm-editor-management-pill {
      border-color: #cbd5e1;
      border-radius: 9999px;
      background: #f1f5f9;
      color: #334155;
    }
    .nm-editor-management-name {
      color: #334155;
    }
    .nm-editor-management-action {
      min-height: 36px;
      border-radius: 6px;
      box-shadow: none;
      transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease;
    }
    .nm-editor-management-action--icon {
      min-width: 32px;
      min-height: 32px;
    }
    .nm-editor-management-action--link {
      border: 0;
      background: transparent;
    }
    .nm-editor-management-action--primary {
      border-color: #93c5fd;
      background: #eff6ff;
      color: #1d4ed8;
    }
    .nm-editor-management-action--primary:hover {
      background: #dbeafe;
    }
    .nm-editor-management-action--destructive {
      border-color: #fecaca;
      background: #ffffff;
      color: #b91c1c;
    }
    .nm-editor-management-action--destructive:hover {
      background: #fef2f2;
    }
    .nm-editor-management-action:disabled {
      cursor: not-allowed;
      opacity: 0.5;
    }
    .nm-editor-management-empty {
      color: #64748b;
      line-height: 1.5;
    }
    html.dark .nm-editor-subdialog-panel {
      border-color: #475569;
      background: #0f172a;
      color: #e2e8f0;
      box-shadow: 0 12px 28px rgba(0, 0, 0, 0.38);
    }
    html.dark .nm-editor-subdialog-title,
    html.dark .nm-editor-management-name {
      color: #e2e8f0;
    }
    html.dark .nm-editor-subdialog-close:hover,
    html.dark .nm-editor-management-section {
      background: #1e293b;
    }
    html.dark .nm-editor-management-section,
    html.dark .nm-editor-management-row,
    html.dark .nm-editor-management-choice,
    html.dark .nm-editor-management-pill {
      border-color: #475569;
    }
    html.dark .nm-editor-management-row,
    html.dark .nm-editor-management-choice {
      background: #0f172a;
      color: #cbd5e1;
    }
    html.dark .nm-editor-management-row:hover,
    html.dark .nm-editor-management-choice:hover {
      border-color: #64748b;
      background: #1e293b;
    }
    html.dark .nm-editor-management-pill {
      background: #1e293b;
      color: #cbd5e1;
    }
    html.dark .nm-editor-management-label,
    html.dark .nm-editor-management-empty {
      color: #94a3b8;
    }
    html.dark .nm-editor-management-action--primary {
      border-color: #3b82f6;
      background: #1e3a8a;
      color: #dbeafe;
    }
    html.dark .nm-editor-management-action--destructive {
      border-color: #7f1d1d;
      background: #0f172a;
      color: #fca5a5;
    }
    @media (prefers-reduced-motion: reduce) {
      .nm-editor-subdialog-close,
      .nm-editor-management-row,
      .nm-editor-management-choice,
      .nm-editor-management-action {
        transition-duration: 1ms;
      }
    }

    /* ノード種セレクトにアイコンを表示 */
    #node-type-select {
      background-repeat: no-repeat;
      background-position: left 10px center;
      background-size: 18px 18px;
      padding-left: 44px;
      padding-right: 32px;
    }
    #node-type-select option.node-type-option {
      background-repeat: no-repeat;
      background-position: left 10px center;
      background-size: 18px 18px;
      padding-left: 36px;
    }

    /* Phase 4-D-1: node surface / state / hover actions */
    .nm-editor-node {
      isolation: isolate;
      outline: 1px solid transparent;
      outline-offset: 2px;
      transition:
        border-color 100ms ease,
        box-shadow 100ms ease,
        outline-color 100ms ease,
        transform 100ms ease;
    }
    .nm-editor-node:hover:not(.node-selected) {
      border-color: #64748b;
      box-shadow: 0 5px 14px rgba(15, 23, 42, 0.16);
    }
    .nm-editor-node.node-selected {
      border-color: #2563eb;
      outline-color: rgba(37, 99, 235, 0.6);
      box-shadow: 0 4px 14px rgba(37, 99, 235, 0.2);
      z-index: 60 !important;
    }
    .nm-editor-node.node-parent-candidate {
      border-color: #0ea5e9;
      outline: 2px dashed rgba(14, 165, 233, 0.7);
      outline-offset: 3px;
      box-shadow: 0 4px 14px rgba(14, 165, 233, 0.18);
    }
    .nm-editor-node.node-parent-candidate-closest {
      border-color: #0369a1;
      outline: 3px solid rgba(3, 105, 161, 0.82);
      outline-offset: 3px;
      box-shadow: 0 5px 16px rgba(3, 105, 161, 0.24);
    }
    .nm-editor-node.node-relation-create-start {
      border-color: #d97706;
      outline: 2px solid rgba(217, 119, 6, 0.72);
      outline-offset: 3px;
      box-shadow: 0 4px 14px rgba(217, 119, 6, 0.22);
      z-index: 58 !important;
    }
    .nm-editor-node .nm-editor-node-root-indicator {
      border: 1px solid rgba(2, 132, 199, 0.48);
      box-shadow: inset 4px 0 0 #0284c7;
    }
    .nm-editor-node .nm-editor-node-body {
      min-width: 0;
    }
    .nm-editor-node .nm-editor-node-header {
      line-height: 1.25;
    }
    .nm-editor-node .nm-editor-node-icon {
      flex: 0 0 auto;
    }
    .nm-editor-node .nm-editor-node-title {
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .nm-editor-node .nm-editor-node-subtype {
      color: rgba(15, 23, 42, 0.72);
    }
    .nm-editor-node .nm-editor-node-detail {
      min-width: 0;
    }
    .nm-editor-node .nm-editor-node-memo-indicator {
      opacity: 0.78;
    }
    .nm-editor-node .nm-editor-node-menu {
      align-items: center;
      padding: 2px;
      border-radius: 999px;
      transition: opacity 100ms ease;
    }
    .nm-editor-node:focus-within .nm-editor-node-menu {
      opacity: 1 !important;
      pointer-events: auto !important;
    }
    .nm-editor-node .nm-editor-node-action {
      border-color: #cbd5e1;
      background: rgba(255, 255, 255, 0.96);
      color: #334155;
      box-shadow: 0 1px 3px rgba(15, 23, 42, 0.18);
      transition:
        border-color 100ms ease,
        background-color 100ms ease,
        box-shadow 100ms ease,
        transform 100ms ease;
    }
    .nm-editor-node .nm-editor-node-action:hover {
      border-color: #3b82f6 !important;
      background: #eff6ff;
      box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.22) !important;
      transform: translateY(-1px);
    }
    .nm-editor-node .nm-editor-node-action--delete:hover {
      border-color: #ef4444 !important;
      background: #fef2f2;
      box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2) !important;
    }
    .nm-editor-node .nm-editor-node-action:focus-visible {
      outline: 2px solid #2563eb;
      outline-offset: 2px;
    }
    html.dark .nm-editor-node:hover:not(.node-selected),
    .nm-export-dark .nm-editor-node:hover:not(.node-selected) {
      border-color: #94a3b8;
      box-shadow: 0 5px 16px rgba(0, 0, 0, 0.4);
    }
    html.dark .nm-editor-node.node-selected,
    .nm-export-dark .nm-editor-node.node-selected {
      border-color: #60a5fa;
      outline-color: rgba(96, 165, 250, 0.72);
      box-shadow: 0 5px 16px rgba(30, 64, 175, 0.32);
    }
    html.dark .nm-editor-node .nm-editor-node-root-indicator,
    .nm-export-dark .nm-editor-node .nm-editor-node-root-indicator {
      border-color: rgba(56, 189, 248, 0.62);
      box-shadow: inset 4px 0 0 #38bdf8;
    }
    html.dark .nm-editor-node .nm-editor-node-subtype,
    .nm-export-dark .nm-editor-node .nm-editor-node-subtype {
      color: rgba(226, 232, 240, 0.78);
    }
    html.dark .nm-editor-node .nm-editor-node-action,
    .nm-export-dark .nm-editor-node .nm-editor-node-action {
      border-color: #475569;
      background: rgba(15, 23, 42, 0.96);
      color: #e2e8f0;
    }
    html.dark .nm-editor-node .nm-editor-node-action:hover,
    .nm-export-dark .nm-editor-node .nm-editor-node-action:hover {
      border-color: #60a5fa !important;
      background: #1e293b;
      box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.26) !important;
    }
    html.dark .nm-editor-node .nm-editor-node-action--delete:hover,
    .nm-export-dark .nm-editor-node .nm-editor-node-action--delete:hover {
      border-color: #f87171 !important;
      background: #3f1d27;
      box-shadow: 0 0 0 2px rgba(248, 113, 113, 0.25) !important;
    }
    @media (prefers-reduced-motion: reduce) {
      .nm-editor-node,
      .nm-editor-node .nm-editor-node-menu,
      .nm-editor-node .nm-editor-node-action {
        transition-duration: 1ms;
      }
      .nm-editor-node:hover:not(.node-selected),
      .nm-editor-node .nm-editor-node-action:hover {
        transform: none;
      }
    }

    /* Phase 4-D-2: PC selection toolbar / menu */
    .nm-editor-selection-toolbar {
      color: #334155;
    }
    .nm-editor-selection-menu {
      border-color: #cbd5e1;
      border-radius: 12px;
      background: #ffffff;
      color: #334155;
      box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
      -webkit-backdrop-filter: none;
      backdrop-filter: none;
      scrollbar-width: thin;
      scrollbar-color: #cbd5e1 transparent;
    }
    .nm-editor-selection-main,
    .nm-editor-selection-subview {
      min-width: 0;
    }
    .nm-editor-selection-menu-header {
      border-color: #e2e8f0;
      background: #ffffff;
      -webkit-backdrop-filter: none;
      backdrop-filter: none;
    }
    .nm-editor-selection-menu-title {
      color: #1f2937;
      line-height: 1.35;
    }
    .nm-editor-selection-menu-description,
    .nm-editor-selection-section-title {
      color: #64748b;
      line-height: 1.4;
    }
    .nm-editor-selection-menu-close {
      border-radius: 6px;
      box-shadow: none;
    }
    .nm-editor-selection-menu-close:hover {
      background: #f1f5f9;
      color: #334155;
    }
    .nm-editor-selection-section {
      border-color: #e2e8f0;
    }
    .nm-editor-selection-section-title {
      font-weight: 600;
      letter-spacing: 0.02em;
    }
    .nm-editor-selection-row {
      border-radius: 8px;
      background: transparent;
    }
    .nm-editor-selection-action {
      min-height: 56px;
      border: 1px solid transparent;
      border-radius: 8px;
      background: transparent;
      color: #334155;
      box-shadow: none;
      transition: border-color 120ms ease, background-color 120ms ease, color 120ms ease;
    }
    .nm-editor-selection-action:hover:not(:disabled) {
      border-color: #bfdbfe;
      background: #eff6ff;
    }
    .nm-editor-selection-action-icon {
      border: 1px solid #e2e8f0;
      border-radius: 7px;
      background: #f8fafc;
      box-shadow: none;
    }
    .nm-editor-selection-action[data-selection-action="delete-selected"] {
      color: #b91c1c;
    }
    .nm-editor-selection-action[data-selection-action="delete-selected"]:hover:not(:disabled),
    .nm-editor-selection-action--destructive:hover:not(:disabled) {
      border-color: #fecaca;
      background: #fef2f2;
    }
    .nm-editor-selection-action:disabled {
      cursor: not-allowed;
      opacity: 0.5;
    }
    .nm-editor-selection-action:focus-visible,
    .nm-editor-selection-menu-close:focus-visible,
    .nm-editor-selection-menu button:focus-visible {
      outline: 2px solid #2563eb;
      outline-offset: 2px;
      box-shadow: none;
    }
    .nm-editor-selection-trigger {
      min-height: 40px;
      border-color: #cbd5e1;
      border-radius: 10px;
      background: #ffffff;
      color: #334155;
      box-shadow: 0 3px 10px rgba(15, 23, 42, 0.16);
      -webkit-backdrop-filter: none;
      backdrop-filter: none;
      transition: border-color 120ms ease, background-color 120ms ease, box-shadow 120ms ease;
    }
    .nm-editor-selection-trigger:hover {
      border-color: #93c5fd;
      background: #f8fafc;
      box-shadow: 0 4px 12px rgba(15, 23, 42, 0.18);
    }
    .nm-editor-selection-trigger[aria-expanded="true"] {
      border-color: #2563eb;
      background: #eff6ff;
      box-shadow: 0 0 0 1px #2563eb, 0 4px 12px rgba(37, 99, 235, 0.16);
    }
    .nm-editor-selection-trigger:focus-visible {
      outline: 2px solid #2563eb;
      outline-offset: 2px;
    }
    .nm-editor-selection-trigger-icon {
      border-radius: 6px;
      background: #eff6ff;
    }
    .nm-editor-selection-trigger-count {
      color: #1f2937;
    }
    /* 複数選択モード中は選択中ボタンを青くする（オン・オフは上部ツールバーの複数選択ボタン） */
    .nm-editor-selection-trigger-row.is-multi-select .nm-editor-selection-trigger {
      border-color: #93c5fd;
      background: #eff6ff;
    }
    html.dark .nm-editor-selection-trigger-row.is-multi-select .nm-editor-selection-trigger,
    .nm-export-dark .nm-editor-selection-trigger-row.is-multi-select .nm-editor-selection-trigger {
      border-color: #1d4ed8;
      background: #172554;
    }
    html.dark .nm-editor-selection-trigger-icon,
    .nm-export-dark .nm-editor-selection-trigger-icon {
      background: #1e3a8a;
    }
    .nm-editor-selection-trigger-chevron {
      transition: transform 120ms ease;
    }
    html.dark .nm-editor-selection-menu,
    .nm-export-dark .nm-editor-selection-menu {
      border-color: #475569;
      background: #0f172a;
      color: #cbd5e1;
      box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
      scrollbar-color: #475569 transparent;
    }
    html.dark .nm-editor-selection-menu-header,
    .nm-export-dark .nm-editor-selection-menu-header {
      border-color: #334155;
      background: #0f172a;
    }
    html.dark .nm-editor-selection-menu-title,
    .nm-export-dark .nm-editor-selection-menu-title,
    html.dark .nm-editor-selection-trigger-count,
    .nm-export-dark .nm-editor-selection-trigger-count {
      color: #f1f5f9;
    }
    html.dark .nm-editor-selection-menu-description,
    html.dark .nm-editor-selection-section-title,
    .nm-export-dark .nm-editor-selection-menu-description,
    .nm-export-dark .nm-editor-selection-section-title {
      color: #94a3b8;
    }
    html.dark .nm-editor-selection-section,
    .nm-export-dark .nm-editor-selection-section {
      border-color: #334155;
    }
    html.dark .nm-editor-selection-action,
    .nm-export-dark .nm-editor-selection-action {
      background: transparent;
      color: #cbd5e1;
    }
    html.dark .nm-editor-selection-action:hover:not(:disabled),
    .nm-export-dark .nm-editor-selection-action:hover:not(:disabled) {
      border-color: #475569;
      background: #1e293b;
    }
    html.dark .nm-editor-selection-action-icon,
    .nm-export-dark .nm-editor-selection-action-icon {
      border-color: #475569;
      background: #1e293b;
    }
    html.dark .nm-editor-selection-action[data-selection-action="delete-selected"],
    .nm-export-dark .nm-editor-selection-action[data-selection-action="delete-selected"] {
      color: #fca5a5;
    }
    html.dark .nm-editor-selection-action[data-selection-action="delete-selected"]:hover:not(:disabled),
    .nm-export-dark .nm-editor-selection-action[data-selection-action="delete-selected"]:hover:not(:disabled) {
      border-color: #7f1d1d;
      background: #3f1d27;
    }
    html.dark .nm-editor-selection-trigger,
    .nm-export-dark .nm-editor-selection-trigger {
      border-color: #475569;
      background: #0f172a;
      color: #cbd5e1;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.34);
    }
    html.dark .nm-editor-selection-trigger:hover,
    .nm-export-dark .nm-editor-selection-trigger:hover {
      border-color: #64748b;
      background: #1e293b;
    }
    html.dark .nm-editor-selection-trigger[aria-expanded="true"],
    .nm-export-dark .nm-editor-selection-trigger[aria-expanded="true"] {
      border-color: #60a5fa;
      background: #1e293b;
      box-shadow: 0 0 0 1px #60a5fa, 0 4px 12px rgba(0, 0, 0, 0.34);
    }
    @media (prefers-reduced-motion: reduce) {
      .nm-editor-selection-menu,
      .nm-editor-selection-subview,
      .nm-editor-selection-action,
      .nm-editor-selection-trigger,
      .nm-editor-selection-trigger-chevron {
        transition-duration: 1ms;
      }
    }

    /* Phase 4-D-3: mobile selection sheet / FooterUI */
    .nm-editor-selection-sheet {
      background: rgba(15, 23, 42, 0.32);
      -webkit-backdrop-filter: none;
      backdrop-filter: none;
    }
    .nm-editor-selection-sheet-surface {
      border-color: #cbd5e1;
      border-radius: 16px 16px 0 0;
      background: #ffffff;
      color: #334155;
      box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.16);
      scrollbar-width: thin;
      scrollbar-color: #cbd5e1 transparent;
    }
    .nm-editor-selection-sheet-main,
    .nm-editor-selection-sheet-subview {
      min-width: 0;
    }
    .nm-editor-selection-sheet-header {
      border-radius: 16px 16px 0 0;
      background: #ffffff;
      -webkit-backdrop-filter: none;
      backdrop-filter: none;
    }
    .nm-editor-selection-sheet-handle > span {
      background: #cbd5e1;
    }
    .nm-editor-selection-sheet-heading {
      border-color: #e2e8f0;
    }
    .nm-editor-selection-sheet-icon,
    .nm-editor-selection-sheet-action-icon {
      border: 1px solid #e2e8f0;
      border-radius: 8px;
      background: #f8fafc;
      color: #475569;
      box-shadow: none;
    }
    .nm-editor-selection-sheet-title {
      color: #1f2937;
      line-height: 1.35;
    }
    .nm-editor-selection-sheet-description,
    .nm-editor-selection-sheet-section-title {
      color: #64748b;
      line-height: 1.4;
    }
    .nm-editor-selection-sheet-close {
      border-radius: 8px;
      box-shadow: none;
    }
    .nm-editor-selection-sheet-close:hover {
      background: #f1f5f9;
      color: #334155;
    }
    .nm-editor-selection-sheet-section {
      border-top: 1px solid #e2e8f0;
      border-radius: 0;
      background: transparent;
      padding: 6px 0 0;
    }
    .nm-editor-selection-sheet-section-title {
      font-weight: 600;
      letter-spacing: 0.02em;
    }
    .nm-editor-selection-sheet-row {
      border: 1px solid #e2e8f0;
      border-radius: 8px;
      background: #ffffff;
      box-shadow: none;
    }
    .nm-editor-selection-sheet-action {
      min-height: 56px;
      border: 1px solid transparent;
      border-radius: 8px;
      background: transparent;
      color: #334155;
      box-shadow: none;
      transition: border-color 120ms ease, background-color 120ms ease, color 120ms ease;
    }
    .nm-editor-selection-sheet-action:hover:not(:disabled) {
      border-color: #bfdbfe;
      background: #eff6ff;
    }
    .nm-editor-selection-sheet-action--destructive {
      color: #b91c1c;
    }
    .nm-editor-selection-sheet-action--destructive:hover:not(:disabled) {
      border-color: #fecaca;
      background: #fef2f2;
    }
    .nm-editor-selection-sheet-action:disabled {
      cursor: not-allowed;
      opacity: 0.5;
    }
    .nm-editor-selection-sheet-action:focus-visible,
    .nm-editor-selection-sheet-close:focus-visible,
    .nm-editor-selection-sheet button:focus-visible {
      outline: 2px solid #2563eb;
      outline-offset: 2px;
      box-shadow: none;
    }
    .nm-editor-footer {
      color: #334155;
    }
    .nm-editor-footer-actions {
      gap: 4px;
      border-color: #cbd5e1;
      border-radius: 12px;
      background: #ffffff;
      padding: 6px;
      box-shadow: 0 4px 14px rgba(15, 23, 42, 0.16);
      scrollbar-width: thin;
      scrollbar-color: #cbd5e1 transparent;
    }
    .nm-editor-footer-action {
      flex: 0 0 44px;
      width: 44px;
      height: 44px;
      border: 1px solid transparent;
      border-radius: 8px;
      background: transparent;
      color: #334155;
      box-shadow: none;
      transition: border-color 120ms ease, background-color 120ms ease, transform 120ms ease;
    }
    .nm-editor-footer-action:hover {
      border-color: #cbd5e1;
      background: #f1f5f9;
    }
    .nm-editor-footer-action:active {
      background: #e2e8f0;
      transform: translateY(1px);
    }
    .nm-editor-footer-action[data-footer-action="delete"] {
      color: #b91c1c;
    }
    .nm-editor-footer-action[data-footer-action="delete"]:hover {
      border-color: #fecaca;
      background: #fef2f2;
    }
    .nm-editor-footer-action:focus-visible {
      outline: 2px solid #2563eb;
      outline-offset: 1px;
    }
    .nm-editor-footer-action svg {
      width: 24px;
      height: 24px;
    }
    .nm-editor-footer-action[aria-pressed="true"] {
      border-color: #93c5fd;
      background: #dbeafe;
      color: #1d4ed8;
    }
    .nm-editor-footer-action[aria-disabled="true"] {
      opacity: 0.4;
    }
    .nm-editor-footer-divider {
      flex: 0 0 1px;
      align-self: stretch;
      margin: 6px 2px;
      background: #cbd5e1;
    }
    html.dark .nm-editor-footer-action[aria-pressed="true"],
    .nm-export-dark .nm-editor-footer-action[aria-pressed="true"] {
      border-color: #1d4ed8;
      background: #1e3a8a;
      color: #bfdbfe;
    }
    html.dark .nm-editor-footer-divider,
    .nm-export-dark .nm-editor-footer-divider {
      background: #475569;
    }
    html.dark .nm-editor-selection-sheet-surface,
    .nm-export-dark .nm-editor-selection-sheet-surface {
      border-color: #475569;
      background: #0f172a;
      color: #cbd5e1;
      box-shadow: 0 -10px 28px rgba(0, 0, 0, 0.42);
      scrollbar-color: #475569 transparent;
    }
    html.dark .nm-editor-selection-sheet-header,
    .nm-export-dark .nm-editor-selection-sheet-header {
      background: #0f172a;
    }
    html.dark .nm-editor-selection-sheet-heading,
    html.dark .nm-editor-selection-sheet-section,
    html.dark .nm-editor-selection-sheet-row,
    .nm-export-dark .nm-editor-selection-sheet-heading,
    .nm-export-dark .nm-editor-selection-sheet-section,
    .nm-export-dark .nm-editor-selection-sheet-row {
      border-color: #334155;
    }
    html.dark .nm-editor-selection-sheet-row,
    .nm-export-dark .nm-editor-selection-sheet-row {
      background: #0f172a;
    }
    html.dark .nm-editor-selection-sheet-title,
    .nm-export-dark .nm-editor-selection-sheet-title {
      color: #f1f5f9;
    }
    html.dark .nm-editor-selection-sheet-description,
    html.dark .nm-editor-selection-sheet-section-title,
    .nm-export-dark .nm-editor-selection-sheet-description,
    .nm-export-dark .nm-editor-selection-sheet-section-title {
      color: #94a3b8;
    }
    html.dark .nm-editor-selection-sheet-icon,
    html.dark .nm-editor-selection-sheet-action-icon,
    .nm-export-dark .nm-editor-selection-sheet-icon,
    .nm-export-dark .nm-editor-selection-sheet-action-icon {
      border-color: #475569;
      background: #1e293b;
      color: #cbd5e1;
    }
    html.dark .nm-editor-selection-sheet-action,
    .nm-export-dark .nm-editor-selection-sheet-action {
      background: transparent;
      color: #cbd5e1;
    }
    html.dark .nm-editor-selection-sheet-action:hover:not(:disabled),
    .nm-export-dark .nm-editor-selection-sheet-action:hover:not(:disabled) {
      border-color: #475569;
      background: #1e293b;
    }
    html.dark .nm-editor-selection-sheet-action--destructive,
    .nm-export-dark .nm-editor-selection-sheet-action--destructive {
      color: #fca5a5;
    }
    html.dark .nm-editor-selection-sheet-action--destructive:hover:not(:disabled),
    .nm-export-dark .nm-editor-selection-sheet-action--destructive:hover:not(:disabled) {
      border-color: #7f1d1d;
      background: #3f1d27;
    }
    html.dark .nm-editor-footer-actions,
    .nm-export-dark .nm-editor-footer-actions {
      border-color: #475569;
      background: #0f172a;
      color: #cbd5e1;
      box-shadow: 0 5px 16px rgba(0, 0, 0, 0.38);
      scrollbar-color: #475569 transparent;
    }
    html.dark .nm-editor-footer-action,
    .nm-export-dark .nm-editor-footer-action {
      color: #cbd5e1;
    }
    html.dark .nm-editor-footer-action:hover,
    .nm-export-dark .nm-editor-footer-action:hover {
      border-color: #475569;
      background: #1e293b;
    }
    html.dark .nm-editor-footer-action[data-footer-action="delete"],
    .nm-export-dark .nm-editor-footer-action[data-footer-action="delete"] {
      color: #fca5a5;
    }
    @media (prefers-reduced-motion: reduce) {
      .nm-editor-selection-sheet,
      .nm-editor-selection-sheet-subview,
      .nm-editor-selection-sheet-action,
      .nm-editor-selection-sheet-close,
      .nm-editor-footer-action {
        transition-duration: 1ms;
      }
      .nm-editor-footer-action:active {
        transform: none;
      }
    }
