/* Décoder la hype de l'IA — version Web
   Charte « Bauhaus » de l'app : bleu outremer, ambre, encre nuit et papier. Police Jost (proche de Futura). */

@font-face { font-family: Jost; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/jost-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Jost; font-style: normal; font-weight: 500; font-display: swap; src: url(../fonts/jost-latin-500-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Jost; font-style: normal; font-weight: 700; font-display: swap; src: url(../fonts/jost-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Jost; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/jost-latin-ext-400-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: Jost; font-style: normal; font-weight: 500; font-display: swap; src: url(../fonts/jost-latin-ext-500-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: Jost; font-style: normal; font-weight: 700; font-display: swap; src: url(../fonts/jost-latin-ext-700-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --blue: #2340D4; --amber: #F2A900; --ink: #0C1033; --paper: #F4F1EA;
  --bg: var(--paper); --surface: #FFFFFF; --surface-2: #ECE8DE; --text: var(--ink); --text-2: #4A4E6B; --text-3: #5F637D; --amber-text: #8F5F00;
  --accent: #2340D4; --line: rgba(12, 16, 51, .12); --red: #C42B1C; --dim: #AAB3E3;
  --radius: 14px; --reading: 720px; --bar-h: 56px; --tabs-h: 64px;
  --font: Jost, Futura, 'Futura PT', 'Century Gothic', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --fs: 17px; --lh: 1.55;
  --shadow: 0 1px 2px rgba(12, 16, 51, .06), 0 6px 18px rgba(12, 16, 51, .06);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0C1033; --surface: #161B47; --surface-2: #1D2357; --text: #FFFFFF; --text-2: #C9CBE0; --text-3: #A9ADCB; --amber-text: #F2A900;
  --accent: #8797FF; --line: rgba(255, 255, 255, .12); --red: #FF6B5E; --dim: #141E5C;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  color-scheme: dark;
}
:root.high-contrast { --text-2: var(--text); --text-3: var(--text); --line: currentColor; }
:root.high-contrast .card, :root.high-contrast .row, :root.high-contrast .group-body, :root.high-contrast .choice, :root.high-contrast .tile { border: 1.5px solid var(--text); }
:root[data-text-size="large"] { --fs: 19px; }
:root[data-text-size="xlarge"] { --fs: 21px; }
:root[data-text-size="xxlarge"] { --fs: 24px; }
:root.readable-font { --font: system-ui, -apple-system, 'Segoe UI', Roboto, Verdana, sans-serif; }
:root.extra-spacing { --lh: 1.85; }
:root.extra-spacing p, :root.extra-spacing li { letter-spacing: .012em; word-spacing: .06em; }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
[tabindex="-1"]:focus { outline: none; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 var(--fs)/var(--lh) var(--font); -webkit-font-smoothing: antialiased; }
body.loading .tabs, body.loading .bar { visibility: hidden; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; border-radius: 6px; }
img { max-width: 100%; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--surface); padding: .5rem 1rem; border-radius: 8px; }
.skip:focus { left: 8px; }
.icon { flex: none; vertical-align: -0.2em; }
.amber { color: var(--amber-text); } .accent { color: var(--accent); } .red { color: var(--red); } .blue { color: var(--blue); } .muted { color: var(--text-2); }
:root[data-theme="dark"] .blue { color: var(--accent); }
.strong { font-weight: 700; } .small { font-size: .88em; } .tiny { font-size: .78em; } .center { text-align: center; }
.selectable { user-select: text; -webkit-user-select: text; }
.clamp1, .clamp2, .clamp3 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.clamp1 { -webkit-line-clamp: 1; } .clamp2 { -webkit-line-clamp: 2; } .clamp3 { -webkit-line-clamp: 3; }

/* ---------------------------------------------------------------- coquille */
.shell { min-height: 100vh; min-height: 100dvh; }
.main-col { min-width: 0; padding-bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom) + 24px); }
.bar { position: sticky; top: 0; z-index: 20; height: calc(var(--bar-h) + env(safe-area-inset-top)); padding: env(safe-area-inset-top) max(8px, env(safe-area-inset-right)) 0 max(8px, env(safe-area-inset-left));
  display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 4px;
  background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px); border-bottom: 1px solid var(--line); }
.bar-title { margin: 0; text-align: center; font-weight: 700; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; grid-column: 2; }
.bar-actions { display: flex; gap: 2px; justify-content: flex-end; min-width: 48px; grid-column: 3; }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 12px; background: transparent; color: var(--accent); text-decoration: none; }
.icon-btn:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.back { grid-column: 1; }
.tabs { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-around; height: calc(var(--tabs-h) + env(safe-area-inset-bottom)); padding: 6px max(6px, env(safe-area-inset-left)) env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px); border-top: 1px solid var(--line); }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--text-2); text-decoration: none; font-size: .72rem; font-weight: 500; border-radius: 12px; max-width: 120px; }
.tab.active { color: var(--accent); }
.tab.active .icon { stroke-width: 2.2; }
.view { padding: 16px max(16px, env(safe-area-inset-left)) 24px; outline: none; }
.view.enter { animation: enter .28s ease-out; }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } }
.reading { max-width: var(--reading); margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.boot { min-height: 60vh; display: grid; place-items: center; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .9s linear infinite; margin: 24px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (min-width: 900px) {
  .shell { display: grid; grid-template-columns: 232px 1fr; }
  .tabs { position: sticky; top: 0; height: 100vh; flex-direction: column; justify-content: flex-start; gap: 4px; padding: 88px 14px 14px; border-top: 0; border-right: 1px solid var(--line); }
  .tab { flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; max-width: none; padding: 10px 14px; font-size: 1rem; }
  .tab.active { background: color-mix(in srgb, var(--accent) 12%, transparent); }
  .tabs::before { content: "DÉCODER LA HYPE"; position: absolute; top: 28px; left: 28px; font-weight: 700; letter-spacing: .08em; font-size: .9rem; color: var(--text); }
  :root[lang="en"] .tabs::before { content: "DECODING AI HYPE"; }
  .main-col { padding-bottom: 48px; }
  .view { padding: 28px 32px 48px; }
}

/* ---------------------------------------------------------------- typographie */
h1, h2, h3, h4 { line-height: 1.2; margin: 0; }
p { margin: 0; }
.display { font-size: clamp(1.7rem, 5vw, 2.4rem); font-weight: 700; letter-spacing: .03em; }
.page-title { font-size: 1.9rem; font-weight: 700; }
.title { font-size: 1.75rem; font-weight: 700; }
.h2 { font-size: 1.35rem; font-weight: 700; }
.h3 { font-size: 1.1rem; font-weight: 700; }
.kicker { font-size: .78rem; font-weight: 700; letter-spacing: .14em; color: var(--amber-text); text-transform: uppercase; }
.kicker-row { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: .85rem; }
.lead { font-size: 1.05em; }
.section-gap { margin-top: 8px; }

/* ---------------------------------------------------------------- éléments */
.card { background: var(--surface); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; }
.card.tight { padding: 14px; gap: 6px; }
.card-head { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.card-head h2 { margin-right: auto; }
.tint-amber { background: color-mix(in srgb, var(--amber) 14%, var(--surface)); }
.tint-blue { background: color-mix(in srgb, var(--blue) 10%, var(--surface)); }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: .8rem; font-weight: 700; }
.tag.amber { color: var(--amber-text); }
.progress { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width .4s; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 20px; border-radius: 14px; border: 0; font-weight: 700; text-decoration: none; text-align: center; transition: transform .1s, filter .15s; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--blue); color: #fff; }
:root[data-theme="dark"] .btn.primary { background: #3A55E8; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.secondary { background: var(--surface); color: var(--accent); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 40%, transparent); }
.btn.danger { background: var(--red); color: #fff; }
.btn.ghost { background: rgba(255, 255, 255, .14); color: #fff; }
.btn.wide { width: 100%; }
.btn small { display: block; font-weight: 400; font-size: .8em; opacity: .9; }
.btn span { display: flex; flex-direction: column; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.small-btn { min-height: 40px; padding: 6px 16px; align-self: flex-start; }
.danger-text { color: var(--red) !important; }
.link-btn { background: none; border: 0; color: var(--accent); font-weight: 700; padding: 6px 4px; display: inline-flex; gap: 4px; align-items: center; }
.pill { display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 99px; padding: 9px 16px; font-weight: 700; }
.pill.amber { background: var(--amber); color: var(--ink); }
.inline-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.inline-actions a { font-weight: 700; display: inline-flex; gap: 6px; align-items: center; }
.inline-actions.sep { border-top: 1px solid var(--line); padding-top: 10px; }
.stack { display: flex; flex-direction: column; gap: 10px; }

.row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--text); text-decoration: none; transition: transform .12s; }
.row:hover { transform: translateY(-1px); }
.row-icon { display: grid; place-items: center; width: 36px; flex: none; }
.row-icon.amber, .icon.amber, .tag.amber .icon, .amber > .icon { color: var(--amber); } .row-icon.accent { color: var(--accent); }
.row-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.row-title { font-weight: 700; }
.row-sub { color: var(--text-2); font-size: .9em; }
.row-sub.counts { display: flex; gap: 12px; font-size: .8em; }
.row-trail { color: var(--text-3); }
.row.dark { background: rgba(255, 255, 255, .08); color: #fff; box-shadow: none; }
.row.dark .row-sub { color: #C9CBE0; }

.group { display: flex; flex-direction: column; gap: 6px; }
.group-title { font-size: .8rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-2); margin: 8px 4px 2px; }
.group-title-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.group-body { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.group-foot { font-size: .85em; color: var(--text-2); margin: 2px 6px 0; }
.list-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 10px 16px; background: none; border: 0; border-top: 1px solid var(--line); color: var(--text); text-decoration: none; text-align: left; }
.group-body > :first-child { border-top: 0; }
a.list-row:hover, button.list-row:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.list-row.static { flex-wrap: wrap; justify-content: space-between; }
.list-row.danger { color: var(--red); }
.list-icon { color: var(--accent); display: grid; place-items: center; }
.list-label { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.list-label small { color: var(--text-2); font-size: .85em; }
.list-chev { color: var(--text-3); }
.list-row .num { font-variant-numeric: tabular-nums; }
.module-row { align-items: flex-start; }
.module-row .meta { color: var(--text-3); font-size: .78em; margin-top: 2px; display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.num-badge { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; background: var(--blue); color: #fff; font-weight: 700; }
.num-badge.done { background: var(--amber); color: var(--ink); }
.num-dot { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--amber); color: var(--ink); font-weight: 700; }

/* interrupteurs et listes déroulantes */
.toggle-row, .toggle-inline, .select-row { cursor: pointer; position: relative; }
.toggle-inline { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0; }
.toggle-inline > span:first-child { display: inline-flex; gap: 6px; align-items: center; }
.toggle-row input, .toggle-inline input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch { flex: none; width: 51px; height: 31px; border-radius: 16px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); position: relative; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .25); transition: transform .2s; }
input:checked + .switch { background: var(--blue); }
input:checked + .switch::after { transform: translateX(20px); }
input:focus-visible + .switch { outline: 3px solid var(--amber); outline-offset: 2px; }
.select-row select, .field select { max-width: 55%; padding: 8px 32px 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237A7E96' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center; appearance: none; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-weight: 700; font-size: .9em; }
.field input, .field textarea, .field select, dialog textarea { width: 100%; max-width: none; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.field.search { flex-direction: row; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding-left: 12px; color: var(--text-3); }
.field.search input { border: 0; background: transparent; }
textarea { resize: vertical; }

.empty { text-align: center; color: var(--text-2); padding: 28px 16px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.empty-title { font-weight: 700; color: var(--text); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 6px 12px; font-size: .82rem; font-weight: 500; }
.chip.on { background: var(--blue); color: #fff; border-color: var(--blue); font-weight: 700; }

/* ---------------------------------------------------------------- accueil */
.hero { display: flex; flex-direction: column; gap: 10px; padding-top: 4px; }
.bar-accent { width: 40px; height: 3px; background: var(--blue); }
.hero-tag { font-size: 1.15rem; color: var(--text-2); }
.continue { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px; border-radius: var(--radius); background: var(--amber); color: var(--ink); text-decoration: none; box-shadow: var(--shadow); }
.continue > span { display: flex; flex-direction: column; }
.continue strong { font-size: 1.1rem; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 16px; border: 0; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); text-align: left; }
.tile span { color: var(--text-2); font-size: .85em; }
.about { display: flex; gap: 12px; align-items: center; padding: 8px 6px; }
.about div { display: flex; flex-direction: column; }

/* logo animé */
.logo .logo-tile.dim { opacity: .5; }
.logo.animated .logo-sphere { animation: sphere .5s ease-out both; transform-origin: 50px 50px; }
.logo.animated .logo-tile { animation: tile .55s cubic-bezier(.3, 1.4, .5, 1) both; animation-delay: calc(.35s + var(--i) * .07s); transform-box: fill-box; transform-origin: center; }
.logo.animated .logo-tile.dim { animation: tile .55s cubic-bezier(.3, 1.4, .5, 1) both, dim .6s 1.75s forwards; opacity: 1; }
.logo.animated .logo-halo { animation: halo .6s 1.75s both; transform-origin: 50px 50px; }
@keyframes sphere { from { opacity: 0; transform: scale(.2); } }
@keyframes tile { from { opacity: 0; transform: scale(.4) rotate(-40deg); } }
@keyframes dim { to { opacity: .5; } }
@keyframes halo { from { opacity: 0; transform: scale(.6); } }

/* ---------------------------------------------------------------- module */
.module-head { display: flex; flex-direction: column; gap: 8px; }
.thread { background: color-mix(in srgb, var(--blue) 9%, var(--surface)); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.thread-label { color: var(--accent); font-weight: 700; display: flex; gap: 6px; align-items: center; }
.thread-q { display: flex; gap: 8px; color: var(--text); }
.thread-q .icon { color: var(--accent); margin-top: 3px; }
.hint-note { margin-top: -4px; }
.content { display: flex; flex-direction: column; gap: 16px; }
.content p, .content li { hyphens: auto; -webkit-hyphens: auto; }
[data-note] { -webkit-touch-callout: none; border-radius: 6px; transition: background .2s; }
[data-note]:hover { background: color-mix(in srgb, var(--amber) 7%, transparent); }
.c-h2 { font-size: 1.4rem; margin-top: 10px; } .c-h3 { font-size: 1.2rem; margin-top: 4px; } .c-h4 { font-size: 1.05rem; }
.c-list { margin: 0; padding-left: 1.3em; display: flex; flex-direction: column; gap: 6px; }
.c-quote { margin: 0; padding-left: 14px; border-left: 3px solid var(--text-3); color: var(--text-2); }
.citation { margin: 0; padding: 16px 18px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.citation blockquote { margin: 0; font-style: italic; font-size: 1.05em; }
.citation figcaption { margin-top: 8px; color: var(--amber-text); font-weight: 700; font-size: .9em; }
.citation figcaption::before { content: "— "; }
.c-note { position: relative; padding: 16px 16px 16px 20px; border-radius: var(--radius); background: color-mix(in srgb, var(--accent) 8%, var(--bg)); display: flex; flex-direction: column; gap: 8px; }
.c-note::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--accent); border-radius: var(--radius) 0 0 var(--radius); }
.hint { font-size: .85em; color: var(--text-2); display: flex; gap: 6px; align-items: center; margin-bottom: 8px; }
.flip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.flip { border: 0; padding: 0; background: none; perspective: 1000px; min-height: 180px; text-align: left; }
.flip-inner { position: relative; display: grid; width: 100%; height: 100%; min-height: 180px; transition: transform .5s; transform-style: preserve-3d; }
.flip-front, .flip-back { grid-area: 1 / 1; display: flex; align-items: center; padding: 16px; border-radius: var(--radius); backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.flip-front { background: var(--blue); color: #fff; font-weight: 700; font-size: 1.1em; justify-content: center; text-align: center; }
.flip-back { background: var(--surface); box-shadow: var(--shadow); transform: rotateY(180deg); font-size: .92em; }
.flip.flipped .flip-inner { transform: rotateY(180deg); }
.c-accordion { display: flex; flex-direction: column; gap: 8px; }
details { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
summary { list-style: none; cursor: pointer; padding: 14px 16px; font-weight: 700; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
summary::-webkit-details-marker { display: none; }
summary .icon { transition: transform .2s; color: var(--text-3); }
details[open] summary .icon { transform: rotate(180deg); }
details > :not(summary) { padding: 0 16px 14px; }
.sources ul { margin: 0; padding-left: 1.2em; font-size: .88em; color: var(--text-2); display: flex; flex-direction: column; gap: 4px; }
.c-table { display: flex; flex-direction: column; gap: 10px; }
.table-cap { font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); }
.table-group { color: var(--accent); margin-top: 6px; }
.table-key { font-weight: 700; }
.table-cell { display: flex; flex-direction: column; font-size: .92em; }
.table-label { font-size: .8em; font-weight: 700; color: var(--text-2); }
.video-card { flex-direction: row; align-items: center; gap: 14px; text-decoration: none; color: var(--text); }
.video-card span { display: flex; flex-direction: column; flex: 1; }
.video-card small { color: var(--text-2); }
.keypoints { background: color-mix(in srgb, var(--amber) 13%, var(--surface)); border-radius: var(--radius); padding: 16px; }
.keypoints h2 { color: var(--accent); display: flex; gap: 6px; align-items: center; margin-bottom: 8px; }
.keypoints ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.keypoints li { position: relative; padding-left: 16px; }
.keypoints li::before { content: ""; position: absolute; left: 0; top: .6em; width: 6px; height: 6px; border-radius: 50%; background: var(--amber); }
.module-foot { display: flex; flex-direction: column; gap: 12px; border-top: 1px solid var(--line); padding-top: 18px; }
.prev-link { display: inline-flex; gap: 6px; align-items: center; padding: 6px 0; }

/* exercice de tri */
.sort-head { display: flex; align-items: center; gap: 8px; }
.sort-head .count { margin-left: auto; font-weight: 700; color: var(--text-2); font-variant-numeric: tabular-nums; }
.sort-stack { position: relative; padding-bottom: 10px; }
.sort-stack::before, .sort-stack::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 4px; height: 20px; border-radius: 12px; background: var(--surface-2); }
.sort-stack::after { left: 24px; right: 24px; bottom: 0; opacity: .6; }
.sort-card { position: relative; z-index: 1; padding: 18px; border-radius: 12px; background: var(--bg); box-shadow: var(--shadow); font-weight: 500; min-height: 70px; display: flex; align-items: center; }
.sort-card.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.sort-cats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; }
.sort-cat { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); text-align: left; font-weight: 500; }
.sort-cat .count { font-weight: 700; color: var(--text-3); }
.sort-cat:hover:not([disabled]) { border-color: var(--accent); }
.sort-cat.wrong { border-color: var(--red); }
.sort-cat.reveal { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.sort-done { display: flex; gap: 12px; align-items: center; }
.sort-review { box-shadow: none; background: var(--bg); }
.ok { color: var(--accent); } .fix { color: var(--amber); }

/* ---------------------------------------------------------------- quiz et test */
.question { display: flex; flex-direction: column; gap: 14px; }
.q-title { font-size: 1.25rem; }
.choices { display: flex; flex-direction: column; gap: 10px; }
.choice { display: flex; align-items: flex-start; gap: 12px; padding: 14px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); border: 1.5px solid transparent; text-align: left; cursor: pointer; }
.choice .icon { color: var(--text-3); margin-top: 1px; }
.choice:hover:not([disabled]) { border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.choice.chosen { border-color: var(--accent); background: color-mix(in srgb, var(--blue) 9%, var(--surface)); }
.choice.chosen .icon, .choice.right .icon { color: var(--accent); }
.choice.right { border-color: var(--accent); background: color-mix(in srgb, var(--blue) 10%, var(--surface)); }
.choice.wrong { border-color: var(--amber); background: color-mix(in srgb, var(--amber) 12%, var(--surface)); }
.choice.wrong .icon { color: var(--amber); }
.choice[disabled] { cursor: default; color: inherit; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice:focus-within { outline: 3px solid var(--amber); outline-offset: 2px; }
.explain { background: var(--surface); border-radius: 14px; padding: 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px; animation: enter .25s; }
.explain-title { font-weight: 700; display: flex; gap: 6px; align-items: center; }
.result { gap: 14px; }
.score { font-size: 3.4rem; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; line-height: 1; }
.score.amber { color: var(--amber-text); }
.intro-card { gap: 14px; }

/* ---------------------------------------------------------------- Boussole */
.page-head { display: flex; gap: 14px; align-items: center; }
.cq { border: 0; margin: 0; }
.cq-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; width: 100%; font-weight: 700; padding: 0; float: left; }
.cq-title + * { clear: both; }
.cq .choices { clear: both; padding-top: 6px; }
.cq .choice { box-shadow: none; background: var(--bg); padding: 12px; position: relative; }
.cq-help { clear: both; padding-top: 6px; }
.step-nav { display: flex; justify-content: space-between; gap: 12px; }
.report { display: flex; flex-direction: column; gap: 14px; }
.report-head { display: flex; gap: 12px; align-items: center; }
.report-counts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.report-counts div { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .8em; }
.report-counts strong { font-size: 1.5rem; color: var(--text); }
.report-counts .muted strong { color: inherit; }
.finding { border-radius: 14px; padding: 14px; border: 1.5px solid currentColor; display: flex; flex-direction: column; gap: 6px; }
.finding > *:not(.finding-status) { color: var(--text); }
.finding .muted { color: var(--text-2) !important; } .finding .accent { color: var(--accent) !important; }
.finding.red { border-color: color-mix(in srgb, var(--red) 60%, transparent); }
.finding.amber { border-color: color-mix(in srgb, var(--amber) 70%, transparent); }
.finding.blue { border-color: color-mix(in srgb, var(--blue) 60%, transparent); }
.finding-status { font-size: .8em; font-weight: 700; display: flex; gap: 6px; align-items: center; }
.report-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }

/* ---------------------------------------------------------------- carnet et outils */
.note-card p { white-space: normal; }
.note-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: .8em; color: var(--text-2); }
.note-meta .icon-btn { margin-left: auto; width: 36px; height: 36px; color: var(--text-3); }
.promise { text-align: left; border: 0; color: var(--text); }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { background: var(--surface); box-shadow: var(--shadow); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; }
.stat strong { font-size: 1.5rem; color: var(--accent); font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat span { font-size: .82em; color: var(--text-2); }
.gauge-row { display: flex; gap: 16px; align-items: center; }
.gauge { flex: none; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(from -135deg, var(--accent) var(--deg), var(--surface-2) 0 270deg, transparent 0); position: relative; font-weight: 700; font-size: 1.2rem; }
.gauge::before { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: var(--surface); }
.gauge span { position: relative; }
.badge-canvas { width: 100%; height: auto; border-radius: 12px; aspect-ratio: 1; background: var(--ink); }
.bars { gap: 6px; }
.bar-row { display: grid; grid-template-columns: 22px 1fr 96px; gap: 10px; align-items: center; }
.bar-row .small { text-align: right; }
.meter { height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--blue); }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; }
.arg { display: flex; gap: 12px; align-items: flex-start; padding: 4px 0; }
.supporter { justify-content: flex-start; gap: 12px; }
.logo-box { width: 44px; height: 44px; border-radius: 10px; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; font-weight: 700; color: rgba(0, 0, 0, .55); overflow: hidden; }
.logo-box img { max-width: 100%; max-height: 100%; padding: 4px; object-fit: contain; }
.bib { flex-direction: column; align-items: flex-start; gap: 2px; justify-content: flex-start; }
.bib a { text-decoration: none; }
.plain-list { margin: 0; padding-left: 1.1em; display: flex; flex-direction: column; gap: 4px; }
.prose .card p + p { margin-top: 2px; }

/* auteur */
.author-head { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.portrait { border: 0; padding: 0; background: none; border-radius: 50%; overflow: hidden; width: 168px; height: 168px; box-shadow: var(--shadow); }
.portrait img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bio { gap: 12px; }
.names { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 4px; }
.names a, .names span { font-weight: 500; }
.easter { position: fixed; inset: 0; z-index: 90; background: #000; color: #fff; overflow: auto; animation: fade .6s; }
.easter-inner { max-width: 640px; margin: 0 auto; padding: 32px 20px 48px; display: flex; flex-direction: column; gap: 18px; }
.easter img { border-radius: 16px; }
.easter blockquote { margin: 0; font-size: 1.2rem; font-style: italic; }
.easter a { color: var(--amber); }
.easter.out, .onboarding.out, .intro.out, .celebration.out { opacity: 0; transition: opacity .3s; }
@keyframes fade { from { opacity: 0; } }

/* ---------------------------------------------------------------- fenêtres */
dialog.sheet { border: 0; padding: 0; width: min(640px, 100vw); max-height: 92vh; border-radius: 20px; background: var(--bg); color: var(--text); box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
dialog.sheet::backdrop { background: rgba(12, 16, 51, .45); backdrop-filter: blur(2px); }
@media (max-width: 640px) { dialog.sheet { margin: auto 0 0; width: 100vw; max-width: 100vw; border-radius: 20px 20px 0 0; padding-bottom: env(safe-area-inset-bottom); } }
.sheet-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px 6px 20px; }
.sheet-body { padding: 8px 20px 20px; overflow: auto; }
.sheet-body form, .form { display: flex; flex-direction: column; gap: 12px; }
.form fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.sheet-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 8px; }
dialog.confirm form { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.confirm-text { font-weight: 700; font-size: 1.05rem; }

.note-menu { position: fixed; z-index: 80; display: flex; gap: 2px; padding: 4px; border-radius: 12px; background: var(--ink); color: #fff; box-shadow: 0 8px 24px rgba(0, 0, 0, .3); animation: enter .15s; }
.note-menu button { display: inline-flex; gap: 6px; align-items: center; border: 0; background: transparent; color: #fff; padding: 8px 12px; border-radius: 9px; font-weight: 500; white-space: nowrap; }
.note-menu button:hover, .note-menu button:focus-visible { background: rgba(255, 255, 255, .14); }
#toast { position: fixed; z-index: 95; left: 50%; bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom) + 16px); transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 12px; box-shadow: 0 8px 24px rgba(0, 0, 0, .3); opacity: 0; pointer-events: none; transition: .25s; max-width: calc(100vw - 32px); text-align: center; }
:root[data-theme="dark"] #toast { background: #fff; color: var(--ink); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 900px) { #toast { bottom: 24px; } }

/* célébration */
.celebration { position: fixed; inset: 0; z-index: 85; display: grid; place-items: center; background: rgba(12, 16, 51, .55); animation: fade .3s; padding: 20px; }
.celebration-card { position: relative; z-index: 2; background: var(--surface); color: var(--text); border-radius: 22px; padding: 28px; max-width: 420px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); animation: pop .45s cubic-bezier(.3, 1.4, .5, 1); }
.celebration-card .icon { color: var(--amber); }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }
.confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.confetti i { position: absolute; top: -20px; width: 8px; height: 14px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(var(--r)); } }

/* premier lancement et générique */
.onboarding { position: fixed; inset: 0; z-index: 70; background: var(--ink); color: #fff; overflow: auto; display: grid; place-items: center; padding: max(20px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom)); }
.ob-card { width: 100%; max-width: 560px; display: flex; flex-direction: column; gap: 14px; }
.ob-lang { align-items: flex-start; }
.ob-lang h1 { font-size: clamp(1.7rem, 6vw, 2.3rem); letter-spacing: .04em; }
.ob-en { font-size: 1.2rem; font-weight: 500; letter-spacing: .06em; color: #C9CBE0; }
.ob-tag, .ob-small { color: #C9CBE0; }
.ob-small { font-size: .8rem; }
.ob-buttons { display: flex; gap: 12px; width: 100%; }
.ob-buttons .btn { flex: 1; }
.ob-top { display: flex; justify-content: space-between; align-items: center; }
.ob-top .link-btn { color: var(--amber); }
.onboarding .kicker, .easter .kicker { color: var(--amber); }
.ob-illu { width: 120px; height: 120px; border-radius: 28px; display: grid; place-items: center; background: rgba(255, 255, 255, .08); color: var(--amber); margin: 8px 0; }
.ob-tour h1 { font-size: 1.6rem; }
.ob-tour p:not(.kicker) { color: #DADCEB; }
.dots { display: flex; gap: 8px; justify-content: center; margin: 6px 0; }
.dots span { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, .3); }
.dots span.on { background: var(--amber); width: 22px; border-radius: 4px; }
.intro { position: fixed; inset: 0; z-index: 95; background: #0C1033; }
.intro video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #0C1033; }
/* Écran en hauteur (téléphone) : la vidéo verticale remplit l'écran, comme dans l'app iOS. */
@media (max-aspect-ratio: 3/4) { .intro video { object-fit: cover; } }
.intro-logo { position: absolute; inset: 0; display: grid; place-items: center; }
.intro-actions { position: absolute; top: max(16px, env(safe-area-inset-top)); right: 16px; display: flex; gap: 8px; }
.intro-actions .btn { min-height: 40px; background: rgba(255, 255, 255, .14); color: #fff; border-color: rgba(255, 255, 255, .35); backdrop-filter: blur(6px); }

/* ---------------------------------------------------------------- animations réduites */
:root.reduce-motion *, :root.reduce-motion *::before, :root.reduce-motion *::after { animation-duration: .001s !important; animation-delay: 0s !important; transition-duration: .001s !important; }
:root.reduce-motion .confetti { display: none; }

/* ---------------------------------------------------------------- impression (rapport Boussole en PDF) */
@media print {
  @page { size: A4; margin: 14mm; }
  :root, :root[data-theme="dark"] { --bg: #fff; --surface: #fff; --text: #0C1033; --text-2: #4A4E6B; --accent: #2340D4; --line: #ccc; --shadow: none; color-scheme: light; }
  body { background: #fff; font-size: 11pt; }
  .tabs, .bar, .no-print, #toast, .skip { display: none !important; }
  .main-col, .view { padding: 0 !important; }
  .shell { display: block; }
  .reading { max-width: none; }
  .finding, .card { break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
}

/* ---------------------------------------------------------------- rappel de sauvegarde (Carnet) */
.backup-reminder { border: 1.5px solid var(--amber, #F2A900); display: flex; flex-direction: column; gap: 8px; }
.backup-reminder p { margin: 0; }
.backup-reminder strong { display: inline-flex; align-items: center; gap: 6px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }

/* ---------------------------------------------------------------- déménagement vers decoderlahype.fr */
.move-banner { position: sticky; top: 0; z-index: 60; margin: 0; padding: 14px max(16px, env(safe-area-inset-left)) 14px; background: var(--surface);
  border-bottom: 2px solid var(--amber, #F2A900); box-shadow: 0 6px 18px rgba(12, 16, 51, .12); display: flex; flex-direction: column; gap: 6px; }
.move-banner p { margin: 0; max-width: 720px; }
.move-banner strong { display: inline-flex; align-items: center; gap: 6px; }
.move-banner .move-status:empty { display: none; }
