/* スイムレーン共通 CSS ・ by-department / phase 個別ページ共通 */
:root {
  --hb-gold: #BFA24B; --hb-gold-deep: #A07650; --hb-bg: #FAFAF8; --hb-bg-card: #FFFFFF;
  --hb-bg-section: #F5F4EF; --hb-black: #0A0A0A; --hb-gray-100: #F0EFE9; --hb-gray-200: #E5E4DC;
  --hb-gray-300: #D4D3CB; --hb-gray-400: #A0A09A; --hb-gray-500: #6E6D67; --hb-gray-700: #3D3D38;
  --hb-gray-900: #1A1A18; --hb-navy: #1E3A5F; --pillar-04: #6B7FA0;
  --lane-admin-bg: #E3F2FD; --lane-admin-fg: #1565C0; --lane-admin-soft: #F5FAFE;
  --lane-sys-bg: #E8F5E9; --lane-sys-fg: #2E7D32; --lane-sys-soft: #F5FAF5;
  --lane-sal-bg: #FFF3E0; --lane-sal-fg: #EF6C00; --lane-sal-soft: #FEFAF5;
  --lane-mfg-bg: #EDE7F6; --lane-mfg-fg: #5E35B1; --lane-mfg-soft: #FAF8FE;
  --lane-hub-bg: #FFEDE6; --lane-hub-fg: #FF7A59; --lane-hub-soft: #FEF7F4;
  --lane-kin-bg: #E8F4FB; --lane-kin-fg: #1565C0; --lane-kin-soft: #F4F9FD;
  --lane-cc-bg: #F3E8FF; --lane-cc-fg: #7E22CE; --lane-cc-soft: #FAF4FE;
  --node-decision: #FFFDE7; --node-decision-fg: #F57F17;
  --node-end: #FFEBEE; --node-end-fg: #C62828;
  --arrow-color: #6B7280;
  --font-heading: 'Outfit', sans-serif; --font-body: 'Noto Sans JP', sans-serif; --font-mono: 'JetBrains Mono', monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font-body); background: var(--hb-bg); color: var(--hb-black); line-height: 1.6; }
.topbar { background: var(--hb-black); color: var(--hb-bg); padding: 10px 24px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.topbar-brand { font-family: var(--font-heading); font-weight: 900; font-size: 14px; letter-spacing: 0.04em; }
.topbar-nav { display: flex; gap: 16px; flex-wrap: wrap; }
.topbar-nav a { color: rgba(255,255,255,0.7); text-decoration: none; font-size: 12px; }
.topbar-nav a:hover { color: white; }
.page { max-width: 1400px; margin: 0 auto; padding: 28px 32px 64px; }
.page-fullscreen { max-width: 100%; margin: 0; padding: 24px 32px 64px; }
.hero { background: linear-gradient(135deg, var(--hb-gray-900) 0%, var(--hb-navy) 100%); color: var(--hb-bg); border-radius: 16px; padding: 28px 32px; margin-bottom: 20px; }
.hero-eyebrow { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; color: var(--hb-gold); margin-bottom: 6px; text-transform: uppercase; }
.hero-title { font-family: var(--font-heading); font-weight: 900; font-size: 28px; line-height: 1.2; margin-bottom: 8px; }
.hero-sub { font-size: 13.5px; line-height: 1.7; opacity: 0.85; max-width: 900px; }
.hero-meta { display: flex; gap: 18px; margin-top: 14px; font-size: 11.5px; opacity: 0.7; flex-wrap: wrap; }
.hero-meta strong { color: var(--hb-gold); font-family: var(--font-mono); }
.version-tabs { display: flex; gap: 0; margin-bottom: 0; border-bottom: 2px solid var(--hb-gray-300); padding-top: 10px; }
.version-tab { padding: 14px 28px; background: transparent; border: 0; cursor: pointer; font-family: var(--font-heading); font-weight: 700; font-size: 14px; color: var(--hb-gray-500); position: relative; transition: all 0.2s; }
.version-tab:hover { color: var(--hb-gray-900); }
.version-tab.active { color: var(--hb-black); }
.version-tab.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 3px; background: var(--hb-gold); }
.version-badge { display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 4px; font-family: var(--font-mono); font-size: 10px; font-weight: 700; }
.version-badge.before { background: var(--hb-gray-200); color: var(--hb-gray-700); }
.version-badge.after { background: #E5F1E8; color: #2D7A47; }
.version-content { display: none; padding: 20px 0; }
.version-content.active { display: block; }
.phase-block { margin-bottom: 36px; background: var(--hb-bg-card); border: 1px solid var(--hb-gray-200); border-radius: 12px; padding: 18px 20px; }
.phase-header { display: flex; align-items: baseline; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.phase-num { font-family: var(--font-heading); font-weight: 900; font-size: 18px; color: var(--hb-black); }
.phase-title { font-family: var(--font-heading); font-weight: 700; font-size: 18px; color: var(--hb-black); }
.phase-desc { font-size: 11.5px; color: var(--hb-gray-500); margin-bottom: 14px; line-height: 1.6; }
.phase-actions { margin-left: auto; display: flex; gap: 8px; }
.btn-fullscreen { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; background: var(--hb-navy); color: white; border-radius: 6px; text-decoration: none; font-size: 11.5px; font-weight: 600; transition: all 0.15s; }
.btn-fullscreen:hover { background: var(--hb-black); transform: translateY(-1px); }

/* ステージ */
.stages { display: grid; grid-template-columns: 140px repeat(5, 1fr); gap: 0; margin-bottom: 0; border-radius: 8px 8px 0 0; overflow: hidden; border: 1px solid var(--hb-gray-200); border-bottom: 0; }
.stages-label { background: var(--hb-bg-section); border-right: 1px solid var(--hb-gray-200); }
.stage { padding: 10px 12px; background: var(--hb-bg-section); border-right: 1px solid var(--hb-gray-200); font-size: 11.5px; color: var(--hb-gray-700); font-weight: 600; text-align: center; }
.stage:last-child { border-right: 0; }
.stage-num { font-family: var(--font-mono); font-size: 10px; color: var(--hb-gold-deep); margin-right: 4px; font-weight: 700; }

/* スイムレーン */
.swimlane-wrap { overflow-x: auto; position: relative; }
.swimlane { min-width: 980px; display: grid; grid-template-columns: 140px 1fr; gap: 0; border: 1px solid var(--hb-gray-200); border-radius: 0 0 10px 10px; overflow: visible; position: relative; }
.swimlane.fullscreen { min-width: 1800px; }
.lane-row { display: contents; }
.lane-label { padding: 14px 12px; font-family: var(--font-heading); font-weight: 700; font-size: 12.5px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; border-bottom: 1px solid var(--hb-gray-200); border-right: 1px solid var(--hb-gray-200); writing-mode: horizontal-tb; }
.lane-row:last-child .lane-label { border-bottom: 0; }
.lane-row:last-child .lane-content { border-bottom: 0; }
.lane-label-sub { display: block; font-size: 9.5px; font-weight: 400; opacity: 0.75; margin-top: 3px; line-height: 1.4; }

.lane-admin .lane-label { background: var(--lane-admin-bg); color: var(--lane-admin-fg); border-left: 4px solid var(--lane-admin-fg); }
.lane-sys .lane-label { background: var(--lane-sys-bg); color: var(--lane-sys-fg); border-left: 4px solid var(--lane-sys-fg); }
.lane-sal .lane-label { background: var(--lane-sal-bg); color: var(--lane-sal-fg); border-left: 4px solid var(--lane-sal-fg); }
.lane-mfg .lane-label { background: var(--lane-mfg-bg); color: var(--lane-mfg-fg); border-left: 4px solid var(--lane-mfg-fg); }
.lane-hub .lane-label { background: var(--lane-hub-bg); color: var(--lane-hub-fg); border-left: 4px solid var(--lane-hub-fg); }
.lane-kin .lane-label { background: var(--lane-kin-bg); color: var(--lane-kin-fg); border-left: 4px solid var(--lane-kin-fg); }
.lane-cc .lane-label { background: var(--lane-cc-bg); color: var(--lane-cc-fg); border-left: 4px solid var(--lane-cc-fg); }

.lane-content { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; min-height: 130px; padding: 0; border-bottom: 1px solid var(--hb-gray-200); position: relative; }
.lane-content > .cell { border-right: 1px dashed var(--hb-gray-200); padding: 14px 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; position: relative; }
.lane-content > .cell:last-child { border-right: 0; }

.lane-admin .lane-content { background-color: var(--lane-admin-soft); }
.lane-sys .lane-content { background-color: var(--lane-sys-soft); }
.lane-sal .lane-content { background-color: var(--lane-sal-soft); }
.lane-mfg .lane-content { background-color: var(--lane-mfg-soft); }
.lane-hub .lane-content { background-color: var(--lane-hub-soft); }
.lane-kin .lane-content { background-color: var(--lane-kin-soft); }
.lane-cc .lane-content { background-color: var(--lane-cc-soft); }

/* ノード */
.node { padding: 8px 10px; background: white; border-radius: 6px; font-size: 11px; line-height: 1.4; text-align: center; min-width: 110px; max-width: 160px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); font-weight: 500; position: relative; }
.fullscreen .node { font-size: 12.5px; padding: 10px 14px; min-width: 140px; max-width: 200px; }
.node-sub { display: block; font-size: 9.5px; opacity: 0.75; font-weight: 400; margin-top: 2px; }
.fullscreen .node-sub { font-size: 11px; }
.node.admin { border: 1.5px solid var(--lane-admin-fg); color: var(--lane-admin-fg); }
.node.sys { border: 1.5px solid var(--lane-sys-fg); color: var(--lane-sys-fg); }
.node.sal { border: 1.5px solid var(--lane-sal-fg); color: var(--lane-sal-fg); }
.node.mfg { border: 1.5px solid var(--lane-mfg-fg); color: var(--lane-mfg-fg); }
.node.hub { border: 1.5px solid var(--lane-hub-fg); color: var(--lane-hub-fg); }
.node.kin { border: 1.5px solid var(--lane-kin-fg); color: var(--lane-kin-fg); }
.node.cc { border: 1.5px solid var(--lane-cc-fg); color: var(--lane-cc-fg); }
.node.ghost { border: 1.5px dashed var(--hb-gray-400); color: var(--hb-gray-500); background: #FAFAFA; }
.node.end { border: 2px solid var(--node-end-fg); color: var(--node-end-fg); background: var(--node-end); font-weight: 700; }
.node-tag { display: inline-block; padding: 1px 6px; border-radius: 4px; font-size: 9px; font-family: var(--font-mono); font-weight: 700; margin-bottom: 4px; letter-spacing: 0.04em; }
.fullscreen .node-tag { font-size: 10px; }
.node-tag.hub { background: var(--lane-hub-fg); color: white; }
.node-tag.kin { background: var(--lane-kin-fg); color: white; }
.node-tag.cc { background: var(--lane-cc-fg); color: white; }

/* ステップバッジ */
.step { position: absolute; top: -10px; left: -10px; width: 22px; height: 22px; border-radius: 50%; background: var(--hb-navy); color: white; font-family: var(--font-mono); font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; z-index: 5; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
.fullscreen .step { width: 26px; height: 26px; font-size: 12px; top: -13px; left: -13px; }

/* 菱形 (Figma 風 ・ 正方形に内接) */
.diamond { position: relative; width: 110px; height: 110px; display: flex; align-items: center; justify-content: center; margin: 6px 0; }
.fullscreen .diamond { width: 140px; height: 140px; }
.diamond::before { content: ""; position: absolute; top: 50%; left: 50%; width: 78px; height: 78px; background: var(--node-decision); border: 2px solid var(--node-decision-fg); transform: translate(-50%, -50%) rotate(45deg); border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.fullscreen .diamond::before { width: 100px; height: 100px; }
.diamond-text { position: relative; z-index: 1; font-size: 10.5px; font-weight: 700; color: var(--node-decision-fg); text-align: center; padding: 0 8px; line-height: 1.3; max-width: 92px; }
.fullscreen .diamond-text { font-size: 11.5px; max-width: 110px; }

/* 矢印 (cell 内縦並び) */
.arrow-down { color: var(--arrow-color); font-size: 18px; line-height: 1; font-weight: 700; margin: -4px 0; opacity: 0.7; }
.fullscreen .arrow-down { font-size: 22px; }
.arrow-label { font-size: 9.5px; color: var(--hb-gray-500); font-weight: 600; padding: 2px 6px; background: rgba(255,255,255,0.7); border-radius: 4px; line-height: 1; }
.fullscreen .arrow-label { font-size: 10.5px; }

/* レーン間矢印 (SVG overlay) */
.flow-svg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 3; }
.flow-svg path, .flow-svg line { stroke: var(--arrow-color); stroke-width: 1.8; fill: none; }
.flow-svg .dashed { stroke-dasharray: 6 4; opacity: 0.7; }
.flow-svg .yes { stroke: #2D7A47; }
.flow-svg .no { stroke: #C62828; }

/* レジェンド & ノートカード */
.lane-legend { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 14px; background: var(--hb-bg-section); border-radius: 8px; margin: 12px 0; font-size: 11.5px; }
.lane-legend-item { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; background: white; border-radius: 4px; font-weight: 600; }
.lane-legend-item .swatch { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.note-card { padding: 12px 14px; background: rgba(45, 122, 122, 0.04); border-left: 3px solid var(--hb-navy); border-radius: 6px; margin: 10px 0; font-size: 11.5px; line-height: 1.7; color: var(--hb-gray-700); }
.cta-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; }
.cta { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; background: var(--hb-bg-card); border: 1px solid var(--hb-gray-300); border-radius: 8px; text-decoration: none; color: var(--hb-gray-900); font-size: 12.5px; font-weight: 600; }
.cta:hover { border-color: var(--hb-gold); }
footer { margin-top: 40px; padding: 20px 0; border-top: 1px solid var(--hb-gray-200); display: flex; justify-content: space-between; font-size: 11px; color: var(--hb-gray-500); flex-wrap: wrap; }

/* フルスクリーン専用: 全画面コンテナ */
.fullscreen-canvas { background: var(--hb-bg-card); border: 1px solid var(--hb-gray-200); border-radius: 12px; padding: 24px; overflow-x: auto; }
.fullscreen-canvas .stages { grid-template-columns: 200px repeat(5, 1fr); }
.fullscreen-canvas .swimlane { grid-template-columns: 200px 1fr; }
.fullscreen-canvas .lane-content { min-height: 180px; }
.fullscreen-canvas .lane-content > .cell { padding: 20px 12px; gap: 14px; }
.fullscreen-canvas .lane-label { padding: 18px 14px; font-size: 14px; }
.fullscreen-canvas .lane-label-sub { font-size: 10.5px; }
.fullscreen-canvas .stage { padding: 14px 16px; font-size: 13px; }
