/* =========================================================
   Trading Evolution — Fed Rate Monitor (fed-monitor.js). Le bandeau reste sombre dans les deux thèmes
   (carte du monde), le reste suit les jetons du site (sombre par défaut, clair via html:not([data-theme="dark"])).
   ========================================================= */
.fed { --fed-cut: var(--cv-a); --fed-hold: var(--cv-c); --fed-hike: var(--amber); }

/* ---------- Bandeau : carte du monde + compte à rebours ---------- */
.fed-hero {
  position: relative; isolation: isolate; overflow: hidden; margin-bottom: var(--s-12);
  border-radius: var(--r-xl); border: 1px solid rgba(96, 165, 250, .18);
  background: radial-gradient(120% 100% at 28% 30%, #0c1a3d 0%, #060a18 58%, #04060f 100%);
  box-shadow: 0 30px 80px -30px rgba(2, 8, 30, .7);
  color-scheme: dark; --ink: #eef2fa; --ink-2: #b9c3d9; --muted: #8a95ae; --line: rgba(255, 255, 255, .09);
}
.fed-map { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; object-position: 38% 42%; }
.fed-hero h1, .fed-hero .lead { text-shadow: 0 2px 18px rgba(4, 7, 18, .85); }
.fed-hero::after { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(90deg, rgba(4, 7, 18, .82) 0%, rgba(4, 7, 18, .42) 40%, rgba(4, 7, 18, .06) 72%, rgba(4, 7, 18, .3) 100%), linear-gradient(0deg, rgba(4, 7, 18, .6), transparent 34%); }
[dir="rtl"] .fed-hero::after { background: linear-gradient(270deg, rgba(4, 7, 18, .82) 0%, rgba(4, 7, 18, .42) 40%, rgba(4, 7, 18, .06) 72%, rgba(4, 7, 18, .3) 100%), linear-gradient(0deg, rgba(4, 7, 18, .6), transparent 34%); }
.fed-hero-in { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr); gap: var(--s-10); align-items: center; padding: clamp(1.5rem, .8rem + 3.4vw, 3.75rem); min-height: 480px; }
.fed-hero h1 { font-family: var(--f-disp); font-size: clamp(2rem, 1.3rem + 2.4vw, 3.1rem); font-weight: 700; line-height: 1.06; letter-spacing: -.03em; color: #fff; margin-bottom: var(--s-5); text-wrap: balance; }
.fed-hero .lead { color: var(--ink-2); margin-bottom: 0; max-width: 36rem; }
.fed-hero .eyebrow { color: #cfe0ff; background: rgba(59, 130, 246, .12); border-color: rgba(96, 165, 250, .3); box-shadow: none; }
.fed-hero .eyebrow .dot { background: #22c55e; }

.fed-count {
  background: rgba(8, 13, 28, .68); border: 1px solid rgba(96, 165, 250, .24); border-radius: var(--r-xl);
  padding: clamp(1.1rem, .8rem + 1vw, 1.6rem); box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(255, 255, 255, .06);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.fed-count-label { margin: 0 0 var(--s-3); font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #8fb4ff; }
.fed-clock { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; }
.fed-clock span { display: grid; gap: .2rem; text-align: center; padding: .75rem .25rem .6rem; border-radius: var(--r-md); background: linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .02)); border: 1px solid rgba(255, 255, 255, .08); }
.fed-clock b { font-family: var(--f-mono); font-size: clamp(1.55rem, 1.1rem + 1.7vw, 2.45rem); font-weight: 700; line-height: 1; color: #fff; font-variant-numeric: tabular-nums; }
.fed-clock small { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.fed-next { margin: var(--s-4) 0 var(--s-4); color: #fff; font-weight: 700; line-height: 1.45; min-height: 2.9em; }
.fed-next small { color: var(--ink-2); font-weight: 500; font-size: var(--t-sm); }
.fed-now { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin: 0 0 var(--s-3); }
.fed-now div { padding: .65rem .8rem; border-radius: var(--r-md); background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .07); }
.fed-now dt { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.fed-now dd { margin: .25rem 0 0; font-family: var(--f-mono); font-weight: 700; color: #fff; direction: ltr; text-align: start; unicode-bidi: isolate; }
.fed-meta { display: flex; flex-wrap: wrap; gap: .35rem .9rem; margin: 0; font-size: var(--t-xs); color: var(--muted); }
.fed-live { display: inline-flex; align-items: center; gap: .4rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #4ade80; }
.fed-live i { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 0 rgba(34, 197, 94, .6); animation: fed-ping 2s infinite; }
.fed-live.is-new { color: #fbbf24; }
.fed-live.is-new i { background: #f59e0b; }
@keyframes fed-ping { 0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .55); } 70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }
.fed-sep, .fed-tag, .fed-today { display: inline-block; vertical-align: middle; padding: .1rem .5rem; border-radius: var(--r-full); font-size: 10.5px; font-weight: 800; letter-spacing: .04em; line-height: 1.5; text-transform: uppercase; background: var(--blue-50); border: 1px solid var(--blue-100); color: var(--blue-300); }
.fed-hero .fed-sep { background: rgba(59, 130, 246, .14); border-color: rgba(96, 165, 250, .3); color: #8fb4ff; }
.fed-today { background: rgba(245, 158, 11, .14); border-color: rgba(245, 158, 11, .35); color: #fbbf24; }

/* ---------- Outil ---------- */
.fed #probabilities, .fed #matrix, .fed #rate-path, .fed #history { max-width: none; }
.fed-tabs { display: flex; gap: .5rem; overflow-x: auto; padding: 2px 2px .5rem; margin: var(--s-5) 0 var(--s-4); scrollbar-width: thin; scrollbar-color: var(--blue-200) transparent; min-height: 64px; }
.fed-tabs::-webkit-scrollbar { height: 6px; }
.fed-tabs::-webkit-scrollbar-thumb { background: var(--blue-200); border-radius: 3px; }
.fed-tabs::-webkit-scrollbar-track { background: transparent; }
.fed-tabs button { flex: 0 0 auto; display: grid; gap: .1rem; min-width: 112px; text-align: start; padding: .6rem .85rem; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--card); color: var(--ink-2); font: inherit; cursor: pointer; transition: border-color var(--d-fast) var(--ease), background-color var(--d-fast) var(--ease); }
.fed-tabs button b { color: var(--ink); font-size: var(--t-sm); }
.fed-tabs button small { color: var(--muted); font-size: 11px; }
.fed-tabs button:hover { border-color: var(--blue-200); }
.fed-tabs button[aria-selected="true"] { border-color: var(--blue); background: var(--blue-50); box-shadow: inset 0 0 0 1px var(--blue); }
.fed-tabs button:focus-visible, .fed-mlink:focus-visible { outline: 2px solid var(--blue-200); outline-offset: 2px; }

.fed-panel { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: var(--s-5); align-items: start; }
.fed-sum { grid-column: 1 / -1; }
.fed-sum-h { margin: 0 0 var(--s-3) !important; color: var(--ink) !important; font-weight: 700; }
.fed-outs { display: grid; grid-template-columns: repeat(3, minmax(0, .8fr)) repeat(2, minmax(0, 1fr)); gap: var(--s-3); }
.fed-out { position: relative; overflow: hidden; display: grid; gap: .2rem; align-content: start; padding: var(--s-4); background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); }
.fed-out small { font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.fed-out b { font-family: var(--f-mono); font-size: clamp(1.25rem, 1rem + 1vw, 1.7rem); color: var(--ink); line-height: 1.15; direction: ltr; unicode-bidi: isolate; text-align: start; }
.fed-out span { font-size: var(--t-xs); color: var(--muted); direction: ltr; unicode-bidi: isolate; text-align: start; }
.fed-out i { position: absolute; inset-inline-start: 0; bottom: 0; height: 3px; border-radius: 0 3px 3px 0; transition: width .6s var(--ease); }
.fed-cut i { background: var(--fed-cut); } .fed-cut small { color: var(--fed-cut); }
.fed-hold i { background: var(--fed-hold); } .fed-hold small { color: var(--fed-hold); }
.fed-hike i { background: var(--fed-hike); } .fed-hike small { color: var(--fed-hike); }
.fed-lik { background: linear-gradient(135deg, rgba(59, 130, 246, .16), rgba(255, 255, 255, .02)); border-color: var(--blue-100); }

.fed-chart { margin: 0; padding: var(--s-4) var(--s-4) var(--s-3); background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); }
.fed-chart figcaption { margin-bottom: var(--s-3); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.fed-bars { display: flex; align-items: stretch; gap: clamp(4px, 1vw, 12px); height: 300px; direction: ltr; }
.fed-bar { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; text-align: center; }
.fed-bar-col { flex: 1 1 auto; width: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; border-bottom: 1px solid var(--line); }
.fed-bar-p { margin-bottom: 5px; font-family: var(--f-mono); font-size: 12px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.fed-bar-col i { display: block; width: 100%; max-width: 74px; border-radius: 7px 7px 2px 2px; background: linear-gradient(180deg, rgba(96, 165, 250, .5), rgba(59, 130, 246, .18)); transition: height .6s var(--ease); }
.fed-bar.is-top .fed-bar-col i { background: linear-gradient(180deg, #60a5fa, #2563eb); box-shadow: 0 0 22px rgba(59, 130, 246, .45); }
.fed-bar.is-top .fed-bar-p { color: var(--blue-300); }
.fed-bar.is-cur .fed-bar-col i { outline: 1.5px dashed var(--ink-2); outline-offset: 2px; }
.fed-bar-l { margin-top: 7px; font-family: var(--f-mono); font-size: 11px; line-height: 1.3; color: var(--ink-2); }
.fed-bar-tag { margin-top: 3px; font-size: 9.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--blue-300); }

.fed-table th { min-width: 0 !important; white-space: nowrap; font-family: var(--f-mono); }
.fed-table td { width: 62%; }
.fed-cell { display: flex; align-items: center; gap: .6rem; direction: ltr; }
.fed-cell i { flex: 0 0 auto; height: 8px; min-width: 2px; border-radius: 4px; background: var(--blue); transition: width .6s var(--ease); }
.fed-cell b { font-family: var(--f-mono); color: var(--ink); font-weight: 700; }
.fed-table tr.is-cur th { color: var(--blue-300); }

.fed-status { margin: var(--s-3) 0 0; font-size: var(--t-sm); color: var(--muted) !important; }
.fed.is-error .fed-status { color: var(--amber) !important; }
.fed:not(.is-ready) .fed-panel { min-height: 470px; border-radius: var(--r-lg); background: linear-gradient(100deg, var(--surface-3) 30%, rgba(96, 165, 250, .07) 50%, var(--surface-3) 70%) 0 0 / 200% 100%; animation: fed-shimmer 1.6s linear infinite; }
.fed.is-error .fed-panel, .fed.is-error .fed-tabs { display: none; }
@keyframes fed-shimmer { to { background-position: -200% 0; } }

/* ---------- Matrice ---------- */
.fed-matrix th, .fed-matrix td { padding: .55rem .6rem; text-align: center; white-space: nowrap; font-family: var(--f-mono); font-size: 12px; }
.fed-matrix thead th { font-size: 10.5px; letter-spacing: .02em; }
.fed-matrix tbody th { min-width: 0; text-align: start; }
.fed-matrix td { background-color: rgb(59 130 246 / calc(var(--p, 0) * .85)); color: var(--ink-2); }
.fed-matrix td.is-hi { color: #fff; font-weight: 700; }
.fed-matrix .is-cur { box-shadow: inset 1px 0 0 var(--blue-200), inset -1px 0 0 var(--blue-200); }
.fed-matrix thead .is-cur { color: var(--blue-300); }
.fed-mlink { padding: 0; border: 0; background: none; color: var(--blue-300); font: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.fed:not(.is-ready) #matrix .pg-table-wrap { min-height: 300px; }

/* ---------- Graphiques SVG ---------- */
.fed-wide { min-height: 240px; padding: var(--s-3) 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); direction: ltr; overflow: hidden; }
.fed-wide svg { display: block; max-width: 100%; height: auto; }
.fed-wide > .pg-note { padding: var(--s-6) var(--s-4); margin: 0; text-align: center; }
.fed-svg .fg { stroke: var(--cv-grid); }
.fed-svg .fa { fill: var(--cv-axis); font: 11px var(--f-mono); }
.fed-svg .fband { fill: var(--blue-50); }
.fed-svg .fband-l { fill: var(--blue-300); font-weight: 700; }
.fed-svg .fline { fill: none; stroke: var(--cv-a); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.fed-svg .fdot { fill: var(--cv-bg); stroke: var(--cv-a); stroke-width: 2; }
.fed-svg .fdot.is-sel { fill: var(--cv-a); }
.fed-svg .fv { fill: var(--cv-ink); font: 600 11px var(--f-mono); }
.fed-svg .fh { fill: none; stroke-width: 2.25; stroke-linejoin: round; }
.fed-svg .fh-end { stroke: none; }
.fed-svg .fh.is-cur { stroke-width: 3.25; }
.fed-legend { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; margin: var(--s-2) var(--s-4) 0 !important; font-size: var(--t-sm); color: var(--ink-2); direction: inherit; }
.fed-legend span { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; }
.fed-legend i { width: 14px; height: 3px; border-radius: 2px; }
.fed-legend b { font-family: var(--f-mono); font-weight: 700; color: var(--ink); }

/* ---------- Calendrier ---------- */
.fed-cal tbody th { min-width: 9rem; }
.fed-cal td time { white-space: nowrap; }
.fed-cal tr.fed-past > * { opacity: .5; }
.fed-cal tr.fed-next-row > * { background: var(--blue-50); }
.fed-cal tr.fed-next-row th { color: var(--blue-300); }


/* ---------- Thème clair ---------- */
html:not([data-theme="dark"]) .fed-tabs button { background: #fff; box-shadow: var(--sh-sm); }
html:not([data-theme="dark"]) .fed-tabs button[aria-selected="true"] { background: #eef4ff; }
html:not([data-theme="dark"]) .fed-out, html:not([data-theme="dark"]) .fed-chart, html:not([data-theme="dark"]) .fed-wide { background: #fff; box-shadow: var(--sh-sm); }
html:not([data-theme="dark"]) .fed-lik { background: linear-gradient(135deg, #eaf1ff, #fff 70%); border-color: rgba(37, 99, 235, .22); }
html:not([data-theme="dark"]) .fed-bar-col i { background: linear-gradient(180deg, rgba(37, 99, 235, .32), rgba(37, 99, 235, .1)); }
html:not([data-theme="dark"]) .fed-bar.is-top .fed-bar-col i { background: linear-gradient(180deg, #3b82f6, #1d4ed8); box-shadow: 0 8px 20px -6px rgba(37, 99, 235, .5); }
html:not([data-theme="dark"]) .fed-matrix td { background-color: rgb(37 99 235 / calc(var(--p, 0) * .8)); }
html:not([data-theme="dark"]) .fed-today { color: #a35a00; }

/* ---------- Téléphone et tablette ---------- */
@media (max-width: 960px) {
  .fed-hero-in { grid-template-columns: minmax(0, 1fr); gap: var(--s-6); min-height: 0; }
  .fed-map { object-position: 30% 30%; }
  .fed-panel { grid-template-columns: minmax(0, 1fr); }
  .fed-outs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fed-imp, .fed-lik { grid-column: span 3; }
}
@media (min-width: 600px) and (max-width: 960px) {
  .fed-imp, .fed-lik { grid-column: auto; }
  .fed-outs { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .fed-out { grid-column: span 2; }
  .fed-imp, .fed-lik { grid-column: span 3; }
}
@media (max-width: 600px) {
  .fed-hero { margin-inline: calc(var(--s-4) * -1 + 4px); border-radius: var(--r-lg); }
  .fed-hero-in { padding: var(--s-5) var(--s-4); }
  .fed-clock b { font-size: 1.6rem; }
  .fed-now { grid-template-columns: minmax(0, 1fr); }
  .fed-outs { gap: var(--s-2); }
  .fed-out { padding: var(--s-3); }
  .fed-bars { height: 240px; gap: 3px; }
  .fed-bar-p { font-size: 10px; }
  .fed-bar-l { font-size: 9.5px; }
}
@media (prefers-reduced-motion: reduce) {
  .fed-live i, .fed:not(.is-ready) .fed-panel { animation: none; }
  .fed-out i, .fed-bar-col i, .fed-cell i { transition: none; }
}
