/* Sonar — dark panel UI */
:root {
  color-scheme: dark;
  --bg: #07080a;
  --bg-2: #0b0c10;
  --card: #111216;
  --card-2: #16171d;
  --card-3: #1c1d24;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.12);
  --text: #f4f4f6;
  --text-2: #b4b4bf;
  --muted: #7d7f8c;
  --grid: #24252c;
  --axis: #34353d;
  --brand-1: #8b7bff;
  --brand-2: #2dd4bf;
  --brand: linear-gradient(135deg, var(--brand-1), var(--brand-2));
  --good: #0ca30c;
  --good-t: #3ddc84;
  --warning: #fab219;
  --serious: #ec835a;
  --critical: #d03b3b;
  --critical-t: #ff7b7b;
  --r: 16px;
  --r-sm: 11px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Consolas, monospace;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; overscroll-behavior-y: none; }
a { color: #a99dff; text-decoration: none; }
a:hover { color: #c8c0ff; }
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; }
h1 { font-size: clamp(1.6rem, 4vw, 2.1rem); font-weight: 800; }
h3 { font-size: 0.98rem; font-weight: 650; }
p { margin: 0.4em 0; }
small, .small { font-size: 0.8rem; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.center { text-align: center; }
.mt { margin-top: 18px; }
.grad { background: var(--brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.eyebrow { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.ok { color: var(--good-t); }
.err { color: var(--critical-t); }
.warn-t { color: var(--warning); }
.danger-t { color: var(--critical-t) !important; }
.admin-t { color: #b3a8ff; }
[hidden] { display: none !important; }

/* ---------- boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line-2); background: var(--card-2); color: var(--text); border-radius: 12px; padding: 10px 16px; font-weight: 600; font-size: 0.92rem; transition: transform 0.12s, background 0.15s, border-color 0.15s, opacity 0.15s; white-space: nowrap; text-decoration: none; }
.btn:hover { background: var(--card-3); border-color: rgba(255, 255, 255, 0.2); color: var(--text); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.4; pointer-events: none; }
.btn.primary { background: var(--brand); border-color: transparent; color: #0a0a12; box-shadow: 0 6px 24px -8px rgba(139, 123, 255, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.35); }
.btn.primary:hover { filter: brightness(1.08); color: #0a0a12; }
.btn.ghost { background: rgba(255, 255, 255, 0.03); }
.btn.danger { background: rgba(208, 59, 59, 0.15); border-color: rgba(208, 59, 59, 0.5); color: #ffb4b4; }
.btn.sm { padding: 7px 12px; font-size: 0.84rem; border-radius: 10px; }
.btn.xs { padding: 4px 9px; font-size: 0.76rem; border-radius: 8px; }
.btn.lg { padding: 15px 20px; font-size: 1rem; border-radius: 14px; }
.btn.block { width: 100%; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn-row.end { justify-content: flex-end; margin-top: 16px; }
.icon-btn { width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 11px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.03); flex: none; }
.icon-btn:hover { background: var(--card-3); }
.icon-btn.sm { width: 30px; height: 30px; border-radius: 9px; font-size: 0.85rem; }

/* ---------- formulaires ---------- */
.form { display: grid; gap: 14px; }
.form.boxed { margin-top: 16px; padding: 16px; border: 1px dashed var(--line-2); border-radius: var(--r); }
.field { display: grid; gap: 6px; }
.field > span { font-size: 0.8rem; font-weight: 600; color: var(--text-2); }
.field input, .field textarea, .field select, select { width: 100%; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 11px; padding: 11px 13px; outline: none; transition: border-color 0.15s, box-shadow 0.15s; }
.field input:focus, .field textarea:focus, .field select:focus, select:focus, .big-input:focus { border-color: rgba(139, 123, 255, 0.7); box-shadow: 0 0 0 4px rgba(139, 123, 255, 0.15); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.code-input { font-family: var(--mono) !important; font-size: 1.7rem !important; letter-spacing: 0.4em; text-align: center; text-transform: uppercase; padding: 14px !important; font-weight: 700; }
.preview { min-height: 1.2em; font-size: 0.85rem; margin-top: -6px; text-align: center; }
.adv summary { cursor: pointer; color: var(--muted); font-size: 0.84rem; }
.adv[open] summary { margin-bottom: 8px; }

.pole-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pole input, .mode-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.pole span { display: grid; gap: 2px; padding: 11px 12px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--bg-2); cursor: pointer; transition: all 0.15s; }
.pole span small { color: var(--muted); font-size: 0.74rem; }
.pole b { font-size: 0.88rem; font-weight: 600; }
.pole input:checked + span { border-color: var(--brand-1); background: rgba(139, 123, 255, 0.1); box-shadow: inset 0 0 0 1px var(--brand-1); }
.pole input:focus-visible + span, .mode-toggle input:focus-visible + span { outline: 2px solid var(--brand-1); outline-offset: 2px; }
.mode-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 13px; }
.mode-toggle span { display: block; text-align: center; padding: 9px; border-radius: 10px; font-weight: 600; font-size: 0.86rem; cursor: pointer; color: var(--text-2); }
.mode-toggle input:checked + span { background: var(--card-3); color: var(--text); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 4px 14px rgba(0, 0, 0, 0.4); }

.switch { display: flex; align-items: center; gap: 10px; font-size: 0.86rem; color: var(--text-2); cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch span { width: 38px; height: 22px; border-radius: 99px; background: var(--card-3); border: 1px solid var(--line-2); position: relative; flex: none; transition: background 0.15s; }
.switch span::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform 0.15s; }
.switch input:checked + span { background: var(--brand-1); }
.switch input:checked + span::after { transform: translateX(16px); }

/* ---------- cartes ---------- */
.card { background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0) 120px), var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 20px 40px -24px rgba(0, 0, 0, 0.7); min-width: 0; }
.card-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-h p { margin: 3px 0 0; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; font-size: 0.78rem; font-weight: 600; background: color-mix(in srgb, var(--c) 16%, transparent); border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); color: var(--text); }
.tag { display: inline-block; font-size: 0.68rem; font-weight: 600; padding: 2px 7px; border-radius: 6px; background: var(--card-3); color: var(--text-2); margin-right: 6px; vertical-align: 1px; }

/* ---------- landing ---------- */
.landing { position: relative; min-height: 100vh; overflow: hidden; padding: calc(28px + var(--safe-t)) 16px 40px; }
.bg-grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px); background-size: 44px 44px; mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%); pointer-events: none; }
.glow { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.45; pointer-events: none; }
.glow.g1 { width: 520px; height: 420px; background: #6d5efc; top: -220px; left: 50%; transform: translateX(-70%); }
.glow.g2 { width: 420px; height: 360px; background: #0fb5a0; top: -160px; left: 50%; transform: translateX(10%); opacity: 0.3; }
.landing-inner { position: relative; max-width: 520px; margin: 0 auto; text-align: center; }
.brand-lg { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.25rem; letter-spacing: -0.02em; margin-bottom: 26px; padding: 7px 14px 7px 8px; border-radius: 99px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.03); backdrop-filter: blur(8px); }
.brand-lg .logo { width: 28px; height: 28px; }
.brand-lg em { font-style: normal; font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; padding: 2px 7px; border-radius: 99px; background: rgba(139, 123, 255, 0.2); color: #c8c0ff; }
.landing h1 { font-size: clamp(2rem, 7vw, 3rem); line-height: 1.05; letter-spacing: -0.04em; }
.lead { color: var(--text-2); font-size: 1.02rem; max-width: 46ch; margin: 14px auto 26px; }
.auth-card { text-align: left; padding: 8px 18px 20px; backdrop-filter: blur(10px); background: rgba(17, 18, 22, 0.85); }
.seg-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin: 10px 0 18px; background: var(--bg-2); border-radius: 13px; border: 1px solid var(--line); }
.seg-tabs button { border: 0; background: transparent; padding: 10px; border-radius: 10px; font-weight: 600; font-size: 0.88rem; color: var(--muted); }
.seg-tabs button.on { background: var(--card-3); color: var(--text); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4); }
.features { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 22px; text-align: left; }
.features div { display: grid; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255, 255, 255, 0.02); }
.features b { font-size: 0.86rem; }
.features span { font-size: 0.78rem; color: var(--muted); }

/* ---------- shell ---------- */
.topbar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 12px; padding: calc(10px + var(--safe-t)) 16px 10px; background: rgba(7, 8, 10, 0.78); backdrop-filter: saturate(160%) blur(14px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--text); letter-spacing: -0.02em; font-size: 1.05rem; }
.brand .logo { width: 26px; height: 26px; }
.team-chip { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.03); border-radius: 10px; padding: 5px 6px 5px 10px; min-width: 0; max-width: 300px; }
.tc-name { font-size: 0.82rem; font-weight: 600; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.code { font-family: var(--mono); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.12em; padding: 3px 7px; border-radius: 7px; background: rgba(139, 123, 255, 0.16); color: #cbc4ff; }
.topnav { display: none; gap: 4px; margin-left: auto; }
.topnav a { padding: 7px 12px; border-radius: 9px; color: var(--muted); font-weight: 600; font-size: 0.88rem; }
.topnav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.topnav a.on { color: var(--text); background: var(--card-3); }
.sync { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.03); border-radius: 99px; padding: 5px 11px; font-size: 0.76rem; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.sync i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.sync.ok i { background: var(--good); box-shadow: 0 0 0 0 rgba(12, 163, 12, 0.6); animation: pulse 2s infinite; }
.sync.warn { color: var(--warning); border-color: rgba(250, 178, 25, 0.35); }
.sync.warn i { background: var(--warning); }
.sync.off i { background: var(--critical); }
.me-chip { display: flex; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(12, 163, 12, 0.55); } 70% { box-shadow: 0 0 0 7px rgba(12, 163, 12, 0); } 100% { box-shadow: 0 0 0 0 rgba(12, 163, 12, 0); } }

.main { max-width: 1240px; margin: 0 auto; padding: 20px 16px calc(96px + var(--safe-b)); display: grid; gap: 14px; }
.main.view-home, .main.view-guide { max-width: 860px; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: grid; grid-template-columns: repeat(4, 1fr); padding: 6px 8px calc(6px + var(--safe-b)); background: rgba(9, 10, 13, 0.88); backdrop-filter: saturate(160%) blur(14px); border-top: 1px solid var(--line); }
.tabbar a { display: grid; justify-items: center; gap: 3px; padding: 6px 0; color: var(--muted); font-size: 0.7rem; font-weight: 600; border-radius: 10px; }
.tabbar a svg { width: 22px; height: 22px; }
.tabbar a.on { color: var(--text); }
.tabbar a.on svg { stroke: url(#lg); color: #b3a8ff; }

@media (min-width: 900px) {
  .topnav { display: flex; }
  .sync { margin-left: 8px; }
  .tabbar { display: none; }
  .main { padding-bottom: 48px; padding-top: 26px; }
}
@media (max-width: 520px) {
  .tc-name { display: none; }
  .team-chip { padding: 4px; }
  .row2 { grid-template-columns: 1fr; }
}

/* avatars */
.av { --c: #6d5efc; width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 0.72rem; font-weight: 700; color: #fff; background: radial-gradient(circle at 30% 25%, color-mix(in srgb, var(--c) 70%, #fff), var(--c)); border: 2px solid var(--card); flex: none; }
.av.sm { width: 26px; height: 26px; font-size: 0.62rem; }
.av-stack { display: flex; align-items: center; }
.av-stack .av + .av { margin-left: -8px; }
.av-stack.sm { margin-top: 8px; }

/* ---------- home ---------- */
.hello { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; padding: 4px 2px; }
.wave { display: inline-block; animation: wave 2.4s ease-in-out 1; transform-origin: 70% 70%; }
@keyframes wave { 0%, 60%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(14deg); } 20% { transform: rotate(-8deg); } 40% { transform: rotate(-4deg); } 50% { transform: rotate(10deg); } }
.squad-card { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.sq-main { display: flex; align-items: center; gap: 14px; }
.sq-badge { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-weight: 800; font-size: 1.3rem; background: var(--brand); color: #0a0a12; box-shadow: 0 8px 24px -10px rgba(139, 123, 255, 0.8); }
.sq-side { display: flex; align-items: center; gap: 12px; }
.squad-empty { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; border-style: dashed; border-color: rgba(139, 123, 255, 0.4); background: rgba(139, 123, 255, 0.05); }

.cta-big { position: relative; display: flex; align-items: center; gap: 16px; width: 100%; text-align: left; padding: 20px; border-radius: 20px; border: 0; color: #0a0a12; background: var(--brand); box-shadow: 0 18px 50px -18px rgba(139, 123, 255, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.4); overflow: hidden; transition: transform 0.15s; }
.cta-big::after { content: ''; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.35) 50%, transparent 70%); transform: translateX(-100%); animation: shine 3.5s ease-in-out infinite; }
@keyframes shine { 0%, 60% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
.cta-big:active { transform: scale(0.985); }
.cta-big b { display: block; font-size: 1.18rem; font-weight: 800; letter-spacing: -0.02em; }
.cta-big small { font-size: 0.84rem; opacity: 0.75; font-weight: 500; }
.cta-icon { width: 46px; height: 46px; border-radius: 14px; background: rgba(10, 10, 18, 0.88); color: #fff; display: grid; place-items: center; font-size: 1.5rem; flex: none; }
.cta-big .arrow { margin-left: auto; font-size: 1.4rem; font-weight: 700; }
.cta-big.resume { background: var(--card-2); color: var(--text); border: 1px solid rgba(250, 178, 25, 0.45); box-shadow: none; }
.cta-big.resume::after { display: none; }
.cta-big.resume .cta-icon { background: rgba(250, 178, 25, 0.16); color: var(--warning); }
.quick-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick-row .btn { padding: 13px; white-space: normal; text-align: center; }
.quick-row small { display: none; }
@media (min-width: 600px) { .quick-row small { display: inline; } }

.stat-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { display: grid; align-content: start; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; min-width: 0; }
.tile.wide { grid-column: 1 / -1; }
.t-label { font-size: 0.78rem; color: var(--text-2); font-weight: 500; display: flex; align-items: center; gap: 7px; }
.t-val { font-size: 1.7rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }
.t-val small, .t-hero small { font-size: 0.5em; color: var(--muted); font-weight: 600; letter-spacing: 0; }
.t-sub { font-size: 0.74rem; color: var(--muted); }
.sw { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
@media (min-width: 700px) { .stat-row { grid-template-columns: 1fr 1fr 2fr; } .tile.wide { grid-column: auto; } }
.two-col { display: grid; gap: 14px; }
@media (min-width: 760px) { .two-col { grid-template-columns: 1fr 1fr; } }

.meter { position: relative; height: 8px; border-radius: 99px; background: #23242c; overflow: visible; margin-top: 6px; }
.meter > div { height: 100%; border-radius: 99px; background: #3987e5; transition: width 0.6s cubic-bezier(.2, .8, .2, 1); }
.meter.brand > div { background: var(--brand); }
.meter i { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text-2); border-radius: 2px; transform: translateX(-1px); }
.meter.st-good > div { background: var(--good); }
.meter.st-warning > div { background: var(--warning); }
.meter.st-critical > div { background: var(--critical); }
.meter.st-pending > div { background: #4b4d58; }

.feed { display: grid; gap: 2px; }
.feed.cols { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 4px 12px; }
.feed-item { display: flex; align-items: center; gap: 12px; padding: 9px 8px; border-radius: 11px; border: 0; background: transparent; text-align: left; width: 100%; }
.feed-item:hover { background: rgba(255, 255, 255, 0.035); }
.fi-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; box-shadow: 0 0 0 3px var(--card); }
.fi-main { display: grid; min-width: 0; flex: 1; }
.fi-main b { font-size: 0.86rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fi-main small { color: var(--muted); }
.fi-score { font-weight: 700; font-size: 0.95rem; }
.fi-score small { color: var(--muted); font-weight: 500; }

/* ---------- squads modal / team ---------- */
.squad-list { display: grid; gap: 8px; }
.squad-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 13px; background: var(--bg-2); }
.squad-row.on { border-color: rgba(139, 123, 255, 0.55); background: rgba(139, 123, 255, 0.07); }
.squad-row > div { display: grid; }
.team-grid { display: grid; gap: 14px; }
@media (min-width: 900px) { .team-grid { grid-template-columns: 1fr 1fr; } .team-grid .span-2 { grid-column: 1 / -1; } }
.invite { display: flex; justify-content: space-between; gap: 18px; align-items: center; flex-wrap: wrap; background: radial-gradient(ellipse at 0% 0%, rgba(139, 123, 255, 0.18), transparent 60%), radial-gradient(ellipse at 100% 100%, rgba(45, 212, 191, 0.12), transparent 60%), var(--card); }
.big-code { font-family: var(--mono); font-size: clamp(2.2rem, 9vw, 3rem); font-weight: 700; letter-spacing: 0.18em; margin: 6px 0 4px; cursor: pointer; }
.qr { padding: 10px; background: #fff; border-radius: 14px; line-height: 0; }
.qr img, .qr canvas { display: block; max-width: 100%; }
.squads { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.squad-tile { display: grid; gap: 4px; padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: var(--bg-2); }
.squad-tile.on { border-color: rgba(139, 123, 255, 0.55); }
.squad-tile .btn-row { margin-top: 8px; }
.st-top { display: flex; justify-content: space-between; align-items: center; }
.count { font-weight: 700; font-size: 0.85rem; padding: 2px 9px; border-radius: 99px; background: var(--card-3); color: var(--text-2); font-variant-numeric: tabular-nums; }
.poles { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.pole-h { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-2); padding-bottom: 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.member { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.mb-main { display: grid; flex: 1; min-width: 0; }
.mb-main b { font-size: 0.88rem; font-weight: 600; }
.admin-key { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 16px 0; padding: 12px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); flex-wrap: wrap; }
.code-pill { font-family: var(--mono); font-weight: 700; letter-spacing: 0.15em; padding: 6px 12px; border-radius: 9px; border: 1px solid rgba(139, 123, 255, 0.4); background: rgba(139, 123, 255, 0.12); color: #d4ceff; }

/* ---------- entretien ---------- */
.iv { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: radial-gradient(ellipse 120% 40% at 50% 0%, rgba(139, 123, 255, 0.1), transparent 70%), var(--bg); }
.iv-top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 14px; padding: calc(12px + var(--safe-t)) 16px 12px; background: rgba(7, 8, 10, 0.8); backdrop-filter: blur(12px); }
.iv-progress { flex: 1; height: 6px; border-radius: 99px; background: #1e1f26; overflow: hidden; }
.iv-progress div { height: 100%; background: var(--brand); border-radius: 99px; transition: width 0.35s cubic-bezier(.2, .8, .2, 1); }
.iv-timer { font-family: var(--mono); font-size: 0.85rem; font-weight: 700; color: var(--text-2); font-variant-numeric: tabular-nums; }
.iv-body { flex: 1; width: 100%; max-width: 640px; margin: 0 auto; }
.iv-pad { padding: 12px 18px 28px; animation: rise 0.28s cubic-bezier(.2, .8, .2, 1); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.iv-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 18px; }
.iv-section { font-size: 0.74rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; background: var(--brand); -webkit-background-clip: text; background-clip: text; color: transparent; margin-bottom: 6px; }
.iv-q { font-size: clamp(1.35rem, 5.4vw, 1.75rem); font-weight: 750; line-height: 1.2; letter-spacing: -0.025em; margin-bottom: 8px; }
.iv-hint { color: var(--text-2); font-size: 0.9rem; margin: 0 0 6px; }
.iv-hint.sm { font-size: 0.8rem; color: var(--muted); }
.iv-input { margin-top: 20px; }
.iv-foot { position: sticky; bottom: 0; display: flex; gap: 10px; padding: 12px 16px calc(12px + var(--safe-b)); background: linear-gradient(to top, var(--bg) 70%, transparent); max-width: 640px; width: 100%; margin: 0 auto; }
.iv-foot .btn:last-child { flex: 1; }

.opts { display: grid; gap: 10px; }
.opt { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 15px 16px; border-radius: 15px; border: 1px solid var(--line-2); background: var(--card); font-size: 1.02rem; font-weight: 550; transition: all 0.14s; }
.opt:hover { border-color: rgba(255, 255, 255, 0.22); background: var(--card-2); }
.opt-key { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-size: 0.78rem; font-weight: 700; font-family: var(--mono); background: var(--card-3); color: var(--muted); flex: none; transition: all 0.14s; }
.opt.on { border-color: var(--brand-1); background: rgba(139, 123, 255, 0.13); box-shadow: inset 0 0 0 1px var(--brand-1), 0 10px 30px -14px rgba(139, 123, 255, 0.8); }
.opt.on .opt-key { background: var(--brand); color: #0a0a12; }
.chips { display: flex; flex-wrap: wrap; gap: 9px; }
.chip-opt { display: inline-flex; align-items: center; gap: 9px; padding: 12px 15px; border-radius: 13px; border: 1px solid var(--line-2); background: var(--card); font-size: 0.95rem; font-weight: 550; text-align: left; transition: all 0.14s; }
.chip-opt i { width: 18px; height: 18px; border-radius: 6px; border: 1.5px solid var(--muted); flex: none; position: relative; transition: all 0.14s; }
.chip-opt.on { border-color: var(--brand-2); background: rgba(45, 212, 191, 0.1); }
.chip-opt.on i { background: var(--brand-2); border-color: var(--brand-2); }
.chip-opt.on i::after { content: ''; position: absolute; left: 5px; top: 1px; width: 5px; height: 10px; border: solid #062; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.sc { aspect-ratio: 1; max-height: 78px; border-radius: 16px; border: 1px solid var(--line-2); background: var(--card); font-size: 1.5rem; font-weight: 800; transition: all 0.14s; }
.sc:hover { background: var(--card-2); }
.sc.on { background: var(--brand); color: #0a0a12; border-color: transparent; transform: translateY(-2px); box-shadow: 0 12px 30px -12px rgba(139, 123, 255, 0.9); }
.scale-l { display: flex; justify-content: space-between; margin-top: 8px; font-size: 0.8rem; color: var(--muted); }
.big-input { width: 100%; background: var(--card); border: 1px solid var(--line-2); border-radius: 14px; padding: 15px 16px; font-size: 1.05rem; outline: none; resize: vertical; }
.contact-fields { display: grid; gap: 10px; }
.pitch-card { --c: var(--brand-1); position: relative; padding: 22px; border-radius: 18px; background: linear-gradient(var(--card), var(--card)) padding-box, var(--brand) border-box; border: 1.5px solid transparent; box-shadow: 0 20px 50px -24px rgba(139, 123, 255, 0.7); }
.pitch-card p { font-size: 1.12rem; line-height: 1.55; margin: 10px 0 0; font-weight: 500; }
.pitch-tag { font-size: 0.74rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #cbc4ff; }
.pitch-card.sm { background: var(--bg-2); border: 1px solid var(--line); border-left: 3px solid var(--c); box-shadow: none; padding: 16px; }
.pitch-card.sm p { font-size: 0.95rem; }
.pitches { display: grid; gap: 10px; }

.big-choices { display: grid; gap: 12px; margin-top: 22px; }
.big-choice { display: flex; align-items: center; gap: 16px; padding: 20px 18px; border-radius: 18px; border: 1px solid var(--line-2); background: linear-gradient(90deg, color-mix(in srgb, var(--c) 10%, transparent), transparent 60%), var(--card); text-align: left; transition: all 0.15s; }
.big-choice:hover { border-color: color-mix(in srgb, var(--c) 60%, transparent); transform: translateY(-1px); }
.big-choice b { display: block; font-size: 1.12rem; }
.big-choice small { color: var(--muted); font-size: 0.84rem; }
.bc-emoji { font-size: 1.7rem; width: 54px; height: 54px; display: grid; place-items: center; border-radius: 15px; background: color-mix(in srgb, var(--c) 18%, var(--card-2)); flex: none; }
.big-choice .arrow { margin-left: auto; color: var(--muted); font-size: 1.2rem; }
.sector-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
.sector-btn { display: grid; gap: 8px; justify-items: start; text-align: left; padding: 16px; border-radius: 16px; border: 1px solid var(--line-2); background: var(--card); font-weight: 650; font-size: 0.95rem; transition: all 0.14s; }
.sector-btn span { font-size: 1.6rem; }
.sector-btn:hover { border-color: var(--brand-1); background: var(--card-2); }

.review { display: grid; gap: 2px; margin-top: 14px; border: 1px solid var(--line); border-radius: 15px; overflow: hidden; background: var(--card); }
.rv-row { display: grid; gap: 3px; padding: 12px 14px; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: transparent; width: 100%; }
.rv-row:last-child { border-bottom: 0; }
button.rv-row:hover { background: rgba(255, 255, 255, 0.03); }
.rv-q { font-size: 0.78rem; color: var(--muted); }
.rv-a { font-size: 0.95rem; font-weight: 600; white-space: pre-wrap; word-break: break-word; }
.rv-a.none { color: #50525d; font-weight: 400; }
.review.static { max-height: 60vh; overflow: auto; }

.done { text-align: center; padding-top: 7vh; }
.done-check { width: 96px; height: 96px; margin: 0 auto 20px; }
.done-check svg { width: 100%; height: 100%; }
.done-check circle { fill: rgba(12, 163, 12, 0.12); stroke: var(--good); stroke-width: 2; stroke-dasharray: 160; stroke-dashoffset: 160; animation: draw 0.6s ease forwards; }
.done-check path { fill: none; stroke: var(--good-t); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw 0.4s 0.45s ease forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.done-actions { display: grid; gap: 10px; margin-top: 28px; }

/* ---------- dashboard ---------- */
.dash { display: grid; gap: 14px; }
.dash-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); animation: pulse 2s infinite; }
.filters { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; position: sticky; top: calc(57px + var(--safe-t)); z-index: 20; padding: 10px 0; background: linear-gradient(var(--bg) 75%, transparent); }
.fchips { display: flex; gap: 6px; flex-wrap: wrap; }
.fchip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 99px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.025); font-size: 0.84rem; font-weight: 600; color: var(--text-2); }
.fchip i { width: 8px; height: 8px; border-radius: 50%; }
.fchip.on { background: var(--text); color: #0a0a12; border-color: var(--text); }
.fselects { display: flex; gap: 6px; flex-wrap: wrap; }
.fselects select { width: auto; padding: 7px 12px; border-radius: 99px; font-size: 0.84rem; background: var(--card); }

.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.tile.hero { grid-column: 1 / -1; padding: 18px 20px; background: radial-gradient(ellipse at 100% 0%, rgba(139, 123, 255, 0.2), transparent 55%), radial-gradient(ellipse at 0% 100%, rgba(45, 212, 191, 0.1), transparent 60%), var(--card); }
.t-hero { font-size: 3.4rem; font-weight: 800; letter-spacing: -0.045em; line-height: 1; margin: 4px 0 6px; }
@media (min-width: 760px) { .kpis { grid-template-columns: repeat(4, 1fr); } .tile.hero { grid-column: span 2; grid-row: span 2; align-content: center; } }
@media (min-width: 1100px) { .kpis { grid-template-columns: 2fr repeat(3, 1fr); } .tile.hero { grid-column: 1; } }

.verdict { border-radius: 20px; padding: 18px; border: 1px solid var(--line); background: linear-gradient(180deg, rgba(139, 123, 255, 0.07), transparent 140px), var(--card); }
.verdict-h { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.verdict-h h2 { font-size: 1.3rem; margin-top: 4px; }
.verdict-bar { display: flex; gap: 4px; }
.verdict-bar i { width: 26px; height: 8px; border-radius: 99px; background: #3a3c46; }
.verdict-bar i.st-good { background: var(--good); }
.verdict-bar i.st-warning { background: var(--warning); }
.verdict-bar i.st-critical { background: var(--critical); }
.hyps { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.hyp { display: grid; gap: 4px; align-content: start; padding: 15px; border-radius: 15px; border: 1px solid var(--line); background: var(--bg-2); position: relative; overflow: hidden; }
.hyp::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: #3a3c46; }
.hyp.st-good::before { background: var(--good); }
.hyp.st-warning::before { background: var(--warning); }
.hyp.st-critical::before { background: var(--critical); }
.hyp-top { display: flex; justify-content: space-between; align-items: center; }
.hyp-id { font-family: var(--mono); font-size: 0.75rem; font-weight: 700; color: var(--muted); }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 0.74rem; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: #23242c; color: var(--text-2); }
.status b { font-size: 0.8rem; }
.st-good .status { background: rgba(12, 163, 12, 0.16); color: var(--good-t); }
.st-warning .status { background: rgba(250, 178, 25, 0.14); color: var(--warning); }
.st-critical .status { background: rgba(208, 59, 59, 0.16); color: var(--critical-t); }
.hyp-val { font-size: 2rem; font-weight: 800; letter-spacing: -0.04em; margin-top: 6px; }
.hyp-val small { font-size: 0.5em; color: var(--muted); }
.hyp-label { font-size: 0.84rem; color: var(--text-2); line-height: 1.35; min-height: 2.6em; }
.hyp-n { font-size: 0.72rem; color: var(--muted); margin-top: 6px; }

.dgrid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .dgrid { grid-template-columns: 1fr 1fr; } .span-2 { grid-column: 1 / -1; } }
@media (min-width: 1240px) { .dgrid { grid-template-columns: 1fr 1fr 1fr; } .dgrid .span-2 { grid-column: span 2; } .dgrid .span-2:has(.quotes), .dgrid .span-2:has(.tbl), .dgrid .span-2:has(.ex-seg), .dgrid .span-2:has(.feed) { grid-column: 1 / -1; } }
.dcard { display: flex; flex-direction: column; }
.dbody { flex: 1; min-width: 0; }
.map { height: 380px; border-radius: 12px; overflow: hidden; background: #0d0e12; border: 1px solid var(--line); }
.leaflet-container { background: #0d0e12; font-family: var(--font); }
.leaflet-tooltip { background: #1c1d24; color: var(--text); border: 1px solid var(--line-2); border-radius: 8px; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5); }
.leaflet-tooltip-top::before { border-top-color: #1c1d24; }
.leaflet-bar a { background: var(--card-2); color: var(--text); border-color: var(--line-2); }
.leaflet-control-attribution { background: rgba(10, 10, 14, 0.7) !important; color: var(--muted) !important; }
.leaflet-control-attribution a { color: var(--text-2) !important; }

.quotes { columns: 280px; column-gap: 12px; }
.quote { break-inside: avoid; margin: 0 0 12px; padding: 16px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--line); border-left: 3px solid var(--c); }
.quote blockquote { margin: 0; font-size: 0.98rem; line-height: 1.5; font-weight: 500; }
.quote blockquote::before { content: '« '; color: var(--muted); }
.quote blockquote::after { content: ' »'; color: var(--muted); }
.quote figcaption { margin-top: 10px; font-size: 0.75rem; color: var(--muted); }

.table-wrap { overflow-x: auto; margin: 0 -4px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 0.86rem; min-width: 640px; }
.tbl th { text-align: left; font-size: 0.72rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; padding: 8px 10px; border-bottom: 1px solid var(--line-2); }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl td.num { font-variant-numeric: tabular-nums; }
.tbl tr:hover td { background: rgba(255, 255, 255, 0.02); }

.ex-seg { border: 1px solid var(--line); border-radius: 14px; margin-bottom: 10px; background: var(--bg-2); }
.ex-seg summary { cursor: pointer; padding: 13px 16px; font-weight: 650; display: flex; align-items: center; gap: 9px; list-style: none; }
.ex-seg summary::-webkit-details-marker { display: none; }
.ex-seg summary::after { content: '⌄'; margin-left: auto; color: var(--muted); transition: transform 0.15s; }
.ex-seg[open] summary::after { transform: rotate(180deg); }
.ex-seg summary i { width: 9px; height: 9px; border-radius: 50%; }
.ex-grid { display: grid; gap: 12px; padding: 0 14px 14px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.ex-item { padding: 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); min-width: 0; }
.ex-q { font-size: 0.86rem; font-weight: 600; margin-bottom: 12px; }
.ex-q em { font-style: normal; color: var(--muted); font-weight: 500; font-size: 0.75rem; margin-left: 6px; }
.texts { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 0.85rem; color: var(--text-2); }

/* ---------- graphiques ---------- */
.ch-empty { display: grid; place-items: center; gap: 6px; padding: 26px 10px; color: var(--muted); font-size: 0.84rem; text-align: center; border: 1px dashed var(--line-2); border-radius: 12px; }
.ch-empty span { font-size: 1.3rem; opacity: 0.5; }
.ch-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 12px; }
.ch-key { display: inline-flex; align-items: center; gap: 6px; font-size: 0.76rem; color: var(--text-2); }
.ch-key i { width: 10px; height: 10px; border-radius: 3px; }

.hb { display: grid; gap: 11px; }
.hb-row { display: grid; gap: 4px; }
.hb-label { font-size: 0.82rem; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-line { display: flex; align-items: center; gap: 10px; }
.hb-track { flex: 1; height: 10px; }
.hb-bar { height: 100%; border-radius: 0 4px 4px 0; transition: width 0.5s cubic-bezier(.2, .8, .2, 1); }
.hb-row:hover .hb-bar { filter: brightness(1.2); }
.hb-val { min-width: 62px; text-align: right; font-size: 0.84rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.hb-val em { font-style: normal; color: var(--muted); font-weight: 500; font-size: 0.74rem; margin-left: 6px; }

.st { display: grid; gap: 12px; }
.st-head { display: flex; justify-content: space-between; font-size: 0.82rem; color: var(--text-2); margin-bottom: 5px; }
.st-head em { font-style: normal; color: var(--muted); font-size: 0.74rem; }
.st-bar { display: flex; gap: 2px; height: 22px; }
.st-seg { display: grid; place-items: center; min-width: 3px; font-size: 0.7rem; font-weight: 700; overflow: visible; white-space: nowrap; }
.st-seg:first-child { border-radius: 4px 0 0 4px; }
.st-seg:last-child { border-radius: 0 4px 4px 0; }
.st-seg:only-child { border-radius: 4px; }
.st-seg:hover { filter: brightness(1.15); }

.cc { --h: 170px; }
.cc-area { position: relative; height: var(--h); margin-left: 34px; border-bottom: 1px solid var(--axis); }
.cc-gl { position: absolute; left: 0; right: 0; border-top: 1px solid var(--grid); }
.cc-gl span { position: absolute; right: calc(100% + 8px); top: -8px; font-size: 0.7rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cc-gl:first-child { border-top-color: transparent; }
.cc-plot { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: 2px; }
.cc-slot { flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; min-width: 0; }
.cc-slot:hover { background: rgba(255, 255, 255, 0.03); }
.cc-stack { width: min(24px, 70%); display: flex; flex-direction: column-reverse; gap: 2px; }
.cc-seg { min-height: 2px; }
.cc-stack .cc-seg:last-child { border-radius: 4px 4px 0 0; }
.cc-group { display: flex; align-items: flex-end; gap: 2px; height: 100%; width: 100%; justify-content: center; }
.cc-bar { position: relative; width: min(24px, 40%); border-radius: 4px 4px 0 0; min-height: 0; transition: height 0.5s cubic-bezier(.2, .8, .2, 1); }
.cc-bar b { position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); font-size: 0.7rem; font-weight: 700; color: var(--text-2); white-space: nowrap; }
.cc-x { display: flex; gap: 2px; margin-left: 34px; margin-top: 6px; }
.cc-x span { flex: 1; text-align: center; font-size: 0.68rem; color: var(--muted); white-space: nowrap; overflow: visible; min-width: 0; }

#tip { position: fixed; z-index: 1000; pointer-events: none; max-width: 260px; padding: 8px 11px; border-radius: 10px; background: #1f2029; border: 1px solid var(--line-2); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55); font-size: 0.8rem; line-height: 1.4; white-space: pre-line; color: var(--text); }

/* ---------- guide ---------- */
.guide { display: grid; gap: 14px; }
.guide-hero { padding: 6px 2px 4px; }
.guide-hero .lead { margin: 10px 0 0; max-width: none; }
.guide h3 { margin-bottom: 12px; font-size: 1.02rem; }
.roles { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.roles div, .where div { display: grid; gap: 4px; padding: 13px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); }
.roles span, .where span { font-size: 0.85rem; color: var(--text-2); }
.where { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.where span b { color: var(--text); }
.rules { margin: 0; padding-left: 20px; display: grid; gap: 9px; color: var(--text-2); }
.rules b { color: var(--text); }
.hooks { margin: 0; padding-left: 20px; display: grid; gap: 9px; color: var(--text-2); }

/* ---------- éditeur ---------- */
.editor { display: grid; gap: 14px; padding-bottom: 60px; }
.q-list { display: grid; gap: 6px; }
.q-row { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-2); flex-wrap: wrap; }
.q-row.sector-ph { border-style: dashed; border-color: rgba(45, 212, 191, 0.45); background: rgba(45, 212, 191, 0.05); }
.q-type { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); width: 120px; flex: none; }
.q-main { display: grid; flex: 1; min-width: 200px; }
.q-main b { font-size: 0.9rem; font-weight: 600; }
.q-actions { display: flex; gap: 4px; }
.sector-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin: 14px 0 10px; }
.savebar { position: fixed; left: 50%; bottom: calc(80px + var(--safe-b)); transform: translate(-50%, 140%); opacity: 0; z-index: 60; display: flex; align-items: center; gap: 14px; padding: 10px 10px 10px 18px; border-radius: 16px; background: #1c1d24; border: 1px solid rgba(250, 178, 25, 0.4); box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6); transition: all 0.25s cubic-bezier(.2, .8, .2, 1); font-size: 0.88rem; font-weight: 600; width: max-content; max-width: calc(100% - 32px); flex-wrap: wrap; }
.savebar.show { transform: translate(-50%, 0); opacity: 1; }
@media (min-width: 900px) { .savebar { bottom: 24px; } }

/* ---------- modal & toasts ---------- */
.modal-bg { position: fixed; inset: 0; z-index: 200; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(6px); display: flex; align-items: flex-end; justify-content: center; animation: fade 0.15s; }
.modal { width: 100%; max-width: 520px; max-height: 92vh; overflow: auto; background: var(--card); border: 1px solid var(--line-2); border-radius: 22px 22px 0 0; padding: 20px 18px calc(20px + var(--safe-b)); animation: up 0.25s cubic-bezier(.2, .8, .2, 1); }
.modal.wide { max-width: 680px; }
.modal-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.modal-foot { margin-top: 16px; display: flex; justify-content: flex-end; }
@media (min-width: 640px) { .modal-bg { align-items: center; } .modal { border-radius: 22px; } }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
#toasts { position: fixed; top: calc(14px + var(--safe-t)); left: 50%; transform: translateX(-50%); z-index: 300; display: grid; gap: 8px; width: max-content; max-width: calc(100% - 32px); pointer-events: none; }
.toast { padding: 11px 16px; border-radius: 13px; background: #1f2029; border: 1px solid var(--line-2); box-shadow: 0 14px 40px rgba(0, 0, 0, 0.6); font-size: 0.88rem; font-weight: 600; animation: drop 0.25s cubic-bezier(.2, .8, .2, 1); transition: opacity 0.3s, transform 0.3s; text-align: center; }
.toast.err { border-color: rgba(208, 59, 59, 0.6); color: #ffc4c4; }
.toast.warn { border-color: rgba(250, 178, 25, 0.5); }
.toast.out { opacity: 0; transform: translateY(-8px); }
@keyframes drop { from { transform: translateY(-12px); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.splash { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 14px; color: var(--muted); font-weight: 600; }
.splash .logo { width: 56px; height: 56px; animation: pulse-logo 1.4s ease-in-out infinite; }
@keyframes pulse-logo { 50% { transform: scale(0.88); opacity: 0.6; } }
.dark-tiles { filter: invert(1) hue-rotate(180deg) brightness(0.85) contrast(0.9) saturate(0.4); }

/* =================== v2 : onboarding, équipes, course, express =================== */
.landing-inner { text-align: left; }
.ob-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin-bottom: 26px; }
.ob-top .brand-lg { margin: 0; justify-self: center; }
.ob-back { justify-self: start; }
.ob-dots { justify-self: end; display: flex; gap: 5px; }
.ob-dots i { width: 18px; height: 5px; border-radius: 99px; background: #2a2b33; transition: background 0.2s; }
.ob-dots i.on { background: var(--brand); }
.ob-body { animation: rise 0.3s cubic-bezier(.2, .8, .2, 1); }
.ob-h { font-size: clamp(2rem, 7vw, 2.8rem); line-height: 1.05; letter-spacing: -0.04em; text-align: center; }
.ob-body .lead { text-align: center; margin: 12px auto 30px; }
.ob-q { font-size: 1.45rem; font-weight: 750; letter-spacing: -0.025em; margin: 6px 0 14px; }
.ob-tag { margin-bottom: 8px; }
.ob-body .big-choices { margin-top: 0; }
.ob-body .form { margin-top: 6px; }
.link-btn { display: block; width: 100%; margin-top: 18px; padding: 12px; border: 0; background: none; color: var(--muted); font-size: 0.88rem; font-weight: 600; text-align: center; border-radius: 12px; }
.link-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.03); }
.pole-pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 99px; font-size: 0.74rem; font-weight: 700; background: color-mix(in srgb, var(--c) 16%, transparent); border: 1px solid color-mix(in srgb, var(--c) 42%, transparent); color: var(--text); white-space: nowrap; }
.pole-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pole-row .pole span { text-align: center; padding: 11px 6px; font-weight: 650; font-size: 0.88rem; }
.code-row { display: flex; gap: 8px; }
.code-row .code-input { flex: 1; min-width: 0; }
.code-input.sm { font-size: 1.3rem !important; padding: 11px !important; }
.scan-btn { font-size: 1.3rem; padding: 0 16px; border-radius: 12px; }
.preview-card { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 13px; text-align: left; background: rgba(45, 212, 191, 0.07); border: 1px solid rgba(45, 212, 191, 0.35); }
.preview-card > span:first-child { font-size: 1.4rem; }
.preview-card div { display: grid; flex: 1; min-width: 0; }
.preview-card small { color: var(--muted); }
.preview { margin-top: 0; }
.inline-join { margin-top: 12px; }

.scan { position: relative; border-radius: 16px; overflow: hidden; background: #000; aspect-ratio: 1; max-height: 60vh; margin: 0 auto 12px; }
.scan video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-frame { position: absolute; inset: 18%; border-radius: 18px; box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.45); border: 2px solid rgba(255, 255, 255, 0.85); }

.invite { display: flex; justify-content: space-between; gap: 18px; align-items: center; flex-wrap: wrap; background: none; }
.inv-main { flex: 1; min-width: 220px; }
.invite.big { flex-direction: column; text-align: center; }
.invite.big .btn-row { justify-content: center; }
.invite.big .qr { order: -1; }
.welcome { text-align: center; padding-top: 10px; }
.welcome .done-check { margin-bottom: 12px; width: 72px; height: 72px; }
.welcome p { max-width: 46ch; margin: 8px auto 0; }

.team-card { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.team-card .av-stack { margin-top: 6px; }
.stat-row.four { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 700px) { .stat-row.four { grid-template-columns: repeat(4, 1fr); } }
.members { display: grid; gap: 2px; }

.race { display: grid; gap: 6px; }
.race-row { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg-2); }
.race-row.mine { border-color: rgba(139, 123, 255, 0.5); background: rgba(139, 123, 255, 0.06); }
.race.compact .race-row { padding: 9px 10px; }
.rank { width: 30px; text-align: center; font-size: 1.25rem; font-weight: 800; color: var(--muted); flex: none; }
.race-main { flex: 1; min-width: 0; display: grid; gap: 7px; }
.race-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.race-name b { font-size: 0.95rem; }
.you { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: #c8c0ff; }
.race-bar { display: flex; gap: 2px; height: 10px; }
.race-bar > div:first-child { border-radius: 4px 0 0 4px; }
.race-bar > div:not(.rest):nth-last-child(2) { border-radius: 0 4px 4px 0; }
.race-bar > div:only-child { border-radius: 4px; }
.race-bar .rest { background: transparent; }
.race-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 0.76rem; color: var(--text-2); align-items: center; }
.race-meta .av-stack { margin: 0; }
.race-n { display: grid; text-align: right; font-size: 1.5rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1; flex: none; }
.race-n small { font-size: 0.62rem; font-weight: 600; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; margin-top: 3px; }

.mode-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 16px 0 4px; }
.mode-switch button { display: grid; gap: 2px; text-align: left; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--card); }
.mode-switch button small { color: var(--muted); font-size: 0.76rem; }
.mode-switch button.on { border-color: var(--brand-1); background: rgba(139, 123, 255, 0.12); box-shadow: inset 0 0 0 1px var(--brand-1); }
.iv-timer { padding: 4px 10px; border-radius: 99px; border: 1px solid var(--line-2); transition: all 0.3s; }
.iv-timer.t-ok { color: var(--good-t); border-color: rgba(12, 163, 12, 0.4); background: rgba(12, 163, 12, 0.08); }
.iv-timer.t-warn { color: var(--warning); border-color: rgba(250, 178, 25, 0.5); background: rgba(250, 178, 25, 0.1); }
.iv-timer.t-late { color: var(--critical-t); border-color: rgba(208, 59, 59, 0.6); background: rgba(208, 59, 59, 0.12); animation: blink 1.6s infinite; }
@keyframes blink { 50% { opacity: 0.55; } }
.review { margin-top: 18px; }

.mini-btn { margin-left: auto; border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.03); color: var(--muted); border-radius: 8px; font-size: 0.7rem; padding: 2px 8px; }
.mini-btn:hover { color: var(--text); }
.sep { height: 1px; background: var(--line); margin: 16px 0; }
.race-card .card-h { margin-bottom: 12px; }
.hm { border-collapse: separate; border-spacing: 2px; width: 100%; font-size: 0.82rem; }
.hm th { font-weight: 600; color: var(--muted); font-size: 0.85rem; padding: 4px 6px; text-align: center; }
.hm tbody th { text-align: left; color: var(--text-2); white-space: nowrap; font-size: 0.8rem; }
.hm td { text-align: center; padding: 8px 4px; border-radius: 4px; font-weight: 700; min-width: 34px; font-variant-numeric: tabular-nums; }
.hm td.hm-0 { background: #17181d; color: #3a3c46; font-weight: 400; }
.tag.perso { background: rgba(139, 123, 255, 0.16); color: #cbc4ff; }
.xp { margin-right: 6px; }
.big-choices.tight { margin-top: 4px; gap: 8px; }
.big-choices.tight .big-choice { padding: 14px 16px; }
.big-choices.tight .bc-emoji { width: 44px; height: 44px; font-size: 1.4rem; }
.toast { display: flex; align-items: center; gap: 14px; pointer-events: auto; }
.toast button { border: 0; background: rgba(139, 123, 255, 0.2); color: #d4ceff; font-weight: 700; padding: 5px 11px; border-radius: 9px; font-size: 0.82rem; }
@media (min-width: 1100px) { .kpis { grid-template-columns: 2fr repeat(4, 1fr); } .tile.hero { grid-column: 1; grid-row: span 2; } }

/* =================== v3 : verdict lisible + sur quoi miser =================== */
.focus { border-radius: 20px; padding: 18px; border: 1px solid rgba(139, 123, 255, 0.35); background: radial-gradient(ellipse at 0% 0%, rgba(139, 123, 255, 0.16), transparent 55%), radial-gradient(ellipse at 100% 100%, rgba(45, 212, 191, 0.1), transparent 55%), var(--card); margin-bottom: 14px; }
.focus h2 { font-size: 1.45rem; margin-top: 4px; }
.focus p { margin: 4px 0 0; }
.pillars { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .pillars { grid-template-columns: repeat(3, 1fr); } }
.pillar { display: grid; gap: 6px; padding: 16px; border-radius: 16px; background: var(--bg-2); border: 1px solid var(--line); }
.pillar.top { border-color: rgba(139, 123, 255, 0.7); box-shadow: 0 0 0 1px rgba(139, 123, 255, 0.4), 0 18px 40px -20px rgba(139, 123, 255, 0.8); }
.pl-head { display: flex; align-items: center; gap: 8px; font-size: 1rem; }
.pl-emoji { font-size: 1.3rem; }
.pl-badge { margin-left: auto; font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; padding: 3px 9px; border-radius: 99px; background: var(--brand); color: #0a0a12; }
.pl-rank { margin-left: auto; font-family: var(--mono); font-size: 0.8rem; color: var(--muted); font-weight: 700; }
.pl-val { font-size: 2.6rem; font-weight: 800; letter-spacing: -0.04em; line-height: 1; }
.pl-sub { font-size: 0.78rem; color: var(--muted); line-height: 1.45; }
.meter.plain > div { background: #6b6f80; }

.hyps { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.hyp { gap: 8px; padding: 16px 16px 14px 18px; }
.hyp-q { margin: 2px 0 0; font-size: 1.02rem; font-weight: 700; line-height: 1.3; letter-spacing: -0.01em; color: var(--text); }
.hyp-ans { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.hyp-ans .hyp-val { font-size: 2.3rem; margin: 0; line-height: 1; }
.hyp-ans .hyp-label { min-height: 0; font-size: 0.86rem; flex: 1; min-width: 140px; }
.hyp-meter { position: relative; padding-bottom: 16px; }
.hyp-goal { position: absolute; bottom: 0; transform: translateX(-50%); font-size: 0.68rem; color: var(--muted); white-space: nowrap; }
.hyp-n { margin-top: 0; }
.hyp-break { display: grid; gap: 6px; padding: 10px 12px; border-radius: 11px; background: rgba(255, 255, 255, 0.025); border: 1px solid var(--line); }
.hb-mini { display: grid; grid-template-columns: 7.5em 1fr 2.2em; align-items: center; gap: 8px; font-size: 0.78rem; color: var(--text-2); }
.hb-mini b { text-align: right; color: var(--text); font-variant-numeric: tabular-nums; }
.mini-track { height: 6px; border-radius: 99px; background: #23242c; overflow: hidden; }
.mini-track div { height: 100%; border-radius: 0 4px 4px 0; }
.hb-line2 { display: flex; justify-content: space-between; gap: 10px; font-size: 0.78rem; color: var(--text-2); }
.hb-line2 b { color: var(--text); white-space: nowrap; }
@media (max-width: 700px) { .filters { position: static; } }
.full-tag { display: inline-block; font-size: 0.7rem; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: rgba(139, 123, 255, 0.14); color: #cbc4ff; }
.pl-sub b { color: var(--text-2); }
.dsections { display: grid; gap: 26px; }
.dsec { display: grid; gap: 12px; }
.dsec-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 4px 2px 8px; border-bottom: 1px solid var(--line); }
.dsec-h i { width: 10px; height: 10px; border-radius: 3px; }
.dsec-h h2 { font-size: 1.15rem; letter-spacing: -0.02em; }
.dsec-h span { font-size: 0.8rem; color: var(--muted); }
.warn-box { margin: 8px 0; padding: 9px 12px; border-radius: 11px; font-size: 0.8rem; background: rgba(250, 178, 25, 0.1); border: 1px solid rgba(250, 178, 25, 0.4); color: #ffd98a; }
