/* Cap ICNA — direction artistique « salle de contrôle » :
   écran radar au phosphore vert sur fond nuit, strips de vol (bandes de papier ambre) pour les séances,
   polices B612 / B612 Mono dessinées pour les cockpits. Navigation, bulle du bas et mouvements repris de Patrimoine. */
:root {
  --bg: #05090D; --bg-2: #08111A; --surface: #0C1620; --surface-2: #13212E; --surface-3: #1B2D3D;
  --border: rgba(140, 220, 190, 0.10); --border-2: rgba(140, 220, 190, 0.18);
  --text: #E6F1EC; --text-2: #93A9A1; --text-3: #5F766F;
  --radar: #5CF2A5; --radar-soft: rgba(92, 242, 165, 0.13); --radar-glow: rgba(92, 242, 165, 0.45);
  --accent: #F5B841; --accent-soft: rgba(245, 184, 65, 0.14); --on-accent: #1E1404;
  --late: #FF6B5E; --late-soft: rgba(255, 107, 94, 0.13);
  --strip: #F3E7C9; --strip-ink: #2B2414;
  --maths: #6FB7FF; --physique: #F5B841; --libre: #B79CFF; --general: #5CF2A5; --francais: #FF8FC7; --consolidation: #4FD8E8; --repos: #5F766F;
  --radius: 18px; --sidebar: 236px;
  --display: "B612", "Inter", sans-serif; --mono: "B612 Mono", ui-monospace, "SF Mono", Consolas, monospace;
  --body-font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #ECE8DE; --bg-2: #E4DFD2; --surface: #FBF8F1; --surface-2: #F0EBDF; --surface-3: #E2DBCB;
    --border: rgba(40, 50, 40, 0.11); --border-2: rgba(40, 50, 40, 0.2); --text: #15201B; --text-2: #55635C; --text-3: #85918A;
    --radar: #0F8A55; --radar-soft: rgba(15, 138, 85, 0.11); --radar-glow: rgba(15, 138, 85, 0.3);
    --accent: #B97A00; --accent-soft: rgba(185, 122, 0, 0.12); --on-accent: #FFF8EA; --late: #C8372B; --late-soft: rgba(200, 55, 43, 0.1);
    --strip: #FFF6DC; --maths: #2563C9; --physique: #B97A00; --libre: #6E4FD8; --general: #0F8A55; --francais: #C93A86; --consolidation: #0B8AA0;
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #ECE8DE; --bg-2: #E4DFD2; --surface: #FBF8F1; --surface-2: #F0EBDF; --surface-3: #E2DBCB;
  --border: rgba(40, 50, 40, 0.11); --border-2: rgba(40, 50, 40, 0.2); --text: #15201B; --text-2: #55635C; --text-3: #85918A;
  --radar: #0F8A55; --radar-soft: rgba(15, 138, 85, 0.11); --radar-glow: rgba(15, 138, 85, 0.3);
  --accent: #B97A00; --accent-soft: rgba(185, 122, 0, 0.12); --on-accent: #FFF8EA; --late: #C8372B; --late-soft: rgba(200, 55, 43, 0.1);
  --strip: #FFF6DC; --maths: #2563C9; --physique: #B97A00; --libre: #6E4FD8; --general: #0F8A55; --francais: #C93A86; --consolidation: #0B8AA0;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font-family: var(--body-font); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
body::before { /* lueur d'écran + grille de la salle de contrôle */
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(70% 55% at 85% -10%, var(--radar-soft), transparent 60%),
    radial-gradient(50% 40% at 0% 110%, var(--accent-soft), transparent 60%),
    linear-gradient(var(--border) 1px, transparent 1px) 0 0 / 100% 48px,
    linear-gradient(90deg, var(--border) 1px, transparent 1px) 0 0 / 48px 100%;
  mask-image: radial-gradient(120% 90% at 60% 20%, #000 30%, transparent 85%);
  -webkit-mask-image: radial-gradient(120% 90% at 60% 20%, #000 30%, transparent 85%);
  opacity: .55;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--text-2); }
.small { font-size: 12.5px; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.link { color: var(--accent); font-weight: 600; }
h1, h2, h3, h4 { margin: 0; }
h1 { font-family: var(--display); font-weight: 700; font-size: clamp(28px, 3.2vw, 44px); letter-spacing: -.02em; line-height: 1.05; }
h2 { font-family: var(--display); font-weight: 700; font-size: 15px; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 12px; }
h4 { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--text-3); margin: 18px 0 8px; font-weight: 400; }
.eyebrow { margin: 0 0 6px; font-family: var(--mono); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--radar); }
.eyebrow::before { content: '● '; animation: blink 2.4s steps(2) infinite; }
.lede { margin: 8px 0 0; color: var(--text-2); font-size: 15px; max-width: 62ch; }
@keyframes blink { 50% { opacity: .25; } }

/* ── Barre latérale (ordinateur) / capsule du bas (téléphone) ── */
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); z-index: 40; display: flex; flex-direction: column; gap: 18px; padding: 22px 14px;
  background: color-mix(in srgb, var(--surface) 72%, transparent); border-right: 1px solid var(--border); backdrop-filter: blur(26px) saturate(170%); -webkit-backdrop-filter: blur(26px) saturate(170%); }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px; }
.brand img { width: 40px; height: 40px; border-radius: 11px; box-shadow: 0 0 0 1px var(--border-2), 0 0 22px -6px var(--radar-glow); }
.brand span { display: flex; flex-direction: column; line-height: 1.15; }
.brand b { font-family: var(--display); font-size: 17px; }
.brand small { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
.side-search { display: flex; align-items: center; gap: 9px; padding: 9px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); font-size: 13px; }
.side-search svg { width: 16px; height: 16px; fill: currentColor; }
.side-search kbd { margin-left: auto; font-family: var(--mono); font-size: 10px; padding: 2px 6px; border-radius: 5px; border: 1px solid var(--border-2); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 12px; color: var(--text-2); font-weight: 500; transition: background-color .2s, color .2s; }
.nav a svg { width: 19px; height: 19px; fill: currentColor; flex: none; }
.nav a span { white-space: nowrap; }
@media (hover: hover) { .nav a:hover { background: var(--surface-2); color: var(--text); } }
.nav a.active { background: var(--radar-soft); color: var(--radar); font-weight: 600; box-shadow: inset 2px 0 0 var(--radar); }
.nav-label { margin: 14px 12px 4px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding: 0 8px; font-size: 12px; color: var(--text-3); }
.sidebar-foot .sync-b { align-self: flex-start; }
.main { margin-left: var(--sidebar); padding: 30px clamp(18px, 2.6vw, 44px) 64px; max-width: 1760px; }
.mob { display: none !important; }

/* ── Mise en page ── */
.page-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.head-act { display: flex; gap: 8px; align-items: center; }
.card { position: relative; background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 92%, var(--radar) 2%), var(--surface)); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; min-width: 0; box-shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 18px 40px -28px rgba(0, 0, 0, .6); }
.card-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.deck { display: grid; grid-template-columns: minmax(300px, 430px) minmax(0, 1fr); gap: 18px; margin-bottom: 18px; }
.deck-2 { grid-template-columns: minmax(260px, 380px) minmax(0, 1fr); }
.deck > .card, .cols3 > .card, .cols2 > .card { margin-bottom: 0; }
.cols3, .cols2 { display: grid; gap: 18px; margin-bottom: 18px; }
.cols3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.row.end { justify-content: flex-end; }
.empty { padding: 16px 0 6px; margin: 0; color: var(--text-3); font-style: italic; }
.group { margin: 26px 0 12px; display: flex; gap: 10px; align-items: baseline; }
.plain { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }

/* ── Boutons, puces, segments ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 0 16px; border-radius: 12px; background: var(--accent); color: var(--on-accent); font-weight: 600; white-space: nowrap; transition: transform .15s var(--ease), filter .2s; }
.btn:active { transform: scale(.96); }
.btn.sm { min-height: 32px; padding: 0 12px; font-size: 13px; background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn.ghost { background: transparent; color: var(--text-2); border: 1px solid var(--border); }
.btn.danger { color: var(--late); }
.btn.icon { width: 38px; padding: 0; font-size: 20px; }
.btn.icon.sm { width: 34px; font-size: 16px; }
.page-h .btn:not(.sm) { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.page-h .btn[data-act="print"] { background: var(--accent); color: var(--on-accent); border: 0; }
.nav-w { display: flex; gap: 6px; flex-wrap: wrap; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 18px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 6px 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); font-size: 13px; font-weight: 500; transition: all .2s; }
.chip.on { background: var(--radar-soft); color: var(--radar); border-color: color-mix(in srgb, var(--radar) 45%, transparent); }
.seg { display: inline-flex; flex-wrap: wrap; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 3px; gap: 2px; }
.seg button { padding: 6px 12px; border-radius: 9px; font-size: 13px; color: var(--text-2); font-weight: 500; transition: background .2s, color .2s; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 6px rgba(0, 0, 0, .3), inset 0 0 0 1px var(--border-2); }
.seg.big button { padding: 8px 16px; font-size: 14px; }
.search, input[type=date], .code, select, .note { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 7px 10px; min-height: 36px; }
.search { flex: 1 1 220px; min-width: 0; }
.code { flex: 1 1 260px; min-width: 0; font-family: var(--mono); font-size: 12px; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 600; background: color-mix(in srgb, var(--c, var(--text-3)) 16%, transparent); color: var(--c, var(--text-2)); white-space: nowrap; }
.tag.ghost { --c: var(--text-3); font-weight: 500; }
.m-maths { --c: var(--maths); } .m-physique { --c: var(--physique); } .m-libre { --c: var(--libre); } .m-general { --c: var(--general); }
.m-francais, .m-francais-anglais, .m-anglais { --c: var(--francais); } .m-consolidation, .m-maths-physique { --c: var(--consolidation); } .m-repos { --c: var(--repos); }

/* ── Scope radar ── */
.scope-card { display: flex; flex-direction: column; align-items: center; gap: 14px; background: radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--radar) 7%, var(--surface)), var(--surface) 70%); }
.scope { width: 100%; max-width: 400px; aspect-ratio: 1; color: var(--radar); overflow: visible; }
.sc-bg { fill: color-mix(in srgb, var(--bg) 70%, #000); stroke: var(--border-2); stroke-width: 1; }
.sc-ring { fill: none; stroke: currentColor; stroke-opacity: .2; stroke-width: .5; }
.sc-axis { fill: none; stroke: currentColor; stroke-opacity: .1; stroke-width: .4; stroke-dasharray: 1.5 2.5; }
.sc-tick line { stroke: currentColor; stroke-opacity: .35; stroke-width: .5; }
.sweep { transform-origin: 0 0; animation: sweep 6s linear infinite; }
.sw-line { stroke: currentColor; stroke-width: 1; stroke-opacity: .9; filter: drop-shadow(0 0 2px currentColor); }
@keyframes sweep { to { transform: rotate(360deg); } }
.blip circle { fill: var(--c); opacity: .3; }
.blip.on circle { opacity: .85; filter: drop-shadow(0 0 2.5px var(--c)); }
.blip { animation: echo 6s linear infinite; transform-box: fill-box; transform-origin: center; }
@keyframes echo { 0% { opacity: 1; transform: scale(1.7); } 12% { transform: scale(1); } 100% { opacity: .45; } }
.sc-core { fill: color-mix(in srgb, var(--bg) 80%, #000); stroke: currentColor; stroke-opacity: .5; stroke-width: .6; }
.sc-v { font-family: var(--mono); font-size: 10px; font-weight: 700; fill: var(--text); text-anchor: middle; }
.sc-l { font-family: var(--mono); font-size: 3.6px; letter-spacing: .12em; fill: var(--text-2); text-anchor: middle; }
.scope-leg { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: center; font-size: 12px; text-align: center; }
.scope-leg i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.lg-maths { background: var(--maths); box-shadow: 0 0 6px var(--maths); } .lg-physique { background: var(--physique); box-shadow: 0 0 6px var(--physique); }

/* ── ETA, indicateurs ── */
.eta-card { display: flex; flex-direction: column; gap: 22px; justify-content: space-between; }
.eta { display: grid; grid-template-columns: auto 1fr; align-items: end; column-gap: 12px; }
.eta .eyebrow { grid-column: 1 / -1; }
.eta strong { font-family: var(--mono); font-size: clamp(64px, 8vw, 112px); line-height: .9; color: var(--accent); letter-spacing: -.05em; text-shadow: 0 0 40px var(--accent-soft); }
.eta-u { font-family: var(--mono); font-size: 14px; color: var(--text-2); text-transform: uppercase; letter-spacing: .14em; padding-bottom: 10px; }
.eta > .muted { grid-column: 1 / -1; margin-top: 8px; }
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.kpis.k6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.kpi { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; background: var(--surface); }
.kpi strong { font-size: 28px; line-height: 1.1; font-weight: 700; }
.kpi small { font-size: 15px; color: var(--text-3); margin-left: 2px; }
.kpi span { font-size: 12px; color: var(--text-2); }
.kpi.warn strong { color: var(--late); } .kpi.good strong { color: var(--radar); }
.week-meter { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; font-size: 12.5px; color: var(--text-2); }
.bar { margin: 12px 0 14px; }
.bar-h { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.track { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, color-mix(in srgb, var(--radar) 55%, transparent), var(--radar)); box-shadow: 0 0 10px var(--radar-glow); transform-origin: left; }
.enter .track i { animation: grow 1.1s var(--ease) both; animation-delay: .2s; }
@keyframes grow { from { transform: scaleX(0); } }
.bar-s { font-size: 11.5px; margin-top: 4px; }

/* ── Feuille de route ── */
.legs { display: flex; gap: 6px; }
.leg { flex: var(--w) 1 0; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.leg-bar { height: 10px; border-radius: 4px; background: var(--surface-3); overflow: hidden; position: relative; }
.leg-bar i { position: absolute; inset: 0 auto 0 0; width: calc(var(--p) * 100%); background: var(--radar); box-shadow: 0 0 10px var(--radar-glow); }
.leg b { font-family: var(--mono); font-size: 12px; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.leg.cur .leg-bar { box-shadow: 0 0 0 2px var(--accent); }
.leg.cur b { color: var(--accent); }
.leg.cur b::after { content: '  ◄ vous êtes ici'; color: var(--text-3); }

/* ── Régularité ── */
.legend { display: flex; align-items: center; gap: 5px; font-size: 11.5px; flex-wrap: wrap; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-left: 6px; }
.hm { display: flex; gap: 3px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: thin; }
.hm-col { display: grid; grid-template-rows: 14px repeat(7, 13px); gap: 3px; }
.hm-col b { font-family: var(--mono); font-size: 9.5px; font-weight: 400; color: var(--text-3); white-space: nowrap; width: 13px; overflow: visible; }
.hm i { width: 13px; height: 13px; border-radius: 3px; display: block; }
.hm-x { background: transparent; } .hm-0 { background: var(--surface-3); }
.hm-late { background: var(--late-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--late) 45%, transparent); }
.hm-2 { background: color-mix(in srgb, var(--radar) 40%, var(--surface-3)); } .hm-4 { background: var(--radar); box-shadow: 0 0 6px -1px var(--radar-glow); }
.hm-today { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ── Strips de vol (séances) ── */
.strip { --c: var(--text-3); display: grid; grid-template-columns: 62px minmax(0, 1fr) auto; align-items: stretch; margin: 8px 0; border-radius: 6px; overflow: hidden;
  background: var(--strip); color: var(--strip-ink); box-shadow: 0 1px 0 rgba(0, 0, 0, .25), 0 6px 14px -10px rgba(0, 0, 0, .7); transition: transform .2s var(--ease), opacity .3s; }
.strip:hover { transform: translateX(2px); }
.strip-code { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 2px; padding: 8px 4px; background: var(--c); color: #0B0F0C; font-family: var(--mono); }
.strip-code b { font-size: 13px; letter-spacing: .04em; }
.strip-code span { font-size: 9.5px; opacity: .75; text-align: center; line-height: 1.1; }
.strip-b { padding: 8px 12px; min-width: 0; border-left: 1px dashed rgba(43, 36, 20, .25); }
.strip-h { font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: rgba(43, 36, 20, .6); }
.strip-h em { font-style: normal; color: #B3261E; font-weight: 700; }
.strip-t { font-size: 13.5px; font-weight: 500; overflow-wrap: anywhere; margin-top: 1px; }
.strip > .chk, .strip > .chk-ph { margin: auto 10px; }
.strip.done { opacity: .55; }
.strip.done .strip-t { text-decoration: line-through; text-decoration-color: rgba(43, 36, 20, .45); }
.strip.late { box-shadow: 0 0 0 2px var(--late), 0 6px 14px -10px rgba(0, 0, 0, .7); }
.chk { flex: none; width: 30px; height: 30px; border-radius: 8px; border: 2px solid rgba(43, 36, 20, .35); display: grid; place-items: center; transition: background .2s, border-color .2s, transform .25s var(--ease); }
.chk svg { width: 17px; height: 17px; fill: none; stroke: #062014; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 24; stroke-dashoffset: 24; transition: stroke-dashoffset .35s var(--ease) .05s; }
.chk:hover { border-color: #0F8A55; }
.chk.on { background: #2FD38A; border-color: #2FD38A; transform: scale(1.04); }
.chk.on svg { stroke-dashoffset: 0; }
.chk:active { transform: scale(.88); }
.chk-ph { width: 30px; flex: none; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 12px; }
.day { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px 10px; min-width: 0; }
.day.today { border-color: color-mix(in srgb, var(--accent) 60%, transparent); box-shadow: 0 0 0 3px var(--accent-soft); }
.day h3 { font-family: var(--mono); font-size: 12px; font-weight: 400; text-transform: uppercase; letter-spacing: .08em; margin: 0 2px 6px; display: flex; justify-content: space-between; gap: 6px; }
.day .strip { grid-template-columns: 1fr auto; }
.day .strip-code { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; padding: 4px 10px; }
.day .strip-b { border-left: 0; }
@media (max-width: 1400px) { .week { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .week { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ── Programme ── */
.chaps { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 520px), 1fr)); gap: 8px; align-items: start; }
.chap { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; transition: border-color .25s; }
.chap.open { border-color: color-mix(in srgb, var(--accent) 40%, transparent); grid-column: 1 / -1; }
.chap-h { display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 14px; text-align: left; }
.dot-st { width: 10px; height: 10px; border-radius: 50%; flex: none; border: 2px solid var(--text-3); }
.chap.ok .dot-st { background: var(--radar); border-color: var(--radar); box-shadow: 0 0 0 4px var(--radar-soft), 0 0 10px var(--radar-glow); }
.chap-n { flex: 1; min-width: 0; font-weight: 500; overflow-wrap: anywhere; }
.chap-m { display: flex; gap: 10px; align-items: center; font-size: 12px; flex: none; }
.lvl { display: inline-flex; gap: 3px; }
.lvl i { width: 6px; height: 14px; border-radius: 2px; background: var(--surface-3); }
.lvl.l1 i:nth-child(-n+1), .lvl.l2 i:nth-child(-n+2), .lvl.l3 i { background: var(--accent); box-shadow: 0 0 6px var(--accent-soft); }
.chap-b { padding: 2px 18px 18px 36px; animation: rise .35s var(--ease) both; }
.exo { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; cursor: pointer; }
.exo input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--radar); flex: none; }
.exo input:checked + span { color: var(--text-3); text-decoration: line-through; }
.sess-dates { display: flex; flex-wrap: wrap; gap: 6px; }
.sess-dates a { font-family: var(--mono); font-size: 11px; padding: 3px 8px; border-radius: 6px; background: var(--surface-2); color: var(--text-2); }
.sess-dates a.ok { background: var(--radar-soft); color: var(--radar); }
.sess-dates a.late { background: var(--late-soft); color: var(--late); }

/* ── Bibliothèque ── */
.ann-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); gap: 8px; }
.docs { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 8px; }
.ann { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; }
.ann.ok { border-color: color-mix(in srgb, var(--radar) 45%, transparent); box-shadow: inset 3px 0 0 var(--radar); }
.ann-b { display: flex; gap: 10px; align-items: center; min-width: 0; flex: 1 1 220px; }
.ann-t { font-weight: 500; overflow-wrap: anywhere; }
.ann-a { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.note { width: 74px; font-family: var(--mono); }
.doc { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; }
.chap-b .doc { background: var(--surface-2); }
.doc-ic { width: 40px; height: 48px; flex: none; border-radius: 6px 12px 6px 6px; background: var(--late-soft); color: var(--late); font-family: var(--mono); font-size: 11px; font-weight: 700; }
.doc-b { flex: 1; min-width: 0; }
.doc-t { font-weight: 600; text-align: left; overflow-wrap: anywhere; }
.drop { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 30px 16px; margin-bottom: 18px; border: 2px dashed var(--border-2); border-radius: var(--radius); text-align: center; cursor: pointer; transition: border-color .2s, background .2s; }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.sites { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.site { display: flex; flex-direction: column; gap: 6px; margin: 0; transition: border-color .2s, transform .2s var(--ease); }
.site:hover { border-color: color-mix(in srgb, var(--accent) 45%, transparent); transform: translateY(-2px); }
.chart svg { width: 100%; height: 150px; display: block; }
.chart h3 { font-size: 13px; margin-bottom: 6px; }
.grid-l { stroke: var(--border); } .ax { font-family: var(--mono); font-size: 10px; fill: var(--text-3); }
.ln { fill: none; stroke: var(--text-3); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.pt { fill: var(--c, var(--accent)); }

/* ── Galons ── */
.streak { display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.streak strong { font-family: var(--mono); font-size: 96px; line-height: .95; color: var(--accent); letter-spacing: -.05em; text-shadow: 0 0 40px var(--accent-soft); }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.badge { display: flex; gap: 14px; align-items: center; padding: 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); opacity: .75; }
.badge > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.badge b { font-size: 13.5px; }
.chev { width: 42px; height: 42px; flex: none; fill: var(--surface-3); }
.badge.ok { opacity: 1; border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: linear-gradient(135deg, var(--accent-soft), var(--surface) 60%); }
.badge.ok .chev { fill: var(--accent); filter: drop-shadow(0 0 6px var(--accent-soft)); }

/* ── Guide, récap ── */
.guide details { border-top: 1px solid var(--border); padding: 14px 0; }
.guide details:first-child { border-top: 0; }
.guide summary { cursor: pointer; font-weight: 600; font-size: 15px; }
.guide p { margin: 10px 0 0; color: var(--text-2); line-height: 1.7; max-width: 80ch; }
.tools { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tools .card { margin: 0; display: flex; flex-direction: column; gap: 2px; padding: 14px; }

/* ── Synchro, visionneuse, dialogues, toast, palier ── */
.sync-b { font-family: var(--mono); font-size: 11px; letter-spacing: .04em; padding: 6px 11px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); white-space: nowrap; }
.sync-b::before { content: '◉ '; }
.sync-b.s-ok { color: var(--radar); } .sync-b.s-syncing::before { animation: blink 1s steps(2) infinite; } .sync-b.s-error, .sync-b.s-unavailable { color: var(--late); }
.viewer { position: fixed; inset: 0; z-index: 80; background: var(--bg); display: flex; flex-direction: column; }
.viewer[hidden] { display: none; }
.viewer-h { display: flex; align-items: center; gap: 8px; padding: max(10px, env(safe-area-inset-top)) 14px 10px; border-bottom: 1px solid var(--border); }
.viewer-h h3 { flex: 1; min-width: 0; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer iframe { flex: 1; border: 0; width: 100%; background: #fff; }
dialog { border: 1px solid var(--border-2); border-radius: var(--radius); background: var(--surface); color: var(--text); padding: 22px; width: min(520px, calc(100vw - 32px)); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .7); }
dialog[open] { animation: pop .28s var(--ease); }
dialog::backdrop { background: rgba(2, 6, 9, .6); backdrop-filter: blur(4px); }
.frm { display: flex; flex-direction: column; gap: 12px; }
.frm h2 { font-size: 18px; text-transform: none; letter-spacing: 0; }
.frm label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--text-2); font-weight: 500; min-width: 0; }
.frm input:not([type=file]), .frm select { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 9px 10px; color: var(--text); width: 100%; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.palette { padding: 0; width: min(640px, calc(100vw - 24px)); margin-top: 12vh; overflow: hidden; }
.palette input { width: 100%; border: 0; border-bottom: 1px solid var(--border); background: transparent; padding: 18px 20px; font-size: 17px; outline: none; }
.pal-list { max-height: 55vh; overflow-y: auto; padding: 6px; }
.pal-list button { display: flex; flex-direction: column; align-items: flex-start; width: 100%; text-align: left; padding: 9px 14px; border-radius: 10px; }
.pal-list button:hover, .pal-list button:first-child { background: var(--surface-2); }
.pal-list span { font-family: var(--mono); font-size: 11px; color: var(--text-3); }
.pal-list p { padding: 14px; margin: 0; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 90; background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-weight: 500; transition: opacity .25s, transform .25s var(--ease); max-width: calc(100vw - 32px); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.milestone { position: fixed; left: 50%; top: max(18px, env(safe-area-inset-top)); z-index: 95; transform: translate(-50%, calc(-100% - 80px)); display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px 26px; border-radius: 18px;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 70%, #fff)); color: var(--on-accent); box-shadow: 0 20px 50px -14px var(--accent); pointer-events: none; text-align: center; }
.milestone b { font-family: var(--display); font-size: 18px; }
.milestone span { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; opacity: .8; }
.milestone.on { animation: drop 3.4s var(--ease) both; }
@keyframes drop { 0% { transform: translate(-50%, calc(-100% - 80px)); } 12%, 85% { transform: translate(-50%, 0); } 100% { transform: translate(-50%, calc(-100% - 80px)); } }

/* ── Écran d'ouverture ── */
.splash { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: #05090D; color: #5CF2A5; transition: opacity .6s, visibility .6s; }
.splash.out { opacity: 0; visibility: hidden; }
.splash-scope { position: relative; width: 120px; height: 120px; border-radius: 50%; border: 1px solid rgba(92, 242, 165, .4); overflow: hidden; }
.splash-scope i { position: absolute; inset: 0; margin: auto; border-radius: 50%; border: 1px solid rgba(92, 242, 165, .22); }
.splash-scope i:nth-child(1) { width: 30%; height: 30%; } .splash-scope i:nth-child(2) { width: 60%; height: 60%; } .splash-scope i:nth-child(3) { width: 1px; height: 100%; border: 0; background: rgba(92, 242, 165, .2); }
.splash-scope b { position: absolute; inset: 0; background: conic-gradient(from 0deg, transparent 0 300deg, rgba(92, 242, 165, .55) 360deg); animation: sweep 1.4s linear infinite; }
.splash p { margin: 0; font-family: "B612 Mono", monospace; font-size: 15px; letter-spacing: .4em; }
.splash small { font-family: "B612 Mono", monospace; font-size: 11px; opacity: .6; animation: blink 1s steps(2) infinite; }

/* ── Mouvement : apparition en cascade (motion.js de Patrimoine) ── */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(8px); } }
.enter :is(.page-h, .card, .day, .chap, .ann, .badge, .doc) { animation: rise .6s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms); }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .25s; }
html[data-anim="off"] *, html[data-anim="off"] *::before { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; transition: none !important; } }

/* ── Impression (récap) ── */
@media print {
  .sidebar, .no-print, .toast, .milestone, .splash { display: none !important; }
  .main { margin: 0; padding: 0; }
  body::before { display: none; }
  .card { break-inside: avoid; box-shadow: none; }
}

/* ── Écrans moyens ── */
@media (max-width: 1200px) { .cols3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kpis.k6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1020px) { .deck, .deck-2 { grid-template-columns: 1fr; } .scope { max-width: 340px; } }

/* ── Téléphone : capsule flottante en bas avec la bulle (Patrimoine) ── */
@media (max-width: 760px) {
  .mob { display: inline-flex !important; }
  nav.mob { display: grid !important; }
  .sidebar { inset: auto 12px max(8px, calc(env(safe-area-inset-bottom) - 16px)) 12px; width: auto; height: auto; padding: 5px; flex-direction: row; gap: 0;
    border: 1px solid var(--border-2); border-radius: 999px; background: color-mix(in srgb, var(--surface) 84%, transparent); box-shadow: 0 14px 34px -12px rgba(0, 0, 0, .7); overflow: visible; }
  .brand, .side-search, .sidebar-foot, .nav .desk { display: none !important; }
  .nav { flex-direction: row; justify-content: space-around; width: 100%; gap: 2px; align-items: stretch; position: relative; touch-action: none; }
  .nav > a { position: relative; z-index: 1; flex: 1; flex-direction: column; justify-content: center; gap: 3px; height: 54px; padding: 0; border-radius: 999px; box-shadow: none; }
  .nav > a svg { width: 21px; height: 21px; }
  .nav > a span { font-size: 10px; font-weight: 600; line-height: 1; }
  .nav a.active { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); }
  .nav.pill-on > a.active { background: transparent; box-shadow: none; }
  .nav-pill { display: block; position: absolute; left: 0; top: 0; z-index: 0; pointer-events: none; opacity: 0; border-radius: 999px; overflow: hidden;
    background: var(--radar-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--radar) 35%, transparent), 0 0 18px -6px var(--radar-glow); transform-origin: center; will-change: transform; }
  .nav.pill-on .nav-pill { opacity: 1; }
  .nav.pill-ready .nav-pill { transition: opacity .2s; }
  .nav.pill-lens .nav-pill { z-index: 2; box-shadow: inset 0 0 0 1px var(--border-2), 0 6px 18px -6px rgba(0, 0, 0, .5); background: var(--surface-2); }
  .nav-pill::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: calc(.65 + .35 * var(--pill-v, 0));
    background: radial-gradient(52% 34% at calc(36% + var(--pill-dir, 0) * 26%) 10%, rgba(255, 255, 255, .2), rgba(255, 255, 255, 0) 62%), radial-gradient(70% 30% at calc(62% - var(--pill-dir, 0) * 20%) 100%, rgba(255, 255, 255, .07), rgba(255, 255, 255, 0) 65%); }
  .nav-pill .nav-lens { position: absolute !important; left: 0; top: 0; margin: 0 !important; padding: 0 !important; display: flex; flex-direction: row; justify-content: space-around; gap: 2px; pointer-events: none; will-change: transform; visibility: hidden; }
  .nav.pill-lens .nav-pill .nav-lens { visibility: visible; }
  .nav-pill .nav-lens > a { position: static !important; display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: 54px; background: transparent !important; box-shadow: none !important; transition: none !important; color: var(--radar); }
  .nav-pill .nav-lens > :not(a) { display: none; }
  .nav:is(.pill-drag, .pill-follow) > a, .nav:is(.pill-drag, .pill-follow) .nav-lens > a { color: color-mix(in srgb, var(--radar), var(--text-2) calc(var(--pill-d, 1) * 100%)) !important; transition: none !important; }
  .nav a.active { color: var(--radar); }

  .main { margin-left: 0; padding: max(18px, env(safe-area-inset-top)) 14px 104px; }
  .page-h { margin-bottom: 16px; align-items: flex-start; }
  .page-h > div:first-child { flex: 1 1 100%; }
  .head-act { order: -1; width: 100%; justify-content: flex-end; margin-bottom: -4px; }
  .card { padding: 16px; border-radius: 16px; margin-bottom: 14px; }
  .cols3, .cols2 { grid-template-columns: 1fr; gap: 14px; margin-bottom: 14px; }
  .deck { gap: 14px; margin-bottom: 14px; }
  .scope { max-width: 300px; }
  .kpis, .kpis.k6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi { padding: 12px; } .kpi strong { font-size: 24px; }
  .eta strong { font-size: 76px; }
  .legs { flex-direction: column; gap: 12px; }
  .week { grid-template-columns: 1fr; }
  .chap-b { padding-left: 16px; }
  .chap-m .num:last-child:not(:first-child) { display: none; }
  .seg.big { width: 100%; } .seg.big button { flex: 1; }
  .tools { grid-template-columns: 1fr; }
  .toast { bottom: 96px; }
  .ann-list, .docs, .chaps { grid-template-columns: 1fr; }
  .streak strong { font-size: 76px; }
}
