@font-face { font-family: Inter; font-weight: 400; font-display: swap; src: url(/fonts/inter-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: Inter; font-weight: 500; font-display: swap; src: url(/fonts/inter-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: Inter; font-weight: 600; font-display: swap; src: url(/fonts/inter-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: Inter; font-weight: 700; font-display: swap; src: url(/fonts/inter-latin-700-normal.woff2) format('woff2'); }

:root {
  --bg: #121214; --card: #1E1E22; --card-2: #26262B; --line: #2E2E34;
  --text: #ECECEF; --text-2: #9A9AA3; --text-3: #6B6B74;
  --accent: #9B6BFF; --accent-soft: rgba(155, 107, 255, .14);
  --up: #34D399; --up-soft: rgba(52, 211, 153, .13);
  --down: #F0656B; --down-soft: rgba(240, 101, 107, .13);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--bg); }
body {
  background: var(--bg); color: var(--text);
  font-family: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-feature-settings: "tnum" 1; -webkit-font-smoothing: antialiased;
}
#app { max-width: 1200px; margin: 0 auto; padding: 28px 32px 24px; background: var(--bg); }
h1 { font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
h2 { font: inherit; }
button { font: inherit; }

/* header */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.brand { display: flex; align-items: center; gap: 12px; }
.logo { width: 32px; height: 32px; border-radius: 10px; background: var(--accent-soft); display: grid; place-items: center; flex: none; }
.logo svg { width: 18px; height: 18px; }
.sub { color: var(--text-2); font-size: 13px; margin-top: 2px; }
.right { display: flex; align-items: center; gap: 14px; }
.upd { font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.brand .upd { display: none; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); flex: none; }
.dot.off { background: var(--text-3); box-shadow: 0 0 0 3px rgba(255,255,255,.06); }
.seg { display: flex; background: var(--card); border-radius: 10px; padding: 3px; }
.seg button { all: unset; font-size: 13px; font-weight: 600; color: var(--text-2); padding: 7px 14px; border-radius: 8px; cursor: pointer; text-align: center; }
.seg button[aria-pressed="true"] { background: var(--card-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.seg button:focus-visible, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn { all: unset; background: var(--accent); color: #fff; font-size: 13px; font-weight: 600; padding: 9px 16px; border-radius: 10px; display: flex; gap: 8px; align-items: center; cursor: pointer; }
.btn:hover { filter: brightness(1.08); }
.btn[disabled] { opacity: .6; cursor: progress; }

/* asset cards */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.card {
  background: var(--card); border-radius: 16px; padding: 20px 20px 14px;
  display: grid; grid-template-columns: auto 1fr auto; column-gap: 10px;
  grid-template-areas: "ic nm badge" "price price price" "meta meta meta" "spark spark spark" "status status status";
  align-items: center; min-width: 0;
}
.ic { grid-area: ic; width: 34px; height: 34px; }
.ic svg { width: 100%; height: 100%; display: block; }
/* compact numbers for narrow screens (e.g. 1.3M sats) */
.v-short { display: none; }
.nm { grid-area: nm; min-width: 0; }
.name { font-size: 15px; font-weight: 600; }
.tk { font-size: 12px; color: var(--text-2); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* what the card is priced in: words under the name here, icons on the status line on phones */
.nm .tk, .usw.ico { display: none; }
.uswrow { display: flex; align-items: center; gap: 8px; margin-top: 5px; }
.usw { display: inline-flex; gap: 2px; background: var(--card-2); border-radius: 8px; padding: 2px; }
.usw button { all: unset; font-size: 11.5px; font-weight: 600; color: var(--text-2); padding: 3px 8px; border-radius: 6px; cursor: pointer; }
.usw button:hover { color: var(--text); }
.usw button[aria-pressed="true"] { background: #3A3A42; color: var(--text); }
.usw button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.spot { font-size: 11px; color: var(--text-3); }
.badge { grid-area: badge; justify-self: end; }
.pill { font-size: 13px; font-weight: 600; padding: 5px 9px; border-radius: 8px; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.pill.up { color: var(--up); background: var(--up-soft); }
.pill.down { color: var(--down); background: var(--down-soft); }
.pill.flat, .pill.closed { color: var(--text-2); background: var(--card-2); }
.price { grid-area: price; font-size: 32px; font-weight: 600; letter-spacing: -.02em; margin: 18px 0 4px; white-space: nowrap; }
.price small { font-size: 20px; color: var(--text-2); font-weight: 500; }
.price.na { font-size: 22px; color: var(--text-2); }
.meta { grid-area: meta; font-size: 12px; color: var(--text-2); display: flex; gap: 14px; }
.meta b { color: var(--text); font-weight: 500; }
.spark { grid-area: spark; margin-top: 12px; height: 74px; position: relative; min-width: 0; touch-action: pan-y; }
.spark svg { display: block; }
.spark .empty { height: 100%; display: grid; place-items: center; font-size: 12px; color: var(--text-3); border: 1px dashed var(--line); border-radius: 10px; }
.placeholder { grid-column: 1 / -1; background: var(--card); border-radius: 16px; padding: 48px 20px; text-align: center; color: var(--text-2); font-size: 14px; }
.status { grid-area: status; font-size: 12px; color: var(--text-2); margin-top: 10px; display: flex; align-items: center; gap: 7px; min-height: 16px; }
.status .sd { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.status .sd.open { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.status .sd.shut { border: 1.5px solid var(--text-3); }
.status .sd.warn { background: var(--down); }
.status .muted { color: var(--text-3); }
/* the status text gives way (…) before the unit icons do; padding keeps the dot's ring unclipped */
.status .st { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 3px 0 3px 3px; margin: -3px 0 -3px -3px; }
.status .st .sd { display: inline-block; margin-right: 7px; vertical-align: 0; }

/* relative performance + correlation */
.panel { background: var(--card); border-radius: 16px; padding: 20px; margin-top: 16px; display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 24px; }
.ph { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.pt { font-size: 15px; font-weight: 600; }
.pd { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--text-2); flex-wrap: wrap; }
.legend span { display: flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 3px; border-radius: 2px; display: inline-block; }
.rel-chart { position: relative; height: 230px; touch-action: pan-y; }
.rel-chart svg { display: block; }
.corr { border-left: 1px solid var(--line); padding-left: 24px; min-width: 0; }
.crow { margin-top: 16px; }
.cl { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; margin-bottom: 7px; }
.cl .v { font-weight: 600; }
.cl .v.na { font-weight: 500; color: var(--text-3); font-size: 12px; text-align: right; }
.bar { height: 6px; background: var(--card-2); border-radius: 3px; overflow: hidden; }
.bar div { height: 100%; border-radius: 3px; background: var(--accent); }
.cn { font-size: 11px; color: var(--text-3); margin-top: 5px; }
.foot { display: flex; justify-content: space-between; gap: 16px; font-size: 11px; color: var(--text-3); margin-top: 14px; padding: 0 4px; }

/* tooltip */
.tip { position: fixed; z-index: 10; pointer-events: none; background: #2C2C32; border: 1px solid #3A3A42; border-radius: 10px; padding: 9px 11px; font-size: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.4); min-width: 150px; }
.tip .tt { font-weight: 600; margin-bottom: 2px; }
.tip .r { display: flex; align-items: center; gap: 7px; margin-top: 4px; color: var(--text-2); }
.tip .r i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.tip .r b { color: var(--text); font-weight: 600; margin-left: auto; padding-left: 14px; }
.tip .chg { min-width: 56px; text-align: right; font-weight: 600; padding-left: 10px; font-variant-numeric: tabular-nums; }
.tip .chg.up { color: var(--up); }
.tip .chg.down { color: var(--down); }
.tip .chg.flat { color: var(--text-2); }
.tip .note { color: var(--text-3); margin-top: 6px; }

@media (max-width: 900px) {
  .panel { grid-template-columns: 1fr; }
  .corr { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 18px; }
}

/* phone: cards become one list */
@media (max-width: 640px) {
  #app { padding: max(20px, env(safe-area-inset-top)) 16px 28px; }
  .top { flex-wrap: wrap; margin-bottom: 0; }
  .brand { flex: 1; }
  .brand .logo, .brand .sub { display: none; }
  h1 { font-size: 26px; letter-spacing: -.02em; }
  .brand .upd { display: flex; margin-top: 4px; }
  .right .upd { display: none; }
  .right { display: contents; }
  .btn { order: 1; width: 42px; height: 42px; padding: 0; justify-content: center; border-radius: 12px; }
  .btn-label { display: none; }
  .btn svg { width: 19px; height: 19px; }
  .seg { order: 2; flex-basis: 100%; display: grid; grid-template-columns: repeat(6, 1fr); border-radius: 12px; margin: 6px 0 14px; }
  .seg button { padding: 9px 0; font-size: 13px; border-radius: 9px; }

  .grid { display: block; background: var(--card); border-radius: 16px; padding: 0 14px; }
  .card {
    background: none; border-radius: 0; padding: 14px 0;
    grid-template-columns: auto minmax(0, 1fr) 74px auto; column-gap: 10px;
    grid-template-areas: "ic nm spark price" "ic nm spark badge" "status status status status";
  }
  .card + .card { border-top: 1px solid var(--line); }
  .ic { width: 36px; height: 36px; }
  .v-full { display: none; }
  .v-short { display: inline; }
  .price { font-size: 15px; margin: 0; text-align: right; letter-spacing: 0; }
  .price small { font-size: 15px; color: var(--text); font-weight: 600; }
  .price.na { font-size: 13px; }
  .badge { margin-top: 4px; }
  .pill { font-size: 12px; padding: 3px 7px; border-radius: 7px; }
  .meta { display: none; }
  .spark { margin: 0; height: 34px; }
  .spark .empty { font-size: 0; border-style: dashed; }
  .status { margin-top: 8px; font-size: 11.5px; white-space: nowrap; }
  .nm .tk { display: block; }
  .uswrow { display: none; }
  .usw.ico { display: inline-flex; margin-left: auto; flex: none; }
  .usw.ico button { padding: 3px 6px; display: grid; place-items: center; }
  .usw.ico svg { width: 17px; height: 17px; display: block; }
  .usw.ico button[aria-pressed="false"] svg { opacity: .55; }

  .panel { padding: 16px 14px; margin-top: 14px; gap: 18px; }
  .ph { flex-direction: column; }
  .rel-chart { height: 210px; }
  .foot { flex-direction: column; align-items: center; text-align: center; gap: 4px; }
}

/* the narrowest phones (320 px): smaller card charts so names fit */
@media (max-width: 359px) {
  .card { grid-template-columns: auto minmax(0, 1fr) 46px auto; column-gap: 8px; }
  .status .muted { display: none; }
  .usw.ico button { padding: 3px 4px; }
}
