/* Neuron Explorer, on top of ../tokens.css and ../site.css. The site header is shared; the
   explorer's own control (which RPC it reads) sits in a toolbar under it. */

.explorer { font-size: 16px; }
.ex-bar { display: flex; align-items: center; justify-content: flex-end; gap: var(--space-3); padding-top: var(--space-4); }
.ex-bar__label { font-size: 14px; color: var(--muted); }
.ex-note { margin-top: var(--space-8); }
.muted { color: var(--muted); font-weight: 400; }

.endpoint { display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--target); border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: var(--radius-md); padding: 0 var(--space-3) 0 var(--space-4); font: 500 15px var(--font); cursor: pointer; max-width: 60vw; transition: border-color var(--fast) var(--ease); }
.endpoint:hover { border-color: var(--color-secondary); }
.endpoint svg { flex: none; width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform var(--fast) var(--ease); }
.endpoint[aria-expanded="true"] svg { transform: rotate(180deg); }
.endpoint span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.endpoint__dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.endpoint__dot.is-ok { background: var(--accent); }
.endpoint__dot.is-bad { background: var(--danger); }

.endpoint-panel { padding-top: 12px; }
.endpoint-form { display: grid; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
@media (min-width: 820px) { .endpoint-form { grid-template-columns: 1.3fr 1fr 1fr auto; align-items: end; } }
.endpoint-form label { display: grid; gap: 6px; font-size: 14px; font-weight: 500; }
.endpoint-form input, .endpoint-form select, .search input { font: inherit; min-height: var(--target); padding: 0 var(--space-4); border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--bg); color: var(--text); min-width: 0; }
.endpoint-form input:focus-visible, .endpoint-form select:focus-visible, .search input:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }

.explorer__main { padding-top: 24px; padding-bottom: 72px; min-height: 60vh; }
.explorer__main:focus { outline: none; }
.search { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin-bottom: 28px; }
.search input { font-family: var(--mono); font-size: 14px; }

.ex-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 14px; margin-bottom: 18px; }
.ex-title h1 { font-size: clamp(26px, 3vw, 32px); margin: 0; }
.ex-title .mono { font-size: 0.9rem; color: var(--muted); word-break: break-all; }

.stats-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 28px; }
@media (min-width: 820px) { .stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px 16px; min-width: 0; }
.stat dt { font-size: 13px; color: var(--muted); font-weight: 500; }
.stat dd { margin: 4px 0 0; font: 600 22px var(--mono); font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat dd.small { font: 600 0.88rem var(--mono); }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 20px; overflow: hidden; }
.panel__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.panel__head h2 { font-size: 17px; font-weight: 700; margin: 0; }
.panel__body { padding: 4px 0; }
.panel__body--pad { padding: 14px 18px; }

.ex-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.ex-table th, .ex-table td { text-align: left; padding: 10px 18px; border-bottom: 1px solid var(--border); vertical-align: top; }
.ex-table tr:last-child td { border-bottom: 0; }
.ex-table th { color: var(--muted); font-weight: 500; font-size: 13px; }
.ex-scroll { overflow-x: auto; }

.kvs { display: grid; grid-template-columns: minmax(120px, 200px) minmax(0, 1fr); margin: 0; }
.kvs dt, .kvs dd { padding: 10px 18px; border-bottom: 1px solid var(--border); margin: 0; }
.kvs dt { color: var(--muted); font-weight: 500; font-size: 14px; }
.kvs dd { word-break: break-all; font-variant-numeric: tabular-nums; }
.kvs > :nth-last-child(-n + 2) { border-bottom: 0; }

.mono { font-family: var(--mono); font-size: 0.86rem; }
a.mono, .ex-table a { text-decoration: none; }
a.mono:hover, .ex-table a:hover { text-decoration: underline; }

.pill { display: inline-block; padding: 2px var(--space-2); border-radius: var(--radius-sm); font-size: 12px; font-weight: 500; white-space: nowrap; border: 1px solid transparent; }
.pill--ok { color: var(--accent); border-color: rgba(20, 241, 149, 0.4); }
.pill--bad { color: var(--danger); border-color: rgba(255, 90, 60, 0.5); }
.pill--neuron { color: var(--brand); border-color: rgba(232, 140, 203, 0.5); }
.pill--muted { color: var(--muted); border-color: var(--border); }

.ix { border-top: 1px solid var(--border); padding: 14px 18px; }
.ix:first-child { border-top: 0; }
.ix__head { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; margin-bottom: 8px; }
.ix__head strong { font-size: 0.98rem; }
.ix__inner { margin: 10px 0 0 14px; padding-left: 12px; border-left: 2px solid var(--border); }
.args { display: grid; grid-template-columns: minmax(100px, 180px) minmax(0, 1fr); gap: 4px 12px; font-size: 0.88rem; margin: 6px 0 0; }
.args dt { color: var(--muted); }
.args dd { margin: 0; word-break: break-all; font-family: var(--mono); font-size: 0.84rem; }

.logs { margin: 0; padding: 14px 18px; background: var(--code-bg); color: var(--text); font: 0.8rem/1.6 var(--mono); overflow-x: auto; white-space: pre-wrap; word-break: break-word; max-height: 420px; }
details.panel > summary { cursor: pointer; display: flex; align-items: center; min-height: var(--target); padding: 0 18px; font-weight: 500; list-style: none; }
details.panel > summary::-webkit-details-marker { display: none; }
details.panel > summary::before { content: "▸ "; color: var(--muted); }
details.panel[open] > summary::before { content: "▾ "; }

.notice { border: 1px solid var(--border); border-left: 3px solid var(--danger); background: var(--surface); border-radius: var(--radius-md); padding: 14px 18px; }
.notice p:last-child { margin: 0; }
.empty { color: var(--muted); padding: 18px; }
.refresh { display: inline-flex; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--muted); }
.refresh input { accent-color: var(--brand); }
.loading { color: var(--muted); }
