.spot-page[data-metal="AG"] {
  --spot-accent: var(--spot-silver);
  --spot-accent-action: #48484f;
}

.spot-page[data-metal="PT"] {
  --spot-accent: var(--spot-platinum);
  --spot-accent-action: #425661;
}

.spot-page[data-metal="PD"] {
  --spot-accent: var(--spot-palladium);
  --spot-accent-action: #57476f;
}

.spot-page a:focus-visible,
.spot-page button:focus-visible,
.spot-page input:focus-visible,
#spot-chart:focus-visible {
  outline: 2px solid var(--spot-focus);
  outline-offset: 3px;
}

.spot-skip-link {
  position: fixed;
  z-index: 100;
  top: -80px;
  left: 12px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 16px;
  border-radius: 10px;
  background: #765b14;
  color: #ffffff;
  font-weight: 600;
  text-decoration: none;
}

.spot-skip-link:focus { top: 12px; }

.shell-header {
  position: relative;
  z-index: 30;
  min-width: 0;
  min-height: 64px;
  display: grid;
  grid-template-columns: minmax(178px, 1fr) 960px minmax(178px, 1fr);
  align-items: stretch;
  border-bottom: 1px solid var(--spot-border);
  background: #050505;
}

.brand {
  grid-column: 1;
  justify-self: start;
  min-width: 0;
  display: flex;
  align-items: center;
  padding: 7px 18px;
}

.brand img {
  width: 148px;
  max-width: 100%;
  height: 48px;
  display: block;
  object-fit: contain;
}
.brand picture { display: block; line-height: 0; }

.primary-nav {
  grid-column: 2;
  justify-self: center;
  width: 960px;
  height: 64px;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: center;
  gap: 4px;
  padding: 6px;
}

.primary-nav a {
  width: 100%;
  min-width: 0;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 7px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
}
.primary-nav .ui-icon { width: 22px; height: 22px; }

.primary-nav a:hover { border-color: var(--spot-border); background: #181819; }

.primary-nav a[aria-current="page"] {
  background: var(--spot-gold-action);
  border-color: #9f812c;
  color: #ffffff;
  font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--spot-gold);
}

.primary-nav a[aria-current="page"]:hover { background: #8e6f1b; }

.primary-nav a[aria-disabled="true"] {
  pointer-events: none;
  cursor: not-allowed;
  background: #0a0a0b;
  color: var(--spot-silver);
}

.primary-nav a[aria-disabled="true"] .ui-icon { opacity: 0.58; }

.header-actions {
  grid-column: 3;
  justify-self: end;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px 6px 8px;
}

.icon-button,
.avatar,
.drawer-heading button,
.account-menu :is(a, button) {
  min-height: 48px;
  border: 1px solid var(--spot-border);
  border-radius: 11px;
  background: var(--spot-control);
  color: #ffffff;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}

.icon-button:hover,
.avatar:hover,
.drawer-heading button:hover,
.account-menu :is(a, button):hover { border-color: #5a5a60; background: #222225; }

.icon-button {
  position: relative;
  width: 50px;
  padding: 0;
  display: grid;
  place-items: center;
}

.notification-count {
  position: absolute;
  top: -5px;
  right: -4px;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  border: 2px solid #050505;
  border-radius: 999px;
  background: #a93d35;
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}

.avatar {
  width: 50px;
  padding: 2px;
  border-color: var(--spot-gold);
  border-radius: 999px;
  background: #0d0d0e;
}

.avatar-image {
  width: 44px;
  height: 44px;
  display: block;
  border-radius: 999px;
  object-fit: cover;
}

.notification-drawer,
.account-menu {
  position: absolute;
  z-index: 40;
  top: 70px;
  right: 14px;
  width: min(380px, calc(100vw - 28px));
  padding: 12px;
  border: 1px solid var(--spot-border-strong);
  border-radius: 14px;
  background: #111113;
  box-shadow: var(--spot-shadow);
}

.notification-drawer[hidden],
.account-menu[hidden] { display: none; }

.account-menu[data-anchor="footer"] {
  position: fixed;
  top: auto;
  right: 8px;
  bottom: calc(var(--spot-footer-height) + env(safe-area-inset-bottom) + 8px);
}

.drawer-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.drawer-heading h2 { margin: 0; color: #ffffff; font-size: 1.05rem; }
.drawer-heading button { padding: 0 14px; }

.notification-list {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.notification-list li { border-top: 1px solid var(--spot-border); }
.notification-record { padding: 8px 0; }

.notification-item {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 18px;
  align-items: center;
  min-height: 60px;
  gap: 10px;
  padding: 10px 8px;
  border-radius: 8px;
  color: #ffffff;
  text-decoration: none;
}

.notification-item:hover { background: #1a1a1d; }

.notification-copy { display: grid; gap: 3px; min-width: 0; }
.notification-copy strong { color: #ffffff; font-size: 0.94rem; line-height: 1.25; overflow-wrap: anywhere; }
.notification-copy > span { color: var(--spot-muted); font-size: 0.82rem; line-height: 1.35; overflow-wrap: anywhere; }
.notification-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 0 8px 4px 38px; }
.notification-action { min-height: 44px; padding: 0 10px; gap: 7px; white-space: nowrap; font-size: 0.82rem; color: #ffffff; }
.notification-action.primary { border-color: var(--spot-gold); background: var(--spot-gold-action); color: #ffffff; }
.notification-empty { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 10px; align-items: start; padding: 18px 8px 12px; color: #ffffff; }
.notification-empty div { display: grid; gap: 4px; }
.notification-empty span { color: var(--spot-muted); font-size: 0.84rem; line-height: 1.4; }
.notification-record.is-read { opacity: 0.76; }

.account-menu {
  width: min(260px, calc(100vw - 28px));
  display: grid;
  gap: 6px;
}

.account-menu :is(a, button) {
  width: 100%;
  display: flex;
  align-items: center;
  padding: 0 16px;
  justify-content: flex-start;
  color: #ffffff;
  text-align: left;
  text-decoration: none;
}

.market-tray {
  min-width: 0;
  min-height: 46px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 5px 18px;
  border-bottom: 1px solid var(--spot-border);
  background: #080809;
}

.market-icon { width: 22px; height: 22px; }

.market-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: center;
  column-gap: 16px;
}
.market-grid.is-auto-scrolling { scroll-behavior: auto; }
.market-item[data-ticker-clone] { pointer-events: none; }

.market-item {
  min-width: 0;
  min-height: 36px;
  display: grid;
  grid-template-columns: max-content max-content;
  align-items: center;
  justify-content: center;
  column-gap: 12px;
  padding: 4px 8px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 9px;
  color: #ffffff;
  text-decoration: none;
  white-space: nowrap;
}

.market-item:hover { border-color: var(--spot-border-strong); background: #131315; }
.market-item[aria-current="page"] { border-color: var(--spot-accent); background: #131315; }
.market-item strong { display: inline-flex; align-items: baseline; gap: 5px; overflow: hidden; color: #ffffff; font-size: 0.98rem; font-variant-numeric: tabular-nums; line-height: 1.2; text-overflow: ellipsis; }
.market-label { letter-spacing: 0.03em; }
.market-price { color: #ffffff; }
.market-item.metal-gold .market-label { color: var(--spot-gold); }
.market-item.metal-silver .market-label { color: var(--spot-silver); }
.market-item.metal-platinum .market-label { color: var(--spot-platinum); }
.market-item.metal-palladium .market-label { color: var(--spot-palladium); }
.market-item small { min-width: 0; display: inline-flex; align-items: center; gap: 4px; overflow: hidden; color: var(--spot-green); font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.2; text-overflow: ellipsis; }

.trend-icon {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  display: block;
  filter: brightness(0) saturate(100%) invert(73%) sepia(78%) saturate(460%) hue-rotate(75deg) brightness(96%) contrast(91%);
}

.global-search {
  width: 100%;
  max-width: var(--canvas-max);
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin: 8px auto;
  padding: 0 var(--canvas-gutter);
}

.global-search input {
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid var(--spot-border-strong);
  border-radius: 12px;
  background: #0c0c0d;
  color: #ffffff;
}

.global-search input::placeholder { color: #8d8d94; }

.spot-shell {
  width: 100%;
  max-width: var(--canvas-max);
  margin: 0 auto;
  padding: 8px var(--canvas-gutter) 32px;
}

.spot-hero {
  display: grid;
  grid-template-columns: minmax(320px, 0.82fr) minmax(620px, 1.38fr);
  align-items: stretch;
  gap: 12px;
}

.spot-hero-copy,
.spot-quote-card,
.spot-panel,
.spot-stat-section,
.spot-disclosure {
  border: 1px solid var(--spot-border);
  border-radius: var(--spot-radius);
  background: var(--spot-surface);
  box-shadow: var(--spot-shadow);
}

.spot-hero-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px;
}

.spot-eyebrow,
.spot-kicker {
  margin: 0 0 6px;
  color: var(--spot-accent);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.spot-hero h1 {
  margin: 0;
  color: #ffffff;
  font-size: clamp(1.9rem, 3vw, 2.7rem);
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.spot-intro {
  max-width: 380px;
  margin: 6px 0 0;
  color: var(--spot-muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.spot-quote-card {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-content: start;
  align-items: center;
  gap: 12px 18px;
  padding: 20px 22px;
  border-color: var(--spot-border-strong);
  box-shadow: inset 0 3px 0 var(--spot-accent), var(--spot-shadow);
}

.spot-quote-heading,
.spot-panel-heading,
.spot-section-heading,
.spot-chart-legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.spot-quote-heading > span:first-child {
  color: var(--spot-muted);
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
}

.spot-quote-heading { grid-column: 1 / -1; }

.spot-quote-main {
  min-width: 0;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 10px;
}

.spot-quote-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.spot-source-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid #6e5a21;
  border-radius: 999px;
  background: #2a2416;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

.spot-quote-value {
  color: #ffffff;
  font-size: clamp(2rem, 3.45vw, 3.15rem);
  font-variant-numeric: tabular-nums;
  line-height: 1.04;
  letter-spacing: -0.045em;
  white-space: nowrap;
}

.spot-quote-meta {
  color: var(--spot-muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.spot-positive {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: #1f6f34;
  color: #ffffff;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.spot-dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.spot-market-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  grid-column: 1 / -1;
  margin: 4px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--spot-border);
}

.spot-market-stats article {
  min-width: 0;
  min-height: var(--metric-card-min-height);
  display: grid;
  align-content: center;
  padding: var(--card-padding-block) var(--card-padding-inline);
  border: 1px solid var(--spot-border);
  border-radius: 12px;
  background: #0d0d0f;
}

.spot-market-stats span {
  display: block;
  color: var(--spot-muted);
  font-size: 0.76rem;
  line-height: 1.3;
}

.spot-market-stats strong {
  display: block;
  margin-top: 7px;
  overflow: hidden;
  color: #ffffff;
  font-size: 1.08rem;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spot-panel,
.spot-stat-section { padding: 18px 20px; }

.spot-panel-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
}

.spot-panel h2,
.spot-stat-section h2,
.spot-disclosure h2 {
  margin: 0;
  color: #ffffff;
  font-size: 1.08rem;
  letter-spacing: -0.01em;
}

.spot-chart-title-group {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.spot-metal-icon-frame {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--spot-accent);
  border-radius: 50%;
  background: #050505;
}

.spot-metal-icon {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.spot-range-control {
  display: grid;
  grid-template-columns: repeat(6, minmax(48px, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--spot-border);
  border-radius: 11px;
  background: #080809;
}

.spot-range-control button,
.spot-tool-group button {
  min-width: 48px;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 10px;
  background: transparent;
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
}

.spot-range-control button:hover,
.spot-tool-group button:hover { background: #202023; }

.spot-range-control button[aria-pressed="true"],
.spot-tool-group button[aria-pressed="true"] {
  border-color: var(--spot-accent);
  background: var(--spot-accent-action);
  color: #ffffff;
  font-weight: 600;
}

.spot-chart-selection {
  min-width: max-content;
  align-self: center;
  color: var(--spot-muted);
  font-size: 0.72rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.spot-chart-tools {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-width: 0;
}

.spot-manage-prices {
  width: fit-content;
  max-width: 100%;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--spot-border-strong);
  border-radius: 10px;
  background: var(--spot-control);
  color: #ffffff;
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}

.spot-manage-prices:hover { border-color: var(--spot-accent); background: #202023; }
.spot-manage-prices .ui-icon { width: 17px; height: 17px; }

.spot-tool-group {
  display: flex;
  align-items: center;
  gap: 7px;
}

.spot-tool-group > span {
  color: var(--spot-muted);
  font-size: 0.67rem;
  font-weight: 500;
}

.spot-tool-group > div {
  display: grid;
  grid-auto-flow: column;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--spot-border);
  border-radius: 10px;
  background: #080809;
}

.spot-study-group > button {
  min-height: 44px;
  border-color: var(--spot-border);
  background: #080809;
}

.spot-chart-frame {
  height: 380px;
  margin-top: 16px;
  border: 1px solid var(--spot-border);
  border-radius: 13px;
  background: #070708;
  overflow: hidden;
}

#spot-chart {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

.spot-chart-readout {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 7px;
  padding: 7px 10px;
  border: 1px solid var(--spot-border);
  border-radius: 10px;
  background: #0f0f11;
}

.spot-chart-readout span {
  color: var(--spot-muted);
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
}

.spot-chart-readout strong {
  min-width: 0;
  overflow: hidden;
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spot-chart-legend {
  justify-content: flex-start;
  margin-top: 8px;
  color: var(--spot-muted);
  font-size: 0.72rem;
}

.spot-chart-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.spot-chart-legend > span:last-child { margin-left: auto; }

.spot-chart-legend i {
  width: 22px;
  height: 3px;
  display: block;
  border-radius: 999px;
  background: var(--spot-accent);
}

.spot-chart-legend .spot-study-swatch {
  height: 0;
  border-top: 2px dashed #ffffff;
  border-radius: 0;
  background: transparent;
}

.spot-chart-legend [hidden] { display: none; }

.spot-stat-section { margin-top: 10px; }

.spot-section-heading > span {
  color: var(--spot-muted);
  font-size: 0.78rem;
}

.spot-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.spot-stat-grid article {
  min-width: 0;
  min-height: var(--metric-card-min-height);
  display: grid;
  align-content: center;
  padding: var(--card-padding-block) var(--card-padding-inline);
  border: 1px solid var(--spot-border);
  border-radius: 12px;
  background: #0f0f11;
}

.spot-stat-grid span {
  display: block;
  color: var(--spot-muted);
  font-size: 0.76rem;
}

.spot-stat-grid strong {
  display: block;
  margin-top: 7px;
  overflow: hidden;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spot-disclosure {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-top: 10px;
  padding: 12px 16px;
  border-color: var(--spot-border);
  background: #0d0d0f;
}

.spot-disclosure img {
  display: block;
  width: 22px;
  height: 22px;
  filter: brightness(0) invert(1);
}

.spot-disclosure p {
  margin: 3px 0 0;
  color: var(--spot-muted);
  font-size: 0.76rem;
  line-height: 1.4;
}

.spot-footer {
  position: fixed;
  z-index: 25;
  right: 0;
  bottom: 0;
  left: 0;
  min-width: 0;
  min-height: calc(var(--spot-footer-height) + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  padding: 5px 8px calc(5px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--spot-border);
  background: #080809;
}

.spot-footer :is(button, .spot-footer-action) {
  min-width: 0;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 clamp(4px, 1vw, 12px);
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.spot-footer :is(button, .spot-footer-action):not(:disabled):hover { background: #19191b; }

.spot-footer button:disabled {
  cursor: not-allowed;
  opacity: 1;
  border-color: transparent;
  background: transparent;
  color: #737983;
}

.spot-footer button:disabled .ui-icon { opacity: 0.42; }
.spot-footer .ui-icon { width: 14px; height: 14px; }

noscript {
  display: block;
  max-width: 1324px;
  margin: 14px auto;
  padding: 14px;
  border: 1px solid #7f382f;
  border-radius: 12px;
  background: #521f1a;
  color: #ffffff;
}

@media (min-width: 1181px) {
  .spot-chart-frame { height: 460px; }
}

@media (max-width: 1320px) {
  .market-grid {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
  }

  .market-grid::-webkit-scrollbar { display: none; }
  .market-item { flex: 0 0 320px; }
}

@media (max-width: 1180px) {
  .shell-header { grid-template-columns: minmax(164px, 1fr) 624px minmax(164px, 1fr); }
  .brand { padding-inline: 12px; }
  .brand img { width: 136px; }
  .primary-nav { width: 624px; }
  .primary-nav a { min-width: 0; gap: 6px; padding-inline: 7px; font-size: 0.8rem; }
  .primary-nav .ui-icon { width: 20px; height: 20px; }
  .market-tray { grid-template-columns: 22px minmax(0, 1fr); gap: 10px; padding-inline: 14px; }
  .market-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px 10px; }
  .market-item { column-gap: 4px; padding-inline: 2px; }
  .market-item strong,
  .market-item small { font-size: 0.82rem; }
  .spot-panel-heading { grid-template-columns: minmax(0, 1fr) auto; }
  .spot-chart-tools { grid-column: 1 / -1; justify-self: end; }
}

@media (max-width: 1024px) {
  .shell-header { grid-template-columns: minmax(144px, 1fr) 456px minmax(144px, 1fr); }
  .primary-nav { width: 456px; }
  .primary-nav a {
    flex-direction: column;
    gap: 3px;
    padding: 6px 4px;
    font-size: 0.68rem;
    line-height: 1;
  }

  .primary-nav .ui-icon { width: 20px; height: 20px; }
  .market-grid { display: flex; gap: 8px; overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-width: none; }
  .market-grid::-webkit-scrollbar { display: none; }
  .market-item { flex: 0 0 300px; padding-inline: 10px; }
  .spot-chart-frame { height: 330px; }
}

@media (max-width: 900px) {
  .shell-header { grid-template-columns: 144px minmax(0, 1fr) auto; }
  .primary-nav { width: 100%; }
  .spot-hero,
  .spot-dashboard { grid-template-columns: minmax(0, 1fr); }
  .spot-hero { gap: 10px; }
  .spot-quote-card { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
  .spot-quote-heading { grid-column: 1 / -1; }
  .spot-quote-actions { justify-content: flex-end; }
}

@media (max-width: 820px) {
  .shell-header { grid-template-columns: 132px minmax(0, 1fr) auto; min-height: 60px; }
  .brand { padding: 5px 10px; }
  .brand img { width: 112px; height: 42px; }
  .primary-nav { height: 60px; padding: 5px; }
  .primary-nav a { min-height: 50px; padding-inline: 8px; font-size: 0.78rem; gap: 5px; }
  .primary-nav .ui-icon { width: 19px; height: 19px; }
  .header-actions { gap: 6px; padding-inline: 8px; }
  .icon-button, .avatar { width: 48px; min-height: 48px; }
  .avatar-image { width: 42px; height: 42px; }
  .notification-drawer, .account-menu { top: 64px; }
  .market-tray { padding-inline: 12px; }
  .global-search,
  .spot-shell { padding-inline: var(--canvas-gutter); }
  .spot-footer { gap: 3px; padding: 3px 6px calc(3px + env(safe-area-inset-bottom)); }
  .spot-footer :is(button, .spot-footer-action) { min-height: 44px; flex-direction: column; gap: 1px; padding-inline: 2px; border-radius: 8px; font-size: 0.62rem; }
  .spot-footer .ui-icon { width: 14px; height: 14px; }
}

@media (max-width: 620px) {
  .shell-header { grid-template-columns: 48px minmax(0, 1fr) 48px; }
  .brand { justify-self: stretch; justify-content: center; padding: 4px; }
  .brand picture, .brand img { width: 40px; height: 40px; }
  .primary-nav { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); width: 100%; overflow: visible; }
  .primary-nav a { width: 100%; min-width: 0; gap: 0; padding-inline: 0; }
  .header-actions { width: 48px; gap: 0; padding-inline: 2px; }
  .avatar { display: grid; width: 44px; min-height: 44px; }
  .avatar-image { width: 38px; height: 38px; }
  .market-tray { grid-template-columns: 18px minmax(0, 1fr); gap: 8px; padding-inline: 8px; }
  .market-icon { width: 18px; height: 18px; }
  .market-grid { display: flex; gap: 8px; overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-width: none; }
  .market-grid::-webkit-scrollbar { display: none; }
  .market-item { flex: 0 0 240px; grid-template-columns: max-content max-content; justify-content: center; column-gap: 6px; min-height: 36px; padding: 4px 5px; }
  .market-item strong { display: inline-flex; align-items: baseline; gap: 4px; font-size: 0.78rem; }
  .market-label { font-size: 0.7rem; line-height: 1.1; }
  .market-price { font-size: 0.78rem; line-height: 1.2; }
  .market-item small { align-self: center; gap: 3px; font-size: 0.68rem; }
  .global-search { grid-template-columns: 18px minmax(0, 1fr); gap: 8px; padding-inline: var(--canvas-gutter); }
  .spot-shell { padding: 12px var(--canvas-gutter) 24px; }
  .spot-hero-copy { padding: 20px 16px; }
  .spot-quote-card { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 18px 16px; }
  .spot-quote-heading { grid-column: auto; }
  .spot-quote-heading .spot-source-badge {
    min-width: 0;
    max-width: 48%;
    overflow-wrap: anywhere;
    text-align: right;
    white-space: normal;
    line-height: 1.2;
  }
  .spot-quote-main { align-items: flex-start; flex-direction: column; gap: 6px; }
  .spot-quote-actions { justify-content: space-between; }
  .spot-positive { padding-inline: 8px; font-size: 0.74rem; white-space: nowrap; }
  .spot-market-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 0; padding-top: 10px; }
  .spot-market-stats article {
    min-height: var(--metric-card-min-height);
    padding: var(--card-padding-block) var(--card-padding-inline);
  }
  .spot-dashboard { gap: 10px; }
  .spot-panel, .spot-stat-section { padding: 14px; }
  .spot-panel-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: flex-start;
  }
  .spot-chart-title-group { align-items: center; }
  .spot-chart-selection { justify-self: start; }
  .spot-metal-icon-frame { width: 42px; height: 42px; flex-basis: 42px; }
  .spot-range-control button,
  .spot-tool-group button { min-width: 44px; min-height: 44px; padding-inline: 6px; }
  .spot-range-control {
    width: 100%;
    grid-template-columns: repeat(3, minmax(44px, 1fr));
  }
  .spot-chart-tools { display: grid; grid-column: auto; justify-self: stretch; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; }
  .spot-tool-group { display: grid; align-items: initial; gap: 4px; }
  .spot-tool-group > div { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-flow: initial; }
  .spot-tool-group button { width: 100%; }
  .spot-chart-frame { height: 300px; }
  .spot-chart-readout { align-items: flex-start; }
  .spot-chart-readout strong { overflow: visible; line-height: 1.35; text-overflow: clip; white-space: normal; }
  .spot-stat-section { margin-top: 10px; }
  .spot-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
  .spot-stat-grid article {
    min-height: var(--metric-card-min-height);
    padding: var(--card-padding-block) var(--card-padding-inline);
  }
  .spot-stat-grid article:last-child strong { overflow: visible; line-height: 1.25; text-overflow: clip; white-space: normal; }
  .spot-disclosure { margin-top: 10px; padding: 14px; }
  .spot-footer :is(button, .spot-footer-action) span { display: none; }
  .spot-footer :is(button, .spot-footer-action)[aria-current="page"] span { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

@media (max-width: 379px) {
  .market-grid { gap: 6px; }
  .market-item { flex-basis: 240px; gap: 4px; padding-inline: 4px; }
  .market-item small { font-size: 0.66rem; }
  .spot-chart-frame { height: 270px; }
  .spot-chart-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .spot-study-group { grid-column: 1 / -1; }
  .spot-quote-actions { align-items: flex-start; flex-direction: column; gap: 8px; }
  .spot-chart-readout { display: grid; gap: 3px; }
  .spot-chart-legend { align-items: flex-start; flex-wrap: wrap; gap: 6px 12px; }
  .spot-chart-legend > span:last-child { width: 100%; margin-left: 0; }
  .spot-footer .ui-icon { width: 13px; height: 13px; }
}

@media (max-width: 360px) {
  .shell-header { grid-template-columns: 44px minmax(0, 1fr) 44px; }
  .brand { padding-inline: 2px; }
  .brand picture, .brand img { width: 38px; height: 38px; }
  .primary-nav a { padding-inline: 0; }
  .primary-nav .ui-icon { width: 17px; height: 17px; }
  .header-actions { width: 44px; padding-inline: 0; }
  .avatar { width: 40px; min-height: 40px; }
  .avatar-image { width: 36px; height: 36px; }
  .notification-count { right: -2px; }
  .global-search,
  .spot-shell { padding-inline: 8px; }
  .global-search { grid-template-columns: 18px minmax(0, 1fr); gap: 6px; }
  .spot-footer .ui-icon { width: 12px; height: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .spot-page *,
  .spot-page *::before,
  .spot-page *::after { scroll-behavior: auto !important; }
}

/* Figma release closure for zoom-equivalent and narrow viewports. */
.market-item { min-height: 44px; }

@media (max-width: 700px) {
  .shell-header {
    grid-template-columns: 48px minmax(0, 1fr) 48px;
    min-height: 60px;
  }

  .brand {
    width: 48px;
    justify-self: stretch;
    justify-content: flex-start;
    overflow: hidden;
    padding: 4px;
  }

  .brand picture,
  .brand img { width: 40px; min-width: 40px; height: 40px; }
  .brand img { object-fit: cover; object-position: left center; }

  .primary-nav {
    width: 100%;
    height: 60px;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    padding: 5px;
  }

  .primary-nav a {
    min-width: 44px;
    min-height: 48px;
    padding-inline: 0;
  }

  .primary-nav .ui-icon { width: 20px; height: 20px; }

  .header-actions {
    width: 48px;
    min-height: 60px;
    gap: 0;
    padding-inline: 2px;
  }

  .avatar,
  .avatar-menu-trigger { width: 44px; min-width: 44px; min-height: 44px; }
  .avatar-image { width: 38px; height: 38px; }

  .spot-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .market-item {
    flex-basis: 280px;
    min-height: 44px;
  }

  .spot-stat-grid strong {
    overflow: visible;
    overflow-wrap: anywhere;
    text-overflow: clip;
    white-space: normal;
  }
}

@media (max-width: 620px) {
  .brand { justify-content: center; }
  .brand picture,
  .brand img { width: 40px; min-width: 40px; height: 40px; }
}

@media (max-width: 420px) {
  .shell-header {
    min-height: 102px;
    grid-template-columns: 48px minmax(0, 1fr) 48px;
    grid-template-rows: 48px 54px;
  }

  .brand { grid-column: 1; grid-row: 1; }

  .primary-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    min-height: 54px;
    padding: 4px 6px;
  }

  .primary-nav a {
    min-width: 44px;
    min-height: 46px;
  }

  .header-actions {
    grid-column: 3;
    grid-row: 1;
    min-height: 48px;
  }

  .avatar,
  .avatar-menu-trigger {
    width: 44px;
    min-width: 44px;
    min-height: 44px;
  }

  .market-item {
    flex-basis: 268px;
    min-height: 44px;
    padding-block: 6px;
  }
}

@media (max-width: 379px) {
  .spot-quote-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-items: start;
    gap: 8px;
  }

  .spot-source-badge {
    max-width: 100%;
    white-space: normal;
  }
}

@media (max-width: 360px) {
  .avatar,
  .avatar-menu-trigger {
    width: 44px;
    min-width: 44px;
    min-height: 44px;
  }
}

@media (min-width: 901px) {
  .spot-shell { padding-top: 8px; }
  .spot-hero { gap: 12px; }
  .spot-hero-copy { padding: 24px; }
  .spot-eyebrow { margin-bottom: 3px; font-size: 0.7rem; }
  .spot-hero h1 { font-size: clamp(1.9rem, 3vw, 2.7rem); }
  .spot-intro { margin-top: 6px; font-size: 0.86rem; line-height: 1.35; }
  .spot-quote-card { gap: 12px 18px; padding: 20px 22px; }
  .spot-quote-value { font-size: clamp(2.15rem, 3.8vw, 3.3rem); }
  .spot-market-stats { gap: 12px; margin-bottom: 4px; }
  .spot-market-stats article { padding: var(--card-padding-block) var(--card-padding-inline); }
}

/* Match the application-wide three-tier border hierarchy. */
.shell-header,
.market-tray,
.spot-footer {
  border-color: var(--spot-border-divider);
}

:is(
  .spot-hero-copy,
  .spot-quote-card,
  .spot-panel,
  .spot-stat-section,
  .spot-disclosure
) {
  border-color: var(--spot-border-frame);
}

:is(
  .spot-market-stats,
  .spot-panel-heading,
  .spot-chart-readout,
  .spot-chart-legend
) {
  border-color: var(--spot-border-divider);
}

:is(
  .spot-range-control,
  .spot-tool-group > div,
  .spot-study-group > button,
  .spot-manage-prices,
  .spot-chart-frame,
  .global-search
) {
  border-color: var(--spot-border-frame);
}

.spot-market-stats article {
  border: 0;
  border-radius: 0;
  background: transparent;
}

.spot-market-stats article + article {
  border-inline-start: 1px solid var(--spot-border-divider);
}

@media (max-width: 620px) {
  .spot-market-stats article {
    border: 1px solid var(--spot-border-divider);
    border-radius: 12px;
    background: #0d0d0f;
  }

  .spot-market-stats article + article { border-inline-start-width: 1px; }
}

/* Shared shell contract for the standalone pricing route. */
.primary-nav > .global-search:focus-within { box-shadow: none; }
.primary-nav > .global-search .ui-icon { width: var(--icon-action, 18px); height: var(--icon-action, 18px); }
.account-menu { padding: 10px; }
.account-profile-card { display: grid; grid-template-columns: 42px minmax(0, 1fr); align-items: center; gap: 10px; min-width: 0; padding: 8px; border: 1px solid var(--spot-border); border-radius: 11px; background: #151517; }
.account-profile-avatar { width: 42px; height: 42px; border: 1px solid var(--spot-gold); border-radius: 50%; object-fit: cover; }
.account-profile-copy { display: grid; min-width: 0; gap: 2px; }
.account-profile-copy strong { color: #ffffff; font-size: 0.86rem; line-height: 1.2; }
.account-profile-copy span { color: var(--spot-muted); font-size: 0.72rem; line-height: 1.25; }
.account-profile-copy small { color: #7f858f; font-size: 0.66rem; line-height: 1.2; overflow-wrap: anywhere; }
.account-menu-divider { height: 1px; margin: 2px 4px; background: var(--spot-border-divider); }
.account-menu :is(a, button) { display: flex; align-items: center; gap: 10px; min-height: 44px; padding-inline: 12px; }
.account-menu :is(a, button) .ui-icon { width: var(--icon-action, 18px); height: var(--icon-action, 18px); opacity: 0.9; }

@media (min-width: 821px) and (max-width: 1320px) {
  .primary-nav:has(> .global-search) { grid-template-columns: repeat(6, minmax(74px, 1fr)) minmax(148px, 1.35fr); }
  .primary-nav > .global-search { width: 100%; justify-self: stretch; grid-template-columns: 20px minmax(0, 1fr); gap: 8px; padding-inline: 10px; }
  .primary-nav > .global-search input { width: 100%; opacity: 1; }
}

@media (max-width: 620px) {
  .primary-nav .ui-icon { width: 18px; height: 18px; }
}

/* Final responsive header contract mirrors the shared workbench shell. */
@media (min-width: 1181px) and (max-width: 1320px) {
  .shell-header:has(.primary-nav > .global-search) {
    grid-template-columns: minmax(154px, 1fr) minmax(0, 900px) minmax(154px, 1fr);
  }

  .primary-nav:has(> .global-search) {
    grid-template-columns: repeat(6, minmax(0, 1fr)) minmax(148px, 1.25fr);
    width: min(900px, 100%);
  }

  .primary-nav > .global-search {
    width: 100%;
    justify-self: stretch;
    grid-template-columns: 20px minmax(0, 1fr);
    gap: 8px;
    padding-inline: 10px;
  }

  .primary-nav > .global-search input { width: 100%; opacity: 1; }
}

@media (min-width: 821px) and (max-width: 1180px) {
  .primary-nav:has(> .global-search) {
    grid-template-columns: repeat(6, minmax(0, 1fr)) 48px;
    width: 100%;
  }

  .primary-nav > .global-search {
    width: 48px;
    justify-self: end;
    grid-template-columns: 22px 0;
    justify-content: center;
    gap: 0;
    padding-inline: 12px;
  }

  .primary-nav > .global-search input { width: 0; opacity: 0; }

  .primary-nav > .global-search:focus-within {
    position: absolute;
    top: 6px;
    right: 6px;
    width: min(360px, calc(100% - 12px));
    grid-template-columns: 20px minmax(0, 1fr);
    justify-content: initial;
    gap: 8px;
    padding-inline: 12px;
    background: #0c0c0d;
  }

  .primary-nav > .global-search:focus-within input { width: 100%; opacity: 1; }
}

@media (min-width: 821px) and (max-width: 900px) {
  .primary-nav a {
    flex-direction: column;
    gap: 3px;
    padding: 6px 4px;
    font-size: 0.7rem;
    line-height: 1;
  }

  .primary-nav .ui-icon { width: 20px; height: 20px; }
}

:root[data-theme="light"] .spot-page .shell-header,
:root[data-theme="light"] .spot-page .market-tray,
:root[data-theme="light"] .spot-page body > footer { background: #ffffff; border-color: var(--spot-border-divider); }

:root[data-theme="light"] .spot-page :is(.spot-hero-copy, .spot-quote-card, .spot-panel, .spot-stat-section, .spot-disclosure, .spot-chart-shell, .spot-chart-frame, .spot-market-stats article) {
  background: var(--spot-surface);
  color: var(--spot-text);
  border-color: var(--spot-border-frame);
}

:root[data-theme="light"] .spot-page :is(h1, h2, h3, h4, strong, .spot-price, .spot-market-value) { color: var(--spot-text); }
:root[data-theme="light"] .spot-page :is(.spot-muted, .spot-subtitle, .spot-hero-copy p, .spot-disclosure p) { color: var(--spot-muted); }
:root[data-theme="light"] .spot-page .account-profile-card { background: var(--spot-surface-raised); border-color: var(--spot-border); }
:root[data-theme="light"] .spot-page .account-profile-copy strong { color: var(--spot-text); }
:root[data-theme="light"] .spot-page .account-profile-copy small { color: #68645d; }
:root[data-theme="light"] .spot-page .account-menu :is(a, button) { background: var(--spot-control); color: var(--spot-text); border-color: var(--spot-border); }

/* Pricing route overrides follow the shared light tokens after the route's dark defaults. */
:root[data-theme="light"] body.spot-page .shell-header,
:root[data-theme="light"] body.spot-page .market-tray,
:root[data-theme="light"] body.spot-page > .spot-footer { background: #ffffff; border-color: var(--spot-border-divider); }
:root[data-theme="light"] body.spot-page .primary-nav a { color: var(--spot-text); }
:root[data-theme="light"] body.spot-page .primary-nav a:hover { background: var(--spot-surface-hover, var(--surface-hover)); border-color: var(--spot-border); }
:root[data-theme="light"] body.spot-page .primary-nav a[aria-current="page"] { color: #1d1d1f; background: var(--spot-gold-action); border-color: var(--spot-gold); }
:root[data-theme="light"] body.spot-page .global-search { background: var(--spot-control); color: var(--spot-text); }
:root[data-theme="light"] body.spot-page .global-search input { background: transparent; color: var(--spot-text); }
:root[data-theme="light"] body.spot-page .market-item,
:root[data-theme="light"] body.spot-page .market-item strong,
:root[data-theme="light"] body.spot-page .market-price { color: var(--spot-text); }
:root[data-theme="light"] body.spot-page .market-item[aria-current="page"] { background: var(--spot-surface-control, var(--surface-control)); }
:root[data-theme="light"] body.spot-page :is(.spot-metal-icon-frame, .spot-range-control, .spot-tool-group > div, .spot-study-group > button, .spot-chart-readout, .spot-stat-grid article, .spot-disclosure) { background: var(--spot-control); color: var(--spot-text); }
:root[data-theme="light"] body.spot-page :is(.spot-range-control button, .spot-tool-group button, .spot-study-group > button) { color: var(--spot-text); }
:root[data-theme="light"] body.spot-page :is(.spot-range-control button:hover, .spot-tool-group button:hover) { background: var(--surface-hover); }
:root[data-theme="light"] body.spot-page :is(.spot-range-control button[aria-pressed="true"], .spot-tool-group button[aria-pressed="true"]) { background: var(--spot-accent-action); color: #1d1d1f; }
:root[data-theme="light"] body.spot-page .spot-manage-prices { color: var(--spot-text); background: var(--spot-control); }
:root[data-theme="light"] body.spot-page .spot-manage-prices:hover { background: var(--surface-hover); }
:root[data-theme="light"] body.spot-page .spot-chart-frame { background: var(--spot-surface-raised); }
:root[data-theme="light"] body.spot-page .spot-chart-readout strong,
:root[data-theme="light"] body.spot-page .spot-stat-grid strong { color: var(--spot-text); }
:root[data-theme="light"] body.spot-page .spot-footer :is(button, .spot-footer-action) { color: var(--spot-text); }
:root[data-theme="light"] body.spot-page .spot-footer :is(button, .spot-footer-action):not(:disabled):hover { background: var(--surface-hover); }
.account-menu [data-theme-toggle][aria-checked="true"] { border-color: var(--spot-gold); background: var(--spot-gold-action); color: #ffffff; }
:root[data-theme="light"] body.spot-page .account-menu [data-theme-toggle][aria-checked="true"] { color: #1d1d1f; }

/* Keep compact pricing labels readable on the warm light canvas. */
:root[data-theme="light"] body.spot-page .market-item small { color: var(--green); }
:root[data-theme="light"] body.spot-page .market-item.metal-gold .market-label { color: #765b14; }
:root[data-theme="light"] body.spot-page :is(.spot-kicker, .spot-eyebrow) { color: #765b14; }
.account-menu [data-theme-toggle] .account-menu-state { margin-left: auto; color: var(--spot-muted); font-size: 0.68rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.account-menu [data-theme-toggle][aria-checked="true"] .account-menu-state { color: inherit; }

/* Keep the Pricing route on the same fluid header contract as the workbench. */
@media (min-width: 1181px) {
  .shell-header:has(.primary-nav > .global-search) {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .primary-nav:has(> .global-search) {
    width: 100%;
    max-width: none;
    grid-template-columns: repeat(6, minmax(0, 1fr)) minmax(clamp(188px, 15vw, 220px), 0.9fr);
  }

  .primary-nav > .global-search {
    width: 100%;
    justify-self: stretch;
  }
}

@media (min-width: 1181px) and (max-width: 1240px) {
  .primary-nav a { gap: 4px; padding-inline: 4px; }
}

/* Global control contract: flat surfaces, predictable states, and a shared
   focus treatment. Elevation belongs to panels, never to interactive controls. */
:where(button, [role="button"], input[type="button"], input[type="submit"], input[type="reset"]) {
  box-shadow: none !important;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease,
    transform 150ms cubic-bezier(0.25, 1, 0.5, 1), opacity 150ms ease;
}

:where(button, [role="button"], input[type="button"], input[type="submit"], input[type="reset"]):not(:disabled):not([aria-disabled="true"]):active {
  transform: scale(0.98);
  opacity: 0.9;
}

:where(button, [role="button"], input[type="button"], input[type="submit"], input[type="reset"]):focus-visible {
  outline: 2px solid var(--spot-focus-ring, var(--focus-ring));
  outline-offset: 2px;
  box-shadow: none !important;
}

:where(button:disabled, [role="button"][aria-disabled="true"], input[type="button"]:disabled, input[type="submit"]:disabled, input[type="reset"]:disabled) {
  cursor: not-allowed;
  opacity: 0.48 !important;
  box-shadow: none !important;
}

:where(.primary-nav a[aria-current="page"], body > footer button[aria-current="page"]) {
  box-shadow: none !important;
}

@media (min-width: 821px) and (max-width: 1180px) {
  .shell-header:has(.primary-nav > .global-search) {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .primary-nav:has(> .global-search) {
    width: 100%;
    max-width: none;
    grid-template-columns: repeat(6, minmax(0, 1fr)) 48px;
  }
}
