:root {
  color-scheme: dark;
  --bg: #0b111a;
  --panel: #131c29;
  --panel-raised: #1a293a;
  --line: #2c3d53;
  --text: #edf4fa;
  --muted: #a8b8cc;
  --dim: #829ab4;
  --accent: #aed8fa;
  --positive: #92dea5;
  --negative: #ffa8a0;
  --amber: #f0cc89;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 300px; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
a:focus-visible, button:focus-visible, canvas:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
time, .quote, .count, .watch-value, .variation { font-variant-numeric: tabular-nums; }
h1, h2, h3, p { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.bar { border-bottom: 1px solid var(--line); background: #0f1824; }
.bar-inner { width: min(100% - 56px, 1360px); min-height: 69px; margin: auto; display: flex; align-items: center; gap: 54px; }
.brand { display: inline-flex; align-items: center; flex: 0 0 auto; }
.brand img { display: block; width: min(196px, 42vw); height: auto; }
nav { display: flex; align-self: stretch; align-items: center; gap: 28px; }
nav a { display: flex; align-items: center; height: 100%; color: var(--muted); font-size: 13px; font-weight: 600; border-bottom: 2px solid transparent; }
nav a[aria-current] { color: var(--text); border-bottom-color: var(--accent); }
.mode { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; border: 1px solid #615234; background: #292417; color: var(--amber); border-radius: 99px; padding: 7px 11px; font-size: 12px; font-weight: 650; white-space: nowrap; }
.mode > span, .feed-state > span { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.workspace { width: min(100% - 56px, 1360px); margin: 0 auto; }
.hero { display: flex; justify-content: space-between; align-items: end; gap: 22px; padding: 37px 0 26px; }
.hero h1 { font-size: clamp(2rem, 4vw, 3.35rem); line-height: 1; letter-spacing: -.058em; font-weight: 780; }
.hero h1 span { color: var(--accent); }
.hero p { margin-top: 12px; color: var(--muted); font-size: 14px; }
.actions { display: flex; align-items: center; gap: 15px; color: var(--muted); font-size: 12px; }
.actions time { white-space: nowrap; }
.refresh { display: inline-flex; align-items: center; gap: 8px; padding: 9px 13px; border: 1px solid var(--line); background: var(--panel); border-radius: 8px; color: var(--text); font-size: 12px; font-weight: 650; white-space: nowrap; }
.refresh span { color: var(--accent); font-size: 16px; line-height: 1; }
.refresh:hover { background: var(--panel-raised); }
.refresh:disabled { cursor: wait; opacity: .7; }

.market-grid { display: grid; grid-template-columns: minmax(0, 2.3fr) minmax(290px, 1fr); gap: 16px; align-items: stretch; }
.panel { border-radius: 14px; border: 1px solid var(--line); background: var(--panel); overflow: hidden; }
.chart-header { display: flex; align-items: start; justify-content: space-between; gap: 16px; padding: 22px 23px 10px; }
.instrument { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.chip { background: #1b3045; color: var(--accent); border: 1px solid #365674; padding: 5px 7px; border-radius: 5px; font: 650 11px ui-monospace, Menlo, monospace; }
.label { color: var(--muted); font-size: 12px; }
.asset h2 { color: var(--muted); font-size: 14px; font-weight: 550; margin: 11px 0 5px; }
.quote { display: flex; align-items: baseline; gap: 11px; flex-wrap: wrap; }
.quote strong { color: var(--text); font-size: clamp(2rem, 3vw, 2.7rem); font-weight: 760; letter-spacing: -.053em; line-height: 1.03; }
.variation { font-size: 13px; font-weight: 700; color: var(--dim); }
.positive { color: var(--positive); }
.negative { color: var(--negative); }
.periods { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); padding: 3px; gap: 2px; flex-shrink: 0; }
.periods button { padding: 7px 10px; background: transparent; font-weight: 700; color: var(--muted); border: 0; border-radius: 5px; font-size: 12px; }
.periods button:hover { color: var(--text); }
.periods button[aria-pressed="true"] { background: #284768; color: var(--accent); }
.plot { height: 282px; margin: 3px 16px 0; position: relative; }
.plot canvas { display: block; width: 100%; height: 100%; }
.point { position: absolute; pointer-events: none; padding: 8px 10px; border-radius: 6px; border: 1px solid var(--line); color: var(--text); background: #0b1623; font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; box-shadow: 0 2px 12px #0b111a80; }
.chart-meta { display: flex; justify-content: space-between; gap: 8px 14px; flex-wrap: wrap; padding: 12px 23px 15px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.chart-meta a { font-weight: 600; }
.crypto-frame { height: 332px; }
.crypto-frame iframe { display: block; width: 100%; height: 100%; border: 0; }

.watch-panel { display: flex; flex-direction: column; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 21px 17px 17px; }
.panel-head h2 { font-size: 17px; font-weight: 750; letter-spacing: -.025em; }
.count { color: var(--muted); font-size: 11px; }
.watch-group { margin: 0 11px 10px; }
.watch-label { display: flex; justify-content: space-between; gap: 5px; color: var(--muted); border-bottom: 1px solid var(--line); padding: 8px 7px; font: 600 10px ui-monospace, Menlo, monospace; letter-spacing: .025em; }
.watch-row { width: 100%; display: grid; grid-template-columns: 29px minmax(0, 1fr) auto; align-items: center; gap: 8px; text-align: left; background: transparent; border: 0; border-bottom: 1px solid #223247; border-left: 2px solid transparent; padding: 8px 6px; min-height: 50px; }
.watch-row:hover { background: #1c2d41; }
.watch-row[aria-pressed="true"] { background: #1b3048; border-left-color: var(--accent); }
.asset-icon { display: grid; place-items: center; width: 27px; height: 27px; font-size: 11px; font-weight: 800; background: #253b51; color: var(--accent); border-radius: 7px; }
.watch-row[data-kind="crypto"] .asset-icon { color: #eac390; background: #382d23; }
.watch-name, .watch-move { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.watch-name strong, .watch-value { font: 650 12px ui-monospace, Menlo, monospace; }
.watch-name small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-size: 11px; }
.watch-move { text-align: right; }
.watch-move .variation { font-size: 10px; }
.feed-state { display: flex; align-items: center; gap: 7px; margin-top: auto; padding: 5px 17px 14px; color: var(--muted); font-size: 11px; }
.feed-state > span { color: var(--dim); }
.feed-state[data-state="fresh"] > span { color: var(--positive); }
.feed-state[data-state="fallback"] > span { color: var(--amber); }

.project { padding: 27px 0 30px; scroll-margin-top: 16px; }
.project-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 1px 13px; }
.project-title h2 { font-size: 19px; letter-spacing: -.03em; }
.gates { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.gate { padding: 16px; }
.gate > div { display: flex; justify-content: space-between; align-items: center; gap: 5px; }
.gate-number { color: var(--muted); font: 600 11px ui-monospace, Menlo, monospace; }
.status { font-size: 10px; font-weight: 700; border-radius: 5px; padding: 4px 6px; color: #beccdd; background: #223044; }
.status.done { background: #26382a; color: #a7e4b3; }
.status.next { background: #38311f; color: var(--amber); }
.gate h3 { margin: 11px 0 6px; font-size: 15px; font-weight: 700; }
.gate p { color: var(--muted); font-size: 12px; line-height: 1.48; }
.partner-link { display: inline-block; margin-top: 10px; color: #aed8fa; font-size: 13px; line-height: 1.48; text-decoration: underline; text-underline-offset: 3px; }
footer { border-top: 1px solid var(--line); color: var(--muted); display: flex; justify-content: space-between; font-size: 12px; padding: 15px 1px 24px; }

@media (max-width: 900px) {
  .market-grid { grid-template-columns: minmax(0, 1fr) 275px; }
  .workspace, .bar-inner { width: calc(100% - 36px); }
  .bar-inner { gap: 33px; }
}
@media (max-width: 700px) {
  .market-grid { grid-template-columns: minmax(0, 1fr); }
  .workspace, .bar-inner { width: calc(100% - 28px); }
  .bar-inner { min-height: 57px; gap: 12px; }
  nav { display: none; }
  .hero { align-items: start; padding-top: 25px; gap: 13px; }
  .hero h1 { font-size: clamp(1.65rem, 7vw, 2.25rem); }
  .hero p { margin-top: 9px; font-size: 12px; }
  .actions time { display: none; }
  .refresh { padding: 8px; gap: 5px; }
  .chart-header { padding: 16px 13px 6px; gap: 8px; }
  .instrument { gap: 6px; }
  #asset-source { font-size: 11px; }
  .periods button { padding: 6px; }
  .plot { height: 245px; margin-inline: 9px; }
  .chart-meta { padding-inline: 13px; }
  .crypto-frame { height: 330px; }
  .gates { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 380px) {
  .hero { flex-wrap: wrap; }
  .periods { margin-top: 2px; }
}
