:root {
  --ink: #f4f4ef;
  --muted: #929a98;
  --panel: #101515;
  --panel-2: #151c1b;
  --line: #28312f;
  --mint: #8cf0c2;
  --amber: #f4c36c;
  --red: #ff8f87;
  --blue: #76baf2;
  --bg: #080c0c;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
}
* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 75% -10%, #15322a 0, transparent 32rem), var(--bg); }
button, select, input { font: inherit; }
a { color: inherit; }
.skip-link { position: fixed; top: -4rem; left: 1rem; z-index: 20; padding: .7rem 1rem; background: var(--mint); color: #07110d; }
.skip-link:focus { top: 1rem; }
.topbar { height: 76px; padding: 0 2rem; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 2rem; position: sticky; top: 0; z-index: 10; background: rgba(8,12,12,.92); backdrop-filter: blur(16px); }
.brand { display: flex; align-items: center; gap: .75rem; min-width: 245px; text-decoration: none; }
.brand-mark { width: 42px; height: 42px; border: 1px solid var(--mint); display: grid; place-items: center; color: var(--mint); font-family: ui-monospace, monospace; }
.brand strong, .brand small { display: block; }
.brand small { color: var(--muted); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; margin-top: .15rem; }
.fund-control { display: flex; align-items: center; gap: .7rem; }
.fund-control label { color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; }
select, input { color: var(--ink); background: var(--panel-2); border: 1px solid var(--line); padding: .62rem .75rem; border-radius: 3px; }
select:focus, input:focus, a:focus-visible, button:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }
.freshness { margin-left: auto; color: var(--muted); text-align: right; font-size: .78rem; }
.freshness strong { display: block; color: var(--ink); font-weight: 600; }
.shell { display: grid; grid-template-columns: 245px minmax(0, 1fr); min-height: calc(100vh - 76px); }
.rail { padding: 2rem 1rem 1.5rem; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: .3rem; }
.rail > a { color: var(--muted); text-decoration: none; padding: .8rem 1rem; display: flex; gap: .85rem; border-left: 2px solid transparent; }
.rail > a span { font: .68rem ui-monospace, monospace; color: #59625f; padding-top: .18rem; }
.rail > a:hover { color: var(--ink); background: #101616; }
.rail > a.active { color: var(--mint); border-color: var(--mint); background: linear-gradient(90deg, rgba(140,240,194,.1), transparent); }
.rail-note { margin-top: auto; padding: 1rem; border: 1px solid var(--line); color: var(--muted); font-size: .75rem; line-height: 1.45; }
.rail-note strong { color: var(--amber); text-transform: uppercase; letter-spacing: .1em; font-size: .65rem; }
#workspace { min-width: 0; padding: 2.3rem clamp(1rem, 3vw, 3rem) 4rem; max-width: 1600px; width: 100%; }
.loading { color: var(--muted); min-height: 50vh; display: grid; place-items: center; align-content: center; gap: 1rem; }
.loading span { width: 34px; height: 34px; border: 2px solid var(--line); border-top-color: var(--mint); border-radius: 50%; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.error { padding: 1rem; border: 1px solid var(--red); color: var(--red); }
.eyebrow { color: var(--mint); font: .7rem ui-monospace, monospace; letter-spacing: .14em; text-transform: uppercase; }
.view-header { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: 1.5rem; }
h1 { margin: .35rem 0 0; font-size: clamp(2rem, 4vw, 3.6rem); font-weight: 520; letter-spacing: -.05em; }
.view-header p { margin: 0; max-width: 36rem; color: var(--muted); line-height: 1.5; text-align: right; }
.capabilities, .source-strip { display: flex; flex-wrap: wrap; gap: .55rem; margin: 1rem 0 1.5rem; }
.capability, .source-chip { font: .7rem ui-monospace, monospace; text-transform: uppercase; letter-spacing: .06em; padding: .45rem .6rem; border: 1px solid var(--line); color: var(--muted); }
.capability.yes { border-color: #305744; color: var(--mint); }
.cards { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.card { background: var(--panel); padding: 1.1rem 1.2rem; min-height: 126px; }
.card .label { color: var(--muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .09em; }
.card .value { font: 500 clamp(1.25rem,2.2vw,2rem) ui-monospace, monospace; margin: 1.2rem 0 .45rem; white-space: nowrap; }
.card .note { font-size: .72rem; color: var(--muted); }
.status { display: inline-flex; align-items: center; gap: .35rem; font: 600 .62rem ui-monospace, monospace; letter-spacing: .08em; padding: .28rem .45rem; color: var(--muted); border: 1px solid var(--line); text-transform: uppercase; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.VERIFIED, .status.COMPLETE, .status.OBSERVED, .status.ISSUER_MATCHED { color: var(--mint); border-color: #305744; }
.status.PARTIAL, .status.PROVISIONAL, .status.RECONSTRUCTED, .status.RECONSTRUCTED_PRE_EX, .status.UNANCHORED { color: var(--amber); border-color: #594a2c; }
.status.UNAVAILABLE, .status.ISSUER_CONFLICT { color: var(--red); border-color: #5b3532; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, .8fr); gap: 1rem; margin-top: 1rem; }
.panel { background: var(--panel); border: 1px solid var(--line); padding: 1.2rem; min-width: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.panel h2 { margin: 0; font-size: 1rem; font-weight: 570; }
.panel small { color: var(--muted); }
.chart { width: 100%; min-height: 280px; display: block; overflow: visible; }
.chart .gridline { stroke: #27302e; stroke-width: 1; }
.chart .series { fill: none; stroke: var(--mint); stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.chart .series.secondary { stroke: var(--amber); }
.chart text { fill: var(--muted); font-size: 11px; font-family: ui-monospace, monospace; }
.legend { display: flex; gap: 1rem; color: var(--muted); font-size: .72rem; }
.legend i { display: inline-block; width: 12px; height: 2px; background: var(--mint); vertical-align: middle; margin-right: .35rem; }
.legend i.amber { background: var(--amber); }
.warnings { margin-top: 1rem; border: 1px solid #55492d; background: #18160f; padding: 1rem; color: #d3bd88; }
.warnings h2 { font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; color: var(--amber); }
.warnings ul { margin: .6rem 0 0; padding-left: 1.2rem; line-height: 1.55; }
.toolbar { display: flex; flex-wrap: wrap; gap: .7rem; align-items: end; margin-bottom: 1rem; }
.toolbar label { display: grid; gap: .35rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-size: .64rem; }
.toolbar input { min-width: 220px; }
.toolbar button { padding: .65rem .85rem; border: 1px solid var(--line); color: var(--ink); background: var(--panel-2); cursor: pointer; }
.table-wrap { overflow: auto; border: 1px solid var(--line); }
table { border-collapse: collapse; width: 100%; min-width: 800px; font-size: .78rem; }
th { position: sticky; top: 0; z-index: 1; color: var(--muted); background: #101616; text-align: left; text-transform: uppercase; letter-spacing: .08em; font-size: .63rem; }
th, td { border-bottom: 1px solid var(--line); padding: .72rem .8rem; white-space: nowrap; }
tbody tr:hover { background: #111817; }
td.num, th.num { text-align: right; font-family: ui-monospace, monospace; }
td a { color: var(--mint); text-decoration: none; border-bottom: 1px dotted #426a58; }
.empty { min-height: 220px; display: grid; place-items: center; color: var(--muted); text-align: center; padding: 2rem; }
.provenance { color: var(--muted); font: .68rem ui-monospace, monospace; }
.metric-list { display: grid; gap: 1px; background: var(--line); }
.metric-row { display: flex; justify-content: space-between; gap: 1rem; padding: .8rem; background: var(--panel); }
.metric-row span:first-child { color: var(--muted); }
.bar-chart { display: grid; gap: .65rem; }
.bar-row { display: grid; grid-template-columns: 70px 1fr 100px; align-items: center; gap: .6rem; font-size: .72rem; }
.bar-track { height: 8px; background: #202725; position: relative; }
.bar-fill { position: absolute; top: 0; bottom: 0; background: var(--mint); min-width: 1px; }
.bar-fill.negative { background: var(--red); right: 50%; }
.bar-fill.positive { left: 50%; }
.bar-row .num { text-align: right; font-family: ui-monospace, monospace; }
footer { color: var(--muted); font-size: .7rem; margin-top: 1.5rem; }
@media (max-width: 1000px) {
  .cards { grid-template-columns: repeat(2,1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .view-header { align-items: start; flex-direction: column; gap: .6rem; }
  .view-header p { text-align: left; }
}
@media (max-width: 760px) {
  .topbar { height: auto; min-height: 68px; padding: .7rem 1rem; flex-wrap: wrap; gap: .75rem; }
  .brand { min-width: 0; margin-right: auto; }
  .brand small { display: none; }
  .fund-control label { display: none; }
  .freshness { width: 100%; text-align: left; border-top: 1px solid var(--line); padding-top: .55rem; }
  .freshness strong { display: inline; margin-right: .4rem; }
  .shell { display: block; }
  .rail { position: sticky; top: 111px; z-index: 9; padding: .45rem .7rem; border-right: 0; border-bottom: 1px solid var(--line); background: rgba(8,12,12,.96); flex-direction: row; overflow-x: auto; }
  .rail > a { padding: .6rem .7rem; white-space: nowrap; border-left: 0; border-bottom: 2px solid transparent; }
  .rail > a span, .rail-note { display: none; }
  #workspace { padding-top: 1.5rem; }
  .cards { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .cards { grid-template-columns: 1fr; }
  .card { min-height: 100px; }
  .toolbar input { min-width: 100%; width: 100%; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; } }
