/* Hadal workspace — one stylesheet for Dashboard, Transactions, Trace, Methodology and Research.
   Reference: cool-grey exterior, white inset frame, pale sidebar, hairline cards, restrained orange.
   Type floor: 12px for text, 11px only for uppercase micro-labels. All text colours meet AA on white. */

/* ───────── Shell ───────── */
body.workspace { padding: 24px; font-size: 13px; line-height: 1.5; }
.app-frame { display: grid; grid-template-columns: 236px minmax(0, 1fr); max-width: 1560px; min-height: calc(100vh - 48px); margin: 0 auto; background: linear-gradient(90deg, var(--surface-2) 235px, var(--line) 235px, var(--line) 236px, var(--surface) 236px); border: 1px solid #fff; border-radius: var(--r-frame); box-shadow: 0 0 0 8px #f4f4f6, 0 18px 40px -24px #17191e30; overflow: clip; }
.sidebar { position: sticky; top: 0; align-self: start; height: calc(100vh - 24px); display: flex; flex-direction: column; padding: 14px 12px 12px; background: var(--surface-2); border-right: 1px solid var(--line); overflow-y: auto; }
.brand-block { display: flex; align-items: center; gap: 10px; padding: 9px 10px; margin-bottom: 6px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-panel); }
.brand-block:hover { border-color: var(--line-strong); }
.brand-block .brand-mark { width: 36px; height: 36px; border-radius: var(--r-control); }
.brand-text { display: grid; line-height: 1.25; min-width: 0; }
.brand-text strong { font-size: 15px; font-weight: 600; letter-spacing: -.02em; }
.brand-text small { font-size: 12px; color: var(--muted); }
.nav-label { margin: 18px 10px 6px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.sidebar nav { display: grid; gap: 2px; }
.sidebar nav a { position: relative; display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 0 10px; border: 1px solid transparent; border-radius: var(--r-control); color: var(--ink-2); font-size: 13px; font-weight: 500; }
.sidebar nav a .icon { color: var(--muted); }
.sidebar nav a:hover { background: var(--surface-3); color: var(--ink); }
.sidebar nav a.selected { background: #fff; border-color: var(--line); color: var(--ink); font-weight: 600; box-shadow: var(--shadow); }
.sidebar nav a.selected .icon { color: var(--beam-ink); }
.sidebar nav a.selected::before { content: ""; position: absolute; left: -13px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--beam); }
.sidebar-foot { margin-top: auto; display: grid; gap: 2px; padding-top: 16px; }
.sidebar-foot > a { display: flex; align-items: center; gap: 10px; min-height: 34px; padding: 0 10px; border-radius: var(--r-control); color: var(--muted); font-size: 13px; }
.sidebar-foot > a:hover { background: var(--surface-3); color: var(--ink); }
.collector-card { display: flex; align-items: center; gap: 10px; margin-top: 8px; padding: 9px 10px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-panel); }
.collector-card strong { display: block; font-size: 13px; font-weight: 600; line-height: 1.3; }
.collector-card small { display: block; font-size: 12px; color: var(--muted); line-height: 1.35; }
.collector-icon { position: relative; display: grid; place-items: center; width: 32px; height: 32px; border-radius: var(--r-control); background: var(--surface-3); color: var(--muted); flex-shrink: 0; }
.collector-icon::after { content: ""; position: absolute; right: -3px; top: -3px; width: 9px; height: 9px; border-radius: 50%; background: var(--faint); border: 2px solid #fff; }
.collector-card[data-state="ok"] .collector-icon { background: var(--ok-soft); color: var(--ok); }
.collector-card[data-state="ok"] .collector-icon::after { background: var(--ok); }
.collector-card[data-state="warn"] .collector-icon { background: var(--warn-soft); color: var(--warn); }
.collector-card[data-state="warn"] .collector-icon::after { background: #d98a00; }
.collector-card[data-state="bad"] .collector-icon { background: var(--bad-soft); color: var(--bad); }
.collector-card[data-state="bad"] .collector-icon::after { background: var(--bad); }

.workspace-body { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 16px; min-height: 60px; padding: 10px 24px; border-bottom: 1px solid var(--line); background: #fff; }
.quick-search { flex: 1 1 280px; max-width: 420px; display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px; background: #fff; border: 1px solid var(--line-strong); border-radius: var(--r-control); color: var(--muted); }
.quick-search:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px #17191e14; }
.quick-search input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; color: var(--ink); font-size: 13px; }
.quick-search input:focus-visible { box-shadow: none; }
.quick-search input::placeholder { color: var(--muted); }
kbd { font: 500 11px/1 var(--font); padding: 3px 5px; border: 1px solid var(--line-strong); border-radius: 4px; color: var(--muted); background: var(--surface-2); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.conn { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 550; color: var(--ink-2); padding: 0 4px; white-space: nowrap; }
.conn-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.conn[data-state="ok"] .conn-dot { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.conn[data-state="warn"] .conn-dot { background: #d98a00; box-shadow: 0 0 0 3px var(--warn-soft); }
.conn[data-state="bad"] .conn-dot { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border: 1px solid var(--line); border-radius: var(--r-chip); background: #fff; color: var(--ink-2); font-size: 12px; font-weight: 550; line-height: 1.4; white-space: nowrap; }
.chip.beam { background: var(--beam-soft); border-color: var(--beam-line); color: var(--beam-ink); }
.chip.ok { background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok); }
.chip.warn { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn); }
.button.primary { background: var(--beam); border-color: var(--beam); color: #fff; }
.button.primary:hover { background: #e9561a; border-color: #e9561a; }
.button .icon { width: 16px; height: 16px; }
main { flex: 1; min-width: 0; padding: 22px 24px 20px; display: flex; flex-direction: column; gap: var(--gap); }
main:focus { outline: none; }

/* ───────── Page head ───────── */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 4px; }
.page-head h1 { font-size: 24px; font-weight: 520; letter-spacing: -.025em; line-height: 1.2; }
.page-head p { margin-top: 4px; color: var(--muted); font-size: 13px; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* ───────── Panels ───────── */
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--r-panel); padding: 16px; box-shadow: var(--shadow); min-width: 0; }
.panel-head { display: flex; align-items: center; gap: 10px; min-height: 28px; margin-bottom: 12px; }
.panel-head h2 { margin-right: auto; font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.panel-foot-link { display: flex; align-items: center; justify-content: space-between; margin: 14px -16px -16px; padding: 11px 16px; border-top: 1px solid var(--line); font-size: 12.5px; font-weight: 550; color: var(--ink-2); }
.panel-foot-link:hover { color: var(--beam-ink); background: var(--surface-2); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.dot.beam { background: var(--beam); }
.dot.rpc { background: var(--rpc); }
.segmented { display: inline-flex; gap: 2px; padding: 2px; background: var(--surface-3); border: 1px solid var(--line); border-radius: var(--r-control); }
.segmented button { min-height: 28px; padding: 0 11px; border: 1px solid transparent; border-radius: 4px; font-size: 12.5px; font-weight: 550; color: var(--muted); white-space: nowrap; }
.segmented button:hover { color: var(--ink); }
.segmented button.active, .segmented button[aria-pressed="true"] { background: #fff; border-color: var(--line); color: var(--ink); box-shadow: 0 1px 2px #17191e12; }
.callout { display: flex; align-items: flex-start; gap: 10px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r-panel); background: var(--surface-2); color: var(--ink-2); font-size: 12.5px; line-height: 1.55; }
.callout .icon { margin-top: 2px; color: var(--muted); }
.callout strong { color: var(--ink); font-weight: 600; }
.sample-callout { background: var(--beam-soft); border-color: var(--beam-line); color: #5a2a10; }
.sample-callout .icon { color: var(--beam-ink); }
.sample-callout strong { color: #3f1a07; }
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 220px; display: grid; gap: 8px; padding: 12px; background: #fff; border: 1px solid var(--line-strong); border-radius: var(--r-panel); box-shadow: 0 12px 30px -10px #17191e33; }
.menu-label { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* ───────── Status banner ───────── */
.status-banner { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r-panel); background: var(--surface-2); }
.banner-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: var(--r-control); background: #fff; border: 1px solid var(--line); color: var(--muted); flex-shrink: 0; }
.banner-icon .icon { width: 16px; height: 16px; }
.banner-copy { flex: 1; min-width: 0; }
.banner-copy p { font-size: 13px; font-weight: 600; color: var(--ink); line-height: 1.35; }
.banner-copy small { display: block; margin-top: 1px; font-size: 12.5px; color: var(--ink-2); line-height: 1.45; }
.mode-pills { display: flex; gap: 6px; flex-shrink: 0; }
.mode-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border: 1px solid var(--line-strong); border-radius: 99px; background: #fff; color: var(--muted); font-size: 12px; font-weight: 550; white-space: nowrap; }
.mode-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.mode-pill[data-on="true"] { color: var(--ok); border-color: var(--ok-line); background: var(--ok-soft); }
.mode-pill[data-on="true"]::before { background: var(--ok); }
.status-banner[data-state="observing"] { background: #f4f9f6; border-color: var(--ok-line); }
.status-banner[data-state="observing"] .banner-icon { color: var(--ok); border-color: var(--ok-line); }
.status-banner[data-state="sampling"] { background: var(--ok-soft); border-color: var(--ok-line); }
.status-banner[data-state="sampling"] .banner-icon { color: var(--ok); border-color: var(--ok-line); }
.status-banner[data-state="degraded"], .status-banner[data-state="stale"] { background: var(--warn-soft); border-color: var(--warn-line); }
.status-banner[data-state="degraded"] .banner-icon, .status-banner[data-state="stale"] .banner-icon { color: var(--warn); border-color: var(--warn-line); }
.status-banner[data-state="offline"] { background: var(--bad-soft); border-color: var(--bad-line); }
.status-banner[data-state="offline"] .banner-icon { color: var(--bad); border-color: var(--bad-line); }

/* ───────── Dashboard grids ───────── */
.grid-summary { display: grid; grid-template-columns: minmax(250px, 300px) minmax(0, 1fr); gap: var(--gap); }
.grid-analytics { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 340px); gap: var(--gap); }
.grid-bottom { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: var(--gap); }
.probe-overview { display: flex; flex-direction: column; }
.overview-total { display: flex; align-items: baseline; gap: 8px; }
.overview-total strong { font-size: 40px; font-weight: 480; letter-spacing: -.03em; line-height: 1.1; }
.overview-total span { color: var(--muted); font-size: 13px; }
.overview-sub { display: flex; justify-content: space-between; margin: 14px 0 8px; font-size: 12.5px; color: var(--muted); }
.overview-sub strong { color: var(--ink); font-weight: 600; }
.route-chips { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.route-chips a { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--r-control); font-size: 13px; font-weight: 500; }
.route-chips a strong { margin-left: auto; font-weight: 600; }
.route-chips a:hover { border-color: var(--line-strong); background: var(--surface-2); }
.route-chips a:first-child { background: var(--beam-soft); border-color: var(--beam-line); }
.overview-note { margin-top: auto; padding-top: 12px; font-size: 12px; line-height: 1.5; color: var(--muted); }
.overview-note:empty { display: none; }

.route-pair { display: grid; grid-template-columns: 1fr 1fr; background: #fff; border: 1px solid var(--line); border-radius: var(--r-panel); box-shadow: var(--shadow); overflow: hidden; min-width: 0; }
.compact-route { display: flex; flex-direction: column; min-width: 0; }
.compact-route + .compact-route { border-left: 1px solid var(--line); }
.compact-route-main { flex: 1; padding: 16px; }
.compact-route .panel-head { margin-bottom: 8px; }
.route-head-icon { display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid var(--line); border-radius: var(--r-control); color: var(--muted); }
.compact-route.beam .route-head-icon { background: var(--beam-soft); border-color: var(--beam-line); color: var(--beam-ink); }
.route-head-icon .icon { width: 16px; height: 16px; }
.compact-route-value { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.route-figure { display: block; font-size: 34px; font-weight: 480; letter-spacing: -.03em; line-height: 1.1; }
.route-figure em { font-style: normal; font-size: 18px; color: var(--muted); margin-left: 2px; }
.route-figure .of { font-size: 18px; color: var(--muted); font-weight: 450; }
.compact-route-value small { display: block; margin-top: 4px; font-size: 12.5px; color: var(--ink-2); line-height: 1.4; }
.route-mini { width: 54px; height: 54px; flex-shrink: 0; }
.route-mini svg { width: 100%; height: 100%; }
.sample-meter { display: flex; align-items: center; gap: 4px; margin-top: 12px; }
.sample-meter i { width: 14px; height: 8px; border-radius: 2px; background: var(--surface-3); border: 1px solid var(--line-strong); }
.sample-meter.beam i.on { background: var(--beam); border-color: var(--beam); }
.sample-meter.rpc i.on { background: var(--rpc); border-color: var(--rpc); }
.sample-meter span { margin-left: 6px; font-size: 12px; font-weight: 550; color: var(--ink-2); }
.route-stats { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.route-stats strong { color: var(--ink); font-weight: 600; margin-left: 2px; }
.route-interval { margin-top: 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); }
.compact-route details { border-top: 1px solid var(--line); }
.compact-route summary, .disclosure > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 40px; padding: 0 16px; cursor: pointer; font-size: 12.5px; font-weight: 550; color: var(--ink-2); }
.compact-route summary::-webkit-details-marker, .disclosure > summary::-webkit-details-marker { display: none; }
.compact-route summary:hover, .disclosure > summary:hover { background: var(--surface-2); color: var(--ink); }
.compact-route summary .icon { width: 14px; height: 14px; transition: transform var(--t) var(--ease); }
.compact-route details[open] summary .icon { transform: rotate(90deg); }
.compact-route details > div { padding: 4px 16px 16px; }
.compact-route dl { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; font-size: 12.5px; }
.compact-route dt { color: var(--muted); }
.compact-route dd { font-weight: 600; text-align: right; }
.compact-route details p { margin-top: 10px; font-size: 12px; line-height: 1.55; color: var(--muted); }

.statline { display: flex; flex-wrap: wrap; gap: 4px 28px; margin-bottom: 10px; }
.statline span { display: flex; align-items: baseline; gap: 8px; }
.statline strong { font-size: 26px; font-weight: 480; letter-spacing: -.02em; }
.statline small { font-size: 12.5px; color: var(--muted); }
.plot-figure { margin: 0; }
.plot { position: relative; height: 200px; border-radius: 6px; }
.plot svg { display: block; width: 100%; height: 100%; overflow: visible; }
.plot-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 16px; text-align: center; border: 1px dashed var(--line-strong); border-radius: 6px; background: var(--surface-2); color: var(--ink-2); font-size: 13px; }
.plot-empty strong { font-weight: 600; color: var(--ink); }
.plot-empty small { max-width: 420px; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.plot-empty .icon { color: var(--faint); width: 22px; height: 22px; }
.plot-caption { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-2); }
.plot-caption span { display: inline-flex; align-items: center; gap: 6px; }
.plot-count { margin-left: auto; color: var(--muted); font-weight: 550; }
.window-note { flex-basis: 100%; color: var(--muted); font-size: 12px; line-height: 1.5; }
.window-note:empty { display: none; }
.threshold { margin-top: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-control); background: var(--surface-2); font-size: 12.5px; }
.threshold input[type="range"] { width: 100%; margin: 8px 0 4px; accent-color: var(--beam); }
#latency-readout { display: flex; flex-wrap: wrap; gap: 4px 16px; color: var(--ink-2); }
#latency-readout span { display: inline-flex; align-items: center; gap: 6px; }
.beam-dot, .rpc-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.beam-dot { background: var(--beam); }
.rpc-dot { background: var(--rpc); }

.landing-health { display: flex; flex-direction: column; }
#landing-gauge { display: grid; place-items: center; padding: 4px 0 0; }
.health-gauge { width: 100%; max-width: 280px; height: auto; }
.health-route-legend { display: grid; gap: 1px; margin-top: 6px; padding: 8px 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-control); }
.health-route-legend > div { display: flex; align-items: center; gap: 8px; min-height: 30px; font-size: 12.5px; color: var(--ink-2); }
.health-route-legend i { width: 14px; height: 4px; border-radius: 2px; background: var(--rpc); }
.health-route-legend > div:first-child i { background: var(--beam); }
.health-route-legend strong { margin-left: auto; font-weight: 600; color: var(--ink); }
.health-route-legend span small { color: var(--muted); }
.landing-health .panel-foot-link { margin-top: auto; }

.instrument { display: flex; flex-direction: column; }
.activity-count { display: flex; align-items: baseline; gap: 8px; margin-bottom: 12px; }
.activity-count strong { font-size: 32px; font-weight: 480; letter-spacing: -.02em; }
.activity-count span { color: var(--muted); }
.runway-stages { display: grid; grid-template-columns: repeat(3, 1fr); padding: 0 8px 4px 56px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.runway-stages span:nth-child(2) { text-align: center; } .runway-stages span:nth-child(3) { text-align: right; }
.lane { display: grid; grid-template-columns: 56px 1fr; align-items: center; min-height: 40px; }
.lane-label { font-size: 12px; font-weight: 650; color: var(--muted); letter-spacing: .04em; }
.lane.beam .lane-label { color: var(--beam-ink); }
.lane-track { position: relative; height: 28px; margin-right: 8px; }
.lane-track::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 2px; margin-top: -1px; border-radius: 1px; background: var(--line); }
.stage-line { position: absolute; top: 5px; bottom: 5px; width: 1px; background: var(--line-strong); }
.stage-line.mid { left: 50%; }
.stage-line.end { left: calc(98% + 7px); }
.probe-dot { position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--rpc); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line-strong); }
.lane.beam .probe-dot { background: var(--beam); box-shadow: 0 0 0 1px var(--beam-line); }
.probe-dot::after { content: ""; position: absolute; inset: -6px; }
.probe-dot.pending { background: #fff; box-shadow: 0 0 0 2px var(--rpc); }
.lane.beam .probe-dot.pending { box-shadow: 0 0 0 2px var(--beam); }
.probe-dot.failed { background: var(--bad); box-shadow: 0 0 0 1px var(--bad); }
.probe-dot.expired { background: #fff; box-shadow: 0 0 0 2px var(--warn); }
.lane-track.empty::before { background: repeating-linear-gradient(90deg, var(--line-strong) 0 4px, transparent 4px 8px); height: 1px; }
.lane-empty { background: #fff; width: max-content; margin: auto; padding: 0 10px; inset: 0; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--muted); }
.activity-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: auto; padding-top: 14px; }
.activity-meta span { display: block; font-size: 12px; color: var(--muted); }
.activity-meta strong { font-size: 13px; font-weight: 600; }

/* ───────── Tables ───────── */
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-control); }
.table-scroll:focus-visible { box-shadow: var(--focus); border-radius: var(--r-control); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { padding: 9px 12px; text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 12px; vertical-align: top; border-bottom: 1px solid var(--line); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fcfcfd; }
td small { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); font-family: var(--mono); letter-spacing: -.02em; }
.sig-button { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 12.5px; font-weight: 500; color: var(--ink); letter-spacing: -.01em; }
.sig-button:hover { color: var(--beam-ink); text-decoration: underline; text-underline-offset: 3px; }
.sig-button .icon { width: 13px; height: 13px; color: var(--muted); }
.tag { display: inline-flex; align-items: center; padding: 2px 8px; border: 1px solid var(--line-strong); border-radius: var(--r-chip); background: var(--rpc-soft); color: var(--rpc-ink); font-size: 11px; font-weight: 650; letter-spacing: .06em; }
.tag.beam { background: var(--beam-soft); border-color: var(--beam-line); color: var(--beam-ink); }
.state-confirmed { color: var(--ok); font-weight: 600; }
.state-failed { color: var(--bad); font-weight: 600; }
.state-expired { color: var(--warn); font-weight: 600; }
.state-sending, .state-submitted { color: var(--ink-2); font-weight: 600; }
.state-confirmed small, .state-failed small, .state-expired small { color: var(--muted); }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 34px 16px; text-align: center; color: var(--ink-2); }
.empty-state strong { font-size: 14px; font-weight: 600; color: var(--ink); }
.empty-state > span:not(.empty-icon) { max-width: 420px; color: var(--muted); font-size: 13px; }
.empty-icon { display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 4px; border: 1px solid var(--line); border-radius: var(--r-panel); background: var(--surface-2); color: var(--muted); }
.ledger .table-scroll + .empty-state { border-top: 0; }

/* ───────── Transactions ───────── */
.stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); }
.stat-tile { padding: 14px 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-panel); box-shadow: var(--shadow); }
.stat-tile span { display: block; font-size: 12.5px; color: var(--muted); }
.stat-tile strong { display: block; margin: 4px 0 2px; font-size: 30px; font-weight: 480; letter-spacing: -.02em; line-height: 1.15; }
.stat-tile small { font-size: 12px; color: var(--muted); }
.coverage-note { margin: -4px 0 12px; font-size: 12.5px; color: var(--ink-2); line-height: 1.55; }
.coverage-note:empty { display: none; }
.ledger-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.ledger-search { flex: 1 1 240px; display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: var(--r-control); color: var(--muted); }
.ledger-search:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px #17191e14; }
.ledger-search input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; font-size: 13px; color: var(--ink); }
.ledger-search input:focus-visible { box-shadow: none; }
.ledger-search input::placeholder { color: var(--muted); }
.select select { height: 36px; padding: 0 30px 0 10px; border: 1px solid var(--line-strong); border-radius: var(--r-control); background: #fff; font-size: 13px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235f636f' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; background-size: 14px; }
.ledger-pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; font-size: 12.5px; color: var(--ink-2); }
.ledger-pagination > div { display: flex; align-items: center; gap: 10px; }
.ledger-pagination .button { min-height: 32px; padding: 4px 12px; }

/* ───────── Trace ───────── */
.trace-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 320px); gap: var(--gap); align-items: start; }
.trace-main { display: grid; gap: var(--gap); min-width: 0; }
.signature-card .panel-head h2 label { font-size: 14px; font-weight: 600; }
.signature-card form { display: flex; gap: 8px; }
.signature-field { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--r-control); color: var(--muted); }
.signature-field:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px #17191e14; }
.signature-field input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; font: 13px var(--mono); color: var(--ink); }
.signature-field input:focus-visible { box-shadow: none; }
.signature-field input::placeholder { color: var(--muted); font-family: var(--font); }
.signature-card .button { min-height: 40px; }
.form-caption { display: flex; align-items: flex-start; gap: 8px; margin-top: 10px; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.form-caption .icon { width: 14px; height: 14px; margin-top: 2px; }
.trace-start { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 36px 20px; text-align: center; }
.trace-start h2 { font-size: 16px; font-weight: 600; }
.trace-start p { max-width: 460px; color: var(--muted); }
.empty-steps { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 8px; }
.empty-steps span { padding: 4px 10px; border: 1px solid var(--line); border-radius: 99px; font-size: 12px; color: var(--ink-2); background: var(--surface-2); }
.trace-loading { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 40px 16px; color: var(--ink-2); text-align: center; }
.trace-loading strong { color: var(--ink); }
.spinner { width: 20px; height: 20px; border: 2px solid var(--line-strong); border-top-color: var(--beam); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.trace-error { display: flex; align-items: flex-start; gap: 10px; padding: 14px 16px; border: 1px solid var(--bad-line); border-radius: var(--r-panel); background: var(--bad-soft); color: #7d1a14; font-size: 13px; }
.trace-error .icon { margin-top: 2px; color: var(--bad); }
.trace-notes h2 { font-size: 15px; font-weight: 600; margin: 4px 0 14px; }
.notes-kicker { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.trace-notes ol { display: grid; gap: 14px; margin-bottom: 14px; }
.trace-notes li { display: flex; gap: 10px; }
.trace-notes li strong { font-size: 13px; font-weight: 600; }
.trace-notes li p { margin-top: 2px; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.note-icon { display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid var(--line); border-radius: var(--r-control); background: var(--surface-2); color: var(--ink-2); flex-shrink: 0; }
.note-icon .icon { width: 15px; height: 15px; }
.trace-notes > a { padding-top: 12px; border-top: 1px solid var(--line); display: flex; }

.trace-evidence { display: grid; gap: 14px; }
.trace-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.trace-summary .links { margin-left: auto; display: flex; gap: 14px; }
.outcome-pill { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 99px; font-size: 13px; font-weight: 600; background: var(--ok-soft); color: var(--ok); border: 1px solid var(--ok-line); }
.outcome-pill .icon { width: 15px; height: 15px; }
.outcome-pill.warning { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.outcome-pill.failed { background: var(--bad-soft); color: var(--bad); border-color: var(--bad-line); }
.outcome-pill.unknown { background: var(--surface-3); color: var(--ink-2); border-color: var(--line-strong); }
.trace-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; padding: 12px 0; border-block: 1px solid var(--line); }
.trace-facts small, .fact-grid small { display: block; font-size: 12px; color: var(--muted); }
.trace-facts strong { display: block; margin-top: 2px; font-size: 15px; font-weight: 560; }
.evidence-lanes { display: grid; gap: 10px; }
.lane-block { border: 1px solid var(--line); border-radius: var(--r-panel); background: #fff; overflow: hidden; }
.lane-block > header { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.lane-block > header h3 { margin-right: auto; font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.lane-block > header h3 .icon { width: 16px; height: 16px; color: var(--muted); }
.lane-block.beam-lane > header h3 .icon { color: var(--beam-ink); }
.lane-body { padding: 12px 14px; }
.stage-ladder { display: grid; gap: 4px; }
.stage-row { display: grid; grid-template-columns: 168px minmax(0, 1fr) 80px; align-items: center; gap: 12px; min-height: 36px; }
.stage-name { font-size: 13px; font-weight: 550; }
.stage-name small { display: block; font-size: 12px; font-weight: 400; color: var(--muted); }
.stage-bar { position: relative; height: 22px; }
.stage-bar::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 2px; margin-top: -1px; background: var(--line); border-radius: 1px; }
.stage-bar i { position: absolute; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--beam); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--beam-line); }
.stage-bar.rpc i { background: var(--rpc); box-shadow: 0 0 0 1px var(--line-strong); }
.stage-bar .span { position: absolute; top: 50%; height: 4px; margin-top: -2px; border-radius: 2px; background: var(--beam-line); }
.stage-bar.rpc .span { background: var(--line-strong); }
.stage-row[data-state="unknown"] .stage-bar i { display: none; }
.stage-row[data-state="unknown"] .stage-bar::before { background: repeating-linear-gradient(90deg, var(--line-strong) 0 4px, transparent 4px 8px); }
.stage-value { text-align: right; font-size: 13px; font-weight: 600; }
.stage-row[data-state="unknown"] .stage-value { color: var(--muted); font-weight: 500; }
.fact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 16px; }
.fact-grid strong { display: block; margin-top: 1px; font-size: 13px; font-weight: 600; }
.lane-note { margin-top: 10px; font-size: 12px; color: var(--muted); line-height: 1.5; }
.reconcile { display: grid; gap: 6px; }
.reconcile h3 { font-size: 13px; font-weight: 600; }
.reconcile ul { display: grid; gap: 6px; }
.reconcile li { display: flex; align-items: flex-start; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-control); background: var(--surface-2); font-size: 12.5px; line-height: 1.5; color: var(--ink-2); }
.reconcile li .icon { width: 15px; height: 15px; margin-top: 2px; }
.reconcile li.agree { background: #f4f9f6; border-color: var(--ok-line); } .reconcile li.agree .icon { color: var(--ok); }
.reconcile li.conflict { background: var(--bad-soft); border-color: var(--bad-line); color: #6d1913; } .reconcile li.conflict .icon { color: var(--bad); }
.reconcile li.missing { background: var(--warn-soft); border-color: var(--warn-line); color: #5f3700; } .reconcile li.missing .icon { color: var(--warn); }
.trace-evidence > details { border: 1px solid var(--line); border-radius: var(--r-panel); }
.trace-evidence > details > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; min-height: 40px; padding: 0 14px; cursor: pointer; font-size: 12.5px; font-weight: 550; color: var(--ink-2); }
.trace-evidence > details > summary::-webkit-details-marker { display: none; }
.trace-timeline { display: grid; gap: 0; padding: 4px 14px 12px; }
.trace-timeline li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 8px 0; border-top: 1px solid var(--line); }
.trace-timeline li:first-child { border-top: 0; }
.timeline-point { display: grid; place-items: center; width: 28px; height: 28px; border-radius: var(--r-control); background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); }
.timeline-point .icon { width: 15px; height: 15px; }
.timeline-copy strong { display: block; font-size: 13px; font-weight: 600; }
.timeline-copy small { display: block; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.timeline-time { font-size: 12px; font-weight: 550; color: var(--ink-2); white-space: nowrap; }
.trace-hint { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r-control); background: var(--surface-2); border: 1px solid var(--line); font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }
.trace-hint .icon { width: 15px; height: 15px; margin-top: 2px; color: var(--muted); }

/* ───────── Disclosures & evidence blocks (dashboard) ───────── */
.disclosure { padding: 0; }
.disclosure > summary { min-height: 46px; padding: 0 16px; gap: 10px; justify-content: flex-start; }
.disclosure > summary .icon { color: var(--muted); }
.disclosure-hint { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.disclosure[open] .disclosure-hint .icon { transform: rotate(180deg); }
.measurement-detail-body { display: grid; gap: 14px; padding: 4px 16px 16px; font-size: 13px; color: var(--ink-2); line-height: 1.6; border-top: 1px solid var(--line); padding-top: 14px; }
.block-evidence { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-control); background: var(--surface-2); }
.block-evidence span { display: block; font-size: 12.5px; color: var(--muted); }
.block-evidence p { grid-column: 1 / -1; font-size: 12.5px; color: var(--muted); }
.evidence-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.outcomes-panel, .tail-panel { padding: 14px; border: 1px solid var(--line); border-radius: var(--r-panel); }
.outcome-route { padding: 10px 0; border-top: 1px solid var(--line); }
.outcome-route:first-child { border-top: 0; padding-top: 0; }
.outcome-route-head { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 13px; }
.outcome-route-head span { color: var(--muted); }
.outcome-route-head i { margin-right: 6px; }
.outcome-bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--surface-3); }
.outcome-segment.succeeded { background: var(--ok); } .outcome-segment.execution-failed { background: var(--bad); } .outcome-segment.expired { background: #d98a00; } .outcome-segment.pending { background: repeating-linear-gradient(45deg, var(--rpc) 0 3px, #fff 3px 6px); }
.outcome-counts { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.outcome-counts strong { color: var(--ink); }
.outcome-key { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; background: var(--rpc); }
.outcome-key.succeeded { background: var(--ok); } .outcome-key.execution-failed { background: var(--bad); } .outcome-key.expired { background: #d98a00; }
.cohort-bound { display: flex; justify-content: space-between; margin-top: 8px; font-size: 12.5px; color: var(--ink-2); }
.footnote { margin-top: 10px; font-size: 12px; color: var(--muted); line-height: 1.5; }
.tail-row { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 4px; border-top: 1px solid var(--line); font-family: var(--mono); font-size: 12.5px; }
.tail-row:first-child { border-top: 0; }
.tail-row strong { margin-left: auto; font-family: var(--font); font-weight: 600; }
.tail-row:hover { background: var(--surface-2); }
.tail-empty { padding: 12px 0; color: var(--ink-2); font-size: 13px; }
.tail-empty span { display: block; margin-top: 4px; color: var(--muted); font-size: 12.5px; }

/* ───────── Methodology ───────── */
.method-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 20px; align-items: start; }
.method-toc { position: sticky; top: 16px; display: grid; gap: 2px; }
.method-toc span { margin: 0 10px 6px; font-size: 11px; font-weight: 600; letter-spacing: .08em; color: var(--muted); }
.method-toc a { padding: 7px 10px; border-radius: var(--r-control); font-size: 13px; color: var(--ink-2); }
.method-toc a:hover { background: var(--surface-3); color: var(--ink); }
.method-content { display: grid; gap: var(--gap); min-width: 0; }
.method-card { padding: 20px; scroll-margin-top: 16px; }
.method-card p { font-size: 13.5px; line-height: 1.7; color: var(--ink-2); max-width: 78ch; }
.method-card p + p, .method-card p + dl, .method-card dl + div, .method-card div + p { margin-top: 12px; }
.method-card a:not(.text-link) { color: var(--beam-ink); text-decoration: underline; text-underline-offset: 2px; }
.method-small { font-size: 12.5px !important; color: var(--muted) !important; }
.contract-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; margin: 16px 0; }
.contract-facts > div { padding: 10px 0; border-top: 1px solid var(--line); }
.contract-facts dt { font-size: 12px; color: var(--muted); }
.contract-facts dd { margin-top: 1px; font-size: 14px; font-weight: 550; overflow-wrap: anywhere; }
.method-callout { display: flex; align-items: flex-start; gap: 10px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r-control); background: var(--surface-2); font-size: 13px; color: var(--ink-2); }
.method-callout .icon { margin-top: 2px; color: var(--muted); }
.method-stages { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 4px 0 16px; border: 1px solid var(--line); border-radius: var(--r-panel); overflow: hidden; }
.method-stages > div { padding: 12px 14px; border-left: 1px solid var(--line); background: var(--surface-2); }
.method-stages > div:first-child { border-left: 0; }
.method-stages span { display: block; font: 600 11px var(--mono); color: var(--beam-ink); }
.method-stages strong { display: block; margin: 2px 0; font-size: 14px; font-weight: 600; }
.method-stages small { font-size: 12px; color: var(--muted); }
.method-card details { border-top: 1px solid var(--line); }
.method-card details:first-of-type { margin-top: 4px; }
.method-card summary { list-style: none; display: flex; align-items: center; gap: 8px; min-height: 42px; cursor: pointer; font-size: 13.5px; font-weight: 550; }
.method-card summary::-webkit-details-marker { display: none; }
.method-card summary::before { content: ""; width: 14px; height: 14px; flex-shrink: 0; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235f636f' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 6 6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat; transition: transform var(--t) var(--ease); }
.method-card details[open] summary::before { transform: rotate(90deg); }
.method-card details > p { padding: 0 0 14px 22px; }
.method-reading { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 4px; }
.method-reading a { display: block; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-control); text-decoration: none !important; color: var(--ink) !important; }
.method-reading a:hover { border-color: var(--beam-line); background: #fffaf7; }
.method-reading strong { display: block; font-size: 13px; font-weight: 600; }
.method-reading span { display: block; margin-top: 2px; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.method-card ul { display: grid; gap: 8px; padding-left: 18px; list-style: disc; color: var(--ink-2); font-size: 13.5px; line-height: 1.6; }
.method-card ul li::marker { color: var(--beam); }

/* ───────── Research ───────── */
.thesis { display: grid; grid-template-columns: 1.3fr 1.1fr auto; gap: 24px; align-items: center; padding: 18px 20px; background: var(--surface-2); }
.thesis h2 { margin-top: 6px; font-size: 20px; font-weight: 500; line-height: 1.35; letter-spacing: -.02em; }
.thesis h2 em { font-style: normal; color: var(--beam-ink); }
.thesis > p { color: var(--ink-2); font-size: 13.5px; line-height: 1.6; }
.thesis-counts { display: flex; gap: 20px; }
.thesis-counts dt { font-size: 12px; color: var(--muted); }
.thesis-counts dd { font-size: 26px; font-weight: 480; letter-spacing: -.02em; }
.research-index { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px; background: var(--surface-3); border: 1px solid var(--line); border-radius: var(--r-panel); }
.research-index a { padding: 7px 14px; border-radius: var(--r-control); font-size: 13px; font-weight: 550; color: var(--ink-2); }
.research-index a:hover { background: #fff; color: var(--ink); box-shadow: 0 1px 2px #17191e12; }
.research-section { display: grid; gap: var(--gap); margin-top: 14px; scroll-margin-top: 16px; }
.research-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.research-section-head h2 { margin-top: 6px; font-size: 20px; font-weight: 500; letter-spacing: -.02em; }
.research-section-head > p { max-width: 380px; font-size: 12.5px; color: var(--muted); line-height: 1.55; }
.algorithm-list { display: grid; background: #fff; border: 1px solid var(--line); border-radius: var(--r-panel); box-shadow: var(--shadow); }
.algorithm-list article { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 16px; border-top: 1px solid var(--line); }
.algorithm-list article:first-child { border-top: 0; }
.algorithm-index { display: grid; place-items: center; width: 28px; height: 28px; border-radius: var(--r-control); background: var(--beam-soft); color: var(--beam-ink); font: 600 12px var(--mono); }
.algorithm-list h3 { font-size: 14px; font-weight: 600; }
.algorithm-list p { margin-top: 3px; font-size: 13px; color: var(--ink-2); line-height: 1.6; max-width: 80ch; }
.algorithm-list small { display: block; margin-top: 6px; font-size: 12px; color: var(--muted); }
.algorithm-list article > a { font-size: 12.5px; font-weight: 550; color: var(--beam-ink); white-space: nowrap; }
.algorithm-list article > a:hover { text-decoration: underline; }
.paper-grid, .visual-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.paper-card { display: flex; flex-direction: column; gap: 8px; padding: 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-panel); box-shadow: var(--shadow); }
.paper-meta { display: flex; justify-content: space-between; font-size: 11px; font-weight: 600; letter-spacing: .08em; color: var(--muted); }
.paper-card h3 { font-size: 16px; font-weight: 560; letter-spacing: -.015em; line-height: 1.3; }
.paper-authors { font-size: 12.5px !important; color: var(--muted) !important; }
.paper-card > p { font-size: 13px; color: var(--ink-2); line-height: 1.6; }
.decision-tag { align-self: flex-start; padding: 3px 9px; border: 1px solid var(--beam-line); border-radius: var(--r-chip); background: var(--beam-soft); color: var(--beam-ink); font-size: 12px; font-weight: 550; }
.paper-card details { margin-top: auto; border-top: 1px solid var(--line); }
.paper-card summary { list-style: none; display: flex; align-items: center; justify-content: space-between; min-height: 40px; cursor: pointer; font-size: 13px; font-weight: 550; }
.paper-card summary::-webkit-details-marker { display: none; }
.paper-card details[open] summary span[aria-hidden] { transform: rotate(45deg); }
.paper-card summary span[aria-hidden] { display: inline-block; font-size: 18px; line-height: 1; color: var(--muted); transition: transform var(--t) var(--ease); }
.paper-card details p { font-size: 13px; color: var(--ink-2); line-height: 1.6; }
.paper-card details small { display: block; margin: 8px 0 10px; font-size: 12px; color: var(--muted); line-height: 1.5; }
.paper-card > .text-link { padding-top: 10px; border-top: 1px solid var(--line); }
.visual-card { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 14px; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-panel); box-shadow: var(--shadow); }
.visual-card:hover { border-color: var(--beam-line); }
.visual-sketch { position: relative; display: grid; place-items: center; min-height: 120px; border: 1px solid var(--line); border-radius: var(--r-control); background: var(--surface-2); overflow: hidden; }
.visual-sketch svg { width: 100%; height: 100%; }
.visual-sketch span { position: absolute; left: 6px; bottom: 5px; padding: 1px 5px; border-radius: 3px; background: #fffffff0; font-size: 11px; font-weight: 600; letter-spacing: .04em; color: var(--muted); }
.visual-card-copy h3 { margin: 4px 0; font-size: 15px; font-weight: 560; }
.visual-card-copy p { font-size: 12.5px; color: var(--ink-2); line-height: 1.55; margin-bottom: 8px; }
.reference-links { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.reference-links a { font-size: 12.5px; font-weight: 550; color: var(--beam-ink); }
.reference-links a:hover { text-decoration: underline; }
.research-next { display: grid; gap: 10px; margin-top: 14px; padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-panel); box-shadow: var(--shadow); }
.research-next h2 { font-size: 20px; font-weight: 500; letter-spacing: -.02em; }
.research-next > p { max-width: 80ch; color: var(--ink-2); line-height: 1.6; }
.research-next ol { display: grid; gap: 0; counter-reset: step; margin-top: 4px; }
.research-next li { position: relative; padding: 12px 0 12px 40px; border-top: 1px solid var(--line); counter-increment: step; }
.research-next li::before { content: counter(step); position: absolute; left: 0; top: 12px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: var(--r-control); background: var(--beam-soft); color: var(--beam-ink); font: 600 12px var(--mono); }
.research-next li strong { display: block; font-size: 13.5px; font-weight: 600; }
.research-next li span { display: block; margin-top: 2px; font-size: 13px; color: var(--ink-2); line-height: 1.6; max-width: 80ch; }
.research-boundary { margin-top: 6px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r-control); background: var(--surface-2); font-size: 12.5px; color: var(--ink-2); }

/* ───────── Footer ───────── */
.evidence-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-2); }
main > .evidence-foot { margin-top: 16px; }
.foot-group { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.foot-label { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.source-health { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.health-item { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.health-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.health-dot.good { background: var(--ok); }
.health-dot.bad { background: var(--bad); }
.evidence-foot > .text-link { margin-left: auto; }
.foot-sep { color: var(--faint); }

/* ───────── Responsive ───────── */
@media (max-width: 1180px) {
  .grid-summary, .grid-analytics, .grid-bottom { grid-template-columns: minmax(0, 1fr); }
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trace-layout { grid-template-columns: minmax(0, 1fr); }
  .thesis { grid-template-columns: 1fr 1fr; } .thesis-counts { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  body.workspace { padding: 10px; }
  .app-frame { display: block; min-height: 0; border-radius: 14px; box-shadow: 0 0 0 5px #f4f4f6; }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; gap: 8px; padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
  .sidebar::-webkit-scrollbar { display: none; }
  .brand-block { margin: 0; padding: 4px 8px 4px 4px; flex-shrink: 0; border: 0; background: transparent; }
  .brand-block .brand-mark { width: 32px; height: 32px; }
  .brand-text small, .nav-label, .sidebar-foot { display: none; }
  .sidebar nav { display: flex; gap: 4px; flex-shrink: 0; }
  .sidebar nav a { min-height: 40px; white-space: nowrap; border-color: var(--line); background: #fff; }
  .sidebar nav a.selected { border-color: var(--ink); background: var(--ink); color: #fff; box-shadow: none; }
  .sidebar nav a.selected .icon { color: #fff; }
  .sidebar nav a.selected::before { display: none; }
  .topbar { flex-wrap: wrap; padding: 10px 14px; }
  .quick-search { flex-basis: 100%; max-width: none; order: 2; }
  .topbar-actions { margin-left: 0; width: 100%; order: 1; justify-content: space-between; }
  kbd { display: none; }
  main { padding: 16px 14px 14px; }
  .method-layout { grid-template-columns: minmax(0, 1fr); }
  .method-toc { position: static; display: flex; flex-wrap: wrap; gap: 4px; }
  .method-toc span { flex-basis: 100%; }
  .method-toc a { border: 1px solid var(--line); }
  .paper-grid, .visual-grid, .evidence-grid, .method-reading { grid-template-columns: minmax(0, 1fr); }
  .research-section-head { flex-direction: column; align-items: flex-start; gap: 8px; }
}
@media (max-width: 640px) {
  .page-head { flex-direction: column; }
  .page-actions { justify-content: flex-start; }
  .route-pair { grid-template-columns: minmax(0, 1fr); }
  .compact-route + .compact-route { border-left: 0; border-top: 1px solid var(--line); }
  .status-banner { flex-wrap: wrap; }
  .mode-pills { flex-basis: 100%; }
  .stat-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
  .stat-tile { padding: 12px; } .stat-tile strong { font-size: 26px; }
  .signature-card form { flex-direction: column; }
  .stage-row { grid-template-columns: 88px minmax(0, 1fr) 72px; gap: 8px; }
  .contract-facts, .method-stages { grid-template-columns: minmax(0, 1fr); }
  .method-stages > div { border-left: 0; border-top: 1px solid var(--line); } .method-stages > div:first-child { border-top: 0; }
  .thesis { grid-template-columns: minmax(0, 1fr); }
  .algorithm-list article { grid-template-columns: 32px minmax(0, 1fr); } .algorithm-list article > a { grid-column: 2; }
  .visual-card { grid-template-columns: minmax(0, 1fr); }
  .trace-timeline li { grid-template-columns: 28px minmax(0, 1fr); } .timeline-time { grid-column: 2; }
  .evidence-foot > .text-link { margin-left: 0; }
  .panel { padding: 14px; }
  .ledger-pagination { flex-direction: column; align-items: flex-start; }
}
