/* Shared typography and controls for React and the retained BTC research page. */
:root {
  --subtle: #b5bdc7;
  --muted: #9aa5b5;
  --ui-bg: var(--bg, #000);
  --ui-fg: var(--fg, #f5f5f5);
  --ui-line: var(--line, #343a43);
  --ui-hover: var(--control, #22262d);
}
:root[data-theme="light"],
:root[data-cg-theme="light"] {
  --subtle: #475569;
  --muted: #526175;
  --ui-bg: #fff;
  --ui-fg: #18202b;
  --ui-line: #d6dce4;
  --ui-hover: #f1f4f8;
}
html {
  scrollbar-gutter: stable;
}
body {
  font-size: 14px;
}
button,
a {
  touch-action: manipulation;
}
button,
a,
input {
  transition:
    background-color 0.12s,
    color 0.12s,
    border-color 0.12s;
}
.site-header nav,
.cg-header nav {
  display: flex !important;
  gap: 26px;
  align-items: center;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.site-header nav a,
.cg-header nav a {
  font-size: 15px !important;
  font-weight: 600 !important;
  color: var(--ui-fg) !important;
  line-height: 24px;
  padding: 8px 0;
  white-space: nowrap;
}
.site-header nav a.active,
.cg-header nav a.active {
  color: var(--green, #00c805) !important;
}
.site-header nav a:hover,
.cg-header nav a:hover {
  color: var(--green, #00c805) !important;
}
.site-header .ts-logo {
  flex-shrink: 0;
}
.site-header .icon-button {
  flex-shrink: 0;
}
table,
.ts-market-table,
.overview-table,
.expanded-exchange-table,
#cg-refined table {
  font-size: 14px !important;
  font-variant-numeric: tabular-nums;
}
table th,
#cg-refined table th {
  font-size: 13px !important;
  color: var(--subtle) !important;
  font-weight: 500 !important;
  line-height: 20px;
}
table td,
#cg-refined table td {
  font-size: 14px !important;
  line-height: 22px;
  padding-top: 17px;
  padding-bottom: 17px;
}
.ts-market-table td {
  height: 70px;
}
.ts-market-table th {
  height: 48px;
}
.ts-asset b,
.exchange-name,
.ts-rank-row b,
#cg-refined .cg-market-identity b {
  font-size: 15px !important;
  font-weight: 600 !important;
}
table small,
.ts-asset small,
.exchange-name small,
#cg-refined table small {
  font-size: 12px !important;
  color: var(--subtle) !important;
  line-height: 19px;
}
.rank,
.ts-rank-no,
.ts-market-table td:nth-child(2) {
  font-size: 12px !important;
  color: var(--muted);
}
.ts-rank-row,
.ts-rank-row strong,
.ts-rank-price,
.watch-panel > a,
.watch-values {
  font-size: 14px !important;
  line-height: 22px;
}
.watch-panel > a small {
  font-size: 12px !important;
}
.watch-panel > a {
  gap: 10px;
}
.watch-values {
  margin-left: auto;
  white-space: nowrap;
}
.ts-table-controls input,
.overview-filters input,
.table-search input {
  font-size: 14px;
}
.table-footnote,
.movers-note,
.ts-sample-note {
  font-size: 12px;
}
.table-scroll {
  scrollbar-width: thin;
  scrollbar-color: var(--ui-line) transparent;
}
.logo-wrap {
  flex-shrink: 0;
  background: transparent;
}
.logo-wrap img {
  border-radius: 50%;
}
.ts-select {
  display: inline-flex;
  vertical-align: middle;
  max-width: 100%;
  color: var(--ui-fg);
  font-size: 13px;
  line-height: 20px;
}
.ts-select-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 38px;
  min-width: 86px;
  padding: 8px 12px;
  border: 1px solid var(--ui-line);
  border-radius: 8px;
  background: var(--ui-bg);
  color: var(--ui-fg);
  font: inherit;
  white-space: nowrap;
  cursor: pointer;
  box-sizing: border-box;
}
.ts-select-trigger:hover,
.ts-select-trigger[aria-expanded="true"] {
  background: var(--ui-hover);
  border-color: var(--subtle);
}
.ts-select-trigger:focus-visible {
  outline: 2px solid var(--green, #00c805);
  outline-offset: 2px;
}
.ts-select-trigger svg {
  flex-shrink: 0;
}
.ts-select-menu {
  position: fixed;
  z-index: 10000;
  box-sizing: border-box;
  overflow-y: auto;
  padding: 6px;
  background: var(--ui-bg);
  color: var(--ui-fg);
  border: 1px solid var(--ui-line);
  border-radius: 10px;
  box-shadow: 0 8px 28px #0003;
  outline: none;
  font:
    14px/22px Arial,
    "Microsoft YaHei",
    sans-serif;
  scrollbar-width: thin;
}
.ts-select-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}
.ts-select-option.focused,
.ts-select-option:hover {
  background: var(--ui-hover);
}
.ts-select-option[aria-selected="true"] {
  color: var(--green, #00c805);
  font-weight: 600;
}
.ts-select-option[aria-disabled="true"] {
  opacity: 0.4;
  cursor: default;
}
.history-controls {
  align-items: center;
  min-height: 42px;
  font-size: 13px;
  gap: 16px;
}
.history-controls label {
  align-items: center;
}
.text-toggle {
  border-radius: 7px;
}
.text-toggle button {
  min-height: 36px;
  font-size: 13px;
  padding: 7px 12px;
}
.range-tabs {
  align-items: center;
  gap: 8px !important;
}
.range-tabs button {
  min-width: 48px;
  min-height: 42px;
  font-size: 13px;
  padding: 10px;
}
.range-tabs button:hover {
  background: var(--ui-hover);
}
.chart-toolbar {
  min-height: 48px;
}
.chart-status {
  height: 24px;
  line-height: 24px;
  font-size: 12px;
  color: var(--subtle);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.comparison-chart {
  position: relative;
}
.comparison-legend {
  min-height: 24px;
  font-size: 13px;
}
.hover-date {
  min-height: 20px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.history-explorer .chart-empty {
  height: 340px;
}
.detail-history .chart-empty {
  height: 260px;
}
#cg-refined {
  --cg-muted: var(--subtle) !important;
}
#cg-refined .cg-market-sort {
  font-size: 13px;
}
#cg-refined .cg-market-sort small {
  font-size: 12px !important;
}
#cg-refined [class*="toolbar"],
#cg-refined [class*="controls"],
#cg-refined .cg-history-head {
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
#cg-refined svg text {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
#cg-refined [data-history-caption],
#cg-refined .cg-flow-hover {
  min-height: 22px;
  line-height: 22px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
#cg-refined .cg-chart-stack,
#cg-refined .cg-history-plot {
  contain: layout;
}
@media (min-width: 1500px) {
  table td,
  #cg-refined table td {
    font-size: 15px !important;
  }
  .page {
    max-width: 1440px;
  }
  .site-header nav a,
  .cg-header nav a {
    font-size: 16px !important;
  }
  .ts-rank-row strong,
  .watch-values {
    font-size: 15px !important;
  }
}
@media (max-width: 850px) {
  .site-header {
    gap: 16px;
  }
  .site-header .global-search {
    width: 36px;
    flex: 0 0 36px;
    margin: 0;
    border: 0;
    padding: 0;
  }
  .global-search span,
  .global-search kbd {
    display: none;
  }
  .site-header nav,
  .cg-header nav {
    gap: 18px;
  }
  .site-header nav a,
  .cg-header nav a {
    font-size: 14px !important;
  }
  .cg-header {
    flex-wrap: wrap;
    height: auto !important;
    min-height: 68px;
    padding-top: 12px !important;
    padding-bottom: 12px !important;
  }
  .cg-header nav {
    order: 3;
    flex-basis: 100%;
  }
  .ts-rank-row {
    min-height: 55px;
  }
}
@media (max-width: 600px) {
  .site-header {
    flex-wrap: wrap;
    height: auto;
    min-height: 68px;
    padding-top: 12px;
    padding-bottom: 12px;
  }
  .site-header nav {
    order: 5;
    flex-basis: 100%;
    justify-content: flex-start;
  }
  .site-header .global-search {
    margin-left: auto;
  }
  .history-controls {
    gap: 10px;
  }
  .history-controls .compare-toggle {
    margin-left: 0;
  }
  .range-tabs {
    flex-wrap: nowrap !important;
    overflow-x: auto;
    width: 100%;
    justify-content: space-between;
  }
  .range-tabs button {
    min-width: 38px;
    padding: 10px 6px;
  }
  .ts-select-trigger {
    min-height: 40px;
  }
  .ts-table-controls input {
    font-size: 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}

#cg-refined :is(table,.cg-markets-table) td{font-size:14px!important}#cg-refined :is(table,.cg-markets-table) th{font-size:13px!important}#cg-refined select[hidden]{display:none!important}@media(min-width:1500px){#cg-refined :is(table,.cg-markets-table) td{font-size:15px!important}}

/* The retained document has its own theme attribute; it is authoritative here. */
:root[data-cg-theme=dark]{--ui-bg:#0b0d0e;--ui-fg:#f5f5f5;--ui-line:#343a43;--ui-hover:#242930;--subtle:#b5bdc7;--muted:#9aa5b5}
:root[data-cg-theme=light]{--ui-bg:#fff;--ui-fg:#18202b;--ui-line:#d6dce4;--ui-hover:#f1f4f8;--subtle:#475569;--muted:#526175}
html[data-cg-theme=dark] #cg-refined{--cg-muted:#b5bdc7!important;--cg-ink:#f5f5f5!important}
html[data-cg-theme=light] #cg-refined{--cg-muted:#475569!important;--cg-ink:#18202b!important}

#cg-refined .ts-select-trigger{display:inline-flex;align-items:center;justify-content:space-between;gap:16px;min-height:38px;min-width:86px;padding:8px 12px;border:1px solid var(--ui-line);border-radius:8px;background:var(--ui-bg);color:var(--ui-fg);font-size:13px;line-height:20px;font-weight:500;white-space:nowrap}
#cg-refined .ts-select-trigger:hover,#cg-refined .ts-select-trigger[aria-expanded=true]{background:var(--ui-hover);border-color:var(--subtle)}
