:root {
  color-scheme: light;
  --bg: #f3ede2;
  --surface: #fffcf6;
  --text: #21180f;
  --accent: #7b4c0f;
  --accent-strong: #5f3a09;
  --error: #9f1d1d;
  --border: #d9c9ac;
  --muted: #6d5a44;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 10%, #efd8b2 0%, transparent 35%),
    radial-gradient(circle at 90% 0%, #e3d4b9 0%, transparent 40%),
    var(--bg);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 252, 246, 0.94);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(6px);
}

.site-header-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  font-family: "Baskerville", "Times New Roman", serif;
  font-size: 1.1rem;
  text-decoration: none;
  color: var(--text);
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.main-nav a {
  text-decoration: none;
  color: var(--accent-strong);
  font-size: 0.92rem;
}

.app {
  max-width: 1080px;
  margin: 1.25rem auto;
  padding: 1.4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
}

h1,
h2,
h3 {
  font-family: "Baskerville", "Times New Roman", serif;
  margin: 0 0 0.6rem;
}

p {
  margin: 0 0 0.55rem;
  line-height: 1.45;
}

p:last-child {
  margin-bottom: 0;
}

.hero {
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
  padding-bottom: 1rem;
}

.breadcrumbs {
  max-width: 1080px;
  margin: 0.85rem auto 0;
  padding: 0.5rem 0.85rem;
  font-size: 0.85rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.breadcrumbs a {
  color: var(--accent-strong);
  text-decoration: none;
}

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

.controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 220px) auto;
  gap: 0.6rem;
  align-items: end;
  margin: 1rem 0;
}

label {
  font-size: 0.9rem;
  color: var(--muted);
  grid-column: 1 / -1;
}

select,
button {
  width: 100%;
  padding: 0.58rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 1rem;
}

button {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  cursor: pointer;
}

button:hover {
  background: var(--accent-strong);
}

.quote,
.method,
.content-card,
.chart-card {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 1rem;
}

.is-hidden {
  display: none !important;
}

.quote-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem 1rem;
}

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

.chart-controls {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.7rem;
}

.range-btn {
  width: auto;
  padding: 0.42rem 0.7rem;
  background: #fff;
  color: var(--accent-strong);
  border: 1px solid var(--border);
}

.range-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.chart-frame {
  position: relative;
  height: 360px;
  max-height: 520px;
}

#historyChart {
  width: 100%;
  height: 100% !important;
  max-height: none;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}

.chart-note,
.chart-meta,
.source,
.status {
  font-size: 0.9rem;
}

a {
  color: var(--accent-strong);
}

.status.error {
  color: var(--error);
}

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

.country-list li {
  margin-bottom: 0.3rem;
}

.country-list span {
  color: var(--muted);
  margin-left: 0.4rem;
}

.related-links {
  margin: 0.4rem 0 0;
  padding-left: 1.2rem;
}

.related-links li {
  margin-bottom: 0.25rem;
}

.related-links span {
  margin-left: 0.35rem;
  color: var(--muted);
}

.legal-footer {
  margin-top: 1.2rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 1rem;
}

.legal-page h1 {
  margin-bottom: 1rem;
}

.legal-page h2 {
  margin-top: 1.1rem;
}

@media (max-width: 700px) {
  .app {
    margin: 0.8rem;
    padding: 1rem;
  }

  .breadcrumbs {
    margin: 0.65rem 0.8rem 0;
    padding: 0.45rem 0.7rem;
  }

  .controls,
  .quote-grid {
    grid-template-columns: 1fr;
  }

  .site-header-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .chart-frame {
    height: 460px;
    max-height: 480px;
  }
}
