:root {
  --bg: #f7f7f2;
  --panel: #ffffff;
  --text: #111111;
  --muted: #666666;
  --border: #222222;
  --soft-border: #d7d7d0;
  --positive: #087f23;
  --negative: #b00020;
  --neutral: #666666;
  --accent: #003b5c;
  --warning-bg: #fff6d6;
  --warning-border: #b88700;
  --info-bg: #eef6fb;
  --info-border: #7aa0ba;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: light;
  font-family: Arial, Helvetica, sans-serif;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.14em;
}

a:hover {
  text-decoration-thickness: 2px;
}

a:focus,
button:focus,
input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button,
input {
  font: inherit;
}

.skip-link {
  position: absolute;
  left: 0.5rem;
  top: -3rem;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
  z-index: 1000;
}

.skip-link:focus {
  top: 0.5rem;
}

.container {
  width: min(1180px, calc(100% - 1.5rem));
  margin: 0 auto;
}

.site-header {
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
  padding: 1rem 0;
  flex-wrap: wrap;
}

.brand-link {
  display: inline-block;
  color: var(--text);
  font-size: 1.5rem;
  font-weight: 700;
  text-decoration: none;
}

.brand-tagline {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.site-nav {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.site-nav a {
  border: 1px solid var(--soft-border);
  padding: 0.45rem 0.7rem;
  color: var(--text);
  text-decoration: none;
}

.site-nav a[aria-current="page"] {
  border-color: var(--border);
  background: #efefe8;
  font-weight: 700;
}

.site-main {
  padding: 1rem 0 2rem;
}

.site-main > .container + .container {
  margin-top: 1rem;
}

.page-intro {
  padding-top: 0.5rem;
}

.eyebrow {
  margin: 0 0 0.4rem;
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

h1,
h2 {
  margin: 0 0 0.75rem;
  line-height: 1.15;
}

h1 {
  font-size: clamp(1.9rem, 4vw, 2.6rem);
}

h2 {
  font-size: 1.1rem;
}

.lead {
  max-width: 70ch;
  margin: 0;
  color: var(--text);
}

.meta-line {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.85rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.banner {
  padding: 0.75rem 0.9rem;
  border: 1px solid;
}

.banner-warning {
  background: var(--warning-bg);
  border-color: var(--warning-border);
}

.banner-info {
  background: var(--info-bg);
  border-color: var(--info-border);
}

.panel,
.market-card,
.disclaimer-box,
.empty-state {
  background: var(--panel);
  border: 1px solid var(--soft-border);
}

.panel,
.disclaimer-box,
.empty-state {
  padding: 1rem;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.75rem;
}

.market-card {
  padding: 0.85rem;
}

.market-card h2 {
  margin-bottom: 0.55rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.market-card-value {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 700;
}

.market-card-change,
.market-card-note {
  margin: 0.45rem 0 0;
  font-size: 0.94rem;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin-bottom: 0.75rem;
}

.panel-head h2 {
  margin: 0;
}

.split-panels,
.prose-grid,
.detail-grid,
.footer-grid {
  display: grid;
  gap: 1rem;
}

.split-panels {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.prose-grid,
.detail-grid,
.footer-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail-price {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.price-figure {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
}

.price-change {
  margin: 0.5rem 0 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.section-copy {
  margin-top: 0;
  color: var(--muted);
}

.table-wrap {
  overflow-x: auto;
}

.market-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

.compact-table {
  min-width: 0;
}

.market-table th,
.market-table td {
  padding: 0.62rem 0.6rem;
  border-bottom: 1px solid var(--soft-border);
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

.market-table th {
  background: #f1f1eb;
  font-size: 0.92rem;
}

.market-table tbody tr:hover {
  background: #fafaf5;
}

.market-table td:nth-child(2) {
  white-space: normal;
}

.sort-button {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  text-align: left;
  font-weight: 700;
  cursor: default;
}

html.js-enabled .sort-button {
  cursor: pointer;
}

html.js-enabled .sort-button::after {
  content: " \2195";
  color: var(--muted);
  font-weight: 400;
}

.table-tools {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 0.8rem;
}

.search-label {
  font-weight: 700;
}

.table-search {
  width: min(32rem, 100%);
  border: 1px solid var(--border);
  background: #fff;
  padding: 0.6rem 0.7rem;
}

.table-status {
  min-height: 1.2rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.table-actions {
  margin-top: 0.8rem;
}

.button-link {
  display: inline-block;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  padding: 0.55rem 0.8rem;
  text-decoration: none;
  cursor: pointer;
}

.button-link:hover {
  background: #efefe8;
}

.metrics-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0;
}

.metrics-list div {
  border-top: 1px solid var(--soft-border);
  padding-top: 0.6rem;
}

.metrics-list dt {
  font-weight: 700;
}

.metrics-list dd {
  margin: 0.25rem 0 0;
}

.plain-list {
  margin: 0;
  padding-left: 1.2rem;
}

.plain-list li + li {
  margin-top: 0.45rem;
}

.prose-panel p:last-child {
  margin-bottom: 0;
}

.breadcrumb {
  margin-bottom: 0.8rem;
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  list-style: none;
  margin: 0;
  padding: 0;
  color: var(--muted);
}

.breadcrumb li:not(:last-child)::after {
  content: ">";
  margin-left: 0.45rem;
}

.positive {
  color: var(--positive);
}

.negative {
  color: var(--negative);
}

.neutral {
  color: var(--neutral);
}

.empty-state p,
.disclaimer-box p {
  margin: 0;
}

.tv-widget-wrap {
  border: 1px solid var(--soft-border);
  background: var(--panel);
  padding: 10px;
  margin: 16px 0;
  min-height: 460px;
}

.tradingview-widget-container {
  width: 100%;
}

.tradingview-widget-container__widget {
  min-height: 420px;
}

.tv-note {
  color: var(--muted);
  font-size: 0.92rem;
}

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--panel);
  padding: 1.25rem 0 2rem;
}

.footer-title {
  margin-bottom: 0.45rem;
  font-size: 1rem;
}

.footer-note {
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.footer-note p {
  margin: 0.45rem 0 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1180px) {
  .kpi-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 800px) {
  .split-panels,
  .prose-grid,
  .detail-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .metrics-list {
    grid-template-columns: 1fr;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .container {
    width: min(100% - 1rem, 1180px);
  }

  .header-inner {
    align-items: start;
  }

  .site-main {
    padding-top: 0.75rem;
  }
}
