:root {
  color-scheme: dark;
  --bg: #141518;
  --side: #191a1e;
  --surface: #1d1e23;
  --raised: #23242a;
  --line: #32343b;
  --text: #f0eee8;
  --muted: #a4a6b0;
  --soft: #777984;
  --accent: #f4c578;
  --up: #76c9aa;
  --down: #ef9492;
  --shadow: 0 2px 6px #0002;
  font: 14px/1.45 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
[hidden] { display: none !important; }
button, select, input { font: inherit; }
button, select { cursor: pointer; }
a { color: inherit; }
button:focus-visible, select:focus-visible, input:focus-visible, a:focus-visible, canvas:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
button { color: var(--text); }
.sidebar { position: fixed; width: 232px; height: 100dvh; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: var(--side); padding: 28px 17px 18px; z-index: 1; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; margin: 0 0 47px 5px; font-size: 19px; line-height: 1.15; font-weight: 720; letter-spacing: -.5px; }
.brand-mark { display: grid; place-items: center; flex: 0 0 34px; height: 34px; border-radius: 9px; color: #281e11; background: var(--accent); font-size: 34px; line-height: .7; font-weight: 600; }
.brand small { display: block; color: var(--muted); font-size: 8px; letter-spacing: 1.1px; margin-top: 6px; white-space: nowrap; }
.side-section { margin-bottom: 30px; }
.side-label { display: block; margin: 0 0 11px 9px; font-size: 10px; font-weight: 760; letter-spacing: 1.3px; color: var(--soft); }
nav { display: grid; gap: 4px; }
nav button { width: 100%; padding: 10px; display: flex; align-items: center; gap: 10px; text-align: left; background: transparent; border: 1px solid transparent; border-radius: 7px; color: var(--muted); }
nav button span:first-child { font-size: 17px; width: 20px; line-height: 1; }
nav button:hover, nav button.selected { background: #2a271f; color: var(--accent); }
nav button.selected { border-color: #413727; }
.counter { margin-left: auto; font-size: 11px; }
.market-picker select { width: 100%; }
.side-bottom { margin-top: auto; padding: 13px 8px 0; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex: 0 0 7px; background: var(--up); box-shadow: 0 0 8px #76c9aa45; }
.status-dot.warning { background: var(--accent); }
main { margin-left: 232px; }
.topbar { padding: 12px 30px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); min-height: 59px; color: var(--muted); background: #18191c; }
.topbar b { padding: 0 7px; color: var(--soft); font-weight: 400; }
.workspace { max-width: 1620px; margin: auto; padding: 26px 30px 12px; }
.page-header { display: flex; gap: 14px; justify-content: space-between; align-items: flex-end; margin-bottom: 23px; }
h1 { margin: 0; font-size: clamp(29px, 3.2vw, 42px); letter-spacing: -1.6px; line-height: 1.1; font-weight: 730; }
h2 { font-size: 16px; margin: 0; letter-spacing: -.2px; line-height: 1.22; }
h3 { font-size: 13px; margin: 0; }
p { margin: 6px 0; }
.page-header p { color: var(--muted); margin: 9px 0 0; }
.market-stamp { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 6px; padding: 7px 10px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.market-layout { display: grid; grid-template-columns: minmax(0, 1.36fr) minmax(330px, 1fr); gap: 17px; align-items: start; }
.primary { display: grid; gap: 16px; min-width: 0; }
.summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.summary article, .card { border: 1px solid var(--line); border-radius: 9px; background: var(--surface); box-shadow: var(--shadow); min-width: 0; }
.summary article { padding: 13px 13px 10px; }
.summary article > span { display: block; color: var(--muted); font-size: 10px; letter-spacing: .9px; font-weight: 670; }
.summary strong { font-size: clamp(16px, 2vw, 25px); letter-spacing: -.5px; margin-top: 4px; display: block; font-variant-numeric: tabular-nums; white-space: nowrap; }
.card-header { display: flex; align-items: center; justify-content: space-between; padding: 15px 15px 10px; gap: 10px; }
.muted { color: var(--muted); }
.subtle, select, input { background: var(--raised); border: 1px solid var(--line); border-radius: 6px; color: var(--text); min-height: 34px; padding: 6px 9px; }
.subtle:hover, .segmented button:hover { border-color: var(--accent); }
.subtle:disabled, button:disabled { opacity: .5; cursor: default; }
.filters { padding: 0 14px 12px; display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.filters select { max-width: 150px; font-size: 12px; }
.search { display: flex; align-items: center; gap: 6px; background: var(--raised); border: 1px solid var(--line); border-radius: 6px; color: var(--muted); min-width: 140px; flex: 1; padding-left: 10px; }
.search input { background: transparent; border: 0; flex: 1; width: 100%; padding-left: 2px; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: 8px 9px; text-align: right; white-space: nowrap; border-bottom: 1px solid #303138; }
th { color: var(--muted); font-weight: 550; font-size: 11px; background: #24252b; }
th:first-child, td:first-child { padding-left: 14px; text-align: left; }
th:last-child, td:last-child { padding-right: 14px; }
tbody tr:last-child td { border-bottom: 0; }
.market-table td { font-size: 12px; vertical-align: middle; height: 45px; }
.market-table tr[data-id] { cursor: pointer; }
.market-table tr[data-id]:hover, .market-table tr.active { background: #2a2723; }
.market-table tr.active td:first-child { box-shadow: inset 2px 0 var(--accent); }
.item-button { display: flex; gap: 8px; align-items: center; background: transparent; border: 0; padding: 0; text-align: left; }
.item-button strong { max-width: 19ch; overflow: hidden; text-overflow: ellipsis; font-weight: 620; }
.item-button small { display: block; font-size: 10px; color: var(--soft); }
.item-icon { width: 26px; height: 26px; border: 1px solid #706453; border-radius: 5px; object-fit: cover; background: #39332a; color: var(--accent); display: inline-grid; place-items: center; flex: none; }
.hero-icon { width: 40px; height: 40px; border-radius: 7px; }
.coin { color: var(--accent); font-variant-numeric: tabular-nums; }
.coin i { font-style: normal; color: #be945a; font-size: .79em; }
.positive { color: var(--up); }
.negative { color: var(--down); }
.spark { height: 19px; width: 45px; vertical-align: middle; }
.list-footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; border-top: 1px solid var(--line); padding: 9px 14px; min-height: 36px; color: var(--muted); font-size: 11px; }
.empty { padding: 26px 14px !important; text-align: center !important; color: var(--muted); white-space: normal; }
.item-title { display: flex; gap: 9px; align-items: center; min-width: 0; }
.item-title small { color: var(--muted); font-size: 11px; }
.star { font-size: 20px; line-height: 20px; color: var(--accent); }
.item-metrics { display: grid; grid-template-columns: 1.15fr 1fr 1fr; gap: 6px; padding: 8px 14px; border-bottom: 1px solid var(--line); }
.item-metrics > div > span { display: block; color: var(--muted); font-size: 10px; }
.item-metrics strong { display: block; font-size: clamp(13px, 1.5vw, 20px); margin-top: 3px; }
.chart-head { display: flex; align-items: center; justify-content: space-between; gap: 7px; padding: 10px 14px 2px; }
.segmented { display: flex; gap: 3px; }
.segmented button { background: transparent; border: 1px solid transparent; border-radius: 5px; font-size: 11px; padding: 4px 7px; color: var(--muted); }
.segmented button.active { background: #383024; color: var(--accent); border-color: #493c29; }
.chart { width: 100%; height: 174px; display: block; }
.chart-note, .card-note { color: var(--muted); min-height: 14px; padding: 0 14px 10px; font-size: 11px; }
.compact th, .compact td { font-size: 11px; }
.compact td { color: var(--muted); }
.compact a { text-decoration-color: #636572; text-underline-offset: 3px; }
.compact .coin { color: var(--accent); }
.source-name { color: var(--text); }
.compact td:first-child small { color: var(--muted); display: block; }
.breakdown { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.breakdown .card-header { align-items: start; }
.breakdown h2 { font-size: 13px; }
.info-link { color: var(--accent); font-size: 12px; text-decoration: none; }
.strategy-grid { display: grid; grid-template-columns: minmax(320px, .7fr) minmax(0, 1fr); gap: 17px; align-items: start; }
.stack { display: grid; gap: 14px; }
.card-body { padding: 3px 15px 15px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid label { display: grid; gap: 5px; color: var(--muted); font-size: 12px; }
.form-grid .wide { grid-column: 1/-1; }
.form-grid input, .form-grid select { width: 100%; min-width: 0; }
.cta { color: #241a0d; background: var(--accent); border: 1px solid #ebc078; border-radius: 6px; padding: 7px 13px; font-weight: 700; min-height: 34px; }
.cta:hover { background: #ffd490; }
.totals { margin: 14px 0 11px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.totals > div { background: #26272e; border-radius: 6px; padding: 8px; }
.totals small { color: var(--muted); display: block; }
.totals strong { font-variant-numeric: tabular-nums; }
.saved { display: grid; grid-template-columns: 1fr auto; align-items: center; padding: 9px 0; gap: 7px; border-top: 1px solid var(--line); }
.credits { color: var(--muted); font-size: 11px; margin: 18px 0 4px; }
.credits a { text-underline-offset: 3px; }
#toast { position: fixed; right: 24px; bottom: 24px; padding: 10px 15px; color: var(--text); background: var(--raised); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 5px 25px #0005; z-index: 2; }
@media (max-width: 1250px) {
  .sidebar { width: 195px; padding-left: 12px; padding-right: 12px; }
  main { margin-left: 195px; }
  .workspace, .topbar { padding-left: 19px; padding-right: 19px; }
  .item-button strong { max-width: 15ch; }
  .market-table th, .market-table td { padding-left: 6px; padding-right: 6px; }
  .market-table th:first-child, .market-table td:first-child { padding-left: 10px; }
}
@media (max-width: 1020px) {
  .market-layout { grid-template-columns: minmax(0, 1fr); }
  .detail-column { grid-row: 1; }
  .market-table td { height: 42px; }
  .item-button strong { max-width: 33ch; }
  .strategy-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 650px) {
  .sidebar { position: static; width: auto; height: auto; border-right: 0; border-bottom: 1px solid var(--line); flex-direction: row; flex-wrap: wrap; padding: 11px 12px 0; gap: 8px; }
  .brand { margin: 2px 0; font-size: 16px; }
  .brand-mark { flex-basis: 27px; height: 27px; font-size: 27px; }
  .brand small { font-size: 7px; }
  .side-section { margin: 0; }
  .side-section:first-of-type { order: 2; width: 100%; }
  nav { display: flex; gap: 3px; }
  nav button { width: auto; padding: 7px; gap: 4px; font-size: 11px; white-space: nowrap; }
  nav button span:first-child { width: 14px; font-size: 14px; }
  .side-label, .side-bottom { display: none; }
  .market-picker { margin-left: auto; max-width: 48%; }
  .market-picker select { font-size: 11px; }
  main { margin-left: 0; }
  .topbar { padding: 6px 12px; min-height: 41px; font-size: 11px; }
  .topbar button { padding: 3px 8px; min-height: 27px; }
  .workspace { padding: 14px 10px; }
  .page-header { flex-wrap: wrap; margin-bottom: 13px; }
  .page-header p { font-size: 12px; }
  .market-layout, .primary { gap: 11px; }
  .summary article { padding: 8px; }
  .summary article > span { font-size: 8px; letter-spacing: .3px; }
  .item-button strong { max-width: 18ch; }
  .market-table td:last-child, .market-table th:last-child { display: none; }
  .market-table td { font-size: 11px; }
  .breakdown { gap: 9px; }
}

.compare-current td { background: #2a2723; }
.compare-current td:first-child { box-shadow: inset 2px 0 var(--accent); }
.compare-link { min-height: 27px; padding: 3px 6px; font-size: 11px; }
