/* arbitrage-cm : feuille de style unique.
   Thèmes : variables CSS sur <html data-theme="dark|light">. Aucun style en ligne (CSP).
   Contrastes : textes à 4,5:1 minimum dans les deux thèmes. */

:root, [data-theme="dark"] {
  --bg: #0f1419; --surface: #131a21; --card: #161e27; --btn: #1a232d; --chip: #1f2a36;
  --border: #253040; --rowline: #222c38; --input: #344456;
  --text: #e6edf3; --text2: #c9d4df; --muted: #9aa7b4;
  --ok-fg: #8ff0bd; --ok-bg: #132a20; --ok-border: #2f6b4e;
  --warn-fg: #f5c97a; --warn-bg: #3a2c12; --warn-border: #8a6a2a;
  --bad-fg: #ffb4aa; --bad-bg: #2a1a1a; --bad-border: #6b2f2f;
  --info-fg: #7cc4ff; --info-bg: #102a40; --info-border: #23415c;
  --t3-fg: #ffa53d; --t3-bg: #3a2610; --t4-fg: #d38bff; --t4-bg: #2e1840;
  --brand: #3fd68f; --on-brand: #0b1a12; --focus: #7cc4ff;
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #f3f5f8; --surface: #ffffff; --card: #ffffff; --btn: #eef1f5; --chip: #e7ebf0;
  --border: #d6dce3; --rowline: #e4e8ed; --input: #8d99a6;
  --text: #15202b; --text2: #384654; --muted: #5a6774;
  --ok-fg: #0d7341; --ok-bg: #e2f5ea; --ok-border: #79c79d;
  --warn-fg: #8a5300; --warn-bg: #fff2d9; --warn-border: #e2b766;
  --bad-fg: #b3261e; --bad-bg: #fde9e7; --bad-border: #e8a49c;
  --info-fg: #0a5fae; --info-bg: #e3effb; --info-border: #9cc2e7;
  --t3-fg: #a35400; --t3-bg: #fff0dd; --t4-fg: #6d32d9; --t4-bg: #efe7fd;
  --brand: #1f9d63; --on-brand: #ffffff; --focus: #0a5fae;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; font-size: 93.75%; }   /* base 15 px (au lieu de 16), suit le réglage du navigateur */
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font: 400 1rem/1.5 Inter, "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}
a { color: var(--info-fg); }
a:hover { text-decoration-thickness: 2px; }
h1 { font-size: 1.5rem; margin: 0 0 .5rem; line-height: 1.25; }
h2 { font-size: 1.15rem; margin: 0 0 .5rem; }
.h-small { font-size: 1rem; }
p { margin: 0 0 .75rem; }
.muted, .hint { color: var(--muted); }
.hint { font-size: .85rem; margin: .35rem 0 0; }
.icon { width: 1.15rem; height: 1.15rem; flex: none; fill: none; stroke: currentColor; stroke-width: 2;
        stroke-linecap: round; stroke-linejoin: round; }

/* Accessibilité : focus visible partout, lien d'évitement, mouvement réduit */
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.skip { position: absolute; left: -999px; top: .5rem; z-index: 10; padding: .6rem 1rem; border-radius: 8px;
        background: var(--card); color: var(--text); }
.skip:focus { left: .5rem; }
main:focus { outline: none; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* En-tête */
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar-inner { max-width: 1280px; margin: 0 auto; padding: .75rem 1.25rem; display: flex; flex-wrap: wrap;
                gap: .75rem 1rem; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: .6rem; color: var(--text); text-decoration: none; }
.brand-icon { width: 1.75rem; height: 1.75rem; stroke: var(--brand); }
.brand-name { display: block; font-weight: 700; font-size: 1.1rem; }
.brand-tag { display: block; font-size: .75rem; color: var(--muted); }
.topbar-tools, .user-nav { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.topbar-tools form { margin: 0; }
.prefs { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.who { font-size: .85rem; color: var(--text2); }

/* Boutons (cibles de 44 px minimum) */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 44px;
       padding: 0 .9rem; border-radius: 8px; border: 1px solid var(--input); background: var(--btn);
       color: var(--text); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--text2); }
.btn[aria-current="page"] { border-color: var(--brand); }
.btn-primary { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.btn-primary:hover { filter: brightness(1.05); border-color: var(--brand); }
.btn-danger { color: var(--bad-fg); border-color: var(--bad-border); background: transparent; }
.btn-block { width: 100%; }
.segmented { display: inline-flex; border: 1px solid var(--input); border-radius: 8px; overflow: hidden; }
.seg { min-height: 44px; min-width: 48px; border: 0; background: transparent; color: var(--text);
       font: inherit; font-weight: 700; cursor: pointer; }
.seg[aria-pressed="true"] { background: var(--text); color: var(--bg); }

/* Mise en page */
.main { max-width: 1280px; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; display: flex; flex-direction: column; gap: 1.25rem; }
.main-narrow { max-width: 30rem; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 1.5rem; }
.card-soft { background: var(--surface); }

/* Formulaires */
.form { display: flex; flex-direction: column; gap: 1rem; }
.field { display: flex; flex-direction: column; gap: .35rem; }
.field label { font-size: .9rem; color: var(--text2); }
input[type="text"], input[type="tel"], input[type="password"], input[type="number"], select {
  min-height: 46px; padding: 0 .75rem; border-radius: 10px; border: 1px solid var(--input);
  background: var(--bg); color: var(--text); font: inherit; font-size: 1rem; width: 100%; }
.phone-input { display: flex; border: 1px solid var(--input); border-radius: 10px; overflow: hidden; background: var(--bg); }
.phone-input .prefix { display: flex; align-items: center; padding: 0 .75rem; background: var(--btn);
                       color: var(--text2); border-right: 1px solid var(--input); }
.phone-input input { border: 0; border-radius: 0; }
.code-input { font-family: ui-monospace, "JetBrains Mono", Consolas, monospace; font-size: 1.5rem;
              letter-spacing: .5rem; }
.check { display: flex; gap: .6rem; align-items: flex-start; font-size: .9rem; color: var(--text2); }
.check input { width: 1.25rem; height: 1.25rem; margin-top: .15rem; flex: none; accent-color: var(--brand); }

/* Messages */
.alert { padding: .75rem .9rem; border-radius: 10px; border: 1px solid; font-size: .95rem; }
.alert-ok { background: var(--ok-bg); border-color: var(--ok-border); color: var(--ok-fg); }
.alert-bad { background: var(--bad-bg); border-color: var(--bad-border); color: var(--bad-fg); }
.alert-warn { background: var(--warn-bg); border-color: var(--warn-border); color: var(--warn-fg); }
.alert-info { background: var(--info-bg); border-color: var(--info-border); color: var(--info-fg); }

.auth-brand { text-align: center; }

@media (max-width: 640px) {
  .topbar-inner { padding: .6rem .9rem; }
  .main { padding: 1rem .9rem 2.5rem; }
  .card { padding: 1.1rem; }
  .who { width: 100%; }
}

/* --- Tableau de bord ------------------------------------------------------------------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
           clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ok-text { color: var(--ok-fg); }
.warn-text { color: var(--warn-fg); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.center { text-align: center; }
code { font-family: ui-monospace, "JetBrains Mono", Consolas, monospace; font-size: .85rem; padding: .05rem .35rem;
       border-radius: 6px; background: var(--bg); border: 1px solid var(--border); }

.dash-head { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; }
.dash-head h1 { margin: 0; }
.refresh-box { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; }
.refresh-form { margin: 0; }
.updated { margin: 0; font-size: .9rem; text-align: right; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1rem; }
.kpi { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 1rem 1.15rem; }
.kpi p { margin: 0; }
.kpi-label, .kpi-sub { font-size: .85rem; color: var(--muted); }
.kpi .kpi-value { font-size: 1.85rem; font-weight: 700; font-variant-numeric: tabular-nums; margin: .2rem 0; }

.opps { display: flex; flex-direction: column; gap: 1rem; }
.opps-head { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; justify-content: space-between; }
.opps-head h2 { margin: 0 0 .25rem; font-size: 1.3rem; }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; padding: 0; margin: .5rem 0 0; }
.tier-chip { padding: .2rem .6rem; border-radius: 999px; font-size: .8rem; font-weight: 600; }
.view-form { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end; margin: 0; }
.field-inline { display: flex; flex-direction: column; gap: .3rem; font-size: .85rem; color: var(--muted); }
.field-inline select, .field-inline input { width: auto; min-width: 9rem; }

.books-form { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: .9rem 1rem; margin: 0; }
.books-form p { margin: 0 0 .6rem; }
.chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.chip { min-height: 40px; padding: 0 .8rem; border-radius: 999px; border: 1px solid var(--ok-border); background: var(--ok-bg);
        color: var(--ok-fg); font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer;
        display: inline-flex; gap: .4rem; align-items: center; }
.chip-off { background: transparent; color: var(--muted); border-color: var(--input); text-decoration: line-through; }

.group { display: flex; flex-direction: column; gap: 1rem; }
.group-title { font-size: 1.05rem; margin: .5rem 0 0; padding-bottom: .4rem; border-bottom: 1px solid var(--border); }
.empty { padding: 1.5rem; text-align: center; color: var(--muted); background: var(--card);
         border: 1px dashed var(--border); border-radius: 12px; }

/* Paliers de rentabilité : jusqu'à 5 %, 5 à 10 %, 10 à 15 %, plus de 15 %, négatif */
.tier-t1 { background: var(--ok-bg); color: var(--ok-fg); border-color: var(--ok-fg); }
.tier-t2 { background: var(--info-bg); color: var(--info-fg); border-color: var(--info-fg); }
.tier-t3 { background: var(--t3-bg); color: var(--t3-fg); border-color: var(--t3-fg); }
.tier-t4 { background: var(--t4-bg); color: var(--t4-fg); border-color: var(--t4-fg); }
.tier-neg { background: var(--bad-bg); color: var(--bad-fg); border-color: var(--bad-fg); }
.tier-text-t1 { color: var(--ok-fg); }
.tier-text-t2 { color: var(--info-fg); }
.tier-text-t3 { color: var(--t3-fg); }
.tier-text-t4 { color: var(--t4-fg); }

.opp { background: var(--card); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.opp-form { margin: 0; }
.opp-head { display: flex; flex-wrap: wrap; gap: .9rem; align-items: center; justify-content: space-between;
            padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
.opp-title { display: flex; gap: .9rem; align-items: center; min-width: 0; }
.opp-title h3 { margin: 0; font-size: 1.15rem; }
.opp-title p { margin: .15rem 0 0; font-size: .85rem; }
.opp-badges { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.pill { padding: .3rem .7rem; border-radius: 999px; background: var(--chip); color: var(--text2); font-size: .8rem; }
.pill-warn { background: var(--warn-bg); color: var(--warn-fg); font-weight: 600; }
.badge { min-width: 7.5rem; text-align: center; padding: .45rem 1rem; border-radius: 14px; border: 2px solid;
         font-size: 1.7rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.badge-small { min-width: 0; font-size: 1rem; padding: .2rem .6rem; border-radius: 10px; }

.sport { width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center;
         justify-content: center; flex: none; }
.sport .icon { width: 26px; height: 26px; stroke-width: 1.8; }
.sport-football { background: var(--ok-bg); color: var(--ok-fg); }
.sport-tennis { background: var(--warn-bg); color: var(--warn-fg); }
.sport-basketball { background: var(--t3-bg); color: var(--t3-fg); }
.sport-ice_hockey { background: var(--info-bg); color: var(--info-fg); }
.sport-handball { background: var(--bad-bg); color: var(--bad-fg); }
.sport-table_tennis { background: var(--t4-bg); color: var(--t4-fg); }

.opp-info { margin: 0; padding: 1rem 1.25rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
            gap: .8rem 1.5rem; background: var(--surface); border-bottom: 1px solid var(--border); font-size: .92rem; }
.opp-info dt { font-size: .8rem; color: var(--muted); margin-bottom: .2rem; }
.opp-info dt.warn-text { color: var(--warn-fg); }
.opp-info dd { margin: 0; }
.opp-body { padding: 1rem 1.25rem; display: flex; flex-direction: column; gap: .8rem; }
.order-note { margin: 0; font-size: .88rem; color: var(--text2); }
.order-note strong { color: var(--warn-fg); }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; }
.legs { min-width: 62rem; font-size: .92rem; }
.legs th, .simple th { text-align: left; font-size: .78rem; font-weight: 500; color: var(--muted); padding: 0 .6rem .55rem 0; }
.legs th.num, .simple th.num { text-align: right; }
.legs td { padding: .55rem .6rem .55rem 0; border-top: 1px solid var(--rowline); vertical-align: top; }
.legs tr.is-placed td { background: var(--ok-bg); }
.order { display: inline-flex; width: 2rem; height: 2rem; align-items: center; justify-content: center;
         border-radius: 50%; background: var(--chip); font-weight: 700; }
.order-first { background: #f5b14c; color: #1f1505; }
.book { display: inline-block; padding: .15rem .6rem; border-radius: 6px; background: var(--chip); font-weight: 600; }
.access { margin-top: .35rem; font-size: .82rem; }
.legs .odds-input, .legs .cap-input { width: 6.5rem; min-height: 40px; font-variant-numeric: tabular-nums; }
.odds-input.changed { border-color: #f5b14c; }
.detected { display: block; color: var(--warn-fg); font-size: .75rem; margin-top: .2rem; }
.detected::before { content: "↺ "; }
.placed { width: 1.5rem; height: 1.5rem; accent-color: var(--brand); margin-top: .4rem; }
.fix { border: 1px solid var(--border); border-radius: 10px; padding: .6rem .9rem; display: flex; flex-wrap: wrap;
       gap: .4rem 1rem; align-items: center; margin: 0; }
.fix legend { font-size: .85rem; color: var(--muted); padding: 0 .3rem; }
.radio { display: flex; gap: .35rem; align-items: center; font-size: .88rem; min-height: 36px; }
.radio input { accent-color: var(--brand); width: 1.1rem; height: 1.1rem; }
.fix .fixed-input { width: 8rem; min-height: 40px; }

.opp-foot { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; justify-content: space-between; padding: .9rem 1.25rem; }
.opp-foot p { margin: 0; }
.verdict { font-weight: 700; }
.foot-ok { background: var(--ok-bg); }
.foot-ok .verdict { color: var(--ok-fg); }
.foot-warn { background: var(--warn-bg); }
.foot-warn .verdict { color: var(--warn-fg); }
.foot-bad { background: var(--bad-bg); }
.foot-bad .verdict { color: var(--bad-fg); }
.progress { font-size: .88rem; font-weight: 600; color: var(--warn-fg); }
.progress:empty { display: none; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.js .actions .btn[value="recalc"] { display: none; }   /* avec JavaScript, le calcul suit la saisie */

.two-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr)); gap: 1.25rem; align-items: start; }
.simple { font-size: .92rem; }
.simple td, .simple tbody th { padding: .5rem .6rem .5rem 0; border-top: 1px solid var(--rowline); text-align: left; }
.simple td.num { text-align: right; }
.dot { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; margin-right: .4rem; background: var(--muted); }
.dot-ok { background: var(--ok-fg); }
.dot-warn { background: var(--warn-fg); }
.dot-bad { background: var(--bad-fg); }
.history { list-style: none; margin: 0; padding: 0; }
.history li { display: flex; gap: .8rem; align-items: center; padding: .6rem 0; border-top: 1px solid var(--rowline); }
.history li > div { flex: 1; min-width: 0; font-size: .9rem; }
.stale { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; justify-content: space-between; }
.stale[hidden] { display: none; }

/* Les éléments flexibles ne doivent jamais élargir la page (sinon le téléphone dézoome). */
.main > *, .opps > *, .group > *, .opp-body > *, .opp-head > * { min-width: 0; }

@media (max-width: 640px) {
  .badge { font-size: 1.35rem; min-width: 6rem; }
  .updated { text-align: left; }
  .two-cols { grid-template-columns: 1fr; }
}

/* Sur petit écran : chaque pari devient une fiche empilée (étiquette à gauche, valeur à droite). */
@media (max-width: 760px) {
  .legs { min-width: 0; }
  .legs thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .legs, .legs tbody, .legs tr, .legs td { display: block; width: 100%; }
  .legs tr { border: 1px solid var(--border); border-radius: 12px; padding: .5rem .8rem; margin-bottom: .7rem; }
  .legs td { border: 0; padding: .35rem 0; display: flex; gap: .8rem; align-items: center; justify-content: space-between;
             text-align: right; }
  .legs td::before { content: attr(data-label); color: var(--muted); font-size: .8rem; text-align: left; flex: none; max-width: 45%; }
  .legs td.num, .legs td.center { justify-content: space-between; }
  .legs .cell { text-align: right; min-width: 0; }
  .legs .access code { white-space: normal; overflow-wrap: anywhere; }
  .legs tr.is-placed { background: var(--ok-bg); }
  .legs tr.is-placed td { background: transparent; }
  .fix { flex-direction: column; align-items: stretch; }
  .opp-head, .opp-info, .opp-body, .opp-foot { padding-left: .9rem; padding-right: .9rem; }
  .actions, .actions .btn { width: 100%; }
}

/* --- Gestion des accès et réglages ------------------------------------------------------- */
.mono { font-family: ui-monospace, "JetBrains Mono", Consolas, monospace; font-size: .85rem; }
.share-alert { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; justify-content: space-between; }
.create-form { display: flex; flex-wrap: wrap; gap: .8rem; align-items: flex-end; margin: .5rem 0 0; }
.create-form .field { min-width: 14rem; flex: 1 1 14rem; }
.create-form .btn { flex: none; }
.code-box { margin-top: 1rem; padding: 1rem 1.1rem; border-radius: 12px; background: var(--ok-bg);
            border: 1px solid var(--ok-border); color: var(--text); display: flex; flex-direction: column; gap: .5rem; }
.code-box p { margin: 0; }
.big-code { font-family: ui-monospace, "JetBrains Mono", Consolas, monospace; font-size: 2.2rem; font-weight: 700;
            letter-spacing: .4rem; color: var(--ok-fg); }
.code-box label { font-size: .85rem; color: var(--text2); }
textarea { width: 100%; padding: .6rem .75rem; border-radius: 10px; border: 1px solid var(--input); background: var(--bg);
           color: var(--text); font: inherit; resize: vertical; }
.accounts { min-width: 52rem; }
.accounts tbody th { font-weight: 600; }
.row-actions { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.inline-form { display: inline-flex; gap: .4rem; align-items: center; margin: 0; }
.inline-form .btn { min-height: 40px; padding: 0 .7rem; font-size: .88rem; }
.reason-input { min-height: 40px !important; width: 10rem !important; font-size: .88rem !important; }
.state { display: inline-block; padding: .15rem .6rem; border-radius: 999px; font-size: .82rem; white-space: nowrap; }
.state-ok { background: var(--ok-bg); color: var(--ok-fg); }
.state-info { background: var(--info-bg); color: var(--info-fg); }
.state-bad { background: var(--bad-bg); color: var(--bad-fg); }
.plain-list, .log { list-style: none; margin: 0; padding: 0; }
.plain-list li { padding: .5rem 0; border-top: 1px solid var(--rowline); font-size: .9rem; }
.log li { display: grid; grid-template-columns: 5.5rem auto 1fr auto; gap: .5rem; align-items: center;
          padding: .45rem 0; border-top: 1px solid var(--rowline); font-size: .88rem; }
.log .dot { margin: 0; }
.dot-muted { background: var(--muted); }

.settings-form { display: flex; flex-direction: column; gap: 1rem; }
.grid-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; }
.checks { border: 1px solid var(--border); border-radius: 10px; padding: .7rem .9rem; margin: 0;
          display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; }
.checks legend { font-size: .9rem; color: var(--text2); padding: 0 .3rem; }
.checks .check { min-height: 36px; align-items: center; }
.checks-col { flex-direction: column; }
.checks-col .check { align-items: flex-start; }
.books-settings { min-width: 44rem; }
.books-settings input, .books-settings select { min-height: 40px; width: 7.5rem; }
.books-settings input.needs-value { border-color: var(--warn-fg); }

@media (max-width: 640px) {
  .log li { grid-template-columns: 1fr; gap: .15rem; }
  .log .dot { display: none; }
}

/* --- pari par pari : marque, sélection, marché, condition de gain --- */
.leg { display: flex; flex-direction: column; align-items: flex-start; gap: .2rem; min-width: 15rem; }
.leg-sel { font-size: 1.08rem; line-height: 1.25; }
.leg-mkt { color: var(--muted); font-size: .85rem; }
.leg-site { font-size: .78rem; color: var(--muted); font-style: italic; }
.leg-cond { margin: .3rem 0 .1rem; padding-top: .35rem; border-top: 1px dashed var(--rowline); font-size: .88rem; }
.bk { display: inline-flex; align-items: center; min-height: 24px; padding: .1rem .5rem; border-radius: 6px;
  font-weight: 800; font-style: italic; letter-spacing: .02em; font-size: .82rem; line-height: 1.2;
  background: #15161a; color: #fff; }
.bk .acc { color: var(--brand-acc, inherit); }
.bk-img { padding: 0; background: transparent; }
.bk-img img { height: 26px; width: auto; max-width: 120px; display: block; border-radius: 5px; }
.bk-betmomo { background: #111; color: #f7c600; --brand-acc: #fff; }
.bk-betmaxplus { background: #0b1f4b; color: #fff; --brand-acc: #ffd400; }
.bk-onexbet { background: #1a5bab; color: #fff; --brand-acc: #fff; }
.bk-sportybet { background: #e41827; color: #fff; --brand-acc: #fff; }
.bk-betpawa { background: #111; color: #8cd23b; --brand-acc: #fff; }
.bk-premierbet { background: #b5121b; color: #fff; --brand-acc: #ffd24a; }
.bk-betclic { background: #d0021b; color: #fff; --brand-acc: #fff; }
.bk-pmuc { background: #006b35; color: #fff; --brand-acc: #ffd24a; }
.bk-yellowbet { background: #ffcc00; color: #111; --brand-acc: #111; }
.bk-betsporter { background: #ff7a00; color: #111; --brand-acc: #111; }
.bk-betsson { background: #ff6a00; color: #111; --brand-acc: #111; }
.bk-betwinner { background: #0c3b2e; color: #fff; --brand-acc: #9be15d; }
.bk-melbet { background: #111; color: #ffcc00; --brand-acc: #fff; }
.bk-demo, .bk-other { background: var(--chip); color: var(--text); --brand-acc: var(--accent, inherit); }
@media (max-width: 760px) {
  .legs td.leg-main { display: block; }
  .legs td.leg-main::before { content: none; }
  .leg { min-width: 0; }
}

/* --- menu replié des petits écrans (seulement avec JavaScript : sans script, tout reste affiché) --- */
.menu-toggle, .menu-toggle .when-open { display: none; }
@media (max-width: 760px) {
  .js .has-menu .menu-toggle { display: inline-flex; }
  .js .has-menu.open .menu-toggle .when-open { display: block; }
  .js .has-menu.open .menu-toggle .when-closed { display: none; }
  .js .has-menu .topbar-tools { display: none; }
  .js .has-menu.open .topbar-tools { display: flex; flex-direction: column; align-items: stretch; width: 100%;
    gap: .6rem; padding-top: .6rem; border-top: 1px solid var(--border); }
  .js .has-menu.open .user-nav { flex-direction: column; align-items: stretch; gap: .4rem; }
  .js .has-menu.open .user-nav .btn, .js .has-menu.open .user-nav form { width: 100%; }
  .js .has-menu.open .user-nav .btn { justify-content: flex-start; }
  .js .has-menu.open .user-nav .btn[aria-current="page"] { border-color: var(--brand); }
  .js .has-menu.open .who { padding: .2rem 0 .3rem; }
}

/* Champs de saisie : jamais sous 16 px, sinon l'iPhone zoome sur la page au toucher. */
input[type="text"], input[type="tel"], input[type="password"], input[type="number"], select, textarea { font-size: max(1rem, 16px); }

/* --- complément d'un pari plafonné --- */
.legs tr.comp-row td { border-top: 1px dashed var(--rowline); background: var(--surface); }
.legs tr.comp-row[hidden] { display: none; }
.order-comp { background: var(--chip); color: var(--text2); }

/* --- cartes compactes : l'essentiel visible, le reste dans « Détails » --- */
.opp-head { padding: .6rem 1rem; gap: .5rem 1rem; }
.opp-title h3 { font-size: 1.02rem; }
.opp-title p { font-size: .8rem; }
.opp-mkt { color: var(--text2); font-weight: 600; }
.sport .icon { width: 22px; height: 22px; }
.badge { font-size: 1.35rem; padding: .25rem .65rem; min-width: 5.5rem; }
.opp-body { padding: .5rem 1rem .6rem; gap: .5rem; }
.legs { min-width: 50rem; font-size: .86rem; }
.legs td { padding: .3rem .5rem .3rem 0; vertical-align: middle; }
.legs th { padding-bottom: .3rem; }
.leg { min-width: 11rem; gap: .05rem; }
.leg-sel { font-size: .95rem; }
.leg-mkt { font-size: .76rem; }
.legs .odds-input, .legs .cap-input { width: 5.6rem; min-height: 34px; }
.access { margin-top: 0; font-size: .76rem; }
.order { width: 1.5rem; height: 1.5rem; font-size: .8rem; }
.opp-more { border-top: 1px solid var(--rowline); padding-top: .35rem; font-size: .85rem; }
.opp-more > summary { cursor: pointer; color: var(--muted); font-size: .8rem; padding: .2rem 0; }
.opp-more[open] > summary { margin-bottom: .4rem; }
.opp-more .opp-info { padding: .5rem 0; background: none; border: 0; }
.conds { margin: .3rem 0; padding-left: 1rem; display: grid; gap: .2rem; }
.opp-foot { padding: .45rem 1rem; }
.opp-foot .verdict { font-size: .92rem; }
.opp-foot .btn { min-height: 36px; padding: 0 .75rem; font-size: .85rem; }
@media (max-width: 760px) {
  .legs .odds-input, .legs .cap-input { min-height: 40px; }
  .opp-foot .btn { min-height: 44px; }
}

/* --- opportunité à revérifier (cotes âgées) --- */
.opp-stale { border-color: var(--warn-border); }
.opp-stale .badge { opacity: .75; }

/* Tableau de suivi : histogrammes d'une seule série (barres pleines sur la ligne de base,
   bout arrondi 4px, 2px d'espace entre barres, détail au survol ou au clavier). */
.period-nav { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.chart-scale { font-size: .8rem; margin: 0 0 .4rem; }
.bars { display: flex; align-items: stretch; gap: 2px; height: 10rem; padding-bottom: 1.4rem; position: relative;
        border-bottom: 1px solid var(--rowline); }
.bar-col { flex: 1 1 0; min-width: 0; position: relative; display: flex; align-items: flex-end; border-radius: 4px 4px 0 0; }
.bar-col:hover, .bar-col:focus-visible { background: var(--chip); outline: none; }
.bar { display: block; width: 100%; background: var(--brand); border-radius: 4px 4px 0 0; }
.bar-label { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: .3rem;
             font-size: .7rem; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.chart-table { margin-top: 1rem; font-size: .88rem; }
.chart-table summary { cursor: pointer; color: var(--text2); }
.tracking td, .chart-table td { padding: .45rem .6rem .45rem 0; border-top: 1px solid var(--rowline); font-variant-numeric: tabular-nums; }
.tracking th[scope="row"], .chart-table th[scope="row"] { text-align: left; font-weight: 500; padding: .45rem .6rem .45rem 0;
             border-top: 1px solid var(--rowline); }
.tracking td.num, .chart-table td.num { text-align: right; white-space: nowrap; }
.bar.h0{height:0%} .bar.h2{height:2%} .bar.h4{height:4%} .bar.h6{height:6%} .bar.h8{height:8%} .bar.h10{height:10%} .bar.h12{height:12%} .bar.h14{height:14%} .bar.h16{height:16%} .bar.h18{height:18%} .bar.h20{height:20%} .bar.h22{height:22%} .bar.h24{height:24%} .bar.h26{height:26%} .bar.h28{height:28%} .bar.h30{height:30%} .bar.h32{height:32%} .bar.h34{height:34%} .bar.h36{height:36%} .bar.h38{height:38%} .bar.h40{height:40%} .bar.h42{height:42%} .bar.h44{height:44%} .bar.h46{height:46%} .bar.h48{height:48%} .bar.h50{height:50%} .bar.h52{height:52%} .bar.h54{height:54%} .bar.h56{height:56%} .bar.h58{height:58%} .bar.h60{height:60%} .bar.h62{height:62%} .bar.h64{height:64%} .bar.h66{height:66%} .bar.h68{height:68%} .bar.h70{height:70%} .bar.h72{height:72%} .bar.h74{height:74%} .bar.h76{height:76%} .bar.h78{height:78%} .bar.h80{height:80%} .bar.h82{height:82%} .bar.h84{height:84%} .bar.h86{height:86%} .bar.h88{height:88%} .bar.h90{height:90%} .bar.h92{height:92%} .bar.h94{height:94%} .bar.h96{height:96%} .bar.h98{height:98%} .bar.h100{height:100%}
