@import url('/kit/tokens.css');
* { box-sizing: border-box; }
html { color-scheme: dark; background: var(--bg); }
body { margin: 0; color: var(--fg); background: var(--bg); font: 14px/1.5 var(--font); }
button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button { color: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--beat); outline-offset: 3px; }
button:disabled { opacity: .45; cursor: default; }
a { color: var(--track-video); }
button, .button { min-height: 40px; border: 1px solid var(--border); border-radius: var(--radius-small); background: var(--raised); padding: 8px 13px; text-decoration: none; }
.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 650; }
.secondary { background: transparent; }
.quiet { background: transparent; border-color: transparent; color: var(--muted); padding: 8px; }
.muted, small, .label { color: var(--muted); }
.mono, .price, .metric strong, .change { font-variant-numeric: tabular-nums; }
.topbar { display: flex; align-items: center; gap: 24px; padding: 14px 28px; border-bottom: 1px solid var(--border); }
.wordmark { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 21px; text-decoration: none; color: var(--fg); white-space: nowrap; }
.wordmark svg { width: 26px; height: 26px; fill: none; stroke: var(--beat); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.wordmark span { color: var(--muted); font-size: 12px; font-weight: 500; margin-left: 2px; }
.topbar nav { display: flex; gap: 4px; flex: 1; }
.tab { background: transparent; border-color: transparent; color: var(--muted); }
.tab.active { background: var(--raised); border-color: var(--border); color: var(--fg); }
.topbar form { margin: 0; }
.shell { max-width: 1560px; padding: 24px 28px 16px; margin: auto; }
.workspace-head { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.segments { display: flex; gap: 3px; padding: 3px; border-radius: 9px; background: var(--card); }
.segments button { border: 0; background: transparent; color: var(--muted); min-height: 36px; }
.segments button.active { color: var(--fg); background: var(--control); }
.daily-label { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 7px; }
.daily-label i { width: 6px; height: 6px; border-radius: 50%; background: var(--beat); }
.workspace { display: grid; grid-template-columns: 252px minmax(0, 1fr); gap: 28px; }
.watchlist { min-width: 0; border-right: 1px solid var(--border); padding-right: 20px; }
.list-head { display: flex; align-items: center; justify-content: space-between; }
h2 { margin: 0; font-size: 16px; }
.search { display: flex; gap: 7px; align-items: center; border: 1px solid var(--border); border-radius: 7px; padding: 7px 10px; margin: 14px 0; }
.search input { background: none; border: 0; outline: none; color: var(--fg); width: 100%; min-width: 0; font-size: 14px; }
.search span { font-size: 22px; color: var(--muted); line-height: 1; }
.instrument { display: flex; align-items: center; gap: 4px; border-radius: 8px; margin-bottom: 3px; }
.instrument.active { background: var(--raised); }
.instrument .name { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; width: 100%; background: transparent; border: 0; text-align: left; padding: 9px; }
.instrument .name strong { font-size: 13px; font-weight: 550; }
.instrument .name small { font-size: 12px; }
.instrument .add { flex: none; width: 32px; min-height: 36px; padding: 0; border: 0; background: none; color: var(--muted); }
.instrument .add.picked { color: var(--beat); }
.list-note { color: var(--muted); font-size: 12px; margin-top: 20px; }
.reading { min-width: 0; }
.reading-head { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.eyebrow { color: var(--muted); text-transform: uppercase; letter-spacing: .09em; font-size: 12px; margin: 0 0 5px; }
h1 { font-size: 27px; line-height: 1.2; margin: 0 0 8px; letter-spacing: -.03em; font-weight: 650; }
.price { font-size: 26px; font-weight: 600; text-align: right; line-height: 1.2; }
.price small { font-size: 12px; margin-left: 6px; font-weight: 400; }
.change { text-align: right; margin-top: 5px; font-size: 13px; }
.positive { color: var(--fact-green); } .negative { color: var(--fact-red); }
.periods { display: flex; gap: 3px; flex-wrap: wrap; }
.periods button { font-size: 12px; padding: 6px 10px; min-height: 34px; border-color: transparent; background: transparent; color: var(--muted); }
.periods button.active { background: var(--raised); border-color: var(--border); color: var(--fg); }
.chart-wrap { position: relative; margin-top: 6px; border-bottom: 1px solid var(--border); }
.line-chart { width: 100%; height: 345px; display: block; touch-action: pan-y; overflow: visible; }
.line-chart text { fill: var(--muted); font: 12px var(--font); }
.line-chart .grid { stroke: var(--border); stroke-width: 1; }
.line-chart .zero { stroke: var(--control); stroke-dasharray: 3 5; }
.chart-tooltip { position: absolute; z-index: 2; left: 12px; top: 12px; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 9px 12px; font-size: 12px; box-shadow: 0 8px 24px var(--shadow); pointer-events: none; }
.chart-tooltip strong { display: block; margin-bottom: 4px; }
.chart-tooltip div { display: flex; gap: 16px; justify-content: space-between; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 14px 0; }
.legend button { border: none; background: none; padding: 3px 0; min-height: 30px; display: flex; align-items: center; gap: 6px; font-size: 12px; }
.legend i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.legend .remove { color: var(--muted); margin-left: 3px; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: 10px; margin: 22px 0 12px; }
.metric { padding: 16px; min-width: 0; }
.metric + .metric { border-left: 1px solid var(--border); }
.metric .label { font-size: 12px; display: block; margin-bottom: 5px; }
.metric strong { font-size: 21px; font-weight: 550; }
.subnote { color: var(--muted); font-size: 12px; margin: 8px 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 24px 0 12px; gap: 12px; }
.section-head h2 { font-size: 15px; }
.weights { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.weight { display: flex; align-items: center; gap: 8px; background: var(--card); border-radius: 7px; padding: 7px 10px; font-size: 12px; }
.weight input { width: 50px; background: var(--input); border: 1px solid var(--border); border-radius: 5px; color: var(--fg); padding: 4px; }
.addition-list { margin-top: 14px; border-top: 1px solid var(--border); }
.addition-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 14px; align-items: center; border-bottom: 1px solid var(--border); padding: 12px 0; }
.addition-row strong { display: block; font-weight: 550; font-size: 13px; }
.addition-row small { display: block; font-size: 12px; }
.addition-risk { text-align: right; font-variant-numeric: tabular-nums; }
.addition-row button { font-size: 12px; white-space: nowrap; }
.matrix-scroll { overflow-x: auto; }
.matrix { border-collapse: separate; border-spacing: 4px; width: 100%; max-width: 720px; font-size: 12px; }
.matrix th { color: var(--muted); font-weight: 400; padding: 6px; text-align: left; white-space: nowrap; }
.matrix td { padding: 14px 5px; text-align: center; border-radius: 5px; min-width: 48px; font-variant-numeric: tabular-nums; }
.experiment-controls { display: grid; grid-template-columns: minmax(170px, 2fr) repeat(3, minmax(70px, 1fr)); gap: 12px; margin: 20px 0 14px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); }
.field select { width: 100%; min-height: 42px; padding: 8px; color: var(--fg); background: var(--card); border: 1px solid var(--border); border-radius: 6px; }
.run-row { display: flex; align-items: center; gap: 16px; margin: 16px 0 24px; }
.run-row p { font-size: 12px; color: var(--muted); margin: 0; }
.split-bar { display: flex; height: 5px; border-radius: 4px; overflow: hidden; margin: 10px 0; background: var(--track-video); }
.split-bar span { background: var(--control); }
.split-labels { display: flex; justify-content: space-between; gap: 16px; font-size: 12px; color: var(--muted); }
.result-heading { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pill { padding: 3px 7px; font-size: 12px; background: var(--raised); border-radius: 5px; color: var(--muted); }
.notice { background: var(--problem-fill); color: var(--fg); padding: 12px 14px; border-radius: 8px; margin-bottom: 16px; }
.notice:empty { display: none; }
.loading { padding: 60px 0; color: var(--muted); }
.footnote { margin: 32px 0 0; padding-top: 14px; border-top: 1px solid var(--border); display: flex; gap: 12px; justify-content: space-between; color: var(--muted); font-size: 12px; }
.browse-mobile { display: none; }
dialog { max-width: 700px; max-height: 88dvh; width: calc(100% - 32px); padding: 0; background: var(--bg); color: var(--fg); border: 1px solid var(--border); border-radius: 14px; }
dialog::backdrop { background: var(--scrim); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 22px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--bg); }
.methods-body { padding: 8px 22px 22px; font-size: 14px; }
.methods-body h3 { margin: 25px 0 6px; font-size: 15px; }
.methods-body p { color: #b7bec8; }
.study-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.study-table td, .study-table th { text-align: right; padding: 9px 5px; border-bottom: 1px solid var(--border); white-space: nowrap; font-variant-numeric: tabular-nums; }
.study-table th:first-child { text-align: left; }
.entry { max-width: 440px; margin: 15dvh auto; padding: 32px; }
.entry h1 { font-size: 42px; margin-top: 12px; }
.entry p { color: var(--muted); margin-bottom: 28px; }
.entry .button { display: inline-flex; align-items: center; justify-content: center; min-width: 150px; }
.entry small { display: block; margin-top: 24px; }
.brand-mark { font-size: 42px; color: var(--beat); margin-bottom: 20px; }
@media (hover: hover) { button:not(:disabled):hover { filter: brightness(1.15); } .instrument:hover { background: var(--raised); } }
@media (max-width: 760px) {
  .topbar { gap: 8px; padding: 12px 16px 0; flex-wrap: wrap; }
  .wordmark { flex: 1; font-size: 20px; }
  .topbar nav { flex-basis: 100%; order: 3; gap: 0; margin: 6px -4px 0; }
  .topbar nav button { flex: 1; border-radius: 0; min-height: 48px; padding: 10px 5px; }
  .topbar nav button.active { border: none; border-bottom: 2px solid var(--fg); background: none; }
  .quiet { min-height: 44px; }
  .signout { font-size: 12px; }
  .shell { padding: 18px 16px; }
  .workspace-head { gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
  .segments button { padding: 7px 10px; font-size: 13px; }
  .daily-label { margin-left: auto; font-size: 12px; }
  .workspace { display: block; }
  .watchlist { display: none; position: fixed; inset: 20% 0 0; background: var(--bg); z-index: 10; border: 1px solid var(--border); border-radius: 18px 18px 0 0; padding: 18px 16px; overflow-y: auto; box-shadow: 0 -100px 0 100px var(--scrim); }
  .watchlist.open { display: block; }
  .browse-mobile { display: inline-flex; align-items: center; justify-content: center; }
  #browse-button { width: 100%; font-size: 13px; margin-top: 8px; }
  .search input, .field select, .weight input { font-size: 16px; }
  .instrument .name { min-height: 50px; }
  .instrument .add { min-height: 44px; min-width: 44px; }
  .reading-head { gap: 8px; margin-bottom: 14px; }
  h1 { font-size: 24px; }
  .price { font-size: 23px; }
  .price small { font-size: 12px; }
  .periods { justify-content: space-between; gap: 0; }
  .periods button { min-height: 44px; padding: 8px; }
  .line-chart { height: 280px; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .metric { padding: 14px; }
  .metric:nth-child(3) { border-left: 0; border-top: 1px solid var(--border); }
  .metric:nth-child(4) { border-top: 1px solid var(--border); }
  .metric strong { font-size: 21px; }
  .legend { gap: 3px 14px; }
  .legend button { min-height: 38px; }
  .experiment-controls { grid-template-columns: 1fr 1fr; gap: 12px; }
  .run-row { flex-direction: column; align-items: stretch; gap: 10px; }
  .run-row button { min-height: 44px; }
  .split-labels { font-size: 12px; }
  .footnote { flex-direction: column; gap: 4px; }
  dialog { position: fixed; inset: auto 0 0; width: 100%; max-width: none; margin: 0; border-radius: 16px 16px 0 0; }
}
