/* =========================================
   GIÁ VÀNG & BẠC – KHÁM PHÁ VIỆT NAM
   Premium Dark Theme
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Playfair+Display:wght@700;800&family=JetBrains+Mono:wght@400;600;700&display=swap');

/* ---- RESET & ROOT ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Gold palette */
  --gold:         #FFD700;
  --gold-light:   #FFE84D;
  --gold-dark:    #C8A400;
  --gold-dim:     rgba(255,215,0,0.12);
  --gold-border:  rgba(255,215,0,0.22);

  /* Silver palette */
  --silver:       #C8D6E5;
  --silver-light: #E2ECF5;
  --silver-dark:  #8FA3B8;
  --silver-dim:   rgba(200,214,229,0.1);
  --silver-border:rgba(200,214,229,0.18);

  /* Background */
  --bg:           #080C12;
  --bg-2:         #0D1520;
  --bg-3:         #131E2D;
  --card:         rgba(13,21,32,0.85);
  --card-2:       rgba(19,30,45,0.9);
  --glass:        rgba(255,255,255,0.04);
  --glass-hover:  rgba(255,255,255,0.07);

  /* Text */
  --text-primary:   #F0F6FC;
  --text-secondary: #8B9CB8;
  --text-muted:     #4A5A70;

  /* Status */
  --up:    #00D97E;
  --down:  #FF4757;
  --flat:  #8B9CB8;

  /* UI */
  --border:       rgba(255,255,255,0.06);
  --border-hover: rgba(255,255,255,0.12);
  --radius-sm:    8px;
  --radius-md:    14px;
  --radius-lg:    20px;
  --shadow:       0 8px 32px rgba(0,0,0,0.4);
  --shadow-lg:    0 20px 60px rgba(0,0,0,0.5);
  --transition:   all 0.2s ease;
}

/* ---- LIGHT THEME ---- */
[data-theme="light"] {
  --gold:         #B8800A;
  --gold-light:   #D09010;
  --gold-dark:    #906008;
  --gold-dim:     rgba(184,128,10,0.10);
  --gold-border:  rgba(184,128,10,0.30);

  --silver:       #3A5878;
  --silver-light: #2A4868;
  --silver-dark:  #1A3858;
  --silver-dim:   rgba(58,88,120,0.10);
  --silver-border:rgba(58,88,120,0.25);

  --bg:           #F0F3F7;
  --bg-2:         #FFFFFF;
  --bg-3:         #E8EDF3;
  --card:         rgba(255,255,255,0.96);
  --card-2:       rgba(248,250,252,0.98);
  --glass:        rgba(0,0,0,0.03);
  --glass-hover:  rgba(0,0,0,0.06);

  /* Tăng contrast màu chữ cho light mode */
  --text-primary:   #0A1520;
  --text-secondary: #2A3D55;  /* Đủ tối để đọc trên nền trắng */
  --text-muted:     #5A7090;  /* Vẫn nhạt hơn nhưng vẫn đọc được */

  --up:    #006840;
  --down:  #BB1122;
  --flat:  #5A7090;

  --border:       rgba(0,0,0,0.09);
  --border-hover: rgba(0,0,0,0.18);
  --shadow:       0 4px 20px rgba(0,0,0,0.10);
  --shadow-lg:    0 12px 40px rgba(0,0,0,0.14);
}

/* Auto-detect OS theme khi không có setting tùy chỉnh */
@media (prefers-color-scheme: light) {
  html:not([data-theme]) {
    --gold:         #B8800A;
    --gold-light:   #D09010;
    --gold-dark:    #906008;
    --gold-dim:     rgba(184,128,10,0.10);
    --gold-border:  rgba(184,128,10,0.30);
    --silver:       #3A5878;
    --silver-dark:  #1A3858;
    --silver-dim:   rgba(58,88,120,0.10);
    --silver-border:rgba(58,88,120,0.25);
    --bg:           #F0F3F7;
    --bg-2:         #FFFFFF;
    --bg-3:         #E8EDF3;
    --card:         rgba(255,255,255,0.96);
    --card-2:       rgba(248,250,252,0.98);
    --glass:        rgba(0,0,0,0.03);
    --glass-hover:  rgba(0,0,0,0.06);
    --text-primary:   #0A1520;
    --text-secondary: #2A3D55;
    --text-muted:     #5A7090;
    --up:    #006840;
    --down:  #BB1122;
    --flat:  #5A7090;
    --border:       rgba(0,0,0,0.09);
    --border-hover: rgba(0,0,0,0.18);
    --shadow:       0 4px 20px rgba(0,0,0,0.10);
    --shadow-lg:    0 12px 40px rgba(0,0,0,0.14);
  }
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.3s ease, color 0.3s ease;
}

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: rgba(255,215,0,0.3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,215,0,0.5); }

/* ---- UTILITIES ---- */
.container { max-width: 1320px; margin: 0 auto; padding: 0 24px; }
.mono { font-family: 'JetBrains Mono', monospace; }
a { text-decoration: none; color: inherit; }

/* ---- LOADER ---- */
.page-loader {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.5s ease;
}
.page-loader.hidden { opacity: 0; pointer-events: none; }
.loader-ring {
  width: 54px; height: 54px;
  border: 3px solid var(--gold-border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- TICKER ---- */
.ticker-bar {
  background: var(--bg-2);
  border-bottom: 1px solid var(--gold-border);
  padding: 8px 0;
  overflow: hidden;
  position: relative;
}
.ticker-bar::before, .ticker-bar::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: 80px;
  z-index: 2;
  pointer-events: none;
}
.ticker-bar::before { left: 0; background: linear-gradient(to right, var(--bg-2), transparent); }
.ticker-bar::after  { right: 0; background: linear-gradient(to left,  var(--bg-2), transparent); }

.ticker-track {
  display: flex;
  gap: 48px;
  animation: tickerScroll 35s linear infinite;
  width: max-content;
}
.ticker-track:hover { animation-play-state: paused; }

@keyframes tickerScroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.ticker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  white-space: nowrap;
}
.ticker-name {
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.ticker-price {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 0.88rem;
}
.ticker-change {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 50px;
}
.up   { color: var(--up); }
.down { color: var(--down); }
.flat { color: var(--flat); }
.ticker-change.up   { background: rgba(0,217,126,0.12); }
.ticker-change.down { background: rgba(255,71,87,0.12); }
.ticker-dot { color: var(--text-muted); font-size: 1.2rem; }

/* ---- CONNECTION STATUS ---- */
.conn-bar {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px 16px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  position: relative;
  z-index: 1001;
}
.conn-bar.offline {
  display: flex;
  background: rgba(255,71,87,0.15);
  border-bottom: 1px solid rgba(255,71,87,0.3);
  color: #FF4757;
}
.conn-bar.simulated {
  display: flex;
  background: rgba(255,215,0,0.10);
  border-bottom: 1px solid rgba(255,215,0,0.2);
  color: var(--gold);
}
.conn-bar.live {
  display: flex;
  background: rgba(0,217,126,0.08);
  border-bottom: 1px solid rgba(0,217,126,0.18);
  color: var(--up);
}
.conn-bar .conn-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
  animation: livePulse 1.5s ease-in-out infinite;
}
.conn-bar .conn-close {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: currentColor;
  opacity: 0.6;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 2px 6px;
  line-height: 1;
}
.conn-bar .conn-close:hover { opacity: 1; }

/* ---- NAVBAR ---- */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: rgba(8,12,18,0.88);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s ease, border-color 0.3s ease;
}

[data-theme="light"] .navbar {
  background: rgba(255,255,255,0.92);
  box-shadow: 0 1px 0 rgba(0,0,0,0.08);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 64px;
  max-width: 1320px;
  margin: 0 auto;
  gap: 24px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  text-decoration: none;
}
.logo-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  box-shadow: 0 0 16px rgba(255,215,0,0.35);
}
.nav-logo span { color: var(--gold); }

.nav-links {
  display: flex;
  list-style: none;
  gap: 2px;
}
.nav-links a {
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition);
}
.nav-links a:hover, .nav-links a.active {
  color: var(--gold);
  background: var(--gold-dim);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.refresh-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--gold-dim);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--gold);
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: var(--transition);
  white-space: nowrap;
}
.refresh-btn:hover {
  background: rgba(255,215,0,0.2);
  box-shadow: 0 0 16px rgba(255,215,0,0.2);
}
.refresh-icon { font-size: 0.9rem; transition: transform 0.5s ease; }
.refresh-btn.spinning .refresh-icon { animation: spin 0.6s linear infinite; }

.last-update {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
}

/* ---- THEME TOGGLE BUTTON ---- */
.theme-toggle {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--glass);
  font-size: 1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}
.theme-toggle:hover {
  background: var(--gold-dim);
  border-color: var(--gold-border);
  transform: rotate(20deg);
}

/* ---- ADMIN NAV LINK ---- */
.nav-links .admin-link {
  color: var(--text-muted) !important;
  font-size: 0.8rem !important;
}
.nav-links .admin-link:hover {
  color: var(--gold) !important;
  background: var(--gold-dim) !important;
}

/* ---- HERO ---- */
.hero {
  padding-top: 120px;
  padding-bottom: 0;
  min-height: 520px;
  position: relative;
  overflow: hidden;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(255,215,0,0.07) 0%, transparent 70%);
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 50%, rgba(255,215,0,0.04) 0%, transparent 50%),
    radial-gradient(circle at 80% 30%, rgba(200,214,229,0.03) 0%, transparent 40%);
  pointer-events: none;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
  padding: 48px 0 72px;
}

.hero-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--gold-dim);
  border: 1px solid var(--gold-border);
  color: var(--gold-light);
  padding: 5px 14px;
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 16px;
}
.live-dot {
  width: 7px; height: 7px;
  background: var(--up);
  border-radius: 50%;
  animation: livePulse 1.5s ease-in-out infinite;
}
@keyframes livePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.7); }
}

.hero-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 16px;
  letter-spacing: -1px;
}
.hero-title .gold { color: var(--gold); }
.hero-title .silver { color: var(--silver); }

.hero-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
  max-width: 440px;
  margin-bottom: 28px;
}

.hero-stats {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
}
.hero-stat-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.hero-stat-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold);
}
.hero-stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ---- HERO MAIN PRICE CARD ---- */
.hero-price-card {
  background: var(--card-2);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-lg), 0 0 60px rgba(255,215,0,0.06);
  position: relative;
  overflow: hidden;
}
.hero-price-card::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 180px; height: 180px;
  background: radial-gradient(circle, rgba(255,215,0,0.08) 0%, transparent 70%);
  pointer-events: none;
}
.hero-price-card::after {
  content: '⚖️';
  position: absolute;
  bottom: 20px;
  right: 24px;
  font-size: 5rem;
  opacity: 0.04;
}

.hero-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.hero-card-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
}
.hero-card-badge {
  background: rgba(0,217,126,0.1);
  border: 1px solid rgba(0,217,126,0.2);
  color: var(--up);
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 0.72rem;
  font-weight: 700;
}

.big-price {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  font-weight: 700;
  line-height: 1;
  margin-bottom: 6px;
  letter-spacing: -1px;
}
.big-price.gold-price { color: var(--gold); text-shadow: 0 0 30px rgba(255,215,0,0.3); }
.big-price.silver-price { color: var(--silver); text-shadow: 0 0 30px rgba(200,214,229,0.2); }

.price-unit {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.price-change-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 0;
}
.price-change-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
}
.price-change-badge.up   { background: rgba(0,217,126,0.12); color: var(--up); }
.price-change-badge.down { background: rgba(255,71,87,0.12);  color: var(--down); }
.price-period { font-size: 0.75rem; color: var(--text-muted); }

.hero-card-divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

.sell-buy-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.sell-buy-item { display: block; }
.sell-buy-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.sell-buy-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.15rem;
  font-weight: 700;
}
.sell-buy-value.sell { color: var(--down); }
.sell-buy-value.buy  { color: var(--up); }

/* ---- SECTION HEADER ---- */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 12px;
}
.section-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  font-weight: 700;
}
.section-title .gold { color: var(--gold); }
.section-title .silver { color: var(--silver); }
.section-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 50px;
}

/* ---- SECTION WRAPPER ---- */
.section { padding: 56px 0; }
.section + .section { border-top: 1px solid var(--border); }

/* ---- PRICE GRID ---- */
.price-category-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 28px;
}
.price-tab {
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: var(--transition);
}
.price-tab.active-gold {
  background: var(--gold-dim);
  border-color: var(--gold-border);
  color: var(--gold);
}
.price-tab.active-silver {
  background: var(--silver-dim);
  border-color: var(--silver-border);
  color: var(--silver);
}
.price-tab:hover { border-color: var(--border-hover); color: var(--text-primary); }

.price-table-wrapper {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.price-table {
  width: 100%;
  border-collapse: collapse;
}
.price-table thead tr {
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--border);
}
.price-table thead th {
  padding: 14px 20px;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
}
.price-table thead th:not(:first-child) { text-align: right; }

.price-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}
.price-table tbody tr:last-child { border-bottom: none; }
.price-table tbody tr:hover { background: var(--glass-hover); }

.price-table td {
  padding: 18px 20px;
  font-size: 0.9rem;
  vertical-align: middle;
}
.price-table td:not(:first-child) { text-align: right; }

.brand-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.brand-name { font-weight: 700; font-size: 0.9rem; color: var(--text-primary); }
.brand-type { font-size: 0.72rem; color: var(--text-muted); }

.price-cell {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 1rem;
}
.price-cell.sell { color: var(--down); }
.price-cell.buy  { color: var(--up); }
.price-cell.gold-val { color: var(--gold); }
.price-cell.silver-val { color: var(--silver); }

.change-cell {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  font-weight: 700;
}

.flash-up   { animation: flashUp 0.6s ease; }
.flash-down { animation: flashDown 0.6s ease; }
@keyframes flashUp   { 0%,100%{background:transparent} 30%{background:rgba(0,217,126,0.15)} }
@keyframes flashDown { 0%,100%{background:transparent} 30%{background:rgba(255,71,87,0.12)} }

/* ---- OVERVIEW CARDS ---- */
.overview-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 48px;
}

.overview-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}
.overview-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.overview-card.gold-card {
  border-color: var(--gold-border);
  background: linear-gradient(135deg, rgba(255,215,0,0.06), var(--card));
}
.overview-card.silver-card {
  border-color: var(--silver-border);
  background: linear-gradient(135deg, rgba(200,214,229,0.06), var(--card));
}

.ov-icon {
  font-size: 1.8rem;
  margin-bottom: 10px;
  display: block;
}
.ov-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.ov-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 6px;
}
.ov-value.gold   { color: var(--gold); }
.ov-value.silver { color: var(--silver); }
.ov-value.green  { color: var(--up); }
.ov-value.white  { color: var(--text-primary); }
.ov-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ---- CHART SECTION ---- */
.chart-wrapper {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
}
.chart-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.chart-metal-tabs {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-right: 8px;
}
.chart-metal-tab {
  padding: 7px 16px;
  background: transparent;
  border: none;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: var(--transition);
}
.chart-metal-tab.active-gold   { background: var(--gold-dim); color: var(--gold); }
.chart-metal-tab.active-silver { background: var(--silver-dim); color: var(--silver); }

.chart-period-tabs {
  display: flex;
  gap: 4px;
}
.chart-period-tab {
  padding: 6px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: var(--transition);
}
.chart-period-tab:hover { border-color: var(--border); color: var(--text-primary); }
.chart-period-tab.active { border-color: var(--gold-border); color: var(--gold); background: var(--gold-dim); }

.chart-container {
  position: relative;
  height: 300px;
}

/* ---- CALCULATOR ---- */
.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.calc-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: var(--transition);
}
.calc-card:hover { border-color: var(--border-hover); }
.calc-card.gold-calc   { border-top: 3px solid var(--gold); }
.calc-card.silver-calc { border-top: 3px solid var(--silver); }

.calc-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.calc-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.calc-row label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}
.calc-input-wrap {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: var(--transition);
}
.calc-input-wrap:focus-within { border-color: var(--gold-border); }
.calc-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  padding: 11px 14px;
  font-size: 1.1rem;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  color: var(--text-primary);
}
.calc-unit {
  padding: 11px 14px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(255,255,255,0.04);
  border-left: 1px solid var(--border);
  white-space: nowrap;
}

.calc-result {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-top: 4px;
}
.calc-result-label { font-size: 0.72rem; color: var(--text-muted); margin-bottom: 6px; }
.calc-result-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.35rem;
  font-weight: 700;
}
.calc-result-value.gold   { color: var(--gold); }
.calc-result-value.silver { color: var(--silver); }

/* ---- ALERT SECTION ---- */
.alert-card {
  background: linear-gradient(135deg, var(--gold-dim), var(--card));
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-lg);
  padding: 32px;
}
.alert-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.alert-input-group {
  display: flex;
  gap: 10px;
}
.alert-input {
  flex: 1;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.9rem;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-primary);
  outline: none;
  transition: var(--transition);
}
.alert-input:focus { border-color: var(--gold-border); }
.alert-select {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.85rem;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  outline: none;
  cursor: pointer;
}
.set-alert-btn {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 22px;
  font-size: 0.9rem;
  font-weight: 700;
  color: #080C12;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: var(--transition);
  white-space: nowrap;
}
.set-alert-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(255,215,0,0.3); }

.active-alerts { margin-top: 20px; }
.alert-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 8px;
  font-size: 0.85rem;
}
.alert-item-text { color: var(--text-secondary); }
.alert-item-del {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 0 4px;
  transition: var(--transition);
}
.alert-item-del:hover { color: var(--down); }

/* ---- NEWS ---- */
.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.news-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition);
  cursor: pointer;
  display: flex;
  flex-direction: column;
}
.news-card:hover {
  border-color: var(--gold-border);
  background: var(--glass-hover);
  transform: translateY(-2px);
}
/* Thumbnail ảnh bài viết */
.news-thumb {
  width: 100%;
  height: 140px;
  overflow: hidden;
  background: var(--bg-3);
  flex-shrink: 0;
}
.news-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.news-card:hover .news-thumb img { transform: scale(1.04); }

/* Padding phần text */
.news-card .news-tag,
.news-card .news-title,
.news-card .news-summary,
.news-card .news-meta {
  padding-left: 18px;
  padding-right: 18px;
}
.news-tag {
  display: inline-block;
  background: var(--gold-dim);
  border: 1px solid var(--gold-border);
  color: var(--gold);
  padding: 2px 9px;
  border-radius: 50px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 14px 0 8px 18px;
}
.news-title {
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.news-summary {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  margin-top: auto;
}

/* Ẩn hoàn toàn admin link */
.admin-link { display: none !important; }

/* ---- TOAST ---- */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  min-width: 280px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
  font-weight: 500;
  animation: toastIn 0.3s ease;
}
.toast.success { border-left: 3px solid var(--up); }
.toast.warning { border-left: 3px solid var(--gold); }
.toast.error   { border-left: 3px solid var(--down); }
.toast.info    { border-left: 3px solid var(--silver); }
@keyframes toastIn { from { opacity:0; transform:translateX(20px); } to { opacity:1; transform:translateX(0); } }

/* ---- FOOTER ---- */
.footer {
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  padding: 48px 0 24px;
  margin-top: 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}
.footer-brand p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-top: 12px;
  max-width: 260px;
}
.footer-col h4 {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 8px; }
.footer-col a {
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: var(--transition);
}
.footer-col a:hover { color: var(--gold); }
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ---- BACK TO TOP ---- */
.back-to-top {
  position: fixed;
  bottom: 90px;
  right: 24px;
  z-index: 8000;
  width: 42px; height: 42px;
  background: var(--gold-dim);
  border: 1px solid var(--gold-border);
  border-radius: 50%;
  color: var(--gold);
  font-size: 1.1rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
}
.back-to-top.show { opacity: 1; pointer-events: auto; }
.back-to-top:hover { background: rgba(255,215,0,0.2); transform: translateY(-2px); }

/* ======================================
   RESPONSIVE – MOBILE FIRST OVERHAUL
   ====================================== */

/* ---- 1100px TABLET ---- */
@media (max-width: 1100px) {
  .overview-grid { grid-template-columns: repeat(2, 1fr); }
  .news-grid     { grid-template-columns: 1fr 1fr; }
  .footer-grid   { grid-template-columns: 1fr 1fr; }
  .hero-inner    { gap: 28px; }
  .calc-grid     { grid-template-columns: 1fr; gap: 20px; }
  .alert-grid    { grid-template-columns: 1fr; }
}

/* ---- HAMBURGER MENU ---- */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 38px; height: 38px;
  padding: 8px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  flex-shrink: 0;
  transition: var(--transition);
}
.hamburger:hover { background: var(--gold-dim); border-color: var(--gold-border); }
.hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: all 0.3s ease;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); background: var(--gold); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); background: var(--gold); }

/* Mobile menu overlay */
.mobile-nav {
  display: none;
  position: fixed;
  top: 64px; left: 0; right: 0;
  background: var(--bg-2);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--gold-border);
  z-index: 999;
  padding: 16px 20px;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
  max-height: calc(100vh - 64px);
  overflow-y: auto;
}
.mobile-nav.open { display: flex; }
.mobile-nav a {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: var(--transition);
  min-height: 44px;
}
.mobile-nav a:hover, .mobile-nav a.active {
  color: var(--gold);
  background: var(--gold-dim);
}
.mobile-nav-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 0;
}

/* ---- 768px MOBILE ---- */
@media (max-width: 768px) {
  /* Container */
  .container { padding: 0 16px; }

  /* Nav – show hamburger, hide desktop links */
  .nav-links   { display: none; }
  .hamburger   { display: flex; }
  .nav-inner   { padding: 0 14px; gap: 8px; height: 56px; }
  .mobile-nav  { top: 56px; max-height: calc(100vh - 56px); }
  .last-update { display: none; }
  .refresh-btn { padding: 7px 10px; font-size: 0.78rem; gap: 4px; }
  .logo-icon   { width: 32px; height: 32px; font-size: 0.95rem; }
  .nav-logo    { font-size: 1rem; }

  /* Hero – single column */
  .hero        { padding-top: 88px; min-height: auto; }
  .hero-inner  {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 24px 0 40px;
  }
  .hero-title    { font-size: 1.9rem; letter-spacing: -0.4px; }
  .hero-subtitle { font-size: 0.88rem; max-width: 100%; margin-bottom: 20px; }
  .hero-stats    { gap: 16px; flex-wrap: wrap; }
  .hero-stat-value { font-size: 1rem; }
  .hero-price-card { padding: 20px 18px; border-radius: var(--radius-md); }

  /* Sections */
  .section { padding: 36px 0; }
  .section-header { flex-direction: column; align-items: flex-start; gap: 8px; padding-bottom: 12px; }
  .section-title  { font-size: 1.25rem; }

  /* Overview grid → 2 cols */
  .overview-grid { grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 32px; }
  .overview-card { padding: 14px 16px; }
  .ov-value      { font-size: 1.15rem; }
  .ov-label      { font-size: 0.7rem; }
  .ov-icon       { font-size: 1.5rem; margin-bottom: 6px; }

  /* Price table → card-style on mobile */
  .price-table-wrapper { overflow-x: auto; border-radius: var(--radius-md); }
  .price-category-tabs { flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
  .price-tab     { padding: 8px 14px; font-size: 0.82rem; flex: 1; text-align: center; }
  .price-table   { display: block; }
  .price-table thead { display: none; }
  .price-table tbody { display: flex; flex-direction: column; gap: 6px; padding: 10px; }
  .price-table tr {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 0 8px;
    padding: 12px 12px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin: 0;
  }
  .price-table tr:hover { background: var(--glass-hover); border-color: var(--border-hover); }
  .price-table td {
    display: flex;
    align-items: center;
    padding: 0;
    border: none;
    font-size: 0.8rem;
  }
  /* Ẩn: Giá/Chỉ (col 4), Thay đổi (col 5), % (col 6) */
  .price-table td:nth-child(4),
  .price-table td:nth-child(5),
  .price-table td:nth-child(6) { display: none; }
  /* Tên thương hiệu: dùng style kế thừa */
  .brand-cell  { gap: 8px; }
  .brand-icon  { width: 30px; height: 30px; font-size: 0.85rem; border-radius: 8px; }
  .brand-name  { font-size: 0.82rem; }
  .brand-type  { font-size: 0.65rem; }
  /* Giá bán */
  .price-table td:nth-child(2) { justify-content: flex-end; }
  .price-cell  { font-size: 0.88rem; }
  /* Giá mua */
  .price-table td:nth-child(3) { justify-content: flex-end; }

  /* Charts */
  .chart-wrapper   { padding: 14px; }
  .chart-container { height: 200px; }
  .chart-controls  { gap: 8px; flex-wrap: wrap; }
  .chart-metal-tabs { margin-right: 0; }
  .chart-metal-tab  { padding: 6px 12px; font-size: 0.8rem; }
  .chart-period-tab { padding: 6px 10px; font-size: 0.76rem; min-height: 34px; }

  /* Calculator */
  .calc-grid   { grid-template-columns: 1fr; gap: 16px; }
  .calc-card   { padding: 18px 16px; }
  .calc-input  { font-size: 0.9rem; }

  /* Alerts */
  .alert-card  { padding: 22px 18px; }
  .alert-grid  { grid-template-columns: 1fr; gap: 14px; }
  .alert-input-group { flex-wrap: wrap; }
  .alert-input { min-width: 0; }
  .set-alert-btn { width: 100%; justify-content: center; }

  /* News */
  .news-grid   { grid-template-columns: 1fr; gap: 12px; }
  .news-thumb  { height: 120px; }

  /* Footer */
  .footer         { padding: 32px 0 80px; }
  .footer-grid    { grid-template-columns: 1fr 1fr; gap: 20px; }
  .footer-brand   { grid-column: 1 / -1; }
  .footer-brand p { max-width: 100%; font-size: 0.82rem; }
  .footer-col h4  { font-size: 0.72rem; }
  .footer-col a   { font-size: 0.82rem; }
  .footer-bottom  { flex-direction: column; gap: 6px; text-align: center; }

  /* Hero price big */
  .big-price { font-size: 1.9rem; }
  .sell-buy-row { gap: 10px; }
  .sell-buy-value { font-size: 1rem; }

  /* Back to top */
  .back-to-top { bottom: 70px; right: 14px; width: 38px; height: 38px; font-size: 1rem; }

  /* Toast */
  .toast-container { bottom: 70px; right: 10px; left: 10px; }
  .toast { font-size: 0.8rem; padding: 10px 12px; min-width: 0; }

  /* Metal tabs */
  .metal-tabs { gap: 6px; }
  .metal-tab  { padding: 8px 14px; font-size: 0.8rem; min-height: 40px; }

  /* Connection bar */
  .conn-bar { font-size: 0.72rem; padding: 5px 12px; }

  /* Ticker font khi mobile */
  .ticker-item { gap: 6px; }
  .ticker-name { font-size: 0.75rem; }
  .ticker-price { font-size: 0.82rem; }
  .ticker-change { display: none; } /* ẩn % change trên ticker khi mobile quá nhỏ */
}

/* ---- 480px SMALL PHONES ---- */
@media (max-width: 480px) {
  .container       { padding: 0 12px; }
  .nav-inner       { padding: 0 12px; height: 52px; }
  .mobile-nav      { top: 52px; max-height: calc(100vh - 52px); }
  .nav-logo        { font-size: 0.9rem; gap: 7px; }
  .logo-icon       { width: 28px; height: 28px; font-size: 0.85rem; }
  .theme-toggle    { width: 34px; height: 34px; font-size: 0.85rem; }
  .refresh-btn     { padding: 6px 8px; font-size: 0.73rem; }

  /* Hero */
  .hero            { padding-top: 76px; }
  .hero-inner      { padding: 20px 0 36px; gap: 16px; }
  .hero-title      { font-size: 1.65rem; letter-spacing: -0.3px; }
  .hero-subtitle   { font-size: 0.86rem; margin-bottom: 16px; color: var(--text-secondary); }
  .hero-price-card { padding: 16px 14px; }
  .hero-stats      { gap: 12px; }
  .hero-stat-value { font-size: 0.95rem; }
  .hero-stat-label { font-size: 0.67rem; }
  .hero-label      { font-size: 0.7rem; padding: 4px 10px; }

  /* Overview – 2 col compact */
  .overview-grid   { grid-template-columns: 1fr 1fr; gap: 7px; margin-bottom: 24px; }
  .overview-card   { padding: 11px 12px; }
  .ov-value        { font-size: 1.05rem; }
  .ov-icon         { font-size: 1.4rem; margin-bottom: 6px; }

  /* Price table */
  .price-table tbody { padding: 7px; gap: 5px; }
  .price-table tr    { padding: 10px 10px; }
  .brand-name        { font-size: 0.78rem; }
  .brand-type        { display: none; }
  .price-cell        { font-size: 0.82rem; }
  /* Ẩn cột mua trên 480px để tiết kiệm không gian */
  .price-table td:nth-child(3) { display: none; }

  /* Sections */
  .section         { padding: 28px 0; }
  .section-title   { font-size: 1.1rem; }

  /* Footer – single column */
  .footer-grid     { grid-template-columns: 1fr; gap: 18px; }
  .footer          { padding-bottom: 90px; }
  .footer-brand    { grid-column: unset; }

  /* Chart */
  .chart-container { height: 160px; }
  .chart-metal-tab { padding: 5px 10px; font-size: 0.76rem; }

  /* Ticker */
  .ticker-item     { gap: 5px; }
  .ticker-bar      { padding: 6px 0; }

  /* Big hero price */
  .big-price       { font-size: 1.6rem; }
  .sell-buy-label  { font-size: 0.64rem; }
  .sell-buy-value  { font-size: 0.95rem; }

  /* Back to top */
  .back-to-top     { bottom: 75px; width: 36px; height: 36px; font-size: 0.9rem; }
}

/* ---- SAFE AREA for iOS notch / home bar ---- */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  @media (max-width: 768px) {
    .footer          { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
    .back-to-top     { bottom: calc(64px + env(safe-area-inset-bottom)); }
    .toast-container { bottom: calc(64px + env(safe-area-inset-bottom)); }
  }
}

/* ---- TOUCH TARGETS – minimum 44×44px for all interactive elements ---- */
@media (max-width: 768px) {
  button, a, input, select, textarea, .faq-q, .chart-period-tab, .metal-tab {
    -webkit-tap-highlight-color: transparent;
  }
  .theme-toggle   { width: 40px; height: 40px; }
  .hamburger      { width: 40px; height: 40px; }
  .refresh-btn    { min-height: 38px; }
  .mobile-nav a   { min-height: 48px; }
  .faq-q          { min-height: 48px; }
  .price-tab      { min-height: 40px; }
}

/* ---- LIGHT MODE SPECIFIC FIXES ---- */
/* Đảm bảo chữ trên nền trắng luôn đọc được */
[data-theme="light"] .brand-name    { color: #0A1520; }
[data-theme="light"] .brand-type    { color: #4A6080; }
[data-theme="light"] .section-badge  { border-color: rgba(0,0,0,0.12); color: #4A6080; }
[data-theme="light"] .price-table thead th { color: #3A5070; }
[data-theme="light"] .calc-row label { color: #3A5070; }
[data-theme="light"] .calc-unit      { color: #3A5070; background: rgba(0,0,0,0.04); }
[data-theme="light"] .hero-card-title { color: #3A5070; }
[data-theme="light"] .hero-card-title.silver { color: #2A4868; }
[data-theme="light"] .ticker-name   { color: #2A3D55; }
[data-theme="light"] .ticker-dot    { color: #7A9AB8; }
[data-theme="light"] .news-title    { color: #0A1520; }
[data-theme="light"] .news-summary  { color: #2A3D55; }
[data-theme="light"] .news-meta     { color: #5A7090; }
[data-theme="light"] .price-period  { color: #5A7090; }
[data-theme="light"] .ov-label      { color: #3A5070; }
[data-theme="light"] .ov-sub        { color: #5A7090; }
[data-theme="light"] .sell-buy-label { color: #3A5070; }
[data-theme="light"] .hero-subtitle { color: #2A3D55; }
[data-theme="light"] .hero-stat-label { color: #5A7090; }
[data-theme="light"] .section-title { color: #0A1520; }
[data-theme="light"] .footer-brand p { color: #2A3D55; }
[data-theme="light"] .footer-col h4  { color: #3A5070; }
[data-theme="light"] .footer-col a   { color: #2A3D55; }
[data-theme="light"] .footer-bottom  { color: #5A7090; }
[data-theme="light"] .hero-card-badge { background: rgba(0,160,80,0.12); border-color: rgba(0,160,80,0.25); }
[data-theme="light"] .mobile-nav a  { color: #1A2D45; }
[data-theme="light"] .alert-item-text { color: #1A2D45; }
[data-theme="light"] .alert-card    {
  background: linear-gradient(135deg, rgba(184,128,10,0.07), var(--card-2));
}
[data-theme="light"] .ticker-bar::before { background: linear-gradient(to right, var(--bg-2), transparent); }
[data-theme="light"] .ticker-bar::after  { background: linear-gradient(to left,  var(--bg-2), transparent); }
[data-theme="light"] .price-table tbody tr:hover { background: rgba(184,128,10,0.04); }
[data-theme="light"] .conn-bar.offline   { background: rgba(200,20,30,0.08);  border-color: rgba(200,20,30,0.2); }
[data-theme="light"] .conn-bar.simulated { background: rgba(184,128,10,0.08); border-color: rgba(184,128,10,0.2); }
[data-theme="light"] .conn-bar.live      { background: rgba(0,120,70,0.07);   border-color: rgba(0,120,70,0.18); }
[data-theme="light"] .hamburger span    { background: #1A2D45; }
[data-theme="light"] .chart-metal-tab   { color: #3A5070; }
[data-theme="light"] .chart-period-tab  { color: #3A5070; }
[data-theme="light"] .price-tab         { color: #3A5070; }
[data-theme="light"] .calc-result-label { color: #3A5070; }
[data-theme="light"] .calc-input        { color: #0A1520; }
[data-theme="light"] .news-tag          { color: var(--gold); }

/* ---- PRINT – strip decorative elements ---- */
@media print {
  .navbar, .ticker-bar, .back-to-top, .toast-container,
  .hamburger, .mobile-nav, .refresh-btn, .theme-toggle,
  .conn-bar { display: none !important; }
  body { background: #fff; color: #000; }
  .section { padding: 20px 0; }
  .price-table-wrapper { border: 1px solid #ccc; }
}
