:root {
  color-scheme: dark;
  --page-bg: #080807;
  --panel-bg: #10100e;
  --gold: #f6ce58;
  --gold-border: #bb8a25;
  --gold-muted: #d6c399;
  --text: #f5f4ef;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page-bg) url("../images/gold-waves.svg") center top / 1600px 900px no-repeat;
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 20px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

body.gold-live-page {
  background-color: #000;
  background-image: url("../images/gold-bulls-background-hd.png");
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

.live-background-motion {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.live-background-motion[hidden] { display: none; }
.live-background-image {
  position: absolute;
  inset: -24px;
  background-color: #000;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

.rates-page {
  width: 970px;
  max-width: calc(100% - 32px);
  margin: 0 auto;
  padding-bottom: 32px;
}

.gold-live-page .rates-page { flex: 1; padding-top: 10px; }
.gold-live-page .rates-table td.product-name { overflow: hidden; text-overflow: ellipsis; }
.rate-action { display: block; color: inherit; text-decoration: none; border-radius: 3px; }
.rate-action:hover { color: inherit; text-decoration: underline; text-underline-offset: 4px; }
.rate-action:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
.rate-action[aria-disabled='true'] { color: var(--gold-muted); cursor: default; }
.live-feed-status { margin: 6px 0 2px; color: var(--gold-muted); font-size: 20px; }
.live-feed-status.feed-error { color: var(--down); }
.rates-table td.live-table-message { text-align: center; color: var(--gold-muted); font-weight: 400; font-size: 20px; }

.brand {
  padding: 18px 0 14px;
}

.brand-logo {
  display: block;
  width: 168px;
  height: 132px;
  object-fit: contain;
}

.welcome {
  min-height: 38px;
  gap: 24px;
  padding: 8px 18px;
  margin-bottom: 15px;
  border: 1px solid #e4b143;
  border-radius: 7px;
  background: linear-gradient(105deg, #cb8d17 0%, #ffe789 43%, #f5ca55 65%, #cb8d17 100%);
  color: #15120b;
}

.welcome h1 {
  font-size: 20px;
  font-weight: 400;
  letter-spacing: 2px;
  text-align: center;
  text-transform: uppercase;
}

.welcome strong { font-weight: 700; }
.welcome-line { width: 46px; height: 1px; background: #5a3d0e; }

.market-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}

.market-table td { padding: 0 6px; vertical-align: top; }
.market-table td:first-child { padding-left: 0; }
.market-table td:last-child { padding-right: 0; }

.market-quote {
  padding: 12px 14px 10px;
  border: 1px solid var(--gold-border);
  border-radius: 9px;
  background: radial-gradient(ellipse at 0 0, #5c401a 0%, transparent 58%), var(--panel-bg);
  text-align: center;
}

.market-name { min-height: 30px; }
.market-name h2 { color: var(--gold); font-size: 20px; font-weight: 700; text-transform: uppercase; }
.market-icon { width: 25px; height: 23px; flex-shrink: 0; }
.gold-icon { color: #f6cf62; }
.silver-icon { color: #e6e7e8; }
.rupee-icon { display: inline-flex; align-items: center; justify-content: center; width: 23px; height: 23px; border-radius: 50%; background: var(--gold); color: #16120b; font-size: 22px; font-weight: 700; }
.market-price { padding: 5px 0 8px; font-size: 28px; font-weight: 700; line-height: 1.3; font-variant-numeric: tabular-nums; }
.market-range { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; padding-top: 7px; border-top: 1px solid #514125; font-size: 20px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.market-range b { color: var(--gold); font-weight: 400; }
.market-range span + span { border-left: 1px solid #7c612d; padding-left: 14px; }

.bullion-section { margin-top: 10px; }
.section-label { padding-bottom: 4px; }
.section-label h2 { font-size: 22px; font-weight: 700; }
.sample-label { color: var(--gold-muted); font-size: 20px; }
.rates-scroll { scrollbar-color: var(--gold-border) #15130e; }
.rates-scroll:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }

/* The desktop table is exactly 970px; small screens scroll its compact columns. */
.rates-table {
  width: 970px;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0 7px;
  font-variant-numeric: tabular-nums;
}

.product-column { width: 38%; }
.price-column { width: 17%; }
.range-column { width: 14%; }
.rates-table th { padding: 8px 12px; background: linear-gradient(180deg, #f1d175, #cf9b32); color: #19140a; font-size: 20px; font-weight: 700; text-align: center; text-transform: uppercase; letter-spacing: .4px; }
.rates-table th:first-child { border-radius: 6px 0 0 6px; padding-left: 13px; text-align: left; }
.rates-table th:last-child { border-radius: 0 6px 6px 0; }
/* A continuous gold-lit outline across the existing five table cells. */
.rates-table tbody tr { position: relative; }
.rates-table tbody tr::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 8px;
  pointer-events: none;
  box-shadow: inset 0 0 4px #ffe581a6, 0 0 3px #efbf3c73;
}
.rates-table td {
  height: 49px;
  padding: 8px 12px;
  border-top: 1px solid #ffda62;
  border-bottom: 1px solid #f2c440;
  background: linear-gradient(180deg, #171309, #080807 45%, #0c0b08);
  box-shadow: none;
  text-align: right;
  vertical-align: middle;
  white-space: nowrap;
}
.rates-table td:first-child {
  border-left: 1px solid #ffda62;
  border-radius: 8px 0 0 8px;
  background: radial-gradient(ellipse at left top, #bb7b288c, transparent 64%), linear-gradient(105deg, #1e160c, #080807 72%);
  text-align: left;
}
.rates-table td:last-child {
  border-right: 1px solid #ffda62;
  border-radius: 0 8px 8px 0;
  background: radial-gradient(ellipse at right top, #c88b2ca6, transparent 76%), linear-gradient(100deg, #080807, #31220c);
}
.rates-table tbody tr:hover::after { box-shadow: inset 0 0 5px #ffe581bf, 0 0 4px #ffd85b80; }
.product-name { font-size: 20px; font-weight: 700; text-transform: uppercase; }
.rate-value { color: #fff; font-size: 22px; font-weight: 700; }
.sell-value { color: #fff; }
.range-value { color: #fff; font-size: 22px; }

/* Reserve the same space in every state so live comparisons never resize rows. */
.rates-table .rate-pill {
  display: block;
  height: 30px;
  padding: 1px 4px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: #fff;
  line-height: 26px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.rates-table .rate-pill.is-up { background: #198754; }
.rates-table .rate-pill.is-down { background: #dc3545; }

@media (max-width: 1001px) {
  .rates-table { width: 970px; min-width: 970px; }
}

@media (max-width: 600px) {
  body.gold-live-page { background-image: url("../images/gold-bulls-background-mobile-hd.png"); }
  .rates-page { max-width: calc(100% - 24px); }
  .brand { padding: 14px 0 12px; }
  .brand-logo { width: 146px; height: 115px; }
  .welcome { gap: 10px; padding-inline: 10px; margin-bottom: 12px; }
  .welcome h1 { font-size: 20px; letter-spacing: 1px; }
  .welcome-line { width: 18px; }
  .market-table td { padding-inline: 3px; }
  .market-quote { padding: 10px 5px 8px; border-radius: 7px; }
  .market-name { flex-direction: column; gap: 5px !important; }
  .market-name h2 { font-size: 20px; }
  .market-price { font-size: 22px; padding: 7px 0; }
  .market-range { white-space: normal; flex-direction: column; gap: 3px; font-size: 20px; }
  .market-range span + span { padding-left: 0; border-left: 0; }
  .rates-table td, .rates-table th { padding-inline: 12px; }
}
