/* Thesis's reader (/thesis/app): the list on the left, a live 3D stage in the middle, the coin's reading on the right. */
:root {
  --bg: #0b0d0a;
  --panel: #12150f;
  --raise: #191d15;
  --line: rgba(232, 212, 154, .14);
  --line-strong: rgba(232, 212, 154, .3);
  --ink: #f1ede1;
  --dim: #b3b09d;
  --faint: #7c7d6b;
  --gold: #e8d49a;
  --red: #ff7a6b;
  --amber: #f2bb4a;
  --green: #7ad49b;
  --quiet: #8f8a73;
  --serif: "Instrument Serif", ui-serif, Georgia, serif;
  --sans: "Geist", ui-sans-serif, system-ui, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --bar: 60px;
  --side: 380px;
  --panel-w: 410px;
  --band: 46svh;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; overflow: hidden; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 3px; }

/* The bar */
.bar { position: relative; z-index: 10; height: var(--bar); display: flex; align-items: center; gap: 22px; padding: 0 20px; border-bottom: 1px solid var(--line); background: var(--bg); }
.mark { display: flex; align-items: baseline; gap: 10px; text-decoration: none; flex: none; }
.mark b { font: 400 25px/1 var(--serif); color: var(--gold); letter-spacing: .12em; }
.mark span { font: 500 11px/1 var(--mono); color: var(--dim); text-transform: uppercase; letter-spacing: .14em; }
.search { flex: 1; max-width: 520px; }
.search input { width: 100%; height: 38px; padding: 0 14px; border-radius: 3px; background: var(--panel); border: 1px solid var(--line-strong); outline: none; font: 400 13.5px var(--mono); }
.search input::placeholder { color: var(--faint); }
.search input:focus { border-color: var(--gold); }
.bar nav { display: flex; gap: 20px; margin-left: auto; font-size: 14px; color: var(--dim); }
.bar nav a { text-decoration: none; }
.bar nav a:hover { color: var(--ink); }

/* The shell: list | stage | reading */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr) var(--panel-w); height: calc(100dvh - var(--bar)); position: relative; }

/* The list */
.side { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: var(--bg); }
.tabs { display: flex; gap: 4px; padding: 12px 12px 8px; overflow-x: auto; scrollbar-width: none; flex: none; }
.tabs button { flex: none; height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--dim); cursor: pointer; font-size: 13px; }
.tabs button[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: #17140a; font-weight: 600; }
.tabs button:not([aria-pressed="true"]):hover { color: var(--ink); border-color: var(--line-strong); }
.about { margin: 0; padding: 0 16px 10px; color: var(--faint); font: 400 11.5px/1.45 var(--mono); flex: none; }
.list { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.row { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; width: 100%; padding: 10px 16px; border: 0; border-top: 1px solid var(--line); background: transparent; text-align: left; cursor: pointer; position: relative; }
.row:first-child { border-top: 0; }
.row:hover, .row.hot { background: var(--raise); }
.row[aria-current="true"] { background: var(--raise); box-shadow: inset 3px 0 0 var(--gold); }
.row .face { grid-row: span 2; width: 38px; height: 38px; border-radius: 50%; object-fit: cover; display: block; background: var(--raise); box-shadow: 0 0 0 2px var(--tone, var(--quiet)); }
.row .face.blank { display: grid; place-items: center; font: 600 14px var(--sans); color: var(--tone, var(--quiet)); }
.row .nm { min-width: 0; display: flex; align-items: baseline; gap: 8px; }
.row .nm b { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .nm span { color: var(--faint); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.row .mv { justify-self: end; font: 500 12.5px var(--mono); white-space: nowrap; }
.row .figs { display: flex; gap: 12px; font: 400 12px var(--mono); color: var(--dim); white-space: nowrap; min-width: 0; overflow: hidden; }
.row .figs small { color: var(--faint); }
.row .chips { justify-self: end; display: flex; gap: 5px; }
.up { color: var(--green); }
.down { color: var(--red); }
.flat { color: var(--faint); }
.chip { display: inline-flex; align-items: center; height: 21px; padding: 0 8px; border-radius: 999px; font: 500 11px var(--mono); white-space: nowrap; border: 1px solid var(--line); color: var(--dim); }
.chip.serious { color: var(--red); border-color: rgba(255, 122, 107, .4); background: rgba(255, 122, 107, .08); }
.chip.minor { color: var(--amber); border-color: rgba(242, 187, 74, .4); background: rgba(242, 187, 74, .08); }
.chip.clear { color: var(--green); border-color: rgba(122, 212, 155, .35); background: rgba(122, 212, 155, .07); }
.chip.official { color: var(--gold); border-color: rgba(232, 212, 154, .55); background: rgba(232, 212, 154, .1); }
.chip.wait { color: var(--faint); }
.list .empty { padding: 40px 20px; text-align: center; color: var(--dim); }
.note { margin: 0; padding: 8px 16px; border-top: 1px solid var(--line); color: var(--faint); font: 400 11px var(--mono); flex: none; }

/* The stage */
.stage { position: relative; min-width: 0; overflow: hidden; background: #0b0d0a; }
#scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: pan-y; }
html.no-gl #scene, html.no-gl #labels, html.no-gl .legend, html.no-gl .views, html.no-gl .stage-hint { display: none !important; }
html.no-gl .stage { background: radial-gradient(800px 500px at 50% 30%, rgba(232, 212, 154, .08), transparent 60%), var(--bg); }
body.dragging, body.dragging * { cursor: grabbing !important; user-select: none; -webkit-user-select: none; }
#labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.label { position: absolute; left: 0; top: 0; padding: 5px 10px 6px; border-left: 2px solid var(--gold); background: rgba(11, 13, 10, .74); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); white-space: nowrap; opacity: 0; transition: opacity .45s ease; will-change: transform; }
.label.on { opacity: 1; }
.label b { display: block; font: 400 20px/1.05 var(--serif); color: var(--ink); }
.label span { display: block; margin-top: 2px; font: 400 10.5px/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--dim); }
.label.is-serious { border-color: var(--red); }
.label.is-minor { border-color: var(--amber); }
.label.is-clear { border-color: var(--green); }
.label.is-up b { color: var(--green); }
.label.is-down b { color: var(--red); }

#tip { position: absolute; z-index: 6; left: 0; top: 0; max-width: 270px; padding: 10px 12px; background: rgba(18, 21, 15, .96); border: 1px solid var(--line-strong); border-radius: 4px; box-shadow: 0 18px 50px rgba(0, 0, 0, .55); pointer-events: none; font-size: 12.5px; line-height: 1.45; }
#tip h4 { margin: 0 0 2px; font: 400 19px/1.1 var(--serif); }
#tip p { margin: 0; color: var(--dim); }
#tip .meta { margin-top: 6px; color: var(--faint); font: 400 11px/1.4 var(--mono); }

.views[hidden] { display: none; }
.views { position: absolute; z-index: 4; top: 14px; left: 50%; transform: translateX(-50%); display: flex; gap: 2px; padding: 3px; border: 1px solid var(--line-strong); border-radius: 999px; background: rgba(11, 13, 10, .72); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.views button { height: 30px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent; color: var(--dim); cursor: pointer; font-size: 13px; }
.views button[aria-pressed="true"] { background: var(--gold); color: #17140a; font-weight: 600; }
.legend { position: absolute; z-index: 3; left: 16px; bottom: 14px; display: flex; flex-wrap: wrap; gap: 6px 16px; max-width: calc(100% - 32px); font: 400 11px/1.3 var(--mono); color: var(--dim); pointer-events: none; transition: opacity .4s; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; }
.legend i.up { width: 0; height: 0; border-radius: 0; border: 5px solid transparent; border-bottom: 8px solid var(--green); border-top: 0; }
.legend i.size { width: 12px; height: 12px; border: 1.5px solid var(--gold); }
body.reading .legend { opacity: 0; }
.stage-hint { position: absolute; z-index: 3; right: 16px; top: 14px; margin: 0; font: 400 11px var(--mono); color: var(--faint); pointer-events: none; transition: opacity .6s; }
body.turned .stage-hint, body.reading .stage-hint { opacity: 0; }
.t-clear { background: var(--green); }
.t-minor { background: var(--amber); }
.t-serious { background: var(--red); }
.t-official { background: var(--gold); }
.t-quiet { background: var(--quiet); }

/* The reading */
.panel { min-height: 0; overflow-y: auto; border-left: 1px solid var(--line); background: var(--panel); scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; overscroll-behavior: contain; }
.idle { padding: 30px 26px; color: var(--dim); }
.idle h2 { margin: 0 0 10px; font: 400 34px/1.05 var(--serif); color: var(--ink); }
.idle h3 { margin: 28px 0 10px; font: 500 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.idle p { margin: 0; }
.idle .fine { margin-top: 18px; font-size: 13.5px; color: var(--faint); }
.pulse { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin: 24px 0 0; background: var(--line); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.pulse div { background: var(--bg); padding: 12px; }
.pulse dt { font: 400 10.5px/1.3 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--faint); }
.pulse dd { margin: 6px 0 0; font: 400 24px/1 var(--serif); color: var(--ink); }
.key { margin: 0; padding: 0; list-style: none; display: grid; gap: 7px; font-size: 13.5px; }
.key li { display: flex; align-items: center; gap: 10px; }
.key i { width: 10px; height: 10px; border-radius: 50%; flex: none; }

.sheet-head { display: flex; gap: 14px; align-items: center; padding: 20px 20px 14px; position: sticky; top: 0; z-index: 2; background: var(--panel); border-bottom: 1px solid var(--line); }
.sheet-head .face { width: 50px; height: 50px; border-radius: 50%; object-fit: cover; background: var(--raise); box-shadow: 0 0 0 2px var(--tone, var(--quiet)); flex: none; }
.sheet-head .face.blank { display: grid; place-items: center; font: 600 18px var(--sans); color: var(--tone, var(--quiet)); }
.sheet-head > div { min-width: 0; flex: 1; }
.sheet-head h2 { margin: 0; font: 400 30px/1 var(--serif); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-head p { margin: 4px 0 0; color: var(--dim); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.close { flex: none; align-self: flex-start; width: 34px; height: 34px; border-radius: 3px; border: 1px solid var(--line); background: transparent; cursor: pointer; color: var(--dim); font-size: 15px; }
.close:hover { color: var(--ink); border-color: var(--line-strong); }
.badges { display: flex; gap: 6px; flex-wrap: wrap; padding: 14px 20px 0; }
.price { display: flex; align-items: baseline; gap: 12px; padding: 14px 20px 0; }
.price b { font: 400 34px/1 var(--serif); }
.price span { font: 500 13px var(--mono); }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin: 14px 20px 0; background: var(--line); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.facts div { background: var(--bg); padding: 9px 10px; min-width: 0; }
.facts small { display: block; font: 400 10px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.facts b { display: block; margin-top: 3px; font: 500 13.5px var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; padding: 14px 20px 4px; }
.btn { display: inline-flex; align-items: center; justify-content: center; height: 36px; padding: 0 13px; border: 1px solid var(--line-strong); border-radius: 3px; background: transparent; color: var(--ink); text-decoration: none; font-size: 13px; font-weight: 500; cursor: pointer; }
.btn:hover { border-color: var(--gold); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #17140a; }
.btn.gold:hover { background: #f4e4b4; }
.part { padding: 18px 20px 6px; border-top: 1px solid var(--line); margin-top: 14px; scroll-margin-top: 96px; }
.part h3 { margin: 0 0 4px; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font: 400 22px/1.15 var(--serif); }
.part h3 button { border: 0; background: none; padding: 0; color: var(--faint); font: 400 11px var(--mono); cursor: pointer; letter-spacing: .04em; }
.part h3 button:hover { color: var(--gold); }
.part > p { margin: 0 0 8px; color: var(--dim); font-size: 13.5px; }
.findings { list-style: none; margin: 0; padding: 0; }
.findings li { display: grid; grid-template-columns: 10px 1fr; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.findings li:first-child { border-top: 0; }
.findings i { width: 9px; height: 9px; border-radius: 50%; margin-top: 7px; background: var(--faint); }
.findings li.red i { background: var(--red); box-shadow: 0 0 0 4px rgba(255, 122, 107, .14); }
.findings li.amber i { background: var(--amber); box-shadow: 0 0 0 4px rgba(242, 187, 74, .14); }
.findings li.green i { background: var(--green); }
.findings b { display: block; font-weight: 600; font-size: 14px; }
.findings span { display: block; color: var(--dim); font-size: 13.5px; margin-top: 2px; }
.bars { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 6px; }
.bars li { display: grid; grid-template-columns: 112px minmax(0, 1fr) 52px; gap: 10px; align-items: center; font: 400 12px var(--mono); color: var(--dim); }
.bars li a { color: var(--dim); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars li a:hover { color: var(--ink); }
.bars .track { height: 8px; border-radius: 4px; background: var(--raise); overflow: hidden; }
.bars .fill { height: 100%; border-radius: 4px; background: #d9d2bb; }
.bars li.creator .fill { background: var(--gold); }
.bars li.pool .fill { background: #a88a46; }
.bars li.rest .fill { background: #5f7b66; }
.bars li b { text-align: right; color: var(--ink); font-weight: 500; }
.trades { list-style: none; margin: 4px 0 0; padding: 0; font: 400 12px var(--mono); }
.trades li { display: grid; grid-template-columns: 38px 76px minmax(0, 1fr) 54px; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); align-items: center; color: var(--dim); }
.trades li:first-child { border-top: 0; }
.trades li.fresh { animation: fresh 1.6s ease-out; }
@keyframes fresh { from { background: rgba(232, 212, 154, .12); } to { background: transparent; } }
.trades .side-buy { color: var(--green); }
.trades .side-sell { color: var(--red); }
.trades b { color: var(--ink); font-weight: 500; text-align: right; }
.trades a { color: var(--faint); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trades a:hover { color: var(--ink); }
.trades .when { text-align: right; color: var(--faint); }
.addr { padding: 16px 20px 6px; font: 400 11.5px/1.6 var(--mono); color: var(--faint); overflow-wrap: anywhere; border-top: 1px solid var(--line); margin-top: 14px; }
.addr a { color: var(--dim); }
.stamp { padding: 6px 20px 26px; color: var(--faint); font-size: 12px; }
.loading { padding: 40px 22px; color: var(--dim); }
.err { padding: 18px 20px; color: var(--amber); }
.muted { color: var(--faint); font-size: 13px; padding: 4px 0 8px; }

/* A narrower screen: the reading slides over the stage. */
@media (max-width: 1240px) {
  :root { --side: 340px; }
  .shell { grid-template-columns: var(--side) minmax(0, 1fr); }
  .panel { position: absolute; z-index: 8; top: 0; right: 0; bottom: 0; width: var(--panel-w); transform: translateX(100%); transition: transform .35s cubic-bezier(.2, .8, .2, 1); box-shadow: -30px 0 60px rgba(0, 0, 0, .45); }
  body.reading .panel { transform: none; }
}

/* A phone: the stage is a band at the top, the list scrolls below it, the reading is a sheet under the band. */
@media (max-width: 860px) {
  body { overflow: auto; height: auto; }
  html, body { height: auto; }
  .bar { gap: 12px; padding: 0 14px; }
  .mark span, .bar nav .wide { display: none; }
  .search input { height: 36px; font-size: 13px; }
  .shell { display: flex; flex-direction: column; height: auto; }
  .stage { order: -1; flex: none; position: sticky; top: 0; z-index: 6; height: var(--band); border-bottom: 1px solid var(--line); }
  .side { border: 0; }
  .list { overflow: visible; }
  .row .figs { font-size: 11.5px; }
  .panel { position: fixed; top: var(--band); left: 0; right: 0; bottom: 0; width: auto; z-index: 20; border-left: 0; border-top: 1px solid var(--line-strong); transform: translateY(105%); transition: transform .35s cubic-bezier(.2, .8, .2, 1); }
  body.reading { overflow: hidden; }
  body.reading .panel { transform: none; }
  .idle { display: none; }
  .views { top: 10px; }
  .views button { height: 28px; padding: 0 11px; font-size: 12px; }
  .legend { left: 12px; bottom: 10px; gap: 4px 10px; font-size: 10px; }
  .stage-hint { display: none; }
  .sheet-head { padding: 14px 16px 12px; }
  .badges, .price, .actions { padding-left: 16px; padding-right: 16px; }
  .facts { margin-left: 16px; margin-right: 16px; }
  .part, .addr { padding-left: 16px; padding-right: 16px; }
}
@media (prefers-reduced-motion: no-preference) {
  .row, .tabs button, .btn, .views button { transition: background-color .15s, border-color .15s, color .15s; }
}
