/* Home page market charts: plain HTML and CSS, no chart library and no third-party requests. */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-top: 1.5rem; }
.kpi { background: #fff; border: 1px solid var(--cr-border); border-radius: var(--cr-radius); padding: 1.1rem 1.2rem; border-top: 4px solid var(--cr-forest); }
.kpi-value { font-size: clamp(1.6rem, 3vw, 2.1rem); font-weight: 800; letter-spacing: -0.03em; color: var(--cr-forest-dark); line-height: 1.1; }
.kpi-label { color: var(--cr-muted); font-size: 0.9rem; margin-top: 0.3rem; }
.chart-card { padding: 1.3rem 1.4rem; height: 100%; }
.chart-title { font-size: 1.05rem; margin-bottom: 1rem; }
.chart-note { font-size: 0.82rem; color: var(--cr-muted); margin: 0.8rem 0 0; }

.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.85rem; }
.bar-row { display: flex; justify-content: space-between; gap: 0.75rem; font-size: 0.92rem; margin-bottom: 0.25rem; }
.bar-label { font-weight: 600; }
.bar-value { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; }
.bar-track { height: 10px; background: var(--cr-mint); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--cr-forest); border-radius: 999px; min-width: 3px; }
.bar-fill.alt { background: #2a8c6a; }

.columns { list-style: none; margin: 0; padding: 0; display: flex; align-items: flex-end; gap: 0.5rem; height: 230px; }
.columns li { flex: 1 1 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; min-width: 0; }
.col-value { font-size: 0.72rem; font-weight: 600; color: var(--cr-muted); margin-bottom: 0.2rem; white-space: nowrap; }
.col-bar { width: 100%; background: var(--cr-forest); border-radius: 6px 6px 0 0; min-height: 3px; display: block; }
.col-label { font-size: 0.8rem; margin-top: 0.35rem; font-weight: 600; }

.tilemap { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: repeat(5, 4.6rem); gap: 0.4rem; max-width: 30rem; }
.tile { border-radius: 10px; padding: 0.4rem 0.5rem; display: flex; flex-direction: column; justify-content: space-between; line-height: 1.15; border: 1px solid rgba(15, 95, 69, 0.15); }
.tile-name { font-size: 0.74rem; font-weight: 600; }
.tile-count { font-size: 1.05rem; font-weight: 800; letter-spacing: -0.02em; }
.l0 { background: #e7f4ed; color: var(--cr-ink); }
.l1 { background: #b9e0cb; color: var(--cr-ink); }
.l2 { background: #7cc7a2; color: var(--cr-ink); }
.l3 { background: #2f8a67; color: #fff; }
.l4 { background: #0f5f45; color: #fff; }
.tile-legend { display: flex; align-items: center; gap: 0.6rem; margin-top: 0.8rem; font-size: 0.8rem; color: var(--cr-muted); }
.swatches { display: inline-flex; gap: 2px; }
.swatches i { width: 22px; height: 12px; display: inline-block; border-radius: 3px; border: 1px solid rgba(15, 95, 69, 0.15); }

.yoy-teaser { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem; margin-top: 1.2rem; padding: 0.8rem 1.1rem; background: #fff; border: 1px solid var(--cr-border); border-radius: var(--cr-radius); }

/* Year on year: two thin bars per row (this year above last year), paired columns by month */
.yoy-head { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; margin-top: 1rem; }
.yoy-fig { background: #fff; border: 1px solid var(--cr-border); border-radius: var(--cr-radius); padding: 0.9rem 1.1rem; display: flex; flex-direction: column; }
.yoy-num { font-size: clamp(1.4rem, 2.6vw, 1.8rem); font-weight: 800; letter-spacing: -0.03em; color: var(--cr-forest-dark); }
.yoy-cap { color: var(--cr-muted); font-size: 0.85rem; }
.yoy-key { display: flex; gap: 1.2rem; margin: 1rem 0 0.6rem; font-size: 0.85rem; color: var(--cr-muted); }
.yoy-key i, .k-prior, .k-now { display: inline-block; width: 14px; height: 10px; border-radius: 3px; margin-right: 0.35rem; }
.k-prior, .bar-fill.prior, .col-bar.prior { background: #a9bdb3; }
.k-now, .bar-fill.now, .col-bar.now { background: var(--cr-forest); }
.bar-track.thin { height: 8px; margin-top: 3px; }
.chg { font-size: 0.78rem; font-weight: 600; color: var(--cr-muted); margin-left: 0.3rem; white-space: nowrap; }
.columns.pair { height: 250px; }
.pair-bars { display: flex; align-items: flex-end; gap: 3px; width: 100%; }
.pair-bars .col-bar { flex: 1 1 0; border-radius: 4px 4px 0 0; }
.col-chg { font-size: 0.68rem; color: var(--cr-muted); white-space: nowrap; font-weight: 600; }

@media (max-width: 575.98px) {
  .col-chg { font-size: 0.55rem; }
  .columns { gap: 0.25rem; }
  .col-value { font-size: 0.6rem; }
  .tilemap { grid-template-rows: repeat(5, 4.2rem); }
  .tile-name { font-size: 0.66rem; }
  .bar-row { flex-direction: column; gap: 0; }
  .bar-value { text-align: left; }
}

/* Reference tables (default values and rates, origin countries) */
.ref-links { margin: 1.4rem 0 0; font-size: 0.98rem; color: var(--cr-muted); }
.ref-links a { font-weight: 600; margin: 0 0.25rem; }
.ref-table { background: #fff; border: 1px solid var(--cr-border); border-radius: var(--cr-radius); overflow: hidden; --bs-table-bg: #fff; }
.ref-table thead th { background: var(--cr-mint); color: var(--cr-forest-dark); font-size: 0.85rem; white-space: nowrap; }
.ref-table tbody th { font-weight: 600; }
.ref-table .code-num { font-variant-numeric: tabular-nums; font-weight: 700; }
.ref-table .desc-cell { max-width: 34rem; font-size: 0.9rem; color: var(--cr-muted); }
.ref-table td, .ref-table th { vertical-align: top; }
.matrix-table { --bs-table-bg: transparent; border-collapse: separate; border-spacing: 3px; }
.matrix-table thead th { font-size: 0.8rem; color: var(--cr-muted); white-space: nowrap; border-bottom: 0; }
.matrix-table tbody th { font-weight: 600; white-space: nowrap; border: 0; }
.matrix-table td { border: 0; padding: 0; }
.heat { display: block; padding: 0.5rem 0.7rem; border-radius: 8px; font-variant-numeric: tabular-nums; font-size: 0.88rem; min-width: 5.2rem; }
.heat.l0 { background: transparent; color: var(--cr-muted); }

/* Market Explorer: in-page section links */
.explorer-nav { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 1.2rem 0 0.4rem; }
.explorer-nav a { padding: 0.4rem 0.95rem; border: 1px solid var(--cr-border); border-radius: 999px; background: #fff; font-weight: 600; font-size: 0.92rem; text-decoration: none; color: var(--cr-ink); }
.explorer-nav a:hover { background: var(--cr-mint); border-color: var(--cr-forest); }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
