/* ==========================================================================
   XAUS — GLOBAL STYLE SHEET
   Contains variables, layout systems, component styling, animations,
   and page-specific layouts (Spot dashboard, Reserves, XAUT, API docs).
   ========================================================================== */

/* ─── DESIGN TOKENS & SYSTEMS ───────────────────────────────────────────── */
:root {
  /* Brand Accents */
  --gold: #c9a84c;
  --gold-light: #e8c97a;
  --gold-dark: #8a6820;
  --gold-muted: rgba(201, 168, 76, 0.08);
  --gold-gradient: linear-gradient(135deg, #e8c97a, #c9a84c, #8a6820);

  /* Dark Theme Palette (TradingView / Financial Dashboard inspired) */
  --bg: #0c0f17;
  --bg2: #121722;
  --bg3: #181f2f;
  --surface: rgba(24, 31, 47, 0.45);
  --surface2: rgba(30, 39, 58, 0.65);
  --border: rgba(255, 255, 255, 0.08);
  --border2: rgba(255, 255, 255, 0.04);
  --shadow: rgba(0, 0, 0, 0.4);
  --gold-glow: rgba(201, 168, 76, 0.08);

  /* Typography */
  --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
               'Segoe UI', Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', 'Source Code Pro',
               Menlo, Consolas, 'DejaVu Sans Mono', monospace;

  /* Text Colors */
  --text: #e8eaf0;
  --text2: #8b92a8;
  --text3: #4a5068;

  /* Signal Indicators */
  --up: #2ebd85;       /* Financial green */
  --down: #f6465d;     /* Financial red */
  --up-bg: rgba(46, 189, 133, 0.12);
  --down-bg: rgba(246, 70, 93, 0.12);

  /* Chart Accents */
  --chart-line: #c9a84c;
  --chart-fill-t: rgba(201, 168, 76, 0.18);
  --chart-fill-b: rgba(201, 168, 76, 0.0);

  /* Global Nav / Backdrop blur settings */
  --nav-bg: rgba(12, 15, 23, 0.85);
  --blur: blur(16px);
}

/* ─── LIGHT MODE OVERRIDES ─────────────────────────────────────────────── */
:root.light {
  --bg: #f5f6f9;
  --bg2: #ffffff;
  --bg3: #ebedf2;
  --surface: rgba(255, 255, 255, 0.75);
  --surface2: rgba(235, 237, 242, 0.8);
  --border: rgba(0, 0, 0, 0.08);
  --border2: rgba(0, 0, 0, 0.04);
  --shadow: rgba(0, 0, 0, 0.05);
  --gold-glow: rgba(184, 134, 11, 0.05);

  /* Text Colors */
  --text: #1e222d;
  --text2: #5f6368;
  --text3: #9aa0a6;

  /* Signals */
  --up: #0ecb81;
  --down: #f6465d;
  --up-bg: rgba(14, 203, 129, 0.08);
  --down-bg: rgba(246, 70, 93, 0.08);

  /* Chart */
  --chart-line: #b8860b;
  --chart-fill-t: rgba(184, 134, 11, 0.12);
  --nav-bg: rgba(245, 246, 249, 0.9);
}

/* ─── CSS RESET & CORE STYLES ──────────────────────────────────────────── */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

/* Subtle grain texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.95' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1000;
  opacity: 0.35;
}
:root.light body::before {
  opacity: 0.12;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: var(--surface2);
  border-radius: 4px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--gold);
}

/* Smooth Transitions */
*:not(.faq-body):not(.art-item .faq-body), *::before, *::after {
  transition: background-color 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              border-color 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              color 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── GLOBAL COMPONENTS ────────────────────────────────────────────────── */

/* Navigation Bar */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--border);
  height: 60px;
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Logo & SVG Animations */
.logo {
  display: flex;
  align-items: center;
  gap: 0;
  text-decoration: none;
  flex-shrink: 0;
}
.logo svg {
  display: block;
}
.logo svg {
  display: block;
  overflow: visible;
}
.logo .hex-outer {
  transform-origin: 22px 21px;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), stroke 0.3s, stroke-width 0.3s;
}
.logo .hex-inner {
  transform-origin: 22px 21px;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), stroke 0.3s, opacity 0.3s;
}
.logo .hex-text {
  transition: fill 0.3s ease, text-shadow 0.3s ease;
}
.logo .tagline-text {
  transition: fill 0.3s ease, letter-spacing 0.3s ease;
}
.logo .shine-stop {
  transition: stop-color 0.4s ease;
}

.logo:hover .hex-outer {
  transform: rotate(-60deg) scale(1.06);
  stroke: var(--gold-light);
  stroke-width: 1.8px;
}
.logo:hover .hex-inner {
  transform: rotate(60deg);
  stroke: var(--gold-light);
  opacity: 0.8;
}
.logo:hover .hex-text {
  fill: var(--text);
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
}
.logo:hover .shine-stop {
  stop-color: var(--gold-light);
}
.logo:hover .tagline-text {
  fill: var(--gold);
  letter-spacing: 2.3px;
}

/* Footer Logo styles and hover animations */
.footer-logo {
  text-decoration: none;
  display: flex;
  align-items: flex-start;
}
.footer-logo svg {
  display: block;
  overflow: visible;
}
.footer-logo .hex-outer {
  transform-origin: 14px 14px;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), stroke 0.3s, stroke-width 0.3s;
}
.footer-logo .hex-inner {
  transform-origin: 14px 14px;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), stroke 0.3s, opacity 0.3s;
}
.footer-logo .hex-text {
  transition: fill 0.3s ease, text-shadow 0.3s ease;
}
.footer-logo .shine-stop {
  transition: stop-color 0.4s ease;
}

.footer-logo:hover .hex-outer {
  transform: rotate(-60deg) scale(1.06);
  stroke: var(--gold-light);
  stroke-width: 1.5px;
}
.footer-logo:hover .hex-inner {
  transform: rotate(60deg);
  stroke: var(--gold-light);
  opacity: 0.8;
}
.footer-logo:hover .hex-text {
  fill: var(--text);
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
}
.footer-logo:hover .shine-stop {
  stop-color: var(--gold-light);
}

:root.light .logo svg text tspan[fill="#f0e8d0"] { fill: var(--text); }
:root.light .logo svg text tspan[fill="#c9a84c"] { fill: var(--gold); }
:root.light .logo svg text[fill="#5a5240"]       { fill: var(--text3); }
:root.light .logo svg text[fill="#c9a84c"]        { fill: var(--gold); }
:root.light .logo svg polygon                     { stroke: var(--gold); }

/* Navigation links & Badges */
.api-nav-link {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--text3);
  text-decoration: none;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 8px;
}
.api-nav-link:hover,
.api-nav-link.active {
  color: var(--gold-light);
}
:root.light .api-nav-link:hover,
:root.light .api-nav-link.active {
  color: var(--gold);
}

.xaut-nav-link,
.reserves-nav-link {
  text-decoration: none;
  flex-shrink: 0;
}

.xaut-badge,
.reserves-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 6px;
  white-space: nowrap;
}

/* Teal styling for XAUT */
.xaut-badge {
  border: 1px solid rgba(46, 189, 133, 0.2);
  background: rgba(46, 189, 133, 0.06);
  color: #2ebd85;
}
.xaut-icon {
  font-size: 11px;
  color: #2ebd85;
}
.xaut-nav-link:hover .xaut-badge {
  border-color: rgba(46, 189, 133, 0.5);
  background: rgba(46, 189, 133, 0.12);
  color: #40d399;
  box-shadow: 0 0 12px rgba(46, 189, 133, 0.15);
}

/* Gold styling for Reserves */
.reserves-badge {
  border: 1px solid rgba(201, 168, 76, 0.25);
  background: rgba(201, 168, 76, 0.06);
  color: var(--gold-light);
}
.reserves-icon {
  font-size: 11px;
  color: var(--gold);
}
.reserves-nav-link:hover .reserves-badge {
  border-color: rgba(201, 168, 76, 0.5);
  background: rgba(201, 168, 76, 0.12);
  box-shadow: 0 0 12px rgba(201, 168, 76, 0.15);
}

:root.light .xaut-badge {
  border-color: rgba(14, 203, 129, 0.2);
  background: rgba(14, 203, 129, 0.05);
  color: #0c9e64;
}
:root.light .xaut-icon {
  color: #0c9e64;
}
:root.light .xaut-nav-link:hover .xaut-badge {
  border-color: rgba(14, 203, 129, 0.4);
  background: rgba(14, 203, 129, 0.08);
  color: #0c9e64;
}
:root.light .reserves-badge {
  border-color: rgba(184, 134, 11, 0.2);
  background: rgba(184, 134, 11, 0.05);
  color: var(--gold);
}
:root.light .reserves-nav-link:hover .reserves-badge {
  border-color: rgba(184, 134, 11, 0.4);
  background: rgba(184, 134, 11, 0.08);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Real-time Indicator */
.live-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  color: var(--text2);
  text-transform: uppercase;
}
.pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--up);
  position: relative;
}
.pulse::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1.5px solid var(--up);
  opacity: 0;
  animation: ripple 2s infinite ease-out;
}
@keyframes ripple {
  0% { transform: scale(0.8); opacity: 0.8; }
  100% { transform: scale(1.8); opacity: 0; }
}

/* Custom Currency Dropdown */
.curr-picker {
  position: relative;
}
.curr-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text2);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 10px;
  cursor: pointer;
  letter-spacing: 0.04em;
  height: 32px;
}
.curr-trigger:hover, .curr-picker.open .curr-trigger {
  border-color: var(--gold);
  color: var(--text);
  background: var(--surface);
}
.curr-flag {
  width: 18px;
  height: 13px;
  border-radius: 2px;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.curr-arrow {
  width: 8px;
  height: 5px;
  color: var(--text3);
  transition: transform 0.2s ease;
}
.curr-picker.open .curr-arrow {
  transform: rotate(180deg);
}

.curr-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 230px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 12px 30px var(--shadow);
  z-index: 200;
  overflow: hidden;
  backdrop-filter: var(--blur);
}
.curr-picker.open .curr-dropdown {
  display: flex;
  flex-direction: column;
}

.curr-search-wrap {
  padding: 8px;
  border-bottom: 1px solid var(--border);
}
.curr-search {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 6px 10px;
  outline: none;
}
.curr-search:focus {
  border-color: var(--gold);
}

.curr-list {
  max-height: 240px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.curr-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text2);
  border-bottom: 1px solid var(--border2);
}
.curr-opt:last-child {
  border-bottom: none;
}
.curr-opt:hover {
  background: var(--gold-muted);
  color: var(--text);
}
.curr-opt.selected {
  color: var(--gold-light);
  background: var(--gold-muted);
  font-weight: 500;
}
:root.light .curr-opt.selected {
  color: var(--gold);
}
.curr-opt-flag {
  font-size: 14px;
  flex-shrink: 0;
}
.curr-opt-name {
  color: var(--text3);
  font-size: 11px;
  margin-left: auto;
  padding-left: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Theme Toggle Button */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text2);
  cursor: pointer;
}
.theme-toggle:hover {
  border-color: var(--gold);
  color: var(--gold-light);
  background: var(--surface);
}
.theme-toggle .toggle-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
}

/* Breadcrumbs bar (Reserves / XAUT sub-navigation) */
.breadcrumb-bar {
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  z-index: 99;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  height: 32px;
  display: flex;
  align-items: center;
}
.breadcrumb-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  width: 100%;
}
.breadcrumb-item {
  color: var(--text3);
  text-decoration: none;
}
.breadcrumb-item:hover {
  color: var(--gold-light);
}
:root.light .breadcrumb-item:hover {
  color: var(--gold);
}
.breadcrumb-sep {
  color: var(--text3);
  opacity: 0.5;
}
.breadcrumb-current {
  color: var(--gold);
  font-weight: 500;
}

/* Accordion (FAQ & Articles) */
.faq-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.faq-item.open .faq-body,
.art-item.open .faq-body {
  grid-template-rows: 1fr;
}
.faq-body-inner {
  overflow: hidden;
  min-height: 0;
}

/* Footer Section */
footer {
  border-top: 1px solid var(--border);
  background: var(--bg2);
  width: 100%;
  margin-top: 4rem;
}
.footer-top {
  max-width: 1100px;
  margin: 0 auto;
  padding: 3rem 2rem 2.5rem;
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 3rem;
  align-items: start;
}
/* footer-logo base style moved to logo section */
.footer-cols {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
}
.footer-col-label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 0.8rem;
  font-weight: 600;
}
.footer-col-text {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.7;
}
.footer-link {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}
.footer-link:hover {
  color: var(--gold-light);
  border-color: var(--gold);
}
:root.light .footer-link:hover {
  color: var(--gold);
}

.footer-market-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.footer-market-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text2);
  text-decoration: none;
  letter-spacing: 0.04em;
  width: fit-content;
}
.footer-market-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.footer-market-dot.gold { background: var(--gold); }
.footer-market-dot.tether { background: #2ebd85; }
.footer-market-dot.reserves { background: var(--gold); opacity: 0.6; }

.footer-market-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text3);
  margin-top: -4px;
  padding-left: 14px;
}

.footer-bottom {
  border-top: 1px solid var(--border);
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.25rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-note {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text3);
  letter-spacing: 0.04em;
  line-height: 1.5;
}

/* ─── COMMON UTILITIES & WRAPPERS ─────────────────────────────────────── */
.glass-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 32px var(--shadow);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
}
.glass-panel:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px var(--shadow), 0 0 1px var(--gold-glow);
  border-color: rgba(201, 168, 76, 0.2);
}

.btn-pill-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg3);
  padding: 3px;
  border-radius: 8px;
  border: 1px solid var(--border);
  width: fit-content;
}
.btn-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text3);
  cursor: pointer;
}
.btn-pill:hover {
  color: var(--text2);
}
.btn-pill.active {
  background: var(--surface2);
  color: var(--gold-light);
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px var(--shadow);
}
:root.light .btn-pill.active {
  color: var(--gold);
}

/* ─── MAIN SPOT PRICE DASHBOARD ────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-top: 60px;
}
.hero-glow {
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(80vw, 700px);
  height: min(60vh, 500px);
  background: radial-gradient(ellipse, rgba(201,168,76,0.08) 0%, rgba(201,168,76,0.02) 45%, transparent 70%);
  pointer-events: none;
}
.hero-inner {
  position: relative;
  z-index: 1;
  padding: 4rem 2rem 0;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

.price-label {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.15em;
  color: var(--text3);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.price-block {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.25rem;
}
.price-main {
  font-family: var(--font-sans);
  font-size: clamp(56px, 8vw, 92px);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.04em;
  line-height: 1;
  text-shadow: 0 2px 20px rgba(0,0,0,0.1);
}
:root:not(.light) .price-main {
  text-shadow: 0 0 40px rgba(201, 168, 76, 0.1);
}

.price-currency {
  font-family: var(--font-mono);
  font-size: 20px;
  color: var(--text3);
  letter-spacing: 0.04em;
  padding-bottom: 8px;
}
.change-wrap {
  display: flex;
  align-items: center;
  padding-bottom: 8px;
}
.change-val {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  letter-spacing: -0.01em;
}
.change-val.up { color: var(--up); background: var(--up-bg); }
.change-val.down { color: var(--down); background: var(--down-bg); }

.timestamp {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text3);
  letter-spacing: 0.05em;
  margin-bottom: 1.5rem;
}

/* Unit Toggle Selector */
.unit-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg3);
  padding: 3px;
  border-radius: 8px;
  border: 1px solid var(--border);
  width: fit-content;
  margin-bottom: 2rem;
}
.unit-btn {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text3);
  cursor: pointer;
  transition: all 0.2s ease;
}
.unit-btn:hover {
  color: var(--text2);
}
.unit-btn.active {
  background: var(--surface2);
  color: var(--gold-light);
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px var(--shadow);
}
:root.light .unit-btn.active {
  color: var(--gold);
}
.unit-sep {
  display: none; /* Hide legacy separator */
}

/* Statistics Grid */
.metrics {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}
.metric {
  padding: 1.25rem;
  border-left: 3px solid transparent;
}
.metric:hover {
  border-left-color: var(--gold);
}
.metric-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
}
.metric-value {
  font-family: var(--font-sans);
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
}
.metric-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text3);
  margin-top: 4px;
}
#m-high { color: var(--up); }
#m-low  { color: var(--down); }

/* Chart Section */
.chart-section {
  padding: 1.5rem;
  margin-bottom: 2rem;
  border-top: 2px solid var(--gold);
}
.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 12px;
}
.chart-title {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.chart-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.chart-control-group {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg3);
  padding: 3px;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.chart-btn {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text3);
  cursor: pointer;
  transition: all 0.2s ease;
}
.chart-btn:hover {
  color: var(--text2);
}
.chart-btn.active {
  background: var(--surface2);
  color: var(--gold-light);
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px var(--shadow);
}
:root.light .chart-btn.active {
  color: var(--gold);
}
.tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg3);
  padding: 3px;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.tab {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text3);
  cursor: pointer;
  transition: all 0.2s ease;
}
.tab:hover {
  color: var(--text2);
}
.tab.active {
  background: var(--surface2);
  color: var(--gold-light);
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px var(--shadow);
}
:root.light .tab.active {
  color: var(--gold);
}
.chart-wrap {
  position: relative;
  height: 380px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg2);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.chart-wrap canvas {
  flex: 1;
  min-height: 0;
  width: 100% !important;
  height: 100% !important;
}

/* OHLC Legend Overlay */
.ohlc-legend {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 5;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text2);
  pointer-events: none;
  background: rgba(12, 15, 23, 0.75);
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
:root.light .ohlc-legend {
  background: rgba(255, 255, 255, 0.85);
}
.ohlc-item span {
  font-weight: 500;
  margin-left: 2px;
}
.ohlc-item.up span {
  color: var(--up);
}
.ohlc-item.down span {
  color: var(--down);
}
.ohlc-item.neutral span {
  color: var(--gold-light);
}
:root.light .ohlc-item.neutral span {
  color: var(--gold);
}


/* Multi Currency display row */
.currency-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}
.currency-card {
  padding: 1.25rem;
  border-left: 3px solid transparent;
}
.currency-card:hover {
  border-left-color: var(--gold);
}
.currency-name {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 0.5rem;
}
.currency-price {
  font-family: var(--font-sans);
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
}

/* Calculator Utility widget */
.converter-section {
  padding: 1.75rem;
  margin-bottom: 2rem;
  border-top: 2px solid var(--gold);
}
.converter-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.converter-title {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.converter-subtitle {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text3);
}
.converter-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 1.5rem;
  margin-bottom: 1.25rem;
}
.conv-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.conv-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.conv-input-wrap {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  height: 44px;
  background: var(--bg2);
}
.conv-input-wrap:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 10px rgba(201, 168, 76, 0.1);
}
.conv-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 16px;
  padding: 0 14px;
}
.conv-unit-select {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text2);
  background: var(--bg3);
  border: none;
  border-left: 1px solid var(--border);
  padding: 0 14px;
  height: 100%;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}
.conv-unit-select:hover {
  color: var(--text);
  background: var(--surface2);
}

.conv-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text3);
  font-size: 22px;
  padding-bottom: 10px;
  flex-shrink: 0;
  user-select: none;
}
.conv-result-wrap {
  display: flex;
  align-items: center;
  background: var(--gold-muted);
  border: 1px solid rgba(201, 168, 76, 0.2);
  border-radius: 8px;
  height: 44px;
  padding: 0 14px;
  gap: 8px;
}
.conv-result-symbol {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text3);
  flex-shrink: 0;
}
.conv-result-value {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 600;
  color: var(--gold-light);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
:root.light .conv-result-value {
  color: var(--gold);
}

.converter-presets {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.conv-preset-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-right: 4px;
}
.conv-preset {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text2);
  cursor: pointer;
}
.conv-preset:hover {
  color: var(--gold-light);
  border-color: rgba(201, 168, 76, 0.3);
  background: var(--gold-muted);
}
:root.light .conv-preset:hover {
  color: var(--gold);
}

/* FAQ & Articles Layout (Accordion Lists) */
.seo-section {
  border-top: 1px solid var(--border);
  padding: 4rem 2rem;
  background: var(--bg2);
}
.seo-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
.art-grid, .faq-grid {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.art-item, .faq-item {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.art-item:last-child, .faq-item:last-child {
  border-bottom: none;
}
.art-q, .faq-q {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  padding: 1.25rem 3rem 1.25rem 1.5rem;
  line-height: 1.4;
  position: relative;
  user-select: none;
  display: block;
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  letter-spacing: -0.01em;
}
.art-q:hover, .faq-q:hover {
  background: var(--gold-muted);
}
.art-item.open .art-q, .faq-item.open .faq-q {
  color: var(--gold-light);
}
:root.light .art-item.open .art-q, :root.light .faq-item.open .faq-q {
  color: var(--gold);
}

.faq-icon {
  position: absolute;
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text3);
  pointer-events: none;
}
.art-item.open .faq-icon, .faq-item.open .faq-icon {
  transform: translateY(-50%) rotate(45deg);
  color: var(--gold);
}

.art-body, .faq-a {
  padding: 1rem 1.5rem 1.5rem;
  border-top: 1px solid var(--border);
}
.art-body {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}
.seo-h2 {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  color: var(--gold-light);
  letter-spacing: -0.01em;
  line-height: 1.4;
}
:root.light .seo-h2 {
  color: var(--gold);
}
.seo-p, .faq-a {
  font-size: 13.5px;
  color: var(--text2);
  line-height: 1.75;
}
.seo-p strong {
  color: var(--text);
  font-weight: 500;
}
.seo-faq {
  padding: 2rem;
  border-top: 2px solid var(--gold);
}
.seo-faq-title {
  margin-bottom: 1.25rem;
}

/* Animations */
.fade-in {
  opacity: 0;
  transform: translateY(12px);
  animation: fadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.fade-in:nth-child(1) { animation-delay: 0.05s; }
.fade-in:nth-child(2) { animation-delay: 0.1s; }
.fade-in:nth-child(3) { animation-delay: 0.15s; }
.fade-in:nth-child(4) { animation-delay: 0.2s; }
.fade-in:nth-child(5) { animation-delay: 0.25s; }
@keyframes fadeUp {
  to { opacity: 1; transform: none; }
}

/* ─── RESERVES REPORTING PAGE ──────────────────────────────────────────── */
.reserves-section {
  border-top: 2px solid var(--gold);
  overflow: hidden;
  margin-bottom: 2rem;
}
.reserves-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.reserves-title {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.reserves-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text3);
}

/* Reserves Data Filters & Search */
.reserves-filter-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
  flex-wrap: wrap;
}
.reserves-search-wrap {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0 10px;
  height: 34px;
  flex: 1;
  max-width: 280px;
  gap: 8px;
}
.reserves-search-wrap:focus-within {
  border-color: var(--gold);
}
.reserves-search-icon {
  color: var(--text3);
  flex-shrink: 0;
}
.reserves-search {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  width: 100%;
}
.filter-btn {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text3);
  cursor: pointer;
}
.filter-btn:hover {
  color: var(--text2);
  border-color: var(--border);
}
.filter-btn.active {
  color: var(--gold-light);
  background: var(--gold-muted);
  border-color: rgba(201,168,76,0.3);
}
:root.light .filter-btn.active {
  color: var(--gold);
}
.filter-spacer {
  flex: 1;
}

/* Table Design */
.reserves-table-head {
  display: grid;
  grid-template-columns: 45px 32px 1fr 110px 110px 100px 110px 110px;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
}
.th {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.th:hover {
  color: var(--text2);
}
.th.right {
  text-align: right;
}
.th.sorted {
  color: var(--gold);
}
.th-arrow {
  margin-left: 4px;
}

.reserve-row {
  display: grid;
  grid-template-columns: 45px 32px 1fr 110px 110px 100px 110px 110px;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.reserve-row:hover {
  background: var(--surface2);
}
.reserve-row:last-child {
  border-bottom: none;
}
.reserve-row.world-total {
  background: rgba(201, 168, 76, 0.03);
  border-top: 2px solid rgba(201, 168, 76, 0.2);
  border-bottom: 2px solid rgba(201, 168, 76, 0.2);
}

.res-rank {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text3);
  text-align: center;
}
.res-flag {
  width: 22px;
  height: 15px;
  border-radius: 2px;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.res-flag-globe {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg3);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  flex-shrink: 0;
}

.res-name-wrap {
  min-width: 0;
}
.res-name {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.res-institution {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text3);
  letter-spacing: 0.04em;
  margin-top: 2px;
}

.res-tonnes {
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--text);
  text-align: right;
  font-weight: 600;
}
.res-prev {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text2);
  text-align: right;
}
.res-change {
  font-family: var(--font-mono);
  font-size: 13px;
  text-align: right;
  font-weight: 500;
}
.res-change.up { color: var(--up); }
.res-change.down { color: var(--down); }
.res-change.flat { color: var(--text3); }

.res-pct-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}
.res-pct {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text2);
}
.res-bar-track {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  width: 100%;
}
.res-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--gold);
}
.res-ref {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text3);
  text-align: right;
}

.reserves-group-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 6px 1.5rem;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
}

/* ─── XAUT DETAILS PAGE ────────────────────────────────────────────────── */
.premium-section {
  overflow: hidden;
  margin-bottom: 2rem;
}
.premium-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg3);
}
.premium-title {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.premium-badge {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
}
.premium-badge.up { color: var(--up); background: var(--up-bg); }
.premium-badge.down { color: var(--down); background: var(--down-bg); }
.premium-badge.flat { color: var(--text3); background: var(--bg2); border: 1px solid var(--border); }

.premium-body {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1px;
  background: var(--border);
}
.premium-cell {
  background: var(--bg2);
  padding: 1.25rem 1.5rem;
}
.premium-cell-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
}
.premium-cell-value {
  font-family: var(--font-sans);
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
}
.premium-cell-value.up { color: var(--up); }
.premium-cell-value.down { color: var(--down); }
.premium-cell-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text3);
  margin-top: 4px;
}

/* Premium / Discount Gauge */
.premium-gauge-wrap {
  padding: 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--bg2);
}
.premium-gauge-labels {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text3);
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}
.premium-gauge-track {
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--down) 0%, var(--border) 45%, var(--border) 55%, var(--up) 100%);
  position: relative;
}
.premium-gauge-fill {
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: 3px;
  opacity: 0.15;
}
.premium-gauge-needle {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  background: var(--gold-light);
  border: 2px solid var(--bg);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 8px rgba(201, 168, 76, 0.6);
  z-index: 10;
}
.premium-gauge-note {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text3);
  margin-top: 10px;
  line-height: 1.5;
}

/* Blockchain Supply Split */
.chains-section {
  border-top: 2px solid var(--gold);
  overflow: hidden;
  margin-bottom: 2rem;
}
.chains-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.chains-title {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.chains-total {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text3);
}

.chain-row {
  display: grid;
  grid-template-columns: 32px 1fr 140px 110px;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.chain-row:last-child {
  border-bottom: none;
}
.chain-row:hover {
  background: var(--surface2);
}
.chain-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}
.chain-name {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
}
.chain-standard {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text3);
  margin-top: 2px;
}
.chain-bar-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.chain-bar-track {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
}
.chain-bar-fill {
  height: 100%;
  border-radius: 2px;
}
.chain-pct {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text3);
}
.chain-supply {
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--text);
  text-align: right;
  font-weight: 600;
}

/* XAUT Markets table */
.markets-section {
  border-top: 2px solid var(--gold);
  overflow: hidden;
  margin-bottom: 2rem;
}
.markets-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.markets-title {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.markets-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text3);
}
.markets-group-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 6px 1.5rem;
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
}
.markets-table {
  display: flex;
  flex-direction: column;
}
.market-row {
  display: grid;
  grid-template-columns: 45px 1fr 110px 110px 100px;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.market-row:last-child {
  border-bottom: none;
}
.market-row:hover {
  background: var(--surface2);
}
.market-rank {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text3);
  text-align: center;
}
.market-name {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
}
.market-pair {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text3);
  margin-top: 2px;
}
.market-price {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text2);
  text-align: right;
}
.market-vol {
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--text);
  font-weight: 600;
  text-align: right;
}
.market-bar-wrap {
  width: 100%;
}
.market-bar-track {
  height: 3px;
  background: var(--border);
  border-radius: 2.5px;
}
.market-bar-fill {
  height: 100%;
  border-radius: 2.5px;
  background: var(--gold);
}
.market-type-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: inline-block;
  margin-left: 6px;
}
.market-type-cex {
  color: var(--text3);
  border: 1px solid var(--border);
  background: var(--bg);
}
.market-type-dex {
  color: var(--gold-light);
  border: 1px solid rgba(201,168,76,0.3);
  background: var(--gold-muted);
}
:root.light .market-type-dex {
  color: var(--gold);
}

.market-loading {
  padding: 1.5rem;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text3);
}

/* ─── DEVELOPER API PORTAL ─────────────────────────────────────────────── */
.nav-logo {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--gold);
  text-decoration: none;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.nav-logo span {
  color: var(--text3);
  font-weight: 400;
}
.nav-back {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text2);
  text-decoration: none;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 6px;
  background: var(--surface2);
  transition: all 0.2s ease;
}
.nav-back:hover {
  color: var(--gold-light);
  border-color: var(--gold);
  background: var(--surface);
  box-shadow: 0 2px 8px var(--shadow);
}
:root.light .nav-back:hover {
  color: var(--gold);
}
.page {
  max-width: 900px;
  margin: 0 auto;
  padding: 6rem 2rem 4rem;
}
.api-hero {
  margin-bottom: 3rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
}
.api-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--up);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--up-bg);
  border: 1px solid rgba(46, 189, 133, 0.2);
  padding: 5px 12px;
  border-radius: 6px;
  margin-bottom: 1.5rem;
}
.api-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--up);
  box-shadow: 0 0 8px var(--up);
}
.api-title {
  font-size: clamp(32px, 5vw, 44px);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.15;
  margin-bottom: 1rem;
}
.api-title span {
  color: var(--gold);
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.api-subtitle {
  font-size: 15px;
  color: var(--text2);
  max-width: 580px;
  line-height: 1.7;
  margin-bottom: 2rem;
}

/* Terminal Endpoint Bar */
.endpoint-bar {
  display: flex;
  align-items: center;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  max-width: 580px;
}
.method-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--up);
  background: var(--up-bg);
  padding: 12px 16px;
  border-right: 1px solid var(--border);
  letter-spacing: 0.08em;
}
.endpoint-url {
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--gold-light);
  padding: 12px 16px;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
:root.light .endpoint-url {
  color: var(--gold);
}
.copy-btn {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text3);
  background: transparent;
  border: none;
  border-left: 1px solid var(--border);
  padding: 12px 16px;
  cursor: pointer;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.copy-btn:hover {
  color: var(--gold-light);
  background: var(--surface);
}
:root.light .copy-btn:hover {
  color: var(--gold);
}

/* Features Strip */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 3.5rem;
}
.feature {
  background: var(--bg2);
  padding: 1.5rem;
}
.feature-icon {
  font-size: 20px;
  margin-bottom: 0.6rem;
}
.feature-title {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--gold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  font-weight: 600;
}
.feature-desc {
  font-size: 12.5px;
  color: var(--text2);
  line-height: 1.6;
}

/* General Layout sections in docs */
.section {
  margin-bottom: 3.5rem;
}
.section-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 0.75rem;
  font-weight: 500;
}
.section-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 1rem;
}
.section-desc {
  font-size: 13.5px;
  color: var(--text2);
  line-height: 1.75;
  margin-bottom: 1.5rem;
  max-width: 680px;
}

/* Stripe/Vercel Editor Container */
.code-block {
  background: #0b0d13;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}
.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg3);
}
.code-lang {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.code-copy {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text3);
  background: transparent;
  border: none;
  cursor: pointer;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.code-copy:hover {
  color: var(--gold-light);
}
pre {
  padding: 1.25rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.75;
  color: #c9d1d9;
}
.t-green  { color: #7ee787; }
.t-gold   { color: #ffab70; }
.t-blue   { color: #79c0ff; }
.t-grey   { color: #8b949e; }
.t-purple { color: #d2a8ff; }

/* Parameters Table */
.params-table, .field-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  font-size: 13px;
  margin-bottom: 1.5rem;
}
.params-table th, .field-table th {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: var(--text3);
  background: var(--bg3);
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-weight: 500;
}
.params-table td, .field-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
  color: var(--text2);
  vertical-align: top;
}
.params-table tr:last-child td, .field-table tr:last-child td {
  border-bottom: none;
}
.param-name, .field-name {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--gold-light);
  font-weight: 500;
}
:root.light .param-name, :root.light .field-name {
  color: var(--gold);
}
.param-type {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text3);
  background: var(--bg3);
  padding: 3px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
  white-space: nowrap;
}

/* Tabs switcher */
.tab-bar {
  display: flex;
  gap: 2px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  padding: 6px 6px 0;
}
.tab-btn {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text3);
  background: transparent;
  border: none;
  padding: 8px 16px 10px;
  cursor: pointer;
  letter-spacing: 0.06em;
  border-radius: 6px 6px 0 0;
}
.tab-btn:hover {
  color: var(--text2);
}
.tab-btn.active {
  color: var(--gold-light);
  background: #0b0d13;
}
:root.light .tab-btn.active {
  color: var(--gold);
}
.tab-content {
  display: none;
}
.tab-content.active {
  display: block;
}
.tabbed .code-block {
  border-radius: 0 0 8px 8px;
  margin-bottom: 0;
}

/* Currency List styling inside docs */
.currency-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 0.75rem;
}
.curr-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text2);
  background: var(--bg3);
  border: 1px solid var(--border);
  padding: 4px 8px;
  border-radius: 4px;
  letter-spacing: 0.04em;
}

/* Warning / Note Boxes */
.info-box {
  background: var(--gold-muted);
  border: 1px solid rgba(201, 168, 76, 0.2);
  border-radius: 8px;
  padding: 1.25rem;
  font-size: 13px;
  color: var(--text2);
  line-height: 1.7;
  margin-bottom: 1.5rem;
}
.info-box strong {
  color: var(--gold-light);
  font-weight: 600;
}
:root.light .info-box strong {
  color: var(--gold);
}

.api-footer {
  border-top: 1px solid var(--border);
  padding-top: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 3.5rem;
}
.api-footer-note {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text3);
  letter-spacing: 0.04em;
}
.api-footer a {
  color: var(--text2);
  text-decoration: none;
}
.api-footer a:hover {
  color: var(--gold-light);
}

/* ─── RESPONSIVE OVERRIDES ─────────────────────────────────────────────── */

/* Tablet View (900px and below) */
@media (max-width: 900px) {
  .metrics {
    grid-template-columns: repeat(3, 1fr);
  }
  .currency-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .nav-disclaimer {
    display: none;
  }
  .reserves-table-head,
  .reserve-row {
    grid-template-columns: 40px 28px 1fr 100px 100px 90px;
  }
  .reserve-row > .res-ref,
  .reserves-table-head > .th:last-child {
    display: none;
  }
  .premium-body {
    grid-template-columns: 1fr 1fr;
  }
  .chain-bar-wrap {
    width: 90px;
  }
}

/* Large Mobile View (600px and below) */
@media (max-width: 600px) {
  /* Navigation */
  nav {
    height: 52px;
  }
  .nav-inner {
    padding: 0 1rem;
  }
  .nav-right {
    gap: 0.6rem;
  }
  .live-pill {
    font-size: 10px;
  }
  .curr-trigger {
    font-size: 11px;
    padding: 4px 8px;
    height: 28px;
  }
  .api-nav-link {
    display: none;
  }
  .xaut-text,
  .reserves-text {
    display: none;
  }
  .xaut-badge,
  .reserves-badge {
    padding: 5px 8px;
  }
  .logo svg {
    width: 130px;
  }
  .logo .tagline-text {
    display: none;
  }
  .breadcrumb-bar {
    top: 52px;
  }
  .breadcrumb-inner {
    padding: 0 1rem;
    font-size: 10px;
  }

  /* Hero Section */
  .hero {
    padding-top: 80px;
  }
  .hero-inner {
    padding: 1.5rem 1rem 0;
  }
  .hero-glow {
    width: 280px;
    height: 200px;
  }

  /* Main price display */
  .price-label {
    font-size: 11px;
    margin-bottom: 0.4rem;
  }
  .price-block {
    gap: 0.5rem;
    margin-bottom: 0.25rem;
  }
  .price-main {
    font-size: clamp(38px, 10vw, 56px);
  }
  .price-currency {
    font-size: 14px;
    padding-bottom: 4px;
  }
  .change-wrap {
    padding-bottom: 4px;
  }
  .change-val {
    font-size: 12px;
    padding: 2px 6px;
  }
  .timestamp {
    font-size: 11px;
    margin-bottom: 1rem;
  }

  .unit-toggle {
    margin-bottom: 1.25rem;
  }
  .unit-btn {
    font-size: 10px;
    padding: 4px 10px;
  }

  /* Metrics and currency rows */
  .metrics {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
  }
  .metric {
    padding: 0.75rem 1rem;
  }
  .metric-value {
    font-size: 18px;
  }
  .metric-label {
    font-size: 10px;
  }

  .currency-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
  }
  .currency-card {
    padding: 0.75rem 1rem;
  }
  .currency-price {
    font-size: 16px;
  }
  .currency-name {
    font-size: 10px;
  }

  /* Chart Layout */
  .chart-section {
    padding: 1rem;
    margin-bottom: 1.5rem;
  }
  .chart-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
  }
  .chart-title {
    font-size: 11px;
  }
  .chart-controls {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    gap: 12px;
    padding-bottom: 4px;
    scrollbar-width: none; /* Hide scrollbars */
  }
  .chart-controls::-webkit-scrollbar {
    display: none;
  }
  .chart-control-group {
    flex-shrink: 0;
  }
  .tabs {
    gap: 3px;
    flex-shrink: 0;
  }
  .tab {
    font-size: 11px;
    padding: 4px 8px;
  }
  .chart-wrap {
    height: 260px;
  }
  .chart-hud {
    padding: 8px 12px;
    gap: 6px 12px;
  }

  /* Calculator / Converter */
  .converter-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  .conv-arrow {
    padding-bottom: 0;
    transform: rotate(90deg);
    align-self: center;
  }
  .converter-section {
    padding: 1.25rem 1rem;
    margin-bottom: 1.5rem;
  }

  /* Reserves table layout */
  .reserves-table-head,
  .reserve-row {
    grid-template-columns: 28px 1fr 90px 70px;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
  }
  .reserves-table-head > .th:nth-child(2),
  .reserve-row > .res-flag,
  .reserves-table-head > .th:nth-child(5),
  .reserve-row > .res-prev,
  .reserves-table-head > .th:nth-child(6),
  .reserve-row > .res-pct-wrap {
    display: none;
  }
  .res-rank {
    font-size: 11px;
  }
  .res-name {
    font-size: 13px;
  }
  .res-tonnes {
    font-size: 12.5px;
  }
  .reserves-filter-bar {
    padding: 0.75rem 1rem;
  }
  .reserves-search-wrap {
    max-width: 100%;
  }

  /* XAUT elements */
  .premium-body {
    grid-template-columns: 1fr;
  }
  .chain-row {
    grid-template-columns: 32px 1fr auto;
  }
  .chain-bar-wrap {
    display: none;
  }
  .market-row {
    grid-template-columns: 1fr 1fr auto;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
  }
  .market-rank, .market-bar-wrap, .market-price {
    display: none;
  }
  .market-vol {
    font-size: 12.5px;
  }
  .market-name {
    font-size: 13px;
  }

  /* Developer API Portal docs */
  .page {
    padding: 4rem 1rem 3rem;
  }
  .features {
    grid-template-columns: 1fr;
  }
  .endpoint-bar {
    max-width: 100%;
  }
  .api-title {
    font-size: 28px;
  }
  .params-table, .field-table {
    display: block;
    overflow-x: auto;
  }

  /* Footer Layout */
  .footer-top {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 2rem 1rem 1.5rem;
  }
  .footer-cols {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
  .footer-bottom {
    padding: 1rem;
    flex-direction: column;
    align-items: flex-start;
  }
  .footer-note {
    font-size: 10px;
  }
  .seo-section {
    padding: 3rem 1rem;
  }
}

/* Small Mobile View (400px and below) */
@media (max-width: 400px) {
  nav {
    height: 48px;
  }
  .nav-right {
    gap: 0.4rem;
  }
  .live-pill {
    display: none;
  }
  .logo svg {
    width: 115px;
  }
  .breadcrumb-bar {
    top: 48px;
  }
  .hero {
    padding-top: 76px;
  }
  .hero-inner {
    padding: 1.25rem 0.875rem 0;
  }
  .geo-pill {
    display: none;
  }

  /* Stack main price + changes vertically */
  .price-block {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
  .change-wrap {
    padding-bottom: 0;
  }
  .price-currency {
    padding-bottom: 0;
  }
  .price-main {
    font-size: clamp(34px, 12vw, 48px);
  }

  .metric {
    padding: 0.6rem 0.75rem;
  }
  .metric-value {
    font-size: 16px;
  }

  .tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    padding-bottom: 2px;
  }
  .tab {
    white-space: nowrap;
    flex-shrink: 0;
  }
  .chart-wrap {
    height: 240px;
  }

  .currency-price {
    font-size: 14.5px;
  }
}

/* Custom Chart HUD Overlay (now an integrated top status bar) */
.chart-hud {
  position: relative;
  top: 0;
  left: 0;
  z-index: 5;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text2);
  pointer-events: auto;
  background: var(--bg3);
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  transition: opacity 0.15s ease;
  width: 100%;
  box-sizing: border-box;
}
:root.light .chart-hud {
  background: rgba(255, 255, 255, 0.88);
  border-bottom-color: rgba(0, 0, 0, 0.08);
}
.hud-item {
  display: flex;
  align-items: center;
  gap: 4px;
}
.hud-lbl {
  color: var(--text3);
}
.hud-val {
  font-weight: 500;
}
.hud-val.up {
  color: var(--up);
}
.hud-val.down {
  color: var(--down);
}

/* Contact Page Styles */
.contact-section {
  max-width: 580px;
  margin: 3rem auto;
  padding: 0 1.5rem;
}
.contact-hero {
  text-align: center;
  margin-bottom: 2.5rem;
}
.contact-title {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}
.contact-title span {
  color: var(--gold);
}
.contact-subtitle {
  font-size: 14px;
  color: var(--text3);
  max-width: 440px;
  margin: 0 auto;
  line-height: 1.5;
}
.contact-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2.5rem;
  box-shadow: 0 8px 32px var(--shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: all 0.3s ease;
}
.contact-card:hover {
  border-color: rgba(201, 168, 76, 0.25);
  box-shadow: 0 12px 40px rgba(201, 168, 76, 0.04);
}
.form-group {
  margin-bottom: 1.5rem;
}
.form-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}
.form-input, .form-textarea {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 14.5px;
  padding: 12px 16px;
  outline: none;
  transition: all 0.2s ease;
  box-sizing: border-box;
}
.form-input:focus, .form-textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 12px rgba(201, 168, 76, 0.12);
  background: var(--bg2);
}
.form-textarea {
  min-height: 120px;
  resize: vertical;
}
.form-btn {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 12px 24px;
  background: var(--bg3);
  color: var(--text2);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.form-btn:hover {
  background: var(--surface2);
  color: var(--gold-light);
  border-color: var(--border);
  box-shadow: 0 4px 12px var(--shadow);
}
:root.light .form-btn:hover {
  color: var(--gold);
}

/* Success Page Styles */
.success-card {
  text-align: center;
  padding: 3.5rem 2.5rem;
}
.success-icon {
  font-size: 48px;
  color: var(--gold);
  margin-bottom: 1.5rem;
}
.success-btn {
  display: inline-block;
  margin-top: 1.5rem;
  text-decoration: none;
  width: auto;
}



/* ─── Price tick flash (added: pulses green/red when the live price moves) ─── */
@keyframes flashUp {
  0%   { color: var(--up); text-shadow: 0 0 18px rgba(46, 189, 133, 0.35); }
  100% { color: inherit;   text-shadow: none; }
}
@keyframes flashDown {
  0%   { color: var(--down); text-shadow: 0 0 18px rgba(246, 70, 93, 0.35); }
  100% { color: inherit;     text-shadow: none; }
}
.price-main.flash-up   { animation: flashUp   0.9s ease-out; }
.price-main.flash-down { animation: flashDown 0.9s ease-out; }

@media (prefers-reduced-motion: reduce) {
  .price-main.flash-up,
  .price-main.flash-down { animation: none; }
}

/* ─── Mobile chart controls (added): wrap instead of clip ───
   The range tabs (1D…5Y) drop to their own full-width row and
   stretch into comfortable touch targets — nothing is cut off
   or hidden behind an invisible horizontal scroll. */
@media (max-width: 600px) {
  .chart-controls {
    flex-wrap: wrap;
    overflow-x: visible;
    row-gap: 10px;
  }
  .chart-control-group {
    flex-shrink: 1;
    flex-wrap: wrap;
    row-gap: 6px;
  }
  .tabs {
    flex-basis: 100%;
    width: 100%;
  }
  .tab {
    flex: 1 1 auto;
    text-align: center;
  }
}
