@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('./fonts/plus-jakarta-sans-latin-wght-normal.woff2') format('woff2');
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #090d16;
  --surface: #111827;
  --surface-2: #192335;
  --surface-3: #233047;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: #343e52;
  --text: #f8fafc;
  --muted: #94a3b8;
  --accent: #10b981;
  --accent-text: #10b981;
  --on-accent: #042f2e;
  --accent-soft: rgba(16, 185, 129, 0.12);
  --info: #38bdf8;
  --pitch: rgba(16, 185, 129, 0.24);
  --glow: 0 0 20px rgba(16, 185, 129, 0.25);
  --ticket-bg: var(--surface);
  --ticket-surface: var(--surface-2);
  --ticket-line: var(--line);
  --ticket-text: var(--text);
  --ticket-muted: var(--muted);
  --glass: rgba(17, 24, 39, 0.75);
  --glass-nav: rgba(17, 21, 30, 0.9);
  --halo: rgba(16, 185, 129, 0.15);
  --ring: color-mix(in srgb, var(--accent-text) 52%, var(--line));
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  --radius: 20px;
  --page-width: 1200px;
  --page-gutter: clamp(12px, 2.4vw, 28px);
  --header-offset: 50px;
  --display: 'Plus Jakarta Sans', Inter, system-ui, sans-serif;
  --numeric: Inter, system-ui, sans-serif;
}

:root.light {
  --bg: #f2f6fa;
  --surface: #fff;
  --surface-2: #eaf0f6;
  --surface-3: #e1e9f2;
  --line: #d8e1ec;
  --line-strong: #a2b2c5;
  --text: #101c2d;
  --muted: #506178;
  --accent: #10b981;
  --accent-text: #006b49;
  --on-accent: #042f2e;
  --accent-soft: #ddf6ec;
  --info: #006784;
  --pitch: rgba(0, 107, 73, 0.21);
  --ticket-bg: var(--surface);
  --ticket-surface: var(--surface-2);
  --ticket-line: var(--line);
  --ticket-text: var(--text);
  --ticket-muted: var(--muted);
  --glass: rgba(255, 255, 255, 0.86);
  --glass-nav: rgba(248, 251, 255, 0.94);
  --halo: rgba(0, 166, 114, 0.12);
  --shadow: 0 12px 32px rgba(20, 39, 68, 0.06);
}

body {
  background:
    radial-gradient(circle at 50% -10%, var(--halo), transparent 60%) top / 100% 840px no-repeat,
    radial-gradient(ellipse at 100% 12%, rgba(56, 189, 248, 0.08), transparent 48%) top / 100% 920px
      no-repeat,
    var(--bg);
  font-family: var(--numeric);
  font-variant-numeric: tabular-nums;
}

body :is(button, input, select, textarea) {
  accent-color: var(--accent-text);
}

body :is(a, button, summary, input, select, textarea):focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 3px;
}

body
  :is(
    .bankroll-amount,
    .score,
    .final-score strong,
    .live-score strong,
    .kickoff strong,
    .prob-legend b,
    .selection-price b,
    .selection-ev,
    .selection-probability,
    .bankroll-kpis dd,
    .result-pick strong,
    .market-price strong,
    .market-potential,
    .odd-movement,
    .market-confidence b,
    .hero-score-parts b,
    .date-chip span,
    .prediction-kpi-grid strong,
    .stats-grid strong,
    .ticket-totals strong,
    .ticket-stake strong,
    .ticket-figures dd,
    .coupon-count,
    #coupon-odds,
    #stake,
    #target-output
  ) {
  font-family: var(--numeric);
  font-variant-numeric: tabular-nums;
}

body .topbar {
  height: 50px;
  min-height: 50px;
  grid-template-columns: max-content minmax(0, 1fr) max-content;
  grid-template-rows: auto;
  gap: clamp(8px, 1.4vw, 18px);
  padding: 2px max(var(--page-gutter), calc((100% - var(--page-width)) / 2 + var(--page-gutter)));
  background: var(--glass-nav);
}

body .topbar > :is(.brand, .tabs, .topbar-actions) {
  grid-row: 1;
}

body .topbar .brand {
  gap: 6px;
  flex: none;
}

body .topbar .brand-mark {
  display: block;
  width: 25px;
  height: 27px;
}

body .topbar .brand-name {
  display: inline;
  font-size: 16px;
  letter-spacing: -0.055em;
  text-transform: none;
  white-space: nowrap;
}

body .topbar .tabs {
  grid-column: 2;
  justify-self: center;
  flex-wrap: nowrap;
  gap: 4px;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
}

body .topbar .tab-button {
  min-height: 36px;
  padding: 4px 9px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
}

body .topbar .tab-button.active {
  background: var(--accent-soft);
  color: var(--accent-text);
}

body .topbar-actions {
  grid-column: 3;
  gap: 6px;
  justify-content: flex-end;
}

.algorithm-status {
  display: inline-flex;
  flex: none;
  gap: 6px;
  align-items: center;
  padding: 4px 7px;
  border: 1px solid var(--ring);
  border-radius: 999px;
  color: var(--accent-text);
  background: var(--accent-soft);
  font: 500 10px/1.35 var(--numeric);
  white-space: nowrap;
}

.algorithm-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: status-pulse 2.4s ease-out infinite;
}

@keyframes status-pulse {
  0% {
    box-shadow: 0 0 0 0 var(--ring);
  }
  70%,
  100% {
    box-shadow: 0 0 0 5px transparent;
  }
}

body #dashboard {
  width: 100%;
  max-width: var(--page-width);
  gap: 16px;
  padding-inline: var(--page-gutter);
}

body :is(.card:not(.opt), .match-card, .hero-score, .ticket, .builder-card) {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--glass);
}

body :is(.hero-main, .hero-score, .match-card, .builder-card, .ticket) {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition:
    border-color 0.3s ease-out,
    box-shadow 0.3s ease-out;
}

body :is(.hero-score, .match-card, .builder-card, .ticket):focus-within {
  border-color: var(--ring);
}

body #dashboard > .hero:not(.tab-hidden) {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

body .hero-main {
  position: relative;
  isolation: isolate;
  justify-content: center;
  min-height: 0;
  gap: 9px;
  padding: clamp(20px, 3vw, 36px);
  overflow: hidden;
  background-image: radial-gradient(ellipse at 96% 8%, var(--accent-soft), transparent 69%);
}

body .hero-main .hero-pitch {
  position: absolute;
  z-index: -1;
  inset: -20% -8% auto auto;
  width: min(52%, 360px);
  height: auto;
  transform: rotate(-13deg);
  color: var(--pitch);
  opacity: 0.65;
  pointer-events: none;
}

body .hero-main .eyebrow,
body .hero-score > small {
  margin: 0;
  color: var(--accent-text);
  font: 600 10px/1.5 var(--numeric);
  letter-spacing: 0.12em;
}

body .hero h1 {
  color: var(--text);
  font: 800 clamp(30px, 4vw, 52px) / 1.08 var(--display);
  letter-spacing: -0.06em;
  text-transform: none;
}

body .hero-intro {
  margin: 0;
  font-size: 14px;
}

body .today-empty p {
  margin: 6px 0;
}

body .today-empty button {
  min-height: 44px;
}

body .hero-copy {
  max-width: none;
  color: var(--muted);
  font-size: 12px;
  white-space: normal;
}

body .hero-main .hero-cta {
  display: none;
}

body .hero-main #quick-combo {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
}

body .hero-main .hero-actions {
  order: 2;
  gap: 8px;
}

body .hero-main .hero-actions .button {
  min-height: 38px;
  padding: 6px 12px;
  font-size: 12px;
}

body .hero-main .hero-actions [data-open-tab='predictions'] {
  display: none;
}

body .hero-score {
  min-width: 0;
  justify-content: center;
  padding: 18px;
  color: var(--text);
  background: radial-gradient(ellipse at 50% 0%, var(--accent-soft), transparent 72%), var(--glass);
  transform: none;
}

body .hero-score > small,
body .hero-score u {
  color: var(--info);
}

body .hero-score .gauge {
  width: 154px;
  height: 85px;
  stroke-width: 11px;
}

body .gauge-track {
  stroke: var(--line-strong);
}

body .gauge-fill {
  stroke: url('#confidence-gradient');
  filter: drop-shadow(0 0 5px var(--ring));
  transition: stroke-dasharray 0.3s ease-out;
}

body .hero-score .score {
  margin-top: -45px;
  color: var(--text);
  font: 700 36px/1 var(--numeric);
}

body .hero-score .score small {
  color: var(--muted);
  font-size: 12px;
}

body .hero-score-parts {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body .hero-score-parts > span {
  background: var(--surface-2);
  border: 1px solid var(--line);
}

body .hero-score-parts b {
  color: var(--info);
}

body .hero-score-parts em {
  color: var(--muted);
}

body #match-navigation:not([hidden]) {
  align-self: stretch;
  width: auto;
  min-width: 0;
  margin: 0;
  padding: 4px;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--glass);
}

body #match-navigation button {
  min-height: 44px;
  padding-inline: 10px;
  border-radius: 10px;
}

body #match-navigation button.active {
  background: var(--accent-soft);
  color: var(--accent-text);
}

body .workspace,
body #matches,
body #match-list {
  min-width: 0;
}

body #matches > #daily-selection {
  margin-top: 16px;
}

body #matches .section-heading {
  margin-bottom: 10px;
}

body #matches .section-heading h2 {
  font-size: clamp(22px, 2.7vw, 34px);
  letter-spacing: -0.04em;
  text-transform: none;
}

body #matches .match-filter-context {
  gap: 4px 12px;
  margin-block: 5px 8px;
}

body #matches .match-strip {
  margin-bottom: 8px;
  padding-block: 4px;
}

body .fixture-network-notice {
  margin-block: 8px;
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
}

body .fixture-network-notice p {
  margin: 0 0 8px;
}

body .fixture-network-notice button {
  min-height: 44px;
}

body .match-preview-card {
  min-height: 144px;
  padding: 16px;
}

body .match-preview-card p {
  margin: 0;
  color: var(--muted);
}

body .match-preview-card h3 {
  margin: 6px 0;
}

body .match-card,
body .match-card.spotlight {
  padding: clamp(10px, 1.5vw, 16px);
  border-radius: var(--radius);
}

body .match-card .match-hero {
  height: auto;
  min-height: 150px;
  padding: 6px 10px 10px;
  border: 1px solid var(--line);
  background: #101722;
}

body .match-card .match-hero::before {
  background: linear-gradient(180deg, #0a1423b3, #090e19e8);
}

body .match-card .match-hero .crest {
  width: clamp(38px, 5vw, 54px);
  height: clamp(38px, 5vw, 54px);
  background: rgba(255, 255, 255, 0.86);
  border-radius: 14px;
  padding: 5px;
}

body .match-header-stats {
  min-height: 44px;
  border: 1px solid #38bdf880;
  background: #102739;
  color: #8feaff;
}

body .match-header-stats:is(:hover, [aria-expanded='true']) {
  background: #124056;
}

body .confidence-track {
  height: 5px;
  background: var(--line-strong);
}

body .confidence-track i,
body .market.selected .confidence-track i {
  background: linear-gradient(90deg, var(--live), var(--info), var(--accent));
  box-shadow: 0 0 8px var(--ring);
}

body .market.selected .confidence-track i {
  background: var(--on-accent);
}

body .match-outcome .prob-track {
  height: 6px;
  border-radius: 999px;
}

body .match-outcome .p-home {
  background: linear-gradient(90deg, var(--accent-text), var(--accent));
}

body .match-outcome .p-away {
  background: linear-gradient(90deg, var(--info), color-mix(in srgb, var(--info) 68%, var(--text)));
}

body .match-card .recommended {
  border-radius: 14px;
}

body .match-card .recommended:not(button) {
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
}

body .match-card .recommended:not(button) :is(strong, small, .selection-eyebrow) {
  background: none;
  color: var(--muted);
}

body :is(.result-pick, .stake-controls button, .builder-tabs button, .bet-mode button) {
  min-height: 44px;
}

body :is(.builder-card, .ticket) input[type='range'] {
  width: 100%;
  min-height: 44px;
  margin-inline: 0;
  cursor: ew-resize;
}

body .builder .bet-mode button.active,
body .builder .builder-tabs button[aria-selected='true'] {
  border: 1px solid var(--ring);
  background: var(--accent-soft);
  color: var(--accent-text);
}

body .builder .range-label output {
  padding: 3px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--info);
}

body #share-combo:not(:disabled),
body #share-confirmed-ticket:not(:disabled) {
  min-height: 46px;
  border: 1px solid currentColor;
  color: var(--info);
  background: color-mix(in srgb, var(--info) 12%, var(--surface));
}

body .ticket-share-dialog {
  width: min(100% - 24px, 520px);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}

body .ticket-share-dialog [data-share-summary] {
  padding: 12px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 700;
}

body .ticket-share-dialog .ticket-share-link input {
  min-height: 44px;
  font-family: var(--numeric);
}

body .ticket-share-dialog [data-share-copy] {
  min-height: 44px;
}

body :is(.button, .match-header-stats, .tab-button, .mobile-nav button, .result-pick) {
  transition:
    background-color 0.3s ease-out,
    border-color 0.3s ease-out,
    box-shadow 0.3s ease-out,
    color 0.3s ease-out,
    transform 0.3s ease-out;
}

body :is(.button, .match-header-stats, .mobile-nav button, .result-pick):not(:disabled):active {
  transform: scale(0.98);
}

@media (hover: hover) {
  body :is(.hero-score, .match-card, #share-combo:not(:disabled)):hover {
    border-color: var(--ring);
    box-shadow: 0 0 24px var(--accent-soft);
  }
}

@media (max-width: 767px) {
  body .topbar {
    gap: 4px;
    padding-inline: max(8px, env(safe-area-inset-left)) max(8px, env(safe-area-inset-right));
  }

  body .topbar .brand-name {
    font-size: 14px;
  }

  body .topbar-actions {
    gap: 2px;
  }

  body .topbar-actions :is(#open-help, #open-inbox:not([hidden])) {
    display: grid;
    border-color: transparent;
  }

  body .topbar .topbar-bankroll {
    display: none;
  }

  body #dashboard {
    gap: 10px;
    padding-top: calc(var(--header-offset) + 12px);
  }

  body #dashboard > .hero:not(.tab-hidden) {
    display: block;
  }

  body .hero-main.card:not(.opt) {
    padding: 8px 0 2px;
    gap: 4px;
    border: 0;
    background: none;
    box-shadow: none;
    backdrop-filter: none;
  }

  body .hero-main .hero-pitch,
  body .hero-score,
  body .hero-main .hero-cta,
  body .hero-main .hero-actions {
    display: none;
  }

  body .hero h1 {
    font-size: clamp(23px, 6.4vw, 32px);
  }

  body .section-block {
    scroll-margin-top: calc(var(--header-offset) + 10px);
  }

  body #match-navigation:not([hidden]) {
    display: none;
  }

  body #matches .analysis-note {
    display: none;
  }

  body .date-chip,
  body .filter {
    min-height: 44px;
  }

  body .mobile-nav {
    inset: auto max(10px, env(safe-area-inset-right)) calc(16px + env(safe-area-inset-bottom))
      max(10px, env(safe-area-inset-left));
    width: auto;
    max-width: 500px;
    margin-inline: auto;
    padding: 4px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 2px;
    border: 1px solid var(--line-strong);
    border-radius: 20px;
    background: var(--glass-nav);
    box-shadow: 0 10px 32px #0005;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  body .mobile-nav button {
    min-height: 56px;
    min-width: 0;
    padding-inline: 1px;
    border-radius: 14px;
    font-size: 0.75rem;
    line-height: 1.15;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  body .mobile-nav button.active {
    background: var(--accent-soft);
    color: var(--accent-text);
    box-shadow: inset 0 0 0 1px var(--ring);
  }

  body .mobile-nav button:enabled:active {
    transform: scale(0.95);
  }

  body .mobile-nav .mobile-ticket-action {
    color: var(--on-accent);
    background: var(--accent);
  }

  body #toast {
    bottom: calc(88px + env(safe-area-inset-bottom));
  }

  body .mobile-coupon:not([hidden]) {
    bottom: calc(86px + env(safe-area-inset-bottom));
    max-width: 500px;
    margin-inline: auto;
  }

  body .match-card .match-overview > .prob-bar {
    display: grid;
    padding: 10px;
    gap: 6px;
  }

  body .match-outcome .prob-legend b {
    font-size: 14px;
  }

  body .ticket-share-dialog .ticket-share-link {
    flex-direction: column;
  }
}

@media (max-width: 419px) {
  body .topbar .brand-mark {
    display: block;
    width: 21px;
    height: 23px;
  }

  .algorithm-status {
    gap: 4px;
    padding-inline: 5px;
    font-size: 9px;
    letter-spacing: -0.055em;
  }
}

@media (max-width: 359px) {
  body .topbar:has(#open-inbox:not([hidden])) .algorithm-status {
    display: none;
  }
}

@media (min-width: 768px) {
  body #dashboard {
    padding-top: 22px;
  }

  body #dashboard > .hero:not(.tab-hidden) {
    grid-template-columns: minmax(0, 1fr) minmax(268px, 32%);
  }
}

@media (min-width: 768px) and (max-width: 1199px) {
  body .topbar-bankroll {
    display: none;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  body .topbar .tab-button svg,
  body .topbar #account-label {
    display: none;
  }

  body .topbar .account-button {
    width: 44px;
    padding: 3px;
  }
}

@media (min-width: 1024px) {
  body #dashboard > .hero:not(.tab-hidden) {
    grid-template-columns: minmax(0, 65fr) minmax(0, 35fr);
    gap: 24px;
  }

  body .workspace > .builder {
    top: calc(var(--header-offset) + 12px);
    border: 1px solid var(--line);
    background: var(--glass);
  }
}

@media (prefers-reduced-motion: reduce) {
  .algorithm-status::before {
    animation: none;
  }

  body
    :is(.button, .match-header-stats, .tab-button, .mobile-nav button, .result-pick, .gauge-fill) {
    transition: none;
  }
}

/* Finitions des cartes et des contrôles. */
#account-avatar > .neutral-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

body .match-card .match-hero .crest {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
}

body .match-card .match-hero .match-head {
  height: auto;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

body .match-card .match-head .match-header-stats {
  grid-column: 2;
  grid-row: 1;
}

body .match-card .match-hero .match-head-badges {
  grid-column: 1 / -1;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 4px 8px;
}

body .match-card .match-head-badges:empty {
  display: none;
}

body .match-card .match-hero .match-head-badges > .value-bet-callout {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 6px;
  padding: 0;
  font-size: 11px;
  line-height: 1.4;
  color: #f8fafc;
}

body .match-card .match-hero .value-bet-badge {
  display: inline-block;
  flex: none;
  max-width: none;
  white-space: nowrap;
  font-size: 11px;
}

.value-bet-market {
  min-width: 0;
  overflow-wrap: anywhere;
}

body .match-card .match-selection :is(.selection-probability, .selection-ev) {
  justify-self: start;
  width: fit-content;
  max-width: 100%;
  padding: 4px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--info);
  font-size: 11px;
  line-height: 1.4;
}

body .match-card .match-selection .selection-ev {
  color: var(--text);
}

/* Les indicateurs complets sont aussi rendus dans le panneau de détails. */
body .match-overview > .opportunity {
  display: none;
}

body .match-card details.match-explanation > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

body .match-card details.match-explanation > summary::-webkit-details-marker {
  display: none;
}

body .match-card details.match-explanation > summary::after {
  content: '';
  width: 7px;
  height: 7px;
  margin-inline-end: 3px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: rotate(45deg);
}

body .match-card details.match-explanation[open] > summary::after {
  transform: rotate(225deg);
}

@media (max-width: 767px) {
  body .date-scroller {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    gap: 4px;
  }

  body .date-scroller > .scroll-btn {
    position: static;
    transform: none;
  }

  body .date-scroller > .date-navigator {
    margin-inline: 0;
    min-width: 0;
    padding-inline: 0;
    scroll-padding-inline: 0;
  }

  #personal-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #personal-kpis > div {
    min-width: 0;
  }

  #personal-kpis > div:first-child {
    grid-column: 1 / -1;
  }

  #personal-kpis dd {
    overflow-wrap: anywhere;
  }

  .mobile-assistant-trigger {
    bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  }

  body.has-mobile-coupon .mobile-assistant-trigger {
    bottom: calc(146px + env(safe-area-inset-bottom, 0px));
  }
}

@media (min-width: 1024px) {
  :root {
    --page-width: 1440px;
  }

  body #dashboard {
    width: 94%;
  }

  body .topbar {
    padding-inline: calc(max(3%, (100% - var(--page-width)) / 2) + var(--page-gutter));
  }

  body #dashboard > .hero:not(.tab-hidden),
  body .workspace {
    grid-template-columns: minmax(0, 1fr) 400px;
  }

  body .match-card .market-grid-wrap .featured-markets {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: none;
    grid-auto-rows: auto;
    gap: 10px;
  }

  body .match-card .market-grid-wrap .featured-markets > .market {
    display: grid;
    grid-column: auto;
    grid-row: span 7;
    grid-template-rows: subgrid;
    min-width: 0;
    padding: 12px;
    border-radius: 14px;
    box-sizing: border-box;
    text-align: left;
    gap: 8px;
  }

  body .market-grid-wrap .featured-markets > .market > .market-label {
    grid-row: 1;
    min-height: 2.5em;
    margin: 0;
    font-size: 14px;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }

  body .market-grid-wrap .featured-markets > .market .market-numbers {
    grid-row: 2;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin: 0;
  }

  body .market-grid-wrap .featured-markets > .market :is(.market-price, .market-confidence) {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    min-width: 0;
    margin: 0;
    gap: 4px;
  }

  body
    .market-grid-wrap
    .featured-markets
    > .market
    :is(.market-price, .market-confidence)
    > small {
    order: -1;
    min-height: 2.6em;
    font-size: 10px;
    line-height: 1.3;
    overflow-wrap: anywhere;
  }

  body
    .market-grid-wrap
    .featured-markets
    > .market
    :is(.market-price strong, .market-confidence b) {
    font: 700 clamp(14px, 1.4vw, 22px) / 1.15 var(--numeric);
    white-space: nowrap;
  }

  body .market-grid-wrap .featured-markets > .market .confidence-track {
    grid-row: 3;
    height: 5px;
    flex-shrink: 0;
  }

  body .market-grid-wrap .featured-markets > .market > small {
    grid-row: 4;
  }

  body .market-grid-wrap .featured-markets > .market > .market-badges {
    grid-row: 6;
  }

  body .market-grid-wrap .featured-markets > .market > .market-meta {
    grid-row: 7;
    margin-top: 0;
  }

  body .market-grid-wrap .featured-markets > .market > .confidence-ribbon {
    grid-row: 5;
    margin: 0;
    padding: 4px 6px;
    border-radius: 6px;
    font-size: 10px;
  }
}

/* Actions publiques et graphiques */
.algorithm-status-full {
  display: none;
}

@media (min-width: 1360px) {
  .algorithm-status-full {
    display: inline;
  }

  .algorithm-status-compact {
    display: none;
  }
}

body .match-card {
  padding: clamp(14px, 2vw, 22px);
  gap: 12px;
}

body .match-card .match-selection .selection-price {
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--text);
}

body .match-card .match-selection .selection-price :is(b, small) {
  color: var(--accent-text);
}

body .match-share-action {
  justify-self: end;
  width: max-content;
  max-width: 100%;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--info);
}

body .match-share-action:hover {
  border-color: var(--info);
  background: var(--surface-2);
}

body #share-analysis-dialog {
  width: min(440px, calc(100% - 24px));
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--text);
  background: var(--surface);
}

#share-analysis-url {
  width: 100%;
  min-height: 44px;
  margin-top: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--text);
  background: var(--surface-2);
}

body #toast.show {
  border-color: var(--ring);
  box-shadow: var(--glow);
}

body :is(.button.primary, .ticket-cta):enabled:hover {
  box-shadow: var(--glow);
}

body :is(.model-curve, #bankroll-chart, .dashboard-charts svg) {
  background: transparent;
}

body .model-curve circle {
  stroke: var(--info);
}

body .hero-score.unavailable .gauge-fill {
  opacity: 0;
}

/* Jauges, tracés SVG et indicateurs */
:root {
  --viz-height: 192px;
  --viz-grid: rgba(255, 255, 255, 0.04);
  --viz-track: rgba(255, 255, 255, 0.08);
  --viz-tip: rgba(15, 23, 42, 0.9);
  --viz-tip-line: rgba(255, 255, 255, 0.1);
}

:root.light {
  --viz-grid: rgba(15, 23, 42, 0.12);
  --viz-track: rgba(15, 23, 42, 0.14);
}

@media (min-width: 768px) {
  :root {
    --viz-height: 256px;
  }
}

body .gauge-face {
  display: grid;
  grid-template-areas: 'face';
  align-items: end;
  justify-items: center;
  width: min(100%, 260px);
  margin: 0 auto;
}

body .gauge-face > .gauge,
body .gauge-face > .gauge-reading {
  grid-area: face;
}

body .gauge-face > .gauge {
  width: 100%;
  height: auto;
  aspect-ratio: 200 / 110;
  stroke-width: 12;
  overflow: visible;
}

body .gauge-face .gauge-track {
  stroke: var(--viz-track);
}

body .gauge-face .gauge-fill {
  filter: drop-shadow(0 0 10px rgba(16, 185, 129, 0.45));
  transition: stroke-dashoffset 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

body .gauge-low .gauge-fill {
  filter: drop-shadow(0 0 10px rgba(244, 63, 94, 0.4));
}

body .hero-score.gauge-low .gauge-fill {
  stroke: url('#confidence-gradient-low');
}

body .model-gauge .gauge-fill {
  stroke: url('#model-success-gradient');
}

body .gauge-low .model-gauge .gauge-fill {
  stroke: url('#model-success-gradient-low');
}

body .gauge-zero .gauge-fill {
  opacity: 0;
}

body .gauge-face > .gauge-reading {
  display: grid;
  gap: 4px;
  justify-items: center;
  align-content: end;
  padding-bottom: 6%;
  text-align: center;
}

body .gauge-reading > small,
body .gauge-reading .gauge-caption,
body .model-ring > .gauge-reading > span {
  color: var(--muted);
  font-size: 11px;
}

body .gauge-reading > small {
  font-weight: 700;
  letter-spacing: 0.08em;
}

body .hero-score .gauge-reading .score,
body .model-ring .gauge-reading strong {
  margin: 0;
  color: var(--accent-text);
  font: 800 clamp(32px, 4vw, 48px) / 1 var(--numeric);
  font-variant-numeric: tabular-nums;
}

body .gauge-low .gauge-reading :is(.score, strong) {
  color: var(--warn);
}

body .model-ring .gauge-reading strong small {
  color: var(--muted);
}

body .model-ring.gauge-face,
body .model-ring > .gauge-reading {
  height: auto;
  aspect-ratio: auto;
  border-radius: 0;
  background: none;
  box-shadow: none;
  transform: none;
}

body .model-ring.gauge-face {
  padding: 0;
  margin-block: 8px 18px;
}

body .model-ring > .gauge-reading > span {
  margin: 0;
}

body
  :is(
    .model-curve,
    .analytics-svg,
    .calibration-plot,
    #bankroll-chart,
    .dashboard-charts .viz-plot
  ) {
  display: block;
  width: 100%;
  height: var(--viz-height);
  background: transparent;
  border: 0;
}

body .calibration-plot {
  max-width: 600px;
  margin-inline: auto;
  color: var(--muted);
  stroke: none;
  font: 11px var(--numeric);
}

body :is(.viz-grid, .model-grid-line, .analytics-grid) {
  stroke: var(--viz-grid);
  stroke-width: 1;
  stroke-dasharray: none;
  vector-effect: non-scaling-stroke;
}

body :is(.viz-zero, .model-zero, .analytics-axis) {
  stroke: var(--viz-track);
  stroke-width: 1;
  stroke-dasharray: 4 5;
  vector-effect: non-scaling-stroke;
}

body .viz-line {
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

body :is(.model-curve, .analytics-svg, .calibration-plot) text {
  fill: var(--muted);
  font: 11px var(--numeric);
  font-variant-numeric: tabular-nums;
}

body .viz-peak {
  pointer-events: none;
}

body .viz-peak path {
  fill: none;
  stroke: var(--info);
  stroke-opacity: 0.45;
  stroke-dasharray: 3 5;
  vector-effect: non-scaling-stroke;
}

body .viz-peak rect {
  fill: #38bdf8;
  filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.36));
  stroke: none;
}

body .viz-peak text {
  fill: #090d16;
  font-weight: 800;
}

body :is(.metric-tooltip, .model-result-tip, #prediction-analytics output) {
  background: var(--viz-tip);
  color: #f8fafc;
  border: 1px solid var(--viz-tip-line);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 12px;
}

body .model-result-tip small {
  color: #cbd5e1;
}

body #prediction-analytics output {
  display: block;
  padding: 10px 12px;
}

body
  :is(
    #personal-kpis > div,
    #home-performance-kpis > div,
    .prediction-kpi-grid article,
    .analytics-kpis > div,
    .stats-grid article,
    .hero-score-parts > span,
    .ticket-totals > span,
    .ticket-stake > span,
    #stake-advice
  ) {
  min-width: 0;
  padding: clamp(10px, 1.6vw, 16px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    radial-gradient(ellipse at 100% 100%, var(--accent-soft), transparent 70%), var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

body
  :is(
    #personal-kpis dd,
    #home-performance-kpis dd,
    .prediction-kpi-grid strong,
    .analytics-kpis strong,
    .stats-grid strong,
    .ticket-totals strong,
    .ticket-stake strong
  ) {
  font-family: var(--numeric);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

body :is(.analytics-kpis strong, .stats-grid strong, .ticket-totals strong, .ticket-stake strong) {
  color: var(--info);
}

body .ticket-totals .total-main strong,
body .stats-grid .stat-main strong {
  color: var(--accent-text);
}

body #stake-advice {
  display: block;
  color: var(--accent-text);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

@media (prefers-reduced-motion: reduce) {
  body .gauge-face .gauge-fill {
    transition: none;
  }
}

body .radar-box [data-radar-series] {
  fill: var(--info);
  fill-opacity: 0.16;
  stroke: var(--info);
  stroke-width: 2.5;
  vector-effect: non-scaling-stroke;
}

body :is(.radar-attributes > div, .selection-probability, .selection-ev) {
  background-image: radial-gradient(ellipse at 100% 100%, var(--accent-soft), transparent 75%);
}

body :is(.chart-labels, .chart-label, .model-chart-caption) {
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

body .match-card .market-grid-wrap .featured-markets > .market .market-gauge,
body .market-grid-wrap .market .market-gauge {
  width: 38px;
  height: 22px;
  margin-inline: auto;
  stroke-width: 5;
  background: none;
  overflow: visible;
}

body .market-gauge .gauge-track {
  stroke: var(--line-strong);
}

body .market-gauge .gauge-fill {
  stroke: var(--accent-text);
  filter: none;
}

body .market-gauge.gauge-low .gauge-fill {
  stroke: var(--warn);
}

body .market.selected .market-gauge :is(.gauge-track, .gauge-fill) {
  stroke: var(--on-accent);
}

body .market.selected .market-gauge .gauge-track {
  opacity: 0.24;
}

body svg [data-viz-value] {
  cursor: help;
}

@media (max-width: 767px) {
  body #personal-charts .dashboard-charts > article {
    display: block;
  }
}

body .model-success {
  padding: clamp(14px, 2vw, 24px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    radial-gradient(ellipse at 100% 100%, var(--accent-soft), transparent 68%), var(--glass);
}

body .model-success :is(.eyebrow, .model-result-counts, p:last-child) {
  color: var(--muted);
}

body .model-result-counts b {
  color: var(--text);
}

body .result-key.won {
  background: var(--accent);
}

body .result-key.lost {
  background: #f43f5e;
}

body :is(#personal-kpis dd, #home-performance-kpis dd) {
  color: var(--info);
}

body #personal-kpis > div:first-child dd {
  color: var(--accent-text);
}

body #stake-advice {
  color: var(--muted);
}

body #stake-advice-value:not([hidden]) {
  display: block;
  margin-block: 3px;
  color: var(--accent-text);
  font: 800 24px / 1.2 var(--numeric);
  font-variant-numeric: tabular-nums;
}

/* Composants d’indicateurs partagés entre les vues. */
:root {
  --viz-grid: rgba(255, 255, 255, 0.05);
  --viz-track: rgba(255, 255, 255, 0.07);
}

body :is(.hero-score, .model-ring) .viz-gauge {
  aspect-ratio: 200 / 126;
  stroke-width: 14;
}

body .viz-gauge .gauge-track {
  stroke: var(--viz-track);
}

body :is(.hero-score, .model-ring, .market-grid-wrap .market) .viz-gauge .gauge-fill {
  stroke: url('#confidence-gradient');
  filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.4));
}

body .gauge-face .gauge-reading :is(.score, strong) {
  font: 800 36px / 1 var(--numeric);
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

body .gauge-face .gauge-reading .gauge-caption,
body .model-ring .gauge-reading > span {
  font-size: 12px;
}

body .market-grid-wrap .market .viz-gauge {
  stroke-width: 14;
}

body .analytics-svg .viz-hit,
body .viz-hit {
  fill: transparent;
  stroke: transparent;
  pointer-events: all;
}

body .analytics-svg .viz-hit:is(:hover, :focus-visible),
body .viz-hit:is(:hover, [aria-describedby]) {
  fill: var(--info);
  stroke: var(--surface);
  stroke-width: 2;
}

body :is(.model-curve, .analytics-svg, .viz-plot, #bankroll-chart) .viz-line {
  filter: drop-shadow(0 0 4px rgba(56, 189, 248, 0.28));
}

body :is(.model-curve, .analytics-svg, .viz-plot, #bankroll-chart, .kpi-sparkline) .viz-end {
  stroke: none;
  filter: drop-shadow(0 0 5px rgba(56, 189, 248, 0.65));
  pointer-events: none;
}

body .viz-bar {
  --bar-color: var(--accent);
}

body .viz-bar-loss {
  --bar-color: var(--danger);
}

body .viz-bar-data {
  --bar-color: var(--info);
}

body .analytics-svg .viz-bar:is(:hover, :focus-visible) {
  stroke: none;
  filter: brightness(1.25);
}

body .viz-bar-cap {
  fill: none;
  stroke: var(--bar-color);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}

body :is(.prediction-kpi-grid, .analytics-kpis) {
  margin-inline: 0;
}

body #predictions .prediction-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 145px), 1fr));
  gap: 12px;
  overflow: visible;
}

body :is(.analytics-kpis, #personal-kpis) {
  align-items: stretch;
}

body .viz-kpi {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 8px;
  position: relative;
  min-width: 0;
  padding: clamp(12px, 2vw, 20px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    radial-gradient(ellipse at 100% 100%, var(--accent-soft), transparent 74%), var(--glass);
  color: var(--text);
}

body .viz-kpi .viz-kpi-label {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  color: var(--muted);
  font: 650 11px / 1.3 var(--numeric);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

body .viz-kpi .viz-kpi-label > span:first-child {
  font: inherit;
  color: inherit;
  overflow-wrap: anywhere;
}

body .viz-kpi .viz-kpi-icon {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-inline-start: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--text) 4%, transparent);
  color: var(--muted);
  flex: none;
}

body .viz-kpi-icon svg {
  width: 16px;
  height: 16px;
}

body .viz-kpi .viz-kpi-value {
  display: grid;
  justify-items: start;
  align-content: start;
  gap: 8px;
  min-width: 0;
  margin: 0;
}

body .viz-kpi .viz-kpi-value strong {
  display: block;
  margin: 0;
  color: var(--text);
  font: 800 clamp(23px, 2.1vw, 30px) / 1.1 var(--numeric);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

body .viz-kpi-positive .viz-kpi-value strong,
body .viz-kpi .viz-kpi-value strong.positive {
  color: var(--accent-text);
}

body .viz-kpi-negative .viz-kpi-value strong,
body .viz-kpi .viz-kpi-value strong.negative {
  color: var(--danger);
}

body .viz-kpi .viz-kpi-caption {
  display: inline-flex;
  max-width: 100%;
  padding: 3px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text) 5%, transparent);
  color: var(--muted);
  font: 500 11px / 1.3 var(--numeric);
  overflow-wrap: anywhere;
}

body #predictions .viz-kpi .help-inline {
  position: static;
  margin: 0;
  flex: none;
}

@media (max-width: 767px) {
  body #predictions .prediction-kpi-grid,
  body .analytics-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

body .viz-bar > rect {
  stroke: none;
}

body :is(.model-curve, .analytics-svg, .calibration-plot) text:not(.viz-peak text) {
  fill: #64748b;
  stroke: none;
}

body .match-card .match-header-stats {
  font-size: 0.875rem;
}

body .match-card .selection-summary {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.875rem;
}

body .selection-summary .selection-title {
  font-size: 1rem;
  overflow-wrap: anywhere;
}

body .selection-summary dl {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 0;
}

body .selection-summary dt {
  color: var(--muted);
}

body .selection-summary dd {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

body .match-card .selection-summary .match-selection {
  display: inline-flex;
  justify-content: center;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--on-accent);
  background: var(--accent);
  font-size: 0.875rem;
  text-align: center;
}

body .match-card .selection-summary .match-selection.selected {
  color: var(--text);
  background: var(--surface-2);
}
