.wiki-entry { margin-top: 18px; padding: 18px; border: 1px solid #c6ddd0; border-radius: 12px; background: #f5faf7; color: #19372e; }
.wiki-entry h3 { font-size: 17px; margin: 0 0 8px; }
.wiki-entry p { font-size: 13px; color: #60756c; margin: 6px 0 12px; line-height: 1.7; }
.wiki-entry button, .wiki-panel button { font: inherit; font-size: 13px; color: #08765b; border: 1px solid #c6ddd0; border-radius: 8px; background: #fff; padding: 8px 12px; cursor: pointer; }
.wiki-panel button:disabled { opacity: .5; cursor: wait; }
.wiki-entry button:hover, .wiki-panel button:hover { background: #eaf5ef; }
.wiki-panel { margin: auto; width: min(900px, calc(100vw - 24px)); max-width: 100vw; max-height: calc(100dvh - 24px); padding: 22px; border: 1px solid #c6ddd0; border-radius: 16px; color: #19372e; background: #fafcfb; }
.wiki-panel::backdrop { background: #173d2940; }
.wiki-panel-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wiki-panel h2 { font-size: 20px; margin: 0; }
.wiki-panel h3 { font-size: 16px; margin: 12px 0; }
.wiki-status { color: #60756c; font-size: 13px; line-height: 1.7; margin: 10px 0; }
.wiki-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.wiki-workspace { display: grid; grid-template-columns: 185px minmax(0,1fr); border-top: 1px solid #dce9e1; margin-top: 12px; }
.wiki-navigation { border-right: 1px solid #dce9e1; padding: 12px 12px 12px 0; display: flex; flex-direction: column; gap: 6px; max-height: 55vh; overflow: auto; }
.wiki-navigation button { text-align: left; width: 100%; }
.wiki-navigation button[aria-current=true] { background: #e5f2e9; color: #075840; border-color: #8bbb9f; }
.wiki-content { padding: 12px 0 12px 20px; min-width: 0; max-height: 55vh; overflow: auto; }
.wiki-content .answer-body { font-size: 14px; line-height: 1.8; overflow-wrap: anywhere; }
.wiki-content pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.wiki-content label { display: block; margin: 10px 0 5px; font-size: 13px; }
.wiki-content textarea, .wiki-content input, .wiki-content select, .wiki-search input { box-sizing: border-box; width: 100%; color: #19372e; padding: 9px; font: inherit; border: 1px solid #c6ddd0; border-radius: 8px; background: #fff; }
.wiki-content textarea { min-height: 170px; resize: vertical; }
.wiki-content input[type=checkbox] { width: auto; }
.wiki-search { display: flex; gap: 8px; }
.wiki-search input { flex: 1; min-width: 0; }
.wiki-badge { display: inline-block; font-size: 11px; color: #36624d; padding: 3px 7px; border-radius: 4px; background: #e7f2eb; margin: 0 4px 8px 0; }
.wiki-proposal { border: 1px solid #dce9e1; border-radius: 9px; padding: 12px; margin: 10px 0; background: #fff; }
.wiki-proposal p { font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; margin: 6px 0; }
.wiki-result { border-bottom: 1px solid #dce9e1; padding: 10px 0; font-size: 13px; }
.wiki-synthesis { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; color: #60756c; }
.wiki-model-state { padding: 4px 8px; border-radius: 6px; background: #e7f2eb; overflow-wrap: anywhere; }
.wiki-current { font-size: 13px; line-height: 1.6; color: #60756c; overflow-wrap: anywhere; }
.wiki-panel, .wiki-panel * { box-sizing: border-box; }
@media(max-width:650px) {
  .wiki-panel { padding: 14px; margin: auto; width: calc(100vw - 12px); max-height: calc(100dvh - 12px); border-radius: 10px; }
  .wiki-workspace { grid-template-columns: minmax(0,1fr); }
  .wiki-navigation { border: 0; flex-direction: row; max-height: 100px; padding: 10px 0; overflow: auto; }
  .wiki-navigation button { white-space: nowrap; width: auto; }
  .wiki-content { padding: 8px 0; max-height: 52vh; }
}
.wiki-graph { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.wiki-graph svg { width: 100%; height: auto; max-height: 46vh; background: #fff; border: 1px solid #dce9e1; border-radius: 10px; }
.wiki-graph-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: #60756c; }
.wiki-graph-legend span { display: inline-flex; align-items: center; gap: 5px; }
.wiki-graph-legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.wiki-graph-attrs { border-top: 1px dashed #dce9e1; padding-top: 8px; margin-top: 4px; }
.wiki-graph-attrs-title { font-size: 12px; color: #60756c; margin-bottom: 6px; }
.wiki-graph-attrs ul { list-style: none; margin: 0; padding: 0; max-height: 240px; overflow: auto; }
.wiki-graph-attrs li { display: flex; gap: 8px; align-items: flex-start; padding: 5px 0; border-bottom: 1px solid #eef4f0; font-size: 13px; line-height: 1.6; }
.wiki-graph-attrs li:last-child { border-bottom: 0; }
.wiki-graph-attrs li .wiki-badge { margin: 2px 0 0; flex: none; }
.wiki-graph-attr-val { min-width: 0; overflow-wrap: anywhere; color: #19372e; }

.wiki-panel { width: min(1160px, calc(100vw - 32px)); padding: 24px; overscroll-behavior: contain; }
.wiki-panel button { min-height: 44px; }
.wiki-panel button:focus-visible, .graph-controls select:focus-visible { outline: 2px solid #28765e; outline-offset: 3px; }
.wiki-workspace { grid-template-columns: 180px minmax(0,1fr); }
.wiki-content { max-height: 58dvh; }
.wiki-inline-link { display: inline; padding: 2px 6px !important; text-decoration: underline; }
.wiki-sync-detail { font-size: 12px; color: #60756c; }
.wiki-sync-detail summary { cursor: pointer; min-height: 28px; }
.profile-graph-view { min-width: 0; }
.graph-controls { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.graph-controls select { min-height: 44px; max-width: 100%; padding: 8px; border: 1px solid #c6ddd0; border-radius: 8px; color: #19372e; background: #fff; }
.graph-controls .wiki-status { margin-right: auto; }
.graph-help { color: #60756c; font-size: 12px; margin: 10px 0; }
.graph-stage { display: grid; grid-template-columns: minmax(0,1fr) 220px; gap: 16px; align-items: start; }
.graph-canvas { min-width: 0; max-height: 450px; overflow: auto; border: 1px solid #dce9e1; border-radius: 10px; background: #f4f8f5; overscroll-behavior: contain; }
.graph-canvas svg { display: block; min-width: 640px; height: auto; }
.graph-detail { min-width: 0; overflow-wrap: anywhere; font-size: 13px; padding: 12px 0; }
.graph-detail h4 { font-size: 16px; margin: 0 0 15px; }
.graph-selected-title { font-size: 16px; font-weight: 600; margin: 0 0 15px; }
.graph-detail h5 { font-size: 13px; margin: 16px 0 8px; }
.graph-detail dl { display: grid; grid-template-columns: 76px minmax(0,1fr); gap: 8px; }
.graph-detail dt { color: #60756c; }.graph-detail dd { margin: 0; }
.graph-detail .graph-relation { display: block; width: 100%; text-align: left; margin: 6px 0; }
.graph-open { width: 100%; margin-top: 12px; background: #e6f2ea !important; }
.graph-node-list { display: flex; flex-wrap: wrap; gap: 6px; max-height: 160px; overflow: auto; margin-top: 14px; border-top: 1px solid #dce9e1; padding-top: 14px; }
.graph-node-list button { max-width: 100%; overflow-wrap: anywhere; text-align: left; }
.graph-node-list button[aria-pressed=true] { background: #e6f2ea; border-color: #28765e; }
.wiki-entry .graph-stage { grid-template-columns: minmax(0,1fr) 250px; }
.wiki-entry .graph-node-list button { min-height: 44px; }
@media(max-width:850px) {
 .graph-stage, .wiki-entry .graph-stage { grid-template-columns: minmax(0,1fr); }
 .graph-detail { border-top: 1px solid #dce9e1; }
 .graph-canvas { max-height: 340px; }
 .graph-canvas svg { min-width: 0; }
}
@media(max-width:650px) {
 .wiki-panel { width: calc(100vw - 12px); padding: 14px; max-height: calc(100dvh - 12px); }
 .wiki-workspace { grid-template-columns: minmax(0,1fr); }
 .wiki-content { max-height: 52dvh; }
 .wiki-entry { padding: 14px; }
 .wiki-search input { font-size: 16px; }
}
