/* The Oracle page (dashboard/oracle.html). The header is nav.css; everything below it is here.
   The price first: the market name with its selector, one big price (56px, 40px on phones) with its change and age,
   then a large chart (440px tall, 260px on phones). Below it "Where this price comes from": the plain answer, the
   venue table, then the method and the signed settlements folded by default.
   Pure black ground, white text, one readable grey; green and red only for direction (the change, the line).
   Four sizes: 56 (price), 20 (titles), 14 (body), 12 (captions). Numbers in tabular figures. Links never underlined,
   no bordered buttons, no accent stripes. Nothing animates. */
:root {
  --bg: #000;
  --fg: #fff;
  --ink2: #d4d4d8;
  --fg2: #a1a1aa;  /* 7.7:1 on black */
  --fg3: #8b8b94;  /* 5.9:1 on black */
  --line: rgba(255, 255, 255, 0.08);
  --line2: rgba(255, 255, 255, 0.14);
  --fill: rgba(255, 255, 255, 0.07);
  --fill2: rgba(255, 255, 255, 0.12);
  --gut: 24px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); }
body { font-family: var(--ob-sans, "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif); font-size: 14px; line-height: 1.5; overflow-x: hidden; }
a { color: var(--fg); text-decoration: none; }
@media (hover: hover) { a:hover { color: var(--ink2); } }
[hidden] { display: none !important; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: lining-nums tabular-nums; }
code, .mono, pre { font-family: var(--ob-code, ui-monospace, SFMono-Regular, Menlo, monospace); font-size: 12px; }
code { color: var(--ink2); }
.sub { display: block; font-size: 12px; line-height: 16px; color: var(--fg3); white-space: nowrap; }
.dim { color: var(--fg3); }
.m-show, .t-only { display: none !important; }
/* sentences: proportional figures (Inter's tabular hyphen reads "BTC - USD") */
.lead, .plain, .vn, .sub, .rule dd, .hnote, .mlist .n { font-variant-numeric: lining-nums proportional-nums; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }

.page { max-width: none; margin: 0; padding: 28px var(--gut) 80px; }

/* ---------- hero: name + selector, price, chart ---------- */
.ttl { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ttl h1 { margin: 0; font-size: var(--ob-h1, 28px); line-height: 36px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.picker { position: relative; flex: none; }
.pbtn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border: 0; border-radius: 8px; background: var(--fill); color: var(--ink2); font-size: 14px; font-weight: 500; cursor: pointer; }
.pbtn[aria-expanded="true"] { background: var(--fill2); color: var(--fg); }
@media (hover: hover) { .pbtn:hover { background: var(--fill2); color: var(--fg); } }
.chev { width: 12px; height: 12px; flex: none; }
.pbtn[aria-expanded="true"] .chev { transform: rotate(180deg); }
.pop { position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; width: 340px; padding: 8px; border-radius: 12px; background: #111113; box-shadow: 0 0 0 1px var(--line2), 0 16px 48px rgba(0, 0, 0, 0.7); }
.find { width: 100%; height: 40px; padding: 0 12px; border: 0; border-radius: 8px; background: var(--fill); color: var(--fg); font-size: 14px; outline: 0; }
.find::placeholder { color: var(--fg3); }
.find:focus-visible { outline: 2px solid var(--fg2); outline-offset: 0; }
.find::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.mlist { list-style: none; margin: 6px 0 0; padding: 0; max-height: min(420px, 55vh); overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--fill2) transparent; }
.mlist li[data-m] { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 36px; padding: 0 10px; border-radius: 8px; color: var(--ink2); cursor: pointer; }
.mlist li[data-m].act { background: var(--fill2); color: var(--fg); }
.mlist li[aria-selected="true"] .n { color: var(--fg); font-weight: 600; }
.mlist .n { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.mlist .c { font-size: 12px; color: var(--fg3); flex: none; }
.mlist .none { padding: 10px; font-size: 14px; color: var(--fg3); }

.quote { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin-top: 10px; }
.qv { min-width: 0; }
.px { display: block; font-size: 40px; line-height: 48px; font-weight: 600; letter-spacing: -0.03em; white-space: nowrap; }
.qmeta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin: 4px 0 0; font-size: 14px; }
.chg { font-weight: 600; }
.chg.up { color: var(--up); }
.chg.down { color: var(--down); }
.chg.flat { color: var(--fg2); }
.chg .rw { margin-left: 2px; font-weight: 400; color: var(--fg2); }
.age { color: var(--fg2); }
.hnote { margin: 10px 0 0; font-size: 14px; color: var(--fg); }

.ranges { display: flex; align-items: center; gap: 2px; }
.ranges[hidden], .rg[hidden] { display: none; } /* 1D / 1W wait until the history covers them (oracle.js renderRanges) */
.rg { min-width: 44px; height: 32px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--fg2); font-size: 14px; font-weight: 500; cursor: pointer; }
@media (hover: hover) { .rg:hover { color: var(--fg); } }
.rg[aria-pressed="true"] { background: var(--fill2); color: var(--fg); }

.chart { position: relative; margin: 20px 0 0; height: 440px; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.chart svg { display: block; position: absolute; inset: 0; overflow: visible; }
.chart .gl { stroke: var(--line); stroke-width: 1; }
/* a gap in the recording: a quiet band with its times, never a torn line */
.chart .gapb rect { fill: var(--fg3); fill-opacity: 0.08; }
.chart .gapb text { fill: var(--fg3); font-size: 12px; }
.chart .bl { stroke: var(--line2); stroke-width: 1; }
.chart .ln { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
/* the live dot's pulse, the Trade chart's (lightweight-charts' last-price animation): a ring that grows and fades */
.chart .pl { transform-box: fill-box; transform-origin: center; animation: orpulse 1.8s ease-out infinite; }
@keyframes orpulse { 0% { opacity: .5; transform: scale(1); } 100% { opacity: 0; transform: scale(3.2); } }
@media (prefers-reduced-motion: reduce) { .chart .pl { animation: none; opacity: 0; } }
.chart text { font-family: var(--ob-sans, "Inter", sans-serif); font-size: 12px; font-variant-numeric: lining-nums tabular-nums; }
.chart .yl, .chart .xl { fill: var(--fg3); }
.chart .tag { fill: #000; font-weight: 600; }
.cempty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; margin: 0; font-size: 14px; color: var(--fg3); }
.hov { position: absolute; inset: 0; pointer-events: none; }
.hov .vl { position: absolute; width: 1px; background: rgba(255, 255, 255, 0.28); }
.hov .dot { position: absolute; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; box-shadow: 0 0 0 2px #000; }
.hov .tip { position: absolute; display: flex; gap: 8px; align-items: baseline; padding: 5px 9px; border-radius: 6px; background: #1c1c1f; box-shadow: 0 0 0 1px var(--line2); font-size: 12px; white-space: nowrap; }
.hov .tip b { font-weight: 600; color: var(--fg); }
.hov .tip span { color: var(--fg2); }

/* ---------- where this price comes from ---------- */
.where { margin-top: 56px; padding-top: 32px; border-top: 1px solid var(--line); }
.where h2 { margin: 0; font-size: 20px; line-height: 28px; font-weight: 600; letter-spacing: -0.01em; }
.lead { margin: 10px 0 0; max-width: 72ch; font-size: 14px; line-height: 1.6; color: var(--ink2); }
.note { margin: 10px 0 0; font-size: 12px; color: var(--fg3); }

.tablewrap { overflow-x: auto; margin-top: 20px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { height: 36px; padding: 0 12px; font-size: 12px; font-weight: 500; color: var(--fg3); text-align: left; border-bottom: 1px solid var(--line2); white-space: nowrap; }
.tbl td { height: 56px; padding: 8px 12px; border-bottom: 1px solid var(--line); color: var(--ink2); vertical-align: middle; white-space: nowrap; }
.tbl tr > :first-child { padding-left: 0; }
.tbl tr > :last-child { padding-right: 0; }
.tbl .r { text-align: right; }
.srcs tbody tr:last-child > td { border-bottom: 0; }
.srcs .la2 { display: none; }
.tbl td.empty { height: 64px; color: var(--fg3); white-space: normal; }
.vn { display: inline-flex; align-items: center; gap: 4px; font-weight: 500; color: var(--fg); }
@media (hover: hover) { a.vn:hover { color: var(--ink2); } }
.ext { width: 11px; height: 11px; color: var(--fg3); flex: none; }
.lv { font-weight: 600; color: var(--fg); }
.yes { display: inline-flex; align-items: center; gap: 5px; color: var(--fg); }
.ok { width: 12px; height: 12px; color: var(--fg); flex: none; }
.no { color: var(--fg2); }
.off { color: var(--fg3); }

/* the folded sections */
.more { border-bottom: 1px solid var(--line); }
#secHow { margin-top: 28px; }
.more > summary { display: flex; align-items: center; gap: 10px; min-height: 52px; list-style: none; cursor: pointer; border-top: 1px solid var(--line); }
.more > summary::-webkit-details-marker { display: none; }
.more > summary .st { font-size: 14px; font-weight: 600; color: var(--fg); }
.more > summary .cnt { font-size: 12px; color: var(--fg3); }
.more > summary .chev { margin-left: auto; color: var(--fg2); }
.more[open] > summary .chev { transform: rotate(180deg); }
@media (hover: hover) { .more > summary:hover .chev { color: var(--fg); } }
.moreb { padding: 0 0 28px; }
.moreb h3 { margin: 24px 0 8px; font-size: 14px; font-weight: 600; }
.plain { margin: 0; max-width: 80ch; font-size: 14px; line-height: 1.6; color: var(--ink2); }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px 24px; margin: 20px 0 0; }
.fact dt { font-size: 12px; color: var(--fg3); }
.fact dd { margin: 2px 0 0; }
.fact .v { display: block; font-size: 14px; font-weight: 600; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fact .s { display: block; font-size: 12px; color: var(--fg3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.rules { margin: 0; }
.rule { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.rule:first-child { border-top: 0; }
.rule dt { font-size: 14px; font-weight: 500; color: var(--fg); }
.rule dd { margin: 0; font-size: 14px; line-height: 1.55; color: var(--fg2); max-width: 78ch; }
.exact { margin-top: 8px; font-size: 14px; }
.exact summary, .pubkey summary { display: inline-flex; align-items: center; min-height: 36px; color: var(--fg2); font-weight: 500; cursor: pointer; list-style: none; }
.exact summary::-webkit-details-marker, .pubkey summary::-webkit-details-marker { display: none; }
@media (hover: hover) { .exact summary:hover, .pubkey summary:hover { color: var(--fg); } }
.exact summary::after, .pubkey summary::after { content: ""; width: 5px; height: 5px; margin-left: 8px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); }
.exact[open] summary::after, .pubkey[open] summary::after { transform: translateY(1px) rotate(-135deg); }
.exact p { margin: 4px 0 0; color: var(--fg2); line-height: 1.6; max-width: 90ch; }

/* recent settlements */
.moreb > .tablewrap { margin-top: 4px; }
.fixes .pv { font-weight: 600; color: var(--fg); }
.fixes.nosrc th:nth-child(4), .fixes.nosrc td.used { display: none; }
.fixes .pv.void { color: var(--fg2); }
.used .u { color: var(--ink2); }
.used .nu { color: var(--fg3); text-decoration: line-through; text-decoration-color: var(--fg3); }
.used .sep { color: var(--fg3); }
.vbtn, .copy { height: 32px; padding: 0 12px; border: 0; border-radius: 8px; background: var(--fill); color: var(--ink2); font-size: 12px; font-weight: 500; cursor: pointer; }
@media (hover: hover) { .vbtn:hover, .copy:hover { background: var(--fill2); color: var(--fg); } }
tr.fx.open .vbtn { color: var(--fg); background: var(--fill2); }
tr.fx.open > td { border-bottom-color: transparent; }
tr.det > td { height: auto; padding: 4px 0 20px; white-space: normal; }
.vres { display: flex; align-items: center; gap: 6px; margin: 0 0 12px; font-size: 14px; color: var(--ink2); }
.vres.good { color: var(--fg); font-weight: 500; }
.vres.bad { color: var(--down); font-weight: 500; }
.vres.pending { color: var(--fg3); }
.inner { margin-bottom: 12px; }
.inner td { height: 40px; padding: 4px 12px; font-size: 12px; }
.kv { margin: 0; display: grid; gap: 2px; }
.kv > div { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; align-items: center; min-height: 36px; }
.kv dt { font-size: 12px; color: var(--fg3); }
.kv dd { margin: 0; display: flex; align-items: center; gap: 8px; min-width: 0; }
.kv code { overflow-wrap: anywhere; word-break: break-all; color: var(--ink2); }
.raw { display: inline-flex; align-items: center; gap: 4px; margin-top: 10px; font-size: 14px; font-weight: 500; }

.verify { margin-top: 24px; }
.verify h3 { margin: 0 0 8px; }
.verify ol { margin: 0 0 14px; padding-left: 18px; font-size: 14px; line-height: 1.6; color: var(--fg2); max-width: 80ch; }
.keyrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.keyrow .lbl { font-size: 12px; color: var(--fg3); }
.pubkey { margin-top: 6px; font-size: 14px; }
.pubkey pre { margin: 6px 0 8px; padding: 12px; border-radius: 8px; background: var(--fill); color: var(--ink2); overflow-x: auto; white-space: pre; }

/* ---------- narrower ---------- */
@media (max-width: 1100px) {
  .t-hide { display: none !important; }
}
@media (max-width: 760px) {
  :root { --gut: 16px; }
  .page { padding-top: 16px; padding-bottom: 56px; }
  .quote { margin-top: 6px; }
  .px { font-size: 36px; line-height: 44px; }
  .ranges { width: 100%; }
  .ranges { justify-content: flex-end; }
  .chart { height: 260px; margin-top: 12px; }
  .where { margin-top: 36px; padding-top: 24px; }
  .ttl { position: relative; }
  .picker { position: static; }
  .pop { left: 0; right: 0; width: auto; }
  .m-hide { display: none !important; }
  .tbl td { white-space: normal; }
  .rule { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .kv > div { grid-template-columns: minmax(0, 1fr); gap: 2px; padding: 6px 0; }
  .find { height: 44px; font-size: 16px; }
  .mlist li[data-m] { min-height: 44px; }
  .pbtn, .rg, .vbtn, .copy { height: 44px; }
  .exact summary, .pubkey summary { min-height: 44px; }
  /* r17: venue links were 15-21 px tall on a phone; a 44 px hit area, the row's look unchanged */
  a.vn, .attr a { min-height: 44px; }
  a.vn { margin: -12px 0; }
}
/* critic r4: at 460-600px the Age and Used columns ran off the card; the age goes under the price from 620px down */
@media (max-width: 620px) {
  .srcs .agec { display: none; }
  .srcs .la2 { display: block; }
  .srcs td { padding-left: 8px; padding-right: 8px; }
  .srcs .sub { white-space: normal; }
}
@media (max-width: 360px) {
  .px { font-size: 32px; line-height: 40px; }
  .qmeta { gap: 2px 10px; }
}
/* the venue table: as wide as its columns need on a wide screen, never one row stretched across 1,900px; with one
   source in use, no "Used" column */
.tbl.srcs { max-width: 960px; }
.tbl.srcs.one th:last-child, .tbl.srcs.one td.cnt { display: none; }
/* touch: Verify, Copy and the market picker are real 44px taps (critic r4: 32px) */
@media (pointer: coarse) { #pbtn, .vbtn, .copy { min-height: 44px; } }
/* round 8: the asset and view buttons are 44px taps on every touch-sized layout */
@media (pointer: coarse), (max-width: 1024px), (max-height: 500px) { #pbtn, .pbtn, .vbtn, .copy, .rg { min-height: 44px; } }
/* round 8 (critic: the Age column floated 200px short of the page edge): the sources table runs the page's full width,
   as the chart and the rows under it do, Age at the right edge */
.tbl.srcs { max-width: none; width: 100%; }
.tbl.srcs th:last-child, .tbl.srcs td:last-child { text-align: right; }
@media (pointer: coarse), (max-width: 1024px), (max-height: 500px) { .exact summary, .pubkey summary { min-height: 44px; } }

/* the source's attribution (Ornn) and the explainer under the sources */
.attr { margin: 10px 0 0; font-size: 12px; color: var(--fg3); }
.attr a { color: var(--fg2); text-decoration: underline; text-underline-offset: 2px; }
@media (hover: hover) { .attr a:hover { color: var(--fg); } }
.explain { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--line); }
.explain h2 { margin: 0; font-size: 20px; line-height: 28px; font-weight: 600; letter-spacing: -0.01em; }
.exgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 32px; margin-top: 16px; }
.ex h3 { margin: 0 0 6px; font-size: 14px; line-height: 20px; font-weight: 600; color: var(--fg); }
.ex p { margin: 0; max-width: 64ch; font-size: 14px; line-height: 1.6; color: var(--ink2); }
.snip { position: relative; margin-top: 14px; }
.snip pre { margin: 0; padding: 14px 14px 14px; border-radius: 8px; background: var(--fill); color: var(--ink2); font-size: 12px; line-height: 1.55; overflow-x: auto; white-space: pre; }
.snip .copy { margin-top: 8px; }
@media (max-width: 720px) {
  .exgrid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .explain { margin-top: 36px; padding-top: 24px; }
}
