/* ==========================================================================================
   goldrush.css — the vault. Loaded AFTER style.css; overrides tokens and restyles components.
   Dark  = dusty warm-black vault, gold bullion plates.   Light = ivory parchment, engraved gold.
   Pure CSS: no external assets (grain is an inline SVG feTurbulence data-URI). Animations are
   entrance / hover / press only (no endless loops) and all vanish under prefers-reduced-motion.
   ========================================================================================== */

/* ------------------------------------------------------------------ tokens: LIGHT (default) */
:root {
  color-scheme: light;
  --page: #efe5cb; --surface: #fbf5e2; --surface2: #f3e8c9;
  --text: #241b0c; --text2: #52452b; --muted: #685b40;
  --grid: #e3d6b0; --axis: #cdbb8a; --border: rgba(120, 84, 8, .30); --wash: rgba(150, 105, 10, .09);
  --accent: #7b5603; --accent-fill: #c9962b; --accent-soft: rgba(181, 134, 10, .17); --accent-ink: #2a1c02;
  --up: #07703a; --down: #c0262f; --neg: #c0262f;
  --shadow: 0 1px 0 rgba(255, 255, 255, .8) inset, 0 8px 22px -6px rgba(90, 62, 8, .28);
  --glow: radial-gradient(1200px 520px at 50% -8%, rgba(214, 160, 40, .30), transparent 64%);

  --vault-edge: #6b4d0c;                                    /* outer dark rim of every plate */
  --foil-a: #8a6106; --foil-b: #d3a02b; --foil-hot: #fff3bf;
  --foil: linear-gradient(176deg, #966a05 0%, #7a5304 38%, #573a02 52%, #865a05 64%, #9a6d05 82%, #7f5604 100%);
  --foil-up: linear-gradient(176deg, #0b8a49 0%, #07703a 40%, #055a2d 54%, #07703a 70%, #0c8f4b 100%);
  --foil-dn: linear-gradient(176deg, #c72f38 0%, #b0222b 40%, #82151d 54%, #b0222b 70%, #c22c35 100%);
  --foil-fx: brightness(1) drop-shadow(0 1px 0 rgba(255, 252, 235, .85)) drop-shadow(0 1px 5px rgba(160, 110, 10, .28));
  --foil-fx-hot: brightness(1.18) drop-shadow(0 1px 0 rgba(255, 252, 235, .85)) drop-shadow(0 0 12px rgba(214, 160, 40, .75));
  --title-gold: #6d4a02;                                    /* small-cap titles */
  --molten: linear-gradient(180deg, #ffeaa1 0%, #f3c847 38%, #d99d1a 64%, #b57f0d 100%);
  --molten-glow: rgba(214, 160, 40, .55);
  --sheen: rgba(255, 255, 255, .62);
  --btn-hi: #fffaf0; --btn-lo: #efe0b4;
  --btn-bevel: inset 0 1px 0 rgba(255, 255, 255, .9), inset 0 -1px 0 rgba(120, 84, 8, .22), 0 1px 0 rgba(120, 84, 8, .25);
  --ingot-hi: #fffbea; --ingot-mid: #f7ecc9; --ingot-lo: #ecdcae; --ingot-warm: rgba(255, 255, 255, .5);
  --bevel-hi: rgba(255, 255, 255, .95); --bevel-lo: rgba(120, 84, 8, .36); --bevel-side: rgba(255, 255, 255, .7); --bevel-lo-side: rgba(120, 84, 8, .16);
  --ingot-shine: rgba(255, 255, 255, .85);
  --spot: rgba(214, 160, 40, .20);
  --brush: rgba(120, 84, 8, .06);
  --frame-line: rgba(140, 98, 8, .40); --frame-hot: #a87a0a;
  --plate-shadow: 0 1px 0 rgba(255, 255, 255, .85) inset, 0 12px 26px -12px rgba(90, 62, 8, .45), 0 2px 3px rgba(90, 62, 8, .18);
  --plate-shadow-hover: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 20px 36px -14px rgba(90, 62, 8, .55), 0 0 0 1px rgba(201, 150, 43, .35), 0 0 26px -6px rgba(214, 160, 40, .5);
  --head-bg: linear-gradient(180deg, #fcf6e4, #f1e5c3);
  --vig: rgba(90, 60, 8, .16);
  --input-bg: #fffaf0;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .32 0 0 0 0 .22 0 0 0 0 .05 .5 0 0 0 -.21'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
  --grain-card: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' seed='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .24 0 0 0 0 .06 .38 0 0 0 -.15'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  --display: "Palatino Linotype", Palatino, "Book Antiqua", "P052", "TeX Gyre Pagella", Georgia, serif;
}

/* ------------------------------------------------------------------ tokens: DARK */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0b0905; --surface: #17120a; --surface2: #211a0d;
    --text: #f8f1de; --text2: #d1c6aa; --muted: #a59b83;
    --grid: #2c2412; --axis: #4a3e21; --border: rgba(224, 174, 52, .24); --wash: rgba(232, 182, 58, .09);
    --accent: #ecbc3d; --accent-fill: #d9a92a; --accent-soft: rgba(236, 188, 61, .17); --accent-ink: #1a1204;
    --up: #3ad98f; --down: #ff6b70; --neg: #ff6b70;
    --shadow: 0 1px 0 rgba(255, 240, 200, .06) inset, 0 10px 28px rgba(0, 0, 0, .5);
    --glow: radial-gradient(1200px 520px at 50% -8%, rgba(240, 192, 64, .34), transparent 64%);
    --vault-edge: #030201;
    --foil-a: #6d5010; --foil-b: #c99a1e; --foil-hot: #fff1b8;
    --foil: linear-gradient(176deg, #fff6cf 0%, #f8dc7a 26%, #e3b232 50%, #b98510 58%, #e9bd45 76%, #ffeaa0 100%);
    --foil-up: linear-gradient(176deg, #e2fff0 0%, #86f2bd 28%, #35c67f 52%, #1f9a5f 60%, #55dd9d 80%, #cbffe4 100%);
    --foil-dn: linear-gradient(176deg, #ffe0e1 0%, #ff9b9f 28%, #f0555d 52%, #c23640 60%, #ff7f85 80%, #ffd3d5 100%);
    --foil-fx: brightness(1) drop-shadow(0 1px 0 rgba(0, 0, 0, .75)) drop-shadow(0 0 9px rgba(240, 190, 60, .26));
    --foil-fx-hot: brightness(1.35) drop-shadow(0 1px 0 rgba(0, 0, 0, .75)) drop-shadow(0 0 16px rgba(255, 205, 80, .9));
    --title-gold: #e9bf55;
    --molten: linear-gradient(180deg, #ffe89a 0%, #f0c445 38%, #d59b1a 64%, #b47d0e 100%);
    --molten-glow: rgba(240, 192, 64, .5);
    --sheen: rgba(255, 236, 170, .30);
    --btn-hi: #2c2312; --btn-lo: #1a1409;
    --btn-bevel: inset 0 1px 0 rgba(255, 225, 140, .22), inset 0 -1px 0 rgba(0, 0, 0, .55), 0 1px 0 rgba(0, 0, 0, .6);
    --ingot-hi: #3a2b0f; --ingot-mid: #241a0a; --ingot-lo: #150f05; --ingot-warm: rgba(240, 192, 64, .16);
    --bevel-hi: rgba(255, 226, 140, .30); --bevel-lo: rgba(0, 0, 0, .7); --bevel-side: rgba(255, 226, 140, .10); --bevel-lo-side: rgba(0, 0, 0, .45);
    --ingot-shine: rgba(255, 236, 170, .30);
    --spot: rgba(240, 192, 64, .14);
    --brush: rgba(255, 236, 170, .055);
    --frame-line: rgba(236, 188, 61, .30); --frame-hot: #f6d36a;
    --plate-shadow: 0 1px 0 rgba(255, 236, 170, .07) inset, 0 14px 30px -12px rgba(0, 0, 0, .85), 0 2px 4px rgba(0, 0, 0, .5);
    --plate-shadow-hover: 0 1px 0 rgba(255, 236, 170, .12) inset, 0 22px 40px -14px rgba(0, 0, 0, .9), 0 0 0 1px rgba(240, 192, 64, .32), 0 0 30px -6px rgba(240, 192, 64, .38);
    --head-bg: linear-gradient(180deg, #1d160b, #120d06);
    --vig: rgba(0, 0, 0, .62);
    --input-bg: #070503;
    --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 .86 0 0 0 0 .55 .30 0 0 0 -.10'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
    --grain-card: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' seed='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 .86 0 0 0 0 .55 .24 0 0 0 -.075'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0b0905; --surface: #17120a; --surface2: #211a0d;
  --text: #f8f1de; --text2: #d1c6aa; --muted: #a59b83;
  --grid: #2c2412; --axis: #4a3e21; --border: rgba(224, 174, 52, .24); --wash: rgba(232, 182, 58, .09);
  --accent: #ecbc3d; --accent-fill: #d9a92a; --accent-soft: rgba(236, 188, 61, .17); --accent-ink: #1a1204;
  --up: #3ad98f; --down: #ff6b70; --neg: #ff6b70;
  --shadow: 0 1px 0 rgba(255, 240, 200, .06) inset, 0 10px 28px rgba(0, 0, 0, .5);
  --glow: radial-gradient(1200px 520px at 50% -8%, rgba(240, 192, 64, .34), transparent 64%);
  --vault-edge: #030201;
  --foil-a: #6d5010; --foil-b: #c99a1e; --foil-hot: #fff1b8;
  --foil: linear-gradient(176deg, #fff6cf 0%, #f8dc7a 26%, #e3b232 50%, #b98510 58%, #e9bd45 76%, #ffeaa0 100%);
  --foil-up: linear-gradient(176deg, #e2fff0 0%, #86f2bd 28%, #35c67f 52%, #1f9a5f 60%, #55dd9d 80%, #cbffe4 100%);
  --foil-dn: linear-gradient(176deg, #ffe0e1 0%, #ff9b9f 28%, #f0555d 52%, #c23640 60%, #ff7f85 80%, #ffd3d5 100%);
  --foil-fx: brightness(1) drop-shadow(0 1px 0 rgba(0, 0, 0, .75)) drop-shadow(0 0 9px rgba(240, 190, 60, .26));
  --foil-fx-hot: brightness(1.35) drop-shadow(0 1px 0 rgba(0, 0, 0, .75)) drop-shadow(0 0 16px rgba(255, 205, 80, .9));
  --title-gold: #e9bf55;
  --molten: linear-gradient(180deg, #ffe89a 0%, #f0c445 38%, #d59b1a 64%, #b47d0e 100%);
  --molten-glow: rgba(240, 192, 64, .5);
  --sheen: rgba(255, 236, 170, .30);
  --btn-hi: #2c2312; --btn-lo: #1a1409;
  --btn-bevel: inset 0 1px 0 rgba(255, 225, 140, .22), inset 0 -1px 0 rgba(0, 0, 0, .55), 0 1px 0 rgba(0, 0, 0, .6);
  --ingot-hi: #3a2b0f; --ingot-mid: #241a0a; --ingot-lo: #150f05; --ingot-warm: rgba(240, 192, 64, .16);
  --bevel-hi: rgba(255, 226, 140, .30); --bevel-lo: rgba(0, 0, 0, .7); --bevel-side: rgba(255, 226, 140, .10); --bevel-lo-side: rgba(0, 0, 0, .45);
  --ingot-shine: rgba(255, 236, 170, .30);
  --spot: rgba(240, 192, 64, .14);
  --brush: rgba(255, 236, 170, .055);
  --frame-line: rgba(236, 188, 61, .30); --frame-hot: #f6d36a;
  --plate-shadow: 0 1px 0 rgba(255, 236, 170, .07) inset, 0 14px 30px -12px rgba(0, 0, 0, .85), 0 2px 4px rgba(0, 0, 0, .5);
  --plate-shadow-hover: 0 1px 0 rgba(255, 236, 170, .12) inset, 0 22px 40px -14px rgba(0, 0, 0, .9), 0 0 0 1px rgba(240, 192, 64, .32), 0 0 30px -6px rgba(240, 192, 64, .38);
  --head-bg: linear-gradient(180deg, #1d160b, #120d06);
  --vig: rgba(0, 0, 0, .62);
  --input-bg: #070503;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 .86 0 0 0 0 .55 .30 0 0 0 -.10'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
  --grain-card: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' seed='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 .86 0 0 0 0 .55 .24 0 0 0 -.075'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ------------------------------------------------------------------ page: warm-black / parchment, glow, vignette, grain */
body {
  background:
    var(--glow) no-repeat top center / 100% 640px,
    radial-gradient(ellipse 130% 90% at 50% 25%, transparent 55%, var(--vig) 100%) no-repeat center / 100% 100%,
    var(--grain),
    var(--page);
  background-attachment: scroll;
  min-height: 100vh;
  letter-spacing: .005em;
  overflow-x: hidden;
}
::selection { background: var(--molten-glow); color: var(--text); }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--frame-hot); outline-offset: 2px; border-radius: 6px; box-shadow: 0 0 0 5px var(--accent-soft); }
* { scrollbar-width: thin; scrollbar-color: var(--foil-a) transparent; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: linear-gradient(90deg, var(--foil-a), var(--foil-b), var(--foil-a)); border-radius: 9px; border: 2px solid transparent; background-clip: padding-box; }

/* ------------------------------------------------------------------ gold-foil text (hero numerals) */
.stockhead .price, .stat .v, .card-head .latest b, .home h1, .brand span {
  color: var(--accent);
  background-image: var(--foil);
  background-size: 100% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: var(--foil-fx);
  font-family: var(--display);
  font-variant-numeric: lining-nums tabular-nums;
}
.stat .v.up { background-image: var(--foil-up); }
.stat .v.down { background-image: var(--foil-dn); }
.stat .v { display: block; width: fit-content; max-width: 100%; }
.card-head .latest b { display: inline-block; }
.fx-land { animation: fx-land .85s ease-out 1; }
@keyframes fx-land { 0% { filter: var(--foil-fx-hot); } 100% { filter: var(--foil-fx); } }
@media (hover: hover) {
  .stat .v { background-size: 100% 240%; background-position: 0 0; transition: background-position .9s cubic-bezier(.2, .8, .2, 1); }
  .stat:hover .v { background-position: 0 100%; }
}

/* ------------------------------------------------------------------ top bar: the vault door header */
.topbar {
  min-height: 59px;
  background: var(--head-bg);
  -webkit-backdrop-filter: none; backdrop-filter: none;
  border-bottom: 1px solid var(--vault-edge);
  box-shadow: 0 1px 0 var(--frame-line), 0 8px 18px -10px rgba(0, 0, 0, .55);
}
.topbar::after {                                   /* row of rivets along the lower edge */
  content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 3px; pointer-events: none; opacity: .75;
  background: radial-gradient(circle at 50% 50%, var(--frame-hot) 0 1px, transparent 1.6px) 0 0 / 18px 3px repeat-x;
}
.brand { gap: 9px; }
.brand svg { filter: drop-shadow(0 0 7px rgba(240, 190, 60, .55)) drop-shadow(0 1px 0 rgba(0, 0, 0, .5)); }
.brand span { font-size: 17px; font-weight: 700; letter-spacing: .05em; font-variant: small-caps; }
.searchbox input {
  background: var(--input-bg);
  border: 1px solid var(--border); border-radius: 9px;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, .32), 0 1px 0 var(--bevel-side);
  transition: border-color .2s, box-shadow .25s;
}
.searchbox input:focus { border-color: var(--frame-hot); box-shadow: inset 0 2px 6px rgba(0, 0, 0, .3), 0 0 0 3px var(--accent-soft), 0 0 22px -2px var(--molten-glow); }
.suggest {
  background: var(--surface); border: 1px solid var(--vault-edge); border-radius: 10px;
  box-shadow: 0 0 0 1px var(--frame-line), 0 18px 40px -8px rgba(0, 0, 0, .7);
}
.suggest li[aria-selected="true"], .suggest li:hover { background: var(--accent-soft); }
.suggest .sym { font-family: var(--display); color: var(--title-gold); }

/* ------------------------------------------------------------------ buttons / segmented / tabs / chips */
.btn, .seg button, .tabs .tab, .vdh-pills button {
  position: relative; overflow: hidden; -webkit-tap-highlight-color: transparent;
  transition: transform .14s cubic-bezier(.3, 1.6, .5, 1), box-shadow .2s, border-color .2s, color .2s, background-color .2s;
}
.btn::after, .seg button::after, .tabs .tab::after, .vdh-pills button::after, .chip::after {   /* gold sheen sweep on hover */
  content: ""; position: absolute; inset: 0; pointer-events: none; transform: translateX(-140%);
  background: linear-gradient(105deg, transparent 36%, var(--sheen) 50%, transparent 64%);
}
.btn {
  color: var(--text);
  background: linear-gradient(180deg, var(--btn-hi), var(--btn-lo));
  border: 1px solid var(--vault-edge); border-radius: 9px;
  box-shadow: var(--btn-bevel), 0 0 0 1px var(--frame-line);
  font-weight: 600; letter-spacing: .02em;
}
.btn:hover { background: linear-gradient(180deg, var(--btn-hi), var(--btn-lo)); border-color: var(--vault-edge); }
.btn.danger { color: var(--down); }
.btn:disabled { opacity: .55; }
@media (hover: hover) {
  .btn:not(:disabled):hover { box-shadow: var(--btn-bevel), 0 0 0 1px var(--frame-hot), 0 0 18px -3px var(--molten-glow); transform: translateY(-1px); }
  .btn:not(:disabled):hover::after, .seg button:hover::after, .tabs .tab:hover::after, .vdh-pills button:hover::after, .chip:hover::after { transform: translateX(140%); transition: transform .7s cubic-bezier(.3, .7, .3, 1); }
}
.btn:not(:disabled):active, .seg button:active, .tabs .tab:active, .vdh-pills button:active {
  transform: scale(.94) translateY(1px);
  box-shadow: inset 0 3px 8px rgba(0, 0, 0, .5), inset 0 0 14px var(--molten-glow), 0 0 0 1px var(--frame-hot);
  transition-duration: .05s;
}
#btn-update { color: var(--accent); }

.seg {
  background: linear-gradient(180deg, var(--btn-lo), var(--btn-hi)); border: 1px solid var(--vault-edge); border-radius: 10px;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, .28), 0 0 0 1px var(--frame-line), 0 1px 0 var(--bevel-side);
}
.seg button { color: var(--text2); font-weight: 600; }
.seg button + button { border-left: 1px solid var(--border); }
.seg button:hover { background: var(--accent-soft); color: var(--text); }
/* selected controls: molten gold ingots */
.seg button[aria-pressed="true"], .pr-bar .btn[aria-pressed="true"], .pr-main .ctl .btn[aria-pressed="true"], .vdh-pills button[aria-pressed="true"], .btn.on {
  background: var(--molten) !important; color: var(--accent-ink); font-weight: 700; border-color: var(--vault-edge);
  text-shadow: 0 1px 0 rgba(255, 244, 190, .55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), inset 0 -2px 0 rgba(96, 62, 0, .5), 0 0 14px -2px var(--molten-glow);
}
.seg button[aria-pressed="true"] { border-left-color: transparent; }

.tabs {
  top: 58px; min-height: 43px;
  background: color-mix(in srgb, var(--page) 90%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--frame-line);
  box-shadow: 0 1px 0 var(--vault-edge), 0 10px 20px -14px rgba(0, 0, 0, .7);
}
.tabs .tab { color: var(--text2); font-weight: 600; border-bottom: 0; padding-bottom: 12px; }
.tabs .tab::after { inset: 0 0 3px; }
.tabs .tab::before {                                /* molten underline */
  content: ""; position: absolute; left: 10%; right: 10%; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; pointer-events: none;
  background: var(--molten); transform: scaleX(0); opacity: 0;
  box-shadow: 0 0 8px 0 var(--molten-glow), 0 -4px 10px 0 var(--molten-glow);
  transition: transform .4s cubic-bezier(.2, .9, .3, 1.25), opacity .2s;
}
.tabs .tab:hover { color: var(--text); background: linear-gradient(0deg, var(--accent-soft), transparent 70%); }
.tabs .tab[aria-selected="true"] {
  color: var(--accent); border-bottom-color: transparent; box-shadow: none; font-weight: 700;
  background: radial-gradient(ellipse 80% 90% at 50% 115%, var(--accent-soft), transparent 75%);
  text-shadow: 0 0 14px var(--molten-glow);
}
.tabs .tab[aria-selected="true"]::before { transform: scaleX(1); opacity: 1; }
.tabs .seg { background: var(--page); box-shadow: -10px 0 8px var(--page), inset 0 2px 5px rgba(0, 0, 0, .28), 0 0 0 1px var(--frame-line); }

/* stock header */
.stockhead { padding-top: 22px; }
.stockhead h1 { font-family: var(--display); font-size: 27px; font-weight: 700; letter-spacing: -.005em; }
.stockhead .sym { font-family: var(--font); letter-spacing: .09em; font-size: 12px; font-weight: 600; text-transform: uppercase; color: var(--muted); }
.stockhead .price { font-size: 36px; font-weight: 700; letter-spacing: -.01em; line-height: 1.05; }
.stockhead .sub { letter-spacing: .02em; }
.stockhead .chg {                                   /* badges with a soft emerald / ruby glow */
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px; border-radius: 999px; font-size: 14px; font-weight: 700;
  background-color: var(--wash); border: 1px solid var(--border);
  filter: none; -webkit-text-fill-color: currentColor; -webkit-background-clip: border-box; background-clip: border-box; background-image: none;
}
.stockhead .chg.up { color: var(--up); background-color: color-mix(in srgb, var(--up) 15%, transparent); border-color: color-mix(in srgb, var(--up) 55%, transparent); box-shadow: 0 0 16px -2px color-mix(in srgb, var(--up) 55%, transparent), inset 0 1px 0 color-mix(in srgb, var(--up) 30%, transparent); }
.stockhead .chg.down { color: var(--down); background-color: color-mix(in srgb, var(--down) 15%, transparent); border-color: color-mix(in srgb, var(--down) 55%, transparent); box-shadow: 0 0 16px -2px color-mix(in srgb, var(--down) 55%, transparent), inset 0 1px 0 color-mix(in srgb, var(--down) 30%, transparent); }
.stockhead .chg.up::before { content: "\25B2"; font-size: 9px; }
.stockhead .chg.down::before { content: "\25BC"; font-size: 9px; }
.stockhead .statusline { letter-spacing: .02em; }

/* ------------------------------------------------------------------ cards: bullion / vault plates */
.card {
  position: relative;
  padding: 16px 16px 12px;
  border: 1px solid var(--vault-edge); border-radius: 8px;
  background:
    linear-gradient(90deg, transparent, var(--frame-hot) 50%, transparent) 0 0 / 100% 1px no-repeat,          /* glint line along the top edge */
    repeating-linear-gradient(90deg, var(--brush) 0 1px, transparent 1px 3px) 0 1px / 100% 8px no-repeat,       /* brushed-metal strip */
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 9%, transparent), transparent 46px),                /* warm top light */
    radial-gradient(300px circle at var(--mx, -999px) var(--my, -999px), var(--spot), transparent 70%),          /* pointer spotlight */
    var(--grain-card),
    linear-gradient(180deg, var(--surface2), var(--surface) 55%);
  box-shadow: var(--plate-shadow);
  transition: transform .28s cubic-bezier(.2, .8, .2, 1), box-shadow .3s;
  animation: vault-rise .65s cubic-bezier(.16, .9, .25, 1) backwards;
  animation-delay: calc(var(--i, 0) * 45ms);
}
.card::before {                                     /* gold-foil border (shimmers on hover / on entrance) */
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(105deg, var(--foil-a) 0%, var(--foil-b) 14%, var(--foil-hot) 26%, var(--foil-b) 38%, var(--foil-a) 52%, var(--foil-b) 70%, var(--foil-a) 100%);
  background-size: 320% 100%; background-position: 100% 0;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  opacity: .62;
  animation: foil-once 1.5s cubic-bezier(.3, .6, .3, 1) backwards;
  animation-delay: calc(var(--i, 0) * 45ms + 320ms);
  transition: opacity .3s;
}
.card::after {                                      /* engraved inner frame + corner ornaments */
  content: ""; position: absolute; inset: 5px; border-radius: 4px; pointer-events: none;
  border: 1px solid var(--frame-line);
  --c: var(--frame-hot);
  background:
    linear-gradient(var(--c), var(--c)) 0 0 / 14px 2px no-repeat, linear-gradient(var(--c), var(--c)) 0 0 / 2px 14px no-repeat,
    linear-gradient(var(--c), var(--c)) 100% 0 / 14px 2px no-repeat, linear-gradient(var(--c), var(--c)) 100% 0 / 2px 14px no-repeat,
    linear-gradient(var(--c), var(--c)) 0 100% / 14px 2px no-repeat, linear-gradient(var(--c), var(--c)) 0 100% / 2px 14px no-repeat,
    linear-gradient(var(--c), var(--c)) 100% 100% / 14px 2px no-repeat, linear-gradient(var(--c), var(--c)) 100% 100% / 2px 14px no-repeat;
  opacity: .8;
}
@media (hover: hover) {
  .card:hover { transform: translateY(-2px); box-shadow: var(--plate-shadow-hover); }
  .card:hover::before { opacity: 1; animation: foil-hover 1.4s cubic-bezier(.3, .6, .3, 1) 1 both; }
}
@keyframes vault-rise { from { opacity: 0; transform: translateY(18px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes foil-once { from { background-position: 100% 0; opacity: 1; } to { background-position: 0% 0; opacity: .62; } }
@keyframes foil-hover { from { background-position: 100% 0; } to { background-position: 0% 0; } }

.card-head { margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border); position: relative; }
.card-head::after { content: ""; position: absolute; left: 0; bottom: -1px; width: 56px; height: 1px; background: linear-gradient(90deg, var(--frame-hot), transparent); }
.card-head h3 {
  display: inline-flex; align-items: center; gap: 9px; font-family: var(--display); font-size: 15px; font-weight: 700;
  font-variant: small-caps; letter-spacing: .09em; color: var(--title-gold);
}
.card-head h3::before {                             /* diamond stud */
  content: ""; width: 7px; height: 7px; border-radius: 1px; transform: rotate(45deg); flex: none;
  background: linear-gradient(135deg, var(--foil-hot), var(--foil-b) 55%, var(--foil-a));
  box-shadow: 0 0 8px var(--molten-glow);
}
.card-head .latest { font-size: 12px; letter-spacing: .03em; }
.card-head .latest b { font-size: 17px; font-weight: 700; letter-spacing: 0; }
.card .note { color: var(--muted); }

.sect-title {
  display: flex; align-items: center; gap: 12px; font-family: var(--display); font-size: 14px; font-weight: 700; color: var(--title-gold);
  letter-spacing: .16em; opacity: 1; font-variant: small-caps; text-transform: none;
}
.sect-title::before { content: ""; width: 8px; height: 8px; transform: rotate(45deg); flex: none; background: linear-gradient(135deg, var(--foil-hot), var(--foil-b) 55%, var(--foil-a)); box-shadow: 0 0 9px var(--molten-glow); }
.sect-title::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--frame-hot), var(--frame-line) 35%, transparent); opacity: .7; }
.sect-title .ov-note { font-family: var(--font); font-variant: normal; color: var(--muted); }

/* ------------------------------------------------------------------ stat tiles: ingot plates */
.stats { gap: 12px; }
.stat {
  position: relative; overflow: hidden; padding: 12px 14px 11px;
  border: 1px solid var(--vault-edge); border-radius: 7px;
  background:
    linear-gradient(180deg, rgba(255, 240, 190, .14) 0, rgba(255, 240, 190, .02) 7px, transparent 8px),
    radial-gradient(200px circle at var(--mx, -999px) var(--my, -999px), var(--spot), transparent 70%),
    radial-gradient(130% 100% at 0% 0%, var(--ingot-warm), transparent 62%),
    var(--grain-card),
    linear-gradient(155deg, var(--ingot-hi) 0%, var(--ingot-mid) 48%, var(--ingot-lo) 100%);
  box-shadow: inset 0 1px 0 var(--bevel-hi), inset 0 -3px 0 var(--bevel-lo), inset 1px 0 0 var(--bevel-side), inset -1px 0 0 var(--bevel-lo-side),
    0 0 0 1px var(--frame-line), 0 8px 16px -8px rgba(0, 0, 0, .6);
  transition: transform .25s cubic-bezier(.2, .8, .2, 1), box-shadow .3s;
  animation: vault-rise .55s cubic-bezier(.16, .9, .25, 1) backwards;
  animation-delay: calc(var(--k, 0) * 40ms);
}
.stat::before {                                     /* left-edge gold seam, like a stamped bar */
  content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 2px; border-radius: 0 2px 2px 0; pointer-events: none;
  background: linear-gradient(180deg, transparent, var(--foil-b), var(--foil-hot), var(--foil-b), transparent); opacity: .85;
}
.stat::after {                                      /* diagonal shine sweep */
  content: ""; position: absolute; inset: 0; pointer-events: none; transform: translateX(-130%);
  background: linear-gradient(115deg, transparent 38%, var(--ingot-shine) 50%, transparent 62%);
}
.stat.fx-shine::after { animation: ingot-shine 1.15s cubic-bezier(.3, .6, .3, 1) calc(var(--k, 0) * 70ms + 300ms) 1 backwards; }
@keyframes ingot-shine { from { transform: translateX(-130%); } to { transform: translateX(130%); } }
@media (hover: hover) {
  .stat:hover { transform: translateY(-2px); box-shadow: inset 0 1px 0 var(--bevel-hi), inset 0 -3px 0 var(--bevel-lo), inset 1px 0 0 var(--bevel-side), inset -1px 0 0 var(--bevel-lo-side), 0 0 0 1px var(--frame-hot), 0 14px 24px -10px rgba(0, 0, 0, .65), 0 0 22px -6px var(--molten-glow); }
  .stat:hover::after { transform: translateX(130%); transition: transform .85s cubic-bezier(.3, .6, .3, 1); }
}
.stat .l { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.stat .v { font-size: 23px; font-weight: 700; letter-spacing: -.01em; margin-top: 3px; line-height: 1.15; }
.stat .s { color: var(--text2); }
.stat .v.up { color: var(--up); } .stat .v.down { color: var(--down); }

/* ------------------------------------------------------------------ tooltip / legend */
.tip {
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid var(--vault-edge); border-radius: 6px;
  box-shadow: 0 0 0 1px var(--frame-hot), 0 12px 28px -6px rgba(0, 0, 0, .6), 0 0 22px -8px var(--molten-glow);
}
.tip .d { color: var(--title-gold); letter-spacing: .06em; font-weight: 600; }
.tip .r .n { color: var(--text2); }
.legend { color: var(--text2); }
.legend .key.bar { box-shadow: 0 0 6px -1px var(--molten-glow); }

/* ------------------------------------------------------------------ tables */
.tablewrap {
  background: var(--surface); border: 1px solid var(--vault-edge); border-radius: 7px;
  box-shadow: 0 0 0 1px var(--frame-line), inset 0 2px 10px -4px rgba(0, 0, 0, .35);
}
table.t th, table.t td { border-bottom: 1px solid color-mix(in srgb, var(--foil-b) 20%, var(--surface)); }
table.t thead th {
  color: var(--title-gold); font-weight: 700; font-size: 11px; letter-spacing: .1em;
  background: linear-gradient(180deg, var(--surface2), color-mix(in srgb, var(--foil-b) 13%, var(--surface)));
  border-bottom: 1px solid var(--frame-hot); box-shadow: 0 1px 0 var(--vault-edge);
}
table.t th:first-child, table.t td:first-child { background: var(--surface); }
table.t thead th:first-child { background: linear-gradient(180deg, var(--surface2), color-mix(in srgb, var(--foil-b) 13%, var(--surface))); }
table.t tbody tr:hover td { background: color-mix(in srgb, var(--accent) 11%, var(--surface)); }
table.t tbody tr:hover td:first-child { box-shadow: inset 3px 0 0 var(--frame-hot); }
table.t td.neg, table.t td .neg, .neg { color: var(--neg); }
table.t tr.head td { color: var(--title-gold); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); letter-spacing: .1em; font-weight: 700; }
table.t tr.strong td { color: var(--text); }
table.t.clk tr.sel td { background: color-mix(in srgb, var(--accent) 18%, var(--surface)); }
table.t.clk tr.sel td:first-child { box-shadow: inset 3px 0 0 var(--frame-hot); }
.stmt-table .tablewrap, .rat-latest .tablewrap, .rat-defs .tablewrap { background: var(--surface); }

/* ------------------------------------------------------------------ chips as coins (home), pills, misc */
.chip {
  position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center;
  min-width: 68px; padding: 8px 18px; border-radius: 999px; border: 1px solid #5a3d02;
  font-family: var(--display); font-weight: 700; letter-spacing: .06em; color: #2a1c02; text-shadow: 0 1px 0 rgba(255, 244, 190, .6);
  background: radial-gradient(circle at 32% 22%, #fff3c0 0, #f5cd52 32%, #d9a02a 68%, #b07a0c 100%);
  box-shadow: inset 0 0 0 2px rgba(255, 240, 180, .55), inset 0 0 0 3px rgba(122, 82, 4, .55), inset 0 -5px 8px rgba(122, 82, 4, .35),
    0 3px 0 #6d4a04, 0 7px 12px -2px rgba(0, 0, 0, .55);
  transition: transform .16s cubic-bezier(.3, 1.6, .5, 1), box-shadow .2s;
}
.chip:hover { text-decoration: none; background: radial-gradient(circle at 32% 22%, #fff3c0 0, #f5cd52 32%, #d9a02a 68%, #b07a0c 100%); border-color: #5a3d02; }
@media (hover: hover) { .chip:hover { transform: translateY(-3px) rotate(-1.5deg); box-shadow: inset 0 0 0 2px rgba(255, 240, 180, .7), inset 0 0 0 3px rgba(122, 82, 4, .55), inset 0 -5px 8px rgba(122, 82, 4, .35), 0 6px 0 #6d4a04, 0 14px 20px -4px rgba(0, 0, 0, .55), 0 0 22px -2px var(--molten-glow); } }
.chip:active { transform: translateY(2px) scale(.97); box-shadow: inset 0 0 0 2px rgba(255, 240, 180, .55), inset 0 0 0 3px rgba(122, 82, 4, .55), inset 0 3px 8px rgba(96, 62, 0, .55), 0 1px 0 #6d4a04, 0 2px 4px rgba(0, 0, 0, .5); transition-duration: .05s; }
.chips { gap: 14px; margin-top: 20px; }

.vdh-pills button {
  color: var(--text2); font-weight: 600; border: 1px solid var(--vault-edge); border-radius: 999px;
  background: linear-gradient(180deg, var(--btn-hi), var(--btn-lo)); box-shadow: var(--btn-bevel), 0 0 0 1px var(--frame-line);
}
.vdh-pills button:hover { color: var(--text); background: linear-gradient(180deg, var(--btn-hi), var(--btn-lo)); }
.vdh-lede { font-family: var(--display); font-size: 16px; }
.vdh-defs dt, .ov-defs dt { color: var(--title-gold); font-family: var(--display); }
.vdh-warn { border-left: 3px solid var(--frame-hot); }
.pr-tv { border: 1px solid var(--vault-edge); box-shadow: 0 0 0 1px var(--frame-line); }
.pr-tvmsg { border: 1px solid var(--frame-line); background: var(--wash); }
.ov-etfnote, .ov-desc, .stmt-notes { color: var(--text2); }

/* 52-week range bar: molten fill, coin marker */
.ov-pos { height: 8px; border-radius: 4px; background: var(--grid); box-shadow: inset 0 1px 3px rgba(0, 0, 0, .45), 0 0 0 1px var(--frame-line); }
.ov-pos .fill { border-radius: 4px; background: linear-gradient(90deg, var(--foil-a), var(--foil-b) 70%, var(--foil-hot)); box-shadow: 0 0 10px -1px var(--molten-glow); }
.ov-pos .dot { width: 14px; height: 14px; margin: -7px 0 0 -7px; background: radial-gradient(circle at 35% 30%, #fff3c0, #f0c445 50%, #b07a0c); border: 2px solid var(--vault-edge); box-shadow: 0 0 12px var(--molten-glow); }

.msg { color: var(--text2); }
.msg.err { color: var(--down); border: 1px solid var(--down); background: color-mix(in srgb, var(--down) 8%, transparent); }
.spinner { border-color: var(--axis); border-top-color: var(--frame-hot); }

/* ------------------------------------------------------------------ home */
.home { position: relative; }
.home::before {                                     /* faint vault dial behind the heading */
  content: ""; position: absolute; left: 50%; top: -110px; width: 560px; height: 560px; margin-left: -280px; pointer-events: none; opacity: .75; z-index: -1;
  border-radius: 50%;
  background:
    radial-gradient(circle, var(--frame-hot) 0 3px, transparent 4px),
    repeating-conic-gradient(from 0deg, var(--frame-line) 0 1deg, transparent 1deg 15deg),
    repeating-radial-gradient(circle, transparent 0 22px, var(--frame-line) 22px 23px);
  -webkit-mask: radial-gradient(circle, #000 55%, transparent 71%); mask: radial-gradient(circle, #000 55%, transparent 71%);
}
.home h1 { font-size: 38px; line-height: 1.12; letter-spacing: -.01em; font-weight: 700; }
.home p { color: var(--text2); }
.home p.muted { font-variant: small-caps; letter-spacing: .14em; color: var(--title-gold); margin-top: 24px; }
.home > * { animation: vault-rise .7s cubic-bezier(.16, .9, .25, 1) backwards; }
.home > :nth-child(2) { animation-delay: .1s; } .home > :nth-child(3) { animation-delay: .2s; }
.home .chips .chip { animation: vault-rise .6s cubic-bezier(.16, .9, .25, 1) backwards; }
.home .chips .chip:nth-child(1) { animation-delay: .25s; } .home .chips .chip:nth-child(2) { animation-delay: .3s; } .home .chips .chip:nth-child(3) { animation-delay: .35s; }
.home .chips .chip:nth-child(4) { animation-delay: .4s; } .home .chips .chip:nth-child(5) { animation-delay: .45s; } .home .chips .chip:nth-child(n+6) { animation-delay: .5s; }

.home::after {                                      /* a few gold-dust twinkles */
  content: ""; position: absolute; left: -80px; right: -80px; top: -30px; height: 420px; pointer-events: none; z-index: -1;
  --d: var(--frame-hot);
  background:
    radial-gradient(circle, var(--d) 0 1.5px, transparent 3px) 14% 22% / 9px 9px no-repeat,
    radial-gradient(circle, var(--d) 0 1px, transparent 2.5px) 82% 16% / 7px 7px no-repeat,
    radial-gradient(circle, var(--d) 0 2px, transparent 3.5px) 27% 74% / 11px 11px no-repeat,
    radial-gradient(circle, var(--d) 0 1.5px, transparent 3px) 71% 66% / 9px 9px no-repeat,
    radial-gradient(circle, var(--d) 0 1px, transparent 2.5px) 50% 8% / 7px 7px no-repeat,
    radial-gradient(circle, var(--d) 0 1.5px, transparent 3px) 91% 48% / 9px 9px no-repeat;
  animation: twinkle 3.4s ease-in-out infinite alternate;
}
@keyframes twinkle { from { opacity: .15; } to { opacity: .95; } }

/* ------------------------------------------------------------------ page-level entrance */
.main > .msg, .main > .tools, .main > .sect-title, .main > .stats, .main > .vdh-pills, .main > .legend, .main > .stmt-notes, .main > .earn-intro, .main > .rat-intro, .main > p, .main > .ov-etfnote {
  animation: fade-up .5s cubic-bezier(.2, .8, .2, 1) backwards;
}
@keyframes fade-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------------ footer */
.foot { text-align: center; letter-spacing: .04em; padding-top: 22px; position: relative; }
.foot::before { content: "\25C6"; display: block; text-align: center; color: var(--frame-hot); font-size: 11px; margin-bottom: 8px; text-shadow: 0 0 10px var(--molten-glow); }
.foot::after { content: ""; position: absolute; left: 16px; right: 16px; top: 8px; height: 1px; background: linear-gradient(90deg, transparent, var(--frame-hot) 20%, transparent 46%, transparent 54%, var(--frame-hot) 80%, transparent); opacity: .55; }

/* ------------------------------------------------------------------ mobile */
@media (max-width: 640px) {
  .topbar { min-height: 109px; } .tabs { top: 108px; }
  .stockhead .price { font-size: 30px; }
  .stockhead h1 { font-size: 22px; }
  .card { padding: 14px 12px 10px; }
  .card::after { inset: 4px; }
  .stat .v { font-size: 20px; }
  .home h1 { font-size: 29px; }
  .home::before { width: 260px; height: 260px; margin-left: -130px; top: -30px; }
  .stats { gap: 10px; }
}

/* ------------------------------------------------------------------ reduced motion: everything static */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .card:hover, .stat:hover, .chip:hover, .btn:hover { transform: none !important; }
}

/* ============================================================ neutral chrome
   Gold now means DATA: hero numerals, bars, lines.  Interface furniture (headings, tabs, toggles, buttons) is
   ivory/neutral with only a thin gold underline, so the gold in the charts is what catches the eye. */
:root { --title-gold: #453c2b; --sel-bg: color-mix(in srgb, var(--text) 9%, var(--surface)); }
:root[data-theme="dark"] { --title-gold: #d8d0bd; --sel-bg: color-mix(in srgb, var(--text) 14%, var(--surface)); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --title-gold: #d8d0bd; --sel-bg: color-mix(in srgb, var(--text) 14%, var(--surface)); } }
.tabs .tab[aria-selected="true"] { color: var(--text); text-shadow: none; }
#btn-update { color: var(--text); }
.seg button[aria-pressed="true"], .pr-bar .btn[aria-pressed="true"], .pr-main .ctl .btn[aria-pressed="true"], .vdh-pills button[aria-pressed="true"], .btn.on {
  background: var(--sel-bg) !important; color: var(--text); text-shadow: none;
  box-shadow: inset 0 -2px 0 var(--accent-fill), 0 0 0 1px var(--frame-line);
}

/* ============================================================ effects level (header button: Full / Subtle / Off) */
html[data-fx="off"] *, html[data-fx="off"] *::before, html[data-fx="off"] *::after { animation: none !important; transition: none !important; }
html[data-fx="subtle"] .fxl-ring { display: none; }
html[data-fx="subtle"] *::after, html[data-fx="subtle"] *::before { animation-iteration-count: 1 !important; }   /* no endless twinkles */
