/* [style.css] - 更新日：2026.04.29 */

/* ================================================================
   CSS VARIABLES
   ================================================================ */
:root {
  --bg:          #080d16;
  --bg-panel:    #0d1526;
  --bg-card:     #111e33;
  --bg-card-h:   #162440;
  --bg-modal:    #0d1728;
  --bg-input:    #0a1322;
  --bg-sec:      #0e1c35;

  --accent:      #00c8f0;
  --accent-dim:  #0090b8;
  --accent-glow: rgba(0, 200, 240, 0.18);
  --accent-line: rgba(0, 200, 240, 0.35);

  /* ── 階層テーマカラー ─────────────────────────────
     系統  : 赤      #ff7b7b
     受電  : シアン  #00c8f0
     饋電２: 緑      #3df0a0  (従来より鮮明に)
     饋電３: 紫      #b07aff  (明確に別色)
  ─────────────────────────────────────────────── */
  --sys-color:   #ff7b7b;
  --sys-glow:    rgba(255, 123, 123, 0.22);
  --sys-border:  rgba(255, 123, 123, 0.45);

  --rec-color:   #00c8f0;
  --rec-glow:    rgba(0, 200, 240, 0.18);
  --rec-border:  rgba(0, 200, 240, 0.40);

  --f2-color:    #3df0a0;
  --f2-glow:     rgba(61, 240, 160, 0.16);
  --f2-border:   rgba(61, 240, 160, 0.35);

  --f3-color:    #b07aff;
  --f3-glow:     rgba(176, 122, 255, 0.16);
  --f3-border:   rgba(176, 122, 255, 0.35);

  --amber:       #f4a261;
  --amber-dim:   #c07a44;

  --danger:      #ff5f5f;
  --danger-dim:  #cc3a3a;
  --danger-glow: rgba(255, 95, 95, 0.15);

  --text:        #d8eaf8;
  --text-dim:    #6b8ab0;
  --text-muted:  #3a5070;
  --text-mono:   #90c8e0;

  --border:      #1a2d4a;
  --border-l:    #1e3860;

  --connector:   rgba(0, 150, 200, 0.5);
  --conn-bright: #00a8cc;

  --r:           7px;
  --r-lg:        12px;
  --shadow:      0 8px 32px rgba(0,0,0,0.5);
  --shadow-card: 0 3px 14px rgba(0,0,0,0.4);

  --font-ui:     'Rajdhani', sans-serif;
  --font-mono:   'JetBrains Mono', monospace;
  --font-jp:     'Noto Sans JP', sans-serif;
}

/* ================================================================
   RESET & BASE
   ================================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%; height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  overflow: hidden;
}

/* ================================================================
   SCREENS
   ================================================================ */
.screen {
  position: fixed;
  inset: 0;
  display: none;
  flex-direction: column;
}
.screen.active { display: flex; }

/* ================================================================
   MAIN SCREEN
   ================================================================ */
.main-grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,160,200,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,160,200,0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}
.main-scanline {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.06) 2px,
    rgba(0,0,0,0.06) 4px
  );
  pointer-events: none;
}
.main-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 0;
  padding: 32px;
}
.main-emblem {
  margin-bottom: 20px;
}
.emblem-bolt {
  font-size: 48px;
  filter: drop-shadow(0 0 16px var(--accent));
  animation: pulse-bolt 3s ease-in-out infinite;
}
@keyframes pulse-bolt {
  0%, 100% { filter: drop-shadow(0 0 12px var(--accent)); }
  50%       { filter: drop-shadow(0 0 28px var(--accent)); }
}
.main-title {
  text-align: center;
  margin-bottom: 40px;
}
.title-abbr {
  display: block;
  font-family: var(--font-ui);
  font-size: clamp(52px, 10vw, 88px);
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--accent);
  text-shadow: 0 0 40px var(--accent-glow), 0 0 80px rgba(0,200,240,0.1);
  line-height: 1;
}
.title-full {
  display: block;
  font-family: var(--font-mono);
  font-size: clamp(10px, 1.8vw, 14px);
  font-weight: 300;
  letter-spacing: 0.25em;
  color: var(--text-dim);
  margin-top: 8px;
  text-transform: uppercase;
}
.main-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 400px;
  margin-bottom: 32px;
}
.main-divider span:first-child,
.main-divider span:last-child {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-l));
}
.main-divider span:last-child {
  background: linear-gradient(90deg, var(--border-l), transparent);
}
.div-text {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--text-muted);
}
.main-nav {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.nav-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-l);
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
  text-align: left;
  width: 100%;
  position: relative;
  overflow: hidden;
}
.nav-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
  border-radius: var(--r) 0 0 var(--r);
}
.nav-card:hover {
  background: var(--bg-card-h);
  border-color: var(--accent-dim);
  transform: translateX(4px);
}
.nav-card-icon { font-size: 22px; }
.nav-card-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-card-jp {
  font-family: var(--font-jp);
  font-size: 17px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: 0.05em;
}
.nav-card-en {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.1em;
}
.nav-card-arrow {
  font-size: 14px;
  color: var(--accent-dim);
}
.main-footer {
  position: absolute;
  bottom: 20px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.15em;
}

/* ================================================================
   PROTECTION SCREEN
   ================================================================ */
.prot-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 20px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.back-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-l);
  border-radius: var(--r);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all 0.2s;
}
.back-btn:hover { border-color: var(--accent-dim); color: var(--accent); }
.back-arrow { font-size: 10px; }

/* ▼ 二段表示タイトル */
.prot-title {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.prot-title-jp {
  font-family: var(--font-jp);
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.06em;
  line-height: 1.2;
}
.prot-title-en {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  line-height: 1.2;
}

.header-spacer { flex: 1; }
.prot-body {
  flex: 1;
  overflow: hidden;
  position: relative;
}
.prot-scroll {
  height: 100%;
  overflow: auto;
  padding: 32px 40px 60px;
}

/* ================================================================
   NODE CARDS (generic)
   ================================================================ */
.node-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 10px 16px;
  min-width: 140px;
  height: 62px;
  background: var(--bg-card);
  border: 1px solid var(--border-l);
  border-radius: var(--r);
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.node-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.03), transparent);
  pointer-events: none;
}
.node-badge {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  line-height: 1;
  margin-bottom: 4px;
}
.node-val {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 500;
  line-height: 1;
  color: var(--text);
}
.nunit {
  font-size: 11px;
  margin-left: 3px;
  color: var(--text-dim);
}

/* ── 系統カード ──────────────────────────────────── */
.system-card {
  border-color: var(--sys-border);
  background: linear-gradient(135deg, #1a1020, var(--bg-card));
}
.system-card:hover {
  border-color: var(--sys-color);
  box-shadow: 0 0 20px var(--sys-glow);
}
.sys-badge { color: var(--sys-color); }
.system-card .node-val { color: var(--sys-color); }

/* ── 受電カード ──────────────────────────────────── */
.reception-card {
  border-color: var(--rec-border);
  background: linear-gradient(135deg, #081e30, var(--bg-card));
}
.reception-card:hover {
  border-color: var(--rec-color);
  box-shadow: 0 0 20px var(--rec-glow);
}
.rec-badge { color: var(--rec-color); }
.reception-card .node-val { color: var(--rec-color); }

/* ── 饋電２カード ─────────────────────────────────── */
.feeder2-card {
  border-color: var(--f2-border);
  background: linear-gradient(135deg, #081e1a, var(--bg-card));
}
.feeder2-card:hover {
  border-color: var(--f2-color);
  box-shadow: 0 0 16px var(--f2-glow);
}
.f2-badge { color: var(--f2-color); }
.feeder2-card .node-val { color: var(--f2-color); }

/* ── 饋電３カード（紫） ───────────────────────────── */
.feeder3-card {
  border-color: var(--f3-border);
  background: linear-gradient(135deg, #130e20, var(--bg-card));
  min-width: 130px;
  height: 58px;
}
.feeder3-card:hover {
  border-color: var(--f3-color);
  box-shadow: 0 0 14px var(--f3-glow);
}
.f3-badge { color: var(--f3-color); }
.feeder3-card .node-val { color: var(--f3-color); font-size: 16px; }

/* ================================================================
   OCR バッジ（カード右下）
   ================================================================ */

/* OCR・無（チェック無し） */
.no-ocr-badge {
  position: absolute;
  bottom: 5px;
  right: 7px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--amber);
  background: rgba(244, 162, 97, 0.12);
  border: 1px solid rgba(244, 162, 97, 0.4);
  border-radius: 3px;
  padding: 1px 5px;
  pointer-events: none;
  z-index: 4;
}

/* ▼ OCR・【n】（チェック有りのみ） */
.ocr-on-badge {
  position: absolute;
  bottom: 5px;
  right: 7px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: inherit;          /* 親カードのテキスト色を継承 */
  background: rgba(255,255,255,0.05);
  border: 1px solid currentColor;
  border-radius: 3px;
  padding: 1px 5px;
  pointer-events: none;
  z-index: 4;
  opacity: 0.75;
}
/* 饋電２のOCR有りバッジ */
.feeder2-card .ocr-on-badge {
  color: var(--f2-color);
  background: rgba(61, 240, 160, 0.08);
  border-color: rgba(61, 240, 160, 0.4);
}
/* 饋電３のOCR有りバッジ */
.feeder3-card .ocr-on-badge {
  color: var(--f3-color);
  background: rgba(176, 122, 255, 0.08);
  border-color: rgba(176, 122, 255, 0.4);
}

/* OCR無しカードのボーダーをアンバーに */
.no-ocr-card.feeder2-card {
  border-color: rgba(244, 162, 97, 0.4);
}
.no-ocr-card.feeder3-card {
  border-color: rgba(244, 162, 97, 0.35);
}

/* ================================================================
   SYSTEM SECTION
   ================================================================ */
.system-block {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ▼ 全削除ボタン */
.reset-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  height: 34px;
  background: transparent;
  border: 1px solid rgba(255, 95, 95, 0.35);
  border-radius: var(--r);
  color: rgba(255, 95, 95, 0.7);
  font-family: var(--font-jp);
  font-size: 12px;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.reset-btn:hover {
  background: var(--danger-glow);
  border-color: var(--danger);
  color: var(--danger);
  box-shadow: 0 0 10px rgba(255, 95, 95, 0.15);
}
.reset-btn:active { transform: scale(0.97); }
.reset-icon {
  font-size: 14px;
  line-height: 1;
}

.sys-vconnect {
  width: 2px;
  height: 28px;
  background: linear-gradient(to bottom, var(--sys-color), var(--conn-bright));
  margin-left: 30px;
  opacity: 0.6;
}

/* ================================================================
   TREE
   ================================================================ */
.tree-container {
  /* nothing special – children define layout */
}

/* Reception row */
.reception-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Add buttons */
.add-btn {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  height: 36px;
  background: transparent;
  border: 1px dashed var(--border-l);
  border-radius: var(--r);
  color: var(--text-dim);
  font-family: var(--font-jp);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}
.add-btn:hover {
  border-color: var(--accent-dim);
  color: var(--accent);
  background: var(--accent-glow);
}
.tier2-btn { border-color: rgba(0,200,240,0.3); }
.tier3-btn { border-color: rgba(61,240,160,0.3); }
.tier3-btn:hover { border-color: var(--f2-color); color: var(--f2-color); }

/* ================================================================
   TREE LISTS & CONNECTORS
   ================================================================ */

/*
 * How tree connectors work:
 * .tree-list has a border-left = vertical trunk line
 * Each .tree-item has ::before = horizontal branch to the node
 * .tree-item.last has ::after = paint over the trunk below its branch
 */

.tree-list {
  list-style: none;
  padding: 0;
  margin: 0;
  padding-left: 32px;
  border-left: 2px solid var(--connector);
  margin-left: 29px; /* aligns trunk with left edge of parent card */
  margin-top: 2px;
}

.tree-item {
  position: relative;
  padding: 8px 0;
}

/* Horizontal branch connector */
.tree-item::before {
  content: '';
  position: absolute;
  left: -32px;
  top: 39px; /* 8px padding + 31px (half of 62px card) */
  width: 32px;
  height: 2px;
  background: var(--conn-bright);
  opacity: 0.55;
}

/* Paint over trunk below the last branch */
.tree-item.last::after {
  content: '';
  position: absolute;
  left: -34px;
  top: 40px; /* just at and below branch center */
  width: 5px;
  height: calc(100% - 32px + 2px);
  background: var(--bg);
  z-index: 2;
}

/* F3 list – purple connector */
.f3-list {
  border-left-color: rgba(176, 122, 255, 0.3);
  margin-left: 27px;
}
.f3-list .tree-item::before {
  background: var(--f3-color);
  opacity: 0.4;
}

/* ================================================================
   OCR 無し：ダッシュコネクタ強調
   ※ リストの最後が OCR有り の場合は適用しない（通常線）
   ================================================================ */

/* 垂直トランク：リスト内の最後ノードもOCR無しの場合のみ適用 */
.tree-list.has-no-ocr {
  border-left: 2px dashed rgba(244, 162, 97, 0.65);
}

/* 水平ブランチ：OCR無しノードの枝線 */
.tree-item.no-ocr::before {
  background: repeating-linear-gradient(
    to right,
    var(--amber) 0px,
    var(--amber) 5px,
    transparent 5px,
    transparent 9px
  );
  opacity: 0.85;
  height: 2px;
}

/* Node row inside each tree item */
.node-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  position: relative;
  z-index: 3;
}

/* ================================================================
   MODALS
   ================================================================ */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-backdrop.active {
  display: flex;
  animation: fadeIn 0.18s ease;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal-win {
  background: var(--bg-modal);
  border: 1px solid var(--border-l);
  border-radius: var(--r-lg);
  width: 100%;
  max-width: 400px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  animation: slideUp 0.2s ease;
  /* 上部ボーダーで階層色を示す（デフォルト） */
  border-top: 3px solid var(--border-l);
  overflow: hidden;
}
.wide-modal { max-width: 480px; }

@keyframes slideUp {
  from { transform: translateY(24px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* ▼ 階層別モーダルテーマ */
.modal-win.tier-sys {
  border-top-color: var(--sys-color);
  box-shadow: var(--shadow), 0 0 24px var(--sys-glow);
}
.modal-win.tier-sys .modal-hdr-title { color: var(--sys-color); }
.modal-win.tier-sys .modal-hdr { border-bottom-color: rgba(255,123,123,0.2); }

.modal-win.tier-rec {
  border-top-color: var(--rec-color);
  box-shadow: var(--shadow), 0 0 20px var(--rec-glow);
}
.modal-win.tier-rec .modal-hdr-title { color: var(--rec-color); }
.modal-win.tier-rec .modal-hdr { border-bottom-color: rgba(0,200,240,0.2); }

.modal-win.tier-f2 {
  border-top-color: var(--f2-color);
  box-shadow: var(--shadow), 0 0 20px var(--f2-glow);
}
.modal-win.tier-f2 .modal-hdr-title { color: var(--f2-color); }
.modal-win.tier-f2 .modal-hdr { border-bottom-color: rgba(61,240,160,0.2); }
.modal-win.tier-f2 .ocr-checkbox:checked ~ .ocr-check-box {
  border-color: var(--f2-color);
  background: rgba(61, 240, 160, 0.1);
  box-shadow: 0 0 0 2px rgba(61, 240, 160, 0.15);
}
.modal-win.tier-f2 .ocr-check-mark { color: var(--f2-color); }

.modal-win.tier-f3 {
  border-top-color: var(--f3-color);
  box-shadow: var(--shadow), 0 0 20px var(--f3-glow);
}
.modal-win.tier-f3 .modal-hdr-title { color: var(--f3-color); }
.modal-win.tier-f3 .modal-hdr { border-bottom-color: rgba(176,122,255,0.2); }
.modal-win.tier-f3 .ocr-checkbox:checked ~ .ocr-check-box {
  border-color: var(--f3-color);
  background: rgba(176, 122, 255, 0.1);
  box-shadow: 0 0 0 2px rgba(176, 122, 255, 0.15);
}
.modal-win.tier-f3 .ocr-check-mark { color: var(--f3-color); }

.modal-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-hdr-title {
  font-family: var(--font-ui);
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.05em;
  transition: color 0.2s;
}
.modal-x {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}
.modal-x:hover { border-color: var(--sys-color); color: var(--sys-color); }

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.modal-ftr {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* ================================================================
   FORM ELEMENTS
   ================================================================ */
.form-cat {
  font-family: var(--font-jp);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-mono);
  letter-spacing: 0.08em;
  padding: 6px 10px;
  background: var(--bg-sec);
  border-left: 3px solid var(--accent-dim);
  border-radius: 0 var(--r) var(--r) 0;
  margin: 6px 0 4px;
}

.form-sec-title {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  text-transform: uppercase;
  padding: 12px 0 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.form-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-lbl {
  font-family: var(--font-jp);
  font-size: 13px;
  color: var(--text-dim);
  flex: 1;
  min-width: 100px;
  line-height: 1.2;
}

.inp-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.finput {
  width: 100px;
  height: 34px;
  background: var(--bg-input);
  border: 1px solid var(--border-l);
  border-radius: var(--r);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 14px;
  padding: 0 10px;
  text-align: right;
  transition: border-color 0.2s;
  outline: none;
  -moz-appearance: textfield;
}
.finput::-webkit-inner-spin-button,
.finput::-webkit-outer-spin-button { -webkit-appearance: none; }
.finput:focus {
  border-color: var(--accent-dim);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.funit {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  min-width: 32px;
}

/* ================================================================
   OCR チェックボックス
   ================================================================ */
.ocr-check-label {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

/* ネイティブのチェックボックスを非表示 */
.ocr-checkbox {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

/* カスタムチェックボックス本体 */
.ocr-check-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: var(--bg-input);
  border: 1px solid var(--border-l);
  border-radius: var(--r);
  transition: all 0.2s;
  position: relative;
}

/* チェックマーク文字 */
.ocr-check-mark {
  font-family: var(--font-jp);
  font-size: 16px;
  font-weight: 700;
  color: var(--f2-color);
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.15s, transform 0.15s;
  line-height: 1;
}

/* チェックされた状態（デフォルト：f2色） */
.ocr-checkbox:checked ~ .ocr-check-box {
  border-color: var(--f2-color);
  background: rgba(61, 240, 160, 0.1);
  box-shadow: 0 0 0 2px rgba(61, 240, 160, 0.15);
}
.ocr-checkbox:checked ~ .ocr-check-box .ocr-check-mark {
  opacity: 1;
  transform: scale(1);
}

/* 未チェック状態のホバー */
.ocr-check-label:hover .ocr-check-box {
  border-color: var(--text-dim);
}

/* ================================================================
   Transformer block inside node modal
   ================================================================ */
.transformer-block {
  background: var(--bg-sec);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 4px 0;
}

/* 変圧器ヘッダー（タイトル + 削除ボタン） */
.transformer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.transformer-title {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* 変圧器削除ボタン（2つ目以降） */
.del-trans-btn {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid rgba(255, 95, 95, 0.3);
  border-radius: 50%;
  color: rgba(255, 95, 95, 0.6);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}
.del-trans-btn:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: var(--danger-glow);
}

.add-transformer-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 9px;
  background: transparent;
  border: 1px dashed var(--border-l);
  border-radius: var(--r);
  color: var(--text-dim);
  font-family: var(--font-jp);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 4px;
}
.add-transformer-btn:hover {
  border-color: var(--amber-dim);
  color: var(--amber);
  background: rgba(244,162,97,0.07);
}

/* ================================================================
   MODAL FOOTER BUTTONS
   ================================================================ */

/* OK ボタン */
.ok-btn {
  padding: 10px 36px;
  background: linear-gradient(135deg, #0090b8, var(--accent));
  border: none;
  border-radius: var(--r);
  color: #001820;
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.15em;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 3px 16px rgba(0,200,240,0.3);
}
.ok-btn:hover {
  background: linear-gradient(135deg, var(--accent), #40e0ff);
  box-shadow: 0 4px 24px rgba(0,200,240,0.5);
  transform: translateY(-1px);
}
.ok-btn:active { transform: translateY(0); }

/* 削除ボタン（ノード階層削除） */
.del-node-btn {
  padding: 10px 24px;
  background: transparent;
  border: 1px solid rgba(255, 95, 95, 0.4);
  border-radius: var(--r);
  color: var(--danger);
  font-family: var(--font-jp);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all 0.2s;
  margin-right: auto; /* 左端に寄せる */
}
.del-node-btn:hover {
  background: var(--danger-glow);
  border-color: var(--danger);
  box-shadow: 0 0 12px rgba(255, 95, 95, 0.2);
}
.del-node-btn:active { transform: scale(0.97); }

/* ================================================================
   SCROLLBARS
   ================================================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-panel); }
::-webkit-scrollbar-thumb { background: var(--border-l); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-dim); }

/* ================================================================
   UTILITY
   ================================================================ */
button { cursor: pointer; border: none; font-family: inherit; }