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

:root {
  --bg: #0a0e1a;
  --surface: #131a2e;
  --surface2: #1a2340;
  --border: #1e2d4a;
  --text: #e2e8f0;
  --muted: #64748b;
  --accent: #3b82f6;
  --green: #22c55e;
  --red: #ef4444;
  --yellow: #f59e0b;
  --gold: #fbbf24;
  --sydney: #22c55e;
  --tokyo: #f59e0b;
  --london: #3b82f6;
  --newyork: #ef4444;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.4;
  height: 100vh;
  overflow: hidden;
}

.wrap {
  max-width: 1900px; margin: 0 auto; padding: 0.5vh 1.5rem;
  height: 100vh; display: flex; flex-direction: column;
}

/* -- Header + Main Clock -------------------------------------------------- */
header { text-align: center; margin-bottom: 0.3vh; flex-shrink: 0; }
header h1 { font-size: 0.88rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 0.2vh; }

.header-row {
  display: flex; align-items: center; justify-content: center; gap: 2rem;
}
.header-center { flex: 0 0 auto; }

.spot-mini {
  display: flex; flex-direction: column; align-items: center; gap: 0.15rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 0.5rem 1.2rem; min-width: 150px;
}
.spot-label { font-size: 0.66rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.spot-price { font-size: 1.38rem; font-weight: 800; color: var(--gold); font-variant-numeric: tabular-nums; }
#spot-silver .spot-price { color: #cbd5e1; }
.spot-chg { font-size: 0.66rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.spot-chg.up { color: var(--green); }
.spot-chg.down { color: var(--red); }

.main-clock { margin: 0 auto; }
.main-time {
  font-size: 8.4rem; font-weight: 800; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(135deg, #fff, #94a3b8);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
}
.main-date { font-size: 0.94rem; color: var(--muted); margin-top: 0.1rem; text-transform: capitalize; }
.main-tz { font-size: 0.72rem; color: var(--muted); margin-top: 0; }

/* -- Session Banner ------------------------------------------------------- */
.session-banner {
  display: flex; align-items: center; justify-content: center; gap: 0.7rem;
  padding: 0.25vh 0.6rem; border-radius: 8px; margin-bottom: 0.3vh; text-align: center;
  font-weight: 600; font-size: 0.83rem; flex-shrink: 0;
}
.session-banner.live { background: rgba(34,197,94,0.12); border: 1px solid rgba(34,197,94,0.3); color: var(--green); }
.session-banner.idle { background: rgba(100,116,139,0.1); border: 1px solid var(--border); color: var(--muted); }
.session-banner.closed { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3); color: var(--red); }
.banner-dot {
  width: 11px; height: 11px; border-radius: 50%; background: currentColor;
  animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

/* -- World Clocks --------------------------------------------------------- */
.world-clocks {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem;
  margin-bottom: 0.3vh; flex-shrink: 0;
}
.clock-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 0.35rem 0.5rem 0.3rem; text-align: center; transition: border-color 0.3s, box-shadow 0.3s;
  position: relative; overflow: hidden;
}
.clock-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: var(--border); transition: background 0.3s;
}
#card-london::before { background: var(--london); opacity: 0.4; }
#card-newyork::before { background: var(--newyork); opacity: 0.4; }
#card-tokyo::before { background: var(--tokyo); opacity: 0.4; }
#card-sydney::before { background: var(--sydney); opacity: 0.4; }

.clock-card.active { border-color: rgba(34,197,94,0.4); box-shadow: 0 0 24px rgba(34,197,94,0.08); }
.clock-card.active::before { opacity: 1; }

.clock-flag { font-size: 1.1rem; margin-bottom: 0; }
.clock-city { font-size: 0.66rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.clock-time {
  font-size: 1.32rem; font-weight: 700; margin: 0.1rem 0;
  font-variant-numeric: tabular-nums;
}
.clock-offset { font-size: 0.61rem; color: var(--muted); }

/* -- Timelines ------------------------------------------------------------ */
.timelines-row {
  display: flex; gap: 0.5rem; margin-bottom: 0.3vh; flex-shrink: 0;
}
.timelines-row .timeline-section { flex: 1; margin-bottom: 0; }
.timeline-section { margin-bottom: 0.3vh; flex-shrink: 0; }
.timeline-section h2 { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.2vh; }

.timeline {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 0.4rem 0.8rem 0.3rem; position: relative; min-height: 118px;
}
.tl-hours {
  display: flex; justify-content: space-between; font-size: 0.61rem; color: var(--muted);
  margin-bottom: 0.25rem; font-weight: 600; padding: 0 0.2rem;
}
.tl-bar {
  position: absolute; height: 20px; border-radius: 4px; display: flex;
  align-items: center; justify-content: center; font-size: 0.61rem; font-weight: 600;
  color: rgba(255,255,255,0.9); opacity: 0.7;
}
.tl-sydney  { top: 28px; background: var(--sydney); }
.tl-tokyo   { top: 52px; background: var(--tokyo); }
.tl-london  { top: 76px; background: var(--london); }
.tl-newyork { top: 100px; background: var(--newyork); }

/* Exchange timeline bars */
.timeline-ex .tl-asx  { top: 28px; background: #14b8a6; }
.timeline-ex .tl-jpx  { top: 52px; background: #ec4899; }
.timeline-ex .tl-lse  { top: 76px; background: #6366f1; }
.timeline-ex .tl-nyse { top: 100px; background: #f97316; }

.tl-now {
  position: absolute; top: 22px; bottom: 4px; width: 2px; background: #fff;
  box-shadow: 0 0 8px rgba(255,255,255,0.5); z-index: 10; transition: left 1s linear;
}
.tl-now::before {
  content: '\25BC'; position: absolute; top: -14px; left: -6px;
  font-size: 0.61rem; color: #fff;
}

/* -- Session Cards -------------------------------------------------------- */
.sessions-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem;
  margin-bottom: 0.3vh; flex-shrink: 0;
}
.sess-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 0.35rem 0.55rem; transition: border-color 0.3s, box-shadow 0.3s;
}
.sess-card.active { box-shadow: 0 0 24px rgba(34,197,94,0.08); }
.sess-card.active.sydney  { border-color: rgba(34,197,94,0.5); }
.sess-card.active.tokyo   { border-color: rgba(245,158,11,0.5); }
.sess-card.active.london  { border-color: rgba(59,130,246,0.5); }
.sess-card.active.newyork { border-color: rgba(239,68,68,0.5); }
.sess-card.active.nyse    { border-color: rgba(249,115,22,0.5); }
.sess-card.active.lse     { border-color: rgba(99,102,241,0.5); }
.sess-card.active.jpx     { border-color: rgba(236,72,153,0.5); }
.sess-card.active.asx     { border-color: rgba(20,184,166,0.5); }

.sess-header { display: flex; align-items: center; gap: 0.4rem; margin-bottom: 0.15rem; }
.sess-flag { font-size: 0.94rem; }
.sess-name { font-weight: 700; font-size: 0.83rem; }
.sess-status {
  margin-left: auto; font-size: 0.61rem; font-weight: 700; padding: 0.11rem 0.44rem;
  border-radius: 20px; text-transform: uppercase; letter-spacing: 0.04em;
}
.sess-status.active { background: rgba(34,197,94,0.15); color: var(--green); }
.sess-status.inactive { background: rgba(100,116,139,0.1); color: var(--muted); }
.sess-status.closed { background: rgba(239,68,68,0.1); color: var(--red); }

.sess-times { font-size: 0.72rem; color: var(--muted); margin-bottom: 0.15rem; }
.sess-times small { opacity: 0.6; }

.sess-countdown {
  font-size: 0.77rem; margin-bottom: 0.15rem; font-variant-numeric: tabular-nums;
}
.sess-countdown strong { color: #fff; font-size: 0.88rem; }

.sess-progress {
  height: 4px; background: var(--border); border-radius: 4px; overflow: hidden;
}
.sess-bar {
  height: 100%; border-radius: 4px; transition: width 1s linear;
}
.sess-card.sydney .sess-bar  { background: var(--sydney); }
.sess-card.tokyo .sess-bar   { background: var(--tokyo); }
.sess-card.london .sess-bar  { background: var(--london); }
.sess-card.newyork .sess-bar { background: var(--newyork); }
.sess-card.nyse .sess-bar    { background: #f97316; }
.sess-card.lse .sess-bar     { background: #6366f1; }
.sess-card.jpx .sess-bar     { background: #ec4899; }
.sess-card.asx .sess-bar     { background: #14b8a6; }

.sess-holiday {
  margin-top: 0.2rem; padding-top: 0.15rem; border-top: 1px solid var(--border);
  font-size: 0.61rem; color: var(--muted); line-height: 1.2;
}
.sess-holiday:empty { display: none; }
.sess-holiday .sh-today { color: var(--red); font-weight: 700; }
.sess-holiday .sh-next { color: var(--gold); }

/* -- Overlaps ------------------------------------------------------------- */
.overlap-section { margin-bottom: 0.2vh; flex-shrink: 0; }
.overlap-section h2 { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.2vh; }
.overlap-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
.overlap-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 0.3rem 0.44rem; text-align: center; transition: border-color 0.3s;
}
.overlap-card.active { border-color: var(--gold); box-shadow: 0 0 18px rgba(251,191,36,0.1); }
.ov-names { font-weight: 700; font-size: 0.77rem; margin-bottom: 0.08rem; }
.ov-times { font-size: 0.66rem; color: var(--muted); margin-bottom: 0.1rem; }
.ov-status { font-size: 0.61rem; font-weight: 600; color: var(--muted); }
.ov-status.active { color: var(--gold); }

/* -- News Ticker ---------------------------------------------------------- */
.ticker-section {
  display: flex; align-items: center; gap: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  overflow: hidden; margin-bottom: 0.2vh; flex-shrink: 0; height: 42px;
}
.ticker-label {
  background: var(--accent); color: #fff; font-size: 0.83rem; font-weight: 700;
  padding: 0 0.8rem; height: 100%; display: flex; align-items: center;
  white-space: nowrap; letter-spacing: 0.03em; flex-shrink: 0;
}
.ticker-wrap {
  flex: 1; overflow: hidden; position: relative; height: 100%;
  mask-image: linear-gradient(to right, transparent, #000 3%, #000 97%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 3%, #000 97%, transparent);
}
.ticker-track {
  display: flex; align-items: center; gap: 5rem; height: 100%;
  white-space: nowrap; animation: ticker-scroll 240s linear infinite;
  width: max-content;
}
.ticker-track:hover { animation-play-state: paused; }
.ticker-item { font-size: 0.83rem; color: var(--text); display: flex; align-items: center; gap: 0.5rem; }
.ticker-item.ticker-new { font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.ticker-item .ti-source { color: var(--accent); font-weight: 700; font-size: 0.77rem; }
.ticker-item .ti-bullet { color: var(--gold); font-size: 0.66rem; }
.ticker-item .ti-time { color: var(--muted); font-size: 0.77rem; }
@keyframes ticker-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* -- Weekend notice ------------------------------------------------------- */
.weekend-notice {
  background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.2);
  border-radius: 12px; padding: 0.66rem 1.1rem; display: flex; align-items: center;
  gap: 1rem; margin-bottom: 0.4vh; flex-shrink: 0;
}
.weekend-notice.hidden { display: none; }
.wn-icon { font-size: 1.65rem; }
.wn-text strong { display: block; color: var(--red); font-size: 0.94rem; }
.wn-text span { color: var(--muted); font-size: 0.83rem; }

/* -- Responsive ----------------------------------------------------------- */
@media (max-width: 768px) {
  body { overflow: auto; height: auto; }
  .wrap { height: auto; padding: 0.5rem 0.6rem; }

  /* Header: stack gold/clock/silver vertically */
  .header-row { flex-direction: column; gap: 0.5rem; }
  .spot-mini { flex-direction: row; gap: 0.5rem; padding: 0.4rem 0.8rem; min-width: unset; width: 100%; justify-content: center; }
  .spot-price { font-size: 1.1rem; }
  header h1 { font-size: 0.77rem; }
  .main-time { font-size: 3.2rem; }
  .main-date { font-size: 0.83rem; }

  /* Banner */
  .session-banner { font-size: 0.77rem; padding: 0.3rem 0.5rem; }

  /* Tabs: scroll horizontally */
  .tab-nav { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; gap: 0.3rem; padding-bottom: 0.2rem; }
  .tab-btn { padding: 0.3rem 0.7rem; font-size: 0.72rem; white-space: nowrap; flex-shrink: 0; }

  /* World clocks 2x2 */
  .world-clocks { grid-template-columns: repeat(2, 1fr); gap: 0.4rem; }
  .clock-flag { font-size: 0.94rem; }
  .clock-time { font-size: 1.1rem; }
  .clock-city { font-size: 0.61rem; }
  .clock-offset { font-size: 0.55rem; }

  /* Timelines: stack vertically */
  .timelines-row { flex-direction: column; gap: 0.4rem; }
  .timeline { min-height: 118px; padding: 0.4rem 0.5rem 0.3rem; }
  .timeline-section h2 { font-size: 0.66rem; }
  .tl-hours { font-size: 0.55rem; }
  .tl-bar { font-size: 0.55rem; height: 18px; }

  /* Session cards 2x2 then 1-col for exchange */
  .sessions-grid { grid-template-columns: repeat(2, 1fr); gap: 0.4rem; }
  .sess-card { padding: 0.3rem 0.4rem; }
  .sess-flag { font-size: 0.83rem; }
  .sess-name { font-size: 0.77rem; }
  .sess-status { font-size: 0.55rem; padding: 0.08rem 0.3rem; }
  .sess-times { font-size: 0.66rem; }
  .sess-countdown { font-size: 0.72rem; }
  .sess-countdown strong { font-size: 0.83rem; }
  .sess-holiday { font-size: 0.55rem; }

  /* Overlaps single column */
  .overlap-grid { grid-template-columns: 1fr; gap: 0.3rem; }
  .overlap-card { padding: 0.3rem 0.4rem; }
  .ov-names { font-size: 0.72rem; }
  .ov-times { font-size: 0.61rem; }
  .ov-status { font-size: 0.55rem; }

  /* Tickers */
  .ticker-section { height: 36px; }
  .ticker-label { font-size: 0.72rem; padding: 0 0.5rem; }
  .ticker-item { font-size: 0.72rem; gap: 0.3rem; }
  .ticker-item .ti-source { font-size: 0.66rem; }
  .ticker-item .ti-time { font-size: 0.66rem; }
  .ticker-track { gap: 3rem; }

  /* Weekend notice */
  .weekend-notice { padding: 0.4rem 0.6rem; gap: 0.5rem; }
  .wn-icon { font-size: 1.2rem; }
  .wn-text strong { font-size: 0.83rem; }
  .wn-text span { font-size: 0.72rem; }

  /* Holidays tab */
  .exchanges-grid { grid-template-columns: 1fr; gap: 0.8rem; }
  .exchange-header .ex-flag { font-size: 1rem; }
  .exchange-header .ex-name { font-size: 0.88rem; }

  /* News tab */
  .news-item { padding: 0.5rem 0.6rem; }
  .news-title { font-size: 0.83rem; }
  .news-desc { font-size: 0.72rem; }
  .news-summary { font-size: 0.72rem; }

  /* Metals tab */
  .metals-wrap { padding: 0.5rem 0; align-items: stretch; }
  .metals-header { flex-wrap: wrap; gap: 0.3rem; }
  .metals-header h2 { font-size: 0.77rem; }
  .metals-grid { grid-template-columns: 1fr; gap: 0.8rem; }
  .metal-card { padding: 0.8rem 0.6rem 0.7rem; }
  .metal-price { font-size: 1.8rem; word-break: break-all; }
  .metal-change { font-size: 0.83rem; margin-bottom: 0.4rem; }
  .metal-icon { font-size: 1.4rem; }
  .metal-name { font-size: 0.83rem; margin-bottom: 0.3rem; }
  .metal-symbol { font-size: 0.66rem; }
  .metal-details { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem 0.3rem; padding-top: 0.5rem; }
  .metal-detail { flex: none; min-width: 0; text-align: left; }
  .md-label { font-size: 0.55rem; }
  .md-value { font-size: 0.72rem; }
  .ratio-card { padding: 0.6rem 0.8rem; max-width: 100%; }
  .ratio-label { font-size: 0.72rem; }
  .ratio-value { font-size: 1.4rem; }
  .ratio-desc { font-size: 0.66rem; }
  .metals-footer { font-size: 0.55rem; line-height: 1.3; }
  .metals-news-section .news-list { max-height: 300px; }
  .metals-news-section .news-header { flex-wrap: wrap; gap: 0.3rem; }
  .metals-news-section .news-header h2 { font-size: 0.77rem; }

  /* News headers general */
  .news-header { flex-wrap: wrap; gap: 0.3rem; }
  .news-header h2 { font-size: 0.77rem; }
  .news-filters { gap: 0.25rem; }
  .news-filter { font-size: 0.66rem; padding: 0.18rem 0.55rem; }
  .news-source { font-size: 0.55rem; }
  .news-time { font-size: 0.61rem; }
  .news-lang-tag { font-size: 0.5rem; }

  /* Holidays tab mobile */
  .holidays-wrap h2 { font-size: 0.77rem; margin-bottom: 0.5rem; }
  .holiday-list li { font-size: 0.72rem; gap: 0.4rem; padding: 0.25rem 0.3rem; }
  .holiday-date { width: 80px; font-size: 0.66rem; }
  .holiday-name { font-size: 0.72rem; }
  .holiday-tag { font-size: 0.55rem; }
}

/* -- Tabs ----------------------------------------------------------------- */
.tab-nav {
  display: flex; justify-content: center; gap: 0.5rem;
  margin-bottom: 0.3vh; flex-shrink: 0;
}
.tab-btn {
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 0.25rem 1.1rem; font-size: 0.77rem; font-weight: 600;
  color: var(--muted); cursor: pointer; transition: all 0.2s;
}
.tab-btn:hover { border-color: var(--accent); color: var(--text); }
.tab-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.tab-content { display: none; flex: 1; overflow-y: auto; }
.tab-content.active { display: flex; flex-direction: column; }

/* -- Holidays Tab --------------------------------------------------------- */
.holidays-wrap { padding: 0.6rem 0; }
.holidays-wrap h2 { font-size: 0.94rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 1rem; text-align: center; }

.exchange-section { margin-bottom: 1.1rem; }
.exchange-header {
  display: flex; align-items: center; gap: 0.55rem;
  margin-bottom: 0.44rem; padding-bottom: 0.33rem; border-bottom: 1px solid var(--border);
}
.exchange-header .ex-flag { font-size: 1.21rem; }
.exchange-header .ex-name { font-weight: 700; font-size: 0.99rem; }
.exchange-header .ex-status {
  margin-left: auto; font-size: 0.66rem; font-weight: 700; padding: 0.17rem 0.55rem;
  border-radius: 20px; text-transform: uppercase; letter-spacing: 0.04em;
}
.exchange-header .ex-status.open { background: rgba(34,197,94,0.15); color: var(--green); }
.exchange-header .ex-status.closed { background: rgba(239,68,68,0.1); color: var(--red); }

.holiday-list { list-style: none; }
.holiday-list li {
  display: flex; align-items: center; gap: 0.66rem;
  padding: 0.33rem 0.55rem; font-size: 0.83rem; border-radius: 7px;
}
.holiday-list li:nth-child(even) { background: rgba(255,255,255,0.02); }
.holiday-list li.today { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.25); }
.holiday-list li.next { background: rgba(251,191,36,0.08); border: 1px solid rgba(251,191,36,0.2); }
.holiday-date { width: 110px; color: var(--muted); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.holiday-name { flex: 1; }
.holiday-tag { font-size: 0.66rem; font-weight: 700; padding: 0.11rem 0.39rem; border-radius: 12px; }
.holiday-tag.today-tag { background: rgba(239,68,68,0.15); color: var(--red); }
.holiday-tag.next-tag { background: rgba(251,191,36,0.12); color: var(--gold); }

.exchanges-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.1rem;
}

/* -- News Tab ------------------------------------------------------------- */
.news-wrap { padding: 0.55rem 0; flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.news-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 0.55rem; flex-shrink: 0;
}
.news-header h2 { font-size: 0.94rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin: 0; }
.news-meta { display: flex; align-items: center; gap: 0.55rem; }
.news-update-text { font-size: 0.72rem; color: var(--muted); }
.news-refresh-btn {
  background: var(--surface); border: 1px solid var(--border); border-radius: 7px;
  color: var(--text); font-size: 1.1rem; padding: 0.22rem 0.55rem; cursor: pointer;
  transition: all 0.2s;
}
.news-refresh-btn:hover { border-color: var(--accent); color: var(--accent); }
.news-refresh-btn.spinning { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.news-filters {
  display: flex; gap: 0.33rem; flex-wrap: wrap; margin-bottom: 0.55rem; flex-shrink: 0;
}
.news-filter {
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
  padding: 0.22rem 0.77rem; font-size: 0.72rem; font-weight: 600;
  color: var(--muted); cursor: pointer; transition: all 0.2s;
}
.news-filter:hover { border-color: var(--accent); color: var(--text); }
.news-filter.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.news-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 0.44rem; }
.news-loading { text-align: center; color: var(--muted); padding: 2.2rem; font-size: 0.94rem; }

.news-item {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 0.66rem 0.88rem; transition: border-color 0.2s; display: block;
  text-decoration: none; color: inherit;
}
.news-item:hover { border-color: var(--accent); }
.news-item-top { display: flex; align-items: center; gap: 0.55rem; margin-bottom: 0.22rem; }
.news-source {
  font-size: 0.61rem; font-weight: 700; padding: 0.11rem 0.44rem; border-radius: 12px;
  background: rgba(59,130,246,0.12); color: var(--accent); text-transform: uppercase;
  letter-spacing: 0.03em; white-space: nowrap;
}
.news-time { font-size: 0.66rem; color: var(--muted); margin-left: auto; white-space: nowrap; }
.news-lang-tag {
  font-size: 0.55rem; font-weight: 700; padding: 0.09rem 0.33rem; border-radius: 10px;
  background: rgba(251,191,36,0.15); color: var(--gold); text-transform: uppercase;
}
.news-title { font-size: 0.88rem; font-weight: 600; line-height: 1.3; margin-bottom: 0.17rem; }
.news-desc { font-size: 0.77rem; color: var(--muted); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.news-summary {
  font-size: 0.77rem; color: var(--muted); line-height: 1.4;
  margin-top: 0.28rem; padding-top: 0.28rem; border-top: 1px solid var(--border);
}
.summary-label {
  font-size: 0.61rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--accent); margin-right: 0.33rem;
}
.news-item.has-summary { padding: 0.77rem 0.88rem; }

/* -- Metals Tab ----------------------------------------------------------- */
.metals-wrap { padding: 1.1rem 0; flex: 1; display: flex; flex-direction: column; align-items: center; }
.metals-header {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  margin-bottom: 1.1rem; flex-shrink: 0;
}
.metals-header h2 { font-size: 0.94rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin: 0; }
.metals-meta { display: flex; align-items: center; gap: 0.55rem; }

.metals-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.38rem;
  margin-bottom: 1.38rem; width: 100%;
}

.metal-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 1.65rem 1.38rem 1.1rem; text-align: center; position: relative; overflow: hidden;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.metal-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
}
.metal-card.gold::before { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.metal-card.silver::before { background: linear-gradient(90deg, #94a3b8, #cbd5e1); }
.metal-card.gold { border-color: rgba(251,191,36,0.25); }
.metal-card.gold:hover { border-color: rgba(251,191,36,0.5); box-shadow: 0 0 30px rgba(251,191,36,0.08); }
.metal-card.silver { border-color: rgba(148,163,184,0.25); }
.metal-card.silver:hover { border-color: rgba(148,163,184,0.5); box-shadow: 0 0 30px rgba(148,163,184,0.08); }

.metal-icon { font-size: 2.2rem; margin-bottom: 0.28rem; }
.metal-name {
  font-size: 0.99rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; margin-bottom: 0.55rem;
}
.metal-symbol { font-size: 0.72rem; color: var(--muted); font-weight: 600; margin-left: 0.28rem; }

.metal-price {
  font-size: 2.75rem; font-weight: 800; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums; line-height: 1.1; margin-bottom: 0.37rem;
}
.metal-card.gold .metal-price { color: var(--gold); }
.metal-card.silver .metal-price { color: #cbd5e1; }

.metal-change {
  font-size: 0.99rem; font-weight: 700; margin-bottom: 0.92rem;
  font-variant-numeric: tabular-nums;
}
.metal-change.up { color: var(--green); }
.metal-change.down { color: var(--red); }

.metal-details {
  display: flex; justify-content: space-around; gap: 0.55rem;
  border-top: 1px solid var(--border); padding-top: 0.73rem;
}
.metal-detail { text-align: center; flex: 1; }
.md-label {
  display: block; font-size: 0.66rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 0.17rem;
}
.md-value {
  display: block; font-size: 0.88rem; font-weight: 600; font-variant-numeric: tabular-nums;
}

.ratio-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 1.1rem 1.83rem; text-align: center; margin-bottom: 1.1rem; width: 100%; max-width: 460px;
}
.ratio-label {
  font-size: 0.83rem; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.28rem;
}
.ratio-value {
  font-size: 2.2rem; font-weight: 800; color: var(--accent);
  margin-bottom: 0.28rem; font-variant-numeric: tabular-nums;
}
.ratio-desc { font-size: 0.72rem; color: var(--muted); }

.metals-footer { font-size: 0.66rem; color: var(--muted); text-align: center; margin-top: 0.55rem; }

/* -- Metals live flash ---------------------------------------------------- */
.metal-price.flash-up { animation: flashGreen 0.6s ease-out; }
.metal-price.flash-down { animation: flashRed 0.6s ease-out; }
@keyframes flashGreen {
  0% { background: rgba(34,197,94,0.3); border-radius: 6px; }
  100% { background: transparent; }
}
@keyframes flashRed {
  0% { background: rgba(239,68,68,0.3); border-radius: 6px; }
  100% { background: transparent; }
}
.live-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--green); margin-right: 0.28rem; vertical-align: middle;
  animation: pulse 1.5s ease-in-out infinite;
}
.metals-update-text { font-size: 0.72rem; color: var(--green); font-weight: 600; }

/* -- Metals ticker (gold variant) ----------------------------------------- */
.ticker-metals { border-color: rgba(251,191,36,0.3); }
.ticker-label-gold { background: linear-gradient(135deg, #b8860b, #fbbf24); font-size: 0.77rem; }

/* -- Metals news section in metals tab ------------------------------------ */
.metals-news-section {
  margin-top: 0.92rem; flex: 1; display: flex; flex-direction: column; overflow: hidden; width: 100%;
}
.metals-news-section .news-list {
  flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 0.44rem;
  max-height: 400px;
}


