/* Daily Analysis pages (built by scripts/build-analysis.mjs from content/analysis/*.md).
   Uses the shared tokens, tls-base.css and the landing page's site.css (nav,
   footer, fields, chips, tags, textures). Motion: transform and opacity only,
   plus SVG stroke-dashoffset for line drawing (and clip-path wipes on the chart
   pictures and bias badges). Reveals play once; js/analysis.js adds .on. */

/* ---------- page: slow gold-line drift (desktop), scroll progress ---------- */
.an-body-page { background: transparent; }
/* entrances that slide in sideways never widen the page (clip keeps the sticky pair bar working) */
.an-body-page main { overflow-x: clip; }
.an-drift { position: fixed; inset: 0; z-index: -1; pointer-events: none; background: var(--bg); overflow: hidden; }
.an-drift::before { content: ""; position: absolute; inset: -80px; background: url("../shared/assets/textures/gold-mesh.webp") 0 0 / 900px auto repeat; opacity: .05; }
@media (min-width: 1024px) and (hover: hover) and (prefers-reduced-motion: no-preference) {
  .an-drift::before { animation: anDrift 60s linear infinite alternate; }
}
@keyframes anDrift { to { transform: translate3d(-64px, -48px, 0); } }

.scroll-progress { position: fixed; left: 0; right: 0; top: 0; z-index: 70; height: 2px; pointer-events: none; }
.scroll-progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-hi)); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); }
@supports (animation-timeline: scroll()) {
  .scroll-progress i { animation: anProgress linear both; animation-timeline: scroll(root block); }
}
@keyframes anProgress { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---------- hero: header loop behind a dark gradient ---------- */
.an-hero { position: relative; isolation: isolate; overflow: hidden; border-bottom: 1px solid var(--line);
  padding: calc(var(--nav-h) + var(--safe-t) + clamp(32px, 6vw, 80px)) 0 clamp(32px, 5vw, 60px); }
.an-hero-media { position: absolute; inset: 0; z-index: -1; background: #050608; }
.an-hero-media > video, .an-hero-still, .an-hero-still img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.an-hero-still img { opacity: .7; }
.an-hero-shade { position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(13, 15, 18, .96) 0, rgba(13, 15, 18, .82) 42%, rgba(13, 15, 18, .38) 100%),
              linear-gradient(180deg, rgba(13, 15, 18, .2) 0, rgba(13, 15, 18, 0) 50%, var(--bg) 100%); }
@media (max-width: 767px) {
  .an-hero-shade { background: linear-gradient(180deg, rgba(13, 15, 18, .72) 0, rgba(13, 15, 18, .88) 45%, var(--bg) 100%); }
}
/* scrolling past: the header settles to .9 behind a blur (desktop) or just fades (phones) */
.an-hero-blur { position: absolute; inset: 0; z-index: 3; pointer-events: none; opacity: var(--hb, 0);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.an-hero-in { position: relative; z-index: 2; transform-origin: 20% 30%; }
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: scroll()) {
    .an-hero-in { animation: anHeroAway linear both; animation-timeline: scroll(root block); animation-range: 0 90vh; }
    .an-hero-blur { animation: anHeroBlur linear both; animation-timeline: scroll(root block); animation-range: 0 90vh; }
    @media (max-width: 1023px) { .an-hero-in { animation-name: anHeroFade; } .an-hero-blur { animation: none; } }
  }
}
@keyframes anHeroAway { to { transform: scale(.9); opacity: .4; } }
@keyframes anHeroFade { to { opacity: .25; } }
@keyframes anHeroBlur { to { opacity: 1; } }

.an-hero-in > * + * { margin-top: var(--s4); }
.an-hero .eyebrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-bottom: 0; }
.today-tag { padding: 3px 9px; border-radius: var(--r-pill); background: var(--gold); color: var(--gold-ink); letter-spacing: .08em; }
.an-title { max-width: 22ch; font-size: clamp(2rem, 1.3rem + 2.8vw, 3.4rem); text-wrap: balance; }
/* the gold underline draws left to right */
.an-title::after { content: ""; display: block; width: min(220px, 50%); height: 2px; margin-top: 18px; border-radius: 2px;
  background: linear-gradient(90deg, var(--gold), rgba(212, 168, 75, 0)); transform-origin: 0 50%; }
.an-hero .lead { max-width: 62ch; }
/* date and title rise in line by line (16 px, 80 ms apart) */
@keyframes anRise { from { opacity: 0; transform: translate3d(0, 16px, 0); } }
@keyframes anSpring { from { opacity: 0; transform: scale(.6); } }
.js .an-rise { animation: anRise 640ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 80ms); }
/* the title's words are already separate in the page (so its text is never
   rewritten); js/analysis.js gives each word its line number (--line) */
.an-title .w { display: inline-block; }
.js .an-title .w { animation: anRise 640ms var(--ease-out) both; animation-delay: calc((var(--i, 1) + var(--line, 0)) * 80ms); }
.js .an-title::after { animation: drawX 800ms var(--ease-out) 420ms both; }

/* "Today's market mood": the overall bias, popping in with a soft spring */
.mood { display: inline-flex; align-items: center; gap: 10px; padding: 5px 16px 5px 5px; border-radius: var(--r-pill);
  border: 1px solid var(--line-2); background: rgba(13, 15, 18, .62); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.js .mood { animation: anSpring 900ms cubic-bezier(.34, 1.56, .64, 1) both; animation-delay: calc(var(--i, 0) * 80ms + 120ms); }
.mood .bias-art { width: 42px; height: 42px; }
.mood-label { font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.mood b { font-weight: 700; }
.mood.bull b { color: var(--gold-hi); }
.mood.bear b { color: #9DB8FF; }

.an-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; font-size: 14px; color: var(--muted); }
.an-meta time { color: var(--fg-2); font-variant-numeric: tabular-nums; }
/* today's analysis: a soft pulsing dot by "Last updated" */
.live-dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--good); }
.live-dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--good); animation: tls-ping 2.2s var(--ease-out) infinite; }
.an-share { display: flex; flex-wrap: wrap; gap: var(--s2); }
.an-share .btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
/* the disclaimer is never animated: it shows at once */
.an-disclaimer { display: flex; align-items: center; gap: 10px; max-width: 640px; padding: 12px 14px; border-radius: var(--r-btn);
  border: 1px solid rgba(230, 160, 40, .4); background: rgba(230, 160, 40, .08); color: #F2CF8E; font-size: 14px; font-weight: 600; }
.an-disclaimer svg { flex: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* ---------- key data notification (CPI, PPI, NFP, FOMC, any High-impact event) ---------- */
.key-alert { display: flex; align-items: flex-start; gap: 14px; max-width: 720px; padding: 14px 16px; border-radius: var(--r-card);
  border: 1px solid rgba(217, 68, 58, .5); background: linear-gradient(120deg, rgba(217, 68, 58, .16), rgba(13, 15, 18, .72) 70%);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.ka-bell { position: relative; flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: rgba(217, 68, 58, .2); color: #FFB4AE; }
.ka-bell svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transform-origin: 50% 12%; animation: anRing 3.2s ease-in-out infinite; }
.ka-bell::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 1px solid rgba(217, 68, 58, .7); animation: tls-ping 2.4s var(--ease-out) infinite; }
@keyframes anRing { 0%, 78%, 100% { transform: rotate(0); } 82% { transform: rotate(14deg); } 86% { transform: rotate(-12deg); } 90% { transform: rotate(8deg); } 94% { transform: rotate(-4deg); } }
.ka-title { font-size: 15px; }
.ka-title b { color: #FFB4AE; margin-right: 6px; }
.ka-sub { color: var(--fg-2); font-size: 14px; }
.ka-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.ka-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 14.5px; }
.ka-list time { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--fg); }
.ka-list b { font-weight: 600; color: var(--fg); }
.ka-count:empty, .ev-count:empty { display: none; }
.ka-count, .ev-count { padding: 2px 9px; border-radius: var(--r-pill); background: rgba(212, 168, 75, .16); border: 1px solid rgba(212, 168, 75, .45); color: var(--gold-hi);
  font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ka-count.done, .ev-count.done { background: none; border-color: var(--line-2); color: var(--muted); }
.key-badge { display: inline-flex; align-items: center; gap: 5px; flex: none; padding: 3px 8px; border-radius: 6px; border: 1px solid rgba(217, 68, 58, .5);
  background: rgba(217, 68, 58, .14); color: #FFB4AE; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.key-badge svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* ---------- pair selector: sticks under the top bar, a sliding gold pill ---------- */
.pair-bar { position: sticky; top: calc(var(--nav-h) + var(--safe-t)); z-index: 30; padding: 10px 0; border-bottom: 1px solid var(--line);
  background: rgba(13, 15, 18, .84); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.pb-track { position: relative; display: inline-flex; gap: 4px; max-width: 100%; padding: 4px; overflow-x: auto; scrollbar-width: none;
  border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--bg-sunk); }
.pb-track::-webkit-scrollbar { display: none; }
.pb-chip { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 18px; border-radius: var(--r-pill);
  text-decoration: none; white-space: nowrap; font-size: 14px; font-weight: 650; color: var(--fg-2); }
.pb-chip.on { color: var(--gold-ink); }
.pb-chip.on .bias-dot { background: var(--gold-ink); }
.pb-pill { position: absolute; z-index: 0; left: 0; top: 4px; bottom: 4px; width: 100px; border-radius: var(--r-pill); background: var(--gold);
  transform-origin: 0 50%; transform: translateX(var(--x, 4px)) scaleX(var(--s, 0)); transition: transform var(--t-slow) var(--ease-out); }

/* ---------- headings, written notes, news ---------- */
.an-h2 { margin-bottom: var(--s5); font-size: clamp(1.4rem, 1.1rem + 1.2vw, 2rem); }
.an-notes { padding-bottom: 0; }
.prose { max-width: 72ch; font-size: clamp(16px, 15px + .3vw, 18px); line-height: 1.7; color: var(--fg-2); }
.prose > * + * { margin-top: 1em; }
.prose h3 { margin-top: 1.7em; color: var(--fg); font-size: clamp(1.15rem, 1rem + .6vw, 1.4rem); }
.prose h3:first-child { margin-top: 0; }
.prose h4 { margin-top: 1.4em; color: var(--fg); font-size: 1.05rem; }
.prose strong { color: var(--fg); font-weight: 650; }
.prose a { color: var(--gold-hi); }
.prose ul, .prose ol { margin-block: 0; padding-left: 1.3em; }
.prose li + li { margin-top: .35em; }
.prose blockquote { margin-inline: 0; padding: 2px 0 2px 16px; border-left: 2px solid var(--gold); color: var(--fg); }
.prose code { padding: 1px 6px; border-radius: 6px; background: var(--surface-2); color: var(--fg); font-family: var(--font-mono); font-size: .88em; }
.prose hr { margin: 2em 0; border: 0; border-top: 1px solid var(--line-2); }
.md-pic { margin-inline: 0; }
.md-pic .zoom { overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-card); }
.md-pic img { width: 100%; height: auto; }
.md-pic figcaption { margin-top: 8px; font-size: 13.5px; color: var(--muted); }

.an-news { padding-bottom: 0; }
.news-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); max-width: 820px; }
.news-list li { display: flex; align-items: flex-start; gap: var(--s3); padding: 14px 16px; border-radius: var(--r-btn); background: var(--surface); border: 1px solid var(--line); }
.news-list time { flex: none; min-width: 4.6em; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--gold-hi); }
.nl-dot { flex: none; width: 8px; height: 8px; margin: 8px 6px 0 2px; border-radius: 50%; background: var(--gold); }
.news-list p { flex: 1; min-width: 0; color: var(--fg); }
.news-list li.key { border-color: rgba(217, 68, 58, .45); background: linear-gradient(90deg, rgba(217, 68, 58, .09), transparent 60%), var(--surface); }
@media (max-width: 559px) { .news-list li { flex-wrap: wrap; } .news-list p { flex-basis: 100%; order: 3; } }

/* ---------- weekly outlook ---------- */
.wk-banner { overflow: hidden; margin-bottom: var(--s4); border: 1px solid var(--line); border-radius: var(--r-card); aspect-ratio: 21 / 9; background: #0A0B0E; }
.wk-banner picture, .wk-banner img { display: block; width: 100%; height: 100%; object-fit: cover; }
.wk-strip { list-style: none; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 42%); gap: var(--s3); margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter) 6px;
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter); scrollbar-width: none; }
.wk-strip::-webkit-scrollbar { display: none; }
@media (min-width: 1024px) { .wk-strip { margin: 0; padding: 0; overflow: visible; grid-auto-columns: 1fr; } }
.wk-strip li { scroll-snap-align: start; }
.js .wk-strip li { opacity: 0; transform: translate3d(24px, 0, 0); }
.js .wk-strip.on li { opacity: 1; transform: none; transition: opacity 500ms var(--ease-out), transform 500ms var(--ease-out); transition-delay: calc(var(--k) * 70ms); }
.wk-card { display: flex; flex-direction: column; gap: 6px; height: 100%; min-height: 148px; padding: 14px; border-radius: var(--r-card); border: 1px solid var(--line); background: var(--surface); text-decoration: none; }
a.wk-card:hover { border-color: rgba(212, 168, 75, .45); }
.wk-strip li[aria-current] .wk-card { border-color: rgba(212, 168, 75, .65); background: linear-gradient(160deg, rgba(212, 168, 75, .09), transparent 60%), var(--surface); }
.wk-day { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--gold-hi); }
.wk-date { font-weight: 700; color: var(--fg); }
.wk-card b { font-weight: 600; font-size: 14.5px; line-height: 1.4; }
.wk-card p { font-size: 14px; color: var(--fg-2); }
.wk-card .wk-none { color: var(--muted); }
.wk-pairs { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12.5px; font-weight: 600; color: var(--fg-2); }

/* ---------- pair cards ---------- */
.pair-grid { display: grid; gap: var(--s4); }
@media (min-width: 900px) { .pair-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }
.pair-card { display: flex; flex-direction: column; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface);
  scroll-margin-top: calc(var(--nav-h) + var(--safe-t) + 72px); }
.js .pair-card.reveal { transition-delay: calc(var(--d, 0) * 60ms); }

/* cover art header, a slow Ken Burns on desktop, the 3D bias icon floating */
.pc-cover { position: relative; overflow: hidden; aspect-ratio: 16 / 7; background: #0A0B0E; }
.pc-cover-pic, .pc-cover-pic img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pc-cover-shade { position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(8, 9, 11, .92) 0, rgba(8, 9, 11, .62) 40%, rgba(8, 9, 11, .08) 78%), linear-gradient(0deg, var(--surface) 0, rgba(21, 24, 29, 0) 48%); }
.pc-cover-in { position: absolute; left: var(--s4); bottom: var(--s4); display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.pc-cover-in h3 { font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.1rem); letter-spacing: .01em; text-shadow: 0 2px 14px rgba(0, 0, 0, .6); }
/* top-right corner, small, so it never sits on the cover's own subject */
.pc-icon { position: absolute; right: 12px; top: 12px; width: clamp(60px, 15%, 92px); }
.pc-icon .bias-art { width: 100%; height: auto; aspect-ratio: 1; animation: anFloat 5s var(--ease-in-out) infinite; }
@keyframes anFloat { 0%, 100% { transform: translate3d(0, -5px, 0); } 50% { transform: translate3d(0, 5px, 0); } }
@media (min-width: 1024px) and (hover: hover) and (prefers-reduced-motion: no-preference) {
  .pair-card.on .pc-cover-pic img { animation: anKenBurns 12s ease-out forwards; }
}
@keyframes anKenBurns { from { transform: scale(1); } to { transform: scale(1.05); } }

/* the bias icon: the 3D Higgsfield picture when it exists, a drawn badge until then */
.bias-art { position: relative; display: inline-grid; place-items: center; flex: none; }
.bias-art > img, .bias-art > video { grid-area: 1 / 1; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .55)); }
.bias-art > video { opacity: 0; }
.bias-art > video.playing { opacity: 1; }
.bias-svg { grid-area: 1 / 1; display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .14);
  background: radial-gradient(circle at 35% 28%, rgba(255, 255, 255, .28), transparent 55%), var(--surface-2); box-shadow: 0 10px 24px rgba(0, 0, 0, .45); }
.bias-svg svg { width: 58%; height: 58%; }
.bias-art.bull .bias-svg { background: radial-gradient(circle at 35% 28%, rgba(255, 255, 255, .45), transparent 55%), linear-gradient(160deg, #F1D58E, #B8862C); }
.bias-art.bull .bias-svg svg { fill: var(--gold-ink); }
.bias-art.bear .bias-svg { background: radial-gradient(circle at 35% 28%, rgba(255, 255, 255, .4), transparent 55%), linear-gradient(160deg, #6F96FF, #1F48B8); }
.bias-art.bear .bias-svg svg { fill: #fff; }
.bias-art.flat .bias-svg { background: radial-gradient(circle at 35% 28%, rgba(255, 255, 255, .5), transparent 55%), linear-gradient(160deg, #E4E7EC, #8C929C); }
.bias-art.flat .bias-svg svg { fill: none; stroke: #1B1F25; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }

/* the badge fills in: an outlined copy underneath, the filled copy wiped in on top */
.bias { position: relative; display: inline-grid; border-radius: var(--r-pill); font-size: 12.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.bias-out, .bias-in { grid-area: 1 / 1; display: inline-flex; align-items: center; gap: 7px; padding: 6px 13px; border-radius: inherit; }
.bias-out { border: 1px solid currentColor; background: rgba(13, 15, 18, .55); }
.bias.bull { color: var(--gold-hi); }
.bias.bear { color: #9DB8FF; }
.bias.flat { color: var(--fg-2); }
.bias-in { border: 1px solid transparent; clip-path: inset(0 100% 0 0); }
.bias.bull .bias-in { background: var(--gold); color: var(--gold-ink); }
.bias.bear .bias-in { background: var(--blue); color: #fff; }
.bias.flat .bias-in { background: var(--surface-2); color: var(--fg); border-color: var(--line-2); }
.bias-ico { display: inline-block; width: 0; height: 0; border-inline: 5px solid transparent; }
.bias.bull .bias-ico { border-bottom: 7px solid currentColor; }
.bias.bear .bias-ico { border-top: 7px solid currentColor; }
.bias.flat .bias-ico { width: 10px; height: 2px; border: 0; background: currentColor; }
.pair-card.on .bias-in, .no-js .bias-in { clip-path: inset(0 0 0 0); }
.pair-card.on .bias-in { transition: clip-path 600ms var(--ease-out) 250ms; }
.pair-card.on .bias.bull .bias-in .bias-ico { animation: anArrowUp 700ms var(--ease-out) 450ms both; }
.pair-card.on .bias.bear .bias-in .bias-ico { animation: anArrowDown 700ms var(--ease-out) 450ms both; }
.pair-card.on .bias.flat .bias-in .bias-ico { animation: anSettle 800ms cubic-bezier(.34, 1.56, .64, 1) 450ms both; }
@keyframes anArrowUp { from { opacity: 0; transform: translate3d(0, 8px, 0); } }
@keyframes anArrowDown { from { opacity: 0; transform: translate3d(0, -8px, 0); } }
@keyframes anSettle { from { opacity: 0; transform: scaleX(0); } }

/* bias meter + confidence bar */
.pc-gauges { display: flex; align-items: center; gap: var(--s4); padding: var(--s3) var(--s4) 0; }
.meter { flex: none; width: 112px; height: auto; overflow: visible; }
.m-arc { fill: none; stroke-width: 7; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; opacity: .28; }
.m-bear { stroke: var(--blue); }
.m-flat { stroke: #8E949E; }
.m-bull { stroke: var(--gold); }
.meter.bull .m-bull, .meter.bear .m-bear, .meter.flat .m-flat { opacity: 1; }
.needle { fill: var(--fg); transform-box: view-box; transform-origin: 60px 60px; transform: rotate(-90deg); }
.pair-card.on .m-arc, .no-js .m-arc { stroke-dashoffset: 0; }
.pair-card.on .m-arc { transition: stroke-dashoffset 700ms var(--ease-out); }
.pair-card.on .m-flat { transition-delay: 120ms; }
.pair-card.on .m-bull { transition-delay: 240ms; }
.pair-card.on .needle, .no-js .needle { transform: rotate(var(--a)); }
.pair-card.on .needle { transition: transform 1000ms cubic-bezier(.34, 1.56, .64, 1) 350ms; }
.conf { flex: 1; display: grid; grid-template-columns: auto minmax(40px, 1fr) auto; align-items: center; gap: 10px; min-width: 0; font-size: 13px; }
.conf-label { font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.conf-bar { position: relative; height: 6px; overflow: hidden; border-radius: 3px; background: var(--surface-2); }
.conf-bar i { position: absolute; inset: 0; border-radius: 3px; background: linear-gradient(90deg, var(--gold), var(--gold-hi)); transform-origin: 0 50%; transform: scaleX(0); }
.pair-card.on .conf-bar i, .no-js .conf-bar i { transform: scaleX(var(--c)); }
.pair-card.on .conf-bar i { transition: transform 900ms var(--ease-out) 300ms; }
.conf b { font-variant-numeric: tabular-nums; color: var(--fg); }

/* chart picture: shimmer until loaded, then a clip-path wipe, 1.03 -> 1, one gold sheen */
.pair-chart { margin: var(--s3) 0 0; }
.zoom { position: relative; display: block; width: 100%; padding: 0; overflow: hidden; border: 0; background: #0A0B0E; cursor: zoom-in; }
.pair-chart img { width: 100%; aspect-ratio: 16 / 9; object-fit: contain; background: #0A0B0E; }
/* the wipe: a cover panel slides off the picture (the picture itself stays fully
   laid out, so the browser's lazy loading still sees it), while it settles 1.03 -> 1 */
.js .pair-chart img { transform: scale(1.03); }
.js .pair-chart.on img { transform: none; transition: transform 1200ms var(--ease-out); }
.js .pair-chart .zoom::before { content: ""; position: absolute; inset: 0; z-index: 2; background: var(--surface-2); transform-origin: 100% 50%; }
.js .pair-chart.on .zoom::before { transform: scaleX(0); transition: transform 900ms var(--ease-out); }
.sheen { position: absolute; inset: 0; z-index: 3; pointer-events: none; background: linear-gradient(100deg, transparent 32%, rgba(230, 194, 122, .3) 50%, transparent 68%); transform: translateX(-120%); }
.pair-chart.on .sheen { animation: anSheen 1200ms var(--ease-in-out) 650ms both; }
@keyframes anSheen { to { transform: translateX(120%); } }
.js .pair-chart:not(.loaded) .zoom::after, .mini.loading::after { content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .07) 50%, transparent 70%); animation: anSkel 1.4s linear infinite; }
@keyframes anSkel { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.zoom-hint { position: absolute; right: 10px; bottom: 10px; z-index: 4; display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: var(--r-pill);
  border: 1px solid var(--line-2); background: rgba(13, 15, 18, .82); font-size: 12.5px; font-weight: 600; color: var(--fg); }
.zoom-hint svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.pair-nochart { display: grid; place-items: center; margin-top: var(--s3); aspect-ratio: 16 / 9; text-decoration: none; font-weight: 600; color: var(--gold-hi);
  background: radial-gradient(70% 70% at 50% 50%, rgba(212, 168, 75, .1), transparent 70%), #0A0B0E; }
.pair-body { display: grid; gap: var(--s5); padding: var(--s4); }

/* key levels: price ladder next to the table (stacked on phones) */
.lv-block { display: grid; gap: var(--s4); }
@media (min-width: 560px) { .lv-block { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; } }
.ladder { position: relative; height: 196px; margin-left: 6px; }
.ladder-rail { position: absolute; left: 0; top: 0; bottom: 0; width: 2px; border-radius: 2px; transform-origin: 50% 0; transform: scaleY(0);
  background: linear-gradient(180deg, rgba(47, 107, 255, .7), rgba(255, 255, 255, .14) 50%, rgba(212, 168, 75, .7)); }
.lv-block.on .ladder-rail, .no-js .ladder-rail { transform: none; }
.lv-block.on .ladder-rail { transition: transform 600ms var(--ease-out); }
.rung { position: absolute; left: 0; right: 0; top: var(--y); display: flex; align-items: center; height: 24px; margin-top: -12px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.rung.res { color: #9DB8FF; }
.rung.sup { color: var(--gold-hi); }
.rung.now { color: var(--fg); cursor: default; }
.rung-line { position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: currentColor; opacity: .5; transform-origin: 0 50%; transform: scaleX(0); }
.rung.now .rung-line { background: repeating-linear-gradient(90deg, currentColor 0 6px, transparent 6px 10px); opacity: .85; }
.lv-block.on .rung-line, .no-js .rung-line { transform: scaleX(1); }
.lv-block.on .rung-line { transition: transform 600ms var(--ease-out) calc(var(--k) * 80ms + 150ms); }
.rung-tag, .rung-val { position: relative; z-index: 1; padding: 1px 8px; border-radius: 6px; background: var(--surface); font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.rung-tag { margin-left: 12px; }
.rung-val { margin-left: auto; color: var(--fg); }
.js .rung-tag, .js .rung-val { opacity: 0; }
.js .lv-block.on .rung-tag, .js .lv-block.on .rung-val { opacity: 1; transition: opacity 400ms var(--ease-out) calc(var(--k) * 80ms + 300ms); }
/* the price marker pulses; a level within 0.1% of it glows */
.rung.now::before { content: ""; position: absolute; left: -5px; top: 50%; z-index: 2; width: 12px; height: 12px; margin-top: -6px; border-radius: 50%; background: var(--fg); box-shadow: 0 0 0 3px var(--surface); }
.rung.now::after { content: ""; position: absolute; left: -5px; top: 50%; z-index: 1; width: 12px; height: 12px; margin-top: -6px; border-radius: 50%; background: var(--fg); animation: tls-ping 2s var(--ease-out) infinite; }
.rung.near .rung-val::after { content: ""; position: absolute; inset: -4px; z-index: -1; border-radius: 9px; background: radial-gradient(closest-side, rgba(212, 168, 75, .55), transparent); animation: anNear 2.4s ease-in-out infinite; }
@keyframes anNear { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
/* tap or hover a level: its line and its table row light up together */
.rung.hl .rung-line { opacity: 1; }
.rung.sup.hl .rung-tag, .rung.sup.hl .rung-val { background: var(--gold-hi); color: var(--gold-ink); }
.rung.res.hl .rung-tag, .rung.res.hl .rung-val { background: #9DB8FF; color: #0B1638; }

.levels { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 15px; }
.levels caption { padding-bottom: 6px; text-align: left; font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.levels th, .levels td { padding: 9px 8px; border-top: 1px solid var(--line); text-align: left; }
.levels th { width: 3.4em; padding-left: 0; font-weight: 700; }
.levels tr { cursor: pointer; outline: none; }
.levels tr.res th { color: #9DB8FF; }
.levels tr.sup th { color: var(--gold-hi); }
.levels tr.now { cursor: default; }
.levels tr.now th, .levels tr.now td { color: var(--fg-2); border-top-style: dashed; }
.levels td { font-weight: 650; color: var(--fg); }
.levels .lv-kind { padding-right: 0; text-align: right; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.levels tr.near .lv-kind { color: var(--gold-hi); font-weight: 650; }
.levels tr.res + tr.sup > * { border-top: 2px solid var(--line-2); }
.levels tr.hl > *, .levels tr:focus-visible > * { background: rgba(212, 168, 75, .1); }

/* named zones: a band at the zone's true height, labelled with its name and range */
.ladder.zones { height: 236px; }
.zone-band { position: absolute; left: 10px; right: 0; top: var(--t); height: var(--h); min-height: 3px; border-radius: 3px;
  background: rgba(157, 184, 255, .13); box-shadow: inset 2px 0 0 #9DB8FF; opacity: 0; }
.zone-band.sup { background: rgba(212, 168, 75, .14); box-shadow: inset 2px 0 0 var(--gold-hi); }
.zone-band.near { animation: anNear 2.4s ease-in-out infinite; }
.lv-block.on .zone-band, .no-js .zone-band { opacity: 1; }
.lv-block.on .zone-band { transition: opacity 500ms var(--ease-out) calc(var(--k) * 70ms + 100ms); }
.zone-band.hl { background: rgba(157, 184, 255, .3); }
.zone-band.sup.hl { background: rgba(212, 168, 75, .32); }
.ladder.zones .rung-line { opacity: .28; }
.ladder.zones .rung-tag { max-width: 54%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.levels.zones th { width: auto; padding-right: 10px; font-size: 13.5px; }
.levels.zones td { white-space: nowrap; }
/* your call on a zone: Buy / Sell with its risk, Scalp only, … once broken */
.zone-acts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.za { padding: 1px 7px; border-radius: var(--r-pill); font-size: 11px; font-weight: 700; letter-spacing: .02em; white-space: nowrap;
  color: var(--fg-2); background: rgba(255, 255, 255, .06); border: 1px solid var(--line); }
.za.buy { color: var(--gold-hi); background: rgba(212, 168, 75, .14); border-color: rgba(212, 168, 75, .35); }
.za.sell { color: #9DB8FF; background: rgba(157, 184, 255, .14); border-color: rgba(157, 184, 255, .35); }
.za.flip { border-style: dashed; }
/* phones: the distance sits under the range (no third column), so the table always fits */
.lv-dist { display: none; }
@media (max-width: 520px) {
  .levels.zones .lv-kind { display: none; }
  .levels.zones td { padding-right: 0; text-align: right; }
  .levels.zones .lv-dist { display: block; margin-top: 3px; font-size: 12px; font-weight: 500; color: var(--muted); }
  .levels.zones tr.near .lv-dist { color: var(--gold-hi); font-weight: 650; }
  .za { white-space: normal; }
}

/* structure: trendlines, patterns, candles, as tagged lines */
.structure { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.structure li { display: flex; align-items: baseline; gap: 10px; font-size: 15px; line-height: 1.5; color: var(--fg-2); }
.st-tag { flex: none; display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px 2px 7px; border-radius: var(--r-pill);
  font-size: 12px; font-weight: 700; letter-spacing: .02em; color: var(--fg); background: rgba(255, 255, 255, .06); border: 1px solid var(--line); }
.st-tag svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.st-tag.st-tl { color: #9DB8FF; }
.st-tag.st-pt { color: var(--gold-hi); }
.st-tag.st-en { color: #7FD6B3; }
.st-tag.st-en svg rect { fill: currentColor; fill-opacity: .25; }
.st-text { min-width: 0; color: var(--fg); }

/* plan: a checklist whose gold ticks draw in */
.plan h4, .scen h4 { margin-bottom: 10px; font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.checks li { display: flex; align-items: flex-start; gap: 10px; color: var(--fg-2); font-size: 15px; line-height: 1.55; }
.checks strong { color: var(--fg); }
.tick { flex: none; width: 18px; height: 18px; margin-top: 2px; fill: none; stroke: var(--gold); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.js .checks li { opacity: 0; transform: translate3d(0, 8px, 0); }
.js .tick path { stroke-dasharray: 1; stroke-dashoffset: 1; }
.js .plan.on .checks li { opacity: 1; transform: none; transition: opacity 400ms var(--ease-out), transform 400ms var(--ease-out); transition-delay: calc(var(--k) * 90ms); }
.js .plan.on .tick path { stroke-dashoffset: 0; transition: stroke-dashoffset 500ms var(--ease-out) calc(var(--k) * 90ms + 200ms); }
/* If / Then scenarios flip in like cards */
.scen-grid { display: grid; gap: var(--s2); perspective: 900px; }
.scen-card { display: grid; gap: 6px; padding: 12px 14px; border-radius: var(--r-btn); border: 1px solid var(--line-2); background: var(--bg-sunk); transform-origin: 50% 0; }
.js .scen-card { opacity: 0; transform: rotateX(-82deg); }
.js .scen.on .scen-card { opacity: 1; transform: none; transition: transform 750ms cubic-bezier(.34, 1.3, .64, 1), opacity 300ms var(--ease-out); transition-delay: calc(var(--k) * 130ms); }
.scen-card p { font-size: 14.5px; color: var(--fg); line-height: 1.5; }
.scen-card span { display: inline-block; margin-right: 8px; padding: 1px 8px; border-radius: 5px; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.scen-if span { background: var(--surface-2); color: var(--fg-2); }
.scen-then span { background: rgba(212, 168, 75, .16); color: var(--gold-hi); }

.pair-actions { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: auto; padding: 0 var(--s4) var(--s4); }
.pair-actions:empty { display: none; }
.mini { position: relative; overflow: hidden; border-top: 1px solid var(--line); background: #0A0B0E; }
/* color-scheme: light = the same as the widget's own page, so the browser keeps its
   transparent background (a dark page around a light-scheme frame paints it white) */
.mini iframe { display: block; width: 100%; height: 230px; border: 0; color-scheme: light; }
.mini-note { padding: 8px var(--s4) 12px; font-size: 12.5px; color: var(--muted); }

/* ---------- events timeline ---------- */
.an-events .ev-note { margin: -12px 0 var(--s4); }
.timeline { position: relative; list-style: none; display: grid; gap: var(--s3); max-width: 780px; margin: 0; padding: 0 0 0 32px; }
.tl-line { position: absolute; left: 9px; top: 10px; bottom: 10px; width: 2px; border-radius: 2px; background: linear-gradient(180deg, var(--gold), rgba(212, 168, 75, .12));
  transform-origin: 50% 0; transform: scaleY(var(--p, 0)); }
@supports (animation-timeline: view()) {
  .timeline { view-timeline: --an-tl block; }
  .tl-line { animation: drawY linear both; animation-timeline: --an-tl; animation-range: entry 10% cover 55%; }
}
.ev { position: relative; display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: 12px 14px; border-radius: var(--r-btn); border: 1px solid var(--line); background: var(--surface); }
.ev-dot { position: absolute; left: -28px; top: 50%; width: 12px; height: 12px; margin-top: -6px; border-radius: 50%; border: 2px solid var(--gold); background: var(--bg); }
.js .ev-dot { transform: scale(0); }
.js .timeline.on .ev-dot { transform: scale(1); transition: transform 500ms cubic-bezier(.34, 1.56, .64, 1) calc(var(--k) * 100ms + 150ms); }
.ev.high .ev-dot { border-color: var(--danger); background: var(--danger); }
.ev.high .ev-dot::after { content: ""; position: absolute; inset: -9px; border-radius: 50%; background: radial-gradient(closest-side, rgba(217, 68, 58, .6), transparent); animation: anRedPulse 2.6s ease-in-out infinite; }
@keyframes anRedPulse { 0%, 100% { opacity: .2; transform: scale(.8); } 50% { opacity: .9; transform: scale(1.25); } }
.ev.past { opacity: .74; }                       /* dimmed, but every label still passes contrast */
.ev.past .ev-dot { opacity: .5; }
.ev.next { border-color: rgba(212, 168, 75, .55); }
.ev-main { display: flex; align-items: baseline; gap: var(--s3); min-width: 0; }
.ev-time { flex: none; min-width: 4.6em; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--gold-hi); }
.ev-name { min-width: 0; color: var(--fg); }
.ev-side { display: flex; flex: none; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 6px; }
.impact { flex: none; padding: 3px 8px; border-radius: 6px; border: 1px solid var(--line-2); font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--fg-2); }
.impact.high { border-color: rgba(217, 68, 58, .55); color: #FFB4AE; }
@media (max-width: 559px) { .ev { flex-wrap: wrap; } .ev-side { justify-content: flex-start; } }

/* ---------- video ---------- */
.yt { position: relative; display: block; width: 100%; max-width: 880px; aspect-ratio: 16 / 9; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-card); background: #000; cursor: pointer; }
.yt img { width: 100%; height: 100%; object-fit: cover; opacity: .85; }
.yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.yt .play { position: absolute; left: 50%; top: 50%; display: grid; place-items: center; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .2); background: rgba(13, 15, 18, .72); }
.yt .play::after { content: ""; margin-left: 5px; border-left: 17px solid var(--fg); border-block: 11px solid transparent; }

/* ---------- archive: list (slides in from the right) or month calendar ---------- */
.arch-controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s3) var(--s4); margin-bottom: var(--s4); }
.arch-date { width: min(100%, 220px); }
.arch-date input { color-scheme: dark; }
.arch-controls .chips { flex: 1 1 260px; }
.arch-view { display: flex; gap: var(--s2); }
.arch-msg { margin-bottom: var(--s3); color: var(--fg-2); }
.arch-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.js .arch-list li { opacity: 0; transform: translate3d(32px, 0, 0); }
.js .arch-list li.in { opacity: 1; transform: none; transition: opacity 500ms var(--ease-out), transform 500ms var(--ease-out); transition-delay: calc(var(--k) * 60ms); }
.js .arch-list li.out { opacity: 0; transform: translate3d(0, 8px, 0); transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out); transition-delay: 0ms; }
.js .arch-list li.rise { animation: anRise 360ms var(--ease-out) both; }
.arch-list a { display: grid; grid-template-columns: 52px 64px minmax(0, 1fr); align-items: center; gap: 6px var(--s3); padding: 12px var(--s4) 12px 12px;
  border-radius: var(--r-card); border: 1px solid var(--line); background: var(--surface); text-decoration: none; }
.arch-list li[aria-current] a { border-color: rgba(212, 168, 75, .6); background: linear-gradient(160deg, rgba(212, 168, 75, .08), transparent 60%), var(--surface); }
.arch-thumb { grid-row: span 2; overflow: hidden; width: 52px; aspect-ratio: 1; border-radius: 10px; background: #0A0B0E; }
.arch-thumb picture, .arch-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.arch-list time { grid-row: span 2; display: flex; flex-direction: column; font-size: 14px; font-weight: 700; line-height: 1.3; color: var(--fg); }
.arch-list time small { font-weight: 500; color: var(--muted); }
.arch-text { display: flex; flex-direction: column; min-width: 0; }
.arch-text b { font-weight: 600; }
.arch-text span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 14px; color: var(--muted); }
.arch-pairs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 12.5px; font-weight: 600; color: var(--fg-2); }
.ap { display: inline-flex; align-items: center; gap: 5px; }
.spark { width: 18px; height: 13px; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.spark.bull { stroke: var(--gold); }
.spark.bear { stroke: var(--blue); }
.spark.flat { stroke: var(--muted); }
@media (min-width: 900px) {
  .arch-list a { grid-template-columns: 52px 84px minmax(0, 1fr) auto; }
  .arch-thumb, .arch-list time { grid-row: auto; }
}
.arch-more { margin-top: var(--s4); }
.arch-cal { max-width: 560px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s3); }
.cal-head b { font-size: 16px; }
.cal-nav { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface); color: var(--fg); }
.cal-nav svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cal-nav:disabled { opacity: .35; }
.cal-viewport { overflow: hidden; }
.cal-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-month.from-r { animation: anCalR 380ms var(--ease-out) both; }
.cal-month.from-l { animation: anCalL 380ms var(--ease-out) both; }
@keyframes anCalR { from { opacity: 0; transform: translate3d(40px, 0, 0); } }
@keyframes anCalL { from { opacity: 0; transform: translate3d(-40px, 0, 0); } }
.cal-dow { padding-bottom: 4px; text-align: center; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.cal-day { position: relative; display: grid; place-items: center; aspect-ratio: 1; border-radius: 10px; font-size: 14px; font-variant-numeric: tabular-nums; color: var(--muted); }
a.cal-day { border: 1px solid var(--line); background: var(--surface); color: var(--fg); font-weight: 650; text-decoration: none; }
a.cal-day:hover { border-color: rgba(212, 168, 75, .5); }
a.cal-day[aria-current] { border-color: rgba(212, 168, 75, .75); }
.cal-day i { position: absolute; bottom: 14%; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.cal-day.bull i { background: var(--gold); }
.cal-day.bear i { background: var(--blue); }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: var(--s3); font-size: 12.5px; color: var(--muted); }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal-legend i { width: 7px; height: 7px; border-radius: 50%; }

/* ---------- full-screen chart viewer (zooms from the thumbnail) ---------- */
.viewer { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; overflow: hidden; border: 0; color: var(--fg); background: transparent; }
.viewer::backdrop { background: rgba(4, 4, 4, .97); opacity: 0; transition: opacity var(--t-slow) var(--ease-out); }
.viewer.shown::backdrop { opacity: 1; }
.viewer-stage { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; touch-action: none; cursor: grab;
  padding: calc(60px + var(--safe-t)) max(8px, var(--safe-r)) max(12px, var(--safe-b)) max(8px, var(--safe-l)); }
.viewer-stage:active { cursor: grabbing; }
.viewer-stage img { max-width: calc(100vw - 16px - var(--safe-l) - var(--safe-r)); max-height: calc(100dvh - 76px - var(--safe-t) - var(--safe-b));
  transform-origin: 50% 50%; user-select: none; -webkit-user-drag: none; will-change: transform; }
.viewer-bar, .viewer-nav { opacity: 0; transition: opacity var(--t-slow) var(--ease-out); }
.viewer.shown .viewer-bar, .viewer.shown .viewer-nav { opacity: 1; }
.viewer-bar { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
  padding: calc(8px + var(--safe-t)) max(10px, var(--safe-r)) 8px max(16px, var(--safe-l)); background: linear-gradient(180deg, rgba(4, 4, 4, .9), rgba(4, 4, 4, 0)); pointer-events: none; }
.viewer-bar > * { pointer-events: auto; }
.viewer-hint { font-size: 13px; color: var(--fg-2); }
#viewerCount:not(:empty) { margin-right: 8px; padding: 2px 8px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--fg); font-weight: 700; font-variant-numeric: tabular-nums; }
.viewer-close, .viewer-nav { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-2); background: rgba(13, 15, 18, .8); }
.viewer-close svg, .viewer-nav svg { width: 20px; height: 20px; fill: none; stroke: var(--fg); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.viewer-nav { position: absolute; top: 50%; margin-top: -22px; }
.viewer-nav.prev { left: max(10px, var(--safe-l)); }
.viewer-nav.next { right: max(10px, var(--safe-r)); }
.viewer-nav[hidden] { display: none; }

/* the nav is solid here (there's no full-screen hero under it) */
.an-body-page .nav.solid::before { opacity: 1; }

/* ---------- desktop-only hover ---------- */
@media (hover: hover) {
  .pair-jump:hover, a.wk-card:hover, .arch-list a:hover { border-color: rgba(212, 168, 75, .45); }
  .zoom:hover .zoom-hint { transform: translate3d(0, -2px, 0); }
  .zoom-hint { transition: transform var(--t-base) var(--ease-out); }
}

/* ---------- reduced motion: everything visible at once, no pulses; the countdown text stays ---------- */
@media (prefers-reduced-motion: reduce) {
  .js .an-rise, .js .an-title .w, .js .mood, .js .an-title::after { animation: none; }
  .live-dot::after, .ka-bell::after, .ka-bell svg, .rung.now::after, .rung.near .rung-val::after, .ev.high .ev-dot::after, .pc-icon .bias-art, .an-drift::before { animation: none; }
  .js .pair-chart img { transform: none; transition: none; }
  .js .pair-chart .zoom::before { display: none; }
  .sheen, .js .pair-chart:not(.loaded) .zoom::after, .mini.loading::after { display: none; }
  .bias-in { clip-path: none !important; transition: none !important; }
  .bias-in .bias-ico { animation: none !important; }
  .m-arc { stroke-dashoffset: 0 !important; transition: none !important; }
  .needle { transform: rotate(var(--a)) !important; transition: none !important; }
  .conf-bar i { transform: scaleX(var(--c)) !important; transition: none !important; }
  .ladder-rail, .rung-line { transform: none !important; transition: none !important; }
  .js .rung-tag, .js .rung-val, .js .checks li, .js .scen-card, .js .arch-list li, .js .wk-strip li { opacity: 1 !important; transform: none !important; transition: none !important; animation: none !important; }
  .js .tick path { stroke-dashoffset: 0 !important; transition: none !important; }
  .js .ev-dot { transform: none !important; transition: none !important; }
  .tl-line { animation: none !important; transform: none !important; }
  .pb-pill { transition: none; }
  .cal-month.from-r, .cal-month.from-l { animation: none; }
  .viewer::backdrop, .viewer-bar, .viewer-nav { transition: none; }
}

/* ---------- Phase 5C: live XAUUSD chart, TradingView outlook, calendar, Latest news, live updates ---------- */
.cal-widget iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.lc-wait { position: absolute; inset: 0; display: grid; place-items: center; font-size: 14px; color: var(--muted); }
.cal-widget.loading::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .07) 50%, transparent 70%); animation: anSkel 1.4s linear infinite; }

.auto-note { margin-top: calc(-1 * var(--s3)); font-size: 12.5px; font-style: italic; color: var(--muted); }
.tv-embed { position: relative; margin-top: var(--s3); aspect-ratio: 16 / 10; overflow: hidden; border-radius: var(--r-btn); border: 1px solid var(--line); background: #0A0B0E; }
.tv-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.ol-grid { display: grid; gap: var(--s4); }
@media (min-width: 900px) { .ol-grid { grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); } }
.ol-card { overflow: hidden; border-radius: var(--r-card); border: 1px solid var(--line); background: var(--surface); }
.ol-pic { position: relative; display: block; width: 100%; max-height: 78vh; overflow: hidden; padding: 0; border: 0; background: #0A0B0E; cursor: zoom-in; }
.ol-pic img { display: block; width: 100%; height: auto; max-height: 78vh; object-fit: contain; }
.ol-card .tv-embed { margin: 0; border: 0; border-radius: 0; }
.ol-bar { display: flex; gap: var(--s2); padding: var(--s3) var(--s4); }
.ol-follow { margin-top: var(--s4); }

.cal-filters { display: grid; gap: var(--s2); margin-bottom: var(--s3); }
.cal-widget { position: relative; height: 560px; overflow: hidden; border-radius: var(--r-card); border: 1px solid var(--line); background: var(--surface); }
@media (max-width: 559px) { .cal-widget { height: 70vh; height: 70svh; } }
.an-calendar .fine, .an-livenews .fine { margin-top: var(--s3); }

.nf-chips { margin-bottom: var(--s3); }
.nf-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); max-width: 820px; }
.nf-item { padding: 14px 16px; border-radius: var(--r-btn); background: var(--surface); border: 1px solid var(--line); }
.nf-item.own { border-color: rgba(212, 168, 75, .3); }
.nf-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 6px; font-size: 12.5px; color: var(--muted); }
.nf-src { padding: 2px 8px; border-radius: var(--r-pill); border: 1px solid var(--line-2); font-weight: 650; color: var(--fg-2); }
.own .nf-src { border-color: rgba(212, 168, 75, .5); color: var(--gold-hi); }
.nf-new { padding: 2px 7px; border-radius: var(--r-pill); background: var(--gold); color: var(--gold-ink); font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.nf-head time { margin-left: auto; font-variant-numeric: tabular-nums; }
.nf-title { display: block; font-weight: 600; line-height: 1.45; color: var(--fg); text-decoration: none; overflow-wrap: anywhere; }
.nf-title:hover { color: var(--gold-hi); }
.nf-text { margin-top: 6px; font-size: 14px; color: var(--fg-2); white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.nf-img { display: block; width: 100%; max-height: 320px; margin-top: 10px; object-fit: cover; border-radius: var(--r-btn); }
.nf-credit { margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.nf-credit a { color: var(--fg-2); }
.nf-skel { height: 74px; border-radius: var(--r-btn); background: var(--surface); position: relative; overflow: hidden; }
.nf-skel::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .06) 50%, transparent 70%); animation: anSkel 1.4s linear infinite; }
.nf-empty { color: var(--muted); }
.nf-join { margin-top: var(--s4); }
.nf-item.arrive { animation: nfArrive 520ms var(--ease-out) both; }
@keyframes nfArrive { from { opacity: 0; transform: translateY(-8px); } }

/* live updates: changed parts crossfade, "Last updated" pulses, a banner for bigger changes */
[data-live] { transition: opacity 200ms var(--ease-out); }
[data-live].lv-out { opacity: 0; }
[data-live].lv-in { animation: lvIn 420ms var(--ease-out) both; }
@keyframes lvIn { from { opacity: 0; } }
.an-meta.pulse time { animation: lvPulse 1.6s var(--ease-out) 2; }
@keyframes lvPulse { 30% { color: var(--gold-hi); text-shadow: 0 0 12px rgba(230, 194, 122, .7); } }
.lv-banner { position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 80; max-width: calc(100% - 32px); padding: 12px 18px; border-radius: var(--r-pill);
  background: var(--gold); color: var(--gold-ink); font-weight: 650; text-decoration: none; box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
  transform: translate(-50%, 140%); transition: transform 380ms var(--ease-out); }
.lv-banner.shown { transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) {
  .cal-widget.loading::after, .nf-skel::after { display: none; }
  .nf-item.arrive, [data-live].lv-in, .an-meta.pulse time { animation: none; }
  [data-live] { transition: none; }
  .lv-banner { transition: none; }
}
/* TradingView widgets draw on a transparent page: keep the iframe's own canvas light-scheme (no white box) */
.cal-widget iframe, .tv-embed iframe, .snap-embed iframe { color-scheme: light; }
@media (min-width: 900px) { .ol-pic, .ol-pic img { max-height: 640px; } }
@media (pointer: coarse) { .pb-chip { min-height: 44px; } }

/* ---------- Phase 5D: my analysis snapshot, one pair at a time ---------- */
/* The XAUUSD / DXY switch shows one pair; without JavaScript both stay listed. */
.js .pair-grid.switch { grid-template-columns: minmax(0, 1fr); }
.js .pair-grid.switch > .pair-card:not(.active) { display: none; }
@media (min-width: 900px) { .js .pair-grid.switch .pc-cover { aspect-ratio: auto; height: clamp(220px, 22vw, 320px); } }
/* the pair's header art drifts slowly on desktop (Ken Burns) */
@media (min-width: 1024px) and (hover: hover) and (prefers-reduced-motion: no-preference) {
  .pc-cover-pic img { transform-origin: 62% 40%; animation: anKenBurns 26s var(--ease-in-out) infinite alternate; }
}
@keyframes anKenBurns { to { transform: scale(1.08) translate3d(-1.5%, -1%, 0); } }

.snap { padding: var(--s4) var(--s4) 0; }
.snap-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: var(--s2); font-size: 13px; color: var(--muted); }
.snap-label { font-size: 11.5px; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; color: var(--fg-2); }
.snap-old { padding: 2px 8px; border-radius: var(--r-pill); border: 1px solid var(--line-2); background: var(--surface-2); font-size: 11.5px; font-weight: 600; color: var(--muted); }
.snap-time { margin-left: auto; font-variant-numeric: tabular-nums; }
.snap-time time { color: var(--fg-2); }
/* the frame: 4:3 on phones, 16:9 on desktop, the whole screen on a phone held sideways */
.snap-frame { position: relative; isolation: isolate; aspect-ratio: 4 / 3; border-radius: var(--r-card); border: 1px solid rgba(212, 168, 75, .28); background: #0A0B0E;
  box-shadow: 0 0 0 1px rgba(212, 168, 75, .05), 0 18px 48px -26px rgba(212, 168, 75, .4); }
@media (min-width: 900px) { .snap-frame { aspect-ratio: 16 / 9; } }
/* (fits under the sticky top bar and pair switch; the full-screen button fills everything) */
@media (orientation: landscape) and (max-height: 520px) { .snap-frame { aspect-ratio: auto; height: calc(100svh - var(--nav-h, 60px) - var(--safe-t) - 84px); min-height: 220px; } }
/* The Higgsfield gold edge-light, once chart-frame.png exists. It's laid out as a 9-slice
   border image (corners stay round and crisp on the 16:9 and 4:3 frames alike): in the
   picture the light line sits 65 px in from each edge and the corners fit in 110 px, so
   --k scales both, and the line lands exactly on the card's edge. */
.an-pairs[data-frame] .snap-frame { --k: .44; border-color: transparent; box-shadow: none; }
@media (min-width: 900px) { .an-pairs[data-frame] .snap-frame { --k: .6; } }
.an-pairs[data-frame] .snap-frame::before { content: ""; position: absolute; z-index: 5; pointer-events: none;   /* over the picture: the light line sits on its edge (taps go through) */
  inset: calc(-65px * var(--k)); border: calc(110px * var(--k)) solid transparent;
  border-image-source: var(--snap-frame-png); border-image-slice: 110 fill; border-image-width: 1; border-image-repeat: stretch; }
@supports (background-image: image-set(url("x.png") type("image/png"))) {
  .an-pairs[data-frame] .snap-frame::before { border-image-source: var(--snap-frame); }
}
.snap-pic, .snap-embed, .snap-none { position: absolute; inset: 0; overflow: hidden; border-radius: inherit; }
.snap-pic { display: block; padding: 0; border: 0; background: #0A0B0E; cursor: zoom-in; }
.snap-pic img, .snap-fallback { display: block; width: 100%; height: 100%; object-fit: contain; }
.snap-embed iframe { position: absolute; left: 0; top: 0; width: 1280px; height: 720px; border: 0; transform-origin: 0 0; }
.snap-none { display: grid; place-items: center; padding: var(--s4); text-align: center; font-size: 14px; color: var(--muted); text-decoration: none; }
a.snap-none { font-weight: 600; color: var(--gold-hi); }
/* shimmer until it has loaded, then a fade and one gold sheen */
.js .snap-frame:not(.loaded):not(.empty)::after { content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none; border-radius: inherit;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .07) 50%, transparent 70%); animation: anSkel 1.4s linear infinite; }
.js .snap-pic img, .js .snap-embed iframe { opacity: 0; transition: opacity 500ms var(--ease-out); }
.snap-frame.loaded .snap-pic img, .snap-frame.loaded .snap-embed iframe { opacity: 1; }
.snap-frame.loaded .snap-fallback { opacity: 0; }
.snap-frame.loaded .sheen { animation: anSheen 1200ms var(--ease-in-out) 150ms both; }
.snap-full { position: absolute; right: 10px; top: 10px; z-index: 6; display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
  border-radius: var(--r-btn); border: 1px solid var(--line-2); background: rgba(13, 15, 18, .82); color: var(--fg); cursor: pointer; }
.snap-full svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.snap-full:active { transform: scale(var(--press, .97)); }
.snap-frame.snap-max { position: fixed; inset: 0; z-index: 90; aspect-ratio: auto; height: auto; border: 0; border-radius: 0; box-shadow: none; background: var(--bg);
  margin: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
.snap-frame.snap-max::before { display: none; }
.snap-open { display: flex; justify-content: center; width: 100%; margin-top: var(--s3); }
@media (min-width: 900px) { .snap-open { display: inline-flex; width: auto; } }
.snap-note { margin: var(--s2) 0 0; font-size: 12.5px; color: var(--muted); }
/* the chart section's ambient loop (Higgsfield, when it exists): desktop only, faint */
.an-pairs { position: relative; }
.an-ambient { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .16; pointer-events: none; z-index: 0; }
.an-pairs > .wrap { position: relative; z-index: 1; }
@media not all and (min-width: 1024px) { .an-ambient { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .an-ambient { display: none; }
  .js .snap-frame:not(.loaded):not(.empty)::after { animation: none; }
  .js .snap-pic img, .js .snap-embed iframe { transition: none; }
}
/* full screen sits above everything (the site bar and pair switch step aside) */
.snap-frame.snap-max { z-index: 1000; }
.modal-open .nav, .modal-open .pair-bar, .modal-open .scroll-progress { visibility: hidden; }
@media (orientation: portrait) and (max-width: 767px) {
  .snap-frame.snap-max.loaded::after { content: "Turn your phone sideways for a bigger chart"; position: absolute; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom));
    transform: translateX(-50%); width: max-content; max-width: 90%; padding: 8px 14px; border-radius: var(--r-pill); border: 1px solid var(--line-2);
    background: rgba(13, 15, 18, .88); font-size: 13px; color: var(--fg-2); pointer-events: none; }
}
