* {
  box-sizing:border-box
}

[hidden] {
  display:none!important
}

:root {
  --ink:var(--patient-ink);
  --muted:var(--patient-muted);
  --line:var(--patient-border);
  --accent:var(--patient-rose);
  --accent-soft:var(--patient-rose-soft);
  --paper:#fff;
  --bg:var(--patient-bg)
}

html,body {
  margin:0;
  height:100%;
  color:var(--ink);
  background:var(--bg);
  font-family:var(--patient-font);
  font-size:18px;
  line-height:1.65
}

button,input,select {
  font:inherit
}

button,a,input,select {
  touch-action:manipulation
}

button {
  cursor:pointer
}

button:disabled {
  opacity:.6;
  cursor:wait
}

button,a {
  color:inherit
}

a {
  text-decoration:none
}

h1,h2,h3,p {
  margin:0
}

h1 {
  font-size:28px;
  font-weight:650;
  letter-spacing:.02em
}

h2 {
  font-size:21px;
  font-weight:650
}

h3 {
  font-size:18px
}

code,pre {
  font-family:Consolas,"Microsoft YaHei",monospace;
  font-size:14px
}

pre {
  white-space:pre-wrap;
  overflow-wrap:anywhere;
  line-height:1.8
}

button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,.point:focus-visible {
  outline:3px solid #b8828b;
  outline-offset:3px
}

button,input,select {
  border:1px solid var(--line);
  border-radius:11px;
  background:#fff;
  padding:9px 13px;
  font-size:16px;
  min-height:44px
}

input {
  min-width:0
}

button:hover {
  background:#f8f0ef;
  border-color:#caa8ad
}

select {
  color:var(--ink)
}

.sr-only {
  position:absolute!important;
  width:1px!important;
  height:1px!important;
  padding:0!important;
  margin:-1px!important;
  overflow:hidden!important;
  clip:rect(0,0,0,0)!important;
  white-space:nowrap!important;
  border:0!important
}

.muted,.caption {
  color:var(--muted)
}

.caption,.eyebrow {
  font-size:14px
}

.eyebrow {
  color:var(--accent);
  font-weight:650
}

.site-header {
  height:78px;
  padding:0 32px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
  background:#fff;
  border-bottom:1px solid var(--line)
}

.brand {
  display:flex;
  align-items:center;
  gap:12px
}

.brand>span {
  display:flex;
  flex-direction:column;
  gap:2px
}

.brand strong {
  font-size:21px
}

.brand small {
  font-size:14px;
  color:var(--muted)
}

.top-actions {
  display:flex;
  align-items:center;
  gap:20px;
  font-size:16px
}

.top-link {
  padding:9px 0
}

.current-page {
  color:var(--accent);
  font-weight:650;
  border-bottom:2px solid var(--accent);
  padding:9px 0
}

.page-shell {
  height:calc(100dvh - 78px);
  padding:16px 28px 12px;
  max-width:1840px;
  margin:auto;
  display:flex;
  flex-direction:column;
  gap:10px;
  min-height:0
}

.page-heading {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:24px;
  flex-shrink:0
}

.page-heading p {
  font-size:16px;
  color:var(--muted)
}

.local-tag {
  font-size:14px;
  color:var(--muted);
  display:flex;
  align-items:center;
  gap:8px
}

.local-tag code {
  display:none
}

.status-dot {
  width:8px;
  height:8px;
  background:var(--patient-sage);
  border-radius:50%;
  box-shadow:0 0 0 4px var(--patient-sage-soft)
}

.overview-strip {
  display:grid;
  grid-template-columns:repeat(4,1fr);
  border:1px solid var(--line);
  background:#fff;
  border-radius:14px;
  flex-shrink:0
}

.metric {
  display:flex;
  align-items:center;
  justify-content:center;
  gap:11px;
  min-height:54px;
  padding:6px 12px;
  border-right:1px solid var(--line)
}

.metric:last-child {
  border-right:0
}

.metric>span {
  font-size:16px;
  color:var(--muted)
}

.metric strong {
  font-size:27px;
  line-height:1.3;
  font-weight:600;
  font-variant-numeric:tabular-nums
}

.metric small {
  font-size:14px;
  color:var(--muted)
}

.tabs {
  display:flex;
  gap:25px;
  border-bottom:1px solid var(--line);
  flex-shrink:0
}

.tab {
  padding:9px 4px;
  border:0;
  border-radius:0;
  background:transparent;
  color:var(--muted);
  min-height:45px;
  position:relative
}

.tab>span {
  display:none
}

.tab.active {
  color:var(--accent);
  font-weight:650
}

.tab.active:after {
  content:"";
  position:absolute;
  height:3px;
  bottom:-1px;
  left:0;
  right:0;
  border-radius:3px;
  background:var(--accent)
}

.tab:hover {
  background:transparent
}

.panel {
  display:flex;
  flex-direction:column;
  flex:1;
  gap:10px;
  min-height:0;
  overflow:hidden
}

.graph-controls {
  display:flex;
  align-items:center;
  gap:10px;
  flex-shrink:0
}

.graph-controls>label:first-child {
  font-size:16px
}

.graph-controls select {
  width:178px
}

.search-field {
  display:flex;
  align-items:center;
  gap:8px;
  flex:1;
  max-width:540px;
  min-width:160px;
  border:1px solid var(--line);
  border-radius:11px;
  background:#fff;
  padding-left:13px
}

.search-field>span {
  color:var(--muted);
  font-size:27px;
  line-height:1
}

.search-field input {
  width:100%;
  border:0;
  background:transparent
}

.reading-tip {
  display:flex;
  align-items:center;
  gap:10px;
  padding:8px 14px;
  background:#f4eae6;
  border-radius:11px;
  flex-shrink:0;
  font-size:15px;
  line-height:1.6;
  color:#705649
}

.tip-mark {
  display:grid;
  place-items:center;
  flex:0 0 23px;
  width:23px;
  height:23px;
  border:1px solid #9e7069;
  border-radius:50%;
  font-family:Georgia,serif;
  font-weight:bold
}

.reading-tip strong {
  font-weight:650
}

.graph-workspace {
  display:grid;
  grid-template-columns:160px minmax(250px,1fr) 370px;
  gap:12px;
  min-height:0;
  flex:1
}

.category-panel,.entity-panel,.detail,.surface {
  border:1px solid var(--line);
  border-radius:16px;
  background:#fff;
  min-width:0;
  box-shadow:var(--patient-shadow)
}

.category-panel {
  display:flex;
  flex-direction:column;
  padding:15px 10px;
  overflow:auto
}

.category-panel h2 {
  font-size:16px;
  color:var(--muted);
  padding:0 10px 11px
}

.category-button {
  display:flex;
  align-items:center;
  width:100%;
  justify-content:space-between;
  gap:8px;
  border:0;
  border-radius:10px;
  padding:9px 11px;
  text-align:left;
  min-height:43px;
  font-size:16px;
  margin-bottom:4px;
  background:transparent
}

.category-button strong {
  font-size:14px;
  font-weight:500;
  color:var(--muted);
  font-variant-numeric:tabular-nums
}

.category-button.active {
  background:var(--accent-soft);
  color:var(--accent);
  font-weight:650
}

.category-button.active strong {
  color:var(--accent)
}

.category-footer {
  margin-top:auto;
  text-align:center;
  padding:15px 0 2px;
  font-size:14px;
  color:var(--muted)
}

.category-footer img {
  opacity:.6
}

.entity-panel {
  display:flex;
  flex-direction:column;
  overflow:hidden;
  position:relative
}

.entity-panel-head {
  padding:14px 18px 12px;
  border-bottom:1px solid var(--line);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-shrink:0;
  background:linear-gradient(110deg,#fff,#fcf8f7)
}

.entity-panel-head p {
  font-size:14px;
  color:var(--muted)
}

.entity-panel-head>span {
  font-size:14px;
  color:var(--muted);
  text-align:right
}

.entity-list {
  overflow:auto;
  min-height:0;
  padding:12px;
  display:flex;
  flex-direction:column;
  gap:9px;
  scrollbar-gutter:stable;
  flex:1
}

.entity-card {
  display:flex;
  align-items:center;
  width:100%;
  gap:13px;
  text-align:left;
  min-height:78px;
  border:1px solid #e9e1dc;
  border-radius:12px;
  padding:12px;
  background:#fff;
  flex-shrink:0
}

.entity-card:hover,.entity-card.selected {
  background:#fcf4f3;
  border-color:#bd8b96
}

.entity-card.selected {
  box-shadow:inset 3px 0 var(--accent)
}

.entity-symbol {
  width:39px;
  height:39px;
  display:grid;
  place-items:center;
  flex-shrink:0;
  border-radius:12px;
  font-size:16px;
  background:#f4e7e6;
  color:var(--accent)
}

.entity-copy {
  min-width:0;
  flex:1
}

.entity-copy strong {
  display:block;
  font-size:19px;
  line-height:1.5;
  overflow-wrap:anywhere;
  font-weight:600
}

.entity-copy small {
  display:block;
  font-size:14px;
  color:var(--muted);
  line-height:1.5;
  margin-top:3px
}

.entity-arrow {
  font-size:24px;
  color:#9d8f87
}

.empty-stage {
  padding:25px;
  color:var(--muted);
  text-align:center;
  font-size:16px
}

.detail {
  display:flex;
  flex-direction:column;
  overflow:hidden
}

.detail-head {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  padding:14px 18px;
  border-bottom:1px solid var(--line);
  background:#fcf8f7;
  flex-shrink:0
}

.detail-head h2 {
  font-size:21px;
  overflow-wrap:anywhere
}

.detail-body {
  padding:17px 18px;
  overflow:auto;
  min-height:0;
  scrollbar-gutter:stable;
  flex:1
}

.detail-empty {
  text-align:center;
  padding:25px 6px
}

.detail-empty img {
  width:72px;
  opacity:.65;
  margin-bottom:16px
}

.detail-empty strong {
  display:block;
  font-size:20px;
  margin-bottom:10px
}

.detail-empty p {
  font-size:16px;
  color:var(--muted)
}

.detail-actions {
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin:12px 0
}

.detail-divider {
  height:1px;
  border:0;
  background:var(--line);
  margin:18px 0
}

.detail-identity {
  display:flex;
  align-items:center;
  gap:10px;
  margin-bottom:14px
}

.detail-identity strong {
  font-size:21px
}

.detail-identity small {
  font-size:14px;
  color:var(--muted)
}

.kv {
  margin:11px 0
}

.kv-label {
  font-size:14px;
  color:var(--muted);
  margin-bottom:5px
}

.kv-value {
  font-size:16px;
  white-space:pre-wrap;
  overflow-wrap:anywhere
}

.evidence {
  border-left:3px solid #bb8e96;
  background:#faf4f1;
  padding:13px 15px;
  border-radius:0 10px 10px 0;
  line-height:1.9;
  font-size:18px;
  margin:8px 0 17px
}

.relation-picker {
  display:flex;
  flex-direction:column;
  gap:7px;
  margin:10px 0 16px
}

.edge-item {
  width:100%;
  text-align:left;
  font-size:15px;
  line-height:1.65;
  border-radius:10px;
  overflow-wrap:anywhere;
  padding:9px 11px
}

.edge-item.selected {
  background:#f4e7e6;
  border-color:#b57f8b;
  color:#854652
}

.relation-path {
  display:grid;
  grid-template-columns:minmax(0, 1fr) minmax(56px, .7fr) minmax(0, 1fr);
  align-items:center;
  gap:8px;
  padding:12px 10px;
  min-height:90px;
  background:#fffaf8;
  border:1px solid #ebdad7;
  border-radius:12px;
  margin:0 0 12px
}

.path-node {
  background:#fff;
  border:1px solid var(--line);
  border-radius:9px;
  padding:8px 7px;
  font-size:18px;
  font-weight:600;
  max-width:100%;
  overflow-wrap:anywhere;
  text-align:center
}

.path-connector {
  font-size:15px;
  line-height:1.5;
  color:var(--accent);
  padding:4px 0;
  overflow-wrap:anywhere;
  text-align:center
}

.path-connector:after {
  content:"⟶";
  display:block;
  font-size:26px;
  line-height:1
}

.relation-condition {
  padding:10px 12px;
  background:#fff2e3;
  color:#795434;
  border-radius:9px;
  font-size:16px;
  line-height:1.7;
  margin-bottom:15px
}

.source-details summary {
  cursor:pointer;
  font-size:15px;
  color:var(--accent);
  padding:8px 0
}

.source-details {
  border-top:1px solid var(--line);
  margin-top:16px;
  padding-top:6px
}

.reading-steps {
  display:grid;
  gap:10px;
  margin:20px 0;
  text-align:left;
  color:var(--muted);
  font-size:16px
}

.reading-steps span {
  display:flex;
  gap:10px
}

.reading-steps b {
  display:grid;
  place-items:center;
  width:26px;
  height:26px;
  border-radius:50%;
  background:#f4e7e6;
  color:var(--accent);
  flex:0 0 26px;
  font-size:14px
}

.detail-status {
  font-size:14px;
  color:var(--muted)
}

.mobile-detail-close {
  display:none
}

.primary {
  background:var(--accent);
  color:#fff;
  border-color:var(--accent);
  font-weight:650
}

.primary:hover {
  background:var(--patient-rose-hover);
  color:#fff;
  border-color:var(--patient-rose-hover)
}

.text-button {
  background:#fff;
  color:var(--accent);
  font-size:16px;
  white-space:nowrap
}

.icon-button {
  display:inline-grid;
  place-items:center;
  width:44px;
  height:44px;
  font-size:25px;
  padding:0
}

.notice {
  border:1px solid #e6c9aa;
  background:#fff5e7;
  color:#795434;
  padding:12px 15px;
  border-radius:11px;
  font-size:16px;
  flex-shrink:0
}

.notice.error {
  background:#fff0ee;
  border-color:#ddb0a7;
  color:#954a41
}

.section-heading {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
  flex-shrink:0
}

.section-heading p:not(.eyebrow) {
  color:var(--muted);
  font-size:15px;
  max-width:580px
}

.toolbar {
  display:flex;
  justify-content:space-between;
  gap:16px;
  flex-wrap:wrap;
  flex-shrink:0
}

.toolbar-main,.toolbar-tools {
  display:flex;
  align-items:center;
  gap:10px;
  font-size:16px
}

.toolbar-tools .muted {
  font-size:14px
}

.switch {
  display:flex;
  align-items:center;
  gap:8px;
  font-size:16px
}

.switch input {
  min-height:0;
  width:18px;
  height:18px;
  accent-color:var(--accent)
}

.switch-track {
  display:none
}

.vector-note {
  display:flex;
  align-items:center;
  gap:15px;
  font-size:14px;
  color:var(--muted);
  padding:9px 14px;
  border-radius:10px;
  background:#edf2ea
}

.vector-note strong {
  color:#526557
}

.vector-note span:last-child {
  display:none
}

.workspace {
  display:grid;
  grid-template-columns:minmax(0,1fr) 370px;
  gap:12px;
  min-height:0;
  flex:1
}

.workspace>.surface {
  overflow:hidden;
  display:flex;
  flex-direction:column
}

.surface-head {
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:12px 17px;
  border-bottom:1px solid var(--line);
  gap:10px
}

.vector-stage {
  min-height:0;
  flex:1;
  position:relative;
  overflow:hidden
}

.vector-stage svg {
  width:100%;
  height:100%;
  display:block
}

.vector-stage .empty-stage {
  position:absolute;
  inset:0;
  align-items:center;
  justify-content:center
}

.point {
  cursor:pointer
}

.legend {
  display:flex;
  justify-content:center;
  flex-wrap:wrap;
  gap:18px;
  padding:9px 14px;
  font-size:14px;
  border-top:1px solid var(--line)
}

.legend-item {
  display:flex;
  align-items:center;
  gap:8px
}

.legend-dot {
  width:9px;
  height:9px;
  border-radius:50%
}

.search-layout {
  display:grid;
  grid-template-columns:minmax(0,1fr) 330px;
  gap:18px;
  overflow:auto;
  min-height:0;
  flex:1
}

.search-layout>div {
  min-width:0
}

.search-box {
  padding:22px
}

.search-box>p {
  font-size:16px;
  margin:10px 0
}

.search-form {
  display:flex;
  gap:8px;
  flex-wrap:wrap
}

.search-form input {
  flex:1;
  min-width:220px
}

.search-examples {
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:14px
}

.search-examples button {
  font-size:15px;
  min-height:40px
}

.side-note {
  padding:20px;
  align-self:start
}

.side-note p:not(.eyebrow) {
  margin:14px 0;
  font-size:16px;
  color:var(--muted)
}

.results-heading {
  display:flex;
  justify-content:space-between;
  padding:16px 2px;
  font-size:15px;
  color:var(--muted);
  gap:10px
}

.search-result {
  padding:20px;
  margin-bottom:12px;
  background:#fff;
  border:1px solid var(--line);
  border-radius:14px
}

.result-top,.result-title {
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap
}

.result-top {
  justify-content:space-between
}

.result-title strong {
  font-size:18px
}

.rank {
  display:grid;
  place-items:center;
  width:28px;
  height:28px;
  border-radius:50%;
  background:var(--accent-soft);
  color:var(--accent);
  font-size:14px
}

.badge {
  font-size:14px;
  padding:4px 8px;
  background:#edf2ea;
  border-radius:6px;
  color:#546955
}

.badge.neutral {
  background:#f4efeb;
  color:var(--muted)
}

.badge.warn {
  background:#fff1df;
  color:#795434
}

.score {
  font-size:14px;
  color:var(--accent)
}

.result-text {
  font-size:18px;
  line-height:1.9;
  margin:15px 0
}

.result-source {
  font-size:14px;
  color:var(--muted);
  overflow-wrap:anywhere
}

.audit-summary {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px
}

.audit-card {
  padding:12px 18px
}

.audit-card p {
  font-size:15px;
  color:var(--muted)
}

.metric-index {
  display:none
}

.audit-title {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:15px
}

.table-wrap {
  overflow:auto;
  flex:1;
  min-height:0
}

.record-table {
  width:100%;
  border-collapse:collapse;
  font-size:16px
}

.record-table th {
  position:sticky;
  top:0;
  background:#faf5f1;
  text-align:left;
  font-size:15px;
  z-index:1
}

.record-table td,.record-table th {
  padding:12px 15px;
  border-bottom:1px solid var(--line)
}

.record-table td {
  vertical-align:top
}

.source-cell {
  max-width:340px;
  overflow-wrap:anywhere
}

.record-table button {
  font-size:15px
}

.footer {
  display:flex;
  justify-content:space-between;
  gap:15px;
  color:var(--muted);
  font-size:14px;
  flex-shrink:0
}

.modal {
  position:fixed;
  inset:0;
  z-index:100;
  background:rgba(65,58,55,.28);
  padding:35px;
  display:grid;
  place-items:center
}

.modal-card {
  width:min(100%,950px);
  max-height:calc(100dvh - 70px);
  background:#fff;
  border-radius:20px;
  display:flex;
  flex-direction:column;
  box-shadow:0 24px 70px rgba(65,58,55,.2)
}

.modal-head {
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:18px 22px;
  border-bottom:1px solid var(--line);
  gap:12px
}

.modal-body {
  padding:22px;
  overflow:auto;
  min-height:0
}

.edge-list-filter {
  width:100%;
  margin:10px 0
}

.edge-list-summary {
  font-size:14px;
  color:var(--muted);
  margin-bottom:10px
}

.modal-body .edge-item {
  margin-bottom:8px
}

.raw-node-button {
  margin-top:15px
}

.detail-overview-copy {
  font-size:16px;
  color:var(--muted)
}

@media(min-width:1180px) and (max-height:820px) {
  .site-header {
    height:68px
  }
  .page-shell {
    height:calc(100dvh - 68px);
    padding-top:12px;
    gap:8px
  }
  .page-heading h1 {
    font-size:25px
  }
  .page-heading p {
    display:none
  }
  .metric {
    min-height:48px
  }
  .category-footer {
    display:none
  }
  .category-panel {
    padding-top:11px
  }
  .category-panel h2 {
    padding-bottom:6px
  }
  .category-button {
    min-height:34px;
    padding-top:4px;
    padding-bottom:4px;
    margin-bottom:3px
  }
  .reading-tip {
    font-size:14px;
    padding:7px 12px
  }
  .entity-card {
    min-height:72px;
    padding:10px
  }
  .entity-panel-head,.detail-head {
    padding-top:11px;
    padding-bottom:11px
  }
  .graph-detail .detail-head {
    padding-top:9px;
    padding-bottom:9px
  }
  .graph-detail .detail-head > div {
    display:flex;
    align-items:baseline;
    flex-wrap:wrap;
    gap:8px
  }
  .graph-detail .detail-body {
    padding-top:12px
  }
  .graph-detail .relation-path {
    min-height:80px;
    padding-top:10px;
    padding-bottom:10px;
    margin-bottom:8px
  }
  .footer {
    font-size:14px
  }
}

@media(min-width:1600px) {
  .graph-workspace {
    grid-template-columns:185px minmax(0,1fr) 430px
  }
  .entity-list {
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    align-content:start
  }
  .entity-card {
    min-height:98px
  }
  .entity-copy strong {
    font-size:21px
  }
  .detail-body {
    padding:20px 24px
  }
  .graph-controls .search-field {
    max-width:700px
  }
}

@media(max-width:1179px) {
  .site-header {
    padding:0 22px
  }
  .page-shell {
    padding:14px 18px 12px
  }
  .graph-workspace {
    grid-template-columns:145px minmax(240px,1fr) 315px
  }
  .graph-controls {
    flex-wrap:wrap
  }
  .graph-controls .search-field {
    max-width:none
  }
  .graph-controls .text-button {
    padding:8px 10px
  }
  .section-heading p:not(.eyebrow) {
    display:none
  }
  .local-tag {
    display:none
  }
  .category-footer {
    display:none
  }
  .workspace {
    grid-template-columns:minmax(0,1fr) 310px
  }
  .source-cell {
    max-width:240px
  }
  .footer span:first-child {
    display:none
  }
}

@media(max-width:899px) {
  html,body {
    font-size:17px
  }
  .site-header {
    height:70px;
    padding:0 16px
  }
  .brand strong {
    font-size:18px
  }
  .brand small {
    display:none;
  }
  .brand img {
    width:36px;
    height:36px
  }
  .top-actions {
    gap:12px
  }
  .current-page {
    display:none
  }
  .top-actions button {
    font-size:14px;
    padding:8px 10px
  }
  .top-link {
    font-size:15px
  }
  .page-shell {
    height:calc(100dvh - 70px);
    padding:12px;
    gap:9px
  }
  .page-heading h1 {
    font-size:24px
  }
  .page-heading p {
    font-size:15px
  }
  .overview-strip {
    grid-template-columns:repeat(4,1fr)
  }
  .metric {
    display:flex;
    flex-wrap:wrap;
    gap:0 5px;
    min-height:69px;
    padding:6px 3px
  }
  .metric>span {
    width:100%;
    text-align:center;
    font-size:14px
  }
  .metric strong {
    font-size:22px
  }
  .metric small {
    font-size:14px
  }
  .tabs {
    gap:0;
    justify-content:space-between
  }
  .tab {
    font-size:15px;
    min-height:43px;
    padding:8px 3px
  }
  .graph-controls {
    gap:8px
  }
  .graph-controls>label:first-child {
    display:none
  }
  .graph-controls select {
    width:135px;
    font-size:16px
  }
  .graph-controls .search-field {
    min-width:130px;
    flex:1
  }
  .graph-controls input {
    font-size:16px;
    padding-left:0
  }
  .graph-controls .text-button {
    font-size:14px;
    min-height:38px;
    flex:1
  }
  .graph-workspace {
    grid-template-columns:minmax(0,1fr);
    gap:10px
  }
  .category-panel {
    border:0;
    background:transparent;
    padding:0;
    box-shadow:none;
    overflow:visible;
    min-height:0
  }
  .category-panel h2 {
    display:none
  }
  #graph-categories {
    display:flex;
    overflow:auto;
    gap:7px;
    padding:0 1px 3px;
    scrollbar-width:thin
  }
  .category-button {
    flex:0 0 auto;
    width:auto;
    min-height:42px;
    margin:0;
    padding:7px 12px;
    gap:9px;
    border:1px solid var(--line);
    background:#fff;
    font-size:16px
  }
  .graph-workspace {
    display:flex;
    flex-direction:column
  }
  .entity-panel {
    flex:1;
    min-height:0
  }
  .entity-list {
    padding:10px;
    gap:8px
  }
  .entity-card {
    min-height:78px
  }
  .entity-copy strong {
    font-size:19px
  }
  .entity-copy small {
    font-size:14px
  }
  .entity-panel-head {
    padding:10px 14px
  }
  .entity-panel-head h2 {
    font-size:20px
  }
  .entity-panel-head p {
    display:none
  }
  .reading-tip {
    padding:8px 10px;
    font-size:14px;
    align-items:flex-start
  }
  .reading-tip strong {
    display:none
  }
  .reading-tip p {
    line-height:1.5
  }
  .graph-detail {
    display:none
  }
  .graph-detail.is-open {
    display:flex;
    position:fixed;
    inset:75px 10px 10px;
    z-index:60;
    box-shadow:0 0 0 100vmax rgba(65,58,55,.28)
  }
  .mobile-detail-close {
    display:inline-block;
    font-size:15px
  }
  .detail-head {
    padding:14px 17px
  }
  .detail-body {
    padding:17px
  }
  .footer {
    display:none
  }
  .workspace {
    grid-template-columns:minmax(0,1fr);
    overflow:auto
  }
  .vector-stage {
    min-height:330px
  }
  .workspace>.detail {
    min-height:280px
  }
  .vector-note {
    display:block
  }
  .vector-note span {
    display:block
  }
  .section-heading h2 {
    font-size:21px
  }
  .section-heading .eyebrow {
    display:none
  }
  .search-layout {
    display:block
  }
  .search-box {
    padding:17px
  }
  .search-layout>.side-note {
    margin-top:15px
  }
  .search-form input {
    flex-basis:100%;
    min-width:0
  }
  .search-form select {
    flex:1;
    min-width:0
  }
  .search-form button {
    flex:1
  }
  .search-examples {
    gap:7px
  }
  .results-heading {
    flex-wrap:wrap
  }
  .audit-summary {
    grid-template-columns:1fr
  }
  .audit-summary>.audit-card:first-child {
    display:none
  }
  .audit-card {
    padding:12px
  }
  .audit-title h3 {
    font-size:17px
  }
  .audit-card p {
    font-size:14px
  }
  .toolbar {
    gap:8px
  }
  .toolbar-main {
    flex-wrap:wrap
  }
  .toolbar-main select {
    max-width:190px
  }
  .toolbar-tools {
    flex-wrap:wrap;
    font-size:14px
  }
  .table-wrap {
    min-height:150px
  }
  .record-table {
    min-width:780px
  }
  .modal {
    padding:10px
  }
  .modal-card {
    max-height:calc(100dvh - 20px)
  }
  .modal-head,.modal-body {
    padding:16px
  }
  .modal-head h2 {
    font-size:21px
  }
}

@media(prefers-reduced-motion:no-preference) {
  button,a {
    transition:background .16s,border-color .16s,box-shadow .16s
  }
  .entity-panel,.graph-detail {
    animation:appear .2s ease-out
  }
  @keyframes appear {
    from {
      opacity:.65;
      transform:translateY(3px)
    }
    to {
      opacity:1;
      transform:translateY(0)
    }
  }
}

/* Incremental graph: the canvas has priority; details remain readable beside it. */
.graph-workspace { grid-template-columns:minmax(0,1fr) 350px; }
.graph-mode { display:flex; padding:3px; background:#f5efeb; border-radius:11px; gap:3px; }
.graph-mode button { border:0; min-height:36px; padding:5px 15px; background:transparent; }
.graph-mode button.active { color:var(--accent); background:#fff; box-shadow:0 1px 4px #bbaaa633; font-weight:650; }
.network-toolbar { display:flex; align-items:center; gap:8px; padding:7px 12px; border-bottom:1px solid #efe8e3; flex-shrink:0; }
.network-toolbar>label { font-size:14px; color:var(--muted); }
.network-toolbar select { max-width:165px; padding:5px 9px; min-height:38px; font-size:15px; }
.network-toolbar #graph-count { font-size:14px; color:var(--muted); margin-right:auto; line-height:1.5; }
.network-zoom { display:flex; gap:4px; flex-shrink:0; }
.network-zoom button { padding:4px 10px; min-height:36px; font-size:14px; }
.network-zoom button[aria-label] { min-width:36px; font-size:20px; line-height:1; }
.network-stage { position:relative; min-height:0; flex:1; overflow:hidden; background:#fffcfa; }
#graph-svg { display:block; width:100%; height:100%; min-height:180px; cursor:grab; touch-action:none; }
#graph-svg.is-panning { cursor:grabbing; }
.network-hint { position:absolute; bottom:0; left:0; right:0; padding:5px 12px; font-size:14px; text-align:center; color:#7b6b65; background:#fffcfae8; pointer-events:none; line-height:1.5; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.kg-node,.kg-edge { cursor:pointer; outline:none; }
.kg-node-box { stroke:#d8c6bf; stroke-width:1.5; transition:stroke .15s; }
.kg-node.selected .kg-node-box,.kg-node:focus-visible .kg-node-box { stroke:#9e5c68; stroke-width:3; }
.kg-node.is-root .kg-node-box { stroke:#b77f89; }
.kg-node:hover .kg-node-box { stroke:#9e5c68; stroke-width:2.5; }
.kg-node-name { font-family:var(--patient-font); font-size:18px; fill:#413a37; font-weight:600; pointer-events:none; }
.kg-node-type { font-family:var(--patient-font); font-size:13px; fill:#7b6b65; pointer-events:none; }
.kg-more-dot { fill:#fff; stroke:#d1b6b4; stroke-width:1; }
.kg-more-count { font-size:11px; fill:#8c5863; pointer-events:none; font-family:var(--patient-font); font-weight:650; }
.kg-edge-line { fill:none; stroke:#cbbab3; stroke-width:1.5; opacity:.72; pointer-events:none; }
.kg-edge-hit { fill:none; stroke:transparent; stroke-width:14; }
.kg-edge.selected .kg-edge-line,.kg-edge:hover .kg-edge-line,.kg-edge:focus-visible .kg-edge-line { stroke:#a46673; stroke-width:2.5; opacity:1; }
.graph-node-actions { display:flex; gap:7px; flex-wrap:wrap; margin-bottom:13px; }
.graph-node-actions button { font-size:15px; padding:8px 10px; min-height:42px; flex:1 0 auto; }
.graph-node-actions button:disabled { cursor:default; }

@media(max-width:1450px) and (min-width:801px) {
  .graph-workspace { grid-template-columns:minmax(0,1fr) 330px; }
  .network-toolbar>label { display:none; }
  .network-toolbar select { max-width:142px; }
  .network-toolbar #graph-count { font-size:13px; }
  .network-zoom button { padding:4px 8px; }
  .graph-detail .detail-head { padding:10px 14px; }
  .graph-detail .detail-body { padding:12px 14px; }
}

@media(max-width:800px) {
  .graph-workspace { display:flex; }
  .network-toolbar { flex-wrap:wrap; gap:6px; padding:6px 10px; }
  .network-toolbar>label { display:none; }
  .network-toolbar select { max-width:145px; }
  .network-toolbar #graph-count { font-size:13px; flex:1; text-align:right; }
  .network-zoom { width:100%; justify-content:flex-end; }
  .network-zoom button { min-height:34px; }
  .network-stage { min-height:280px; }
  #graph-svg { min-height:280px; }
  .entity-panel { min-height:410px; }
  .entity-panel-head { padding:9px 11px; }
  .entity-panel-head h2 { font-size:18px; }
  .graph-mode button { padding:5px 11px; font-size:15px; }
  .network-hint { font-size:13px; }
  .graph-detail.is-open { inset:65px 8px 8px; }
}

@media(max-width:899px) {
  /* The small-screen graph is a scrollable section, not a clipped desktop pane. */
  #panel-graph { overflow-y:auto; overflow-x:hidden; padding-bottom:8px; }
  #panel-graph .graph-workspace { flex:0 0 auto; min-height:460px; }
  #panel-graph .entity-panel { flex:0 0 auto; height:460px; min-height:460px; }
}

/* Knowledge atlas: a generous canvas in a naturally scrolling workspace. */
.page-shell { height:auto; min-height:calc(100dvh - 78px); gap:18px; padding-top:24px; padding-bottom:28px; }
.page-heading p { display:block; }
.panel { flex:none; overflow:visible; gap:14px; }
.graph-workspace { align-items:start; grid-template-columns:minmax(0,1fr) 340px; gap:18px; }
#panel-graph .entity-panel { display:flex; flex-direction:column; height:960px; min-height:0; overflow:hidden; border-color:#dfd1c9; box-shadow:0 8px 36px #71534b08; }
.entity-panel-head { min-height:96px; padding:20px; gap:14px; background:linear-gradient(110deg,#fffdfb,#fbf4f2); }
.entity-panel-head h2 { font-size:25px; }
.entity-panel-head p { display:block; font-size:14px; margin:0 0 4px; color:#8c696b; }
.atlas-head-actions { display:flex; align-items:center; gap:12px; flex-wrap:wrap; justify-content:flex-end; }
#graph-show-project { padding:10px 15px; font-size:16px; border-radius:12px; box-shadow:0 3px 9px #9e5c6817; }
#graph-show-project span { margin-right:5px; font-size:19px; }
.atlas-modebar { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:8px; padding:12px 20px; border-bottom:1px solid #eee4df; background:#fff; }
.atlas-extent { display:flex; gap:5px; }
.atlas-extent button { padding:7px 13px; min-height:39px; font-size:16px; color:#756863; border:1px solid transparent; background:transparent; border-radius:9px; }
.atlas-extent button.active { border-color:#e6cdd0; color:#935666; background:#faf0f1; font-weight:600; }
#graph-count { font-size:14px; color:#786b65; }
.network-toolbar { padding:12px 20px; gap:12px; flex-wrap:wrap; background:#fffdfb; }
.network-toolbar>label { display:inline-flex; align-items:center; gap:7px; font-size:15px; }
.network-toolbar select { font-size:15px; max-width:160px; }
.edge-label-control { cursor:pointer; }
.edge-label-control input { width:17px; height:17px; accent-color:#9e5c68; }
.network-zoom { margin-left:auto; gap:5px; }
.network-zoom button { border-radius:8px; font-size:14px; padding:5px 9px; min-height:36px; }
.network-zoom #graph-scale { min-width:57px; font-variant-numeric:tabular-nums; color:#8e5a65; }
#graph-fullscreen { font-size:14px; }
.network-stage { flex:1; min-height:520px; background-color:#fffdfa; background-image:radial-gradient(#e7dcd4 .7px,transparent .7px); background-size:22px 22px; }
#graph-svg { height:100%; min-height:0; }
.network-hint { padding:9px 12px; font-size:14px; color:#796c65; background:linear-gradient(0deg,#fffdfa 75%,#fffdfa00); }
.atlas-footer { display:flex; flex-wrap:wrap; gap:10px; align-items:center; justify-content:space-between; padding:14px 20px; border-top:1px solid #eee4df; background:#fff; font-size:13px; color:#8b7a73; }
.atlas-legend { display:flex; gap:12px; flex-wrap:wrap; }
.atlas-legend button { display:flex; align-items:center; gap:6px; font-size:14px; padding:2px; min-height:28px; border:0; background:transparent; color:#6f605b; }
.atlas-legend button.active { color:#975c68; font-weight:650; text-decoration:underline; text-underline-offset:5px; }
.atlas-legend-item { display:inline-flex; align-items:center; gap:6px; min-height:28px; font-size:14px; color:#6f605b; }
.atlas-legend i { width:12px; height:12px; border-radius:4px; border:1px solid #bca69d; }
.atlas-legend-item i { flex:0 0 12px; }
.graph-category-note { min-width:0; font-size:14px; color:#786b65; overflow-wrap:anywhere; }
.graph-detail { position:sticky; top:22px; max-height:calc(100dvh - 44px); height:820px; }
.graph-detail .detail-head { padding:19px; background:#fffaf7; }
.graph-detail .detail-body { padding:19px; }
.kg-edge-label text { font-family:var(--patient-font); font-size:15px; fill:#715650; }
.kg-edge-label rect { fill:#fffdf9; stroke:#e8dbd3; stroke-width:1; rx:5; }
.kg-edge-label { cursor:pointer; }
.kg-edge.selected .kg-edge-label text { fill:#984e62; font-weight:650; }
.kg-edge.selected .kg-edge-label rect { fill:#fff1f4; stroke:#c58d9b; }
.kg-edge.is-muted { opacity:.23; }
.kg-node.is-muted { opacity:.55; }
.kg-group-title { font-family:var(--patient-font); fill:#8d7469; font-size:18px; letter-spacing:2px; }
.kg-group-box { fill:#f7f1eb; fill-opacity:.42; stroke:#e7dacf; stroke-dasharray:5 6; rx:24; }
.entity-panel:fullscreen { width:100%; height:100dvh!important; min-height:0!important; max-height:none; background:#fffdfa; border:0; border-radius:0; }
.entity-panel:fullscreen .network-stage { min-height:80px; }
.entity-panel:fullscreen .entity-panel-head { min-height:76px; padding:12px 22px; }
.entity-panel:fullscreen .atlas-footer { padding:8px 22px; }
#panel-vectors .workspace { min-height:650px; }
.footer { margin-top:8px; }
@media(max-width:1199px) {
  .graph-workspace { grid-template-columns:minmax(0,1fr) 295px; gap:12px; }
  .entity-panel-head { align-items:flex-start; flex-wrap:wrap; padding:16px; }
  .atlas-head-actions { justify-content:flex-start; }
  .network-toolbar { padding:10px 14px; }
  .network-zoom { width:100%; justify-content:flex-end; }
  .graph-detail .detail-head,.graph-detail .detail-body { padding:15px; }
}
@media(max-width:899px) {
  .page-shell { height:auto; min-height:calc(100dvh - 70px); padding:18px 12px 24px; gap:14px; }
  #panel-graph { overflow:visible; }
  #panel-graph .graph-workspace { min-height:0; display:block; }
  #panel-graph .entity-panel { height:820px; min-height:0; }
  .entity-panel-head { gap:12px; }
  .entity-panel-head h2 { font-size:22px; }
  .entity-panel-head p { font-size:13px; }
  .atlas-head-actions { width:100%; justify-content:space-between; gap:8px; }
  #graph-show-project { font-size:15px; padding:8px 11px; }
  .atlas-modebar { padding:10px 12px; }
  .atlas-extent button { font-size:15px; padding:6px 10px; }
  .network-toolbar { gap:9px; padding:10px 12px; }
  .network-toolbar>label:first-child { display:none; }
  .network-toolbar select { max-width:150px; }
  .network-zoom { gap:3px; justify-content:flex-start; }
  .network-zoom button { font-size:13px; padding:5px 7px; }
  .network-stage { min-height:380px; }
  .atlas-footer { padding:10px 12px; }
  .atlas-footer>span { display:none; }
  .atlas-legend { gap:7px 11px; }
  .graph-detail.is-open { height:auto; max-height:none; }
  .entity-panel:fullscreen .network-stage { min-height:50px; }
  .entity-panel:fullscreen .entity-panel-head { padding:9px 12px; }
  .entity-panel:fullscreen .entity-panel-head>div:first-child { display:none; }
  .entity-panel:fullscreen .atlas-footer { display:none; }
}

/* Multi-dimensional queries keep the matching graph and its evidence together. */
.graph-query-form { padding:18px 20px 15px; border:1px solid #e4d7cf; border-radius:17px; background:#fffdfb; box-shadow:0 4px 20px #71534b05; }
.graph-search-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:12px 24px; margin-bottom:13px; }
.graph-search-heading>div { min-width:0; }
.graph-search-heading h2 { color:#654d48; font-size:20px; line-height:1.5; }
.graph-search-heading p { margin-top:3px; color:#837168; font-size:14px; line-height:1.6; }
.graph-search-heading .text-button { flex:0 0 auto; min-height:36px; padding:5px 8px; font-size:14px; }
.graph-query-form .graph-controls { display:grid; grid-template-columns:1.1fr 1fr 1fr; align-items:end; gap:12px; }
.graph-query-form .graph-query-control { display:flex; flex-direction:column; gap:6px; min-width:0; font-size:15px; color:#786861; }
.graph-query-control>span { padding-left:2px; }
.graph-query-form .graph-controls select { width:100%; min-width:0; max-width:100%; min-height:48px; padding:10px 12px; font-size:16px; color:var(--ink); }
.graph-scope-help,.graph-mode-help,.graph-type-help { font-size:14px; line-height:1.65; color:#7a6b63; overflow-wrap:anywhere; }
.graph-scope-help { margin:6px 2px 10px; }
.graph-mode-help { margin:7px 2px 0; color:#715650; }
.graph-type-help { margin:3px 2px 0; }
.graph-scope-help:empty,.graph-mode-help:empty,.graph-type-help:empty { display:none; }
.graph-search-row { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:10px; }
.graph-query-form .graph-query-search { min-width:0; max-width:none; height:48px; margin:0; border-color:#dbcac2; border-radius:11px; background:#fff; }
.graph-query-form .graph-query-search input { min-width:0; width:100%; height:46px; padding:9px 12px 9px 2px; font-size:16px; }
.graph-query-search:focus-within { outline:2px solid #b8828b; outline-offset:2px; }
.graph-query-search input:focus-visible { outline:none; }
.graph-query-actions { display:flex; gap:8px; }
.graph-query-actions button { min-height:48px; padding:10px 15px; white-space:nowrap; font-size:16px; }
.graph-advanced { margin-top:11px; border-top:1px solid #eee5df; }
.graph-advanced summary { width:fit-content; max-width:100%; padding:9px 2px 5px; font-size:15px; color:#895863; font-weight:600; cursor:pointer; }
.graph-advanced summary>span { font-size:14px; font-weight:400; color:#897971; margin-left:12px; }
.graph-advanced summary:focus-visible { outline:3px solid #b8828b; outline-offset:3px; border-radius:5px; }
.graph-advanced[open] summary { padding-bottom:12px; }
.graph-advanced-fields { display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:12px; }
.graph-advanced-fields label { display:flex; flex-direction:column; gap:5px; min-width:0; color:#786861; font-size:15px; }
.graph-advanced-fields input,.graph-advanced-fields select { width:100%; min-width:0; max-width:100%; background:#fff; color:var(--ink); font-size:16px; }
.graph-advanced-fields input:disabled { background:#f4eeea; color:#93877f; cursor:not-allowed; }
.graph-query-help { margin-top:10px; color:#7a6b63; font-size:14px; line-height:1.65; }
.graph-query-examples { display:flex; align-items:center; flex-wrap:wrap; gap:7px; margin-top:12px; color:#88766e; font-size:14px; }
.graph-query-examples>span { margin-right:2px; }
.graph-query-examples>button { min-height:36px; border-color:#eaddd5; padding:5px 10px; border-radius:8px; font-size:14px; background:#faf5f0; color:#795f57; }
.graph-query-examples>button:hover { background:#f4e8e8; border-color:#cbabb0; }
.graph-query-examples #show-relations { margin-left:auto; background:transparent; border-color:transparent; color:#9a5c69; }
.graph-query-examples>button { max-width:100%; white-space:normal; overflow-wrap:anywhere; text-align:left; }
.graph-search-resources { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); align-items:start; gap:10px; margin-top:10px; }
.graph-catalog,.graph-definitions { min-width:0; border:1px solid #ecdfd7; border-radius:10px; background:#faf6f1; }
.graph-catalog>summary,.graph-definitions>summary { padding:9px 12px; cursor:pointer; color:#865965; font-size:14px; line-height:1.55; font-weight:600; overflow-wrap:anywhere; }
.graph-catalog>summary:focus-visible,.graph-definitions>summary:focus-visible,.graph-catalog-group>summary:focus-visible { outline:3px solid #b8828b; outline-offset:2px; border-radius:6px; }
.graph-catalog[open]>summary,.graph-definitions[open]>summary { border-bottom:1px solid #eadbd2; }
#graph-catalog-content { max-height:310px; overflow:auto; overscroll-behavior:contain; scrollbar-width:thin; padding:0 12px; }
.graph-catalog-group { padding:8px 0; border-bottom:1px solid #eadeD6; }
.graph-catalog-group:last-child { border-bottom:0; }
.graph-catalog-group>summary { cursor:pointer; color:#705b53; font-size:14px; line-height:1.6; overflow-wrap:anywhere; }
.graph-catalog-items { display:flex; flex-wrap:wrap; gap:6px; padding:8px 0 2px; }
.graph-catalog-items button { max-width:100%; min-height:34px; padding:5px 9px; border-color:#e5d6cc; border-radius:8px; background:#fffdfb; color:#765850; font-size:14px; line-height:1.5; text-align:left; white-space:normal; overflow-wrap:anywhere; }
.graph-catalog-items button:hover { border-color:#c797a1; background:#f8eded; }
.graph-catalog-note,.graph-catalog-empty { color:#88756d; font-size:13px; line-height:1.65; overflow-wrap:anywhere; }
.graph-catalog-note { margin:6px 0 2px; }
.graph-catalog-empty { padding:12px 0; }
.graph-definitions dl { display:grid; grid-template-columns:95px minmax(0,1fr); gap:9px 13px; max-height:310px; margin:0; padding:12px; overflow:auto; overscroll-behavior:contain; scrollbar-width:thin; font-size:14px; line-height:1.65; }
.graph-definitions dt { color:#79555b; font-weight:600; }
.graph-definitions dd { min-width:0; margin:0; color:#77675f; overflow-wrap:anywhere; }
.graph-query-context { margin-top:10px; padding:8px 11px; border-left:3px solid #c48f99; border-radius:0 7px 7px 0; background:#f7eeeb; color:#79545c; font-size:14px; line-height:1.65; overflow-wrap:anywhere; }
.graph-query-context:empty { display:none; }
.graph-filter-message { margin-top:8px; color:#90633c; font-size:14px; line-height:1.65; overflow-wrap:anywhere; }
.graph-query-results { border:1px solid #e0cec9; border-radius:16px; background:#fffaf8; overflow:hidden; }
.graph-query-results-head { display:flex; align-items:baseline; justify-content:space-between; gap:12px 24px; flex-wrap:wrap; padding:14px 18px; border-bottom:1px solid #eee0da; }
.graph-query-results-head h2 { font-size:19px; color:#80535d; }
.graph-query-results-head p { font-size:14px; color:#7d6b62; }
.graph-query-hits { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:9px; padding:12px; max-height:220px; overflow:auto; overscroll-behavior:contain; scrollbar-width:thin; }
.query-hit { position:relative; display:flex; flex-direction:column; align-items:flex-start; gap:5px; min-width:0; width:100%; min-height:104px; padding:12px 14px; background:#fff; border:1px solid #e6d8d0; border-radius:11px; text-align:left; overflow-wrap:anywhere; }
.query-hit strong { display:block; font-size:17px; line-height:1.5; color:#4f423d; font-weight:600; }
.query-hit small { display:block; font-size:14px; line-height:1.5; color:#827168; }
.query-hit-reason { display:block; font-size:14px; line-height:1.55; color:#8c5a63; word-break:break-word; }
.query-hit-reason mark { background:#f5dce1; color:#6e3545; border-radius:3px; padding:0 2px; }
.query-hit .query-raw-note { color:#956737; }

/* A record can contain both supported and unresolved fields. */
.record-field-summary { display:block; margin-top:6px; color:var(--muted); white-space:nowrap; font-size:13px; }
.badge.field-verified { color:#48684c; background:#edf4ec; }
.field-evidence { margin:24px 0; min-width:0; }
.field-evidence-heading,.field-evidence-top { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; flex-wrap:wrap; }
.field-evidence-heading h3 { font-size:19px; }
.field-evidence-count { color:#48684c; font-size:15px; }
.field-evidence-boundary,.field-evidence-note { margin:8px 0 14px; color:var(--muted); font-size:14px; line-height:1.65; }
.field-evidence-card { border:1px solid var(--line); border-radius:12px; padding:16px; margin-top:12px; min-width:0; overflow-wrap:anywhere; }
.field-evidence-top h4 { margin:0; font-size:16px; font-weight:650; }
.field-evidence-path { display:block; margin-top:3px; color:var(--muted); font-size:12px; overflow-wrap:anywhere; }
.field-evidence-card .kv { margin:12px 0; }
.field-evidence-card .kv-label { font-size:13px; }
.field-evidence-card .kv-value { font-size:15px; white-space:pre-wrap; }
.field-evidence-quote { margin:8px 0 0; border-left:3px solid var(--accent); padding:10px 13px; background:#faf6f3; font-size:15px; white-space:pre-wrap; }
.field-evidence-location { color:var(--muted); font-size:12px; line-height:1.65; margin:6px 0 12px; overflow-wrap:anywhere; }
.field-evidence-missing { color:#956737; background:#fcf7ee; padding:10px 12px; border-radius:8px; font-size:14px; margin:10px 0; }
.field-evidence-checks { font-size:13px; color:var(--muted); margin-top:12px; }
.field-evidence-checks summary,.original-record-json summary { cursor:pointer; }
.field-evidence-checks ul { margin:8px 0; padding-left:20px; }
.query-selection .field-evidence { margin:14px 0; }
.query-selection .field-evidence-heading h3 { font-size:15px; }
.query-selection .field-evidence-card { padding:12px; }
@media(max-width:600px) {
  .field-evidence-card { padding:13px; }
  .field-evidence-heading { gap:4px; }
  .field-evidence-heading h3 { font-size:17px; }
  .field-evidence-top .badge { font-size:12px; }
}
.query-hit:hover { background:#fff9f8; border-color:#c797a1; }
.query-hit[aria-pressed="true"],.query-hit.selected { border-color:#a46472; background:#fbefef; box-shadow:inset 3px 0 #a46472; }
.query-hit[aria-pressed="true"] strong,.query-hit.selected strong { color:#864d5d; }
.graph-query-hits>p { grid-column:1/-1; margin:6px; font-size:16px; color:#796960; }
.graph-query-insight { flex:0 0 auto; max-height:170px; overflow:auto; padding:13px 18px; border-bottom:1px solid #e7d6cd; background:#f7f0eb; font-size:15px; line-height:1.65; overflow-wrap:anywhere; scrollbar-width:thin; }
.graph-query-insight strong { color:#80555f; font-weight:650; }
.graph-query-insight p+p { margin-top:7px; }
.graph-query-insight small { display:block; margin-top:5px; font-size:14px; color:#7b6b62; }
.graph-query-insight .query-chip,.graph-query-insight .chip { display:inline-flex; max-width:100%; margin:4px 5px 0 0; padding:3px 7px; border:1px solid #dfcac7; border-radius:7px; background:#fffaf7; color:#866069; font-size:13px; white-space:normal; overflow-wrap:anywhere; }
.query-selection { margin:0 0 15px; padding:12px; border:1px solid #dfc7c9; border-radius:10px; background:#fcf1f1; font-size:15px; line-height:1.7; overflow-wrap:anywhere; }
.query-selection strong { display:block; color:#8e5564; font-size:16px; margin-bottom:4px; }
.query-selection small { display:block; font-size:14px; color:#7c6762; }
.query-selection .kv-value,.query-selection code,.query-selection span { overflow-wrap:anywhere; word-break:break-word; }
.kg-node.query-match .kg-node-box { stroke:#a26572; stroke-width:2.6; }
.kg-node.query-match.selected .kg-node-box { stroke:#874556; stroke-width:3.6; }
.kg-node.query-context:not(.selected):not(.is-muted) { opacity:.76; }
.kg-edge.query-match .kg-edge-line { stroke:#ad7380; stroke-width:2.1; opacity:.95; }
.kg-edge.query-match .kg-edge-label rect { fill:#fff2f2; stroke:#d1a2aa; }
.kg-edge.query-match .kg-edge-label text { fill:#914f61; font-weight:600; }
.kg-edge.query-context:not(.selected):not(.is-muted) { opacity:.5; }
.kg-edge.query-match.selected .kg-edge-line { stroke:#874556; stroke-width:3; opacity:1; }
@media(max-width:1199px) {
  .graph-query-form .graph-controls { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .graph-advanced-fields { grid-template-columns:repeat(auto-fit,minmax(165px,1fr)); }
  .graph-query-hits { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media(max-width:899px) {
  .graph-query-form { padding:14px 12px; border-radius:14px; }
  .graph-search-heading { flex-direction:column; gap:6px; margin-bottom:10px; }
  .graph-search-heading h2 { font-size:19px; }
  .graph-search-heading .text-button { padding:3px 0; min-height:30px; text-align:left; }
  .graph-query-form .graph-controls { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
  .graph-query-form .graph-controls>.graph-query-control:first-child { grid-column:1/-1; }
  .graph-query-form .graph-controls>.graph-query-control { display:flex; font-size:14px; }
  .graph-query-form .graph-controls select { min-height:46px; padding:9px 10px; }
  .graph-search-row { grid-template-columns:minmax(0,1fr); gap:8px; }
  .graph-query-form .graph-query-search { grid-column:1/-1; min-width:0; height:48px; }
  .graph-query-form .graph-query-search input { font-size:16px; }
  .graph-query-form .graph-query-actions { display:grid; grid-template-columns:1fr 1fr; width:100%; }
  .graph-query-form .graph-query-actions button { min-height:46px; font-size:16px; }
  .graph-advanced summary>span { display:none; }
  .graph-advanced-fields { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
  .graph-advanced-fields>label:last-child { grid-column:1/-1; }
  .graph-query-help { font-size:14px; }
  .graph-query-examples { gap:6px; align-items:flex-start; }
  .graph-query-examples>span { width:100%; }
  .graph-query-examples #show-relations { margin-left:0; }
  .graph-search-resources { grid-template-columns:minmax(0,1fr); gap:7px; }
  .graph-definitions dl { grid-template-columns:86px minmax(0,1fr); gap:8px 10px; }
  .graph-category-note { width:100%; font-size:13px; }
  .graph-query-results-head { padding:12px; gap:5px; }
  .graph-query-results-head h2 { font-size:18px; }
  .graph-query-hits { grid-template-columns:minmax(0,1fr); max-height:190px; padding:9px; }
  .query-hit { min-height:96px; padding:11px 12px; }
  .graph-query-insight { max-height:150px; padding:11px 16px; }
}
@media(max-width:479px) {
  .graph-query-form .graph-controls { grid-template-columns:minmax(0,1fr); gap:8px; }
  .graph-query-form .graph-query-control { gap:4px; }
  .graph-advanced-fields { grid-template-columns:minmax(0,1fr); gap:8px; }
  .graph-definitions dl { grid-template-columns:minmax(0,1fr); gap:3px; }
  .graph-definitions dd+dt { margin-top:7px; }
  .graph-query-context { padding:8px 9px; }
}

