:root{color-scheme:light dark;--fg:#1b1d21;--bg:#f7f7f8;--card:#fff;--muted:#5e6470;--line:#d8dbe0;--accent:#2457d6;--bad:#b42318;--ok:#067647;--warn:#9a6700}
@media (prefers-color-scheme:dark){:root{--fg:#e8e9ec;--bg:#121316;--card:#1b1d22;--muted:#a0a6b2;--line:#30343c;--accent:#7aa2ff;--bad:#ff8a80;--ok:#5fd39a;--warn:#f0c24b}}
*{box-sizing:border-box}body{margin:0;font:16px/1.45 system-ui,-apple-system,Segoe UI,Roboto,sans-serif;color:var(--fg);background:var(--bg)}
header{display:flex;gap:.75rem;align-items:center;padding:.75rem 1rem;border-bottom:1px solid var(--line)}header .net{font-size:.8rem;color:var(--muted)}
nav.top{display:flex;flex-wrap:wrap;gap:1rem;align-items:center;padding:.5rem 1rem;border-bottom:1px solid var(--line)}
main{max-width:46rem;margin:0 auto;padding:1rem}footer{max-width:46rem;margin:0 auto;padding:1rem;font-size:.8rem;color:var(--muted)}
h1{font-size:1.4rem;margin:.5rem 0 1rem}h2{font-size:1.1rem;margin:.25rem 0 .75rem}h3{font-size:1rem;margin:1rem 0 .5rem}
.card{background:var(--card);border:1px solid var(--line);border-radius:.6rem;padding:1rem;margin:0 0 1rem}
label{display:block;margin:.5rem 0}label input{display:block;width:100%;margin-top:.25rem;padding:.6rem;font:inherit;border:1px solid var(--line);border-radius:.4rem;background:var(--bg);color:var(--fg)}
label.check{display:inline-flex;gap:.35rem;margin-right:1rem}label.check input{display:inline;width:auto;margin:0}fieldset{border:1px solid var(--line);border-radius:.4rem;margin:.5rem 0}
button{font:inherit;padding:.65rem 1.1rem;border-radius:.45rem;border:1px solid var(--accent);background:var(--accent);color:#fff;cursor:pointer;min-height:2.75rem}
button.secondary{background:transparent;color:var(--accent)}button.danger{background:var(--bad);border-color:var(--bad)}button.link{background:none;border:none;color:var(--accent);padding:0;min-height:auto}
button:disabled{opacity:.5;cursor:not-allowed}form.inline{display:inline}.row{display:flex;flex-wrap:wrap;gap:.75rem;margin:.75rem 0}
code,pre,.mono{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:.85rem;overflow-wrap:anywhere;word-break:break-all}
pre{white-space:pre-wrap;background:var(--bg);border:1px solid var(--line);border-radius:.4rem;padding:.6rem;max-height:24rem;overflow:auto}
dl{display:grid;grid-template-columns:minmax(7rem,max-content) 1fr;gap:.3rem .8rem;margin:0}dt{color:var(--muted)}dd{margin:0;overflow-wrap:anywhere}
@media (max-width:30rem){dl{grid-template-columns:1fr}dd{margin-bottom:.4rem}}
table{width:100%;border-collapse:collapse;font-size:.9rem}th,td{text-align:left;padding:.35rem;border-bottom:1px solid var(--line);overflow-wrap:anywhere}
.badge{display:inline-block;padding:.15rem .55rem;border-radius:1rem;border:1px solid currentColor;font-size:.85rem;font-weight:600}
.state-running,.state-stopped,.pass{color:var(--ok)}.state-held,.state-unverified,.fail,.error{color:var(--bad)}.state-awaiting-funding,.state-stopping,.awaiting-funding,.unverified,.warn{color:var(--warn)}
.muted{color:var(--muted)}.label-template{color:var(--warn);font-weight:700}.wrap{overflow-wrap:anywhere}
p.error{border:1px solid var(--bad);border-radius:.4rem;padding:.6rem}p.info{border:1px solid var(--line);border-radius:.4rem;padding:.6rem}
.public-value{flex:1;min-width:12rem;max-width:100%;font:inherit;padding:.5rem;border:1px solid var(--line);border-radius:.4rem;background:var(--bg);color:var(--fg)}
textarea{width:100%;font-family:ui-monospace,monospace;font-size:.85rem;padding:.5rem;border-radius:.4rem;border:1px solid var(--line);background:var(--bg);color:var(--fg)}

body[data-page="dashboard"] main,body[data-page="dashboard"] footer,body[data-page="market"] main,body[data-page="market"] footer{max-width:76rem}
.market-panel{margin-top:1.5rem}.market-heading,.market-tools,.market-periods{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem}
.market-heading{justify-content:space-between;margin-bottom:.8rem}.market-heading h2{font-size:1.3rem;margin:0}.market-tools button,.market-periods button{font-size:.8rem;padding:.35rem .6rem;min-height:2.2rem}
.market-grid{display:grid;grid-template-columns:minmax(0,2fr) minmax(17rem,1fr);gap:1rem}.market-card{min-width:0;background:var(--card);border:1px solid var(--line);border-radius:.8rem;padding:1rem}
.market-caption,.market-source,.market-note{font-size:.78rem;color:var(--muted);overflow-wrap:anywhere}.market-note{margin:.7rem 0}.market-state{font-size:.75rem;border:1px solid var(--line);border-radius:2rem;padding:.25rem .6rem;color:var(--muted)}.market-state[data-state="live"]{color:var(--ok);border-color:var(--ok)}.market-state[data-state="stale"],.market-state[data-state="error"]{color:var(--warn);border-color:var(--warn)}
.market-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.8rem;margin:1rem 0}.market-stat dt{font-size:.75rem}.market-stat dd{font-size:1rem;font-weight:600;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}.market-periods button[aria-pressed="true"]{background:var(--accent);color:var(--card)}
.market-chart-wrap{display:grid;grid-template-columns:minmax(4rem,7rem) minmax(0,1fr);gap:.6rem;height:19rem;margin:1rem 0}.market-axis{display:flex;flex-direction:column;justify-content:space-between;font-size:.75rem;color:var(--muted);font-variant-numeric:tabular-nums;overflow:hidden}.market-axis span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.market-chart{width:100%;height:100%;overflow:visible}.market-gridline{stroke:var(--line);stroke-width:1}.market-price-line{stroke:var(--accent);stroke-width:2.5;fill:none;vector-effect:non-scaling-stroke}.market-price-dot{fill:var(--accent)}.market-chart-empty{grid-column:1/-1;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:.5rem;color:var(--muted);text-align:center;border:1px dashed var(--line);border-radius:.5rem;padding:1rem}
.market-time-axis{display:flex;justify-content:space-between;gap:.5rem;font-size:.75rem;color:var(--muted)}.market-book{width:100%;font-size:.78rem;font-variant-numeric:tabular-nums}.market-book th,.market-book td{border:0;padding:.25rem .35rem;text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:7.5rem}.market-book th{color:var(--muted);font-weight:400}.market-book tr.bid{--book-fill:color-mix(in srgb,var(--ok) 13%,transparent)}.market-book tr.ask{--book-fill:color-mix(in srgb,var(--bad) 13%,transparent)}.market-book tr.bid,.market-book tr.ask{background:linear-gradient(to left,var(--book-fill) 0 var(--depth),transparent var(--depth) 100%)}.market-book .bid td:first-child{color:var(--ok)}.market-book .ask td:first-child{color:var(--bad)}.market-book .market-mid td{padding:.7rem .35rem;font-weight:600;border-block:1px solid var(--line);white-space:normal}.market-empty-side td{text-align:center;color:var(--muted)}.market-panel[data-quality="stale"] .market-chart,.market-panel[data-quality="stale"] .market-book{opacity:.6}
@media(max-width:58rem){.market-grid{grid-template-columns:1fr}.market-chart-wrap{height:16rem}.market-book td{max-width:none}}@media(max-width:30rem){.market-stats{gap:.3rem}.market-stat dd{font-size:.85rem}.market-chart-wrap{grid-template-columns:4.5rem minmax(0,1fr);gap:.3rem;height:13rem}.market-heading h2{font-size:1.1rem}}
.market-book .depth-0{--depth:0%}.market-book .depth-1{--depth:1%}.market-book .depth-2{--depth:2%}.market-book .depth-3{--depth:3%}.market-book .depth-4{--depth:4%}.market-book .depth-5{--depth:5%}.market-book .depth-6{--depth:6%}.market-book .depth-7{--depth:7%}.market-book .depth-8{--depth:8%}.market-book .depth-9{--depth:9%}.market-book .depth-10{--depth:10%}.market-book .depth-11{--depth:11%}.market-book .depth-12{--depth:12%}.market-book .depth-13{--depth:13%}.market-book .depth-14{--depth:14%}.market-book .depth-15{--depth:15%}.market-book .depth-16{--depth:16%}.market-book .depth-17{--depth:17%}.market-book .depth-18{--depth:18%}.market-book .depth-19{--depth:19%}.market-book .depth-20{--depth:20%}.market-book .depth-21{--depth:21%}.market-book .depth-22{--depth:22%}.market-book .depth-23{--depth:23%}.market-book .depth-24{--depth:24%}.market-book .depth-25{--depth:25%}.market-book .depth-26{--depth:26%}.market-book .depth-27{--depth:27%}.market-book .depth-28{--depth:28%}.market-book .depth-29{--depth:29%}.market-book .depth-30{--depth:30%}.market-book .depth-31{--depth:31%}.market-book .depth-32{--depth:32%}.market-book .depth-33{--depth:33%}.market-book .depth-34{--depth:34%}.market-book .depth-35{--depth:35%}.market-book .depth-36{--depth:36%}.market-book .depth-37{--depth:37%}.market-book .depth-38{--depth:38%}.market-book .depth-39{--depth:39%}.market-book .depth-40{--depth:40%}.market-book .depth-41{--depth:41%}.market-book .depth-42{--depth:42%}.market-book .depth-43{--depth:43%}.market-book .depth-44{--depth:44%}.market-book .depth-45{--depth:45%}.market-book .depth-46{--depth:46%}.market-book .depth-47{--depth:47%}.market-book .depth-48{--depth:48%}.market-book .depth-49{--depth:49%}.market-book .depth-50{--depth:50%}.market-book .depth-51{--depth:51%}.market-book .depth-52{--depth:52%}.market-book .depth-53{--depth:53%}.market-book .depth-54{--depth:54%}.market-book .depth-55{--depth:55%}.market-book .depth-56{--depth:56%}.market-book .depth-57{--depth:57%}.market-book .depth-58{--depth:58%}.market-book .depth-59{--depth:59%}.market-book .depth-60{--depth:60%}.market-book .depth-61{--depth:61%}.market-book .depth-62{--depth:62%}.market-book .depth-63{--depth:63%}.market-book .depth-64{--depth:64%}.market-book .depth-65{--depth:65%}.market-book .depth-66{--depth:66%}.market-book .depth-67{--depth:67%}.market-book .depth-68{--depth:68%}.market-book .depth-69{--depth:69%}.market-book .depth-70{--depth:70%}.market-book .depth-71{--depth:71%}.market-book .depth-72{--depth:72%}.market-book .depth-73{--depth:73%}.market-book .depth-74{--depth:74%}.market-book .depth-75{--depth:75%}.market-book .depth-76{--depth:76%}.market-book .depth-77{--depth:77%}.market-book .depth-78{--depth:78%}.market-book .depth-79{--depth:79%}.market-book .depth-80{--depth:80%}.market-book .depth-81{--depth:81%}.market-book .depth-82{--depth:82%}.market-book .depth-83{--depth:83%}.market-book .depth-84{--depth:84%}.market-book .depth-85{--depth:85%}.market-book .depth-86{--depth:86%}.market-book .depth-87{--depth:87%}.market-book .depth-88{--depth:88%}.market-book .depth-89{--depth:89%}.market-book .depth-90{--depth:90%}.market-book .depth-91{--depth:91%}.market-book .depth-92{--depth:92%}.market-book .depth-93{--depth:93%}.market-book .depth-94{--depth:94%}.market-book .depth-95{--depth:95%}.market-book .depth-96{--depth:96%}.market-book .depth-97{--depth:97%}.market-book .depth-98{--depth:98%}.market-book .depth-99{--depth:99%}.market-book .depth-100{--depth:100%}