#archive-explorer { padding: 1.25rem; overflow: auto; flex: 1; min-height: 0; color: var(--text); font-family: var(--sans); font-size: var(--fs-base); }
#archive-explorer h2 { font-size: var(--fs-lg); margin: 0 0 .4rem; }
#archive-explorer h3, #archive-explorer h4 { font-size: var(--fs-md); margin: .75rem 0; }
#archive-explorer p { margin: .6rem 0; line-height: 1.6; }
#archive-explorer button, #archive-explorer input, #archive-explorer select, #archive-explorer textarea { font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: .4rem; padding: .55rem .7rem; }
#archive-explorer button { cursor: pointer; min-height: 2.5rem; }
#archive-explorer button:hover { background: var(--surface-3); }
#archive-explorer :focus-visible { outline: 2px solid var(--archive); outline-offset: 2px; }
#archive-explorer label { display: flex; flex-direction: column; gap: .3rem; font-size: var(--fs-sm); }
.rx-heading, .rx-toolbar { display: flex; align-items: end; flex-wrap: wrap; gap: .7rem; margin-bottom: .9rem; }
.rx-heading { align-items: center; justify-content: space-between; }
.rx-query { flex: 1; min-width: 14rem; }
.rx-muted, .rx-result small, .rx-node small { color: var(--text-muted); }
#rx-status { padding: .65rem; background: var(--archive-dim); border-radius: .4rem; }
#rx-status.rx-error { color: var(--danger); background: var(--danger-dim); }
.rx-layout { display: grid; grid-template-columns: minmax(12rem, 1fr) minmax(20rem, 2.5fr) minmax(14rem, 1.2fr); gap: 1rem; }
.rx-layout > section { min-width: 0; }
#rx-results { max-height: 36rem; overflow: auto; }
.rx-result { display: flex; flex-direction: column; text-align: left; width: 100%; gap: .3rem; margin-bottom: .4rem; }
.rx-result span { overflow-wrap: anywhere; font-size: var(--fs-sm); max-height: 4.5rem; overflow: hidden; }
#rx-map { height: 30rem; overflow: auto; background: var(--surface-1); border: 1px solid var(--border); border-radius: .5rem; }
.rx-drawing { position: relative; transform-origin: top left; }
.rx-drawing svg { position: absolute; pointer-events: none; }
.rx-drawing line { stroke: var(--text-muted); stroke-width: 1; opacity: .45; }
.rx-groups rect { fill: var(--archive-dim); stroke: var(--archive); stroke-dasharray: 6 4; }
.rx-groups text { fill: var(--text-muted); font: 14px var(--sans); }
#archive-explorer .rx-kind-author_note { border-left-color: var(--library); }
#archive-explorer .rx-node { position: absolute; transform: translate(-50%, -50%); width: 11rem; display: flex; flex-direction: column; text-align: left; border-left: .3rem solid var(--archive); }
.rx-node strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#archive-explorer .rx-arranging .rx-node { cursor: grab; touch-action: none; user-select: none; }
#archive-explorer .rx-arranging .rx-node:active { cursor: grabbing; }
#rx-arrange[aria-pressed="true"] { border-color: var(--archive); background: var(--archive-dim); }
#rx-layout-state { color: var(--text-muted); font-size: var(--fs-sm); }
#rx-discard { padding: .75rem; border: 1px solid var(--archive); border-radius: .4rem; background: var(--archive-dim); margin-bottom: 1rem; }
#rx-canvas-review pre { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 12rem; overflow: auto; }
#rx-canvas-review article { border-bottom: 1px solid var(--border); padding-bottom: 1rem; }
#rx-knowledge-results { max-height: 32rem; overflow: auto; }
#rx-knowledge-results article { border-top: 1px solid var(--border); padding: .6rem; overflow-wrap: anywhere; }
#archive-explorer .rx-root { outline: 2px solid var(--archive); }
#archive-explorer .rx-kind-sources { border-left-color: var(--library); }
#archive-explorer .rx-kind-politics { border-left-color: var(--type-organisation); }
#archive-explorer .rx-kind-concepts { border-left-color: var(--type-concept); }
#rx-links { max-height: 16rem; overflow: auto; }
#rx-links ul { padding-left: 1rem; }
#rx-links li { margin-bottom: .5rem; line-height: 1.7; }
#rx-links button { font-size: var(--fs-sm); padding: .2rem .4rem; }
#rx-detail { max-height: 52rem; overflow: auto; overflow-wrap: anywhere; }
.rx-record-text, #rx-preview { white-space: pre-wrap; font: inherit; overflow-wrap: anywhere; }
#rx-detail blockquote { border-left: .2rem solid var(--archive); margin: .75rem 0; padding-left: .75rem; }
.rx-adoption { margin-top: 1rem; border-top: 1px solid var(--border); padding-top: 1rem; }
.rx-adoption summary { cursor: pointer; font-size: var(--fs-md); }
.rx-adoption textarea, .rx-adoption input { width: 100%; box-sizing: border-box; }
.rx-adoption label { margin: 1rem 0 .6rem; }
#rx-preview { max-height: 24rem; overflow: auto; }
@media (max-width: 1000px) { .rx-layout { grid-template-columns: minmax(12rem, 1fr) minmax(20rem, 2fr); } .rx-layout > section:last-child { grid-column: 1 / -1; } }
@media (max-width: 650px) { .rx-layout { display: flex; flex-direction: column; } #rx-results { max-height: 15rem; } .rx-toolbar > label, .rx-toolbar > button { flex: 1 1 45%; } #rx-map { height: 24rem; } }
