/* ==========================================================================
   FBITools widgets (tools-data): Record Watch and This Week in League History.
   Prime Time tokens (assets/prime.css) with fallbacks so a widget renders on
   any Prime page. Type stays inside the self-hosted axes: Archivo wdth 68-100,
   wght 400-800; Instrument Sans 400-700.
   ========================================================================== */

.fbi-tool {
  --ft-ac: var(--pt-ac, #D4FF3F);
  --ft-bg: var(--pt-bg, #0C0D10);
  --ft-s1: var(--pt-s1, #14161B);
  --ft-s2: var(--pt-s2, #1C1F26);
  --ft-line: var(--pt-line, #272B33);
  --ft-line2: var(--pt-line-2, #3A3F49);
  --ft-tx: var(--pt-tx, #F3F1EC);
  --ft-tx2: var(--pt-tx2, #B4B9C3);
  --ft-tx3: var(--pt-tx3, #8B919D);
  --ft-ink: var(--pt-ink, #0C0D10);
  --ft-display: var(--pt-display, 'Archivo', 'Arial Narrow', sans-serif);
  --ft-ease: var(--pt-ease, cubic-bezier(.2, .8, .2, 1));
  display: block;
  color: var(--ft-tx);
}
.fbi-tool[hidden] { display: none !important; }
.fbi-tool *, .fbi-tool *::before, .fbi-tool *::after { box-sizing: border-box; }
.fbi-tool :where(h2, p, ol, li) { margin: 0; padding: 0; }
.fbi-tool :where(ol) { list-style: none; }
.fbi-tool .pt-n { font-family: var(--ft-display); font-stretch: 84%; font-weight: 700; font-variant-numeric: tabular-nums; }
.ft-chev { width: 16px; height: 16px; flex: none; display: block; transition: transform .2s var(--ft-ease); }

/* ---------- shared head ---------- */
.ft-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap; margin-bottom: 28px; }
.ft-head-t { min-width: 0; max-width: 760px; }
.ft-eb { font-size: 14px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ft-ac); }
.ft-title { font-family: var(--ft-display); font-stretch: 68%; font-weight: 800; text-transform: uppercase; line-height: .9; letter-spacing: -.005em; font-size: 60px; margin-top: 10px; }
.fbi-tool .ft-title { margin-top: 10px; }
.ft-dek { margin-top: 14px; color: var(--ft-tx2); font-size: 17px; line-height: 1.5; }
.fbi-tool .ft-dek { margin-top: 14px; }
.ft-more { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 700; font-size: 15px; color: var(--ft-tx2); text-decoration: none; }
.fbi-tool a.ft-more:hover { color: var(--ft-ac); }

/* ==========================================================================
   Record Watch: one progress rail per chase
   ========================================================================== */
.ft-rw-list { background: var(--ft-s1); border: 1px solid var(--ft-line); border-radius: 18px; overflow: hidden; }
.ft-rw-item { border-bottom: 1px solid var(--ft-line); position: relative; }
.ft-rw-item:last-child { border-bottom: 0; }
.ft-rw-item[data-state="record"]::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--ft-ac);
}
.ft-rw-d > summary { list-style: none; cursor: pointer; }
.ft-rw-d > summary::-webkit-details-marker { display: none; }
.ft-rw-d > summary:focus-visible { outline: 2px solid var(--ft-ac); outline-offset: -4px; border-radius: 14px; }
.ft-rw-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "top fig" "who fig" "rail rail" "foot foot";
  column-gap: 24px;
  row-gap: 14px;
  padding: 24px 28px 20px;
  min-height: 44px;
}
.ft-rw-row:hover { background: rgba(255, 255, 255, .018); }
.ft-rw-top-line { grid-area: top; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-width: 0; }
.ft-rw-label { font-size: 14px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ft-tx2); }
.ft-rw-pill {
  display: inline-flex; align-items: center; min-height: 28px; padding: 0 12px; border-radius: 999px;
  background: var(--ft-ac); color: var(--ft-ink); font-size: 14px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap;
}
.ft-rw-main { display: contents; }
.ft-rw-main > .pt-av, .ft-rw-main > .ft-rw-who { grid-area: who; }
.ft-rw-main > .pt-av { align-self: center; }
.ft-rw-who { display: flex; flex-direction: column; justify-content: center; min-width: 0; padding-left: 58px; min-height: 44px; }
.ft-rw-main > .pt-av + .ft-rw-who { padding-left: 58px; }
.ft-rw-main > .pt-av { width: 44px; height: 44px; }
.ft-rw-who-n { font-weight: 700; font-size: 17px; line-height: 1.2; }
.ft-rw-who-v { font-size: 15px; color: var(--ft-tx2); }
.ft-rw-who-v .pt-n { font-size: 17px; color: var(--ft-tx); }
.ft-rw-fig { grid-area: fig; display: flex; flex-direction: column; align-items: flex-end; justify-content: center; text-align: right; }
.ft-rw-fig-n { font-size: 64px; line-height: .86; letter-spacing: -.01em; color: var(--ft-tx); }
.ft-rw-item[data-state="record"] .ft-rw-fig-n { color: var(--ft-ac); }
.ft-rw-fig-c { margin-top: 8px; font-size: 14px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ft-tx3); max-width: 22ch; }

/* the rail: a track with quarter ticks, a volt fill, a finish post with the holder's portrait */
.ft-rw-rail { grid-area: rail; position: relative; display: flex; align-items: center; height: 40px; padding-right: 20px; }
.ft-rw-track {
  position: relative; flex: 1; height: 10px; border-radius: 5px; overflow: hidden;
  background:
    linear-gradient(to right, transparent calc(25% - 1px), rgba(243, 241, 236, .14) calc(25% - 1px), rgba(243, 241, 236, .14) 25%, transparent 25%,
      transparent calc(50% - 1px), rgba(243, 241, 236, .14) calc(50% - 1px), rgba(243, 241, 236, .14) 50%, transparent 50%,
      transparent calc(75% - 1px), rgba(243, 241, 236, .14) calc(75% - 1px), rgba(243, 241, 236, .14) 75%, transparent 75%),
    var(--ft-s2);
}
.ft-rw-fill { position: absolute; inset: 0; transform-origin: left center; background: var(--ft-ac); border-radius: 5px; }
.ft-rw-item[data-state="in-reach"] .ft-rw-fill { background: linear-gradient(90deg, rgba(212, 255, 63, .55), var(--ft-ac)); }
.ft-rw-end { position: absolute; right: 0; top: 50%; transform: translateY(-50%); display: grid; place-items: center; }
.ft-rw-end::before { content: ""; position: absolute; left: 50%; top: -6px; bottom: -6px; width: 2px; margin-left: -1px; background: var(--ft-line2); z-index: 0; }
.ft-rw-end .pt-av { position: relative; z-index: 1; width: 32px; height: 32px; box-shadow: 0 0 0 2px var(--ft-s1), 0 0 0 3px var(--ft-line2); }
.ft-rw-end-mark { width: 40px; height: 40px; }
.ft-rw-end-mark::after { content: ""; position: relative; z-index: 1; width: 14px; height: 14px; border-radius: 50%; background: var(--ft-ac); box-shadow: 0 0 0 3px var(--ft-s1); }

.ft-rw-foot { grid-area: foot; display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; min-height: 28px; }
.ft-rw-rec { font-size: 15px; color: var(--ft-tx3); }
.ft-rw-rec .pt-n { font-size: 17px; color: var(--ft-tx2); }
.ft-rw-rec-who { color: var(--ft-tx3); }
.ft-rw-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ft-tx2); }
.ft-rw-d[open] .ft-rw-toggle .ft-chev { transform: rotate(90deg); }
.ft-rw-row:hover .ft-rw-toggle { color: var(--ft-ac); }

.ft-rw-more { padding: 4px 28px 26px; }
.ft-rw-say { font-size: 16px; color: var(--ft-tx2); line-height: 1.5; margin-bottom: 18px; max-width: 72ch; }
.fbi-tool .ft-rw-say { margin-bottom: 18px; }
.ft-rw-say .pt-n { font-size: 17px; color: var(--ft-tx); }
.ft-rw-seal { box-shadow: none; background: transparent; }
.ft-rw-more-h { font-size: 14px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ft-tx3); margin-bottom: 8px; }
.fbi-tool .ft-rw-more-h { margin-bottom: 8px; }
.ft-rw-top { border-top: 1px solid var(--ft-line); }
.ft-rw-t {
  display: grid; grid-template-columns: 32px minmax(0, 1fr) auto auto; align-items: center; gap: 14px;
  min-height: 56px; border-bottom: 1px solid var(--ft-line); font-size: 16px;
}
.ft-rw-t-r { font-size: 20px; color: var(--ft-tx3); text-align: center; }
.ft-rw-t-who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ft-rw-t-who .pt-av { width: 32px; height: 32px; }
.ft-rw-t-n { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ft-rw-t-when { display: inline-flex; align-items: center; gap: 10px; color: var(--ft-tx3); font-size: 15px; white-space: nowrap; }
.ft-rw-t-v { font-size: 22px; text-align: right; min-width: 5ch; }
.ft-rw-t.is-live .ft-rw-t-v { color: var(--ft-ac); }
.ft-rw-live { display: inline-flex; align-items: center; min-height: 24px; padding: 0 8px; border-radius: 999px; border: 1px solid var(--ft-ac); color: var(--ft-ac); font-size: 14px; font-weight: 700; letter-spacing: .04em; }
.ft-rw-method { margin-top: 14px; color: var(--ft-tx3); font-size: 14px; line-height: 1.5; max-width: 72ch; }
.fbi-tool .ft-rw-method { margin-top: 14px; }

/* ==========================================================================
   This Week in League History: receipt cards
   ========================================================================== */
.ft-tw-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(214px, 1fr)); gap: 16px; }
.ft-tw-item { display: flex; min-width: 0; }
.ft-tw-card {
  position: relative; display: flex; flex-direction: column; gap: 14px; width: 100%; min-width: 0;
  padding: 22px 22px 18px; border-radius: 18px; border: 1px solid var(--ft-line); background: var(--ft-s1);
  color: var(--ft-tx); text-decoration: none; overflow: hidden;
  transition: border-color .15s var(--ft-ease);
}
.ft-tw-card::before { content: ""; position: absolute; left: 22px; right: 22px; top: 0; height: 3px; border-radius: 0 0 3px 3px; background: var(--ft-line2); }
.ft-tw-item[data-kind="high"] .ft-tw-card::before { background: var(--ft-ac); }
.fbi-tool a.ft-tw-card:hover { border-color: var(--ft-line2); color: var(--ft-tx); }
.fbi-tool a.ft-tw-card:hover .ft-tw-cta { color: var(--ft-ac); }
.fbi-tool a.ft-tw-card:focus-visible { outline: 2px solid var(--ft-ac); outline-offset: 3px; }
.ft-tw-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ft-tw-kind { font-size: 14px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ft-ac); }
.ft-tw-stamp { font-size: 17px; color: var(--ft-tx2); white-space: nowrap; }
.ft-tw-round { margin-top: -6px; font-size: 14px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ft-tx2); }
.ft-tw-fig { display: flex; flex-direction: column; }
.ft-tw-fig-n { font-size: 60px; line-height: .86; letter-spacing: -.01em; }
.ft-tw-fig-c { margin-top: 8px; font-size: 14px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ft-tx3); }
.ft-tw-who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ft-tw-who .pt-av { width: 40px; height: 40px; }
.ft-tw-who-t { display: flex; flex-direction: column; min-width: 0; }
.ft-tw-name { font-weight: 700; font-size: 17px; line-height: 1.2; }
.ft-tw-team { font-size: 14px; color: var(--ft-tx3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ft-tw-line { font-size: 15px; color: var(--ft-tx2); line-height: 1.45; }
.ft-tw-line .pt-n { font-size: 17px; color: var(--ft-tx); white-space: nowrap; }
.ft-tw-note { font-size: 15px; color: var(--ft-tx2); line-height: 1.45; padding-top: 12px; border-top: 1px solid var(--ft-line); }
.ft-tw-cta { margin-top: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 15px; font-weight: 700; color: var(--ft-tx2); min-height: 24px; }

/* ---------- responsive ---------- */
@media (min-width: 641px) and (max-width: 1100px) {
  .ft-tw-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* an odd count: the lead card takes the full row as a wide receipt */
  .ft-tw-item:first-child:nth-last-child(2n+1) { grid-column: 1 / -1; }
  .ft-tw-item:first-child:nth-last-child(2n+1) .ft-tw-card {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 32px; row-gap: 14px;
    grid-template-areas: "top fig" "round fig" "who fig" "line line" "note note" "cta cta";
  }
  .ft-tw-item:first-child:nth-last-child(2n+1) .ft-tw-top { grid-area: top; }
  .ft-tw-item:first-child:nth-last-child(2n+1) .ft-tw-round { grid-area: round; margin-top: 0; }
  .ft-tw-item:first-child:nth-last-child(2n+1) .ft-tw-fig { grid-area: fig; align-items: flex-end; justify-content: center; text-align: right; }
  .ft-tw-item:first-child:nth-last-child(2n+1) .ft-tw-fig-n { font-size: 84px; }
  .ft-tw-item:first-child:nth-last-child(2n+1) .ft-tw-who { grid-area: who; }
  .ft-tw-item:first-child:nth-last-child(2n+1) .ft-tw-line { grid-area: line; }
  .ft-tw-item:first-child:nth-last-child(2n+1) .ft-tw-note { grid-area: note; }
  .ft-tw-item:first-child:nth-last-child(2n+1) .ft-tw-cta { grid-area: cta; }
}
@media (max-width: 640px) {
  .ft-head { margin-bottom: 20px; }
  .ft-title { font-size: 42px; }
  .ft-dek { font-size: 16px; }
  .ft-rw-row { padding: 20px 18px 16px; column-gap: 14px; row-gap: 12px;
    grid-template-areas: "top top" "who fig" "rail rail" "foot foot"; }
  .ft-rw-fig-n { font-size: 44px; }
  .ft-rw-fig-c { font-size: 14px; max-width: 14ch; }
  .ft-rw-who { padding-left: 54px; }
  .ft-rw-main > .pt-av + .ft-rw-who { padding-left: 54px; }
  .ft-rw-who-n { font-size: 16px; }
  .ft-rw-more { padding: 4px 18px 22px; }
  .ft-rw-t { grid-template-columns: 24px minmax(0, 1fr) auto; grid-template-areas: "r who v" "r when v"; row-gap: 0; padding: 10px 0; }
  .ft-rw-t-r { grid-area: r; font-size: 18px; }
  .ft-rw-t-who { grid-area: who; }
  .ft-rw-t-when { grid-area: when; padding-left: 44px; font-size: 14px; }
  .ft-rw-t-v { grid-area: v; font-size: 20px; }
  .ft-tw-list { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .ft-tw-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "top top" "round round" "who fig" "line line" "note note" "cta cta"; column-gap: 14px; row-gap: 12px; padding: 20px 18px 16px; }
  .ft-tw-card::before { left: 18px; right: 18px; }
  .ft-tw-top { grid-area: top; }
  .ft-tw-round { grid-area: round; }
  .ft-tw-fig-c { max-width: 13ch; text-align: right; }
  .ft-tw-fig { grid-area: fig; align-items: flex-end; text-align: right; }
  .ft-tw-fig-n { font-size: 44px; }
  .ft-tw-who { grid-area: who; }
  .ft-tw-line { grid-area: line; }
  .ft-tw-note { grid-area: note; }
  .ft-tw-cta { grid-area: cta; min-height: 24px; }
}
@media (max-width: 360px) {
  .ft-rw-row { padding: 18px 14px 14px; }
  .ft-rw-fig-n { font-size: 38px; }
  .ft-rw-who { padding-left: 0; }
  .ft-rw-main > .pt-av { display: none; }
  .ft-rw-main > .pt-av + .ft-rw-who { padding-left: 0; }
  .ft-tw-card { padding: 18px 14px 14px; }
  .ft-tw-fig-n { font-size: 38px; }
}
@media (forced-colors: active) {
  .ft-rw-fill { background: Highlight; }
  .ft-rw-pill { border: 1px solid CanvasText; }
}
@media (prefers-reduced-motion: reduce) {
  .ft-chev, .ft-tw-card { transition: none; }
}
