:root {
  --maroon-950: #200302;
  --maroon-900: #360608;
  --maroon-800: #550a0d;
  --maroon-700: #6f1216;
  --cream-50: #fff9ea;
  --cream-100: #fbefd3;
  --cream-200: #f2dfb8;
  --gold-100: #fff0b8;
  --gold-300: #efc86b;
  --gold-500: #d8a928;
  --gold-700: #93640f;
  --ink: #35100f;
  --muted: #6f5d4d;
  --green: #058455;
  --red: #f1001b;
  --panel-radius: 26px;
  --card-radius: 14px;
  --app-scale: 1;
}

* {
  box-sizing: border-box;
}

section,
article,
nav,
header,
main,
div,
button {
  min-width: 0;
}

html,
body {
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  padding-bottom: 84px;
  color: var(--ink);
  font-family: "Inter", Arial, Helvetica, sans-serif;
  background:
    radial-gradient(circle at 50% -12%, #4b0b0b 0, var(--maroon-950) 46%, #140101 100%);
}

button {
  font: inherit;
}

img {
  max-width: 100%;
}

.phone-shell {
  width: 100%;
  max-width: 740px;
  min-height: 100vh;
  margin: 0 auto;
  background: linear-gradient(180deg, #250303 0%, #4c080b 76%, #5f0b10 100%);
  overflow: hidden;
}

.brand-header {
  min-height: 188px;
  display: grid;
  grid-template-columns: 170px 1fr 62px;
  align-items: center;
  gap: 18px;
  padding: 32px 32px 18px;
  background:
    radial-gradient(circle at 52% 16%, rgba(150, 28, 26, 0.28), transparent 44%),
    linear-gradient(180deg, #210202, #2c0304 58%, #3b0608);
}

.brand-tagline {
  grid-column: 1 / -1;
  margin: 4px 0 0;
  text-align: right;
  color: var(--gold-300);
  font-size: clamp(13px, 2.9vw, 18px);
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.brand-logo-img {
  width: 158px;
  max-width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 8px 8px rgba(0, 0, 0, 0.45));
}

.brand-copy {
  min-width: 0;
}

.brand-copy h1 {
  margin: 0;
  color: transparent;
  font-family: "Cinzel", Georgia, serif;
  font-size: clamp(38px, 7.1vw, 68px);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: 0;
  white-space: nowrap;
  background: linear-gradient(180deg, #fff3bc 2%, #e0b54a 43%, #835712 90%);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.7));
}

.brand-copy h1 span {
  font-size: 0.73em;
}

.brand-copy p {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 10px 0 0;
  padding-top: 0;
  color: #ead18c;
  border-top: 0;
  font-family: "Cinzel", Georgia, serif;
  font-size: clamp(13px, 2.7vw, 22px);
  font-weight: 600;
  letter-spacing: 0.32em;
  white-space: nowrap;
  text-transform: uppercase;
}

.brand-copy p::before,
.brand-copy p::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  max-width: 90px;
  background: linear-gradient(90deg, rgba(216, 169, 40, 0) 0%, rgba(216, 169, 40, 0.85) 50%, rgba(216, 169, 40, 0) 100%);
}

.brand-copy b {
  color: #f7d780;
  font-weight: 500;
}

.icon-button,
.refresh-button {
  border: 0;
  background: transparent;
  color: var(--gold-100);
}

.notify-btn {
  align-self: start;
  justify-self: end;
  padding: 0;
  font-size: 36px;
  color: var(--gold-300);
}

.gold-frame {
  margin: 0 15px 16px;
  padding: 14px;
  border: 2px solid var(--gold-300);
  border-radius: 34px;
  background: linear-gradient(180deg, #fbf2df 0%, #f8ead0 100%);
  box-shadow:
    inset 0 0 0 3px rgba(136, 90, 19, 0.38),
    0 9px 21px rgba(0, 0, 0, 0.55);
}

.rates-panel,
.commodity-panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(157, 101, 17, 0.6);
  border-radius: 21px;
  background: linear-gradient(180deg, #fff9eb, #faedd3);
  box-shadow: inset 0 0 24px rgba(216, 169, 40, 0.22);
}

.rates-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 30px 20px 21px;
}

.rates-title {
  display: flex;
  align-items: center;
  gap: 24px;
  min-width: 0;
}

.rates-title h2,
.commodity-head h2 {
  margin: 0;
  color: #4a0a0b;
  font-size: clamp(24px, 4.1vw, 30px);
  font-weight: 800;
  letter-spacing: 0;
}

.rates-title span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: clamp(16px, 2.5vw, 18px);
  color: #251717;
  font-weight: 500;
}

.rates-title span i,
.commodity-head span i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--red);
}

.rates-time {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 28px;
  color: #261919;
  font-size: clamp(14px, 2.5vw, 18px);
  white-space: nowrap;
}

.refresh-button {
  width: 34px;
  height: 34px;
  padding: 0;
  color: #3b0809;
  font-size: 29px;
  line-height: 1;
}

.refresh-button.spin i {
  display: block;
  animation: spin 0.65s linear;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.rate-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px 12px;
  padding: 0 12px 17px;
}

.rate-card {
  min-width: 0;
  min-height: 157px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-auto-rows: min-content;
  align-content: center;
  justify-items: center;
  text-align: center;
  gap: 8px;
  padding: 16px 10px;
  border: 1px solid rgba(183, 129, 36, 0.68);
  border-radius: var(--card-radius);
  background: linear-gradient(180deg, #fff8e9 0%, #f6e4c0 100%);
  box-shadow: 0 7px 12px rgba(74, 36, 9, 0.18), inset 0 1px 7px rgba(255, 255, 255, 0.7);
}

.rate-media {
  width: 88px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
}

.rate-metal-img {
  width: 84px;
  max-width: 100%;
  max-height: 70px;
  height: auto;
  display: block;
  object-fit: contain;
}

.rate-currency-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 84px;
  max-width: 100%;
  height: 70px;
  font-size: clamp(38px, 9vw, 52px);
  line-height: 1;
  color: var(--gold-500);
}

.rate-card.pulse {
  box-shadow:
    0 0 0 2px rgba(216, 169, 40, 0.72),
    0 9px 18px rgba(74, 36, 9, 0.22),
    inset 0 1px 7px rgba(255, 255, 255, 0.7);
}

.rate-copy h3 {
  margin: 0 0 6px;
  color: #2d1110;
  font-size: clamp(13px, 1.6vw, 18px);
  font-weight: 700;
  line-height: 1.15;
  /*white-space: nowrap;*/
}

.rate-copy {
  min-width: 0;
  width: 100%;
  text-align: center;
}

.rate-copy strong {
  display: block;
  color: #42090b;
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.rate-copy small {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
  color: var(--green);
  font-size: clamp(12px, 1.5vw, 17px);
  font-weight: 600;
}

/* Top rate cards: hide the green LIVE status text. */
.rate-card .rate-copy small {
  display: none;
}

.rate-copy small.same,
.rate-copy small.up {
  color: var(--green);
}

.rate-copy small.down {
  color: var(--red);
}

.rate-up {
  color: var(--green) !important;
}

.rate-down {
  color: var(--red) !important;
}

.rate-same {
  color: #42090b !important;
}

.rate-copy small i {
  font-size: 17px;
}

.market-tabs {
  overflow: hidden;
  min-height: 160px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: stretch;
  margin: 13px 0 12px;
  padding: 16px 0;
  border: 2px solid var(--gold-300);
  border-radius: 20px;
  background: linear-gradient(180deg, #6a0d12 0%, #300404 100%);
  box-shadow: inset 0 0 0 2px rgba(40, 2, 2, 0.72), 0 6px 11px rgba(59, 22, 7, 0.2);
}

.market-tabs.rate-slider-tabs {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.market-tabs button {
  overflow: hidden;
  min-width: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  background: transparent;
  color: #e8c979;
  font-size: clamp(16px, 3.4vw, 24px);
  font-weight: 700;
}

.market-tabs button:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 8px;
  right: 0;
  bottom: 8px;
  width: 1px;
  background: rgba(224, 187, 92, 0.52);
}

.market-tabs i {
  color: #f1d27c;
  font-size: clamp(40px, 8vw, 57px);
  line-height: 0.9;
}

.market-tabs small {
  display: block;
  margin-top: -5px;
  font-size: 0.82em;
  line-height: 1;
}

.tab-metal-img {
  width: 86px;
  max-width: 80%;
  height: auto;
  display: block;
  object-fit: contain;
}

/* Live Rates pill tab bar (screenshot-matched) */
.market-tabs.rate-slider-tabs {
  min-height: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 6px;
  margin: 13px 0 12px;
  padding: 6px;
  border: 2px solid var(--gold-500);
  border-radius: 999px;
  background: linear-gradient(180deg, #f4e3ba 0%, #ecd6a4 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 249, 234, 0.6), 0 4px 10px rgba(59, 22, 7, 0.18);
}

.market-tabs.rate-slider-tabs button {
  flex-direction: row;
  gap: 0;
  padding: 12px 8px;
  border: 2px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--maroon-800);
  font-size: clamp(13px, 2.6vw, 17px);
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
  text-align: center;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.market-tabs.rate-slider-tabs button span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Remove the vertical divider lines for the pill variant */
.market-tabs.rate-slider-tabs button:not(:last-child)::after {
  content: none;
  display: none;
}

.market-tabs.rate-slider-tabs button.active {
  border-color: var(--gold-300);
  background: linear-gradient(180deg, #6f1216 0%, #4a0709 100%);
  color: var(--gold-100);
  box-shadow: 0 2px 6px rgba(40, 2, 2, 0.4);
}

/* ===== Zaveri Bazar disclaimer (expandable, below Buy/Sell table) ===== */
/* Hidden by default; shown only on the Zaveri Bazar (coin) tab. */
.zaveri-disclaimer {
  display: none;
  margin: 12px 0 13px;
  text-align: center;
}

.gold-frame:has(.market-tabs button.active[data-rate-group="coin"]) .zaveri-disclaimer {
  display: block;
}

.zaveri-disclaimer-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 4px 6px;
  color: #000;
  font-size: clamp(13px, 2.6vw, 15px);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  list-style: none;
  -webkit-tap-highlight-color: transparent;
}

.zaveri-disclaimer-link::-webkit-details-marker {
  display: none;
}

.zaveri-disclaimer-link::after {
  content: "\f078";
  font-family: "FontAwesome";
  font-size: 10px;
  transition: transform 0.2s ease;
}

.zaveri-disclaimer[open] .zaveri-disclaimer-link::after {
  transform: rotate(180deg);
}

.zaveri-disclaimer-body {
  margin-top: 8px;
  padding: 14px 16px;
  border: 1px solid var(--gold-300);
  border-radius: var(--card-radius);
  background: linear-gradient(180deg, #fff8e9 0%, #f6e4c0 100%);
  box-shadow: inset 0 1px 6px rgba(255, 255, 255, 0.6);
  color: #000;
  font-size: clamp(12px, 2.5vw, 15px);
  line-height: 1.5;
  text-align: left;
}

.zaveri-disclaimer-body p {
  margin: 0 0 8px;
}

.zaveri-disclaimer-body p:last-child {
  margin-bottom: 0;
}

.zaveri-disclaimer-body strong {
  color: #000;
}

.commodity-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 0 20px;
  background: linear-gradient(180deg, #5c0b10, #3c0608);
}

.commodity-head h2 {
  color: #fff4d9;
  font-size: clamp(19px, 3.7vw, 26px);
}

.commodity-head span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fff4d9;
  font-size: clamp(16px, 3.2vw, 22px);
  font-weight: 700;
}

.commodity-head span i {
  background: #42be72;
}

/* Three-column Commodity Rates header aligned with the data rows */
.commodity-head.commodity-head-cols {
  display: grid;
  grid-template-columns: 40% 30% 30%;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
}

.commodity-head-title-hidden {
  display: none !important;
}

.commodity-head .commodity-head-col {
  display: block;
  color: #fff4d9;
  font-size: clamp(13px, 2.6vw, 18px);
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.commodity-head .commodity-head-products {
  text-align: left;
}

.commodity-head .commodity-head-buy,
.commodity-head .commodity-head-sell {
  text-align: center;
}

/* Coin (Zaveri Bazar) header labels are hidden on Gold/Silver tabs. */
.commodity-head .commodity-head-coin-product,
.commodity-head .commodity-head-coin-sell {
  display: none;
}

/* ===== Future Rates section (Gold Future & Silver Future) ===== */
.futures-panel {
  margin-top: 16px;
}

.commodity-head.futures-head {
  justify-content: center;
}

.commodity-head .futures-title {
  width: 100%;
  text-align: center;
  color: #fff4d9;
  font-weight: 800;
  letter-spacing: 0.04em;
}

/* Column header row: COMMODITY / BUY / SELL */
.commodity-head.commodity-head-cols.futures-head-cols {
  min-height: 0;
  margin: 12px 11px 0;
  padding: 12px 12px;
  border-radius: 14px;
  background: linear-gradient(180deg, #fff8e9 0%, #f6e4c0 100%);
}

.commodity-head.futures-head-cols .commodity-head-col {
  color: #3d0709;
  font-weight: 800;
}

.commodity-head.futures-head-cols .futures-head-commodity {
  text-align: left;
}

.commodity-head.futures-head-cols .futures-head-buy,
.commodity-head.futures-head-cols .futures-head-sell {
  text-align: center;
}

/* Data cards */
.futures-list {
  padding: 12px 11px 12px;
}

.commodity-row.futures-row {
  min-height: 70px;
  margin-bottom: 12px;
  padding: 12px 12px;
  border: 1px solid rgba(183, 129, 36, 0.5);
  border-radius: 14px;
  background: linear-gradient(180deg, #f3e6c9 0%, #e7d3ab 100%);
  box-shadow: 0 4px 10px rgba(74, 36, 9, 0.14), inset 0 1px 6px rgba(255, 255, 255, 0.6);
  cursor: default;
}

.commodity-row.futures-row:last-child {
  margin-bottom: 0;
}

.futures-row .futures-name b {
  font-size: clamp(16px, 3.1vw, 22px);
  white-space: normal;
}

/* Zaveri Bazar (coin) tab: two-column header (PRODUCT 60% / Sell 40%)
   aligned with the coin data rows. Scoped via the active tab's rate group. */
.gold-frame:has(.market-tabs button.active[data-rate-group="coin"]) .commodity-head.commodity-head-cols {
  grid-template-columns: 60% 40%;
  gap: 8px;
  padding: 0 16px;
}

.gold-frame:has(.market-tabs button.active[data-rate-group="coin"]) .commodity-head .commodity-head-title-hidden,
.gold-frame:has(.market-tabs button.active[data-rate-group="coin"]) .commodity-head .commodity-head-products,
.gold-frame:has(.market-tabs button.active[data-rate-group="coin"]) .commodity-head .commodity-head-buy,
.gold-frame:has(.market-tabs button.active[data-rate-group="coin"]) .commodity-head .commodity-head-sell {
  display: none !important;
}

.gold-frame:has(.market-tabs button.active[data-rate-group="coin"]) .commodity-head .commodity-head-coin-product {
  display: block;
  text-align: left;
}

.gold-frame:has(.market-tabs button.active[data-rate-group="coin"]) .commodity-head .commodity-head-coin-sell {
  display: block;
  text-align: right;
}

.commodity-list {
  padding: 11px 11px 5px;
  background: linear-gradient(180deg, #fff7e7, #f9ebd1);
}

.commodity-empty {
  padding: 22px 10px;
  color: #3d0709;
  font-size: clamp(14px, 2.6vw, 18px);
  font-weight: 700;
  text-align: center;
}

.commodity-row {
  overflow: hidden;
  min-width: 0;
  width: 100%;
  min-height: 88px;
  display: grid;
  grid-template-columns: 40% 30% 30%;
  align-items: center;
  gap: 8px;
  padding: 9px 5px;
  border: 0;
  border-bottom: 1px solid rgba(110, 80, 38, 0.14);
  background: transparent;
  text-align: left;
  color: var(--ink);
}

.commodity-row:last-child {
  border-bottom: 0;
}

/* Zaveri Bazar (coin) rows: product name (60%) + Sell rate (40%) */
.commodity-row.commodity-row-coin {
  grid-template-columns: 60% 40%;
}

.commodity-row.commodity-row-coin .commodity-col-sell {
  align-items: flex-end;
  text-align: right;
}

.coin {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 26px;
  font-weight: 500;
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.55), inset 0 -2px 3px rgba(0, 0, 0, 0.16);
}

.coin.au {
  color: #fff9d7;
  background: linear-gradient(135deg, #f9d36c, #c99a2b);
  border: 1px solid #b27a13;
}

.coin.ag {
  color: #ffffff;
  background: linear-gradient(135deg, #aaaeb3, #656a70);
  border: 1px solid #656a70;
}

.commodity-name {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.commodity-name-text {
  min-width: 0;
}

.commodity-name b {
  display: block;
  overflow: hidden;
  color: #191412;
  font-size: clamp(17px, 3.2vw, 22px);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.commodity-name small {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 6px;
  color: var(--green);
  font-size: clamp(12px, 2.4vw, 16px);
  font-weight: 800;
}

.commodity-name small i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
}

/* Product Buy/Sell table: hide the Au/Ag symbol and the LIVE status text. */
.commodity-row:not(.commodity-row-coin) .commodity-name .coin,
.commodity-row:not(.commodity-row-coin) .commodity-name-text small {
  display: none;
}

/* Zaveri Bazar (coin) rows: hide the LIVE status text and the Au/Ag symbol. */
.commodity-row.commodity-row-coin .commodity-name-text small,
.commodity-row.commodity-row-coin .commodity-name .coin {
  display: none;
}

.commodity-col {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 4px;
}

.commodity-rate {
  display: block;
  color: #3d0709;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
}

.commodity-rate small {
  display: block;
  margin-bottom: 2px;
  color: #271817;
  font-size: clamp(11px, 2vw, 14px);
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* Product Buy/Sell table: hide the "Buy"/"Sell" labels above the rate values.
   (Coin rows keep their "Ask" label; futures rows have no label.) */
.commodity-row:not(.commodity-row-coin):not(.futures-row) .commodity-rate small {
  display: none;
}


/* Product Buy/Sell: render each product as an individual card
   (same style as the Future Rates cards). */
.commodity-row:not(.commodity-row-coin):not(.futures-row) {
  min-height: 70px;
  margin-bottom: 12px;
  padding: 12px 12px;
  border: 1px solid rgba(183, 129, 36, 0.5);
  border-bottom: 1px solid rgba(183, 129, 36, 0.5);
  border-radius: 14px;
  background: linear-gradient(180deg, #f3e6c9 0%, #e7d3ab 100%);
  box-shadow: 0 4px 10px rgba(74, 36, 9, 0.14), inset 0 1px 6px rgba(255, 255, 255, 0.6);
}

.commodity-row:not(.commodity-row-coin):not(.futures-row):last-child {
  margin-bottom: 0;
}

/* Give the list card-style breathing room (matches futures-list). */
.gold-frame:not(:has(.market-tabs button.active[data-rate-group="coin"])) #premiumCommodityList {
  padding: 12px 11px 12px;
}

.commodity-hl {
  display: block;
  color: #6f5d4d;
  font-size: clamp(11px, 2.1vw, 15px);
  font-weight: 600;
  line-height: 1.1;
  white-space: nowrap;
}

.trust-banner {
  min-height: 152px;
  display: grid;
  grid-template-columns: 150px 1fr 215px;
  align-items: center;
  gap: 15px;
  margin-top: 13px;
  padding: 16px 23px;
  border: 1px solid rgba(237, 198, 93, 0.7);
  border-radius: 20px;
  background:
    radial-gradient(circle at 86% 26%, rgba(145, 28, 21, 0.45), transparent 34%),
    linear-gradient(180deg, #5c0a10, #250202);
  overflow: hidden;
}

.trust-logo-img {
  width: 119px;
  max-width: 100%;
  height: auto;
  display: block;
}

.trust-copy h2 {
  margin: 0;
  color: transparent;
  font-family: "Cinzel", Georgia, serif;
  font-size: clamp(25px, 4.7vw, 34px);
  font-weight: 900;
  line-height: 1.18;
  background: linear-gradient(180deg, #fff0ad 0%, #e4bd55 60%, #9d6e18 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

.trust-copy p {
  margin: 15px 0 0;
  color: #f4d887;
  font-size: clamp(13px, 2.3vw, 18px);
  font-weight: 600;
  white-space: nowrap;
}

.trust-gold {
  position: relative;
  height: 118px;
  min-width: 0;
}

.trust-gold-img {
  position: absolute;
  left: 0;
  bottom: 4px;
  width: 154px;
  height: auto;
  display: block;
}

.quality-badge-img {
  position: absolute;
  right: 3px;
  top: 6px;
  width: 66px;
  height: auto;
  display: block;
}

.bottom-nav {
  position: fixed;
  right: auto;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  transform-origin: bottom center;
  z-index: 100;
  min-height: 72px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: center;
  width: 100%;
  max-width: 740px;
  margin: 0 auto;
  padding: 4px 21px calc(5px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(224, 187, 92, 0.28);
  background: linear-gradient(180deg, #681016, #46080c);
}

.bottom-nav button {
  height: 60px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 0;
  background: transparent;
  color: rgba(248, 224, 154, 0.82);
  font-size: clamp(13px, 2.5vw, 18px);
  font-weight: 500;
}

.bottom-nav i {
  color: inherit;
  font-size: clamp(28px, 5.5vw, 38px);
  line-height: 1;
}

.bottom-nav button.active {
  color: #ffe58d;
}

.bottom-nav button.active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 6px;
  transform: translateX(-50%);
  width: min(46px, 70%);
  height: 3px;
  border-radius: 999px;
  background: #ffdf6a;
}

/* Menu (More) footer item never shows the active underline indicator. */
.bottom-nav button.second-nav-toggler.active::after {
  content: none;
  display: none;
}

.detail-modal {
  border: 1px solid var(--gold-500);
  border-radius: 18px;
  background: linear-gradient(180deg, #fff9eb, #f6e5c3);
}

.detail-modal .modal-title {
  font-weight: 800;
  color: var(--ink);
}

.detail-modal .modal-body > div {
  display: flex;
  justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px dashed rgba(80, 40, 10, 0.18);
}

.detail-modal .modal-body > div:last-child {
  border-bottom: 0;
}

.legacy-live-targets {
  display: none;
}

@media (max-width: 620px) {
  .phone-shell {
    width: 100%;
    max-width: none;
  }

  .bottom-nav {
    left: 50%;
    width: 100%;
    max-width: none;
    transform: translateX(-50%);
  }

  body {
    padding-bottom: 66px;
  }

  .brand-header {
    min-height: 128px;
    grid-template-columns: 96px minmax(0, 1fr) 34px;
    gap: 8px;
    padding: 17px 14px 10px;
  }

  .brand-logo-img {
    width: 86px;
  }

  .brand-copy h1 {
    font-size: clamp(30px, 9vw, 43px);
  }

  .brand-copy p {
    gap: 8px;
    margin-top: 6px;
    padding-top: 0;
    font-size: clamp(10px, 2.6vw, 14px);
    letter-spacing: 0.22em;
  }

  .brand-copy p::before,
  .brand-copy p::after {
    max-width: 48px;
  }

  .notify-btn {
    font-size: 24px;
  }

  .gold-frame {
    margin: 0 6px 10px;
    padding: 6px;
    border-radius: 25px;
  }

  .rates-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    padding: 17px 10px 13px;
    gap: 8px;
  }

  .rates-title {
    gap: 8px;
    min-width: 0;
    flex: 1 1 auto;
  }

  .rates-title h2 {
    font-size: 20px;
  }

  .rates-title span,
  .rates-time {
    font-size: 12px;
  }

  .rates-time {
    width: auto;
    flex: 0 0 auto;
    gap: 10px;
    justify-content: flex-end;
  }

  .rates-time time {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .refresh-button {
    width: 25px;
    height: 25px;
    font-size: 22px;
  }

  .rate-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px 5px;
    padding: 0 7px 11px;
  }

  .rate-card {
    min-height: 108px;
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
    padding: 8px 3px;
  }

  .rate-media {
    width: 40px;
    height: 34px;
  }

  .rate-metal-img {
    width: 40px;
    max-width: 100%;
    max-height: 34px;
  }

  .rate-currency-icon {
    width: 40px;
    height: 34px;
    font-size: 30px;
  }

  .rate-copy h3 {
    margin-bottom: 4px;
    font-size: clamp(9px, 2.4vw, 12px);
  }

  /* .rate-copy strong {
    font-size: clamp(12px, 3.4vw, 18px);
  } */

  .rate-copy small {
    gap: 2px;
    margin-top: 6px;
    font-size: clamp(9px, 2.3vw, 12px);
  }

  .rate-copy small i {
    font-size: 10px;
  }

  .market-tabs {
    grid-template-columns: repeat(5, 1fr);
    min-height: 104px;
    margin: 9px 0;
    padding: 8px 0;
    border-radius: 16px;
  }

  .market-tabs button {
    gap: 4px;
    padding-inline: 1px;
    font-size: 12px;
    line-height: 2;
  }

  .market-tabs i {
    font-size: 34px;
  }

  .market-tabs.rate-slider-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    min-height: 0;
    gap: 4px;
    margin: 9px 0;
    padding: 4px;
    border-radius: 999px;
  }

  .market-tabs.rate-slider-tabs button {
    gap: 0;
    padding: 9px 4px;
    font-size: clamp(10px, 3vw, 13px);
    line-height: 1.15;
  }

  .tab-metal-img {
    width: 50px;
  }

  .commodity-head {
    min-height: 43px;
    padding: 0 12px;
  }

  .commodity-head.commodity-head-cols {
    gap: 4px;
    padding: 0 11px 0 9px;
  }

  .commodity-head.commodity-head-cols.futures-head-cols {
    gap: 4px;
    margin: 10px 7px 0;
    padding: 10px 9px;
  }

  .gold-frame:has(.market-tabs button.active[data-rate-group="coin"]) .commodity-head.commodity-head-cols {
    gap: 4px;
    padding: 0 11px 0 9px;
  }

  .commodity-head h2 {
    font-size: 17px;
  }

  .commodity-head span {
    font-size: 11px;
  }

  .commodity-head .commodity-head-col {
    font-size: clamp(10px, 2.8vw, 13px);
  }

  .commodity-list {
    padding: 8px 7px 3px;
  }

  .commodity-row {
    min-height: 70px;
    grid-template-columns: 40% 30% 30%;
    gap: 4px;
    padding: 7px 4px 7px 2px;
  }

  .commodity-name {
    gap: 6px;
  }

  .coin {
    width: 30px;
    height: 30px;
    font-size: 14px;
  }

  .commodity-name b {
    overflow: visible;
    font-size: 12px;
    line-height: 1.16;
    text-overflow: clip;
    white-space: normal;
  }

  .commodity-name small {
    gap: 5px;
    margin-top: 5px;
    font-size: 10px;
  }

  /* .commodity-rate {
    font-size: clamp(12px, 3.6vw, 16px);
  } */

  .commodity-rate small {
    margin-bottom: 1px;
    font-size: clamp(8px, 2.6vw, 11px);
  }

  .commodity-hl {
    font-size: clamp(9px, 2.7vw, 12px);
  }

  .trust-banner {
    min-height: 103px;
    grid-template-columns: 72px minmax(0, 1fr) 100px;
    gap: 7px;
    padding: 10px 9px;
  }

  .trust-logo-img {
    width: 68px;
  }

  .trust-copy h2 {
    font-size: 20px;
    line-height: 1.1;
  }

  .trust-copy p {
    margin-top: 7px;
    font-size: 10px;
    line-height: 1.25;
    white-space: normal;
  }

  .trust-gold {
    height: 78px;
  }

  .trust-gold-img {
    width: 88px;
    bottom: 2px;
  }

  .quality-badge-img {
    top: 3px;
    width: 38px;
  }

  .bottom-nav {
    min-height: 62px;
    padding-inline: 8px;
  }

  .bottom-nav button {
    height: 54px;
    gap: 3px;
    font-size: 8px;
    padding-inline: 0;
  }

  .bottom-nav i {
    font-size: 18px;
  }

  .bottom-nav button.active::after {
    bottom: 5px;
    width: min(42px, 74%);
  }
}

@media (max-width: 360px) {
  .rate-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px 4px;
  }

  .rate-card {
    grid-template-columns: minmax(0, 1fr);
    padding: 7px 2px;
  }

  .rate-media {
    width: 34px;
    height: 30px;
  }

  .rate-metal-img {
    width: 34px;
    max-height: 30px;
  }

  .rate-currency-icon {
    width: 34px;
    height: 30px;
    font-size: 26px;
  }

  .rate-copy h3 {
    font-size: 10px;
  }
/* 
  .rate-copy strong {
    font-size: 14px;
  } */

  .commodity-row {
    grid-template-columns: 40% 30% 30%;
    padding: 7px 4px 7px 2px;
  }

  /* .commodity-rate {
    font-size: clamp(11px, 4vw, 15px);
  } */

  .commodity-rate small {
    font-size: clamp(8px, 2.8vw, 10px);
  }

  .commodity-hl {
    font-size: clamp(8px, 3vw, 11px);
  }
}


/* Consistent table typography across desktop and mobile. */
.commodity-panel .commodity-row .commodity-rate { font-size: 24px; }
/* Fractional tracks account for gaps without overflowing the table frame. */
.commodity-panel .commodity-row {
  grid-template-columns: minmax(0, 4fr) minmax(0, 3fr) minmax(0, 3fr);
}
.commodity-panel .commodity-row.commodity-row-coin {
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
}
.commodity-panel .commodity-rate {
  white-space: normal;
  overflow-wrap: anywhere;
}
