* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #111827;
  color: #e5e7eb;
  min-height: 100vh;
}

/* ── Header ─────────────────────────────────────────────────────────────────── */
header {
  padding: 12px 20px 8px;
  background: #1a2236;
  border-bottom: 1px solid #2d3a50;
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

header h1 {
  font-size: 20px;
  font-weight: 800;
  color: #f87171;
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* ── Tab buttons ─────────────────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 8px;
  background: #0d1117;
  border: 1px solid #2d3a50;
  border-radius: 12px;
  padding: 5px;
}

.tab-btn {
  position: relative;
  background: transparent;
  color: #6b7280;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 9px 26px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.4px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s, box-shadow 0.2s, transform 0.1s;
  white-space: nowrap;
  user-select: none;
}

.tab-btn:hover:not(.active) {
  color: #d1d5db;
  background: rgba(255,255,255,0.05);
  border-color: #374151;
}

.tab-btn:active:not(.active) {
  transform: scale(0.97);
}

.tab-btn.active {
  color: #111827;
  font-weight: 700;
  border-color: transparent;
  transform: translateY(-1px);
  box-shadow:
    0 2px 12px rgba(248, 113, 113, 0.45),
    0 1px 3px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: background 0.25s, box-shadow 0.25s, color 0.25s, transform 0.1s;
}
body.mode-highest .tab-btn.active {
  background: linear-gradient(135deg, #f87171 0%, #fb923c 100%);
  box-shadow:
    0 2px 12px rgba(248, 113, 113, 0.45),
    0 1px 3px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
body.mode-lowest .tab-btn.active {
  background: linear-gradient(135deg, #38bdf8 0%, #60a5fa 100%);
  color: #0b1422;
  box-shadow:
    0 2px 12px rgba(96, 165, 250, 0.45),
    0 1px 3px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

/* ── Countdown ───────────────────────────────────────────────────────────────── */
#countdown-wrap {
  position: relative;
  background: #0d1117;
  border: 1px solid #2d3a50;
  height: 18px;
  border-radius: 9px;
  overflow: hidden;
  margin-bottom: 5px;
}

#progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #f87171, #fb923c);
  width: 100%;
  transition: width 1s linear;
  border-radius: 9px;
}

/* Mode theming: warm gradient for Highest, cool gradient for Lowest. */
body.mode-lowest #progress-bar {
  background: linear-gradient(90deg, #38bdf8, #60a5fa);
}

/* Sliding switch between title and tabs */
.mode-switch {
  position: relative;
  display: inline-flex;
  align-items: stretch;
  margin: 0 14px 0 18px;
  padding: 3px;
  border: 1px solid #2d3a50;
  border-radius: 999px;
  background: #0d1117;
  cursor: pointer;
  user-select: none;
  overflow: hidden;
  line-height: 1;
}
.mode-switch:active { transform: translateY(1px); }

.mode-switch-thumb {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc(50% - 3px);
  border-radius: 999px;
  z-index: 0;
  transition: transform 0.25s ease, background 0.25s, box-shadow 0.25s;
}
body.mode-highest .mode-switch-thumb {
  transform: translateX(0);
  background: linear-gradient(135deg, #f87171, #fb923c);
  box-shadow: 0 0 10px rgba(251, 146, 60, 0.45);
}
body.mode-lowest .mode-switch-thumb {
  transform: translateX(100%);
  background: linear-gradient(135deg, #38bdf8, #60a5fa);
  box-shadow: 0 0 10px rgba(96, 165, 250, 0.45);
}

.mode-switch-opt {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 700;
  color: #6b7280;
  transition: color 0.25s;
  letter-spacing: 0.3px;
}
.mode-switch-opt .mode-icon  { font-size: 14px; }
.mode-switch-opt .mode-label { letter-spacing: 0.4px; }
body.mode-highest .mode-switch-hi,
body.mode-lowest  .mode-switch-lo { color: #fff; }

#countdown-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 9px;
  font-weight: 800;
  color: #fff;
  pointer-events: none;
  letter-spacing: 0.5px;
}

#status {
  font-size: 10px;
  color: #4b5563;
}

/* ── Tab content ─────────────────────────────────────────────────────────────── */
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── R&D tab ─────────────────────────────────────────────────────────────────── */
.rd-subtabs { display: flex; gap: 6px; padding: 12px 20px 0; background: #1a2236; border-bottom: 1px solid #2d3a50; }
.rd-subtab-btn {
  background: #111827; color: #9ca3af; border: 1px solid #2d3a50; border-bottom: none;
  border-radius: 6px 6px 0 0; padding: 8px 16px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.rd-subtab-btn.active { background: #0b1422; color: #e5e7eb; }
.rd-sub-content { display: none; padding: 16px 20px; }
.rd-sub-content.active { display: block; }
.rd-toolbar { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.rd-toolbar label { font-size: 12px; font-weight: 600; color: #9ca3af; text-transform: uppercase; letter-spacing: .4px; }
.rd-toolbar select, .rd-toolbar input[type=number] {
  background: #111827; color: #e5e7eb; border: 1px solid #2d3a50; padding: 6px 10px; border-radius: 4px; font-size: 13px;
}
.rd-global-note { font-size: 11px; color: #6b7280; }
.rd-days-label { display: inline-flex; align-items: center; gap: 6px; }
.rd-days-label input { width: 60px; }
.rd-loading { color: #9ca3af; font-style: italic; padding: 20px; }

.loading-bar-wrap {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 60px 20px; gap: 14px;
}
.loading-bar-track {
  width: min(400px, 80%); height: 4px;
  background: #1e293b; border-radius: 2px; overflow: hidden;
}
.loading-bar-fill {
  height: 100%; width: 35%;
  background: linear-gradient(90deg, transparent, #60a5fa, transparent);
  border-radius: 2px;
  animation: loading-slide 1.4s ease-in-out infinite;
}
@keyframes loading-slide {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(400%); }
}
.loading-bar-label {
  color: #6b7280; font-size: 13px; font-style: italic; text-align: center;
}
.rd-chart-wrap { background: #0b1422; border: 1px solid #2d3a50; border-radius: 6px; padding: 12px; margin-bottom: 16px; height: 380px; }

.rd-table { width: 100%; border-collapse: collapse; font-size: 11px; font-family: ui-monospace, Menlo, monospace; }
.rd-table th, .rd-table td { padding: 4px 6px; border: 1px solid #1a2236; text-align: center; white-space: nowrap; }
.rd-table thead th { background: #1a2236; color: #9ca3af; font-weight: 700; position: sticky; top: 0; z-index: 1; }
.rd-table tbody th { background: #111827; color: #e5e7eb; text-align: left; font-weight: 600; position: sticky; left: 0; z-index: 1; }
.rd-table tbody tr:nth-child(even) td { background: #0d1726; }
.rd-table-wrap { overflow: auto; max-height: 75vh; border: 1px solid #2d3a50; border-radius: 6px; }
.rd-cell-good   { background: rgba(52,211,153,0.18) !important; color: #6ee7b7; }
.rd-cell-ok     { background: rgba(251,191,36,0.18)  !important; color: #fcd34d; }
.rd-cell-bad    { background: rgba(248,113,113,0.18) !important; color: #fca5a5; }
.rd-cell-empty  { color: #4b5563; }
.rd-cell-pm     { color: #c4b5fd; }
.rd-cell-metar  { color: #6ee7b7; font-weight: 600; }

.rd-toolbar-suffix { color: #6b7280; font-size: 12px; margin-left: -2px; }
.rd-edge-warning { font-size: 11px; color: #fbbf24; max-width: 700px; line-height: 1.4; }
.rd-btn {
  background: #4338ca; color: #fff; border: none; padding: 6px 14px; border-radius: 4px;
  font-size: 12px; font-weight: 600; cursor: pointer;
}
.rd-btn:hover { background: #5b50e0; }
.rd-edge-table .rd-cell-ev-pos { background: rgba(52,211,153,0.18); color: #34d399; font-weight: 700; }
.rd-edge-table .rd-cell-ev-strong { background: rgba(52,211,153,0.32); color: #6ee7b7; font-weight: 800; }
.rd-edge-table .rd-cell-ev-neg { background: rgba(248,113,113,0.12); color: #fca5a5; }
.rd-edge-table td, .rd-edge-table th { font-size: 12px; padding: 6px 8px; }
.rd-edge-table tbody tr:hover td { background: rgba(96,165,250,0.08); }
.rd-edge-table tr.rd-row-held td { background: rgba(96,165,250,0.10); border-left: 3px solid #60a5fa; }
.rd-edge-table tr.rd-row-held:hover td { background: rgba(96,165,250,0.18); }
.rd-edge-table .rd-cell-held { color: #60a5fa; font-weight: 700; cursor: help; }
.rd-edge-bucket { color: #c4b5fd; }

/* Tooltip on column headers (uses data-tooltip attr) */
.rd-tip {
  cursor: help;
  text-decoration: underline dotted #4b5563;
  text-underline-offset: 3px;
  position: relative;
}
.rd-tip::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translate(-50%, 8px);
  background: #0b1422;
  color: #e5e7eb;
  border: 1px solid #4338ca;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  white-space: pre-wrap;
  width: 320px;
  pointer-events: none;
  opacity: 0;
  z-index: 100;
  transition: opacity .15s;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  text-align: left;
}
.rd-tip:hover::after { opacity: 1; }

/* ── Météo mondiale — city grid ──────────────────────────────────────────────── */
#city-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 10px 14px 16px;
}

.city-card {
  background: #1a2236;
  border: 1px solid #2d3a50;
  border-radius: 8px;
  padding: 7px 9px 5px;
}

.city-card h3 {
  font-size: 11px;
  font-weight: 700;
  color: #f87171;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chart-wrapper {
  position: relative;
  height: 190px;
}

/* ── Météo locale — selector bar ─────────────────────────────────────────────── */
.locale-selector {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  background: #1a2236;
  border-bottom: 1px solid #2d3a50;
}

.locale-selector label {
  font-size: 13px;
  font-weight: 700;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.locale-clock {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13px;
  color: #d1d5db;
  background: #111827;
  padding: 6px 10px;
  border-radius: 4px;
  border: 1px solid #2d3a50;
  letter-spacing: 0.4px;
}

.locale-days-bar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.locale-days-btn {
  background: #1a2236;
  color: #9ca3af;
  border: 1px solid #2d3a50;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.12s, background 0.12s, border-color 0.12s;
}
.locale-days-btn:hover:not(.active) { color: #d1d5db; border-color: #4b5563; }
.locale-days-btn.active {
  background: linear-gradient(135deg, #1d4ed8, #3b82f6);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(59,130,246,0.35);
}
.locale-model-countdowns {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11px;
  color: #9ca3af;
  background: #111827;
  padding: 6px 10px;
  border-radius: 4px;
  border: 1px solid #2d3a50;
  letter-spacing: 0.3px;
}
.model-cd-item  { }
.model-cd-sep   { color: #4b5563; }
.model-cd-ok    { color: #9ca3af; }
.model-cd-alert { color: #ef4444; font-weight: 700; animation: blink-red 1s ease-in-out infinite; }
.model-cd-fresh { color: #22c55e; font-weight: 700; animation: blink-green 1.6s ease-in-out infinite; }
@keyframes blink-red {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.2; }
}
@keyframes blink-green {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.55; }
}

/* Source de données fraîchement ingérée (< 60min) — soulignement vert clignotant doux */
.model-fresh {
  color: #22c55e;
  animation: blink-green 1.6s ease-in-out infinite;
}

/* Cellule "Depuis dernière run effective" dans Données */
.freshness-eff       { color: #9ca3af; font-weight: 600; }
.freshness-eff-fresh { color: #22c55e; font-weight: 700; animation: blink-green 1.6s ease-in-out infinite; }

#city-select {
  background: #111827;
  color: #e5e7eb;
  border: 1px solid #374151;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  min-width: 240px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%236b7280' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

#city-select:hover  { border-color: #4b5563; }
#city-select:focus  { outline: none; border-color: #f87171; box-shadow: 0 0 0 2px rgba(248,113,113,0.2); }

/* ── Météo locale — empty prompt ─────────────────────────────────────────────── */
#locale-prompt {
  display: block;
  text-align: center;
  padding: 80px 20px;
  font-size: 15px;
  color: #4b5563;
  font-style: italic;
}

/* ── Météo locale — 3-column layout ─────────────────────────────────────────── */
#locale-layout {
  display: none; /* shown via JS */
  grid-template-columns: 65% 35%;
}

.locale-col {
  padding: 14px 16px;
  border-right: 1px solid #2d3a50;
  overflow-y: auto;
  max-height: calc(100vh - 130px);
}

.locale-col:last-child { border-right: none; }

.locale-chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid #2d3a50;
}
.locale-col h2 {
  font-size: 12px;
  font-weight: 700;
  color: #f87171;
  margin-bottom: 0;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.locale-zoom-reset-btn,
.locale-refresh-btn {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  background: #1a2236;
  color: #9ca3af;
  border: 1px solid #2d3a50;
  cursor: pointer;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.locale-zoom-reset-btn:hover,
.locale-refresh-btn:hover { background: #253348; color: #e5e7eb; }
.locale-refresh-btn { margin-left: auto; }
.locale-refresh-btn:disabled { opacity: 0.55; cursor: progress; }
.locale-chart-header { gap: 8px; }

.locale-chart-wrap {
  position: relative;
  height: 312px;
  margin-bottom: 6px;
}

/* ── Stats — day blocks ──────────────────────────────────────────────────────── */
.stats-day-block {
  margin-bottom: 18px;
}

.stats-day-title {
  font-size: 11px;
  font-weight: 700;
  color: #f87171;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 5px 0 6px;
  border-bottom: 1px solid #2d3a50;
  margin-bottom: 4px;
}

/* ── Stats table — col 2 ─────────────────────────────────────────────────────── */
.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.stats-table th {
  color: #4b5563;
  font-weight: 700;
  text-align: left;
  padding: 4px 8px;
  border-bottom: 1px solid #2d3a50;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.stats-table td {
  padding: 7px 8px;
  border-bottom: 1px solid #1a2236;
  vertical-align: top;
}

.stats-table tr.avg-row td  { background: rgba(248,113,113,0.06); }
.stats-table tr:hover td    { background: rgba(255,255,255,0.03); }

.stat-source {
  font-weight: 600;
  color: #e5e7eb;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 5px;
  position: relative;
  cursor: default;
}

.stat-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.stat-val      { font-size: 12px; font-weight: 700; color: #fbbf24; }
.stat-val.cool { color: #60a5fa; }
.stat-time     { font-size: 10px; color: #4b5563; margin-top: 2px; }
.stat-spread   { font-size: 10px; font-weight: 400; color: #6b7280; }

/* ── History verification table — col 1 ─────────────────────────────────────── */
.history-block       { margin-top: 20px; }
.history-title       { font-size: 12px; font-weight: 700; color: #e5e7eb; margin-bottom: 8px; text-transform: uppercase; letter-spacing: .5px; }
.history-table       { width: 100%; border-collapse: collapse; font-size: 11px; }
.history-table th    { padding: 4px 8px; text-align: center; color: #6b7280; font-weight: 600; border-bottom: 1px solid #2d3a50; }
.history-table td    { padding: 4px 8px; border-bottom: 1px solid #1a2236; text-align: center; }
.hist-actual-row td  { font-weight: 700; background: #1a2236; }
.hist-metar-interval { font-weight: 400; font-size: 11px; color: #6b7280; margin-left: 4px; }
.hist-val            { color: #d1d5db; font-weight: 600; }
.hist-val.hist-min   { color: #d1d5db; }
.hist-val-reliable   { font-style: italic; }
.hist-delta          { font-weight: 600; color: #9ca3af; }
.hist-delta-cell     { text-align: center; }
.hist-delta-th       { text-align: center !important; }
.delta-good          { color: #34d399; }
.delta-ok            { color: #fbbf24; }
.delta-bad           { color: #f87171; }
.history-note        { font-size: 9px; color: #4b5563; margin-top: 6px; line-height: 1.5; }
.hist-spread-badge   { display: inline-block; font-size: 10px; font-weight: 600; padding: 1px 7px; border-radius: 4px; margin-left: 6px; vertical-align: middle; }
.hist-spread-badge.delta-good { background: rgba(52,211,153,0.12);  color: #34d399; }
.hist-spread-badge.delta-ok   { background: rgba(251,191,36,0.12);  color: #fbbf24; }
.hist-spread-badge.delta-bad  { background: rgba(248,113,113,0.12); color: #f87171; }
.hist-rank           { color: #4b5563; margin-right: 2px; }
.pm-col              { color: #a78bfa; }
.pm-col-val          { font-weight: 600; }
.forecast-max        { color: #d1d5db; font-weight: 600; text-align: center; }
.forecast-corr-best  { color: #86efac; font-weight: 600; text-align: center; }
.forecast-corr-dim   { color: #4b5563; text-align: center; }
.forecast-net-na     { color: #4b5563; text-align: center; }
.fc-best-highlight   { background: rgba(134, 239, 172, 0.10); border: 1px solid rgba(134, 239, 172, 0.35); border-radius: 3px; }
.fc-day-hd           { text-align: center; border-bottom: 1px solid #2d3a50; }
.fc-sub-brut         { color: #9ca3af; font-size: 10px; text-align: center; }
.fc-sub-corr         { color: #86efac; font-size: 10px; font-weight: 600; text-align: center; }
.fc-sub-corr-dim     { color: #6b7280; font-weight: 400; }
.fc-sub-hd           { color: #9ca3af; font-size: 10px; font-weight: 500; text-align: center; border-bottom: 1px solid #2d3a50; padding: 2px 6px; }
.fc-sub-hd-corr      { color: #86efac; }
.fc-day-sep          { border-left: 2px solid #374151 !important; }
.fc-spread-tag       { color: #6b7280; font-size: 9px; font-weight: 400; margin-left: 4px; }
.fc-best-src-label   { background: rgba(134, 239, 172, 0.10); border-radius: 3px; }
/* Strategy-name sub-headers: wrap over several lines, narrow columns. */
.fc-strat-hd         { white-space: normal; font-size: 9px; line-height: 1.15; min-width: 52px; max-width: 78px; vertical-align: bottom; }
.fc-strat-hd.rd-tip  { text-decoration-color: #4b5563; }
.pm-hist-raw         { color: #6b7280; font-size: 10px; font-weight: 400; }
.history-loading     { font-size: 11px; color: #6b7280; margin-top: 16px; font-style: italic; }

/* ── Model freshness tooltip ─────────────────────────────────────────────────── */
.model-freshness-tip {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 200;
  background: #1a2236;
  border: 1px solid #3b4f6a;
  border-radius: 6px;
  padding: 7px 10px;
  min-width: 240px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.55);
  pointer-events: none;
}
.legend-item:hover .model-freshness-tip,
.stat-source:hover  .model-freshness-tip {
  display: block;
}
.tip-line {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: #d1d5db;
  line-height: 1.8;
  white-space: nowrap;
}

/* ── PolyMarket resolved history ─────────────────────────────────────────────── */
.pm-history-block  { margin-top: 28px; }
.pm-history-title  { font-size: 12px; font-weight: 700; color: #e5e7eb; margin-bottom: 8px; text-transform: uppercase; letter-spacing: .5px; }
.pm-history-table  { width: 100%; border-collapse: collapse; font-size: 11px; }
.pm-history-table th { padding: 4px 8px; text-align: center; color: #6b7280; font-weight: 600; border-bottom: 1px solid #2d3a50; }
.pm-history-table td { padding: 4px 8px; border-bottom: 1px solid #1a2236; }
.pm-hist-date      { color: #9ca3af; }
.pm-hist-temp      { color: #d1d5db; font-weight: 600; text-align: center; }
.pm-hist-forecast  { color: #d1d5db; font-weight: 600; text-align: center; }
.pm-hist-f         { color: #6b7280; font-size: 10px; font-weight: 400; }
.pm-hist-icon      { text-align: center; font-size: 14px; white-space: nowrap; }
.retro-win         { color: #34d399; font-size: 16px; font-weight: 900; }
.retro-loss        { color: #f87171; font-size: 16px; font-weight: 900; }
.pm-hist-tron      { font-size: 11px; color: #9ca3af; font-weight: 500; margin-left: 4px; }

/* ── Best source badge ───────────────────────────────────────────────────────── */
.best-source-badge {
  font-size: 11px;
  color: #d1d5db;
  background: rgba(167,139,250,0.12);
  border: 1px solid rgba(167,139,250,0.3);
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 14px;
  line-height: 1.6;
}
.best-source-badge strong { color: #a78bfa; }
.best-source-val { color: #6b7280; font-size: 10px; }

/* ── Strategies table (right block, above PolyMarket) ─────────────────────── */
.strategies-block { margin-bottom: 14px; }
.strategies-title { font-size: 12px; color: #d1d5db; font-weight: 600; margin-bottom: 6px; }
.strategies-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.strategies-table th {
  background: #1f2937; color: #9ca3af; font-weight: 600;
  text-align: left; padding: 6px 8px; border-bottom: 1px solid #374151;
}
.strategies-table th.num { text-align: right; }
.strategies-table td { padding: 4px 8px; border-bottom: 1px solid rgba(55,65,81,0.4); }
.strategies-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.strategies-table tr.strat-best {
  background: rgba(34,197,94,0.15);
}
.strategies-table tr.strat-best td { color: #86efac; font-weight: 700; }
.strategies-table tr.strat-best td.strat-wr { color: #4ade80; }
.strat-rank { color: #6b7280; width: 24px; }
.strat-short { color: #e5e7eb; }
.strat-wr-bad  { color: #ef4444; }
.strat-wr-ok   { color: #facc15; }
.strat-wr-good { color: #4ade80; }
.strat-source-cell { color: #9ca3af; font-size: 10px; }
.strat-na { color: #4b5563; font-style: italic; }
.pred-strategy-sub {
  display: block; color: #4b5563; font-size: 10px; margin-top: 2px;
}
.fb-block { margin-top: 8px; border-top: 1px solid rgba(167,139,250,0.2); padding-top: 6px; display: flex; flex-direction: column; gap: 4px; }
.fb-line  { display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px; font-size: 11px; }
.fb-date  { color: #a78bfa; font-weight: 700; min-width: 52px; }
.fb-action { color: #e5e7eb; }
.fb-action strong { color: #e5e7eb; }
.fb-val   { color: #6b7280; }
.fb-cote  { color: #d1d5db; }
.fb-cote strong { color: #d1d5db; }
.fb-c     { color: #6b7280; font-size: 10px; }
.fb-none  { color: #4b5563; font-style: italic; }

/* ── Bets column — col 3 ─────────────────────────────────────────────────────── */
.no-bets {
  color: #4b5563;
  font-size: 12px;
  line-height: 1.7;
  padding: 16px;
  background: #0d1117;
  border: 1px dashed #2d3a50;
  border-radius: 8px;
  font-style: italic;
}

.bet-card {
  background: #0d1117;
  border: 1px solid #2d3a50;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
}

.bet-question {
  font-size: 10px;
  color: #6b7280;
  margin-bottom: 6px;
  line-height: 1.5;
}

.bet-condition {
  font-size: 12px;
  font-weight: 700;
  color: #f87171;
  margin-bottom: 10px;
}

.bet-chart-wrap {
  position: relative;
  height: 160px;
  margin-top: 4px;
}

.bet-bar-wrap  { margin-bottom: 6px; }

.bet-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
  color: #d1d5db;
  margin-bottom: 3px;
}

.bet-bar-track {
  background: #1a2236;
  height: 16px;
  border-radius: 4px;
  overflow: hidden;
}

.bet-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}

/* ── Shared legend ───────────────────────────────────────────────────────────── */
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-top: 5px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  color: #6b7280;
  position: relative;
  cursor: default;
}

.legend-dash {
  width: 12px;
  height: 2px;
  border-radius: 1px;
  flex-shrink: 0;
}

/* Soulignement des modèles régionaux dans Météo locale (légende + tableaux) */
.legend-regional,
.model-regional {
  text-decoration: underline;
  text-decoration-color: #fbbf24;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 2px;
}

/* Source écartée des stratégies (couverture < moitié des autres) : en rouge. */
.hist-src-excluded { color: #f87171 !important; }
td.hist-src-excluded .hist-rank { color: #f87171 !important; }

/* ── Predictions tab ─────────────────────────────────────────────────────────── */
#tab-predictions { padding: 24px 32px; }

.pred-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.pred-table th {
  padding: 7px 12px;
  text-align: center;
  color: #6b7280;
  font-weight: 600;
  border-bottom: 1px solid #2d3a50;
  white-space: nowrap;
}
.pred-th-rank { text-align: center; width: 30px; }
.pred-th-sort { cursor: pointer; user-select: none; white-space: nowrap; }
.pred-th-sort:hover { color: #d1d5db; }
.pred-th-active { color: #e2e8f0 !important; }
.pred-sort-ind { margin-left: 4px; font-size: 10px; opacity: 0.8; }
.pred-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #1a2236;
  vertical-align: middle;
  text-align: center;
}
.pred-table td:nth-child(1),
.pred-table td:nth-child(2) { text-align: left; }

.pred-group-hd {
  font-size: 11px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; padding: 6px 12px 4px;
  border-bottom: 2px solid #2d3a50;
}
.pred-group-14 { color: #60a5fa; border-top: 2px solid #1d4ed8; }
.pred-group-5  { color: #34d399; border-top: 2px solid #065f46; }

.pred-sep-hd { width: 10px; border: none; background: transparent; padding: 0; }
.pred-sep    { width: 10px; border: none; background: transparent; padding: 0; }

.pred-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.pred-interval-bar { display: flex; gap: 6px; }

.pred-refresh-btn {
  background: #1a2236;
  color: #6b7280;
  border: 1px solid #2d3a50;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.12s, background 0.12s, border-color 0.12s;
  margin-left: auto;
}
.pred-refresh-btn:hover { color: #facc15; border-color: #854d0e; background: #1e2a1a; }

.pred-interval-btn {
  background: #1a2236;
  color: #6b7280;
  border: 1px solid #2d3a50;
  border-radius: 6px;
  padding: 6px 18px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.12s, background 0.12s, border-color 0.12s;
}
.pred-interval-btn:hover:not(.active) { color: #d1d5db; border-color: #4b5563; }
.pred-interval-btn.active {
  background: linear-gradient(135deg, #1d4ed8, #3b82f6);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(59,130,246,0.35);
}

.pred-group-spread { color: #34d399; border-top: 2px solid #065f46; }
.pred-group-sim    { color: #a78bfa; border-top: 2px solid #4c1d95; }
.pred-group-pm     { color: #fbbf24; border-top: 2px solid #92400e; }
.pred-group-q      { color: #f472b6; border-top: 2px solid #831843; }
.pred-group-day    { color: #e5e7eb; font-size: 14px; font-weight: 700; letter-spacing: .04em; }

/* ── Séparation verticale appuyée entre les méga-colonnes par jour ─────────── */
.pred-table th.pred-day-start,
.pred-table td.pred-day-start {
  border-left: 3px solid #4f46e5;
}
.pred-table th.pred-day-start-hd {
  border-left: 3px solid #4f46e5;
  background: linear-gradient(135deg, rgba(99,102,241,0.18), rgba(129,140,248,0.10));
}

/* Opportunité favorable : Bucket PM ≤ 30 % · Qualité ≥ 70 % · Spread ≤ 5 °C */
.pred-table td.pred-day-favorable {
  background: rgba(34,197,94,0.10);
}

/* ── Regroupement par région dans le tableau Prédictions ───────────────────── */
.pred-region-row {
  background: linear-gradient(135deg, rgba(59,130,246,0.10), rgba(99,102,241,0.06));
  border-top: 1px solid rgba(99,102,241,0.30);
  border-bottom: 1px solid rgba(99,102,241,0.20);
  cursor: pointer;
  transition: background .15s;
  font-weight: 700;
}
.pred-region-row:hover {
  background: linear-gradient(135deg, rgba(59,130,246,0.18), rgba(99,102,241,0.12));
}
.pred-region-row.open {
  background: linear-gradient(135deg, rgba(59,130,246,0.16), rgba(99,102,241,0.10));
}
.pred-region-toggle-cell {
  color: #a5b4fc;
  font-weight: 700;
  text-align: center;
  user-select: none;
}
.pred-region-name {
  color: #c7d2fe;
  font-size: 14px;
  font-weight: 700;
}
.pred-region-count {
  color: #818cf8;
  font-size: 11px;
  font-weight: 500;
  margin-left: 4px;
}
.pred-city-row {
  background: rgba(255,255,255,0.01);
}

.pred-pm-bucket-cell    { font-weight: 700; font-size: 13px; text-align: center; line-height: 1.4; }
.pred-pm-bucket-pct     { color: #fcd34d; }

.pred-q-cell { font-weight: 700; font-size: 13px; text-align: center; white-space: nowrap; }
.pred-q-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
}
.pred-q-pct       { vertical-align: middle; }
.pred-q-red       { color: #f87171; }
.pred-q-orange    { color: #fb923c; }
.pred-q-green     { color: #4ade80; }
.pred-q-dot.pred-q-red    { background: #ef4444; box-shadow: 0 0 4px rgba(239,68,68,.6); }
.pred-q-dot.pred-q-orange { background: #f97316; box-shadow: 0 0 4px rgba(249,115,22,.6); }
.pred-q-dot.pred-q-green  { background: #22c55e; box-shadow: 0 0 4px rgba(34,197,94,.6); }

/* ── Météo locale: encadré "Qualité de la prédiction dans son bucket PM" ── */
.bet-quality-box {
  background: linear-gradient(135deg, rgba(244,114,182,0.07), rgba(168,85,247,0.04));
  border: 1px solid rgba(244,114,182,0.30);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 14px;
}
.bet-quality-title {
  font-size: 11px;
  font-weight: 700;
  color: #f9a8d4;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 8px;
}
.bet-quality-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 5px 0;
  border-top: 1px solid rgba(244,114,182,0.10);
  font-size: 12px;
}
.bet-quality-row:first-of-type { border-top: none; }
.bet-quality-date  { font-weight: 700; color: #e5e7eb; }
.bet-quality-meta  { color: #9ca3af; font-size: 11px; text-align: right; }
.bet-quality-pred  { color: #d1d5db; }
.bet-quality-bucket { margin-left: 6px; color: #94a3b8; }
.bet-quality-score { font-weight: 700; font-size: 13px; min-width: 60px; text-align: right; }
.bet-quality-dot {
  display: inline-block;
  width: 9px; height: 9px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.bet-quality-pct        { vertical-align: middle; }
.bet-quality-pct.pred-q-red    { color: #f87171; }
.bet-quality-pct.pred-q-orange { color: #fb923c; }
.bet-quality-pct.pred-q-green  { color: #4ade80; }
.bet-quality-dot.pred-q-red    { background: #ef4444; box-shadow: 0 0 5px rgba(239,68,68,.6); }
.bet-quality-dot.pred-q-orange { background: #f97316; box-shadow: 0 0 5px rgba(249,115,22,.6); }
.bet-quality-dot.pred-q-green  { background: #22c55e; box-shadow: 0 0 5px rgba(34,197,94,.6); }

.pred-rank      { color: #4b5563; }
.pred-city-td   { font-weight: 600; }
.pred-city-link { color: #93c5fd; text-decoration: none; }
.pred-city-link:hover { color: #60a5fa; text-decoration: underline; }
.pred-dmax      { font-weight: 700; line-height: 1.6; }
.pred-sim-win   { font-weight: 700; vertical-align: top; }
.pred-source    { font-size: 10px; font-weight: 400; color: #6b7280; }
.pred-retro     { font-weight: 700; font-size: 13px; }
.pred-spread    { font-weight: 700; font-size: 13px; }
.pred-spread-na { color: #374151; }
.pred-spread-cell { font-weight: 700; font-size: 13px; text-align: center; }

/* ── Configuration tab ──────────────────────────────────────────────────────── */
.cfg-page        { padding: 24px 28px; }
.cfg-header      { margin-bottom: 20px; }
.cfg-header h2   { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.cfg-desc        { font-size: 12px; color: #6b7280; line-height: 1.5; }
.cfg-table-wrap  { overflow-x: auto; }
.cfg-table       { width: 100%; border-collapse: collapse; font-size: 13px; }
.cfg-table thead tr { background: #1a2236; }
.cfg-table th    { padding: 10px 14px; text-align: left; font-size: 11px; font-weight: 600; color: #6b7280; text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid #2d3a50; }
.cfg-table tbody tr { border-bottom: 1px solid #1a2236; transition: background .15s; }
.cfg-table tbody tr:hover:not(.cfg-edit-row) { background: rgba(255,255,255,.03); }
.cfg-table td    { padding: 9px 14px; vertical-align: middle; }
.cfg-name        { font-weight: 600; color: #d1d5db; white-space: nowrap; }
.cfg-coord       { font-family: monospace; font-size: 12px; color: #9ca3af; }
.cfg-tz          { font-size: 11px; color: #6b7280; white-space: nowrap; }
.cfg-comment-td  { max-width: 260px; }
.cfg-comment     { font-size: 11px; color: #9ca3af; }
.cfg-no-comment  { color: #374151; }
.cfg-badge       { display: inline-block; border-radius: 4px; padding: 2px 8px; font-size: 11px; font-weight: 600; }
.cfg-auto        { background: rgba(59,130,246,.15); color: #60a5fa; }
.cfg-custom      { background: rgba(167,139,250,.15); color: #a78bfa; }
.cfg-actions     { white-space: nowrap; }
.cfg-maps-btn    { display: inline-flex; align-items: center; justify-content: center; background: rgba(52,211,153,.1); border: 1px solid rgba(52,211,153,.25); border-radius: 6px; padding: 4px 8px; font-size: 13px; text-decoration: none; margin-right: 6px; line-height: 1; }
.cfg-maps-btn:hover { background: rgba(52,211,153,.22); }
.cfg-edit-btn    { background: rgba(167,139,250,.12); color: #a78bfa; border: 1px solid rgba(167,139,250,.25); border-radius: 6px; padding: 4px 12px; font-size: 12px; cursor: pointer; }
.cfg-edit-btn:hover { background: rgba(167,139,250,.22); }
.cfg-reset-btn   { background: rgba(248,113,113,.1); color: #f87171; border: 1px solid rgba(248,113,113,.2); border-radius: 6px; padding: 4px 10px; font-size: 12px; cursor: pointer; margin-left: 6px; }
.cfg-reset-btn:hover { background: rgba(248,113,113,.2); }
.cfg-edit-row td { padding: 0; background: #0d1117; }
.cfg-edit-form   { padding: 14px 18px; display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.cfg-edit-form label { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: #6b7280; }
.cfg-edit-form input { background: #111827; border: 1px solid #374151; border-radius: 6px; padding: 7px 10px; color: #e5e7eb; font-size: 13px; width: 130px; outline: none; font-family: monospace; }
.cfg-edit-form input:focus { border-color: #a78bfa; }
.cfg-edit-btns   { display: flex; gap: 8px; align-self: flex-end; padding-bottom: 1px; }
.cfg-save-btn    { background: #7c3aed; color: #fff; border: none; border-radius: 6px; padding: 8px 16px; font-size: 13px; font-weight: 600; cursor: pointer; }
.cfg-save-btn:hover { background: #6d28d9; }
.cfg-cancel-btn  { background: transparent; color: #6b7280; border: 1px solid #374151; border-radius: 6px; padding: 8px 14px; font-size: 13px; cursor: pointer; }
.cfg-cancel-btn:hover { color: #9ca3af; }

/* ── Custom scrollbars (Météo locale columns) ────────────────────────────────── */
.locale-col::-webkit-scrollbar          { width: 12px; }
.locale-col::-webkit-scrollbar-track   { background: rgba(255,255,255,0.04); border-radius: 6px; }
.locale-col::-webkit-scrollbar-thumb   { background: rgba(167,139,250,0.35); border-radius: 6px; border: 2px solid transparent; background-clip: padding-box; }
.locale-col::-webkit-scrollbar-thumb:hover { background: rgba(167,139,250,0.65); border: 2px solid transparent; background-clip: padding-box; }

/* ── Balance tab ─────────────────────────────────────────────────────────────── */
.bal-setup-wrap {
  display: flex; align-items: center; justify-content: center;
  min-height: 60vh; padding: 40px 20px;
}
.bal-setup-card {
  background: #1a2236; border: 1px solid #2d3a50; border-radius: 16px;
  padding: 48px 56px; max-width: 520px; width: 100%; text-align: center;
}
.bal-setup-icon  { font-size: 48px; margin-bottom: 16px; }
.bal-setup-card h2 { font-size: 20px; font-weight: 700; color: #e5e7eb; margin-bottom: 10px; }
.bal-setup-card p  { color: #9ca3af; font-size: 14px; margin-bottom: 20px; line-height: 1.6; }
.bal-setup-hint {
  background: rgba(167,139,250,0.08); border: 1px solid rgba(167,139,250,0.2);
  border-radius: 8px; padding: 10px 14px; font-size: 12px; color: #9ca3af;
  margin-bottom: 24px; text-align: left;
}
.bal-setup-form { display: flex; gap: 10px; }
.bal-setup-form input {
  flex: 1; background: #111827; border: 1px solid #374151; border-radius: 8px;
  padding: 10px 14px; color: #e5e7eb; font-size: 13px; font-family: monospace;
  outline: none;
}
.bal-setup-form input:focus { border-color: #a78bfa; }
.bal-setup-form button {
  background: #7c3aed; color: #fff; border: none; border-radius: 8px;
  padding: 10px 20px; font-size: 13px; font-weight: 600; cursor: pointer;
  white-space: nowrap;
}
.bal-setup-form button:hover { background: #6d28d9; }

.bal-page      { padding: 24px 28px; }
.bal-header    { margin-bottom: 24px; }
.bal-kpi-grid  { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.bal-kpi {
  background: #1a2236; border: 1px solid #2d3a50; border-radius: 12px;
  padding: 18px 20px;
}
.bal-kpi-label { font-size: 11px; color: #6b7280; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
.bal-kpi-value { font-size: 22px; font-weight: 800; color: #e5e7eb; }
.bal-kpi-pct   { font-size: 13px; font-weight: 500; }
.bal-kpi-sub   { font-size: 10px; color: #6b7280; margin-top: 4px; font-weight: 500; }
.bal-kpi-cash-detail { color: #4b5563; }
.bal-pos { color: #34d399; }
.bal-neg { color: #f87171; }

.bal-period-section { margin-bottom: 16px; }
.bal-period-title {
  font-size: 11px; color: #6b7280; text-transform: uppercase; letter-spacing: .05em;
  margin-bottom: 8px;
}
.bal-period-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px;
}
.bal-period {
  background: #131d2e; border: 1px solid #1e2d42; border-radius: 10px;
  padding: 12px 14px;
}
.bal-period-label {
  font-size: 10px; color: #6b7280; text-transform: uppercase;
  letter-spacing: .05em; margin-bottom: 5px;
}
.bal-period-value {
  font-size: 14px; font-weight: 700; color: #e5e7eb; white-space: nowrap;
}
.bal-period-pct { font-size: 11px; font-weight: 500; margin-left: 2px; }
.bal-period-na  { color: #374151; font-weight: 400; }

.bal-meta {
  display: flex; align-items: center; gap: 18px; font-size: 11px; color: #4b5563;
}
.bal-wallet, .bal-updated { font-family: monospace; }
.bal-change-wallet { color: #a78bfa; text-decoration: none; font-size: 11px; }
.bal-change-wallet:hover { color: #7c3aed; }

.bal-table-wrap { overflow-x: auto; }
.bal-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.bal-table thead tr { background: #1a2236; }
.bal-table th {
  padding: 10px 14px; text-align: center; font-size: 11px; font-weight: 600;
  color: #6b7280; text-transform: uppercase; letter-spacing: .05em;
  border-bottom: 1px solid #2d3a50;
}
.bal-table tbody tr { border-bottom: 1px solid #1a2236; transition: background .15s; }
.bal-table tbody tr:hover { background: rgba(167,139,250,0.05); }
.bal-table td   { padding: 11px 14px; vertical-align: middle; }
.bal-title      { max-width: 340px; color: #d1d5db; line-height: 1.4; }
.bal-num        { text-align: center; font-variant-numeric: tabular-nums; font-weight: 600; color: #d1d5db; }
.bal-date       { text-align: center; color: #9ca3af; font-size: 12px; }
.bal-empty      { text-align: center; color: #4b5563; padding: 40px; }

.bal-outcome-badge {
  display: inline-block; border-radius: 4px; padding: 2px 8px;
  font-size: 11px; font-weight: 700; margin-right: 6px;
}
.bal-yes { background: rgba(52,211,153,.15); color: #34d399; }
.bal-no  { background: rgba(248,113,113,.15); color: #f87171; }

/* ── Stats sections (Statistiques tab) ────────────────────────────────────── */
.bal-kpi-mini {
  display: inline-flex; flex-direction: column; gap: 4px;
  background: #1a2236; border: 1px solid #2d3a50; border-radius: 12px;
  padding: 14px 22px; margin-bottom: 14px;
}
.bal-kpi-mini-label {
  font-size: 11px; color: #6b7280; text-transform: uppercase;
  letter-spacing: .05em; margin-bottom: 4px;
}
.bal-kpi-mini-value { font-size: 26px; font-weight: 800; color: #e5e7eb; }
.bal-kpi-mini-sub   { font-size: 10px; color: #6b7280; font-weight: 500; }

.bal-section { margin-top: 22px; }
.bal-section-title {
  font-size: 13px; font-weight: 700; color: #d1d5db;
  text-transform: uppercase; letter-spacing: .07em;
  margin-bottom: 10px;
  padding-bottom: 5px; border-bottom: 1px solid #2d3a50;
}
.bal-empty-section { color: #6b7280; font-size: 13px; padding: 14px 0; }

.stat-summary {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px;
}
.stat-summary-balance {
  background: #1a2236;
  border-color: #3b4f6a;
  box-shadow: 0 0 12px rgba(167, 139, 250, 0.15);
}
.stat-summary-balance .stat-summary-value { color: #e9d5ff; }

.bal-chart-wrap {
  background: #131d2e; border: 1px solid #1e2d42; border-radius: 10px;
  padding: 14px 16px; height: 260px;
}
.stat-summary-item {
  background: #131d2e; border: 1px solid #1e2d42; border-radius: 10px;
  padding: 12px 14px; text-align: center;
}
.stat-summary-label {
  font-size: 10px; color: #6b7280; text-transform: uppercase;
  letter-spacing: .05em; margin-bottom: 4px;
}
.stat-summary-value { font-size: 17px; font-weight: 800; color: #e5e7eb; }
.stat-summary-sub   { font-size: 10px; color: #6b7280; margin-top: 2px; }

.stat-table {
  width: 100%; border-collapse: collapse; font-size: 12px;
}
.stat-table thead tr { background: #1a2236; }
.stat-table th {
  padding: 8px 10px; font-size: 10px; font-weight: 600;
  color: #6b7280; text-transform: uppercase; letter-spacing: .05em;
  border-bottom: 1px solid #2d3a50; text-align: center;
}
.stat-table th:first-child { text-align: left; }
.stat-table tbody tr { border-bottom: 1px solid #1a2236; }
.stat-table tbody tr:hover { background: rgba(167,139,250,0.04); }
.stat-table td { padding: 7px 10px; vertical-align: middle; }
.stat-key {
  color: #e5e7eb; font-weight: 600;
}
.stat-key-extra {
  display: inline-block; margin-left: 6px;
  font-size: 10px; color: #6b7280; font-weight: 400;
}
.stat-num {
  text-align: center; font-variant-numeric: tabular-nums; color: #d1d5db;
}
.stat-roi { font-size: 13px; }
.bal-prob { font-size: 11px; color: #6b7280; }
.bal-pnl-pct { font-size: 11px; font-weight: 400; }

.bal-row-neutral td { background: rgba(251,191,36,0.05); }
.bal-row-win     td { background: rgba(52,211,153,0.06); }
.bal-row-loss    td { background: rgba(248,113,113,0.06); }
.bal-row-jackpot td { background: rgba(52,211,153,0.10); }

@keyframes casino-spin {
  0%   { transform: scale(1) rotate(0deg);   opacity: 1;   }
  25%  { transform: scale(1.3) rotate(15deg); opacity: 0.9; }
  50%  { transform: scale(1) rotate(0deg);   opacity: 1;   }
  75%  { transform: scale(1.3) rotate(-15deg);opacity: 0.9; }
  100% { transform: scale(1) rotate(0deg);   opacity: 1;   }
}
.bal-casino {
  display: inline-block;
  margin-left: 5px;
  animation: casino-spin 0.9s ease-in-out infinite;
  cursor: default;
}

/* ── Consommation tab ────────────────────────────────────────────────────────── */
.conso-page    { padding: 24px 28px; }
.conso-header  { margin-bottom: 20px; }
.conso-header h2 { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.conso-meta    { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: #6b7280; align-items: flex-start; }
.conso-refresh-all-btn {
  margin-top: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 6px;
  background: linear-gradient(135deg, #1d4ed8, #3b82f6);
  color: #fff;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .15s, box-shadow .15s, transform .1s;
  box-shadow: 0 2px 8px rgba(59,130,246,0.25);
}
.conso-refresh-all-btn:hover:not(:disabled)  { background: linear-gradient(135deg, #1e40af, #2563eb); box-shadow: 0 3px 10px rgba(59,130,246,0.4); }
.conso-refresh-all-btn:active:not(:disabled) { transform: translateY(1px); }
.conso-refresh-all-btn:disabled { opacity: .6; cursor: progress; }
.conso-note    { font-size: 11px; color: #4b5563; }

.conso-table-wrap { overflow-x: auto; }
.conso-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.conso-table thead tr { background: #1a2236; }
.conso-table th {
  padding: 10px 14px; text-align: left; font-size: 11px; font-weight: 600;
  color: #6b7280; text-transform: uppercase; letter-spacing: .05em;
  border-bottom: 1px solid #2d3a50; white-space: nowrap;
}
.conso-table tbody tr { border-bottom: 1px solid #1a2236; transition: background .15s; }
.conso-table tbody tr:hover { background: rgba(255,255,255,0.03); }
.conso-table td { padding: 12px 14px; vertical-align: middle; }

.conso-label   { font-weight: 600; color: #d1d5db; white-space: nowrap; }
.conso-url-badge {
  font-family: monospace; font-size: 11px; background: rgba(99,102,241,.12);
  color: #818cf8; border: 1px solid rgba(99,102,241,.2); border-radius: 4px;
  padding: 2px 7px;
}
.conso-freq    { color: #9ca3af; font-size: 12px; white-space: nowrap; }
.conso-calls   { font-variant-numeric: tabular-nums; font-weight: 700; color: #e5e7eb; text-align: right; }
.conso-limit   { text-align: right; color: #6b7280; font-variant-numeric: tabular-nums; }
.conso-unlimited { color: #374151; }
.conso-proj    { font-variant-numeric: tabular-nums; text-align: right; color: #d1d5db; font-weight: 600; }
.conso-proj-pct { color: #6b7280; font-size: 11px; font-weight: 400; }

.conso-bar-cell { min-width: 160px; }
.conso-bar-wrap { display: inline-flex; align-items: center; gap: 8px; width: 100%; }
.conso-bar-wrap .conso-bar {
  height: 8px; border-radius: 4px; min-width: 2px; transition: width .4s;
}
.conso-bar-green  { background: linear-gradient(90deg, #059669, #34d399); }
.conso-bar-orange { background: linear-gradient(90deg, #d97706, #fbbf24); }
.conso-bar-red    { background: linear-gradient(90deg, #dc2626, #f87171); }
.conso-pct        { font-size: 11px; color: #9ca3af; white-space: nowrap; }

.conso-trend      { white-space: nowrap; }
.conso-trend-green  { color: #34d399; font-size: 12px; font-weight: 600; }
.conso-trend-orange { color: #fbbf24; font-size: 12px; font-weight: 600; }
.conso-trend-red    { color: #f87171; font-size: 12px; font-weight: 600; }
.conso-last-ts  { white-space: nowrap; font-variant-numeric: tabular-nums; }
.conso-ts       { color: #9ca3af; font-size: 12px; }
.conso-ts-time  { color: #e5e7eb; font-size: 12px; font-weight: 600; }
.conso-never    { color: #4b5563; }

/* ── Consommation — model freshness table ──────────────────────────────────── */
.freshness-section   { margin-top: 32px; }
.freshness-title     { font-size: 15px; font-weight: 700; color: #e5e7eb; margin-bottom: 12px; }
.freshness-table td  { padding: 10px 14px; vertical-align: middle; line-height: 1.5; }
.freshness-src       { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.freshness-dot       { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.freshness-src strong { font-size: 13px; color: #e5e7eb; }
.freshness-schedule  { font-size: 11px; color: #6b7280; margin-left: 2px; }
.freshness-ago,
.freshness-until     { font-variant-numeric: tabular-nums; font-size: 13px; font-weight: 600; color: #d1d5db; white-space: nowrap; }
.freshness-countdown { color: #60a5fa; }
.freshness-sub       { display: block; font-size: 11px; font-weight: 400; color: #6b7280; }
.freshness-action    { white-space: nowrap; }
.freshness-refresh-btn {
  padding: 5px 12px; font-size: 12px; font-weight: 600; border-radius: 4px;
  background: #1e3a5f; color: #60a5fa; border: 1px solid #2d5a8e; cursor: pointer;
  transition: background .15s;
}
.freshness-refresh-btn:hover:not(:disabled) { background: #254a76; }
.freshness-refresh-btn:disabled { opacity: .5; cursor: default; }
.freshness-note      { margin-top: 8px; font-size: 11px; color: #4b5563; font-style: italic; }

/* ── Forecast analysis block ─────────────────────────────────────────────────── */
.fa-block {
  margin: 10px 0 4px;
  background: #131d2e;
  border: 1px solid #1e2d42;
  border-radius: 8px;
  overflow: hidden;
}

/* T0 header */
.fa-t0-section {
  padding: 10px 14px 10px;
  border-bottom: 1px solid #1e2d42;
}

.fa-t0-hd {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.fa-t0-label {
  font-size: 10px;
  font-weight: 700;
  color: #4b5563;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  flex-shrink: 0;
}

.fa-avg-val {
  font-size: 26px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1;
}

.fa-spread-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
}
.fa-spread-badge.delta-good { background: rgba(52,211,153,0.12);  color: #34d399; border: 1px solid rgba(52,211,153,0.25); }
.fa-spread-badge.delta-ok   { background: rgba(251,191,36,0.12);  color: #fbbf24; border: 1px solid rgba(251,191,36,0.25); }
.fa-spread-badge.delta-bad  { background: rgba(248,113,113,0.12); color: #f87171; border: 1px solid rgba(248,113,113,0.25); }

.fa-model-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
}

.fa-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: #9ca3af;
}
.fa-badge strong { color: #e5e7eb; }

.fa-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--dot);
  flex-shrink: 0;
}

/* Volatility table */
.fa-vol-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.fa-block-title {
  text-align: left !important;
  font-size: 11px;
  font-weight: 700;
  color: #e5e7eb;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 9px 12px 7px !important;
  border-bottom: 1px solid #1e2d42;
  background: #0d1117;
}

.fa-vol-table thead tr {
  background: #0d1117;
}

.fa-vol-table th {
  padding: 6px 12px;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  color: #4b5563;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid #1e2d42;
}
.fa-vol-table th:not(:first-child) { text-align: center; }

.fa-vol-table tbody tr {
  border-bottom: 1px solid #1a2236;
  transition: background 0.12s;
}
.fa-vol-table tbody tr:last-child { border-bottom: none; }
.fa-vol-table tbody tr:hover { background: rgba(255,255,255,0.03); }

.fa-td-day {
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  color: #d1d5db;
  white-space: nowrap;
}

.fa-td-num {
  padding: 8px 12px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
}

.fa-td-peak {
  padding: 8px 12px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
}

.fa-peak-time {
  font-size: 10px;
  font-weight: 400;
  color: #6b7280;
  margin-left: 2px;
}

/* Tooltip sur les en-têtes */
.fa-th-tip {
  position: relative;
  cursor: help;
  text-decoration: underline dotted #374151;
  text-underline-offset: 3px;
  display: inline-block;
}

.fa-th-tip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: 220px;
  background: #1e2a3e;
  border: 1px solid #374151;
  color: #d1d5db;
  font-size: 11px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  padding: 8px 11px;
  border-radius: 7px;
  line-height: 1.55;
  white-space: normal;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  z-index: 200;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}

.fa-th-tip:hover::after { opacity: 1; }

/* ── Simulations tab ─────────────────────────────────────────────────────────── */
.sim-subtabs { display: flex; align-items: center; gap: 6px; padding: 12px 20px 0; background: #1a2236; border-bottom: 1px solid #2d3a50; }
.sim-subtab-btn {
  background: #111827; color: #9ca3af; border: 1px solid #2d3a50; border-bottom: none;
  border-radius: 6px 6px 0 0; padding: 8px 16px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.sim-subtab-btn.active { background: #0b1422; color: #e5e7eb; }
.sim-sub-content { display: none; padding: 16px 20px; }
.sim-sub-content.active { display: block; }
.sim-window-note { color: #6b7280; font-size: 11px; font-style: italic; margin-left: auto; }

.sim-section-title  { font-size: 13px; font-weight: 700; color: #e5e7eb; margin: 18px 0 8px; text-transform: uppercase; letter-spacing: .5px; }
.sim-section-title:first-child { margin-top: 0; }
.sim-section-sub    { font-size: 11px; color: #9ca3af; margin-bottom: 10px; font-weight: 400; }

.sim-table { width: 100%; border-collapse: collapse; font-size: 11px; margin-bottom: 24px; background: #1a2236; border-radius: 6px; overflow: hidden; }
.sim-table thead th { background: #243144; color: #e5e7eb; padding: 8px 10px; text-align: left; font-weight: 700; font-size: 11px; border-bottom: 1px solid #2d3a50; position: relative; cursor: help; }
.sim-table thead th.num { text-align: right; }
.sim-table tbody td { padding: 7px 10px; border-bottom: 1px solid #243144; color: #d1d5db; }
.sim-table tbody td.num { text-align: right; font-variant-numeric: tabular-nums; }
.sim-table tbody tr:last-child td { border-bottom: none; }
.sim-table tbody tr:hover { background: rgba(96, 165, 250, 0.05); }

.sim-best-row td       { background: rgba(134, 239, 172, 0.12); font-weight: 600; }
.sim-worst-row td      { background: rgba(248, 113, 113, 0.10); }
.sim-aggregate-row td  { background: #243144; font-weight: 700; color: #e5e7eb; border-top: 2px solid #3b4f6a; }

.sim-mae-good   { color: #86efac; }
.sim-mae-ok     { color: #fbbf24; }
.sim-mae-bad    { color: #f87171; }

.sim-weight-controls { background: #1a2236; padding: 14px 16px; border-radius: 6px; margin-bottom: 16px; }
.sim-weight-row      { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 12px; }
.sim-weight-row:last-child { margin-bottom: 0; }
.sim-weight-label    { min-width: 130px; color: #d1d5db; font-weight: 600; position: relative; cursor: default; }
.sim-weight-slider   { flex: 1; max-width: 260px; }
.sim-weight-value    { min-width: 60px; font-variant-numeric: tabular-nums; color: #93c5fd; font-weight: 700; }
.sim-weight-opt      { min-width: 80px; font-size: 10px; color: #6b7280; }
.sim-weight-btns     { display: flex; gap: 8px; margin-top: 12px; }
.sim-weight-btn      { background: #2d3a50; color: #e5e7eb; border: 1px solid #3b4f6a; padding: 6px 14px; border-radius: 4px; font-size: 11px; font-weight: 600; cursor: pointer; }
.sim-weight-btn:hover { background: #3b4f6a; }
.sim-weight-btn-primary { background: #1e40af; border-color: #2563eb; }
.sim-weight-btn-primary:hover { background: #2563eb; }

.sim-metric-card { display: inline-block; padding: 8px 14px; background: #243144; border-radius: 5px; margin-right: 10px; margin-bottom: 8px; font-size: 11px; }
.sim-metric-card .val { font-size: 16px; font-weight: 700; color: #e5e7eb; display: block; font-variant-numeric: tabular-nums; }
.sim-metric-card .lbl { color: #9ca3af; text-transform: uppercase; letter-spacing: .3px; font-size: 9px; }

.sim-prompt { padding: 40px 20px; text-align: center; color: #6b7280; font-size: 13px; }

/* Column header tooltip (data-tip attribute) */
.sim-table thead th[data-tip] { position: relative; }
.sim-table thead th[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute; top: calc(100% + 4px); left: 0;
  background: #1a2236; border: 1px solid #3b4f6a; border-radius: 6px;
  padding: 7px 10px; font-size: 11px; font-weight: 400; color: #d1d5db;
  white-space: normal; line-height: 1.5; min-width: 200px; max-width: 320px;
  z-index: 250; box-shadow: 0 4px 14px rgba(0,0,0,0.55);
}

/* Backtest PM 2 — unit column */
.sim-bt2-unit { color: #9ca3af; font-size: 10px; font-weight: 600; letter-spacing: .5px; }

/* Backtest PM 2 — best cell per row */
.sim-bt2-best { background: rgba(52, 211, 153, 0.12) !important; outline: 1px solid rgba(52, 211, 153, 0.35); }

/* Backtest PM 2 — summary cards */
.sim-bt2-card { text-align: center; min-width: 90px; }
.sim-bt2-card .val { font-size: 22px; }
.sim-bt2-card-sub { display: block; font-size: 9px; color: #6b7280; margin-top: 2px; }
.sim-bt2-card-best { outline: 1px solid rgba(52, 211, 153, 0.5); background: rgba(52, 211, 153, 0.08) !important; }
.sim-bt2-card-best .val { color: #34d399; }

/* Backtest PM 2 — tfoot summary row */
.sim-bt2-tfoot { font-size: 11px; font-weight: 600; color: #d1d5db; padding: 6px 8px; border-top: 2px solid #3b4f6a; background: #1a2236; }

/* Simulations — multi-villes header + accordion */
.sim-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; background: #0f1729; border-bottom: 1px solid #2d3a50; }
.sim-header .sim-window-note { margin-left: 0; }
.sim-city-row { cursor: pointer; }
.sim-city-row:hover { background: rgba(96, 165, 250, 0.10) !important; }
.sim-acc-arrow { color: #6b7280; font-size: 9px; margin-right: 4px; display: inline-block; width: 10px; }

/* ── Global floating tooltip ─────────────────────────────────────────────────── */
#float-tip-g {
  display: none;
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  background: #1a2236;
  border: 1px solid #3b4f6a;
  border-radius: 6px;
  padding: 10px 13px;
  box-shadow: 0 5px 18px rgba(0,0,0,0.65);
  max-width: 440px;
  font-size: 11px;
  color: #d1d5db;
  line-height: 1.5;
}
.ftip-head { font-weight: 700; font-size: 12px; color: #e5e7eb; margin-bottom: 3px; }
.ftip-sub  { color: #9ca3af; font-size: 10px; margin-bottom: 6px; }
.ftip-row  { white-space: nowrap; margin-bottom: 1px; }
.ftip-table { border-collapse: collapse; width: 100%; margin-top: 7px; }
.ftip-table thead th { color: #6b7280; text-align: left; padding: 2px 7px; font-size: 10px; border-bottom: 1px solid #2d3a50; }
.ftip-table tbody td { padding: 3px 7px; border-bottom: 1px solid #1e2d43; }
.ftip-date { color: #9ca3af; white-space: nowrap; }
.ftip-num  { color: #e5e7eb; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.ftip-pm   { color: #d1d5db; white-space: nowrap; }
.ftip-res  { text-align: center; min-width: 24px; }
.ftip-win  { color: #34d399; font-weight: 900; font-size: 13px; }
.ftip-loss { color: #f87171; font-weight: 900; font-size: 13px; }

/* ── Peak reached overlays ───────────────────────────────────────────────────
   When the city's observed TMAX/TMIN for today has already happened, betting
   for that day is pointless. Applied to: stats day block, forecast cells,
   bet cards (Météo locale) + the J/J+1/J+2 cells (Prédictions). */
.peak-banner {
  display: block;
  background: rgba(0, 0, 0, 0.85);
  color: #fca5a5;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 5px 8px;
  margin: 4px 0 8px;
  text-align: center;
  border: 1px solid #7f1d1d;
  border-radius: 4px;
  line-height: 1.35;
}
.stats-day-block.peak-reached .stats-table,
.bet-card.peak-reached .bet-chart-wrap {
  position: relative;
  opacity: 0.35;
  filter: grayscale(0.6);
  pointer-events: none;
}
.stats-day-block.peak-reached .stats-table::after,
.bet-card.peak-reached .bet-chart-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(10, 14, 22, 0.55);
  border-radius: 4px;
  pointer-events: none;
}
/* Forecast block (col 1 — 3 day forecast table) */
th.fc-day-hd.fc-peak-reached,
th.fc-sub-hd.fc-peak-reached,
td.fc-peak-reached {
  background: rgba(15, 18, 28, 0.85) !important;
  color: #fca5a5 !important;
}
td.fc-peak-reached {
  opacity: 0.55;
  text-decoration: line-through;
  text-decoration-color: rgba(252, 165, 165, 0.4);
}
.fc-peak-sub {
  display: block;
  font-size: 9px;
  font-weight: 700;
  color: #fca5a5;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-top: 2px;
  line-height: 1.2;
}
/* Prédictions: J/J+1/J+2 cell overlay */
.pred-table td.pred-day-peak-reached {
  background: linear-gradient(rgba(8, 10, 16, 0.78), rgba(8, 10, 16, 0.78)),
              repeating-linear-gradient(135deg,
                rgba(127, 29, 29, 0.18) 0 8px,
                transparent 8px 16px) !important;
  color: #fca5a5 !important;
  cursor: help;
}
.pred-table td.pred-day-peak-reached > * {
  opacity: 0.45;
}

/* ══════════════════════════════════════════════════════════════════════════
   World Map
   ══════════════════════════════════════════════════════════════════════════ */
.wm-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px 18px;
}
.wm-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: #9ca3af;
}
.wm-leg-item { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.wm-leg-item b { color: #d1d5db; }
.wm-leg-band { display: inline-block; width: 18px; height: 12px; border-radius: 2px; }
.wm-leg-band-max { background: rgba(251,146,60,0.35); border: 1px solid rgba(251,146,60,0.6); }
.wm-leg-band-min { background: rgba(56,189,248,0.30); border: 1px solid rgba(56,189,248,0.6); }
.wm-leg-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; }
.wm-leg-dot-max  { background: #fb923c; }
.wm-leg-dot-min  { background: #38bdf8; }
.wm-leg-dot-both { background: linear-gradient(90deg, #38bdf8 0 50%, #fb923c 50% 100%); }
.wm-leg-halo {
  display: inline-block; width: 12px; height: 12px; border-radius: 50%;
  background: #cbd5e1;
  box-shadow: 0 0 0 2px rgba(34,197,94,0.9), 0 0 8px 3px rgba(34,197,94,0.7);
}

.wm-controls { display: flex; align-items: center; gap: 8px; }
.wm-btn {
  background: #0d1117;
  color: #cbd5e1;
  border: 1px solid #2d3a50;
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  min-width: 38px;
}
.wm-btn:hover { background: #161f33; border-color: #3b82f6; color: #fff; }
.wm-btn:active { transform: scale(0.96); }
.wm-btn-refresh { color: #fbbf24; border-color: #854d0e; }
.wm-btn-refresh:hover { background: #1e2a1a; border-color: #a16207; color: #facc15; }
.wm-btn:disabled { opacity: 0.5; cursor: progress; }

#wm-map-wrap {
  position: relative;
  margin: 0;
  border: none;
  border-top: 1px solid #2d3a50;
  border-radius: 0;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 35%, #0e1830 0%, #0a0f1c 100%);
}
#wm-map { display: block; width: 100%; height: auto; cursor: grab; }
#wm-map:active { cursor: grabbing; }
.wm-status {
  position: absolute;
  top: 12px; left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  color: #94a3b8;
  background: rgba(13,17,23,0.85);
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid #2d3a50;
  pointer-events: none;
}
.wm-status.wm-hidden { display: none; }

/* Map geometry */
.wm-sphere    { fill: #0a1120; stroke: #1e2a44; stroke-width: 0.5px; }
.wm-graticule { fill: none; stroke: rgba(148,163,184,0.10); stroke-width: 0.5px; }
.wm-land      { fill: #1c283f; stroke: #33425e; stroke-width: 0.4px; }

/* Time-window bands */
.wm-band-max { fill: rgba(251,146,60,0.16); }
.wm-band-min { fill: rgba(56,189,248,0.14); }
.wm-band-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
  pointer-events: none;
}
.wm-band-label-max { fill: rgba(251,146,60,0.85); }
.wm-band-label-min { fill: rgba(56,189,248,0.85); }
.wm-band-arrow {
  fill: none;
  stroke-width: 1.4px;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: wm-arrow-drift 3s linear infinite;
}
.wm-band-arrow-max { stroke: rgba(251,146,60,0.65); }
.wm-band-arrow-min { stroke: rgba(56,189,248,0.65); }
/* Fade in on the right, drift left, fade out — loop is seamless because the
   reset happens while invisible (opacity 0). Conveys the east→west motion. */
@keyframes wm-arrow-drift {
  0%   { opacity: 0;    transform: translateX(7px); }
  30%  { opacity: 0.95; }
  70%  { opacity: 0.95; }
  100% { opacity: 0;    transform: translateX(-9px); }
}

/* City markers */
.wm-marker { cursor: pointer; }
.wm-marker .wm-dot-max  { fill: #fb923c; }
.wm-marker .wm-dot-min  { fill: #38bdf8; }
.wm-marker .wm-dot-ring { fill: none; stroke: rgba(255,255,255,0.55); stroke-width: 0.8px; }
.wm-marker:hover .wm-dot-ring { stroke: #fff; stroke-width: 1.4px; }
.wm-city-name {
  font-size: 11px;
  font-weight: 700;
  fill: #f1f5f9;
  text-anchor: middle;
  paint-order: stroke;
  stroke: rgba(3,7,18,0.9);
  stroke-width: 3px;
  stroke-linejoin: round;
}
.wm-sub {
  font-size: 9px;
  font-weight: 600;
  text-anchor: middle;
  paint-order: stroke;
  stroke: rgba(3,7,18,0.92);
  stroke-width: 2.6px;
  stroke-linejoin: round;
}
.wm-marker:hover .wm-city-name { fill: #fff; }

/* Hover tooltip (replaces the always-on sub-lines under each city) */
.wm-tooltip {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  width: 270px;
  background: rgba(13,17,23,0.97);
  border: 1px solid #2d3a50;
  border-radius: 9px;
  padding: 9px 11px;
  font-size: 11.5px;
  line-height: 1.45;
  box-shadow: 0 8px 22px rgba(0,0,0,0.55);
  white-space: normal;
}
.wm-tooltip.wm-hidden { display: none; }
.wm-tt-city { font-size: 13px; font-weight: 800; color: #f1f5f9; margin-bottom: 5px; }
.wm-tt-section { padding-top: 6px; margin-top: 6px; border-top: 1px solid rgba(148,163,184,0.14); }
.wm-tt-section:first-of-type { border-top: none; margin-top: 0; padding-top: 0; }
.wm-tt-head { font-size: 11px; font-weight: 700; margin-bottom: 4px; }
.wm-tt-max .wm-tt-head, .wm-tt-max .wm-tt-v { color: #fdba74; }
.wm-tt-min .wm-tt-head, .wm-tt-min .wm-tt-v { color: #7dd3fc; }
.wm-tt-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-top: 3px;
}
.wm-tt-k { color: #cbd5e1; font-weight: 600; }
.wm-tt-v { font-weight: 800; white-space: nowrap; }
.wm-tt-hint { color: #8b97a8; font-size: 9.5px; line-height: 1.35; margin: 1px 0 3px; }

/* Green opportunity halo */
.wm-halo {
  fill: rgba(34,197,94,0.16);
  stroke: rgba(34,197,94,0.9);
  stroke-width: 1.6px;
  filter: drop-shadow(0 0 5px rgba(34,197,94,0.85));
  animation: wm-halo-pulse 2.1s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}
@keyframes wm-halo-pulse {
  0%, 100% { opacity: 0.55; transform: scale(0.92); }
  50%      { opacity: 1;    transform: scale(1.12); }
}
