/* Founder Graph (app id: capmap) — canvas graph + inspect / path / ask panel */
.app-capmap {
  /* node colours by type: canvas reads these, so accents and light mode restyle the graph */
  --fg-venture: var(--acc); --fg-milestone: var(--acc-lo); --fg-domain: var(--acc-hot); --fg-skill: var(--text-2);
  --fg-principle: var(--green); --fg-category: var(--muted); --fg-app: var(--dim);
  --fg-edge: var(--line-3); --fg-edge-hi: var(--acc); --fg-ring: var(--acc); --fg-tag: var(--panel); --fg-grid: var(--line);
  background: radial-gradient(ellipse at 36% 50%, var(--panel-2) 0%, var(--panel) 62%);
}
.fg { display: grid; grid-template-columns: minmax(0, 1fr) 320px; height: 100%; min-height: 0; }
.fg-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }

/* filters */
.fg-bar { flex: none; display: grid; gap: 8px; padding: 10px 12px 9px; border-bottom: 1px solid var(--line); }
.fg-types { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 1px 4px 4px 1px; }
.fg-types::-webkit-scrollbar { display: none; }
.app-capmap .fg-tchip { flex: none; gap: 7px; padding: 0 10px; font-size: 11px; }
.fg-tchip[aria-pressed='false'] { opacity: 0.5; }
.fg-tchip[aria-pressed='false'] .fg-sw { filter: grayscale(1); }
.fg-sw { display: block; flex: none; }
.fg-bar2 { display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap; }
.fg-field { display: flex; align-items: center; gap: 8px; }
.app-capmap .fg-dom { width: auto; height: 28px; padding: 0 8px; font-size: 12px; resize: none; }
.fg-time { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 240px; }
.fg-range { flex: 1; min-width: 70px; max-width: 220px; accent-color: var(--acc); height: 20px; }
.fg-tout { flex: 1; min-width: 0; font-size: 11px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-capmap .fg-play { width: 28px; padding: 0; font-size: 10px; }

/* stage */
.fg-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.fg-canvas { position: absolute; inset: 0; display: block; touch-action: none; cursor: grab; }
.fg-canvas.is-grabbing { cursor: grabbing; }
.fg-a11y { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.fg-zoom { position: absolute; right: 10px; bottom: 10px; display: flex; gap: 6px; }
.app-capmap .fg-zb { min-width: 30px; padding: 0 8px; }
.fg-hint { position: absolute; left: 12px; bottom: 14px; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); pointer-events: none; }
.fg-selbar { position: absolute; left: 10px; bottom: 10px; max-width: calc(100% - 150px); overflow: hidden; text-overflow: ellipsis; }
.fg-selbar, .fg-selbar[hidden] { display: none; }

/* panel */
.fg-panel { border-left: 1px solid var(--line); background: var(--bg-2); min-height: 0; min-width: 0; display: flex; flex-direction: column; }
.fg-tabs { padding: 0 8px; }
.fg-tabs .tab { padding: 11px 9px 10px; font-size: 11.5px; }
.fg-body { flex: 1; min-height: 0; }
.fg-pane { padding: 14px 16px 24px; display: flex; flex-direction: column; gap: 9px; }
.fg-pane[hidden] { display: none; }
.fg-pane p { margin: 0; line-height: 1.6; font-size: 12px; }
.fg-title { font-size: 18px; color: var(--text); margin: 0; line-height: 1.3; }
.fg-lead { color: var(--text-2); }
.fg-small { font-size: 11px !important; line-height: 1.5 !important; }
.fg-kind { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--acc); }
.fg-sec { display: grid; gap: 7px; margin-top: 6px; }
.fg-legend { display: grid; gap: 7px; margin: 4px 0; font-size: 11.5px; }
.fg-legend div { display: grid; grid-template-columns: 16px auto minmax(0, 1fr); align-items: center; gap: 4px 10px; }
.fg-legend b { color: var(--text); font-weight: 600; }
.fg-legend span { font-size: 11px; }
.fg-presets { display: grid; justify-items: start; gap: 6px; }
.app-capmap .fg-q { height: auto; min-height: 26px; padding: 5px 11px; white-space: normal; text-align: left; line-height: 1.35; border-radius: 13px; }
.fg-keys { display: grid; gap: 5px; margin: 8px 0 0; padding: 10px 0 0; border-top: 1px dashed var(--line-2); list-style: none; font-size: 11px; color: var(--muted); }
.fg-group { display: grid; gap: 5px; }
.fg-gl { font-size: 10.5px; color: var(--dim); }
.app-capmap .fg-nchip { gap: 6px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.fg-dl { display: grid; gap: 3px; margin: 0; font-size: 12px; }
.fg-dl dt { color: var(--text); font-weight: 600; margin-top: 5px; }
.fg-dl dd { margin: 0; color: var(--text-2); line-height: 1.5; }
.fg-quote { margin: 0; padding: 9px 12px; border-left: 2px solid var(--acc); background: var(--acc-a06); color: var(--text); font-size: 12px; line-height: 1.55; }
.fg-quote cite { display: block; margin-top: 4px; font-style: normal; font-size: 11px; color: var(--muted); }
.fg-commit { display: block; padding: 9px 11px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); font: 11.5px/1.5 var(--font-mono); color: var(--text-2); overflow-wrap: anywhere; }
.fg-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

/* path finder + ask */
.fg-pathform { display: grid; gap: 4px; }
.fg-combo { position: relative; display: grid; gap: 5px; }
.app-capmap .fg-in { height: 34px; resize: none; }
.app-capmap .fg-swap { justify-self: center; width: 34px; padding: 0; font-size: 14px; }
.fg-list { position: absolute; top: 100%; left: 0; right: 0; z-index: 6; margin: 4px 0 0; padding: 4px; list-style: none; max-height: 248px; overflow: auto; background: var(--surface-pop); border: 2px solid var(--nb-line); border-radius: 6px; box-shadow: var(--shadow-pop); }
.fg-opt { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 4px; font-size: 12px; color: var(--text); cursor: pointer; }
.fg-opt span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fg-opt small { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.fg-opt[aria-selected='true'], .fg-opt:hover { background: var(--acc-a10); }
.fg-out { display: grid; gap: 10px; margin-top: 4px; }
.fg-route { display: grid; gap: 8px; padding: 12px; border: 2px solid var(--nb-line); border-radius: 6px; background: var(--nb-card); box-shadow: var(--nb-shadow-sm); }
.fg-route-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.fg-route-h .label { color: var(--acc); }
.fg-say { color: var(--text) !important; font-size: 12.5px !important; }
.fg-chain { display: grid; justify-items: start; gap: 2px; margin: 0; padding: 0; list-style: none; }
.fg-hop { padding-left: 14px; font-size: 10.5px; color: var(--dim); line-height: 1.2; }
.fg-askform { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; }
.app-capmap .fg-ask { resize: none; min-height: 52px; line-height: 1.45; }
.fg-you { color: var(--text-2) !important; }
.fg-ai { display: grid; gap: 6px; padding: 10px 12px; border-left: 2px solid var(--acc); background: var(--acc-a06); }
.fg-ai p { color: var(--text); }

/* kept from the Capability Map: domain + venture detail blocks */
.cm-hl { color: var(--acc) !important; font-weight: 600; }
.cm-back { align-self: flex-start; margin-bottom: 2px; }
.cm-list { display: grid; gap: 6px; }
.cm-li { display: grid; gap: 2px; text-align: left; padding: 9px 11px; border: 1px solid var(--line); border-radius: 7px; }
.cm-li:hover { border-color: var(--acc-lo); background: var(--acc-a06); }
.cm-li b { color: var(--acc); font-size: 12.5px; }
.cm-li span { font-size: 11px; }
.cm-meter { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: center; margin-top: 4px; font-size: 12px; }
.cm-meter b { color: var(--text); text-align: right; }
.cm-bar { grid-column: 1 / -1; height: 6px; background: repeating-linear-gradient(90deg, var(--acc-deep) 0 6px, transparent 6px 8px); position: relative; }
.cm-bar i { position: absolute; inset: 0 auto 0 0; background: repeating-linear-gradient(90deg, var(--acc) 0 6px, transparent 6px 8px); }
.cm-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cm-proofs { display: grid; gap: 6px; }
.cm-proof { display: grid; gap: 2px; text-align: left; padding: 9px 11px; border: 1px solid var(--line); border-radius: 7px; }
.cm-proof:hover { border-color: var(--acc-lo); background: var(--acc-a06); }
.cm-proof b { color: var(--text); font-size: 12px; }
.cm-proof span { font-size: 11px; line-height: 1.45; }
.cm-vm { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.cm-vm div { display: grid; gap: 2px; padding: 8px; border: 1px solid var(--line); border-radius: 6px; min-width: 0; }
.cm-vm b { font: 800 15px var(--font-dot); color: var(--acc); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Phones and narrow windows: one scrolling column ── */
@container (max-width: 760px) {
  .fg { display: block; overflow-y: auto; }
  .fg-main { display: block; }
  .fg-stage { height: clamp(300px, 56vh, 540px); }
  .fg-panel { display: block; border-left: 0; border-top: 1px solid var(--line); }
  .fg-body { overflow: visible; }
  .fg-hint { display: none; }
  .fg-selbar:not([hidden]) { display: inline-flex; }
  .fg-time { flex-basis: 100%; min-width: 0; }
  .fg-range { max-width: none; height: 36px; }
  .fg-tout { flex-basis: 100%; order: 3; }
  .fg-time { flex-wrap: wrap; }
  .app-capmap .fg-tchip, .app-capmap .fg-dom, .app-capmap .fg-play, .app-capmap .fg-zb, .app-capmap .fg-pane .btn--sm,
  .app-capmap .fg-pane .chip, .app-capmap .fg-in, .app-capmap .fg-selbar { min-height: 36px; }
  .app-capmap .fg-play, .app-capmap .fg-zb { min-width: 36px; }
  .fg-tabs .tab { padding: 12px 10px; }
  .fg-opt { padding: 10px 8px; }
}

/* ── Raised boxes (both modes; tokens: --nb-*) ── */
:root .cm-li, :root .cm-proof, :root .cm-vm div { border: 2px solid var(--nb-line); background: var(--nb-card); box-shadow: var(--nb-shadow-sm); }
:root .cm-li b { color: var(--text); }

/* ── Light mode: ink on paper ── */
[data-mode='light'] .app-capmap {
  background: var(--panel);
  --fg-milestone: var(--acc-hi); --fg-domain: var(--text); --fg-skill: var(--text-2); --fg-category: var(--muted); --fg-app: var(--dim);
  --fg-edge: var(--line-3); --fg-edge-hi: var(--nb-line); --fg-ring: var(--nb-line); --fg-tag: var(--nb-fill); --fg-grid: var(--line);
}
[data-mode='light'] .fg-bar { border-bottom: 2px solid var(--nb-line); background: var(--panel-2); }
[data-mode='light'] .fg-panel { border-left: 2px solid var(--nb-line); background: var(--panel-2); }
[data-mode='light'] .fg-quote, [data-mode='light'] .fg-ai { border-left: 4px solid var(--nb-line); background: var(--nb-tag-bg); }
[data-mode='light'] .fg-commit { border: 2px solid var(--nb-line); background: var(--nb-card); }
[data-mode='light'] .fg-opt[aria-selected='true'], [data-mode='light'] .fg-opt:hover { background: var(--nb-fill); color: var(--nb-fill-ink); }
[data-mode='light'] .fg-opt[aria-selected='true'] small { color: var(--nb-fill-ink); }
[data-mode='light'] .fg-route-h .label, [data-mode='light'] .fg-kind { color: var(--text); }
@container (max-width: 760px) { [data-mode='light'] .fg-panel { border-top: 2px solid var(--nb-line); } }
