/* Readable resource bodies: directory, independent articles and Architecture.
 * Existing KGRID/DGRID identities and graph-driven sections are preserved. */
html body[data-template][data-page="research"] main.content-field {
  gap: 20px !important;
  grid-template-rows: auto auto auto !important;
}
html body[data-template][data-page="research"] .page-head {
  background: var(--panel) !important;
  border: 1px solid var(--line) !important;
  border-radius: 12px !important;
}
html body[data-template][data-page="research"] .page-head .lede { font-size: 1rem; }
html body[data-template][data-page="research"] .research-inspector-head { display: flex; flex-wrap: wrap; gap: 8px; }
html body[data-template][data-page="research"] .research-workspace .card p { font-size: .9375rem !important; }
html body[data-template][data-page="research"] :is(.research-workspace, .research-inspector) {
  padding: 20px !important;
  border: 1px solid var(--line) !important;
  background: var(--panel) !important;
  border-radius: 12px !important;
  min-width: 0;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}
html body[data-template][data-page="research"] .research-connection-structure {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  overflow: visible !important;
  gap: 8px !important;
}
html body[data-template][data-page="research"] .research-connection-structure b { white-space: normal; overflow: visible; overflow-wrap: anywhere; font-size: .875rem; }
html body[data-template][data-page="research"] .research-index-head {
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 8px !important;
}
html body[data-template][data-page="research"] .research-workspace .card {
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 12px !important;
}
html body[data-template][data-page="research"] .research-workspace .card :is(h3, p, .meta) {
  display: block !important;
  height: auto !important;
  max-height: none !important;
  -webkit-line-clamp: unset !important;
  white-space: normal !important;
  overflow: visible !important;
  text-align: left !important;
  overflow-wrap: anywhere;
}
html body[data-template][data-page="research"] .research-workspace .card[hidden] { display: none !important; }
.research-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-block: 16px; }
.research-filter button, .research-inspect {
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  white-space: normal;
}
.research-inspect { justify-self: start; }
.research-filter button:focus-visible, .research-inspect:focus-visible {
  outline: 2px solid var(--system);
  outline-offset: 3px;
}
.research-filter .is-active, .research-inspect[aria-pressed="true"] { border-color: var(--system); color: var(--system); }
html body[data-template][data-page="research-article"] main.content-field { display: block !important; }
html body[data-template][data-page="research-article"] .article-workspace {
  display: grid !important;
  grid-template-columns: minmax(0, 3fr) minmax(220px, 1fr) !important;
  gap: 24px;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  margin-top: 24px;
}
html body[data-template][data-page="research-article"] :is(.article-content, .article-body, .article-context) {
  height: auto !important;
  max-height: none !important;
  min-width: 0;
  padding: 24px;
  overflow: visible !important;
  overflow-wrap: anywhere;
}
html body[data-template][data-page="research-article"] .article-body { padding: 0; font-size: 1rem; line-height: 1.8; }
html body[data-template][data-page="research-article"] .article-body pre { overflow-x: auto !important; font-size: .875rem; }
@media (max-width: 1199px) {
  html body[data-template][data-page="research"] .research-inspector { grid-row: 4 !important; }
}
@media (max-width: 767px) {
  html body[data-template][data-page="research"] .research-connection-structure { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  html body[data-template][data-page="research-article"] .article-workspace { grid-template-columns: minmax(0, 1fr) !important; }
}
