:root {
  --bg: #c4cbd4;
  --chrome: #1b222b;
  --chrome-2: #232b34;
  --chrome-3: #2d3642;
  --chrome-line: #10141a;
  --chrome-hover: #3a4554;
  --ink-on-dark: #e8edf3;
  --muted-on-dark: #9bb0c2;
  --panel: #f6f4ee;
  --panel-2: #eeebe3;
  --line: #d4cfc4;
  --line-strong: #c0b9ac;
  --text: #1a222c;
  --muted: #5c6776;
  --accent: #0b6cb8;
  --accent-2: #0a5a98;
  --accent-soft: #dceef8;
  --on-fill: #d4e8f6;
  --ok: #2f9e62;
  --warn: #c9a227;
  --sch: #f7f3e8;
  --sheet: #fffdf8;
  --font: "Segoe UI", Tahoma, Arial, sans-serif;
  --shadow-card: 0 1px 2px rgba(20, 28, 38, .06), 0 8px 20px rgba(20, 28, 38, .05);
  --focus: 0 0 0 2px #fff, 0 0 0 4px var(--accent);
  --radius: 8px;
  --ease: 140ms ease;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  font: 13px/1.45 var(--font); color: var(--text); background: var(--bg);
}
button, a { font: inherit; }
#app {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) 26px;
  height: 100%;
  min-width: 960px;
}
.top {
  background: var(--chrome);
  color: var(--ink-on-dark);
  border-bottom: 1px solid var(--chrome-line);
  box-shadow: 0 1px 0 rgba(255,255,255,.045) inset;
}
.brand-row { display: flex; align-items: center; gap: 10px; padding: 8px 16px 6px; }
.brand { color: #7ec4ff; text-decoration: none; font-weight: 700; letter-spacing: .04em; }
.brand:hover { color: #c4e4ff; }
.sep { color: var(--muted-on-dark); }
h1 { margin: 0; font-size: 14px; font-weight: 600; }
.spacer { flex: 1; }
.ghost {
  color: var(--ink-on-dark); text-decoration: none;
  border: 1px solid #45515f; padding: 5px 12px; border-radius: 6px;
  background: var(--chrome-3);
}
.ghost:hover { background: var(--chrome-hover); color: #fff; }

.greet-bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding: 8px 16px 14px;
  background: linear-gradient(#262f39, var(--chrome-2));
}
.order-greet {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: .01em;
  color: #fff;
  line-height: 1.3;
}
.flow {
  margin: 0;
  color: var(--muted-on-dark);
  font-size: 12px;
  white-space: nowrap;
}

.layout {
  display: flex;
  min-height: 0;
  background: var(--bg);
}
.sidebar {
  width: 280px;
  flex: 0 0 280px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--panel);
  border-right: 1px solid var(--line);
}
.side-head {
  flex: 0 0 auto;
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--panel-2);
  border-bottom: 1px solid var(--line);
}
.cad-tree {
  flex: 1;
  overflow: auto;
  padding: 8px 0 16px;
}
.cad-tree::-webkit-scrollbar { width: 10px; }
.cad-tree::-webkit-scrollbar-thumb { background: #c5c0b4; border-radius: 6px; }
.cad-tree::-webkit-scrollbar-track { background: transparent; }

.tree-node {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 12px 7px 8px;
  cursor: pointer;
  user-select: none;
  border: 0;
  border-left: 3px solid transparent;
  background: transparent;
  color: inherit;
  text-align: left;
  font: inherit;
  border-radius: 0 6px 6px 0;
  transition: background var(--ease), border-color var(--ease);
}
.tree-node:hover { background: #e8f0fc; }
.tree-node.on {
  background: var(--on-fill);
  border-left-color: var(--accent);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(11, 108, 184, .12);
}
.tree-node.stage {
  background: #eef3d8;
  border-left-color: #8a9a4a;
}
.tree-node.stage.on {
  background: var(--on-fill);
  border-left-color: var(--accent);
}
.tree-node.dim { opacity: .48; }
.tree-node .chev {
  width: 16px;
  flex-shrink: 0;
  text-align: center;
  color: var(--muted);
  font-size: 9px;
}
.tree-node .mark {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--accent-2);
  flex-shrink: 0;
  font-size: 12px;
  border-radius: 5px;
  background: rgba(11, 108, 184, .08);
}
.tree-node.on .mark { background: rgba(11, 108, 184, .16); }
.tree-node .tree-lab {
  overflow: hidden;
  min-width: 0;
}
.tree-node .tree-lab b,
.tree-node .tree-lab span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tree-node .tree-lab span {
  font-weight: 400;
  color: var(--muted);
  font-size: 12px;
}
.tree-kids { display: none; }
.tree-kids.open { display: block; }

.workspace {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--sch);
}
.stepper {
  flex: 0 0 auto;
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 0;
  background: var(--chrome-2);
  border-bottom: 1px solid var(--chrome-line);
  overflow-x: auto;
}
.step {
  flex: 1 1 0;
  min-width: 128px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 0;
  border-right: 1px solid #10141a;
  background: transparent;
  color: var(--muted-on-dark);
  cursor: pointer;
  text-align: left;
  font: inherit;
  transition: background var(--ease), color var(--ease);
}
.step:hover { background: var(--chrome-hover); color: var(--ink-on-dark); }
.step.on {
  background: #2a3544;
  color: #fff;
  box-shadow: inset 0 -3px 0 var(--accent);
}
.step .num {
  flex-shrink: 0;
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 1px solid #5a6a7c;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
}
.step.on .num { border-color: #7ec4ff; color: #7ec4ff; background: rgba(126, 196, 255, .08); }
.step .lab { font-size: 13px; line-height: 1.25; font-weight: 600; }

.bpm-strip {
  background: #1e2833;
  border-bottom: 1px solid var(--chrome-line);
}
.bpm-strip .step { min-width: 110px; padding: 10px 12px; }
.bpm-strip .step .lab { font-size: 12px; }
.bpm-strip .step.on {
  background: #243342;
  box-shadow: inset 0 -3px 0 #c9a227;
}
.bpm-strip .step.on .num { border-color: #e8c96a; color: #e8c96a; background: rgba(232, 201, 106, .08); }

.stack-bar {
  display: flex;
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: #e6eaef;
  margin: 12px 0 8px;
}
.stack-bar .seg { display: block; height: 100%; min-width: 0; }
.stack-bar .seg.buy { background: #0b6cb8; }
.stack-bar .seg.asm { background: #3d7a4a; }
.stack-bar .seg.det { background: #c9a227; }
.stack-bar .seg.mat { background: #6b5c9e; }
.stack-bar .seg.labor { background: #8a6a4a; }
.stack-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin: 0 0 16px;
  font-size: 12px;
  color: var(--muted);
}
.stack-legend .dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.stack-legend .dot.buy { background: #0b6cb8; }
.stack-legend .dot.asm { background: #3d7a4a; }
.stack-legend .dot.det { background: #c9a227; }
.stack-legend .dot.mat { background: #6b5c9e; }
.stack-legend .dot.labor { background: #8a6a4a; }
.hbars { margin: 0 0 18px; max-width: 720px; }
.hbar {
  display: grid;
  grid-template-columns: minmax(120px, 180px) 1fr 110px;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}
.hbar-lab { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track {
  height: 10px;
  background: #e6eaef;
  border-radius: 999px;
  overflow: hidden;
}
.hbar-track > i { display: block; height: 100%; background: var(--accent); }
.hbar-n { font-size: 12px; font-weight: 600; text-align: right; }
.analog-block { margin-bottom: 20px; }
.analog-block table.dash { margin-top: 10px; }

.kpi-row {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  padding: 16px 18px 4px;
}
.kpi {
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 14px 16px 12px;
  text-align: left;
  cursor: pointer;
  color: inherit;
  font: inherit;
  transition: border-color var(--ease), transform var(--ease), box-shadow var(--ease);
}
.kpi:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(11, 108, 184, .12);
}
.kpi.on { background: var(--accent-soft); border-color: var(--accent); }
.kpi .n { display: block; font-size: 26px; font-weight: 700; color: var(--accent-2); line-height: 1.1; }
.kpi .l { display: block; color: var(--text); font-size: 13px; font-weight: 600; margin-top: 6px; }
.kpi .why { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; line-height: 1.35; }
.kpi .kpi-go {
  display: inline-block;
  margin-top: 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
}

.ws-toolbar {
  flex: 0 0 auto;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px 12px;
  background: linear-gradient(#fffdf8, #f3eee2);
  border-bottom: 1px solid var(--line);
  color: var(--text);
}
.ws-toolbar h2 { margin: 2px 0 0; font-size: 18px; font-weight: 700; color: var(--text); }
.ws-toolbar .hello { margin: 0; font-size: 13px; color: var(--muted); }
.ws-toolbar .meta { color: var(--muted); }
.ws-body {
  flex: 1;
  min-height: 0;
  display: flex;
}
.ws-main {
  flex: 1;
  min-width: 0;
  overflow: auto;
  padding: 20px 22px 28px;
}
.ws-detail {
  width: 300px;
  flex: 0 0 300px;
  overflow: auto;
  background: var(--sheet);
  border-left: 1px solid var(--line);
  padding: 18px 18px 24px;
}
.ws-detail h3 {
  margin: 0 0 14px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
}
.ws-detail .field { margin: 0 0 14px; }
.ws-detail .field b { display: block; font-size: 14px; }
.ws-detail .ids { font-family: Consolas, "Cascadia Mono", monospace; font-size: 11px; color: var(--muted); word-break: break-all; line-height: 1.5; }
.pause {
  background: #fff8e6;
  border: 1px solid #e0c56a;
  padding: 12px 14px;
  border-radius: var(--radius);
  margin: 10px 0;
}

.entry-title {
  margin: 0 0 14px;
  font-size: 14px;
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}
.entry-title .meta { font-weight: 400; display: block; margin-top: 4px; }
.tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 16px;
  max-width: 960px;
  margin-bottom: 20px;
}
.tile, .open-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  text-align: left;
  cursor: pointer;
  color: inherit;
  font: inherit;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--sheet);
  box-shadow: var(--shadow-card);
  transition: border-color var(--ease), background var(--ease), transform var(--ease);
}
.tile {
  padding: 22px 20px 18px;
  min-height: 148px;
}
.tile:hover, .open-btn:hover {
  border-color: var(--accent);
  background: #fff;
  transform: translateY(-1px);
}
.tile .kind, .open-btn .kind {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .01em;
  color: var(--accent-2);
}
.tile .sub, .open-btn .sub { color: var(--muted); font-size: 13px; line-height: 1.4; }
.tile .go { margin-top: auto; font-size: 12px; color: var(--accent); font-weight: 600; }

.preview-card, .id-card {
  background: var(--sheet);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 18px 20px;
  margin-bottom: 18px;
}
.preview-card h3, .id-card h3 { margin: 0 0 6px; font-size: 20px; font-weight: 700; }
.preview-card .meta, .id-card .meta { color: var(--muted); margin-bottom: 12px; }
.id-card p { margin: 0 0 10px; color: var(--text); }
.open-row { display: flex; flex-wrap: wrap; gap: 12px; }
.open-btn { padding: 14px 18px; min-width: 180px; min-height: 72px; }
.open-btn .kind { font-size: 16px; }

.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.dcard {
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  text-align: left;
  cursor: pointer;
  color: inherit;
  font: inherit;
  box-shadow: var(--shadow-card);
  transition: border-color var(--ease), background var(--ease);
}
.dcard:hover, .dcard.on { border-color: var(--accent); }
.dcard.on { background: var(--accent-soft); }
.dcard b { display: block; font-size: 14px; }
.dcard .st {
  display: inline-block;
  margin-top: 8px;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #f7edd0;
  color: #7a6414;
}

table.dash {
  width: 100%;
  border-collapse: collapse;
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
table.dash th, table.dash td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
table.dash th {
  background: var(--panel-2);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  font-weight: 700;
}
table.dash tr { cursor: pointer; }
table.dash tr:hover td { background: #e8f0fc; }
table.dash tr.on td { background: var(--on-fill); }
table.dash .indent { padding-left: 28px; }

.bar, .cov-track {
  height: 8px;
  background: #e6eaef;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 6px;
  max-width: 160px;
}
.bar > i, .cov-track > i { display: block; height: 100%; background: var(--ok); }
.bar.warn > i, .cov.warn .cov-track > i { background: var(--warn); }
.cov.mid .cov-track > i { background: #c9a227; }
.cov {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}
.cov-lab { font-size: 12px; color: var(--muted); font-weight: 600; min-width: 2.4em; }
.kpi .cov { margin-top: 10px; }
.kpi .cov-track { max-width: none; flex: 1; }

.filters { display: flex; gap: 8px; margin: 0 0 16px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line-strong);
  background: var(--sheet);
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: background var(--ease), border-color var(--ease);
}
.chip:hover { border-color: var(--accent); background: #fff; }
.chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-2); font-weight: 600; }

.badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #0a5a98;
  margin-right: 4px;
}
.badge.d { background: var(--panel-2); color: #3a4554; }
.meta { color: var(--muted); font-size: 12px; }
.msg { color: var(--muted); line-height: 1.5; margin: 0 0 16px; max-width: 52em; }
button.build {
  background: var(--accent);
  color: #fff;
  border: 0;
  padding: 10px 16px;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  margin-bottom: 16px;
}
button.build:hover { background: var(--accent-2); }

.empty-state {
  background: var(--sheet);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 28px 24px;
  margin-bottom: 16px;
  max-width: 36em;
}
.empty-title { margin: 0 0 6px; font-size: 16px; font-weight: 700; }
.empty-text { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.empty-inline { color: var(--muted); margin: 0 0 14px; }

.shop-lead {
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
}
.shop-count { margin: 0 0 6px; font-size: 16px; font-weight: 700; }

.status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--chrome-2);
  color: var(--muted-on-dark);
  padding: 0 14px;
  font-size: 12px;
  border-top: 1px solid var(--chrome-line);
}
:focus { outline: none; }
:focus-visible { box-shadow: var(--focus); }
.top :focus-visible, .ghost:focus-visible, .step:focus-visible { box-shadow: 0 0 0 2px rgba(126, 196, 255, .95); }

.stack-bar {
  display: flex;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: #e6eaef;
  margin: 8px 0 10px;
}
.stack-bar .seg { display: block; height: 100%; }
.stack-bar .seg.buy, .dot.buy { background: #3d7ea6; }
.stack-bar .seg.asm, .dot.asm, .stack-bar .seg.own, .dot.own { background: #8a6d3b; }
.stack-bar .seg.det, .dot.det, .stack-bar .seg.wage, .dot.wage { background: #5a8f5a; }
.stack-bar .seg.mat, .dot.mat { background: #c9a227; }
.stack-bar .seg.labor, .dot.labor, .stack-bar .seg.extra, .dot.extra { background: #6b5b95; }
.stack-bar .seg.tzr, .dot.tzr, .stack-bar .seg.social, .dot.social { background: #4a90a4; }
.stack-bar .seg.rseo, .dot.rseo, .stack-bar .seg.shop, .dot.shop,
.stack-bar .seg.admin, .dot.admin, .stack-bar .seg.comm, .dot.comm { background: #a65d4e; }
.stack-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 14px;
}
.stack-legend .dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}
.hbars { display: flex; flex-direction: column; gap: 8px; margin: 0 0 18px; }
.hbar {
  display: grid;
  grid-template-columns: 160px 1fr 120px;
  gap: 10px;
  align-items: center;
}
.hbar-lab { font-size: 12px; color: var(--muted); }
.hbar-track { height: 8px; background: #e6eaef; border-radius: 999px; overflow: hidden; }
.hbar-track > i { display: block; height: 100%; background: var(--accent); }
.hbar-n { font-size: 12px; font-weight: 600; }
.kpi-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 12px;
  margin: 0 0 18px;
}
.kpi-tile {
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow-card);
}
.kpi-tile .n { display: block; font-size: 16px; font-weight: 700; color: var(--accent-2); }
.kpi-tile .l { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); }
.coeff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  margin: 0 0 18px;
}
.coeff-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}
.coeff-grid input, .coeff-grid select {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  color: inherit;
  background: var(--sheet);
}

.menu { display: flex; padding: 0 6px 2px; gap: 0; background: var(--chrome); }
.menu-drop { position: relative; }
.menu-btn, .menu-pop button {
  background: transparent; color: var(--ink-on-dark); border: 0;
  padding: 4px 11px; cursor: pointer; font: inherit; text-align: left; width: 100%;
}
.menu-btn { width: auto; border-radius: 6px; height: 24px; padding: 0 10px; }
.menu-btn:hover, .menu-drop.open .menu-btn { background: var(--chrome-hover); }
.menu-pop {
  display: none; position: absolute; top: 100%; left: 0; min-width: 280px; z-index: 40;
  background: #323a44; border: 1px solid #12161c; border-radius: 0 0 8px 8px;
  padding: 4px 0; box-shadow: 0 8px 24px rgba(0,0,0,.35);
}
.menu-drop.open .menu-pop { display: block; }
.menu-pop button { padding: 6px 14px; }
.menu-pop button:hover { background: #4a5564; }
.menu-sep { height: 1px; margin: 4px 10px; background: #4a5562; }

.bpm-modal[hidden] { display: none; }
.bpm-modal {
  position: fixed; inset: 0; z-index: 80;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 48px 16px 24px;
}
.bpm-modal-bg { position: absolute; inset: 0; background: rgba(16, 20, 26, .45); }
.bpm-dlg {
  position: relative; z-index: 1;
  width: min(880px, 100%);
  max-height: calc(100vh - 72px);
  overflow: auto;
  background: var(--sheet);
  border-radius: 10px;
  box-shadow: 0 16px 48px rgba(16, 20, 26, .28);
  color: var(--text);
}
.bpm-dlg-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
  background: var(--panel-2); position: sticky; top: 0;
}
.bpm-dlg-head h2 { margin: 0; font-size: 16px; }
.bpm-dlg-x {
  border: 0; background: transparent; font-size: 22px; cursor: pointer; color: var(--muted);
}
.bpm-dlg-body { padding: 16px 18px 22px; }
.bpm-dlg-body h3 { margin: 16px 0 8px; font-size: 13px; }
.src-list { display: flex; flex-direction: column; gap: 10px; margin: 8px 0 16px; }
.src-list label { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; }
.check-row { display: flex; align-items: center; gap: 8px; margin: 8px 0; }

.causal { margin: 0 0 18px; }
.causal-row {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: stretch;
}
.causal-node {
  flex: 1 1 140px;
  min-width: 120px;
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  box-shadow: var(--shadow-card);
}
.causal-node b { display: block; font-size: 12px; }
.causal-node .n { display: block; font-weight: 700; color: var(--accent-2); margin: 4px 0 2px; }
.causal-node .from { display: block; font-size: 11px; color: var(--muted); line-height: 1.3; }
.causal-arrow {
  text-align: center; color: var(--muted); font-size: 12px; margin: 4px 0 8px; letter-spacing: .04em;
}

@media (max-width: 1200px) {
  .kpi-row { grid-template-columns: repeat(3, 1fr); }
  .tiles { grid-template-columns: 1fr; }
  .ws-detail { width: 260px; flex-basis: 260px; }
  .flow { display: none; }
}
