/* ───────────────────────────────────────────────────────────────
   Veine — système de design « clear glass »
   Verre dépoli translucide sur un fond d'aurore, sphères lumineuses, mouvement discret.
   Sombre par défaut, clair automatique ; surchargeable avec <html data-theme="light|dark">.
   ─────────────────────────────────────────────────────────────── */

:root {
  color-scheme: dark;
  --bg0: #060715; --bg1: #0b0e2a;
  --ink: #f4f6ff; --ink2: rgba(244, 246, 255, .70); --ink3: rgba(244, 246, 255, .46);
  --glass: rgba(255, 255, 255, .075); --glass-hi: rgba(255, 255, 255, .13); --glass-lo: rgba(255, 255, 255, .04);
  --stroke: rgba(255, 255, 255, .15); --stroke-hi: rgba(255, 255, 255, .30);
  --shine: rgba(255, 255, 255, .22);
  --shadow: 0 18px 50px -18px rgba(0, 0, 0, .65), 0 2px 0 rgba(255, 255, 255, .05) inset;
  --acc: #8b8bff; --acc2: #c08cff; --acc3: #4fe3d1;
  --ok: #4ade9a; --warn: #ffb454; --bad: #ff6b8a; --info: #5cc8ff;
  --grad: linear-gradient(135deg, #7c8cff 0%, #b38cff 55%, #ff8fd8 100%);
  --blob1: #5b5bff; --blob2: #14c8b4; --blob3: #ff5fb0; --blob-o: .42;
  --r-lg: 26px; --r-md: 18px; --r-sm: 12px;
  --dock-h: 74px;
  --font: ui-rounded, "SF Pro Rounded", "SF Pro Display", system-ui, -apple-system, "Segoe UI Variable Display", "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;
  --ease: cubic-bezier(.22, .9, .3, 1);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg0: #eef0ff; --bg1: #f8f4ff;
    --ink: #141838; --ink2: rgba(20, 24, 56, .70); --ink3: rgba(20, 24, 56, .48);
    --glass: rgba(255, 255, 255, .58); --glass-hi: rgba(255, 255, 255, .80); --glass-lo: rgba(255, 255, 255, .34);
    --stroke: rgba(255, 255, 255, .85); --stroke-hi: rgba(255, 255, 255, 1);
    --shine: rgba(255, 255, 255, .9);
    --shadow: 0 18px 44px -20px rgba(60, 70, 160, .38), 0 1px 0 rgba(255, 255, 255, .9) inset;
    --acc: #5b5bf0; --acc2: #9a5cf0; --acc3: #0aa89a;
    --ok: #16a867; --warn: #d98a12; --bad: #e0365f; --info: #1f86d6;
    --blob1: #9aa4ff; --blob2: #7be6d6; --blob3: #ffb3e0; --blob-o: .6;
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg0: #eef0ff; --bg1: #f8f4ff;
  --ink: #141838; --ink2: rgba(20, 24, 56, .70); --ink3: rgba(20, 24, 56, .48);
  --glass: rgba(255, 255, 255, .58); --glass-hi: rgba(255, 255, 255, .80); --glass-lo: rgba(255, 255, 255, .34);
  --stroke: rgba(255, 255, 255, .85); --stroke-hi: rgba(255, 255, 255, 1);
  --shine: rgba(255, 255, 255, .9);
  --shadow: 0 18px 44px -20px rgba(60, 70, 160, .38), 0 1px 0 rgba(255, 255, 255, .9) inset;
  --acc: #5b5bf0; --acc2: #9a5cf0; --acc3: #0aa89a;
  --ok: #16a867; --warn: #d98a12; --bad: #e0365f; --info: #1f86d6;
  --blob1: #9aa4ff; --blob2: #7be6d6; --blob3: #ffb3e0; --blob-o: .6;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: linear-gradient(180deg, var(--bg0), var(--bg1)) fixed; min-height: 100%; }
body {
  margin: 0; min-height: 100dvh; color: var(--ink); font: 15px/1.5 var(--font); letter-spacing: -.005em;
  background: transparent;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
h1, h2, h3 { margin: 0; letter-spacing: -.02em; line-height: 1.15; }
p { margin: 0 0 .6em; }
a { color: var(--acc); }
code { font-family: var(--mono); font-size: .88em; background: var(--glass-lo); border: 1px solid var(--stroke); padding: .05em .4em; border-radius: 6px; }
b, strong { font-weight: 650; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink2); } .faint { color: var(--ink3); }
.small { font-size: 13px; } .xs { font-size: 12px; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── Aurore d'arrière-plan ────────────────────────────────────── */
.aurora { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.aurora i { position: absolute; width: 62vmax; height: 62vmax; border-radius: 50%; filter: blur(70px); opacity: var(--blob-o); will-change: transform; }
.aurora i:nth-child(1) { background: var(--blob1); left: -22vmax; top: -26vmax; animation: drift1 28s ease-in-out infinite alternate; }
.aurora i:nth-child(2) { background: var(--blob2); right: -28vmax; top: 18vh; width: 52vmax; height: 52vmax; animation: drift2 34s ease-in-out infinite alternate; }
.aurora i:nth-child(3) { background: var(--blob3); left: 10vw; bottom: -36vmax; width: 56vmax; height: 56vmax; animation: drift3 40s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate(14vmax, 10vmax) scale(1.08); } }
@keyframes drift2 { to { transform: translate(-12vmax, -8vmax) scale(.94); } }
@keyframes drift3 { to { transform: translate(8vmax, -14vmax) scale(1.12); } }

/* ── Surfaces en verre ────────────────────────────────────────── */
.glass {
  position: relative; background: var(--glass); border: 1px solid var(--stroke); border-radius: var(--r-lg);
  -webkit-backdrop-filter: blur(22px) saturate(170%); backdrop-filter: blur(22px) saturate(170%);
  box-shadow: var(--shadow); isolation: isolate;
}
.glass::before {   /* reflet spéculaire en haut à gauche */
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: -1;
  background: linear-gradient(135deg, var(--shine) 0%, transparent 38%, transparent 70%, color-mix(in srgb, var(--shine) 30%, transparent) 100%);
  opacity: .55;
}
.glass.pad, .card { padding: 18px; }
.card, .glass-card { position: relative; background: var(--glass); border: 1px solid var(--stroke); border-radius: var(--r-lg);
  -webkit-backdrop-filter: blur(22px) saturate(170%); backdrop-filter: blur(22px) saturate(170%); box-shadow: var(--shadow); isolation: isolate; }
.card::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: -1;
  background: linear-gradient(135deg, var(--shine) 0%, transparent 38%, transparent 70%, color-mix(in srgb, var(--shine) 30%, transparent) 100%); opacity: .5; }
.card.flat { box-shadow: none; }
.card.tint { background: linear-gradient(135deg, color-mix(in srgb, var(--tint, var(--acc)) 26%, var(--glass)), var(--glass)); }
.card-title { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 650; color: var(--ink2); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 12px; }
.card-title .ico { width: 16px; height: 16px; }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .card, .glass, .dock, .sheet { background: color-mix(in srgb, var(--bg1) 88%, #fff 6%); }
}

/* ── Mise en page ─────────────────────────────────────────────── */
.app { display: grid; min-height: 100dvh; }
.page { width: 100%; max-width: 1080px; margin: 0 auto; padding: calc(18px + env(safe-area-inset-top)) 16px calc(var(--dock-h) + 36px + env(safe-area-inset-bottom)); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 6px 2px 18px; }
.page-head h1 { font-size: clamp(26px, 6vw, 36px); font-weight: 760; }
.page-head .sub { color: var(--ink2); margin-top: 4px; font-size: 14px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 760; font-size: 19px; letter-spacing: -.03em; }
.brand img { width: 30px; height: 30px; border-radius: 9px; box-shadow: 0 6px 16px -6px var(--acc); }
.stack { display: grid; gap: 14px; }
.grid2 { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid3 { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.row.nowrap { flex-wrap: nowrap; }
.spacer { flex: 1; }
.between { justify-content: space-between; }
.center { text-align: center; }

/* ── Navigation : dock flottant (mobile) / rail latéral (bureau) ─ */
.nav { position: fixed; z-index: 30; display: flex; }
.nav a {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; flex: 1;
  color: var(--ink3); text-decoration: none; font-size: 10.5px; font-weight: 600; letter-spacing: .01em; border-radius: 20px; padding: 8px 4px;
  transition: color .25s var(--ease), transform .25s var(--ease), background .25s var(--ease);
}
.nav a .ico { width: 24px; height: 24px; transition: transform .35s var(--ease); }
.nav a:hover { color: var(--ink); }
.nav a:active { transform: scale(.93); }
.nav a[aria-current="page"] { color: var(--ink); background: linear-gradient(180deg, var(--glass-hi), var(--glass-lo)); box-shadow: 0 0 0 1px var(--stroke-hi) inset, 0 8px 20px -10px var(--acc); }
.nav a[aria-current="page"] .ico { transform: translateY(-1px) scale(1.08); color: var(--acc); }
.nav .brand-mini { display: none; }
.dock {
  left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); height: var(--dock-h); padding: 7px; gap: 4px; border-radius: 30px;
  background: var(--glass); border: 1px solid var(--stroke); box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(26px) saturate(180%); backdrop-filter: blur(26px) saturate(180%);
  max-width: 560px; margin: 0 auto;
}
@media (min-width: 900px) {
  .app { padding-left: 228px; }
  .page { padding: 28px 28px 60px; }
  .dock { left: 18px; right: auto; top: 18px; bottom: 18px; width: 192px; height: auto; max-width: none; margin: 0; flex-direction: column; justify-content: flex-start; gap: 6px; padding: 14px 10px; border-radius: 30px; }
  .nav a { flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; font-size: 14.5px; padding: 12px 14px; }
  .nav .brand-mini { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 780; letter-spacing: -.03em; padding: 6px 10px 18px; }
  .nav .brand-mini img { width: 32px; height: 32px; border-radius: 10px; }
  .nav .grow { flex: 1; }
}

/* ── Contrôles ────────────────────────────────────────────────── */
.btn {
  appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; font: inherit; font-weight: 640; color: var(--ink);
  padding: 11px 18px; border-radius: 999px; border: 1px solid var(--stroke-hi);
  background: linear-gradient(180deg, var(--glass-hi), var(--glass)); box-shadow: 0 8px 22px -14px rgba(0, 0, 0, .6), 0 1px 0 var(--shine) inset;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), filter .2s; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; transform: none; }
.btn:focus-visible, .chip:focus-visible, .nav a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .tile:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.btn.primary { color: #fff; border-color: rgba(255, 255, 255, .45); background: var(--grad); box-shadow: 0 12px 28px -12px var(--acc), 0 1px 0 rgba(255, 255, 255, .5) inset; text-shadow: 0 1px 2px rgba(0, 0, 0, .25); }
.btn.danger { color: var(--bad); }
.btn.ghost { background: transparent; box-shadow: none; border-color: var(--stroke); }
.btn.sm { padding: 7px 13px; font-size: 13px; } .btn.lg { padding: 15px 26px; font-size: 16px; }
.btn.block { width: 100%; }
.btn .ico { width: 18px; height: 18px; }
.ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.chip { appearance: none; font: inherit; font-size: 13px; font-weight: 600; color: var(--ink2); cursor: pointer; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--stroke); background: var(--glass-lo);
  transition: all .22s var(--ease); white-space: nowrap; }
.chip:hover { color: var(--ink); border-color: var(--stroke-hi); }
.chip.on { color: var(--ink); background: linear-gradient(180deg, var(--glass-hi), var(--glass)); border-color: var(--acc); box-shadow: 0 0 0 1px var(--acc) inset, 0 8px 18px -10px var(--acc); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; margin: 0 -2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }

.seg { display: inline-flex; padding: 4px; gap: 2px; border-radius: 999px; background: var(--glass-lo); border: 1px solid var(--stroke); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg button { appearance: none; border: 0; background: transparent; font: inherit; font-size: 14px; font-weight: 620; color: var(--ink2); cursor: pointer; padding: 8px 16px; border-radius: 999px; transition: all .25s var(--ease); white-space: nowrap; }
.seg button:hover { color: var(--ink); }
.seg button.on { color: #fff; background: var(--grad); box-shadow: 0 8px 18px -10px var(--acc), 0 1px 0 rgba(255, 255, 255, .45) inset; }

input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]), select, textarea {
  font: inherit; color: var(--ink); background: var(--glass-lo); border: 1px solid var(--stroke); border-radius: 14px; padding: 10px 14px; min-width: 0; width: auto;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); transition: border-color .2s, box-shadow .2s;
}
input::placeholder, textarea::placeholder { color: var(--ink3); }
input:focus, select:focus, textarea:focus { border-color: var(--acc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--acc) 25%, transparent); outline: none; }
select option { color: #111; }
textarea { resize: vertical; width: 100%; font-family: var(--mono); font-size: 13px; }
.field { display: grid; gap: 5px; font-size: 12.5px; color: var(--ink2); font-weight: 560; }
.field input, .field select { width: 100%; font-size: 15px; color: var(--ink); font-weight: 500; }

.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; color: var(--ink2); user-select: none; }
.switch input { position: absolute; opacity: 0; }
.switch .track { width: 46px; height: 28px; border-radius: 999px; background: var(--glass-lo); border: 1px solid var(--stroke-hi); position: relative; transition: all .25s var(--ease); flex: none; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, .35); transition: transform .3s var(--ease); }
.switch input:checked + .track { background: var(--grad); border-color: transparent; }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { outline: 2px solid var(--acc); outline-offset: 2px; }

.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 650; padding: 3px 10px; border-radius: 999px; background: color-mix(in srgb, var(--c, var(--acc)) 20%, transparent); color: var(--c, var(--acc)); border: 1px solid color-mix(in srgb, var(--c, var(--acc)) 38%, transparent); white-space: nowrap; }
.pill.ok { --c: var(--ok); } .pill.warn { --c: var(--warn); } .pill.bad { --c: var(--bad); } .pill.info { --c: var(--info); } .pill.mute { --c: var(--ink2); }

.banner { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-md); font-size: 13.5px; background: color-mix(in srgb, var(--c, var(--warn)) 14%, var(--glass-lo)); border: 1px solid color-mix(in srgb, var(--c, var(--warn)) 35%, transparent); }
.banner .ico { width: 18px; height: 18px; color: var(--c, var(--warn)); margin-top: 2px; }
.banner.info { --c: var(--info); } .banner.ok { --c: var(--ok); } .banner.bad { --c: var(--bad); }

/* ── Sphères de loto ──────────────────────────────────────────── */
.ball {
  --bc: #8b8bff; --s: 40px; flex: none;
  display: inline-grid; place-items: center; width: var(--s); height: var(--s); border-radius: 50%; color: #fff; font-weight: 800; font-size: calc(var(--s) * .4); font-variant-numeric: tabular-nums; letter-spacing: -.02em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .45); position: relative;
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, .95) 0, rgba(255, 255, 255, .55) 9%, rgba(255, 255, 255, 0) 30%),
    radial-gradient(circle at 70% 82%, rgba(0, 0, 0, .38), rgba(0, 0, 0, 0) 55%),
    radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--bc) 88%, #fff) 0%, var(--bc) 55%, color-mix(in srgb, var(--bc) 62%, #000) 100%);
  box-shadow: 0 10px 22px -10px var(--bc), 0 1px 0 rgba(255, 255, 255, .5) inset, 0 -2px 4px rgba(0, 0, 0, .25) inset;
}
.ball.sm { --s: 28px; } .ball.lg { --s: 52px; } .ball.xl { --s: 64px; }
.ball.c0 { --bc: #ff7a59; } .ball.c1 { --bc: #ffb020; } .ball.c2 { --bc: #2fd47f; } .ball.c3 { --bc: #34b8ff; } .ball.c4 { --bc: #9d7cff; } .ball.c5 { --bc: #ff6fd0; }
.ball.bonus { --bc: #ffc94a; color: #3a2600; text-shadow: 0 1px 0 rgba(255, 255, 255, .5); box-shadow: 0 10px 22px -10px #ffc94a, 0 0 0 3px rgba(255, 201, 74, .28), 0 1px 0 rgba(255, 255, 255, .6) inset; }
.balls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.balls .plus { color: var(--ink3); font-weight: 700; }
.balls.pop .ball { animation: pop .55s var(--ease) both; }
.balls.pop .ball:nth-child(2) { animation-delay: .06s; } .balls.pop .ball:nth-child(3) { animation-delay: .12s; } .balls.pop .ball:nth-child(4) { animation-delay: .18s; }
.balls.pop .ball:nth-child(5) { animation-delay: .24s; } .balls.pop .ball:nth-child(6) { animation-delay: .3s; } .balls.pop .ball:nth-child(7) { animation-delay: .36s; }
@keyframes pop { 0% { transform: translateY(14px) scale(.4) rotate(-40deg); opacity: 0; } 60% { transform: translateY(-3px) scale(1.12); opacity: 1; } 100% { transform: none; opacity: 1; } }

/* ── Indicateurs ──────────────────────────────────────────────── */
.kpi { padding: 14px 16px; border-radius: var(--r-md); background: var(--glass-lo); border: 1px solid var(--stroke); }
.kpi .l { font-size: 12px; font-weight: 600; color: var(--ink3); text-transform: uppercase; letter-spacing: .07em; }
.kpi .v { font-size: 26px; font-weight: 780; letter-spacing: -.03em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi .v small { font-size: 14px; font-weight: 600; color: var(--ink2); letter-spacing: 0; }
.kpi .d { font-size: 12.5px; color: var(--ink2); margin-top: 2px; }
.meter { height: 8px; border-radius: 999px; background: var(--glass-lo); border: 1px solid var(--stroke); overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--acc3), var(--ok)); transition: width .8s var(--ease); }
.meter.over > i { background: linear-gradient(90deg, var(--warn), var(--bad)); }
.ring { --p: 0; --c: var(--acc); width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; position: relative; flex: none;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--glass-lo) 0); }
.ring::before { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: color-mix(in srgb, var(--bg1) 70%, transparent); border: 1px solid var(--stroke); }
.ring b { position: relative; font-size: 18px; font-variant-numeric: tabular-nums; }

/* ── Carte de chaleur ─────────────────────────────────────────── */
.heat { display: grid; grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); gap: 8px; }
.tile {
  --tint: var(--ink3); --k: 0; position: relative; display: grid; place-items: center; gap: 0; padding: 9px 0 7px; border-radius: 16px; cursor: default; text-align: center;
  background: linear-gradient(180deg, color-mix(in srgb, var(--tint) calc(var(--k) * 62%), var(--glass)) , color-mix(in srgb, var(--tint) calc(var(--k) * 28%), var(--glass-lo)));
  border: 1px solid color-mix(in srgb, var(--tint) calc(20% + var(--k) * 50%), var(--stroke)); box-shadow: 0 10px 20px -14px var(--tint);
  transition: transform .2s var(--ease);
}
.tile:hover { transform: translateY(-2px) scale(1.04); }
.tile b { font-size: 17px; font-weight: 780; font-variant-numeric: tabular-nums; line-height: 1.1; }
.tile small { font-size: 10.5px; color: var(--ink2); font-variant-numeric: tabular-nums; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--ink2); margin-top: 12px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }

/* ── Listes ───────────────────────────────────────────────────── */
.list { display: grid; }
.item { display: grid; align-items: center; gap: 4px 14px; padding: 12px 4px; border-bottom: 1px solid color-mix(in srgb, var(--stroke) 70%, transparent); }
.item:last-child { border-bottom: 0; }
.nrow { grid-template-columns: 44px 1.4fr repeat(3, minmax(0, 1fr)); }
.nrow .bar { height: 6px; border-radius: 999px; background: var(--glass-lo); overflow: hidden; margin-top: 5px; }
.nrow .bar i { display: block; height: 100%; background: var(--grad); border-radius: inherit; }
.nrow .c { text-align: right; font-variant-numeric: tabular-nums; }
.nrow .c small { display: block; font-size: 11px; color: var(--ink3); }
.nhead { font-size: 11.5px; color: var(--ink3); text-transform: uppercase; letter-spacing: .07em; font-weight: 650; border-bottom: 1px solid var(--stroke); padding-bottom: 8px; }
.nhead button { appearance: none; background: none; border: 0; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; font-weight: inherit; cursor: pointer; padding: 0; }
.nhead button.on { color: var(--acc); }
.up { color: var(--bad); } .down { color: var(--info); } .good { color: var(--ok); }
@media (max-width: 640px) { .nrow { grid-template-columns: 40px 1fr 74px 74px; } .nrow .hide-s { display: none; } }

.fm { display: inline-flex; gap: 3px; vertical-align: middle; }
.fm i { font-style: normal; font-size: 10.5px; font-weight: 750; width: 18px; height: 18px; display: inline-grid; place-items: center; border-radius: 6px; color: #fff; box-shadow: 0 1px 0 rgba(255, 255, 255, .35) inset; }
.f-W { background: linear-gradient(180deg, #43e39a, #17a867); } .f-L { background: linear-gradient(180deg, #ff7f9c, #dc3358); } .f-D { background: linear-gradient(180deg, #9aa3c4, #6b7396); }

/* ── Accueil ──────────────────────────────────────────────────── */
.hero { padding: 24px 22px 22px; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--acc2) 55%, transparent), transparent 65%); z-index: -1; filter: blur(8px); }
.hero .eyebrow { font-size: 13px; font-weight: 650; color: var(--ink2); letter-spacing: .02em; }
.hero h1 { font-size: clamp(30px, 8vw, 46px); font-weight: 800; margin: 6px 0 4px; letter-spacing: -.035em; }
.hero h1 em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead { color: var(--ink2); max-width: 46ch; }
.count { font-variant-numeric: tabular-nums; font-weight: 780; }
.action { display: flex; align-items: center; gap: 14px; padding: 16px; text-align: left; cursor: pointer; color: inherit; text-decoration: none; transition: transform .25s var(--ease); }
.action:hover { transform: translateY(-3px); }
.action:active { transform: scale(.98); }
.action .badge { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; flex: none; color: #fff; background: var(--grad); box-shadow: 0 10px 22px -10px var(--acc), 0 1px 0 rgba(255, 255, 255, .5) inset; }
.action .badge.t2 { background: linear-gradient(135deg, #14c8b4, #4f8bff); } .action .badge.t3 { background: linear-gradient(135deg, #ff9a56, #ff5fb0); }
.action .badge .ico { width: 24px; height: 24px; }
.action b { display: block; font-size: 16px; } .action span { font-size: 13px; color: var(--ink2); }

/* ── Paris ────────────────────────────────────────────────────── */
.bet { padding: 16px; display: grid; gap: 12px; }
.bet .top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.bet .teams { font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.bet .meta { font-size: 12.5px; color: var(--ink2); }
.bet .odds { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.bet .odds div { background: var(--glass-lo); border: 1px solid var(--stroke); border-radius: 14px; padding: 8px 10px; }
.bet .odds .l { font-size: 10.5px; color: var(--ink3); text-transform: uppercase; letter-spacing: .06em; font-weight: 650; }
.bet .odds .v { font-size: 17px; font-weight: 760; font-variant-numeric: tabular-nums; }
.edge { font-weight: 800; color: var(--ok); }
.empty { padding: 26px 18px; text-align: center; }
.empty .big { font-size: 40px; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .3)); }
.empty h3 { font-size: 19px; margin: 6px 0; }
.margin-bars { display: grid; gap: 10px; margin: 14px 0 4px; }
.margin-bars .mb { display: grid; grid-template-columns: 78px 1fr 52px; gap: 10px; align-items: center; font-size: 13px; }
.margin-bars .mb i { display: block; height: 10px; border-radius: 999px; background: var(--grad); }
.margin-bars .mb.ref i { background: linear-gradient(90deg, var(--acc3), var(--ok)); }
.match { padding: 14px 16px; }
.match summary { cursor: pointer; list-style: none; display: grid; gap: 6px; }
.match summary::-webkit-details-marker { display: none; }
.match .detail { margin-top: 12px; display: grid; gap: 12px; font-size: 13.5px; }
.match .detail .side { background: var(--glass-lo); border: 1px solid var(--stroke); border-radius: 14px; padding: 12px; }
.jrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 13px 2px; border-bottom: 1px solid color-mix(in srgb, var(--stroke) 70%, transparent); }
.jrow:last-child { border-bottom: 0; }

/* ── Assistant (chat) ─────────────────────────────────────────── */
.chat { display: flex; flex-direction: column; gap: 10px; padding-bottom: 8px; }
.msg { max-width: 88%; padding: 11px 15px; border-radius: 22px; overflow-wrap: anywhere; animation: rise .35s var(--ease) both;
  background: var(--glass); border: 1px solid var(--stroke); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border-bottom-left-radius: 8px; }
.msg.user { align-self: flex-end; border-bottom-left-radius: 22px; border-bottom-right-radius: 8px; color: #fff; background: var(--grad); border-color: rgba(255, 255, 255, .4); box-shadow: 0 12px 26px -14px var(--acc); }
.msg.err { border-color: var(--bad); color: var(--bad); }
.msg p { margin: 0 0 6px; } .msg p:last-child { margin: 0; } .msg ul { margin: 4px 0; padding-left: 20px; }
.tool { align-self: flex-start; max-width: 92%; font-size: 12.5px; color: var(--ink2); padding: 7px 12px; border-radius: 14px; background: var(--glass-lo); border: 1px dashed var(--stroke-hi); animation: rise .3s var(--ease) both; }
.tool.refused { border-color: var(--bad); }
.tool summary { cursor: pointer; }
.tool pre { margin: 6px 0 0; white-space: pre-wrap; font: 11.5px/1.4 var(--mono); max-height: 160px; overflow: auto; }
.typing { display: inline-flex; gap: 4px; padding: 14px 16px; } .typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink3); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; transform: none; } 40% { opacity: 1; transform: translateY(-3px); } }
.composer { position: sticky; bottom: calc(var(--dock-h) + 22px + env(safe-area-inset-bottom)); display: flex; gap: 8px; align-items: flex-end; padding: 8px; border-radius: 28px; z-index: 5; }
.composer textarea { flex: 1; min-height: 44px; max-height: 140px; border-radius: 22px; font-family: var(--font); font-size: 15px; background: transparent; border-color: transparent; resize: none; }
.composer .btn { width: 46px; height: 46px; padding: 0; flex: none; }
@media (min-width: 900px) { .composer { bottom: 22px; } }

/* ── Fenêtre de confirmation (feuille de verre) ───────────────── */
dialog.sheet { border: 1px solid var(--stroke-hi); border-radius: 28px; color: var(--ink); width: min(440px, calc(100% - 28px)); padding: 22px; background: var(--glass-hi);
  -webkit-backdrop-filter: blur(30px) saturate(180%); backdrop-filter: blur(30px) saturate(180%); box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .8); }
dialog.sheet[open] { animation: sheetIn .38s var(--ease); }
dialog.sheet::backdrop { background: rgba(4, 5, 20, .55); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); }
dialog.sheet h3 { font-size: 20px; margin-bottom: 4px; } dialog.sheet ul { padding-left: 18px; margin: 12px 0 18px; display: grid; gap: 6px; font-size: 14px; }
dialog.sheet .actions { display: flex; gap: 10px; justify-content: flex-end; }
@keyframes sheetIn { from { opacity: 0; transform: translateY(24px) scale(.95); } to { opacity: 1; transform: none; } }

/* ── Divers ───────────────────────────────────────────────────── */
.toast-wrap { position: fixed; z-index: 60; left: 0; right: 0; bottom: calc(var(--dock-h) + 30px + env(safe-area-inset-bottom)); display: grid; justify-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast { pointer-events: auto; padding: 11px 18px; border-radius: 999px; font-size: 14px; font-weight: 600; background: var(--glass-hi); border: 1px solid var(--stroke-hi); box-shadow: var(--shadow); -webkit-backdrop-filter: blur(22px); backdrop-filter: blur(22px); animation: rise .35s var(--ease) both; max-width: 560px; }
.toast.bad { color: var(--bad); } .toast.ok { color: var(--ok); }
@media (min-width: 900px) { .toast-wrap { bottom: 28px; } }
.skeleton { border-radius: 14px; background: linear-gradient(100deg, var(--glass-lo) 30%, var(--glass-hi) 50%, var(--glass-lo) 70%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.enter > * { animation: rise .5s var(--ease) both; }
.enter > *:nth-child(2) { animation-delay: .05s; } .enter > *:nth-child(3) { animation-delay: .1s; } .enter > *:nth-child(4) { animation-delay: .15s; }
.enter > *:nth-child(5) { animation-delay: .2s; } .enter > *:nth-child(6) { animation-delay: .25s; } .enter > *:nth-child(n+7) { animation-delay: .3s; }
.sync { font-size: 12px; color: var(--ink3); display: inline-flex; align-items: center; gap: 6px; }
.sync::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ink3); }
.sync.ok::before { background: var(--ok); box-shadow: 0 0 10px var(--ok); } .sync.error::before { background: var(--bad); } .sync.syncing::before { background: var(--warn); animation: blink 1s infinite; }
.tablewrap { overflow-x: auto; margin: 0 -4px; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { padding: 9px 8px; text-align: right; border-bottom: 1px solid color-mix(in srgb, var(--stroke) 70%, transparent); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; } th { font-size: 11.5px; color: var(--ink3); text-transform: uppercase; letter-spacing: .06em; font-weight: 650; }
.help { font-size: 13px; color: var(--ink2); }
hr { border: 0; border-top: 1px solid var(--stroke); margin: 16px 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
@media (max-width: 420px) { .bet .odds { grid-template-columns: repeat(2, 1fr); } .page { padding-left: 12px; padding-right: 12px; } }

/* ── Compléments ──────────────────────────────────────────────── */
.opt { appearance: none; text-align: left; font: inherit; color: var(--ink); cursor: pointer; display: grid; gap: 3px; padding: 14px 16px; border-radius: var(--r-md);
  background: var(--glass-lo); border: 1px solid var(--stroke); transition: all .25s var(--ease); }
.opt b { font-size: 15.5px; } .opt span { font-size: 12.5px; color: var(--ink2); }
.opt:hover { border-color: var(--stroke-hi); transform: translateY(-2px); }
.opt.on { border-color: var(--acc); background: linear-gradient(180deg, var(--glass-hi), var(--glass)); box-shadow: 0 0 0 1px var(--acc) inset, 0 14px 28px -16px var(--acc); }
.input-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }

/* ── Raccourcis de l'accueil ──────────────────────────────────── */
.actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.actions .action { flex-direction: column; text-align: center; padding: 16px 8px 14px; gap: 10px; }
.actions .action span:not(.badge) { display: none; }
.actions .action b { font-size: 14px; }
@media (min-width: 640px) {
  .actions .action { flex-direction: row; text-align: left; padding: 16px; gap: 14px; }
  .actions .action span:not(.badge) { display: block; }
  .actions .action b { font-size: 16px; }
}
@media (max-width: 899px) { .nav .sync, .nav .grow { display: none; } }
@media (max-width: 420px) { .ball.lg { --s: 42px; } .ball.xl { --s: 54px; } .balls { gap: 6px; } }

.fab { position: fixed; right: 16px; bottom: calc(var(--dock-h) + 28px + env(safe-area-inset-bottom)); z-index: 20; width: 54px; height: 54px; padding: 0; border-radius: 50%; box-shadow: 0 16px 34px -12px var(--acc); }
.fab .ico { width: 24px; height: 24px; }
@media (min-width: 900px) { .fab { bottom: 28px; right: 28px; } }
.chips.wrap { flex-wrap: wrap; overflow: visible; }

/* ── Écran de verrouillage ────────────────────────────────────── */
.lock { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; overflow-y: auto; animation: lockIn .5s var(--ease);
  /* Totalement opaque : rien de l'application ne doit être visible tant que l'accès n'est pas déverrouillé */
  background:
    radial-gradient(60vmax 60vmax at 12% -5%, color-mix(in srgb, var(--blob1) 55%, transparent), transparent 70%),
    radial-gradient(50vmax 50vmax at 100% 55%, color-mix(in srgb, var(--blob2) 40%, transparent), transparent 70%),
    radial-gradient(55vmax 55vmax at 40% 108%, color-mix(in srgb, var(--blob3) 42%, transparent), transparent 70%),
    var(--bg0); }
@keyframes lockIn { from { opacity: 0; } to { opacity: 1; } }
.lock-card { width: 100%; max-width: 400px; padding: 32px 26px 26px; text-align: center; animation: rise .6s var(--ease) both; }
.lock-card h1 { font-size: 34px; font-weight: 800; letter-spacing: -.04em; margin: 10px 0 6px; }
.lock-logo { width: 72px; height: 72px; border-radius: 22px; box-shadow: 0 16px 36px -12px var(--acc), 0 0 0 1px var(--stroke-hi); animation: float 5s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-5px); } }

/* ── Bannière de mise à jour ──────────────────────────────────── */
.update-bar { position: fixed; z-index: 110; left: 12px; right: 12px; bottom: calc(var(--dock-h) + 24px + env(safe-area-inset-bottom)); max-width: 460px; margin: 0 auto; padding: 12px 14px;
  display: flex; align-items: center; gap: 12px; border-radius: 22px; animation: rise .5s var(--ease) both; }
.update-bar > div { flex: 1; min-width: 0; line-height: 1.25; }
.update-bar .ub-ico { width: 38px; height: 38px; border-radius: 13px; display: grid; place-items: center; flex: none; color: #fff; background: var(--grad); box-shadow: 0 8px 18px -8px var(--acc); }
@media (min-width: 900px) { .update-bar { bottom: 28px; left: auto; right: 28px; margin: 0; } }

/* ── Cotes dans la liste des matchs ───────────────────────────── */
.oc { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px 2px 4px; border-radius: 999px; font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums;
  background: var(--glass-lo); border: 1px solid var(--stroke); color: var(--ink); }
.oc i { font-style: normal; font-size: 10.5px; width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; background: var(--glass-hi); color: var(--ink2); }
.oc.pos { border-color: var(--ok); box-shadow: 0 0 0 1px color-mix(in srgb, var(--ok) 40%, transparent) inset; }
.odds-market + .odds-market { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--stroke); }
.orow { display: grid; grid-template-columns: minmax(0, 1fr) 68px 62px 74px; gap: 8px; align-items: center; padding: 7px 0; border-bottom: 1px solid color-mix(in srgb, var(--stroke) 60%, transparent); }
.orow:last-of-type { border-bottom: 0; } .orow span:not(:first-child), .orow b { text-align: right; }
.orow.ohead { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink3); font-weight: 650; }

/* ── Avis IA : bouton, panneau, tableau de scores ─────────────── */
.ai-btn { position: relative; display: inline-flex; align-items: center; gap: 7px; padding: 6px 14px 6px 11px; border-radius: 999px; font: inherit; font-size: 13px; font-weight: 700; color: var(--ink); cursor: pointer;
  border: 1.5px solid transparent;
  background: linear-gradient(var(--glass-hi), var(--glass)) padding-box, linear-gradient(110deg, #7c8cff, #ff8fd8, #4fe3d1, #7c8cff) border-box; background-size: 100% 100%, 300% 100%;
  animation: aiShift 7s linear infinite; box-shadow: 0 8px 22px -12px var(--acc), 0 1px 0 var(--shine) inset; -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
.ai-btn .ico { width: 16px; height: 16px; color: var(--acc); filter: drop-shadow(0 0 6px var(--acc)); }
.ai-btn:hover { transform: translateY(-1px); box-shadow: 0 12px 26px -10px var(--acc), 0 1px 0 var(--shine) inset; }
.ai-btn:active { transform: scale(.95); } .ai-btn:disabled { opacity: .6; cursor: progress; animation-duration: 1.4s; }
.ai-btn:disabled .ico { animation: spin 1s linear infinite; }
@keyframes aiShift { to { background-position: 0 0, -300% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
.ai-panel { position: relative; padding: 16px; border-radius: 20px; border: 1.5px solid transparent;
  background: linear-gradient(color-mix(in srgb, var(--bg1) 70%, transparent), color-mix(in srgb, var(--bg1) 70%, transparent)) padding-box,
    linear-gradient(135deg, color-mix(in srgb, #7c8cff 70%, transparent), color-mix(in srgb, #ff8fd8 60%, transparent), color-mix(in srgb, #4fe3d1 60%, transparent)) border-box;
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); animation: rise .45s var(--ease) both; }
.ai-head { display: flex; align-items: center; gap: 10px; }
.ai-orb { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--grad); box-shadow: 0 6px 16px -6px var(--acc); }
.ai-orb .ico { width: 17px; height: 17px; }
.ai-text { margin-top: 10px; font-size: 14.5px; line-height: 1.55; } .ai-text p { margin: 0 0 9px; } .ai-text p:last-child { margin: 0; }
.ai-model { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--stroke); }
.score-row { grid-template-columns: 1fr 58px 64px 84px 70px; }
.score-in { width: 100%; padding: 5px 8px; border-radius: 10px; font-size: 13.5px; text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 460px) { .score-row { grid-template-columns: 1fr 50px 52px 70px 58px; gap: 6px; } .score-in { padding: 5px 6px; } }
