/* XAU/XAG Public Platform — single stylesheet, mobile-first, no framework.
   Clean financial style: light background, dark text, one accent colour.
   All layouts stack on small screens; tables scroll horizontally. */

:root {
  --ink: #1a1a1a;
  --muted: #555;
  --line: #ddd;
  --accent: #1a5fb4;
  --accent-dark: #134a8c;
  --bg: #fff;
  --bg-soft: #f4f6f8;
  --good: #1e7d32;
  --warn: #9a6a00;
  --bad: #b3261e;
  --radius: 8px;
  --max-width: 1020px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
}

.wrap { max-width: var(--max-width); margin: 0 auto; padding: 0 16px; }

a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
a:focus-visible, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: #fff; padding: 8px 16px; z-index: 10;
}
.skip-link:focus { left: 8px; top: 8px; }

/* Header */
.site-header { background: var(--ink); color: #fff; }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; padding-top: 12px; padding-bottom: 12px; }
.site-title { color: #fff; font-weight: 700; font-size: 20px; text-decoration: none; }
.site-nav { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.site-nav a { color: #dbe7f5; text-decoration: none; font-size: 15px; }
.site-nav a:hover { color: #fff; text-decoration: underline; }

/* Headings and text */
h1 { font-size: 30px; line-height: 1.25; margin: 24px 0 12px; }
h2 { font-size: 23px; margin: 32px 0 10px; }
h3 { font-size: 19px; margin: 24px 0 8px; }
.lede { font-size: 19px; color: var(--muted); }
.meta { color: var(--muted); font-size: 14px; }
.big-price { font-size: 44px; font-weight: 700; margin: 4px 0 12px; letter-spacing: -0.5px; }

/* Cards and grids */
.card {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 16px 0;
}
.grid-2 { display: grid; gap: 16px; }
@media (min-width: 760px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.instrument-card h2 { margin-top: 0; }

/* Definition lists */
.facts { margin: 0; }
.facts > div { display: grid; grid-template-columns: 180px 1fr; gap: 4px 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.facts > div:last-child { border-bottom: 0; }
.facts dt { font-weight: 600; }
.facts dd { margin: 0; }
@media (max-width: 560px) { .facts > div { grid-template-columns: 1fr; } }

/* Tables */
.data-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.data-table th, .data-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.data-table thead th { background: #e9edf1; }
.data-table tbody tr:hover { background: #eef3f8; }
@media (max-width: 640px) {
  .card { overflow-x: auto; }
  .data-table { min-width: 560px; }
}

/* Freshness */
.freshness { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin: 12px 0; }
.freshness dl { margin: 0; }
.freshness dl > div { display: grid; grid-template-columns: 180px 1fr; gap: 4px 12px; padding: 4px 0; }
.freshness dt { font-weight: 600; }
.freshness dd { margin: 0; }
@media (max-width: 560px) { .freshness dl > div { grid-template-columns: 1fr; } }
.status-badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 14px; font-weight: 600; }
.status-current { background: #dff0e2; color: var(--good); }
.status-delayed { background: #fdf0cc; color: var(--warn); }
.status-unavailable { background: #fbdfe0; color: var(--bad); }
.stale-note { color: var(--warn); font-weight: 600; }

/* Historical banner + disclaimer */
.historical-banner {
  background: #fdf0cc; border: 1px solid #e8c96a; border-radius: var(--radius);
  padding: 12px 16px; margin: 16px 0;
}
.disclaimer { font-size: 14px; color: var(--muted); }
.review-note { background: #fdf0cc; border: 1px solid #e8c96a; border-radius: var(--radius); padding: 12px 16px; }

/* Breadcrumbs */
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 8px; margin: 16px 0 0; padding: 0; font-size: 14px; }
.breadcrumbs li + li::before { content: "›"; margin-right: 8px; color: var(--muted); }

/* Ads */
.ad-slot { margin: 16px auto; text-align: center; }
.ad-placeholder {
  border: 1px dashed var(--line); background: var(--bg-soft); color: var(--muted);
  font-size: 13px; padding: 18px; max-width: 728px;
}

/* Chart */
.chart svg { display: block; background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); }
.chart figcaption { font-size: 14px; color: var(--muted); margin-top: 6px; }

/* Footer */
.site-footer { background: var(--bg-soft); border-top: 1px solid var(--line); margin-top: 48px; padding: 24px 0 32px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 16px 0; }
.fine-print { font-size: 14px; color: var(--muted); }

/* Full report as text (v1.4.0) — verbatim WhatsApp report in a copyable block */
.report-text { white-space: pre-wrap; word-break: break-word; background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; font-size: 14px; line-height: 1.55; max-height: 32rem; overflow: auto; margin: 0; }
.copy-report-btn { margin-top: 12px; padding: 8px 16px; font: inherit; font-size: 15px; cursor: pointer; border-radius: var(--radius); border: 1px solid var(--accent); background: var(--accent); color: #fff; }
.copy-report-btn:hover { background: var(--accent-dark); }

ul { padding-left: 22px; }
li { margin: 4px 0; }

@media print {
  .site-nav, .ad-slot, .site-footer .footer-nav { display: none; }
  body { font-size: 13px; }
}
