body[data-view="graph"]{display:flex;flex-direction:column;height:100vh;height:100dvh;overflow:hidden}
body[data-view="graph"] .topbar{flex:none}.primary-nav{overflow-x:auto;overflow-y:hidden}
body[data-view="graph"] .shell{display:flex;flex:1;min-height:0;overflow:hidden}
body[data-view="graph"] main{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden;padding:0}
body[data-view="graph"] #graph-view{display:flex;flex-direction:column;flex:1;min-height:0;padding:0;border:0;border-radius:0;background:#fff}
body[data-view="graph"] .site-footer{flex:none;margin:0;padding:7px 20px;border-top:1px solid #e6e6ed;font-size:.75rem;line-height:1.5}
body[data-view="graph"] .reg-assistant-launcher,body[data-view="graph"] .reg-assistant-panel{display:none!important}
.graph-toolbar{display:flex;align-items:center;gap:18px 28px;padding:16px 24px;border-bottom:1px solid #dedee6;flex:none;flex-wrap:wrap}
.graph-title h1{font-size:1.4rem;margin:0;color:var(--hnu-indigo)}.graph-title p{font-size:.875rem;margin:4px 0 0;color:#707080}
.graph-search{position:relative;display:flex;gap:8px;margin-left:auto;width:min(560px,100%)}.graph-search input{flex:1;min-width:0;padding:10px 12px;border:1px solid #d5d5e1;border-radius:4px;font-size:1rem}.graph-search select{min-width:0;max-width:170px;padding:8px;border:1px solid #d5d5e1;border-radius:4px;background:#fff;color:#4a4a64;font-size:.875rem}
.graph-matches{position:absolute;top:100%;left:0;right:0;z-index:4;max-height:300px;overflow:auto;border:1px solid #d5d5e1;background:#fff;box-shadow:0 8px 24px #34346515}.graph-matches button{display:block;width:100%;border:0;border-bottom:1px solid #ededf2;padding:10px 12px;background:#fff;text-align:left;font-size:.9375rem;color:#343465}.graph-matches button:hover{background:#f7f2f5}.graph-matches small{display:block;font-size:.75rem;color:#747487;margin-top:3px}.graph-matches p{padding:12px}
.graph-body{display:grid;grid-template-columns:minmax(0,1fr) 330px;flex:1;min-height:0;overflow:hidden}
.graph-visual{position:relative;display:flex;flex-direction:column;min-height:0;min-width:0;background:radial-gradient(#e4e4eb .7px,transparent .7px);background-size:18px 18px}
/* Category toggles stay above the canvas, so they never cover documents. */
.graph-categories{display:flex;align-items:center;gap:8px 12px;padding:10px 16px 0;background:#fafafd;flex:none;flex-wrap:wrap}
.graph-categories-label{font-size:.875rem;color:#626279}
.graph-category-buttons{display:flex;gap:6px;flex-wrap:wrap}
.graph-category{display:inline-flex;align-items:center;gap:7px;min-height:36px;padding:6px 10px;border:1px solid #d5d5e1;border-radius:5px;background:#fff;color:#404057;font-size:.875rem;cursor:pointer}
/* Match DocumentGraphStyle.categories. Color and silhouette both convey kind. */
.graph-category,.graph-legend>span[class]{--graph-kind-color:#1d4ed8;--graph-kind-shape:polygon(0 0,100% 0,100% 100%,0 100%)}
.graph-category[data-graph-kind="explanation"],.graph-legend>span.graph-wiki{--graph-kind-color:#007f73;--graph-kind-shape:ellipse(50% 42% at 50% 50%)}
.graph-category[data-graph-kind="clause"],.graph-legend>span.graph-clause{--graph-kind-color:#a95208;--graph-kind-shape:polygon(25% 0,75% 0,100% 50%,75% 100%,25% 100%,0 50%)}
.graph-category[data-graph-kind="topic"],.graph-legend>span.graph-topic{--graph-kind-color:#7e22ce;--graph-kind-shape:polygon(50% 0,100% 50%,50% 100%,0 50%)}
.graph-category::before{content:'';width:14px;height:14px;background:var(--graph-kind-color);clip-path:var(--graph-kind-shape);flex:none}
.graph-category[aria-pressed="true"]{border-color:var(--graph-kind-color);background:#fff;font-weight:600;box-shadow:inset 0 -2px var(--graph-kind-color)}
.graph-category[aria-pressed="false"]{color:#737380;background:transparent;border-style:dashed}
.graph-category[aria-pressed="false"]::before{opacity:.35}
.graph-category[aria-pressed="false"]{text-decoration:line-through;text-decoration-thickness:1px}
.graph-category:hover{border-color:#777797}.graph-category:focus-visible{outline:2px solid var(--hnu-indigo,#343465);outline-offset:2px}
.graph-controls{display:flex;flex-wrap:wrap;gap:6px;padding:12px 16px;flex:none;background:#fafafd;border-bottom:1px solid #ededf2}
.graph-controls button,.graph-center{min-height:36px;border:1px solid #d7d7e3;border-radius:4px;background:#fff;padding:7px 10px;font-size:.875rem;color:#4c4c67}.graph-controls button:hover,.graph-center:hover{background:#f5f0f4}
.graph-canvas{flex:1;min-height:180px;position:relative;min-width:0}
.graph-status{margin:0;padding:6px 16px;font-size:.8125rem;color:#666679;background:#fff}.graph-legend{display:flex;gap:6px 16px;flex-wrap:wrap;padding:8px 16px 12px;flex:none;background:#fff;font-size:.75rem;color:#707083}.graph-legend>span{display:inline-flex;align-items:center;gap:5px}.graph-legend>span[class]::before{content:'';display:inline-block;flex:none;width:14px;height:14px;background:var(--graph-kind-color);clip-path:var(--graph-kind-shape)}
.graph-sheet-header,.graph-sheet-toggle,.graph-touch-hint{display:none}
.graph-inspector{overflow:auto;overscroll-behavior:contain;padding:22px 20px;border-left:1px solid #dedee6;background:#fff;min-height:0;font-size:.9375rem;line-height:1.75}
.graph-kind-label{font-size:.8125rem;color:#757589}.graph-inspector h2{font-size:1.125rem;margin:6px 0 14px;color:#343465;line-height:1.55;overflow-wrap:anywhere}.graph-inspector h3{font-size:.9375rem;margin:24px 0 10px}.graph-inspector p{overflow-wrap:anywhere}.graph-summary{margin:0 0 14px;color:#626279}.graph-meta{font-size:.8125rem;color:#77778b}.graph-recheck{padding:10px;background:#fff6e4;color:#80632f;font-size:.875rem}.graph-open{display:inline-block;padding:7px 11px;border:1px solid #c6c6d8;border-radius:4px;margin:4px 8px 8px 0;font-size:.875rem}.graph-center{margin:4px 0 8px}.graph-neighbor{display:block;width:100%;padding:10px 0;border:0;border-bottom:1px solid #ebebf0;text-align:left;background:transparent;color:#343465;font-size:.9375rem;line-height:1.65;overflow-wrap:anywhere}.graph-neighbor small{display:block;color:#77778b;font-size:.75rem}.graph-neighbor:hover{color:#a41e44}.graph-inspector blockquote{margin:18px 0;padding:12px;border-left:2px solid #b6b6cb;background:#f8f8fb;white-space:pre-wrap;font-size:.875rem;color:#56566d}
@media(max-width:850px){.graph-toolbar{padding:12px 16px;gap:10px}.graph-search{margin-left:0;flex-basis:100%;width:100%}.graph-body{grid-template-columns:minmax(0,1fr) 280px}.graph-inspector{padding:16px}.graph-title p{display:none}}
@media(max-width:650px), (max-width:950px) and (max-height:500px){
  .graph-toolbar{padding:8px 12px;gap:0}.graph-title{display:none}.graph-search{flex-basis:auto;width:100%;gap:6px}.graph-search input{min-height:44px;padding:8px 10px}.graph-search select{max-width:110px;min-height:44px}
  .graph-body{position:relative;display:flex;overflow:hidden}.graph-visual{flex:1;width:100%}
  .graph-categories{padding:4px 10px 0;flex-wrap:nowrap;gap:0}.graph-categories-label{display:none}.graph-category-buttons{width:100%;flex-wrap:nowrap;overflow-x:auto;padding:2px;gap:5px;scrollbar-width:none}.graph-category{min-height:44px;padding:6px 9px;white-space:nowrap;flex:none}
  .graph-controls{flex-wrap:nowrap;overflow-x:auto;padding:6px 10px;gap:5px;scrollbar-width:none}.graph-controls button{min-height:44px;padding:6px 9px;white-space:nowrap;flex:none}
  .graph-canvas{min-height:0}.graph-status{padding:5px 12px;font-size:.75rem;flex:none}.graph-legend{display:none}.graph-touch-hint{display:block;flex:none;margin:0;padding:0 12px 6px;color:#707083;font-size:.75rem;background:#fff}
  .graph-sheet-toggle:not([hidden]){display:block;position:absolute;z-index:2;right:12px;bottom:66px;min-height:44px;padding:8px 14px;border:1px solid #c8c8dc;border-radius:22px;background:#fff;color:#343465;font-size:.875rem;box-shadow:0 3px 14px #34346520}
  .graph-inspector{display:none;position:absolute;z-index:5;bottom:0;left:0;right:0;max-height:60%;padding:0;border:1px solid #d5d5e1;border-bottom:0;border-radius:16px 16px 0 0;background:#fff;box-shadow:0 -8px 28px #3434651a;overflow:hidden;font-size:1rem}
  .graph-inspector.is-open{display:flex;flex-direction:column}.graph-sheet-header{display:flex;align-items:center;justify-content:space-between;flex:none;padding:8px 14px;border-bottom:1px solid #ededf2;font-size:.875rem;color:#626279}.graph-sheet-header button{min-height:44px;padding:8px 12px;border:1px solid #d5d5e1;border-radius:5px;background:#fff;color:#343465;font-size:.875rem}
  #graph-inspector-content{padding:12px 18px;overflow:auto;overscroll-behavior:contain;min-height:0}.graph-inspector h2{font-size:1.125rem}.graph-neighbor{min-height:44px}.graph-center,.graph-open{min-height:44px}
  body[data-view="graph"] .site-footer{padding:3px 12px}body[data-view="graph"] .site-footer>span:first-child{display:none}
}
@media(max-width:950px) and (max-height:500px){
  body[data-view="graph"] .topbar{height:44px;grid-template-columns:minmax(0,1fr);grid-template-rows:44px;padding:0 10px}
  body[data-view="graph"] .brand,body[data-view="graph"] .topbar-right{display:none}body[data-view="graph"] .primary-nav{grid-row:1;grid-column:1;margin:0;padding:0;border:0}
  body[data-view="graph"] #graph-view{position:relative}.graph-toolbar{position:absolute;right:8px;top:0;width:42%;z-index:3;padding:4px;background:#fafafd}.graph-search select{display:none}
  .graph-categories{width:55%;padding-top:4px}.graph-controls{padding-top:4px;padding-bottom:4px}.graph-inspector{max-height:75%}.graph-touch-hint{display:none}.graph-sheet-toggle:not([hidden]){bottom:40px}
}
@media print{body[data-view="graph"]{height:auto;overflow:visible}body[data-view="graph"] .shell,body[data-view="graph"] main,body[data-view="graph"] #graph-view,.graph-body{display:block;height:auto;overflow:visible}.graph-controls,.graph-search,.graph-sheet-toggle,.graph-sheet-header,.graph-touch-hint{display:none}.graph-canvas{height:500px}.graph-inspector{overflow:visible}}

.document-graph-entry{float:right;font-size:.8125rem}.weki-graph-link{display:inline-flex;align-items:center;min-height:44px;padding:8px 12px;border:1px solid #d8d8e3;border-radius:4px;font-size:.875rem;text-decoration:none}

.graph-topic-article{display:block;padding:12px 0;border-bottom:1px solid #ebebf0;color:#343465;font-size:.9375rem;line-height:1.65;overflow-wrap:anywhere;text-decoration:underline;text-underline-offset:3px}.graph-topic-article:hover{color:#a41e44}
