:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #0f172a;
  background: #eef2f7;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --panel: rgba(255,255,255,.96);
  --border: #e2e8f0;
  --muted: #64748b;
  --brand: #2563eb;
  --domain: #1d4ed8;
  --capability: #7c3aed;
  --concept: #0891b2;
  --technique: #d97706;
  --tool: #475569;
  --pattern: #be123c;
  --artifact: #059669;
}
* { box-sizing: border-box; }
html, body, #app { width: 100%; height: 100%; margin: 0; overflow: hidden; }
button, input, select { font: inherit; }
button { color: inherit; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em; }
.is-hidden { display: none !important; }
.app-shell { display: grid; grid-template-columns: 250px minmax(0,1fr) 326px; height: 100%; }
.sidebar, .inspector { background: var(--panel); backdrop-filter: blur(16px); z-index: 5; }
.sidebar { border-right: 1px solid var(--border); padding: 18px 14px; display: flex; flex-direction: column; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px 22px; }
.brand__mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: #0f172a; color: #fff; font-weight: 850; box-shadow: 0 8px 22px rgba(15,23,42,.18); }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 14px; letter-spacing: -.015em; }
.brand small { color: var(--muted); font-size: 10px; margin-top: 2px; }
.sidebar-section { margin-bottom: 20px; }
.sidebar-section h2 { color: #475569; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; padding: 0 8px 8px; margin: 0; }
.section-heading { display: flex; justify-content: space-between; align-items: center; }
.section-heading output { color: #1d4ed8; font-size: 11px; font-weight: 800; padding: 0 8px 8px; }
.section-help { margin: 8px 8px 0; color: #94a3b8; font-size: 9px; line-height: 1.45; }
.nav-item { width: 100%; border: 0; background: transparent; border-radius: 9px; padding: 8px; cursor: pointer; display: flex; align-items: center; justify-content: space-between; text-align: left; color: #475569; font-size: 11px; }
.nav-item:hover { background: #f1f5f9; color: #0f172a; }
.nav-item.is-active { background: #e8efff; color: #1d4ed8; font-weight: 700; }
.nav-item small { color: #94a3b8; }
.segmented-list { display: grid; gap: 3px; }
.field-label { display: block; color: #64748b; font-size: 9px; margin: 0 8px 6px; }
.select { width: calc(100% - 16px); margin: 0 8px; border: 1px solid #dbe3ee; border-radius: 8px; padding: 8px; background: #fff; color: #334155; font-size: 10px; outline: none; }
.select:focus { border-color: #93b4f7; box-shadow: 0 0 0 3px rgba(37,99,235,.08); }
.range { width: calc(100% - 16px); margin: 0 8px; accent-color: var(--brand); }
.toggle-row { display: flex; gap: 7px; align-items: center; margin: 10px 8px 0; color: #64748b; font-size: 10px; }
.toggle-row input { accent-color: var(--brand); }
.reset-button { margin-top: auto; display: flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--border); background: #fff; border-radius: 9px; padding: 9px; cursor: pointer; color: #475569; font-size: 11px; }
.reset-button:hover { border-color: #cbd5e1; background: #f8fafc; }
.workspace { min-width: 0; display: grid; grid-template-rows: 64px minmax(0,1fr); }
.toolbar { background: rgba(248,250,252,.94); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 9px 14px; z-index: 4; }
.toolbar__left { min-width: 0; display: flex; align-items: center; gap: 14px; flex: 1; }
.search-box { width: min(440px,52%); min-width: 260px; height: 39px; border: 1px solid #dbe3ee; background: #fff; border-radius: 10px; display: flex; align-items: center; gap: 8px; padding: 0 10px; box-shadow: 0 1px 2px rgba(15,23,42,.03); color: #64748b; }
.search-box:focus-within { border-color: #93b4f7; box-shadow: 0 0 0 3px rgba(37,99,235,.08); }
.search-box input { flex: 1; border: 0; outline: none; min-width: 0; color: #0f172a; font-size: 12px; }
.search-box input::placeholder { color: #94a3b8; }
.search-box kbd { font-family: inherit; font-size: 8px; border: 1px solid #e2e8f0; border-radius: 5px; padding: 3px 5px; color: #64748b; background: #f8fafc; }
.view-title, .view-description { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.view-title { font-size: 12px; color: #0f172a; }
.view-description { max-width: 500px; font-size: 9px; color: #64748b; margin-top: 2px; }
.toolbar__stats { font-size: 10px; color: var(--muted); white-space: nowrap; }
.canvas { min-height: 0; position: relative; overflow: hidden; background-color: #f8fafc; background-image: radial-gradient(#cbd5e1 1px, transparent 1px); background-size: 22px 22px; cursor: grab; touch-action: none; }
.canvas.is-panning { cursor: grabbing; }
.scene { position: absolute; width: 2800px; height: 12000px; transform-origin: 0 0; will-change: transform; }
.edges-layer, .nodes-layer { position: absolute; inset: 0; width: 2800px; min-height: 12000px; overflow: visible; }
.edge { fill: none; stroke-width: 1.55; opacity: .58; vector-effect: non-scaling-stroke; }
.edge--contains { stroke: #94a3b8; stroke-width: 1.25; }
.edge--requires { stroke: #f59e0b; }
.edge--relates-to { stroke: #8b5cf6; stroke-dasharray: 5 4; }
.edge--supports { stroke: #0ea5e9; stroke-dasharray: 3 4; }
.edge--implemented-by { stroke: #475569; stroke-dasharray: 6 3; }
.edge--applied-in { stroke: #10b981; stroke-dasharray: 8 4; animation: edgeFlow 1.4s linear infinite; }
@keyframes edgeFlow { to { stroke-dashoffset: -24; } }
.knowledge-node { position: absolute; width: 232px; min-height: 108px; border: 1px solid #dbe3ee; border-left: 4px solid var(--concept); background: rgba(255,255,255,.98); border-radius: 12px; padding: 10px 11px; box-shadow: 0 5px 18px rgba(15,23,42,.07); cursor: pointer; user-select: none; transition: opacity .15s, box-shadow .15s, border-color .15s, transform .08s; }
.knowledge-node:hover { box-shadow: 0 9px 25px rgba(15,23,42,.11); }
.knowledge-node:focus-visible { outline: 3px solid rgba(37,99,235,.22); outline-offset: 2px; }
.knowledge-node.is-selected { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37,99,235,.12),0 10px 28px rgba(15,23,42,.11); z-index: 2; }
.knowledge-node.is-dimmed { opacity: .2; }
.knowledge-node.is-required { background: linear-gradient(135deg,#fff,#f9fbff); }
.knowledge-node.has-gap { box-shadow: 0 0 0 2px rgba(225,29,72,.12),0 5px 18px rgba(15,23,42,.07); }
.knowledge-node--domain { width: 252px; min-height: 118px; border-left-color: var(--domain); background: linear-gradient(135deg,#fff,#eef4ff); }
.knowledge-node--capability { border-left-color: var(--capability); background: linear-gradient(135deg,#fff,#f7f3ff); }
.knowledge-node--concept { border-left-color: var(--concept); }
.knowledge-node--technique { border-left-color: var(--technique); }
.knowledge-node--tool { border-left-color: var(--tool); }
.knowledge-node--pattern { border-left-color: var(--pattern); }
.knowledge-node--artifact { width: 260px; min-height: 112px; border-left-color: var(--artifact); background: linear-gradient(135deg,#fff,#effcf6); }
.knowledge-node__head { display: flex; align-items: center; gap: 6px; }
.node-icon { color: #475569; font-size: 12px; }
.node-kind { color: #64748b; text-transform: uppercase; letter-spacing: .08em; font-size: 7px; font-weight: 800; white-space: nowrap; }
.knowledge-node__head .mastery-badge { margin-left: auto; }
.knowledge-node__title-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 7px; }
.knowledge-node strong { font-size: 12px; letter-spacing: -.012em; line-height: 1.25; }
.knowledge-node p { margin: 5px 0 0; color: #64748b; font-size: 9px; line-height: 1.42; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.knowledge-node__footer { display: flex; align-items: flex-end; justify-content: space-between; gap: 6px; margin-top: 8px; }
.knowledge-node__tags { min-width: 0; display: flex; gap: 4px; overflow: hidden; }
.knowledge-node__tags span { font-size: 7px; color: #64748b; background: #f1f5f9; border-radius: 4px; padding: 2px 4px; white-space: nowrap; }
.node-toggle { width: 23px; height: 23px; display: grid; place-items: center; border: 0; border-radius: 7px; background: #edf3ff; cursor: pointer; color: #1d4ed8; font-size: 16px; line-height: 1; }
.node-toggle:hover { background: #dbe8ff; }
.mastery-badge, .expectation-badge, .kind-badge, .depth-badge { display: inline-flex; align-items: center; border-radius: 999px; white-space: nowrap; }
.mastery-badge { padding: 3px 6px; font-size: 7px; font-weight: 800; background: #eef2ff; color: #4338ca; }
.mastery-0 { background: #f1f5f9; color: #64748b; }
.mastery-1 { background: #f8fafc; color: #475569; }
.mastery-2 { background: #ecfeff; color: #0e7490; }
.mastery-3 { background: #eff6ff; color: #1d4ed8; }
.mastery-4 { background: #f5f3ff; color: #6d28d9; }
.mastery-5 { background: #fff7ed; color: #c2410c; }
.mastery-6 { background: #ecfdf5; color: #047857; }
.expectation-badge { flex: 0 0 auto; padding: 3px 5px; font-size: 7px; font-weight: 800; color: #be123c; background: #fff1f2; }
.canvas-controls { position: absolute; right: 14px; bottom: 14px; display: flex; flex-direction: column; z-index: 3; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; background: #fff; box-shadow: 0 4px 16px rgba(15,23,42,.08); }
.canvas-controls button { width: 34px; height: 32px; border: 0; border-bottom: 1px solid var(--border); background: #fff; cursor: pointer; color: #475569; font-weight: 700; }
.canvas-controls button:last-child { border-bottom: 0; }
.canvas-controls button:hover { background: #f1f5f9; }
.canvas-hint { position: absolute; top: 12px; left: 14px; z-index: 3; border: 1px solid var(--border); background: rgba(255,255,255,.88); color: #94a3b8; border-radius: 7px; padding: 5px 8px; font-size: 8px; backdrop-filter: blur(8px); pointer-events: none; }
.canvas-legend { position: absolute; left: 14px; bottom: 14px; z-index: 3; display: flex; flex-wrap: wrap; gap: 12px; max-width: calc(100% - 90px); background: rgba(255,255,255,.92); border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; font-size: 8px; color: #64748b; backdrop-filter: blur(8px); }
.canvas-legend span { display: flex; align-items: center; gap: 5px; }
.legend-line { width: 16px; height: 0; display: inline-block; border-top: 2px solid; }
.legend-line--contains { border-color: #94a3b8; }
.legend-line--requires { border-color: #f59e0b; }
.legend-line--applied { border-color: #10b981; border-top-style: dashed; }
.legend-chip { width: 8px; height: 8px; display: inline-block; border-radius: 999px; }
.legend-chip--current { background: #6366f1; }
.legend-chip--expected { background: #f43f5e; }
.legend-chip--gap { background: #fff; border: 2px solid #f43f5e; }
.inspector { border-left: 1px solid var(--border); padding: 25px 21px; overflow-y: auto; position: relative; }
.inspector-empty { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: #94a3b8; }
.inspector-empty__icon { font-size: 32px; font-weight: 200; }
.inspector-empty strong { color: #475569; margin-top: 10px; font-size: 13px; }
.inspector-empty p { max-width: 225px; font-size: 10px; line-height: 1.5; }
.inspector__close { position: absolute; right: 14px; top: 12px; border: 0; background: transparent; cursor: pointer; color: #64748b; font-size: 23px; line-height: 1; }
.eyebrow { max-width: 255px; color: #64748b; font-size: 8px; font-weight: 750; text-transform: uppercase; letter-spacing: .07em; line-height: 1.5; }
.inspector h1 { margin: 8px 28px 8px 0; font-size: 21px; line-height: 1.15; letter-spacing: -.025em; }
.badge-row { display: flex; flex-wrap: wrap; gap: 6px; }
.kind-badge, .depth-badge { padding: 4px 7px; font-size: 8px; color: #475569; background: #f1f5f9; }
.inspector__summary { color: #475569; font-size: 11px; line-height: 1.62; margin: 17px 0 22px; }
.inspector section { border-top: 1px solid #edf1f6; padding-top: 16px; margin-top: 16px; }
.inspector section h2 { margin: 0 0 10px; font-size: 10px; text-transform: uppercase; letter-spacing: .07em; color: #64748b; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-list span { background: #edf3ff; color: #315eaa; border-radius: 6px; padding: 5px 7px; font-size: 9px; }
.mastery-card, .career-card { border: 1px solid #e2e8f0; border-radius: 10px; padding: 10px; background: #f8fafc; }
.mastery-card strong, .career-card strong { font-size: 10px; }
.mastery-card p, .career-card p { margin: 6px 0; color: #64748b; font-size: 9px; line-height: 1.45; }
.mastery-card small, .career-card small { color: #94a3b8; font-size: 8px; }
.career-card--gap { border-color: #fecdd3; background: #fff7f8; }
.career-card--gap small { color: #be123c; }
.career-matrix { display: grid; gap: 7px; }
.matrix-row { display: grid; grid-template-columns: 68px 34px 1fr; gap: 6px; align-items: start; padding: 7px; border-radius: 8px; background: #f8fafc; }
.matrix-row span { color: #475569; font-size: 9px; font-weight: 700; }
.matrix-row strong { font-size: 9px; color: #1d4ed8; }
.matrix-row small { color: #64748b; font-size: 8px; line-height: 1.35; }
.relation-list, .evidence-list { display: grid; gap: 6px; }
.relation-list button, .evidence-list button { border: 1px solid #e7edf4; background: #fff; border-radius: 9px; padding: 8px 9px; text-align: left; cursor: pointer; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 3px 7px; align-items: center; }
.relation-list button:hover, .evidence-list button:hover { border-color: #b9c9e5; background: #f8faff; }
.relation-list button small { grid-column: 1/-1; font-size: 7px; text-transform: uppercase; letter-spacing: .07em; color: #94a3b8; }
.relation-list button strong, .evidence-list button strong { font-size: 10px; }
.relation-list button > span, .evidence-list button > span { color: #94a3b8; }
.external-link { display: inline-block; margin-top: 10px; color: #2563eb; text-decoration: none; font-size: 10px; }
.muted { color: #94a3b8; font-size: 10px; line-height: 1.5; }
.fatal-error { max-width: 680px; margin: 12vh auto; padding: 28px; background: #fff; border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 18px 50px rgba(15,23,42,.1); }
.fatal-error h1 { font-size: 22px; }
.fatal-error p { color: #475569; line-height: 1.6; }
@media (max-width: 1180px) {
  .app-shell { grid-template-columns: 220px minmax(0,1fr) 286px; }
  .sidebar { padding-left: 9px; padding-right: 9px; }
  .inspector { padding-left: 16px; padding-right: 16px; }
  .view-description { max-width: 300px; }
}
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 188px minmax(0,1fr); }
  .inspector { position: fixed; right: 12px; bottom: 12px; top: 76px; width: min(330px,calc(100vw - 212px)); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 18px 50px rgba(15,23,42,.18); }
  .inspector:has(.inspector-empty) { display: none; }
  .toolbar__left > div { display: none; }
  .search-box { width: 100%; min-width: 0; }
  .canvas-hint { display: none; }
}
