
:root {
  --accent: #E2C040;
  --accent-hover: #d1b02f;
  --accent-soft: rgba(226, 192, 64, 0.1);
  --accent-med: rgba(226, 192, 64, 0.3);
  --fg: #111;
  --fg-muted: #666;
  --fg-light: #888;
  --fg-lighter: #999;
  --fg-faint: #aaa;
  --fg-dim: #bbb;
  --fg-whisper: #ccc;
  --bg: #fff;
  --bg-alt: #fafaf8;
  --border: #eee;
  --border-med: #ddd;
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-ui: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --green: #2eab4b;
  --green-dark: #1a7a4a;
  --red: #d94444;
  --red-dark: #c0392b;
}

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

body {
  font-family: var(--font-body);
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.market-page { max-width: 100%; }

.breadcrumbs {
  padding: 10px 24px;
  font-family: var(--font-ui);
  font-size: 10px;
  color: var(--fg-faint);
  border-bottom: 1px solid var(--border);
}
.breadcrumbs a { color: var(--fg-light); text-decoration: none; }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs span[aria-current] { color: #333; font-weight: 500; }

.market-hero {
  padding: 24px 24px 16px;
  border-bottom: 1px solid var(--border);
}
.market-hero h1 {
  font-family: var(--font-heading);
  font-size: 26px;
  color: var(--fg);
  font-weight: 400;
  margin-bottom: 8px;
}
.market-hero__intro {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--fg-muted);
  max-width: 560px;
  line-height: 1.6;
}

.stat-bar {
  display: flex;
  border-bottom: 1px solid var(--border);
}
.stat-bar__cell {
  flex: 1;
  padding: 10px 14px;
  text-align: center;
  border-right: 1px solid var(--border);
}
.stat-bar__cell:last-child { border-right: none; }
.stat-bar__value {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--fg);
  display: block;
}
.stat-bar__label {
  font-family: var(--font-ui);
  font-size: 9px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-lighter);
  display: block;
  margin-top: 2px;
}
.stat-bar__link {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  text-decoration: none;
  color: #c8a800;
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 500;
  border-right: 1px solid var(--border);
  transition: background 0.15s;
}
.stat-bar__link:last-child { border-right: none; }
.stat-bar__link:hover { background: var(--accent-soft); }

.stat-bar--insufficient {
  padding: 16px 24px;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--fg-light);
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.chart-section { border-bottom: 1px solid var(--border); }

.chart-tabs {
  display: flex;
  padding: 16px 24px 0;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.chart-tab {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 8px 16px;
  color: var(--fg-lighter);
  cursor: pointer;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}
.chart-tab:hover { color: #555; }
.chart-tab--active {
  color: var(--fg);
  border-bottom-color: var(--accent);
}

.chart-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
}
.time-pills {
  display: flex;
  gap: 0;
}
.time-pill {
  font-family: var(--font-ui);
  font-size: 9px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-right: none;
  background: var(--bg);
  color: var(--fg-lighter);
  cursor: pointer;
  transition: all 0.15s;
}
.time-pill:last-child { border-right: 1px solid var(--border); }
.time-pill--active {
  color: var(--fg);
  background: var(--bg-alt);
  border-color: var(--border-med);
}
.date-range {
  display: flex;
  align-items: center;
  gap: 8px;
}
.date-range__label {
  font-family: var(--font-ui);
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-lighter);
}
.date-range__input {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 5px 8px;
  border: 1px solid var(--border-med);
  width: 110px;
  background: var(--bg);
  color: var(--fg);
}

.chart-area {
  height: 340px;
  margin: 0 24px;
  position: relative;
}
.chart-area canvas {
  width: 100%;
  height: 100%;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 10px 24px;
  border-bottom: 1px solid var(--border);
}
.chart-legend__item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-ui);
  font-size: 9px;
  color: var(--fg-light);
}
.chart-legend__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.chart-legend__line {
  width: 16px;
  height: 2px;
  flex-shrink: 0;
}

.chart-desc {
  padding: 10px 24px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--fg-light);
  line-height: 1.5;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 400;
  color: var(--fg);
  margin-bottom: 10px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 16px 24px 0;
}
.section-header__link {
  font-family: var(--font-ui);
  font-size: 9px;
  color: #c8a800;
  text-decoration: none;
}
.section-header__link:hover { text-decoration: underline; }

.transmission-premium {
  padding: 0 24px 16px;
}

.market-table-wrap {
  padding: 0 24px;
  margin-bottom: 16px;
  overflow-x: auto;
}
.market-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-ui);
  font-size: 11px;
}
.market-table th {
  text-align: left;
  font-weight: 500;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-lighter);
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-med);
  white-space: nowrap;
}
.market-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--fg);
  vertical-align: middle;
}
.market-table tr:last-child td { border-bottom: none; }
.td-mono {
  font-family: var(--font-mono);
  font-weight: 700;
}
.td-mono--sm {
  font-family: var(--font-mono);
  font-size: 10px;
}
.badge--trim {
  font-family: var(--font-ui);
  font-size: 8px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  background: #f0f0f0;
  color: var(--fg-light);
  margin-left: 6px;
}
.badge--special {
  background: var(--accent-soft);
  color: #b09800;
}
.badge--active {
  font-family: var(--font-mono);
  font-size: 9px;
  padding: 2px 6px;
  background: var(--accent-soft);
  color: #b09800;
}
.trend-up { color: var(--green-dark); }
.trend-down { color: var(--red-dark); }

.score-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
}
.score-green { color: var(--green); }
.score-gold { color: #b09800; }
.score-red { color: var(--red); }

.gated-section { position: relative; }
.gated-section__blur {
  filter: blur(6px);
  pointer-events: none;
  user-select: none;
}
.gate-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg);
  border: 1px solid var(--border);
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  padding: 28px 40px;
  text-align: center;
  z-index: 10;
  max-width: 400px;
  width: 90%;
}
.gate-overlay__icon {
  width: 36px;
  height: 36px;
  background: var(--fg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
}
.gate-overlay__icon svg { width: 20px; height: 20px; fill: var(--accent); }
.gate-overlay__title {
  font-family: var(--font-heading);
  font-size: 18px;
  margin-bottom: 8px;
}
.gate-overlay__desc {
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--fg-light);
  max-width: 320px;
  margin: 0 auto 16px;
  line-height: 1.6;
}
.gate-overlay__cta {
  display: inline-block;
  background: var(--accent);
  color: var(--fg);
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 11px 32px;
  text-decoration: none;
  transition: opacity 0.15s;
}
.gate-overlay__cta:hover { opacity: 0.9; }
.gate-overlay__login {
  display: block;
  margin-top: 10px;
  font-family: var(--font-ui);
  font-size: 9px;
  color: var(--fg-light);
}
.gate-overlay__login a { color: #c8a800; text-decoration: none; }

.price-factors {
  margin: 0 24px 16px;
  border: 1px solid var(--border);
}
.price-factor {
  display: flex;
  border-bottom: 1px solid #f5f5f5;
}
.price-factor:last-child { border-bottom: none; }
.price-factor__strip {
  width: 4px;
  flex-shrink: 0;
}
.price-factor__strip--positive { background: var(--green-dark); }
.price-factor__strip--negative { background: var(--red-dark); }
.price-factor__strip--neutral { background: var(--border-med); }
.price-factor__body {
  padding: 10px 14px;
  flex: 1;
}
.price-factor__title {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 3px;
}
.price-factor__desc {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--fg-muted);
  line-height: 1.6;
}
.price-factor__impact {
  font-family: var(--font-ui);
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  display: inline-block;
  margin-top: 4px;
}
.impact--positive { background: #f0faf3; color: var(--green-dark); }
.impact--negative { background: #fef2f2; color: var(--red-dark); }
.impact--neutral { background: #f5f5f5; color: var(--fg-light); }

.faq-section { margin: 0 24px 16px; }
.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 11px 0;
}
.faq-item:last-child { border-bottom: none; }
.faq-question {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 500;
  color: #222;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  padding: 0;
}
.faq-arrow {
  width: 12px;
  height: 12px;
  color: var(--fg-dim);
  transition: transform 0.2s;
  flex-shrink: 0;
  margin-left: 12px;
}
.faq-item--open .faq-arrow { transform: rotate(180deg); }
.faq-answer {
  display: none;
  font-family: var(--font-body);
  font-size: 12.5px;
  color: var(--fg-muted);
  line-height: 1.7;
  margin-top: 8px;
}
.faq-item--open .faq-answer { display: block; }
.faq-answer a { color: #c8a800; text-decoration: none; }
.faq-answer a:hover { text-decoration: underline; }

.listing-snippet {
  padding: 0 24px;
  margin-bottom: 16px;
}
.snippet-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: #e8e8e8;
}
.snippet-card {
  background: var(--bg);
  text-decoration: none;
  color: var(--fg);
  display: block;
  transition: box-shadow 0.15s;
}
.snippet-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.snippet-card__img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
}
.snippet-card__body { padding: 10px 12px; }
.snippet-card__title {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 500;
  color: var(--fg);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.snippet-card__price {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--fg);
}
.snippet-card__meta {
  font-family: var(--font-ui);
  font-size: 9px;
  color: var(--fg-lighter);
  margin-top: 4px;
}
.snippet-card__score {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  margin-left: 6px;
}

.bottom-ctas {
  display: flex;
  gap: 10px;
  padding: 0 24px 20px;
  margin-top: 16px;
}
.bottom-cta {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  text-decoration: none;
  transition: opacity 0.15s;
}
.bottom-cta:hover { opacity: 0.9; }
.bottom-cta--dark {
  background: var(--fg);
  color: #fff;
}
.bottom-cta--light {
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg);
}
.bottom-cta__icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.bottom-cta--dark .bottom-cta__icon { background: var(--accent); }
.bottom-cta--dark .bottom-cta__icon svg { width: 16px; height: 16px; fill: var(--fg); }
.bottom-cta--light .bottom-cta__icon {
  border: 1px solid var(--border);
  background: var(--bg);
}
.bottom-cta--light .bottom-cta__icon svg { width: 16px; height: 16px; fill: var(--fg); }
.bottom-cta__text { flex: 1; }
.bottom-cta__title {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 700;
}
.bottom-cta__subtitle {
  font-family: var(--font-ui);
  font-size: 9px;
  opacity: 0.45;
}
.bottom-cta--light .bottom-cta__subtitle { color: var(--fg-lighter); opacity: 1; }

.market-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  font-family: var(--font-ui);
  font-size: 9px;
  color: var(--fg-dim);
  text-align: center;
}

.supply-chart-area {
  height: 140px;
  margin: 0 24px 16px;
  border: 1px solid var(--border);
  position: relative;
}
.supply-chart-area canvas {
  width: 100%;
  height: 100%;
}

@media (max-width: 1024px) {
  .snippet-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  .stat-bar { flex-wrap: wrap; }
  .stat-bar__cell { flex: 0 0 50%; border-bottom: 1px solid var(--border); }
  .stat-bar__link { flex: 0 0 100%; }
  .chart-tabs { padding: 12px 16px 0; }
  .chart-tab { padding: 6px 12px; font-size: 9px; }
  .chart-controls { flex-direction: column; gap: 8px; align-items: flex-start; padding: 10px 16px; }
  .chart-area { margin: 0 16px; }
  .market-hero { padding: 16px; }
  .section-header { padding: 12px 16px 0; }
  .market-table-wrap { padding: 0 16px; }
  .faq-section { margin: 0 16px 16px; }
  .price-factors { margin: 0 16px 16px; }
  .listing-snippet { padding: 0 16px; }
  .bottom-ctas { flex-direction: column; padding: 0 16px 16px; }
  .snippet-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .stat-bar__cell { flex: 0 0 100%; border-right: none; }
  .market-hero h1 { font-size: 22px; }
  .snippet-grid { grid-template-columns: 1fr; }
  .chart-area { height: 280px; }
}
