/* Chart of the week: the hero deck on the home page, the chart itself, and the stock page's news section. */
:root {
  --cotw-primary: #2a78d6;
  --cotw-highlight: #c98500;
  --cotw-marker: #c98500;
  /* named series, in this fixed order (validated as a set; a chart never invents an eighth) */
  --cotw-n1: #2a78d6; --cotw-n2: #eb6834; --cotw-n3: #1baf7a; --cotw-n4: #eda100; --cotw-n5: #e87ba4; --cotw-n6: #008300; --cotw-n7: #6250d6;
  --cotw-bench: #98a2b3;
  --cotw-context: #98a2b3;
  --cotw-grid: #eceff5;
  --cotw-axis: #cfd6e4;
  --cotw-muted: #6b7690;
  --cotw-text: var(--tx, #101828);
  --cotw-surface: var(--surface, #fff);
}
:root[data-theme="dark"], :root:not([data-theme]) {
  --cotw-primary: #3987e5;
  --cotw-highlight: #c98500;
  --cotw-marker: #c98500;
  --cotw-n1: #3987e5; --cotw-n2: #d95926; --cotw-n3: #199e70; --cotw-n4: #c98500; --cotw-n5: #d55181; --cotw-n6: #008300; --cotw-n7: #9085e9;
  --cotw-bench: #5f6f96;
  --cotw-context: #5f6f96;
  --cotw-grid: #1c2744;
  --cotw-axis: #2c3a5c;
  --cotw-muted: #8d9bc0;
}

/* --- the deck ------------------------------------------------------------- */
.uz-deck { position: relative; margin-bottom: 14px; }
.uz-deck .uz-deck-track {
  display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -ms-overflow-style: none;
  outline: none; scroll-behavior: smooth;
}
.uz-deck .uz-deck-track::-webkit-scrollbar { display: none; }
.uz-deck .uz-deck-track:focus-visible { box-shadow: 0 0 0 2px var(--brand); border-radius: var(--radius-lg); }
.uz-deck .uz-slide { flex: 0 0 100%; min-width: 0; scroll-snap-align: start; scroll-snap-stop: always; margin-bottom: 0; display: flex; flex-direction: column; }
/* The record slide shares the deck's height with the chart slide: the rings sit in the middle of whatever
   room that leaves and the button stays at the bottom of the card. */
.uz-deck.has-cotw .uz-slide > .uz-hero-body { flex: 1 1 auto; align-content: center; }
.uz-deck.has-cotw .uz-slide > .cta { margin-top: auto; }
.uz-deck .uz-slide-cotw h2 {
  font-size: clamp(19px, 2.6vw, 26px); font-weight: 800; letter-spacing: -.02em; line-height: 1.2; color: var(--tx); margin: 7px 0 5px;
}
.uz-deck .uz-slide-cotw .sub { font-size: 13px; color: var(--tx-2); margin: 0 0 8px; max-width: 72ch; }
.uz-deck .uz-slide-cotw .uz-cotw-chart { flex: 1 1 auto; margin-top: 6px; }
.uz-deck .uz-slide-cotw .cta { margin-top: 12px; }
.uz-deck-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface); color: var(--tx); font-size: 20px; line-height: 1; cursor: pointer;
  display: grid; place-items: center; box-shadow: var(--shadow); z-index: 2; opacity: .9;
}
.uz-deck-arrow:hover { opacity: 1; border-color: var(--brand); }
.uz-deck-arrow.prev { left: -14px; } .uz-deck-arrow.next { right: -14px; }
.uz-deck:not(.is-second) .uz-deck-arrow.prev, .uz-deck.is-second .uz-deck-arrow.next { display: none; }
.uz-deck-dots { display: flex; justify-content: center; gap: 8px; margin-top: 10px; }
.uz-deck-dots button { width: 8px; height: 8px; border-radius: 50%; border: 0; padding: 0; background: var(--line); cursor: pointer; }
.uz-deck-dots button.is-active { background: var(--brand); width: 20px; border-radius: 4px; }
.uz-deck-tab {
  position: absolute; top: 14px; right: 14px; z-index: 2; border: 1px solid color-mix(in srgb, var(--brand) 40%, transparent);
  background: color-mix(in srgb, var(--brand) 12%, var(--surface)); color: var(--brand); border-radius: 999px; padding: 4px 11px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .02em; cursor: pointer; font-family: var(--font-ui);
}
.uz-deck-tab:hover { background: color-mix(in srgb, var(--brand) 20%, var(--surface)); }
.uz-deck.is-second .uz-deck-tab { display: none; }
@media (max-width: 640px) {
  .uz-deck-arrow { display: none !important; }
  /* No room beside the eyebrow on a phone: the tab sits on the dots' row instead. */
  .uz-deck-tab { top: auto; bottom: -7px; right: 0; padding: 3px 9px; font-size: 11px; }
  .uz-deck-dots { min-height: 14px; align-items: center; justify-content: flex-start; padding-left: 6px; }
  /* A shorter chart slide on a phone, so the record slide beside it is not stretched far past its own height. */
  .uz-deck .cotw-plot { height: 200px; }
  .uz-deck .uz-slide-cotw .sub { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .uz-deck .cotw-foot { display: none; }
}
@media (prefers-reduced-motion: reduce) { .uz-deck .uz-deck-track { scroll-behavior: auto; } }

/* --- the chart ----------------------------------------------------------- */
.cotw-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 0 2px; }
.cotw-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--tx-2); }
.cotw-key { display: inline-flex; align-items: center; gap: 6px; }
.cotw-key i { display: inline-block; width: 18px; height: 0; border-top: 2px solid; }
.cotw-key i.thin { border-top-width: 1px; }
.cotw-key i.thick { border-top-width: 3px; }
.cotw-key i.band { height: 10px; border: 0; background: color-mix(in srgb, var(--cotw-primary) 24%, transparent); }
.cotw-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.cotw-seg button { background: transparent; border: 0; color: var(--tx-2); padding: 3px 10px; font: inherit; font-size: 12.5px; cursor: pointer; }
.cotw-seg button[aria-pressed="true"] { background: color-mix(in srgb, var(--brand) 18%, transparent); color: var(--tx); }
/* The plot has a set height, the same as the page's other charts (.chart-container: 400 / 350 / 280), and the
   script draws at that size. In the hero deck this keeps the slide about as tall as the Cumulative Return card. */
.cotw-plot { position: relative; height: 400px; }
.cotw-plot svg { width: 100%; height: 100%; display: block; font-family: var(--font-ui); }
@media (max-width: 1024px) { .cotw-plot { height: 350px; } }
@media (max-width: 768px) { .cotw-plot { height: 280px; } }
.cotw-bar.is-hover { filter: brightness(1.18); }
.cotw-num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.cotw-line.is-hl { stroke: var(--cotw-text) !important; stroke-opacity: 1 !important; stroke-width: 2 !important; }
.cotw-foot { font-size: 11px; color: var(--tx-3, var(--tx-2)); margin-top: -2px; }
.cotw-tip {
  position: absolute; pointer-events: none; display: none; z-index: 3; min-width: 180px; max-width: 320px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 12px; box-shadow: var(--shadow); color: var(--tx);
}
.cotw-tip .t { color: var(--tx-2); margin-bottom: 4px; }
.cotw-tip .row { display: flex; justify-content: space-between; gap: 12px; }
.cotw-tip .row span { color: var(--tx-2); } .cotw-tip .row b { font-weight: 600; padding-left: 6px; }
.cotw-tip .mk { margin-top: 4px; color: var(--cotw-highlight); font-weight: 600; }
.cotw-tip .cases { display: grid; grid-template-columns: 1fr 1fr; gap: 1px 14px; margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); color: var(--tx-2); }
.cotw-tip .cases span { display: flex; justify-content: space-between; gap: 8px; } .cotw-tip .cases b { color: var(--tx); font-weight: 500; }

/* --- the stock page section --------------------------------------------- */
.uf-news { border-left: 3px solid var(--brand); padding-left: 14px; margin: 18px 0 6px; }
.uf-news .when { font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--tx-2); margin-bottom: 2px; }
.uf-news .tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 10px 0 12px; }
.uf-news .tile { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--surface-2, var(--surface)); }
.uf-news .tile .lab { font-size: 12px; color: var(--tx-2); } .uf-news .tile .val { font-size: 22px; font-weight: 600; margin-top: 2px; } .uf-news .tile .sub { font-size: 12px; color: var(--tx-2); }
.uf-news .tbl { overflow-x: auto; margin-top: 8px; }
.uf-news table { min-width: 560px; font-size: 13.5px; } .uf-news td:first-child { min-width: 220px; } .uf-news .nw, .uf-news td.r { white-space: nowrap; }
.uf-news details summary { cursor: pointer; color: var(--brand); font-size: 14px; margin-top: 6px; }
@media (max-width: 640px) { .uf-news .tiles { grid-template-columns: repeat(2, 1fr); } }
